/* ==========================================================================
   AKFA Lift BI — dizayn tizimi
   Ikki tema: light (default) va dark. Barcha ranglar CSS o'zgaruvchilarida —
   temani almashtirish uchun faqat <html data-theme="..."> o'zgaradi.
   Build qadami yo'q.
   ========================================================================== */

/* ------------------------------------------------------------ Light tema */

:root {
    --bg: #f2f4f9;
    --bg-soft: #e9ecf5;
    --surface: #ffffff;
    --surface-2: #f6f7fb;
    --surface-3: #eef0f7;

    --border: rgba(20, 24, 40, .07);
    --border-strong: rgba(20, 24, 40, .13);

    --text: #171a23;
    --text-dim: #5f6779;
    --text-muted: #98a0b3;

    --primary: #7c5cf5;
    --primary-soft: rgba(124, 92, 245, .12);
    --primary-contrast: #ffffff;

    --accent: #f5b81f;
    --accent-soft: rgba(245, 184, 31, .16);

    --green: #22c07f;
    --green-soft: rgba(34, 192, 127, .14);
    --red: #f2545b;
    --red-soft: rgba(242, 84, 91, .13);
    --amber: #f5a524;
    --amber-soft: rgba(245, 165, 36, .15);
    --blue: #4d8bf5;
    --blue-soft: rgba(77, 139, 245, .13);

    --shadow-sm: 0 1px 2px rgba(20, 24, 40, .05);
    --shadow: 0 6px 20px rgba(20, 24, 40, .07);
    --shadow-lg: 0 18px 44px rgba(20, 24, 40, .12);

    --radius: 22px;
    --radius-md: 16px;
    --radius-sm: 11px;
    --pill: 999px;

    --chart-grid: rgba(20, 24, 40, .07);
    --chart-text: #78819a;

    color-scheme: light;
}

/* ------------------------------------------------------------- Dark tema */

[data-theme="dark"] {
    --bg: #0a0d16;
    --bg-soft: #0f1320;
    --surface: #151a28;
    --surface-2: #1b2131;
    --surface-3: #222939;

    --border: rgba(255, 255, 255, .07);
    --border-strong: rgba(255, 255, 255, .15);

    --text: #edeff6;
    --text-dim: #99a1b5;
    --text-muted: #6b7488;

    --primary: #9b7ffb;
    --primary-soft: rgba(155, 127, 251, .18);
    --primary-contrast: #100f1c;

    --accent: #fbc74a;
    --accent-soft: rgba(251, 199, 74, .18);

    --green: #34d399;
    --green-soft: rgba(52, 211, 153, .16);
    --red: #f87171;
    --red-soft: rgba(248, 113, 113, .16);
    --amber: #fbbf24;
    --amber-soft: rgba(251, 191, 36, .16);
    --blue: #60a5fa;
    --blue-soft: rgba(96, 165, 250, .16);

    --shadow-sm: 0 1px 2px rgba(0, 0, 0, .3);
    --shadow: 0 8px 26px rgba(0, 0, 0, .38);
    --shadow-lg: 0 22px 50px rgba(0, 0, 0, .5);

    --chart-grid: rgba(255, 255, 255, .07);
    --chart-text: #99a1b5;

    color-scheme: dark;
}

/* Foydalanuvchi tanlamagan bo'lsa — tizim sozlamasiga ergashish */
@media (prefers-color-scheme: dark) {
    :root:not([data-theme="light"]) {
        --bg: #0a0d16;
        --bg-soft: #0f1320;
        --surface: #151a28;
        --surface-2: #1b2131;
        --surface-3: #222939;
        --border: rgba(255, 255, 255, .07);
        --border-strong: rgba(255, 255, 255, .15);
        --text: #edeff6;
        --text-dim: #99a1b5;
        --text-muted: #6b7488;
        --primary: #9b7ffb;
        --primary-soft: rgba(155, 127, 251, .18);
        --primary-contrast: #100f1c;
        --accent: #fbc74a;
        --accent-soft: rgba(251, 199, 74, .18);
        --green: #34d399;
        --green-soft: rgba(52, 211, 153, .16);
        --red: #f87171;
        --red-soft: rgba(248, 113, 113, .16);
        --amber: #fbbf24;
        --amber-soft: rgba(251, 191, 36, .16);
        --blue: #60a5fa;
        --blue-soft: rgba(96, 165, 250, .16);
        --shadow-sm: 0 1px 2px rgba(0, 0, 0, .3);
        --shadow: 0 8px 26px rgba(0, 0, 0, .38);
        --shadow-lg: 0 22px 50px rgba(0, 0, 0, .5);
        --chart-grid: rgba(255, 255, 255, .07);
        --chart-text: #99a1b5;
        color-scheme: dark;
    }
}

/* ------------------------------------------------------------------ Base */

* { box-sizing: border-box; }

html, body { height: 100%; }

body {
    margin: 0;
    font-family: "Plus Jakarta Sans", "Segoe UI", system-ui, -apple-system, sans-serif;
    font-size: 14px;
    line-height: 1.5;
    color: var(--text);
    background: var(--bg);
    -webkit-font-smoothing: antialiased;
    transition: background-color .25s ease, color .25s ease;
}

a { color: inherit; text-decoration: none; }

h1, h2, h3 { margin: 0; letter-spacing: -.02em; }

::-webkit-scrollbar { width: 10px; height: 10px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb {
    background: var(--border-strong);
    border-radius: var(--pill);
    border: 3px solid transparent;
    background-clip: content-box;
}
::-webkit-scrollbar-thumb:hover { background-color: var(--text-muted); background-clip: content-box; }

::selection { background: var(--primary-soft); }

/* ---------------------------------------------------------------- Shell */

.shell {
    max-width: 1560px;
    margin: 0 auto;
    padding: 18px 26px 40px;
    display: flex;
    flex-direction: column;
    gap: 18px;
}

/* --------------------------------------------------------------- Header */

.appbar {
    display: flex;
    align-items: center;
    gap: 18px;
    background: var(--surface);
    border-radius: var(--pill);
    padding: 10px 14px 10px 22px;
    box-shadow: var(--shadow);
}

.brand {
    display: flex;
    align-items: center;
    gap: 10px;
    font-size: 17px;
    font-weight: 700;
    letter-spacing: -.03em;
    flex-shrink: 0;
}

.brand__mark {
    width: 32px; height: 32px;
    border-radius: 10px;
    display: grid; place-items: center;
    background: linear-gradient(135deg, var(--primary), var(--accent));
    color: #fff;
    font-size: 12px;
    font-weight: 800;
}

.brand span b { color: var(--primary); font-weight: 800; }

/* Markazdagi pill navigatsiya */
.mainnav {
    margin: 0 auto;
    display: flex;
    align-items: center;
    gap: 2px;
    background: var(--surface-2);
    border-radius: var(--pill);
    padding: 5px;
}

.mainnav a {
    padding: 9px 20px;
    border-radius: var(--pill);
    font-size: 13.5px;
    font-weight: 500;
    color: var(--text-dim);
    white-space: nowrap;
    transition: color .18s, background .18s, box-shadow .18s;
}

.mainnav a:hover { color: var(--text); }

.mainnav a.is-active {
    background: var(--surface);
    color: var(--text);
    font-weight: 600;
    box-shadow: var(--shadow-sm);
}

[data-theme="dark"] .mainnav a.is-active { background: var(--surface-3); }

.appbar__right { display: flex; align-items: center; gap: 8px; margin-left: auto; flex-shrink: 0; }

.icon-btn {
    width: 38px; height: 38px;
    border-radius: 50%;
    border: 0;
    background: var(--surface-2);
    color: var(--text-dim);
    display: grid; place-items: center;
    font-size: 18px;
    cursor: pointer;
    transition: background .18s, color .18s;
}
.icon-btn:hover { background: var(--surface-3); color: var(--text); }

/* Foydalanuvchi menyusi */
.usermenu { position: relative; }

.usermenu__trigger {
    display: flex;
    align-items: center;
    gap: 9px;
    background: var(--surface-2);
    border: 0;
    border-radius: var(--pill);
    padding: 5px 13px 5px 5px;
    cursor: pointer;
    color: var(--text);
    font-family: inherit;
    transition: background .18s;
}
.usermenu__trigger:hover { background: var(--surface-3); }

.usermenu__avatar {
    width: 30px; height: 30px;
    border-radius: 50%;
    display: grid; place-items: center;
    background: linear-gradient(135deg, var(--primary), var(--accent));
    color: #fff;
    font-size: 12px;
    font-weight: 700;
}

.usermenu__meta { display: flex; flex-direction: column; line-height: 1.25; text-align: left; }
.usermenu__meta b { font-size: 12.5px; font-weight: 600; }
.usermenu__meta small { font-size: 10.5px; color: var(--text-muted); }

.usermenu__panel {
    position: absolute;
    right: 0; top: calc(100% + 10px);
    min-width: 228px;
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius-md);
    box-shadow: var(--shadow-lg);
    padding: 7px;
    display: none;
    z-index: 80;
}
.usermenu__panel.is-open { display: block; }

.usermenu__panel a,
.usermenu__panel button {
    display: flex;
    align-items: center;
    gap: 10px;
    width: 100%;
    padding: 9px 12px;
    border: 0;
    border-radius: var(--radius-sm);
    background: none;
    color: var(--text);
    font-size: 13px;
    font-family: inherit;
    text-align: left;
    cursor: pointer;
}
.usermenu__panel a:hover,
.usermenu__panel button:hover { background: var(--surface-2); }
.usermenu__panel i { font-size: 17px; color: var(--text-muted); }
.usermenu__panel form { margin: 0; }

.usermenu__sep { height: 1px; background: var(--border); margin: 6px 4px; }

.usermenu__label {
    padding: 8px 12px 5px;
    font-size: 10.5px;
    text-transform: uppercase;
    letter-spacing: .08em;
    color: var(--text-muted);
}

/* ------------------------------------------------------------- Pagehead */

.pagehead { display: flex; align-items: flex-end; gap: 16px; padding: 4px 8px 0; flex-wrap: wrap; }
.pagehead h1 { font-size: 26px; font-weight: 700; }
.pagehead p { margin: 4px 0 0; color: var(--text-muted); font-size: 13px; }
.pagehead__extra { margin-left: auto; }

/* -------------------------------------------------------------- Filters */

.filters {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    align-items: center;
    background: var(--surface);
    border-radius: var(--radius);
    padding: 12px 16px;
    box-shadow: var(--shadow);
}

.segmented {
    display: inline-flex;
    background: var(--surface-2);
    border-radius: var(--pill);
    padding: 4px;
    gap: 2px;
}

.segmented button,
.segmented a {
    display: inline-block;
    border: 0;
    background: none;
    color: var(--text-dim);
    padding: 7px 16px;
    border-radius: var(--pill);
    font-size: 12.5px;
    font-weight: 500;
    font-family: inherit;
    line-height: 1.4;
    white-space: nowrap;
    cursor: pointer;
    transition: background .18s, color .18s, box-shadow .18s;
}
.segmented button:hover,
.segmented a:hover { color: var(--text); }

.segmented button.is-active,
.segmented a.is-active {
    background: var(--surface);
    color: var(--text);
    font-weight: 600;
    box-shadow: var(--shadow-sm);
}
[data-theme="dark"] .segmented button.is-active,
[data-theme="dark"] .segmented a.is-active { background: var(--surface-3); }

.field {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    background: var(--surface-2);
    border-radius: var(--pill);
    padding: 0 15px;
    height: 38px;
    transition: box-shadow .18s;
}
.field:focus-within { box-shadow: 0 0 0 2px var(--primary-soft); }
.field i { color: var(--text-muted); font-size: 16px; }

.field select,
.field input {
    background: none;
    border: 0;
    color: var(--text);
    font-family: inherit;
    font-size: 12.5px;
    font-weight: 500;
    outline: none;
    min-width: 116px;
    height: 100%;
    cursor: pointer;
}
.field input { cursor: text; }
.field select option { background: var(--surface); color: var(--text); }
.field input::placeholder { color: var(--text-muted); font-weight: 400; }

.filters__spacer { margin-left: auto; }

/* --------------------------------------------------------------- Layout */

.grid { display: grid; gap: 16px; }
.grid--kpi { grid-template-columns: repeat(auto-fit, minmax(226px, 1fr)); }
.grid--2 { grid-template-columns: repeat(auto-fit, minmax(340px, 1fr)); }
.grid--3 { grid-template-columns: repeat(auto-fit, minmax(275px, 1fr)); }
.grid--wide { grid-template-columns: 2fr 1fr; }

@media (max-width: 1150px) { .grid--wide { grid-template-columns: 1fr; } }

/* ---------------------------------------------------------------- Cards */

.card {
    background: var(--surface);
    border-radius: var(--radius);
    box-shadow: var(--shadow);
    padding: 22px 24px;
}

.card__head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 14px;
    margin-bottom: 18px;
    flex-wrap: wrap;
}

.card__title { font-size: 16px; font-weight: 700; }
.card__hint { color: var(--text-muted); font-size: 12px; font-weight: 500; }

/* ------------------------------------------------------------------ KPI */

.kpi {
    background: var(--surface);
    border-radius: var(--radius);
    box-shadow: var(--shadow);
    padding: 20px 22px;
    display: flex;
    flex-direction: column;
    gap: 10px;
    position: relative;
    overflow: hidden;
}

.kpi__label {
    display: flex; align-items: center; gap: 8px;
    color: var(--text-dim);
    font-size: 12.5px;
    font-weight: 500;
}
.kpi__label i {
    font-size: 15px;
    width: 26px; height: 26px;
    display: grid; place-items: center;
    border-radius: 8px;
    background: var(--primary-soft);
    color: var(--primary);
}

.kpi__value {
    font-size: 30px;
    font-weight: 700;
    letter-spacing: -.035em;
    line-height: 1.05;
}
.kpi__unit { font-size: 13px; color: var(--text-muted); font-weight: 500; margin-left: 4px; }

.kpi__foot { display: flex; align-items: center; gap: 8px; font-size: 11.5px; flex-wrap: wrap; }
.kpi__note { color: var(--text-muted); }

.delta {
    display: inline-flex;
    align-items: center;
    gap: 3px;
    font-weight: 600;
    padding: 3px 9px;
    border-radius: var(--pill);
    font-size: 11px;
}
.delta--up { color: var(--green); background: var(--green-soft); }
.delta--down { color: var(--red); background: var(--red-soft); }
.delta--flat { color: var(--text-muted); background: var(--surface-2); }

/* Xatar darajasiga qarab urg'u */
.kpi--critical .kpi__value { color: var(--red); }
.kpi--critical .kpi__label i { background: var(--red-soft); color: var(--red); }
.kpi--high .kpi__value { color: var(--amber); }
.kpi--high .kpi__label i { background: var(--amber-soft); color: var(--amber); }

/* --------------------------------------------------------------- Charts */

.chart { width: 100%; min-height: 250px; }
.chart--tall { min-height: 330px; }

/* --------------------------------------------------------------- Funnel */

.funnel { display: flex; flex-direction: column; gap: 10px; }
.funnel__row { display: grid; grid-template-columns: 1fr auto; gap: 12px; align-items: center; }

.funnel__bar {
    position: relative;
    height: 38px;
    border-radius: var(--radius-sm);
    background: var(--surface-2);
    overflow: hidden;
}

.funnel__fill {
    height: 100%;
    border-radius: var(--radius-sm);
    background: linear-gradient(90deg, var(--primary), var(--accent));
    opacity: .9;
}

.funnel__label {
    position: absolute; inset: 0;
    display: flex; align-items: center; justify-content: space-between;
    padding: 0 14px;
    font-size: 12.5px;
    font-weight: 500;
}
.funnel__label b { font-variant-numeric: tabular-nums; font-weight: 700; }

.funnel__meta {
    font-size: 11.5px;
    color: var(--text-muted);
    min-width: 104px;
    text-align: right;
    font-variant-numeric: tabular-nums;
    line-height: 1.45;
}

/* --------------------------------------------------------------- Tables */

.table-wrap { overflow-x: auto; margin: 0 -6px; padding: 0 6px; }

table.data { width: 100%; border-collapse: collapse; font-size: 13px; }

table.data th {
    text-align: left;
    padding: 10px 14px;
    color: var(--text-muted);
    font-weight: 600;
    font-size: 11px;
    text-transform: uppercase;
    letter-spacing: .06em;
    white-space: nowrap;
}

table.data td { padding: 12px 14px; border-top: 1px solid var(--border); font-weight: 500; }
table.data tbody tr { transition: background .15s; }
table.data tbody tr:hover { background: var(--surface-2); }
table.data tbody tr:hover td:first-child { border-radius: var(--radius-sm) 0 0 var(--radius-sm); }
table.data tbody tr:hover td:last-child { border-radius: 0 var(--radius-sm) var(--radius-sm) 0; }

.num { text-align: right; font-variant-numeric: tabular-nums; white-space: nowrap; }

/* ----------------------------------------------------------------- Bars */

.minibar {
    height: 7px;
    border-radius: var(--pill);
    background: var(--surface-3);
    overflow: hidden;
    min-width: 68px;
}
.minibar span {
    display: block; height: 100%;
    border-radius: var(--pill);
    background: var(--primary);
    transition: width .35s ease;
}
.minibar span.is-ok { background: var(--green); }
.minibar span.is-warn { background: var(--amber); }
.minibar span.is-danger { background: var(--red); }

/* --------------------------------------------------------------- Badges */

.badge {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    padding: 4px 11px;
    border-radius: var(--pill);
    font-size: 11px;
    font-weight: 600;
    white-space: nowrap;
}

.badge--blue { background: var(--blue-soft); color: var(--blue); }
.badge--green { background: var(--green-soft); color: var(--green); }
.badge--red { background: var(--red-soft); color: var(--red); }
.badge--amber { background: var(--amber-soft); color: var(--amber); }
.badge--purple { background: var(--primary-soft); color: var(--primary); }
.badge--muted { background: var(--surface-2); color: var(--text-dim); }

/* --------------------------------------------------------------- Alerts */

.alert {
    display: flex;
    gap: 13px;
    padding: 16px 20px;
    border-radius: var(--radius);
    font-size: 13px;
    line-height: 1.6;
    background: var(--amber-soft);
    color: var(--text);
    box-shadow: var(--shadow-sm);
}
.alert i { font-size: 20px; flex-shrink: 0; color: var(--amber); }
.alert ul { margin: 6px 0 0; padding-left: 18px; }
.alert li + li { margin-top: 5px; }
.alert b { font-weight: 700; }

.alert--info { background: var(--blue-soft); }
.alert--info i { color: var(--blue); }

/* -------------------------------------------------------------- Buttons */

.btn {
    display: inline-flex;
    align-items: center;
    gap: 7px;
    padding: 10px 18px;
    border-radius: var(--pill);
    border: 0;
    background: var(--surface-2);
    color: var(--text);
    font-size: 13px;
    font-weight: 600;
    font-family: inherit;
    cursor: pointer;
    transition: background .18s, transform .12s, box-shadow .18s;
}
.btn:hover { background: var(--surface-3); }
.btn:active { transform: scale(.98); }

.btn--primary {
    background: var(--primary);
    color: var(--primary-contrast);
    box-shadow: 0 5px 16px var(--primary-soft);
}
.btn--primary:hover { background: var(--primary); filter: brightness(1.07); }

.btn--danger { color: var(--red); background: var(--red-soft); }
.btn--danger:hover { background: var(--red-soft); filter: brightness(.95); }

.btn--ghost { background: none; }
.btn--ghost:hover { background: var(--surface-2); }
.btn--sm { padding: 7px 13px; font-size: 12px; }

/* --------------------------------------------------------------- Worker */

.worker {
    background: var(--surface-2);
    border-radius: var(--radius-md);
    padding: 16px 17px;
    display: flex;
    flex-direction: column;
    gap: 11px;
}

.worker__head { display: flex; align-items: center; gap: 11px; }

.worker__avatar {
    width: 38px; height: 38px;
    border-radius: 50%;
    display: grid; place-items: center;
    background: var(--primary-soft);
    color: var(--primary);
    font-weight: 700;
    font-size: 14px;
    flex-shrink: 0;
}

.worker__name { font-size: 14px; font-weight: 600; }
.worker__sub { font-size: 11.5px; color: var(--text-muted); }
.worker__stats { margin-left: auto; text-align: right; }
.worker__count { font-size: 22px; font-weight: 700; line-height: 1; letter-spacing: -.03em; }

.worker__objects {
    margin: 0; padding: 0; list-style: none;
    display: flex; flex-direction: column; gap: 5px;
    max-height: 152px; overflow-y: auto;
}

.worker__objects li {
    font-size: 12px;
    color: var(--text-dim);
    padding: 7px 11px;
    border-radius: var(--radius-sm);
    background: var(--surface);
    display: flex; justify-content: space-between; gap: 8px;
    font-weight: 500;
}
.worker__objects li span:first-child { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

/* Loyiha kartochkasi — usta kartochkasi bilan bir xil ko'rinish */
.worker--done { background: var(--green-soft); }
.worker--over { background: var(--red-soft); }

.worker__foot {
    display: flex; align-items: center; gap: 8px; flex-wrap: wrap;
    padding-top: 10px;
    border-top: 1px solid var(--border);
    font-size: 11.5px; color: var(--text-muted); font-weight: 500;
}
.worker__foot span { display: inline-flex; align-items: center; gap: 4px; }

/* -------------------------------------------------------------- Project */

.project {
    background: var(--surface-2);
    border-radius: var(--radius-md);
    padding: 16px 17px;
    display: flex;
    flex-direction: column;
    gap: 12px;
    transition: transform .18s, box-shadow .18s;
}
.project:hover { transform: translateY(-2px); box-shadow: var(--shadow); }

.project--over { background: var(--red-soft); }
.project--soon { background: var(--amber-soft); }

.project__head { display: flex; align-items: flex-start; gap: 12px; }

.project__title {
    font-size: 14px;
    font-weight: 600;
    line-height: 1.35;
    overflow: hidden;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
}

.project__company { font-size: 11.5px; color: var(--text-muted); margin-top: 3px; }

.project__pct { margin-left: auto; text-align: right; flex-shrink: 0; }
.project__pct b { font-size: 22px; font-weight: 700; line-height: 1; letter-spacing: -.03em; }
.project__pct small { display: block; font-size: 10.5px; color: var(--text-muted); margin-top: 3px; }

.project__pct--over b { color: var(--red); }
.project__pct--soon b { color: var(--amber); }
.project__pct--ok b { color: var(--green); }

.project__meta {
    display: flex; justify-content: space-between; gap: 8px;
    font-size: 11.5px; color: var(--text-dim); font-weight: 500;
}
.project__meta span { white-space: nowrap; display: inline-flex; align-items: center; gap: 4px; }

.project__bars { display: flex; flex-direction: column; gap: 8px; }
.project__bar-row { display: grid; grid-template-columns: 42px 1fr auto; gap: 9px; align-items: center; }
.project__bar-row > span:first-child { font-size: 10.5px; color: var(--text-muted); font-weight: 500; }
.project__bar-row > span:last-child {
    font-size: 11px; color: var(--text-dim); min-width: 34px;
    text-align: right; font-variant-numeric: tabular-nums; font-weight: 600;
}

.project__foot {
    display: flex; align-items: center; gap: 8px; flex-wrap: wrap;
    padding-top: 10px;
    border-top: 1px solid var(--border);
    font-size: 11.5px; color: var(--text-muted); font-weight: 500;
}

/* ---------------------------------------------------------------- Empty */

.empty {
    padding: 42px 20px;
    text-align: center;
    color: var(--text-muted);
    font-size: 13px;
}
.empty i { font-size: 34px; display: block; margin-bottom: 10px; opacity: .5; }

/* ----------------------------------------------------------------- Auth */

.auth { min-height: 100vh; display: grid; place-items: center; padding: 20px; background: var(--bg); }

.auth__card {
    width: 100%;
    max-width: 392px;
    background: var(--surface);
    border-radius: 26px;
    box-shadow: var(--shadow-lg);
    padding: 36px 34px;
}

.auth__logo {
    width: 52px; height: 52px;
    border-radius: 16px;
    display: grid; place-items: center;
    background: linear-gradient(135deg, var(--primary), var(--accent));
    color: #fff;
    font-weight: 800;
    font-size: 15px;
    margin-bottom: 20px;
}

.auth__card h1 { font-size: 23px; font-weight: 700; margin-bottom: 5px; }
.auth__card p.sub { margin: 0 0 26px; color: var(--text-muted); font-size: 13px; }

.input-group { margin-bottom: 15px; }
.input-group label {
    display: block; font-size: 12px; font-weight: 600;
    color: var(--text-dim); margin-bottom: 7px;
}

.input-group input,
.input-group select {
    width: 100%;
    height: 44px;
    padding: 0 15px;
    background: var(--surface-2);
    border: 1px solid transparent;
    border-radius: var(--radius-sm);
    color: var(--text);
    font-family: inherit;
    font-size: 13.5px;
    outline: none;
    transition: border-color .18s, box-shadow .18s;
}
.input-group input:focus,
.input-group select:focus {
    border-color: var(--primary);
    box-shadow: 0 0 0 3px var(--primary-soft);
}

.form-error {
    background: var(--red-soft);
    color: var(--red);
    padding: 11px 14px;
    border-radius: var(--radius-sm);
    font-size: 12.5px;
    font-weight: 500;
    margin-bottom: 16px;
}

.form-help { color: var(--text-muted); font-size: 11.5px; margin-top: 6px; }

/* ---------------------------------------------------------------- Modal */

.modal {
    position: fixed; inset: 0;
    background: rgba(10, 13, 22, .55);
    backdrop-filter: blur(3px);
    display: none;
    place-items: center;
    padding: 20px;
    z-index: 90;
}
.modal.is-open { display: grid; }

.modal__box {
    width: 100%;
    max-width: 440px;
    background: var(--surface);
    border-radius: var(--radius);
    box-shadow: var(--shadow-lg);
    padding: 26px 28px;
    max-height: 90vh;
    overflow-y: auto;
}
.modal__box h2 { margin-bottom: 20px; font-size: 18px; font-weight: 700; }
.modal__actions { display: flex; gap: 9px; justify-content: flex-end; margin-top: 22px; }

/* --------------------------------------------------------------- Footer */

.page-footer { padding: 6px 8px; color: var(--text-muted); font-size: 12px; }

/* ----------------------------------------------------------- Responsive */

@media (max-width: 1080px) {
    .appbar { flex-wrap: wrap; border-radius: var(--radius); padding: 12px 14px; }
    .mainnav { order: 3; width: 100%; margin: 4px 0 0; overflow-x: auto; justify-content: flex-start; }
    .appbar__right { margin-left: auto; }
}

@media (max-width: 720px) {
    .shell { padding: 12px 13px 28px; }
    .pagehead h1 { font-size: 21px; }
    .kpi__value { font-size: 25px; }
    .card { padding: 18px 16px; }
    .usermenu__meta { display: none; }
    .usermenu__trigger { padding: 5px; }
    .field select, .field input { min-width: 92px; }
}

@media print {
    .appbar, .filters, .page-footer { display: none !important; }
    body { background: #fff; }
    .card, .kpi { box-shadow: none; border: 1px solid #ddd; }
}
