/**
 * CRM JURÍDICO PANAMÁ - SISTEMA DE DISEÑO (FASE 2)
 * base.css: Reset, Design Tokens, Variables CSS, Tipografía y Utilidades
 * Inspiración: Linear / Stripe / Notion (Minimalismo, Alta Densidad, Bajo Ruido Cognitivo)
 */

/**
 * CRM JURÍDICO PANAMÁ - SISTEMA DE DISEÑO DE AUTOR
 * "Gaceta Forense & Consola Lexis" (Bespoke Legal Editorial & High-Density Instrumentation)
 * Ruptura explícita de clichés de IA: tipografía dual editorial/tabular, alabastro cálido,
 * tintas secas, acentos de sello lacre/oro viejo, y elevaciones nítidas en bajorrelieve.
 */

:root {
  /* Lienzo y Superficies de Autor (Alabastro y Pergamino Encolado) */
  --bg-canvas: #f7f6f2;
  --bg-surface: #ffffff;
  --bg-subtle: #efece4;
  --bg-hover: #f1eee5;
  --bg-active: #e7e3d6;

  /* Tintas de Alta Legibilidad y Contraste Calibrado (WCAG AAA) */
  --text-primary: #14191e;
  --text-secondary: #3c4753;
  --text-muted: #64707d;
  --text-subtle: #8d98a5;
  --text-inverse: #ffffff;

  /* Líneas Estructurales de Precisión (1px Hairlines Nítidos) */
  --border-subtle: #dcd7ca;
  --border-strong: #c2bbb0;
  --border-focus: #1b365d;

  /* Acento Primario: Azul Forense Naval / Prestigio Notarial */
  --primary: #1b365d;
  --primary-hover: #12243e;
  --primary-active: #0d1a2d;
  --primary-light: #edf2f9;
  --primary-border: #b8cce6;

  /* Acentos Funcionales de Autor (Sello Lacre, Latón Antiguo y Notaría Verde) */
  --success: #1e6343;
  --success-bg: #edf7f1;
  --success-border: #b3dfc9;
  --success-text: #13462f;

  --warning: #94680e;
  --warning-bg: #fdf8eb;
  --warning-border: #ecd99f;
  --warning-text: #6b4a05;

  --danger: #8c2424;
  --danger-bg: #faeeee;
  --danger-border: #e6b8b8;
  --danger-text: #631515;

  --info: #1b4965;
  --info-bg: #edf5fa;
  --info-border: #bad8eb;
  --info-text: #113247;

  --neutral-badge-bg: #efece4;
  --neutral-badge-text: #3c4753;
  --neutral-badge-border: #dcd7ca;

  /* Tipografía Dual: Editorial Serif Autoritaria + Monoespaciada Tabular */
  --font-serif: 'Newsreader', Georgia, 'Times New Roman', serif;
  --font-sans: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
  --font-mono: 'JetBrains Mono', ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, monospace;

  /* Elevaciones Nítidas Tipo Bajorrelieve Táctil (Sin Sombras Difusas Excesivas) */
  --shadow-none: none;
  --shadow-xs: 0 1px 1px rgba(20, 25, 30, 0.05);
  --shadow-sm: 0 1px 2px rgba(20, 25, 30, 0.06), 0 1px 1px rgba(20, 25, 30, 0.04);
  --shadow-md: 0 3px 6px -1px rgba(20, 25, 30, 0.07), 0 1px 3px -1px rgba(20, 25, 30, 0.05);
  --shadow-lg: 0 6px 16px -2px rgba(20, 25, 30, 0.09), 0 2px 6px -2px rgba(20, 25, 30, 0.05);
  --shadow-modal: 0 12px 32px -4px rgba(20, 25, 30, 0.22), 0 4px 12px -2px rgba(20, 25, 30, 0.12);

  /* Radios de Esquina Quirúrgicos y Sobrios (2px a 6px) */
  --radius-xs: 2px;
  --radius-sm: 4px;
  --radius-md: 6px;
  --radius-lg: 8px;
  --radius-full: 9999px;

  /* Microinteracciones Instantáneas de Instrumento Mecánico */
  --transition-fast: 130ms cubic-bezier(0.16, 1, 0.3, 1);
  --transition-normal: 180ms cubic-bezier(0.16, 1, 0.3, 1);
}

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

html {
  font-size: 14px;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  text-rendering: optimizeLegibility;
}

body {
  font-family: var(--font-sans);
  background-color: var(--bg-canvas);
  color: var(--text-primary);
  line-height: 1.5;
  min-height: 100vh;
  overflow-x: hidden;
}

/* Tipografía Escalar Editorial & Jurídica */
h1, h2, h3, h4, h5, h6 {
  font-family: var(--font-serif);
  font-weight: 600;
  color: var(--text-primary);
  line-height: 1.25;
  letter-spacing: -0.01em;
}

h1 { font-size: 1.65rem; }
h2 { font-size: 1.35rem; }
h3 { font-size: 1.15rem; }
h4 { font-size: 1.025rem; font-family: var(--font-sans); font-weight: 600; }

p {
  color: var(--text-secondary);
  line-height: 1.55;
}

small {
  font-size: 0.8125rem;
  color: var(--text-muted);
}

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

a:hover {
  text-decoration: underline;
}

code, kbd, samp, pre {
  font-family: var(--font-mono);
  font-size: 0.85em;
  font-variant-numeric: tabular-nums;
}
  font-family: var(--font-mono);
  font-size: 0.85em;
}

code {
  background: var(--bg-subtle);
  color: var(--text-primary);
  padding: 2px 6px;
  border-radius: var(--radius-xs);
  border: 1px solid var(--border-subtle);
}

kbd {
  background: var(--bg-surface);
  border: 1px solid var(--border-strong);
  box-shadow: 0 1px 0 rgba(15, 23, 42, 0.08);
  border-radius: var(--radius-xs);
  padding: 2px 5px;
  font-size: 0.75rem;
  color: var(--text-muted);
}

/* Utilidades de Selección y Scroll */
::selection {
  background: var(--primary-light);
  color: var(--primary);
}

::-webkit-scrollbar {
  width: 6px;
  height: 6px;
}

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

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

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

