/* ==========================================================================
   MINDS Sales Dashboard v2 Prototype - Design Tokens (Review Polish)
   Brand: MINDS White-first canvas + Warm Beige / Rose / Bordeaux accents
   Structure: YouTube Studio-inspired flat, spacious, data-first UI
   Accessibility:
     - All text tokens >= 4.5:1 against #FFFFFF
     - All non-text UI graphics, focus rings, and chart series >= 3.0:1
   External dependencies: None (100% local, zero external CDN)
   ========================================================================== */

:root {
  /* Surfaces (White-first for a lighter, modern YouTube Studio feel) */
  --color-bg-canvas: #FFFFFF;
  --color-bg-surface: #FFFFFF;
  --color-bg-selected: #F2EAE5;        /* Reserved for sidebar active state */
  --color-bg-subtle: #F7F4F2;          /* Subtle segmented track & hover */
  --color-bg-hover: #F7F4F2;
  --color-bg-chart-highlight: #FAF6F4; /* Soft highlight for selected month */

  /* Borders (1px hairline standard; #D1C5B8 matches MINDS corporate token) */
  --color-border: #EAE2DE;
  --color-border-strong: #D1C5B8;
  --color-border-subtle: #F2ECE8;

  /* Text (WCAG 2.1 AA >= 4.5:1 verified on #FFFFFF) */
  --color-text-primary: #302A28;    /* 14.12:1 on #FFF */
  --color-text-secondary: #6B605C;  /*  6.08:1 on #FFF */
  --color-text-muted: #756A66;      /*  5.24:1 on #FFF */

  /* MINDS Brand Accents (No additional accent colors introduced) */
  --color-accent: #963F53;          /*  6.70:1 on #FFF / 5.64:1 on #F2EAE5 */
  --color-accent-hover: #7D3244;    /*  8.71:1 on #FFF */
  --color-accent-sub: #B56978;      /*  3.99:1 on #FFF / 3.74:1 on #FAF6F4 */

  /* Data Visualization Series (WCAG >= 3.0:1 on #FFF and #FAF6F4) */
  --chart-reg: #8E847E;             /*  3.65:1 on #FFF / 3.43:1 on #FAF6F4 */
  --chart-doc: #B56978;             /*  3.99:1 on #FFF / 3.74:1 on #FAF6F4 */
  --chart-web: #4A6B8A;             /*  5.58:1 on #FFF / 5.23:1 on #FAF6F4 */
  --chart-ref: #963F53;             /*  6.70:1 on #FFF / 6.29:1 on #FAF6F4 */

  --chart-p1: #963F53;              /*  6.70:1 on #FFF / 6.29:1 on #FAF6F4 */
  --chart-p2: #4A6B8A;              /*  5.58:1 on #FFF / 5.23:1 on #FAF6F4 */
  --chart-p3: #8C6D3F;              /*  4.80:1 on #FFF / 4.50:1 on #FAF6F4 */

  /* Alerts (Rendered only when anomalies or invalid filter dates occur) */
  --color-warn: #8A5318;            /*  5.91:1 on #FDF7EC */
  --color-warn-bg: #FDF7EC;
  --color-warn-border: #E5CFA7;

  --color-error: #B42318;           /*  6.05:1 on #FEF3F2 */
  --color-error-bg: #FEF3F2;
  --color-error-border: #F2C6C2;

  /* Typography (OS-standard Japanese Gothic + Tabular Numerals) */
  --font-sans: -apple-system, BlinkMacSystemFont, "Hiragino Sans", "Hiragino Kaku Gothic ProN", "Yu Gothic", "Meiryo", sans-serif;

  --text-xs: 12.5px;
  --text-sm: 13.5px;
  --text-base: 14px;
  --text-section: 16px;
  --text-page-title: 26px;
  --text-kpi: 34px;
  --text-sub-kpi: 22px;

  /* Spacing Scale (4 / 8 / 12 / 16 / 24 / 32px) */
  --space-1: 4px;
  --space-2: 8px;
  --space-3: 12px;
  --space-4: 16px;
  --space-6: 24px;
  --space-8: 32px;

  /* Radius (Restrained 4-8px) */
  --radius-sm: 4px;
  --radius-md: 6px;
  --radius-lg: 8px;

  /* Elevation (Flat by default; shadow reserved strictly for floating tooltip) */
  --shadow-none: none;
  --shadow-tooltip: 0 4px 12px rgba(48, 42, 40, 0.08);

  /* Dimensions */
  --sidebar-width: 240px;
  --control-height: 36px;
}

*,
*::before,
*::after {
  box-sizing: border-box;
}

html,
body {
  margin: 0;
  padding: 0;
  background-color: var(--color-bg-canvas);
  color: var(--color-text-primary);
  font-family: var(--font-sans);
  font-size: var(--text-base);
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
  overflow-x: hidden;
}

button,
input,
select {
  font-family: inherit;
  font-size: inherit;
  color: inherit;
}

/* Keyboard Focus Accessibility (6.70:1 focus indicator) */
button:focus:not(:focus-visible),
input:focus:not(:focus-visible),
select:focus:not(:focus-visible),
[tabindex]:focus:not(:focus-visible) {
  outline: none;
}

button:focus-visible,
input:focus-visible,
select:focus-visible,
[tabindex]:focus-visible {
  outline: 2px solid var(--color-accent);
  outline-offset: 2px;
}

.tabular-nums {
  font-variant-numeric: tabular-nums;
}

.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}
