/* css/base.css - Modern Reset, typography & variables */
:root {
  --font-sans: 'Inter', -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif, "Apple Color Emoji", "Segoe UI Emoji";
  --font-mono: "SFMono-Regular", Consolas, "Liberation Mono", Menlo, Courier, monospace;

  --font-size-xs: 0.75rem;     /* 12px */
  --font-size-sm: 0.8125rem;   /* 13px */
  --font-size-base: 0.875rem;  /* 14px */
  --font-size-md: 0.9375rem;   /* 15px */
  --font-size-lg: 1.0625rem;   /* 17px */
  --font-size-xl: 1.25rem;     /* 20px */
  --font-size-2xl: 1.5rem;     /* 24px */

  --font-weight-normal: 400;
  --font-weight-medium: 500;
  --font-weight-semibold: 600;
  --font-weight-bold: 700;

  --tracking-tight: -0.018em;
  --tracking-normal: 0;
  --tracking-wide: 0.04em;
  --tracking-wider: 0.07em;

  --line-height-tight: 1.25;
  --line-height-normal: 1.5;
  --line-height-relaxed: 1.625;

  --space-1: 0.25rem;
  --space-2: 0.5rem;
  --space-3: 0.75rem;
  --space-4: 1rem;
  --space-5: 1.25rem;
  --space-6: 1.5rem;
  --space-8: 2rem;

  --radius-xs: 6px;
  --radius-sm: 8px;
  --radius-md: 12px;
  --radius-lg: 18px;
  --radius-xl: 22px;
  --radius-2xl: 28px;
  --radius-full: 9999px;

  /* Ambient, diffused depth shadows */
  --shadow-xs: 0 1px 2px 0 rgba(145, 130, 115, 0.04);
  --shadow-sm: 0 2px 5px 0 rgba(145, 130, 115, 0.06), 0 1px 2px -1px rgba(145, 130, 115, 0.03);
  --shadow-md: 0 6px 16px -2px rgba(145, 130, 115, 0.08), 0 2px 6px -2px rgba(145, 130, 115, 0.04);
  --shadow-lg: 0 12px 24px -4px rgba(145, 130, 115, 0.1), 0 4px 8px -3px rgba(145, 130, 115, 0.05);
  --shadow-modal: 0 24px 48px -8px rgba(35, 30, 25, 0.22), 0 8px 16px -4px rgba(35, 30, 25, 0.08);

  /* Modern cubic-bezier motion curves */
  --transition-fast: 120ms cubic-bezier(0.16, 1, 0.3, 1);
  --transition-normal: 180ms cubic-bezier(0.16, 1, 0.3, 1);
  --transition-smooth: 260ms cubic-bezier(0.16, 1, 0.3, 1);
}

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

html, body {
  height: 100%;
  width: 100%;
  min-width: 1024px;
  font-family: var(--font-sans);
  font-size: 16px;
  line-height: var(--line-height-normal);
  color: var(--color-text-main);
  background-color: var(--color-bg-app);
  text-rendering: optimizeLegibility;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

body {
  overflow: hidden;
  display: flex;
  flex-direction: column;
}

h1, h2, h3, h4, h5, h6 {
  color: var(--color-text-main);
  font-weight: var(--font-weight-semibold);
  line-height: var(--line-height-tight);
  letter-spacing: var(--tracking-tight);
}

h1 { font-size: var(--font-size-2xl); }
h2 { font-size: var(--font-size-xl); }
h3 { font-size: var(--font-size-lg); }
h4 { font-size: var(--font-size-md); }

a {
  color: var(--color-primary);
  text-decoration: none;
  transition: color var(--transition-fast), opacity var(--transition-fast);
}

a:hover {
  text-decoration: none;
  opacity: 0.88;
}

button {
  font-family: inherit;
  font-size: var(--font-size-base);
  cursor: pointer;
  border: none;
  background: none;
}

input, textarea, select {
  font-family: inherit;
  font-size: var(--font-size-base);
  color: var(--color-text-main);
  background-color: var(--color-bg-surface);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-md);
  padding: var(--space-2) var(--space-3);
  outline: none;
  transition: border-color var(--transition-fast), box-shadow var(--transition-fast), background-color var(--transition-fast);
}

input:focus, textarea:focus, select:focus {
  border-color: var(--color-primary);
  box-shadow: 0 0 0 3px var(--color-primary-subtle);
}

/* Tabular numbers for clocks, metrics, badges, and tables */
.header-clock,
.pending-pill-count,
.badge,
.table-num,
.kv-value {
  font-variant-numeric: tabular-nums;
}

/* Custom Minimal Scrollbars */
::-webkit-scrollbar {
  width: 5px;
  height: 5px;
}

::-webkit-scrollbar-track {
  background: transparent;
}

::-webkit-scrollbar-thumb {
  background: var(--color-scrollbar-thumb);
  border-radius: var(--radius-full);
}

::-webkit-scrollbar-thumb:hover {
  background: var(--color-scrollbar-thumb-hover);
}

/* Keyboard Accessible Focus Rings */
:focus-visible {
  outline: 2px solid var(--color-primary);
  outline-offset: 2px;
}
