* {
    box-sizing:border-box;
}

:root {
    --bg:#f4f6f9;
    --panel:#ffffff;
    --sidebar:#001c3a;
    --sidebar2:#082c49;
    --text:#172033;
    --muted:#697386;
    --border:#e6e9ef;
    --accent:#008b98;
    --green:#16a34a;
}

html,
body {
    margin:0;
    padding:0;
    min-height:100%;
    font-family:
        Inter,
        -apple-system,
        BlinkMacSystemFont,
        "Segoe UI",
        Arial,
        sans-serif;
    background:var(--bg);
    color:var(--text);
}

body {
    min-height:100vh;
}

.app {
    min-height:100vh;
    display:flex;
}

.sidebar {
    width:250px;
    min-width:250px;
    background:var(--sidebar);
    color:white;
    min-height:100vh;
    overflow-y:auto;
}

.brand {
    height:78px;
    padding:16px 18px;
    display:flex;
    align-items:center;
    gap:12px;
    border-bottom:1px solid rgba(255,255,255,.07);
}

.brand-logo {
    width:42px;
    height:42px;
    border-radius:10px;
    background:var(--accent);
    display:flex;
    align-items:center;
    justify-content:center;
    font-weight:800;
    font-size:16px;
}

.brand-name {
    font-weight:750;
    font-size:18px;
}

.brand-sub {
    color:#9aa4b2;
    font-size:11px;
    margin-top:2px;
}

.menu {
    padding:14px 10px 25px;
}

.menu-section {
    padding:14px 10px 7px;
    color:#778294;
    font-size:10px;
    font-weight:700;
    letter-spacing:.08em;
}

.menu-item {
    display:flex;
    align-items:center;
    gap:12px;
    padding:10px 12px;
    margin:2px 0;
    color:#c8d0dc;
    text-decoration:none;
    border-radius:8px;
    font-size:13px;
    cursor:pointer;
    transition:.15s;
}

.menu-item:hover {
    background:var(--sidebar2);
    color:white;
}

.menu-item.active {
    background:#007582;
    color:white;
}

.icon {
    width:20px;
    text-align:center;
    opacity:.9;
}

.main {
    flex:1;
    min-width:0;
}

.topbar {
    height:78px;
    background:white;
    border-bottom:1px solid var(--border);
    display:flex;
    align-items:center;
    justify-content:space-between;
    padding:0 28px;
    position:sticky;
    top:0;
    z-index:10;
}

.page-title {
    font-size:20px;
    font-weight:700;
}

.page-subtitle {
    font-size:12px;
    color:var(--muted);
    margin-top:3px;
}

.top-actions {
    display:flex;
    align-items:center;
    gap:25px;
}

.live-indicator {
    font-size:11px;
    font-weight:700;
    display:flex;
    align-items:center;
    gap:7px;
}

.live-indicator span {
    width:8px;
    height:8px;
    background:#22c55e;
    border-radius:50%;
    box-shadow:0 0 0 4px rgba(34,197,94,.12);
}

.user-box {
    display:flex;
    align-items:center;
    gap:10px;
}

.avatar {
    width:34px;
    height:34px;
    background:#e8eefc;
    color:#007582;
    border-radius:50%;
    display:flex;
    justify-content:center;
    align-items:center;
    font-weight:700;
}

.user-name {
    font-size:12px;
    font-weight:650;
}

.user-role {
    font-size:10px;
    color:var(--muted);
}

.mobile-menu {
    display:none;
}

.content {
    padding:26px;
    max-width:1800px;
    margin:auto;
}

.welcome-row {
    display:flex;
    justify-content:space-between;
    align-items:center;
    margin-bottom:22px;
}

.welcome-row h1 {
    font-size:24px;
    margin:0 0 5px;
}

.welcome-row p {
    margin:0;
    color:var(--muted);
    font-size:13px;
}

.date-box {
    background:white;
    border:1px solid var(--border);
    padding:10px 16px;
    border-radius:9px;
    text-align:right;
}

.date-label {
    font-size:9px;
    color:var(--muted);
    letter-spacing:.08em;
}

#currentDate {
    font-size:12px;
    font-weight:650;
    margin-top:3px;
}

.stats-grid {
    display:grid;
    grid-template-columns:repeat(4,1fr);
    gap:14px;
    margin-bottom:18px;
}

.stat-card {
    background:var(--panel);
    border:1px solid var(--border);
    border-radius:10px;
    padding:17px 18px;
    min-height:115px;
}

.stat-label {
    font-size:10px;
    color:var(--muted);
    font-weight:700;
    letter-spacing:.04em;
}

.stat-value {
    font-size:27px;
    font-weight:750;
    margin-top:9px;
    letter-spacing:-.03em;
}

.stat-meta {
    font-size:10px;
    color:#98a2b3;
    margin-top:5px;
}

.two-column {
    display:grid;
    grid-template-columns:1fr 1fr;
    gap:18px;
    margin-bottom:18px;
}

.panel {
    background:white;
    border:1px solid var(--border);
    border-radius:10px;
    overflow:hidden;
    margin-bottom:18px;
}

.panel-header {
    min-height:66px;
    padding:15px 18px;
    border-bottom:1px solid var(--border);
    display:flex;
    justify-content:space-between;
    align-items:center;
}

.panel-title {
    font-size:14px;
    font-weight:700;
}

.panel-subtitle {
    color:var(--muted);
    font-size:10px;
    margin-top:3px;
}

.panel-button {
    border:1px solid var(--border);
    background:white;
    border-radius:6px;
    padding:6px 10px;
    font-size:10px;
    cursor:pointer;
}

.panel-button:hover {
    background:#f7f8fa;
}

.refresh-status {
    color:var(--green);
    font-size:10px;
    font-weight:600;
}

.table-wrap {
    overflow-x:auto;
}

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

th {
    text-align:left;
    padding:11px 15px;
    font-size:9px;
    color:#8993a4;
    font-weight:750;
    letter-spacing:.04em;
    white-space:nowrap;
    background:#fafbfc;
}

td {
    padding:12px 15px;
    border-top:1px solid #eef0f4;
    font-size:11px;
    white-space:nowrap;
}

tr:hover td {
    background:#fafcff;
}

.empty {
    text-align:center;
    color:#9aa4b2;
    padding:24px;
}

.status {
    display:inline-block;
    padding:4px 7px;
    border-radius:5px;
    font-size:9px;
    font-weight:700;
}

.status-incall {
    background:#dcfce7;
    color:#15803d;
}

.status-ready {
    background:#dbeafe;
    color:#007582;
}

.status-paused {
    background:#fef3c7;
    color:#a16207;
}

.status-other {
    background:#f1f5f9;
    color:#475569;
}

.page {
    display:none;
}

.page.active {
    display:block;
}

.empty-page {
    min-height:500px;
    display:flex;
    flex-direction:column;
    align-items:center;
    justify-content:center;
    background:white;
    border:1px solid var(--border);
    border-radius:12px;
    text-align:center;
}

.empty-icon {
    width:64px;
    height:64px;
    border-radius:50%;
    background:#eef3ff;
    color:#008b98;
    display:flex;
    align-items:center;
    justify-content:center;
    font-size:26px;
    margin-bottom:15px;
}

.empty-page h2 {
    margin:0 0 7px;
}

.empty-page p {
    color:var(--muted);
    font-size:13px;
    max-width:450px;
}

.module-status {
    margin-top:14px;
    font-size:9px;
    font-weight:700;
    color:#008b98;
    background:#eef3ff;
    padding:7px 10px;
    border-radius:6px;
}

@media(max-width:1100px) {

    .sidebar {
        width:220px;
        min-width:220px;
    }

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

}

@media(max-width:800px) {

    .sidebar {
        position:fixed;
        left:-250px;
        top:0;
        bottom:0;
        z-index:100;
        transition:.2s;
    }

    .sidebar.open {
        left:0;
    }

    .mobile-menu {
        display:block;
        border:0;
        background:none;
        font-size:22px;
        margin-right:10px;
    }

    .topbar {
        padding:0 15px;
    }

    .content {
        padding:15px;
    }

    .top-actions {
        gap:10px;
    }

    .user-box {
        display:none;
    }

    .two-column {
        grid-template-columns:1fr;
    }

}

@media(max-width:500px) {

    .stats-grid {
        grid-template-columns:1fr;
    }

    .welcome-row {
        align-items:flex-start;
        gap:15px;
        flex-direction:column;
    }

    .date-box {
        text-align:left;
    }

}
