/* Zivro Console, look A "Zivro Teal". Desktop first (about 1280 px); everything wraps on a narrow window.
   Screens use these shared classes; anything only one screen needs goes in its .razor.css file. */

:root {
  --bg: #F8F7F2;
  --surface: #FFFFFF;
  --surface-2: #F3F6F5;
  --ink: #14201F;
  --ink-2: #3F4E4D;
  --muted: #5E6867;
  --faint: #8E979A;
  --line: #E4E8E7;
  --line-2: #D6DDDC;
  --line-soft: #EEF2F1;

  --teal: #0B6B6D;
  --teal-dark: #084F50;
  --teal-ink: #0B4F50;
  --teal-tint: #E3F3F3;
  --teal-row: #F3FAFA;
  --saffron: #F5B800;
  --saffron-tint: #FFF4CC;
  --saffron-line: #F1DC8C;
  --saffron-ink: #5C4000;
  --red: #D7373F;
  --red-strong: #B3261E;
  --red-ink: #8E1F26;
  --red-tint: #FDE8E9;
  --red-line: #F5C6C9;
  --red-row: #FFFAFA;
  --amber: #E08A00;
  --amber-ink: #8A5300;
  --green: #1E9E5A;
  --green-ink: #14653B;
  --green-tint: #E8F6EE;
  --blue: #1F4E79;
  --blue-tint: #E5EEF7;

  --nav: #0F2E2E;
  --nav-active: #1D4746;
  --nav-card: #163C3C;
  --nav-text: #D5E4E3;
  --nav-muted: #A9C4C3;

  --radius: 16px;
  --radius-sm: 10px;
  --font: Inter, system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  --font-head: Sora, Inter, system-ui, sans-serif;
  --font-mono: ui-monospace, Consolas, "Cascadia Mono", monospace;
}

* { box-sizing: border-box; }
[hidden] { display: none !important; }
html, body { min-height: 100%; }

body {
  margin: 0;
  background: var(--bg);
  color: var(--ink);
  font: 14px/20px var(--font);
  -webkit-font-smoothing: antialiased;
}

h1, h2, h3, p { margin: 0; }
h1, h2, h3 { font-family: var(--font-head); font-weight: 600; }
a { color: var(--teal); }
a:hover { color: var(--teal-dark); }
button, input, select, textarea { font: inherit; color: inherit; }
:focus-visible { outline: 3px solid #7FC4C5; outline-offset: 2px; }
/* Blazor moves focus to the page title after each navigation (for screen readers); no ring needed there. */
h1:focus { outline: none; }
.tnum { font-variant-numeric: tabular-nums; }
.mono { font-family: var(--font-mono); }

.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;
}

/* ── Layout helpers ─────────────────────────────────────────────── */
.row { display: flex; flex-wrap: wrap; align-items: center; gap: 12px; }
.stack { display: flex; flex-direction: column; gap: 12px; }
.stack-sm { display: flex; flex-direction: column; gap: 6px; }
.stack-lg { display: flex; flex-direction: column; gap: 24px; }
.grow { flex: 1 1 auto; min-width: 0; }
.split { display: flex; flex-wrap: wrap; gap: 24px; align-items: flex-start; }
.split > .main { flex: 999 1 560px; min-width: 0; }
.split > .side { flex: 1 1 300px; min-width: 0; }
.muted { color: var(--muted); }
.faint { color: var(--faint); }
.small { font-size: 13px; line-height: 18px; }
.strong { font-weight: 600; }
.nowrap { white-space: nowrap; }
.right { text-align: right; }

/* ── Page ───────────────────────────────────────────────────────── */
.page { padding: 28px 32px 40px; display: flex; flex-direction: column; gap: 24px; min-width: 0; }
.page-head { display: flex; flex-wrap: wrap; align-items: center; gap: 12px 16px; }
.page-head .heading { flex: 1 1 300px; display: flex; flex-direction: column; gap: 4px; }
.page-title { font-size: 28px; line-height: 36px; }
.page-sub { color: var(--muted); }
.back { font-weight: 600; text-decoration: none; }

/* ── Cards ──────────────────────────────────────────────────────── */
.card { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); min-width: 0; }
.card-pad { padding: 18px 20px; }
.card-head { display: flex; flex-wrap: wrap; align-items: center; gap: 12px; padding: 16px 20px; border-bottom: 1px solid var(--line); }
.card-title { font-size: 18px; line-height: 24px; }
.card-title-sm { font-size: 16px; line-height: 22px; }
.card-foot { display: flex; flex-wrap: wrap; align-items: center; gap: 12px; padding: 16px 24px; background: var(--surface-2); border-top: 1px solid var(--line); border-radius: 0 0 var(--radius) var(--radius); }
.section { padding: 20px 24px; border-bottom: 1px solid var(--line-soft); display: flex; flex-direction: column; gap: 12px; }
.section:last-child { border-bottom: 0; }

/* ── Buttons ────────────────────────────────────────────────────── */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  min-height: 44px; padding: 0 18px; border-radius: 12px;
  border: 1px solid var(--line-2); background: var(--surface); color: var(--ink);
  font-weight: 600; text-decoration: none; cursor: pointer; white-space: nowrap;
}
.btn:hover { border-color: #B9C4C3; color: var(--ink); }
.btn:disabled, .btn[aria-disabled="true"] { opacity: 0.55; cursor: not-allowed; }
.btn-sm { min-height: 36px; padding: 0 12px; border-radius: var(--radius-sm); }
.btn-primary { background: var(--teal); border-color: var(--teal); color: #FFFFFF; }
.btn-primary:hover { background: var(--teal-dark); border-color: var(--teal-dark); color: #FFFFFF; }
.btn-danger { background: var(--red-strong); border-color: var(--red-strong); color: #FFFFFF; font-weight: 700; }
.btn-danger:hover { background: #941F18; border-color: #941F18; color: #FFFFFF; }
.btn-outline { border-color: var(--teal); color: var(--teal); font-weight: 700; }
.btn-dashed { border: 1.5px dashed #9FB4B3; color: var(--teal); font-weight: 700; }
.btn-quiet-danger { border-color: var(--red-line); color: #A4232A; }
.link {
  border: 0; background: none; padding: 0; min-height: 32px; display: inline-flex; align-items: center;
  color: var(--teal); font-weight: 600; cursor: pointer; text-decoration: none;
}
.link:hover { color: var(--teal-dark); text-decoration: underline; }
.link:disabled { color: var(--faint); cursor: not-allowed; text-decoration: none; }
.icon-btn {
  width: 40px; height: 40px; border-radius: var(--radius-sm); border: 1px solid var(--line-2);
  background: var(--surface); color: var(--ink-2); display: inline-flex; align-items: center; justify-content: center; cursor: pointer;
}
.icon-btn:disabled { opacity: 0.45; cursor: not-allowed; }

/* ── Filter chips and toggles ───────────────────────────────────── */
.chips { display: flex; flex-wrap: wrap; gap: 6px; }
.chip {
  min-height: 36px; padding: 0 14px; border-radius: 999px; border: 1px solid var(--line-2);
  background: var(--surface); color: var(--ink-2); cursor: pointer; display: inline-flex; align-items: center; gap: 6px;
}
.chip[aria-pressed="true"], .chip.on { border-color: var(--teal); background: var(--teal-tint); color: var(--teal); font-weight: 600; }
.chip.solid[aria-pressed="true"] { background: var(--teal); color: #FFFFFF; }

/* A box you pick (store, kind, duration): a label around a checkbox or radio. */
.choice {
  display: inline-flex; align-items: center; gap: 8px; min-height: 44px; padding: 0 14px;
  border-radius: 12px; border: 1px solid var(--line-2); background: var(--surface); color: var(--ink-2); cursor: pointer;
}
.choice input { width: 18px; height: 18px; accent-color: var(--teal); margin: 0; }
.choice.on { border: 1.5px solid var(--teal); background: var(--teal-tint); color: var(--teal-ink); font-weight: 600; }
.choice.disabled { opacity: 0.55; cursor: not-allowed; }

/* Segmented control: labels in a row inside one border. */
.seg { display: inline-flex; border: 1px solid var(--line-2); border-radius: var(--radius-sm); overflow: hidden; }
.seg > label, .seg > button {
  min-height: 40px; padding: 0 16px; display: inline-flex; align-items: center; justify-content: center; gap: 6px;
  border: 0; border-left: 1px solid var(--line-2); background: var(--surface); color: var(--ink-2); cursor: pointer;
}
.seg > :first-child { border-left: 0; }
.seg > .on { background: var(--teal-tint); color: var(--teal-ink); font-weight: 700; }
.seg input { accent-color: var(--teal); margin: 0; }

/* ── Status pills and tags ──────────────────────────────────────── */
.pill { display: inline-flex; align-items: center; gap: 6px; padding: 2px 10px; border-radius: 999px; font-weight: 600; font-size: 13px; line-height: 20px; white-space: nowrap; }
.pill .dot { width: 8px; height: 8px; border-radius: 50%; background: currentColor; }
.pill-ok { background: var(--green-tint); color: var(--green-ink); }
.pill-ok .dot { background: var(--green); }
.pill-err { background: var(--red-tint); color: var(--red-ink); }
.pill-err .dot { background: var(--red); }
.pill-warn { background: var(--saffron-tint); color: var(--saffron-ink); }
.pill-warn .dot { background: var(--amber); }
.pill-info { background: var(--blue-tint); color: var(--blue); }
.pill-info .dot { background: var(--blue); }
.pill-muted { background: var(--line-soft); color: var(--ink-2); }
.pill-muted .dot { background: var(--faint); }
.tag { display: inline-block; padding: 1px 8px; border-radius: 6px; font-size: 12px; font-weight: 700; letter-spacing: 0.02em; }
.eyebrow { font-size: 12px; font-weight: 600; letter-spacing: 0.05em; text-transform: uppercase; color: var(--muted); }
.count { margin-left: 4px; padding: 0 8px; border-radius: 999px; background: var(--line-soft); font-size: 12px; font-weight: 600; }

/* ── Forms ──────────────────────────────────────────────────────── */
fieldset { border: 0; margin: 0; padding: 0; min-width: 0; }
legend { padding: 0; }
.field { display: flex; flex-direction: column; gap: 6px; min-width: 0; }
.field-label { font-weight: 600; }
.field-label .opt { font-weight: 400; color: var(--muted); }
.input, .select, .textarea {
  min-height: 44px; padding: 0 12px; border: 1px solid var(--line-2); border-radius: var(--radius-sm);
  background: var(--surface); color: var(--ink); width: 100%; min-width: 0;
}
.textarea { padding: 10px 12px; resize: vertical; min-height: 72px; }
.select { padding: 0 10px; }
.input:focus, .select:focus, .textarea:focus { border-color: var(--teal); outline: 2px solid #BFE3E3; outline-offset: 0; }
.input[aria-invalid="true"], .select[aria-invalid="true"], .textarea[aria-invalid="true"] { border-color: var(--red); }
.hint { color: var(--muted); font-size: 13px; line-height: 18px; }
.fields { display: flex; flex-wrap: wrap; gap: 14px; }
.fields > .field { flex: 1 1 220px; }

/* ── Inline messages and the banner ─────────────────────────────── */
.msg { display: flex; gap: 10px; align-items: flex-start; padding: 12px 14px; border-radius: 12px; }
.msg-err { background: var(--red-tint); color: var(--red-ink); }
.msg-warn { background: var(--saffron-tint); color: var(--saffron-ink); }
.msg-ok { background: var(--green-tint); color: var(--green-ink); }
.msg-info { background: var(--teal-tint); color: var(--teal-ink); }
.msg-muted { background: var(--line-soft); color: var(--ink-2); }
.bar { display: flex; flex-wrap: wrap; align-items: center; gap: 12px; padding: 12px 16px; border-radius: 14px; font-weight: 500; }
.bar-ok { background: var(--green-tint); color: var(--green-ink); border: 1px solid #BFE3CC; }
.bar-err { background: var(--red-tint); color: var(--red-ink); border: 1px solid var(--red-line); }
.check { display: flex; gap: 10px; align-items: flex-start; margin: 0; }
.check > svg { flex: none; margin-top: 1px; }

/* ── Tables ─────────────────────────────────────────────────────── */
.table-wrap { overflow-x: auto; }
.table { width: 100%; border-collapse: collapse; }
.table > thead > tr > th { text-align: left; color: var(--muted); font-size: 12px; text-transform: uppercase; letter-spacing: 0.05em; font-weight: 600; padding: 12px; }
.table > tbody > tr > td { padding: 14px 12px; border-top: 1px solid var(--line-soft); vertical-align: top; }
.table > thead > tr > th:first-child, .table > tbody > tr > td:first-child { padding-left: 20px; }
.table > thead > tr > th:last-child, .table > tbody > tr > td:last-child { padding-right: 20px; }
.table > tbody > tr.hot > td { background: var(--red-row); }
.table > tbody > tr.open > td { background: var(--teal-row); }
.table .sub { color: var(--muted); font-size: 13px; line-height: 18px; }

/* ── Summary tiles ──────────────────────────────────────────────── */
.kpis { display: grid; grid-template-columns: repeat(auto-fit, minmax(200px, 1fr)); gap: 16px; }
.kpi { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 18px 20px; display: flex; flex-direction: column; gap: 6px; }
.kpi-label { color: var(--muted); font-weight: 500; }
.kpi-value { font-family: var(--font-head); font-size: 32px; line-height: 40px; font-weight: 600; }
.kpi-value small { font-size: 16px; color: var(--muted); font-weight: 500; }
.kpi-err { background: var(--red-tint); border-color: var(--red-line); color: var(--red-ink); }
.kpi-err .kpi-label, .kpi-err small { color: var(--red-ink); }
.kpi-warn { background: var(--saffron-tint); border-color: var(--saffron-line); color: var(--saffron-ink); }
.kpi-warn .kpi-label, .kpi-warn small { color: var(--saffron-ink); }
.kpi-info { background: var(--blue-tint); border-color: #C9DAEB; color: var(--blue); }

/* ── Avatars ────────────────────────────────────────────────────── */
.avatar { flex: none; width: 32px; height: 32px; border-radius: 50%; display: inline-flex; align-items: center; justify-content: center; font-size: 12px; font-weight: 700; background: var(--teal-tint); color: var(--teal); }

/* ── Phone preview frame ────────────────────────────────────────── */
.phone { width: 320px; max-width: 100%; height: 600px; border-radius: 40px; background: var(--ink); padding: 12px; }
.phone-screen { width: 100%; height: 100%; border-radius: 30px; background: var(--bg); overflow: hidden auto; display: flex; flex-direction: column; }
.skeleton { background: #E9EDEC; border-radius: 12px; }

/* ── Overlay (dialogs, expired session) ─────────────────────────── */
.overlay { position: fixed; inset: 0; background: rgba(20, 32, 31, 0.5); display: flex; align-items: center; justify-content: center; padding: 24px; z-index: 50; }
.dialog { background: var(--surface); border-radius: 20px; padding: 28px; width: 100%; max-width: 480px; display: flex; flex-direction: column; gap: 16px; box-shadow: 0 24px 60px rgba(15, 46, 46, 0.25); }

/* ── Loading ────────────────────────────────────────────────────── */
.loading { padding: 48px; text-align: center; color: var(--muted); }
.spinner { width: 18px; height: 18px; border-radius: 50%; border: 2.5px solid currentColor; border-right-color: transparent; animation: spin 0.8s linear infinite; display: inline-block; vertical-align: middle; }
@keyframes spin { to { transform: rotate(360deg); } }
@media (prefers-reduced-motion: reduce) { .spinner { animation-duration: 2s; } }

@media (max-width: 720px) {
  .page { padding: 20px 16px 32px; }
  .page-title { font-size: 24px; line-height: 32px; }
}
