/* ═══════════════════════════════════════
   XUANJI MI-OS — Unified Theme v1.0
   AP#2: Single source of truth for colors, fonts, and typography scale.

   All pages MUST include this file:
     <link rel="stylesheet" href="css/theme.css">

   Pages should NOT re-declare these variables in inline <style>.
   Only override a variable when the page genuinely needs a different value.
   ═══════════════════════════════════════ */

/* ══════════════════════════════════════
   1. COLOR PALETTE
   ══════════════════════════════════════ */
:root {
  /* ── Brand ── */
  --navy:    #003A70;
  --gold:    #C5A258;
  --dark:    #1A1A2E;

  /* ── Backgrounds ── */
  --bg:      #F7F8FA;
  --card:    #fff;
  --border:  #E2E5EA;
  --hover:   #F0F4FF;

  /* ── Semantic (status) ── */
  --red:     #D32F2F;
  --green:   #2E7D32;
  --orange:  #EF6C00;
  --blue:    #1565C0;
  --cyan:    #0277BD;
  --purple:  #7B1FA2;
  --teal:    #00796B;
  --yellow:  #F9A825;
  --pink:    #C2185B;

  /* ── Neutrals ── */
  --gray:    #6B7280;
  --muted:   #64748B;

  /* ── Semantic backgrounds (light fills for badges/alerts) ── */
  --red-bg:    #FFEBEE;
  --green-bg:  #E8F5E9;
  --orange-bg: #FFF3E0;
  --blue-bg:   #E3F2FD;
  --yellow-bg: #FFF8E1;
  --purple-bg: #F3E5F5;
  --cyan-bg:   #E0F7FA;
  --teal-bg:   #E0F2F1;
}

/* ══════════════════════════════════════
   2. TYPOGRAPHY
   ══════════════════════════════════════ */
:root {
  /* ── Font stacks ── */
  --font-sans:  'Segoe UI', system-ui, 'Noto Sans TC', sans-serif;
  --font-mono:  'Consolas', 'JetBrains Mono', 'SF Mono', monospace;
  --font-serif: 'Noto Serif TC', Georgia, serif;

  /* ── Type scale (8 levels) ── */
  --text-xs:    10px;
  --text-sm:    11px;
  --text-base:  12px;
  --text-md:    13px;
  --text-lg:    14px;
  --text-xl:    16px;
  --text-2xl:   20px;
  --text-3xl:   24px;
}

/* ══════════════════════════════════════
   3. BASE STYLES
   ══════════════════════════════════════ */
*, *::before, *::after {
  box-sizing: border-box;
}

body {
  font-family: var(--font-sans);
  font-size: var(--text-md);
  color: var(--dark);
  background: var(--bg);
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
}

/* Monospace for financial data */
.mono, .num, td.num, .financial-value {
  font-family: var(--font-mono);
}
