/* ============================================================
   ALL IN ALL MATRIMONY — shared design system
   Direction: Modern minimal (Linear/Vercel) with the brand's
   orange + yellow + black + white + gray palette.
   Base breakpoints: 360 / 390-430 / 600-744 / 768-834 /
   1024-1180 / 1280-1366 / 1440-1536 / 1920
   ============================================================ */

:root {
  /* Neutral surfaces (white + gray) */
  --bg:              oklch(98.2% 0.004 60);
  --surface:         oklch(100% 0 0);
  --surface-2:       oklch(97% 0.004 60);
  --surface-3:       oklch(93.5% 0.008 60);
  --fg:              oklch(17% 0.015 60);   /* near-black ink */
  --muted:           oklch(52% 0.012 60);
  --muted-2:         oklch(64% 0.012 60);
  --border:          oklch(90.5% 0.008 60);
  --border-strong:   oklch(82% 0.012 60);

  /* Brand accents — orange primary, yellow domain highlight, black */
  --accent:          oklch(56% 0.21 45);    /* orange */
  --accent-strong:   oklch(47% 0.20 45);    /* pressed / deep orange */
  --accent-soft:     oklch(95% 0.06 45);    /* orange tint */
  --accent-2:        oklch(84% 0.18 95);    /* yellow highlight */
  --accent-2-soft:   oklch(96% 0.08 95);
  --dark:            oklch(15% 0.015 60);   /* black */
  --on-accent:       oklch(99% 0 0);

  /* Status */
  --success:         oklch(52% 0.16 150);
  --success-soft:    oklch(95% 0.04 150);
  --danger:          oklch(55% 0.20 27);
  --danger-soft:     oklch(95% 0.05 27);
  --warn:            oklch(62% 0.16 75);
  --warn-soft:       oklch(96% 0.05 75);
  --info:            oklch(55% 0.14 245);
  --info-soft:       oklch(95% 0.03 245);

  /* Type */
  --font-display: -apple-system, BlinkMacSystemFont, 'SF Pro Display', 'Segoe UI', system-ui, sans-serif;
  --font-body:    -apple-system, BlinkMacSystemFont, 'SF Pro Text', 'Segoe UI', system-ui, sans-serif;
  --font-mono:    'JetBrains Mono', 'IBM Plex Mono', ui-monospace, Menlo, monospace;

  /* Radii */
  --r-sm: 6px;
  --r-md: 9px;
  --r-lg: 14px;
  --r-xl: 18px;
  --r-pill: 999px;

  /* Elevation */
  --shadow-1: 0 1px 2px oklch(20% 0.02 60 / 0.06);
  --shadow-2: 0 6px 18px oklch(20% 0.02 60 / 0.08), 0 2px 5px oklch(20% 0.02 60 / 0.05);
  --shadow-3: 0 18px 44px oklch(15% 0.02 60 / 0.16);

  --maxw: 1200px;
  --gutter: clamp(16px, 4vw, 48px);
}

* { box-sizing: border-box; }

html, body { margin: 0; padding: 0; }

body {
  font-family: var(--font-body);
  color: var(--fg);
  background: var(--bg);
  font-size: 15.5px;
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}

/* ---------- Layout helpers ---------- */
.container { max-width: var(--maxw); margin: 0 auto; padding: 0 var(--gutter); }
.shell { max-width: 1240px; margin: 0 auto; padding: 0 var(--gutter); }
.stack { display: flex; flex-direction: column; gap: var(--sp-x, 12px); }
.row { display: flex; align-items: center; gap: var(--sp-x, 12px); }
.wrap { flex-wrap: wrap; }
.between { justify-content: space-between; }
.grid { display: grid; gap: var(--sp-x, 16px); }

/* ---------- Typography ---------- */
h1, h2, h3, h4, .display {
  font-family: var(--font-display);
  color: var(--fg);
  letter-spacing: -0.02em;
  line-height: 1.12;
  margin: 0;
}
h1 { font-size: clamp(28px, 4vw, 40px); font-weight: 700; letter-spacing: -0.03em; }
h2 { font-size: clamp(22px, 3vw, 30px); font-weight: 700; }
h3 { font-size: clamp(17px, 2vw, 20px); font-weight: 650; }
h4 { font-size: 16px; font-weight: 650; }

.eyebrow {
  font-family: var(--font-body);
  font-size: 11px;
  font-weight: 650;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--accent);
  margin: 0 0 8px;
}
.lead { font-size: clamp(16px, 2vw, 18px); color: var(--muted); line-height: 1.55; max-width: 60ch; }
.muted { color: var(--muted); }
.small { font-size: 13px; }
.tiny { font-size: 11.5px; }
.mono { font-family: var(--font-mono); font-variant-numeric: tabular-nums; }
.tnum { font-variant-numeric: tabular-nums; }
strong { font-weight: 650; }

/* ---------- Buttons ---------- */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  font-family: var(--font-body); font-size: 14px; font-weight: 600;
  line-height: 1; padding: 10px 16px; border-radius: var(--r-pill);
  cursor: pointer; border: 1px solid transparent; text-decoration: none;
  transition: transform .05s ease, background .15s ease, box-shadow .15s ease;
  white-space: nowrap; min-height: 40px;
}
.btn:active { transform: translateY(1px); }
.btn-primary { background: var(--accent); color: var(--on-accent); }
.btn-primary:hover { background: var(--accent-strong); }
.btn-dark { background: var(--dark); color: #fff; }
.btn-dark:hover { background: oklch(24% 0.015 60); }
.btn-outline { background: var(--surface); color: var(--fg); border-color: var(--border-strong); }
.btn-outline:hover { border-color: var(--fg); }
.btn-ghost { background: transparent; color: var(--muted); }
.btn-ghost:hover { color: var(--fg); background: var(--surface-2); }
.btn-sm { min-height: 32px; padding: 7px 12px; font-size: 13px; }
.btn-lg { min-height: 48px; padding: 14px 22px; font-size: 15.5px; }
.btn-block { width: 100%; }
.btn[disabled] { opacity: .45; cursor: not-allowed; }

/* ---------- Cards ---------- */
.card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--r-lg);
  padding: 20px;
}
.card-elev { box-shadow: var(--shadow-1); }
.card-hover { transition: transform .15s ease, box-shadow .15s ease, border-color .15s ease; }
.card-hover:hover { transform: translateY(-2px); box-shadow: var(--shadow-2); border-color: var(--border-strong); }
.card-flat { background: transparent; border: 1px dashed var(--border-strong); }

/* Section header on panel pages */
.panel-wrap { min-height: 100vh; }
.panel-head {
  display: flex; align-items: center; justify-content: space-between; gap: 16px;
  margin-bottom: 22px; flex-wrap: wrap;
}
.panel-head h2 { margin: 0; }

/* ---------- Chips / pills / tags ---------- */
.chip {
  display: inline-flex; align-items: center; gap: 6px;
  font-size: 12.5px; font-weight: 600; padding: 5px 11px;
  border-radius: var(--r-pill); border: 1px solid var(--border);
  background: var(--surface); color: var(--fg); white-space: nowrap;
}
.chip.on { background: var(--accent); border-color: var(--accent); color: #fff; }
.tag { display: inline-flex; align-items: center; gap: 5px; font-size: 11px; font-weight: 650;
  padding: 3px 9px; border-radius: var(--r-pill); letter-spacing: .02em; }
.tag-accent { background: var(--accent-soft); color: var(--accent-strong); }
.tag-yellow { background: var(--accent-2-soft); color: oklch(45% 0.16 90); }
.tag-gray { background: var(--surface-3); color: var(--muted); }
.tag-success { background: var(--success-soft); color: oklch(38% 0.13 150); }
.tag-danger { background: var(--danger-soft); color: oklch(42% 0.16 27); }
.tag-warn { background: var(--warn-soft); color: oklch(46% 0.13 75); }
.tag-dark { background: var(--dark); color: #fff; }
.dot { width: 7px; height: 7px; border-radius: 50%; display: inline-block; }
.dot.on { background: var(--success); }
.dot.off { background: var(--border-strong); }
.dot.accent { background: var(--accent); }
.dot.yellow { background: var(--accent-2); }
.dot.danger { background: var(--danger); }

/* ---------- Avatars / profile photo placeholders ---------- */
.avatar {
  border-radius: var(--r-md); background: var(--surface-3);
  flex: none; display: grid; place-items: center; overflow: hidden;
  color: var(--accent-strong); font-weight: 700;
}
.avatar img { width: 100%; height: 100%; object-fit: cover; display: block; }

/* ---------- Inputs ---------- */
.field { display: flex; flex-direction: column; gap: 6px; }
.field label { font-size: 12.5px; font-weight: 600; color: var(--muted); }
.input, .select, textarea.input {
  font-family: var(--font-body); font-size: 14.5px; color: var(--fg);
  background: var(--surface); border: 1px solid var(--border-strong);
  border-radius: var(--r-md); padding: 10px 12px; min-height: 42px; width: 100%;
  transition: border-color .15s ease, box-shadow .15s ease;
}
.input:focus, .select:focus, textarea.input:focus {
  outline: none; border-color: var(--accent);
  box-shadow: 0 0 0 3px oklch(56% 0.21 45 / 0.14);
}
textarea.input { resize: vertical; min-height: 90px; }
.input-group { display: flex; gap: 8px; align-items: stretch; }

/* ---------- Tables ---------- */
.table { width: 100%; border-collapse: collapse; font-size: 13.5px; }
.table th {
  text-align: left; font-size: 11px; font-weight: 650; text-transform: uppercase;
  letter-spacing: .06em; color: var(--muted); padding: 10px 12px;
  border-bottom: 1px solid var(--border); white-space: nowrap;
}
.table td { padding: 13px 12px; border-bottom: 1px solid var(--border); vertical-align: middle; }
.table tbody tr:last-child td { border-bottom: none; }
.table tbody tr:hover { background: var(--surface-2); }
.table .num, .tnum { font-variant-numeric: tabular-nums; }
.table-wrap { overflow-x: auto; }

/* ---------- Status bars / meters ---------- */
.meter { height: 8px; border-radius: var(--r-pill); background: var(--surface-3); overflow: hidden; }
.meter > span { display: block; height: 100%; border-radius: var(--r-pill); background: var(--accent); }
.score-ring { position: relative; width: 72px; height: 72px; flex: none; }
.score-ring svg { transform: rotate(-90deg); }
.score-ring .num { position: absolute; inset: 0; display: grid; place-items: center; font-weight: 750; font-size: 15px; }

/* ---------- Match-score color scale ---------- */
.m-exc  { color: oklch(40% 0.16 140); }
.m-exc-f{ stroke: oklch(60% 0.18 150); }
.m-exc-bg{ background: var(--success); }
.m-strong { color: oklch(45% 0.16 90); }
.m-strong-f { stroke: var(--accent-2); }
.m-strong-bg { background: var(--accent-2); }
.m-excellent { color: oklch(42% 0.16 70); }
.m-excellent-f { stroke: oklch(60% 0.18 70); }
.m-excellent-bg { background: oklch(60% 0.18 70); }
.m-potential { color: oklch(52% 0.09 60); }
.m-potential-f { stroke: var(--muted); }
.m-caution { color: var(--accent-strong); }
.m-caution-f { stroke: var(--accent); }

/* Score band legend */
.band { display: flex; align-items: center; gap: 6px; font-size: 12px; color: var(--muted); }

/* ---------- Chat (AI conversational search) ---------- */
.chat { display: flex; flex-direction: column; gap: 12px; }
.msg { max-width: 78%; padding: 11px 15px; border-radius: var(--r-lg); font-size: 14.5px; line-height: 1.5; }
.msg-user { align-self: flex-end; background: var(--accent); color: #fff; border-bottom-right-radius: var(--r-sm); }
.msg-ai { align-self: flex-start; background: var(--surface); border: 1px solid var(--border); border-bottom-left-radius: var(--r-sm); }
.msg-ai.is-thinking { color: var(--muted); font-style: italic; }
.chat-input { display: flex; gap: 8px; align-items: center; }
.chat-input .input { border-radius: var(--r-pill); }

/* Filter "SEARCH UNDERSTOOD" panel */
.found-panel { border: 1px solid var(--border); border-radius: var(--r-lg); background: var(--surface); overflow: hidden; }
.found-panel .fp-head { display: flex; align-items: center; gap: 8px; padding: 12px 16px; background: var(--surface-2); border-bottom: 1px solid var(--border); font-weight: 650; font-size: 13px; }
.fp-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(180px, 1fr)); gap: 1px; background: var(--border); }
.fp-cell { background: var(--surface); padding: 10px 14px; }
.fp-cell .k { font-size: 11px; color: var(--muted); text-transform: uppercase; letter-spacing: .05em; font-weight: 600; }
.fp-cell .v { font-size: 14px; font-weight: 650; margin-top: 2px; }

/* ---------- Nav ---------- */
.topnav {
  position: sticky; top: 0; z-index: 50;
  background: color-mix(in oklab, var(--surface) 86%, transparent);
  backdrop-filter: blur(12px);
  border-bottom: 1px solid var(--border);
}
.topnav .inner { display: flex; align-items: center; gap: 20px; height: 60px; }
.brand { display: flex; align-items: center; gap: 9px; font-family: var(--font-display); font-weight: 750; letter-spacing: -0.02em; text-decoration: none; color: var(--fg); font-size: 17px; }
.brand-mark { width: 28px; height: 28px; border-radius: 8px; background: var(--dark); display: grid; place-items: center; color: #fff; font-weight: 800; font-size: 13px; flex: none; }
.brand-mark.accent { background: var(--accent); }
.nav-links { display: flex; gap: 4px; margin-left: auto; }
.nav-links a { padding: 8px 12px; border-radius: var(--r-md); color: var(--muted); font-size: 14px; font-weight: 550; text-decoration: none; transition: .12s; }
.nav-links a:hover { color: var(--fg); background: var(--surface-2); }
.nav-links a.on { color: var(--fg); background: var(--surface-2); }

/* Sidebar layout for panels */
.app { display: flex; min-height: 100vh; }
.sidebar {
  width: 244px; flex: none; background: var(--dark); color: oklch(90% 0.01 60);
  display: flex; flex-direction: column; padding: 18px 14px; gap: 4px;
  position: sticky; top: 0; height: 100vh; overflow-y: auto;
}
.sidebar .side-brand { display: flex; align-items: center; gap: 10px; padding: 4px 8px 18px; color: #fff; }
.sidebar .side-brand .brand-mark { background: var(--accent); }
.side-label { font-size: 10.5px; text-transform: uppercase; letter-spacing: .1em; color: oklch(60% 0.01 60); padding: 16px 10px 6px; font-weight: 650; }
.side-link { display: flex; align-items: center; gap: 10px; padding: 9px 10px; border-radius: var(--r-md); color: oklch(78% 0.01 60); font-size: 13.5px; font-weight: 550; text-decoration: none; transition: .12s; }
.side-link:hover { background: oklch(28% 0.02 60); color: #fff; }
.side-link.on { background: var(--accent); color: #fff; }
.side-link .ico { width: 16px; text-align: center; opacity: .9; }
.main { flex: 1; min-width: 0; padding: 26px var(--gutter) 60px; }
.main-top { display: flex; align-items: center; gap: 12px; }
.crumb { font-size: 13px; color: var(--muted); }
.crumb b { color: var(--fg); font-weight: 650; }

/* icon button */
.icon-btn { width: 38px; height: 38px; border-radius: var(--r-md); border: 1px solid var(--border); background: var(--surface); display: grid; place-items: center; cursor: pointer; color: var(--fg); }
.icon-btn:hover { border-color: var(--border-strong); background: var(--surface-2); }

/* prose */
.kv { display: grid; grid-template-columns: auto 1fr; gap: 4px 18px; font-size: 13.5px; }
.kv dt { color: var(--muted); font-weight: 550; }
.kv dd { margin: 0; font-weight: 600; }

.divider { height: 1px; background: var(--border); border: none; margin: 18px 0; }

/* stat card */
.stat { background: var(--surface); border: 1px solid var(--border); border-radius: var(--r-lg); padding: 16px 18px; }
.stat .label { font-size: 12px; color: var(--muted); font-weight: 600; }
.stat .value { font-family: var(--font-mono); font-variant-numeric: tabular-nums; font-size: 26px; font-weight: 700; letter-spacing: -0.02em; margin-top: 4px; }
.stat .delta { font-size: 12px; font-weight: 650; margin-top: 4px; }
.delta.up { color: var(--success); }
.delta.down { color: var(--danger); }

/* Tabs */
.tabs { display: flex; gap: 4px; border-bottom: 1px solid var(--border); overflow-x: auto; }
.tab { padding: 10px 14px; font-size: 13.5px; font-weight: 600; color: var(--muted); cursor: pointer; border-bottom: 2px solid transparent; white-space: nowrap; background: transparent; font-family: var(--font-body); }
.tab.on { color: var(--fg); border-bottom-color: var(--accent); }

/* Bottom nav (customer mobile) */
.bottomnav {
  position: sticky; bottom: 0; z-index: 40;
  background: color-mix(in oklab, var(--surface) 90%, transparent);
  backdrop-filter: blur(12px);
  border-top: 1px solid var(--border);
  display: none;
}
.bottomnav .inner { display: grid; grid-template-columns: repeat(5, 1fr); height: 60px; }
.bottomnav a { display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 3px; font-size: 10.5px; color: var(--muted); text-decoration: none; font-weight: 600; }
.bottomnav a.on { color: var(--accent); }
.bottomnav a .bi { font-size: 19px; line-height: 1; }

/* responsive helpers */
@media (max-width: 900px) {
  .sidebar { width: 72px; padding: 18px 8px; }
  .sidebar .side-brand .b-text, .sidebar .side-link span, .sidebar .side-label { display: none; }
  .side-label { padding: 12px 0 6px; }
  .side-link { justify-content: center; padding: 11px; }
}
@media (max-width: 720px) {
  .sidebar { display: none; }
  .app { display: block; }
  .main-top { position: sticky; top: 0; z-index: 30; background: color-mix(in oklab, var(--surface) 90%, transparent); backdrop-filter: blur(12px); padding: 10px 0; border-bottom: 1px solid var(--border); margin-bottom: 16px; }
  .nav-links { display: none; }
  .bottomnav { display: block; }
}
@media (min-width: 721px) { .bottomnav { display: none; } }

/* hide empty placeholder */
.stub { display: flex; flex-direction: column; gap: 6px; }
.stub .line { height: 10px; border-radius: 4px; background: var(--surface-3); }
