/* ============================================================
   AdminApp — base.css  (sistema de diseño global)
   Referencia: Lebane · Identidad: Macna (primario azul #2563EB)
   Variables canónicas. Ver design-system/MASTER.md.
   ============================================================ */

@import url('https://fonts.googleapis.com/css2?family=Inter:wght@400;500;600;700&display=swap');

:root {
  /* ── Superficies y fondos ── */
  --bg:            #F8F9FA;
  --surface:       #FFFFFF;
  --surface-2:     #F8F9FA;   /* header de tablas, toolbars */
  --hover:         #F8F9FA;   /* hover de filas */

  /* ── Sidebar (CLARO) ── */
  --sidebar:           #FFFFFF;
  --sidebar-hover:     #F8F9FA;
  --sidebar-active-bg: #EFF6FF;
  --sidebar-active:    #2563EB;
  --on-sidebar:        #1A1A1A;
  --on-sidebar-muted:  #6B6B6B;

  /* ── Texto ── */
  --text:        #1A1A1A;
  --text-muted:  #6B6B6B;
  --text-faint:  #9CA3AF;

  /* ── Primario (azul #2563EB) ── */
  --primary:            #2563EB;
  --primary-hover:      #1D4ED8;
  --primary-light:      #3B82F6;
  --primary-ultralight: #EFF6FF;
  --primary-dark:       #1E40AF;
  --on-primary:         #FFFFFF;
  --on-primary-muted:   #DBEAFE;

  /* ── Acento (= primario) ── */
  --accent:        #2563EB;
  --accent-hover:  #3B82F6;
  --accent-soft:   #EFF6FF;

  /* ── Bordes ── */
  --border:         #E5E7EB;
  --border-subtle:  #F3F4F6;
  --border-input:   #E5E7EB;

  /* ── Semántica ── */
  --success:     #10B981;   /* badges / barras / íconos */
  --danger:      #EF4444;
  --warning:     #F59E0B;
  /* Montos: texto negro unificado (monocromo). El estado se comunica por badges, no por color de cifra. */
  --pos:         #1A1A1A;
  --neg:         #1A1A1A;
  --info:        #1A1A1A;
  --warn:        #1A1A1A;   /* texto de materiales en negro */
  --warn-bg:     #F1F5F9;   /* slate neutro (materiales) */
  /* aliases legacy (antes "on dark"; hoy superficies claras) */
  --pos-on-dark: var(--pos);
  --neg-on-dark: var(--neg);

  /* ── Tipografía (Inter) ── */
  --font-body: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
  --font-head: var(--font-body);
  --font-mono: var(--font-body);

  /* ── Forma ── */
  --radius-sm: 6px;
  --radius:    8px;    /* botones, inputs */
  --radius-md: 10px;   /* tablas */
  --radius-lg: 14px;   /* cards, modales */
  --radius-pill: 999px;

  /* ── Sombras ── */
  --shadow-sm: 0 1px 3px rgba(0,0,0,0.06), 0 1px 2px rgba(0,0,0,0.04);
  --shadow:    0 4px 16px rgba(0,0,0,0.10);
  --shadow-lg: 0 8px 32px rgba(0,0,0,0.12);

  /* ── Layout ── */
  --sidebar-width: 220px;
  --header-height: 60px;
}

/* ── Reset / base ── */
* { margin: 0; padding: 0; box-sizing: border-box; }

body {
  font-family: var(--font-body);
  font-size: 14px;
  font-weight: 400;
  line-height: 1.5;
  background: var(--bg);
  color: var(--text);
  font-variant-numeric: tabular-nums;
  font-feature-settings: 'tnum' 1, 'cv01' 1;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}

/* ── Tipografía estructural ── */
h1, .page-title { font-size: 24px; font-weight: 600; color: var(--text); letter-spacing: -0.01em; }
h2, .section-title { font-size: 18px; font-weight: 600; color: var(--text); }
h3, .card-title { font-size: 16px; font-weight: 600; color: var(--text); }
.label, label { font-size: 13px; font-weight: 500; color: var(--text-muted); }
.micro { font-size: 12px; }

::selection { background: var(--accent-soft); color: var(--text); }
:focus-visible { outline: 3px solid rgba(37,99,235,0.25); outline-offset: 1px; }

/* ── Scrollbars sutiles ── */
* { scrollbar-width: thin; scrollbar-color: #D7DBDF transparent; }
*::-webkit-scrollbar { width: 9px; height: 9px; }
*::-webkit-scrollbar-thumb { background: #D7DBDF; border-radius: 5px; }
*::-webkit-scrollbar-thumb:hover { background: var(--text-faint); }

/* ============================================================
   LIBRERÍA DE COMPONENTES
   ============================================================ */

/* ── Sidebar (claro) ── */
.sidebar {
  background: var(--sidebar); color: var(--on-sidebar);
  width: var(--sidebar-width); flex-shrink: 0;
  display: flex; flex-direction: column;
  border-right: 1px solid var(--border);
}
.sidebar-brand {
  font-size: 18px; font-weight: 700; letter-spacing: 0.3px;
  color: var(--text); padding: 0 16px; height: var(--header-height);
  display: flex; align-items: center; gap: 8px; flex-shrink: 0;
}
.sidebar-brand span { color: var(--accent); }
.sidebar-section {
  font-size: 11px; font-weight: 600; color: var(--text-faint);
  text-transform: uppercase; letter-spacing: 0.08em; margin: 20px 16px 6px;
}
.sidebar-item {
  display: flex; align-items: center; gap: 11px;
  height: 40px; margin: 2px 12px; padding: 0 16px; border-radius: 8px;
  font-size: 14px; font-weight: 500;
  color: var(--text-muted); text-decoration: none;
  cursor: pointer; transition: background .15s, color .15s;
}
.sidebar-item:hover { background: var(--sidebar-hover); color: var(--text); }
.sidebar-item.active { background: var(--sidebar-active-bg); color: var(--sidebar-active); font-weight: 600; }
.sidebar-item svg { width: 18px; height: 18px; flex-shrink: 0; }

/* ── Cards ── */
.card {
  background: var(--surface); border: 1px solid var(--border);
  border-radius: 12px; box-shadow: var(--shadow-sm); padding: 24px;
}

/* ── Botones ── */
.btn-primary {
  background: var(--primary); color: var(--on-primary); border: none;
  padding: 9px 18px; border-radius: var(--radius);
  font: 600 14px/1 var(--font-body); cursor: pointer; transition: background .15s;
}
.btn-primary:hover { background: var(--primary-hover); }
.btn-secondary {
  background: var(--surface); color: var(--primary);
  border: 1.5px solid var(--primary); padding: 8px 18px; border-radius: var(--radius);
  font: 600 14px/1 var(--font-body); cursor: pointer; transition: background .15s;
}
.btn-secondary:hover { background: var(--primary-ultralight); }
.btn-ghost {
  background: transparent; color: var(--text-muted);
  border: 1px solid var(--border); padding: 8px 16px; border-radius: var(--radius);
  font: 500 14px/1 var(--font-body); cursor: pointer; transition: background .15s;
}
.btn-ghost:hover { background: var(--bg); }
.btn-danger {
  background: var(--danger); color: #fff; border: none;
  padding: 9px 18px; border-radius: var(--radius);
  font: 600 14px/1 var(--font-body); cursor: pointer;
}

/* ── Badges (pill) ── */
.badge {
  display: inline-flex; align-items: center;
  padding: 3px 10px; border-radius: var(--radius-pill);
  font-size: 12px; font-weight: 500; line-height: 1.4;
  background: #F3F4F6; color: #374151;
}
.badge.active,  .badge.success { background: #D1FAE5; color: #065F46; }
.badge.pending, .badge.warning { background: #FEF3C7; color: #92400E; }
.badge.danger { background: #FEE2E2; color: #991B1B; }
.badge.neutral { background: #F3F4F6; color: #374151; }
.badge.primary { background: var(--primary-ultralight); color: var(--primary); }

/* ── Pills (badges de estado · esquina redondeada completa) ── */
.pill { display: inline-flex; align-items: center; border-radius: var(--radius-pill); font-weight: 700; white-space: nowrap; line-height: 1.4; }
.pill--asignado { font-size: 11px; padding: 3px 9px; background: rgba(37,99,235,0.14); color: var(--info); }
.pill--success { font-size: 11px; padding: 3px 9px; background: rgba(16,185,129,0.14); color: #0B6E54; }

/* ── Inputs / selects ── */
.input, input.input, select.input, textarea.input {
  height: 38px; width: 100%; padding: 0 12px;
  border: 1px solid var(--border-input); border-radius: var(--radius);
  font: 400 14px/1.4 var(--font-body); color: var(--text);
  background: var(--surface); outline: none;
  transition: border-color .15s, box-shadow .15s;
}
textarea.input { height: auto; padding: 9px 12px; }
.input:focus, input.input:focus, select.input:focus, textarea.input:focus {
  border-color: var(--primary); box-shadow: 0 0 0 3px rgba(37,99,235,0.15);
}
.input::placeholder { color: var(--text-faint); }

/* ── Tablas ── */
.table { width: 100%; border-collapse: collapse; font-size: 14px; }
.table th {
  background: var(--surface-2); color: var(--text-muted);
  font-size: 12px; font-weight: 600; text-transform: uppercase; letter-spacing: 0.06em;
  text-align: left; padding: 10px 16px; border-bottom: 1px solid var(--border); white-space: nowrap;
}
.table td { padding: 12px 16px; border-bottom: 1px solid var(--border-subtle); color: var(--text); }
.table tbody tr:hover td { background: var(--hover); }

/* ── Separador ── */
.separator { border: none; border-top: 1px solid var(--border); margin: 16px 0; }

@media (prefers-reduced-motion: reduce) {
  * { transition: none !important; animation: none !important; }
}
