/* ==========================================================================
   Anand District Collector — Public Grievance & Follow-up Management
   UI kit (shell module). Plain CSS, no build step.
   ========================================================================== */

:root {
    --navy: #13294b;
    --navy-800: #0f2240;
    --navy-900: #0b1a33;
    --navy-600: #1c3a68;
    --primary: #13294b;
    --primary-hover: #0c1d38;
    --accent: #1f5fbf;          /* active nav, focus, links */
    --link: #1d5fbf;
    --link-hover: #154a96;

    --bg: #f4f6fa;
    --surface: #ffffff;
    --surface-2: #f8fafc;
    --border: #e3e8ef;
    --border-strong: #cfd8e3;
    --text: #0f1f3a;
    --text-2: #33435c;
    --muted: #5d6b82;
    --muted-2: #8592a6;

    --gray-bg: #eef1f5;   --gray-fg: #475569;   --gray-bd: #d9dfe7;
    --blue-bg: #e7f0ff;   --blue-fg: #1d55c4;   --blue-bd: #c3d7fb;
    --green-bg: #e2f5ea;  --green-fg: #157347;  --green-bd: #b8e3c9;
    --red-bg: #fde8e8;    --red-fg: #c02727;    --red-bd: #f6c2c2;
    --amber-bg: #fff2d9;  --amber-fg: #96560a;  --amber-bd: #f6d59a;
    --teal-bg: #ddf4f1;   --teal-fg: #0d6e66;   --teal-bd: #aee1da;
    --indigo-bg: #ecebff; --indigo-fg: #4338ca; --indigo-bd: #cfcbfb;
    --navy-bg: #e4eaf4;   --navy-fg: #13294b;   --navy-bd: #c3cfe2;

    --danger: #c62828;
    --success: #157347;
    --warning: #b45309;

    --radius: 12px;
    --radius-sm: 8px;
    --radius-xs: 6px;
    --shadow-sm: 0 1px 2px rgba(15, 31, 58, .05);
    --shadow: 0 1px 3px rgba(15, 31, 58, .06), 0 1px 2px rgba(15, 31, 58, .04);
    --shadow-lg: 0 12px 32px rgba(15, 31, 58, .16), 0 2px 6px rgba(15, 31, 58, .08);
    --focus: 0 0 0 3px rgba(31, 95, 191, .35);

    --sidebar-w: 232px;
    --topbar-h: 54px;
    --font: "Inter", "Noto Sans Gujarati", system-ui, -apple-system, "Segoe UI", Roboto, Arial, sans-serif;
}

/* ---------------------------------------------------------------- base */
*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
    margin: 0;
    font-family: var(--font);
    font-size: 14px;
    line-height: 1.5;
    color: var(--text);
    background: var(--bg);
    -webkit-font-smoothing: antialiased;
    text-rendering: optimizeLegibility;
}
body.locale-gu { line-height: 1.6; }
h1, h2, h3, h4, h5, h6 { margin: 0 0 .5em; line-height: 1.25; color: var(--text); font-weight: 700; }
p { margin: 0 0 .75em; }
a { color: var(--link); text-decoration: none; }
a:hover { color: var(--link-hover); text-decoration: underline; }
img, svg { vertical-align: middle; }
img { max-width: 100%; }
hr { border: 0; border-top: 1px solid var(--border); margin: 15px 0; }
small { font-size: 12px; }
code, kbd { font-family: ui-monospace, SFMono-Regular, Consolas, monospace; font-size: 12.5px; background: var(--gray-bg); padding: 1px 5px; border-radius: 4px; }
[hidden] { display: none !important; }
button { font-family: inherit; font-size: inherit; }
:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
.icon { flex-shrink: 0; }

.sr-only { position: absolute !important; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip: rect(0, 0, 0, 0); white-space: nowrap; border: 0; }
.skip-link { position: absolute; left: 12px; top: -48px; z-index: 1000; background: var(--navy); color: #fff; padding: 8px 14px; border-radius: 8px; }
.skip-link:focus { top: 12px; color: #fff; }

/* ---------------------------------------------------------------- app shell */
.app-shell { min-height: 100vh; }
.app-main { margin-left: var(--sidebar-w); min-height: 100vh; display: flex; flex-direction: column; min-width: 0; }
.app-content { flex: 1; padding: 20px 22.5px 22.5px; max-width: 1680px; width: 100%; outline: none; }
.app-footer { padding: 10px 22.5px 15px; font-size: 11.5px; color: var(--muted-2); display: flex; gap: 8px; }

/* sidebar */
.sidebar {
    position: fixed; inset: 0 auto 0 0; width: var(--sidebar-w); z-index: 60;
    background: linear-gradient(180deg, #16305a 0%, var(--navy) 45%, #102443 100%);
    color: #dbe4f3; display: flex; flex-direction: column; overflow-y: auto;
}
.sidebar-brand { display: flex; align-items: center; gap: 12px; padding: 17.5px 19px 19px; color: #fff; text-decoration: none; }
.sidebar-brand:hover { color: #fff; text-decoration: none; }
.sidebar-emblem { width: 38.5px; height: 38.5px; }
.sidebar-brand-text { display: flex; flex-direction: column; line-height: 1.15; }
.brand-title { font-size: 17px; font-weight: 800; letter-spacing: .02em; }
.brand-sub { font-size: 14.5px; font-weight: 500; color: #e6edf8; }
.sidebar-close, .sidebar-close.btn-icon { display: none; position: absolute; top: 14px; right: 12px; color: #fff; background: transparent; border: 0; }
.sidebar-nav { flex: 1; display: flex; flex-direction: column; padding: 4px 10px 16.5px; }
.nav-list { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 4px; }
.nav-bottom { margin-top: auto; padding-top: 14px; position: relative; }
.nav-bottom::before { content: ""; position: absolute; top: 0; left: 8px; right: 8px; border-top: 1px solid rgba(255, 255, 255, .14); }.nav-divider { border-top-color: rgba(255, 255, 255, .14); margin: 14px 4px; }
.nav-link {
    display: flex; align-items: center; gap: 14px; padding: 12px 14px; border-radius: 8px;
    color: #e4ebf6; font-size: 14.5px; font-weight: 500; text-decoration: none; transition: background .15s;
}
.nav-link .icon { color: #c9d6ea; }
.nav-link:hover { background: rgba(255, 255, 255, .08); color: #fff; text-decoration: none; }
.nav-link.is-active { background: var(--accent); color: #fff; box-shadow: 0 2px 6px rgba(0, 0, 0, .18); }
.nav-link.is-active .icon { color: #fff; }
.nav-link:focus-visible { outline: 2px solid #fff; outline-offset: -2px; }
.sidebar-backdrop { display: none; }

/* topbar */
.topbar {
    position: sticky; top: 0; z-index: 40; height: var(--topbar-h);
    display: flex; align-items: center; gap: 15px; padding: 0 17.5px 0 20px;
    background: #fff; border-bottom: 1px solid var(--border);
}
.topbar-menu, .topbar-menu.btn-icon { display: none; }
.breadcrumbs { min-width: 0; flex: 1; }
.breadcrumbs ol { list-style: none; margin: 0; padding: 0; display: flex; align-items: center; flex-wrap: nowrap; overflow: hidden; }
.breadcrumbs li { display: flex; align-items: center; white-space: nowrap; font-size: 14px; color: var(--muted); min-width: 0; }
.breadcrumbs li:last-child { overflow: hidden; }
.breadcrumbs a { color: var(--muted); }
.breadcrumbs a:hover { color: var(--link); }
.breadcrumbs [aria-current] { color: var(--text); font-weight: 500; overflow: hidden; text-overflow: ellipsis; }
.crumb-sep { margin: 0 10px; color: var(--muted-2); }
.topbar-right { display: flex; align-items: center; gap: 12px; margin-left: auto; }
.topbar-search { position: relative; display: flex; align-items: center; width: 340px; }
.topbar-search .icon { position: absolute; left: 12px; color: var(--muted); pointer-events: none; }
.topbar-search input {
    width: 100%; height: 34px; border: 1px solid var(--border-strong); border-radius: 8px;
    padding: 0 12px 0 28.5px; font: inherit; font-size: 13.5px; color: var(--text); background: #fff;
}
.topbar-search input::placeholder { color: var(--muted-2); }
.topbar-search input:focus { outline: none; border-color: var(--accent); box-shadow: var(--focus); }
.topbar-search-mobile, .topbar-search-mobile.btn-icon { display: none; }
.topbar-btn {
    display: inline-flex; align-items: center; gap: 8px; height: 35px; padding: 0 12px;
    border: 1px solid var(--border-strong); border-radius: 8px; background: #fff; color: var(--text); cursor: pointer; font-size: 14px;
}
.topbar-btn:hover { background: var(--surface-2); }
.topbar-bell { position: relative; color: var(--text-2); }
.bell-count {
    position: absolute; top: 2px; right: 0; transform: translateX(30%); box-sizing: border-box; min-width: 19px; height: 19px; padding: 0 4px; border-radius: 10px;
    background: #d92d20; color: #fff; font-size: 10.5px; font-weight: 700; line-height: 15px; text-align: center; border: 2px solid #fff;
}
.user-btn { display: flex; align-items: center; gap: 10px; background: none; border: 0; padding: 4px 6px; border-radius: 10px; cursor: pointer; color: var(--text); text-align: left; }
.user-btn:hover { background: var(--surface-2); }
.user-meta { display: flex; flex-direction: column; line-height: 1.2; max-width: 190px; }
.user-name { font-weight: 600; font-size: 13.5px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.user-role { font-size: 12.5px; color: var(--muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }

.avatar {
    display: inline-flex; align-items: center; justify-content: center; flex-shrink: 0;
    width: 33.5px; height: 33.5px; border-radius: 50%; background: #1d4f91; color: #fff; font-weight: 600; font-size: 13.5px; letter-spacing: .02em;
}
.avatar-sm { width: 28px; height: 28px; font-size: 11.5px; }
.avatar-lg { width: 39.5px; height: 39.5px; font-size: 15px; }

/* ---------------------------------------------------------------- dropdowns */
.dropdown { position: relative; }
.dropdown-menu {
    position: absolute; top: calc(100% + 6px); left: 0; z-index: 80; min-width: 190px; padding: 6px;
    background: #fff; border: 1px solid var(--border); border-radius: 10px; box-shadow: var(--shadow-lg);
    display: none;
}
.dropdown.is-open > .dropdown-menu { display: block; }
.dropdown-right { left: auto; right: 0; }
.dropdown-item {
    display: flex; align-items: center; gap: 10px; width: 100%; padding: 9px 10px; border-radius: 6px;
    color: var(--text); font-size: 14px; background: none; border: 0; cursor: pointer; text-align: left; text-decoration: none;
}
.dropdown-item:hover, .dropdown-item:focus-visible { background: var(--surface-2); text-decoration: none; color: var(--text); }
.dropdown-item.is-active { font-weight: 600; color: var(--accent); }
.dropdown-item.text-danger { color: var(--danger); }
.dropdown-divider { border-top: 1px solid var(--border); margin: 6px 0; }
.dropdown-header { display: flex; align-items: center; justify-content: space-between; gap: 10px; padding: 8px 10px 10px; border-bottom: 1px solid var(--border); margin: -6px -6px 6px; padding-top: 12px; }
.dropdown-header form { margin: 0; }
.dropdown-footer { display: flex; align-items: center; justify-content: center; gap: 6px; padding: 10px; margin: 6px -6px -6px; border-top: 1px solid var(--border); font-size: 13.5px; font-weight: 500; }
.dropdown-empty { padding: 16.5px 10px; text-align: center; color: var(--muted); font-size: 13.5px; }
.dropdown-notifications { width: 360px; max-width: calc(100vw - 24px); }
.dropdown-user { width: 290px; }
.dropdown-profile { display: flex; gap: 12px; padding: 10px 10px 12px; border-bottom: 1px solid var(--border); margin-bottom: 6px; }
.notif-item-form { margin: 0; }
.notif-item { display: flex; gap: 10px; width: 100%; padding: 10px; border: 0; background: none; border-radius: 8px; text-align: left; cursor: pointer; color: var(--text); }
.notif-item:hover { background: var(--surface-2); }
.notif-dot { width: 8px; height: 8px; border-radius: 50%; margin-top: 6px; flex-shrink: 0; background: transparent; }
.notif-item.is-unread .notif-dot { background: var(--accent); }
.notif-item.is-unread .notif-title { font-weight: 600; }
.notif-text { display: flex; flex-direction: column; gap: 2px; min-width: 0; }
.notif-title { font-size: 13.5px; }
.notif-body { font-size: 12.5px; color: var(--muted); }
.notif-time { font-size: 12px; color: var(--muted-2); }
.link-btn { background: none; border: 0; padding: 0; color: var(--link); cursor: pointer; font: inherit; }
.link-btn:hover { text-decoration: underline; }

/* ---------------------------------------------------------------- page header */
.page-header { display: flex; align-items: flex-start; justify-content: space-between; gap: 15px 20px; margin-bottom: 17.5px; flex-wrap: wrap; }
.page-header-main { min-width: 0; }
.page-title-row { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; }
.page-title { font-size: 22px; font-weight: 800; letter-spacing: -.02em; margin: 0; color: var(--navy-900); }
.page-badges { display: flex; gap: 8px; flex-wrap: wrap; }
.page-badges .badge { font-size: 14px; padding: 5px 12px; }
.page-subtitle { margin: 4px 0 0; font-size: 15px; color: var(--muted); }
.page-meta { margin: 6px 0 0; font-size: 14px; color: var(--muted); }
.page-back { display: inline-flex; align-items: center; gap: 6px; font-size: 13.5px; margin-bottom: 6px; color: var(--muted); }
.page-actions { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; }
.page-actions .btn { height: 34px; padding: 0 15px; font-size: 13.5px; }
.subtitle-sep { display: inline-block; margin: 0 12px; color: var(--muted-2); }

/* ---------------------------------------------------------------- layout helpers */
.grid { display: grid; gap: 17.5px; }
.grid-2 { display: grid; gap: 17.5px; grid-template-columns: repeat(2, minmax(0, 1fr)); }
.grid-3 { display: grid; gap: 17.5px; grid-template-columns: repeat(3, minmax(0, 1fr)); }
.grid-4 { display: grid; gap: 15px; grid-template-columns: repeat(4, minmax(0, 1fr)); }
.grid-main-side { display: grid; gap: 17.5px; grid-template-columns: minmax(0, 2fr) minmax(0, 1fr); align-items: start; }
.grid-side-main { display: grid; gap: 17.5px; grid-template-columns: minmax(0, 1fr) minmax(0, 2fr); align-items: start; }
.grid > *, .grid-2 > *, .grid-3 > *, .grid-4 > *, .grid-main-side > *, .grid-side-main > * { min-width: 0; }
.stack { display: flex; flex-direction: column; gap: 15px; }
.stack > * { margin-top: 0; margin-bottom: 0; }
.stack-lg { display: flex; flex-direction: column; gap: 17.5px; }
.stack-sm { display: flex; flex-direction: column; gap: 8px; }
.stack-sm > * { margin: 0; }
.row { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.row-between { display: flex; align-items: center; justify-content: space-between; gap: 10px; flex-wrap: wrap; }
.row-top { align-items: flex-start; }
.row-nowrap { flex-wrap: nowrap; }
.row > .input-icon, .row > .form-control { flex: 1 1 160px; min-width: 0; }
.ml-auto { margin-left: auto; }
.mt-0 { margin-top: 0 !important; } .mt-1 { margin-top: 4px !important; } .mt-2 { margin-top: 8px !important; } .mt-3 { margin-top: 15px !important; } .mt-4 { margin-top: 20px !important; }
.mb-0 { margin-bottom: 0 !important; } .mb-1 { margin-bottom: 4px !important; } .mb-2 { margin-bottom: 8px !important; } .mb-3 { margin-bottom: 15px !important; } .mb-4 { margin-bottom: 20px !important; }
.p-0 { padding: 0 !important; }
.pt-0 { padding-top: 0 !important; }
.ml-1 { margin-left: 4px; } .ml-2 { margin-left: 8px; }
.gap-sm { gap: 6px !important; }
.w-full { width: 100%; }
.text-right { text-align: right; }
.text-center { text-align: center; }
.nowrap { white-space: nowrap; }
.truncate { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.flex-1 { flex: 1; min-width: 0; }

/* text */
.text-muted { color: var(--muted) !important; }
.text-sm { font-size: 13px; }
.text-xs { font-size: 12px; }
.text-lg { font-size: 15px; }
.text-danger { color: var(--danger) !important; }
.text-success { color: var(--success) !important; }
.text-warning { color: var(--warning) !important; }
.text-navy { color: var(--navy) !important; }
.fw-400 { font-weight: 400; }
.fw-500 { font-weight: 500; }
.fw-600 { font-weight: 600; }
.fw-700 { font-weight: 700; }
.h1 { font-size: 21px; font-weight: 800; }
.h2 { font-size: 17px; font-weight: 700; }
.h3 { font-size: 15px; font-weight: 700; }
.section-title { font-size: 14.5px; font-weight: 700; margin: 0 0 12px; display: flex; align-items: center; gap: 10px; }

/* ---------------------------------------------------------------- buttons */
.btn {
    display: inline-flex; align-items: center; justify-content: center; gap: 8px;
    height: 34px; padding: 0 14px; border-radius: 8px; border: 1px solid transparent;
    font-family: inherit; font-size: 13.5px; font-weight: 600; line-height: 1; white-space: nowrap;
    cursor: pointer; text-decoration: none; transition: background .15s, border-color .15s, color .15s, box-shadow .15s;
    background: #fff; color: var(--text);
}
.btn:hover { text-decoration: none; }
.btn:focus-visible { outline: none; box-shadow: var(--focus); }
.btn:disabled, .btn.is-disabled { opacity: .55; cursor: not-allowed; pointer-events: none; }
.btn-primary { background: var(--primary); color: #fff; border-color: var(--primary); }
.btn-primary:hover { background: var(--primary-hover); color: #fff; }
.btn-outline { background: #fff; color: var(--navy); border-color: #3b5f95; }
.btn-outline:hover { background: #f1f5fb; color: var(--navy); }
.btn-ghost { background: transparent; color: var(--text-2); border-color: transparent; }
.btn-ghost:hover { background: var(--gray-bg); color: var(--text); }
.btn-danger { background: var(--danger); border-color: var(--danger); color: #fff; }
.btn-danger:hover { background: #a61f1f; color: #fff; }
.btn-success { background: #198754; border-color: #198754; color: #fff; }
.btn-success:hover { background: #136b42; color: #fff; }
.btn-warning { background: #f59e0b; border-color: #f59e0b; color: #1f1300; }
.btn-warning:hover { background: #d98a05; color: #1f1300; }
.btn-light { background: var(--blue-bg); border-color: var(--blue-bd); color: var(--blue-fg); }
.btn-light:hover { background: #d9e7ff; color: var(--blue-fg); }
.btn-outline-danger { background: #fff; color: var(--danger); border-color: #e7a3a3; }
.btn-outline-danger:hover { background: var(--red-bg); color: var(--danger); }
.btn-sm { height: 28px; padding: 0 10px; font-size: 12.5px; border-radius: 6px; gap: 6px; }
.btn-xs { height: 24px; padding: 0 8px; font-size: 11.5px; border-radius: 6px; gap: 4px; }
.btn-lg { height: 38px; padding: 0 18px; font-size: 14px; }
.btn-block { display: flex; width: 100%; }
.btn-icon { display: inline-flex; align-items: center; justify-content: center; width: 32px; height: 32px; padding: 0; border-radius: 8px; background: transparent; border: 0; color: var(--text-2); cursor: pointer; }
.btn.btn-icon { border: 1px solid transparent; }
.btn-icon:hover { background: var(--gray-bg); color: var(--text); }
.btn-icon.btn-sm { width: 28px; height: 28px; }
.btn-group { display: inline-flex; gap: 8px; flex-wrap: wrap; }
.is-loading { position: relative; color: transparent !important; }
.is-loading::after { content: ""; position: absolute; width: 16px; height: 16px; border: 2px solid currentColor; border-color: #fff transparent #fff transparent; border-radius: 50%; animation: spin .7s linear infinite; }
.btn-outline.is-loading::after, .btn-ghost.is-loading::after { border-color: var(--navy) transparent var(--navy) transparent; }
@keyframes spin { to { transform: rotate(360deg); } }

.link-more { display: inline-flex; align-items: center; gap: 6px; font-size: 13.5px; font-weight: 500; white-space: nowrap; }

/* ---------------------------------------------------------------- cards */
.card { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); box-shadow: var(--shadow-sm); min-width: 0; }
.card-header { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 15px 17.5px; border-bottom: 1px solid var(--border); flex-wrap: wrap; }
.card-heading { display: flex; align-items: center; gap: 12px; min-width: 0; }
.card-icon { color: var(--navy); display: inline-flex; }
.card-title { font-size: 15.5px; font-weight: 700; margin: 0; color: var(--navy-900); }
.card-title small, .card-title .text-muted { font-weight: 500; font-size: 14px; }
.card-subtitle { margin: 2px 0 0; font-size: 13px; color: var(--muted); }
.card-actions { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.card-body { padding: 16.5px 17.5px; }
.card-flush > .card-body { padding: 0; }
.card-footer { padding: 12px 17.5px; border-top: 1px solid var(--border); background: var(--surface-2); border-radius: 0 0 var(--radius) var(--radius); }
.card-flush .table-wrap { border: 0; border-radius: 0; }
.card-flush .pagination-bar { padding: 12px 17.5px; border-top: 1px solid var(--border); }
.card-section + .card-section { border-top: 1px solid var(--border); margin-top: 16.5px; padding-top: 16.5px; }
.card-tinted { background: var(--surface-2); }

/* ---------------------------------------------------------------- stat cards */
.stat-card {
    display: flex; align-items: flex-start; gap: 16.5px; padding: 16.5px 17.5px; background: #fff;
    border: 1px solid var(--border); border-radius: var(--radius); box-shadow: var(--shadow-sm); color: var(--text); min-width: 0;
}
a.stat-card:hover { text-decoration: none; color: var(--text); border-color: var(--border-strong); box-shadow: var(--shadow); }
.stat-icon { display: inline-flex; align-items: center; justify-content: center; width: 50.5px; height: 50.5px; border-radius: 10px; flex-shrink: 0; }
.stat-body { display: flex; flex-direction: column; min-width: 0; padding-top: 2px; }
.stat-label { font-size: 14px; font-weight: 500; color: var(--text-2); }
.stat-value { font-size: 22px; font-weight: 800; line-height: 1.15; color: var(--navy-900); letter-spacing: -.01em; }
.stat-trend { display: inline-flex; align-items: center; gap: 3px; font-size: 13px; font-weight: 600; margin-top: 2px; }
.stat-hint { font-size: 12.5px; color: var(--muted); margin-top: 2px; }
.stat-blue .stat-icon { background: var(--blue-bg); color: var(--blue-fg); }
.stat-green .stat-icon { background: var(--green-bg); color: var(--green-fg); }
.stat-red .stat-icon { background: var(--red-bg); color: var(--red-fg); }
.stat-amber .stat-icon { background: var(--amber-bg); color: var(--amber-fg); }
.stat-teal .stat-icon { background: var(--teal-bg); color: var(--teal-fg); }
.stat-indigo .stat-icon { background: var(--indigo-bg); color: var(--indigo-fg); }
.stat-gray .stat-icon { background: var(--gray-bg); color: var(--gray-fg); }
.stat-navy .stat-icon { background: var(--navy-bg); color: var(--navy-fg); }
.stat-filled { align-items: center; }
.stat-filled .stat-icon { border-radius: 50%; background: #fff !important; border: 1px solid currentColor; width: 49px; height: 49px; }
.stat-filled.stat-blue { background: #f0f5ff; border-color: var(--blue-bd); }
.stat-filled.stat-green { background: #effaf4; border-color: var(--green-bd); }
.stat-filled.stat-red { background: #fdf0f0; border-color: var(--red-bd); }
.stat-filled.stat-red .stat-value { color: var(--red-fg); }
.stat-filled.stat-amber { background: #fff8ec; border-color: var(--amber-bd); }
.stat-filled.stat-amber .stat-value { color: var(--amber-fg); }
.stat-filled.stat-teal { background: #eefaf8; border-color: var(--teal-bd); }
.stat-filled.stat-teal .stat-value { color: var(--teal-fg); }
.stat-filled.stat-indigo { background: #f4f3ff; border-color: var(--indigo-bd); }
.stat-filled.stat-gray { background: var(--surface-2); }

/* ---------------------------------------------------------------- badges & pills */
.badge {
    display: inline-flex; align-items: center; gap: 5px; padding: 3px 10px; border-radius: 6px;
    font-size: 12.5px; font-weight: 600; line-height: 1.45; white-space: nowrap; border: 1px solid transparent;
    background: var(--gray-bg); color: var(--gray-fg); vertical-align: middle;
}
.badge-gray { background: var(--gray-bg); color: var(--gray-fg); border-color: var(--gray-bd); }
.badge-blue { background: var(--blue-bg); color: var(--blue-fg); border-color: var(--blue-bd); }
.badge-green { background: var(--green-bg); color: var(--green-fg); border-color: var(--green-bd); }
.badge-red { background: var(--red-bg); color: var(--red-fg); border-color: var(--red-bd); }
.badge-amber { background: var(--amber-bg); color: var(--amber-fg); border-color: var(--amber-bd); }
.badge-teal { background: var(--teal-bg); color: var(--teal-fg); border-color: var(--teal-bd); }
.badge-indigo { background: var(--indigo-bg); color: var(--indigo-fg); border-color: var(--indigo-bd); }
.badge-navy { background: var(--navy); color: #fff; border-color: var(--navy); }
.badge-dot::before { content: ""; width: 7px; height: 7px; border-radius: 50%; background: currentColor; flex-shrink: 0; }
.badge-lg { font-size: 14px; padding: 5px 12px; }
.badge-sm { font-size: 11.5px; padding: 1px 7px; }
.badge-outline { background: #fff; }
.pill {
    display: inline-flex; align-items: center; justify-content: center; min-width: 22px; height: 20px; padding: 0 7px;
    border-radius: 10px; font-size: 12px; font-weight: 600; background: var(--gray-bg); color: var(--gray-fg);
}
.pill-blue { background: var(--blue-bg); color: var(--blue-fg); }
.pill-red { background: var(--red-bg); color: var(--red-fg); }
.pill-green { background: var(--green-bg); color: var(--green-fg); }
.pill-amber { background: var(--amber-bg); color: var(--amber-fg); }
.pill-navy { background: var(--navy); color: #fff; }
.chip {
    display: inline-flex; align-items: center; gap: 6px; padding: 4px 6px 4px 10px; border-radius: 16px;
    background: var(--navy-bg); color: var(--navy); font-size: 13px; font-weight: 500; border: 1px solid var(--navy-bd);
}
.chip button, .chip .chip-remove { display: inline-flex; background: none; border: 0; padding: 2px; border-radius: 50%; cursor: pointer; color: inherit; }
.chip button:hover, .chip .chip-remove:hover { background: rgba(19, 41, 75, .12); }
.due-overdue, .cell-sub.due-overdue { color: var(--danger); font-weight: 500; }
.due-soon, .cell-sub.due-soon { color: var(--warning); font-weight: 500; }
.due-ok { color: var(--muted); }

/* ---------------------------------------------------------------- tables */
.table-wrap { width: 100%; overflow-x: auto; border: 1px solid var(--border); border-radius: 10px; background: #fff; -webkit-overflow-scrolling: touch; }
.table { width: 100%; border-collapse: collapse; font-size: 14px; }
.table th {
    text-align: left; font-weight: 600; font-size: 13.5px; color: var(--text-2); background: #f6f8fb;
    padding: 11px 14px; border-bottom: 1px solid var(--border); white-space: nowrap; vertical-align: middle;
}
.table th a { color: inherit; display: inline-flex; align-items: center; gap: 4px; }
.table th a:hover { color: var(--link); text-decoration: none; }
.table td { padding: 12px 14px; border-bottom: 1px solid var(--border); vertical-align: middle; color: var(--text); }
.table tbody tr:last-child td { border-bottom: 0; }
.table-hover tbody tr:hover td { background: #f8fafd; }
.table-compact th { padding: 8px 12px; font-size: 12.5px; }
.table-compact td { padding: 8px 12px; font-size: 13.5px; }
.table-striped tbody tr:nth-child(even) td { background: #fafbfd; }
.table .text-right, .table th.text-right { text-align: right; }
.table .col-check { width: 36px; }
.table .col-actions { width: 1%; white-space: nowrap; text-align: right; }
.table tr.is-overdue td:first-child { box-shadow: inset 3px 0 0 var(--danger); }
.table tr.is-selected td { background: #eef4ff; }
.table tfoot td { font-weight: 600; background: #f6f8fb; }
.cell-title { display: block; font-weight: 600; color: var(--text); line-height: 1.35; }
.cell-sub { display: block; font-size: 12.5px; color: var(--muted); line-height: 1.35; margin-top: 1px; }
a.token-link { font-weight: 500; color: var(--link); text-decoration: underline; text-decoration-color: rgba(29, 95, 191, .35); text-underline-offset: 3px; white-space: nowrap; }
a.token-link:hover { text-decoration-color: currentColor; }
.sticky-actions { position: sticky; right: 0; background: inherit; }
.table td.sticky-actions { background: #fff; box-shadow: -6px 0 8px -6px rgba(15, 31, 58, .12); }
.table th.sticky-actions { background: #f6f8fb; }
.th-sort { display: inline-flex; align-items: center; gap: 4px; }

/* filter bar */
.filter-bar { display: flex; align-items: flex-end; gap: 12px; flex-wrap: wrap; padding: 14px 15px; background: #fff; border: 1px solid var(--border); border-radius: var(--radius); margin-bottom: 15px; }
.filter-bar .form-field { margin: 0; min-width: 150px; flex: 1 1 160px; }
.filter-bar .form-label { font-size: 12.5px; margin-bottom: 4px; color: var(--muted); font-weight: 500; }
.filter-bar .form-control { height: 35px; }
.filter-bar .filter-search { flex: 2 1 240px; }
.filter-bar .filter-actions { display: flex; gap: 8px; align-items: center; }
.card .filter-bar { border: 0; border-bottom: 1px solid var(--border); border-radius: 0; margin: 0; }

/* bulk bar */
.bulk-bar { display: flex; align-items: center; gap: 12px; padding: 10px 15px; background: var(--navy); color: #fff; border-radius: 10px; margin-bottom: 12px; flex-wrap: wrap; }

/* ---------------------------------------------------------------- forms */
.form-field { margin-bottom: 15px; min-width: 0; }
.form-field:last-child { margin-bottom: 0; }
.form-label { display: block; font-size: 14px; font-weight: 500; color: var(--text-2); margin-bottom: 6px; }
.form-label.required::after { content: " *"; color: var(--danger); font-weight: 600; }
.form-control {
    display: block; width: 100%; height: 34px; padding: 7px 11px; font: inherit; font-size: 14px; color: var(--text);
    background: #fff; border: 1px solid var(--border-strong); border-radius: 8px; transition: border-color .15s, box-shadow .15s;
}
.form-control::placeholder { color: var(--muted-2); }
.form-control:hover { border-color: #b8c3d3; }
.form-control:focus { outline: none; border-color: var(--accent); box-shadow: var(--focus); }
.form-control:disabled, .form-control[readonly] { background: var(--surface-2); color: var(--muted); }
.form-control.is-invalid { border-color: var(--danger); }
.form-control.is-invalid:focus { box-shadow: 0 0 0 3px rgba(198, 40, 40, .2); }
textarea.form-control { height: auto; min-height: 62.5px; resize: vertical; line-height: 1.5; }
select.form-control, .form-select {
    appearance: none; -webkit-appearance: none; padding-right: 27px; cursor: pointer;
    background-image: 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='%2333435c' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpolyline points='6 9 12 15 18 9'/%3E%3C/svg%3E");
    background-repeat: no-repeat; background-position: right 12px center;
}

/* searchable select (app.js wraps long / dependent / creatable selects; the native select stays for the form) */
.ss { position: relative; min-width: 0; }
.ss-native { position: absolute !important; left: 0; bottom: 0; width: 100% !important; height: 1px !important; min-height: 0 !important; padding: 0 !important; border: 0 !important; opacity: 0; pointer-events: none; }
.ss-trigger { display: flex; align-items: center; justify-content: space-between; gap: 8px; text-align: left; cursor: pointer; padding-right: 10px; }
.ss-value { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; color: var(--text); }
.ss-trigger.is-placeholder .ss-value { color: var(--muted-2); }
.ss-chevron { flex-shrink: 0; color: var(--text-2); transition: transform .15s; }
.ss.is-open .ss-chevron { transform: rotate(180deg); }
.ss.is-open .ss-trigger { border-color: var(--accent); box-shadow: var(--focus); }
.ss-trigger:focus-visible { outline: none; border-color: var(--accent); box-shadow: var(--focus); }
.ss.is-disabled .ss-trigger { background: var(--surface-2); cursor: not-allowed; }
.ss.is-disabled .ss-value { color: var(--muted-2); }
.ss-trigger.is-invalid { border-color: var(--danger); }
.ss-panel { position: absolute; z-index: 70; top: calc(100% + 4px); left: 0; right: 0; min-width: 220px; padding: 6px; background: #fff; border: 1px solid var(--border-strong); border-radius: 8px; box-shadow: var(--shadow-lg); }
.ss.ss-up .ss-panel { top: auto; bottom: calc(100% + 4px); }
.ss-search-wrap { position: relative; margin-bottom: 4px; }
.ss-search-wrap svg { position: absolute; left: 9px; top: 50%; transform: translateY(-50%); color: var(--muted); pointer-events: none; }
.ss-search { width: 100%; height: 32px; padding: 0 10px 0 30px; font: inherit; font-size: 13.5px; color: var(--text); border: 1px solid var(--border-strong); border-radius: 6px; background: #fff; }
.ss-search:focus { outline: none; border-color: var(--accent); box-shadow: var(--focus); }
.ss-list { list-style: none; margin: 0; padding: 0; max-height: 240px; overflow-y: auto; }
.ss-option { padding: 7px 10px; border-radius: 6px; font-size: 13.5px; line-height: 1.35; cursor: pointer; color: var(--text); }
.ss-option.is-active { background: var(--blue-bg); }
.ss-option.is-selected { font-weight: 600; color: var(--blue-fg); }
.ss-option.is-placeholder { color: var(--muted); }
.ss-option.is-disabled { color: var(--muted-2); cursor: not-allowed; }
.ss-empty { margin: 4px 0; padding: 7px 10px; font-size: 13px; color: var(--muted); }
.ss-create { display: block; width: 100%; margin-top: 4px; padding: 8px 10px; text-align: left; font: inherit; font-size: 13.5px; font-weight: 600; color: var(--link); background: none; border: 0; border-top: 1px dashed var(--border-strong); border-radius: 0 0 6px 6px; cursor: pointer; }
.ss-create:hover, .ss-create.is-active { background: var(--blue-bg); }
.ss-create:disabled { opacity: .6; cursor: progress; }
.ss-msg { margin: 6px 4px 2px; font-size: 12.5px; color: var(--danger); }
select[multiple].form-control { height: auto; min-height: 72px; background-image: none; padding-right: 12px; }
input[type="date"].form-control, input[type="time"].form-control, input[type="datetime-local"].form-control { cursor: text; }
input[type="file"].form-control { height: auto; padding: 7px 10px; }
.form-control-sm { height: 31px; padding: 4px 10px; font-size: 13px; }
.form-control-wrap { min-width: 0; }
.form-hint { margin: 5px 0 0; font-size: 12.5px; color: var(--muted); }
.form-error { display: flex; align-items: center; gap: 5px; margin: 5px 0 0; font-size: 12.5px; color: var(--danger); font-weight: 500; }
.char-counter { margin: 4px 0 0; text-align: right; font-size: 12px; color: var(--muted-2); }
.char-counter.is-near { color: var(--warning); }
.char-counter.is-full { color: var(--danger); }
.form-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 0 17.5px; }
.form-grid .span-2, .form-grid .col-span-2 { grid-column: 1 / -1; }
.form-grid-3 { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 0 17.5px; }
.form-row { display: grid; grid-template-columns: 160px minmax(0, 1fr); gap: 6px 15px; align-items: start; margin-bottom: 12px; }
.form-row > .form-label { margin: 0; padding-top: 9px; }
.form-row-wide { grid-template-columns: 200px minmax(0, 1fr); }
.form-actions { display: flex; align-items: center; justify-content: flex-end; gap: 12px; padding-top: 15px; flex-wrap: wrap; }
.form-actions-bar {
    position: sticky; bottom: 0; z-index: 30; display: flex; justify-content: flex-end; gap: 12px; flex-wrap: wrap;
    margin: 17.5px -28px -28px; padding: 14px 22.5px; background: #fff; border-top: 1px solid var(--border); box-shadow: 0 -4px 12px rgba(15, 31, 58, .05);
}
.form-section-title { font-size: 13px; font-weight: 700; text-transform: uppercase; letter-spacing: .04em; color: var(--muted); margin: 8px 0 12px; }
fieldset { border: 0; padding: 0; margin: 0; min-width: 0; }
legend { padding: 0; }

.input-icon { position: relative; display: block; }
.input-icon > .icon { position: absolute; left: 12px; top: 50%; transform: translateY(-50%); color: var(--muted); pointer-events: none; }
.input-icon > .form-control { padding-left: 29.5px; }
.input-icon .input-action { position: absolute; right: 6px; top: 50%; transform: translateY(-50%); }
.input-icon.has-action > .form-control { padding-right: 32px; }
.input-group { display: flex; align-items: stretch; }
.input-group > .form-control { border-top-right-radius: 0; border-bottom-right-radius: 0; flex: 1; }
.input-group > .btn { border-top-left-radius: 0; border-bottom-left-radius: 0; height: auto; }

/* checkbox & radio */
.checkbox, .radio { display: inline-flex; align-items: center; gap: 9px; cursor: pointer; font-size: 14px; color: var(--text); user-select: none; }
.checkbox input, .radio input { width: 18px; height: 18px; margin: 0; accent-color: var(--accent); cursor: pointer; flex-shrink: 0; }
.checkbox input:focus-visible, .radio input:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
.checkbox-list { display: flex; flex-direction: column; gap: 10px; }
.checkbox-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); gap: 10px 15px; }

/* switch: <label class="switch"><input type="checkbox"><span></span></label> */
/* Geometry comes from three variables, so the knob always travels exactly to the end of the track. */
.switch { --sw-w: 36px; --sw-h: 20px; --sw-pad: 2px; --sw-knob: calc(var(--sw-h) - 2 * var(--sw-pad)); position: relative; display: inline-flex; align-items: center; gap: 8px; cursor: pointer; vertical-align: middle; }
.switch input { position: absolute; top: 50%; left: 0; transform: translateY(-50%); opacity: 0; width: var(--sw-w); height: var(--sw-h); margin: 0; cursor: pointer; z-index: 1; }
.switch > span:first-of-type {
    position: relative; display: inline-block; width: var(--sw-w); height: var(--sw-h); border-radius: 999px; background: #c5cedb; transition: background .18s; flex-shrink: 0;
}
.switch > span:first-of-type::after {
    content: ""; position: absolute; top: var(--sw-pad); left: var(--sw-pad); width: var(--sw-knob); height: var(--sw-knob); border-radius: 50%; background: #fff;
    box-shadow: 0 1px 2px rgba(15, 31, 58, .3); transition: transform .18s;
}
.switch input:checked + span { background: var(--accent); }
.switch input:checked + span::after { transform: translateX(calc(var(--sw-w) - var(--sw-knob) - 2 * var(--sw-pad))); }
.switch input:focus-visible + span { box-shadow: var(--focus); }
.switch input:disabled + span { opacity: .5; }
.switch .switch-label { font-size: 14px; }
.switch-row { display: flex; align-items: center; justify-content: space-between; gap: 15px; padding: 14px 0; border-bottom: 1px solid var(--border); }
.switch-row:last-child { border-bottom: 0; }

/* segmented (radio group as buttons) */
.segmented { display: grid; grid-auto-columns: minmax(0, 1fr); grid-auto-flow: column; gap: 8px; }
.segmented-option { position: relative; display: block; cursor: pointer; }
.segmented-option input { position: absolute; opacity: 0; width: 100%; height: 100%; margin: 0; cursor: pointer; }
.segmented-option span {
    display: flex; align-items: center; justify-content: center; height: 34px; padding: 0 12px; border-radius: 8px;
    background: #f1f4f8; border: 1px solid var(--border-strong); font-weight: 500; color: var(--text-2); text-align: center; transition: all .15s;
}
.segmented-option:hover span { background: #e8edf4; }
.segmented-option input:focus-visible + span { box-shadow: var(--focus); }
.segmented-option input:checked + span { font-weight: 700; background: var(--navy-bg); border-color: var(--navy); color: var(--navy); box-shadow: inset 0 0 0 1px var(--navy); }
.segmented-option input:checked + span::before { content: "✓"; margin-right: 6px; font-weight: 700; }
.seg-gray input:checked + span { background: #e9edf3; border-color: #64748b; color: #334155; box-shadow: inset 0 0 0 1px #64748b; }
.seg-amber input:checked + span { background: #fff1d6; border-color: #f0a92b; color: #8a4b00; box-shadow: inset 0 0 0 1px #f0a92b; }
.seg-red input:checked + span { background: #fde4e4; border-color: #e05252; color: #a51d1d; box-shadow: inset 0 0 0 1px #e05252; }
.seg-green input:checked + span { background: var(--green-bg); border-color: #2f9e65; color: var(--green-fg); box-shadow: inset 0 0 0 1px #2f9e65; }
.seg-blue input:checked + span { background: var(--blue-bg); border-color: var(--accent); color: var(--blue-fg); box-shadow: inset 0 0 0 1px var(--accent); }
.segmented-option input:disabled + span { opacity: .55; cursor: not-allowed; }
.segmented-sm .segmented-option span { height: 28px; font-size: 12.5px; }
.segmented.is-invalid .segmented-option span { border-color: var(--danger); }

/* dropzone */
.dropzone {
    position: relative; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 4px;
    padding: 19px 15px; border: 1.5px dashed #a9b7cc; border-radius: 10px; background: #fbfcfe; text-align: center; cursor: pointer; transition: all .15s;
}
.dropzone:hover, .dropzone.is-dragover { border-color: var(--accent); background: #f2f7ff; }
.dropzone input[type="file"] { position: absolute; inset: 0; opacity: 0; cursor: pointer; width: 100%; height: 100%; }
.dropzone:focus-within { box-shadow: var(--focus); border-color: var(--accent); }
.dropzone-main { display: flex; align-items: center; gap: 12px; color: var(--text-2); }
.dropzone-main .icon { color: var(--accent); }
.dropzone-cta { color: var(--link); font-weight: 600; }
.dropzone-hint { font-size: 12.5px; color: var(--muted); }
.dropzone-files { list-style: none; margin: 10px 0 0; padding: 0; display: flex; flex-direction: column; gap: 6px; width: 100%; text-align: left; position: relative; z-index: 2; }
.dropzone-files li { display: flex; align-items: center; gap: 8px; padding: 7px 10px; background: #fff; border: 1px solid var(--border); border-radius: 8px; font-size: 13px; }
.dropzone-files .file-size { margin-left: auto; color: var(--muted); font-size: 12px; white-space: nowrap; }
.dropzone-files .file-warn { color: var(--danger); font-size: 12px; }

/* ---------------------------------------------------------------- alerts */
.alert { display: flex; align-items: flex-start; gap: 12px; padding: 14px 15px; border-radius: 10px; border: 1px solid; margin-bottom: 15px; font-size: 14px; }
.alert:last-child { margin-bottom: 0; }
.alert .alert-icon { display: inline-flex; flex-shrink: 0; margin-top: 1px; }
.alert-body { flex: 1; min-width: 0; }
.alert-title { margin: 0; font-weight: 700; font-size: 14.5px; }
.alert-title + .alert-text { margin-top: 2px; }
.alert-text { color: var(--text-2); }
.alert-text p:last-child { margin-bottom: 0; }
.alert-actions { display: flex; align-items: center; gap: 10px; align-self: center; flex-shrink: 0; }
.alert-close { background: none; border: 0; padding: 4px; border-radius: 6px; cursor: pointer; color: inherit; opacity: .7; }
.alert-close:hover { opacity: 1; background: rgba(0, 0, 0, .06); }
.alert-info { background: #eef4ff; border-color: #c9dbfb; }
.alert-info .alert-icon, .alert-info .alert-title { color: #1d4ed8; }
.alert-danger { background: #fdeeee; border-color: #f4c3c3; }
.alert-danger .alert-icon, .alert-danger .alert-title { color: #c02727; }
.alert-warning { background: #fff7e8; border-color: #f5d79e; }
.alert-warning .alert-icon, .alert-warning .alert-title { color: #9a5b00; }
.alert-success { background: #ecf8f1; border-color: #bfe5cf; }
.alert-success .alert-icon, .alert-success .alert-title { color: #157347; }
.alert-lg { padding: 16.5px 17.5px; }
.alert-lg .alert-icon .icon { width: 31px; height: 31px; }
.error-list { margin: 4px 0 0; padding-left: 0; }
.error-list li { margin: 2px 0; }

/* Collector direction callout */
.callout-direction { background: #fff7ea; border: 1px solid #f3d19c; border-radius: 10px; padding: 15px 16.5px; color: #7a4300; }
.callout-direction .callout-title { display: flex; align-items: center; gap: 10px; font-size: 15px; font-weight: 700; margin: 0 0 8px; color: #8a4b00; }
.callout-direction .callout-text { font-size: 14.5px; font-weight: 500; margin: 0; color: #7a4300; }
.callout-direction .callout-meta { display: flex; gap: 25px; flex-wrap: wrap; margin-top: 14px; padding-top: 12px; border-top: 1px solid #f0d9b0; font-size: 13px; color: #6b4a1f; }
.callout-direction .callout-meta strong { display: block; font-size: 14px; color: var(--text); }
.callout { padding: 14px 15px; border-radius: 10px; border: 1px solid var(--border); background: var(--surface-2); }

/* ---------------------------------------------------------------- tabs */
.tabs { display: flex; gap: 4px; box-shadow: inset 0 -1px 0 var(--border); margin-bottom: 17.5px; overflow-x: auto; overflow-y: hidden; scrollbar-width: thin; }
.tab {
    display: inline-flex; align-items: center; gap: 8px; padding: 11px 16.5px; font-size: 14.5px; font-weight: 500; color: var(--text-2);
    border-bottom: 3px solid transparent; white-space: nowrap; text-decoration: none;
}
.tab:hover { color: var(--navy); text-decoration: none; background: #f7f9fc; }
.tab.is-active { color: var(--accent); border-bottom-color: var(--accent); font-weight: 600; }
.tab.is-active .pill { background: var(--blue-bg); color: var(--blue-fg); }
.card > .tabs { padding: 0 12px; margin-bottom: 0; }

/* ---------------------------------------------------------------- definition list */
.kv { display: grid; grid-template-columns: minmax(110px, max-content) minmax(0, 1fr); gap: 10px 20px; margin: 0; }
.kv dt { color: var(--muted); font-size: 13.5px; }
.kv dd { margin: 0; color: var(--text); font-weight: 500; min-width: 0; overflow-wrap: anywhere; }
.kv-rows { grid-template-columns: minmax(130px, max-content) minmax(0, 1fr); gap: 0; }
.kv-rows dt, .kv-rows dd { padding: 12px 0; border-bottom: 1px solid var(--border); }
.kv-rows dt:last-of-type, .kv-rows dd:last-of-type { border-bottom: 0; }
.kv-stacked { display: grid; grid-template-columns: repeat(auto-fill, minmax(170px, 1fr)); gap: 15px 20px; }
.kv-stacked > div dt { font-size: 13px; color: var(--muted); margin-bottom: 2px; }
.kv-stacked > div dd { margin: 0; font-weight: 600; font-size: 14.5px; }
.kv-icon { display: flex; gap: 12px; align-items: flex-start; }
.kv-icon > .icon { color: var(--muted); margin-top: 2px; }

/* progress bar */
.bar { position: relative; height: 10px; background: #e8edf4; border-radius: 5px; overflow: hidden; min-width: 48px; }
.bar-fill { display: block; height: 100%; background: #1f5aa6; border-radius: 5px; }
.bar-green .bar-fill, .bar-fill.green { background: #23955c; }
.bar-red .bar-fill, .bar-fill.red { background: #d64545; }
.bar-amber .bar-fill, .bar-fill.amber { background: #e59a16; }
.bar-row { display: grid; grid-template-columns: minmax(120px, 160px) minmax(0, 1fr) 40px; align-items: center; gap: 14px; padding: 7px 0; font-size: 14px; }
.bar-row .bar-value { text-align: right; font-weight: 600; font-variant-numeric: tabular-nums; }

/* lists */
.list-plain { list-style: none; margin: 0; padding: 0; }
.list-divided > li { padding: 12px 0; border-bottom: 1px solid var(--border); }
.list-divided > li:first-child { padding-top: 0; }
.list-divided > li:last-child { border-bottom: 0; padding-bottom: 0; }
.list-accent > li { border-left: 3px solid var(--border-strong); padding: 6px 0 6px 12px; margin-bottom: 10px; }
.list-accent > li.accent-red { border-left-color: var(--danger); }
.list-accent > li.accent-amber { border-left-color: #e59a16; }
.list-accent > li.accent-blue { border-left-color: var(--accent); }
.list-accent > li.accent-green { border-left-color: #23955c; }
.divider { height: 1px; background: var(--border); margin: 15px 0; border: 0; }
.divider-v { width: 1px; align-self: stretch; background: var(--border); }

/* ---------------------------------------------------------------- timeline */
.timeline { list-style: none; margin: 0; padding: 0; position: relative; }
.timeline-item { position: relative; padding: 0 0 19px 27px; }
.timeline-item::before { content: ""; position: absolute; left: 10px; top: 22px; bottom: -2px; width: 2px; background: #cdd6e3; }
.timeline-item:last-child { padding-bottom: 0; }
.timeline-item:last-child::before { display: none; }
.timeline-marker {
    position: absolute; left: 0; top: 1px; width: 22px; height: 22px; border-radius: 50%; display: flex; align-items: center; justify-content: center;
    background: var(--accent); color: #fff; box-shadow: 0 0 0 3px #fff;
}
.tl-green .timeline-marker { background: #fff; border: 5px solid #1f9d63; }
.tl-green.has-icon .timeline-marker { background: #1f9d63; border: 0; }
.tl-blue .timeline-marker { background: #1f6fe0; }
.tl-amber .timeline-marker { background: #e59a16; }
.tl-red .timeline-marker { background: #d64545; }
.tl-gray .timeline-marker { background: #9aa6b8; }
.tl-indigo .timeline-marker { background: #4f46e5; }
.tl-teal .timeline-marker { background: #0f8c80; }
.tl-navy .timeline-marker { background: var(--navy); }
.tl-hollow .timeline-marker { background: #fff !important; border: 2px solid #9aa6b8 !important; }
.timeline-head { display: flex; align-items: baseline; justify-content: space-between; gap: 6px 12px; flex-wrap: wrap; }
.timeline-title { margin: 0; font-weight: 700; font-size: 14.5px; }
.timeline-time { font-size: 13px; color: var(--muted); white-space: nowrap; }
.timeline-body { margin-top: 3px; color: var(--text-2); font-size: 14px; }
.timeline-body p:last-child { margin-bottom: 0; }
.timeline-by { margin: 4px 0 0; font-size: 13px; color: var(--muted); }
.timeline-compact .timeline-item { padding-bottom: 14px; }
.timeline-compact .timeline-title { font-size: 14px; }

/* ---------------------------------------------------------------- empty state */
.empty-state { display: flex; flex-direction: column; align-items: center; justify-content: center; text-align: center; padding: 29.5px 17.5px; color: var(--muted); }
.empty-icon { display: inline-flex; align-items: center; justify-content: center; width: 50.5px; height: 50.5px; border-radius: 50%; background: var(--gray-bg); color: var(--muted); margin-bottom: 12px; }
.empty-title { margin: 0; font-size: 15px; font-weight: 700; color: var(--text); }
.empty-message { margin: 4px 0 0; max-width: 420px; font-size: 14px; }
.empty-actions { margin-top: 15px; display: flex; gap: 10px; flex-wrap: wrap; justify-content: center; }
.empty-compact { padding: 17.5px 12px; }
.empty-compact .empty-icon { width: 38.5px; height: 38.5px; margin-bottom: 8px; }
.empty-compact .empty-title { font-size: 14px; }

/* ---------------------------------------------------------------- modal */
.modal { position: fixed; inset: 0; z-index: 200; display: flex; align-items: flex-start; justify-content: center; padding: 8vh 15px 15px; overflow-y: auto; }
.modal-backdrop { position: fixed; inset: 0; background: rgba(11, 26, 51, .5); }
.modal-dialog { position: relative; width: 100%; max-width: 560px; background: #fff; border-radius: 14px; box-shadow: var(--shadow-lg); animation: modal-in .16s ease-out; }
.modal-sm .modal-dialog, .modal-dialog.modal-sm { max-width: 420px; }
.modal-lg .modal-dialog { max-width: 800px; }
.modal-xl .modal-dialog { max-width: 1080px; }
.modal-header { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 15px 17.5px; border-bottom: 1px solid var(--border); }
.modal-title { display: flex; align-items: center; gap: 10px; margin: 0; font-size: 16px; font-weight: 700; }
.modal-body { padding: 16.5px 17.5px; }
.modal-footer { display: flex; justify-content: flex-end; gap: 10px; padding: 14px 17.5px; border-top: 1px solid var(--border); background: var(--surface-2); border-radius: 0 0 14px 14px; flex-wrap: wrap; }
body.modal-open { overflow: hidden; }
@keyframes modal-in { from { opacity: 0; transform: translateY(-8px); } to { opacity: 1; transform: none; } }

/* ---------------------------------------------------------------- pagination */
.pagination-bar { display: flex; align-items: center; justify-content: space-between; gap: 12px; flex-wrap: wrap; padding: 14px 0 0; }
.pagination-info { font-size: 13.5px; color: var(--muted); }
.pager { display: flex; align-items: center; gap: 6px; list-style: none; margin: 0; padding: 0; flex-wrap: wrap; }
.pager a, .pager span.page {
    display: inline-flex; align-items: center; justify-content: center; min-width: 30px; height: 30px; padding: 0 8px;
    border: 1px solid var(--border-strong); border-radius: 7px; background: #fff; color: var(--text); font-size: 13px; font-weight: 500; text-decoration: none;
}
.pager a:hover { background: var(--surface-2); border-color: #9fb0c8; text-decoration: none; }
.pager .is-current span.page { background: var(--navy); border-color: var(--navy); color: #fff; font-weight: 700; }
.pager .is-disabled span.page { color: #b0bac8; background: #f8fafc; cursor: not-allowed; }
.pager .is-dots span.page { border-color: transparent; background: none; }

/* ---------------------------------------------------------------- misc components */
.info-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(180px, 1fr)); gap: 15px; }
.meta-item { display: flex; gap: 10px; }
.meta-item .icon { color: var(--muted); margin-top: 2px; }
.meta-item .meta-label { font-size: 13px; color: var(--muted); display: block; }
.meta-item .meta-value { font-size: 14.5px; font-weight: 600; display: block; }
.section-divider { border-top: 1px solid var(--border); margin: 17.5px 0; }
.legend { display: flex; gap: 14px; flex-wrap: wrap; font-size: 13px; color: var(--muted); }
.legend-swatch { display: inline-block; width: 10px; height: 10px; border-radius: 3px; margin-right: 6px; vertical-align: middle; }
.kbd-hint { font-size: 12px; color: var(--muted-2); }
.file-icon { display: inline-flex; align-items: center; justify-content: center; width: 28px; height: 31px; border-radius: 4px; background: #e5484d; color: #fff; font-size: 9px; font-weight: 800; flex-shrink: 0; }
.file-icon.doc { background: #2b6cd9; } .file-icon.xls { background: #1f8a4c; } .file-icon.img { background: #8b5cf6; }
.help-steps { counter-reset: step; list-style: none; padding: 0; margin: 0; }
.help-steps li { counter-increment: step; position: relative; padding: 0 0 14px 29.5px; }
.help-steps li::before { content: counter(step); position: absolute; left: 0; top: 0; width: 26px; height: 26px; border-radius: 50%; background: var(--navy-bg); color: var(--navy); font-weight: 700; font-size: 13px; display: flex; align-items: center; justify-content: center; }
.notif-row { display: flex; gap: 14px; padding: 14px 17.5px; border-bottom: 1px solid var(--border); align-items: flex-start; }
.notif-row:last-child { border-bottom: 0; }
.notif-row.is-unread { background: #f5f9ff; }
.notif-row .notif-icon { display: inline-flex; align-items: center; justify-content: center; width: 35px; height: 35px; border-radius: 50%; background: var(--blue-bg); color: var(--blue-fg); flex-shrink: 0; }
.notif-row.is-read .notif-icon { background: var(--gray-bg); color: var(--muted); }
.notif-row .notif-main { flex: 1; min-width: 0; }
.notif-row .notif-main button { background: none; border: 0; padding: 0; text-align: left; cursor: pointer; font: inherit; color: var(--text); font-weight: 600; font-size: 14.5px; }
.notif-row .notif-main button:hover { color: var(--link); text-decoration: underline; }
.notif-row.is-read .notif-main button { font-weight: 500; }
.swatch-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(120px, 1fr)); gap: 10px; }
.swatch { border-radius: 8px; padding: 10px; font-size: 12px; border: 1px solid var(--border); }

/* ---------------------------------------------------------------- auth / guest */
.guest-body { background: #fff; }
.auth-shell { display: grid; grid-template-columns: minmax(0, 48.5fr) minmax(0, 51.5fr); min-height: 100vh; }
.auth-brand {
    position: relative; overflow: hidden; color: #fff; display: flex; flex-direction: column;
    background: radial-gradient(1200px 600px at 10% 0%, #1d3c6c 0%, transparent 60%), linear-gradient(180deg, #17325d 0%, #13294b 55%, #0f2240 100%);
}
.auth-brand-inner { position: relative; z-index: 2; padding: clamp(40px, 9vh, 92px) 80px 24px; max-width: 760px; }
.auth-emblem { width: 190px; height: auto; display: block; margin-bottom: 20px; }
.auth-district { margin: 0; font-size: 37px; line-height: 1; font-weight: 800; letter-spacing: .01em; }
.auth-office { margin: 4px 0 0; font-size: 27px; line-height: 1.15; font-weight: 600; }
.auth-rule { display: block; width: 180px; height: 2px; background: rgba(255, 255, 255, .7); margin: 19px 0 17.5px; }
.auth-system { margin: 0; font-size: 20px; font-weight: 500; color: #f1f5fb; }
.auth-tagline { margin: 8px 0 0; font-size: 16.5px; color: #c6d3e8; }
.auth-features { list-style: none; margin: 29.5px 0 0; padding: 0; display: flex; flex-direction: column; gap: 19px; }
.auth-features li { display: flex; align-items: center; gap: 19px; }
.auth-feature-icon { display: inline-flex; align-items: center; justify-content: center; width: 51.5px; height: 51.5px; border-radius: 50%; background: rgba(255, 255, 255, .1); flex-shrink: 0; color: #fff; }
.auth-features strong { display: block; font-size: 16.5px; font-weight: 600; }
.auth-features small { display: block; font-size: 15px; color: #c6d3e8; margin-top: 2px; }
.auth-building { display: block; position: relative; margin-top: auto; width: 100%; height: auto; max-height: 300px; object-fit: cover; object-position: center bottom; z-index: 1; opacity: .9; pointer-events: none; }
.auth-main { position: relative; display: flex; flex-direction: column; align-items: center; justify-content: center; padding: 63px 34.5px 0; min-height: 100vh; }
.auth-lang { position: absolute; top: 28px; right: 32px; }
.auth-lang .lang-btn { height: 34px; padding: 0 13px; border-radius: 8px; font-size: 13.5px; }
.auth-mobile-brand { display: none; }
.auth-card { width: 100%; max-width: 514px; margin: auto 0; }
.auth-title { font-size: 27px; font-weight: 800; letter-spacing: -.02em; margin: 0; color: var(--navy-900); }
.auth-subtitle { font-size: 18px; color: var(--muted); margin: 6px 0 27px; }
.auth-card .form-field { margin-bottom: 19px; }
.auth-card .form-label { font-size: 15px; font-weight: 600; color: var(--text-2); margin-bottom: 8px; }
.auth-card .form-control { height: 40px; font-size: 14px; border-radius: 8px; background: #fbfcfe; }
.auth-card .input-icon > .form-control { padding-left: 38px; }
.auth-card .input-icon > .icon { left: 20px; color: var(--text-2); }
.auth-card .input-icon.has-action > .form-control { padding-right: 39px; }
.auth-card .btn-primary { height: 40px; font-size: 14.5px; border-radius: 8px; }
.auth-row { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin: -2px 0 22.5px; flex-wrap: wrap; }
.auth-row .checkbox { font-size: 15px; }
.auth-row .checkbox input { width: 22px; height: 22px; }
.auth-row a { font-size: 15px; font-weight: 600; }
.auth-note { text-align: center; color: var(--muted); font-size: 14.5px; margin: 23.5px 0 0; }
.auth-footer { width: calc(100% + 0px); max-width: 750px; margin-top: auto; padding: 19px 0 22.5px; text-align: center; border-top: 1px solid var(--border); color: var(--muted); font-size: 14.5px; }
.auth-footer a { font-weight: 700; }
.password-toggle { display: inline-flex; align-items: center; justify-content: center; width: 32px; height: 32px; border: 0; background: transparent; border-radius: 8px; cursor: pointer; color: var(--text-2); }
.password-toggle:hover { background: var(--gray-bg); }

/* error pages */
.error-page { min-height: 100vh; display: flex; align-items: center; justify-content: center; padding: 20px; background: var(--bg); }
.error-card { max-width: 560px; width: 100%; background: #fff; border: 1px solid var(--border); border-radius: 16px; padding: 29.5px 27px; text-align: center; box-shadow: var(--shadow); }
.error-code { font-size: 39px; font-weight: 800; color: var(--navy); line-height: 1; margin: 12px 0 8px; letter-spacing: -.02em; }
.error-title { font-size: 18px; font-weight: 700; margin: 0 0 8px; }
.error-text { color: var(--muted); font-size: 14.5px; margin: 0 0 20px; }
.error-brand { display: inline-flex; align-items: center; gap: 10px; color: var(--navy); font-weight: 700; }
.app-content .error-inline { max-width: 640px; margin: 29.5px auto; }

/* ---------------------------------------------------------------- state pages: errors, session expired, maintenance, offline, loading */
.state-body { background: var(--bg); }
.state-shell { min-height: 100vh; display: flex; flex-direction: column; }
.state-header {
    display: flex; align-items: center; justify-content: space-between; gap: 15px; min-height: 67px; padding: 12px 27px;
    background: linear-gradient(180deg, #16305a 0%, var(--navy) 100%); color: #fff;
}
.state-brand { display: flex; align-items: center; gap: 14px; color: #fff; text-decoration: none; }
.state-brand:hover { color: #fff; text-decoration: none; }
.state-brand img { width: 47px; height: 47px; }
.state-brand .brand-title { font-size: 19px; }
.state-brand .brand-sub { font-size: 16.5px; }
.lang-menu { position: relative; }
.lang-menu > summary {
    display: inline-flex; align-items: center; gap: 8px; height: 34px; padding: 0 13px; list-style: none; cursor: pointer;
    border: 1px solid rgba(255, 255, 255, .45); border-radius: 8px; color: #fff; font-size: 13.5px; font-weight: 500; user-select: none;
}
.lang-menu > summary::-webkit-details-marker { display: none; }
.lang-menu > summary:hover { background: rgba(255, 255, 255, .08); }
.lang-menu > summary:focus-visible { outline: 2px solid #fff; outline-offset: 2px; }
.lang-menu[open] > .dropdown-menu { display: block; }
.state-main { flex: 1; display: flex; align-items: center; justify-content: center; padding: 34.5px 17.5px; outline: none; }
.state-footer { display: flex; justify-content: center; align-items: center; gap: 10px; flex-wrap: wrap; padding: 14px 17.5px 21px; font-size: 13.5px; color: var(--muted); }
.state-footer a { font-weight: 700; color: var(--navy-900); }
.state-footer-sep { color: var(--muted-2); margin: 0 4px; }
.app-content.state-content { display: flex; align-items: center; justify-content: center; padding-top: 34.5px; padding-bottom: 34.5px; }

.state-card {
    width: 100%; max-width: 900px; margin: 0 auto; background: #fff; border: 1px solid var(--border); border-radius: 16px;
    box-shadow: var(--shadow-sm); padding: 39px 34.5px 32px; text-align: center;
}
.state-card-narrow { max-width: 720px; }
.state-art { display: flex; justify-content: center; margin-bottom: 6px; }
.state-illustration { width: 240px; height: auto; max-width: 100%; }
.state-code { margin: 4px 0 10px; font-size: 55px; line-height: 1; font-weight: 800; letter-spacing: -.03em; color: var(--navy-900); }
.state-code.is-red { color: #c8191f; }
.state-code-sm { margin: 0 0 8px; font-size: 16px; font-weight: 700; letter-spacing: .14em; color: var(--muted); }
.state-title { margin: 0 0 10px; font-size: 25px; font-weight: 800; letter-spacing: -.02em; line-height: 1.2; color: var(--navy-900); }
.state-text { margin: 0 auto 23.5px; max-width: 640px; font-size: 16.5px; color: var(--muted); }
.state-detail { margin: -18px auto 21px; max-width: 560px; font-size: 14px; color: var(--muted); }
.state-actions { display: flex; justify-content: center; gap: 16.5px; flex-wrap: wrap; }
.state-actions .btn { height: 40px; min-width: 200px; padding: 0 20px; font-size: 14.5px; border-radius: 8px; }
.state-actions .btn-wide { width: 100%; max-width: 446px; }
.state-actions .btn-outline { border-color: var(--navy-600); }
.state-link { display: inline-flex; align-items: center; gap: 10px; font-size: 15px; font-weight: 600; color: var(--link); }
.state-link-underline { text-decoration: underline; text-underline-offset: 3px; }
.state-card > .state-link { margin-top: 19px; }
.state-help { margin: 20px 0 0; font-size: 15.5px; color: var(--muted); display: flex; align-items: center; justify-content: center; gap: 8px; flex-wrap: wrap; }
.state-help a { font-weight: 500; }
.state-help .icon { color: var(--link); }
.state-foot {
    display: flex; align-items: center; justify-content: center; gap: 12px; flex-wrap: wrap;
    margin: 25px auto 0; padding-top: 21px; max-width: 800px; border-top: 1px solid var(--border); font-size: 15px; color: var(--text-2);
}
.state-foot .icon { color: var(--muted); }
.state-foot-sm { font-size: 14.5px; color: var(--muted); }
.state-foot-split { gap: 14px 22.5px; }
.state-note {
    display: flex; align-items: center; justify-content: center; gap: 15px; margin: 23.5px auto 0; padding: 19px 8px; max-width: 646px;
    border-top: 1px solid var(--border); border-bottom: 1px solid var(--border); font-size: 15px; color: var(--text-2); text-align: left;
}
.state-note .icon { color: var(--navy); }
.state-note + .state-foot { border-top: 0; margin-top: 8px; padding-top: 16.5px; }
.state-ref { color: var(--muted); }
.state-ref strong { color: var(--navy-900); letter-spacing: .02em; margin-left: 6px; }
.state-sep { width: 1px; height: 30px; background: var(--border-strong); }
.state-support { display: inline-flex; align-items: center; gap: 10px; color: var(--link); font-weight: 500; }
.state-support > .icon:first-child { color: var(--navy); }

/* live notification toasts (app.js) */
.notif-toasts { position: fixed; right: 20px; bottom: 20px; z-index: 320; display: flex; flex-direction: column; gap: 10px; width: min(360px, calc(100vw - 32px)); }
.notif-toast { display: flex; align-items: flex-start; gap: 12px; padding: 12px 14px; background: #fff; border: 1px solid var(--border); border-left: 4px solid var(--accent); border-radius: 10px; box-shadow: var(--shadow-lg); animation: notif-in .22s ease-out; }
.notif-toast.is-leaving { opacity: 0; transform: translateY(6px); transition: opacity .2s, transform .2s; }
.notif-toast-icon { display: inline-flex; align-items: center; justify-content: center; flex-shrink: 0; width: 32px; height: 32px; border-radius: 50%; background: var(--blue-bg); color: var(--blue-fg); }
.notif-toast-body { flex: 1; min-width: 0; }
.notif-toast-kicker { margin: 0; font-size: 11.5px; font-weight: 600; letter-spacing: .02em; text-transform: uppercase; color: var(--muted); }
.notif-toast-title { margin: 2px 0 0; font-size: 13.5px; font-weight: 700; color: var(--navy-900); overflow-wrap: anywhere; }
.notif-toast-text { margin: 2px 0 0; font-size: 12.5px; color: var(--text-2); overflow-wrap: anywhere; }
.notif-toast-link { display: inline-block; margin-top: 6px; font-size: 12.5px; font-weight: 600; }
.notif-toast-close { flex-shrink: 0; width: 24px; height: 24px; border: 0; background: none; color: var(--muted); font-size: 18px; line-height: 1; cursor: pointer; border-radius: 6px; }
.notif-toast-close:hover { background: var(--gray-bg); color: var(--text); }
@keyframes notif-in { from { opacity: 0; transform: translateY(8px); } to { opacity: 1; transform: none; } }
@media print { .notif-toasts { display: none !important; } }

/* page loader: one spinner centred on the screen (slow navigation / sign-in) */
.page-loader {
    position: fixed; inset: 0; z-index: 300; display: grid; place-items: center;
    background: rgba(244, 246, 250, .55); cursor: progress; animation: state-fade .15s ease-out;
}
.page-loader[hidden] { display: none; }
.spinner { display: inline-block; width: 41px; height: 41px; border-radius: 50%; border: 4px solid #cad8ec; border-top-color: var(--navy-600); border-left-color: var(--navy-600); animation: spin .8s linear infinite; }
body.is-navigating { cursor: progress; }
@keyframes state-fade { from { opacity: 0; } to { opacity: 1; } }

/* connection lost overlay */
.conn-lost {
    position: fixed; z-index: 250; top: var(--topbar-h); left: var(--sidebar-w); right: 0; bottom: 0;
    display: flex; align-items: center; justify-content: center; padding: 20px; overflow-y: auto;
    background: var(--bg); animation: state-fade .2s ease-out;
}
.conn-lost[hidden] { display: none !important; }
.guest-body .conn-lost, .state-body .conn-lost { top: 0; left: 0; z-index: 400; }
.conn-card { max-width: 766px; padding: 34.5px 29.5px 29.5px; margin: auto; }
.conn-card .state-title { font-size: 25px; }
.conn-card .state-actions .btn { min-width: 220px; height: 40px; }
.conn-status { min-height: 22px; margin: 10px 0 0; font-size: 14.5px; color: var(--muted); }
.conn-status.is-warn { color: var(--warning); font-weight: 500; }
.conn-note {
    display: flex; align-items: center; gap: 12px; width: fit-content; max-width: 100%; margin: 6px auto 19px; padding: 12px 17.5px; text-align: left;
    background: #eef4fd; border: 1px solid #d5e3f6; border-radius: 8px; font-size: 14.5px; color: var(--text-2);
}
.conn-note .icon { color: var(--navy-600); }
.conn-support { height: 36px; padding: 0 15px; font-size: 14px; border-color: var(--navy-600); }

/* auth extras: forgot / reset password */
.auth-icon { display: inline-flex; align-items: center; justify-content: center; width: 71px; height: 71px; border-radius: 50%; background: #eef2f8; color: var(--navy-900); margin-bottom: 21px; }
.auth-head-center { text-align: center; }
.auth-head-center .auth-icon { margin-bottom: 19px; }
.auth-subtitle-sm { font-size: 16.5px; margin-bottom: 23.5px; }
.auth-buttons { display: flex; flex-direction: column; gap: 15px; margin-top: 23.5px; }
.auth-card .auth-buttons .btn { height: 40px; font-size: 14.5px; }
.auth-card .btn-outline { border-color: #9aa9be; color: var(--navy-900); }
.auth-note-sm { font-size: 15px; margin-top: 22.5px; }
.auth-account { display: flex; align-items: center; gap: 8px; margin: -8px 0 17.5px; padding: 10px 14px; background: var(--surface-2); border: 1px solid var(--border); border-radius: 8px; font-size: 14.5px; color: var(--text-2); overflow-wrap: anywhere; }
.auth-account .icon { color: var(--muted); }
.pw-strength { display: flex; align-items: center; gap: 12px; margin-top: 12px; }
.pw-bars { flex: 1; display: grid; grid-template-columns: repeat(3, minmax(0, 88px)); gap: 8px; }
.pw-bars span { height: 6px; border-radius: 3px; background: #e3e8ef; }
.pw-label { margin-left: auto; font-size: 14.5px; font-weight: 600; }
.pw-strength[data-score="1"] .pw-bars span:nth-child(1) { background: #d64545; }
.pw-strength[data-score="1"] .pw-label { color: var(--danger); }
.pw-strength[data-score="2"] .pw-bars span:nth-child(-n+2) { background: #e59a16; }
.pw-strength[data-score="2"] .pw-label { color: var(--warning); }
.pw-strength[data-score="3"] .pw-bars span { background: #23a560; }
.pw-strength[data-score="3"] .pw-label { color: var(--success); }
.pw-rules-title { margin: 12px 0 6px; font-size: 13.5px; font-weight: 600; color: var(--text-2); }
.pw-rules { list-style: none; margin: 0; padding: 0; display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 4px 15px; font-size: 13.5px; color: var(--muted); }
.pw-rules li { display: flex; align-items: center; gap: 8px; }
.pw-rules .pw-on { display: none; }
.pw-rules .pw-off { color: var(--muted-2); }
.pw-rules li.is-met { color: var(--success); }
.pw-rules li.is-met .pw-on { display: inline-block; }
.pw-rules li.is-met .pw-off { display: none; }
.auth-card .form-hint { font-size: 14px; }

/* print layout */
.print-body { background: #e9edf3; }
.print-toolbar { position: sticky; top: 0; z-index: 10; display: flex; align-items: center; gap: 12px; padding: 12px 17.5px; background: #fff; border-bottom: 1px solid var(--border); flex-wrap: wrap; }
.print-page { background: #fff; max-width: 210mm; margin: 17.5px auto; padding: 14mm; box-shadow: var(--shadow); min-height: 270mm; }
.print-page.a3, .print-a3 .print-page { max-width: 420mm; min-height: 0; }
.print-landscape .print-page { max-width: 297mm; min-height: 0; }
.print-header { display: flex; align-items: center; gap: 14px; padding-bottom: 10px; margin-bottom: 14px; border-bottom: 2px solid var(--navy); }
.print-org { margin: 0; font-size: 16px; font-weight: 800; color: var(--navy); }
.print-sys { margin: 0; font-size: 13px; color: var(--muted); }
.print-stamp { margin-left: auto; text-align: right; }
.print-footer { margin-top: 16.5px; padding-top: 8px; border-top: 1px solid var(--border); }
.print-table { width: 100%; border-collapse: collapse; font-size: 11px; }
.print-table th, .print-table td { border: 1px solid #9aa6b8; padding: 4px 6px; text-align: left; vertical-align: top; }
.print-table th { background: #eef1f5; font-weight: 700; }
.print-only { display: none; }

/* ---------------------------------------------------------------- responsive */
@media (max-width: 1440px) {
    .topbar-search { width: 280px; }
    .app-content { padding: 19px 19px 20px; }
    .form-actions-bar { margin: 17.5px -22px -24px; padding: 14px 19px; }
}
@media (max-width: 1280px) {
    .grid-4 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
    .stat-value { font-size: 20px; }
    .stat-icon { width: 44.5px; height: 44.5px; }
    .auth-brand-inner { padding: clamp(36px, 7vh, 72px) 56px 24px; }
    .auth-district { font-size: 33px; }
    .auth-office { font-size: 24px; }
}
@media (max-width: 1100px) {
    .grid-main-side, .grid-side-main, .grid-3 { grid-template-columns: minmax(0, 1fr); }
    .topbar-search { width: 220px; }
}
@media (max-width: 1023px) {
    :root { --sidebar-w: 268px; }
    .app-main { margin-left: 0; }
    .sidebar { transform: translateX(-100%); transition: transform .2s ease; box-shadow: none; }
    body.sidebar-open .sidebar { transform: none; box-shadow: var(--shadow-lg); }
    body.sidebar-open .sidebar-backdrop { display: block; position: fixed; inset: 0; z-index: 55; background: rgba(11, 26, 51, .45); }
    body.sidebar-open { overflow: hidden; }
    .sidebar-close.btn-icon { display: inline-flex; }
    .topbar-menu.btn-icon { display: inline-flex; }
    .topbar { padding: 0 12px; gap: 8px; }
    .grid-2, .form-grid, .form-grid-3 { grid-template-columns: minmax(0, 1fr); }
    .auth-shell { grid-template-columns: minmax(0, 1fr); }
    .auth-brand { display: none; }
    .auth-mobile-brand { display: flex; align-items: center; gap: 10px; color: var(--navy); font-size: 16px; margin-bottom: 20px; }
    .auth-mobile-brand img { filter: none; background: var(--navy); border-radius: 8px; padding: 4px; width: 45.5px; height: auto; }
    .auth-main { padding: 58.5px 20px 0; justify-content: flex-start; }
    .auth-card { margin: 0; }
    .conn-lost { left: 0; }
}
@media (max-width: 760px) {
    .topbar-search { display: none; }
    .topbar-search-mobile.btn-icon { display: inline-flex; }
    .hide-mobile { display: none !important; }
    .breadcrumbs li:not(:last-child):not(:first-child) { display: none; }
    .breadcrumbs li:first-child { display: none; }
    .breadcrumbs li:last-child .crumb-sep { display: none; }
    .app-content { padding: 15px 14px 17.5px; }
    .page-title { font-size: 19px; }
    .page-actions { width: 100%; }
    .page-actions .btn { height: 32px; padding: 0 12px; font-size: 13px; }
    .grid-4 { grid-template-columns: minmax(0, 1fr); }
    .stat-card { padding: 14px 15px; }
    .form-row { grid-template-columns: minmax(0, 1fr); gap: 4px; }
    .form-row > .form-label { padding-top: 0; }
    .kv, .kv-rows { grid-template-columns: minmax(0, 1fr); gap: 2px; }
    .kv dd { margin-bottom: 10px; }
    .kv-rows dt { border-bottom: 0; padding-bottom: 0; }
    .card-header, .card-body { padding-left: 14px; padding-right: 14px; }
    .form-actions-bar { margin: 17.5px -14px -20px; padding: 12px 14px; }
    .form-actions-bar .btn { flex: 1; }
    .pagination-bar { justify-content: center; }
    .dropdown-notifications { position: fixed; left: 12px; right: 12px; top: 64px; width: auto; }
    .auth-title { font-size: 23px; }
    .auth-subtitle { font-size: 16px; margin-bottom: 21px; }
    .auth-lang { right: 16px; top: 18px; }
    .modal { padding-top: 15px; }
    .segmented { grid-auto-flow: row; grid-template-columns: repeat(auto-fit, minmax(90px, 1fr)); }
    .state-header { padding: 10px 15px; min-height: 55px; }
    .state-brand img { width: 39.5px; height: 39.5px; }
    .state-brand .brand-title { font-size: 16.5px; }
    .state-brand .brand-sub { font-size: 14.5px; }
    .lang-menu > summary { height: 32px; padding: 0 11px; font-size: 13px; }
    .state-main { padding: 20px 12px; }
    .app-content.state-content { padding-top: 17.5px; }
    .state-card, .conn-card { padding: 25px 16.5px 22.5px; }
    .state-illustration { width: 190px; }
    .state-code { font-size: 41px; }
    .state-title, .conn-card .state-title { font-size: 20px; }
    .state-text { font-size: 15px; }
    .state-actions .btn, .conn-card .state-actions .btn { width: 100%; min-width: 0; height: 38px; font-size: 14px; }
    .state-note { text-align: left; padding: 15px 4px; }
    .state-sep { display: none; }
    .pw-rules { grid-template-columns: minmax(0, 1fr); }
    .auth-icon { width: 57.5px; height: 57.5px; margin-bottom: 16.5px; }
}

/* ---------------------------------------------------------------- print */
@media print {
    @page { margin: 12mm; }
    body, .print-body { background: #fff !important; font-size: 11.5pt; color: #000; }
    .no-print, .sidebar, .topbar, .app-footer, .sidebar-backdrop, .print-toolbar, .modal, .skip-link, .alert-close, .page-actions, .btn, .page-loader, .conn-lost { display: none !important; }
    .print-only { display: block !important; }
    .app-main { margin: 0 !important; }
    .app-content { padding: 0 !important; max-width: none; }
    .print-page { margin: 0; padding: 0; box-shadow: none; max-width: none; min-height: 0; }
    .card, .stat-card, .table-wrap { box-shadow: none !important; break-inside: avoid; border-color: #b9c2cf; }
    .table-wrap { overflow: visible; }
    .table th { background: #eef1f5 !important; -webkit-print-color-adjust: exact; print-color-adjust: exact; }
    .badge { -webkit-print-color-adjust: exact; print-color-adjust: exact; }
    .grid-main-side, .grid-side-main { grid-template-columns: minmax(0, 1fr); }
    a { color: inherit; text-decoration: none; }
    a.token-link { text-decoration: none; }
    .tabs { display: none; }
    tr, img { break-inside: avoid; }
    thead { display: table-header-group; }
}

@media (prefers-reduced-motion: reduce) {
    *, *::before, *::after { animation: none !important; transition: none !important; }
}
