/* ==========================================================================
   B.OCR Web - Base Design System (Design Tokens, Typography, Reset)
   Professional Desktop Utility (Ref: update.md & redesain.md)
   ========================================================================== */

/* Light Theme (Default Root) */
:root, [data-theme="light"] {
  /* Surfaces & Backgrounds */
  --bg: #f7f8fa;
  --bg-elevated: #ffffff;
  --surface: #ffffff;
  --surface-2: #f1f3f5;
  --surface-hover: #e9ecef;
  --surface-active: #dde1e6;

  /* Borders */
  --border: #dde1e6;
  --border-subtle: #eaedf1;
  --border-strong: #c4cad3;
  --border-focus: #2563eb;

  /* Typography Colors */
  --text: #17191c;
  --text-muted: #626a73;
  --text-subtle: #8a94a2;
  --text-inverse: #ffffff;

  /* Functional Accents */
  --accent: #2563eb;
  --accent-hover: #1d4ed8;
  --accent-active: #1e40af;
  --accent-dim: rgba(37, 99, 235, 0.08);
  --accent-border: rgba(37, 99, 235, 0.22);

  /* Status Colors */
  --success: #16a34a;
  --success-hover: #15803d;
  --success-dim: rgba(22, 163, 74, 0.1);
  --warning: #d97706;
  --warning-dim: rgba(217, 119, 6, 0.1);
  --danger: #dc2626;
  --danger-dim: rgba(220, 38, 38, 0.1);
  --info: #0284c7;
  --info-dim: rgba(2, 132, 199, 0.1);

  /* Typography */
  --font-sans: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', system-ui, sans-serif;
  --font-mono: 'JetBrains Mono', ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, monospace;

  /* Compact Radii */
  --radius-xs: 3px;
  --radius-sm: 5px;
  --radius: 6px;
  --radius-md: 8px;

  /* Restrained Shadows */
  --shadow-sm: 0 1px 2px rgba(0, 0, 0, 0.04);
  --shadow: 0 2px 8px rgba(0, 0, 0, 0.06);
  --shadow-lg: 0 12px 32px rgba(0, 0, 0, 0.09);

  /* Scrollbar */
  --scrollbar-thumb: #c4cad3;
  --scrollbar-thumb-hover: #9ca3af;

  /* Dimensions */
  --header-height: 56px;
  --sidebar-width: 340px;
  --statusbar-height: 32px;
}

/* Dark Theme */
[data-theme="dark"] {
  /* Surfaces & Backgrounds */
  --bg: #0b0d0f;
  --bg-elevated: #111418;
  --surface: #111418;
  --surface-2: #171a1f;
  --surface-hover: #1e2229;
  --surface-active: #252a32;

  /* Borders */
  --border: #252a31;
  --border-subtle: #1c2026;
  --border-strong: #343c46;
  --border-focus: #3b82f6;

  /* Typography Colors */
  --text: #f1f3f5;
  --text-muted: #959da8;
  --text-subtle: #616a78;
  --text-inverse: #ffffff;

  /* Functional Accents */
  --accent: #3b82f6;
  --accent-hover: #2563eb;
  --accent-active: #1d4ed8;
  --accent-dim: rgba(59, 130, 246, 0.12);
  --accent-border: rgba(59, 130, 246, 0.25);

  /* Status Colors */
  --success: #22c55e;
  --success-hover: #16a34a;
  --success-dim: rgba(34, 197, 94, 0.12);
  --warning: #f59e0b;
  --warning-dim: rgba(245, 158, 11, 0.12);
  --danger: #ef4444;
  --danger-dim: rgba(239, 68, 68, 0.12);
  --info: #0ea5e9;
  --info-dim: rgba(14, 165, 233, 0.12);

  /* Shadows */
  --shadow-sm: 0 1px 2px rgba(0, 0, 0, 0.35);
  --shadow: 0 2px 8px rgba(0, 0, 0, 0.45);
  --shadow-lg: 0 12px 32px rgba(0, 0, 0, 0.6);

  /* Scrollbar */
  --scrollbar-thumb: #252a31;
  --scrollbar-thumb-hover: #343c46;
}

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

html, body {
  width: 100%;
  height: 100%;
  background-color: var(--bg);
  color: var(--text);
  font-family: var(--font-sans);
  font-size: 13px;
  line-height: 1.45;
  overflow: hidden;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  transition: background-color 0.2s ease, color 0.2s ease;
}

/* Custom Scrollbars */
::-webkit-scrollbar {
  width: 6px;
  height: 6px;
}
::-webkit-scrollbar-track {
  background: transparent;
}
::-webkit-scrollbar-thumb {
  background: var(--scrollbar-thumb);
  border-radius: var(--radius-xs);
}
::-webkit-scrollbar-thumb:hover {
  background: var(--scrollbar-thumb-hover);
}
