/* ============================================
   DIRECCIÓN 360 — base.css
   Variables, reset, tipografía, paleta institucional
   ============================================ */

:root {
  /* ---------- Paleta institucional ---------- */
  --color-primary:        #1B5E3F;   /* Verde institucional */
  --color-primary-dark:   #134B30;
  --color-primary-light:  #E8F1ED;
  --color-primary-hover:  #225E45;

  --color-secondary:      #0F2A44;   /* Azul oscuro */
  --color-secondary-light:#1E3A5F;
  --color-secondary-soft: #E6EAF1;

  --color-bg:             #F5F7FA;   /* Gris claro de fondo */
  --color-surface:        #FFFFFF;   /* Blanco */
  --color-surface-alt:    #FAFBFC;

  --color-text:           #1F2937;   /* Negro suave */
  --color-text-soft:      #374151;
  --color-text-muted:     #6B7280;
  --color-text-faint:     #9CA3AF;

  --color-border:         #E5E7EB;
  --color-border-soft:    #F1F3F5;

  /* ---------- Estados semánticos ---------- */
  --color-success:        #10B981;
  --color-success-soft:   #D1FAE5;
  --color-warning:        #F59E0B;
  --color-warning-soft:   #FEF3C7;
  --color-danger:         #DC2626;
  --color-danger-soft:    #FEE2E2;
  --color-info:           #2563EB;
  --color-info-soft:      #DBEAFE;

  /* ---------- Tipografía ---------- */
  --font-sans: 'Plus Jakarta Sans', -apple-system, BlinkMacSystemFont, 'Segoe UI', system-ui, sans-serif;
  --font-mono: 'JetBrains Mono', 'SF Mono', Menlo, Consolas, monospace;

  --fs-xs:   0.75rem;
  --fs-sm:   0.8125rem;
  --fs-base: 0.875rem;
  --fs-md:   0.9375rem;
  --fs-lg:   1.0625rem;
  --fs-xl:   1.25rem;
  --fs-2xl:  1.5rem;
  --fs-3xl:  1.875rem;
  --fs-4xl:  2.25rem;

  --fw-regular:  400;
  --fw-medium:   500;
  --fw-semibold: 600;
  --fw-bold:     700;
  --fw-extrabold:800;

  --lh-tight:    1.2;
  --lh-snug:     1.35;
  --lh-normal:   1.5;
  --lh-relaxed:  1.65;

  /* ---------- Espaciado ---------- */
  --space-1:  4px;
  --space-2:  8px;
  --space-3:  12px;
  --space-4:  16px;
  --space-5:  20px;
  --space-6:  24px;
  --space-7:  28px;
  --space-8:  32px;
  --space-10: 40px;
  --space-12: 48px;
  --space-16: 64px;

  /* ---------- Radios ---------- */
  --radius-xs: 4px;
  --radius-sm: 6px;
  --radius-md: 8px;
  --radius-lg: 12px;
  --radius-xl: 16px;
  --radius-pill: 9999px;

  /* ---------- Sombras ---------- */
  --shadow-xs:  0 1px 2px rgba(15, 42, 68, 0.04);
  --shadow-sm:  0 1px 3px rgba(15, 42, 68, 0.06), 0 1px 2px rgba(15, 42, 68, 0.04);
  --shadow-md:  0 4px 12px rgba(15, 42, 68, 0.07), 0 2px 4px rgba(15, 42, 68, 0.04);
  --shadow-lg:  0 12px 32px rgba(15, 42, 68, 0.10), 0 4px 8px rgba(15, 42, 68, 0.05);
  --shadow-xl:  0 24px 48px rgba(15, 42, 68, 0.14);

  /* ---------- Layout ---------- */
  --sidebar-w:      260px;
  --topbar-h:       64px;
  --content-max:    1400px;

  /* ---------- Transiciones ---------- */
  --transition-fast:   120ms cubic-bezier(0.4, 0, 0.2, 1);
  --transition-base:   180ms cubic-bezier(0.4, 0, 0.2, 1);
  --transition-slow:   280ms cubic-bezier(0.4, 0, 0.2, 1);

  /* ---------- Z-index ---------- */
  --z-sidebar: 50;
  --z-topbar:  40;
  --z-modal:   100;
  --z-toast:   200;
}

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

html {
  -webkit-text-size-adjust: 100%;
  -webkit-tap-highlight-color: transparent;
  scroll-behavior: smooth;
}

body {
  font-family: var(--font-sans);
  font-size: var(--fs-base);
  font-weight: var(--fw-regular);
  line-height: var(--lh-normal);
  color: var(--color-text);
  background-color: var(--color-bg);
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  min-height: 100vh;
  text-rendering: optimizeLegibility;
}

/* ---------- Tipografía base ---------- */
h1, h2, h3, h4, h5, h6 {
  font-weight: var(--fw-semibold);
  line-height: var(--lh-tight);
  color: var(--color-text);
  letter-spacing: -0.01em;
}

h1 { font-size: var(--fs-3xl); font-weight: var(--fw-bold); letter-spacing: -0.02em; }
h2 { font-size: var(--fs-2xl); font-weight: var(--fw-semibold); }
h3 { font-size: var(--fs-xl); }
h4 { font-size: var(--fs-lg); }
h5 { font-size: var(--fs-md); }
h6 { font-size: var(--fs-base); }

p {
  font-size: var(--fs-base);
  line-height: var(--lh-relaxed);
  color: var(--color-text-soft);
}

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

ul, ol { list-style: none; }

button {
  font-family: inherit;
  cursor: pointer;
  border: none;
  background: none;
  color: inherit;
}

input, textarea, select {
  font-family: inherit;
  font-size: inherit;
  color: inherit;
}

img, svg { display: block; max-width: 100%; }

code, pre, .mono {
  font-family: var(--font-mono);
  font-feature-settings: "tnum" 1, "calt" 0;
}

/* ---------- Utilidades ---------- */
.hidden { display: none !important; }
.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

.text-muted { color: var(--color-text-muted); }
.text-faint { color: var(--color-text-faint); }
.text-mono  { font-family: var(--font-mono); font-feature-settings: "tnum" 1; }

/* ---------- Scrollbar ---------- */
::-webkit-scrollbar { width: 10px; height: 10px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb {
  background: #D1D5DB;
  border-radius: var(--radius-pill);
  border: 2px solid var(--color-bg);
}
::-webkit-scrollbar-thumb:hover { background: #9CA3AF; }

/* ---------- Selección de texto ---------- */
::selection {
  background: var(--color-primary-light);
  color: var(--color-primary-dark);
}

/* ---------- Focus visible accesible ---------- */
:focus-visible {
  outline: 2px solid var(--color-primary);
  outline-offset: 2px;
  border-radius: var(--radius-xs);
}
