:root {
    --primary: #4f46e5;
    --primary-dark: #4338ca;
    --primary-light: #818cf8;
    --secondary: #06b6d4;
    --accent: #8b5cf6;
    --bg-dark: #0f172a;
    --bg-darker: #020617;
    --text-light: #f8fafc;
    --text-muted: #94a3b8;
    --glass-bg: rgba(30, 41, 59, 0.7);
    --glass-border: rgba(255, 255, 255, 0.1);
    --sidebar-width: 260px;
    --transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    font-family: 'Outfit', sans-serif;
}

body {
    background-color: var(--bg-darker);
    color: var(--text-light);
    height: 100vh;
    overflow: hidden;
}

.dashboard-container {
    display: flex;
    height: 100vh;
}

/* Sidebar */
.sidebar {
    width: var(--sidebar-width);
    background: var(--bg-dark);
    border-right: 1px solid var(--glass-border);
    display: flex;
    flex-direction: column;
    padding: 2rem 1.5rem;
    z-index: 100;
}

.sidebar-logo {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    font-size: 1.5rem;
    font-weight: 700;
    margin-bottom: 3rem;
}

.logo-icon {
    background: linear-gradient(135deg, var(--primary), var(--secondary));
    width: 36px;
    height: 36px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 10px;
    color: white;
    font-size: 1.2rem;
}

.logo-text span {
    color: var(--primary-light);
}

.sidebar-nav ul {
    list-style: none;
}

.sidebar-nav li {
    margin-bottom: 0.5rem;
}

.sidebar-nav a {
    display: flex;
    align-items: center;
    gap: 1rem;
    color: var(--text-muted);
    text-decoration: none;
    padding: 0.8rem 1rem;
    border-radius: 12px;
    transition: var(--transition);
    font-weight: 500;
}

.sidebar-nav li.active a,
.sidebar-nav a:hover {
    background: rgba(79, 70, 229, 0.1);
    color: var(--primary-light);
}

.sidebar-nav a i {
    width: 20px;
}

.sidebar-footer {
    margin-top: auto;
    padding-top: 2rem;
    border-top: 1px solid var(--glass-border);
}

.user-profile {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    margin-bottom: 1.5rem;
}

.user-avatar {
    width: 40px;
    height: 40px;
    background: var(--accent);
    border-radius: 10px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 700;
}

.user-info {
    display: flex;
    flex-direction: column;
}

.user-name {
    font-size: 0.9rem;
    font-weight: 600;
}

.user-role {
    font-size: 0.75rem;
    color: var(--text-muted);
}

.logout-btn {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    color: #ef4444;
    text-decoration: none;
    font-size: 0.9rem;
    font-weight: 600;
    transition: var(--transition);
}

.logout-btn:hover {
    opacity: 0.8;
}

/* Main Content */
.main-content {
    flex: 1;
    display: flex;
    flex-direction: column;
    overflow-y: auto;
    background: radial-gradient(circle at top right, rgba(79, 70, 229, 0.05), transparent 40%);
}

.main-header {
    height: 80px;
    padding: 0 2rem;
    display: flex;
    align-items: center;
    justify-content: space-between;
    background: rgba(15, 23, 42, 0.5);
    backdrop-filter: blur(10px);
    border-bottom: 1px solid var(--glass-border);
    position: sticky;
    top: 0;
    z-index: 90;
}

.header-search {
    display: flex;
    align-items: center;
    gap: 1rem;
    background: var(--bg-dark);
    padding: 0.6rem 1.25rem;
    border-radius: 100px;
    width: 400px;
    border: 1px solid var(--glass-border);
}

.header-search input {
    background: transparent;
    border: none;
    color: var(--text-light);
    width: 100%;
    outline: none;
}

.header-actions {
    display: flex;
    align-items: center;
    gap: 1.5rem;
}

.icon-btn {
    position: relative;
    background: transparent;
    border: none;
    color: var(--text-muted);
    cursor: pointer;
    font-size: 1.2rem;
    transition: var(--transition);
}

.icon-btn:hover {
    color: var(--text-light);
}

.icon-btn .badge {
    position: absolute;
    top: -2px;
    right: -2px;
    width: 8px;
    height: 8px;
    background: #ef4444;
    border-radius: 50%;
}

.date-picker {
    background: var(--glass-bg);
    padding: 0.5rem 1rem;
    border-radius: 8px;
    font-size: 0.85rem;
    font-weight: 600;
    border: 1px solid var(--glass-border);
}

.content-wrapper {
    padding: 2rem;
}

/* Stats Cards */
.stats-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 1.5rem;
    margin-bottom: 2rem;
}

.stat-card {
    background: var(--glass-bg);
    border: 1px solid var(--glass-border);
    padding: 1.5rem;
    border-radius: 20px;
    display: flex;
    align-items: center;
    gap: 1.25rem;
    transition: var(--transition);
}

.stat-card:hover {
    border-color: var(--primary-light);
    transform: translateY(-5px);
}

.stat-icon {
    width: 48px;
    height: 48px;
    border-radius: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.25rem;
}

.stat-icon.calls {
    background: rgba(79, 70, 229, 0.1);
    color: var(--primary-light);
}

.stat-icon.success {
    background: rgba(34, 197, 94, 0.1);
    color: #22c55e;
}

.stat-icon.duration {
    background: rgba(6, 182, 212, 0.1);
    color: var(--secondary);
}

.stat-icon.agents {
    background: rgba(139, 92, 246, 0.1);
    color: var(--accent);
}

.stat-data h3 {
    font-size: 0.8rem;
    color: var(--text-muted);
    font-weight: 500;
    margin-bottom: 0.25rem;
}

.stat-data .value {
    font-size: 1.5rem;
    font-weight: 700;
    margin-bottom: 0.25rem;
}

.trend {
    font-size: 0.75rem;
    display: flex;
    align-items: center;
    gap: 0.25rem;
}

.trend.positive {
    color: #22c55e;
}

.trend.negative {
    color: #ef4444;
}

.trend.steady {
    color: var(--text-muted);
}

/* Dashboard Grid Layer */
.dashboard-grid {
    display: grid;
    grid-template-columns: 1fr;
    gap: 1.5rem;
}

.glass-section {
    background: var(--glass-bg);
    border: 1px solid var(--glass-border);
    border-radius: 24px;
    padding: 1.5rem;
    backdrop-filter: blur(10px);
}

.chart-container,
.calls-container {
    grid-column: 1;
}

.section-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 1.5rem;
}

.section-header h2 {
    font-size: 1.1rem;
    font-weight: 600;
}

.chart-filters {
    display: flex;
    gap: 0.5rem;
}

.chart-filters button {
    background: transparent;
    border: 1px solid var(--glass-border);
    color: var(--text-muted);
    padding: 0.25rem 0.75rem;
    border-radius: 6px;
    font-size: 0.75rem;
    cursor: pointer;
    transition: var(--transition);
}

.chart-filters button.active {
    background: var(--primary);
    border-color: var(--primary);
    color: white;
}

/* Table */
.calls-container {
    grid-column: span 1;
}

.view-all {
    font-size: 0.8rem;
    color: var(--primary-light);
    text-decoration: none;
}

.calls-table-wrapper {
    overflow-x: auto;
}

.dashboard-table {
    width: 100%;
    border-collapse: collapse;
}

.dashboard-table th {
    text-align: left;
    font-size: 0.75rem;
    color: var(--text-muted);
    padding: 1rem;
    border-bottom: 1px solid var(--glass-border);
}

.dashboard-table td {
    padding: 1rem;
    border-bottom: 1px solid var(--glass-border);
    font-size: 0.85rem;
}

.caller-info {
    display: flex;
    flex-direction: column;
}

.caller-name {
    font-weight: 600;
}

.caller-number {
    font-size: 0.75rem;
    color: var(--text-muted);
}

.status-tag {
    padding: 0.25rem 0.75rem;
    border-radius: 100px;
    font-size: 0.7rem;
    font-weight: 600;
}

.status-tag.completed {
    background: rgba(34, 197, 94, 0.1);
    color: #22c55e;
}

.status-tag.ringing {
    background: rgba(234, 179, 8, 0.1);
    color: #eab308;
    animation: pulse 2s infinite;
}

.status-tag.missed {
    background: rgba(239, 68, 68, 0.1);
    color: #ef4444;
}

@keyframes pulse {

    0%,
    100% {
        opacity: 1;
    }

    50% {
        opacity: 0.6;
    }
}

.action-btn {
    background: transparent;
    border: none;
    color: var(--text-muted);
    cursor: pointer;
    transition: var(--transition);
}

.action-btn.active-call {
    background: var(--primary);
    color: white;
    width: 32px;
    height: 32px;
    border-radius: 50%;
}

/* CRM Widget */
.crm-container {
    grid-column: 2;
    grid-row: 1 / 3;
}

.customers-list {
    display: flex;
    flex-direction: column;
    gap: 1.25rem;
    margin-bottom: 2rem;
}

.customer-item {
    display: flex;
    align-items: center;
    gap: 1rem;
    padding: 0.75rem;
    border-radius: 16px;
    transition: var(--transition);
    cursor: pointer;
}

.customer-item:hover {
    background: rgba(255, 255, 255, 0.05);
}

.customer-avatar {
    width: 40px;
    height: 40px;
    background: var(--primary);
    border-radius: 10px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 700;
    font-size: 0.8rem;
}

.customer-avatar.violet {
    background: var(--accent);
}

.customer-avatar.cyan {
    background: var(--secondary);
}

.customer-details {
    flex: 1;
    display: flex;
    flex-direction: column;
}

.customer-name {
    font-size: 0.9rem;
    font-weight: 600;
}

.customer-meta {
    font-size: 0.7rem;
    color: var(--text-muted);
}

.customer-status {
    width: 8px;
    height: 8px;
    border-radius: 50%;
}

.customer-status.online {
    background: #22c55e;
}

.customer-status.busy {
    background: #eab308;
}

/* Buttons */
.btn-primary {
    background: linear-gradient(135deg, var(--primary), var(--accent));
    color: white;
    border: none;
    padding: 0.6rem 1.25rem;
    border-radius: 10px;
    font-weight: 600;
    cursor: pointer;
    transition: var(--transition);
    display: flex;
    align-items: center;
    gap: 0.5rem;
    box-shadow: 0 4px 15px -5px rgba(79, 70, 229, 0.4);
}

.btn-primary:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 20px -5px rgba(79, 70, 229, 0.6);
    filter: brightness(1.1);
}

.btn-primary i {
    width: 16px;
}

.btn-full-width {
    width: 100%;
    background: var(--glass-border);
    border: 1px solid var(--glass-border);
    color: var(--text-light);
    padding: 0.75rem;
    border-radius: 12px;
    font-weight: 600;
    cursor: pointer;
    transition: var(--transition);
}

.btn-full-width:hover {
    background: var(--primary);
    border-color: var(--primary);
}

/* Active Users Footer Section */
.active-users-footer-section {
    margin-top: 2rem;
    padding: 1.5rem;
}

.active-users-horizontal-list {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 1.5rem;
    margin-top: 1rem;
}

.user-pill {
    display: flex;
    align-items: center;
    gap: 1rem;
    padding: 1rem 1.2rem;
    background: rgba(255, 255, 255, 0.02);
    border: 1px solid var(--glass-border);
    border-radius: 16px;
    transition: all 0.4s cubic-bezier(0.4, 0, 0.2, 1);
    position: relative;
    cursor: pointer;
}

.user-pill:hover {
    background: rgba(255, 255, 255, 0.05);
    transform: translateY(-4px);
    border-color: var(--primary-light);
    box-shadow: 0 10px 20px -10px rgba(0, 0, 0, 0.5);
}

.user-pill .customer-status.online {
    background: #22c55e;
    box-shadow: 0 0 10px #22c55e;
}

.user-pill .customer-avatar {
    width: 40px;
    height: 40px;
    font-size: 0.9rem;
}

.user-details-mini {
    display: flex;
    flex-direction: column;
}

.user-details-mini .name {
    font-size: 0.9rem;
    font-weight: 600;
}

.user-details-mini .role {
    font-size: 0.75rem;
    color: var(--text-muted);
}

.user-pill .customer-status {
    position: absolute;
    top: 0.8rem;
    right: 0.8rem;
}

/* Dashboard Footer */
.dashboard-footer {
    padding: 1.5rem 2rem;
    background: rgba(15, 23, 42, 0.8);
    backdrop-filter: blur(10px);
    border-top: 1px solid var(--glass-border);
    margin-top: auto;
}

.footer-content {
    display: flex;
    justify-content: space-between;
    align-items: center;
    color: var(--text-muted);
    font-size: 0.8rem;
}

.footer-meta {
    display: flex;
    align-items: center;
    gap: 1.5rem;
}

.status-indicator {
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.status-indicator .dot {
    width: 6px;
    height: 6px;
    background: #22c55e;
    border-radius: 50%;
    box-shadow: 0 0 10px #22c55e;
}

/* Animations */
@keyframes fadeIn {
    from {
        opacity: 0;
        transform: translateY(10px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.content-wrapper>* {
    animation: fadeIn 0.5s ease forwards;
}

/* Pagination */
.pagination {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-top: 1.5rem;
    padding-top: 1rem;
    border-top: 1px solid var(--glass-border);
}

.page-info {
    font-size: 0.8rem;
    color: var(--text-muted);
}

.page-btns {
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.page-btn {
    width: 32px;
    height: 32px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: transparent;
    border: 1px solid var(--glass-border);
    color: var(--text-muted);
    border-radius: 8px;
    cursor: pointer;
    font-size: 0.8rem;
    transition: var(--transition);
}

.page-btn:hover:not(:disabled) {
    border-color: var(--primary-light);
    color: var(--text-light);
}

.page-btn.active {
    background: var(--primary);
    border-color: var(--primary);
    color: white;
}

.page-btn:disabled {
    opacity: 0.3;
    cursor: not-allowed;
}

.page-btn i {
    width: 16px;
}

.pager-dots {
    color: var(--text-muted);
}

/* Responsive Adjustments */
@media (max-width: 1280px) {
    .dashboard-grid {
        grid-template-columns: 1fr;
    }

    .crm-container {
        grid-column: 1;
        grid-row: auto;
    }

    .stats-grid {
        grid-template-columns: repeat(2, 1fr);
    }
}

@media (max-width: 992px) {
    .sidebar {
        width: 80px;
        padding: 2rem 0.5rem;
    }

    .sidebar .logo-text,
    .sidebar .user-info,
    .sidebar-nav a span,
    .sidebar-nav a {
        justify-content: center;
    }

    .sidebar .logo-text,
    .sidebar .user-info,
    .sidebar-nav span {
        display: none;
    }

    .sidebar-nav a {
        padding: 1rem;
    }

    .sidebar-nav a i {
        margin: 0;
    }

    :root {
        --sidebar-width: 80px;
    }
}

@media (max-width: 768px) {
    .stats-grid {
        grid-template-columns: 1fr;
    }

    .header-search {
        display: none;
    }

    .main-header {
        padding: 0 1rem;
    }

    .content-wrapper {
        padding: 1rem;
    }

    .pagination {
        flex-direction: column;
        gap: 1rem;
        text-align: center;
    }
}

/* Chart Height fixed to 3 inches but responsive in width */
.chart-container {
    height: 3in;
    /* Fixed height as requested */
    min-height: auto;
    display: flex;
    flex-direction: column;
    overflow: hidden;
}

.chart-container canvas {
    flex: 1;
    width: 100% !important;
    max-height: 100%;
}