/* Clue UI mockups — shared stylesheet.
   Tokens, base and the app shell (sidebar, topbar, content box) used by every
   referrer and admin page. Page-specific and component styles stay in each
   page's own <style> block, which loads after this file. */

/* ============ Clue design tokens ============ */

:root {
  /* Brand (CLUE REBRAND FINAL) */
  --teal-900: #023D3B;
  --teal-800: #06302E;   /* dark chart surface */
  --teal-700: #0B4F49;
  --green-500: #00D37F;
  --purple-500: #7161E2;
  --blue-300: #A7C5F9;
  --lime-100: #F0FFE1;

  /* Validated categorical palette — light surface */
  --cat-1: #00A76B;  /* green  */
  --cat-2: #7161E2;  /* purple */
  --cat-3: #00917F;  /* teal   */
  --cat-4: #4E82EE;  /* blue   */

  /* Validated categorical palette — dark surface (#06302E) */
  --cat-dark-1: #00AC6B;
  --cat-dark-2: #8F7FF2;
  --cat-dark-3: #2AA893;
  --cat-dark-4: #5C8EF0;

  /* Ordinal teal ramp (funnel) */
  --ord-1: #0B4F49;
  --ord-2: #147A6C;
  --ord-3: #2AA893;
  --ord-4: #55BBA4;

  /* Ink */
  --ink-900: #0C2321;
  --ink-600: #47605D;
  --ink-400: #7A908D;
  --line-200: #E4EBE7;
  --surface: #FFFFFF;
  --page-bg: #F5F8F4;

  /* Status */
  --status-good: #00A76B;
  --status-warn: #C77700;
  --status-bad: #D6455D;

  --radius: 20px;
  --shadow: none;
  --card-border: rgba(2,61,59,.09);
}

* { margin:0; padding:0; box-sizing:border-box; }

html { -webkit-font-smoothing: antialiased; }

body {
  font-family: 'Hanken Grotesk', -apple-system, 'Segoe UI', sans-serif;
  background: var(--teal-900);
  color: var(--ink-900);
  font-size: 14px;
  line-height: 1.45;
}

::selection { background: var(--green-500); color: var(--teal-900); }

/* Shell: nav floats on the teal ground; the content box is the only
   surface — rounded on its left corners, bleeding off top/right/bottom. */

.app { display: flex; height: 100svh; padding: 14px 0; }

/* ============ Sidebar (transparent, on the teal ground) ============ */

.sidebar {
  color: var(--lime-100);
  padding: 14px 16px 10px;
  width: 298px; flex-shrink: 0;
  display: flex; flex-direction: column; gap: 4px;
  overflow-y: auto;
}

.logo { display:flex; align-items:center; gap:2px; padding: 4px 12px 26px; }

.logo img { height: 28px; width:auto; display:block; }

.nav-label {
  font-size: 10.5px; font-weight: 700; letter-spacing: .1em; text-transform: uppercase;
  color: rgba(240,255,225,.45); padding: 14px 12px 6px;
}

.nav-item {
  display:flex; align-items:center; gap:11px;
  padding: 9px 12px; border-radius: 10px;
  color: rgba(240,255,225,.78); text-decoration: none;
  font-weight: 400; font-size: 13.5px;
  transition: background .15s, color .15s;
}

.nav-item:hover { background: rgba(240,255,225,.08); color: var(--lime-100); }

.nav-item.active { background: var(--green-500); color: var(--teal-900); font-weight: 700; }

.nav-item svg { width:17px; height:17px; flex:none; stroke-width: 1.5; }

.nav-item .pill {
  margin-left:auto; font-size: 11px; font-weight: 700;
  background: var(--purple-500); color:#fff;
  border-radius: 99px; padding: 1px 7px;
}

.nav-item.active .pill { background: var(--teal-900); color: var(--lime-100); }

.sidebar .spacer { flex: 1; }

.upsell {
  margin: 8px 4px 0; padding: 14px; border-radius: 14px;
  background: linear-gradient(135deg, rgba(113,97,226,.35), rgba(0,211,127,.18));
  border: 1px solid rgba(240,255,225,.14);
}

.upsell h4 { font-size: 13px; font-weight: 700; margin-bottom: 4px; }

.upsell p { font-size: 12px; color: rgba(240,255,225,.7); margin-bottom: 10px; }

.upsell a {
  display:inline-block; font-size: 12px; font-weight: 700; color: var(--teal-900);
  background: var(--green-500); padding: 6px 12px; border-radius: 8px; text-decoration: none;
}

.account {
  display:flex; align-items:center; gap: 10px; width: 100%;
  margin-top: 12px; padding: 8px 10px;
  background: none; border: none; border-radius: 12px; cursor: pointer;
  color: var(--lime-100); font: inherit; text-align: left;
}

.account:hover { background: rgba(240,255,225,.08); }

.account .account-id { flex: 1; min-width: 0; display:flex; flex-direction: column; }

.account .name { font-size: 13px; font-weight: 600; line-height: 1.2; }

.account .org { font-size: 11.5px; color: rgba(240,255,225,.55); line-height: 1.25; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }

.account > svg { width: 15px; height: 15px; flex: none; color: rgba(240,255,225,.5); }

.sidebar-footer {
  margin-top: 10px; padding-top: 8px;
  border-top: 1px solid rgba(240,255,225,.12);
  display:flex; flex-direction: column; gap: 2px;
}

.nav-util {
  display:flex; align-items:center; gap: 11px;
  padding: 7px 12px; border-radius: 10px;
  color: rgba(240,255,225,.62); text-decoration: none;
  font-weight: 400; font-size: 12.5px;
}

.nav-util:hover { background: rgba(240,255,225,.08); color: var(--lime-100); }

.nav-util svg { width: 15px; height: 15px; flex: none; }

/* ============ Main: THE BOX ============ */

.app-main {
  flex: 1; min-width: 0;
  display: flex; flex-direction: column;
  background: var(--page-bg);
  border-top-left-radius: 26px;
  border-bottom-left-radius: 26px;
  overflow: hidden;
}

/* Thin context strip inside the box */

.topbar {
  display: flex; align-items: center; gap: 10px;
  flex-shrink: 0;
  height: 54px; padding: 0 32px;
  border-bottom: 1px solid rgba(2,61,59,.09);
  background: #fff;
}

.breadcrumbs { display:flex; align-items:center; gap: 6px; font-size: 13px; color: var(--ink-400); }

.breadcrumbs a { color: var(--ink-400); text-decoration: none; }

.breadcrumbs a:hover { color: var(--teal-900); text-decoration: underline; text-underline-offset: 3px; }

.breadcrumbs svg { width: 13px; height: 13px; opacity: .55; }

.breadcrumbs b { color: var(--ink-900); font-weight: 600; }

.topbar-actions { margin-left:auto; display:flex; align-items:center; gap: 4px; }

.icon-btn {
  width: 34px; height: 34px; border:none; background:none; border-radius: 9px;
  display:flex; align-items:center; justify-content:center; cursor:pointer;
  color: var(--teal-900); position: relative;
}

.icon-btn:hover { background: rgba(2,61,59,.07); }

.icon-btn svg { width: 17px; height: 17px; }

.icon-btn .count {
  position:absolute; top: 1px; right: -1px;
  min-width: 15px; height: 15px; padding: 0 4px; border-radius: 99px;
  background: var(--green-500); color: var(--teal-900);
  font-size: 10px; font-weight: 800; line-height: 15px;
  box-shadow: 0 0 0 2px #fff;
}

/* Scrolling content region inside the box */

.content { flex: 1; overflow-y: auto; padding: 26px 32px 44px; }

/* Cap content width on large screens; cards centre in the box */

.content > * { max-width: 1536px; margin-left: auto; margin-right: auto; }

.page-header .sub { color: var(--ink-400); font-size: 13px; margin-top: 1px; }

.btn-primary:hover { filter: brightness(.96); }

.btn-ghost:hover { background: var(--teal-900); border-color: var(--teal-900); color: var(--lime-100); }

/* ==================================================================
   Shared components (added with the admin portal, 26 Oct 2026).
   Prefixed names (.dlg-, .fm-, .chk, .toast) so they can't collide
   with the per-page component styles in the referrer mockups.
   ================================================================== */

/* ---- Dialog: centred panel over a dimmed teal backdrop ---- */
.dlg-backdrop {
  position: fixed; inset: 0; z-index: 50;
  background: rgba(2,61,59,.45);
  display: none; align-items: center; justify-content: center;
  padding: 24px;
}
.dlg-backdrop.open { display: flex; }
.dlg {
  background: #fff; border-radius: 22px;
  width: 100%; max-width: 560px; max-height: calc(100svh - 48px);
  display: flex; flex-direction: column; overflow: hidden;
  box-shadow: 0 24px 60px rgba(2,30,29,.25);
}
.dlg-head {
  display: flex; align-items: center; gap: 12px;
  padding: 18px 24px; border-bottom: 1px solid rgba(2,61,59,.08);
}
.dlg-head h2 { font-size: 17px; font-weight: 800; letter-spacing: -.01em; }
.dlg-head .sub { font-size: 12.5px; color: var(--ink-400); margin-top: 1px; }
.dlg-close {
  margin-left: auto; width: 32px; height: 32px; border-radius: 9px;
  border: none; background: none; color: var(--ink-400); cursor: pointer;
  display: flex; align-items: center; justify-content: center;
}
.dlg-close:hover { background: rgba(2,61,59,.07); color: var(--ink-900); }
.dlg-close svg { width: 17px; height: 17px; }
.dlg-body { padding: 20px 24px; overflow-y: auto; }
.dlg-foot {
  display: flex; align-items: center; gap: 8px;
  padding: 14px 24px; border-top: 1px solid rgba(2,61,59,.08);
  background: var(--page-bg);
}
.dlg-foot .left { margin-right: auto; display: flex; align-items: center; gap: 12px; }

/* ---- Form fields ---- */
.fm-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 14px 16px; }
.fm-field { display: flex; flex-direction: column; gap: 6px; min-width: 0; }
.fm-field.wide { grid-column: 1 / -1; }
.fm-field label { font-size: 12.5px; font-weight: 600; color: var(--ink-600); }
.fm-field input, .fm-field select, .fm-field textarea {
  font: inherit; font-size: 13.5px; color: var(--ink-900);
  width: 100%; padding: 0 12px; height: 40px;
  background: #fff; border: 1px solid rgba(2,61,59,.16); border-radius: 11px;
  outline: none; transition: border-color .15s, box-shadow .15s;
}
.fm-field textarea { height: auto; padding: 10px 12px; line-height: 1.5; resize: vertical; }
.fm-field input:focus, .fm-field select:focus, .fm-field textarea:focus {
  border-color: var(--teal-900); box-shadow: 0 0 0 3px rgba(2,61,59,.1);
}
.fm-field input::placeholder, .fm-field textarea::placeholder { color: var(--ink-400); }
.fm-hint { font-size: 12px; color: var(--ink-400); line-height: 1.45; }

/* ---- Checkbox (custom box, native input kept for a11y) ---- */
.chk { display: inline-flex; align-items: center; gap: 9px; cursor: pointer; font-size: 13px; }
.chk input { position: absolute; opacity: 0; pointer-events: none; }
.chk .box {
  width: 17px; height: 17px; border-radius: 5px; flex: none;
  border: 1.5px solid rgba(2,61,59,.3); background: #fff;
  display: flex; align-items: center; justify-content: center;
  transition: background .12s, border-color .12s;
}
.chk .box svg { width: 11px; height: 11px; color: var(--lime-100); opacity: 0; }
.chk input:checked + .box { background: var(--teal-900); border-color: var(--teal-900); }
.chk input:checked + .box svg { opacity: 1; }
.chk input:focus-visible + .box { box-shadow: 0 0 0 3px rgba(2,61,59,.15); }
.chk input:disabled + .box { background: rgba(2,61,59,.05); border-color: rgba(2,61,59,.12); }

/* ---- Toast ---- */
.toast {
  position: fixed; left: 50%; bottom: 28px; z-index: 60;
  transform: translate(-50%, 20px); opacity: 0; pointer-events: none;
  display: flex; align-items: center; gap: 10px;
  background: var(--teal-900); color: var(--lime-100);
  border-radius: 99px; padding: 11px 20px; font-size: 13px; font-weight: 600;
  box-shadow: 0 12px 30px rgba(2,30,29,.25);
  transition: opacity .2s, transform .2s;
}
.toast.show { opacity: 1; transform: translate(-50%, 0); }
.toast svg { width: 16px; height: 16px; color: var(--green-500); }

/* ---- Account chip avatar (admin pages) ---- */
.account .acct-avatar {
  width: 30px; height: 30px; border-radius: 50%; flex: none;
  background: var(--cat-3); color: #fff; font-weight: 700; font-size: 12px;
  display: flex; align-items: center; justify-content: center;
}
