:root {
  --navy: #070B14;
  --navy-2: #12182A;
  --green: #204090;
  --green-strong: #183070;
  --green-soft: #E7EDF8;
  --mint: #C5D0EA;
  --paper: #F3F5F9;
  --surface: #ffffff;
  --ink: #10182C;
  --muted: #5C6780;
  --line: #E2E6EF;
  --line-strong: #C9D0DC;
  --amber: #a86009;
  --amber-soft: #fff3dc;
  --red: #D02020;
  --red-soft: #FDECEC;
  --blue: #204090;
  --violet: #7057a3;
  --shadow: 0 18px 50px rgba(16, 24, 44, .08);
  --radius-lg: 24px;
  --radius-md: 16px;
  --radius-sm: 11px;
  --crescent: #D02020;
  --globe: #204090;
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body {
  margin: 0;
  min-width: 320px;
  min-height: 100vh;
  background: var(--paper);
  color: var(--ink);
  font-family: "Tahoma", "Segoe UI", Arial, sans-serif;
  -webkit-font-smoothing: antialiased;
  overflow-x: hidden;
}
button, input { font: inherit; }
button, a { -webkit-tap-highlight-color: transparent; }
button { color: inherit; }
svg { fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }
.sr-only { position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip: rect(0,0,0,0); white-space: nowrap; border: 0; }
.skip-link { position: fixed; inset: 10px auto auto 10px; z-index: 100; padding: 10px 14px; background: #fff; color: var(--navy); border-radius: 10px; transform: translateY(-150%); }
.skip-link:focus { transform: translateY(0); }
:focus-visible { outline: 3px solid var(--crescent); outline-offset: 3px; }

/* topbar replaced by taif-chrome.css */

.main-nav { background: var(--surface); border-bottom: 1px solid var(--line); position: sticky; top: 72px; z-index: 30; }
.nav-inner { width: min(1180px, calc(100% - 40px)); min-height: 64px; margin: auto; display: flex; align-items: stretch; gap: 28px; }
.nav-tab { position: relative; min-height: 64px; padding: 0 4px; display: inline-flex; align-items: center; gap: 9px; border: 0; background: transparent; color: var(--muted); font-weight: 700; cursor: pointer; white-space: nowrap; }
.nav-tab svg { width: 19px; }
.nav-tab::after { content: ""; position: absolute; height: 3px; border-radius: 3px 3px 0 0; right: 0; left: 100%; bottom: -1px; background: var(--green); transition: left .25s ease; }
.nav-tab.active { color: var(--green-strong); }
.nav-tab.active::after { left: 0; }
.nav-count { min-width: 22px; height: 22px; padding: 0 6px; border-radius: 20px; display: grid; place-items: center; font-size: 10px; color: var(--amber); background: var(--amber-soft); }

.page-shell { width: min(1180px, calc(100% - 40px)); margin: auto; padding: 34px 0 60px; }
.welcome-row { display: flex; align-items: center; justify-content: space-between; gap: 24px; margin-bottom: 24px; }
.eyebrow { margin: 0 0 8px; color: var(--green); font-size: 11px; font-weight: 800; letter-spacing: .08em; }
.welcome-row h2 { margin: 0; font-size: clamp(22px, 3vw, 30px); letter-spacing: -.035em; }
.welcome-row p:not(.eyebrow) { margin: 9px 0 0; color: var(--muted); font-size: 13px; }
.date-chip { display: flex; gap: 8px; align-items: center; padding: 10px 13px; border: 1px solid var(--line); border-radius: 11px; background: rgba(255,255,255,.6); color: var(--muted); font-size: 12px; white-space: nowrap; }
.date-chip svg { width: 17px; color: var(--green); }

.stats-grid { display: grid; grid-template-columns: 1.15fr repeat(3, 1fr); gap: 12px; margin-bottom: 18px; }
.stat-card { min-height: 116px; display: flex; align-items: center; gap: 13px; padding: 18px; border: 1px solid var(--line); border-radius: var(--radius-md); background: var(--surface); position: relative; overflow: hidden; }
.stat-card.featured { border-color: #C5D0EA; background: linear-gradient(130deg, #fff 55%, #EEF2FA); }
.stat-icon { width: 42px; height: 42px; border-radius: 13px; flex: 0 0 auto; display: grid; place-items: center; color: var(--green); background: var(--green-soft); }
.stat-icon svg { width: 21px; }
.stat-icon.amber { color: var(--amber); background: var(--amber-soft); }
.stat-icon.blue { color: var(--blue); background: #E7EDF8; }
.stat-icon.violet { color: var(--violet); background: #f0ecf8; }
.stat-card > div:nth-child(2) { display: grid; min-width: 0; }
.stat-card span { color: var(--muted); font-size: 11px; }
.stat-card strong { font-size: 25px; line-height: 1.2; margin: 4px 0; }
.stat-card small { color: var(--muted); font-size: 10px; white-space: nowrap; }
.stat-card small b { color: var(--green); }
.mini-bars { position: absolute; direction: ltr; display: flex; align-items: end; gap: 3px; left: 14px; bottom: 18px; height: 32px; opacity: .65; }
.mini-bars i { width: 3px; border-radius: 3px; background: var(--green); height: 30%; }
.mini-bars i:nth-child(2) { height: 55%; }.mini-bars i:nth-child(3) { height: 42%; }.mini-bars i:nth-child(4) { height: 68%; }.mini-bars i:nth-child(5) { height: 60%; }.mini-bars i:nth-child(6) { height: 88%; }.mini-bars i:nth-child(7) { height: 100%; }

.view-panel { display: none; }
.view-panel.active { display: block; animation: enter .35s ease both; }
@keyframes enter { from { opacity: 0; transform: translateY(8px); } to { opacity: 1; transform: none; } }
.search-card, .records-card, .result-detail, .upload-card, .queue-card, .empty-card, .paste-card, .paste-guide { border: 1px solid var(--line); border-radius: var(--radius-lg); background: var(--surface); box-shadow: 0 1px 0 rgba(17,58,50,.02); }
.search-card { padding: clamp(20px, 3vw, 30px); }
.search-intro { display: flex; gap: 14px; align-items: flex-start; padding-bottom: 23px; margin-bottom: 23px; border-bottom: 1px solid var(--line); }
.section-number { width: 35px; height: 35px; border-radius: 11px; display: grid; place-items: center; background: var(--navy); color: #fff; font-weight: 800; font-size: 11px; font-variant-numeric: tabular-nums; flex: 0 0 auto; }
.search-intro h3, .section-head h3 { margin: 0; font-size: 17px; }
.search-intro p, .section-head p { margin: 6px 0 0; color: var(--muted); font-size: 12px; line-height: 1.7; }
.field-grid { display: grid; grid-template-columns: 1.15fr 1fr 1fr; gap: 14px; }
.field > span { display: flex; align-items: center; gap: 7px; margin-bottom: 8px; font-size: 12px; font-weight: 800; }
.field em, .field i { padding: 3px 7px; border-radius: 20px; font-style: normal; font-weight: 400; font-size: 9px; }
.field em { color: var(--red); background: var(--red-soft); }
.field i { color: var(--muted); background: #EEF1F6; }
.input-wrap { height: 48px; border: 1px solid var(--line-strong); border-radius: var(--radius-sm); display: flex; align-items: center; padding: 0 13px; transition: border .2s, box-shadow .2s; }
.input-wrap:focus-within { border-color: var(--green); box-shadow: 0 0 0 4px rgba(32,64,144,.1); }
.input-wrap.has-error { border-color: var(--red); box-shadow: 0 0 0 4px rgba(208,32,32,.08); }
.input-wrap svg { width: 19px; color: #789087; flex: 0 0 auto; margin-left: 9px; }
.input-wrap input { width: 100%; height: 100%; border: 0; outline: 0; background: transparent; color: var(--ink); font-size: 12px; }
.input-wrap input::placeholder { color: #97a6a1; }
.field > small { display: block; min-height: 15px; margin-top: 6px; color: var(--muted); font-size: 9px; }
.field .field-error { color: var(--red); font-weight: 700; }
.form-actions { display: flex; justify-content: flex-end; gap: 10px; margin-top: 18px; }
.button { min-height: 44px; padding: 0 18px; border-radius: 11px; border: 1px solid transparent; display: inline-flex; align-items: center; justify-content: center; gap: 8px; font-size: 12px; font-weight: 800; cursor: pointer; transition: transform .16s ease, background .16s ease, border .16s ease; }
.button:active { transform: translateY(1px); }
.button svg { width: 18px; }
.button.primary { background: var(--green); color: #fff; box-shadow: 0 8px 18px rgba(32,64,144,.17); }
.button.primary:hover { background: var(--green-strong); }
.button.secondary { background: var(--green-soft); color: var(--green-strong); border-color: #C5D0EA; }
.button.secondary:hover { background: #E7EDF8; }
.button.quiet { background: #fff; color: var(--muted); border-color: var(--line); }

.result-detail { margin-top: 16px; padding: 24px; border-color: #C5D0EA; box-shadow: var(--shadow); }
.result-head { display: flex; align-items: center; justify-content: space-between; gap: 20px; }
.person-summary { display: flex; align-items: center; gap: 13px; }
.person-avatar { width: 48px; height: 48px; display: grid; place-items: center; border-radius: 14px; background: var(--green-soft); color: var(--green-strong); font-weight: 800; }
.person-summary h3 { margin: 6px 0 3px; font-size: 18px; }
.person-summary p { margin: 0; color: var(--muted); font-size: 11px; }
.status-badge { width: fit-content; display: inline-flex; align-items: center; gap: 6px; border-radius: 20px; padding: 5px 9px; font-size: 10px; font-weight: 800; white-space: nowrap; }
.status-badge i { width: 6px; height: 6px; border-radius: 50%; }
.status-badge.success { background: var(--green-soft); color: var(--green-strong); }.status-badge.success i { background: var(--green); }
.status-badge.warning { background: var(--amber-soft); color: var(--amber); }.status-badge.warning i { background: #d88716; }
.status-badge.danger { background: var(--red-soft); color: var(--red); }.status-badge.danger i { background: var(--red); }
.check-rail { display: grid; grid-template-columns: auto 1fr auto 1fr auto 1fr auto; align-items: center; margin: 28px 0 20px; padding: 20px; border-radius: 16px; background: #F6F8FC; border: 1px solid #E4E8F0; }
.check-step { display: grid; justify-items: center; text-align: center; min-width: 112px; }
.check-step > span { width: 31px; height: 31px; border-radius: 50%; display: grid; place-items: center; margin-bottom: 8px; }
.check-step.done > span { background: var(--green); color: #fff; }
.check-step svg { width: 16px; }
.check-step b { font-size: 10px; }.check-step small { color: var(--muted); font-size: 8px; margin-top: 3px; }
.rail-line { height: 2px; background: var(--line); transform: translateY(-14px); }.rail-line.done { background: var(--mint); }
.detail-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 8px; }
.detail-grid > div { padding: 12px; border-inline-start: 2px solid var(--mint); background: #F7F9FC; }
.detail-grid span { display: block; color: var(--muted); font-size: 9px; margin-bottom: 5px; }.detail-grid b { font-size: 11px; }

.records-card { margin-top: 16px; overflow: hidden; }
.section-head { padding: 22px 24px; display: flex; align-items: center; justify-content: space-between; gap: 20px; border-bottom: 1px solid var(--line); }
.section-head.compact { padding: 0 0 18px; }
.text-button { border: 0; background: transparent; color: var(--green-strong); display: flex; align-items: center; gap: 6px; cursor: pointer; font-size: 11px; font-weight: 800; }
.text-button svg { width: 15px; }
.table-wrap { overflow-x: auto; }
table { width: 100%; border-collapse: collapse; }
th, td { padding: 14px 18px; text-align: right; border-bottom: 1px solid var(--line); font-size: 11px; white-space: nowrap; }
th { background: #F6F8FC; color: var(--muted); font-size: 10px; font-weight: 800; }
tbody tr:last-child td { border-bottom: 0; }
tbody tr:hover { background: #F7F9FC; }
td:first-child b { display: block; font-size: 11px; margin-bottom: 4px; } td:first-child small { color: var(--muted); direction: ltr; display: block; text-align: right; }
.mini-status { font-weight: 800; }.mini-status.ok { color: var(--green-strong); }.mini-status.bad { color: var(--red); }
.row-action { width: 34px; height: 34px; display: grid; place-items: center; border: 1px solid var(--line); border-radius: 9px; background: #fff; color: var(--green); cursor: pointer; }
.row-action svg { width: 16px; transform: scaleX(-1); }

.upload-layout { display: grid; grid-template-columns: 1.35fr .65fr; gap: 16px; }
.upload-card, .queue-card { padding: 26px; }
.drop-zone { padding: 42px 24px; display: grid; place-items: center; text-align: center; border: 1.5px dashed #8FA3D4; border-radius: 18px; background: #F4F7FC; cursor: pointer; transition: background .2s, border .2s; }
.drop-zone:hover, .drop-zone.dragging { background: var(--green-soft); border-color: var(--green); }
.upload-icon { width: 52px; height: 52px; display: grid; place-items: center; border-radius: 15px; background: #fff; color: var(--green); box-shadow: 0 8px 25px rgba(32,64,144,.1); }
.upload-icon svg { width: 25px; }
.drop-zone h3 { margin: 16px 0 7px; font-size: 15px; }.drop-zone p { margin: 0 0 17px; color: var(--muted); font-size: 11px; }
.template-links { display: flex; align-items: center; gap: 14px; margin-top: 16px; color: var(--muted); font-size: 10px; }.template-links a { color: var(--green-strong); font-weight: 800; }
.queue-count { padding: 6px 9px; border-radius: 20px; color: var(--amber); background: var(--amber-soft); font-size: 10px; font-weight: 800; }
.queue-item { display: flex; gap: 10px; padding: 15px 0; border-bottom: 1px solid var(--line); }.queue-item:last-child { border: 0; }
.queue-item.priority { background: rgba(36, 99, 235, .06); border-radius: 10px; padding: 15px 10px; }
.queue-item.paused { opacity: .82; }
.queue-item.paused small { color: #9a6700; }
.file-icon { width: 38px; height: 42px; display: grid; place-items: center; border-radius: 9px; color: var(--green-strong); background: var(--green-soft); font-size: 9px; font-weight: 900; }.file-icon.csv { color: var(--blue); background: #E7EDF8; }
.queue-info { flex: 1; min-width: 0; }.queue-info > div:first-child { display: flex; justify-content: space-between; gap: 8px; }.queue-info b { font-size: 10px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }.queue-info span, .queue-info small { color: var(--muted); font-size: 8px; }.queue-info small { display: block; margin-top: 6px; }
.progress { height: 5px; margin-top: 9px; border-radius: 10px; background: #E4E8F0; overflow: hidden; }.progress i { display: block; height: 100%; border-radius: inherit; background: var(--green); }
.empty-card { padding: 70px 24px; display: grid; justify-items: center; text-align: center; }.empty-card > svg { width: 52px; color: var(--green); }.empty-card h3 { margin: 20px 0 8px; }.empty-card p { max-width: 500px; margin: 0 0 20px; color: var(--muted); line-height: 1.8; font-size: 12px; }

.paste-layout { display: grid; grid-template-columns: minmax(0, 1.35fr) minmax(260px, .65fr); gap: 16px; }
.paste-card, .paste-guide { padding: 26px; }
.paste-label { display: block; margin-bottom: 9px; font-size: 12px; font-weight: 800; }
.paste-box { position: relative; }
.paste-box textarea { width: 100%; resize: vertical; min-height: 212px; padding: 18px; border: 1px solid var(--line-strong); border-radius: 15px; outline: none; background: #F7F9FC; color: var(--ink); font: 600 14px/1.9 "Segoe UI", Tahoma, sans-serif; direction: ltr; text-align: left; transition: border .2s, box-shadow .2s; }
.paste-box textarea:focus { border-color: var(--green); box-shadow: 0 0 0 4px rgba(32,64,144,.1); background: #fff; }
.paste-box textarea::placeholder { color: #a4b1ac; }
.paste-clear { position: absolute; top: 12px; left: 12px; padding: 6px 9px; border: 0; border-radius: 8px; background: #EEF1F6; color: var(--muted); font-size: 9px; cursor: pointer; }
.paste-help { display: flex; justify-content: space-between; align-items: center; gap: 14px; margin: 10px 0 14px; }
.paste-help > span { display: flex; align-items: center; gap: 6px; color: var(--muted); font-size: 9px; }.paste-help svg { width: 15px; color: var(--green); }
.paste-summary { display: flex; flex-wrap: wrap; gap: 8px; padding: 13px; border-radius: 12px; background: #F3F5F9; border: 1px solid #E4E8F0; }
.summary-pill { padding: 6px 10px; border-radius: 20px; font-size: 10px; font-weight: 700; }.summary-pill b { font-size: 12px; margin-left: 4px; }.summary-pill.valid { color: var(--green-strong); background: var(--green-soft); }.summary-pill.duplicate { color: var(--amber); background: var(--amber-soft); }.summary-pill.invalid { color: var(--red); background: var(--red-soft); }
.invalid-list { margin-top: 10px; padding: 11px 13px; border: 1px solid #f1c8c5; border-radius: 11px; background: var(--red-soft); color: var(--red); font-size: 10px; line-height: 1.7; direction: ltr; text-align: left; word-break: break-word; }
.paste-actions { display: flex; justify-content: space-between; align-items: center; gap: 16px; margin-top: 18px; }
.paste-actions > span { color: var(--muted); font-size: 10px; line-height: 1.7; }
.button:disabled { cursor: not-allowed; opacity: .55; box-shadow: none; }
.paste-guide { background: linear-gradient(160deg, #070B14, #12182A); color: #fff; overflow: hidden; position: relative; }
.paste-guide::after { content: ""; position: absolute; width: 190px; height: 190px; border: 1px solid rgba(158,224,194,.14); border-radius: 50%; left: -90px; bottom: -100px; box-shadow: 0 0 0 35px rgba(158,224,194,.035), 0 0 0 70px rgba(158,224,194,.025); }
.paste-guide .eyebrow { color: #8FA6DC; }.paste-guide h3 { margin: 0 0 24px; font-size: 19px; }
.paste-guide ol { list-style: none; margin: 0; padding: 0; display: grid; gap: 19px; position: relative; z-index: 1; }
.paste-guide li { display: flex; gap: 11px; align-items: flex-start; }.paste-guide li > span { width: 28px; height: 28px; flex: 0 0 auto; display: grid; place-items: center; border: 1px solid rgba(255,255,255,.22); border-radius: 9px; color: #A8BBE8; font: 800 10px "Segoe UI", sans-serif; }.paste-guide li div { display: grid; }.paste-guide li b { font-size: 11px; }.paste-guide li small { margin-top: 4px; color: #9AA8C7; font-size: 9px; line-height: 1.6; }
.privacy-note { display: flex; gap: 10px; align-items: flex-start; margin-top: 28px; padding: 14px; border-radius: 13px; background: rgba(255,255,255,.07); position: relative; z-index: 1; }.privacy-note svg { width: 21px; flex: 0 0 auto; color: #D02020; }.privacy-note div { display: grid; }.privacy-note b { font-size: 10px; }.privacy-note small { color: #aac6bd; font-size: 8px; line-height: 1.6; margin-top: 3px; }

.id-meta { margin: 6px 0 0; color: var(--muted); font-size: 12px; line-height: 1.7; }
.file-preview { margin-top: 14px; padding: 12px 14px; border: 1px dashed var(--line-strong); border-radius: 12px; background: #F7F9FC; display: flex; flex-direction: column; gap: 4px; }
.file-preview b { font-size: 13px; }
.file-preview span { color: var(--muted); font-size: 12px; }

.toast { position: fixed; z-index: 50; left: 28px; bottom: 28px; min-width: 270px; padding: 15px 17px; display: flex; align-items: center; gap: 10px; border-radius: 13px; background: var(--navy); color: #fff; box-shadow: 0 18px 45px rgba(7,11,20,.25); font-size: 12px; animation: toast-in .3s ease both; }
.toast svg { width: 19px; color: #7B97E0; }
@keyframes toast-in { from { opacity: 0; transform: translateY(12px); } }

@media (max-width: 960px) {
  .stats-grid { grid-template-columns: repeat(2, 1fr); }
  .field-grid { grid-template-columns: 1fr 1fr; }.primary-field { grid-column: 1 / -1; }
  .upload-layout { grid-template-columns: 1fr; }
  .paste-layout { grid-template-columns: 1fr; }
  .check-rail { grid-template-columns: 1fr 1fr; gap: 14px; }.rail-line { display: none; }.check-step { padding: 13px; border: 1px solid var(--line); border-radius: 12px; background: #fff; }
  .detail-grid { grid-template-columns: repeat(2, 1fr); }
}

@media (max-width: 700px) {
  
  .main-nav { width: 100%; overflow-x: auto; overflow-y: hidden; scrollbar-width: none; }.main-nav::-webkit-scrollbar { display: none; }.nav-inner { width: max-content; min-width: 100%; padding: 0 16px; gap: 22px; }
  .page-shell { width: calc(100% - 24px); padding-top: 24px; }
  .welcome-row { align-items: flex-start; }.date-chip { display: none; }
  .stats-grid { width: 100%; display: flex; overflow-x: auto; overflow-y: hidden; scroll-snap-type: x mandatory; scrollbar-width: none; }.stats-grid::-webkit-scrollbar { display: none; }.stat-card { min-width: 210px; scroll-snap-align: start; }
  .field-grid { grid-template-columns: 1fr; }.primary-field { grid-column: auto; }.form-actions { flex-direction: column-reverse; }.button { width: 100%; }
  .search-card, .result-detail, .upload-card, .queue-card { border-radius: 18px; }
  .paste-card, .paste-guide { border-radius: 18px; padding: 20px; }
  .paste-actions { align-items: stretch; flex-direction: column; }.paste-actions .button { width: 100%; }
  .paste-help { align-items: flex-start; flex-direction: column; }
  .result-head, .person-summary { align-items: flex-start; }.result-head { flex-direction: column; }.result-head .button { width: auto; }.person-summary p { line-height: 1.7; }
  .check-rail { grid-template-columns: 1fr; }.detail-grid { grid-template-columns: 1fr 1fr; }
  .section-head { padding: 18px; }.section-head > .text-button { display: none; }
  .table-wrap { overflow: visible; padding: 10px; } table, thead, tbody, tr, th, td { display: block; } thead { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0,0,0,0); }
  tbody { display: grid; gap: 10px; } tbody tr { padding: 8px 12px; border: 1px solid var(--line); border-radius: 13px; } tbody tr:hover { background: #fff; } td { display: flex; justify-content: space-between; align-items: center; gap: 15px; padding: 9px 0; border-bottom: 1px dashed var(--line); white-space: normal; text-align: left; } td::before { content: attr(data-label); color: var(--muted); font-size: 9px; font-weight: 800; text-align: right; } td:first-child { align-items: flex-start; } td:first-child b, td:first-child small { text-align: left; } td:last-child { border: 0; justify-content: flex-end; padding-bottom: 2px; } td:last-child::before { display: none; }
  .template-links { flex-wrap: wrap; }.toast { left: 12px; right: 12px; bottom: 12px; min-width: 0; }
}

@media (max-width: 420px) {
  .brand-kicker { display: none; }.brand-block h1 { font-size: 17px; }.brand-mark { width: 42px; height: 42px; }.nav-tab { font-size: 11px; }
  .detail-grid { grid-template-columns: 1fr; }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { scroll-behavior: auto !important; animation-duration: .01ms !important; transition-duration: .01ms !important; }
}

[hidden] { display: none !important; }
body {
  font-family: "IBM Plex Sans Arabic", "Tahoma", "Segoe UI", Arial, sans-serif;
}
.banner {
  width: min(1180px, calc(100% - 40px));
  margin: 16px auto 0;
  padding: 12px 16px;
  border-radius: 12px;
  background: var(--amber-soft);
  color: var(--amber);
  font-size: 13px;
  font-weight: 700;
}
.banner strong { margin-left: 8px; }
.check-step.warn > span { background: var(--amber); color: #fff; }
.check-step.bad > span { background: var(--red); color: #fff; }
.check-step.idle > span { background: var(--line); color: var(--muted); }
.logout-form { margin: 0; }
.ghost-logout {
  border: 1px solid rgba(255,255,255,.18);
  background: rgba(255,255,255,.08);
  color: #fff;
  border-radius: 11px;
  min-height: 42px;
  padding: 0 14px;
  font: inherit;
  font-weight: 800;
  cursor: pointer;
}
.feed { list-style: none; margin: 0; padding: 0; display: grid; gap: 8px; max-height: 280px; overflow: auto; }
.feed li { display: flex; gap: 10px; font-size: 11px; padding: 8px 0; border-bottom: 1px solid var(--line); }
.feed time { color: var(--muted); font-variant-numeric: tabular-nums; }
.feed .k-ok { color: var(--green-strong); }
.feed .k-bad { color: var(--red); }
.live-empty { color: var(--muted); font-size: 12px; }
.q-running b { color: var(--green-strong); }
/* auth replaced by taif-chrome.css */

.login-card .alert.ok {
  background: var(--green-soft);
  color: var(--green-strong);
}
.login-card .auth-links {
  margin: 18px 0 0;
  text-align: center;
  color: var(--muted);
  font-size: 13px;
  font-weight: 700;
}
.login-card .auth-links a {
  color: var(--green-strong);
  text-decoration: none;
}
.login-card .auth-links a:hover { text-decoration: underline; }

.admin-form {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
  gap: 12px;
  align-items: end;
  padding: 0 22px 18px;
}
.admin-form label { display: grid; gap: 6px; font-size: 12px; font-weight: 800; }
.admin-form input, .admin-form select {
  height: 44px; border: 1px solid var(--line-strong); border-radius: 11px; padding: 0 12px; font: inherit; background: #fff;
}
.admin-form .button { min-height: 44px; }
#user-msg.bad { color: var(--red); }
.row-acts { display: flex; gap: 8px; flex-wrap: wrap; }
.drop-zone input[type="file"] { position: absolute; inset: 0; opacity: 0; cursor: pointer; }
.drop-zone { position: relative; }
.job-log { margin-top: 16px; }
.analytics-page .kpi-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 12px; margin-bottom: 20px; }
.kpi-card { background: #fff; border: 1px solid var(--line); border-radius: var(--radius-md); padding: 16px 18px; box-shadow: var(--shadow); }
.kpi-card .label { color: var(--muted); font-size: 11px; font-weight: 800; }
.kpi-card .value { font-size: 28px; font-weight: 800; color: var(--navy); margin-top: 6px; }
.kpi-card .delta { font-size: 11px; color: var(--muted); margin-top: 4px; }
.kpi-card .delta .up { color: var(--green-strong); }
.kpi-card .delta .down { color: var(--red); }
.alert-widget { background: #fff; border: 1px solid var(--line); border-radius: var(--radius-md); padding: 18px; margin-bottom: 20px; }
.alert-widget h3 { margin: 0 0 12px; font-size: 15px; }
.alert-rows { display: flex; gap: 16px; flex-wrap: wrap; }
.alert-item { min-width: 180px; padding: 12px 14px; border-radius: 12px; }
.alert-item .n { font-size: 24px; font-weight: 800; }
.alert-item .t { font-size: 12px; color: var(--muted); }
.alert-item.red { background: var(--red-soft); }
.alert-item.yellow { background: var(--amber-soft); }
.chart-grid { display: grid; grid-template-columns: 1.4fr 1fr; gap: 12px; margin-bottom: 22px; }
.chart-card { background: #fff; border: 1px solid var(--line); border-radius: var(--radius-md); padding: 16px; }
.chart-card.wide { grid-column: 1 / -1; }
.chart-card h3 { margin: 0 0 10px; font-size: 13px; }
.chart-wrap { height: 240px; }
.form-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(180px, 1fr)); gap: 12px; margin-bottom: 14px; }
.form-grid .field { display: grid; gap: 6px; font-size: 12px; font-weight: 800; }
.form-grid input, .form-grid select { height: 44px; border: 1px solid var(--line-strong); border-radius: 11px; padding: 0 12px; font: inherit; }
.pagination { display: flex; gap: 10px; align-items: center; margin-top: 12px; }
.pg-info { font-size: 12px; color: var(--muted); }
.badge { display: inline-flex; border-radius: 20px; padding: 4px 9px; font-size: 10px; font-weight: 800; }
.badge.ok { background: var(--green-soft); color: var(--green-strong); }
.badge.bad { background: var(--red-soft); color: var(--red); }
.badge.warn { background: var(--amber-soft); color: var(--amber); }
table.data { width: 100%; border-collapse: collapse; font-size: 12px; }
table.data th, table.data td { padding: 10px 8px; border-bottom: 1px solid var(--line); text-align: right; }
table.data .empty { color: var(--muted); text-align: center; padding: 24px; }
.mono { font-variant-numeric: tabular-nums; }
.btn, .button.sm { min-height: 36px; padding: 0 12px; }
.btn.ghost, .button.ghost { background: #fff; color: var(--muted); border: 1px solid var(--line); }
.btn, button.btn { min-height: 44px; padding: 0 16px; border-radius: 11px; border: 0; background: var(--green); color: #fff; font: inherit; font-weight: 800; cursor: pointer; }
.modal-backdrop { position: fixed; inset: 0; background: rgba(7,11,20,.35); display: flex; align-items: center; justify-content: center; z-index: 40; padding: 20px; }
.modal { width: min(560px, 100%); max-height: 80vh; overflow: auto; background: #fff; border-radius: 18px; padding: 18px; }
.modal-head { display: flex; justify-content: space-between; align-items: center; margin-bottom: 12px; }
.modal-close { border: 0; background: transparent; cursor: pointer; font-size: 18px; }
.detail-row { display: flex; justify-content: space-between; gap: 12px; padding: 8px 0; border-bottom: 1px solid var(--line); font-size: 13px; }
.detail-row .k { color: var(--muted); }
.toast-stack { position: fixed; inset: auto 16px 16px auto; z-index: 50; display: grid; gap: 8px; }
.analytics-page .toast, .toast-stack .toast { background: var(--navy); color: #fff; padding: 10px 14px; border-radius: 10px; font-size: 12px; }
@media (max-width: 900px) {
  .analytics-page .kpi-grid, .chart-grid { grid-template-columns: 1fr; }
  .chart-card.wide { grid-column: auto; }
}


/* taif-chrome-start */
.topbar {
  position: sticky;
  top: 0;
  z-index: 40;
  min-height: 72px;
  padding: 0 28px;
  background: #000;
  color: #fff;
  display: grid;
  grid-template-columns: auto 1fr auto;
  align-items: center;
  column-gap: 20px;
}
.topbar::after {
  content: "";
  position: absolute;
  right: 0;
  left: 0;
  bottom: 0;
  height: 3px;
  background: linear-gradient(90deg, #D02020 0%, #204090 58%, #28408C 100%);
}
.brand-block {
  display: flex;
  align-items: center;
  gap: 12px;
  min-width: 0;
  color: inherit;
  text-decoration: none;
}
.brand-mark-img {
  width: 44px;
  height: 44px;
  object-fit: contain;
  background: #fff;
  border-radius: 12px;
  padding: 4px;
  flex: 0 0 auto;
}
.brand-text { display: grid; min-width: 0; }
.brand-text strong { font-size: 15px; font-weight: 700; white-space: nowrap; }
.brand-text small { color: #A8B6D4; font-size: 11px; margin-top: 2px; }
.nav-toggle {
  display: none;
  width: 44px;
  height: 44px;
  margin-inline-start: auto;
  border: 1px solid rgba(255,255,255,.18);
  border-radius: 12px;
  background: rgba(255,255,255,.06);
  padding: 0;
  cursor: pointer;
  flex-direction: column;
  justify-content: center;
  align-items: center;
  gap: 5px;
}
.nav-toggle span {
  display: block;
  width: 18px;
  height: 2px;
  background: #fff;
  border-radius: 2px;
}
.top-actions { display: contents; }
.top-end { display: flex; align-items: center; gap: 12px; justify-self: end; }
.nav-pills {
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 4px;
  border-radius: 999px;
  background: rgba(255,255,255,.08);
  justify-self: center;
}
.nav-pill {
  color: #D5DEF0;
  text-decoration: none;
  border: 0;
  background: transparent;
  border-radius: 999px;
  padding: 8px 18px;
  font-size: 13px;
  font-weight: 700;
  white-space: nowrap;
}
.nav-pill:hover { color: #fff; background: rgba(255,255,255,.08); }
.nav-pill.is-active { background: #fff; color: #183070; }
.live-chip {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 6px 4px 6px 10px;
  border-inline-start: 1px solid rgba(255,255,255,.12);
}
.live-dot { width: 8px; height: 8px; border-radius: 50%; background: #3D6AD6; box-shadow: 0 0 0 5px rgba(61,106,214,.16); flex: 0 0 auto; }
.live-dot.is-off { background: #D02020; box-shadow: 0 0 0 5px rgba(208,32,32,.16); }
.live-copy { display: grid; }
.live-copy b { font-size: 12px; }
.live-copy small { font-size: 10px; color: #9AA8C7; margin-top: 2px; }
.account-wrap { position: relative; flex: 0 0 auto; }
.account-btn {
  display: flex;
  align-items: center;
  gap: 10px;
  border: 1px solid rgba(255,255,255,.18);
  background: rgba(255,255,255,.08);
  color: #fff;
  border-radius: 12px;
  min-height: 44px;
  padding: 0 12px 0 8px;
  cursor: pointer;
}
.avatar {
  width: 32px;
  height: 32px;
  border-radius: 10px;
  display: grid;
  place-items: center;
  background: #E7EDF8;
  color: #183070;
  font-weight: 800;
}
.user-copy { display: grid; text-align: right; }
.user-copy b { font-size: 12px; }
.user-copy small { color: #9AA8C7; font-size: 10px; margin-top: 2px; }
.account-menu {
  position: absolute;
  top: calc(100% + 8px);
  left: 0;
  min-width: 210px;
  padding: 8px;
  border-radius: 14px;
  background: #fff;
  color: var(--ink);
  box-shadow: 0 18px 40px rgba(16,24,44,.18);
  z-index: 50;
  display: grid;
  gap: 4px;
}
.account-item {
  display: block;
  width: 100%;
  text-align: right;
  border: 0;
  background: transparent;
  color: var(--ink);
  text-decoration: none;
  border-radius: 10px;
  padding: 10px 12px;
  font: inherit;
  font-weight: 700;
  cursor: pointer;
}
.account-item:hover, .account-item.is-active { background: var(--green-soft); color: var(--green-strong); }
.account-item.danger { color: var(--red); }
.logout-form { margin: 0; }

@media (max-width: 1180px) {
  .live-copy small { display: none; }
  .user-copy { display: none; }
  .topbar { padding: 0 18px; column-gap: 16px; }
}
@media (max-width: 1040px) {
  .live-chip { display: none; }
  .nav-pill { padding: 8px 14px; }
}

@media (max-width: 800px) {
  .topbar {
    grid-template-columns: 1fr auto;
    padding: 10px 14px;
    min-height: 64px;
  }
  .nav-toggle { display: flex; }
  .top-actions {
    display: none;
    position: absolute;
    top: calc(100% + 8px);
    right: 12px;
    left: 12px;
    flex-direction: column;
    align-items: stretch;
    justify-content: flex-start;
    gap: 10px;
    padding: 12px;
    background: #070B14;
    border: 1px solid rgba(255,255,255,.12);
    border-radius: 16px;
    box-shadow: 0 18px 40px rgba(0,0,0,.35);
    z-index: 45;
  }
  .topbar.is-nav-open .top-actions { display: flex; }
  .top-end { display: flex; flex-direction: column; align-items: stretch; gap: 10px; }
  .nav-pills { flex-direction: column; border-radius: 14px; padding: 6px; justify-self: stretch; }
  .nav-pill { width: 100%; text-align: center; }
  .live-chip { display: flex; border: 0; padding: 8px; }
  .user-copy { display: grid; }
  .account-btn { width: 100%; }
  .account-menu { position: static; box-shadow: none; background: #F3F5F9; }
}

body.auth {
  min-height: 100vh;
  display: grid;
  place-items: center;
  padding: 24px;
  background:
    radial-gradient(900px 420px at 90% -10%, rgba(208,32,32,.18), transparent 55%),
    radial-gradient(700px 380px at 10% 110%, rgba(32,64,144,.22), transparent 50%),
    #000;
}
.login-card {
  width: min(440px, calc(100% - 32px));
  padding: 0 0 28px;
  border: 1px solid rgba(255,255,255,.08);
  border-radius: 24px;
  background: #fff;
  box-shadow: 0 24px 60px rgba(0,0,0,.35);
  overflow: hidden;
}
.lockup-plate {
  background: #000;
  padding: 22px 20px 18px;
  display: grid;
  place-items: center;
}
.lockup-plate img {
  width: min(340px, 100%);
  height: auto;
  display: block;
}
.login-card .brand-lock { display: none; }
.login-card .eyebrow { margin: 18px 28px 4px; color: #D02020; font-size: 11px; font-weight: 800; }
.login-card h1 { margin: 0 28px 6px; font-size: 22px; color: #183070; }
.login-card .city, .login-card .lead { color: var(--muted); font-size: 13px; line-height: 1.7; margin: 0 28px 8px; }
.login-card form, .login-card .alert { margin-left: 28px; margin-right: 28px; }
.login-card label { display: grid; gap: 8px; margin: 14px 0; font-size: 12px; font-weight: 800; }
.login-card input {
  height: 48px; border: 1px solid var(--line-strong); border-radius: 11px;
  padding: 0 14px; font: inherit;
}
.login-card input:focus { outline: 3px solid rgba(208,32,32,.35); outline-offset: 2px; border-color: var(--green); }
.login-card button[type="submit"] {
  width: 100%; min-height: 48px; margin-top: 8px; border: 0; border-radius: 12px;
  background: var(--green); color: #fff; font: inherit; font-weight: 800; cursor: pointer;
}
.login-card button[type="submit"]:hover { background: var(--green-strong); }
.login-card .alert { background: var(--red-soft); color: var(--red); padding: 10px 12px; border-radius: 10px; font-size: 12px; font-weight: 700; }
.login-card .alert.ok { background: var(--green-soft); color: var(--green-strong); }
.login-card .auth-links {
  margin: 18px 28px 0;
  text-align: center;
  color: var(--muted);
  font-size: 13px;
  font-weight: 700;
}
.login-card .auth-links a { color: var(--green-strong); text-decoration: none; }
.login-card .auth-links a:hover { text-decoration: underline; }
body.admin-auth .login-card .eyebrow { color: #D02020; }

.filter-actions, .alert-actions { display: flex; gap: 8px; flex-wrap: wrap; margin-top: 12px; }
.section-title { margin: 8px 0 12px; }
.search-filters { margin-bottom: 16px; }
.expiring-table { max-height: 400px; overflow: auto; }
.modal-backdrop[hidden] { display: none !important; }

/* taif-chrome-end */
