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

/* Straydog Talent — Linear-inspired monochrome design system (Light + Dark) */
:root {
  --bg: #f7f8fa;
  --surface: #ffffff;
  --surface-subtle: #f1f3f6;
  --surface-hover: #f4f5f8;
  --bar: #0b0c0f;
  --bar-border: rgba(255, 255, 255, .09);
  --border: rgba(15, 17, 21, .09);
  --border-strong: rgba(15, 17, 21, .17);
  --text: #0f1115;
  --text-2: #4b505c;
  --muted: #767c8a;
  --primary: #0f1115;
  --primary-hover: #242833;
  --primary-fg: #ffffff;
  --accent: #c8a84b;
  --accent-soft: rgba(200, 168, 75, .18);
  --red: #dc2626;
  --red-soft: rgba(220, 38, 38, .1);
  --amber: #d97706;
  --amber-soft: rgba(217, 119, 6, .12);
  --green-soft: #16a34a;
  --green: #15803d;
  --green-tint: rgba(22, 163, 74, .11);
  --blue: #2563eb;
  --purple: #7c3aed;
  --radius: 8px;
  --radius-sm: 6px;
  --shadow-sm: 0 1px 2px rgba(15, 17, 21, .04);
  --shadow: 0 1px 2px rgba(15, 17, 21, .05), 0 6px 20px rgba(15, 17, 21, .07);
  --font: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
}

[data-theme="dark"] {
  --bg: #0b0c0f;
  --surface: #13151b;
  --surface-subtle: #0f1116;
  --surface-hover: #1a1d26;
  --bar: #090a0d;
  --bar-border: rgba(255, 255, 255, .08);
  --border: rgba(255, 255, 255, .085);
  --border-strong: rgba(255, 255, 255, .17);
  --text: #f3f4f6;
  --text-2: #b4b9c5;
  --muted: #7c8291;
  --primary: #f3f4f6;
  --primary-hover: #ffffff;
  --primary-fg: #0b0c0f;
  --accent: #d4b458;
  --accent-soft: rgba(212, 180, 88, .18);
  --red: #f87171;
  --red-soft: rgba(248, 113, 113, .14);
  --amber: #fbbf24;
  --amber-soft: rgba(251, 191, 36, .14);
  --green-soft: #4ade80;
  --green: #34d399;
  --green-tint: rgba(52, 211, 153, .13);
  --blue: #60a5fa;
  --purple: #a78bfa;
  --shadow-sm: 0 1px 2px rgba(0, 0, 0, .3);
  --shadow: 0 2px 6px rgba(0, 0, 0, .4), 0 12px 32px rgba(0, 0, 0, .45);
}

*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0; background: var(--bg); color: var(--text);
  font: 14px/1.5 var(--font); -webkit-font-smoothing: antialiased;
  overflow-x: hidden; transition: background .15s ease, color .15s ease;
}
body.no-scroll { overflow: hidden; }
a { color: var(--text); text-decoration: none; }
a:hover { text-decoration: underline; text-underline-offset: 3px; }
h1, h2, h3 { color: var(--text); margin: 0; line-height: 1.25; letter-spacing: -.02em; font-weight: 600; }
button { font: inherit; }
.muted { color: var(--muted); }
.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
.ico { width: 14px; height: 14px; flex: none; display: inline-block; vertical-align: -2px; stroke: currentColor; fill: none; stroke-width: 1.65; stroke-linecap: round; stroke-linejoin: round; }

/* ---------- Buttons & inputs ---------- */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 6px;
  border: 1px solid var(--border-strong); background: var(--surface); color: var(--text);
  border-radius: 7px; padding: 6px 12px; font-weight: 500; font-size: 13px; cursor: pointer;
  text-decoration: none; white-space: nowrap; transition: background .12s, border-color .12s, opacity .12s;
  box-shadow: var(--shadow-sm);
}
.btn:hover { background: var(--surface-hover); border-color: var(--muted); text-decoration: none; }
.btn:disabled { opacity: .55; cursor: default; }
.btn-primary { background: var(--primary); border-color: var(--primary); color: var(--primary-fg); font-weight: 600; }
.btn-primary:hover { background: var(--primary-hover); border-color: var(--primary-hover); color: var(--primary-fg); }
.btn-danger { color: var(--red); border-color: var(--border); }
.btn-danger:hover { border-color: var(--red); background: var(--red-soft); }
.btn-small { padding: 4px 10px; font-size: 12.5px; }
.btn-block { width: 100%; padding: 8px 14px; }
.btn-link { background: none; border: 0; color: var(--text); text-decoration: underline; text-underline-offset: 3px; cursor: pointer; padding: 0; font-weight: 500; font-size: 13px; }
.btn-icon {
  display: inline-flex; align-items: center; justify-content: center;
  width: 30px; height: 30px; border-radius: 7px; cursor: pointer; padding: 0;
  border: 1px solid var(--border); background: var(--surface); color: var(--text-2);
  transition: background .12s, color .12s, border-color .12s;
}
.btn-icon:hover { background: var(--surface-hover); color: var(--text); border-color: var(--border-strong); }

.input {
  width: 100%; border: 1px solid var(--border-strong); border-radius: 7px; background: var(--surface);
  padding: 7px 10px; font: inherit; font-size: 13.5px; color: var(--text);
  transition: border-color .12s, box-shadow .12s;
}
.input::placeholder { color: var(--muted); }
.input:focus { outline: none; border-color: var(--text); box-shadow: 0 0 0 3px var(--accent-soft); }
textarea.input { resize: vertical; min-height: 70px; }
.form-error { color: var(--red); font-size: 13px; margin: 0; }

/* Segmented toggle (Board/List/Market, EN/ES) */
.seg { display: inline-flex; background: var(--surface-subtle); border: 1px solid var(--border); border-radius: 7px; padding: 2px; gap: 2px; }
.seg button { border: 0; background: none; color: var(--muted); padding: 4px 10px; border-radius: 5px; font-size: 12.5px; font-weight: 500; cursor: pointer; transition: color .12s, background .12s; }
.seg button:hover { color: var(--text); }
.seg button.is-active { background: var(--surface); color: var(--text); font-weight: 600; box-shadow: var(--shadow-sm); }
.topbar .seg, .sidebar .seg { background: rgba(255,255,255,.06); border-color: rgba(255,255,255,.12); }
.topbar .seg button, .sidebar .seg button { color: rgba(255,255,255,.62); }
.topbar .seg button:hover, .sidebar .seg button:hover { color: #fff; }
.topbar .seg button.is-active, .sidebar .seg button.is-active { background: rgba(255,255,255,.16); color: #fff; box-shadow: none; }
.topbar .btn-icon, .sidebar .btn-icon { background: rgba(255,255,255,.06); border-color: rgba(255,255,255,.12); color: rgba(255,255,255,.72); }
.topbar .btn-icon:hover, .sidebar .btn-icon:hover { background: rgba(255,255,255,.14); color: #fff; border-color: rgba(255,255,255,.22); }
.side-controls { display: flex; align-items: center; gap: 6px; margin-bottom: 10px; }

/* ---------- Status indicators & scores (Linear-style dots) ---------- */
.status-dot { width: 7px; height: 7px; border-radius: 50%; display: inline-block; flex: none; background: var(--blue); }
.status-pill[data-status="Submitted"] .status-dot, .column[data-status="Submitted"] .status-dot { background: var(--blue); }
.status-pill[data-status="Hiring Manager Screen"] .status-dot, .column[data-status="Hiring Manager Screen"] .status-dot { background: #0ea5e9; }
.status-pill[data-status="Tech Screen / Take Home Assignment"] .status-dot, .column[data-status="Tech Screen / Take Home Assignment"] .status-dot { background: var(--purple); }
.status-pill[data-status="Final Interview"] .status-dot, .column[data-status="Final Interview"] .status-dot { background: var(--amber); }
.status-pill[data-status="Offer"] .status-dot, .column[data-status="Offer"] .status-dot { background: var(--green-soft); }
.status-pill[data-status="Rejected"] .status-dot, .column[data-status="Rejected"] .status-dot { background: var(--muted); }

.status-pill {
  display: inline-flex; align-items: center; gap: 6px;
  background: var(--surface-subtle); border: 1px solid var(--border); color: var(--text);
  border-radius: 6px; padding: 2px 8px; font-size: 12px; font-weight: 500; white-space: nowrap;
}
.status-pill.is-terminal { color: var(--muted); }
.column-head .status-pill { background: none; border: 0; padding: 0; font-size: 13px; font-weight: 600; }

.score-pill, .score-chip {
  display: inline-flex; align-items: center; border-radius: 5px; padding: 1px 6px;
  font-size: 11.5px; font-weight: 600; white-space: nowrap; line-height: 1.5;
  font-variant-numeric: tabular-nums; border: 1px solid transparent;
}
.score-1 { color: var(--red); background: var(--red-soft); border-color: color-mix(in srgb, var(--red) 25%, transparent); }
.score-2 { color: var(--amber); background: var(--amber-soft); border-color: color-mix(in srgb, var(--amber) 25%, transparent); }
.score-3 { color: var(--green-soft); background: var(--green-tint); border-color: color-mix(in srgb, var(--green-soft) 25%, transparent); }
.score-4 { color: var(--green); background: var(--green-tint); border-color: color-mix(in srgb, var(--green) 30%, transparent); }

/* ---------- Message / gate screens ---------- */
.screen { min-height: 100vh; display: grid; place-items: center; padding: 24px 16px; }
.screen-card {
  width: 100%; max-width: 380px; background: var(--surface); border: 1px solid var(--border);
  border-radius: 12px; padding: 32px 26px 26px; text-align: center; box-shadow: var(--shadow);
  display: grid; gap: 12px;
}
.screen-card h1 { font-size: 18px; }
.screen-card p { margin: 0; font-size: 13.5px; }
.screen-logo { width: 220px; max-width: 100%; margin: -6px auto; display: block; mix-blend-mode: lighten; }
.screen-logo-wrap {
  background: var(--bar); border-bottom: 1px solid var(--bar-border);
  border-radius: 11px 11px 0 0; margin: -32px -26px 8px; padding: 20px 26px;
  display: flex; justify-content: center;
}
.screen-lang { margin-top: 4px; display: flex; justify-content: center; align-items: center; gap: 8px; }

/* ---------- Client top bar ---------- */
.topbar {
  position: sticky; top: 0; z-index: 10; background: var(--bar); color: #fff;
  border-bottom: 1px solid var(--bar-border); min-height: 52px;
  display: flex; align-items: center; gap: 14px; padding: 8px 20px; flex-wrap: wrap;
}
.brand { display: inline-flex; align-items: center; gap: 9px; color: var(--text); font-size: 12.5px; letter-spacing: .24em; font-weight: 500; white-space: nowrap; }
.brand img { height: 26px; width: auto; mix-blend-mode: lighten; }
.brand.is-white, .topbar .brand { color: #fff; }
.topbar-controls { display: flex; align-items: center; gap: 8px; }
.topbar-title { margin-left: auto; text-align: right; display: flex; flex-direction: column; line-height: 1.25; min-width: 0; }
.topbar-title strong { color: #fff; font-size: 14px; font-weight: 600; letter-spacing: -.01em; }
.topbar-title span { color: rgba(255,255,255,.58); font-size: 12px; }
.page { padding: 18px 20px 48px; max-width: 1520px; margin: 0 auto; }
.page-meta { margin: 0 0 12px; font-size: 12.5px; font-variant-numeric: tabular-nums; }
.empty { background: var(--surface); border: 1px dashed var(--border-strong); border-radius: var(--radius); padding: 40px; text-align: center; color: var(--muted); font-size: 13.5px; }

/* ---------- Board (Linear-style) ---------- */
.board { display: grid; grid-auto-flow: column; grid-auto-columns: minmax(252px, 1fr); gap: 12px; overflow-x: auto; padding-bottom: 8px; align-items: start; }
.column {
  background: var(--surface-subtle); border: 1px solid var(--border);
  border-radius: 10px; padding: 8px; min-width: 0; transition: background .12s, border-color .12s;
}
.column.drag-over { background: var(--surface-hover); border-color: var(--accent); }
.column.is-terminal { opacity: .68; }
.column-head { display: flex; align-items: center; justify-content: space-between; padding: 4px 6px 10px; gap: 8px; }
.column-count { color: var(--muted); font-size: 12px; font-weight: 500; font-variant-numeric: tabular-nums; }
.column-body { display: grid; gap: 8px; }
.column-empty { color: var(--muted); font-size: 12.5px; text-align: center; margin: 10px 0 12px; }

.card {
  background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius);
  padding: 11px 12px; cursor: pointer; min-width: 0; box-shadow: var(--shadow-sm);
  transition: border-color .12s, box-shadow .12s, transform .12s;
}
.card:hover { border-color: var(--border-strong); box-shadow: var(--shadow); }
.card.is-dragging { opacity: .38; }
.card[draggable="true"] { cursor: grab; }
.card[draggable="true"]:active { cursor: grabbing; }
.card.drop-before { box-shadow: 0 -2px 0 0 var(--accent), var(--shadow); }
.card.drop-after { box-shadow: 0 2px 0 0 var(--accent), var(--shadow); }
.card-head { display: flex; align-items: center; gap: 9px; }
.card-name { font-weight: 600; font-size: 13.5px; color: var(--text); flex: 1; min-width: 0; overflow-wrap: anywhere; letter-spacing: -.01em; }
.card-head .score-pill { align-self: center; }
.card-body { margin-top: 7px; padding-left: 35px; display: grid; gap: 3px; font-size: 12.5px; color: var(--text-2); }
.card-row { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; display: flex; align-items: center; gap: 5px; }
.card-row a { color: var(--text-2); }
.card-row a:hover { color: var(--text); }
.card-location { color: var(--muted); }

.avatar {
  flex: none; width: 26px; height: 26px; border-radius: 50%;
  background: var(--surface-subtle); border: 1px solid var(--border-strong); color: var(--text);
  display: inline-grid; place-items: center; font-size: 11px; font-weight: 600; letter-spacing: .02em;
}

/* ---------- List ---------- */
.list-wrap { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); overflow: hidden; }
.list { width: 100%; border-collapse: collapse; }
.list th {
  text-align: left; font-size: 11.5px; text-transform: uppercase; letter-spacing: .05em;
  color: var(--muted); font-weight: 500; padding: 10px 14px; border-bottom: 1px solid var(--border);
  background: var(--surface-subtle);
}
.list td { padding: 10px 14px; border-bottom: 1px solid var(--border); vertical-align: middle; font-size: 13.5px; }
.list tr:last-child td { border-bottom: 0; }
.list-row { cursor: pointer; transition: background .1s; }
.list-row:hover { background: var(--surface-hover); }
.list-row.is-terminal td { color: var(--muted); }
.list-candidate { display: flex; align-items: center; gap: 10px; font-weight: 600; color: var(--text); }
.list-row.is-terminal .list-candidate { color: var(--muted); }

/* ---------- Drawer & profile ---------- */
.drawer-wrap { position: fixed; inset: 0; z-index: 50; }
.drawer-overlay { position: absolute; inset: 0; background: rgba(9, 10, 13, .45); backdrop-filter: blur(4px); opacity: 0; transition: opacity .18s; }
.drawer {
  position: absolute; top: 0; right: 0; bottom: 0; width: min(600px, 100%);
  background: var(--surface); border-left: 1px solid var(--border);
  box-shadow: -12px 0 36px rgba(0, 0, 0, .18); transform: translateX(100%);
  transition: transform .2s cubic-bezier(.16, 1, .3, 1); overflow-y: auto; overscroll-behavior: contain;
}
.drawer-wrap.is-open .drawer-overlay { opacity: 1; }
.drawer-wrap.is-open .drawer { transform: none; }
.drawer-close {
  position: sticky; top: 14px; float: right; margin: 14px 14px 0 0; width: 30px; height: 30px;
  border-radius: 7px; border: 1px solid var(--border); background: var(--surface);
  cursor: pointer; color: var(--muted); display: inline-flex; align-items: center; justify-content: center; z-index: 2;
}
.drawer-close:hover { color: var(--text); border-color: var(--border-strong); background: var(--surface-hover); }
.drawer-content { padding: 24px 26px 48px; }

.profile-head { display: flex; align-items: center; gap: 13px; padding-right: 36px; margin-bottom: 8px; }
.profile-head .avatar { width: 42px; height: 42px; font-size: 14px; }
.profile-head h2 { font-size: 19px; overflow-wrap: anywhere; }
.profile-sub { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; margin-top: 4px; color: var(--muted); font-size: 13px; }
.profile-extra:empty { display: none; }
.profile-extra { margin: 14px 0 4px; }
.profile-section { padding: 16px 0; border-top: 1px solid var(--border); }
.profile-head + .profile-extra + .profile-section, .profile-head + .profile-extra:empty + .profile-section { margin-top: 12px; }
.profile-section h3 { font-size: 11.5px; text-transform: uppercase; letter-spacing: .06em; color: var(--muted); font-weight: 600; margin-bottom: 10px; }
.chips { display: flex; flex-wrap: wrap; gap: 8px; }
.chip {
  display: inline-flex; align-items: center; gap: 6px;
  border: 1px solid var(--border-strong); border-radius: 7px; padding: 5px 10px;
  font-size: 13px; color: var(--text); max-width: 100%; overflow-wrap: anywhere; text-decoration: none;
  background: var(--surface-subtle);
}
.chip:hover { border-color: var(--text); text-decoration: none; }
.resume-box {
  display: flex; align-items: center; gap: 10px; border: 1px solid var(--border-strong);
  border-radius: var(--radius); padding: 10px 13px; color: var(--text); text-decoration: none;
  background: var(--surface-subtle); transition: border-color .12s, background .12s;
}
.resume-box:hover { border-color: var(--text); background: var(--surface-hover); text-decoration: none; }
.resume-icon { color: var(--text-2); display: inline-flex; }
.resume-label { flex: 1; font-weight: 500; font-size: 13.5px; min-width: 0; overflow-wrap: anywhere; }
.resume-open { color: var(--text-2); font-weight: 500; font-size: 12.5px; white-space: nowrap; }
.rec-badge {
  display: inline-flex; align-items: center; gap: 6px;
  border-radius: 6px; padding: 5px 10px; font-weight: 600; font-size: 13px; border: 1px solid;
}
.rec-badge.is-green { color: var(--green); background: var(--green-tint); border-color: color-mix(in srgb, var(--green) 28%, transparent); }
.rec-badge.is-amber { color: var(--amber); background: var(--amber-soft); border-color: color-mix(in srgb, var(--amber) 28%, transparent); }
.notes { margin: 0; padding-left: 18px; display: grid; gap: 6px; color: var(--text-2); }
.notes li::marker { color: var(--muted); }
.notes strong { color: var(--text); }
.to-consider { margin: 12px 0 0; color: var(--text-2); }
.to-consider strong { color: var(--text); }
.av { display: grid; gap: 7px; color: var(--text-2); }
.av-row strong { color: var(--text); font-weight: 500; }

/* ---------- Feedback ---------- */
.fb-note { background: var(--surface-subtle); border: 1px solid var(--border); border-radius: var(--radius); padding: 10px 12px; margin-bottom: 8px; }
.fb-meta { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; font-size: 12.5px; }
.fb-meta strong { color: var(--text); font-weight: 600; }
.fb-text { margin: 6px 0 0; white-space: pre-wrap; overflow-wrap: anywhere; color: var(--text-2); font-size: 13.5px; }
.fb-empty { margin: 0 0 10px; font-size: 13px; }
.fb-delete { margin-left: auto; border: 0; background: none; cursor: pointer; color: var(--muted); padding: 3px 5px; border-radius: 5px; display: inline-flex; align-items: center; }
.fb-delete:hover { color: var(--red); background: var(--red-soft); }
.fb-form { display: grid; gap: 8px; border-top: 1px solid var(--border); padding-top: 12px; margin-top: 8px; }
.fb-actions { display: flex; justify-content: flex-end; }

/* ---------- Toasts ---------- */
.toasts { position: fixed; bottom: 18px; left: 50%; transform: translateX(-50%); z-index: 100; display: grid; gap: 8px; width: max-content; max-width: calc(100vw - 32px); }
.toast { background: var(--bar); color: #fff; border: 1px solid var(--bar-border); padding: 9px 14px; border-radius: 8px; box-shadow: var(--shadow); font-size: 13px; font-weight: 500; animation: toast-in .18s ease; transition: opacity .25s; }
.toast-error { background: var(--red); border-color: transparent; color: #fff; }
.toast.is-leaving { opacity: 0; }
@keyframes toast-in { from { transform: translateY(6px); opacity: 0; } }

/* ---------- Admin ---------- */
.admin-shell { display: grid; grid-template-columns: 244px 1fr; min-height: 100vh; }
.sidebar a { text-decoration: none; }
.sidebar {
  background: var(--bar); color: rgba(255,255,255,.72); border-right: 1px solid var(--bar-border);
  padding: 16px 12px; display: flex; flex-direction: column; gap: 4px;
  position: sticky; top: 0; height: 100vh; overflow-y: auto;
}
.side-brand { margin: 2px 6px 16px; padding: 0 !important; font-size: 12px; }
.side-brand:hover { background: none !important; }
.sidebar a.side-brand { display: inline-flex; width: auto; color: #fff; }
.side-menu { display: flex; flex-direction: column; gap: 2px; flex: 1; }
.sidebar a, .sidebar button.side-link {
  display: block; color: rgba(255,255,255,.78); padding: 6px 9px; border-radius: 6px;
  font-size: 13px; font-weight: 500; text-decoration: none; background: none; border: 0;
  text-align: left; width: 100%; cursor: pointer; transition: background .1s, color .1s;
}
.sidebar a:hover, .sidebar button.side-link:hover { background: rgba(255,255,255,.07); color: #fff; text-decoration: none; }
.sidebar a.is-active { background: rgba(255,255,255,.12); color: #fff; font-weight: 600; }
.side-new { color: var(--accent) !important; font-weight: 600; }
.side-label { font-size: 11px; text-transform: uppercase; letter-spacing: .07em; color: rgba(255,255,255,.4); margin: 14px 9px 4px; font-weight: 600; }
.side-pipelines { display: grid; gap: 2px; }
.side-pipelines a small { display: block; color: rgba(255,255,255,.45); font-size: 11.5px; font-weight: 400; }
.side-foot { margin-top: auto; padding: 12px 6px 0; font-size: 12px; color: rgba(255,255,255,.48); border-top: 1px solid var(--bar-border); overflow-wrap: anywhere; }
.side-foot button[data-signout] { background: none; border: 0; color: rgba(255,255,255,.82); cursor: pointer; padding: 0; font-size: 12px; text-decoration: underline; }
.side-toggle { display: none; }

.admin-main { padding: 24px 28px 64px; min-width: 0; }
.admin-head { display: flex; align-items: flex-start; gap: 14px; flex-wrap: wrap; margin-bottom: 18px; }
.admin-head h1 { font-size: 20px; }
.admin-head .sub { color: var(--muted); margin-top: 3px; font-size: 13px; display: flex; flex-wrap: wrap; align-items: center; gap: 8px; }
.admin-actions { margin-left: auto; display: flex; gap: 6px; flex-wrap: wrap; }
.panel { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); padding: 18px; box-shadow: var(--shadow-sm); }
.panel + .panel { margin-top: 14px; }
.table-wrap { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); overflow-x: auto; }
.table { width: 100%; border-collapse: collapse; font-size: 13.5px; }
.table th { text-align: left; font-size: 11.5px; text-transform: uppercase; letter-spacing: .05em; color: var(--muted); font-weight: 500; padding: 10px 14px; border-bottom: 1px solid var(--border); background: var(--surface-subtle); white-space: nowrap; }
.table td { padding: 11px 14px; border-bottom: 1px solid var(--border); vertical-align: middle; font-variant-numeric: tabular-nums; }
.table tr:last-child td { border-bottom: 0; }
.table td small { display: block; color: var(--muted); font-size: 12px; }
.table .actions { display: flex; gap: 6px; justify-content: flex-end; flex-wrap: wrap; }
.link-box { display: grid; gap: 8px; background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); padding: 13px 15px; margin-bottom: 16px; box-shadow: var(--shadow-sm); }
.link-box .row { display: flex; gap: 10px; align-items: center; flex-wrap: wrap; font-size: 13px; }
.link-box .label { font-size: 11.5px; text-transform: uppercase; letter-spacing: .05em; color: var(--muted); min-width: 72px; font-weight: 500; }
.link-box a, .link-box code { overflow-wrap: anywhere; }
.link-box a { text-decoration: underline; text-decoration-color: var(--border-strong); text-underline-offset: 3px; }
.link-box code { font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace; font-size: 12.5px; background: var(--surface-subtle); border: 1px solid var(--border); padding: 2px 6px; border-radius: 5px; }
.badge { display: inline-flex; align-items: center; font-size: 11.5px; font-weight: 500; border-radius: 5px; padding: 2px 8px; border: 1px solid transparent; }
.badge-warn { background: var(--amber-soft); color: var(--amber); border-color: color-mix(in srgb, var(--amber) 25%, transparent); }
.badge-ok { background: var(--green-tint); color: var(--green); border-color: color-mix(in srgb, var(--green) 25%, transparent); }
.badge-muted { background: var(--surface-subtle); color: var(--muted); border-color: var(--border); }
.badge-frozen { background: rgba(37, 99, 235, .1); color: var(--blue); border-color: rgba(37, 99, 235, .22); }
.frozen-note { display: flex; align-items: center; gap: 8px; background: rgba(37, 99, 235, .08); color: var(--blue); border: 1px solid rgba(37, 99, 235, .2); border-radius: var(--radius); padding: 10px 14px; margin-bottom: 16px; font-size: 13px; }

/* Unbranded "not available" page (unknown or frozen client links) */
body.is-plain { background: #fff; color: #333; font: 15px/1.5 system-ui, -apple-system, "Segoe UI", sans-serif; }
.screen-plain { text-align: center; max-width: 420px; }
.screen-plain h1 { color: #222; font-size: 19px; font-weight: 600; margin-bottom: 8px; }
.screen-plain p { color: #777; margin: 0; }

.form { display: grid; gap: 16px; max-width: 760px; }
.form fieldset { border: 1px solid var(--border); border-radius: var(--radius); padding: 16px 18px 18px; margin: 0; background: var(--surface); display: grid; gap: 13px; }
.form legend { font-weight: 600; font-size: 13px; color: var(--text); padding: 0 6px; letter-spacing: -.01em; }
.field { display: grid; gap: 5px; }
.field > span { font-size: 12.5px; font-weight: 500; color: var(--text); }
.field small { color: var(--muted); font-size: 12px; }
.grid-2 { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.input-row { display: flex; gap: 8px; }
.input-row .input { flex: 1; min-width: 0; }
.bullets { display: grid; gap: 6px; }
.bullet-row { display: flex; gap: 6px; align-items: center; }
.bullet-row::before { content: '•'; color: var(--muted); }
.bullet-row .input { flex: 1; min-width: 0; }
.icon-btn { flex: none; width: 30px; height: 30px; border: 1px solid var(--border); border-radius: 6px; background: var(--surface); color: var(--muted); cursor: pointer; display: inline-flex; align-items: center; justify-content: center; }
.icon-btn:hover { color: var(--red); border-color: var(--red); background: var(--red-soft); }
.resume-current { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; font-size: 13px; }
.form-actions { display: flex; gap: 8px; justify-content: flex-end; flex-wrap: wrap; }
.stage-select { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; background: var(--surface-subtle); border: 1px solid var(--border); border-radius: var(--radius); padding: 10px 12px; }
.stage-select select { width: auto; flex: 1; min-width: 150px; }
.code-area { font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace; font-size: 12.5px; min-height: 240px; }
.login-note { font-size: 12.5px; }
.loading { color: var(--muted); padding: 40px 0; text-align: center; font-size: 13.5px; }

/* ---------- Market Research Insights ---------- */
.market-wrap { display: grid; gap: 14px; }
.market-h { font-size: 11.5px; text-transform: uppercase; letter-spacing: .06em; color: var(--muted); font-weight: 600; margin: 0 0 12px; }
.market-summary-text { margin: 0; white-space: pre-wrap; color: var(--text-2); font-size: 14px; line-height: 1.6; }
.market-summary-text strong { color: var(--text); }
.market-kpis { display: grid; grid-template-columns: repeat(auto-fit, minmax(190px, 1fr)); gap: 10px; }
.kpi-card { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); padding: 14px 16px; box-shadow: var(--shadow-sm); }
.kpi-label { font-size: 11.5px; text-transform: uppercase; letter-spacing: .05em; color: var(--muted); font-weight: 500; }
.kpi-value { font-size: 22px; font-weight: 600; letter-spacing: -.03em; color: var(--text); margin-top: 6px; overflow-wrap: anywhere; font-variant-numeric: tabular-nums; }
.market-grid { display: grid; grid-template-columns: 1fr 1.3fr; gap: 14px; align-items: start; }
.market-grid.is-single { grid-template-columns: 1fr; }
.funnel { display: grid; gap: 12px; }
.funnel-row { display: grid; gap: 6px; }
.funnel-meta { display: flex; justify-content: space-between; align-items: baseline; gap: 8px; font-size: 13px; }
.funnel-label { color: var(--text); font-weight: 500; }
.funnel-num { color: var(--text); white-space: nowrap; font-variant-numeric: tabular-nums; }
.funnel-track { height: 6px; background: var(--surface-subtle); border-radius: 999px; overflow: hidden; }
.funnel-bar { height: 100%; background: var(--primary); border-radius: 999px; transition: width .25s ease; }
.market-notes { gap: 9px; font-size: 13.5px; line-height: 1.55; }
.charts-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(280px, 1fr)); gap: 14px; }
.chart-card { margin: 0; border: 1px solid var(--border); border-radius: var(--radius); overflow: hidden; background: var(--surface-subtle); }
.chart-card a { display: block; background: var(--surface); }
.chart-card img { width: 100%; height: auto; max-height: 420px; object-fit: contain; display: block; }
.chart-card figcaption { padding: 9px 12px; font-size: 12.5px; color: var(--muted); border-top: 1px solid var(--border); }
.kv-list { display: grid; gap: 8px; }
.kv-row { display: grid; grid-template-columns: 1fr 130px auto; gap: 8px; align-items: center; }
.kv-row.is-metric { grid-template-columns: 1fr 1fr auto; }
.chart-edit-row { display: grid; grid-template-columns: 72px 1fr auto; gap: 10px; align-items: start; padding: 10px; border: 1px solid var(--border); border-radius: 8px; background: var(--surface-subtle); }
.chart-edit-thumb { width: 72px; height: 54px; object-fit: cover; border-radius: 6px; border: 1px solid var(--border); background: var(--surface); }
.chart-edit-fields { display: grid; gap: 6px; }
mark.hl { background: var(--accent-soft); color: var(--text); padding: 1px 4px; border-radius: 4px; font-weight: 500; }
code.inline-code { font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace; font-size: .88em; background: var(--surface-subtle); border: 1px solid var(--border); padding: 1px 5px; border-radius: 4px; }
.fmt-bar { display: flex; flex-wrap: wrap; align-items: center; gap: 5px; margin-bottom: 4px; }
.fmt-btn { display: inline-flex; align-items: center; gap: 4px; border: 1px solid var(--border-strong); background: var(--surface-subtle); color: var(--text); border-radius: 5px; padding: 3px 8px; font-size: 12px; font-weight: 600; cursor: pointer; line-height: 1.4; }
.fmt-btn:hover { border-color: var(--text); background: var(--surface); }
.fmt-hint { font-size: 11.5px; color: var(--muted); margin-left: auto; }

/* ---------- Responsive ---------- */
@media (max-width: 760px) {
  .topbar { padding: 8px 14px; gap: 10px; }
  .brand { font-size: 11.5px; letter-spacing: .2em; gap: 7px; }
  .brand img { height: 22px; }
  .topbar-title { order: 3; width: 100%; margin-left: 0; text-align: left; flex-direction: row; flex-wrap: wrap; gap: 0 8px; align-items: baseline; }
  .topbar-controls { margin-left: auto; }
  .page { padding: 14px 14px 40px; }
  .board { grid-auto-columns: minmax(78vw, 1fr); scroll-snap-type: x mandatory; }
  .column { scroll-snap-align: start; }
  .col-location { display: none; }
  .list th, .list td { padding: 9px 12px; }
  .drawer-content { padding: 18px 16px 40px; }

  .admin-shell { grid-template-columns: 1fr; }
  .sidebar { position: static; height: auto; padding: 10px 14px; flex-direction: row; flex-wrap: wrap; align-items: center; gap: 4px; }
  .side-brand { margin: 0 auto 0 0; width: auto !important; }
  .side-toggle { display: inline-block; background: rgba(255,255,255,.1); color: #fff; border: 0; border-radius: 6px; padding: 5px 10px; font-size: 12.5px; cursor: pointer; }
  .sidebar .side-menu { display: none; width: 100%; }
  .sidebar.is-open .side-menu { display: grid; gap: 2px; padding-top: 10px; }
  .side-foot { margin-top: 10px; }
  .admin-main { padding: 18px 14px 48px; }
  .admin-actions { margin-left: 0; }
  .grid-2 { grid-template-columns: 1fr; }
  .market-grid { grid-template-columns: 1fr; }
  .kv-row, .kv-row.is-metric { grid-template-columns: 1fr 1fr auto; }
}
@media (max-width: 420px) {
  .col-avg { display: none; }
}
