/* ═══════════════════════════════════════════════════
   theme.css — FluentUI-inspired Design Tokens v7.0
   Single source of truth for all CSS variables.
   ═══════════════════════════════════════════════════ */

:root {
  /* ═══ Primary: Professional Blue ═══ */
  --primary: #2563EB;
  --primary-hover: #1D4ED8;
  --primary-active: #1E40AF;
  --primary-light: #EFF6FF;
  --primary-lighter: #DBEAFE;

  /* ═══ Neutral Gray Scale (Slate) ═══ */
  --neutral-0: #FFFFFF;
  --neutral-50: #F8FAFC;
  --neutral-100: #F1F5F9;
  --neutral-200: #E2E8F0;
  --neutral-300: #CBD5E1;
  --neutral-400: #94A3B8;
  --neutral-500: #64748B;
  --neutral-600: #475569;
  --neutral-700: #334155;
  --neutral-800: #1E293B;
  --neutral-900: #0F172A;

  /* ═══ Semantic Colors ═══ */
  --success: #16A34A;
  --success-hover: #15803D;
  --success-light: #F0FDF4;
  --warning: #D97706;
  --warning-hover: #B45309;
  --warning-light: #FFFBEB;
  --danger: #DC2626;
  --danger-hover: #B91C1C;
  --danger-light: #FEF2F2;
  --info: #2563EB;
  --info-light: #EFF6FF;

  /* ═══ Surface / Background ═══ */
  --bg-page: #F8FAFC;
  --bg-card: #FFFFFF;
  --bg-card-hover: #F8FAFC;
  --bg-sidebar: #0F172A;
  --bg-sidebar-hover: #1E293B;
  --bg-sidebar-active: rgba(37, 99, 235, 0.15);
  --bg-section: #F8FAFC;

  /* ═══ Text ═══ */
  --text-primary: #0F172A;
  --text-secondary: #475569;
  --text-muted: #94A3B8;
  --text-sidebar: #CBD5E1;
  --text-sidebar-muted: #64748B;
  --text-sidebar-active: #FFFFFF;
  --text-inverse: #FFFFFF;

  /* ═══ Borders ═══ */
  --border: #E2E8F0;
  --border-light: #F1F5F9;
  --border-sidebar: rgba(255, 255, 255, 0.08);

  /* ═══ Border Radius (sharp, professional) ═══ */
  --radius-sm: 2px;
  --radius: 4px;
  --radius-lg: 6px;
  --radius-xl: 8px;

  /* ═══ Shadows (subtle, modern) ═══ */
  --shadow-sm: 0 1px 2px rgba(0, 0, 0, 0.04);
  --shadow: 0 1px 3px rgba(0, 0, 0, 0.06);
  --shadow-md: 0 2px 6px rgba(0, 0, 0, 0.08);
  --shadow-lg: 0 4px 12px rgba(0, 0, 0, 0.10);
  --shadow-xl: 0 8px 24px rgba(0, 0, 0, 0.12);

  /* ═══ Spacing (4px baseline grid) ═══ */
  --space-1: 4px;
  --space-2: 8px;
  --space-3: 12px;
  --space-4: 16px;
  --space-5: 20px;
  --space-6: 24px;
  --space-8: 32px;
  --space-10: 40px;
  --space-12: 48px;

  /* ═══ Layout Dimensions ═══ */
  --sidebar-width: 240px;
  --sidebar-collapsed: 64px;
  --header-height: 52px;

  /* ═══ Typography ═══ */
  --font: "Segoe UI", -apple-system, BlinkMacSystemFont, "Helvetica Neue", Arial,
    "Microsoft YaHei", "PingFang SC", "Noto Sans SC", sans-serif;
  --font-mono: "Cascadia Code", "Consolas", "SF Mono", "Courier New", monospace;

  --text-xs: 11px;
  --text-sm: 13px;
  --text-base: 14px;
  --text-lg: 16px;
  --text-xl: 20px;
  --text-2xl: 28px;

  /* ═══ Transitions ═══ */
  --transition-fast: 0.12s ease;
  --transition: 0.18s ease;
  --transition-slow: 0.25s ease;
}

/* ═══════════════════════════════════════════════════
   Global Reset
   ═══════════════════════════════════════════════════ */
*,
*::before,
*::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

html {
  font-size: var(--text-base);
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

body {
  font-family: var(--font);
  font-size: var(--text-base);
  line-height: 1.5;
  color: var(--text-primary);
  background: var(--bg-page);
  overflow-x: hidden;
}

a {
  color: var(--primary);
  text-decoration: none;
}
a:hover {
  color: var(--primary-hover);
}

img {
  max-width: 100%;
  height: auto;
}

/* ═══ Scrollbar (thin, modern) ═══ */
::-webkit-scrollbar {
  width: 6px;
  height: 6px;
}
::-webkit-scrollbar-track {
  background: transparent;
}
::-webkit-scrollbar-thumb {
  background: var(--neutral-300);
  border-radius: 3px;
}
::-webkit-scrollbar-thumb:hover {
  background: var(--neutral-400);
}

/* ═══ Selection ═══ */
::selection {
  background: var(--primary-lighter);
  color: var(--primary);
}

/* ═══════════════════════════════════════════════════
   Utility Classes
   ═══════════════════════════════════════════════════ */

/* --- Font Sizes --- */
.text-xs { font-size: var(--text-xs); }
.text-sm { font-size: var(--text-sm); }
.text-base { font-size: var(--text-base); }
.text-lg { font-size: var(--text-lg); }
.text-xl { font-size: var(--text-xl); }
.text-2xl { font-size: var(--text-2xl); }

/* --- Text Colors --- */
.text-primary { color: var(--text-primary); }
.text-secondary { color: var(--text-secondary); }
.text-muted { color: var(--text-muted); }

/* --- Font Weights --- */
.font-normal { font-weight: 400; }
.font-medium { font-weight: 500; }
.font-semibold { font-weight: 600; }
.font-bold { font-weight: 700; }

/* --- Truncate --- */
.truncate {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

/* --- Screen Reader Only --- */
.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  border: 0;
}

/* --- Inline Code / Mono --- */
code, .mono {
  font-family: var(--font-mono);
  font-size: 0.9em;
}

/* ═══ Animations ═══ */
@keyframes fadeIn {
  from { opacity: 0; transform: translateY(4px); }
  to { opacity: 1; transform: translateY(0); }
}

@keyframes spin {
  from { transform: rotate(0deg); }
  to { transform: rotate(360deg); }
}

@keyframes pulse {
  0%, 100% { opacity: 1; }
  50% { opacity: 0.5; }
}

@keyframes shimmer {
  0% { background-position: -200% 0; }
  100% { background-position: 200% 0; }
}

@keyframes modalIn {
  from { opacity: 0; transform: scale(0.96) translateY(-8px); }
  to { opacity: 1; transform: scale(1) translateY(0); }
}
