/* ============================================================
   ailean — design tokens + shadcn (New York) component styles
   Ported 1:1 from the real app's src/styles/globals.css
   ============================================================ */

:root {
  /* Markenschrift: Inter primaer (Roobert im Logotype/in der Signatur) */
  --app-font: "Inter", "Roobert", ui-sans-serif, system-ui, -apple-system, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
  --background: oklch(1 0 0);
  --foreground: oklch(0.145 0 0);
  --card: oklch(1 0 0);
  --card-foreground: oklch(0.145 0 0);
  --popover: oklch(1 0 0);
  --popover-foreground: oklch(0.145 0 0);
  --primary: oklch(0.205 0 0);
  --primary-foreground: oklch(0.985 0 0);
  --secondary: oklch(0.97 0 0);
  --secondary-foreground: oklch(0.205 0 0);
  --muted: oklch(0.97 0 0);
  --muted-foreground: oklch(0.556 0 0);
  --accent: oklch(0.97 0 0);
  --accent-foreground: oklch(0.205 0 0);
  --destructive: #DC2626;          /* funktionales Error — getrennt vom Marken-Rot #FF0000 */
  --destructive-foreground: #FFFFFF;
  --border: oklch(0.922 0 0);
  --input: oklch(0.922 0 0);
  --ring: var(--brand-red);          /* Fokus-Ring = Marken-Rot (Akzent) */
  --radius: 0.625rem;
  --sidebar: oklch(0.985 0 0);
  --sidebar-foreground: oklch(0.145 0 0);
  --sidebar-primary: oklch(0.205 0 0);
  --sidebar-primary-foreground: oklch(0.985 0 0);
  --sidebar-accent: oklch(0.97 0 0);
  --sidebar-accent-foreground: oklch(0.205 0 0);
  --sidebar-border: oklch(0.922 0 0);
  --sidebar-ring: oklch(0.58 0.17 254);

  /* status hues (kept consistent light/dark via opacity tints) */
  /* status hues — aligned to brand functional colours (success/warning/info) */
  --emerald: #15803D;   /* --success */
  --orange: #F59E0B;    /* --warning */
  --yellow: oklch(0.795 0.16 86);
  --violet: oklch(0.606 0.25 292);
  --sky: oklch(0.685 0.16 237);
  --blue: #0277BD;      /* --info */
  --whatsapp: oklch(0.62 0.16 150);

  /* spacing scale — use these instead of ad-hoc px/rem gaps & padding */
  --sp-1: 0.25rem;
  --sp-2: 0.5rem;
  --sp-3: 0.75rem;
  --sp-4: 1rem;
  --sp-5: 1.25rem;
  --sp-6: 1.5rem;
  --sp-8: 2rem;
  --sp-10: 2.5rem;

  /* typography scale */
  --fs-xs: 0.72rem;
  --fs-sm: 0.82rem;
  --fs-md: 0.875rem;
  --fs-base: 0.95rem;
  --fs-lg: 1.1rem;
  --fs-xl: 1.35rem;
  --fs-2xl: 1.75rem;
  --fw-regular: 400;
  --fw-medium: 500;
  --fw-semibold: 600;
  --fw-bold: 700;
  --lh-tight: 1.2;
  --lh-snug: 1.4;
  --lh-normal: 1.55;

  /* elevation */
  --shadow-sm: 0 1px 2px rgba(0,0,0,0.05);
  --shadow-md: 0 4px 14px rgba(0,0,0,0.08);
  --shadow-lg: 0 18px 50px rgba(0,0,0,0.18);

  /* ============================================================
     ailean — Markenwerte (verbindlich)
     1. Marken-Rot #FF0000 = NUR Akzent / CTA / Hervorhebung
     2. Fehler-/Destructive-Zustaende = funktionales Error #DC2626
        (bewusst dunkler als Marken-Rot, damit Marke != Fehler)
     Additiv eingefuehrt — die bestehende oklch-Neutralskala bleibt.
     ============================================================ */
  /* Neutral-Skala — Referenz-Hex */
  --white:#FFFFFF;  --grey-50:#F5F5F5;  --grey-100:#EBEBEB; --grey-200:#D6D6D6;
  --grey-300:#B8B8B8; --grey-400:#999999; --grey-500:#757575; --grey-600:#595959;
  --grey-700:#404040; --grey-800:#262626; --grey-900:#121212; --almost-black:#040404;

  /* Schweizer Rot — Leitakzent (NUR Akzent/CTA, nie Fehler, nie Logo) */
  --brand-red:#FF0000;
  --red-50:#FFE5E5;  --red-100:#FFB3B3; --red-200:#FF8080; --red-300:#FF4D4D;
  --red-400:#FF1A1A; --red-500:#FF0000; --red-600:#D90000; --red-700:#B30000;
  --red-800:#800000; --red-900:#4D0000;

  /* Funktionale UI-Farben — nur Zustaende */
  --success:#15803D; --success-bg:#E7F4EC; --success-fg:#0F5C2E;
  --warning:#F59E0B; --warning-bg:#FEF3E2; --warning-fg:#92560A;
  --error:#DC2626;   --error-bg:#FCEBEB;   --error-fg:#991B1B;
  --info:#0277BD;    --info-bg:#E6F1FB;    --info-fg:#024E7A;
}

.dark {
  --background: oklch(0.145 0 0);
  --foreground: oklch(0.985 0 0);
  --card: oklch(0.205 0 0);
  --card-foreground: oklch(0.985 0 0);
  --popover: oklch(0.205 0 0);
  --popover-foreground: oklch(0.985 0 0);
  --primary: oklch(0.985 0 0);
  --primary-foreground: oklch(0.205 0 0);
  --secondary: oklch(0.269 0 0);
  --secondary-foreground: oklch(0.985 0 0);
  --muted: oklch(0.269 0 0);
  --muted-foreground: oklch(0.708 0 0);
  --accent: oklch(0.269 0 0);
  --accent-foreground: oklch(0.985 0 0);
  --destructive: #F87171;          /* hellere Fehlerfarbe auf dunklen Flaechen */
  --destructive-foreground: #1A0606;
  --border: oklch(1 0 0 / 10%);
  --input: oklch(1 0 0 / 15%);
  --ring: var(--brand-red);          /* Fokus-Ring = Marken-Rot (Akzent) */
  /* hellere Varianten der Brand-Statusfarben fuer Kontrast auf dunklen Flaechen */
  --emerald: #22C55E;
  --orange: #FBBF24;
  --blue: #38BDF8;
  --sidebar: oklch(0.205 0 0);
  --sidebar-foreground: oklch(0.985 0 0);
  --sidebar-primary: oklch(0.985 0 0);
  --sidebar-primary-foreground: oklch(0.205 0 0);
  --sidebar-accent: oklch(0.269 0 0);
  --sidebar-accent-foreground: oklch(0.985 0 0);
  --sidebar-border: oklch(1 0 0 / 10%);
  --sidebar-ring: oklch(0.439 0 0);
}

/* ── Marken-Rot gezielt einsetzen (Akzent-Utilities) ───────── */
::selection { background: var(--brand-red); color: #fff; }
.accent-red { color: var(--brand-red); }
.bg-accent-red { background: var(--brand-red); color: #fff; }
.border-accent-red { border-color: var(--brand-red); }

* { box-sizing: border-box; border-color: var(--border); }
html, body { margin: 0; height: 100%; }
body {
  background: var(--background);
  color: var(--foreground);
  font-family: var(--app-font, ui-sans-serif, system-ui, -apple-system, "Segoe UI", Roboto, Helvetica, Arial, sans-serif);
  font-size: 14px;
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}
#root { height: 100%; }
button { font-family: inherit; }
a { color: inherit; }
::selection { background: color-mix(in oklch, var(--primary) 22%, transparent); }

.muted { color: var(--muted-foreground); }
.mono { font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, monospace; }

/* ── Radius helpers ─────────────────────────────── */
.rounded-sm { border-radius: calc(var(--radius) - 4px); }
.rounded-md { border-radius: calc(var(--radius) - 2px); }
.rounded-lg { border-radius: var(--radius); }
.rounded-xl { border-radius: calc(var(--radius) + 4px); }

/* ── App layout ─────────────────────────────────── */
.app { display: flex; flex-direction: column; height: 100vh; width: 100%; overflow: hidden; background: var(--background); position: relative; }
.app-body { flex: 1; display: flex; min-height: 0; position: relative; overflow: hidden; }
.main-wrap { flex: 1; min-width: 0; display: flex; flex-direction: column; overflow: hidden; }
.page-scroll { flex: 1; overflow-y: auto; min-height: 0; }
.page { padding: 1.5rem 2rem 4rem; max-width: 1400px; margin: 0 auto; width: 100%; }
.page-wide { max-width: 1600px; }

.page-head { display: flex; align-items: flex-start; justify-content: space-between; gap: 1rem; flex-wrap: wrap; margin-bottom: 1.5rem; }
.page-head-lead { display: flex; align-items: flex-start; justify-content: space-between; gap: 1rem; flex: 1 1 auto; min-width: 0; }
.page-head-status { flex-shrink: 0; padding-top: 4px; }
.page-title { font-size: 1.6rem; font-weight: 700; letter-spacing: -0.02em; margin: 0; }
.page-sub { color: var(--muted-foreground); font-size: 0.875rem; margin: 0.35rem 0 0; max-width: 60ch; }
.head-actions { display: flex; align-items: center; gap: 0.5rem; flex-wrap: wrap; }

/* ── Topbar ─────────────────────────────────────── */
.topbar {
  height: 56px; flex-shrink: 0; display: flex; align-items: center; gap: 0.75rem;
  padding: 0 1.25rem; border-bottom: 1px solid var(--border); background: var(--background);
}
.topbar-sep { width: 1px; height: 22px; background: var(--border); }
.topbar-ai { display: inline-flex; align-items: center; gap: 7px; height: 2.1rem; padding: 0 0.85rem 0 0.45rem; border: none; border-radius: 999px; background: var(--primary); color: var(--primary-foreground); font: inherit; font-size: 0.82rem; font-weight: 600; cursor: pointer; box-shadow: 0 1px 2px rgba(0,0,0,0.08); transition: filter 0.15s, transform 0.15s, box-shadow 0.15s; flex-shrink: 0; }
.topbar-ai:hover { filter: brightness(1.07); box-shadow: 0 4px 12px color-mix(in oklch, var(--primary) 40%, transparent); }
.topbar-ai:active { transform: translateY(1px); }
.topbar-ai-spark { width: 23px; height: 23px; border-radius: 999px; background: var(--primary-foreground); color: var(--primary); display: grid; place-items: center; flex-shrink: 0; }
.topbar-guide { display: inline-flex; align-items: center; gap: 7px; font-size: 0.8rem; font-weight: 600; color: var(--muted-foreground); cursor: pointer; flex-shrink: 0; }
.tb-lang { display: inline-flex; align-items: center; gap: 2px; padding: 2px; border: 1px solid var(--border); border-radius: 9px; background: var(--card); flex-shrink: 0; }
.tb-lang-btn { border: none; background: none; font: inherit; font-size: 0.72rem; font-weight: 600; color: var(--muted-foreground); padding: 4px 9px; border-radius: 7px; cursor: pointer; display: inline-flex; align-items: center; gap: 4px; }
.tb-lang-btn.on { background: var(--primary); color: var(--primary-foreground); }
.tb-lang-ai { color: var(--blue); }
.tb-lang-ai svg { width: 13px; height: 13px; }
.guide-hint { font-size: 0.72rem; line-height: 1.4; color: color-mix(in srgb, #FF0000 75%, transparent); font-weight: 400; margin: 3px 0 7px; max-width: 60ch; }
.guide-only { display: none; }
body.guide-on .guide-only { display: block; }
.guide-tip { position: fixed; z-index: 9999; max-width: 16rem; padding: 8px 11px; border-radius: 8px; background: var(--foreground); color: var(--background); font-size: 0.74rem; line-height: 1.45; font-weight: 400; box-shadow: 0 6px 22px rgba(0,0,0,0.22); pointer-events: none; opacity: 0; transition: opacity 0.12s ease; }
.guide-tip.show { opacity: 1; }
.guide-tip::after { content: ""; position: absolute; left: var(--gt-arrow, 50%); bottom: -5px; transform: translateX(-50%) rotate(45deg); width: 9px; height: 9px; background: var(--foreground); }
.guide-tip.below::after { bottom: auto; top: -5px; }
body.guide-on input, body.guide-on select, body.guide-on textarea, body.guide-on .user-select, body.guide-on .status-switch { cursor: help; }

/* ── Tenant Audit ─────────────────────────────────── */
.ta-card { position: relative; padding: 22px; }
.ta-archive { position: absolute; top: 14px; right: 14px; width: 32px; height: 32px; border-radius: 8px; border: 1px solid var(--border); background: var(--card); display: grid; place-items: center; cursor: pointer; color: var(--muted-foreground); }
.ta-archive:hover { background: var(--muted); color: var(--foreground); }
.ta-top { display: flex; justify-content: space-between; align-items: center; gap: 24px; padding-top: 4px; }
.ta-id { display: flex; gap: 15px; align-items: flex-start; min-width: 0; }
.ta-score { display: flex; flex-direction: column; align-items: center; gap: 9px; flex-shrink: 0; }
.ta-kpis { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 12px; margin-top: 20px; }
.ta-kpi { padding: 13px 14px; border: 1px solid var(--border); border-radius: 11px; background: var(--card); }
.ta-kpi-k { display: flex; align-items: center; gap: 6px; font-size: 11px; text-transform: uppercase; letter-spacing: .03em; color: var(--muted-foreground); font-weight: 600; }
.ta-kpi-v { font-size: 21px; font-weight: 700; margin-top: 7px; line-height: 1.1; }
.ta-kpi-s { font-size: 11.5px; color: var(--muted-foreground); margin-top: 4px; }
.ta-avatar { width: 52px; height: 52px; border-radius: 999px; background: var(--muted); display: grid; place-items: center; font-weight: 700; font-size: 17px; flex-shrink: 0; }
.ta-kyc { display: inline-flex; align-items: center; gap: 4px; }
.ta-fact-k { font-size: 11px; text-transform: uppercase; letter-spacing: .04em; color: var(--muted-foreground); font-weight: 600; }
.ta-fact-v { font-size: 13.5px; margin-top: 3px; }
.ta-sources { font-size: 11.5px; color: var(--muted-foreground); margin-top: 18px; padding-top: 14px; border-top: 1px solid var(--border); }
.ta-decision { display: flex; align-items: center; justify-content: space-between; gap: 16px; flex-wrap: wrap; margin-top: 14px; padding: 14px 16px; border: 1px solid var(--border); border-radius: 12px; background: var(--muted); }
.ta-decision-seg { display: inline-flex; gap: 6px; background: var(--card); border: 1px solid var(--border); border-radius: 10px; padding: 4px; }
.ta-dec-btn { display: inline-flex; align-items: center; gap: 6px; padding: 7px 13px; border: none; background: none; border-radius: 7px; cursor: pointer; font-size: 13px; font-weight: 500; color: var(--muted-foreground); }
.ta-dec-btn:hover { background: var(--muted); }
.ta-dec-btn.on { color: #fff; }
.ta-dec-btn.on.tone-emerald { background: var(--emerald); }
.ta-dec-btn.on.tone-destructive { background: var(--destructive); }
.ta-dec-btn.on.tone-secondary { background: var(--foreground); }
.ta-applied { display: inline-flex; align-items: center; gap: 9px; margin-top: 11px; padding: 8px 12px; border: 1px solid var(--border); border-radius: 10px; background: var(--muted); flex-wrap: wrap; }
.ta-applied-txt { font-size: 13px; }
.ta-combinebar { display: flex; align-items: center; justify-content: space-between; gap: 14px; flex-wrap: wrap; padding: 12px 16px; border: 1px solid var(--primary); border-radius: 11px; background: color-mix(in oklch, var(--primary) 6%, transparent); margin-bottom: 16px; }
.ta-search { display: flex; align-items: center; gap: 7px; padding: 0 10px; height: 32px; border: 1px solid var(--border); border-radius: 8px; background: var(--card); color: var(--muted-foreground); }
.ta-upload { display: flex; align-items: center; gap: 12px; padding: 14px 16px; border: 1.5px dashed var(--border); border-radius: 11px; background: var(--muted); cursor: pointer; margin-bottom: 16px; }
.ta-upload:hover { border-color: var(--primary); }
.ta-upload.done { border-style: solid; border-color: var(--emerald); background: color-mix(in oklch, var(--emerald) 6%, transparent); cursor: default; }
.ta-up-ic { width: 36px; height: 36px; border-radius: 9px; background: var(--card); border: 1px solid var(--border); display: grid; place-items: center; flex-shrink: 0; color: var(--muted-foreground); }
.ta-up-ic.done { color: var(--emerald); border-color: var(--emerald); }
.ta-spin { animation: ta-spin 0.9s linear infinite; }
@keyframes ta-spin { to { transform: rotate(360deg); } }
.ta-applicant { border: 1px solid var(--border); border-radius: 10px; padding: 10px; background: var(--card); }
.ta-intake { display: flex; gap: 12px; align-items: flex-start; padding: 13px 14px; border: 1px solid var(--border); border-radius: 11px; margin-bottom: 10px; background: var(--card); }
.ta-intake-ic { width: 36px; height: 36px; border-radius: 9px; background: var(--muted); display: grid; place-items: center; flex-shrink: 0; color: var(--foreground); }
.ta-vt { display: inline-flex; border: 1px solid var(--border); border-radius: 8px; overflow: hidden; }
.ta-vt button { border: none; background: var(--card); font: inherit; font-size: 0.75rem; font-weight: 600; color: var(--muted-foreground); padding: 6px 12px; cursor: pointer; }
.ta-vt button + button { border-left: 1px solid var(--border); }
.ta-vt button.on { background: var(--primary); color: var(--primary-foreground); }
.ta-list > button { width: 100%; }
.ta-pager { display: flex; align-items: center; justify-content: space-between; gap: 12px; flex-wrap: wrap; margin: 4px 0 18px; padding-top: 12px; border-top: 1px solid var(--border); }
.ta-split-on { display: grid; grid-template-columns: 340px minmax(0, 1fr); gap: 20px; align-items: start; }
.ta-split-on .ta-split-list { position: sticky; top: 12px; max-height: calc(100vh - 96px); overflow-y: auto; padding-right: 2px; }
@media (max-width: 980px) { .ta-split-on { grid-template-columns: 1fr; } .ta-split-on .ta-split-list { position: static; max-height: none; } }
.ta-pickhead { align-items: center; }
.ta-split-on .ta-pickhead { flex-direction: column; align-items: flex-start; gap: 8px; }
.ta-split-on .ta-pickhead > .row { flex-wrap: wrap; justify-content: flex-start; }
.ta-list > button.ta-row { display: flex; align-items: center; gap: 10px; padding: 8px 12px; border-radius: 10px; background: var(--card); border: 1px solid var(--border); cursor: pointer; text-align: left; min-width: 0; }
.ta-row.on { border-color: var(--primary); box-shadow: inset 0 0 0 1px var(--primary); }
.ta-row-av { width: 26px; height: 26px; border-radius: 999px; background: var(--muted); display: grid; place-items: center; font-size: 10.5px; font-weight: 600; flex-shrink: 0; }
.ta-row-name { font-weight: 600; font-size: 0.82rem; flex-shrink: 0; white-space: nowrap; max-width: 32ch; overflow: hidden; text-overflow: ellipsis; }
.ta-row-score { font-weight: 700; font-size: 0.82rem; flex-shrink: 0; }
.ta-row-meta { color: var(--muted-foreground); font-size: 0.78rem; flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.ta-row-date { color: var(--muted-foreground); font-size: 0.75rem; flex-shrink: 0; white-space: nowrap; }
@media (max-width: 640px) { .ta-list > button.ta-row { flex-wrap: wrap; } .ta-row-meta { flex-basis: 100%; order: 5; } .ta-row-date { order: 6; } }
.ta-moredetails { display: inline-flex; align-items: center; gap: 6px; margin-top: 8px; padding: 2px 4px; border: none; background: none; cursor: pointer; font-size: 12px; font-weight: 500; color: var(--muted-foreground); }
.ta-moredetails:hover { color: var(--foreground); }
.ta-applicant-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; margin-top: 10px; padding-top: 10px; border-top: 1px solid var(--border); }
.ta-applicant-grid .ta-grp { grid-column: 1 / -1; margin-top: 4px; }
.ta-applicant-grid .ta-grp:first-child { margin-top: 0; }
.ta-search input { border: none; background: none; outline: none; font-size: 13px; width: 150px; color: var(--foreground); }
.ta-filter { padding: 16px; border: 1px solid var(--border); border-radius: 12px; background: var(--card); margin-bottom: 16px; }
.ta-filter-grid { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 14px; }
.ta-filter-grid label { display: flex; flex-direction: column; gap: 6px; }
@media (max-width: 900px) { .ta-filter-grid { grid-template-columns: 1fr 1fr; } }
@media (max-width: 560px) { .ta-filter-grid { grid-template-columns: 1fr; } .ta-search input { width: 110px; } }
.ta-check { width: 18px; height: 18px; border-radius: 5px; border: 1.5px solid var(--border); display: grid; place-items: center; flex-shrink: 0; }
.ta-check.on { background: var(--primary); border-color: var(--primary); color: var(--primary-foreground); }
.ta-member { display: inline-flex; align-items: center; gap: 7px; padding: 5px 11px 5px 5px; border-radius: 999px; border: 1.5px solid var(--border); background: var(--card); cursor: pointer; font-size: 12.5px; }
.ta-member.on { border-color: var(--primary); }
.ta-src-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; margin-top: 6px; }
.ta-src { display: flex; align-items: center; gap: 9px; padding: 9px 11px; border: 1.5px solid var(--border); border-radius: 9px; cursor: pointer; font-size: 12.5px; }
.ta-src.on { border-color: var(--primary); background: color-mix(in oklch, var(--primary) 5%, transparent); }
.ta-costnote { display: flex; align-items: flex-start; gap: 8px; margin-top: 14px; padding: 10px 12px; border-radius: 9px; background: var(--muted); font-size: 12.5px; color: var(--muted-foreground); }
.ta-acc { border-top: 1px solid var(--border); }
.ta-acc { border-top: 1px solid var(--border); margin: 6px -22px 0; }
.ta-acc-head { width: 100%; display: flex; align-items: center; justify-content: space-between; padding: 13px 22px; background: none; border: none; cursor: pointer; font-size: 13.5px; font-weight: 600; color: var(--foreground); }
.ta-acc-head:hover { background: var(--muted); }
.ta-acc-body { padding: 6px 22px; display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 18px 28px; }
.ta-acc-wrap { padding-bottom: 14px; }
.ta-acc-wrap > .ta-det-group { padding: 12px 22px 6px; }
.ta-acc-body .ta-det-group { padding: 0; }
.ta-flag { display: inline-block; margin-left: 6px; font-size: 10.5px; font-weight: 600; color: var(--orange); background: color-mix(in oklch, var(--orange) 14%, transparent); border-radius: 999px; padding: 1px 7px; }
.ta-xcheck { display: flex; flex-direction: column; gap: 6px; }
.ta-xrow { display: grid; grid-template-columns: 1.4fr 1fr 1.4fr auto; gap: 12px; align-items: center; font-size: 13px; padding: 9px 12px; background: var(--muted); border-radius: 9px; }
.ta-doc-row { display: flex; gap: 9px; align-items: flex-start; }
.ta-legal { margin: 10px 22px 4px; padding: 14px 16px; border: 1px solid var(--border); border-radius: 11px; background: color-mix(in oklch, var(--emerald) 5%, transparent); }
.ta-redline { display: flex; gap: 8px; align-items: flex-start; font-size: 12px; color: var(--muted-foreground); padding-top: 10px; border-top: 1px dashed var(--border); }
.ta-jointcta { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; margin: 0 22px 4px; padding: 11px 14px; border: 1px solid var(--primary); border-radius: 10px; background: color-mix(in oklch, var(--primary) 6%, transparent); font-size: 12.5px; }
.ta-jointcta > span { flex: 1; min-width: 180px; }
.ta-det-row span:last-child { white-space: normal; }
@media (max-width: 700px) { .ta-acc-body { grid-template-columns: 1fr; } .ta-xrow { grid-template-columns: 1fr; gap: 4px; } }
.ta-det-list { display: flex; flex-direction: column; gap: 7px; }
.ta-det-row { display: flex; justify-content: space-between; gap: 16px; font-size: 13px; border-bottom: 1px dotted var(--border); padding-bottom: 5px; }
@media (max-width: 700px) { .ta-acc-body { grid-template-columns: 1fr; } }
@media (max-width: 560px) { .ta-src-grid { grid-template-columns: 1fr; } }
.ta-score-label { font-size: 11px; text-transform: uppercase; letter-spacing: .04em; color: var(--muted-foreground); font-weight: 600; }
.ta-grid3 { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 16px; }
.ta-grid2 { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 16px; }
.ta-theme { display: flex; flex-direction: column; align-items: center; text-align: center; gap: 8px; padding: 18px; }
.ta-theme .ta-sec-ic { margin: 0; }
.ta-sec-ic { width: 30px; height: 30px; border-radius: 8px; background: var(--muted); display: grid; place-items: center; color: var(--foreground); flex-shrink: 0; }
.ta-progress { height: 6px; border-radius: 999px; background: var(--muted); overflow: hidden; }
.ta-progress > span { display: block; height: 100%; width: 45%; border-radius: 999px; background: var(--primary); animation: ta-prog 1.6s ease-in-out infinite; }
@keyframes ta-prog { 0% { margin-left: -45%; } 100% { margin-left: 100%; } }
.ta-rating-row { display: flex; gap: 12px; align-items: flex-start; }
.ta-rating-ic { width: 34px; height: 34px; border-radius: 9px; display: grid; place-items: center; flex-shrink: 0; }
.ta-tone-emerald { background: color-mix(in oklch, var(--emerald) 16%, transparent); color: var(--emerald); }
.ta-tone-yellow { background: color-mix(in oklch, var(--yellow) 18%, transparent); color: var(--yellow); }
.ta-tone-destructive { background: color-mix(in srgb, var(--destructive) 14%, transparent); color: var(--destructive); }
.ta-log { margin-top: 12px; padding: 10px 12px; background: var(--muted); border-radius: 9px; display: flex; flex-direction: column; gap: 6px; }
.ta-bank-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 18px; }
.ta-bar { position: relative; height: 8px; border-radius: 999px; background: var(--muted); overflow: visible; }
.ta-bar > span { display: block; height: 100%; border-radius: 999px; transition: width .5s ease; }
.ta-bar > i { position: absolute; top: -3px; width: 2px; height: 14px; background: var(--foreground); opacity: .45; }
.ta-biz-grid { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 16px; }
@media (max-width: 900px) {
  .ta-top { flex-direction: column-reverse; align-items: stretch; }
  .ta-score { align-self: center; }
  .ta-kpis { grid-template-columns: 1fr 1fr; }
  .ta-grid3, .ta-grid2, .ta-biz-grid, .ta-bank-grid { grid-template-columns: 1fr 1fr; }
}
@media (max-width: 560px) { .ta-kpis, .ta-grid3, .ta-grid2, .ta-biz-grid, .ta-bank-grid { grid-template-columns: 1fr; } }
.form-grid-2 .guide-hint, .form-grid-3 .guide-hint, .grid2 .guide-hint { margin-bottom: 0; }
@media (max-width: 680px) { .topbar-ai { padding: 0; width: 2.1rem; justify-content: center; } .topbar-ai-label { display: none; } }
.topbar-title { font-weight: 600; font-size: 0.95rem; }
.topbar-spacer { flex: 1; }
.topbar-brand { display: flex; align-items: center; gap: 0.5rem; height: 100%; padding: 0 0.9rem 0 0.1rem; margin-right: 0.15rem; border: none; background: transparent; cursor: pointer; border-radius: var(--radius); color: var(--foreground); }
.topbar-brand:hover { background: var(--accent); }
.topbar-brand .brand-text { display: grid; line-height: 1.15; overflow: hidden; text-align: left; }
.topbar-brand .brand-name { font-weight: 600; font-size: 0.875rem; white-space: nowrap; }
.topbar-brand .brand-greet { font-size: 0.7rem; color: var(--muted-foreground); white-space: nowrap; }
.sidebar.sidebar-overlay { position: absolute; top: 0; left: 0; bottom: 0; width: 16rem; z-index: 80; box-shadow: 6px 0 30px rgba(0,0,0,0.18); transition: none; transform: none; }
.sidebar-scrim { position: absolute; inset: 0; background: rgba(0,0,0,0.42); z-index: 70; animation: scrim-in 0.16s ease; }
@keyframes scrim-in { from { opacity: 0; } to { opacity: 1; } }

/* ── Sidebar ────────────────────────────────────── */
.sidebar {
  width: 16rem; flex-shrink: 0; background: var(--sidebar); color: var(--sidebar-foreground);
  border-right: 1px solid var(--sidebar-border); display: flex; flex-direction: column;
  transition: width 0.22s cubic-bezier(0.4,0,0.2,1);
}
.sidebar.collapsed { width: 3.5rem; }
.sidebar-header { padding: 0.5rem; }
.sidebar-content { flex: 1; overflow-y: auto; padding: 0.25rem 0.5rem; min-height: 0; }
.sidebar-footer { padding: 0.5rem; margin-top: auto; }
.sidebar-group { padding: 0.25rem 0 0.5rem; }
.sidebar-group-head { display: flex; align-items: center; justify-content: space-between; gap: 0.25rem; }
.sidebar-fold { display: grid; place-items: center; width: 1.9rem; height: 1.9rem; flex-shrink: 0; border: none; background: transparent; color: color-mix(in oklch, var(--sidebar-foreground) 55%, transparent); border-radius: calc(var(--radius) - 2px); cursor: pointer; transition: background 0.12s, color 0.12s; }
.sidebar-fold:hover { background: var(--sidebar-accent); color: var(--sidebar-foreground); }
.sidebar-fold svg { width: 16px; height: 16px; }
.collapsed .sidebar-group-head { justify-content: center; }
.sidebar-group-label {
  font-size: 0.72rem; font-weight: 500; color: color-mix(in oklch, var(--sidebar-foreground) 55%, transparent);
  padding: 0.4rem 0.5rem; height: 2rem; display: flex; align-items: center; white-space: nowrap; overflow: hidden;
}
.collapsed .sidebar-group-label, .collapsed .menu-btn-text, .collapsed .brand-text, .collapsed .user-text, .collapsed .menu-badge { display: none; }
.collapsed .sidebar-content { overflow: visible; }

.menu-btn {
  display: flex; align-items: center; gap: 0.5rem; width: 100%; height: 2rem;
  padding: 0 0.5rem; border-radius: calc(var(--radius) - 2px); border: none; background: transparent;
  color: var(--sidebar-foreground); font-size: 0.875rem; cursor: pointer; text-align: left;
  white-space: nowrap; transition: background 0.12s, color 0.12s; position: relative;
}
.menu-btn:hover { background: var(--sidebar-accent); color: var(--sidebar-accent-foreground); }
.menu-btn.active { background: var(--sidebar-primary); color: var(--sidebar-primary-foreground); font-weight: 600; }
.menu-btn.active::before { content: ""; position: absolute; left: -0.5rem; top: 50%; transform: translateY(-50%); width: 3px; height: 1.1rem; border-radius: 999px; background: var(--sidebar-primary); }
.menu-btn.active:hover { background: var(--sidebar-primary); color: var(--sidebar-primary-foreground); }
.menu-btn svg { width: 16px; height: 16px; flex-shrink: 0; }
.menu-btn[draggable="true"] { cursor: grab; }
.nav-reorder-hint { margin-left: 6px; font-size: 0.95em; line-height: 1; color: var(--muted-foreground); cursor: help; vertical-align: middle; }
.sidebar-guide-hint { display: none; }
body.guide-on .sidebar-guide-hint { display: flex; align-items: center; gap: 6px; font-size: 0.7rem; line-height: 1.35; color: color-mix(in srgb, #FF0000 75%, transparent); padding: 2px 0.5rem 8px; }
.sidebar-guide-ico { flex-shrink: 0; line-height: 1.35; }
.menu-btn[draggable="true"]:active { cursor: grabbing; }
.menu-btn.menu-btn-dragging { opacity: 0.45; }
.menu-btn.menu-btn-over { box-shadow: inset 0 2px 0 var(--sidebar-primary); }
.menu-btn-text { flex: 1; overflow: hidden; text-overflow: ellipsis; }
.menu-progress { flex-shrink: 0; font-size: 0.64rem; font-weight: 700; color: var(--muted-foreground); background: var(--card); border: 1px solid var(--border); border-radius: 999px; padding: 1px 6px; font-variant-numeric: tabular-nums; }
.menu-btn.active .menu-progress { color: var(--sidebar-primary-foreground); background: color-mix(in oklch, var(--sidebar-primary-foreground) 22%, transparent); border-color: transparent; }
.menu-progress.done { color: #fff; background: var(--emerald); border-color: transparent; }
.menu-badge {
  font-size: 0.62rem; font-weight: 600; padding: 0.05rem 0.35rem; border-radius: 999px;
  background: var(--sidebar-accent); color: var(--muted-foreground); border: 1px solid var(--sidebar-border);
}
.menu-btn-lg { height: 3rem; }
.brand-btn { display: flex; align-items: center; gap: 0.5rem; width: 100%; height: 3rem; padding: 0 0.4rem; border-radius: calc(var(--radius) - 2px); border: none; background: transparent; cursor: pointer; color: inherit; text-align: left; }
.brand-btn:hover { background: var(--sidebar-accent); }
.brand-emblem { width: 2rem; height: 2rem; flex-shrink: 0; border-radius: 8px; display: grid; place-items: center; }
.brand-emblem svg { width: 100%; height: 100%; }
.brand-text { display: grid; line-height: 1.2; overflow: hidden; }
.brand-name { font-weight: 600; font-size: 0.875rem; white-space: nowrap; }
.brand-greet { font-size: 0.72rem; color: var(--muted-foreground); white-space: nowrap; }

.user-btn { display: flex; align-items: center; gap: 0.5rem; width: 100%; height: 3rem; padding: 0 0.4rem; border-radius: calc(var(--radius) - 2px); border: none; background: transparent; cursor: pointer; color: inherit; text-align: left; }
.user-btn:hover, .user-btn.open { background: var(--sidebar-accent); }
.user-text { display: grid; line-height: 1.25; overflow: hidden; flex: 1; }
.user-role { font-size: 0.74rem; font-weight: 600; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.user-mail { font-size: 0.72rem; color: var(--muted-foreground); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }

/* ── Avatar ─────────────────────────────────────── */
.avatar { width: 2rem; height: 2rem; border-radius: var(--radius); background: var(--muted); color: var(--muted-foreground); display: grid; place-items: center; flex-shrink: 0; font-size: 0.75rem; font-weight: 600; overflow: hidden; }
.avatar svg { width: 16px; height: 16px; }

/* ── Buttons ────────────────────────────────────── */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 0.45rem;
  height: 2.25rem; padding: 0 1rem; border-radius: calc(var(--radius) - 2px);
  font-size: 0.875rem; font-weight: 500; cursor: pointer; white-space: nowrap;
  border: 1px solid transparent; background: var(--primary); color: var(--primary-foreground);
  transition: background 0.12s, opacity 0.12s, border-color 0.12s; user-select: none;
}
.btn svg { width: 16px; height: 16px; }
.btn:hover { opacity: 0.9; }
.btn:disabled { opacity: 0.5; cursor: not-allowed; }
.btn-outline { background: var(--background); color: var(--foreground); border-color: var(--border); }
.btn-outline:hover { background: var(--accent); color: var(--accent-foreground); opacity: 1; }
.btn-ghost { background: transparent; color: var(--foreground); }
.btn-ghost:hover { background: var(--accent); color: var(--accent-foreground); opacity: 1; }
.btn-secondary { background: var(--secondary); color: var(--secondary-foreground); }
.btn-secondary:hover { opacity: 1; background: color-mix(in oklch, var(--secondary) 80%, var(--foreground) 6%); }
.btn-destructive { background: var(--destructive); color: var(--destructive-foreground); }
.btn-sm { height: 2rem; padding: 0 0.75rem; font-size: 0.82rem; }
.btn-xs { height: 1.75rem; padding: 0 0.6rem; font-size: 0.78rem; gap: 0.3rem; }
.btn-icon { width: 2.25rem; padding: 0; }
.btn-icon.btn-sm { width: 2rem; }
.btn-lg { height: 2.5rem; padding: 0 1.25rem; }

/* ── Card ───────────────────────────────────────── */
.card { background: var(--card); color: var(--card-foreground); border: 1px solid var(--border); border-radius: var(--radius); box-shadow: 0 1px 2px 0 oklch(0 0 0 / 0.04); }
.card-pad { padding: 1.5rem; }
.card-head { padding: 1.5rem 1.5rem 0; }
.card-body { padding: 1.5rem; }
.card-title { font-size: 1rem; font-weight: 600; letter-spacing: -0.01em; margin: 0; }
.card-desc { color: var(--muted-foreground); font-size: 0.85rem; margin: 0.25rem 0 0; }
.card-sep { height: 1px; background: var(--border); margin: 1.5rem 0; }

/* ── Badge ──────────────────────────────────────── */
.badge { display: inline-flex; align-items: center; gap: 0.25rem; border-radius: calc(var(--radius) - 4px); padding: 0.1rem 0.5rem; font-size: 0.72rem; font-weight: 500; border: 1px solid transparent; white-space: nowrap; line-height: 1.4; }
.badge-default { background: var(--primary); color: var(--primary-foreground); }
.badge-secondary { background: var(--secondary); color: var(--secondary-foreground); }
.badge-outline { border-color: var(--border); color: var(--foreground); }
.badge-muted { background: color-mix(in oklch, var(--muted) 60%, transparent); color: var(--muted-foreground); border-color: var(--border); }
.badge-emerald { background: color-mix(in oklch, var(--emerald) 15%, transparent); color: var(--emerald); border-color: color-mix(in oklch, var(--emerald) 30%, transparent); }
.badge-orange  { background: color-mix(in oklch, var(--orange) 15%, transparent);  color: var(--orange);  border-color: color-mix(in oklch, var(--orange) 30%, transparent); }
.badge-yellow  { background: color-mix(in oklch, var(--yellow) 18%, transparent);  color: oklch(0.62 0.13 86); border-color: color-mix(in oklch, var(--yellow) 35%, transparent); }
.dark .badge-yellow { color: var(--yellow); }
.badge-violet  { background: color-mix(in oklch, var(--violet) 15%, transparent);  color: var(--violet);  border-color: color-mix(in oklch, var(--violet) 30%, transparent); }
.badge-sky     { background: color-mix(in oklch, var(--sky) 15%, transparent);     color: var(--sky);     border-color: color-mix(in oklch, var(--sky) 30%, transparent); }
.badge-blue    { background: color-mix(in oklch, var(--blue) 15%, transparent);    color: var(--blue);    border-color: color-mix(in oklch, var(--blue) 30%, transparent); }
.badge-destructive { background: color-mix(in oklch, var(--destructive) 15%, transparent); color: var(--destructive); border-color: color-mix(in oklch, var(--destructive) 30%, transparent); }

/* ── Inputs ─────────────────────────────────────── */
.input, .textarea, .select {
  width: 100%; height: 2.25rem; padding: 0 0.75rem; border-radius: calc(var(--radius) - 2px);
  border: 1px solid var(--input); background: var(--background); color: var(--foreground);
  font-size: 0.875rem; font-family: inherit; outline: none; transition: border-color 0.12s, box-shadow 0.12s;
}
.input::placeholder, .textarea::placeholder { color: var(--muted-foreground); }
.input:focus, .textarea:focus, .select:focus { border-color: var(--ring); box-shadow: 0 0 0 3px color-mix(in oklch, var(--ring) 35%, transparent); }
.textarea { height: auto; min-height: 5rem; padding: 0.55rem 0.75rem; resize: vertical; line-height: 1.5; }
.select { appearance: none; background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='14' height='14' viewBox='0 0 24 24' fill='none' stroke='%23888' stroke-width='2'%3E%3Cpath d='m6 9 6 6 6-6'/%3E%3C/svg%3E"); background-repeat: no-repeat; background-position: right 0.6rem center; padding-right: 2rem; cursor: pointer; }
.label { font-size: 0.82rem; font-weight: 500; display: block; margin-bottom: 0.4rem; }
.field-label { font-size: 0.82rem; font-weight: 500; display: block; margin-bottom: 0.4rem; }
.field { margin-bottom: 1rem; }

.search-wrap { position: relative; display: inline-flex; align-items: center; }
.search-wrap svg { position: absolute; left: 0.7rem; width: 16px; height: 16px; color: var(--muted-foreground); pointer-events: none; }
.search-wrap .input { padding-left: 2.1rem; }

/* ── Switch ─────────────────────────────────────── */
.switch { position: relative; width: 2.25rem; height: 1.25rem; border-radius: 999px; background: var(--input); border: none; cursor: pointer; flex-shrink: 0; transition: background 0.15s; padding: 0; }
.switch.on { background: var(--primary); }
.switch::after { content: ""; position: absolute; top: 2px; left: 2px; width: 1rem; height: 1rem; border-radius: 999px; background: var(--background); transition: transform 0.15s; box-shadow: 0 1px 2px oklch(0 0 0 / 0.2); }
.dark .switch::after { background: var(--foreground); }
.switch.on::after { transform: translateX(1rem); }
.dark .switch.on::after { background: var(--primary-foreground); }

/* ── Checkbox ───────────────────────────────────── */
.checkbox { width: 1rem; height: 1rem; border-radius: 4px; border: 1px solid var(--input); background: var(--background); display: inline-grid; place-items: center; cursor: pointer; flex-shrink: 0; transition: background 0.12s, border-color 0.12s; }
.checkbox.on { background: var(--primary); border-color: var(--primary); color: var(--primary-foreground); }
.checkbox svg { width: 12px; height: 12px; opacity: 0; }
.checkbox.on svg { opacity: 1; }

/* ── Tabs ───────────────────────────────────────── */
.tabs-list { display: inline-flex; gap: 0.25rem; background: var(--muted); padding: 0.25rem; border-radius: calc(var(--radius) - 2px); flex-wrap: wrap; }
.tab { border: none; background: transparent; color: var(--muted-foreground); font-size: 0.84rem; font-weight: 500; padding: 0.35rem 0.75rem; border-radius: calc(var(--radius) - 4px); cursor: pointer; white-space: nowrap; transition: background 0.12s, color 0.12s; display: inline-flex; align-items: center; gap: 0.4rem; }
.tab:hover { color: var(--foreground); }
.tab.active { background: var(--background); color: var(--foreground); box-shadow: 0 1px 2px oklch(0 0 0 / 0.08); }
.dark .tab.active { background: color-mix(in oklch, var(--card) 80%, var(--foreground) 5%); }

/* ── Table ──────────────────────────────────────── */
.table-card { border: 1px solid var(--border); border-radius: var(--radius); overflow: hidden; background: var(--card); }
.table-scroll { overflow-x: auto; }
table.tbl { width: 100%; border-collapse: collapse; font-size: 0.86rem; }
.tbl thead th { text-align: left; font-weight: 500; color: var(--muted-foreground); padding: 0.7rem 0.85rem; border-bottom: 1px solid var(--border); white-space: nowrap; height: 2.75rem; font-size: 0.8rem; background: color-mix(in oklch, var(--muted) 40%, transparent); }
.tbl tbody td { padding: 0.7rem 0.85rem; border-bottom: 1px solid var(--border); vertical-align: middle; }
.tbl tbody tr:last-child td { border-bottom: none; }
/* SDUI: progressive column reveal for the .tbl data tables. Lower-priority
   columns drop as width tightens (real <table> auto-collapses the track),
   so the grid stays readable instead of scrolling sideways. */
@media (max-width: 1099px) { .tbl .cu-props { display: none; } }
@media (max-width: 880px) { .tbl .cu-phone { display: none; } }
@media (max-width: 720px) { .tbl .cu-role { display: none; } }
.tbl tbody tr:hover { background: color-mix(in oklch, var(--muted) 45%, transparent); }
.tbl .num { font-variant-numeric: tabular-nums; }

/* ── Tooltip ────────────────────────────────────── */
.tip { position: relative; display: inline-flex; }
.tip-pop { position: absolute; bottom: calc(100% + 6px); left: 50%; transform: translateX(-50%); background: var(--primary); color: var(--primary-foreground); padding: 0.3rem 0.55rem; border-radius: calc(var(--radius) - 4px); font-size: 0.72rem; white-space: nowrap; pointer-events: none; opacity: 0; transition: opacity 0.12s; z-index: 60; box-shadow: 0 4px 12px oklch(0 0 0 / 0.18); }
.tip:hover .tip-pop { opacity: 1; }

/* ── Dropdown / popover ─────────────────────────── */
.pop { position: absolute; background: var(--popover); color: var(--popover-foreground); border: 1px solid var(--border); border-radius: calc(var(--radius) - 2px); box-shadow: 0 8px 28px oklch(0 0 0 / 0.16); padding: 0.25rem; min-width: 13rem; z-index: 80; }
.pop-label { padding: 0.4rem 0.5rem; font-size: 0.78rem; color: var(--muted-foreground); }
.pop-sep { height: 1px; background: var(--border); margin: 0.25rem 0; }
.pop-item { display: flex; align-items: center; gap: 0.5rem; padding: 0.4rem 0.5rem; border-radius: calc(var(--radius) - 4px); font-size: 0.85rem; cursor: pointer; border: none; background: transparent; color: inherit; width: 100%; text-align: left; }
.pop-item:hover { background: var(--accent); color: var(--accent-foreground); }
.pop-item svg { width: 15px; height: 15px; color: var(--muted-foreground); }
.pop-item.check svg { opacity: 0; }
.pop-item.check.on svg { opacity: 1; color: var(--foreground); }

/* ── Modal ──────────────────────────────────────── */
.overlay { position: fixed; inset: 0; background: oklch(0 0 0 / 0.5); display: grid; place-items: center; z-index: 100; padding: 1.5rem; animation: fade 0.15s ease; }
@keyframes fade { from { opacity: 0; } }
.modal { background: var(--popover); color: var(--popover-foreground); border: 1px solid var(--border); border-radius: var(--radius); box-shadow: 0 24px 60px oklch(0 0 0 / 0.3); width: 100%; max-width: 32rem; max-height: 88vh; overflow-y: auto; animation: pop 0.16s cubic-bezier(0.34,1.56,0.64,1); }
@keyframes pop { from { opacity: 0; transform: scale(0.96) translateY(6px); } }
.modal-head { padding: 1.25rem 1.5rem 0.5rem; display: flex; align-items: flex-start; justify-content: space-between; gap: 1rem; }
.modal-title { font-size: 1.05rem; font-weight: 600; margin: 0; }
.modal-desc { color: var(--muted-foreground); font-size: 0.85rem; margin: 0.4rem 0 0; line-height: 1.55; }
.modal-body { padding: 0.75rem 1.5rem 1rem; }
.modal-foot { padding: 0.75rem 1.5rem 1.25rem; display: flex; gap: 0.5rem; justify-content: flex-end; }

/* ── Misc helpers ───────────────────────────────── */
.row { display: flex; align-items: center; gap: 0.5rem; }
.col { display: flex; flex-direction: column; }
.grid2 { display: grid; grid-template-columns: 1fr 1fr; gap: 1rem; }
.grid3 { display: grid; grid-template-columns: repeat(3, 1fr); gap: 1rem; }
.spacer { flex: 1; }
.dot { width: 8px; height: 8px; border-radius: 999px; display: inline-block; flex-shrink: 0; }
.empty { text-align: center; color: var(--muted-foreground); padding: 3rem 1rem; font-size: 0.9rem; }
.iconbtn { display: inline-grid; place-items: center; width: 2rem; height: 2rem; border-radius: calc(var(--radius) - 2px); border: 1px solid transparent; background: transparent; color: var(--foreground); cursor: pointer; }
.iconbtn:hover { background: var(--accent); }
.iconbtn svg { width: 17px; height: 17px; }
.iconbtn.has-badge { position: relative; }
.iconbtn-badge { position: absolute; top: -2px; right: -2px; min-width: 15px; height: 15px; padding: 0 3px; border-radius: 999px; background: #FF0000; color: #fff; font-size: 0.6rem; font-weight: 700; line-height: 15px; text-align: center; box-shadow: 0 0 0 2px var(--background); pointer-events: none; }
.spin { animation: spin 0.9s linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }

/* segmented role switcher in topbar */
.seg { display: inline-flex; background: var(--muted); border-radius: calc(var(--radius) - 2px); padding: 0.15rem; gap: 0.1rem; }
.seg button { border: none; background: transparent; color: var(--muted-foreground); font-size: 0.7rem; font-weight: 500; padding: 0.22rem 0.5rem; border-radius: calc(var(--radius) - 4px); cursor: pointer;nter; white-space: nowrap; }
.seg button.active { background: var(--background); color: var(--foreground); box-shadow: 0 1px 2px oklch(0 0 0 / 0.08); }

/* ── Kanban ─────────────────────────────────────── */
.kanban { display: flex; gap: 0.75rem; align-items: flex-start; overflow-x: auto; padding-bottom: 1rem; }
.kcol { flex: 0 0 17rem; width: 17rem; background: color-mix(in oklch, var(--muted) 45%, transparent); border: 1px solid var(--border); border-radius: var(--radius); display: flex; flex-direction: column; max-height: calc(100vh - 220px); }
.kcol-head { display: flex; align-items: center; gap: 0.5rem; padding: 0.7rem 0.8rem; border-bottom: 1px solid var(--border); position: sticky; top: 0; }
.kcol-title { font-weight: 600; font-size: 0.82rem; }
.kcol-count { font-size: 0.72rem; font-weight: 600; color: var(--muted-foreground); background: var(--background); border: 1px solid var(--border); border-radius: 999px; padding: 0.02rem 0.4rem; min-width: 1.3rem; text-align: center; }
.kcol-body { padding: 0.5rem; overflow-y: auto; display: flex; flex-direction: column; gap: 0; }
.dcard { background: var(--card); border: 1px solid var(--border); border-radius: 10px; margin-bottom: 0; padding: 12px 13px; box-shadow: var(--shadow-sm); cursor: pointer; transition: box-shadow 0.15s, border-color 0.15s, transform 0.12s; display: flex; flex-direction: column; gap: 8px; }
.dcard:hover { box-shadow: var(--shadow-md); border-color: color-mix(in oklch, var(--foreground) 16%, var(--border)); transform: translateY(-1px); }
.dcard-title { font-size: 0.85rem; font-weight: 650; line-height: 1.35; letter-spacing: -0.005em; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.dcard-meta { display: flex; align-items: center; gap: 6px; font-size: 0.76rem; color: var(--muted-foreground); }
.dcard-meta svg { width: 13px; height: 13px; flex-shrink: 0; opacity: 0.75; }

@keyframes card-pop { 0%{transform:scale(1);} 20%{transform:scale(1.04);} 55%{transform:scale(0.975);} 80%{transform:scale(1.015);} 100%{transform:scale(1);} }
@keyframes card-enter { 0%{transform:translateY(-18px) scale(0.93);opacity:0;} 55%{transform:translateY(3px) scale(1.025);opacity:1;} 78%{transform:translateY(-2px) scale(0.99);} 100%{transform:translateY(0) scale(1);opacity:1;} }
@keyframes indicator-pop { 0%{transform:scale(1);} 28%{transform:scale(1.65);} 55%{transform:scale(0.82);} 78%{transform:scale(1.18);} 100%{transform:scale(1);} }
@keyframes ring-fade { 0%{box-shadow:0 0 0 2px oklch(0.6 0.18 254 / 0.7), 0 4px 24px oklch(0.6 0.18 254 / 0.25);} 100%{box-shadow:0 0 0 0 transparent;} }
.anim-pop { animation: card-pop 650ms cubic-bezier(0.22,1,0.36,1) both, ring-fade 900ms ease-out both; }
.anim-enter { animation: card-enter 520ms cubic-bezier(0.34,1.56,0.64,1) both, ring-fade 900ms ease-out both; }
.anim-ind { animation: indicator-pop 480ms cubic-bezier(0.34,1.56,0.64,1) both; }

/* whatsapp variable chips */
.wa-chip { display: inline-flex; align-items: center; border-radius: 0.25rem; padding: 0 0.375rem; font-size: 0.75rem; font-weight: 600; line-height: 1.5; font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, monospace; cursor: default; user-select: none; white-space: nowrap; background-color: color-mix(in oklch, var(--primary) 12%, transparent); border: 1px solid color-mix(in oklch, var(--primary) 25%, transparent); color: var(--primary); }

/* progress bar (budget) */
.bar { height: 6px; border-radius: 999px; background: var(--muted); overflow: hidden; min-width: 60px; }
.bar > span { display: block; height: 100%; border-radius: 999px; background: var(--primary); }
.bar.warn > span { background: var(--orange); }
.bar.danger > span { background: var(--destructive); }

/* qr placeholder */
.qr { width: 150px; height: 150px; border-radius: 8px; background:
  repeating-conic-gradient(var(--foreground) 0% 25%, transparent 0% 50%) 0 0 / 14px 14px;
  opacity: 0.85; border: 1px solid var(--border); }

/* toast */
.toast-host { position: fixed; top: 1rem; right: 1rem; z-index: 200; display: flex; flex-direction: column; gap: 0.5rem; }
.toast { background: var(--popover); color: var(--popover-foreground); border: 1px solid var(--border); border-radius: calc(var(--radius) - 2px); padding: 0.7rem 0.9rem; box-shadow: 0 8px 24px oklch(0 0 0 / 0.18); font-size: 0.85rem; display: flex; align-items: center; gap: 0.5rem; min-width: 16rem; animation: slidein 0.2s ease; }
@keyframes slidein { from { opacity: 0; transform: translateX(20px); } }
.toast .dot { width: 16px; height: 16px; border-radius: 999px; display: grid; place-items: center; }
.toast.ok .dot { background: color-mix(in oklch, var(--emerald) 20%, transparent); color: var(--emerald); }
.toast svg { width: 12px; height: 12px; }

@media (max-width: 820px) {
  .page { padding: 1.25rem 1rem 4rem; }
  .grid2, .grid3 { grid-template-columns: 1fr; }
  .plan-grid { grid-template-columns: 1fr; }
}
@media (prefers-reduced-motion: reduce) {
  .anim-pop, .anim-enter, .anim-ind { animation: none !important; }
}
.no-motion .anim-pop, .no-motion .anim-enter, .no-motion .anim-ind { animation: none !important; }
.no-motion * { transition-duration: 0.001ms !important; }

/* ── Onboarding ─────────────────────────────────── */
.onb-banner { display: flex; align-items: center; gap: 0.75rem; background: color-mix(in oklch, var(--emerald) 9%, var(--card)); border: 1px solid color-mix(in oklch, var(--emerald) 22%, transparent); border-radius: var(--radius); padding: 1rem 1.25rem; margin-bottom: 1.25rem; }
.onb-banner .ico { width: 2.4rem; height: 2.4rem; border-radius: 999px; display: grid; place-items: center; background: color-mix(in oklch, var(--emerald) 18%, transparent); color: var(--emerald); flex-shrink: 0; }
.onb-prog { display: flex; align-items: center; justify-content: space-between; margin-bottom: 0.6rem; font-size: 0.85rem; }
.onb-track { display: flex; flex-direction: column; gap: 2px; margin-top: 0.9rem; padding-top: 0.85rem; border-top: 1px solid var(--border); }
.onb-track-item { display: flex; align-items: center; gap: 9px; font-size: 0.82rem; color: var(--muted-foreground); padding: 3px 0; }
.onb-track-item.done { color: var(--foreground); }
.onb-track-dot { width: 20px; height: 20px; border-radius: 999px; flex-shrink: 0; display: grid; place-items: center; font-size: 0.68rem; font-weight: 700; border: 1.5px solid var(--border); color: var(--muted-foreground); }
.onb-track-item.done .onb-track-dot { background: var(--emerald); border-color: var(--emerald); color: #fff; }
.onb-steps { display: flex; flex-direction: column; }
.onb-step { display: flex; gap: 1rem; }
.onb-rail { display: flex; flex-direction: column; align-items: center; }
.onb-check { width: 2rem; height: 2rem; border-radius: 999px; border: 1px solid var(--border); background: var(--background); color: var(--muted-foreground); font-weight: 600; font-size: 0.82rem; display: grid; place-items: center; cursor: default; flex-shrink: 0; }
.onb-check.on { background: var(--emerald); border-color: var(--emerald); color: #fff; }
.onb-line { width: 2px; flex: 1; background: var(--border); margin: 4px 0; min-height: 1.5rem; }
.onb-body { padding-bottom: 1.4rem; flex: 1; }
.onb-step-head { display: flex; align-items: center; gap: 0.5rem; margin-bottom: 0.3rem; }
.onb-step-title { font-weight: 600; font-size: 0.95rem; }
.onb-step-desc { color: var(--muted-foreground); font-size: 0.85rem; margin-bottom: 0.7rem; max-width: 56ch; line-height: 1.5; }
.onb-step-actions { display: flex; gap: 0.5rem; }
.onb-golive { display: flex; align-items: center; justify-content: space-between; gap: 1rem; margin-top: 0.5rem; padding: 1.25rem; border: 1px solid var(--border); border-radius: var(--radius); background: var(--card); }
.onb-gl-title { font-weight: 600; font-size: 1rem; }
.onb-gl-sub { color: var(--muted-foreground); font-size: 0.85rem; margin-top: 0.2rem; }

/* ── Craftsmen (dashboard design) ─────────────────── */
.craft-wrap { border: 1px solid var(--border); border-radius: 14px; overflow: hidden; background: var(--card); }
.craft-toolbar { display: flex; align-items: center; justify-content: space-between; padding: 13px 18px; background: var(--muted); border-bottom: 1px solid var(--border); }
.craft-toolbar .label { font-size: 14px; font-weight: 600; }
.craft-toolbar .actions { display: flex; gap: 8px; }
.craft-group-head { display: flex; align-items: center; gap: 10px; padding: 13px 18px; background: var(--muted); border-bottom: 1px solid var(--border); cursor: pointer; }
.craft-group-head .chev { color: var(--muted-foreground); display: flex; }
.craft-group-head .gname { font-weight: 600; font-size: 14px; }
.craft-group-head .gcount { color: var(--muted-foreground); font-size: 13px; }
.craft-group-head .warn { color: var(--orange); display: flex; }
.craft-table-head, .craft-row { display: grid; grid-template-columns: 34px 70px 1.4fr 1.5fr 1.1fr 1.3fr 92px 84px; align-items: center; }
.craft-table-head > div { padding: 10px 12px; font-size: 12px; font-weight: 600; color: var(--muted-foreground); text-transform: uppercase; letter-spacing: .03em; }
.craft-table-head { border-bottom: 1px solid var(--border); }
.craft-row { border-bottom: 1px solid var(--border); }
.craft-row:last-child { border-bottom: none; }
.craft-row > div { padding: 12px; font-size: 13.5px; }
/* Progressive column reveal — degrade to essentials instead of x-scroll.
   Tiers: name/status/actions always; emergency+industries drop first at
   narrow; grip+phone next; email is lowest priority. Head + rows share
   one grid template so they stay aligned automatically. */
@media (max-width: 1399px) {
  .craft-table-head, .craft-row { grid-template-columns: 34px 70px 1.4fr 1.1fr 1.3fr 92px 84px; }
  .craft-table-head .cc-email, .craft-row .cc-email { display: none; }
}
@media (max-width: 1199px) {
  .craft-table-head, .craft-row { grid-template-columns: 70px 1.4fr 1.3fr 92px 84px; }
  .craft-table-head .cc-grip, .craft-row .cc-grip,
  .craft-table-head .cc-phone, .craft-row .cc-phone { display: none; }
}
@media (max-width: 999px) {
  .craft-table-head, .craft-row { grid-template-columns: 72px 1.4fr 84px; }
  .craft-table-head .cc-ind, .craft-row .cc-ind,
  .craft-table-head .cc-emg, .craft-row .cc-emg { display: none; }
}
.craft-row.dragging { opacity: .45; }
.craft-row.drag-over { box-shadow: inset 0 2px 0 0 var(--foreground); }
.craft-row.expanded { background: color-mix(in oklch, var(--muted) 28%, transparent); border-bottom-color: transparent; }
.craft-expand { border-bottom: 1px solid var(--border); background: color-mix(in oklch, var(--muted) 28%, transparent); padding: 18px 22px 20px; display: flex; flex-direction: column; gap: 16px; }
.craft-expand-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 16px 22px; }
.craft-expand-grid .k, .craft-expand-block .k { font-size: 0.74rem; color: var(--muted-foreground); text-transform: uppercase; letter-spacing: .03em; font-weight: 600; margin-bottom: 4px; }
.craft-expand-grid .v, .craft-expand-block .v { font-size: 13.5px; }
.craft-expand-block .chips { display: flex; flex-wrap: wrap; gap: 6px; }
.craft-expand-block .chip { font-size: 12px; padding: 4px 10px; border-radius: 7px; background: var(--card); color: var(--foreground); border: 1px solid var(--border); }
.craft-comp-warn { display: inline-flex; align-items: center; gap: 5px; margin-left: 8px; color: var(--orange); font-size: 12px; font-weight: 600; }
@media (max-width: 999px) { .craft-expand-grid { grid-template-columns: repeat(2, 1fr); } .craft-expand-grid > div[style] { grid-column: auto !important; } }
.drag-handle { color: var(--muted-foreground); cursor: grab; display: flex; opacity: .55; }
.drag-handle:active { cursor: grabbing; }
.craft-name { font-weight: 600; }
.industries-link { text-decoration: underline; cursor: pointer; color: var(--muted-foreground); font-size: 13px; }
.emergency-radio { width: 20px; height: 20px; border-radius: 50%; border: 1.5px solid var(--border); display: inline-flex; align-items: center; justify-content: center; cursor: pointer; color: transparent; }
.emergency-radio.on { background: var(--emerald); border-color: var(--emerald); color: #fff; }
.cpop { position: fixed; z-index: 200; background: var(--card); border: 1px solid var(--border); border-radius: 12px; box-shadow: 0 10px 30px oklch(0 0 0 / 0.16); padding: 14px; width: 360px; }
.cpop h4 { margin: 0 0 10px; font-size: 13px; font-weight: 700; }
.cpop .chips { display: flex; flex-wrap: wrap; gap: 6px; }
.cpop .chip { font-size: 12px; padding: 4px 10px; border-radius: 7px; background: var(--muted); color: var(--muted-foreground); border: 1px solid var(--border); }
.craft-archived { border-top: 1px solid var(--border); }
.craft-arch-row { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 11px 18px; border-top: 1px solid var(--border); opacity: .8; }

/* ── Billing (dashboard design) ───────────────────── */
.bill-section-title { font-size: 13px; font-weight: 700; letter-spacing: .05em; text-transform: uppercase; color: var(--muted-foreground); margin: 4px 0 14px; }
.plan-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; margin-bottom: 18px; }
.plan-card { position: relative; text-align: left; background: var(--card); border: 1.5px solid var(--border); border-radius: 16px; padding: 22px; display: flex; flex-direction: column; gap: 8px; cursor: pointer; transition: border-color .12s, box-shadow .12s; }
.plan-card:hover { border-color: var(--muted-foreground); }
.plan-card.selected { border-color: var(--foreground); box-shadow: 0 0 0 3px var(--muted); }
.plan-radio { position: absolute; top: 20px; right: 20px; width: 20px; height: 20px; border-radius: 50%; border: 2px solid var(--border); display: flex; align-items: center; justify-content: center; }
.plan-card.selected .plan-radio { border-color: var(--foreground); }
.plan-radio-dot { width: 10px; height: 10px; border-radius: 50%; background: var(--foreground); }
.plan-ico { width: 42px; height: 42px; border-radius: 11px; background: var(--muted); color: var(--foreground); display: flex; align-items: center; justify-content: center; }
.plan-title { font-size: 17px; font-weight: 700; }
.plan-desc { font-size: 13px; color: var(--muted-foreground); line-height: 1.5; }
.plan-price { font-size: 14px; color: var(--muted-foreground); margin-top: 4px; }
.plan-price strong { color: var(--foreground); font-size: 16px; font-weight: 700; }
.plan-foot { font-size: 12px; color: var(--muted-foreground); margin-top: 2px; }
.bill-detail { padding: 22px 24px; margin-bottom: 16px; }
.bd-head { display: flex; align-items: flex-start; justify-content: space-between; gap: 12px; margin-bottom: 16px; }
.bd-title { font-size: 15px; font-weight: 700; }
.bd-sub { font-size: 13px; color: var(--muted-foreground); margin-top: 3px; }
.tier-table, .inv-table { width: 100%; border-collapse: collapse; font-size: 13.5px; }
.tier-table th { text-align: left; font-size: 12px; font-weight: 600; color: var(--muted-foreground); padding: 8px 10px; border-bottom: 1px solid var(--border); }
.tier-table td { padding: 11px 10px; border-bottom: 1px solid var(--border); color: var(--foreground); }
.tier-table tr:last-child td { border-bottom: none; }
.tier-table tr.active td { background: var(--muted); color: var(--foreground); font-weight: 600; }
.tier-table tr.active td:first-child { border-radius: 8px 0 0 8px; }
.tier-table tr.active td:last-child { border-radius: 0 8px 8px 0; }
.tier-you { font-size: 11.5px; font-weight: 700; color: var(--foreground); }
.inq-grid { display: flex; flex-direction: column; }
.inq-row { display: grid; grid-template-columns: 1fr auto auto; gap: 18px; align-items: center; padding: 12px 2px; border-bottom: 1px solid var(--border); }
.inq-row:last-child { border-bottom: none; }
.inq-label { font-weight: 600; font-size: 14px; }
.inq-calc { font-size: 13px; color: var(--muted-foreground); }
.inq-sum { font-size: 14px; font-weight: 600; min-width: 90px; text-align: right; }
.pay-managed { display: flex; align-items: center; justify-content: space-between; gap: 16px; padding: 16px; border: 1px solid var(--border); border-radius: 12px; background: var(--card); flex-wrap: wrap; }
.pay-managed .pm-info { display: flex; align-items: center; gap: 14px; }
.pay-managed .pm-ico { width: 42px; height: 42px; border-radius: 10px; background: var(--muted); color: var(--foreground); display: flex; align-items: center; justify-content: center; flex-shrink: 0; }
.pay-managed .pm-title { font-weight: 600; font-size: 14px; }
.pay-managed .pm-sub { font-size: 12.5px; color: var(--muted-foreground); margin-top: 2px; max-width: 340px; }
.stripe-note { display: flex; align-items: center; gap: 8px; font-size: 12.5px; color: var(--muted-foreground); margin-top: 16px; padding: 11px 14px; background: var(--muted); border-radius: 10px; }
.bill-summary { padding: 22px 24px; margin-top: 8px; }
.bs-head { font-size: 13px; font-weight: 700; letter-spacing: .04em; text-transform: uppercase; color: var(--muted-foreground); margin-bottom: 14px; }
.bs-rows { display: flex; flex-direction: column; gap: 9px; }
.bs-row { display: flex; align-items: center; justify-content: space-between; font-size: 13.5px; color: var(--foreground); }
.bs-total { display: flex; align-items: baseline; justify-content: space-between; margin-top: 16px; padding-top: 16px; border-top: 1px solid var(--border); }
.bs-total > span:first-child { font-size: 15px; font-weight: 700; }
.bs-total em { font-style: normal; font-weight: 400; color: var(--muted-foreground); font-size: 13px; }
.bs-amount { font-size: 26px; font-weight: 800; letter-spacing: -.01em; }
.bs-meta { font-size: 12.5px; color: var(--muted-foreground); margin-top: 12px; padding-top: 12px; border-top: 1px solid var(--border); }
.bs-pay-row { display: flex; align-items: center; justify-content: space-between; gap: 10px; }
.bs-pay-method { display: inline-flex; align-items: center; gap: 6px; font-size: 13px; font-weight: 600; color: var(--foreground); }
.bs-pay-status { font-size: 11px; font-weight: 700; padding: 2px 8px; border-radius: 999px; }
.bs-pay-status.ok { background: color-mix(in oklch, var(--emerald) 18%, transparent); color: var(--emerald); }
.bs-pay-status.due { background: color-mix(in oklch, var(--orange, #d97706) 20%, transparent); color: var(--orange, #d97706); }
.bs-pay-sub { font-size: 12px; color: var(--muted-foreground); margin-top: 6px; line-height: 1.45; }
.pay-testbar { display: flex; align-items: center; justify-content: space-between; gap: 10px; margin-bottom: 14px; }
.pay-test-badge { font-size: 11px; font-weight: 700; letter-spacing: .03em; text-transform: uppercase; color: var(--orange, #d97706); background: color-mix(in oklch, var(--orange, #d97706) 16%, transparent); padding: 3px 9px; border-radius: 999px; }
.pay-test-fill { border: none; background: none; color: var(--primary); font: inherit; font-size: 12.5px; font-weight: 600; cursor: pointer; }
.pay-test-fill:hover { text-decoration: underline; }
.pay-card-group { display: flex; flex-direction: column; gap: 8px; }
.pay-card-num { position: relative; }
.pay-brand { position: absolute; right: 12px; top: 50%; transform: translateY(-50%); font-size: 11px; font-weight: 700; color: var(--muted-foreground); pointer-events: none; }
.pay-card-row { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
.input.input-err { border-color: var(--destructive); }
.pay-err { color: var(--destructive); font-size: 12px; margin-top: 6px; }
.inv-table th { text-align: left; font-size: 12px; font-weight: 600; color: var(--muted-foreground); padding: 13px 18px; border-bottom: 1px solid var(--border); }
.inv-table td { padding: 13px 18px; border-bottom: 1px solid var(--border); }
.inv-table tr:last-child td { border-bottom: none; }
.inv-id { font-family: "SF Mono", ui-monospace, monospace; font-size: 12.5px; }
.manage-sub { display: flex; align-items: center; justify-content: space-between; gap: 16px; }
.bill-settings-actions { display: flex; justify-content: flex-end; gap: 10px; margin-top: 18px; }

/* ── Guided tour ────────────────────────────────── */
.tour-root { position: fixed; inset: 0; z-index: 300; }
.tour-catch { position: absolute; inset: 0; }
.tour-dim { position: absolute; inset: 0; background: oklch(0 0 0 / 0.55); }
.tour-spot { position: absolute; border-radius: calc(var(--radius)); box-shadow: 0 0 0 9999px oklch(0 0 0 / 0.55), 0 0 0 2px var(--sidebar-ring); transition: all 0.25s cubic-bezier(0.4,0,0.2,1); pointer-events: none; }
.tour-tip { position: fixed; background: var(--popover); color: var(--popover-foreground); border: 1px solid var(--border); border-radius: var(--radius); box-shadow: 0 16px 48px oklch(0 0 0 / 0.3); padding: 1rem 1.1rem; z-index: 310; }
.tour-tip-top { display: flex; align-items: center; justify-content: space-between; margin-bottom: 0.5rem; }
.tour-step-n { font-size: 0.72rem; font-weight: 600; color: var(--muted-foreground); text-transform: uppercase; letter-spacing: 0.04em; }
.tour-skip { background: none; border: none; color: var(--muted-foreground); font-size: 0.78rem; cursor: pointer; }
.tour-tip h3 { font-size: 1rem; margin: 0 0 0.35rem; font-weight: 600; }
.tour-tip p { font-size: 0.85rem; color: var(--muted-foreground); line-height: 1.5; margin: 0 0 0.9rem; }
.tour-foot { display: flex; align-items: center; justify-content: space-between; }
.tour-dots { display: flex; gap: 5px; }
.tour-dots span { width: 6px; height: 6px; border-radius: 999px; background: var(--border); cursor: pointer; }
.tour-dots span.on { background: var(--primary); width: 16px; }
.tour-btns { display: flex; gap: 0.4rem; }

/* ── Billing modal bits ─────────────────────────── */
.bill-ico { width: 3rem; height: 3rem; border-radius: 999px; display: grid; place-items: center; background: color-mix(in oklch, var(--blue) 14%, transparent); color: var(--blue); margin-bottom: 0.4rem; }
.bill-ico.warn { background: color-mix(in oklch, var(--orange) 16%, transparent); color: var(--orange); }
.bill-step { display: flex; gap: 0.7rem; align-items: flex-start; padding: 0.6rem 0; }
.bill-step .si { width: 2rem; height: 2rem; border-radius: calc(var(--radius) - 2px); background: var(--muted); display: grid; place-items: center; color: var(--muted-foreground); flex-shrink: 0; }
.opt-card { border: 1px solid var(--border); border-radius: var(--radius); padding: 0.85rem 1rem; cursor: pointer; transition: border-color .12s, background .12s; }
.opt-card.on { border-color: var(--primary); background: color-mix(in oklch, var(--primary) 5%, transparent); }
.opt-card .ot { font-weight: 600; font-size: 0.9rem; }
.opt-card .os { color: var(--muted-foreground); font-size: 0.8rem; margin-top: 0.15rem; }
.cancel-rule { display: flex; align-items: center; gap: 0.6rem; padding: 0.6rem 0.8rem; border: 1px solid var(--border); border-radius: calc(var(--radius) - 2px); font-size: 0.82rem; margin-bottom: 0.5rem; }
.cancel-rule.active { border-color: var(--orange); background: color-mix(in oklch, var(--orange) 8%, transparent); }
.cancel-callout { display: flex; gap: 0.6rem; align-items: center; background: var(--muted); border-radius: calc(var(--radius) - 2px); padding: 0.7rem 0.9rem; margin-top: 0.5rem; }

/* ── Settings: rich tabs ────────────────────────── */
.muted-label { font-size: 0.72rem; font-weight: 600; letter-spacing: 0.05em; text-transform: uppercase; color: var(--muted-foreground); margin-bottom: 0.7rem; }
.rt-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 0.85rem; }
.rt-card { border: 1px solid var(--border); border-radius: var(--radius); padding: 1rem; border-top: 3px solid var(--border); background: var(--card); }
.rt-card.red { border-top-color: var(--destructive); }
.rt-card.amber { border-top-color: var(--orange); }
.rt-card.blue { border-top-color: var(--blue); }
.rt-title { display: flex; align-items: center; gap: 0.4rem; font-weight: 600; font-size: 0.9rem; }
.rt-card.red .rt-title svg { color: var(--destructive); } .rt-card.amber .rt-title svg { color: var(--orange); } .rt-card.blue .rt-title svg { color: var(--blue); }
.rt-title svg { width: 16px; height: 16px; }
.rt-desc { color: var(--muted-foreground); font-size: 0.78rem; margin: 0.3rem 0 0.85rem; line-height: 1.45; min-height: 2.1em; }
.rt-field-label { font-size: 0.72rem; font-weight: 500; color: var(--muted-foreground); margin-bottom: 0.35rem; }
.rt-input-group { display: flex; gap: 0.5rem; }
.rt-input-group > input { flex: 1; height: 2.25rem; padding: 0 0.7rem; border-radius: calc(var(--radius) - 2px); border: 1px solid var(--input); background: var(--background); color: var(--foreground); font-size: 0.9rem; font-variant-numeric: tabular-nums; outline: none; }
.rt-input-group > input:focus { border-color: var(--ring); box-shadow: 0 0 0 3px color-mix(in oklch, var(--ring) 30%, transparent); }
.rt-unit-toggle { display: inline-flex; background: var(--muted); border-radius: calc(var(--radius) - 2px); padding: 0.18rem; }
.rt-unit-toggle button { border: none; background: transparent; color: var(--muted-foreground); font-size: 0.78rem; font-weight: 500; padding: 0 0.6rem; border-radius: calc(var(--radius) - 4px); cursor: pointer; }
.rt-unit-toggle button.on { background: var(--background); color: var(--foreground); box-shadow: 0 1px 2px oklch(0 0 0 / 0.08); }
.rt-examples { color: var(--muted-foreground); font-size: 0.72rem; margin-top: 0.7rem; line-height: 1.4; }

.qr-layout { display: grid; grid-template-columns: 1fr 200px; gap: 1.5rem; align-items: start; }
.qr-help-label, .section-label-icon { display: flex; align-items: center; gap: 0.4rem; font-size: 0.82rem; font-weight: 500; margin-bottom: 0.4rem; }
.qr-help-label svg, .section-label-icon svg { width: 15px; height: 15px; color: var(--muted-foreground); }
.qr-help { color: var(--muted-foreground); font-size: 0.76rem; line-height: 1.5; margin: 0.5rem 0 0; }
.char-count { color: var(--muted-foreground); font-size: 0.72rem; text-align: right; margin-top: 0.3rem; }
.qr-img { width: 180px; height: 180px; border: 1px solid var(--border); border-radius: 8px; }
/* ── Settings: ailean config polish ─────────────────── */
.cfg-channel { display: flex; align-items: center; gap: 12px; padding: 12px 14px; border: 1px solid var(--border); border-radius: var(--radius); background: var(--background); }
.cfg-channel-ico { width: 38px; height: 38px; border-radius: 9px; display: grid; place-items: center; background: color-mix(in oklch, var(--emerald) 15%, transparent); color: var(--emerald); flex-shrink: 0; }
.cfg-badge { display: inline-flex; align-items: center; gap: 6px; font-size: 0.72rem; font-weight: 700; color: var(--emerald); background: color-mix(in oklch, var(--emerald) 14%, transparent); padding: 4px 9px; border-radius: 999px; flex-shrink: 0; }
.cfg-dot { width: 7px; height: 7px; border-radius: 999px; background: var(--emerald); }
.cfg-preview { margin-top: 12px; padding: 12px; border: 1px solid var(--border); border-radius: var(--radius); background: var(--muted); }
.cfg-preview-head { display: flex; align-items: center; gap: 6px; font-size: 0.68rem; font-weight: 700; letter-spacing: 0.04em; text-transform: uppercase; color: var(--muted-foreground); margin-bottom: 8px; }
.cfg-bubble { background: var(--background); border: 1px solid var(--border); border-radius: 12px 12px 12px 4px; padding: 9px 12px; font-size: 0.84rem; line-height: 1.5; max-width: 92%; box-shadow: 0 1px 2px rgba(0,0,0,0.04); white-space: pre-wrap; }
.cfg-qr-card { display: flex; flex-direction: column; align-items: center; gap: 14px; padding: 18px; border: 1px solid var(--border); border-radius: var(--radius); background: var(--background); }
.cfg-qr-title { display: flex; align-items: center; gap: 7px; font-size: 0.8rem; font-weight: 700; color: var(--foreground); align-self: flex-start; }
.cfg-setting-row { display: flex; align-items: center; gap: 14px; padding: 14px 16px; border: 1px solid var(--border); border-radius: var(--radius); }
.cfg-setting-ico { width: 34px; height: 34px; border-radius: 8px; display: grid; place-items: center; background: var(--accent); color: var(--foreground); flex-shrink: 0; }
/* ── Settings: labelled sub-panels (emergency, etc.) ── */
.set-panel { border: 1px solid var(--border); border-radius: var(--radius); padding: 16px; }
.set-panel + .set-panel { margin-top: 14px; }
.set-panel-head { display: flex; align-items: center; gap: 11px; margin-bottom: 14px; }
.set-panel-ico { width: 36px; height: 36px; border-radius: 9px; display: grid; place-items: center; flex-shrink: 0; }
.set-panel-ico.day { background: color-mix(in oklch, var(--blue) 14%, transparent); color: var(--blue); }
.set-panel-ico.night { background: color-mix(in oklch, var(--muted-foreground) 16%, transparent); color: var(--foreground); }
.set-panel-title { font-weight: 600; font-size: 0.92rem; }
.set-panel-sub { font-size: 0.76rem; color: var(--muted-foreground); margin-top: 1px; }
.set-summary { display: inline-flex; align-items: center; gap: 7px; font-size: 0.8rem; font-weight: 600; color: var(--foreground); background: var(--accent); border-radius: 999px; padding: 5px 12px; }
/* ── Settings: language picker ──────────────────────── */
.lang-select { position: relative; }
.lang-trigger, .lang-opt { display: flex; align-items: center; gap: 11px; width: 100%; text-align: left; background: var(--background); border: 1px solid var(--border); border-radius: var(--radius); padding: 9px 12px; cursor: pointer; font: inherit; color: var(--foreground); }
.lang-trigger.open { border-color: var(--primary); box-shadow: 0 0 0 3px color-mix(in oklch, var(--primary) 18%, transparent); }
.lang-chip { width: 30px; height: 30px; border-radius: 7px; display: grid; place-items: center; background: var(--accent); font-size: 0.72rem; font-weight: 700; letter-spacing: 0.03em; flex-shrink: 0; }
.lang-name { display: flex; flex-direction: column; line-height: 1.2; font-size: 0.88rem; font-weight: 600; }
.lang-sub { font-size: 0.72rem; font-weight: 400; color: var(--muted-foreground); }
.lang-caret { margin-left: auto; color: var(--muted-foreground); display: inline-flex; transition: transform 0.18s; }
.lang-trigger.open .lang-caret { transform: rotate(180deg); }
.lang-backdrop { position: fixed; inset: 0; z-index: 40; }
.lang-menu { position: absolute; top: calc(100% + 6px); left: 0; right: 0; z-index: 41; background: var(--popover, var(--background)); border: 1px solid var(--border); border-radius: var(--radius); box-shadow: 0 12px 32px rgba(0,0,0,0.16); padding: 5px; display: flex; flex-direction: column; gap: 2px; animation: anim-pop 0.14s ease; }
.lang-opt { border-color: transparent; padding: 7px 9px; }
.lang-opt:hover { background: var(--accent); }
.lang-opt.on { background: color-mix(in oklch, var(--primary) 10%, transparent); }
.lang-check { margin-left: auto; color: var(--primary); display: inline-flex; }
@media (max-width: 860px) { .qr-layout { grid-template-columns: 1fr; } }
/* ── Settings: ailean config 2-col layout + QR downloads ── */
.cfg-grid { display: grid; grid-template-columns: minmax(0, 1fr) 260px; gap: 1.5rem; align-items: start; }
.cfg-dl-row { display: grid; grid-template-columns: repeat(3, 1fr); gap: 6px; width: 100%; }
.cfg-dl-row .btn { justify-content: center; padding-left: 0; padding-right: 0; }
@media (max-width: 860px) { .cfg-grid { grid-template-columns: 1fr; } }
/* ── Polished native selects + reusable custom dropdown ── */
select.field, .select { transition: border-color 0.14s, box-shadow 0.14s; }
select.field:hover:not([disabled]):not([readonly]), .select:hover:not([disabled]) { border-color: color-mix(in oklch, var(--foreground) 26%, var(--border)); }
select.field:focus, .select:focus { border-color: var(--ring); box-shadow: 0 0 0 3px color-mix(in oklch, var(--ring) 30%, transparent); outline: none; }
.nsel { position: relative; }
.nsel-trigger { display: flex; align-items: center; gap: 8px; width: 100%; background: var(--background); border: 1px solid var(--input); border-radius: calc(var(--radius) - 2px); height: 2.4rem; padding: 0 0.7rem; cursor: pointer; font: inherit; font-size: 0.875rem; color: var(--foreground); transition: border-color 0.14s, box-shadow 0.14s; }
.nsel-trigger:hover { border-color: color-mix(in oklch, var(--foreground) 26%, var(--border)); }
.nsel-trigger.open { border-color: var(--ring); box-shadow: 0 0 0 3px color-mix(in oklch, var(--ring) 28%, transparent); }
.nsel-val { flex: 1; text-align: left; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.nsel-caret { color: var(--muted-foreground); display: inline-flex; transition: transform 0.18s; }
.nsel-trigger.open .nsel-caret { transform: rotate(180deg); }
.nsel-menu { position: absolute; top: calc(100% + 6px); left: 0; right: 0; z-index: 41; background: var(--popover, var(--background)); border: 1px solid var(--border); border-radius: var(--radius); box-shadow: 0 12px 32px rgba(0,0,0,0.16); padding: 5px; display: flex; flex-direction: column; gap: 2px; min-width: max-content; animation: anim-pop 0.14s ease; }
.nsel-opt { display: flex; align-items: center; gap: 10px; width: 100%; text-align: left; background: none; border: none; border-radius: calc(var(--radius) - 3px); padding: 7px 10px; cursor: pointer; font: inherit; font-size: 0.86rem; color: var(--foreground); white-space: nowrap; }
.nsel-opt:hover { background: var(--accent); }
.nsel-opt.on { background: color-mix(in oklch, var(--primary) 10%, transparent); font-weight: 600; }
.nsel-opt > span:first-child { flex: 1; }

.toggle-row { display: flex; align-items: center; justify-content: space-between; gap: 1rem; padding: 0.85rem 0; }
.tr-title { font-weight: 500; font-size: 0.86rem; }
.tr-desc { color: var(--muted-foreground); font-size: 0.78rem; margin-top: 0.2rem; line-height: 1.4; max-width: 60ch; }

.emergency-block { margin-bottom: 1.25rem; }
.emergency-block:last-child { margin-bottom: 0; }
.emergency-block h4 { font-size: 0.86rem; font-weight: 600; margin: 0 0 0.7rem; }

.day-toolbar { display: flex; gap: 0.5rem; flex-wrap: wrap; margin-bottom: 1rem; }
.day-row { display: grid; grid-template-columns: 110px 90px 1fr 1fr; gap: 0.75rem; align-items: center; padding: 0.5rem 0; border-bottom: 1px solid var(--border); }
.day-row:last-child { border-bottom: none; }
.day-name { font-size: 0.86rem; font-weight: 500; }
.day-closed { display: flex; align-items: center; gap: 0.35rem; font-size: 0.78rem; color: var(--muted-foreground); cursor: pointer; }
.day-closed input { accent-color: var(--primary); }
.time-input { display: flex; align-items: center; gap: 0.4rem; height: 2.25rem; padding: 0 0.7rem; border-radius: calc(var(--radius) - 2px); border: 1px solid var(--input); background: var(--background); }
.time-input.disabled { opacity: 0.45; background: var(--muted); }
.time-input input { border: none; background: transparent; outline: none; color: var(--foreground); width: 100%; font-size: 0.85rem; font-variant-numeric: tabular-nums; }
.time-input svg { width: 14px; height: 14px; color: var(--muted-foreground); flex-shrink: 0; }

.holiday-head, .holiday-row { display: grid; grid-template-columns: 1.4fr 1fr 1fr 0.7fr; gap: 0.75rem; align-items: center; }
.holiday-head { font-size: 0.72rem; font-weight: 600; text-transform: uppercase; letter-spacing: 0.03em; color: var(--muted-foreground); padding-bottom: 0.6rem; border-bottom: 1px solid var(--border); margin-bottom: 0.5rem; }
.holiday-row { padding: 0.4rem 0; }
.remove-link { background: none; border: none; color: var(--destructive); font-size: 0.8rem; font-weight: 500; cursor: pointer; }
.hol-row { display: flex; align-items: center; gap: 14px; padding: 10px 12px; border: 1px solid var(--border); border-radius: var(--radius); transition: opacity 0.15s; }
.hol-row.off { opacity: 0.5; }
.hol-date { width: 46px; height: 46px; border-radius: 10px; background: var(--accent); display: flex; flex-direction: column; align-items: center; justify-content: center; flex-shrink: 0; line-height: 1; }
.hol-d { font-size: 1.05rem; font-weight: 700; }
.hol-m { font-size: 0.6rem; font-weight: 700; text-transform: uppercase; letter-spacing: 0.04em; color: var(--muted-foreground); margin-top: 2px; }
.hol-main { flex: 1; min-width: 0; }
.hol-name { font-weight: 600; font-size: 0.9rem; }
.hol-meta { font-size: 0.76rem; color: var(--muted-foreground); margin-top: 1px; }
.hol-dur { width: auto; min-width: 122px; flex-shrink: 0; }

.report-head { display: grid; grid-template-columns: 1fr 120px 120px; align-items: stretch; padding: 0 0 0.85rem; border-bottom: 1px solid var(--border); margin-bottom: 0.4rem; }
.report-head .col-h { display: flex; flex-direction: column; align-items: center; justify-content: flex-end; gap: 8px; }
.report-head .col-h .section-label-icon { margin-bottom: 0 !important; }
.report-section-row { font-size: 0.7rem; font-weight: 700; letter-spacing: 0.05em; text-transform: uppercase; color: var(--muted-foreground); background: color-mix(in oklch, var(--muted) 55%, transparent); border-radius: 7px; padding: 7px 12px; margin-top: 8px; display: flex; align-items: center; justify-content: space-between; }
.report-sec-count { font-size: 0.66rem; font-weight: 600; letter-spacing: 0; text-transform: none; color: var(--muted-foreground); opacity: 0.85; }
.report-field-row { display: grid; grid-template-columns: 1fr 120px 120px; align-items: center; padding: 0.5rem 0.6rem; border-bottom: 1px solid var(--border); border-radius: 8px; transition: background 0.12s; }
.report-field-row:hover { background: var(--accent); }
.report-field-row .fname { font-size: 0.86rem; }
.report-field-row .check-cell { display: flex; justify-content: center; }
.report-head .col-h, .report-field-row .check-cell { border-left: 1px solid color-mix(in oklch, var(--border) 60%, transparent); }
.checkbox-round { width: 1.35rem; height: 1.35rem; border-radius: 6px; border: 1px solid var(--input); background: var(--background); display: inline-grid; place-items: center; cursor: pointer; color: var(--primary-foreground); transition: border-color 0.12s, background 0.12s; }
.checkbox-round:hover { border-color: var(--ring); }
.checkbox-round.on:hover { background: color-mix(in oklch, var(--primary) 88%, black); }
.checkbox-round.on { background: var(--primary); border-color: var(--primary); }
.checkbox-round svg { width: 13px; height: 13px; }

.answer-item .field, .scard-body .field { width: 100%; }
.reply-item { border: 1px solid var(--border); border-radius: var(--radius); padding: 14px; }
.reply-q { display: flex; align-items: center; gap: 8px; font-weight: 600; font-size: 0.86rem; margin-bottom: 10px; }
.reply-q-ico { width: 26px; height: 26px; border-radius: 7px; background: var(--accent); color: var(--muted-foreground); display: grid; place-items: center; flex-shrink: 0; }
/* ── Settings: missing-setting indicators ───────────── */
.tab-warn { width: 7px; height: 7px; border-radius: 999px; background: var(--destructive); margin-left: 6px; display: inline-block; vertical-align: middle; flex-shrink: 0; }
.settings-alert { display: flex; align-items: flex-start; gap: 11px; padding: 12px 14px; border: 1px solid color-mix(in oklch, var(--orange, #d97706) 40%, transparent); background: color-mix(in oklch, var(--orange, #d97706) 10%, transparent); border-radius: var(--radius); margin-bottom: 16px; font-size: 0.86rem; line-height: 1.45; }
.settings-alert > svg { color: var(--orange, #d97706); flex-shrink: 0; margin-top: 1px; }
.settings-alert-tabs { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 9px; }
.settings-alert-tabs button { border: 1px solid var(--border); background: var(--background); border-radius: 999px; padding: 3px 11px; font: inherit; font-size: 0.78rem; font-weight: 600; cursor: pointer; transition: border-color 0.12s; }
.settings-alert-tabs button:hover { border-color: var(--orange, #d97706); }
.settings-actions { display: flex; justify-content: flex-end; gap: 0.6rem; margin-top: 1.5rem; }
.scard-body .field, .form-row .field, .form-grid-2 .field { width: 100%; height: 2.4rem; padding: 0 0.75rem; border-radius: calc(var(--radius) - 2px); border: 1px solid var(--input); background: var(--background); color: var(--foreground); font-size: 0.88rem; font-family: inherit; outline: none; }
textarea.field { height: auto; min-height: 3.4rem; padding: 0.5rem 0.75rem; resize: vertical; line-height: 1.5; }
select.field { appearance: none; background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='14' height='14' viewBox='0 0 24 24' fill='none' stroke='%23888' stroke-width='2'%3E%3Cpath d='m6 9 6 6 6-6'/%3E%3C/svg%3E"); background-repeat: no-repeat; background-position: right 0.6rem center; padding-right: 2rem; cursor: pointer; }
.scard-body .field:focus, .form-row .field:focus, .form-grid-2 .field:focus { border-color: var(--ring); box-shadow: 0 0 0 3px color-mix(in oklch, var(--ring) 30%, transparent); }

/* ── Super-admin rich pages ─────────────────────── */
.sa-input-suffix { position: relative; display: flex; align-items: center; }
.sa-input-suffix .field { width: 100%; height: 2.4rem; padding: 0 3rem 0 0.75rem; border-radius: calc(var(--radius) - 2px); border: 1px solid var(--input); background: var(--background); color: var(--foreground); font-size: 0.9rem; font-variant-numeric: tabular-nums; outline: none; }
.sa-input-suffix.sm .field { height: 2.1rem; padding-right: 2.7rem; font-size: 0.85rem; }
.sa-input-suffix .field:focus { border-color: var(--ring); box-shadow: 0 0 0 3px color-mix(in oklch, var(--ring) 30%, transparent); }
.sa-input-suffix .suffix { position: absolute; right: 0.6rem; font-size: 0.78rem; color: var(--muted-foreground); pointer-events: none; }
.sa-card-head { display: flex; align-items: center; gap: 0.5rem; }
.sa-card-head svg { width: 17px; height: 17px; color: var(--muted-foreground); }
.sa-card-head h3 { font-size: 1rem; font-weight: 600; margin: 0; }
.sa-card-sub { color: var(--muted-foreground); font-size: 0.82rem; margin: 0.3rem 0 1rem; }
.sa-section-head { display: flex; align-items: flex-start; justify-content: space-between; gap: 1rem; margin-bottom: 1rem; }
.sa-tier-head, .sa-tier-row { display: grid; grid-template-columns: 70px 1fr 1fr 1fr 90px; gap: 0.75rem; align-items: center; }
.sa-tier-head { font-size: 0.72rem; font-weight: 600; text-transform: uppercase; letter-spacing: 0.03em; color: var(--muted-foreground); padding-bottom: 0.6rem; border-bottom: 1px solid var(--border); }
.sa-tier-row { padding: 0.5rem 0; border-bottom: 1px solid var(--border); }
.sa-tier-row:last-child { border-bottom: none; }
.sa-tier-num { display: inline-grid; place-items: center; width: 1.7rem; height: 1.7rem; border-radius: 6px; background: var(--secondary); font-weight: 600; font-size: 0.8rem; }
.sa-pct { display: flex; align-items: center; gap: 0.35rem; }
.sa-pct span { color: var(--muted-foreground); font-size: 0.82rem; }
.ta-r { text-align: right; } .ta-c { text-align: center; }
.sa-sub-title { display: flex; align-items: center; gap: 0.5rem; font-weight: 600; font-size: 0.95rem; margin: 0 0 0.7rem; }
.sa-sub-title.mt { margin-top: 1.75rem; }
.sa-sub-title svg { width: 16px; height: 16px; color: var(--muted-foreground); }
.sa-sub-title.sa-muted-title { color: var(--muted-foreground); }
.sa-count { font-weight: 400; color: var(--muted-foreground); font-size: 0.85rem; }
.sa-table-wrap { overflow-x: auto; }
.sa-table { width: 100%; border-collapse: collapse; font-size: 0.85rem; }
.sa-table th { text-align: left; font-weight: 500; color: var(--muted-foreground); padding: 0.65rem 0.8rem; border-bottom: 1px solid var(--border); white-space: nowrap; font-size: 0.78rem; background: color-mix(in oklch, var(--muted) 40%, transparent); }
.sa-table td { padding: 0.6rem 0.8rem; border-bottom: 1px solid var(--border); vertical-align: middle; }
.sa-table tbody tr:last-child td { border-bottom: none; }
.sa-co-name { font-weight: 600; }
.sa-neg { color: var(--destructive); font-variant-numeric: tabular-nums; }
.sa-strong { font-weight: 600; font-variant-numeric: tabular-nums; }
.sa-muted { color: var(--muted-foreground); }
.sa-usage { font-variant-numeric: tabular-nums; }
.sa-usage .eq { color: var(--muted-foreground); font-size: 0.78rem; }
.sa-row-actions { display: inline-flex; gap: 0.25rem; justify-content: flex-end; }
.act-btn { display: inline-grid; place-items: center; width: 1.9rem; height: 1.9rem; border-radius: 6px; border: 1px solid var(--border); background: var(--background); color: var(--muted-foreground); cursor: pointer; }
.act-btn:hover { background: var(--accent); color: var(--foreground); }
.act-btn.danger:hover { color: var(--destructive); border-color: color-mix(in oklch, var(--destructive) 40%, transparent); }
.act-btn svg { width: 15px; height: 15px; }
.sa-assign { display: flex; gap: 0.5rem; }
.sa-monthnav, .sa-monthnav.sm { display: inline-flex; align-items: center; gap: 0.5rem; }
.sa-month { display: inline-flex; align-items: center; gap: 0.35rem; font-size: 0.85rem; font-weight: 500; white-space: nowrap; }
.sa-month svg { width: 14px; height: 14px; color: var(--muted-foreground); }
.sa-actions { display: flex; justify-content: flex-end; margin-top: 1.5rem; }
.sa-section { margin-top: 1.25rem; }
.icon-btn-bordered { display: inline-grid; place-items: center; width: 2.25rem; height: 2.25rem; border-radius: calc(var(--radius) - 2px); border: 1px solid var(--border); background: var(--background); color: var(--foreground); cursor: pointer; }
.icon-btn-bordered:hover { background: var(--accent); }
.icon-btn-bordered svg { width: 16px; height: 16px; }
.sa-grid-2 { display: grid; grid-template-columns: 1fr 1fr; gap: 1rem; }
.sa-grid-3 { display: grid; grid-template-columns: repeat(3, 1fr); gap: 0.75rem; }
.sa-pad { padding: 1.5rem; }

/* audit */
.sa-audit-filters { display: flex; align-items: flex-end; gap: 0.75rem; flex-wrap: wrap; margin-bottom: 1rem; }
.sa-filter { display: flex; flex-direction: column; gap: 0.3rem; }
.sa-filter label { font-size: 0.72rem; font-weight: 500; color: var(--muted-foreground); }
.sa-filter .field, .sa-audit-filters .search { height: 2.25rem; }
.search { position: relative; display: inline-flex; align-items: center; }
.search svg { position: absolute; left: 0.65rem; width: 15px; height: 15px; color: var(--muted-foreground); }
.search input { height: 2.25rem; padding: 0 0.75rem 0 2rem; border-radius: calc(var(--radius) - 2px); border: 1px solid var(--input); background: var(--background); color: var(--foreground); font-size: 0.85rem; outline: none; min-width: 220px; }
.search input:focus { border-color: var(--ring); box-shadow: 0 0 0 3px color-mix(in oklch, var(--ring) 30%, transparent); }
.sa-audit-row { cursor: pointer; }
.sa-audit-row:hover { background: color-mix(in oklch, var(--muted) 40%, transparent); }
.sa-chev { display: inline-flex; transition: transform 0.15s; color: var(--muted-foreground); }
.sa-chev.open { transform: rotate(90deg); }
.sa-chev svg { width: 15px; height: 15px; }
.sa-mono-sm { font-family: ui-monospace, SFMono-Regular, Menlo, monospace; font-size: 0.78rem; }
.sa-action { display: inline-block; padding: 0.1rem 0.5rem; border-radius: 999px; font-size: 0.72rem; font-weight: 500; background: var(--secondary); color: var(--secondary-foreground); }
.sa-action.blue { background: color-mix(in oklch, var(--blue) 15%, transparent); color: var(--blue); }
.sa-action.amber { background: color-mix(in oklch, var(--orange) 15%, transparent); color: var(--orange); }
.sa-action.green { background: color-mix(in oklch, var(--emerald) 15%, transparent); color: var(--emerald); }
.sa-action.purple { background: color-mix(in oklch, var(--violet) 15%, transparent); color: var(--violet); }
.sa-endpoint { font-family: ui-monospace, SFMono-Regular, Menlo, monospace; font-size: 0.78rem; color: var(--muted-foreground); }
.sa-method { font-weight: 700; color: var(--foreground); }
.sa-status { font-size: 0.76rem; font-weight: 600; }
.sa-status.ok { color: var(--emerald); } .sa-status.err { color: var(--destructive); }
.sa-audit-detail-row td { background: color-mix(in oklch, var(--muted) 35%, transparent); }
.sa-audit-detail { display: grid; grid-template-columns: repeat(2, 1fr); gap: 0.5rem 2rem; padding: 0.5rem 0; }
.sa-kv { display: flex; gap: 0.6rem; font-size: 0.82rem; }
.sa-kv.full { grid-column: 1 / -1; flex-direction: column; gap: 0.3rem; }
.sa-kv .k { color: var(--muted-foreground); min-width: 90px; }
.sa-json { background: var(--background); border: 1px solid var(--border); border-radius: 6px; padding: 0.6rem 0.8rem; font-size: 0.78rem; overflow-x: auto; margin: 0; }
.sa-empty { text-align: center; color: var(--muted-foreground); padding: 2rem; font-size: 0.88rem; }

/* breakdown modal */
.sa-breakdown { max-width: 760px; }
.sa-bd-head { display: flex; align-items: flex-start; justify-content: space-between; gap: 1rem; padding: 1.25rem 1.5rem 0.75rem; }
.sa-bd-head h2 { font-size: 1.1rem; margin: 0; font-weight: 600; }
.sa-bd-head .sub { color: var(--muted-foreground); font-size: 0.84rem; margin-top: 0.2rem; }
.sa-bd-actions { display: flex; gap: 0.5rem; }
.sa-bd-body { padding: 0.5rem 1.5rem 1.5rem; }
.sa-bd-summary { display: grid; grid-template-columns: repeat(4, 1fr); gap: 1rem; padding: 1rem; background: color-mix(in oklch, var(--muted) 45%, transparent); border-radius: var(--radius); margin-bottom: 1.25rem; }
.sa-bd-summary .k { font-size: 0.74rem; color: var(--muted-foreground); margin-bottom: 0.3rem; }
.sa-bd-summary .v.big { font-size: 1.25rem; font-weight: 700; }
.sa-bd-summary .v.green { color: var(--emerald); }
.sa-bd-note { display: block; font-size: 0.68rem; font-weight: 400; color: var(--muted-foreground); margin-top: 0.2rem; }
.sa-bd-monthnav { display: flex; align-items: center; justify-content: center; gap: 1rem; margin-bottom: 1.25rem; }
.sa-bd-bdtitle { font-size: 0.95rem; margin: 0 0 0.6rem; }
.badge-soft { background: var(--secondary); color: var(--secondary-foreground); padding: 0.1rem 0.5rem; border-radius: 6px; font-size: 0.74rem; font-weight: 500; }

/* whatsapp templates */
.sa-tpl-list { display: flex; flex-direction: column; gap: 1rem; }
.sa-tpl-head { display: flex; align-items: center; justify-content: space-between; gap: 1rem; margin-bottom: 1rem; flex-wrap: wrap; }
.sa-tpl-name { font-weight: 600; font-size: 0.95rem; font-family: ui-monospace, SFMono-Regular, Menlo, monospace; }
.sa-tpl-meta { font-size: 0.76rem; color: var(--muted-foreground); display: flex; align-items: center; gap: 0.5rem; }
.sa-approved { background: color-mix(in oklch, var(--emerald) 15%, transparent); color: var(--emerald); padding: 0.05rem 0.45rem; border-radius: 999px; font-size: 0.66rem; font-weight: 600; letter-spacing: 0.03em; }
.sa-tpl-block { margin-bottom: 0.9rem; }
.sa-tpl-label { font-size: 0.74rem; font-weight: 600; color: var(--muted-foreground); margin-bottom: 0.4rem; }
.sa-var-chips { display: flex; flex-wrap: wrap; gap: 0.5rem; }
.sa-var-chip { font-size: 0.74rem; color: var(--muted-foreground); background: var(--muted); border: 1px solid var(--border); border-radius: 6px; padding: 0.2rem 0.5rem; }
.sa-var-chip code { font-weight: 700; color: var(--foreground); }
.sa-tpl-body { white-space: pre-wrap; font-size: 0.86rem; line-height: 1.55; background: var(--muted); border: 1px solid var(--border); border-radius: 8px; padding: 0.8rem 0.9rem; cursor: text; }
.sa-tpl-var { background: color-mix(in oklch, var(--primary) 12%, transparent); border: 1px solid color-mix(in oklch, var(--primary) 25%, transparent); color: var(--primary); border-radius: 4px; padding: 0 0.3rem; font-family: ui-monospace, SFMono-Regular, Menlo, monospace; font-size: 0.8rem; font-weight: 600; }
.sa-tpl-edit { width: 100%; font-family: ui-monospace, SFMono-Regular, Menlo, monospace; font-size: 0.84rem; }
.sa-tpl-foot { display: flex; justify-content: flex-end; }
.sa-rt-title, .sa-rt-card .sa-rt-head { font-weight: 600; }
.sa-rt-card { border: 1px solid var(--border); border-radius: var(--radius); padding: 1rem; max-width: 360px; margin-top: 0.8rem; }
.sa-rt-head { display: flex; align-items: center; gap: 0.5rem; margin-bottom: 0.3rem; }
.sa-rt-ico { display: inline-grid; place-items: center; width: 1.8rem; height: 1.8rem; border-radius: 6px; background: var(--secondary); }
.sa-rt-ico svg { width: 15px; height: 15px; }
.sa-rt-title { font-size: 1rem; margin: 0 0 0.3rem; }
@media (max-width: 820px) { .sa-grid-2, .sa-grid-3, .sa-bd-summary { grid-template-columns: 1fr; } }

/* ── Welcome page ─────────────────────────────────────────── */
.welcome-video { position: relative; padding: 0; overflow: hidden; cursor: pointer; aspect-ratio: 16 / 7; margin-bottom: 1.5rem;
  background: linear-gradient(135deg, oklch(0.28 0.03 265) 0%, oklch(0.18 0.02 265) 100%); border: 1px solid var(--border); }
.welcome-video-inner { position: absolute; inset: 0; display: flex; align-items: flex-end; padding: 1.5rem; }
.welcome-play { position: absolute; top: 50%; left: 50%; transform: translate(-50%, -50%); width: 68px; height: 68px; border-radius: 999px;
  border: none; background: rgba(255,255,255,0.95); color: oklch(0.2 0 0); display: grid; place-items: center; cursor: pointer;
  box-shadow: 0 8px 30px rgba(0,0,0,0.35); transition: transform 0.15s ease; }
.welcome-play:hover { transform: translate(-50%, -50%) scale(1.06); }
.welcome-play svg { margin-left: 3px; }
.welcome-video-meta { color: #fff; }
.welcome-video-title { font-size: 1.05rem; font-weight: 600; }
.welcome-video-sub { font-size: 0.82rem; opacity: 0.7; margin-top: 2px; }
.welcome-video-playing { color: #fff; display: flex; align-items: center; gap: 0.5rem; font-size: 0.9rem; margin: auto; opacity: 0.9; }

.welcome-steps-head { display: flex; align-items: baseline; justify-content: space-between; margin: 0 0 0.85rem; }
.welcome-steps-head h3 { font-size: 1.05rem; font-weight: 600; margin: 0; }
.welcome-steps-head span { font-size: 0.8rem; color: var(--muted-foreground); }
.welcome-steps { display: flex; flex-direction: column; gap: 0.6rem; }
.welcome-step { border: 1px solid var(--border); border-radius: var(--radius); background: var(--card); overflow: hidden; transition: border-color 0.15s ease; }
.welcome-step.open { border-color: var(--ring); }
.welcome-step-head { width: 100%; display: flex; align-items: center; gap: 0.85rem; padding: 0.9rem 1.1rem; background: none; border: none; cursor: pointer; text-align: left; color: inherit; }
.welcome-step-no { font-size: 0.78rem; font-weight: 600; color: var(--muted-foreground); font-variant-numeric: tabular-nums; }
.welcome-step-ico { display: grid; place-items: center; width: 2rem; height: 2rem; border-radius: 7px; background: var(--secondary); color: var(--foreground); flex-shrink: 0; }
.welcome-step-title { flex: 1; font-weight: 600; font-size: 0.95rem; }
.welcome-step-chev { color: var(--muted-foreground); display: grid; place-items: center; transition: transform 0.2s ease; }
.welcome-step-chev.up { transform: rotate(180deg); }
.welcome-step-body { padding: 0 1.1rem 1.1rem 4rem; }
.welcome-step-body p { margin: 0 0 0.7rem; color: var(--muted-foreground); font-size: 0.9rem; line-height: 1.5; max-width: 60ch; }
.welcome-step-body ul { list-style: none; margin: 0 0 0.95rem; padding: 0; display: flex; flex-direction: column; gap: 0.45rem; }
.welcome-step-body li { display: flex; align-items: flex-start; gap: 0.55rem; font-size: 0.88rem; }
.welcome-step-body li svg { color: oklch(0.55 0.14 150); margin-top: 2px; flex-shrink: 0; }
@media (max-width: 640px) { .welcome-step-body { padding-left: 1.1rem; } }

.welcome-cta { display: flex; align-items: center; justify-content: space-between; gap: 1.25rem; flex-wrap: wrap;
  margin-top: 1.1rem; padding: 1.1rem 1.3rem; border: 1px solid var(--border); border-radius: var(--radius);
  background: var(--secondary); }
.welcome-cta-title { font-size: 1rem; font-weight: 600; margin-bottom: 0.2rem; }
.welcome-cta-sub { font-size: 0.85rem; color: var(--muted-foreground); max-width: 52ch; line-height: 1.5; }

.whatsnew-list { display: flex; flex-direction: column; gap: 0.75rem; }
.welcome-jump:hover { background: var(--secondary); }
.whatsnew-item { display: grid; grid-template-columns: 9rem 1fr; gap: 1rem; padding: 1.05rem 1.25rem; }
.whatsnew-meta { display: flex; flex-direction: column; gap: 0.4rem; align-items: flex-start; }
.whatsnew-tag { font-size: 0.72rem; font-weight: 600; padding: 0.15rem 0.55rem; border-radius: 999px; }
.whatsnew-tag.tone-new { background: oklch(0.95 0.05 150); color: oklch(0.45 0.14 150); }
.whatsnew-tag.tone-improved { background: oklch(0.95 0.04 250); color: oklch(0.45 0.14 250); }
.whatsnew-tag.tone-fixed { background: var(--secondary); color: var(--muted-foreground); }
.whatsnew-date { font-size: 0.78rem; color: var(--muted-foreground); font-variant-numeric: tabular-nums; }
.whatsnew-title { font-size: 0.98rem; font-weight: 600; margin-bottom: 0.3rem; }
.whatsnew-body p { margin: 0; color: var(--muted-foreground); font-size: 0.9rem; line-height: 1.55; max-width: 70ch; }
.whatsnew-toggle { display: inline-flex; align-items: center; gap: 5px; margin-top: 0.7rem; padding: 0; background: none; border: none; color: var(--foreground); font: inherit; font-size: 0.85rem; font-weight: 600; cursor: pointer; }
.whatsnew-toggle:hover { text-decoration: underline; }
.whatsnew-toggle .chev { display: inline-flex; transition: transform 0.2s ease; }
.whatsnew-item.open .whatsnew-toggle .chev { transform: rotate(180deg); }
.whatsnew-more { overflow: hidden; }
.whatsnew-more-inner { margin-top: 0.85rem; padding-top: 0.85rem; border-top: 1px solid var(--border); }
.whatsnew-more-inner p { margin: 0 0 0.65rem; }
.whatsnew-more-inner ul { margin: 0; padding-left: 1.05rem; display: flex; flex-direction: column; gap: 0.4rem; }
.whatsnew-more-inner li { color: var(--muted-foreground); font-size: 0.88rem; line-height: 1.5; max-width: 70ch; }
@media (max-width: 640px) { .whatsnew-item { grid-template-columns: 1fr; gap: 0.5rem; } .whatsnew-meta { flex-direction: row; align-items: center; gap: 0.6rem; } }
.wn-filter { display: flex; flex-direction: column; gap: 2px; }
.wn-filter-btn { display: flex; align-items: center; justify-content: space-between; gap: 8px; width: 100%; padding: 7px 10px; background: none; border: none; border-radius: var(--radius); cursor: pointer; color: var(--muted-foreground); text-align: left; font: inherit; font-size: 0.84rem; font-weight: 500; transition: background .12s, color .12s; }
.wn-filter-btn:hover { background: var(--accent); color: var(--foreground); }
.wn-filter-btn.on { background: var(--secondary); color: var(--foreground); font-weight: 600; }
.wn-filter-n { font-size: 0.72rem; font-weight: 600; color: var(--muted-foreground); background: var(--secondary); border-radius: 999px; min-width: 20px; text-align: center; padding: 1px 6px; }
.wn-filter-btn.on .wn-filter-n { background: var(--background); }

.onb-f { display: flex; flex-direction: column; gap: 0.35rem; font-size: 0.82rem; font-weight: 500; }
.onb-f .field { width: 100%; }

/* Welcome animated mini-mockups */
.welcome-demo { border: 1px solid var(--border); border-radius: 9px; overflow: hidden; background: var(--card); margin-bottom: 0.95rem; max-width: 420px; box-shadow: 0 1px 3px rgba(0,0,0,0.05); }
.wd-bar { display: flex; gap: 5px; padding: 7px 9px; background: var(--secondary); border-bottom: 1px solid var(--border); }
.wd-bar span { width: 8px; height: 8px; border-radius: 999px; background: var(--muted-foreground); opacity: 0.4; }
.wd-screen { padding: 11px; min-height: 110px; display: flex; flex-direction: column; gap: 7px; }
.wd-row { display: flex; align-items: center; gap: 8px; padding: 7px 9px; border: 1px solid var(--border); border-radius: 7px; font-size: 0.8rem;
  opacity: 0; transform: translateY(6px); animation: wdIn 0.45s ease forwards; }
@keyframes wdIn { to { opacity: 1; transform: none; } }
.wd-ico, .wd-av { display: grid; place-items: center; width: 22px; height: 22px; border-radius: 6px; background: var(--secondary); flex-shrink: 0; font-size: 0.7rem; font-weight: 600; }
.wd-row-t { flex: 1; font-weight: 500; }
.wd-row-n, .wd-badge { font-size: 0.72rem; color: var(--muted-foreground); }
.wd-badge { padding: 2px 7px; border-radius: 999px; background: var(--secondary); }
/* chat */
.wd-chat .wd-screen { gap: 6px; }
.wd-msg { max-width: 78%; padding: 7px 10px; border-radius: 11px; font-size: 0.78rem; line-height: 1.3; opacity: 0; animation: wdIn 0.4s ease forwards; }
.wd-msg.in { align-self: flex-start; background: var(--secondary); border-bottom-left-radius: 3px; }
.wd-lang { align-self: flex-start; font-size: 0.66rem; color: var(--muted-foreground); opacity: 0; animation: wdIn 0.4s ease 0.5s forwards; }
.wd-msg.out { align-self: flex-end; background: oklch(0.45 0.13 255); color: #fff; border-bottom-right-radius: 3px; }
.wd-msg.out:not(.wd-msg-final) { animation: wdIn 0.3s ease 0.9s forwards, wdHide 0.1s linear 2s forwards; }
.wd-msg-final { animation: wdIn 0.4s ease 2s forwards; }
@keyframes wdHide { to { display: none; opacity: 0; height: 0; padding: 0; margin: 0; } }
.wd-typing { display: inline-flex; gap: 3px; }
.wd-typing i { width: 5px; height: 5px; border-radius: 999px; background: rgba(255,255,255,0.8); animation: wdBlink 1s infinite; }
.wd-typing i:nth-child(2) { animation-delay: 0.15s; } .wd-typing i:nth-child(3) { animation-delay: 0.3s; }
@keyframes wdBlink { 0%, 60%, 100% { opacity: 0.3; } 30% { opacity: 1; } }
/* kanban */
.wd-kanban .wd-screen { display: grid; grid-template-columns: repeat(3, 1fr); gap: 6px; align-content: start; }
.wd-col-h { font-size: 0.68rem; font-weight: 600; color: var(--muted-foreground); text-align: center; padding-bottom: 3px; border-bottom: 2px solid var(--border); }
.wd-ticket { grid-row: 2; display: flex; align-items: center; gap: 5px; padding: 7px; border: 1px solid var(--border); border-radius: 7px; font-size: 0.72rem; background: var(--card);
  grid-column: 1; animation: wdSlide 4s ease-in-out infinite; }
@keyframes wdSlide { 0%, 15% { grid-column: 1; transform: none; } 45%, 60% { grid-column: 2; } 90%, 100% { grid-column: 3; } }
/* toggle */
.wd-toggle { width: 30px; height: 17px; border-radius: 999px; background: var(--border); position: relative; transition: background 0.3s; }
.wd-toggle i { position: absolute; top: 2px; left: 2px; width: 13px; height: 13px; border-radius: 999px; background: #fff; transition: left 0.3s; box-shadow: 0 1px 2px rgba(0,0,0,0.3); }
.wd-toggle.on { background: oklch(0.55 0.14 150); } .wd-toggle.on i { left: 15px; }

/* ============================================================
   Ported pages (To-Dos, Users, Billing, Audit, Help, Account)
   ============================================================ */
.ml-auto { margin-left: auto; }
.live-dot { display: inline-flex; align-items: center; gap: 5px; font-size: 0.75rem; font-weight: 600; color: oklch(0.55 0.14 150); vertical-align: middle; }
.live-dot > span:first-child { width: 7px; height: 7px; border-radius: 999px; background: oklch(0.6 0.16 150); }
.empty-row { display: flex; align-items: center; justify-content: center; gap: 8px; padding: 28px; color: var(--muted-foreground); font-size: 0.9rem; }
.status-badge { display: inline-flex; align-items: center; gap: var(--sp-2); }
.status-badge-dot { width: 6px; height: 6px; border-radius: 999px; background: currentColor; flex-shrink: 0; }
/* ── Tenant Management ──────────────────────────────── */
.tn-group { padding: 0; overflow: hidden; }
.tn-group-head { display: flex; align-items: center; gap: 8px; padding: 13px 16px; cursor: pointer; border-bottom: 1px solid var(--border); }
.tn-group-head:hover { background: color-mix(in oklch, var(--muted) 35%, transparent); }
.tn-chev { display: inline-flex; color: var(--muted-foreground); }
.tn-group-name { font-weight: 600; font-size: 0.95rem; }
.tn-group-spacer { flex: 1; }
.tn-group-meta { font-size: 0.78rem; font-weight: 600; color: var(--muted-foreground); background: var(--secondary); border: 1px solid var(--border); border-radius: 999px; padding: 2px 10px; font-variant-numeric: tabular-nums; }
.tn-table th, .tn-table td { white-space: nowrap; }
.tn-rating { display: inline-flex; align-items: center; gap: 3px; }
.tn-star { width: 9px; height: 9px; border-radius: 999px; border: 1.5px solid color-mix(in oklch, var(--muted-foreground) 55%, transparent); box-sizing: border-box; }
.tn-star.on { background: var(--emerald); border-color: var(--emerald); }
.tn-rating-num { font-size: 0.74rem; color: var(--muted-foreground); margin-left: 5px; font-variant-numeric: tabular-nums; }
.tn-notes { display: inline-flex; align-items: center; gap: 5px; color: var(--muted-foreground); }
.tn-table .tn-unit-row td { background: color-mix(in oklch, var(--muted) 40%, transparent); padding-top: 7px; padding-bottom: 7px; }
.tn-unit-name { font-weight: 600; font-size: 0.82rem; }
.tn-unit-badge { margin-left: 8px; }
.tn-table .tn-unit-row:hover td { background: color-mix(in oklch, var(--muted) 40%, transparent); }
.tn-chev.sm { display: inline-flex; color: var(--muted-foreground); flex-shrink: 0; }
.tn-trow.expanded td { background: var(--accent); }
.tn-detail-row td { background: color-mix(in oklch, var(--muted) 28%, var(--background)); padding: 14px 16px 16px; }
.tn-detail { display: flex; gap: 28px; flex-wrap: wrap; }
.tn-detail-col { min-width: 180px; }
.tn-detail-h { font-size: 0.68rem; font-weight: 700; letter-spacing: 0.04em; text-transform: uppercase; color: var(--muted-foreground); margin-bottom: 8px; overflow-wrap: anywhere; }
.tn-detail-kv { display: flex; align-items: center; gap: 7px; font-size: 0.84rem; margin-bottom: 5px; }
.tn-detail-kv svg { color: var(--muted-foreground); flex-shrink: 0; }
.tn-hist { display: flex; gap: 9px; padding: 5px 0; }
.tn-hist-dot { width: 8px; height: 8px; border-radius: 999px; border: 1.5px solid var(--muted-foreground); box-sizing: border-box; margin-top: 5px; flex-shrink: 0; }
.tn-hist-dot.current { background: var(--emerald); border-color: var(--emerald); }
.tn-hist-unit { font-size: 0.84rem; font-weight: 500; }
.tn-hist-dates { font-size: 0.76rem; color: var(--muted-foreground); font-variant-numeric: tabular-nums; }
.tn-hist-tag { font-size: 0.66rem; font-weight: 600; color: var(--orange); background: color-mix(in oklch, var(--orange) 14%, transparent); border-radius: 999px; padding: 1px 7px; margin: 2px 0; display: inline-block; }
.tn-tk { display: flex; gap: 9px; padding: 5px 0; }
.tn-tk-dot { width: 8px; height: 8px; border-radius: 999px; background: var(--blue); margin-top: 6px; flex-shrink: 0; }
.tn-tk-title-link { display: block; font-size: 0.84rem; font-weight: 500; color: var(--foreground); background: none; border: none; padding: 0; text-align: left; cursor: pointer; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; max-width: 100%; }
.tn-tk-title-link:hover { color: var(--blue); text-decoration: underline; }
.tn-tk-tags { display: flex; flex-wrap: wrap; gap: 5px; margin-top: 4px; }
.tn-tk-tags .badge { font-size: 0.66rem; }
.tn-tk-date { font-size: 0.66rem; color: var(--muted-foreground); align-self: center; font-variant-numeric: tabular-nums; }
.tn-rating-btn { display: inline-flex; align-items: center; gap: 6px; background: none; border: none; padding: 2px 4px; margin: -2px -4px; border-radius: 6px; cursor: pointer; font: inherit; color: inherit; }
.tn-rating-btn:hover { background: var(--accent); }
.tn-rating-detail { padding: 2px 0; }
.tn-rf-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(220px, 100%), 1fr)); gap: 8px 28px; margin-top: 10px; }
.tn-rf { display: grid; grid-template-columns: minmax(0, 140px) minmax(0, 1fr); align-items: start; gap: 12px; min-height: 30px; }
.tn-rf-label { font-size: 0.84rem; overflow-wrap: anywhere; align-self: center; }
.tn-rsplit { display: grid; grid-template-columns: 1fr 1fr; gap: 28px; padding: 4px 0 2px; }
.tn-rcol { min-width: 0; overflow-wrap: anywhere; }
.tn-rf-grid.one { grid-template-columns: 1fr; gap: 10px; }
.tn-pm-stars { display: flex; align-items: center; gap: 7px; margin-top: 10px; }
.tn-pm-star { width: 22px; height: 22px; border-radius: 6px; border: 1px solid var(--input); background: var(--background); cursor: pointer; position: relative; }
.tn-pm-star::after { content: "★"; position: absolute; inset: 0; display: grid; place-items: center; font-size: 13px; color: color-mix(in oklch, var(--muted-foreground) 45%, transparent); }
.tn-pm-star.on { border-color: var(--emerald); background: color-mix(in oklch, var(--emerald) 14%, transparent); }
.tn-pm-star.on::after { color: var(--emerald); }
.tn-pm-star.sm { width: 18px; height: 18px; border-radius: 5px; }
.tn-pm-star.sm::after { font-size: 11px; }
.tn-pm-clear { margin-left: 6px; background: none; border: none; color: var(--muted-foreground); font: inherit; font-size: 0.78rem; cursor: pointer; }
.tn-pm-clear:hover { color: var(--foreground); text-decoration: underline; }
@media (max-width: 720px) { .tn-rsplit { grid-template-columns: 1fr; gap: 16px; } }
.tn-notes-btn { display: inline-flex; align-items: center; gap: 6px; background: none; border: none; padding: 2px 4px; margin: -2px -4px; border-radius: 6px; cursor: pointer; font: inherit; color: inherit; }
.tn-notes-btn:hover { background: var(--accent); }
.tn-notes-detail { padding: 2px 0; max-width: 720px; }
.tn-note-list { display: flex; flex-direction: column; gap: 8px; margin: 10px 0; }
.tn-note { border: 1px solid var(--border); border-radius: 10px; padding: 9px 12px; background: var(--card); }
.tn-note-meta { font-size: 0.72rem; color: var(--muted-foreground); margin-bottom: 3px; }
.tn-note-body { font-size: 0.86rem; line-height: 1.45; }
.tn-note-add { display: flex; gap: 8px; align-items: flex-start; }
.tn-note-add .field { flex: 1; min-height: 2.4rem; }
.bulk-bar { display: flex; align-items: center; gap: 12px; padding: 10px 14px; border-bottom: 1px solid var(--border); background: color-mix(in oklch, var(--primary) 8%, var(--background)); }

/* To-Dos */
.todo-counter { font-size: 0.85rem; color: var(--muted-foreground); white-space: nowrap; }
.todo-cat-list { display: flex; flex-direction: column; gap: 1px; border-top: 1px solid var(--border); padding-top: 10px; }
.todo-cat-row { display: flex; align-items: center; gap: 9px; padding: 5px 2px; font-size: 0.82rem; }
.todo-cat-ico { display: grid; place-items: center; width: 24px; height: 24px; border-radius: 7px; background: var(--secondary); color: var(--foreground); flex-shrink: 0; }
.todo-cat-name { flex: 1; min-width: 0; color: var(--muted-foreground); }
.todo-cat-n { font-weight: 700; font-size: 0.82rem; }
.kanban { display: flex; align-items: flex-start; gap: 16px; overflow-x: auto; padding-bottom: 10px; }
.kcol { flex: 1 1 300px; min-width: 270px; max-width: 520px; width: auto; border: 1px solid var(--border); border-radius: 14px; background: color-mix(in oklch, var(--muted) 26%, var(--background)); display: flex; flex-direction: column; min-height: 200px; overflow: hidden; }
.kcol-head { display: flex; align-items: center; gap: 8px; justify-content: space-between; padding: 13px 15px 11px; border-bottom: 1px solid color-mix(in oklch, var(--border) 70%, transparent); }
.kcol-collapse { display: inline-flex; align-items: center; justify-content: center; width: 22px; height: 22px; border: none; background: none; color: var(--muted-foreground); border-radius: 6px; cursor: pointer; flex-shrink: 0; }
.kcol-collapse:hover { background: var(--card); color: var(--foreground); }
.kcol-title { font-weight: 600; font-size: 0.9rem; flex: 1; min-width: 0; display: flex; align-items: center; gap: 8px; letter-spacing: -0.01em; }
.kcol-count { font-size: 0.72rem; font-weight: 700; color: var(--muted-foreground); background: var(--card); border: 1px solid var(--border); border-radius: 999px; padding: 2px 9px; flex-shrink: 0; font-variant-numeric: tabular-nums; }
.kcol-body { display: flex; flex-direction: column; gap: 10px; padding: 12px; }
.kcol .def-stage-dot { width: 9px; height: 9px; box-shadow: 0 0 0 3px color-mix(in oklch, currentColor 0%, transparent); }
/* Collapsed: column shrinks to a vertical rail but stays in the board,
   keeping kanban context. Click the rail or the chevron to expand. */
.kanban .kcol.collapsed { flex: 0 0 46px; width: 46px; min-width: 46px; max-width: 46px; cursor: pointer; }
.kcol.collapsed .kcol-head { flex-direction: column; align-items: center; gap: 10px; height: 100%; padding: 10px 6px; }
.kcol.collapsed .kcol-title { writing-mode: vertical-rl; transform: rotate(180deg); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; max-height: 100%; }
.kcol-empty { display: flex; flex-direction: column; align-items: center; gap: 6px; padding: 24px 0; color: var(--muted-foreground); font-size: 0.82rem; }
.todo-bcard { border: 1px solid var(--border); border-radius: 10px; background: var(--card); padding: 13px 14px; cursor: pointer; transition: border-color 0.12s, box-shadow 0.12s; text-align: left; }
.todo-bcard:hover { border-color: var(--muted-foreground); box-shadow: 0 4px 14px rgba(0,0,0,0.06); }
.todo-bcard.urgent { border-left: 3px solid var(--destructive); }
.todo-ico { display: grid; place-items: center; width: 28px; height: 28px; border-radius: 7px; background: var(--secondary); color: var(--foreground); flex-shrink: 0; }
.todo-ico.sm { width: 22px; height: 22px; }
.todo-cat { font-size: 0.72rem; font-weight: 600; letter-spacing: 0.02em; text-transform: uppercase; color: var(--muted-foreground); }
.todo-title { font-weight: 600; font-size: 0.92rem; margin: 2px 0 5px; line-height: 1.35; }
.todo-context { font-size: 0.83rem; color: var(--muted-foreground); line-height: 1.5; }
.todo-meta { display: flex; flex-wrap: wrap; gap: 12px; margin-top: 9px; font-size: 0.78rem; color: var(--muted-foreground); }
.todo-meta span { display: inline-flex; align-items: center; gap: 5px; }
.todo-note { display: flex; gap: 10px; padding: 12px 14px; border-radius: 10px; background: oklch(0.96 0.04 75); color: oklch(0.45 0.1 60); margin-bottom: 14px; font-size: 0.85rem; line-height: 1.5; }
.todo-note strong { display: block; margin-bottom: 2px; }
.td-grid { display: flex; flex-direction: column; gap: 1px; background: var(--border); border: 1px solid var(--border); border-radius: 10px; overflow: hidden; }
.td-row { display: flex; justify-content: space-between; gap: 16px; padding: 10px 14px; background: var(--card); font-size: 0.85rem; }
.td-row .k { color: var(--muted-foreground); }
.td-row .v { font-weight: 500; text-align: right; }

/* stat cards + avatar + tables */
.stat-row { display: grid; grid-template-columns: repeat(3, 1fr); gap: 14px; margin-bottom: 18px; }
.stat-card { border: 1px solid var(--border); border-radius: var(--radius); background: var(--card); padding: 16px 18px; }
.stat-n { font-size: 1.6rem; font-weight: 700; line-height: 1; }
.stat-l { font-size: 0.82rem; color: var(--muted-foreground); margin-top: 6px; }
.avatar { display: grid; place-items: center; width: 34px; height: 34px; border-radius: 999px; background: var(--foreground); color: var(--background); font-size: 0.75rem; font-weight: 600; flex-shrink: 0; }
.avatar.lg { width: 56px; height: 56px; font-size: 1.05rem; }
.table-card { padding: 0; overflow: hidden; }
.table-card .table-scroll { padding: 0; }
.chip-check { display: inline-flex; align-items: center; gap: 7px; padding: 6px 11px; border: 1px solid var(--border); border-radius: 999px; font-size: 0.82rem; cursor: pointer; }
.chip-check.on { border-color: var(--primary); background: var(--secondary); }

/* billing */
.banner-info { display: flex; align-items: center; gap: 9px; padding: 12px 15px; border: 1px solid var(--border); border-radius: var(--radius); background: var(--secondary); font-size: 0.86rem; margin-bottom: 16px; }
.pay-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.pay-opt { text-align: left; border: 1.5px solid var(--border); border-radius: 12px; padding: 15px 16px; background: var(--card); cursor: pointer; transition: border-color 0.12s; }
.pay-opt:hover { border-color: var(--muted-foreground); }
.pay-opt.on { border-color: var(--primary); background: var(--secondary); }
.pay-opt p { margin: 6px 0 0; font-size: 0.82rem; color: var(--muted-foreground); }
.est-rows { display: flex; flex-direction: column; }
.est-row { display: flex; justify-content: space-between; gap: 16px; padding: 11px 0; border-bottom: 1px solid var(--border); font-size: 0.9rem; }
.est-row.muted { color: var(--muted-foreground); }
.est-row.total { border-bottom: none; font-weight: 700; font-size: 1.05rem; padding-top: 14px; }

/* audit chips */
.chip-row { display: flex; flex-wrap: wrap; gap: 8px; margin-bottom: 16px; }
.filter-chip { padding: 6px 13px; border: 1px solid var(--border); border-radius: 999px; background: var(--card); font-size: 0.82rem; color: var(--muted-foreground); cursor: pointer; }
.filter-chip.on { background: var(--primary); color: var(--primary-foreground); border-color: var(--primary); }

/* help */
.help-cards { display: grid; grid-template-columns: repeat(auto-fit, minmax(190px, 1fr)); gap: 14px; margin-bottom: 18px; }
.help-card .help-ico { display: grid; place-items: center; width: 38px; height: 38px; border-radius: 10px; background: var(--secondary); color: var(--foreground); margin-bottom: 10px; }
.help-aside-card { text-align: left; }
.help-aside-spark { width: 40px; height: 40px; border-radius: 12px; background: var(--primary); color: var(--primary-foreground); display: grid; place-items: center; font-weight: 800; font-size: 1.1rem; }
.help-links { display: flex; flex-direction: column; gap: 4px; }
.help-link { display: flex; align-items: center; gap: 11px; width: 100%; padding: 9px 8px; background: none; border: none; border-radius: var(--radius); cursor: pointer; color: var(--foreground); text-align: left; font: inherit; transition: background .12s; }
.help-link:hover { background: var(--accent); }
.help-link-ico { display: grid; place-items: center; width: 30px; height: 30px; border-radius: 8px; background: var(--secondary); flex-shrink: 0; }
.help-link-tx { display: flex; flex-direction: column; line-height: 1.3; flex: 1; min-width: 0; }
.help-link-tx strong { font-size: 0.84rem; }
.help-link-tx span { font-size: 0.74rem; color: var(--muted-foreground); }
.help-link > svg:last-child { color: var(--muted-foreground); flex-shrink: 0; }
.acct-nav { display: flex; flex-direction: column; gap: 2px; }
.acct-nav-label { font-size: 0.7rem; font-weight: 700; letter-spacing: 0.06em; text-transform: uppercase; color: var(--muted-foreground); padding: 4px 10px 8px; }
.acct-nav-item { display: flex; align-items: center; gap: 9px; width: 100%; padding: 8px 10px; background: none; border: none; border-radius: var(--radius); cursor: pointer; color: var(--muted-foreground); text-align: left; font: inherit; font-size: 0.84rem; font-weight: 500; transition: background .12s, color .12s; }
.acct-nav-item:hover { background: var(--accent); color: var(--foreground); }
.acct-nav-item > svg { flex-shrink: 0; }
.faq-list { display: flex; flex-direction: column; }
.faq { border-bottom: 1px solid var(--border); }
.faq:last-child { border-bottom: none; }
.faq-q { width: 100%; display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 14px 2px; background: none; border: none; cursor: pointer; color: inherit; font-size: 0.92rem; font-weight: 500; text-align: left; }
.faq-q svg { transition: transform 0.2s; flex-shrink: 0; color: var(--muted-foreground); }
.faq-q svg.rot { transform: rotate(180deg); }
.faq-a { padding: 0 2px 16px; font-size: 0.87rem; color: var(--muted-foreground); line-height: 1.6; max-width: 70ch; }

/* inline wizard rail */
.iw-rail { position: fixed; top: 72px; right: 20px; width: 332px; max-height: calc(100vh - 96px); z-index: 90; overflow-y: auto;
  background: var(--card); border: 1px solid var(--border); border-radius: 16px; box-shadow: 0 12px 34px rgba(0,0,0,0.18); padding: 16px 18px 14px; }
.iw-head { display: flex; align-items: center; justify-content: space-between; margin-bottom: 8px; }
.iw-eyebrow { display: inline-flex; align-items: center; gap: 6px; font-size: 0.7rem; font-weight: 700; letter-spacing: 0.05em; text-transform: uppercase; color: var(--primary); }
.iw-title { margin: 0 0 10px; font-size: 1rem; font-weight: 700; }
.iw-prog { display: flex; align-items: center; gap: 9px; margin-bottom: 14px; }
.iw-prog-bar { flex: 1; height: 5px; background: var(--secondary); border-radius: 999px; overflow: hidden; }
.iw-prog-bar > div { height: 100%; background: var(--primary); border-radius: 999px; transition: width 0.25s ease; }
.iw-prog > span { font-size: 0.72rem; font-weight: 600; color: var(--muted-foreground); white-space: nowrap; }
.iw-step-title { font-size: 0.9rem; font-weight: 700; margin-bottom: 6px; }
.iw-step-desc { margin: 0 0 12px; font-size: 0.84rem; line-height: 1.55; color: var(--muted-foreground); }
.iw-hint { display: inline-flex; align-items: center; gap: 6px; font-size: 0.76rem; background: var(--secondary); color: var(--primary); border-radius: 999px; padding: 4px 10px; margin-bottom: 12px; }
.iw-tips { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 8px; }
.iw-tips li { display: flex; align-items: flex-start; gap: 8px; font-size: 0.8rem; line-height: 1.45; color: var(--muted-foreground); }
.iw-tips li svg { color: oklch(0.55 0.14 150); flex-shrink: 0; margin-top: 2px; }
.iw-foot { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-top: 16px; padding-top: 14px; border-top: 1px solid var(--border); }
.iw-dots { display: flex; gap: 6px; }
.iw-dots span { width: 7px; height: 7px; border-radius: 50%; background: var(--border); cursor: pointer; }
.iw-dots span.on { background: var(--primary); }
@media (max-width: 760px) { .iw-rail { left: 16px; right: 16px; width: auto; top: auto; bottom: 16px; max-height: 56vh; } .stat-row, .help-cards, .pay-grid { grid-template-columns: 1fr; } }

/* ── Properties: status switch ─────────────────────── */
.status-switch { display: inline-flex; border: 1px solid var(--border); border-radius: calc(var(--radius) - 2px); overflow: hidden; background: var(--background); }
.status-switch .ss-seg { appearance: none; border: none; background: transparent; padding: 5px 10px; font-size: 0.74rem; font-weight: 600; color: var(--muted-foreground); cursor: pointer; border-right: 1px solid var(--border); transition: background 0.12s, color 0.12s; display: inline-flex; align-items: center; gap: 3px; }
.status-switch .ss-seg:last-child { border-right: none; }
/* Clickable (not current, not disabled) segments read as actionable buttons */
.status-switch .ss-seg.actionable { color: var(--foreground); background: color-mix(in oklch, var(--accent) 55%, transparent); }
.status-switch .ss-seg .ss-arrow { font-size: 0.85em; opacity: 0; max-width: 0; overflow: hidden; transition: opacity 0.12s, max-width 0.12s; }
.status-switch .ss-seg.actionable:hover { color: #fff; }
.status-switch .ss-seg.actionable:hover .ss-arrow { opacity: 1; max-width: 1.2em; }
/* On hover, preview the colour the property will become (by segment position) */
.status-switch .ss-seg.actionable:nth-child(1):hover { background: #71717a; }
.status-switch .ss-seg.actionable:nth-child(2):hover { background: var(--blue); }
.status-switch .ss-seg.actionable:nth-child(3):hover { background: var(--emerald); }
.status-switch .ss-seg.actionable:focus-visible { outline: 2px solid var(--blue); outline-offset: -2px; }
.status-switch .ss-seg.disabled { color: color-mix(in oklch, var(--muted-foreground) 55%, transparent); cursor: not-allowed; background: transparent; }
.status-switch .ss-seg.on { color: #fff; cursor: default; font-weight: 700; }
/* Phase indicator — fills progressively so state reads without colour (WCAG 1.4.1) */
.status-switch .ss-phase { width: 9px; height: 9px; border-radius: 999px; border: 1.5px solid currentColor; box-sizing: border-box; flex-shrink: 0; display: inline-block; }
.status-switch .ss-phase.p-active { background: linear-gradient(to right, currentColor 0 50%, transparent 50% 100%); }
.status-switch .ss-phase.p-live { background: currentColor; }
.status-switch.st-inactive .ss-seg.on { background: #71717a; }
.status-switch.st-active .ss-seg.on { background: var(--blue); }
.status-switch.st-live .ss-seg.on { background: var(--emerald); }
/* Status column header — info affordance explaining the workflow */
.th-info { display: inline-flex; align-items: center; justify-content: center; width: 14px; height: 14px; border-radius: 50%; border: 1px solid var(--border); color: var(--muted-foreground); font-size: 9px; font-style: normal; font-weight: 700; line-height: 1; cursor: help; vertical-align: middle; }
.th-info:hover { color: var(--foreground); border-color: var(--muted-foreground); }

/* ── Properties: searchable user combobox ──────────── */
.user-select { position: relative; display: inline-block; width: 100%; max-width: 168px; }
.user-select-trigger { display: flex; align-items: center; justify-content: space-between; gap: 6px; width: 100%; height: 2.25rem; padding: 0 0.6rem; border: 1px solid var(--input); border-radius: calc(var(--radius) - 2px); background: var(--background); color: var(--foreground); font-size: 0.82rem; cursor: pointer; }
.user-select-trigger:hover { border-color: var(--ring); }
.user-select-trigger.placeholder { color: var(--muted-foreground); }
.user-select-trigger .ust-label { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.user-select-trigger svg { width: 14px; height: 14px; flex-shrink: 0; color: var(--muted-foreground); }
.user-select-pop { background: var(--popover); border: 1px solid var(--border); border-radius: var(--radius); box-shadow: 0 12px 32px oklch(0 0 0 / 0.18); z-index: 200; overflow: hidden; }
.user-select-search { display: flex; align-items: center; gap: 6px; padding: 8px 10px; border-bottom: 1px solid var(--border); }
.user-select-search svg { width: 14px; height: 14px; color: var(--muted-foreground); }
.user-select-search input { border: none; outline: none; background: transparent; font-size: 0.82rem; width: 100%; color: var(--foreground); }
.user-select-list { max-height: 244px; overflow-y: auto; padding: 4px; }
.user-select-opt { display: flex; align-items: center; gap: 8px; width: 100%; text-align: left; padding: 6px 8px; border: none; background: transparent; border-radius: 8px; cursor: pointer; }
.user-select-opt:hover { background: var(--accent); }
.user-select-opt.sel { background: var(--secondary); }
.user-select-opt .uso-av { width: 26px; height: 26px; border-radius: 999px; background: var(--foreground); color: var(--background); display: grid; place-items: center; font-size: 0.62rem; font-weight: 600; flex-shrink: 0; }
.user-select-opt .uso-id { display: flex; flex-direction: column; flex: 1; overflow: hidden; }
.user-select-opt .uso-name { font-size: 0.82rem; font-weight: 500; }
.user-select-opt .uso-mail { font-size: 0.72rem; color: var(--muted-foreground); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.user-select-opt > svg { width: 15px; height: 15px; color: var(--primary); flex-shrink: 0; }
.user-select-empty { padding: 14px; text-align: center; color: var(--muted-foreground); font-size: 0.82rem; }

/* ── Properties: view toggle, footer, budget, expand ─ */
.view-toggle { display: inline-flex; border: 1px solid var(--border); border-radius: calc(var(--radius) - 2px); overflow: hidden; }
.view-toggle .vt-opt { display: inline-flex; align-items: center; gap: 6px; padding: 0 12px; height: 2.25rem; background: var(--background); border: none; font-size: 0.82rem; color: var(--muted-foreground); cursor: pointer; }
.view-toggle .vt-opt.on { background: var(--primary); color: var(--primary-foreground); }
.view-toggle .tf-count { background: color-mix(in oklch, var(--muted-foreground) 25%, transparent); border-radius: 999px; padding: 0 6px; font-size: 0.68rem; }
.budget-used-text { font-size: 0.8rem; white-space: nowrap; }
.prop-foot { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-top: 16px; }
.prop-more { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 12px 14px; border-top: 1px solid var(--border); }
.save-status { display: inline-flex; align-items: center; gap: 6px; font-size: 0.82rem; font-weight: 500; color: var(--muted-foreground); white-space: nowrap; }
.save-status .save-status-ico { display: inline-flex; }
.save-status.saved { color: var(--emerald, #1f8a5b); }
.save-status .save-status-dot { width: 8px; height: 8px; border-radius: 999px; background: var(--emerald, #1f8a5b); box-shadow: 0 0 0 3px color-mix(in oklch, var(--emerald, #1f8a5b) 18%, transparent); }
.save-status.idle .save-status-dot, .save-status.saved .save-status-dot { animation: save-dot-in 0.3s ease; }
@keyframes save-dot-in { from { transform: scale(0.4); opacity: 0; } to { transform: scale(1); opacity: 1; } }
.save-status.saving { color: var(--muted-foreground); }
.save-status.saving .save-status-ico { animation: save-spin 0.8s linear infinite; }
@keyframes save-spin { to { transform: rotate(360deg); } }
.prop-summary { padding: 1.1rem 1.2rem; }
.prop-sum-stats { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; margin-bottom: 14px; }
.prop-sum-stats > div { border: 1px solid var(--border); border-radius: var(--radius); padding: 10px 12px; display: flex; flex-direction: column; gap: 3px; }
.prop-sum-stats strong { font-size: 1.35rem; line-height: 1; }
.prop-sum-stats span { font-size: 0.68rem; color: var(--muted-foreground); text-transform: uppercase; letter-spacing: .04em; }
.prop-sum-status { font-size: 0.8rem; color: var(--muted-foreground); margin-bottom: 12px; }
.prop-expand-cell { background: color-mix(in oklch, var(--muted) 35%, transparent); padding: 0 !important; }
.prop-expand { padding: 18px 22px; }
.prop-expand h3 { font-size: 0.92rem; font-weight: 700; margin: 0 0 14px; }
.prop-info-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 16px 20px; margin-bottom: 16px; }
.prop-info-grid .k { font-size: 0.74rem; color: var(--muted-foreground); margin-bottom: 3px; }
.prop-info-grid .v { font-size: 0.85rem; font-weight: 500; }

/* ── Rental units modal ────────────────────────────── */
.ru-stats { display: grid; grid-template-columns: repeat(3, 1fr); gap: 12px; margin-bottom: 18px; }
.ru-stat { border: 1px solid var(--border); border-radius: var(--radius); padding: 12px 14px; }
.ru-stat .lbl { display: flex; align-items: center; gap: 6px; color: var(--muted-foreground); font-size: 0.76rem; }
.ru-stat .lbl svg { width: 14px; height: 14px; }
.ru-stat .n { font-size: 1.5rem; font-weight: 700; margin-top: 4px; }
.ru-bld { border: 1px solid var(--border); border-radius: var(--radius); margin-bottom: 12px; overflow: hidden; }
.ru-bld-head { display: flex; align-items: center; justify-content: space-between; gap: 8px; padding: 12px 14px; background: color-mix(in oklch, var(--muted) 35%, transparent); border-bottom: 1px solid var(--border); }
.ru-bld-name { font-weight: 600; font-size: 0.9rem; }
.ru-bld-name span { font-weight: 400; color: var(--muted-foreground); }
.ru-bld-meta { font-size: 0.74rem; color: var(--muted-foreground); margin-top: 2px; }
.ru-units { padding: 10px 14px; display: flex; flex-direction: column; gap: 10px; }
.ru-unit { border: 1px solid var(--border); border-radius: 10px; padding: 10px 12px; }
.ru-unit-top { display: flex; align-items: flex-start; justify-content: space-between; gap: 8px; }
.ru-u-name { font-weight: 600; font-size: 0.85rem; }
.ru-u-meta { display: flex; align-items: center; gap: 8px; margin-top: 4px; font-size: 0.74rem; color: var(--muted-foreground); }
.ru-tenant { display: flex; align-items: center; justify-content: space-between; gap: 8px; padding: 8px 0 0; border-top: 1px solid var(--border); margin-top: 8px; }
.ru-tn-name { font-size: 0.82rem; font-weight: 500; }
.ru-tn-contact { font-size: 0.74rem; color: var(--muted-foreground); }
.ru-empty { font-size: 0.78rem; color: var(--muted-foreground); padding: 4px 0; }
.ru-row-actions { display: flex; align-items: center; gap: 2px; }
.ru-add { display: inline-flex; align-items: center; gap: 5px; margin-top: 8px; padding: 5px 8px; border: 1px dashed var(--border); border-radius: 8px; background: transparent; color: var(--muted-foreground); font-size: 0.76rem; cursor: pointer; }
.ru-add:hover { border-color: var(--ring); color: var(--foreground); }

/* ── Activation / go-live gating ───────────────────── */
.act-warn { display: flex; align-items: center; gap: 8px; font-size: 0.82rem; font-weight: 600; color: var(--orange); margin-bottom: 10px; }
.act-list { margin: 0 0 14px; padding-left: 18px; color: var(--muted-foreground); font-size: 0.82rem; line-height: 1.75; }
.act-props { display: flex; flex-wrap: wrap; gap: 6px; margin-bottom: 14px; }
.act-ack { display: flex; align-items: flex-start; gap: 10px; font-size: 0.82rem; cursor: pointer; line-height: 1.5; }
.golive-checklist { list-style: none; margin: 0 0 8px; padding: 0; display: flex; flex-direction: column; gap: 8px; }
.golive-checklist li { display: flex; align-items: center; gap: 8px; font-size: 0.84rem; color: var(--muted-foreground); }
.golive-checklist li.unmet { color: var(--foreground); }
.golive-checklist .gc-ico { width: 20px; height: 20px; border-radius: 999px; display: grid; place-items: center; flex-shrink: 0; }
.golive-checklist .gc-ico svg { width: 12px; height: 12px; }
.golive-checklist li.met .gc-ico { background: color-mix(in oklch, var(--emerald) 18%, transparent); color: var(--emerald); }
.golive-checklist li.unmet .gc-ico { background: color-mix(in oklch, var(--destructive) 15%, transparent); color: var(--destructive); }
.golive-prop { font-weight: 600; font-size: 0.82rem; margin: 12px 0 6px; }

/* ── CSV import ────────────────────────────────────── */
.dropzone { border: 2px dashed var(--border); border-radius: var(--radius); padding: 30px; text-align: center; cursor: pointer; transition: border-color 0.12s, background 0.12s; }
.dropzone.over, .dropzone:hover { border-color: var(--ring); background: color-mix(in oklch, var(--muted) 30%, transparent); }
.dz-icon { width: 44px; height: 44px; border-radius: 999px; background: color-mix(in oklch, var(--muted) 50%, transparent); display: grid; place-items: center; margin: 0 auto 10px; color: var(--muted-foreground); }
.dz-title { font-weight: 600; font-size: 0.9rem; }
.dz-sub { font-size: 0.8rem; color: var(--muted-foreground); margin-top: 3px; }
.dz-link { color: var(--primary); text-decoration: underline; }
.dz-or { display: flex; align-items: center; gap: 10px; color: var(--muted-foreground); font-size: 0.76rem; margin: 14px 0; }
.dz-or::before, .dz-or::after { content: ""; flex: 1; height: 1px; background: var(--border); }
.btn.full { width: 100%; justify-content: center; }
.import-note { display: flex; gap: 8px; align-items: flex-start; font-size: 0.78rem; color: var(--muted-foreground); margin-top: 14px; }
.import-note svg { flex-shrink: 0; margin-top: 1px; }
.import-filebar { display: flex; align-items: center; justify-content: space-between; gap: 8px; padding: 10px 12px; border: 1px solid var(--border); border-radius: var(--radius); margin-bottom: 14px; font-size: 0.82rem; }
.import-filebar .fb-left { display: flex; align-items: center; gap: 8px; min-width: 0; }
.map-row { display: grid; grid-template-columns: 1fr 1fr 1.2fr; gap: 12px; align-items: center; padding: 8px 0; border-bottom: 1px solid var(--border); font-size: 0.82rem; }
.map-row .mg-col { display: flex; align-items: center; gap: 6px; font-weight: 500; }
.map-row .mg-col svg { color: var(--muted-foreground); flex-shrink: 0; }
.map-row .mg-sample { color: var(--muted-foreground); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.import-warn { display: flex; align-items: center; gap: 8px; font-size: 0.8rem; color: var(--orange); background: color-mix(in oklch, var(--orange) 12%, transparent); border-radius: 8px; padding: 8px 10px; margin: 12px 0 0; }
.diff-summary { display: grid; grid-template-columns: repeat(3, 1fr); gap: 10px; margin-bottom: 12px; }
.diff-stat { border: 1px solid var(--border); border-radius: var(--radius); padding: 12px 14px; }
.diff-stat .ds-n { font-size: 1.4rem; font-weight: 700; line-height: 1.1; }
.diff-stat .ds-l { font-size: 0.74rem; color: var(--muted-foreground); }
.diff-group { margin-bottom: 12px; }
.diff-group-head { display: flex; align-items: center; gap: 8px; font-size: 0.8rem; font-weight: 600; margin-bottom: 4px; }
.dg-dot { width: 8px; height: 8px; border-radius: 999px; display: inline-block; }
.diff-row { display: flex; align-items: center; gap: 8px; padding: 7px 0; border-bottom: 1px solid var(--border); font-size: 0.82rem; }
.diff-row .dr-name { font-weight: 500; }
.diff-row .dr-meta { color: var(--muted-foreground); flex: 1; }

/* ── Conversations: reported-tickets panel ─────────── */
.conv-tkt-dot { display: inline-flex; align-items: center; gap: 3px; flex-shrink: 0; font-size: 0.68rem; font-weight: 700; color: var(--orange); background: color-mix(in oklch, var(--orange) 14%, transparent); border-radius: 999px; padding: 1px 6px 1px 5px; }
.conv-tkt-dot svg { width: 12px; height: 12px; }
.tkt-panel { padding: 0; overflow: hidden; position: sticky; top: 0; }
.tkt-panel-head { display: flex; align-items: center; justify-content: space-between; gap: 8px; padding: 12px 14px; border-bottom: 1px solid var(--border); }
.tkt-panel-head svg { color: var(--muted-foreground); }
.tkt-panel-body { padding: 12px; display: flex; flex-direction: column; gap: 10px; max-height: 64vh; overflow-y: auto; }
.tkt-card { display: block; width: 100%; text-align: left; border: 1px solid var(--border); border-radius: var(--radius); background: var(--card); padding: 11px 12px; cursor: pointer; transition: border-color 0.12s, box-shadow 0.12s, background 0.12s; }
.tkt-card:hover { border-color: var(--ring); box-shadow: 0 2px 8px oklch(0 0 0 / 0.06); background: color-mix(in oklch, var(--muted) 22%, transparent); }
.tkt-card-title { font-size: 0.84rem; font-weight: 600; line-height: 1.35; }
.tkt-card-meta { display: flex; align-items: center; gap: 6px; font-size: 0.75rem; color: var(--muted-foreground); }
.tkt-card-meta svg { color: var(--muted-foreground); flex-shrink: 0; }
.tkt-card-link { display: inline-flex; align-items: center; gap: 2px; font-size: 0.74rem; font-weight: 600; color: var(--primary); }
.tkt-rail { display: flex; flex-direction: column; align-items: center; gap: 10px; width: 48px; padding: 14px 0; border: 1px solid var(--border); border-radius: var(--radius); background: var(--card); color: var(--muted-foreground); cursor: pointer; }
.tkt-rail:hover { background: var(--accent); color: var(--foreground); }
.tkt-rail-count { font-size: 0.7rem; font-weight: 700; color: #fff; background: var(--orange); border-radius: 999px; min-width: 18px; height: 18px; display: grid; place-items: center; padding: 0 4px; }
.tkt-rail-label { writing-mode: vertical-rl; font-size: 0.74rem; font-weight: 600; letter-spacing: 0.04em; margin-top: 2px; }
.conv-list-rail { display: flex; flex-direction: column; align-items: center; gap: 10px; width: 56px; padding: 12px 0; border: 1px solid var(--border); border-radius: var(--radius); background: var(--card); }
.conv-rail-avatars { display: flex; flex-direction: column; align-items: center; gap: 8px; max-height: 60vh; overflow-y: auto; padding: 2px 0; }
.conv-rail-av { border: 2px solid transparent; border-radius: 999px; padding: 0; background: none; cursor: pointer; line-height: 0; }
.conv-rail-av:hover { border-color: color-mix(in oklch, var(--primary) 40%, transparent); }
.conv-rail-av.on { border-color: #FF0000; }
.conv-rail-av.on .avatar { background: #FF0000; color: #fff; }
.conv-rail-av { position: relative; }
.conv-rail-count { position: absolute; top: -3px; right: -3px; min-width: 15px; height: 15px; padding: 0 3px; border-radius: 999px; background: var(--primary); color: var(--primary-foreground, #fff); font-size: 9.5px; font-weight: 700; line-height: 15px; text-align: center; box-shadow: 0 0 0 2px var(--card); }

/* ── Conversations: filter accordion ───────────────── */
.conv-filter-acc { display: grid; grid-template-rows: 0fr; transition: grid-template-rows 0.22s ease; }
.conv-filter-acc > .card { overflow: hidden; min-height: 0; opacity: 0; transform: translateY(-4px); transition: opacity 0.18s, transform 0.18s; padding: 0; }
.conv-filter-acc.open { grid-template-rows: 1fr; margin-bottom: 16px; }
.conv-filter-acc.open > .card { opacity: 1; transform: none; padding: 16px 18px; }
.conv-filter-head { display: flex; align-items: center; justify-content: space-between; gap: 8px; margin-bottom: 14px; }
.conv-filter-head svg { color: var(--muted-foreground); }
.conv-filter-clear { border: none; background: transparent; color: var(--primary); font-size: 0.8rem; font-weight: 600; cursor: pointer; }
.conv-filter-clear:disabled { color: var(--muted-foreground); cursor: default; opacity: 0.6; }
.conv-filter-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 14px 16px; }
.conv-filter-f { display: flex; flex-direction: column; gap: 0; }
.conv-filter-f .label { margin-bottom: 0.4rem; }
@media (max-width: 900px) { .conv-filter-grid { grid-template-columns: repeat(2, 1fr); } }
.conv-date-range { display: flex; align-items: center; gap: 6px; }
.conv-date-range .input { padding: 0 0.5rem; }
.conv-date-sep { color: var(--muted-foreground); flex-shrink: 0; }

/* ── Deficiencies: stage kanban cards + report ─────── */
/* Adaptive (SDUI) ticket board: aggregation notice, meta columns,
   compact density, swimlane matrix + split preview pane */
.kanban-notice { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; background: color-mix(in oklch, var(--blue) 8%, var(--card)); border: 1px solid color-mix(in oklch, var(--blue) 28%, transparent); border-radius: var(--radius); padding: 5px 12px; margin-bottom: 14px; }
.kanban-notice.subtle { background: var(--secondary); border-color: var(--border); }
.kanban-notice-ico { color: var(--blue); display: inline-flex; flex-shrink: 0; }
.kanban-notice-txt { font-size: 0.82rem; font-weight: 500; color: var(--foreground); }
.kanban-notice-hidden { font-size: 0.74rem; color: var(--muted-foreground); background: color-mix(in oklch, var(--muted) 55%, transparent); border: 1px solid var(--border); border-radius: 999px; padding: 2px 9px; }
.kanban-notice-btn { margin-left: auto; font-size: 0.78rem; font-weight: 600; color: var(--blue); background: none; border: none; cursor: pointer; padding: 4px 6px; border-radius: 7px; }
.kanban-notice-btn:hover { background: color-mix(in oklch, var(--blue) 12%, transparent); }
.kanban-meta { overflow-x: visible; flex-wrap: nowrap; }
.kanban-meta .kcol { flex: 1 1 0; min-width: 0; max-width: none; width: auto; }
.kcol-emptyrail { background: color-mix(in oklch, var(--emerald) 6%, var(--secondary)); }
.kcol-emptyrail-note { display: flex; flex-direction: column; align-items: center; gap: 6px; padding: 22px 12px; color: color-mix(in oklch, var(--emerald) 70%, var(--muted-foreground)); font-size: 0.78rem; text-align: center; }
.kcol-emptyrail-note svg { color: var(--emerald); }
/* Compact card density (ultrawide / high card-count) */
.dcard-compact { padding: 8px 10px; }
.dcard-compact .dcard-title { font-weight: 600; line-height: 1.35; }
.dcard-emerg-dot { width: 8px; height: 8px; border-radius: 999px; background: var(--destructive); flex-shrink: 0; margin-top: 4px; }
.dcard.is-active { outline: 2px solid var(--primary); outline-offset: 0; }
/* Split layout: board 60% · sticky preview pane 40% */
.ticket-split { display: grid; grid-template-columns: 6fr 4fr; gap: 16px; align-items: start; }
.ticket-split-board { min-width: 0; }
.ticket-split-pane { position: sticky; top: 12px; }
.ticket-pane { display: flex; flex-direction: column; background: var(--card); border: 1px solid var(--border); border-radius: var(--radius); max-height: calc(100vh - 150px); }
.ticket-pane-empty { align-items: center; justify-content: center; gap: 8px; padding: 48px 24px; text-align: center; color: var(--muted-foreground); min-height: 320px; }
.ticket-pane-empty-t { font-weight: 600; font-size: 0.92rem; color: var(--foreground); }
.ticket-pane-empty-s { font-size: 0.8rem; max-width: 30ch; }
.ticket-pane-head { display: flex; align-items: center; justify-content: space-between; gap: 8px; padding: 12px 14px; border-bottom: 1px solid var(--border); }
.ticket-pane-scroll { padding: 14px; overflow-y: auto; }
.ticket-pane-title { font-weight: 700; font-size: 1.02rem; line-height: 1.35; }
.ticket-pane-foot { padding: 12px 14px; border-top: 1px solid var(--border); margin-top: auto; }
/* 2D swimlane matrix */
.ticket-matrix-scroll { overflow-x: auto; border: 1px solid var(--border); border-radius: var(--radius); }
.ticket-matrix { display: grid; min-width: max-content; }
.ticket-matrix > div { border-right: 1px solid var(--border); border-bottom: 1px solid var(--border); padding: 8px; }
.ticket-matrix .tm-corner, .ticket-matrix .tm-colhead { position: sticky; top: 0; z-index: 2; background: var(--secondary); font-size: 0.74rem; font-weight: 700; text-transform: uppercase; letter-spacing: 0.03em; color: var(--muted-foreground); display: flex; align-items: center; }
.ticket-matrix .tm-corner { left: 0; z-index: 3; }
.tm-lanehead { position: sticky; left: 0; z-index: 1; background: var(--card); display: flex; align-items: center; gap: 6px; font-size: 0.8rem; font-weight: 600; }
.tm-lanehead span:nth-child(2) { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.tm-lanecount { margin-left: auto; font-size: 0.7rem; color: var(--muted-foreground); background: color-mix(in oklch, var(--muted) 55%, transparent); border-radius: 999px; padding: 1px 7px; }
.tm-cell { display: flex; flex-direction: column; gap: 6px; background: color-mix(in oklch, var(--muted) 18%, transparent); }
.def-stage-dot { width: 8px; height: 8px; border-radius: 999px; display: inline-block; margin-right: 6px; vertical-align: middle; flex-shrink: 0; }
.def-tag { font-size: 0.7rem; font-weight: 500; color: var(--muted-foreground); background: color-mix(in oklch, var(--muted) 60%, transparent); border: 1px solid var(--border); border-radius: 999px; padding: 1px 8px; }
.def-esc { display: flex; align-items: center; gap: 6px; font-size: 0.72rem; font-weight: 600; color: var(--orange); background: color-mix(in oklch, var(--orange) 12%, transparent); border: 1px solid color-mix(in oklch, var(--orange) 30%, transparent); border-radius: 8px; padding: 5px 8px; margin-bottom: 7px; }
.def-banner { display: flex; gap: 10px; border-radius: var(--radius); padding: 12px 14px; margin-bottom: 16px; }
.def-banner.red { background: color-mix(in oklch, var(--destructive) 10%, transparent); border: 1px solid color-mix(in oklch, var(--destructive) 30%, transparent); }
.def-banner.amber { background: color-mix(in oklch, var(--orange) 12%, transparent); border: 1px solid color-mix(in oklch, var(--orange) 30%, transparent); }
.def-banner-ico { flex-shrink: 0; margin-top: 1px; }
.def-banner.red .def-banner-ico { color: var(--destructive); }
.def-banner.amber .def-banner-ico { color: var(--orange); }
.def-banner-title { font-weight: 700; font-size: 0.86rem; margin-bottom: 2px; }
.def-banner-body { font-size: 0.82rem; line-height: 1.55; color: var(--muted-foreground); }
.def-overview { margin-bottom: 16px; }
.def-facts { display: grid; grid-template-columns: repeat(4, 1fr); gap: 12px; margin-bottom: 12px; }
.def-fact .k { font-size: 0.72rem; color: var(--muted-foreground); margin-bottom: 2px; }
.def-fact .v { font-size: 0.84rem; font-weight: 600; }
.def-desc { font-size: 0.88rem; line-height: 1.6; margin: 0; }
.def-sec-head { font-size: 0.7rem; font-weight: 700; letter-spacing: 0.06em; text-transform: uppercase; color: var(--muted-foreground); margin: 20px 0 10px; }
.def-block { border: 1px solid var(--border); border-radius: var(--radius); padding: 14px 16px; }
.def-block-title { display: flex; align-items: center; gap: 7px; font-weight: 600; font-size: 0.86rem; margin-bottom: 10px; }
.def-block-title svg { color: var(--muted-foreground); }
.def-kv { display: flex; flex-direction: column; gap: 8px; }
.def-kv-row { display: flex; justify-content: space-between; gap: 12px; align-items: baseline; }
.def-kv-row .k { font-size: 0.8rem; color: var(--muted-foreground); }
.def-kv-row .v { font-size: 0.82rem; font-weight: 500; text-align: right; }
.def-subhead { font-size: 0.78rem; font-weight: 600; color: var(--muted-foreground); margin: 12px 0 6px; }
.def-callout { display: flex; gap: 10px; border-radius: var(--radius); padding: 12px 14px; }
.def-callout.info { background: color-mix(in oklch, var(--blue) 9%, transparent); border: 1px solid color-mix(in oklch, var(--blue) 25%, transparent); }
.def-callout.warn { background: color-mix(in oklch, var(--orange) 10%, transparent); border: 1px solid color-mix(in oklch, var(--orange) 28%, transparent); }
.def-callout-ico { flex-shrink: 0; margin-top: 1px; }
.def-callout.info .def-callout-ico { color: var(--blue); }
.def-callout.warn .def-callout-ico { color: var(--orange); }
.def-callout-title { font-weight: 600; font-size: 0.82rem; margin-bottom: 3px; }
.def-callout-body { font-size: 0.82rem; line-height: 1.55; color: var(--muted-foreground); }
.def-fin-grid { display: grid; grid-template-columns: repeat(2, 1fr); gap: 10px 20px; }
.def-fin-row { display: flex; justify-content: space-between; gap: 12px; border-bottom: 1px solid var(--border); padding-bottom: 8px; }
.def-fin-row .k { font-size: 0.8rem; color: var(--muted-foreground); }
.def-fin-row .v { font-size: 0.82rem; font-weight: 600; }
.def-attach { display: flex; flex-wrap: wrap; gap: 10px; }
.def-att { display: flex; align-items: center; gap: 9px; border: 1px solid var(--border); border-radius: 10px; padding: 9px 12px; background: color-mix(in oklch, var(--muted) 30%, transparent); }
.def-att-ico { width: 30px; height: 30px; border-radius: 8px; display: grid; place-items: center; background: var(--background); color: var(--muted-foreground); }
.def-att-name { font-size: 0.8rem; font-weight: 500; }
.def-att-type { font-size: 0.7rem; color: var(--muted-foreground); }
@media (max-width: 760px) { .def-facts { grid-template-columns: repeat(2, 1fr); } }

/* ── Ask ailean assistant panel ────────────────────── */
.ai-panel { padding: 0; overflow: hidden; display: flex; flex-direction: column; position: sticky; top: 0; max-height: calc(100vh - 140px); }
.ai-head { display: flex; align-items: center; justify-content: space-between; gap: 8px; padding: 12px 14px; border-bottom: 1px solid var(--border); }
.ai-avatar { width: 30px; height: 30px; border-radius: 999px; background: var(--primary); color: var(--primary-foreground); display: grid; place-items: center; font-weight: 700; font-size: 0.85rem; flex-shrink: 0; }
.ai-avatar.sm { width: 22px; height: 22px; font-size: 0.7rem; }
.ai-body { flex: 1; overflow-y: auto; padding: 14px; display: flex; flex-direction: column; gap: 12px; min-height: 280px; }
.ai-msg { display: flex; gap: 8px; align-items: flex-end; }
.ai-msg.user { justify-content: flex-end; }
.ai-bubble { max-width: 82%; padding: 0.55rem 0.7rem; border-radius: 14px; font-size: 0.84rem; line-height: 1.5; }
.ai-bubble.ai { background: var(--muted); color: var(--foreground); border-bottom-left-radius: 4px; }
.ai-bubble.user { background: var(--primary); color: var(--primary-foreground); border-bottom-right-radius: 4px; }
.ai-chips { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 2px; }
.ai-chip { font-size: 0.76rem; font-weight: 500; border: 1px solid var(--border); background: var(--background); color: var(--foreground); border-radius: 999px; padding: 5px 11px; cursor: pointer; transition: background 0.12s, border-color 0.12s; }
.ai-chip:hover { background: var(--accent); border-color: var(--ring); }
.ai-inputbar { display: flex; align-items: center; gap: 8px; padding: 10px 12px; border-top: 1px solid var(--border); }
.ai-inputbar .input { flex: 1; }
.ai-send { padding: 0; width: 2.25rem; height: 2.25rem; flex-shrink: 0; display: grid; place-items: center; }
.ai-rail { display: flex; flex-direction: column; align-items: center; gap: 10px; width: 48px; padding: 14px 0; border: 1px solid var(--border); border-radius: var(--radius); background: var(--card); color: var(--muted-foreground); cursor: pointer; }
.ai-rail:hover { background: var(--accent); color: var(--foreground); }
.ai-rail-spark { width: 24px; height: 24px; border-radius: 999px; background: var(--primary); color: var(--primary-foreground); display: grid; place-items: center; font-weight: 700; font-size: 0.8rem; }
.ai-rail-label { writing-mode: vertical-rl; font-size: 0.74rem; font-weight: 600; letter-spacing: 0.04em; margin-top: 2px; }
.todo-solve { background: #18181b; border-color: #18181b; color: #fff; }
.todo-solve:hover { background: #000; border-color: #000; }

/* ── Floating Ask ailean dock + FAB ─────────────────────── */
.ai-fab { position: fixed; right: 22px; bottom: 22px; z-index: 90; display: flex; align-items: center; height: 52px; padding: 0 11px; border: none; border-radius: 999px; background: var(--primary); color: var(--primary-foreground); box-shadow: 0 8px 28px rgba(0,0,0,.22); cursor: pointer; font-weight: 600; font-size: 0.9rem; transition: transform .25s ease, opacity .25s ease, box-shadow .15s, padding .2s ease; }
.ai-fab:hover { transform: translateY(-2px); box-shadow: 0 12px 34px rgba(0,0,0,.28); padding-right: 18px; }
.ai-fab.ai-fab-hidden { transform: translateY(150%); opacity: 0; pointer-events: none; }
.ai-fab-label { max-width: 0; overflow: hidden; white-space: nowrap; opacity: 0; transition: max-width .25s ease, opacity .2s ease, margin-left .2s ease; }
.ai-fab:hover .ai-fab-label, .ai-fab:focus-visible .ai-fab-label { max-width: 130px; opacity: 1; margin-left: 9px; }
.ai-fab-spark { width: 30px; height: 30px; border-radius: 999px; background: var(--primary-foreground); color: var(--primary); display: grid; place-items: center; font-weight: 800; font-size: 0.95rem; flex-shrink: 0; }
.ai-dock { position: fixed; right: 22px; bottom: 22px; z-index: 91; width: 384px; max-width: calc(100vw - 32px); height: 560px; max-height: calc(100vh - 96px); box-shadow: 0 18px 50px rgba(0,0,0,.28); border-radius: calc(var(--radius) + 4px); overflow: hidden; animation: ai-dock-in .18s ease; }
.ai-dock .ai-panel { position: static; max-height: none; height: 100%; border-radius: calc(var(--radius) + 4px); }
@keyframes ai-dock-in { from { opacity: 0; transform: translateY(12px) scale(.98); } to { opacity: 1; transform: none; } }
@media (max-width: 560px) {
  .ai-dock { right: 0; left: 0; bottom: 0; width: auto; max-width: none; height: 82vh; max-height: 82vh; border-radius: 16px 16px 0 0; }
  .ai-fab { padding: 0; width: 52px; justify-content: center; }
  .ai-fab-label { display: none; }
}

/* ── Settings: Zefix-synced company info ───────────── */
.zefix-bar { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 11px 14px; border: 1px solid color-mix(in oklch, var(--emerald) 35%, transparent); background: color-mix(in oklch, var(--emerald) 9%, transparent); border-radius: var(--radius); margin-bottom: 16px; }
.zefix-left { display: flex; align-items: center; gap: 10px; }
.zefix-ico { color: var(--emerald); display: inline-flex; }
.zefix-title { font-size: 0.84rem; font-weight: 600; }
.zefix-sub { font-size: 0.76rem; color: var(--muted-foreground); font-variant-numeric: tabular-nums; }
.zefix-search { display: flex; align-items: center; gap: 8px; margin-bottom: 16px; }
.zefix-tag { font-size: 0.62rem; font-weight: 700; letter-spacing: 0.04em; text-transform: uppercase; color: var(--emerald); background: color-mix(in oklch, var(--emerald) 14%, transparent); border-radius: 4px; padding: 1px 5px; margin-left: 5px; vertical-align: middle; }

/* ============================================================
   Translation layout safety
   Longer German strings must WRAP inside their box and never
   overlap a neighbouring column. Generalises the tenant-detail
   fix to every fixed-track grid / label-value layout in the app.
   ============================================================ */

/* 1) Grid/flex CELLS that hold text must be allowed to shrink,
      otherwise content wider than its track overflows into the
      next column. min-width:0 lets the cell shrink so the text
      wraps (or ellipsises) inside its own track instead. */
.craft-row > *, .craft-table-head > *,
.day-row > *, .report-head > *, .report-field-row > *,
.sa-tier-head > *, .sa-tier-row > *,
.qr-layout > *, .cfg-grid > *,
.tn-rf > *, .tn-rf-grid > *, .tn-rcol > *,
.detail-row > *, .kv-row > *, .stat-row > *,
.list-row > *, .row > * { min-width: 0; }

/* 2) Long compound words (German loves them) break instead of
      forcing the box wider. Applied to label/value text that is
      not protected by ellipsis truncation. */
.tn-rf-label, .day-name, .report-field-row .fname,
.craft-row, .sa-tier-row, .detail-row, .kv-row,
.field-label, .stat-label, .list-cell,
.card .desc, .page-head .sub, .badge { overflow-wrap: anywhere; }

/* 3) Labels that were locked to a single line (nowrap) but live
      in a flexible column should be free to wrap when the German
      label is longer than the English one — only where there is
      no ellipsis fallback. */
.day-name, .report-field-row .fname,
.sa-month, .todo-counter { white-space: normal; }
