/*
 * Concierge UI — base styles.
 * Tailwind v4 utility classes are injected at runtime by the browser CDN.
 * This file holds only custom properties and overrides that can't be
 * expressed as utility classes.
 */

/*
 * Brand gold ramp, anchored on #B0894F at the 600 step.
 * Perceptually even in OKLCH (hue 76.048) so hover/border/tint steps stay
 * in family. Hex equivalents are noted for reference only.
 */
:root {
  --color-gold-50:  oklch(97.5% 0.013 76.048); /* #FCF6EE */
  --color-gold-100: oklch(95.0% 0.025 76.048); /* #F8EDDC */
  --color-gold-200: oklch(90.5% 0.045 76.048); /* #F1DCBF */
  --color-gold-300: oklch(84.5% 0.064 76.048); /* #E5C79E */
  --color-gold-400: oklch(75.5% 0.082 76.048); /* #CEA974 */
  --color-gold-500: oklch(70.0% 0.089 76.048); /* #BE975D */
  --color-gold-600: oklch(65.5% 0.089 76.048); /* #B0894F — brand */
  --color-gold-700: oklch(57.5% 0.085 76.048); /* #96723B */
  --color-gold-800: oklch(49.0% 0.073 76.048); /* #785A2D */
  --color-gold-900: oklch(41.5% 0.061 76.048); /* #5F4723 */
  --color-gold-950: oklch(29.0% 0.045 76.048); /* #382810 */
}

/*
 * Retarget Tailwind's indigo palette onto the gold ramp.
 * Tailwind v4 compiles `bg-indigo-600` to `var(--color-indigo-600)`, so
 * redefining these variables recolors every existing `indigo-*` utility
 * (buttons, highlights, focus rings, tints) without touching the templates.
 * These declarations are unlayered, so they beat Tailwind's `@layer theme`
 * defaults regardless of stylesheet order.
 */
:root {
  --color-indigo-50:  var(--color-gold-50);
  --color-indigo-100: var(--color-gold-100);
  --color-indigo-200: var(--color-gold-200);
  --color-indigo-300: var(--color-gold-300);
  --color-indigo-400: var(--color-gold-400);
  --color-indigo-500: oklch(56% 0.084 76.048);
  --color-indigo-600: oklch(53% 0.081 76.048);
  --color-indigo-700: var(--color-gold-800);
  --color-indigo-800: var(--color-gold-800);
  --color-indigo-900: var(--color-gold-900);
  --color-indigo-950: var(--color-gold-950);
}

/*
 * Accessibility: the indigo 500 to 700 steps above are darker than the brand
 * gold on purpose, so white text on a button and small gold text on white or
 * on a tint reach 4.5:1 (WCAG AA). The brand gold itself stays at gold-600.
 * Tailwind's gray 400 and 500 are darkened for the same reason, because small
 * captions use them on white and on gray-100.
 */
:root {
  --color-gray-400: #6b7280;
  --color-gray-500: #5b6472;
}

/* Penguin UI / Arctic theme tokens */
:root {
  --color-primary:        #b0894f; /* gold-600 */
  --color-primary-hover:  #96723b; /* gold-700 */
  --color-surface:        #f9fafb; /* gray-50   */
  --color-surface-raised: #ffffff;
  --color-border:         #e5e7eb; /* gray-200  */
  --color-text:           #111827; /* gray-900  */
  --color-text-muted:     #6b7280; /* gray-500  */
  --sidebar-width:        16rem;
}

/* Remove Drupal's default body margin/padding on agent pages */
body.concierge-agent {
  margin: 0;
  padding: 0;
  background-color: var(--color-surface);
  color: var(--color-text);
  font-family: ui-sans-serif, system-ui, sans-serif;
}

body.concierge-agent #toolbar-administration {
  /* Let Drupal toolbar coexist */
}

/* Scrollbar styling */
::-webkit-scrollbar { width: 6px; height: 6px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb { background: #d1d5db; border-radius: 3px; }

/* Transition helpers used by Alpine */
[x-cloak] { display: none !important; }

/* OAuth approval page — style Drupal's default form buttons */
.path-oauth .form-submit[value="Allow"] {
  flex: 1;
  background-color: var(--color-primary);
  color: white;
  font-weight: 600;
  font-size: 0.875rem;
  padding: 0.625rem 1.25rem;
  border: none;
  border-radius: 0.75rem;
  cursor: pointer;
  transition: background-color 0.15s;
}
.path-oauth .form-submit[value="Allow"]:hover { background-color: var(--color-primary-hover); }

.path-oauth .form-submit[value="Deny"] {
  flex: 1;
  background-color: white;
  color: #6b7280;
  font-weight: 600;
  font-size: 0.875rem;
  padding: 0.625rem 1.25rem;
  border: 1px solid #e5e7eb;
  border-radius: 0.75rem;
  cursor: pointer;
  transition: all 0.15s;
}
.path-oauth .form-submit[value="Deny"]:hover { border-color: #d1d5db; color: #374151; }

/*
 * ── Dashboard chart palette ──────────────────────────────────────────────
 * Canvas can't read CSS custom properties, so app.js resolves these once via
 * getComputedStyle() and hands the values to Chart.js. Keeping them here means
 * the charts move with the brand ramp above instead of drifting into Chart.js
 * defaults.
 *
 * Every value below was checked with the dataviz palette validator against the
 * white chart surface (light mode only — this theme has no dark mode):
 *
 *  - Categorical (outreach channels): blue/orange/aqua PASS all six checks
 *    (worst all-pairs CVD ΔE 9.2, normal-vision ΔE 24.0). The brand gold
 *    CANNOT be a categorical slot — its chroma is 0.089, below the 0.10 floor,
 *    so it reads as gray under CVD and collided with aqua at ΔE 5.5.
 *  - Ordinal (donut stages): gold 400/600/800 PASS (monotone L, ΔL ≥ 0.06,
 *    light end 2.20:1 vs white). Gold 300 was rejected — 1.62:1, under the 2:1
 *    floor.
 *  - Aqua sits at 2.82:1, just under 3:1. The mandated relief is shipped: every
 *    chart carries a visible legend with values and a "View as table" view.
 */
:root {
  /* Categorical — identity only. Used where series are genuinely different
     things (email vs SMS), never to re-encode a magnitude. */
  --chart-cat-1: #2a78d6; /* blue */
  --chart-cat-2: #eb6834; /* orange */
  --chart-cat-3: #1baf7a; /* aqua */

  /* Ordinal / sequential — the brand ramp, light→dark with magnitude. */
  --chart-seq-light: #CEA974; /* gold 400 */
  --chart-seq-mid:   #B0894F; /* gold 600 — the single-series default */
  --chart-seq-dark:  #785A2D; /* gold 800 */

  /* De-emphasis: dead deals, unrated contacts — present but not competing. */
  --chart-muted: #9ca3af;

  /* Status — reserved meanings, never reused as a series color. Always
     shipped with an icon + label, since warning is sub-3:1 on white. */
  --chart-status-good:     #0ca30c;
  --chart-status-warning:  #fab219;
  --chart-status-critical: #d03b3b;

  /* Chrome: recessive by design so the data reads first. */
  --chart-surface:  #ffffff;
  --chart-grid:     #f1f1ef;
  --chart-axis:     #d1d5db;
  --chart-ink:      #111827;
  --chart-ink-soft: #6b7280;
}

/* Charts sit in a fixed-height box; Chart.js handles the rest via
   maintainAspectRatio:false. Without a bounded parent it grows unbounded. */
.chart-box { position: relative; height: 220px; }
.chart-box--tall { height: 280px; }
