/*
 * shadcn/ui look — both apps
 * ===========================
 * Layered over design-system.css and every page sheet, loaded last by both
 * base.html files. It changes how the components look, not what they are: no
 * template uses a class that is defined only here. Tried on the website
 * first, then chosen for both ("A shadcn on both") so the two can match.
 *
 * What shadcn/ui (ui.shadcn.com) does, translated:
 *   - zinc neutrals: near-black ink, one #e4e4e7 border, #f4f4f5 muted fills
 *   - a white page; cards are a 1px border and a whisper of shadow, not a lift
 *   - 36px controls, 14px/500 labels, 8px radius on controls, 12px on cards
 *   - no glow under buttons; focus is a 3px ring in the brand colour
 *   - tabs: a muted track and a white, raised active tab
 * The colour stays ours: coral is the primary, indigo the secondary, and the
 * state washes (green, amber, blue) keep their meaning.
 */

@import url('https://fonts.googleapis.com/css2?family=Geist:wght@400;500;600;700&display=swap');

:root {
  --tc-font: 'Geist', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;

  /* zinc */
  --tc-ink:          #09090B;
  --tc-body:         #3F3F46;
  --tc-meta:         #71717A;
  --tc-disabled:     #A1A1AA;
  --tc-disabled-alt: #D4D4D8;
  --tc-surface:      #F4F4F5;
  --tc-border:       #E4E4E7;

  --tc-r-sm:    4px;
  --tc-r-md:    6px;
  --tc-r-lg:    8px;
  --tc-r-xl:   10px;
  --tc-r-2xl:  12px;
  --tc-r-3xl:  14px;
  --tc-r-control: 8px;

  --tc-shadow-xs:   0 1px 2px rgba(0, 0, 0, .05);
  --tc-shadow-sm:   0 1px 3px rgba(0, 0, 0, .06), 0 1px 2px -1px rgba(0, 0, 0, .06);
  --tc-shadow-card: var(--tc-shadow-sm);
  --tc-shadow-over: 0 10px 15px -3px rgba(0, 0, 0, .08), 0 4px 6px -4px rgba(0, 0, 0, .08);
  --tc-shadow-coral:    var(--tc-shadow-xs);
  --tc-shadow-coral-44: var(--tc-shadow-xs);
  --tc-shadow-coral-40: var(--tc-shadow-xs);

  --sc-ring: rgba(255, 91, 57, .28);
}

body { background: #FFFFFF; letter-spacing: -0.006em; }

/* ── type: semibold and tight, the shadcn heading ───────────────────── */
.tc-display, .tc-h1, .tc-h2 { font-weight: 600; letter-spacing: -.025em; }
.tc-h3, .tc-card-title { font-weight: 600; letter-spacing: -.01em; }
.tc-micro { font-size: 14px; font-weight: 500; letter-spacing: .04em; }

/* ── buttons ─────────────────────────────────────────────────────────── */
.tc-btn { font-weight: 500; transition: background .15s, color .15s, border-color .15s, box-shadow .15s; }
.tc-btn:active { transform: none; }
.tc-btn:focus-visible { box-shadow: 0 0 0 3px var(--sc-ring); outline: 1px solid var(--tc-coral); outline-offset: 0; }

.tc-btn-primary, .tc-btn-compact {
  height: 36px; padding-inline: 16px; font: 500 14px/1 var(--tc-font);
  box-shadow: var(--tc-shadow-xs);
}
.tc-btn-primary:hover:not(:disabled),
.tc-btn-compact:hover:not(:disabled) { filter: none; background: #F04A28; }
.tc-btn-compact-indigo:hover:not(:disabled) { background: #5B4CC2; }

/* outline */
.tc-btn-secondary, .tc-btn-quiet {
  height: 36px; padding-inline: 16px; font: 500 14px/1 var(--tc-font);
  border: 1px solid var(--tc-border); background: #FFFFFF; color: var(--tc-ink);
  box-shadow: var(--tc-shadow-xs);
}
.tc-btn-secondary:hover:not(:disabled),
.tc-btn-quiet:hover:not(:disabled) { background: var(--tc-surface); border-color: var(--tc-border); }

.tc-btn-inline {
  height: 36px; padding-inline: 14px; font: 500 14px/1 var(--tc-font);
  border-width: 1px; box-shadow: var(--tc-shadow-xs);
}

/* ghost icon */
.tc-btn-icon { width: 36px; height: 36px; background: transparent; color: var(--tc-body); }
.tc-btn-icon:hover:not(:disabled) { background: var(--tc-surface); color: var(--tc-ink); }
.tc-btn-icon.tc-btn-icon-field { width: 36px; height: 36px; border: 1px solid var(--tc-border); box-shadow: var(--tc-shadow-xs); }
.tc-btn-icon-coral { width: 36px; height: 36px; background: var(--tc-coral); color: #fff; }
.tc-btn-icon-coral:hover:not(:disabled) { background: #F04A28; color: #fff; }

/* ── inputs ──────────────────────────────────────────────────────────── */
.tc-label { font: 500 14px/1.2 var(--tc-font); color: var(--tc-ink); }
.tc-input, .tc-textarea, .tc-input-pill {
  border: 1px solid var(--tc-border); border-radius: var(--tc-r-control);
  background: transparent; box-shadow: var(--tc-shadow-xs);
}
.tc-input, .tc-input-pill { height: 36px; padding: 0 12px; }
.tc-textarea { padding: 8px 12px; min-height: 64px; }
.tc-input:focus, .tc-textarea:focus, .tc-input-pill:focus {
  border-color: var(--tc-coral); box-shadow: 0 0 0 3px var(--sc-ring); background: #FFFFFF;
}
.tc-search {
  background: transparent; border: 1px solid var(--tc-border);
  padding: 0 12px; height: 36px; box-shadow: var(--tc-shadow-xs);
}
.tc-search:focus-within { border-color: var(--tc-coral); box-shadow: 0 0 0 3px var(--sc-ring); }

/* ── chips (toggle buttons) and badges ───────────────────────────────── */
.tc-chip {
  height: 32px; padding: 0 12px; font-weight: 500;
  border-radius: var(--tc-r-control); box-shadow: var(--tc-shadow-xs);
}
.tc-chip:hover { background: var(--tc-surface); border-color: var(--tc-border); }
.tc-chip-active, .tc-chip[aria-pressed="true"] {
  background: var(--tc-ink); border-color: var(--tc-ink); color: #FFFFFF;
}
.tc-chip-active:hover, .tc-chip[aria-pressed="true"]:hover { background: #27272A; border-color: #27272A; }

.tc-badge, .tc-badge-coral, .tc-badge-amber, .tc-badge-indigo {
  font: 500 14px/1.3 var(--tc-font); padding: 2px 8px;
  border-radius: 6px; letter-spacing: 0; text-transform: none;
  border: 1px solid transparent;
}
.tc-badge-coral { color: var(--tc-coral-ink); }

/* ── cards ───────────────────────────────────────────────────────────── */
.tc-card {
  border: 1px solid var(--tc-border); border-radius: var(--tc-r-2xl);
  box-shadow: var(--tc-shadow-sm);
}
.tc-card-sm { border: 1px solid var(--tc-border); border-radius: var(--tc-r-xl); box-shadow: var(--tc-shadow-xs); }
.tc-card-link:hover { border-color: var(--tc-disabled-alt); box-shadow: var(--tc-shadow-sm); }
.tc-modal-card { border: 1px solid var(--tc-border); border-radius: var(--tc-r-2xl); box-shadow: var(--tc-shadow-over); }

/* ── tabs ────────────────────────────────────────────────────────────── */
.tc-segmented { gap: 0; padding: 3px; border-radius: 10px; background: var(--tc-surface); }
.tc-segmented button {
  padding: 6px 12px; border-radius: 7px; color: var(--tc-meta); font-weight: 500;
  border: 1px solid transparent;
}
.tc-segmented button:hover { color: var(--tc-ink); }
.tc-segmented button.tc-on {
  background: #FFFFFF; color: var(--tc-ink);
  border-color: var(--tc-border); box-shadow: var(--tc-shadow-xs);
}

/* ── switch ──────────────────────────────────────────────────────────── */
.tc-toggle { width: 36px; height: 20px; border-radius: 999px; background: var(--tc-disabled-alt); }
.tc-toggle::after { top: 2px; left: 2px; width: 16px; height: 16px; box-shadow: var(--tc-shadow-sm); }
.tc-toggle:checked::after { transform: translateX(16px); }

/* ── top bar and nav ─────────────────────────────────────────────────── */
.topbar { background: rgba(255, 255, 255, .85); backdrop-filter: saturate(180%) blur(8px); }
.topnav a { font-weight: 500; border-radius: var(--tc-r-control); }
.topnav a.on { background: var(--tc-surface); color: var(--tc-ink); }

/* ── tables ──────────────────────────────────────────────────────────── */
.sites th {
  font: 500 14px/1.2 var(--tc-font); color: var(--tc-meta);
  text-transform: none; letter-spacing: 0;
  border-bottom: 1px solid var(--tc-border);
}
.sites tbody tr + tr td { border-top: 1px solid var(--tc-border); }
.sites tbody tr:hover td { background: rgba(244, 244, 245, .6); border-radius: 0 !important; }

/* ── menus and dialogs ───────────────────────────────────────────────── */
.tc-select-menu, .acctmenu {
  border: 1px solid var(--tc-border); border-radius: var(--tc-r-xl);
  box-shadow: var(--tc-shadow-over);
}

/* ── sentence case ───────────────────────────────────────────────────────
   shadcn writes labels the way they are read: "Building", "Signed in",
   "AI provider". The old system set two dozen of them in tracked capitals. */

/* Status pills: a small badge, 12px, no tracking. */
.st, .state, .caprow .state, .rtbadge, .capcount, .tc-badge-indigo, .appmark,
.chipstate, .pgrow .vp {
  text-transform: none !important; letter-spacing: 0 !important;
  font-size: 14px !important; font-weight: 500 !important;
  border-radius: 6px;
}

/* Column heads and small labels: muted, 13px, sentence case. */
.sites th, table.byprovider th, .accts th, .kpi .lab, .lim .lab,
.caprow .role, .tickall, .taskitems .tigroup, details.reply .tag,
details.reply .bax figcaption, .cmppane > .cap, .pggroup .lbl, .tc-micro {
  text-transform: none !important; letter-spacing: 0 !important;
  font-size: 14px; font-weight: 500;
}

/* An eyebrow that names a card is the card's title. */
.tc-eyebrow {
  text-transform: none !important; letter-spacing: -.01em !important;
  font: 600 14px/1.3 var(--tc-font) !important; color: var(--tc-ink) !important;
}

/* Card header rule: the border colour, as shadcn's CardHeader separators. */
.cardhead { border-bottom-color: var(--tc-border); }

/* Device switcher and other coral-filled tabs: the shadcn tab. */
.devseg { background: var(--tc-surface) !important; padding: 3px !important; border-radius: 10px !important; gap: 0 !important; }
.devseg button { border-radius: 7px !important; color: var(--tc-meta) !important; background: transparent !important; box-shadow: none !important; }
.devseg button.tc-on {
  background: #FFFFFF !important; color: var(--tc-ink) !important;
  box-shadow: var(--tc-shadow-xs);
}

/* Some state words are written in capitals in the templates themselves
   ("FAILED", "SIGNED IN"). Lower case, as the site page's own badge already
   reads ("building") — no CSS can capitalise only the first letter of an
   inline-flex pill. */
.state { text-transform: lowercase !important; padding: 2px 8px !important; }
