:root {
    --bg: #f4f7ff;
    --card: #ffffff;
    --muted: #64748b;
    --text: #0f172a;
    --brand: #1d4ed8;
    --brand2: #1e40af;
    --danger: #ef4444;
    --shadow: 0 10px 30px rgba(2,6,23,.06);
    --shadow2: 0 6px 18px rgba(2,6,23,.05);
    --radius: 16px;
}

* {
    box-sizing: border-box
}

body {
    margin: 0;
    font-family: system-ui,-apple-system,Segoe UI,Roboto,Arial;
    background: var(--bg);
    color: var(--text);
}

a {
    color: inherit;
    text-decoration: none
}

.container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 20px;
}

/* Layout */
.layout {
    display: flex;
    min-height: 100vh;
    background: var(--bg);
}

.sidebar {
    width: 260px;
    position: sticky;
    top: 0;
    height: 100vh;
    padding: 18px;
    background: linear-gradient(180deg, var(--brand), var(--brand2));
    color: #fff;
    box-shadow: 8px 0 30px rgba(2,6,23,.10);
}

.main {
    flex: 1;
    padding: 18px 18px;
}

    .main .container {
        max-width: 1200px;
        margin: 0 auto;
    }

/* Nav */
.nav a {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 10px 12px;
    border-radius: 12px;
    margin-bottom: 6px;
    color: rgba(255,255,255,.92);
    font-weight: 800;
    font-size: 14px;
    transition: background .15s ease, transform .15s ease;
}

    .nav a:hover {
        background: rgba(255,255,255,.10);
        transform: translateY(-1px);
    }

    .nav a.active {
        background: rgba(255,255,255,.16);
        box-shadow: 0 10px 25px rgba(2,6,23,.18);
    }

/* Cards */
.card {
    background: var(--card);
    border: 1px solid rgba(15,23,42,.06);
    border-radius: var(--radius);
    padding: 16px;
    box-shadow: var(--shadow2);
}

/* Rows */
.row {
    display: flex;
    gap: 16px;
    flex-wrap: wrap
}

/* KPI */
.kpi {
    flex: 1;
    min-width: 220px
}

    .kpi .val {
        font-size: 26px;
        font-weight: 900
    }

    .kpi .lbl {
        color: var(--muted);
        font-size: 12px;
        margin-top: 4px
    }

/* Buttons */
.btn {
    background: linear-gradient(90deg, var(--brand), var(--brand2));
    color: #fff;
    border: 0;
    padding: 10px 14px;
    border-radius: 12px;
    font-weight: 900;
    cursor: pointer;
    box-shadow: var(--shadow2);
}

    .btn.secondary {
        background: #fff;
        border: 1px solid rgba(15,23,42,.10);
        color: var(--text);
        box-shadow: none;
    }

    .btn.danger {
        background: var(--danger);
        color: #fff;
        box-shadow: none;
    }

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

/* Topbar helper (if used in list pages) */
.topbar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 14px;
    gap: 10px;
}

/* Table */
.table {
    width: 100%;
    border-collapse: collapse;
    background: #fff;
    border-radius: var(--radius);
    overflow: hidden;
}

    .table th, .table td {
        padding: 10px 10px;
        border-bottom: 1px solid rgba(15,23,42,.06);
        text-align: left;
        font-size: 13px;
    }

    .table th {
        color: var(--muted);
        font-weight: 900;
        background: rgba(2,6,23,.02);
    }

/* Badge */
.badge {
    padding: 4px 8px;
    border-radius: 999px;
    font-size: 12px;
    border: 1px solid rgba(15,23,42,.12);
    color: var(--muted);
    background: rgba(2,6,23,.02);
}

/* Form inputs */
input, select {
    padding: 10px 12px;
    border-radius: 12px;
    border: 1px solid rgba(15,23,42,.10);
    background: #fff;
    color: var(--text);
    outline: none;
}

    input:focus, select:focus {
        border-color: rgba(29,78,216,.35);
        box-shadow: 0 0 0 4px rgba(29,78,216,.12);
    }

.grid2 {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 16px
}

/* Responsive */
@media(max-width:1000px) {
    .layout {
        flex-direction: column
    }

    .sidebar {
        width: auto;
        height: auto;
        position: relative
    }

    .grid2 {
        grid-template-columns: 1fr
    }
}
