/* ═══════════════════════════════════════════════════════════════════════════
   GroundTruth™ Design System — groundtruth.css
   Brand Guide 2026 — canonical design tokens and component classes
   Metriq Tanzania Limited — metriqos.net
   ═══════════════════════════════════════════════════════════════════════════ */

/* ── DESIGN TOKENS ─────────────────────────────────────────────────────────── */
:root {
  /* GroundTruth colour tokens */
  --gt-teal:        #0E8A7B;
  --gt-teal-deep:   #0a6b5e;
  --gt-teal-50:     #f0fdfa;
  --gt-teal-100:    #d6f0eb;

  /* Field navy */
  --gt-ink:         #0A1A24;
  --gt-ink-2:       #0E2730;
  --gt-ink-3:       #123039;

  /* Signal states */
  --gt-signal:      #19C37D;
  --gt-amber:       #F59E0B;
  --gt-red:         #EF4444;

  /* Neutrals */
  --gt-paper:       #F4F8F7;
  --gt-card:        #ffffff;
  --gt-border:      #E4ECEA;
  --gt-border-2:    #D3DEDB;
  --gt-text:        #0F1F26;
  --gt-muted:       #5C6B6E;
  --gt-faint:       #94A4A3;

  /* Shadows */
  --sh-sm:          0 1px 3px rgba(8,30,28,.08);
  --sh:             0 8px 26px rgba(8,30,28,.1);
  --sh-drawer:      -18px 0 50px rgba(6,22,20,.16);

  /* Convenience aliases */
  --gt-teal-border: var(--gt-teal-100);
  --gt-teal-light:  var(--gt-teal-50);
  --gt-bg:          var(--gt-paper);
  --gt-surface:     var(--gt-paper);
  --gt-error:       var(--gt-red);

  /* Semantic signal aliases */
  --gt-success:     var(--gt-signal);
  --gt-warn:        var(--gt-amber);
  --gt-orange:      var(--gt-amber);

  /* Legacy surface aliases */
  --gt-navy:        var(--gt-ink);
  --gt-field-navy:  #0B1829;
}

/* ── CONTOUR MOTIF ─────────────────────────────────────────────────────────── */
/*
 * Usage: add <div class="contour-bg"></div> as first child of any dark surface.
 *
 * Example markup:
 * <div class="contour-bg">
 *   <svg viewBox="0 0 400 400" fill="none" xmlns="http://www.w3.org/2000/svg">
 *     <circle cx="200" cy="200" r="80"  stroke="#0E8A7B" stroke-width="1.2"/>
 *     <circle cx="200" cy="200" r="120" stroke="#0E8A7B" stroke-width="1.0"/>
 *     <circle cx="200" cy="200" r="165" stroke="#0E8A7B" stroke-width="0.9"/>
 *     <circle cx="200" cy="200" r="215" stroke="#0E8A7B" stroke-width="0.8"/>
 *     <ellipse cx="190" cy="180" rx="95" ry="75" stroke="#0E8A7B" stroke-width="0.7"/>
 *   </svg>
 * </div>
 */
.contour-bg {
  position: absolute;
  inset: 0;
  pointer-events: none;
  overflow: hidden;
  border-radius: inherit;
}
.contour-bg svg {
  position: absolute;
  width: 140%;
  height: 140%;
  top: -20%;
  left: -20%;
  opacity: 0.35;
}

/* ── TYPOGRAPHY ────────────────────────────────────────────────────────────── */
.gt-display     { font-size: 24px; font-weight: 800; letter-spacing: -0.02em; }
.gt-page-title  { font-size: 20px; font-weight: 800; }
.gt-card-title  { font-size: 15px; font-weight: 800; }
.gt-body        { font-size: 13px; font-weight: 400; line-height: 1.55; }
.gt-body-md     { font-size: 14px; font-weight: 500; }
.gt-label       { font-size: 11px; font-weight: 800; letter-spacing: 0.07em; text-transform: uppercase; color: var(--gt-muted); }
.gt-num         { font-variant-numeric: tabular-nums; letter-spacing: -0.01em; }

/* ── BUTTONS ───────────────────────────────────────────────────────────────── */
.gt-btn-primary {
  display: inline-flex; align-items: center; gap: 6px;
  padding: 10px 20px; border-radius: 9px;
  background: var(--gt-teal); color: #fff;
  font-size: 13px; font-weight: 700; letter-spacing: 0.02em;
  border: none; cursor: pointer; text-decoration: none;
  box-shadow: 0 4px 14px rgba(14,138,123,.28);
  transition: background .15s, box-shadow .15s;
}
.gt-btn-primary:hover {
  background: var(--gt-teal-deep);
  box-shadow: 0 6px 18px rgba(14,138,123,.35);
}

.gt-btn-signal {
  /* Used on dark surfaces: CTA like "Start next response" */
  background: var(--gt-signal); color: var(--gt-ink);
  box-shadow: 0 4px 14px rgba(25,195,125,.28);
}
.gt-btn-signal:hover { filter: brightness(1.05); }

.gt-btn-ghost {
  background: transparent; color: var(--gt-text);
  border: 1px solid var(--gt-border-2); box-shadow: none;
}
.gt-btn-ghost:hover { background: var(--gt-paper); }

.gt-btn-ghost-dark {
  background: transparent; color: rgba(255,255,255,.75);
  border: 1px solid rgba(255,255,255,.2);
}

/* ── STATUS BADGES ─────────────────────────────────────────────────────────── */
.gt-badge            { display: inline-flex; align-items: center; padding: 3px 10px; border-radius: 999px; font-size: 11px; font-weight: 700; letter-spacing: 0.04em; }
.gt-badge-published  { background: #DEF7EC; color: #046C4E; }
.gt-badge-continuous { background: #EAF1FE; color: #1E40AF; }
.gt-badge-draft      { background: #EEF1F0; color: var(--gt-muted); }
.gt-badge-review     { background: #FEF3C7; color: #92400E; }
.gt-badge-validated  { background: #DEF7EC; color: #046C4E; }
.gt-badge-rejected   { background: #FEE2E2; color: #991B1B; }

/* ── DATAPULSE™ RINGS ──────────────────────────────────────────────────────── */
.gt-dp-ring                     { display: inline-flex; align-items: center; justify-content: center; position: relative; }
.gt-dp-ring svg                 { transform: rotate(-90deg); }
.gt-dp-ring circle              { fill: none; stroke-linecap: round; }
.gt-dp-ring .track              { stroke: var(--gt-border); }
.gt-dp-ring .arc-signal         { stroke: var(--gt-signal); }
.gt-dp-ring .arc-amber          { stroke: var(--gt-amber); }
.gt-dp-ring .arc-red            { stroke: var(--gt-red); }
.gt-dp-ring .label              { position: absolute; font-size: 10px; font-weight: 800; color: var(--gt-text); font-variant-numeric: tabular-nums; }
/* Sizes */
.gt-dp-ring-sm { width: 26px; height: 26px; }
.gt-dp-ring-md { width: 48px; height: 48px; }
.gt-dp-ring-lg { width: 74px; height: 74px; }

/* ── FLAG PILLS ────────────────────────────────────────────────────────────── */
.gt-flag          { display: inline-flex; align-items: center; gap: 4px; padding: 2px 8px; border-radius: 999px; font-size: 11px; font-weight: 700; }
.gt-flag-fence    { background: #FEE2E2; color: #991B1B; }
.gt-flag-straight { background: #FEE2E2; color: #991B1B; }
.gt-flag-low-dqa  { background: #FEF3C7; color: #92400E; }
.gt-flag-clean    { background: #DEF7EC; color: #046C4E; }

/* ── SYNC CHIP ─────────────────────────────────────────────────────────────── */
.gt-sync-chip    { display: inline-flex; align-items: center; gap: 6px; padding: 4px 10px; border-radius: 999px; font-size: 11px; font-weight: 600; }
.gt-sync-online  { background: rgba(25,195,125,.12); color: var(--gt-signal); }
.gt-sync-offline { background: rgba(245,158,11,.12); color: var(--gt-amber); }
.gt-sync-pending { background: rgba(245,158,11,.08); color: var(--gt-amber); }
.gt-sync-led { width: 6px; height: 6px; border-radius: 50%; flex-shrink: 0; }
.gt-sync-online  .gt-sync-led { background: var(--gt-signal); box-shadow: 0 0 0 3px rgba(25,195,125,.2); }
.gt-sync-offline .gt-sync-led { background: var(--gt-amber); }

/* ── TOGGLE ────────────────────────────────────────────────────────────────── */
.gt-toggle { width: 36px; height: 20px; border-radius: 999px; border: none; cursor: pointer; position: relative; transition: background .2s; }
.gt-toggle[aria-checked="true"]  { background: var(--gt-teal); }
.gt-toggle[aria-checked="false"] { background: var(--gt-border-2); }
.gt-toggle::after { content:''; position:absolute; width:14px; height:14px; border-radius:50%; background:#fff; top:3px; transition: left .2s; }
.gt-toggle[aria-checked="true"]::after  { left: 19px; }
.gt-toggle[aria-checked="false"]::after { left: 3px; }

/* ── NAVIGATION TABS (5-group) ─────────────────────────────────────────────── */
.gt-nav-tabs    { display: flex; gap: 2px; border-bottom: 1px solid var(--gt-border); }
.gt-nav-tab     { display: flex; flex-direction: column; align-items: center; padding: 10px 18px; border-bottom: 2px solid transparent; cursor: pointer; text-decoration: none; color: var(--gt-muted); font-size: 12px; font-weight: 700; letter-spacing: 0.03em; transition: color .15s, border-color .15s; }
.gt-nav-tab:hover                          { color: var(--gt-teal); }
.gt-nav-tab.active                         { color: var(--gt-teal); border-bottom-color: var(--gt-teal); }
.gt-nav-tab-caption                        { font-size: 10px; font-weight: 500; color: var(--gt-faint); margin-top: 2px; }
.gt-nav-tab.active .gt-nav-tab-caption     { color: var(--gt-teal-deep); }

/* ── CARDS & SURFACES ──────────────────────────────────────────────────────── */
.gt-card          { background: var(--gt-card); border: 1px solid var(--gt-border); border-radius: 16px; }
.gt-card-sm       { border-radius: 10px; }
.gt-surface-dark  { background: var(--gt-ink); color: #fff; }
.gt-surface-panel { background: var(--gt-ink-2); }

/* ── UNIFIED EMPTY STATES ──────────────────────────────────────────────────── */
.gt-empty          { text-align: center; padding: 56px 24px; }
.gt-empty-icon     { width: 56px; height: 56px; border-radius: 14px; background: rgba(14,138,123,.1); display: flex; align-items: center; justify-content: center; margin: 0 auto 16px; font-size: 22px; color: var(--gt-teal); }
.gt-empty-title    { font-size: 15px; font-weight: 700; color: var(--gt-text); margin-bottom: 6px; }
.gt-empty-desc     { font-size: 13px; color: var(--gt-muted); line-height: 1.6; max-width: 360px; margin: 0 auto 20px; }
/* Compact variant — used inside table cells and sidebars */
.gt-empty-sm       { text-align: center; padding: 28px 16px; }
.gt-empty-sm i     { display: block; font-size: 22px; margin-bottom: 8px; color: var(--gt-border-2); }
.gt-empty-sm p     { font-size: 13px; color: var(--gt-muted); margin: 0; }

/* ── UTILITIES ─────────────────────────────────────────────────────────────── */
.gt-mono { font-family: 'Courier New', monospace; font-size: 12px; letter-spacing: 0.02em; }

.gt-required { color: var(--gt-error, #EF4444); font-weight: 700; margin-left: 2px; }

.gt-msg         { padding: 10px 14px; border-radius: 8px; font-size: 13px; font-weight: 500; margin-top: 8px; }
.gt-msg-success { background: #D1FAE5; color: #065F46; border: 1px solid #6EE7B7; }
.gt-msg-error   { background: #FEE2E2; color: #991B1B; border: 1px solid #FCA5A5; }

/* ── TOKEN ROW (inline input + button) ────────────────────────────────────── */
.gc-token-row      { display: flex; gap: 10px; align-items: stretch; margin-top: 8px; }
.gc-token-input    { flex: 1 1 0; min-width: 0; width: auto !important; margin: 0 !important; }
.gc-token-btn      { flex: 0 0 auto; white-space: nowrap; padding: 0 18px; height: 46px; border-radius: 10px; min-width: fit-content; }
