/* Z Agency Leads
   World: zaid.agency's near-black ground, white-alpha hairlines, Inter, one violet accent.
   Radius rule: controls and panels 10px; status pills and avatars fully round. Nothing else. */

@font-face {
  font-family: "Inter";
  src: url("/static/fonts/InterVariable.woff2") format("woff2");
  font-weight: 100 900;
  font-style: normal;
  font-display: swap;
}

:root {
  color-scheme: dark;
  --bg: #0a0a0b;
  --bg-raised: #111113;
  --bg-hover: #16161a;
  --bg-input: #0f0f11;
  --line: rgba(255, 255, 255, 0.08);
  --line-strong: rgba(255, 255, 255, 0.16);
  --text: #ededef;
  --text-2: #a8a8b3;           /* 8.2:1 on --bg */
  --text-3: #7c7c88;           /* 4.9:1 on --bg, muted labels only */
  --accent: #8b5cf6;
  --accent-text: #b39cf9;      /* 7.1:1 on --bg */
  --accent-soft: rgba(139, 92, 246, 0.16);
  --success-text: #5fd3a5;
  --success-soft: rgba(52, 211, 153, 0.14);
  --warning-text: #f5c451;
  --warning-soft: rgba(251, 191, 36, 0.14);
  --danger-text: #f5867e;
  --danger-soft: rgba(248, 113, 113, 0.14);
  --neutral-soft: rgba(255, 255, 255, 0.07);
  --radius: 10px;
  --shadow: 0 12px 40px -12px rgba(0, 0, 0, 0.7), 0 2px 8px rgba(0, 0, 0, 0.4);
  --ease: cubic-bezier(0.16, 1, 0.3, 1);
  --dur: 180ms;
  --gutter: 16px;
  --topbar-h: 56px;
  --panel-w: 440px;
}
@media (min-width: 720px) { :root { --gutter: 24px; } }

*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font: 400 15px/1.5 "Inter", system-ui, -apple-system, "Segoe UI", sans-serif;
  font-feature-settings: "cv11", "ss01";
  -webkit-font-smoothing: antialiased;
  min-height: 100dvh;
}
a { color: var(--accent-text); text-decoration: none; }
a:hover { text-decoration: underline; text-underline-offset: 2px; }
h1, h2, h3 { margin: 0; font-weight: 600; letter-spacing: -0.01em; line-height: 1.25; }
h1 { font-size: 22px; }
h2 { font-size: 17px; }
h3 { font-size: 14px; color: var(--text-2); font-weight: 500; }
p { margin: 0; }
code, .mono { font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace; font-size: 0.92em; }
.tnum { font-variant-numeric: tabular-nums; }
.muted { color: var(--text-2); }
.faint { color: var(--text-3); }
.small { font-size: 13px; }
.nowrap { white-space: nowrap; }
.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; border-radius: 4px; }
::selection { background: rgba(139, 92, 246, 0.35); }

.icon { width: 18px; height: 18px; flex: none; stroke: currentColor; fill: none; stroke-width: 1.75; stroke-linecap: round; stroke-linejoin: round; }
.icon-sm { width: 15px; height: 15px; }

/* ---------------------------------------------------------------- shell */
.topbar {
  position: sticky; top: 0; z-index: 20;
  height: var(--topbar-h);
  display: flex; align-items: center; gap: 14px;
  padding: 0 var(--gutter);
  background: rgba(10, 10, 11, 0.85);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  border-bottom: 1px solid var(--line);
}
.brand { display: flex; align-items: center; gap: 10px; color: var(--text); min-width: 0; }
.brand:hover { text-decoration: none; }
.zmark {
  width: 28px; height: 28px; border-radius: 7px; flex: none;
  background: #fff; color: #0a0a0b;
  display: grid; place-items: center;
  font-weight: 800; font-size: 15px; letter-spacing: -0.04em;
}
.brand-name { font-weight: 600; font-size: 15px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.brand-sub { color: var(--text-3); font-size: 13px; white-space: nowrap; }
.brand-sep { color: var(--text-3); margin: 0 2px; }
.nav { display: flex; gap: 2px; margin-left: 6px; }
.nav a {
  color: var(--text-2); padding: 6px 10px; border-radius: 8px; font-size: 14px; font-weight: 500;
  transition: background var(--dur) var(--ease), color var(--dur) var(--ease);
}
.nav a:hover { background: var(--bg-hover); color: var(--text); text-decoration: none; }
.nav a[aria-current="page"] { color: var(--text); background: var(--neutral-soft); }
.topbar-right { margin-left: auto; display: flex; align-items: center; gap: 8px; }
.user-chip { display: flex; align-items: center; gap: 8px; color: var(--text-2); font-size: 13px; }
.avatar {
  width: 28px; height: 28px; border-radius: 999px; flex: none;
  background: var(--neutral-soft); border: 1px solid var(--line-strong);
  display: grid; place-items: center; font-size: 11px; font-weight: 600; color: var(--text);
}
@media (max-width: 719px) {
  .user-chip .user-name { display: none; }
  .nav { display: none; }
  .brand-sub { display: none; }
}
.subnav { display: none; }
@media (max-width: 719px) {
  .subnav { display: flex; gap: 2px; overflow-x: auto; padding: 8px var(--gutter); border-bottom: 1px solid var(--line); scrollbar-width: none; }
  .subnav::-webkit-scrollbar { display: none; }
  .subnav a { color: var(--text-2); padding: 6px 10px; border-radius: 8px; font-size: 14px; font-weight: 500; white-space: nowrap; }
  .subnav a[aria-current="page"] { color: var(--text); background: var(--neutral-soft); }
}

.page { max-width: 1240px; margin: 0 auto; padding: 20px var(--gutter) 80px; }
.page-narrow { max-width: 760px; }
.page-head { display: flex; align-items: flex-end; justify-content: space-between; gap: 16px; flex-wrap: wrap; margin-bottom: 18px; }
.page-head p { color: var(--text-2); margin-top: 4px; }

.viewing-as {
  display: flex; align-items: center; gap: 10px; flex-wrap: wrap;
  padding: 10px 14px; margin-bottom: 16px;
  background: var(--accent-soft); border: 1px solid rgba(139, 92, 246, 0.35); border-radius: var(--radius);
  color: var(--text); font-size: 14px;
}
.viewing-as a { margin-left: auto; }

/* ---------------------------------------------------------------- buttons + forms */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  height: 38px; padding: 0 14px;
  border-radius: var(--radius); border: 1px solid var(--line-strong);
  background: var(--bg-raised); color: var(--text);
  font: inherit; font-size: 14px; font-weight: 500; line-height: 1; white-space: nowrap;
  cursor: pointer; text-decoration: none;
  transition: background var(--dur) var(--ease), border-color var(--dur) var(--ease), transform 80ms var(--ease), opacity var(--dur);
}
.btn:hover { background: var(--bg-hover); border-color: rgba(255, 255, 255, 0.24); text-decoration: none; }
.btn:active { transform: translateY(1px); }
.btn:disabled, .btn[aria-disabled="true"] { opacity: 0.5; cursor: not-allowed; transform: none; }
.btn-primary { background: #fff; color: #0a0a0b; border-color: #fff; }
.btn-primary:hover { background: #e9e9ec; border-color: #e9e9ec; }
.btn-accent { background: var(--accent); border-color: var(--accent); color: #fff; }
.btn-accent:hover { background: #7c4ff0; border-color: #7c4ff0; }
.btn-ghost { background: transparent; border-color: transparent; color: var(--text-2); }
.btn-ghost:hover { background: var(--bg-hover); color: var(--text); border-color: transparent; }
.btn-danger { color: var(--danger-text); }
.btn-danger:hover { background: var(--danger-soft); border-color: rgba(248, 113, 113, 0.4); }
.btn-sm { height: 32px; padding: 0 11px; font-size: 13px; border-radius: 8px; }
.btn-icon { width: 38px; padding: 0; }
.btn-sm.btn-icon { width: 32px; }
.btn-block { width: 100%; }
.btn.is-loading { position: relative; color: transparent !important; pointer-events: none; }
.btn.is-loading::after {
  content: ""; position: absolute; inset: 0; margin: auto; width: 16px; height: 16px;
  border-radius: 999px; border: 2px solid rgba(255, 255, 255, 0.35); border-top-color: #fff;
  animation: spin 700ms linear infinite;
}
.btn-primary.is-loading::after { border-color: rgba(0, 0, 0, 0.25); border-top-color: #0a0a0b; }
@keyframes spin { to { transform: rotate(360deg); } }

.field { display: flex; flex-direction: column; gap: 6px; }
.field label, .label { font-size: 13px; font-weight: 500; color: var(--text-2); }
.field .hint { font-size: 12.5px; color: var(--text-3); }
.field .error-text { font-size: 13px; color: var(--danger-text); }
.input, .select, .textarea {
  width: 100%; min-height: 40px; padding: 8px 12px;
  background: var(--bg-input); color: var(--text);
  border: 1px solid var(--line-strong); border-radius: var(--radius);
  font: inherit; font-size: 15px;
  transition: border-color var(--dur) var(--ease), box-shadow var(--dur) var(--ease);
}
.input::placeholder, .textarea::placeholder { color: var(--text-3); }
.input:hover, .select:hover, .textarea:hover { border-color: rgba(255, 255, 255, 0.24); }
.input:focus, .select:focus, .textarea:focus { outline: none; border-color: var(--accent); box-shadow: 0 0 0 3px var(--accent-soft); }
.input[aria-invalid="true"] { border-color: var(--danger-text); }
.textarea { resize: vertical; min-height: 84px; line-height: 1.5; }
.select {
  appearance: none; -webkit-appearance: none; padding-right: 34px;
  background-image: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' width='16' height='16' viewBox='0 0 24 24' fill='none' stroke='%23a8a8b3' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'><path d='M6 9l6 6 6-6'/></svg>");
  background-repeat: no-repeat; background-position: right 11px center;
}
input[type="date"].input { color-scheme: dark; }
.check { display: flex; align-items: center; gap: 10px; font-size: 14px; color: var(--text); cursor: pointer; }
.check input { width: 18px; height: 18px; accent-color: var(--accent); margin: 0; }
.form-grid { display: grid; gap: 16px; grid-template-columns: 1fr; }
@media (min-width: 640px) { .form-grid.cols-2 { grid-template-columns: 1fr 1fr; } .form-grid .span-2 { grid-column: span 2; } }
.form-actions { display: flex; gap: 10px; align-items: center; flex-wrap: wrap; margin-top: 4px; }
.inline-form { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; }

/* ---------------------------------------------------------------- alerts + toasts */
.alert {
  display: flex; gap: 10px; align-items: flex-start;
  padding: 11px 14px; border-radius: var(--radius); font-size: 14px; margin-bottom: 16px;
  border: 1px solid var(--line-strong); background: var(--bg-raised); color: var(--text);
}
.alert .icon { margin-top: 1px; }
.alert-ok { border-color: rgba(52, 211, 153, 0.35); background: var(--success-soft); }
.alert-error { border-color: rgba(248, 113, 113, 0.4); background: var(--danger-soft); }
.alert-warn { border-color: rgba(251, 191, 36, 0.4); background: var(--warning-soft); }
.toasts { position: fixed; left: 50%; bottom: 20px; transform: translateX(-50%); z-index: 60; display: flex; flex-direction: column; gap: 8px; pointer-events: none; }
.toast {
  pointer-events: auto; display: flex; gap: 10px; align-items: center;
  padding: 10px 14px; border-radius: var(--radius);
  background: #fff; color: #0a0a0b; font-size: 14px; font-weight: 500;
  box-shadow: var(--shadow);
  animation: toast-in 260ms var(--ease);
}
.toast.is-leaving { animation: toast-out 220ms var(--ease) forwards; }
@keyframes toast-in { from { opacity: 0; transform: translateY(10px); } }
@keyframes toast-out { to { opacity: 0; transform: translateY(8px); } }

/* ---------------------------------------------------------------- stats line */
.stats {
  display: flex; flex-wrap: wrap; gap: 6px 22px; align-items: baseline;
  padding: 0 0 16px; color: var(--text-2); font-size: 14px;
}
.stats b { color: var(--text); font-weight: 600; font-size: 18px; letter-spacing: -0.01em; }
.stats .stat-due b { color: var(--warning-text); }
.stats .stat-due.is-zero { display: none; }

/* ---------------------------------------------------------------- toolbar */
.toolbar { display: flex; gap: 8px; flex-wrap: wrap; align-items: center; margin-bottom: 12px; }
.toolbar .search { position: relative; flex: 1 1 220px; min-width: 200px; }
.toolbar .search .icon { position: absolute; left: 11px; top: 50%; transform: translateY(-50%); color: var(--text-3); pointer-events: none; }
.toolbar .search .input { padding-left: 36px; }
.toolbar .select { width: auto; min-width: 130px; }
.toolbar .date-range { display: flex; gap: 6px; align-items: center; }
.toolbar .date-range .input { width: 150px; }
.toolbar .spacer { flex: 1; }
@media (max-width: 719px) {
  .toolbar .date-range { display: none; }
  .toolbar .select { flex: 1; }
}
.filters-note { display: flex; gap: 10px; align-items: center; color: var(--text-2); font-size: 13px; margin: -4px 0 12px; }

/* ---------------------------------------------------------------- lead list */
.list { border: 1px solid var(--line); border-radius: var(--radius); background: var(--bg-raised); overflow: hidden; }
.list-head {
  display: grid; grid-template-columns: minmax(0, 2.2fr) minmax(0, 2fr) 150px 120px;
  gap: 14px; padding: 9px 16px;
  font-size: 12px; font-weight: 500; color: var(--text-3); letter-spacing: 0.01em;
  border-bottom: 1px solid var(--line);
}
.list-head.with-client { grid-template-columns: minmax(0, 2fr) minmax(0, 1.4fr) minmax(0, 1.6fr) 150px 120px; }
.list-head span:last-child { text-align: right; }
@media (max-width: 719px) { .list-head { display: none; } }

.lead {
  display: grid; grid-template-columns: minmax(0, 2.2fr) minmax(0, 2fr) 150px 120px;
  gap: 14px; align-items: center;
  padding: 12px 16px;
  border-bottom: 1px solid var(--line);
  cursor: pointer;
  transition: background var(--dur) var(--ease), opacity 260ms var(--ease);
  position: relative;
}
.lead.with-client { grid-template-columns: minmax(0, 2fr) minmax(0, 1.4fr) minmax(0, 1.6fr) 150px 120px; }
.lead:last-child { border-bottom: 0; }
.lead:hover { background: var(--bg-hover); }
.lead:focus-visible { outline: none; box-shadow: inset 0 0 0 2px var(--accent); }
.lead.is-active { background: var(--bg-hover); box-shadow: inset 3px 0 0 var(--accent); }
.lead.is-closed { opacity: 0.5; }
.lead.is-closed:hover, .lead.is-closed.is-active { opacity: 0.8; }
.lead.is-closed .pill { filter: saturate(0); }
.lead.is-fresh { animation: fresh 1600ms var(--ease); }
@keyframes fresh { 0% { background: var(--accent-soft); } 100% { background: transparent; } }
.lead .who { min-width: 0; display: flex; align-items: center; gap: 12px; }
.lead .who .avatar { width: 34px; height: 34px; font-size: 12px; }
.lead .who .name { font-weight: 600; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.lead .who .phone { color: var(--text-2); font-size: 13.5px; }
.lead .src { min-width: 0; color: var(--text-2); font-size: 13.5px; display: flex; align-items: center; gap: 8px; }
.lead .src .icon { color: var(--text-3); }
.lead .src span { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.lead .client-col { min-width: 0; color: var(--text-2); font-size: 13.5px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.lead .when { color: var(--text-2); font-size: 13.5px; white-space: nowrap; }
.lead .state { display: flex; justify-content: flex-end; align-items: center; gap: 8px; }
.lead .meta-tags { display: flex; gap: 6px; }
.tag { display: inline-flex; align-items: center; gap: 4px; font-size: 11.5px; font-weight: 500; color: var(--text-3); }
.tag .icon { width: 13px; height: 13px; }
.tag.due-today, .tag.overdue { color: var(--warning-text); }
.tag.overdue { color: var(--danger-text); }
@media (max-width: 719px) {
  .lead, .lead.with-client {
    grid-template-columns: 1fr auto; grid-template-areas: "who state" "src when";
    gap: 6px 12px; padding: 12px var(--gutter);
  }
  .lead .who { grid-area: who; }
  .lead .state { grid-area: state; }
  .lead .src { grid-area: src; padding-left: 46px; }
  .lead .client-col { display: none; }
  .lead .when { grid-area: when; justify-self: end; }
  .lead .meta-tags { display: none; }
}

.list-divider {
  display: flex; align-items: center; gap: 12px;
  padding: 8px 16px; font-size: 12px; font-weight: 500; color: var(--text-3);
  background: rgba(255, 255, 255, 0.02); border-bottom: 1px solid var(--line);
}
.list-divider::after { content: ""; flex: 1; height: 1px; background: var(--line); }
.list-divider.is-hidden { display: none; }
.list-foot { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 12px 16px; color: var(--text-2); font-size: 13px; }

.pill {
  display: inline-flex; align-items: center; gap: 6px;
  height: 26px; padding: 0 10px; border-radius: 999px;
  font-size: 12.5px; font-weight: 600; letter-spacing: 0.005em; white-space: nowrap;
  background: var(--neutral-soft); color: var(--text);
}
.pill[data-tone="accent"] { background: var(--accent-soft); color: var(--accent-text); }
.pill[data-tone="success"] { background: var(--success-soft); color: var(--success-text); }
.pill[data-tone="warning"] { background: var(--warning-soft); color: var(--warning-text); }
.pill[data-tone="danger"] { background: var(--danger-soft); color: var(--danger-text); }
.pill-sm { height: 22px; padding: 0 8px; font-size: 11.5px; }

.empty {
  padding: 56px 24px; text-align: center; color: var(--text-2);
}
.empty .icon { width: 28px; height: 28px; color: var(--text-3); margin-bottom: 12px; }
.empty h2 { color: var(--text); margin-bottom: 6px; }
.empty p { max-width: 42ch; margin: 0 auto; }
.empty .btn { margin-top: 16px; }

.skeleton .lead { pointer-events: none; }
.sk { display: block; height: 12px; border-radius: 6px; background: linear-gradient(90deg, var(--neutral-soft) 25%, rgba(255,255,255,0.12) 50%, var(--neutral-soft) 75%); background-size: 200% 100%; animation: shimmer 1.4s linear infinite; }
@keyframes shimmer { to { background-position: -200% 0; } }

/* ---------------------------------------------------------------- detail panel */
.panel-backdrop {
  position: fixed; inset: 0; z-index: 30;
  background: rgba(0, 0, 0, 0.55);
  opacity: 0; pointer-events: none; transition: opacity 220ms var(--ease);
}
.panel {
  position: fixed; z-index: 40;
  top: 0; right: 0; bottom: 0; width: min(var(--panel-w), 100vw);
  background: var(--bg-raised); border-left: 1px solid var(--line-strong);
  box-shadow: var(--shadow);
  transform: translateX(100%); transition: transform 260ms var(--ease);
  display: flex; flex-direction: column;
  overscroll-behavior: contain;
}
body.panel-open .panel-backdrop { opacity: 1; pointer-events: auto; }
body.panel-open .panel { transform: none; }
@media (max-width: 719px) {
  .panel {
    top: auto; left: 0; right: 0; width: auto; max-height: 92dvh;
    border-left: 0; border-top: 1px solid var(--line-strong); border-radius: 16px 16px 0 0;
    transform: translateY(100%);
  }
}
#panel-content { display: flex; flex-direction: column; flex: 1; min-height: 0; }
.panel-head { flex: none; display: flex; align-items: flex-start; gap: 12px; padding: 18px 20px 14px; border-bottom: 1px solid var(--line); }
.panel-head .avatar { width: 40px; height: 40px; font-size: 14px; }
.panel-head .titles { min-width: 0; flex: 1; }
.panel-head h2 { font-size: 18px; word-break: break-word; }
.panel-head .sub { color: var(--text-2); font-size: 13.5px; margin-top: 2px; }
.panel-body { overflow-y: auto; min-height: 0; padding: 18px 20px 28px; display: flex; flex-direction: column; gap: 22px; flex: 1; -webkit-overflow-scrolling: touch; }
.panel-section h3 { margin-bottom: 10px; }
.actions-row { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.actions-row .btn { height: 44px; font-size: 15px; }
.actions-row .btn.wa { color: #5fd3a5; }
.actions-row .btn.wa:hover { border-color: rgba(52, 211, 153, 0.4); background: var(--success-soft); }
.kv { display: grid; grid-template-columns: 120px 1fr; gap: 8px 14px; font-size: 14px; }
.kv dt { color: var(--text-3); margin: 0; }
.kv dd { margin: 0; color: var(--text); word-break: break-word; }
.kv dd.empty-v { color: var(--text-3); }
.answers { display: flex; flex-direction: column; gap: 12px; }
.answer .q { font-size: 12.5px; color: var(--text-3); margin-bottom: 2px; }
.answer .a { font-size: 15px; white-space: pre-wrap; word-break: break-word; }
.segmented { display: grid; grid-template-columns: repeat(2, 1fr); gap: 6px; }
.segmented .seg {
  height: 38px; border-radius: var(--radius); border: 1px solid var(--line-strong);
  background: var(--bg-input); color: var(--text-2); font: inherit; font-size: 13.5px; font-weight: 500;
  cursor: pointer; transition: all var(--dur) var(--ease);
}
.segmented .seg:hover { border-color: rgba(255, 255, 255, 0.28); color: var(--text); }
.segmented .seg[aria-pressed="true"] { background: #fff; color: #0a0a0b; border-color: #fff; }
.segmented .seg[aria-pressed="true"][data-tone="accent"] { background: var(--accent); border-color: var(--accent); color: #fff; }
.segmented .seg[aria-pressed="true"][data-tone="success"] { background: #2fbf88; border-color: #2fbf88; color: #06281a; }
.segmented .seg[aria-pressed="true"][data-tone="danger"] { background: #e5605a; border-color: #e5605a; color: #fff; }
.segmented .seg[aria-pressed="true"][data-tone="warning"] { background: #e9b640; border-color: #e9b640; color: #201800; }
.status-meta { margin-top: 8px; font-size: 12.5px; color: var(--text-3); }
.followup-row { display: flex; gap: 8px; align-items: center; }
.followup-row .input { flex: 1; }
.notes { display: flex; flex-direction: column; gap: 10px; }
.note { padding: 10px 12px; border: 1px solid var(--line); border-radius: var(--radius); background: var(--bg); }
.note .note-meta { font-size: 12px; color: var(--text-3); margin-bottom: 4px; }
.note .note-body { white-space: pre-wrap; word-break: break-word; font-size: 14px; }
.note-form { display: flex; flex-direction: column; gap: 8px; }
.note-form .textarea { min-height: 64px; }
.history { display: flex; flex-direction: column; gap: 6px; font-size: 13px; color: var(--text-2); }
.history .h-when { color: var(--text-3); }
.panel .close { margin-left: auto; }

/* ---------------------------------------------------------------- login */
.login-wrap { min-height: 100dvh; display: grid; place-items: center; padding: 24px var(--gutter); }
.login {
  width: 100%; max-width: 380px;
  display: flex; flex-direction: column; gap: 22px;
}
.login .brand { gap: 12px; }
.login .zmark { width: 40px; height: 40px; border-radius: 10px; font-size: 22px; }
.login h1 { font-size: 24px; letter-spacing: -0.02em; }
.login form { display: flex; flex-direction: column; gap: 14px; }
.login .btn { height: 44px; font-size: 15px; }
.login-foot { color: var(--text-3); font-size: 13px; }

/* ---------------------------------------------------------------- admin */
.cards { display: grid; gap: 12px; grid-template-columns: 1fr; }
@media (min-width: 720px) { .cards { grid-template-columns: repeat(2, 1fr); } }
@media (min-width: 1024px) { .cards.cols-3 { grid-template-columns: repeat(3, 1fr); } }
.card { border: 1px solid var(--line); border-radius: var(--radius); background: var(--bg-raised); padding: 16px 18px; display: flex; flex-direction: column; gap: 10px; min-width: 0; }
.card h2 { display: flex; align-items: center; gap: 10px; }
.card .card-actions { display: flex; gap: 8px; flex-wrap: wrap; margin-top: auto; padding-top: 6px; }
.section { margin-top: 30px; }
.section-head { display: flex; align-items: baseline; justify-content: space-between; gap: 12px; margin-bottom: 12px; flex-wrap: wrap; }
.section-head p { color: var(--text-2); font-size: 14px; }
.table-wrap { border: 1px solid var(--line); border-radius: var(--radius); background: var(--bg-raised); overflow-x: auto; }
table.table { width: 100%; border-collapse: collapse; font-size: 14px; }
.table th { text-align: left; font-weight: 500; font-size: 12px; color: var(--text-3); padding: 9px 14px; border-bottom: 1px solid var(--line); white-space: nowrap; }
.table td { padding: 11px 14px; border-bottom: 1px solid var(--line); vertical-align: middle; }
.table tr:last-child td { border-bottom: 0; }
.table td.actions { text-align: right; white-space: nowrap; }
.table td.actions form { display: inline-flex; gap: 6px; align-items: center; }
.row-muted td { color: var(--text-3); }
.dot { width: 8px; height: 8px; border-radius: 999px; display: inline-block; background: var(--text-3); }
.dot.ok { background: #34d399; }
.dot.err { background: #f87171; }
.dot.warn { background: #fbbf24; }
.health { display: flex; align-items: center; gap: 8px; }
pre.code {
  margin: 0; padding: 14px 16px; border-radius: var(--radius); background: var(--bg); border: 1px solid var(--line);
  font-size: 12.5px; line-height: 1.5; overflow-x: auto; max-height: 420px; color: var(--text-2); white-space: pre;
}
.copy-row { display: flex; gap: 8px; align-items: center; }
.copy-row .input { font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace; font-size: 13px; }
details.disclosure { border: 1px solid var(--line); border-radius: var(--radius); background: var(--bg-raised); }
details.disclosure summary { cursor: pointer; padding: 12px 16px; font-weight: 500; list-style: none; display: flex; align-items: center; gap: 8px; }
details.disclosure summary::-webkit-details-marker { display: none; }
details.disclosure summary .icon { transition: transform var(--dur) var(--ease); }
details.disclosure[open] summary .icon { transform: rotate(90deg); }
details.disclosure .disclosure-body { padding: 4px 16px 16px; display: flex; flex-direction: column; gap: 14px; }
.steps { margin: 0; padding-left: 20px; color: var(--text-2); font-size: 14px; display: flex; flex-direction: column; gap: 6px; }
.steps code { color: var(--text); }
.danger-zone { border-color: rgba(248, 113, 113, 0.25); }
.rows { display: flex; flex-direction: column; gap: 8px; }
.row-item { display: flex; flex-wrap: wrap; align-items: center; gap: 8px 12px; padding: 10px 12px; border: 1px solid var(--line); border-radius: var(--radius); background: var(--bg); }
.row-item.row-muted { color: var(--text-3); }
.row-item .row-main { flex: 1 1 200px; min-width: 0; }
.row-item .row-actions { display: flex; gap: 4px; align-items: center; }
.row-item .row-more { flex: 1 1 100%; }
.row-item .row-more summary { list-style: none; display: inline-flex; cursor: pointer; }
.row-item .row-more summary::-webkit-details-marker { display: none; }

.error-page { min-height: 70dvh; display: grid; place-items: center; text-align: center; }
.error-page h1 { font-size: 44px; letter-spacing: -0.03em; color: var(--text-3); }

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: 0.01ms !important; transition-duration: 0.01ms !important; }
}
