@import url('https://fonts.googleapis.com/css2?family=Inter:wght@400;500;600;700;800&display=swap');

:root {
    --bg: #eef2f7;
    --surface: #ffffff;
    --surface-soft: #f8fafc;
    --text: #0f172a;
    --muted: #475569;
    --border: #e2e8f0;
    --primary: #2563eb;
    --primary-dark: #1d4ed8;
    --success-bg: #dcfce7;
    --success-tx: #166534;
    --danger-bg: #fee2e2;
    --danger-tx: #991b1b;
    --shadow: 0 12px 28px rgba(15, 23, 42, 0.08);
}

* { box-sizing: border-box; }

body {
    font-family: "Inter", "Segoe UI", Roboto, Arial, sans-serif;
    background: var(--bg);
    color: var(--text);
    margin: 0;
    overflow-x: hidden;
}

.container {
    max-width: none;
    margin: 16px 16px 16px 286px;
    width: calc(100vw - 302px);
    background: var(--surface);
    border-radius: 16px;
    padding: 24px;
    box-shadow: var(--shadow);
    border: 1px solid #dbe2ea;
    min-height: calc(100vh - 32px);
}

h1, h2, h3 { margin-top: 0; letter-spacing: -0.01em; }

.topbar {
    position: fixed;
    top: 12px;
    left: 12px;
    bottom: 12px;
    width: 258px;
    display: flex;
    flex-direction: column;
    gap: 16px;
    background: linear-gradient(180deg, #ffffff 0%, #f8fafc 100%);
    border: 1px solid #dbe2ea;
    border-radius: 16px;
    padding: 18px 12px;
    box-shadow: 0 10px 30px rgba(15, 23, 42, 0.1);
    z-index: 100;
}

.brand {
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.brand-title {
    font-size: 18px;
    font-weight: 700;
}

.brand-subtitle {
    font-size: 13px;
    color: var(--muted);
    line-height: 1.35;
}

.menu {
    display: flex;
    flex-direction: column;
    gap: 8px;
    overflow-y: auto;
    padding-right: 3px;
}

.menu a {
    text-decoration: none;
    color: #1e293b;
    background: transparent;
    border: 1px solid var(--border);
    padding: 10px 11px;
    border-radius: 10px;
    font-size: 14px;
    font-weight: 600;
    transition: all .18s ease;
    display: flex;
    align-items: center;
    gap: 10px;
}

.menu a:hover {
    border-color: #93c5fd;
    background: #eff6ff;
    color: #1e40af;
}

.menu a.active {
    background: #dbeafe;
    color: #1e3a8a;
    border-color: #93c5fd;
}

.menu a i {
    font-size: 15px;
    width: 16px;
}

.card-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(190px, 1fr));
    gap: 14px;
}

.card {
    border: 1px solid var(--border);
    border-radius: 12px;
    padding: 14px;
    background: var(--surface-soft);
}

.metric-card {
    background: linear-gradient(145deg, #ffffff, #f8fafc);
    border: 1px solid #dbeafe;
    border-radius: 14px;
    padding: 16px;
}

.metric-label {
    font-size: 13px;
    color: var(--muted);
    margin-bottom: 8px;
}

.metric-value {
    font-size: 27px;
    font-weight: 800;
    color: #0b3aa5;
    letter-spacing: -0.02em;
}

.dashboard-grid {
    display: grid;
    grid-template-columns: 1.3fr .9fr;
    gap: 16px;
    margin-top: 16px;
}

.chart-card {
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: 14px;
    padding: 14px;
    min-height: 340px;
}

.dashboard-grid-3 {
    grid-template-columns: 1.1fr 1.1fr .8fr;
}

.chart-wrap {
    position: relative;
    height: 270px;
}

.page-header {
    display: flex;
    flex-wrap: wrap;
    justify-content: space-between;
    gap: 14px;
    align-items: flex-start;
    margin-bottom: 16px;
}

.page-subtitle {
    color: var(--muted);
    font-size: 14px;
}

.header-actions {
    min-width: 0;
    flex: 1 1 280px;
    max-width: 420px;
    display: flex;
    gap: 10px;
    align-items: center;
}

.header-actions input {
    margin: 0;
    min-width: 0;
}

.quick-btn {
    background: #1d4ed8;
    color: #fff;
    text-decoration: none;
    border-radius: 9px;
    padding: 9px 12px;
    font-weight: 700;
    white-space: nowrap;
}

.activity-list {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.activity-item {
    display: flex;
    gap: 10px;
    align-items: flex-start;
}

.activity-dot {
    width: 9px;
    height: 9px;
    margin-top: 6px;
    border-radius: 50%;
    background: #2563eb;
}

.activity-title {
    font-size: 13px;
    font-weight: 600;
}

.activity-sub {
    font-size: 12px;
    color: #64748b;
}

.status-pill {
    display: inline-block;
    border-radius: 999px;
    font-size: 12px;
    font-weight: 700;
    padding: 4px 9px;
    border: 1px solid transparent;
}

.status-ok {
    background: #dcfce7;
    color: #166534;
    border-color: #bbf7d0;
}

.status-info {
    background: #dbeafe;
    color: #1e3a8a;
    border-color: #bfdbfe;
}

label { display: block; margin-top: 10px; margin-bottom: 6px; font-weight: 600; color: #334155; }
input, select, textarea {
    width: 100%;
    padding: 10px;
    border: 1px solid #cbd5e1;
    border-radius: 8px;
    background: #fff;
}
button {
    margin-top: 14px;
    padding: 10px 14px;
    border: 0;
    border-radius: 9px;
    background: var(--primary);
    color: #fff;
    cursor: pointer;
    font-weight: 700;
}
button:hover { background: var(--primary-dark); }

.alert {
    padding: 12px 14px;
    border-radius: 10px;
    margin: 12px 0;
    border: 1px solid transparent;
}
.alert-error { background: var(--danger-bg); color: var(--danger-tx); border-color: #fecaca; }
.alert-ok { background: var(--success-bg); color: var(--success-tx); border-color: #bbf7d0; }

table {
    width: 100%;
    border-collapse: collapse;
    margin-top: 12px;
    background: #fff;
    border: 1px solid var(--border);
    border-radius: 12px;
    overflow: hidden;
}
th, td {
    border-bottom: 1px solid var(--border);
    padding: 10px 9px;
    text-align: left;
    font-size: 14px;
}
th {
    background: #f8fafc;
    color: #334155;
    font-weight: 700;
}
tr:last-child td { border-bottom: 0; }

.section-title {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-top: 20px;
    margin-bottom: 4px;
}

@media (max-width: 1360px) {
    .topbar {
        width: 232px;
        left: 10px;
        top: 10px;
        bottom: 10px;
        padding: 14px 10px;
    }
    .container {
        margin: 10px 10px 10px 252px;
        width: calc(100vw - 262px);
        padding: 18px;
        min-height: calc(100vh - 20px);
    }
    .brand-title {
        font-size: 17px;
    }
    .menu a {
        font-size: 13px;
        padding: 9px 9px;
    }
}

@media (max-width: 1080px) {
    .topbar {
        position: static;
        width: auto;
        margin: 10px 10px 0 10px;
        border-radius: 14px;
        flex-direction: row;
        align-items: flex-start;
    }
    .menu {
        flex-direction: row;
        flex-wrap: wrap;
        max-height: none;
        overflow: visible;
        gap: 6px;
    }
    .menu a {
        border-radius: 8px;
        font-size: 12px;
        padding: 7px 8px;
    }
    .menu a span {
        white-space: nowrap;
    }
    .container {
        margin: 10px;
        width: auto;
        min-height: auto;
        border-radius: 14px;
    }
    .dashboard-grid,
    .dashboard-grid-3 {
        grid-template-columns: 1fr;
    }
    .card-grid {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }
}

@media (max-width: 980px) {
    .topbar {
        margin: 8px 8px 0 8px;
        padding: 12px;
    }
    .brand {
        width: 100%;
    }
    .brand-title {
        font-size: 16px;
    }
    .brand-subtitle {
        font-size: 12px;
    }
    .menu {
        width: 100%;
    }
    .menu a {
        flex: 1 1 calc(50% - 6px);
        min-width: 130px;
    }
    .dashboard-grid {
        grid-template-columns: 1fr;
    }
    .dashboard-grid-3 {
        grid-template-columns: 1fr;
    }
    .page-header {
        flex-direction: column;
    }
    .header-actions {
        width: 100%;
        min-width: 0;
        flex-direction: column;
        align-items: stretch;
    }
    .container {
        margin: 8px;
        width: auto;
        padding: 12px;
        min-height: auto;
    }
    .card-grid {
        grid-template-columns: 1fr;
    }
    .metric-value {
        font-size: 24px;
    }
    .chart-wrap {
        height: 220px;
    }
    table {
        display: block;
        overflow-x: auto;
        white-space: nowrap;
    }
}

@media (max-width: 560px) {
    .menu a {
        flex: 1 1 100%;
    }
    h1 { font-size: 26px; }
    h2 { font-size: 21px; }
    h3 { font-size: 18px; }
}
