/* ===== Design tokens — "Dispatch Console" direction: light ops-console, teal accent,
   dark navy sidebar as the one deliberate dark surface, dense data-forward layout ===== */
:root {
    --accent: #0D9488;
    --accent-dark: #0F766E;
    --accent-light: #CCFBF1;
    --accent-50: #F0FDFA;

    --ink: #0F172A;
    --ink-soft: #334155;
    --muted: #64748B;
    --muted-light: #94A3B8;

    --bg: #F4F6F8;
    --surface: #FFFFFF;
    --surface-alt: #FAFBFC;
    --border: #E2E8F0;
    --border-soft: #EEF2F6;

    --success: #0D9488;
    --success-bg: #F0FDFA;
    --warning: #B45309;
    --warning-bg: #FFFBEB;
    --error: #DC2626;
    --error-bg: #FEF2F2;

    --navy: #0B1520;
    --navy-panel: #132635;

    --radius-sm: 7px;
    --radius-md: 10px;
    --radius-lg: 14px;

    --shadow-sm: 0 1px 2px rgba(15, 23, 42, 0.05);
    --shadow-md: 0 6px 18px rgba(15, 23, 42, 0.07), 0 1px 4px rgba(15, 23, 42, 0.04);
    --shadow-lg: 0 20px 50px rgba(15, 23, 42, 0.16);

    --mono: ui-monospace, SFMono-Regular, Menlo, Consolas, 'Liberation Mono', monospace;
    --sidenav-w: 220px;
}

* { box-sizing: border-box; }
html, body {
    margin: 0;
    background: var(--bg);
    color: var(--ink);
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', 'Inter', Roboto, sans-serif;
    -webkit-font-smoothing: antialiased;
}
::selection { background: var(--accent-light); color: var(--accent-dark); }

/* ===== Shell / layout ===== */
.shell { display: flex; min-height: 100vh; }

.sidenav {
    width: var(--sidenav-w);
    flex-shrink: 0;
    background: var(--navy);
    padding: 20px 12px;
    display: flex;
    flex-direction: column;
    position: sticky;
    top: 0;
    height: 100vh;
}
.sidenav .brand {
    display: flex;
    align-items: center;
    gap: 9px;
    color: white;
    font-weight: 800;
    font-size: 13.5px;
    letter-spacing: 0.03em;
    padding: 6px 8px 20px;
}
.sidenav .brand .logo-badge {
    width: 30px; height: 30px;
    border-radius: 8px;
    background: var(--accent);
    display: flex; align-items: center; justify-content: center;
    color: var(--navy);
    flex-shrink: 0;
}
.sidenav .brand .brand-text { min-width: 0; }
.sidenav .brand .brand-agency {
    overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
    color: white; font-weight: 800; font-size: 13.5px; letter-spacing: 0.03em;
}
.sidenav .brand .brand-platform {
    color: #5C7186; font-weight: 600; font-size: 10px; letter-spacing: 0.02em;
    margin-top: 1px; text-transform: uppercase;
}
.sidenav .nav-group { display: flex; flex-direction: column; gap: 1px; }
.sidenav a {
    display: flex;
    align-items: center;
    gap: 11px;
    padding: 9px 12px;
    color: #8CA0B3;
    text-decoration: none;
    font-size: 13.5px;
    font-weight: 600;
    border-radius: 6px;
    transition: background 0.15s ease, color 0.15s ease;
}
.sidenav a svg { width: 17px; height: 17px; flex-shrink: 0; opacity: 0.8; }
.sidenav a:hover { background: rgba(255,255,255,0.06); color: white; }
.sidenav a.active { background: var(--navy-panel); color: #5EEAD4; box-shadow: none; }
.sidenav a.active svg { opacity: 1; }
.sidenav .nav-spacer { flex: 1; }
.sidenav .nav-footer {
    color: #5C7186;
    font-size: 11.5px;
    padding: 10px 14px;
    border-top: 1px solid rgba(255,255,255,0.08);
    margin-top: 10px;
}

.content-wrap { flex: 1; display: flex; flex-direction: column; min-width: 0; }

.topbar {
    height: 56px;
    background: var(--surface);
    border-bottom: 1px solid var(--border);
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0 28px;
    position: sticky;
    top: 0;
    z-index: 5;
}
.topbar .page-title { font-size: 15px; font-weight: 700; color: var(--ink); letter-spacing: 0.01em; }
.topbar .who { display: flex; align-items: center; gap: 10px; }
.topbar .avatar {
    width: 34px; height: 34px; border-radius: 50%;
    background: var(--accent-light); color: var(--accent-dark);
    display: flex; align-items: center; justify-content: center;
    font-weight: 700; font-size: 13px;
}
.topbar .who-name { font-size: 13.5px; font-weight: 600; color: var(--ink-soft); }
.topbar .who-role { font-size: 11.5px; color: var(--muted); }

.content { flex: 1; padding: 28px 32px 60px; max-width: 1080px; width: 100%; }

h1 { font-size: 22px; font-weight: 700; color: var(--ink); margin: 0 0 4px; }
h2 { color: var(--ink); font-size: 15px; font-weight: 700; margin: 0 0 14px; }
.page-sub { color: var(--muted); font-size: 13.5px; margin: 0 0 24px; }

/* ===== Stat cards ===== */
.stat-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(190px, 1fr)); gap: 12px; margin-bottom: 28px; }
.stat-card {
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius-md);
    padding: 16px 18px;
    box-shadow: var(--shadow-sm);
    display: flex;
    align-items: center;
    gap: 14px;
}
.stat-card .stat-icon {
    width: 40px; height: 40px; border-radius: 9px;
    background: var(--accent-50);
    display: flex; align-items: center; justify-content: center;
    color: var(--accent-dark);
    flex-shrink: 0;
}
.stat-card .stat-icon svg { width: 20px; height: 20px; }
.stat-number { font-size: 24px; font-weight: 800; color: var(--ink); line-height: 1; font-variant-numeric: tabular-nums; }
.stat-label { color: var(--muted); font-size: 11px; margin-top: 6px; font-weight: 700; letter-spacing: 0.05em; text-transform: uppercase; }

/* ===== Cards / sections ===== */
.panel {
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius-md);
    box-shadow: var(--shadow-sm);
    padding: 18px 20px;
    margin-bottom: 20px;
}
.panel-head { display: flex; align-items: center; justify-content: space-between; margin-bottom: 14px; flex-wrap: wrap; gap: 10px; }
.panel-head h2 { margin: 0; }
.panel-head-actions { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }

.search-box {
    display: flex; align-items: center; gap: 8px;
    background: var(--surface); border: 1.5px solid var(--border);
    border-radius: var(--radius-sm);
    padding: 7px 12px;
    min-width: 220px;
}
.search-box svg { width: 15px; height: 15px; color: var(--muted-light); flex-shrink: 0; }
.search-box input {
    border: none; outline: none; background: transparent;
    font-size: 13.5px; font-family: inherit; color: var(--ink);
    width: 100%;
}
.search-box input::placeholder { color: var(--muted-light); }
.search-box:focus-within { border-color: var(--accent); box-shadow: 0 0 0 3px var(--accent-light); }

/* ===== Table ===== */
.table-wrap { overflow-x: auto; border-radius: var(--radius-md); border: 1px solid var(--border-soft); }
.data-table { width: 100%; border-collapse: collapse; font-size: 13.5px; background: var(--surface); }
.data-table th {
    text-align: left; background: var(--surface-alt); padding: 10px 16px;
    font-size: 10.5px; text-transform: uppercase; letter-spacing: 0.06em;
    color: var(--muted); font-weight: 700; border-bottom: 1px solid var(--border);
}
.data-table td { padding: 11px 16px; border-bottom: 1px solid var(--border-soft); color: var(--ink-soft); }
.data-table tbody tr:last-child td { border-bottom: none; }
.data-table tbody tr:hover { background: var(--surface-alt); }
.data-table td.num { font-variant-numeric: tabular-nums; }
.data-table td.mono, .data-table th.mono { font-family: var(--mono); font-size: 12px; color: var(--muted-light); }

.name-cell { display: flex; align-items: center; gap: 10px; font-weight: 600; color: var(--ink); }
.mini-avatar {
    width: 30px; height: 30px; border-radius: 50%;
    background: var(--accent-light); color: var(--accent-dark);
    display: flex; align-items: center; justify-content: center;
    font-size: 12px; font-weight: 700; flex-shrink: 0;
}

.empty-state {
    text-align: center; padding: 44px 20px; color: var(--muted);
}
.empty-state .empty-icon { color: var(--muted-light); margin-bottom: 10px; }
.empty-state .empty-icon svg { width: 40px; height: 40px; }
.empty-state p { margin: 0; font-size: 13.5px; }

/* ===== Badges — dot + label reads as status before you read the word ===== */
.badge {
    display: inline-flex; align-items: center; gap: 6px;
    padding: 2px 2px; border-radius: 999px;
    font-size: 11.5px; font-weight: 700; letter-spacing: 0.1px;
}
.badge::before {
    content: ""; width: 6px; height: 6px; border-radius: 50%; flex-shrink: 0;
    background: currentColor;
}
.badge-blue { color: var(--accent-dark); }
.badge-green { color: var(--success); }
.badge-amber { color: var(--warning); }
.badge-gray { color: var(--muted); }
.badge-gray::before { background: var(--muted-light); }
.badge-red { color: var(--error); }
.badge-red::before { background: var(--error); }

.back-link {
    display: inline-flex; align-items: center; gap: 4px;
    color: var(--muted); font-size: 13px; font-weight: 600;
    text-decoration: none; margin-bottom: 14px;
}
.back-link:hover { color: var(--accent-dark); }

/* ===== Worker Attendance calendar ===== */
.attn-month-nav { display: flex; align-items: center; justify-content: center; gap: 4px; margin-bottom: 20px; }
.attn-summary { display: grid; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); gap: 12px; margin-bottom: 22px; }

.attn-calendar { display: grid; grid-template-columns: repeat(7, 1fr); gap: 6px; }
.attn-day-label { text-align: center; font-size: 10.5px; font-weight: 700; color: var(--muted); text-transform: uppercase; letter-spacing: 0.05em; padding-bottom: 6px; }
.attn-day-cell {
    aspect-ratio: 1; border-radius: var(--radius-sm); border: 1.5px solid var(--border);
    display: flex; align-items: center; justify-content: center;
    cursor: pointer; position: relative; font-size: 13px; font-weight: 700;
    color: var(--ink-soft); background: var(--surface-alt);
    transition: border-color 0.15s ease, transform 0.1s ease;
}
.attn-day-cell:hover { border-color: var(--accent); }
.attn-day-cell.selected { border-color: var(--accent); box-shadow: 0 0 0 2px var(--accent-light); }
.attn-day-cell.empty { visibility: hidden; cursor: default; }
.attn-day-cell.present { background: var(--success-bg); color: var(--success); }
.attn-day-cell.half-day { background: var(--warning-bg); color: var(--warning); }
.attn-day-cell.leave { background: var(--accent-50); color: var(--accent-dark); }
.attn-day-cell.absent { background: var(--error-bg); color: var(--error); }
.attn-day-flag {
    position: absolute; top: 4px; right: 4px; width: 6px; height: 6px;
    border-radius: 50%; background: var(--warning);
    box-shadow: 0 0 0 1.5px var(--surface);
}

.attn-legend { display: flex; flex-wrap: wrap; gap: 16px; margin-top: 16px; font-size: 12px; color: var(--muted); }
.attn-legend span { display: flex; align-items: center; gap: 6px; }
.attn-legend .dot { width: 9px; height: 9px; border-radius: 50%; flex-shrink: 0; }
.attn-legend .dot.present { background: var(--success); }
.attn-legend .dot.half-day { background: var(--warning); }
.attn-legend .dot.leave { background: var(--accent-dark); }
.attn-legend .dot.absent { background: var(--error); }
.attn-legend .dot.flag { background: var(--warning); box-shadow: 0 0 0 2px var(--warning-bg); }

.attn-detail-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(200px, 1fr)); gap: 14px; }
.attn-detail-card { background: var(--surface-alt); border: 1px solid var(--border-soft); border-radius: var(--radius-md); padding: 16px; }
.attn-detail-label { font-size: 11px; font-weight: 700; color: var(--muted); text-transform: uppercase; letter-spacing: 0.05em; margin-bottom: 6px; }
.attn-detail-time { font-size: 20px; font-weight: 800; color: var(--ink); font-variant-numeric: tabular-nums; }
.attn-map-link { display: inline-flex; align-items: center; gap: 5px; color: var(--accent-dark); font-size: 12.5px; font-weight: 700; text-decoration: none; margin-top: 4px; }
.attn-map-link:hover { text-decoration: underline; }

/* ===== "Fix a mistake" admin-override panel (WorkerAttendance.razor) — deliberately
   louder than a plain dashed sub-panel: this changes real attendance data, so it needs
   to read as "careful, admin tool" at a glance, not blend into the page like a filter. */
.fix-panel {
    background: linear-gradient(180deg, var(--warning-bg) 0%, var(--surface) 90px);
    border: 1px solid var(--border-soft);
    border-left: 3px solid var(--warning);
    border-radius: var(--radius-md);
    padding: 18px 20px;
    margin-top: 16px;
    box-shadow: var(--shadow-sm);
}
.fix-panel-head { display: flex; align-items: flex-start; gap: 12px; margin-bottom: 14px; }
.fix-panel-icon {
    width: 34px; height: 34px; border-radius: 9px; flex-shrink: 0;
    background: var(--surface); color: var(--warning);
    display: flex; align-items: center; justify-content: center;
    box-shadow: var(--shadow-sm);
}
.fix-panel-icon svg { width: 17px; height: 17px; }
.fix-panel-head h3 { margin: 0; font-size: 14.5px; font-weight: 800; color: var(--ink); }
.fix-panel-head p { margin: 2px 0 0; font-size: 12.5px; color: var(--muted); }

.fix-row {
    display: flex; align-items: center; gap: 14px;
    background: var(--surface);
    border: 1px solid var(--border-soft);
    border-radius: var(--radius-sm);
    padding: 12px 14px;
    margin-top: 8px;
    transition: border-color 0.15s ease, box-shadow 0.15s ease;
}
.fix-row:hover { border-color: var(--border); box-shadow: var(--shadow-sm); }
.fix-row.danger:hover { border-color: #F3B6AE; }
.fix-row-icon {
    width: 30px; height: 30px; border-radius: 50%; flex-shrink: 0;
    display: flex; align-items: center; justify-content: center;
}
.fix-row-icon svg { width: 15px; height: 15px; }
.fix-row-icon.accent { background: var(--accent-50); color: var(--accent-dark); }
.fix-row-icon.error { background: var(--error-bg); color: var(--error); }
.fix-row-text { flex: 1; min-width: 160px; }
.fix-row-title { font-size: 13.5px; font-weight: 700; color: var(--ink-soft); }
.fix-row-title.danger { color: var(--error); }
.fix-row-sub { font-size: 12px; color: var(--muted); margin-top: 2px; }
.fix-row-btn { padding: 8px 14px; font-size: 12.5px; flex-shrink: 0; }
.fix-row-btn.danger { color: var(--error); border-color: #F3B6AE; }
.fix-row-btn.danger:hover { background: var(--error-bg); border-color: var(--error); }
.fix-row-btn:disabled { opacity: 0.55; cursor: not-allowed; }

/* ===== Forms ===== */
.form-row { margin-bottom: 16px; display: flex; flex-direction: column; gap: 6px; }
.form-row label { font-size: 12.5px; color: var(--ink-soft); font-weight: 700; }
.form-row input[type=text], .form-row input[type=number], .form-row input[type=date],
.form-row input[type=email], .form-row input[type=password], .form-row input[type=tel],
.form-row input:not([type]), .form-row select {
    padding: 10px 12px;
    border: 1.5px solid var(--border);
    border-radius: var(--radius-sm);
    font-size: 14px;
    background: var(--surface);
    color: var(--ink);
    transition: border-color 0.15s ease, box-shadow 0.15s ease;
    font-family: inherit;
}
.form-row input:focus, .form-row select:focus {
    outline: none;
    border-color: var(--accent);
    box-shadow: 0 0 0 3px var(--accent-light);
}
.table-input {
    width: 100%; padding: 7px 9px;
    border: 1.5px solid var(--border);
    border-radius: var(--radius-sm);
    font-size: 13.5px;
    background: var(--surface);
    color: var(--ink);
    font-family: inherit;
    box-sizing: border-box;
}
.table-input:focus { outline: none; border-color: var(--accent); box-shadow: 0 0 0 3px var(--accent-light); }
.form-row.checkbox-row { flex-direction: row; align-items: center; gap: 8px; }
.form-row.checkbox-row label { font-weight: 500; color: var(--ink-soft); }
.form-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); gap: 4px 20px; }
.form-actions { display: flex; gap: 10px; margin-top: 6px; }

/* ===== Buttons ===== */
.btn-primary, .btn-secondary, .btn-small, .btn-ghost {
    border: none;
    border-radius: var(--radius-sm);
    font-weight: 700;
    cursor: pointer;
    text-decoration: none;
    display: inline-flex;
    align-items: center;
    gap: 8px;
    font-family: inherit;
    transition: background 0.15s ease, box-shadow 0.15s ease, transform 0.05s ease;
}
.btn-primary {
    background: var(--accent); color: white; padding: 11px 20px; font-size: 14px;
    box-shadow: var(--shadow-sm);
}
.btn-primary:hover { background: var(--accent-dark); }
.btn-primary:active { transform: translateY(1px); }
.btn-primary:disabled { background: var(--muted-light); cursor: not-allowed; box-shadow: none; }

.btn-secondary {
    background: var(--surface); color: var(--ink-soft); padding: 11px 20px; font-size: 14px;
    border: 1.5px solid var(--border);
}
.btn-secondary:hover { background: #FAFBFD; border-color: var(--muted-light); }

.btn-small { background: var(--accent-50); color: var(--accent-dark); padding: 7px 13px; font-size: 12.5px; white-space: nowrap; }
.btn-small:hover { background: var(--accent-light); }

.btn-ghost { background: transparent; color: var(--muted); padding: 6px 8px; font-size: 13px; }
.btn-ghost:hover { color: var(--ink); background: #F1F5F9; }

svg.icon { width: 16px; height: 16px; }

/* ===== Modal ===== */
.modal-overlay {
    position: fixed; inset: 0; background: rgba(15, 23, 42, 0.45);
    display: flex; align-items: center; justify-content: center;
    z-index: 50; padding: 20px; backdrop-filter: blur(2px);
}
.modal-card {
    background: var(--surface); border-radius: var(--radius-lg);
    box-shadow: var(--shadow-lg); width: 100%; max-width: 460px;
    padding: 26px 26px 22px; max-height: 88vh; overflow-y: auto;
}
.modal-head { display: flex; align-items: center; justify-content: space-between; margin-bottom: 18px; }
.modal-head h2 { margin: 0; font-size: 17px; }

/* ===== Link / share box ===== */
.link-box { background: var(--accent-50); border: 1px solid var(--accent-light); border-radius: var(--radius-md); padding: 18px; margin: 16px 0; }
.link-box p { margin: 0 0 8px; font-size: 13px; color: var(--ink-soft); }
.link-box code {
    display: block; background: white; padding: 10px 12px; border-radius: var(--radius-sm);
    margin: 8px 0 12px; word-break: break-all; font-size: 12.5px; border: 1px solid var(--border);
    color: var(--ink-soft);
}
.link-box .link-actions { display: flex; gap: 10px; }

.warning-text { color: var(--warning); font-size: 13.5px; background: var(--warning-bg); padding: 10px 14px; border-radius: var(--radius-sm); display: block; }
.client-block { border: 1px solid var(--border); border-radius: var(--radius-lg); padding: 20px 22px; margin-bottom: 16px; background: var(--surface); box-shadow: var(--shadow-sm); }
.client-block h3 { margin: 0 0 10px; font-size: 15.5px; }
.client-block ul { list-style: none; margin: 0 0 14px; padding: 0; display: flex; flex-direction: column; gap: 6px; }
.client-block li { font-size: 13.5px; color: var(--ink-soft); display: flex; align-items: center; gap: 8px; }
.client-block li .pin { color: var(--accent-dark); flex-shrink: 0; }
.client-block details summary { cursor: pointer; font-size: 13px; color: var(--accent-dark); font-weight: 700; list-style: none; }
.client-block details summary::-webkit-details-marker { display: none; }
.client-block details[open] summary { margin-bottom: 14px; }
.client-block .form-grid { margin-top: 10px; }
.client-block details + details { margin-top: 10px; }
.gst-line { display: flex; gap: 16px; flex-wrap: wrap; font-size: 12.5px; color: var(--muted); margin-bottom: 12px; }
.gst-line code { background: var(--bg); border: 1px solid var(--border); border-radius: 4px; padding: 1px 5px; }

.doc-list { display: flex; flex-direction: column; gap: 8px; margin-bottom: 4px; }
.doc-row { display: flex; align-items: center; gap: 12px; padding: 10px 12px; border: 1px solid var(--border-soft); border-radius: var(--radius-sm); }
.doc-icon { width: 34px; height: 34px; border-radius: 8px; background: var(--accent-50); color: var(--accent-dark); display: flex; align-items: center; justify-content: center; flex-shrink: 0; }
.doc-info { flex: 1; min-width: 0; }
.doc-name { font-size: 13.5px; font-weight: 600; color: var(--ink); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.doc-meta { font-size: 12px; color: var(--muted); margin-top: 2px; }

.tab-strip { display: flex; gap: 4px; margin-bottom: 18px; border-bottom: 1px solid var(--border); }
.tab-btn {
    background: none; border: none; cursor: pointer; font-family: inherit;
    padding: 10px 16px; font-size: 13.5px; font-weight: 700; color: var(--muted);
    border-bottom: 2px solid transparent; margin-bottom: -1px;
}
.tab-btn:hover { color: var(--ink); }
.tab-btn.active { color: var(--accent-dark); border-bottom-color: var(--accent); }

.support-fab {
    position: fixed; right: 20px; bottom: 90px; z-index: 30;
    display: flex; flex-direction: column; gap: 10px; align-items: flex-end;
}
.support-fab .fab-btn {
    width: 48px; height: 48px; border-radius: 50%; border: none; cursor: pointer;
    display: flex; align-items: center; justify-content: center;
    box-shadow: var(--shadow-md); color: white;
}
.support-fab .fab-whatsapp { background: #25D366; }
.support-fab .fab-bug { background: var(--ink-soft); }
.support-fab svg { width: 20px; height: 20px; }
@media (max-width: 900px) {
    .support-fab { bottom: 88px; right: 14px; }
}

/* ===== Roadmap ===== */
.roadmap-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(260px, 1fr)); gap: 16px; margin-top: 8px; }
.roadmap-card {
    background: var(--surface); border-radius: var(--radius-lg); padding: 20px;
    border: 1.5px dashed var(--border);
}
.roadmap-card .card-head { display: flex; align-items: flex-start; justify-content: space-between; gap: 10px; margin-bottom: 8px; }
.roadmap-card .soon-badge { flex-shrink: 0; white-space: nowrap; margin-top: 2px; }
.roadmap-card h3 { color: var(--ink); font-size: 15px; margin: 0; display: flex; align-items: center; gap: 10px; }
.roadmap-card h3 svg { width: 18px; height: 18px; color: var(--accent-dark); flex-shrink: 0; }
.roadmap-card p { color: var(--muted); font-size: 13px; margin: 0; line-height: 1.6; }

/* ===== Bottom tab bar — mobile nav, replaces the sidebar below 900px ===== */
.bottom-tabbar {
    display: none;
    position: fixed;
    left: 0; right: 0; bottom: 0;
    background: var(--surface);
    border-top: 1px solid var(--border);
    box-shadow: 0 -4px 20px rgba(15, 23, 42, 0.06);
    z-index: 20;
    padding: 6px 4px calc(6px + env(safe-area-inset-bottom, 0px));
    align-items: stretch;
    justify-content: space-around;
}
.tab-item {
    flex: 1;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 3px;
    padding: 6px 2px;
    color: var(--muted);
    text-decoration: none;
    font-size: 11px;
    font-weight: 600;
    background: none;
    border: none;
    cursor: pointer;
    border-radius: var(--radius-sm);
    font-family: inherit;
}
.tab-item svg { width: 21px; height: 21px; }
.tab-item.active { color: var(--accent-dark); }

.sheet-overlay {
    position: fixed; inset: 0; background: rgba(15, 23, 42, 0.45);
    z-index: 50; display: flex; align-items: flex-end;
    backdrop-filter: blur(2px);
}
.sheet-card {
    background: var(--surface);
    width: 100%;
    border-radius: 20px 20px 0 0;
    padding: 10px 10px calc(20px + env(safe-area-inset-bottom, 0px));
    box-shadow: var(--shadow-lg);
    animation: sheet-up 0.18s ease-out;
}
@keyframes sheet-up {
    from { transform: translateY(16px); opacity: 0.6; }
    to { transform: translateY(0); opacity: 1; }
}
.sheet-handle {
    width: 40px; height: 4px; border-radius: 999px;
    background: var(--border); margin: 4px auto 14px;
}
.sheet-item {
    display: flex; align-items: center; gap: 14px;
    padding: 14px 12px; border-radius: var(--radius-sm);
    color: var(--ink-soft); text-decoration: none;
    font-size: 15px; font-weight: 600;
}
.sheet-item svg { width: 20px; height: 20px; color: var(--accent-dark); }
.sheet-item:active { background: var(--accent-50); }

@media (max-width: 900px) {
    .sidenav { display: none; }
    .content { padding: 16px 16px calc(84px + env(safe-area-inset-bottom, 0px)); }
    .bottom-tabbar { display: flex; }
}

/* ===== Auth pages (login / signup) ===== */
.auth-page {
    min-height: 100vh;
    display: flex; align-items: center; justify-content: center;
    padding: 24px;
    background:
        radial-gradient(120% 60% at 50% -10%, var(--accent-light) 0%, transparent 60%),
        var(--bg);
}
.auth-card {
    width: 100%; max-width: 420px;
    background: var(--surface);
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-md);
    padding: 34px 32px;
}
.auth-brand {
    display: flex; align-items: center; gap: 10px;
    font-weight: 800; font-size: 17px; color: var(--ink);
    margin-bottom: 6px;
}
.auth-brand .logo-badge {
    width: 34px; height: 34px; border-radius: 10px;
    background: linear-gradient(135deg, var(--accent), var(--accent-dark));
    display: flex; align-items: center; justify-content: center;
    color: white; flex-shrink: 0;
}
.auth-title { font-size: 20px; font-weight: 800; color: var(--ink); margin: 18px 0 4px; }
.auth-sub { color: var(--muted); font-size: 13.5px; margin: 0 0 24px; }

.auth-error {
    background: var(--error-bg); color: var(--error);
    border-radius: var(--radius-sm); padding: 10px 14px;
    font-size: 13.5px; margin-bottom: 18px;
}

.auth-terms {
    background: var(--bg); border: 1px solid var(--border-soft);
    border-radius: var(--radius-sm); padding: 12px 14px;
    max-height: 130px; overflow-y: auto;
    font-size: 12px; color: var(--muted); line-height: 1.6;
    margin-bottom: 12px;
}

.auth-footer { margin-top: 22px; text-align: center; font-size: 13.5px; color: var(--muted); }
.auth-footer a { color: var(--accent-dark); font-weight: 700; text-decoration: none; }
.auth-footer a:hover { text-decoration: underline; }

.auth-page .btn-primary { width: 100%; justify-content: center; padding: 12px 20px; font-size: 14.5px; }

.auth-dev-panel {
    margin-top: 18px; padding: 14px 16px;
    border: 1.5px dashed var(--warning);
    border-radius: var(--radius-md);
    background: var(--warning-bg);
    text-align: center;
}
.auth-dev-panel p { font-size: 12.5px; color: var(--ink-soft); margin: 8px 0 12px; line-height: 1.5; }
.auth-dev-panel code { background: white; border: 1px solid var(--border); border-radius: 4px; padding: 1px 5px; }
.auth-dev-panel .btn-secondary { width: 100%; justify-content: center; }

.agency-banner {
    align-items: center; gap: 8px;
    background: var(--accent-50); color: var(--accent-dark);
    border: 1px solid var(--accent-light); border-radius: var(--radius-sm);
    padding: 9px 12px; font-size: 13px; font-weight: 700;
    margin: -6px 0 16px;
    animation: agency-banner-in 0.18s ease-out;
}
/* Equal-specificity tiebreak: without this, our own `display: flex` above would win
   the cascade over the browser's built-in `[hidden] { display: none }` rule (same
   specificity, but ours loads later) and the [hidden] attribute would silently stop
   hiding the element at all. */
.agency-banner:not([hidden]) { display: flex; }
.agency-banner svg { flex-shrink: 0; }
@keyframes agency-banner-in {
    from { opacity: 0; transform: translateY(-4px); }
    to { opacity: 1; transform: translateY(0); }
}

/* Blazor Server reconnect UI — replaces the framework's default full-screen
   "Attempting to reconnect..." overlay with a slim top-of-page sliding bar +
   status pill. Blazor only auto-injects its default modal when no element with
   id="components-reconnect-modal" exists in the DOM, so providing our own here
   (see _Host.cshtml) fully replaces it; blazor.server.js just toggles the
   components-reconnect-* classes below. */
#components-reconnect-modal {
    position: fixed; top: 0; left: 0; right: 0;
    z-index: 9999; pointer-events: none; display: none;
}
#components-reconnect-modal.components-reconnect-show,
#components-reconnect-modal.components-reconnect-failed,
#components-reconnect-modal.components-reconnect-rejected { display: block; }
#components-reconnect-modal .reconnect-bar {
    height: 3px; width: 100%;
    background: linear-gradient(90deg, transparent, var(--accent), var(--accent-dark), var(--accent), transparent);
    background-size: 200% 100%;
    animation: reconnect-slide 1.4s linear infinite;
}
@keyframes reconnect-slide {
    0% { background-position: 200% 0; }
    100% { background-position: -200% 0; }
}
#components-reconnect-modal .reconnect-label {
    pointer-events: auto;
    position: absolute; top: 10px; left: 50%; transform: translateX(-50%);
    display: flex; align-items: center; gap: 8px; white-space: nowrap;
    background: var(--ink); color: #fff;
    font-size: 12.5px; font-weight: 700;
    padding: 6px 14px; border-radius: 999px;
    box-shadow: var(--shadow-md);
}
#components-reconnect-modal .reconnect-label::before {
    content: ""; width: 7px; height: 7px; border-radius: 50%; flex-shrink: 0;
    background: #FBBF24; animation: reconnect-dot 1s ease-in-out infinite;
}
@keyframes reconnect-dot { 0%, 100% { opacity: 1; } 50% { opacity: 0.3; } }
#components-reconnect-modal .reconnect-text-failed,
#components-reconnect-modal .reconnect-text-rejected { display: none; }
#components-reconnect-modal.components-reconnect-failed .reconnect-text-show,
#components-reconnect-modal.components-reconnect-rejected .reconnect-text-show { display: none; }
#components-reconnect-modal.components-reconnect-failed .reconnect-text-failed { display: inline; }
#components-reconnect-modal.components-reconnect-rejected .reconnect-text-rejected { display: inline; }
#components-reconnect-modal.components-reconnect-failed .reconnect-bar,
#components-reconnect-modal.components-reconnect-rejected .reconnect-bar { animation: none; background: #DC2626; }
#components-reconnect-modal.components-reconnect-failed .reconnect-label::before,
#components-reconnect-modal.components-reconnect-rejected .reconnect-label::before { background: #DC2626; animation: none; }
#components-reconnect-modal .reconnect-label a { color: #93C5FD; text-decoration: underline; margin-left: 2px; }

/* Site-location confirm banner + modal (SiteLocationConfirmModal.razor) */
.site-loc-banner {
    display: flex; align-items: center; gap: 8px;
    background: var(--accent-50); color: var(--accent-dark);
    border: 1px solid var(--accent-light); border-radius: var(--radius-sm);
    padding: 9px 12px; font-size: 13px; font-weight: 700;
    margin: -6px 0 16px;
}
.site-loc-banner svg { flex-shrink: 0; }
.site-loc-banner span { flex: 1; }
.site-loc-banner-en { display: block; font-weight: 500; color: var(--muted); font-size: 12px; margin-top: 1px; }
.site-loc-compare { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; margin-top: 10px; }
.site-loc-option {
    border: 1px solid var(--border); border-radius: var(--radius-sm);
    padding: 10px 12px;
}
.site-loc-option.suggested { border-color: var(--accent-light); background: var(--accent-50); }
.site-loc-option-label { font-size: 11px; font-weight: 700; text-transform: uppercase; letter-spacing: 0.04em; color: var(--muted); margin-bottom: 6px; }

/* Location capture UI (Clients.razor add-site / edit-location) */
.loc-capture {
    background: var(--surface-alt); border: 1px dashed var(--border);
    border-radius: var(--radius-sm); padding: 12px; margin-top: 10px;
}
.loc-capture-status {
    display: flex; align-items: center; gap: 8px;
    font-size: 12.5px; font-weight: 600; margin-bottom: 10px;
}
.loc-capture-status.set { color: var(--accent-dark); }
.loc-capture-status.unset { color: var(--warning); }
