/* =====================================================================
   Doctor OP – design system
   Tokens first; every colour below comes from here.
   ===================================================================== */
:root {
    --bg: #f2f5fa;
    --surface: #ffffff;
    --surface-2: #f7f9fc;
    --ink: #111a2e;
    --ink-2: #3a475f;
    --muted: #66758f;
    --line: #e3e8f1;
    --line-strong: #cfd7e5;

    --brand: #2155d9;
    --brand-600: #1a45b8;
    --brand-soft: #e9efff;
    --navy-1: #0c1a3d;
    --navy-2: #16306b;

    --inc: #2563eb;       /* income  (blue)  */
    --exp: #f59e0b;       /* expense (amber) – blue/amber stays distinguishable for colour-blind users */
    --profit: #0f8a5f;
    --loss: #d92d20;
    --pending: #b45309;

    --ok-bg: #e7f6ee;  --ok-ink: #0b6b45;
    --err-bg: #fdecea; --err-ink: #a3201a;
    --warn-bg: #fff4dc; --warn-ink: #7a4a00;

    --radius: 14px;
    --radius-sm: 10px;
    --shadow-sm: 0 1px 2px rgba(16, 24, 40, .05);
    --shadow: 0 1px 3px rgba(16, 24, 40, .06), 0 8px 24px -12px rgba(16, 24, 40, .12);
    --ring: 0 0 0 3px rgba(33, 85, 217, .22);
    --font: 'Inter', system-ui, -apple-system, 'Segoe UI', Roboto, 'Noto Sans', 'Noto Sans Malayalam', Arial, sans-serif;
}

* { box-sizing: border-box; margin: 0; padding: 0; }
html { -webkit-text-size-adjust: 100%; }
body {
    font-family: var(--font); font-size: 15px; line-height: 1.5; color: var(--ink);
    background: var(--bg); -webkit-font-smoothing: antialiased;
}
h1, h2, h3, h4 { color: var(--ink); letter-spacing: -.01em; }
h3 { font-size: 17px; font-weight: 650; margin-bottom: 14px; }
h4 { font-size: 13px; font-weight: 650; text-transform: uppercase; letter-spacing: .06em; color: var(--muted); margin: 2px 0 12px; }
a { color: var(--brand); }
:focus-visible { outline: none; box-shadow: var(--ring); border-radius: 6px; }

/* ---------------------------------------------------------------- header */
.site-header {
    position: sticky; top: 0; z-index: 50;
    background: linear-gradient(135deg, var(--navy-1), var(--navy-2));
    box-shadow: 0 6px 20px -10px rgba(8, 16, 40, .6);
}
.hdr-inner { max-width: 1240px; margin: 0 auto; padding: 10px 24px; display: flex; align-items: center; gap: 24px; }
.brand { display: flex; align-items: center; gap: 12px; text-decoration: none; color: #fff; flex-shrink: 0; }
.brand img { width: 40px; height: 40px; border-radius: 11px; display: block; box-shadow: 0 4px 12px rgba(0, 0, 0, .35); background: #fff2; }
.brand-text { display: flex; flex-direction: column; line-height: 1.15; }
.brand-text b { font-size: 18px; font-weight: 700; letter-spacing: -.02em; }
.brand-text small { font-size: 11.5px; color: #a9b8dc; font-weight: 500; letter-spacing: .02em; }
.main-nav { display: flex; gap: 4px; margin: 0 auto; background: rgba(255, 255, 255, .08); padding: 4px; border-radius: 12px; }
.main-nav a {
    display: inline-flex; align-items: center; gap: 8px; padding: 8px 16px; border-radius: 9px;
    color: #cbd6f0; text-decoration: none; font-size: 14px; font-weight: 550; transition: background .15s, color .15s;
}
.main-nav a svg { width: 17px; height: 17px; flex: none; }
.main-nav a:hover { background: rgba(255, 255, 255, .1); color: #fff; }
.main-nav a.active { background: #fff; color: var(--navy-2); box-shadow: 0 2px 8px rgba(0, 0, 0, .25); }
.hdr-user { display: flex; align-items: center; gap: 10px; margin: 0; }
.avatar { width: 34px; height: 34px; border-radius: 50%; background: #ffffff1f; color: #fff; display: grid; place-items: center; font-weight: 650; font-size: 14px; border: 1px solid #ffffff30; }
.btn.ghost-light { background: transparent; color: #dbe4fb; border: 1px solid #ffffff3d; box-shadow: none; }
.btn.ghost-light:hover { background: #ffffff1a; color: #fff; }

.container { max-width: 1240px; margin: 0 auto; padding: 26px 24px 60px; }

/* ---------------------------------------------------------------- cards */
.card {
    position: relative; background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius);
    padding: 22px 24px; box-shadow: var(--shadow); margin-bottom: 20px;
}
.card > h3:first-child, .card > .chart-head:first-child { margin-top: 0; }
.card-head { display: flex; justify-content: space-between; align-items: center; gap: 12px; flex-wrap: wrap; margin-bottom: 14px; }
.card-head h3 { margin: 0; }
.page-head { display: flex; justify-content: space-between; align-items: flex-end; gap: 16px; flex-wrap: wrap; margin-bottom: 18px; }
.page-head h2 { font-size: 24px; font-weight: 700; letter-spacing: -.02em; }
.page-head p { color: var(--muted); font-size: 14px; margin-top: 2px; }

/* ---------------------------------------------------------------- forms */
label { display: block; font-size: 13px; font-weight: 600; color: var(--ink-2); margin: 0 0 6px; }
input, select, textarea {
    display: block; width: 100%; padding: 10px 12px; margin: 0; color: var(--ink); background: #fff;
    border: 1px solid var(--line-strong); border-radius: var(--radius-sm); font: inherit; font-size: 14.5px;
    transition: border-color .15s, box-shadow .15s; min-height: 42px;
}
input::placeholder, textarea::placeholder { color: #9aa7bd; }
input:hover, select:hover, textarea:hover { border-color: #b3bfd4; }
input:focus, select:focus, textarea:focus { border-color: var(--brand); box-shadow: var(--ring); outline: none; }
textarea { min-height: 84px; resize: vertical; line-height: 1.5; }
select { appearance: none; padding-right: 36px; background: #fff url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='16' height='16' viewBox='0 0 24 24' fill='none' stroke='%2366758f' stroke-width='2.4' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='m6 9 6 6 6-6'/%3E%3C/svg%3E") no-repeat right 12px center; }
input[type=checkbox], input[type=radio] { width: auto; min-height: 0; display: inline-block; accent-color: var(--brand); }
input[type=date] { min-height: 42px; }

.f { min-width: 0; }
.f.span-2 { grid-column: span 2; } .f.span-all { grid-column: 1 / -1; }
.fgrid { display: grid; gap: 16px 18px; grid-template-columns: repeat(12, 1fr); }
.fgrid > .f { grid-column: span 4; }
.fgrid > .f.c3 { grid-column: span 3; } .fgrid > .f.c2 { grid-column: span 2; } .fgrid > .f.c6 { grid-column: span 6; }
.fgrid > .f.c12 { grid-column: 1 / -1; }
.fgrid > .f.c5 { grid-column: span 5; } .fgrid > .f.c7 { grid-column: span 7; }
@media (max-width: 900px) { .fgrid > .f, .fgrid > .f.c3, .fgrid > .f.c2, .fgrid > .f.c5, .fgrid > .f.c7 { grid-column: span 6; } }
@media (max-width: 560px) { .fgrid > .f, .fgrid > .f.c3, .fgrid > .f.c2, .fgrid > .f.c6, .fgrid > .f.c5, .fgrid > .f.c7 { grid-column: 1 / -1; } }
.sec { margin-top: 22px; padding-top: 18px; border-top: 1px dashed var(--line-strong); }
.sec:first-of-type { margin-top: 0; padding-top: 0; border-top: 0; }
.form-actions { margin-top: 22px; display: flex; gap: 10px; flex-wrap: wrap; align-items: center; }

.paysel { display: flex; gap: 6px; flex-wrap: wrap; }
.paysel label { margin: 0; cursor: pointer; }
.paysel input { position: absolute; opacity: 0; width: 1px; height: 1px; }
.paysel span {
    display: inline-flex; align-items: center; padding: 9px 14px; border: 1px solid var(--line-strong); border-radius: var(--radius-sm);
    font-size: 14px; font-weight: 600; color: var(--ink-2); background: #fff; transition: all .15s; min-height: 42px;
}
.paysel label:hover span { border-color: var(--brand); }
.paysel input:checked + span { background: var(--brand-soft); border-color: var(--brand); color: var(--brand-600); }
.paysel input[value=pending]:checked + span { background: var(--warn-bg); border-color: #e9b44c; color: var(--warn-ink); }
.paysel input:focus-visible + span { box-shadow: var(--ring); }

.custom-block { margin-top: 22px; padding: 18px; background: var(--surface-2); border: 1px solid var(--line); border-radius: var(--radius); }
.custom-block .fgrid { margin-top: 2px; }

/* ---------------------------------------------------------------- buttons */
.btn {
    display: inline-flex; align-items: center; justify-content: center; gap: 8px; padding: 0 18px; min-height: 42px;
    background: var(--brand); color: #fff; text-decoration: none; border-radius: var(--radius-sm); border: 1px solid transparent;
    cursor: pointer; font: inherit; font-size: 14px; font-weight: 600; white-space: nowrap;
    transition: background .15s, box-shadow .15s, transform .05s; box-shadow: 0 1px 2px rgba(33, 85, 217, .35);
}
.btn:hover { background: var(--brand-600); }
.btn:active { transform: translateY(1px); }
.btn:focus-visible { box-shadow: var(--ring); }
.btn svg { width: 16px; height: 16px; flex: none; }
.btn.small { min-height: 32px; padding: 0 12px; font-size: 12.5px; border-radius: 8px; box-shadow: none; }
.btn.alt { background: var(--brand-soft); color: var(--brand-600); border-color: #cddafb; box-shadow: none; }
.btn.alt:hover { background: #dbe5ff; }
.btn.cancel { background: #fff; color: var(--ink-2); border-color: var(--line-strong); box-shadow: none; }
.btn.cancel:hover { background: var(--surface-2); }
.btn.danger { background: #fff; color: var(--loss); border-color: #f3c3be; box-shadow: none; }
.btn.danger:hover { background: var(--err-bg); }
.btn.ok { background: var(--ok-bg); color: var(--ok-ink); border-color: #bfe6d1; box-shadow: none; }
.btn.ok:hover { background: #d6f0e3; }
.btn-row { margin-top: 10px; display: flex; gap: 10px; flex-wrap: wrap; align-items: center; }
.btn-row.right { justify-content: flex-end; margin-top: 18px; }
form.inline { display: inline; }
.card-actions { display: flex; gap: 8px; flex-wrap: wrap; margin-bottom: 4px; }
.results-head { display: flex; justify-content: space-between; align-items: center; margin: 4px 0 14px; gap: 10px; }
.results-head h3 { margin: 0; }

/* ---------------------------------------------------------------- alerts */
.alert { padding: 12px 16px; border-radius: var(--radius-sm); margin-bottom: 16px; font-size: 14px; border: 1px solid transparent; line-height: 1.55; }
.alert.success { background: var(--ok-bg); border-color: #bfe6d1; color: var(--ok-ink); }
.alert.error { background: var(--err-bg); border-color: #f5c6c1; color: var(--err-ink); }
.alert.pending-note { background: var(--warn-bg); border-color: #f1d08a; color: var(--warn-ink); }
.alert a { color: inherit; font-weight: 650; }
.hint { color: var(--muted); font-size: 13px; line-height: 1.55; margin: 8px 0 0; }
.hint a { color: var(--brand); }
.sr { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }

/* ---------------------------------------------------------------- tables */
.table-wrap { overflow-x: auto; border: 1px solid var(--line); border-radius: var(--radius-sm); margin-top: 6px; }
table { width: 100%; border-collapse: collapse; }
th, td { padding: 12px 14px; text-align: left; vertical-align: middle; border-bottom: 1px solid var(--line); word-break: break-word; font-size: 14px; }
th { background: var(--surface-2); color: var(--muted); font-size: 11.5px; font-weight: 650; text-transform: uppercase; letter-spacing: .06em; white-space: nowrap; }
tbody tr:last-child td { border-bottom: 0; }
tbody tr:hover td { background: #fafcff; }
table.grid { min-width: 760px; }
.w-date { width: 108px; } .w-op { width: 90px; } .w-name { width: 150px; } .w-ph { width: 130px; } .w-act { width: 210px; }
td.small, .small { font-size: 13px; }
td.actions { white-space: nowrap; }
td.actions .btn, td.actions form { margin: 0 4px 0 0; vertical-align: middle; }
.num, th.num { text-align: right; font-variant-numeric: tabular-nums; white-space: nowrap; }
tr.muted td { background: var(--surface-2); color: var(--muted); }
tr.row-pending td { background: #fffaf0; }
.muted-t { color: var(--muted); font-weight: 400; }

.pill { display: inline-flex; align-items: center; padding: 3px 10px; border-radius: 999px; font-size: 12px; font-weight: 650; line-height: 1.4; }
.pill.ok { background: var(--ok-bg); color: var(--ok-ink); } .pill.off { background: #eceff4; color: #5a6578; }
.pill.inc { background: var(--brand-soft); color: var(--brand-600); } .pill.exp { background: var(--warn-bg); color: var(--warn-ink); }
.pill.pay-online { background: var(--brand-soft); color: var(--brand-600); } .pill.pay-offline { background: var(--ok-bg); color: var(--ok-ink); }
.pill.pay-pending { background: var(--warn-bg); color: var(--warn-ink); } .pill.pay-other { background: #eceff4; color: #4b5668; }
.badge { display: inline-block; min-width: 20px; padding: 0 7px; border-radius: 999px; background: var(--exp); color: #3b2a00; font-size: 12px; font-weight: 700; text-align: center; line-height: 20px; }

/* ---------------------------------------------------------------- sub-navigation */
.subtabs { display: flex; gap: 2px; flex-wrap: wrap; margin-bottom: 20px; border-bottom: 1px solid var(--line-strong); }
.subtabs a {
    padding: 10px 16px; text-decoration: none; color: var(--muted); font-weight: 600; font-size: 14px;
    border-bottom: 2px solid transparent; margin-bottom: -1px; display: inline-flex; align-items: center; gap: 8px;
}
.subtabs a:hover { color: var(--ink); }
.subtabs a.active { color: var(--brand); border-bottom-color: var(--brand); }
.switch { display: inline-flex; background: #e9edf5; padding: 4px; border-radius: 11px; gap: 2px; margin-bottom: 18px; flex-wrap: wrap; }
.switch a { padding: 8px 16px; border-radius: 8px; text-decoration: none; font-size: 14px; font-weight: 600; color: var(--ink-2); display: inline-flex; gap: 8px; align-items: center; }
.switch a:hover { color: var(--ink); }
.switch a.active { background: #fff; color: var(--brand-600); box-shadow: var(--shadow-sm); }

/* ---------------------------------------------------------------- modals */
.modal {
    display: none; position: fixed; inset: 0; background: rgba(10, 18, 40, .55); backdrop-filter: blur(3px);
    align-items: center; justify-content: center; z-index: 1000; padding: 24px; overflow-y: auto;
}
.modal .card { max-width: 920px; width: 100%; max-height: 92vh; overflow-y: auto; margin: 0; border-radius: 18px; box-shadow: 0 24px 60px -12px rgba(8, 16, 40, .55); }
.modal.sm .card { max-width: 560px; }
.modal hr { border: 0; border-top: 1px solid var(--line); margin: 18px 0; }
.preview { font-size: 14px; overflow-x: auto; }
.preview table { margin-top: 0; border: 1px solid var(--line); border-radius: 8px; border-collapse: separate; border-spacing: 0; }
.preview th { width: 13%; background: var(--surface-2); color: var(--ink-2); font-size: 12px; text-transform: none; letter-spacing: 0; white-space: normal; }
.preview td, .preview th { border-bottom: 1px solid var(--line); border-right: 1px solid var(--line); }
.email-row { display: flex; gap: 10px; align-items: center; }
.email-row input { flex: 1; }
@media (max-width: 600px) {
    .modal { padding: 8px; align-items: flex-end; }
    .modal .card { max-height: 94vh; border-radius: 18px 18px 0 0; padding: 18px; }
    .email-row { flex-direction: column; align-items: stretch; }
}

/* ---------------------------------------------------------------- admin */
.admin-table input, .admin-table textarea { margin: 0 0 6px; padding: 8px 10px; min-height: 38px; }
.admin-table textarea { min-height: 76px; }
.admin-table td { vertical-align: top; }
.admin-table .w-sort { width: 90px; } .admin-table .w-type { width: 130px; } .admin-table .w-req { width: 110px; }
.admin-table .w-state { width: 90px; } .w-act2 { width: 250px; } .w-act3 { width: 300px; } .w-pay { width: 140px; }
.inline-form { display: none; }
.grid-3 { display: grid; grid-template-columns: 2fr 1.2fr 1fr; gap: 16px; align-items: end; }
.grid-3 > div { min-width: 0; }
.check-col { padding-bottom: 10px; }
label.check { display: flex; align-items: center; gap: 8px; margin: 0; cursor: pointer; font-weight: 500; white-space: nowrap; }
.admin-form .btn { margin-top: 14px; }
.row-form { display: flex; gap: 12px; align-items: flex-end; flex-wrap: wrap; }
.row-form > div { flex: 1; min-width: 220px; }
.row-form .btn { margin-top: 0; }
@media (max-width: 700px) { .grid-3 { grid-template-columns: 1fr; } }

/* ---------------------------------------------------------------- profit & loss */
.tiles { display: grid; grid-template-columns: repeat(4, 1fr); gap: 16px; margin-bottom: 20px; }
.tiles-3 { grid-template-columns: repeat(3, 1fr); }
@media (max-width: 960px) { .tiles { grid-template-columns: repeat(2, 1fr); } }
@media (max-width: 560px) { .tiles, .tiles-3 { grid-template-columns: 1fr; } }
.tile { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 18px 20px; box-shadow: var(--shadow); }
.tile-label { font-size: 12.5px; color: var(--muted); font-weight: 650; text-transform: uppercase; letter-spacing: .05em; }
.tile-value { font-size: 28px; font-weight: 700; margin-top: 6px; line-height: 1.15; font-variant-numeric: tabular-nums; letter-spacing: -.02em; word-break: break-word; }
.tile-sub { font-size: 12.5px; color: var(--muted); margin-bottom: 12px; }
.tile-split { display: flex; flex-direction: column; gap: 3px; font-size: 13px; border-top: 1px solid var(--line); padding-top: 12px; font-variant-numeric: tabular-nums; color: var(--ink-2); }
.pos { color: var(--profit); } .neg { color: var(--loss); } .pend { color: var(--pending); }
.dot { display: inline-block; width: 10px; height: 10px; border-radius: 3px; margin-right: 7px; vertical-align: baseline; }
.dot.inc { background: var(--inc); } .dot.exp { background: var(--exp); } .dot.line { background: var(--profit); border-radius: 50%; }

.chart-head { display: flex; justify-content: space-between; align-items: center; gap: 12px; flex-wrap: wrap; margin-bottom: 10px; }
.chart-head h3 { margin: 0; }
.seg { display: inline-flex; background: #e9edf5; padding: 3px; border-radius: 10px; gap: 2px; }
.seg-btn { border: 0; background: transparent; color: var(--ink-2); padding: 7px 16px; font: inherit; font-size: 13.5px; font-weight: 600; cursor: pointer; border-radius: 8px; }
.seg-btn:hover { color: var(--ink); }
.seg-btn.active { background: #fff; color: var(--brand-600); box-shadow: var(--shadow-sm); }
.seg-btn:focus-visible { box-shadow: var(--ring); }
.legend { display: flex; gap: 18px; flex-wrap: wrap; font-size: 13px; color: var(--ink-2); margin-bottom: 8px; align-items: center; }
.chart-note { margin-left: auto; color: var(--muted); font-variant-numeric: tabular-nums; }
@media (max-width: 700px) { .chart-note { margin-left: 0; width: 100%; } }
.chart { width: 100%; position: relative; min-height: 260px; }
.chart.loading { opacity: .5; }
.chart svg { display: block; max-width: 100%; touch-action: pan-y; }
.chart-tip { position: absolute; background: #fff; border: 1px solid var(--line-strong); border-radius: 10px; padding: 10px 14px; font-size: 13px; box-shadow: var(--shadow); pointer-events: none; z-index: 5; white-space: nowrap; font-variant-numeric: tabular-nums; line-height: 1.7; }
.grid-line { stroke: #e8ecf3; stroke-width: 1; } .zero-line { stroke: #8b98ae; stroke-width: 1.2; }
.axis-text { font-size: 11px; fill: var(--muted); font-family: var(--font); }
.bar-inc { fill: var(--inc); } .bar-exp { fill: var(--exp); }
.profit-line { stroke: var(--profit); stroke-width: 2.4; stroke-linejoin: round; }
.profit-dot { fill: #fff; stroke: var(--profit); stroke-width: 2; }
.hover-col { fill: rgba(37, 99, 235, .07); }

.split { display: grid; grid-template-columns: 1fr 1fr; gap: 32px; }
@media (max-width: 760px) { .split { grid-template-columns: 1fr; gap: 22px; } }
.bd-head { display: flex; justify-content: space-between; border-bottom: 1px solid var(--line-strong); padding-bottom: 8px; margin-bottom: 12px; font-variant-numeric: tabular-nums; }
.bd-row { margin-bottom: 14px; }
.bd-line { display: flex; justify-content: space-between; gap: 8px; font-size: 14px; font-variant-numeric: tabular-nums; }
.bd-line small { color: var(--muted); }
.bd-bar { height: 8px; background: #edf0f6; border-radius: 4px; margin-top: 6px; overflow: hidden; }
.bd-bar span { display: block; height: 100%; border-radius: 4px; }
.bd-bar .inc { background: var(--inc); } .bd-bar .exp { background: var(--exp); }
.net { margin-top: 18px; padding-top: 14px; border-top: 1px solid var(--line); font-size: 15px; }
.inline-select { display: flex; align-items: center; } .inline-select select { width: auto; min-height: 38px; padding-top: 6px; padding-bottom: 6px; }

.type-switch { display: inline-flex; gap: 8px; margin-bottom: 16px; }
.type-opt { display: inline-flex; align-items: center; gap: 8px; padding: 9px 20px; border: 1px solid var(--line-strong); border-radius: var(--radius-sm); cursor: pointer; margin: 0; font-weight: 650; font-size: 14px; background: #fff; }
.type-opt input { margin: 0; }
.type-opt.inc:has(input:checked) { border-color: var(--inc); background: var(--brand-soft); color: var(--brand-600); }
.type-opt.exp:has(input:checked) { border-color: #e9b44c; background: var(--warn-bg); color: var(--warn-ink); }

.filter-row { display: grid; grid-template-columns: repeat(4, 1fr) auto; gap: 14px; align-items: end; margin-bottom: 8px; }
.filter-consult { grid-template-columns: repeat(3, 1fr); }
.filter-consult .filter-go, .filter-row .filter-go { display: flex; gap: 8px; }
.filter-consult .filter-go { grid-column: 1 / -1; }
@media (max-width: 800px) { .filter-row, .filter-consult { grid-template-columns: 1fr 1fr; } }
.sumbar { display: flex; gap: 26px; flex-wrap: wrap; margin: 14px 0 10px; font-size: 14px; font-variant-numeric: tabular-nums; color: var(--ink-2); }
.sumbar b { font-weight: 700; }
.inc-t { color: var(--brand-600); } .exp-t { color: var(--pending); }
.ledger { min-width: 660px; }
.ledger td:first-child { white-space: nowrap; }
form.recv { display: inline-flex; gap: 6px; align-items: center; }
form.recv select { width: auto; margin: 0; min-height: 32px; padding: 4px 28px 4px 8px; font-size: 12.5px; border-radius: 8px; }

/* export dialog */
.range-list { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; margin: 6px 0 4px; }
@media (max-width: 560px) { .range-list { grid-template-columns: 1fr; } }
.range-opt { display: block; margin: 0; cursor: pointer; }
.range-opt input { position: absolute; opacity: 0; width: 1px; height: 1px; }
.range-opt span { display: block; padding: 11px 14px; border: 1px solid var(--line-strong); border-radius: var(--radius-sm); background: #fff; transition: all .15s; }
.range-opt b { display: block; font-size: 14px; color: var(--ink); font-weight: 650; }
.range-opt small { color: var(--muted); font-size: 12px; font-weight: 500; }
.range-opt:hover span { border-color: var(--brand); }
.range-opt input:checked + span { border-color: var(--brand); background: var(--brand-soft); box-shadow: inset 0 0 0 1px var(--brand); }
.range-opt input:focus-visible + span { box-shadow: var(--ring); }
.range-custom { display: none; grid-template-columns: 1fr 1fr; gap: 14px; margin-top: 14px; }
.range-custom.show { display: grid; }

/* ---------------------------------------------------------------- sign-in */
body.auth { min-height: 100vh; display: grid; grid-template-columns: 1.1fr 1fr; background: #fff; }
.auth-side {
    position: relative; overflow: hidden; color: #fff; padding: 56px; display: flex; flex-direction: column; justify-content: space-between;
    background: radial-gradient(900px 500px at 10% -10%, #2f5fe0 0%, transparent 60%), linear-gradient(150deg, var(--navy-1), var(--navy-2));
}
.auth-side::after { content: ""; position: absolute; width: 520px; height: 520px; right: -180px; bottom: -200px; border-radius: 50%; background: rgba(126, 224, 195, .12); }
.auth-side .brand img { width: 48px; height: 48px; border-radius: 13px; }
.auth-side .brand-text b { font-size: 21px; }
.auth-side h2 { font-size: 34px; line-height: 1.15; letter-spacing: -.03em; color: #fff; max-width: 440px; margin-bottom: 20px; }
.auth-side ul { list-style: none; display: grid; gap: 12px; color: #c4d1f0; font-size: 15px; position: relative; z-index: 1; }
.auth-side li { display: flex; gap: 10px; align-items: center; }
.auth-side li::before { content: ""; width: 20px; height: 20px; border-radius: 50%; flex: none; background: #7ee0c3 url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%230c1a3d' stroke-width='3.4' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='m6 12.5 4 4 8-9'/%3E%3C/svg%3E") center/12px no-repeat; }
.auth-main { display: grid; place-items: center; padding: 32px 24px; background: var(--bg); }
.auth-card { width: 100%; max-width: 400px; background: #fff; border: 1px solid var(--line); border-radius: 20px; padding: 36px; box-shadow: var(--shadow); }
.auth-card h1 { font-size: 24px; font-weight: 700; letter-spacing: -.02em; margin-bottom: 4px; }
.auth-card .sub { color: var(--muted); font-size: 14px; margin-bottom: 24px; }
.auth-card .f { margin-bottom: 16px; }
.auth-card .btn { width: 100%; min-height: 46px; font-size: 15px; margin-top: 6px; }
.auth-mobile-brand { display: none; }
@media (max-width: 860px) {
    body.auth { grid-template-columns: 1fr; }
    .auth-side { display: none; }
    .auth-mobile-brand { display: flex; align-items: center; gap: 12px; justify-content: center; margin-bottom: 22px; color: var(--ink); text-decoration: none; }
    .auth-mobile-brand img { width: 44px; height: 44px; border-radius: 12px; }
    .auth-mobile-brand b { font-size: 20px; }
}

/* ---------------------------------------------------------------- responsive shell */
@media (max-width: 860px) {
    .hdr-inner { flex-wrap: wrap; padding: 10px 16px; gap: 10px 12px; }
    .brand { order: 1; margin-right: auto; }
    .hdr-user { order: 2; }
    .main-nav { order: 3; width: 100%; margin: 0; }
    .main-nav a { flex: 1; justify-content: center; padding: 9px 8px; font-size: 13.5px; }
    .container { padding: 18px 14px 48px; }
    .card { padding: 18px 16px; }
    .brand-text small, .avatar { display: none; }
}
@media (max-width: 420px) { .main-nav a svg { display: none; } }
@media (prefers-reduced-motion: reduce) { * { transition: none !important; } }

.fgrid.cols5 { grid-template-columns: repeat(5, 1fr); }
.fgrid.cols5 > .f { grid-column: auto; }
@media (max-width: 900px) { .fgrid.cols5 { grid-template-columns: repeat(3, 1fr); } }
@media (max-width: 560px) { .fgrid.cols5 { grid-template-columns: repeat(2, 1fr); } }

.hint + form, .hint + .admin-form { margin-top: 16px; }
.admin-table td { vertical-align: middle; }
@media (max-width: 640px) {
    .switch { display: flex; width: 100%; flex-wrap: nowrap; }
    .switch a { flex: 1; justify-content: center; text-align: center; padding: 9px 6px; font-size: 13.5px; }
}
