/* =============================================
   GestionFlota — Design System
   MVP Gestión de Trámites Vehiculares
   ============================================= */

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

:root {
  /* =============================================================
     BRAND · paleta refinada (post /impeccable + /ui-ux-pro-max)
     Azul Stripe-ish con profundidad. Más matices del primary para
     gradientes / hover / pressed / ring. Cohesión a través del
     sistema sin tocar la firma del producto.
     ============================================================= */
  --primary-50:  #eff6ff;  /* fondos claros, chips */
  --primary-100: #dbeafe;  /* hover suaves */
  --primary-200: #bfdbfe;  /* dividers acento */
  --primary-500: #3b82f6;  /* fallback a tono más claro */
  --primary-600: #2563eb;  /* CANON · primary action */
  --primary-700: #1d4ed8;  /* hover primary action */
  --primary-800: #1e40af;  /* pressed */
  --primary-900: #1e3a8a;  /* texto sobre fondos claros del primary */

  /* Aliases — back-compat */
  --primary:       var(--primary-600);
  --primary-dark:  var(--primary-700);
  --primary-light: var(--primary-50);
  --primary-ring:  rgba(37, 99, 235, 0.18);

  /* =============================================================
     SEMÁNTICOS · success / warning / danger / info
     Saturación reducida para sentirse premium (no fluorescente).
     ============================================================= */
  --success:       #16a34a;
  --success-bg:    #f0fdf4;
  --success-ring:  rgba(22, 163, 74, 0.16);
  --warning:       #d97706;
  --warning-bg:    #fffbeb;
  --warning-ring:  rgba(217, 119, 6, 0.16);
  --danger:        #dc2626;
  --danger-bg:     #fef2f2;
  --danger-ring:   rgba(220, 38, 38, 0.18);
  --info:          var(--primary-600);
  --info-bg:       var(--primary-50);
  --info-ring:     var(--primary-ring);

  /* =============================================================
     ACENTOS DE DOMINIO (logística) — back-compat + alias
     ============================================================= */
  --accent-tracking:    #f97316;
  --accent-tracking-bg: #fff7ed;
  --accent-delivered:   var(--success);
  --accent-delivered-bg: var(--success-bg);

  --status-ok:        var(--success);
  --status-ok-bg:     var(--success-bg);
  --status-30:        var(--warning);
  --status-30-bg:     var(--warning-bg);
  --status-15:        #ea580c;
  --status-15-bg:     #fff7ed;
  --status-7:         var(--danger);
  --status-7-bg:      var(--danger-bg);
  --status-vencido:   #991b1b;
  --status-vencido-bg: #fde8e8;

  /* =============================================================
     NEUTRALES · escala completa con tinte primary (Stripe/Linear)
     OKLCH para precisión perceptual.
     ============================================================= */
  --neutral-0:    #ffffff;
  --neutral-50:   oklch(98.5% 0.004 250);
  --neutral-100:  oklch(96.5% 0.006 250);
  --neutral-200:  oklch(92%   0.008 250);
  --neutral-300:  oklch(85%   0.010 250);
  --neutral-400:  oklch(72%   0.012 250);
  --neutral-500:  oklch(58%   0.014 250);
  --neutral-600:  oklch(45%   0.016 250);
  --neutral-700:  oklch(32%   0.014 250);
  --neutral-800:  oklch(20%   0.010 250);
  --neutral-900:  oklch(10%   0.008 250);

  /* Aliases — back-compat */
  --bg:            var(--neutral-50);
  --surface:       var(--neutral-0);
  --bg-muted:      var(--neutral-100);
  --bg-accent:     var(--primary-50);
  --border:        var(--neutral-200);
  --border-strong: var(--neutral-300);
  --text:          var(--neutral-900);
  --text-primary:  var(--neutral-900);
  --text-secondary: var(--neutral-700);
  --text-muted:    var(--neutral-500);

  /* =============================================================
     ACENTOS SECUNDARIOS (badges informativos)
     ============================================================= */
  --accent-indigo:    #3730a3;
  --accent-indigo-bg: #e0e7ff;
  --accent-emerald:   var(--success);
  --accent-emerald-bg: var(--success-bg);
  --accent-rose:      #b91c1c;
  --accent-rose-bg:   #fef3f2;

  /* =============================================================
     TIPOGRAFÍA · escala armónica + variable font support
     ============================================================= */
  --font-sans: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
  --font-mono: 'JetBrains Mono', 'Fira Code', ui-monospace, SFMono-Regular, Consolas, monospace;

  --fs-xs:   0.78rem;    /* 13px · captions, helper text */
  --fs-sm:   0.88rem;    /* 15px · body small */
  --fs-base: 1rem;       /* 17px · body default (html font-size 17px) */
  --fs-lg:   1.13rem;    /* 19px · subheaders */
  --fs-xl:   1.32rem;    /* 22px · h3 / card titles */
  --fs-2xl:  1.65rem;    /* 28px · h2 sections */
  --fs-3xl:  2.10rem;    /* 36px · h1 page titles */
  --fs-4xl:  2.65rem;    /* 45px · hero */

  --lh-tight:  1.20;
  --lh-snug:   1.35;
  --lh-normal: 1.55;
  --lh-loose:  1.75;

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

  --tracking-tight:  -0.02em;
  --tracking-normal: 0;
  --tracking-wide:    0.02em;
  --tracking-widest:  0.06em;

  /* =============================================================
     SPACING · grid 4px refinado
     ============================================================= */
  --space-xs:  0.25rem;  /* 4px  */
  --space-sm:  0.5rem;   /* 8px  */
  --space-md:  0.75rem;  /* 12px */
  --space-lg:  1rem;     /* 16px */
  --space-xl:  1.5rem;   /* 24px */
  --space-2xl: 2rem;     /* 32px */
  --space-3xl: 3rem;     /* 48px */
  --space-4xl: 4rem;     /* 64px */

  /* =============================================================
     RADIUS · escala armónica
     ============================================================= */
  --radius-xs:  0.125rem;  /* 2px  · chip muy chico */
  --radius-sm:  0.25rem;   /* 4px  · inputs pequeños */
  --radius-md:  0.5rem;    /* 8px  · CANON botones / cards (subido de 6px) */
  --radius-lg:  0.75rem;   /* 12px · modales / cards grandes */
  --radius-xl:  1rem;      /* 16px · hero / banners */
  --radius-2xl: 1.5rem;    /* 24px · contenedores premium */
  --radius-full: 9999px;   /* pills / avatars */

  /* =============================================================
     ELEVATION · sombras multi-layer (Stripe/Linear)
     Cada nivel tiene un layer near (sharp) + far (diffused).
     ============================================================= */
  --shadow-xs:    0 1px 2px rgba(17, 24, 39, 0.04);
  --shadow-sm:    0 1px 3px rgba(17, 24, 39, 0.06), 0 1px 2px rgba(17, 24, 39, 0.03);
  --shadow-md:    0 4px 8px rgba(17, 24, 39, 0.05), 0 2px 4px rgba(17, 24, 39, 0.04);
  --shadow-lg:    0 12px 24px rgba(17, 24, 39, 0.08), 0 4px 8px rgba(17, 24, 39, 0.04);
  --shadow-xl:    0 24px 48px rgba(17, 24, 39, 0.12), 0 8px 16px rgba(17, 24, 39, 0.06);
  /* Versiones tintadas con primary (CTAs / botones primary) */
  --shadow-primary-sm: 0 1px 3px rgba(37, 99, 235, 0.18), 0 1px 2px rgba(37, 99, 235, 0.12);
  --shadow-primary-md: 0 4px 12px rgba(37, 99, 235, 0.22), 0 2px 4px rgba(37, 99, 235, 0.10);
  --shadow-card:  var(--shadow-sm);
  --shadow-hover: var(--shadow-md);

  /* =============================================================
     MOTION · easing curves + duraciones consistentes
     ============================================================= */
  --ease-standard:    cubic-bezier(0.2, 0.0, 0.0, 1.0);   /* default */
  --ease-emphasized:  cubic-bezier(0.3, 0.0, 0.0, 1.0);   /* entradas */
  --ease-decelerate:  cubic-bezier(0.0, 0.0, 0.2, 1.0);   /* CTAs */
  --ease-accelerate:  cubic-bezier(0.3, 0.0, 1.0, 1.0);   /* salidas */
  --duration-instant: 80ms;
  --duration-fast:    150ms;
  --duration-base:    220ms;
  --duration-slow:    320ms;
}

/* Reduce motion para accesibilidad */
@media (prefers-reduced-motion: reduce) {
  :root {
    --duration-instant: 0ms;
    --duration-fast:    0ms;
    --duration-base:    0ms;
    --duration-slow:    0ms;
  }
}

html {
  font-size: 17px;            /* Senior-friendly: 17px base, antes 16px */
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

body {
  font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
  background: var(--bg);
  color: var(--text);
  line-height: 1.55;
  min-height: 100vh;
}

/* --- Typography --- */
/* =========================================================
   TIPOGRAFÍA · escala armónica (post /impeccable)
   Ratios fluidos, weights claros, tracking compresor en headings.
   ========================================================= */
h1, h2, h3, h4 {
  font-weight: var(--fw-bold);
  line-height: var(--lh-tight);
  letter-spacing: var(--tracking-tight);
  color: var(--text-primary);
}

h1 {
  font-size: clamp(var(--fs-2xl), 4vw, var(--fs-3xl));
  letter-spacing: -0.025em;
  font-weight: var(--fw-black);
}
h2 {
  font-size: var(--fs-2xl);
  font-weight: var(--fw-bold);
}
h3 {
  font-size: var(--fs-xl);
  font-weight: var(--fw-semibold);
}
h4 {
  font-size: var(--fs-base);
  font-weight: var(--fw-semibold);
  letter-spacing: -0.01em;
}

/* M3 · Tabular nums fintech-grade: alineación columnar perfecta en cifras CLP/UF.
   Aplica a KPIs, montos en tablas, badges numéricos. */
.kpi-card__value,
.cargos-item__monto strong,
.cargos-item__monto small,
.lote-btn__count,
.count,
.acount-mios,
.gauge__label,
[class*="count-"],
[class*="gcount-"],
[class*="mcount-"],
[class*="acount-"],
.td-dias,
[data-numeric],
.cliente-cell__patente,
.td-patente {
  font-feature-settings: 'tnum' 1, 'lnum' 1;
  font-variant-numeric: tabular-nums lining-nums;
}

p {
  color: var(--text-secondary);
  line-height: var(--lh-normal);
}
small { font-size: var(--fs-xs); color: var(--text-muted); }
code {
  font-family: var(--font-mono);
  font-size: 0.92em;
  background: var(--neutral-100);
  padding: 0.1em 0.4em;
  border-radius: var(--radius-xs);
  color: var(--text-secondary);
}

a { color: var(--primary); text-decoration: none; }
/* underline solo en anchors-tipo-link, no en los que actúan como botón */
a:hover:not(.btn) { text-decoration: underline; }

/* --- Layout --- */
.container {
  max-width: 1200px;
  margin: 0 auto;
  padding: 0 var(--space-lg);
}

.container--narrow { max-width: 800px; }

/* --- Header --- */
.header {
  background: var(--surface);
  border-bottom: 1px solid var(--border);
  padding: var(--space-sm) 0;
  position: sticky;
  top: 0;
  z-index: 100;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.04);
}

.header__inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.header__brand {
  display: flex;
  align-items: center;
  gap: var(--space-sm);
}

.header__logo {
  width: 28px;
  height: 28px;
  background: var(--primary);
  border-radius: var(--radius-sm);
  display: flex;
  align-items: center;
  justify-content: center;
  color: white;
  font-weight: 800;
  font-size: 0.8rem;
}

.header__title {
  font-size: 0.95rem;
  font-weight: 700;
  color: var(--text);
}

.header__subtitle {
  font-size: 0.6rem;
  color: var(--text-muted);
  font-weight: 400;
  letter-spacing: 0.02em;
}

.header__nav {
  display: flex;
  gap: var(--space-sm);
  align-items: center;
}

.header__link {
  font-size: 0.8rem;
  color: var(--text-secondary);
  font-weight: 500;
  padding: var(--space-xs) var(--space-sm);
  border-radius: var(--radius-sm);
  transition: all 0.15s;
}

.header__link:hover,
.header__link--active {
  color: var(--primary);
  background: var(--primary-light);
  text-decoration: none;
}

/* =========================================================
   CARDS · /impeccable · borde sutil + sombra multi-layer
   Hover lift opcional (clase .card--interactive).
   ========================================================= */
.card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: var(--space-xl);
  box-shadow: var(--shadow-card);
  transition: box-shadow var(--duration-base) var(--ease-standard),
              border-color var(--duration-base) var(--ease-standard),
              transform var(--duration-base) var(--ease-standard);
}
.card--interactive { cursor: pointer; }
.card--interactive:hover {
  box-shadow: var(--shadow-hover);
  border-color: var(--border-strong);
  transform: translateY(-2px);
}
.card--accent {
  border-left: 3px solid var(--primary-600);
}
.card--bordered-strong {
  border-color: var(--border-strong);
}

.card--hero {
  text-align: center;
  padding: var(--space-xl);
  border: none;
  background: linear-gradient(135deg, var(--primary) 0%, var(--primary-dark) 100%);
  color: white;
}

.card--hero h1,
.card--hero p { color: white; }
.card--hero p { opacity: 0.9; }

/* --- KPI Cards --- */
/* =========================================================
   KPI CARDS · /impeccable + /ui-ux-pro-max
   - Bordes sutiles + sombra multi-layer.
   - Hover lift de 2px + elevación.
   - Status como tinte sutil y barra superior 2px (no full bg).
   - Hero number con letter-spacing tighter, tabular nums.
   - Click target visible (cursor pointer en clickable).
   ========================================================= */
.kpi-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(190px, 1fr));
  gap: var(--space-md);
  margin-bottom: var(--space-xl);
}

.kpi-card {
  position: relative;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: var(--space-lg) var(--space-lg) calc(var(--space-lg) - 2px);
  box-shadow: var(--shadow-xs);
  transition: box-shadow var(--duration-base) var(--ease-standard),
              border-color var(--duration-base) var(--ease-standard),
              transform var(--duration-base) var(--ease-standard);
  overflow: hidden;
}

.kpi-card::before {
  content: "";
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 2px;
  background: var(--neutral-200);
  transition: background var(--duration-base) var(--ease-standard);
}

.kpi-card:hover {
  box-shadow: var(--shadow-md);
  border-color: var(--border-strong);
  transform: translateY(-2px);
}

.kpi-card--clickable { cursor: pointer; }
.kpi-card--clickable:focus-visible {
  outline: 3px solid var(--primary-ring);
  outline-offset: 2px;
}

/* Status: barra superior tintada + número tintado (sin saturar el fondo) */
.kpi-card--danger::before  { background: var(--status-vencido); }
.kpi-card--warning::before { background: var(--danger); }
.kpi-card--caution::before { background: var(--status-30); }
.kpi-card--ok::before      { background: var(--success); }
.kpi-card--info::before    { background: var(--primary-600); }
.kpi-card--primary::before { background: var(--primary-600); }

.kpi-card--danger  .kpi-card__value { color: var(--status-vencido); }
.kpi-card--warning .kpi-card__value { color: var(--danger); }
.kpi-card--caution .kpi-card__value { color: var(--status-30); }
.kpi-card--ok      .kpi-card__value { color: var(--success); }
.kpi-card--info    .kpi-card__value { color: var(--primary-600); }
.kpi-card--primary .kpi-card__value { color: var(--primary-600); }

.kpi-card__label {
  font-size: 0.74rem;
  font-weight: var(--fw-semibold);
  text-transform: uppercase;
  letter-spacing: var(--tracking-widest);
  color: var(--text-muted);
  margin-bottom: var(--space-xs);
}

.kpi-card__value {
  font-size: clamp(2.1rem, 3.2vw, 2.85rem);
  font-weight: var(--fw-black);
  line-height: 1;
  letter-spacing: -0.025em;
  color: var(--text-primary);
  margin: 4px 0 var(--space-xs);
  font-feature-settings: 'tnum' 1, 'lnum' 1;
}

.kpi-card__detail {
  font-size: 0.78rem;
  color: var(--text-secondary);
  line-height: 1.4;
}

/* --- Status Badges --- */
.badge {
  display: inline-block;
  padding: 0.15em 0.55em;
  font-size: 0.7rem;
  font-weight: 600;
  border-radius: var(--radius-sm);
  white-space: nowrap;
}

.badge--al_dia    { background: var(--status-ok-bg); color: var(--status-ok); }
.badge--alerta_30 { background: var(--status-30-bg); color: var(--status-30); }
.badge--alerta_15 { background: var(--status-15-bg); color: var(--status-15); }
.badge--alerta_7  { background: var(--status-7-bg);  color: var(--status-7); }
.badge--vencido   { background: var(--status-vencido-bg); color: var(--status-vencido); }
.badge--atascado  { background: var(--status-vencido-bg); color: var(--status-vencido); }
.badge--riesgo    { background: var(--status-15-bg); color: var(--status-15); }
.badge--ok        { background: var(--status-ok-bg); color: var(--status-ok); }
.badge--sin-asignar { background: var(--bg-accent, #eef2ff); color: var(--text-secondary, #475569); }

/* --- KPI card prospectos + vista prospectos --- */
.kpi-card--prospectos {
  background: linear-gradient(180deg, color-mix(in oklab, var(--status-30-bg) 60%, var(--surface)) 0%, var(--surface) 100%);
}
.kpi-card--prospectos .kpi-card__value { color: var(--status-30, #b45309); }
.kpi-card--prospectos:hover { box-shadow: var(--shadow-md); }

.vista-prospectos { margin-top: var(--space-md); }
.vista-prospectos__header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: var(--space-md);
  margin-bottom: var(--space-md);
  flex-wrap: wrap;
}
.vista-prospectos__resumen { font-size: 0.95rem; color: var(--text-secondary); }
.vista-prospectos__resumen strong { color: var(--text); }
.vista-prospectos__grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(340px, 1fr));
  gap: var(--space-md);
}
.prospecto-card {
  background: var(--bg-card, #ffffff);
  border: 1px solid var(--border-color, #e2e8f0);
  border-radius: var(--radius-md);
  padding: var(--space-md);
  display: flex;
  flex-direction: column;
  gap: var(--space-sm);
}
.prospecto-card__header {
  display: flex;
  justify-content: space-between;
  align-items: start;
  gap: var(--space-sm);
}
.prospecto-card__rut {
  display: block;
  font-size: 0.75rem;
  color: var(--text-muted);
  font-family: var(--font-mono, monospace);
  margin-top: 2px;
}
.prospecto-card__contacto { font-size: 0.9rem; color: var(--text); }
.prospecto-card__meta { display: flex; flex-wrap: wrap; gap: 6px; }
.prospecto-card__acciones { display: flex; gap: 8px; flex-wrap: wrap; margin-top: auto; padding-top: var(--space-xs); }
.prospecto-card__acciones .btn { flex: 1; min-width: 120px; }

.chip--antig-lt3 { background: var(--status-ok-bg); color: var(--status-ok); }
.chip--antig-3a7 { background: var(--status-30-bg); color: var(--status-30); }
.chip--antig-gt7 { background: var(--status-vencido-bg); color: var(--status-vencido); font-weight: 700; }

/* =========================================================
   VISTA "MI DÍA" · lista priorizada de acciones
   Reemplaza la tabla filtrada por una lista clara de tareas.
   "Hoy tienes que hacer estas 3 cosas" — UX senior-friendly.
   ========================================================= */
.vista-midia { margin-top: var(--space-md); }
.vista-midia__header { margin-bottom: var(--space-md); }
.vista-midia__title {
  margin: 0 0 4px;
  font-size: 1.5rem;
  font-weight: 700;
  color: var(--text-primary, #0f172a);
}
.vista-midia__subtitle {
  margin: 0;
  font-size: 1rem;
  color: var(--text-secondary, #475569);
}
.vista-midia__list {
  display: flex;
  flex-direction: column;
  gap: var(--space-lg);
}
.midia-group {
  display: flex;
  flex-direction: column;
  gap: var(--space-xs);
}
.midia-group__header {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 8px 14px;
  background: var(--neutral-50);
  border-radius: var(--radius-md);
  font-size: 0.95rem;
  font-weight: 600;
  color: var(--text-primary, #0f172a);
}
.midia-group--atrasados   .midia-group__header { background: var(--status-vencido-bg); color: var(--status-vencido); }
.midia-group--esta_semana .midia-group__header { background: var(--status-7-bg); color: var(--status-7); }
.midia-group__icon  { font-size: 1.2rem; }
.midia-group__label { flex: 1; }
.midia-group__count {
  background: rgba(0,0,0,0.06);
  padding: 2px 10px;
  border-radius: var(--radius-full);
  font-size: 0.85rem;
  font-weight: 700;
}
.midia-group__items {
  display: flex;
  flex-direction: column;
  gap: 8px;
}
.midia-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--space-md);
  padding: var(--space-md) var(--space-lg);
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  cursor: pointer;
  transition: all var(--duration-fast) var(--ease-standard);
  min-height: 64px;
}
.midia-item:hover {
  border-color: var(--primary);
  box-shadow: var(--shadow-sm);
  transform: translateY(-1px);
}
.midia-item:focus-visible {
  outline: 2px solid var(--primary);
  outline-offset: 2px;
}
.midia-item__main { flex: 1; min-width: 0; }
.midia-item__title {
  font-size: 1.05rem;
  font-weight: 600;
  color: var(--text-primary, #0f172a);
  margin-bottom: 2px;
}
.midia-item__patente {
  font-family: var(--font-mono, monospace);
  font-weight: 700;
  color: var(--primary);
}
.midia-item__sub {
  font-size: 0.88rem;
  color: var(--text-muted);
}
.midia-item__right {
  display: flex;
  align-items: center;
  gap: var(--space-md);
  flex-shrink: 0;
}
.midia-item__plazo {
  font-size: 0.95rem;
  font-weight: 700;
  text-align: right;
  min-width: 130px;
}
.midia-item__plazo--vencido    { color: var(--status-vencido); }
.midia-item__plazo--alerta_7   { color: var(--status-7); }
.midia-item__plazo--alerta_15  { color: var(--status-15); }
.midia-item__plazo--alerta_30  { color: var(--status-30); }
.midia-item__plazo--al_dia     { color: var(--status-ok); }
.midia-item__plazo--spot       { color: var(--text-muted); font-style: italic; }
.midia-item__cta {
  white-space: nowrap;
  min-height: 40px;
}
.vista-midia__empty {
  text-align: center;
  padding: var(--space-xl);
  background: var(--neutral-50);
  border-radius: var(--radius-md);
}
.vista-midia__empty-icon {
  width: 56px;
  height: 56px;
  margin: 0 auto var(--space-sm);
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  background: var(--status-ok-bg);
  color: var(--status-ok);
  font-size: 1.5rem;
  font-weight: 700;
}
.vista-midia__empty h3 { margin: 0 0 4px; }
.vista-midia__empty p { margin: 0; color: var(--text-muted); }

/* Mobile: layout vertical en items */
@media (max-width: 640px) {
  .midia-item {
    flex-direction: column;
    align-items: stretch;
    gap: var(--space-sm);
  }
  .midia-item__right {
    justify-content: space-between;
  }
  .midia-item__plazo { min-width: 0; text-align: left; }
}

/* --- Vista por operador --- */
.vista-por-operador { margin-top: var(--space-md); }
.vista-por-operador__header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--space-md);
  margin-bottom: var(--space-md);
  flex-wrap: wrap;
}
.vista-por-operador__resumen {
  font-size: 0.95rem;
  color: var(--text-secondary, #475569);
}
.vista-por-operador__resumen strong { color: var(--text-primary, #0f172a); }
.pop-resumen__atascados { color: var(--status-vencido); font-weight: 600; }
.pop-resumen__sin-asignar { color: var(--status-15); font-weight: 600; }
.vista-por-operador__grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(340px, 1fr));
  gap: var(--space-md);
}
.operador-card {
  background: var(--bg-card, #ffffff);
  border: 1px solid var(--border-color, #e2e8f0);
  border-radius: var(--radius-md);
  overflow: hidden;
  display: flex;
  flex-direction: column;
}
.operador-card__header {
  padding: var(--space-sm) var(--space-md);
  background: var(--bg-muted, #f8fafc);
  border-bottom: 1px solid var(--border-color, #e2e8f0);
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: var(--space-sm);
}
.operador-card__header--atascado {
  background: var(--status-vencido-bg);
}
.operador-card__titulo { display: flex; flex-direction: column; min-width: 0; }
.operador-card__sub {
  font-size: 0.75rem;
  color: var(--text-secondary, #64748b);
  text-transform: capitalize;
}
.operador-card__contador {
  font-size: 0.8rem;
  color: var(--text-secondary, #475569);
  text-align: right;
  flex-shrink: 0;
}
.operador-card__atascados { color: var(--status-vencido); font-weight: 600; }
.operador-card--sin-asignar .operador-card__header {
  background: var(--bg-accent, #eef2ff);
}
.operador-card__lista { padding: var(--space-xs); display: flex; flex-direction: column; gap: 2px; }
.tramite-mini-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: var(--space-sm);
  padding: 0.55rem var(--space-sm);
  border-radius: var(--radius-sm);
  cursor: pointer;
  transition: background 150ms ease;
}
.tramite-mini-row:hover { background: var(--bg-muted, #f1f5f9); }
.tramite-mini-row--atascado { background: var(--status-vencido-bg); }
.tramite-mini-row--atascado:hover { background: var(--status-vencido-bg); filter: brightness(0.97); }
.tramite-mini-row--riesgo { background: var(--status-15-bg); }
.tramite-mini-row--riesgo:hover { background: var(--status-15-bg); filter: brightness(0.97); }
.tramite-mini-row__main { display: flex; align-items: baseline; gap: 0.5rem; min-width: 0; flex-wrap: wrap; }
.tramite-mini-row__main strong { font-family: var(--font-mono, 'JetBrains Mono', monospace); }
.tramite-mini-row__tipo { font-size: 0.85rem; color: var(--text-primary, #0f172a); }
.tramite-mini-row__empresa { font-size: 0.75rem; color: var(--text-secondary, #64748b); }
.tramite-mini-row__meta { flex-shrink: 0; }

/* --- Forms --- */
.form-group {
  margin-bottom: var(--space-md);
}

.form-group label {
  display: block;
  font-size: 0.88rem;
  font-weight: var(--fw-semibold);
  color: var(--text-primary);
  margin-bottom: var(--space-xs);
  letter-spacing: -0.005em;
}

.form-group label .required {
  color: var(--danger);
  margin-left: 2px;
}

.form-group small {
  display: block;
  font-size: 0.78rem;
  color: var(--text-muted);
  margin-top: 4px;
  line-height: 1.4;
}

.form-row {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  gap: var(--space-md);
}

/* =========================================================
   PATRÓN "link bajo demanda" · "No tengo este dato"
   Usado en /portal modal Agregar vehículo.
   El link es discreto; al hacer clic se expande un panel
   con radios y desactiva el input principal.
   ========================================================= */
.av-link-nodato {
  background: none;
  border: none;
  color: var(--text-muted);
  font-size: 0.82rem;
  padding: 6px 0 0;
  cursor: pointer;
  text-align: left;
  text-decoration: underline;
  text-decoration-style: dotted;
  text-underline-offset: 3px;
  display: inline-block;
}
.av-link-nodato:hover {
  color: var(--primary);
}
.av-motivo-panel {
  margin-top: 8px;
  padding: 12px 14px;
  background: #fffbeb;
  border: 1px solid #fde68a;
  border-radius: 6px;
  font-size: 0.88rem;
}
.av-motivo-titulo {
  font-weight: 600;
  margin-bottom: 8px;
  color: #78350f;
}
.av-motivo-radio {
  display: flex;
  align-items: flex-start;
  gap: 8px;
  padding: 6px 0;
  cursor: pointer;
  color: #1f2937;
  line-height: 1.4;
}
.av-motivo-radio input[type="radio"] {
  margin-top: 3px;
  flex-shrink: 0;
  width: auto;
  height: auto;
  min-height: 0;
}
.av-motivo-radio:hover {
  color: var(--primary);
}
.av-link-volver {
  background: none;
  border: none;
  color: var(--primary);
  font-size: 0.8rem;
  padding: 8px 0 0;
  cursor: pointer;
  text-decoration: underline;
  display: inline-block;
}

/* =========================================================
   INPUTS · /impeccable · 44px altura, focus ring claro
   ========================================================= */
input[type="text"],
input[type="email"],
input[type="tel"],
input[type="date"],
input[type="password"],
input[type="number"],
input[type="search"],
input[type="url"],
select,
textarea {
  width: 100%;
  padding: 0.6rem 0.85rem;
  font-size: 0.95rem;
  font-family: inherit;
  line-height: 1.4;
  color: var(--text);
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  transition: border-color var(--duration-fast) var(--ease-standard),
              box-shadow var(--duration-fast) var(--ease-standard),
              background var(--duration-fast) var(--ease-standard);
  appearance: none;
  -webkit-appearance: none;
}

input:hover:not(:focus):not(:disabled),
select:hover:not(:focus):not(:disabled),
textarea:hover:not(:focus):not(:disabled) {
  border-color: var(--border-strong);
}

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

input::placeholder,
textarea::placeholder {
  color: var(--text-muted);
  opacity: 0.7;
}

input:disabled,
select:disabled,
textarea:disabled {
  background: var(--neutral-100);
  color: var(--text-muted);
  cursor: not-allowed;
}

input.error,
select.error { border-color: var(--danger); }
input.error:focus,
select.error:focus { box-shadow: 0 0 0 3px var(--danger-ring); }

.form-error {
  font-size: 0.78rem;
  color: var(--danger);
  margin-top: var(--space-xs);
}

/* =========================================================
   BUTTONS · /impeccable + /ui-ux-pro-max
   - Sombras multi-layer, hover lift sutil, pressed feedback.
   - Letter-spacing tight para sentir premium (-0.01em).
   - Focus ring grueso + offset accesible.
   - Active scale para tactile feel.
   ========================================================= */
/* .btn base · migrado a .c-btn del DS (css/ds/components.css) */

/* PRIMARY · sombra tintada, lift on hover */
.btn--primary {
  background: var(--primary-600);
  color: var(--neutral-0);
  box-shadow: var(--shadow-primary-sm);
}
.btn--primary:hover:not(:disabled) {
  background: var(--primary-700);
  box-shadow: var(--shadow-primary-md);
  transform: translateY(-1px);
}
.btn--primary:active:not(:disabled) {
  background: var(--primary-800);
  box-shadow: var(--shadow-primary-sm);
  transform: translateY(0);
}

/* SECONDARY · neutral con borde, lift sutil */
.btn--secondary {
  background: var(--surface);
  color: var(--text);
  border-color: var(--border);
  box-shadow: var(--shadow-xs);
}
.btn--secondary:hover:not(:disabled) {
  background: var(--neutral-50);
  border-color: var(--border-strong);
  box-shadow: var(--shadow-sm);
  transform: translateY(-1px);
}
.btn--secondary:active:not(:disabled) {
  background: var(--neutral-100);
  box-shadow: none;
  transform: translateY(0);
}

/* .btn--danger · migrado a .c-btn--danger del DS */

/* DANGER SOFT · rojo suave con borde (acciones destructivas no-primarias) */
.btn--danger-soft {
  background: #fef2f2;
  color: #b91c1c;
  border: 1px solid #fecaca;
  box-shadow: none;
}
.btn--danger-soft:hover:not(:disabled) {
  background: #fee2e2;
  border-color: #fca5a5;
  color: #991b1b;
}

/* Chips de motivos rápidos · click rellena el textarea del modal de motivo */
.motivo-chip {
  background: #f1f5f9;
  border: 1px solid #cbd5e1;
  color: #334155;
  padding: 6px 12px;
  border-radius: 999px;
  font-size: 0.82rem;
  font-weight: 500;
  cursor: pointer;
  transition: background 0.15s, border-color 0.15s;
  font-family: inherit;
}
.motivo-chip:hover {
  background: #e2e8f0;
  border-color: #94a3b8;
}
.motivo-chip:active {
  background: #cbd5e1;
}

/* .btn--ghost · migrado a .c-btn--ghost del DS */

/* =============================================
   Tareas widget (top del panel)
   ============================================= */
.tareas-widget {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  padding: var(--space-md);
  box-shadow: var(--shadow-sm);
}
.tareas-widget__empty {
  display: flex;
  justify-content: space-between;
  align-items: center;
  color: var(--text-muted);
  font-size: 0.88rem;
}
.tareas-widget__header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: var(--space-sm);
  font-size: 0.9rem;
}
.tareas-widget__list {
  list-style: none;
  padding: 0;
  margin: 0;
}
.tarea-item {
  display: flex;
  gap: 10px;
  padding: 8px 0;
  border-bottom: 1px solid var(--border);
}
.tarea-item:last-child { border-bottom: none; }
.tarea-item__check { margin-top: 2px; flex-shrink: 0; }
.tarea-item__body { flex: 1; min-width: 0; }
.tarea-item__texto { color: var(--text); font-size: 0.88rem; }
.tarea-item__meta {
  color: var(--text-muted);
  font-size: 0.76rem;
  margin-top: 4px;
  display: flex;
  gap: 8px;
  align-items: center;
}
.tareas-widget__more {
  color: var(--primary);
  font-size: 0.8rem;
  text-align: center;
  padding: 6px 0 0;
  cursor: pointer;
}

/* =============================================
   Saved Views dropdown
   ============================================= */
.saved-views-dropdown {
  position: absolute;
  top: calc(100% + 4px);
  right: 0;
  width: 260px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  box-shadow: var(--shadow-lg);
  z-index: 100;
  padding: 8px;
  animation: saved-views-pop 120ms ease-out;
}
@keyframes saved-views-pop {
  from { opacity: 0; transform: translateY(-4px); }
  to   { opacity: 1; transform: translateY(0); }
}
.saved-views__section { margin-bottom: 8px; }
.saved-views__section:last-child { margin-bottom: 0; }
.saved-views__title {
  font-size: 0.68rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--text-muted);
  padding: 6px 10px 2px;
}
.saved-view {
  display: flex;
  width: 100%;
  justify-content: space-between;
  align-items: center;
  padding: 8px 10px;
  background: transparent;
  border: none;
  border-radius: 6px;
  text-align: left;
  cursor: pointer;
  font-size: 0.86rem;
  color: var(--text);
}
.saved-view:hover { background: var(--primary-light); color: var(--primary-dark); }
.saved-view__name { flex: 1; }
.saved-view__badge {
  font-size: 0.65rem;
  color: var(--text-muted);
  background: var(--bg);
  padding: 1px 6px;
  border-radius: 999px;
}
.saved-view__del {
  background: transparent;
  border: none;
  color: var(--text-muted);
  cursor: pointer;
  font-size: 1.1rem;
  line-height: 1;
  padding: 0 4px;
  opacity: 0;
  transition: opacity 100ms ease;
}
.saved-view:hover .saved-view__del { opacity: 1; }
.saved-view__del:hover { color: var(--status-vencido); }
.saved-view__empty {
  padding: 10px;
  font-size: 0.78rem;
  color: var(--text-muted);
  font-style: italic;
  text-align: center;
}
.saved-views__footer {
  border-top: 1px solid var(--border);
  padding-top: 8px;
  margin-top: 4px;
}

/* =============================================
   Inline edit (celda tabla)
   ============================================= */
.cell-editable {
  position: relative;
  cursor: pointer;
  padding-right: 20px;
  border-radius: 4px;
  transition: background 100ms ease;
}
.cell-editable:hover { background: var(--primary-light); }
.cell-editable__icon {
  position: absolute;
  right: 4px;
  top: 50%;
  transform: translateY(-50%);
  font-size: 0.72rem;
  color: var(--text-muted);
  opacity: 0;
  transition: opacity 100ms ease;
}
.cell-editable:hover .cell-editable__icon { opacity: 1; color: var(--primary); }

.inline-edit-popover {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  box-shadow: var(--shadow-lg);
  padding: 12px;
  min-width: 280px;
  z-index: 200;
  animation: saved-views-pop 120ms ease-out;
}
.inline-edit-popover__title {
  font-size: 0.7rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--text-muted);
  margin-bottom: 8px;
}
.inline-edit-popover select {
  width: 100%;
  padding: 6px 8px;
  font-size: 0.88rem;
  border: 1px solid var(--border);
  border-radius: 6px;
}
.inline-edit-popover__close {
  position: absolute;
  top: 6px;
  right: 8px;
  background: transparent;
  border: none;
  font-size: 1.1rem;
  color: var(--text-muted);
  cursor: pointer;
}

/* =============================================
   Cliente 360
   ============================================= */
.c360 { min-height: calc(100vh - 120px); }
.c360__header {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: var(--space-xl);
  margin-bottom: var(--space-lg);
  box-shadow: var(--shadow-sm);
}
.c360__title-row {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: var(--space-lg);
  flex-wrap: wrap;
}
.c360__title-main { flex: 1; min-width: 280px; }

/* Badge de riesgo en el header */
.c360__riesgo-badge {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  font-size: 0.72rem;
  font-weight: 700;
  padding: 4px 10px;
  border-radius: 999px;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  margin-left: 8px;
  vertical-align: middle;
}
.c360__riesgo-badge--alto {
  background: var(--status-vencido-bg);
  color: var(--status-vencido);
  animation: pulse-alert 2.2s ease-out infinite;
}
.c360__riesgo-badge--medio {
  background: var(--status-30-bg);
  color: var(--status-30);
}

.c360__ult-contacto {
  font-size: 0.8rem;
  color: var(--text-muted);
  margin-top: 4px;
}

/* Health Score ring con tooltip */
.c360__health {
  position: relative;
  width: 72px;
  height: 72px;
  cursor: help;
  flex-shrink: 0;
}
.c360__health-ring {
  width: 72px;
  height: 72px;
  transform: rotate(0deg);
  transition: transform 220ms ease;
}
.c360__health-label {
  position: absolute;
  inset: 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  pointer-events: none;
}
.c360__health-label strong { font-size: 1.1rem; color: var(--text); line-height: 1; }
.c360__health-label small { font-size: 0.62rem; color: var(--text-muted); }
.c360__health-tooltip {
  position: absolute;
  top: calc(100% + 8px);
  right: 0;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  box-shadow: var(--shadow-lg);
  padding: 12px 14px;
  width: 280px;
  opacity: 0;
  pointer-events: none;
  transform: translateY(-4px);
  transition: opacity 160ms ease, transform 160ms ease;
  z-index: 50;
}
.c360__health:hover .c360__health-tooltip,
.c360__health:focus-within .c360__health-tooltip {
  opacity: 1;
  pointer-events: auto;
  transform: translateY(0);
}
.c360__health-title {
  font-size: 0.72rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--text-muted);
  margin-bottom: 6px;
}
.c360__health-razones {
  list-style: none;
  padding: 0;
  margin: 0;
  font-size: 0.82rem;
  color: var(--text);
}
.c360__health-razones li {
  padding: 4px 0;
  border-bottom: 1px solid var(--border);
}
.c360__health-razones li:last-child { border-bottom: none; }

/* KPIs clickeables */
.kpi-card--clickable {
  cursor: pointer;
  transition: transform 120ms ease, box-shadow 120ms ease;
}
.kpi-card--clickable:hover {
  transform: translateY(-1px);
  box-shadow: var(--shadow-md);
}
.kpi-card--clickable:focus-visible {
  outline: 2px solid var(--primary);
  outline-offset: 2px;
}

/* Filtros chips dentro de Cliente 360 */
.c360__filtros {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin: 8px 0 12px;
}

/* Fila vencida destacada en tabla tramites */
.c360__row--vencido td { background: rgba(220, 38, 38, 0.04); }

/* filter-btn variantes semanticas */
.filter-btn--ok:not(.filter-btn--active) {
  border-color: var(--status-ok);
  color: var(--status-ok);
}
.filter-btn--ok:not(.filter-btn--active) .count {
  background: var(--status-ok-bg);
  color: var(--status-ok);
}
.filter-btn--warn:not(.filter-btn--active) {
  border-color: var(--warning, #ea580c);
  color: var(--warning, #ea580c);
  background: var(--warning-light, rgba(234, 88, 12, 0.08));
}
.filter-btn--warn:not(.filter-btn--active) .count {
  background: var(--warning, #ea580c);
  color: white;
}

/* =============================================
   Clientes tabs agrupados (config > Clientes)
   ============================================= */
.clientes-toolbar {
  display: flex;
  justify-content: space-between;
  align-items: flex-end;
  gap: var(--space-lg);
  margin-bottom: var(--space-md);
  flex-wrap: wrap;
}
.clientes-tabs {
  display: flex;
  gap: var(--space-lg);
  flex-wrap: wrap;
  align-items: flex-end;
}
.clientes-tabs__group {
  display: flex;
  flex-direction: column;
  gap: 4px;
}
.clientes-tabs__label {
  font-size: 0.65rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--text-muted);
  padding-left: 2px;
}
.clientes-tabs__group:has(+ .clientes-tabs__group) {
  padding-right: var(--space-md);
  border-right: 1px solid var(--border);
}
.clientes-tab {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 8px 14px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  cursor: pointer;
  font-size: 0.9rem;
  color: var(--text-secondary);
  transition: all 120ms ease;
  white-space: nowrap;
}
.clientes-tab:hover {
  border-color: var(--border-strong);
  color: var(--text);
}
.clientes-tab--active {
  background: var(--primary);
  color: white;
  border-color: var(--primary);
  box-shadow: var(--shadow-sm);
}
.clientes-tab--active .clientes-tab__count {
  background: rgba(255, 255, 255, 0.2);
  color: white;
}
.clientes-tab__count {
  background: var(--bg);
  color: var(--text-muted);
  padding: 1px 8px;
  border-radius: 999px;
  font-size: 0.72rem;
  font-weight: 700;
  min-width: 22px;
  text-align: center;
}
/* Tab "Foco operacional" destacado cuando no activo */
.clientes-tab--foco:not(.clientes-tab--active) {
  border-color: var(--status-ok);
  color: var(--status-ok);
}
.clientes-tab--foco:not(.clientes-tab--active) .clientes-tab__count {
  background: var(--status-ok-bg);
  color: var(--status-ok);
}

/* Search inline */
.clientes-search {
  position: relative;
  flex: 0 1 320px;
  min-width: 240px;
}
.clientes-search svg {
  position: absolute;
  left: 12px;
  top: 50%;
  transform: translateY(-50%);
  width: 16px;
  height: 16px;
  color: var(--text-muted);
  pointer-events: none;
}
.clientes-search input {
  width: 100%;
  padding: 10px 36px 10px 36px;
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  font-size: 0.9rem;
  background: var(--surface);
  transition: border-color 120ms ease, box-shadow 120ms ease;
}
.clientes-search input:focus {
  outline: none;
  border-color: var(--primary);
  box-shadow: 0 0 0 3px var(--primary-ring);
}
.clientes-search__clear {
  position: absolute;
  right: 8px;
  top: 50%;
  transform: translateY(-50%);
  width: 24px;
  height: 24px;
  border: none;
  background: transparent;
  color: var(--text-muted);
  font-size: 1.2rem;
  cursor: pointer;
  border-radius: 50%;
}
.clientes-search__clear:hover {
  background: var(--bg);
  color: var(--text);
}

.clientes-resumen {
  font-size: 0.82rem;
  color: var(--text-muted);
  margin-bottom: var(--space-sm);
}
.clientes-resumen strong { color: var(--text); }

@media (max-width: 820px) {
  .clientes-tabs { gap: var(--space-sm); }
  .clientes-tabs__group:has(+ .clientes-tabs__group) {
    padding-right: 0;
    border-right: none;
  }
  .clientes-search { flex: 1 1 100%; }
}

/* Cliente 360 empty state (sin id) */
.c360-empty {
  max-width: 720px;
  margin: 2rem auto;
  display: flex;
  flex-direction: column;
  gap: var(--space-xl);
}
.c360-empty__header {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: var(--space-2xl) var(--space-xl);
  text-align: center;
  box-shadow: var(--shadow-sm);
}
.c360-empty__header h1 {
  font-size: 1.75rem;
  margin: 0 0 var(--space-sm);
  letter-spacing: -0.02em;
}
.c360-empty__header p {
  color: var(--text-muted);
  margin: 0 0 var(--space-lg);
}
.c360-empty__header kbd {
  display: inline-block;
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: 4px;
  padding: 1px 6px;
  font-family: inherit;
  font-size: 0.82rem;
  color: var(--text-secondary);
}
.c360-empty__subtitle {
  font-size: 0.75rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--text-muted);
  margin: 0 0 var(--space-md);
}
.c360-empty__grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(240px, 1fr));
  gap: var(--space-sm);
}
.c360-empty__card {
  display: block;
  padding: var(--space-md);
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  text-decoration: none;
  transition: all 120ms ease;
}
.c360-empty__card:hover {
  border-color: var(--primary);
  box-shadow: var(--shadow-md);
  transform: translateY(-1px);
}
.c360-empty__nombre {
  font-weight: 600;
  color: var(--text);
  margin-bottom: 4px;
}
.c360-empty__meta {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 0.82rem;
  color: var(--text-muted);
}
.c360-empty__footer {
  display: flex;
  gap: var(--space-sm);
  justify-content: center;
  flex-wrap: wrap;
}

/* Celda "Cliente" en config > Clientes (empresa + contacto juntos) */
.cliente-cell { display: flex; flex-direction: column; gap: 2px; }
.cliente-cell__empresa {
  font-weight: 700;
  color: var(--text);
  text-decoration: none;
  font-size: 0.95rem;
  transition: color 120ms ease;
}
.cliente-cell__empresa:hover { color: var(--primary); text-decoration: underline; }
.cliente-cell__meta {
  font-size: 0.78rem;
  color: var(--text-muted);
  display: flex;
  align-items: center;
  gap: 4px;
  flex-wrap: wrap;
}
.cliente-cell__persona { color: var(--text-secondary); font-weight: 500; }

.cliente-canales { font-size: 0.85rem; line-height: 1.4; }
.cliente-canales__mail { color: var(--text); }
.cliente-canales__mail:hover { color: var(--primary); }
.cliente-canales__tel {
  color: var(--text-secondary);
  font-family: var(--font-mono);
  font-size: 0.8rem;
}

/* Notas internas side card */
.c360-nota {
  padding: 8px 0;
  border-bottom: 1px solid var(--border);
}
.c360-nota:last-of-type { border-bottom: none; }
.c360-nota__meta {
  font-size: 0.7rem;
  color: var(--text-muted);
  margin-bottom: 2px;
}
.c360-nota__texto {
  font-size: 0.85rem;
  color: var(--text);
  white-space: pre-wrap;
}
.c360-nota__form {
  display: flex;
  gap: 6px;
  margin-top: 10px;
  padding-top: 10px;
  border-top: 1px solid var(--border);
}
.c360-nota__form textarea {
  flex: 1;
  font-family: inherit;
  font-size: 0.82rem;
  padding: 6px 8px;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  resize: vertical;
  min-height: 44px;
}
.c360__back {
  display: inline-block;
  font-size: 0.82rem;
  color: var(--text-muted);
  margin-bottom: 6px;
}
.c360__back:hover { color: var(--primary); }
.c360__title {
  font-size: 1.75rem;
  font-weight: 700;
  letter-spacing: -0.02em;
  display: flex;
  align-items: center;
  gap: 12px;
  margin: 0;
}
.c360__meta {
  color: var(--text-secondary);
  font-size: 0.9rem;
  margin-top: 8px;
}
.c360__meta a { color: var(--text-secondary); border-bottom: 1px dashed var(--border-strong); }
.c360__meta a:hover { color: var(--primary); border-color: var(--primary); }
.c360__actions { display: flex; gap: var(--space-sm); flex-wrap: wrap; }

.c360__kpis {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: var(--space-md);
  margin-bottom: var(--space-lg);
}
@media (max-width: 820px) { .c360__kpis { grid-template-columns: repeat(2, 1fr); } }

.c360__grid {
  display: grid;
  grid-template-columns: 1fr 340px;
  gap: var(--space-lg);
}
@media (max-width: 1024px) { .c360__grid { grid-template-columns: 1fr; } }

.c360__section {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: var(--space-xl);
  margin-bottom: var(--space-lg);
  box-shadow: var(--shadow-sm);
}
.c360__section h2 {
  font-size: 1.05rem;
  margin: 0;
  color: var(--text);
}
.c360__section-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--space-md);
  margin-bottom: var(--space-md);
  flex-wrap: wrap;
}
.c360__section .empty {
  color: var(--text-muted);
  font-style: italic;
  padding: var(--space-md);
  text-align: center;
}

.c360__side-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: var(--space-lg);
  margin-bottom: var(--space-md);
  box-shadow: var(--shadow-sm);
}
.c360__side-card h3 {
  font-size: 0.88rem;
  font-weight: 600;
  color: var(--text-secondary);
  text-transform: uppercase;
  letter-spacing: 0.04em;
  margin: 0 0 var(--space-sm);
}
.c360__side-card .empty { color: var(--text-muted); font-size: 0.85rem; font-style: italic; }

.c360__dl {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 6px 12px;
  margin: 0;
  font-size: 0.85rem;
}
.c360__dl dt { color: var(--text-muted); }
.c360__dl dd { margin: 0; color: var(--text); font-weight: 500; }

.c360__list {
  list-style: none;
  padding: 0;
  margin: 0;
  font-size: 0.85rem;
}
.c360__list li {
  padding: 8px 0;
  border-bottom: 1px solid var(--border);
}
.c360__list li:last-child { border-bottom: none; }
.c360__list small { color: var(--text-muted); font-size: 0.75rem; }

/* Timeline */
.c360-tl {
  display: flex;
  flex-direction: column;
  gap: 12px;
  position: relative;
  padding-left: 22px;
}
.c360-tl::before {
  content: '';
  position: absolute;
  left: 7px;
  top: 4px;
  bottom: 4px;
  width: 2px;
  background: var(--border);
}
.c360-tl__item { position: relative; padding-left: 16px; }
.c360-tl__dot {
  position: absolute;
  left: -20px;
  top: 6px;
  width: 12px;
  height: 12px;
  border-radius: 50%;
  background: var(--primary);
  border: 2px solid var(--surface);
  box-shadow: 0 0 0 1px var(--border);
}
.c360-tl__item--lead .c360-tl__dot { background: var(--accent-tracking); }
.c360-tl__item--pago .c360-tl__dot { background: var(--accent-delivered); }
.c360-tl__item--estado .c360-tl__dot { background: var(--primary); }
.c360-tl__head { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.c360-tl__titulo { font-weight: 600; color: var(--text); font-size: 0.9rem; }
.c360-tl__sub { color: var(--text-secondary); font-size: 0.82rem; margin-top: 2px; }
.c360-tl__fecha { color: var(--text-muted); font-size: 0.72rem; margin-top: 4px; }

/* Header search button (pill tipo Linear/Stripe) */
.header__search {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 6px 10px 6px 12px;
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: 999px;
  color: var(--text-muted);
  font-size: 0.82rem;
  cursor: pointer;
  transition: all 150ms ease;
  margin-right: 8px;
}
.header__search:hover {
  background: var(--surface);
  border-color: var(--border-strong);
  color: var(--text);
  box-shadow: var(--shadow-sm);
}
.header__search svg { width: 14px; height: 14px; flex-shrink: 0; }
.header__search-label { font-weight: 500; }
.header__search-kbd {
  font-family: inherit;
  font-size: 0.68rem;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 4px;
  padding: 2px 6px;
  color: var(--text-muted);
  letter-spacing: 0.02em;
}
@media (max-width: 820px) {
  .header__search-label, .header__search-kbd { display: none; }
  .header__search { padding: 8px; border-radius: 8px; }
}

/* Global Search overlay */
.gsearch-overlay {
  position: fixed; inset: 0;
  background: rgba(17, 24, 39, 0.55);
  backdrop-filter: blur(4px);
  -webkit-backdrop-filter: blur(4px);
  z-index: 9000;
  display: flex; align-items: flex-start; justify-content: center;
  padding-top: 12vh;
  animation: gsearch-fade 140ms ease-out;
}
@keyframes gsearch-fade {
  from { opacity: 0; }
  to   { opacity: 1; }
}
.gsearch {
  width: min(640px, 92vw);
  background: var(--surface);
  border-radius: 12px;
  box-shadow: 0 24px 72px rgba(17, 24, 39, 0.28), 0 8px 24px rgba(37, 99, 235, 0.12);
  overflow: hidden;
  display: flex; flex-direction: column;
  max-height: 70vh;
  animation: gsearch-pop 180ms cubic-bezier(0.34, 1.56, 0.64, 1);
}
@keyframes gsearch-pop {
  from { transform: translateY(-12px) scale(0.98); opacity: 0; }
  to   { transform: translateY(0) scale(1); opacity: 1; }
}
.gsearch__header {
  display: flex; align-items: center; gap: 12px;
  padding: 16px 18px;
  border-bottom: 1px solid var(--border);
}
.gsearch__icon { width: 18px; height: 18px; color: var(--text-muted); flex-shrink: 0; }
.gsearch__header input {
  flex: 1;
  border: none;
  outline: none;
  font-size: 1rem;
  color: var(--text);
  background: transparent;
  padding: 0;
}
.gsearch__header input::placeholder { color: var(--text-muted); }
.gsearch__kbd {
  font-family: inherit;
  font-size: 0.7rem;
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: 4px;
  padding: 2px 8px;
  color: var(--text-muted);
}
.gsearch__results {
  flex: 1;
  overflow-y: auto;
  padding: 8px;
}
.gsearch__hint {
  padding: 36px 20px;
  text-align: center;
  color: var(--text-muted);
  font-size: 0.88rem;
}
.gsearch__hint--err { color: var(--status-vencido); }
.gsearch__group { margin-bottom: 8px; }
.gsearch__group-title {
  font-size: 0.7rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--text-muted);
  padding: 6px 12px;
}
.gsearch__item {
  display: flex; align-items: center; gap: 12px;
  padding: 10px 12px;
  border-radius: 8px;
  cursor: pointer;
  transition: background 100ms ease;
}
.gsearch__item:hover, .gsearch__item--active {
  background: var(--primary-light);
}
.gsearch__item--active { box-shadow: inset 0 0 0 1px var(--primary); }
.gsearch__main { flex: 1; min-width: 0; }
.gsearch__title { font-weight: 600; color: var(--text); font-size: 0.92rem; }
.gsearch__sub {
  font-size: 0.78rem;
  color: var(--text-muted);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.gsearch__badge {
  font-size: 0.68rem;
  background: var(--bg);
  border: 1px solid var(--border);
  padding: 2px 8px;
  border-radius: 999px;
  color: var(--text-secondary);
  text-transform: uppercase;
  letter-spacing: 0.03em;
}
.gsearch__footer {
  display: flex; gap: 20px;
  padding: 10px 18px;
  border-top: 1px solid var(--border);
  background: var(--bg);
  font-size: 0.74rem;
  color: var(--text-muted);
}
.gsearch__footer kbd {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 4px;
  padding: 1px 6px;
  margin-right: 4px;
  font-family: inherit;
}

/* Boton cerrar modal (touch target >= 44x44) */
.modal__close {
  position: absolute;
  top: 8px;
  right: 8px;
  width: 44px;
  height: 44px;
  min-width: 44px;
  min-height: 44px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  background: transparent;
  border: none;
  border-radius: 50%;
  font-size: 1.6rem;
  line-height: 1;
  cursor: pointer;
  color: var(--text-secondary, #475569);
  transition: background 150ms ease, color 150ms ease;
}
.modal__close:hover { background: var(--bg, #f8fafc); color: var(--text, #0f172a); }
.modal__close:focus-visible { outline: 2px solid var(--primary, #2563eb); outline-offset: 2px; }

/* Logout: rojo outline para destacar accion destructiva */
.btn--logout {
  border-color: #fecaca;
  color: #b91c1c;
  background: #fef2f2;
  font-weight: 600;
}
.btn--logout:hover:not(:disabled) {
  background: #fee2e2;
  border-color: #fca5a5;
  color: #991b1b;
}
.btn--logout:focus-visible {
  outline: 2px solid #dc2626;
  outline-offset: 2px;
}

/* .btn--sm · migrado a .c-btn--sm del DS */
.btn--full { width: 100%; }
.btn--lg { padding: 0.85rem 1.4rem; font-size: 1.05rem; min-height: 50px; }

/* --- Vehicle Fieldset --- */
.vehicle-card {
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  padding: var(--space-lg);
  margin-bottom: var(--space-md);
  position: relative;
}

.vehicle-card__header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: var(--space-md);
}

.vehicle-card__number {
  font-weight: 700;
  font-size: 0.875rem;
  color: var(--primary);
}

.vehicle-card__remove {
  background: none;
  border: none;
  color: var(--text-muted);
  cursor: pointer;
  font-size: 1.25rem;
  padding: var(--space-xs);
  border-radius: var(--radius-sm);
  transition: all 0.15s;
}

.vehicle-card__remove:hover {
  color: var(--status-7);
  background: var(--status-7-bg);
}

.vehicle-card__dates {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: var(--space-md);
  margin-top: var(--space-md);
}

/* =========================================================
   TABLE · /impeccable
   - Wrapper con sombra refinada.
   - Header sticky en scroll vertical.
   - Hover row con tinte primary sutil.
   - Sin zebra (cleaner) + linea separadora muy sutil.
   - Patentes con tipografía mono distintiva.
   ========================================================= */
.table-wrapper {
  overflow-x: auto;
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  background: var(--surface);
  box-shadow: var(--shadow-xs);
}

.table-wrapper table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.92rem;
}

.table-wrapper thead {
  position: sticky;
  top: 0;
  z-index: 1;
  background: var(--neutral-50);
  backdrop-filter: blur(4px);
}

.table-wrapper th {
  text-align: left;
  padding: 11px 14px;
  font-weight: var(--fw-semibold);
  font-size: 0.72rem;
  text-transform: uppercase;
  letter-spacing: var(--tracking-widest);
  color: var(--text-muted);
  border-bottom: 1px solid var(--border);
  white-space: nowrap;
  background: var(--neutral-50);
}

.table-wrapper td {
  padding: 12px 14px;
  border-bottom: 1px solid var(--neutral-100);
  vertical-align: middle;
  color: var(--text);
}

.table-wrapper tbody tr {
  transition: background var(--duration-fast) var(--ease-standard);
}
.table-wrapper tbody tr:hover {
  background: var(--primary-50);
}
.table-wrapper tbody tr:last-child td { border-bottom: none; }

/* Patente: ficha estilo placa */
.td-patente {
  font-weight: var(--fw-bold);
  font-family: var(--font-mono);
  font-size: 0.92rem;
  letter-spacing: 0.05em;
  color: var(--text-primary);
  display: inline-block;
  padding: 3px 8px;
  background: var(--neutral-50);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
}

.td-dias {
  font-weight: 700;
  font-size: 0.9rem;
  text-align: center;
}

.td-dias--negative { color: var(--status-vencido); }
.td-dias--urgent   { color: var(--status-7); }
.td-dias--warning  { color: var(--status-15); }
.td-dias--caution  { color: var(--status-30); }
.td-dias--ok       { color: var(--status-ok); }

/* =========================================================
   SITUACIÓN · celda unificada (estado + gestión)
   Reemplaza columnas Días/Estado/Gestión por texto humano
   "Atrasado N días", "Vence en N días", "Al día"
   ========================================================= */
.td-situacion { min-width: 170px; }
.situacion-cell {
  display: flex;
  flex-direction: column;
  gap: 4px;
  line-height: 1.3;
}
.situacion-plazo {
  font-weight: 700;
  font-size: 0.95rem;
}
.situacion-plazo--vencido    { color: var(--status-vencido); }
.situacion-plazo--alerta_7   { color: var(--status-7); }
.situacion-plazo--alerta_15  { color: var(--status-15); }
.situacion-plazo--alerta_30  { color: var(--status-30); }
.situacion-plazo--al_dia     { color: var(--status-ok); }
.situacion-plazo--spot       { color: var(--text-muted); font-style: italic; }
.situacion-gestion {
  font-size: 0.78rem;
  font-weight: 500;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.04em;
}
.situacion-gestion--en_gestion { color: var(--primary); }
.situacion-gestion--completado { color: var(--status-ok); }
.situacion-gestion--pendiente  { color: var(--text-muted); }

/* =========================================================
   SEARCH BOX · /impeccable
   Pill grande, ícono refinado, focus ring claro.
   ========================================================= */
.search-box {
  position: relative;
  margin-bottom: var(--space-md);
  max-width: 420px;
}
.search-box input {
  padding: 11px 16px 11px 42px;
  font-size: 0.95rem;
  border-radius: var(--radius-full);
  background: var(--neutral-50);
  border: 1px solid var(--border);
  transition: background var(--duration-fast) var(--ease-standard),
              border-color var(--duration-fast) var(--ease-standard),
              box-shadow var(--duration-fast) var(--ease-standard);
}
.search-box input:hover:not(:focus) {
  background: var(--neutral-100);
  border-color: var(--border-strong);
}
.search-box input:focus {
  background: var(--surface);
  border-color: var(--primary-600);
  box-shadow: 0 0 0 4px var(--primary-ring);
}
.search-box__icon {
  position: absolute;
  left: 14px;
  top: 50%;
  transform: translateY(-50%);
  color: var(--text-muted);
  pointer-events: none;
  width: 18px;
  height: 18px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
}
.search-box__icon svg { width: 18px; height: 18px; }

/* =========================================================
   FILTERS · /impeccable
   Botones tipo "chip", hover tintado, activo con primary fill.
   ========================================================= */
.filters {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-bottom: var(--space-sm);
}

.filter-btn {
  padding: 6px 12px;
  font-size: 0.82rem;
  font-weight: var(--fw-medium);
  border: 1px solid var(--border);
  border-radius: var(--radius-full);
  background: var(--surface);
  color: var(--text-secondary);
  cursor: pointer;
  transition: background var(--duration-fast) var(--ease-standard),
              color var(--duration-fast) var(--ease-standard),
              border-color var(--duration-fast) var(--ease-standard),
              box-shadow var(--duration-fast) var(--ease-standard);
  font-family: inherit;
  white-space: nowrap;
  min-height: 30px;
}
.filter-btn:hover:not(.filter-btn--active) {
  background: var(--neutral-100);
  border-color: var(--border-strong);
  color: var(--text-primary);
}
.filter-btn:focus-visible {
  outline: 3px solid var(--primary-ring);
  outline-offset: 2px;
}

.filter-btn:hover {
  border-color: var(--primary);
  color: var(--primary);
  background: var(--primary-light);
}

.filter-btn--active {
  background: var(--primary-600);
  color: var(--neutral-0);
  border-color: var(--primary-600);
  box-shadow: var(--shadow-primary-sm);
}
.filter-btn--active:hover {
  background: var(--primary-700);
  border-color: var(--primary-700);
}

.filter-btn .count {
  display: inline-block;
  min-width: 1.4em;
  text-align: center;
  background: rgba(0, 0, 0, 0.06);
  padding: 0 6px;
  border-radius: var(--radius-full);
  font-size: 0.72rem;
  font-weight: var(--fw-semibold);
  margin-left: 6px;
  font-feature-settings: 'tnum' 1;
}

.filter-btn--active .count {
  background: rgba(255, 255, 255, 0.22);
  color: var(--neutral-0);
}

/* --- Filter rows (empresa, gestión) --- */
.filters-row {
  display: flex;
  align-items: center;
  gap: var(--space-xs);
  margin-bottom: var(--space-sm);
  flex-wrap: wrap;
}

.filters-row__label {
  font-size: 0.7rem;
  font-weight: 600;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.03em;
  white-space: nowrap;
  margin-right: var(--space-xs);
}

.filter-dot {
  display: inline-block;
  width: 7px;
  height: 7px;
  border-radius: 50%;
  margin-right: 2px;
  vertical-align: middle;
}
.filter-dot--pendiente  { background: #9ca3af; }
.filter-dot--en_gestion { background: #3b82f6; }
.filter-dot--completado { background: var(--status-ok); }

/* --- Filtros avanzados (colapsable) --- */
.filtros-avanzados { margin-bottom: var(--space-xs); }
.filtros-avanzados__toggle {
  display: flex; align-items: center; gap: var(--space-xs);
  background: none; border: none; cursor: pointer;
  padding: var(--space-xs) 0; font-size: 0.72rem;
  font-weight: 500; font-family: inherit; color: var(--text-muted);
  transition: color 0.15s;
}
.filtros-avanzados__toggle:hover { color: var(--text); }
.filtros-avanzados__icon { transition: transform 0.2s; font-size: 0.55rem; }
.filtros-avanzados__icon--open { transform: rotate(90deg); }
.filtros-avanzados__resumen {
  font-size: 0.68rem; color: var(--primary); font-weight: 600;
}
.filtros-avanzados__content {
  display: none; padding-left: var(--space-sm);
}
.filtros-avanzados__content--visible { display: block; }

/* --- Alerts / Toast --- */
.toast {
  position: fixed;
  bottom: var(--space-xl);
  right: var(--space-xl);
  max-width: min(92vw, 460px);
  padding: var(--space-md) var(--space-lg);
  border-radius: var(--radius-md);
  font-size: 0.95rem;
  font-weight: 500;
  line-height: 1.4;
  box-shadow: var(--shadow-lg), 0 12px 32px rgba(17, 24, 39, 0.18);
  /* Por encima de modal-overlay (9999) — los toasts deben verse SIEMPRE */
  z-index: 10001;
  transform: translateY(120%);
  opacity: 0;
  transition: transform 0.3s cubic-bezier(0.22, 1, 0.36, 1), opacity 0.3s ease;
  pointer-events: none;
  display: flex;
  flex-direction: column;
  gap: 0;
  overflow: hidden;
}
.toast__row {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  padding: 0;
}
/* Barra de progreso visible para timeout auto-cierre (6s) */
.toast__progress {
  position: absolute;
  left: 0;
  bottom: 0;
  height: 3px;
  width: 100%;
  background: rgba(255, 255, 255, 0.5);
  transform-origin: left center;
  animation: toast-progress 6s linear forwards;
}
@keyframes toast-progress {
  from { transform: scaleX(1); }
  to   { transform: scaleX(0); }
}
@media (prefers-reduced-motion: reduce) {
  .toast__progress { animation: none; display: none; }
}
.toast__icon {
  font-weight: 700;
  font-size: 1.05rem;
  flex-shrink: 0;
  line-height: 1.4;
}
.toast__msg {
  flex: 1;
  min-width: 0;
  word-break: break-word;
}
.toast__close {
  background: rgba(255, 255, 255, 0.18);
  color: inherit;
  border: 0;
  width: 28px;
  height: 28px;
  border-radius: 50%;
  font-size: 1.1rem;
  line-height: 1;
  cursor: pointer;
  flex-shrink: 0;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 0;
  transition: background 0.15s;
}
.toast__close:hover { background: rgba(255, 255, 255, 0.32); }
.toast--persistente { /* No se cierra solo · queda hasta que el user clickea ✕ */
  border-left: 4px solid rgba(255, 255, 255, 0.6);
}
.toast--visible { pointer-events: auto; }
@media (max-width: 600px) {
  .toast {
    bottom: var(--space-md);
    right: var(--space-md);
    left: var(--space-md);
    max-width: none;
  }
}

.toast--visible { transform: translateY(0); opacity: 1; }
/* Variantes legacy de color · solo aplican cuando el toast NO tiene c-toast
   adentro (compat con código viejo que aún emite el HTML de antes). */
.toast--success:not(:has(.c-toast)) { background: var(--status-ok); color: white; }
.toast--error:not(:has(.c-toast))   { background: var(--status-7); color: white; }
.toast--warning:not(:has(.c-toast)) { background: var(--status-15, #f59e0b); color: white; }
.toast--info:not(:has(.c-toast))    { background: var(--primary, #2563eb); color: white; }

/* Cuando el toast usa el patrón c-toast del DS, el wrapper externo (.toast)
   solo provee position fixed + animation · el c-toast pinta el contenido. */
.toast:has(.c-toast) {
  background: transparent;
  padding: 0;
  box-shadow: none;
  border: 0;
}
.toast .c-toast {
  width: 100%;
  min-width: unset;
}

/* --- Achievements (B2 Polish 2 · Linear-style minimalista) --- */
.achievements-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
  gap: var(--space-sm);
}
.achievement-badge {
  display: flex;
  align-items: center;
  gap: var(--space-sm);
  padding: var(--space-sm) var(--space-md);
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  transition: border-color 0.15s, box-shadow 0.15s;
}
.achievement-badge:hover {
  border-color: var(--primary);
  box-shadow: var(--shadow-sm);
}
.achievement-badge svg {
  width: 28px; height: 28px;
  flex-shrink: 0;
  color: var(--primary);
}
.achievement-badge__body { min-width: 0; }
.achievement-badge__label {
  font-size: 0.85rem;
  font-weight: 600;
  color: var(--text);
  letter-spacing: -0.01em;
}
.achievement-badge__date {
  font-size: 0.72rem;
  color: var(--text-muted);
  font-family: var(--font-mono);
  margin-top: 2px;
}

/* --- Demo Data Banner (A3 Polish 2) --- */
.demo-data-banner {
  display: flex;
  align-items: center;
  gap: var(--space-md);
  padding: var(--space-sm) var(--space-md);
  background: linear-gradient(90deg, color-mix(in oklab, var(--accent-indigo-bg) 70%, var(--surface)) 0%, var(--surface) 100%);
  border: 1px solid var(--accent-indigo-bg);
  border-radius: var(--radius-md);
  margin-bottom: var(--space-md);
  font-size: 0.88rem;
  color: var(--text);
}
.demo-data-banner__icon { font-size: 1.25rem; flex-shrink: 0; }
.demo-data-banner__text { flex: 1; line-height: 1.4; }
.demo-data-banner__text strong { color: var(--accent-indigo); }
@media (max-width: 600px) {
  .demo-data-banner { flex-wrap: wrap; }
  .demo-data-banner__text { flex: 1 0 100%; }
}

/* --- Alertas Home Banner (B1 Polish 2) --- */
.alertas-home-banner {
  display: flex;
  align-items: center;
  gap: var(--space-md);
  padding: var(--space-md) var(--space-lg);
  border-radius: var(--radius-md);
  margin-bottom: var(--space-md);
  font-size: 0.92rem;
  font-weight: 500;
  cursor: pointer;
  transition: transform 0.15s, box-shadow 0.15s;
}
.alertas-home-banner:hover { transform: translateY(-1px); box-shadow: var(--shadow-md); }
.alertas-home-banner__icon { font-size: 1.4rem; flex-shrink: 0; }
.alertas-home-banner__text { flex: 1; }
.alertas-home-banner__cta {
  font-size: 0.85rem; font-weight: 600;
  text-decoration: underline; flex-shrink: 0;
}
.alertas-home-banner--critico {
  background: var(--status-vencido-bg); color: var(--status-vencido);
  border: 1px solid var(--status-vencido);
}
.alertas-home-banner--urgente {
  background: var(--status-7-bg); color: var(--status-7);
  border: 1px solid var(--status-7);
}
.alertas-home-banner--proximo {
  background: var(--status-30-bg); color: var(--status-30);
  border: 1px solid var(--status-30);
}
.alertas-home-banner--ok {
  background: var(--status-ok-bg); color: var(--status-ok);
  border: 1px solid var(--status-ok);
  cursor: default;
}

/* --- Onboarding Tour (Shepherd.js overrides · A2 Polish 2) --- */
.shepherd-element.gestionflota-shepherd-step {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-lg);
  font-family: 'Inter', -apple-system, sans-serif;
  max-width: 380px;
}
.shepherd-element.gestionflota-shepherd-step .shepherd-content {
  background: transparent;
  border-radius: var(--radius-lg);
}
.shepherd-element.gestionflota-shepherd-step .shepherd-text {
  font-size: 0.92rem;
  color: var(--text);
  padding: var(--space-lg) var(--space-lg) var(--space-md);
  line-height: 1.5;
}
.shepherd-element.gestionflota-shepherd-step .shepherd-text strong {
  font-size: 1.05rem;
  letter-spacing: -0.015em;
  color: var(--primary);
}
.shepherd-element.gestionflota-shepherd-step .shepherd-footer {
  padding: var(--space-md) var(--space-lg) var(--space-lg);
  display: flex;
  justify-content: flex-end;
  gap: var(--space-sm);
  border-top: 1px solid var(--border);
}
.shepherd-element.gestionflota-shepherd-step .shepherd-button {
  font-family: inherit;
  font-size: 0.85rem;
  font-weight: 500;
  padding: 0.55rem 1rem;
  border-radius: var(--radius-md);
  cursor: pointer;
  border: 1px solid transparent;
  transition: background 0.15s, border-color 0.15s;
}
.shepherd-element.gestionflota-shepherd-step .shepherd-button-primary {
  background: var(--primary); color: #fff;
}
.shepherd-element.gestionflota-shepherd-step .shepherd-button-primary:hover {
  background: var(--primary-dark);
}
.shepherd-element.gestionflota-shepherd-step .shepherd-button-secondary {
  background: transparent; color: var(--text-secondary);
  border-color: var(--border);
}
.shepherd-element.gestionflota-shepherd-step .shepherd-button-secondary:hover {
  background: var(--bg-muted);
}
.shepherd-element.gestionflota-shepherd-step .shepherd-cancel-icon {
  color: var(--text-muted);
  font-size: 1.4rem;
}
.shepherd-modal-overlay-container {
  background: rgba(17, 24, 39, 0.4);
}

/* --- Empty State (M6) --- */
.empty-state {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  text-align: center;
  padding: var(--space-2xl) var(--space-lg);
  color: var(--text-secondary);
  max-width: 480px;
  margin: 0 auto;
  min-height: clamp(280px, 40vh, 480px);
}

.empty-state__icon {
  width: 80px;
  height: 80px;
  margin: 0 auto var(--space-md);
  opacity: 0.5;
  color: var(--primary);
}
.empty-state__icon svg { width: 100%; height: 100%; }

.empty-state__title {
  font-size: 1.05rem;
  font-weight: 600;
  color: var(--text);
  margin-bottom: var(--space-xs);
  letter-spacing: -0.01em;
}

.empty-state__hint {
  font-size: 0.9rem;
  color: var(--text-secondary);
  line-height: 1.5;
}

.empty-state__cta {
  display: inline-block;
  margin-top: var(--space-md);
}

/* Variante cuando es realmente "everything OK" no falta nada */
.empty-state--ok .empty-state__title { color: var(--status-ok); }
.empty-state--ok .empty-state__icon { color: var(--status-ok); opacity: 0.6; }

/* --- Loading --- */
.spinner {
  display: inline-block;
  width: 1rem;
  height: 1rem;
  border: 2px solid rgba(255, 255, 255, 0.3);
  border-top-color: white;
  border-radius: 50%;
  animation: spin 0.6s linear infinite;
}

.spinner--dark {
  border-color: var(--border);
  border-top-color: var(--primary);
}

@keyframes spin { to { transform: rotate(360deg); } }

.loading-overlay {
  display: flex;
  align-items: center;
  justify-content: center;
  padding: var(--space-2xl);
  gap: var(--space-sm);
  color: var(--text-secondary);
  font-size: 0.85rem;
}

/* --- Section spacing --- */
.section { margin-bottom: var(--space-xl); }

.section__header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: var(--space-md);
  margin-bottom: var(--space-md);
  padding-bottom: var(--space-sm);
  border-bottom: 1px solid var(--border);
}
.section__header h2 {
  font-size: var(--fs-xl);
  font-weight: var(--fw-bold);
  letter-spacing: -0.015em;
  margin: 0;
}

/* =========================================================
   AUTH DIALOGS · /impeccable + /ui-ux-pro-max
   Login overlay (panel, cotizador, solicitudes, config, reportes,
   portal, cliente, reset). Premium, calmo, jerárquico.
   ========================================================= */

/* Auth instant-paint: si auth-instant.js detectó sesión válida en sessionStorage,
   ocultamos el login y mostramos el app SIN flash al navegar entre páginas backoffice.
   Si Supabase rechaza la sesión luego, el JS limpia la clase y vuelve al estado normal. */
html.auth-instant #pin-overlay,
html.auth-instant #login-gate   { display: none !important; }
html.auth-instant #app          { display: block !important; }

/* --- OVERLAY de fondo · gradiente sutil con orbe primary --- */
.pin-overlay {
  position: fixed;
  inset: 0;
  background:
    radial-gradient(800px 600px at 15% 0%, rgba(37, 99, 235, 0.18) 0%, transparent 60%),
    radial-gradient(600px 500px at 85% 100%, rgba(37, 99, 235, 0.10) 0%, transparent 55%),
    linear-gradient(180deg, #0b1220 0%, #0f172a 60%, #111c33 100%);
  backdrop-filter: blur(2px);
  display: flex;
  align-items: flex-start;   /* permite scroll cuando el diálogo es más alto que la ventana */
  justify-content: center;
  z-index: 9999;
  padding: var(--space-lg);
  overflow-y: auto;          /* scroll vertical si el contenido no entra · evita que la X quede oculta */
  animation: authOverlayIn var(--duration-slow) var(--ease-decelerate);
}

/* Grid de líneas finas tipo "blueprint" — añade profundidad sin distraer */
.pin-overlay::before {
  content: "";
  position: absolute;
  inset: 0;
  background-image:
    linear-gradient(to right, rgba(255, 255, 255, 0.022) 1px, transparent 1px),
    linear-gradient(to bottom, rgba(255, 255, 255, 0.022) 1px, transparent 1px);
  background-size: 56px 56px;
  mask-image: radial-gradient(ellipse 1200px 800px at 50% 50%, #000 30%, transparent 100%);
  -webkit-mask-image: radial-gradient(ellipse 1200px 800px at 50% 50%, #000 30%, transparent 100%);
  pointer-events: none;
}

@keyframes authOverlayIn {
  from { opacity: 0; }
  to   { opacity: 1; }
}

/* --- DIÁLOGO · card central premium --- */
.pin-dialog,
.login-dialog {
  position: relative;
  background: var(--neutral-0);
  border: 1px solid rgba(255, 255, 255, 0.06);
  border-radius: var(--radius-xl);
  padding: var(--space-2xl) var(--space-2xl) var(--space-xl);
  box-shadow:
    0 1px 0 rgba(255, 255, 255, 0.06) inset,                /* highlight superior */
    0 30px 80px -16px rgba(8, 12, 24, 0.55),                /* sombra profunda */
    0 12px 32px -8px rgba(8, 12, 24, 0.35);                 /* sombra cercana */
  width: 100%;
  max-width: 420px;
  text-align: center;
  animation: authDialogIn 320ms var(--ease-decelerate);
  /* margin-block auto centra verticalmente cuando hay espacio sobrante en el
     overlay flex · si el diálogo es más alto que la ventana, queda pegado
     arriba y el scroll del overlay permite ver todo (incluida la X y el
     enlace "¿Olvidaste tu contraseña?"). */
  margin-block: auto;
  flex-shrink: 0;
}

/* Altura de ventana corta (laptops sin scroll) · reduce padding para que el
   formulario completo (logo + título + 2 inputs + botón + enlace recuperar
   + nota inferior + X) entre sin scroll. */
@media (max-height: 720px) {
  .pin-dialog,
  .login-dialog {
    padding: var(--space-lg) var(--space-xl) var(--space-md);
  }
  .pin-dialog .header__logo,
  .login-dialog .header__logo {
    margin-bottom: var(--space-sm) !important;
  }
}

/* Acento de marca · solo barra superior limpia (sin gradient mezcla) */
.pin-dialog::before,
.login-dialog::before {
  content: "";
  position: absolute;
  top: 0;
  left: var(--space-2xl);
  right: var(--space-2xl);
  height: 3px;
  background: var(--primary-600);
  border-radius: 0 0 var(--radius-xs) var(--radius-xs);
}

/* Pseudo decorativo bajo · removido del diseño previo (era noise) */
.pin-dialog::after,
.login-dialog::after { display: none; }

@keyframes authDialogIn {
  from { opacity: 0; transform: translateY(16px) scale(0.97); }
  to   { opacity: 1; transform: translateY(0) scale(1); }
}

/* --- LOGO · cuadrado con halo primary sutil --- */
.pin-dialog .header__logo,
.login-dialog .header__logo {
  width: 60px;
  height: 60px;
  margin: 0 auto var(--space-lg);
  border-radius: var(--radius-lg);
  background: var(--primary-50);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  box-shadow:
    0 0 0 1px var(--primary-200),
    0 8px 24px -8px rgba(37, 99, 235, 0.35);
}
.pin-dialog .header__logo svg,
.login-dialog .header__logo svg {
  width: 30px;
  height: 30px;
  color: var(--primary-600);
  stroke: var(--primary-600);
}

/* --- TÍTULO Y SUBTÍTULO --- */
.pin-dialog h3,
.login-dialog h3 {
  margin-bottom: 6px;
  font-size: var(--fs-xl);
  font-weight: var(--fw-bold);
  letter-spacing: -0.015em;
  color: var(--text-primary);
}
.pin-dialog p,
.login-dialog p {
  margin-bottom: var(--space-xl);
  font-size: var(--fs-sm);
  color: var(--text-secondary);
  line-height: var(--lh-snug);
}

/* --- FORM · alineado izquierda, espaciado generoso --- */
.pin-dialog .form-group,
.login-dialog .form-group {
  text-align: left;
  margin-bottom: var(--space-md);
}
.pin-dialog .form-group label,
.login-dialog .form-group label {
  font-size: 0.82rem;
  font-weight: var(--fw-semibold);
  color: var(--text-secondary);
  letter-spacing: 0;
  text-transform: none;
  margin-bottom: 6px;
  display: block;
  transition: color var(--duration-fast) var(--ease-standard);
}
/* Label cambia de color cuando el input tiene foco — micro detalle */
.pin-dialog .form-group:focus-within label,
.login-dialog .form-group:focus-within label {
  color: var(--primary-700);
}

.pin-dialog .form-group input,
.login-dialog .form-group input {
  width: 100%;
  padding: 11px 14px;
  font-size: 0.95rem;
  font-family: inherit;
  color: var(--text);
  background: var(--neutral-0);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  transition: border-color var(--duration-fast) var(--ease-standard),
              box-shadow var(--duration-fast) var(--ease-standard),
              background var(--duration-fast) var(--ease-standard);
}
.pin-dialog .form-group input:hover:not(:focus),
.login-dialog .form-group input:hover:not(:focus) {
  border-color: var(--border-strong);
}
.pin-dialog .form-group input:focus,
.login-dialog .form-group input:focus {
  outline: none;
  border-color: var(--primary-600);
  background: var(--neutral-0);
  box-shadow: 0 0 0 4px var(--primary-ring);
}

/* PIN input dedicado · monoespaciado dramático con tracking */
.pin-dialog input[type="password"]#pin-input,
#pin-form input[type="password"]#pin-input {
  text-align: center;
  font-size: 1.5rem;
  letter-spacing: 0.55em;
  font-family: var(--font-mono);
  font-weight: var(--fw-bold);
  padding: 14px 12px;
}

/* --- ERROR INLINE refinado --- */
.pin-dialog .form-error,
.login-dialog .form-error {
  font-size: 0.82rem;
  color: var(--danger);
  margin-top: 4px;
  min-height: 0;
  font-weight: var(--fw-medium);
}

/* --- BOTÓN PRIMARIO · alto + sombra primary tintada --- */
.pin-dialog .btn--full,
.login-dialog .btn--full {
  margin-top: var(--space-lg);
  min-height: 48px;
  font-size: 0.95rem;
  font-weight: var(--fw-semibold);
  background: var(--primary-600);
  color: var(--neutral-0);
  border: none;
  border-radius: var(--radius-md);
  letter-spacing: -0.01em;
  box-shadow: var(--shadow-primary-sm);
  transition: background var(--duration-fast) var(--ease-standard),
              box-shadow var(--duration-fast) var(--ease-standard),
              transform var(--duration-fast) var(--ease-standard);
}
.pin-dialog .btn--full:hover:not(:disabled),
.login-dialog .btn--full:hover:not(:disabled) {
  background: var(--primary-700);
  box-shadow: var(--shadow-primary-md);
  transform: translateY(-1px);
}
.pin-dialog .btn--full:active:not(:disabled),
.login-dialog .btn--full:active:not(:disabled) {
  background: var(--primary-800);
  transform: translateY(0);
  box-shadow: var(--shadow-primary-sm);
}

/* --- LINKS auxiliares (reset password, toggle PIN, etc.) --- */
#toggle-pin,
#link-reset {
  display: inline-block;
  font-size: 0.85rem;
  color: var(--primary-600);
  font-weight: var(--fw-medium);
  text-decoration: none;
  padding: 6px 10px;
  border-radius: var(--radius-sm);
  margin-top: var(--space-sm);
  transition: background var(--duration-fast) var(--ease-standard),
              color var(--duration-fast) var(--ease-standard);
}
#toggle-pin:hover,
#link-reset:hover {
  background: var(--primary-50);
  color: var(--primary-700);
  text-decoration: none;
}

/* --- HINT al pie · separator + micro-info --- */
.auth-hint {
  margin-top: var(--space-xl);
  padding-top: var(--space-lg);
  border-top: 1px solid var(--border);
  font-size: 0.82rem;
  color: var(--text-muted);
  text-align: center;
  line-height: var(--lh-snug);
}
.auth-hint a {
  color: var(--primary-600);
  font-weight: var(--fw-semibold);
  text-decoration: none;
}
.auth-hint a:hover { color: var(--primary-700); text-decoration: underline; }
.auth-hint strong { color: var(--text); font-family: var(--font-mono); letter-spacing: 0.04em; }

/* --- CLOSE button --- */
.login-dialog__close {
  position: absolute;
  top: 12px;
  right: 12px;
  width: 36px;
  height: 36px;
  border: none;
  background: transparent;
  font-size: 1.4rem;
  line-height: 1;
  cursor: pointer;
  color: var(--text-muted);
  border-radius: var(--radius-full);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  transition: background var(--duration-fast) var(--ease-standard),
              color var(--duration-fast) var(--ease-standard);
  z-index: 2;
}
.login-dialog__close:hover {
  background: var(--neutral-100);
  color: var(--text);
}
.login-dialog__close:focus-visible {
  outline: 3px solid var(--primary-ring);
  outline-offset: 2px;
}

/* Footer decorativo removido — interfería con el diálogo cuando el contenido
   crecía (visible detrás del botón "Ingresar"). */

/* --- MOBILE refinement --- */
@media (max-width: 480px) {
  .pin-dialog,
  .login-dialog {
    padding: var(--space-xl) var(--space-lg) var(--space-lg);
    border-radius: var(--radius-lg);
    max-width: calc(100vw - 32px);
  }
  .pin-dialog::before,
  .login-dialog::before {
    left: var(--space-lg);
    right: var(--space-lg);
  }
  .pin-dialog .header__logo,
  .login-dialog .header__logo {
    width: 52px;
    height: 52px;
  }
  .pin-dialog .header__logo svg,
  .login-dialog .header__logo svg {
    width: 26px;
    height: 26px;
  }
  .pin-dialog h3,
  .login-dialog h3 { font-size: var(--fs-lg); }
}

/* Reduce motion */
@media (prefers-reduced-motion: reduce) {
  .pin-overlay,
  .pin-dialog,
  .login-dialog { animation: none; }
}

/* --- Footer --- */
.footer {
  text-align: center;
  padding: var(--space-lg) 0;
  color: var(--text-muted);
  font-size: 0.7rem;
  border-top: 1px solid var(--border);
  margin-top: var(--space-2xl);
}

/* --- Configuración layout --- */
.cfg-layout {
  display: flex; max-width: 1200px; margin: 0 auto;
  padding: var(--space-lg); gap: var(--space-lg);
  min-height: calc(100vh - 60px);
}
.cfg-sidebar {
  width: 160px; flex-shrink: 0;
  display: flex; flex-direction: column; gap: 2px;
  position: sticky; top: 60px; align-self: flex-start;
}
.cfg-nav-btn {
  padding: var(--space-sm) var(--space-md);
  font-size: 0.8rem; font-weight: 500; font-family: inherit;
  text-align: left; border: none; background: none;
  color: var(--text-secondary); cursor: pointer;
  border-radius: var(--radius-sm); transition: all 0.15s;
}
.cfg-nav-btn:hover { background: var(--bg); color: var(--text); }
.cfg-nav-btn--active {
  background: var(--primary-light); color: var(--primary);
  font-weight: 600;
}
.cfg-content { flex: 1; min-width: 0; }
.cfg-section__header {
  display: flex; align-items: center; justify-content: space-between;
  margin-bottom: var(--space-md);
}

.cfg-card {
  background: var(--surface); border: 1px solid var(--border);
  border-radius: var(--radius-md); padding: var(--space-md);
}
.cfg-card--item {
  margin-bottom: var(--space-sm);
  transition: box-shadow 0.15s;
}
.cfg-card--item:hover { box-shadow: var(--shadow-md); }
.cfg-card__top {
  display: flex; align-items: flex-start;
  justify-content: space-between; gap: var(--space-md);
}
.cfg-card__name { font-size: 0.9rem; font-weight: 600; color: var(--text); }
.cfg-card__meta { font-size: 0.7rem; color: var(--text-muted); margin-top: 2px; }
.cfg-card__title {
  font-size: 0.7rem; font-weight: 700; text-transform: uppercase;
  letter-spacing: 0.03em; color: var(--text-muted);
  margin-bottom: var(--space-sm);
}
.cfg-card__actions { display: flex; gap: 4px; flex-shrink: 0; }

.cfg-field { margin-bottom: var(--space-sm); }
.cfg-field--inline { display: flex; align-items: center; gap: var(--space-sm); }
.cfg-field--inline label { font-size: 0.8rem; white-space: nowrap; }

.cfg-table {
  width: 100%; border-collapse: collapse; font-size: 0.8rem;
}
.cfg-table th {
  text-align: left; padding: var(--space-xs) var(--space-sm);
  font-size: 0.65rem; text-transform: uppercase;
  letter-spacing: 0.04em; color: var(--text-muted);
  border-bottom: 2px solid var(--border);
}
.cfg-table td {
  padding: var(--space-xs) var(--space-sm);
  border-bottom: 1px solid #f3f4f6;
}
.cfg-umbral-input {
  width: 60px; text-align: center; padding: 3px;
  font-size: 0.8rem; border: 1px solid var(--border);
  border-radius: var(--radius-sm);
}

.cfg-empty {
  font-size: 0.8rem; color: var(--text-muted); font-style: italic;
  padding: var(--space-lg); text-align: center;
}

/* Editable rows (pasos, docs, etc.) */
.cfg-editable-row {
  display: flex; align-items: center; gap: var(--space-xs);
  margin-bottom: 3px;
}
.cfg-editable-input {
  flex: 1; padding: 4px 8px; font-size: 0.78rem;
  border: 1px solid var(--border); border-radius: var(--radius-sm);
  font-family: inherit;
}
.cfg-editable-input:focus {
  outline: none; border-color: var(--primary);
  box-shadow: 0 0 0 2px var(--primary-ring);
}
.cfg-editable-remove {
  background: none; border: none; cursor: pointer;
  color: var(--text-muted); font-size: 0.9rem; padding: 2px 5px;
  border-radius: var(--radius-sm); transition: all 0.15s;
}
.cfg-editable-remove:hover { color: var(--status-7); background: var(--status-7-bg); }

/* Modal trámite */
.modal--tramite {
  max-width: 620px; max-height: 88vh;
  display: flex; flex-direction: column;
}
.modal-tramite-scroll {
  flex: 1; overflow-y: auto; min-height: 0;
  scrollbar-width: thin; scrollbar-color: var(--border) transparent;
  padding-right: var(--space-xs);
}
.modal--tramite .modal__actions {
  flex-shrink: 0; border-top: 1px solid var(--border);
  padding-top: var(--space-sm); margin-top: var(--space-sm);
}
.modal--tramite .cfg-card {
  background: var(--bg); margin-top: var(--space-sm);
}

/* --- Landing page --- */
.landing-hero {
  background: linear-gradient(135deg, #1e3a5f 0%, #2563eb 100%);
  color: white; padding: var(--space-2xl) 0;
}
.landing-hero__content {
  max-width: 680px;
}
.landing-hero__title {
  font-size: 2.2rem; font-weight: 800; line-height: 1.15;
  color: white; margin-bottom: var(--space-md);
}
.landing-hero__desc {
  font-size: 1rem; line-height: 1.6; color: rgba(255,255,255,0.85);
  margin-bottom: var(--space-lg);
}
.landing-hero__cta {
  display: flex; gap: var(--space-sm); flex-wrap: wrap;
  margin-bottom: var(--space-xl);
}
.btn--lg { padding: 0.6rem 1.4rem; font-size: 0.9rem; }
.landing-hero__cta .btn--secondary {
  background: rgba(255,255,255,0.15); color: white;
  border-color: rgba(255,255,255,0.3);
}
.landing-hero__cta .btn--secondary:hover {
  background: rgba(255,255,255,0.25);
}
.landing-hero__stats {
  display: flex; gap: var(--space-xl);
}
.landing-stat__value {
  font-size: 1.8rem; font-weight: 800; color: white;
}
.landing-stat__label {
  font-size: 0.72rem; color: rgba(255,255,255,0.7);
  font-weight: 500;
}

.landing-section {
  padding: var(--space-2xl) 0;
}
.landing-section--alt { background: var(--bg); }
.landing-section__header {
  text-align: center; max-width: 560px; margin: 0 auto var(--space-xl);
}
.landing-section__header h2 {
  font-size: 1.5rem; margin-bottom: var(--space-xs);
}
.landing-section__header p {
  font-size: 0.9rem; color: var(--text-secondary);
}

/* Services grid */
.services-grid {
  display: grid; grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
  gap: var(--space-md);
}
.service-card {
  background: var(--surface); border: 1px solid var(--border);
  border-radius: var(--radius-lg); padding: var(--space-lg);
  transition: box-shadow 0.2s, transform 0.2s;
}
.service-card:hover {
  box-shadow: var(--shadow-lg); transform: translateY(-2px);
}
.service-card__icon {
  width: 40px; height: 40px; border-radius: var(--radius-md);
  display: flex; align-items: center; justify-content: center;
  font-size: 1.2rem; font-weight: 700; margin-bottom: var(--space-sm);
}
.service-card h3 {
  font-size: 1rem; margin-bottom: var(--space-xs);
}
.service-card > p {
  font-size: 0.8rem; color: var(--text-secondary); line-height: 1.5;
  margin-bottom: var(--space-sm);
}
.service-card__list {
  list-style: none; padding: 0; margin: 0;
}
.service-card__list li {
  font-size: 0.75rem; color: var(--text-secondary);
  padding: 2px 0 2px 1rem; position: relative;
}
.service-card__list li::before {
  content: ''; position: absolute; left: 0.15rem; top: 0.55em;
  width: 5px; height: 5px; border-radius: 50%;
  background: var(--primary);
}

/* Steps */
.steps-grid {
  display: flex; align-items: flex-start; justify-content: center;
  gap: var(--space-md); flex-wrap: wrap;
}
.step-card {
  text-align: center; flex: 1; min-width: 180px; max-width: 240px;
}
.step-card__number {
  width: 36px; height: 36px; border-radius: 50%;
  background: var(--primary); color: white;
  font-size: 1rem; font-weight: 800;
  display: flex; align-items: center; justify-content: center;
  margin: 0 auto var(--space-sm);
}
.step-card h4 { font-size: 0.9rem; margin-bottom: var(--space-xs); }
.step-card p { font-size: 0.78rem; color: var(--text-secondary); line-height: 1.5; }
.step-card__arrow {
  color: var(--border-strong); font-size: 1.2rem; padding-top: 8px;
  flex-shrink: 0;
}

/* --- Portal cliente --- */
.portal-layout { display: flex; max-width: 1200px; margin: 0 auto; padding: var(--space-lg); gap: var(--space-lg); min-height: calc(100vh - 60px); }
.portal-sidebar { width: 160px; flex-shrink: 0; display: flex; flex-direction: column; gap: 2px; position: sticky; top: 60px; align-self: flex-start; }
.portal-nav-btn { padding: var(--space-sm) var(--space-md); font-size: 0.8rem; font-weight: 500; font-family: inherit; text-align: left; border: none; background: none; color: var(--text-secondary); cursor: pointer; border-radius: var(--radius-sm); transition: all 0.15s; }
.portal-nav-btn:hover { background: var(--bg); color: var(--text); }
.portal-nav-btn--active { background: var(--primary-light); color: var(--primary); font-weight: 600; }
.portal-content { flex: 1; min-width: 0; }
.portal-section__header { display: flex; align-items: center; justify-content: space-between; margin-bottom: var(--space-md); }

/* Login dialog */
/* estilos .login-dialog definidos arriba (auth dialogs rediseño) */

/* Welcome bar */
.portal-welcome { display: flex; align-items: center; justify-content: space-between; flex-wrap: wrap; gap: var(--space-sm); padding: var(--space-md) var(--space-lg); background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius-md); margin-bottom: var(--space-md); }
.portal-welcome__info { display: flex; align-items: center; gap: var(--space-sm); }
.portal-welcome__name { font-size: 0.9rem; font-weight: 600; color: var(--text); }
.portal-welcome__empresa { font-size: 0.75rem; color: var(--text-secondary); }
.portal-welcome__badge { display: inline-block; padding: 0.15em 0.5em; font-size: 0.65rem; font-weight: 700; border-radius: var(--radius-sm); text-transform: uppercase; letter-spacing: 0.03em; }
.portal-welcome__badge--activa,
.portal-welcome__badge--activo     { background: var(--status-ok-bg);      color: var(--status-ok); }
.portal-welcome__badge--vencida    { background: var(--status-vencido-bg); color: var(--status-vencido); }
.portal-welcome__badge--prospecto  { background: var(--status-15-bg);      color: var(--status-15); }
.portal-welcome__badge--suspendido,
.portal-welcome__badge--suspendida { background: var(--status-vencido-bg); color: var(--status-vencido); }

/* Chips (tabla de leads + otros) */
.chip { display: inline-block; padding: 0.18em 0.65em; font-size: 0.72rem; font-weight: 600; border-radius: 999px; white-space: nowrap; }
.chip--tipo-contacto        { background: var(--accent-indigo-bg); color: var(--accent-indigo); }
.chip--tipo-activacion_plan { background: #fed7aa; color: #9a3412; }
.chip--tipo-cotizacion      { background: #bbf7d0; color: #166534; }
.chip--tipo-soporte         { background: #fde68a; color: #78350f; }
.chip--estado-nuevo         { background: var(--status-15-bg);      color: var(--status-15); }
.chip--estado-contactado    { background: #dbeafe; color: #1e40af; }
.chip--estado-cerrado       { background: var(--bg-muted); color: var(--text-secondary); }

/* Chips informativos reutilizables (ex inline styles en panel.js) */
.chip--info     { background: var(--accent-indigo-bg); color: var(--accent-indigo); }
.chip--success  { background: #bbf7d0; color: #166534; }
.chip--neutral  { background: var(--bg-muted); color: var(--text-muted); }

/* Badge de conteo en el sidebar de config */
.cfg-nav-btn { position: relative; }
.cfg-nav-btn__badge,
.header__badge {
  display: inline-block;
  background: #dc2626;
  color: #fff;
  font-size: 0.68rem;
  font-weight: 700;
  padding: 1px 7px;
  border-radius: 999px;
  margin-left: 6px;
  min-width: 18px;
  text-align: center;
  vertical-align: middle;
}

/* Membership banner */
.membresia-banner { padding: var(--space-sm) var(--space-md); border-radius: var(--radius-md); font-size: 0.8rem; font-weight: 500; margin-bottom: var(--space-md); }
.membresia-banner--warn { background: var(--status-30-bg); border: 1px solid var(--status-30); color: var(--status-30); }
.membresia-banner--danger { background: var(--status-vencido-bg); border: 1px solid var(--status-vencido); color: var(--status-vencido); }

/* Alert list */
.alerta-list { list-style: none; padding: 0; margin: 0; }
.alerta-item { display: flex; align-items: center; gap: var(--space-sm); padding: var(--space-xs) var(--space-sm); border-radius: var(--radius-sm); transition: background 0.1s; font-size: 0.8rem; }
.alerta-item:hover { background: #f3f4f6; cursor: pointer; }
.alerta-item__patente { font-family: var(--font-mono); font-weight: 700; font-size: 0.75rem; min-width: 65px; }
.alerta-item__tramite { flex: 1; color: var(--text-secondary); font-size: 0.75rem; }
.alerta-item__dias { font-weight: 700; font-size: 0.8rem; min-width: 35px; text-align: right; }

/* Equipo cards */
.equipo-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(250px, 1fr)); gap: var(--space-sm); }
.equipo-card { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius-md); padding: var(--space-md); transition: box-shadow 0.15s, border-color 0.15s; cursor: pointer; }
.equipo-card:hover { border-color: var(--primary); }
.equipo-card:hover { box-shadow: var(--shadow-md); }
.equipo-card--danger { border-left-color: var(--status-vencido); }
.equipo-card--warning { border-left-color: var(--status-7); }
.equipo-card--caution { border-left-color: var(--status-30); }
.equipo-card--ok { border-left-color: var(--status-ok); }
.equipo-card__top { display: flex; align-items: center; justify-content: space-between; margin-bottom: var(--space-xs); }
.equipo-card__patente { font-family: var(--font-mono); font-weight: 700; font-size: 0.9rem; letter-spacing: 0.03em; }
.equipo-card__tipo { font-size: 0.65rem; color: var(--text-muted); }
.equipo-card__dots { display: flex; gap: 6px; align-items: center; }
.equipo-dot { display: flex; align-items: center; gap: 3px; font-size: 0.6rem; color: var(--text-muted); }
.equipo-dot__circle { width: 8px; height: 8px; border-radius: 50%; }
.equipo-dot__circle--ok { background: var(--status-ok); }
.equipo-dot__circle--warn { background: var(--status-30); }
.equipo-dot__circle--danger { background: var(--status-vencido); }
.equipo-dot__circle--none { background: var(--border); }
.equipo-dot__circle--gestion { background: var(--primary); }

/* Membership card */
.membresia-card { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius-lg); padding: var(--space-lg); margin-bottom: var(--space-md); }
.membresia-card__top { display: flex; align-items: flex-start; justify-content: space-between; margin-bottom: var(--space-md); }
.membresia-card__plan { font-size: 1.1rem; font-weight: 700; color: var(--text); }
.membresia-card__grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(160px, 1fr)); gap: var(--space-sm) var(--space-md); margin-bottom: var(--space-md); }
.membresia-card__field label { display: block; font-size: 0.65rem; font-weight: 600; color: var(--text-muted); text-transform: uppercase; letter-spacing: 0.02em; margin-bottom: 2px; }
.membresia-card__field span { font-size: 0.85rem; font-weight: 500; color: var(--text); }
.membresia-uso { margin-bottom: var(--space-sm); }
.membresia-uso__label { font-size: 0.72rem; color: var(--text-secondary); margin-bottom: 3px; display: flex; justify-content: space-between; }
.membresia-uso__bar { height: 6px; background: var(--border); border-radius: 3px; overflow: hidden; }
.membresia-uso__fill { height: 100%; border-radius: 3px; background: var(--primary); transition: width 0.3s; }

/* Plan grid */
.plan-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(200px, 1fr)); gap: var(--space-md); margin-bottom: var(--space-lg); }
.plan-card { background: var(--surface); border: 2px solid var(--border); border-radius: var(--radius-lg); padding: var(--space-lg); text-align: center; transition: box-shadow 0.15s; }
.plan-card--active { border-color: var(--primary); box-shadow: 0 0 0 3px var(--primary-ring); }
.plan-card__nombre { font-size: 0.85rem; font-weight: 700; color: var(--text); margin-bottom: var(--space-xs); }
.plan-card__precio { font-size: 1.5rem; font-weight: 800; color: var(--primary); margin-bottom: var(--space-xs); }
.plan-card__precio small { font-size: 0.7rem; font-weight: 400; color: var(--text-muted); }
.plan-card__desc { font-size: 0.75rem; color: var(--text-secondary); }
.plan-card__badge { display: inline-block; margin-top: var(--space-sm); padding: 0.2em 0.6em; font-size: 0.65rem; font-weight: 600; border-radius: var(--radius-sm); background: var(--primary-light); color: var(--primary); }

/* Descargas */
.descargas-group { margin-bottom: var(--space-lg); }
.descargas-group__title { font-size: 0.8rem; font-weight: 600; color: var(--text); margin-bottom: var(--space-sm); display: flex; align-items: center; gap: var(--space-sm); }
.descargas-group__patente { font-family: var(--font-mono); font-size: 0.75rem; padding: 0.1em 0.4em; background: var(--primary-light); color: var(--primary-dark); border-radius: 2px; }

/* --- Responsive --- */
@media (max-width: 768px) {
  .form-row { grid-template-columns: 1fr; }
  .vehicle-card__dates { grid-template-columns: 1fr; }
  .kpi-grid { grid-template-columns: repeat(2, 1fr); }
  h1 { font-size: 1.3rem; }
  /* .landing-hero__title ya escala con clamp() — no override necesario */
  .landing-hero__stats { gap: var(--space-lg); }
  .landing-stat__value { font-size: 1.3rem; }
  .step-card__arrow { display: none; }
  .cfg-layout { flex-direction: column; }
  .cfg-sidebar { width: 100%; flex-direction: row; overflow-x: auto; position: static; }
  .portal-layout { flex-direction: column; }
  .portal-sidebar { width: 100%; flex-direction: row; overflow-x: auto; position: static; }
  .equipo-grid { grid-template-columns: 1fr; }
  .plan-grid { grid-template-columns: 1fr; }

  /* Header con muchos elementos colapsa en 2 líneas */
  .header__inner { flex-wrap: wrap; gap: var(--space-xs); }
  .header__nav { flex-wrap: wrap; width: 100%; justify-content: flex-end; }
  .header__operator { min-width: 120px; max-width: 160px; font-size: 0.75rem; }

  /* Modal lleno: más ancho y padding menor */
  .modal { width: 96%; padding: var(--space-md); }
  .modal--gestion, .modal--tramite, .modal--masivo { max-width: 96%; }

  /* Filas de filtros permiten scroll horizontal cómodo */
  .filters, .filters-row { flex-wrap: nowrap; overflow-x: auto; padding-bottom: 4px; }
  .filter-btn { flex-shrink: 0; }

  /* Banners y secciones con más aire */
  .landing-section { padding-top: var(--space-xl); padding-bottom: var(--space-xl); }
  .service-group { margin-top: var(--space-xl); }

  .bento-grid--permanente, .bento-grid--eventual { grid-template-columns: 1fr; }
}

@media (max-width: 480px) {
  html { font-size: 15px; }   /* Senior-friendly: antes 13.5px */
  /* iOS Safari zoom-prevention: inputs deben ser >=16px efectivos al focus.
     Con html=15px y 0.95rem ≈ 14.25px se generaba zoom forzado. */
  input[type="text"], input[type="email"], input[type="password"],
  input[type="number"], input[type="search"], input[type="tel"],
  input[type="url"], input[type="date"], select, textarea {
    font-size: 16px;
  }
  .container { padding: 0 var(--space-md); }
  .kpi-grid { grid-template-columns: 1fr 1fr; gap: 6px; }
  .kpi-card { padding: var(--space-sm); }
  .kpi-card__value { font-size: 1.4rem; }
  .bento-card--lg { padding: var(--space-lg); }
  .bento-card__icon { width: 38px; height: 38px; }
  .bento-card__icon i[data-lucide] { width: 18px; height: 18px; }
  /* .landing-hero__title y .landing-hero__desc usan clamp() — sin override */
  .landing-hero__cta { flex-direction: column; align-items: stretch; }
  .landing-hero__cta .btn { width: 100%; text-align: center; }
  .landing-hero__stats { flex-direction: column; align-items: flex-start; gap: var(--space-sm); }
  .header__nav { gap: 4px; }
  .header__link { padding: 4px 6px; font-size: 0.78rem; }
  .header__operator { width: 100%; max-width: none; margin-top: 4px; }

  /* Tablas: texto compacto pero legible (senior-friendly) */
  .table-wrapper table { font-size: 0.92rem; }
  .td-patente { font-size: 0.95rem; }
}

/* --- Checkbox style --- */
.checkbox-group {
  display: flex;
  align-items: center;
  gap: var(--space-sm);
}

.checkbox-group input[type="checkbox"] {
  width: 1rem;
  height: 1rem;
  accent-color: var(--primary);
}

.checkbox-group label {
  font-size: 0.85rem;
  font-weight: 400;
  margin-bottom: 0;
}

/* --- Tramite label --- */
.tramite-label {
  display: inline-block;
  padding: 0.1em 0.45em;
  font-size: 0.7rem;
  font-weight: 500;
  border-radius: var(--radius-sm);
  background: var(--primary-light);
  color: var(--primary-dark);
}

/* --- Confirmation modal --- */
.modal-overlay {
  position: fixed;
  inset: 0;
  background: rgba(17, 24, 39, 0.4);
  backdrop-filter: blur(4px);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 9999;
}

.modal {
  background: var(--surface);
  border-radius: var(--radius-lg);
  padding: var(--space-lg);
  box-shadow: var(--shadow-lg);
  max-width: 440px;
  width: 90%;
  position: relative;  /* Necesario para que .modal__close (absolute) se ancle al modal */
}

.modal__actions {
  display: flex;
  justify-content: flex-end;
  gap: var(--space-sm);
  margin-top: var(--space-lg);
}

/* --- Gestión workflow badges --- */
.badge--gestion-pendiente {
  background: #f9fafb; color: #6b7280;
  border: 1px solid #e5e7eb; cursor: pointer;
  transition: all 0.15s;
}
.badge--gestion-pendiente:hover { border-color: #9ca3af; background: #f3f4f6; }

.badge--gestion-en_gestion {
  background: #eff6ff; color: #2563eb;
  border: 1px solid #bfdbfe; font-weight: 600; cursor: pointer;
  transition: all 0.15s;
}
.badge--gestion-en_gestion:hover { border-color: #60a5fa; background: #dbeafe; }

.badge--gestion-completado {
  background: var(--status-ok-bg); color: var(--status-ok);
  border: 1px solid #a7f3d0; cursor: pointer;
  transition: all 0.15s;
}
.badge--gestion-completado:hover { border-color: var(--status-ok); }

/* --- Pipeline indicator (modal) --- */
.pipeline { display: flex; align-items: center; margin: var(--space-md) 0; }
.pipeline__step { display: flex; flex-direction: column; align-items: center; gap: 3px; }
.pipeline__dot {
  width: 24px; height: 24px; border-radius: 50%;
  border: 2px solid #d1d5db; background: #f9fafb;
  display: flex; align-items: center; justify-content: center;
  font-size: 0.7rem; font-weight: 700; color: #9ca3af;
  transition: all 0.2s;
}
.pipeline__step-label { font-size: 0.65rem; color: #9ca3af; white-space: nowrap; }
.pipeline__step--done .pipeline__dot { background: var(--status-ok-bg); border-color: var(--status-ok); color: var(--status-ok); }
.pipeline__step--done .pipeline__step-label { color: var(--status-ok); }
.pipeline__step--active .pipeline__dot { background: #eff6ff; border-color: var(--primary); color: var(--primary); box-shadow: 0 0 0 3px var(--primary-ring); }
.pipeline__step--active .pipeline__step-label { color: var(--primary); font-weight: 600; }
.pipeline__connector { flex: 1; height: 2px; background: #e5e7eb; margin: 0 4px; margin-bottom: 14px; }
.pipeline__connector--done { background: var(--status-ok); }

/* --- Gestión modal variants --- */
.modal--gestion {
  max-width: 600px; max-height: 88vh;
  overflow-y: auto; scrollbar-width: thin;
  scrollbar-color: var(--border) transparent;
}
.modal__record-info { display: grid; grid-template-columns: 1fr 1fr; gap: var(--space-xs) var(--space-lg); margin-bottom: var(--space-md); }
.modal__record-info dt { font-size: 0.65rem; color: var(--text-muted); text-transform: uppercase; letter-spacing: 0.03em; }
.modal__record-info dd { font-size: 0.85rem; font-weight: 500; margin: 0; }
.modal__action-area { background: #f9fafb; border: 1px solid var(--border); border-radius: var(--radius-md); padding: var(--space-md); margin-top: var(--space-md); }

/* --- Document section (modal) --- */
.docs-section { margin-top: var(--space-lg); border-top: 1px solid var(--border); padding-top: var(--space-md); }
.docs-section__header { display: flex; align-items: center; justify-content: space-between; margin-bottom: var(--space-sm); }
.docs-section__title { font-size: 0.8rem; font-weight: 600; color: var(--text); }
.docs-section__count { font-size: 0.7rem; color: var(--text-muted); margin-left: var(--space-xs); }

.doc-list { list-style: none; padding: 0; margin: 0; }
.doc-item {
  display: flex; align-items: center; gap: var(--space-sm);
  padding: var(--space-xs) var(--space-sm);
  border-radius: var(--radius-sm);
  transition: background 0.1s;
}
.doc-item:hover { background: #f3f4f6; }
.doc-item__icon { font-size: 1rem; flex-shrink: 0; width: 24px; text-align: center; }
.doc-item__info { flex: 1; min-width: 0; }
.doc-item__name { font-size: 0.75rem; font-weight: 500; color: var(--text); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.doc-item__meta { font-size: 0.65rem; color: var(--text-muted); }
.doc-item__actions { display: flex; gap: 4px; flex-shrink: 0; }
.doc-item__btn {
  background: none; border: none; cursor: pointer;
  font-size: 0.7rem; color: var(--text-muted); padding: 2px 5px;
  border-radius: var(--radius-sm); transition: background 0.1s, color 0.1s;
}
.doc-item__btn:hover { background: #e5e7eb; color: var(--text); }
.doc-item__btn--delete:hover { background: #fee2e2; color: #dc2626; }

.doc-empty { font-size: 0.75rem; color: var(--text-muted); padding: var(--space-sm) 0; font-style: italic; }

.doc-upload {
  display: flex; align-items: center; gap: var(--space-sm);
  margin-top: var(--space-sm); padding-top: var(--space-sm);
  border-top: 1px dashed var(--border);
}
.doc-upload__input { display: none; }
.doc-upload__btn {
  font-size: 0.75rem; padding: 4px 10px;
  background: var(--surface); border: 1px solid var(--border);
  border-radius: var(--radius-sm); cursor: pointer; color: var(--text-secondary);
  transition: all 0.15s;
}
.doc-upload__btn:hover { border-color: var(--primary); color: var(--primary); background: var(--primary-light); }
.doc-upload__note {
  flex: 1; font-size: 0.75rem; padding: 4px 8px;
  border: 1px solid var(--border); border-radius: var(--radius-sm);
  background: var(--surface);
}
.doc-upload__send {
  font-size: 0.75rem; padding: 4px 10px;
  background: var(--primary); color: #fff; border: none;
  border-radius: var(--radius-sm); cursor: pointer;
  transition: background 0.15s;
}
.doc-upload__send:hover:not(:disabled) { background: var(--primary-dark); }
.doc-upload__send:disabled { opacity: 0.5; cursor: not-allowed; }
.doc-upload__filename { font-size: 0.7rem; color: var(--text-muted); max-width: 120px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }

/* --- Guía operativa (modal) --- */
.guia-toggle {
  display: flex; align-items: center; gap: var(--space-sm);
  width: 100%; background: none; border: none; cursor: pointer;
  padding: var(--space-sm) 0; color: var(--primary); font-size: 0.8rem;
  font-weight: 600; font-family: inherit; transition: color 0.15s;
}
.guia-toggle:hover { color: var(--primary-dark); }
.guia-toggle__arrow { transition: transform 0.2s; font-size: 0.6rem; }
.guia-toggle__arrow--open { transform: rotate(90deg); }

.guia-content {
  display: none; padding: var(--space-md);
  background: #f9fafb; border: 1px solid var(--border);
  border-radius: var(--radius-md); margin-bottom: var(--space-md);
}
.guia-content--visible { display: block; }

.guia-desc {
  font-size: 0.8rem; color: var(--text-secondary);
  margin-bottom: var(--space-md); line-height: 1.5;
}

.guia-section { margin-bottom: var(--space-md); }
.guia-section:last-child { margin-bottom: 0; }

.guia-section__title {
  font-size: 0.7rem; font-weight: 700; text-transform: uppercase;
  letter-spacing: 0.04em; color: var(--text-muted);
  margin-bottom: var(--space-xs); display: flex; align-items: center; gap: var(--space-xs);
}

.guia-steps {
  list-style: none; padding: 0; margin: 0; counter-reset: step;
}
.guia-steps li {
  position: relative; padding-left: 1.6rem; font-size: 0.78rem;
  color: var(--text); line-height: 1.6; counter-increment: step;
}
.guia-steps li::before {
  content: counter(step);
  position: absolute; left: 0; top: 0.15em;
  width: 1.1rem; height: 1.1rem; border-radius: 50%;
  background: var(--primary-light); color: var(--primary);
  font-size: 0.6rem; font-weight: 700;
  display: flex; align-items: center; justify-content: center;
}

.guia-docs {
  list-style: none; padding: 0; margin: 0;
}
.guia-docs li {
  font-size: 0.78rem; color: var(--text); padding: 0.1rem 0;
  padding-left: 1.1rem; position: relative;
}
.guia-docs li::before {
  content: ''; position: absolute; left: 0.2rem; top: 0.45em;
  width: 6px; height: 6px; border: 1.5px solid var(--primary);
  border-radius: 2px;
}

.guia-cost {
  font-size: 0.85rem; font-weight: 600; color: var(--text);
}

.guia-donde {
  font-size: 0.78rem; color: var(--text-secondary);
}

.guia-contactos {
  list-style: none; padding: 0; margin: 0;
}
.guia-contactos li {
  font-size: 0.78rem; padding: 0.1rem 0;
}
.guia-contactos__nombre { font-weight: 600; color: var(--text); }
.guia-contactos__valor { color: var(--primary); }

.guia-consideraciones {
  list-style: none; padding: 0; margin: 0;
}
.guia-consideraciones li {
  font-size: 0.75rem; color: var(--text-secondary);
  padding: 0.15rem 0 0.15rem 1rem; position: relative;
}
.guia-consideraciones li::before {
  content: ''; position: absolute; left: 0.15rem; top: 0.55em;
  width: 5px; height: 5px; border-radius: 50%;
  background: var(--status-30);
}

/* --- Checklist de ejecución (modal) --- */
.checklist { margin: var(--space-sm) 0; }
.checklist__toggle {
  display: flex; align-items: center; gap: var(--space-sm);
  width: 100%; background: none; border: none; cursor: pointer;
  padding: var(--space-xs) 0; font-family: inherit;
}
.checklist__arrow {
  font-size: 0.55rem; color: var(--text-muted);
  transition: transform 0.2s; margin-left: auto;
}
.checklist--open .checklist__arrow { transform: rotate(90deg); }
.checklist__list { display: none; }
.checklist--open .checklist__list { display: block; }
.checklist__title {
  font-size: 0.75rem; font-weight: 700; text-transform: uppercase;
  letter-spacing: 0.03em; color: var(--text-muted);
}
.checklist__count {
  font-size: 0.7rem; font-weight: 600; color: var(--primary);
}
.checklist__bar {
  height: 4px; background: var(--border); border-radius: 2px;
  overflow: hidden; margin-bottom: var(--space-sm);
}
.checklist__bar-fill {
  height: 100%; background: var(--status-ok); border-radius: 2px;
  transition: width 0.3s ease;
}
.checklist__list { list-style: none; padding: 0; margin: 0; }
.checklist__item {
  display: flex; align-items: center; justify-content: space-between;
  padding: 0.2rem var(--space-sm); border-radius: var(--radius-sm);
  transition: background 0.1s;
}
.checklist__item:hover { background: #f3f4f6; }
.checklist__item--done .checklist__text {
  text-decoration: line-through; color: var(--text-muted);
}
.checklist__label {
  display: flex; align-items: center; gap: var(--space-sm);
  cursor: pointer; flex: 1; min-width: 0;
}
.checklist__label input[type="checkbox"] {
  width: 0.85rem; height: 0.85rem; accent-color: var(--status-ok);
  flex-shrink: 0;
}
.checklist__text { font-size: 0.78rem; color: var(--text); }
.checklist__fecha {
  font-size: 0.65rem; color: var(--text-muted); white-space: nowrap;
  margin-left: var(--space-sm);
}

/* --- Proveedor / Costo (modal) --- */
.prov-cost {
  margin: var(--space-xs) 0;
  background: #f9fafb; border: 1px solid var(--border);
  border-radius: var(--radius-md);
}
.prov-cost__toggle {
  display: flex; align-items: center; gap: var(--space-sm);
  width: 100%; background: none; border: none; cursor: pointer;
  padding: var(--space-sm) var(--space-md); font-family: inherit;
  font-size: 0.72rem; font-weight: 600; color: var(--text-secondary);
}
.prov-cost__toggle:hover { color: var(--text); }
.prov-cost__preview { font-weight: 400; color: var(--primary); font-size: 0.7rem; }
.prov-cost__arrow {
  font-size: 0.55rem; color: var(--text-muted);
  transition: transform 0.2s; margin-left: auto;
}
.prov-cost--open .prov-cost__arrow { transform: rotate(90deg); }
.prov-cost__body { display: none; padding: 0 var(--space-md) var(--space-md); }
.prov-cost--open .prov-cost__body { display: block; }
.prov-cost__grid {
  display: grid; grid-template-columns: 1fr 1fr;
  gap: var(--space-sm) var(--space-md);
}
.prov-cost__field label {
  display: block; font-size: 0.65rem; font-weight: 600;
  color: var(--text-muted); text-transform: uppercase;
  letter-spacing: 0.02em; margin-bottom: 2px;
}
.prov-cost__field input,
.prov-cost__field select {
  font-size: 0.8rem; padding: 0.3rem 0.5rem;
}
.prov-cost__value {
  font-size: 0.8rem; font-weight: 500; color: var(--text);
}
.prov-cost__save {
  margin-top: var(--space-sm);
}

/* --- Notas + Timeline unificado (modal gestion tramite) --- */
.tr-notas {
  margin-top: var(--space-md);
  display: flex;
  flex-direction: column;
  gap: var(--space-sm);
}
.tr-notas__header {
  font-size: 0.78rem;
  font-weight: 600;
  color: var(--text-secondary);
  text-transform: uppercase;
  letter-spacing: 0.03em;
}
.tr-notas__count { color: var(--primary); font-weight: 700; }
.tr-notas__timeline {
  max-height: 260px;
  overflow-y: auto;
  padding: var(--space-sm);
  background: var(--bg);
  border-radius: var(--radius-md);
  border: 1px solid var(--border);
  display: flex;
  flex-direction: column;
  gap: 8px;
}
.tr-notas__empty {
  color: var(--text-muted);
  font-size: 0.85rem;
  font-style: italic;
  text-align: center;
  padding: var(--space-md);
}

.nota-item {
  display: flex;
  gap: 10px;
  padding: 8px 10px;
  border-radius: var(--radius-sm);
  background: var(--surface);
  border: 1px solid var(--border);
}
.nota-item__dot {
  flex-shrink: 0;
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--text-muted);
  margin-top: 6px;
}
.nota-item--nota { border-color: var(--border); }
.nota-item--nota .nota-item__dot { background: var(--primary); }
.nota-item--sistema { background: var(--bg); border-color: transparent; }
.nota-item--sistema .nota-item__texto { color: var(--text-secondary); font-size: 0.84rem; }
.nota-item--cliente-visible {
  border: 1px solid var(--primary-ring);
  background: var(--primary-light);
}
.nota-item__body { flex: 1; min-width: 0; }
.nota-item__meta {
  display: flex;
  align-items: center;
  gap: 4px;
  font-size: 0.72rem;
  color: var(--text-muted);
  margin-bottom: 2px;
}
.nota-item__actor { font-weight: 600; color: var(--text-secondary); }
.nota-item__texto { font-size: 0.9rem; color: var(--text); white-space: pre-wrap; }
.chip--visible {
  background: var(--primary);
  color: white;
  font-size: 0.65rem;
  padding: 2px 8px;
}

.tr-notas__input {
  background: var(--surface);
  padding: var(--space-sm);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  position: sticky;
  bottom: 0;
}
.tr-notas__quick {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-bottom: var(--space-sm);
}
.chip--quick {
  cursor: pointer;
  background: var(--bg);
  color: var(--text-secondary);
  border: 1px solid var(--border);
  font-weight: 500;
  transition: all 150ms ease;
}
.chip--quick:hover {
  background: var(--primary-light);
  color: var(--primary-dark);
  border-color: var(--primary);
}
.tr-notas__row {
  display: flex;
  gap: var(--space-sm);
  align-items: flex-start;
}
.tr-notas__row textarea {
  flex: 1;
  resize: vertical;
  min-height: 56px;
  font-family: inherit;
  font-size: 0.9rem;
  padding: 8px 10px;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
}
.tr-notas__actions {
  display: flex;
  flex-direction: column;
  gap: 6px;
  align-items: stretch;
}
.tr-notas__visible {
  display: flex;
  align-items: center;
  gap: 4px;
  font-size: 0.75rem;
  color: var(--text-secondary);
  cursor: pointer;
  white-space: nowrap;
}
.tr-notas__visible input { margin: 0; }

/* Portal: notas visibles al cliente */
.portal-notas {
  padding: var(--space-sm) var(--space-md);
  background: var(--primary-light);
  border: 1px solid var(--primary-ring);
  border-radius: var(--radius-sm);
}
.portal-nota {
  padding: 6px 0;
  border-bottom: 1px solid rgba(37, 99, 235, 0.15);
}
.portal-nota:last-child { border-bottom: none; }
.portal-nota__fecha {
  font-size: 0.72rem;
  color: var(--primary-dark);
  font-weight: 600;
}
.portal-nota__texto {
  margin: 2px 0 0;
  font-size: 0.88rem;
  color: var(--text);
  white-space: pre-wrap;
}

/* --- Historial / Timeline (modal) — legacy, aun usado en portal --- */
.historial { margin-top: var(--space-md); }
.historial__toggle {
  display: flex; align-items: center; gap: var(--space-sm);
  width: 100%; background: none; border: none; cursor: pointer;
  padding: var(--space-sm) 0; color: var(--text-secondary); font-size: 0.78rem;
  font-weight: 600; font-family: inherit; transition: color 0.15s;
}
.historial__toggle:hover { color: var(--text); }
.historial__arrow { transition: transform 0.2s; font-size: 0.6rem; }
.historial__arrow--open { transform: rotate(90deg); }
.historial__content {
  display: none; padding: var(--space-sm) 0 var(--space-sm) var(--space-md);
}
.historial__content--visible { display: block; }
.historial__list { list-style: none; padding: 0; margin: 0; }
.historial__item {
  display: flex; gap: var(--space-sm); padding: var(--space-xs) 0;
  position: relative;
}
.historial__item::before {
  content: ''; position: absolute; left: 4px; top: 16px; bottom: -4px;
  width: 1px; background: var(--border);
}
.historial__item:last-child::before { display: none; }
.historial__dot {
  width: 9px; height: 9px; border-radius: 50%;
  background: var(--primary-light); border: 2px solid var(--primary);
  flex-shrink: 0; margin-top: 3px;
}
.historial__body { flex: 1; min-width: 0; }
.historial__accion { font-size: 0.75rem; font-weight: 600; color: var(--text); }
.historial__detalle {
  font-size: 0.7rem; color: var(--text-secondary);
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.historial__fecha { font-size: 0.6rem; color: var(--text-muted); }

/* --- Bulk selection bar --- */
.bulk-bar {
  display: flex; align-items: center; justify-content: space-between;
  padding: var(--space-sm) var(--space-md);
  background: var(--primary); color: white;
  border-radius: var(--radius-md); margin-bottom: var(--space-sm);
  box-shadow: var(--shadow-md); animation: slideDown 0.2s ease;
}
@keyframes slideDown {
  from { opacity: 0; transform: translateY(-8px); }
  to { opacity: 1; transform: translateY(0); }
}
.bulk-bar__info {
  font-size: 0.8rem; font-weight: 600;
}
.bulk-bar__info span {
  font-size: 1rem; font-weight: 800;
}
.bulk-bar__actions { display: flex; gap: var(--space-xs); }
.bulk-bar__actions .btn--primary {
  background: rgba(255,255,255,0.2); border-color: rgba(255,255,255,0.3);
}
.bulk-bar__actions .btn--primary:hover { background: rgba(255,255,255,0.35); }
.bulk-bar__actions .btn--ghost { color: rgba(255,255,255,0.8); }
.bulk-bar__actions .btn--ghost:hover { color: white; background: rgba(255,255,255,0.15); }

/* --- Checkbox column --- */
.th-check, .td-check {
  width: 32px; text-align: center; padding-left: 0.4rem; padding-right: 0.2rem;
}
.th-check input, .td-check input {
  width: 0.85rem; height: 0.85rem; accent-color: var(--primary);
  cursor: pointer;
}
.tr--selected { background: var(--primary-light) !important; }
.tr--selected:hover { background: #dbeafe !important; }

/* --- Modal masivo --- */
.modal--masivo {
  max-width: 580px;
  max-height: 88vh;
  display: flex; flex-direction: column;
}
.modal--masivo h3 { flex-shrink: 0; }
.modal--masivo .masivo-resumen { flex-shrink: 0; }
.masivo-scroll {
  overflow-y: auto; flex: 1 1 auto;
  min-height: 0;
  scrollbar-width: thin; scrollbar-color: var(--border) transparent;
  padding-right: var(--space-xs);
}
.modal--masivo .modal__actions {
  flex-shrink: 0; border-top: 1px solid var(--border);
  padding-top: var(--space-sm); margin-top: var(--space-sm);
}
.masivo-resumen { margin-bottom: var(--space-sm); flex-shrink: 0; }
.masivo-resumen__list { display: flex; flex-direction: column; gap: var(--space-xs); }
.masivo-resumen__group {
  padding: var(--space-xs) var(--space-sm); background: #f9fafb;
  border: 1px solid var(--border); border-radius: var(--radius-sm);
}
.masivo-resumen__tramite {
  font-size: 0.72rem; font-weight: 600; color: var(--text);
  margin-bottom: 2px;
}
.masivo-resumen__count { color: var(--text-muted); font-weight: 400; }
.masivo-resumen__patentes { display: flex; flex-wrap: wrap; gap: 3px; }
.masivo-resumen__chip {
  display: inline-block; padding: 0.05em 0.35em;
  font-size: 0.6rem; font-weight: 600;
  font-family: var(--font-mono);
  background: var(--primary-light); color: var(--primary-dark);
  border-radius: 2px; line-height: 1.4;
}
.masivo-grupos { margin-bottom: var(--space-sm); }
.masivo-comun { margin-bottom: 0; }
.masivo-comun .form-row { gap: var(--space-xs) var(--space-sm); }
.masivo-comun .form-group { margin-bottom: var(--space-xs); }
.masivo-toggle { margin-bottom: var(--space-sm); }
.masivo-grupo-prov {
  padding: var(--space-sm); background: #f9fafb;
  border: 1px solid var(--border); border-radius: var(--radius-sm);
  margin-bottom: var(--space-xs);
}
.masivo-grupo-prov__label {
  font-size: 0.75rem; font-weight: 600; color: var(--primary);
  margin-bottom: var(--space-xs);
}
.masivo-resumen__emp {
  display: block; font-size: 0.55rem; font-weight: 400;
  color: var(--text-muted); font-family: inherit; line-height: 1.2;
}

/* --- Documentos masivos (modal) --- */
.masivo-docs {
  margin-top: var(--space-sm); padding-top: var(--space-sm);
  border-top: 1px solid var(--border);
}
.masivo-docs__header {
  font-size: 0.7rem; font-weight: 700; color: var(--text-muted);
  text-transform: uppercase; letter-spacing: 0.03em;
  margin-bottom: var(--space-xs);
}
.masivo-docs__tabs {
  display: flex; gap: 0; margin-bottom: var(--space-sm);
  border-bottom: 2px solid var(--border);
}
.masivo-docs__tab {
  padding: 0.3rem 0.75rem; font-size: 0.72rem;
  font-weight: 500; font-family: inherit; border: none;
  background: transparent; color: var(--text-muted);
  cursor: pointer; transition: all 0.15s;
  border-bottom: 2px solid transparent; margin-bottom: -2px;
}
.masivo-docs__tab:hover { color: var(--text); }
.masivo-docs__tab--active {
  color: var(--primary); font-weight: 600;
  border-bottom-color: var(--primary);
}
.masivo-docs__panel { }
.masivo-docs__panel[style*="display: none"] + .masivo-docs__panel { }
.masivo-docs__add {
  display: flex; align-items: center; gap: var(--space-xs);
  margin-top: var(--space-xs);
}
.masivo-docs__nota {
  flex: 1; font-size: 0.72rem; padding: 3px 6px;
  border: 1px solid var(--border); border-radius: var(--radius-sm);
  font-family: inherit;
}
.masivo-docs__list { display: flex; flex-direction: column; gap: 2px; }
.masivo-docs__item {
  display: flex; align-items: center; gap: var(--space-xs);
  padding: 2px var(--space-sm); background: var(--primary-light);
  border-radius: 2px; font-size: 0.68rem;
}
.masivo-docs__fname {
  font-weight: 500; color: var(--text);
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
  max-width: 160px;
}
.masivo-docs__fnota {
  font-size: 0.6rem; color: var(--text-muted); flex: 1;
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.masivo-docs__remove {
  background: none; border: none; cursor: pointer;
  color: var(--text-muted); font-size: 0.75rem;
  padding: 0 2px; border-radius: 2px; line-height: 1;
}
.masivo-docs__remove:hover { color: var(--status-7); background: var(--status-7-bg); }

/* Per-patente scroll container */
#masivo-docs-patente {
  max-height: 220px; overflow-y: auto;
  scrollbar-width: thin; scrollbar-color: var(--border) transparent;
}
.masivo-docs__patente-row {
  padding: var(--space-xs) var(--space-sm);
  border: 1px solid var(--border); border-radius: var(--radius-sm);
  margin-bottom: 3px;
}
.masivo-docs__patente-label {
  font-size: 0.7rem; margin-bottom: 2px;
  display: flex; align-items: baseline; gap: var(--space-xs);
}
.masivo-docs__patente-label strong {
  font-family: var(--font-mono);
  font-size: 0.68rem; letter-spacing: 0.03em;
}
.masivo-docs__patente-label small {
  color: var(--text-muted); font-size: 0.6rem;
}

/* --- Lotes de trabajo --- */
.lotes { margin-bottom: var(--space-sm); }
.lotes__header {
  font-size: 0.7rem; font-weight: 700; text-transform: uppercase;
  letter-spacing: 0.04em; color: var(--text-muted);
  margin-bottom: var(--space-xs);
}
.lotes__grid {
  display: grid; grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
  gap: var(--space-sm);
}
.lote-card {
  background: var(--surface); border: 1px solid var(--border);
  border-radius: var(--radius-md); padding: var(--space-sm) var(--space-md);
  transition: all 0.15s;
  position: relative;
}
.lote-card::before {
  content: ""; position: absolute; top: var(--space-sm); right: var(--space-sm);
  width: 8px; height: 8px; border-radius: 50%; background: var(--primary);
}
.lote-card:hover { box-shadow: var(--shadow-md); border-color: var(--primary-ring); }
.lote-card--active { border-color: var(--primary); background: var(--primary-light); }
.lote-card--progress::before { background: var(--status-30); }
.lote-card--done::before { background: var(--status-ok); }
.lote-card__top {
  display: flex; align-items: flex-start; justify-content: space-between;
}
.lote-card__nombre {
  font-size: 0.8rem; font-weight: 600; color: var(--text); line-height: 1.3;
}
.lote-card__close {
  background: none; border: none; cursor: pointer; font-size: 1rem;
  color: var(--text-muted); padding: 0 2px; line-height: 1;
  border-radius: var(--radius-sm); transition: all 0.15s;
}
.lote-card__close:hover { color: var(--status-7); background: var(--status-7-bg); }
.lote-card__proveedor {
  font-size: 0.7rem; color: var(--text-secondary); margin-bottom: var(--space-xs);
}
.lote-card__bar {
  height: 4px; background: var(--border); border-radius: 2px;
  overflow: hidden; margin-bottom: 3px;
}
.lote-card__bar-fill {
  height: 100%; border-radius: 2px; transition: width 0.3s ease;
  background: var(--primary);
}
.lote-card--done .lote-card__bar-fill { background: var(--status-ok); }
.lote-card--progress .lote-card__bar-fill { background: var(--status-30); }
.lote-card__stats {
  display: flex; justify-content: space-between; align-items: center;
  font-size: 0.65rem; color: var(--text-muted); margin-bottom: var(--space-xs);
}
.lote-card__pct { font-weight: 700; color: var(--primary); }
.lote-card--done .lote-card__pct { color: var(--status-ok); }
.lote-card__actions { display: flex; gap: 4px; }
.lote-card__codigo {
  display: inline-block; padding: 0.05em 0.4em;
  font-size: 0.65rem; font-weight: 700;
  font-family: var(--font-mono);
  background: var(--primary); color: white;
  border-radius: var(--radius-sm); letter-spacing: 0.03em;
  vertical-align: middle;
}
.lote-card--done .lote-card__codigo { background: var(--status-ok); }

/* Lote tag en tabla */
.td-lote {
  display: inline-block; margin-top: 2px;
  padding: 0 0.35em; font-size: 0.55rem; font-weight: 700;
  font-family: var(--font-mono);
  background: var(--primary-light); color: var(--primary);
  border-radius: 2px; letter-spacing: 0.02em;
}

/* --- Panel selección por lote --- */
.lote-panel {
  background: var(--surface); border: 1px solid var(--border);
  border-radius: var(--radius-md); margin-bottom: var(--space-sm);
  overflow: hidden;
}
.lote-panel__toggle {
  display: flex; align-items: center; gap: var(--space-sm);
  width: 100%; background: none; border: none; cursor: pointer;
  padding: var(--space-sm) var(--space-md);
  font-size: 0.8rem; font-weight: 600; font-family: inherit;
  color: var(--primary); transition: background 0.15s;
}
.lote-panel__toggle:hover { background: var(--primary-light); }
.lote-panel__icon { transition: transform 0.2s; font-size: 0.6rem; }
.lote-panel__icon--open { transform: rotate(90deg); }
.lote-panel__content {
  display: none; padding: 0 var(--space-md) var(--space-md);
}
.lote-panel__content--visible { display: block; }

.lote-section {
  display: flex; align-items: center; gap: var(--space-xs);
  margin-bottom: var(--space-xs); flex-wrap: wrap;
}
.lote-section__label {
  font-size: 0.65rem; font-weight: 600; color: var(--text-muted);
  text-transform: uppercase; letter-spacing: 0.03em;
  white-space: nowrap; min-width: 80px;
}
.lote-section__btns { display: flex; flex-wrap: wrap; gap: 4px; }

.lote-btn {
  padding: 0.2rem 0.55rem; font-size: 0.72rem; font-weight: 500;
  border: 1px solid var(--border); border-radius: var(--radius-sm);
  background: var(--surface); color: var(--text-secondary);
  cursor: pointer; transition: all 0.15s; font-family: inherit;
}
.lote-btn:hover {
  border-color: var(--primary); color: var(--primary); background: var(--primary-light);
}
.lote-btn--active {
  background: var(--primary); color: white; border-color: var(--primary);
}
.lote-btn__count {
  font-size: 0.6rem; opacity: 0.7; margin-left: 2px;
}
.lote-empty {
  font-size: 0.7rem; color: var(--text-muted); font-style: italic;
}

.lote-match {
  display: flex; align-items: center; gap: var(--space-sm);
  padding: var(--space-sm); margin-top: var(--space-xs);
  background: var(--primary-light); border: 1px solid var(--primary);
  border-radius: var(--radius-sm); font-size: 0.78rem; color: var(--primary);
  font-weight: 500;
}
.lote-match span:first-child { font-weight: 800; font-size: 0.9rem; }

/* =============================================
   Bento grid & landing 2.0 (minimal profesional)
   ============================================= */

/* Tokens extendidos para landing — respeta las variables ya definidas. */
:root {
  --space-3xl: 3.5rem;
  --space-4xl: 5rem;
  --radius-xl: 1rem;
  --radius-2xl: 1.25rem;
  --shadow-card: 0 1px 3px rgba(15, 23, 42, 0.06), 0 1px 2px rgba(15, 23, 42, 0.04);
  --shadow-hover: 0 12px 32px -8px rgba(15, 23, 42, 0.16), 0 4px 12px -2px rgba(15, 23, 42, 0.06);
  --color-accent-soft: #f5f7fa;
  --color-ink: #0f172a;
}

/* --- Hero refinado en landing (fondo claro → stats en oscuro) --- */
.landing-hero {
  /* Mobile-first: padding más chico en cel, generoso en desktop */
  padding: clamp(var(--space-xl), 6vw, var(--space-3xl)) 0 clamp(var(--space-lg), 5vw, var(--space-2xl));
  background: linear-gradient(180deg, #ffffff 0%, var(--color-accent-soft) 100%);
  border-bottom: 1px solid var(--border);
}
.landing-hero__title {
  /* Escala fluida 320px→1440px sin breakpoints fijos.
     Mínimo legible para senior (1.55rem ≈ 26px en cel) hasta 2.75rem en desktop. */
  font-size: clamp(1.55rem, 5.5vw, 2.75rem);
  line-height: 1.15;
  letter-spacing: -0.01em;
  color: var(--color-ink);
  margin-bottom: var(--space-md);
  max-width: 820px;
}
.landing-hero__desc {
  font-size: clamp(0.95rem, 2.4vw, 1.1rem);
  line-height: 1.6;
  color: var(--text-secondary);
  max-width: 640px;
  margin-bottom: var(--space-xl);
}
.landing-hero__cta { margin-bottom: var(--space-2xl); }

/* Override contraste: el hero ahora es claro, no oscuro */
.landing-hero .landing-stat__value { color: var(--color-ink); }
.landing-hero .landing-stat__label { color: var(--text-secondary); }
.landing-hero__cta .btn--secondary {
  background: var(--surface);
  color: var(--primary);
  border: 1px solid var(--primary);
}
.landing-hero__cta .btn--secondary:hover {
  background: var(--primary-light);
  border-color: var(--primary-dark);
  color: var(--primary-dark);
}

/* --- Sección: agrupadores de servicios (permanente / eventual) --- */
.service-group {
  margin-top: var(--space-2xl);
}
.service-group + .service-group {
  margin-top: var(--space-3xl);
}
.service-group__header {
  display: flex;
  flex-direction: column;
  gap: var(--space-xs);
  margin-bottom: var(--space-lg);
}
.service-group__badge {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  align-self: flex-start;
  padding: 4px 12px;
  font-size: 0.72rem;
  font-weight: 600;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  border-radius: 999px;
  background: var(--primary-light);
  color: var(--primary);
  border: 1px solid rgba(37, 99, 235, 0.18);
}
.service-group__badge--permanente {
  background: #ecfdf5;
  color: var(--status-ok);
  border-color: rgba(5, 150, 105, 0.18);
}
.service-group__title {
  font-size: 1.25rem;
  color: var(--color-ink);
  margin-top: 2px;
}
.service-group__desc {
  color: var(--text-secondary);
  font-size: 0.9rem;
  max-width: 640px;
}

/* --- Bento grid --- */
.bento-grid {
  display: grid;
  gap: var(--space-lg);
}
.bento-grid--permanente {
  grid-template-columns: repeat(2, minmax(0, 1fr));
}
.bento-grid--eventual {
  grid-template-columns: repeat(3, minmax(0, 1fr));
}

.bento-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-xl);
  padding: var(--space-xl);
  box-shadow: var(--shadow-card);
  transition: transform 180ms ease, box-shadow 180ms ease, border-color 180ms ease;
  display: flex;
  flex-direction: column;
  gap: var(--space-md);
  position: relative;
  overflow: hidden;
}
.bento-card:hover {
  transform: translateY(-2px);
  box-shadow: var(--shadow-hover);
  border-color: var(--border-strong);
}
.bento-card--lg {
  padding: var(--space-2xl);
}
.bento-card--lg h4 { font-size: 1.2rem; }
.bento-card__icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 44px; height: 44px;
  border-radius: 12px;
  font-size: 1.25rem;
}
.bento-card__icon i[data-lucide] { width: 22px; height: 22px; }
.bento-card__body { display: flex; flex-direction: column; gap: var(--space-sm); }
.bento-card__body h4 {
  color: var(--color-ink);
  font-size: 1.05rem;
  letter-spacing: -0.005em;
}
.bento-card__body p {
  color: var(--text-secondary);
  font-size: 0.88rem;
  line-height: 1.55;
}
.bento-card__features {
  list-style: none;
  padding: 0;
  margin: var(--space-sm) 0 0;
  display: flex;
  flex-direction: column;
  gap: 4px;
}
.bento-card__features li {
  position: relative;
  padding-left: 18px;
  font-size: 0.82rem;
  color: var(--text);
}
.bento-card__features li::before {
  content: "";
  position: absolute;
  left: 0; top: 7px;
  width: 6px; height: 6px;
  border-radius: 50%;
  background: var(--primary);
  opacity: 0.85;
}
/* --- Cómo funciona: paso 4 con énfasis sutil (sin romper consistencia visual) ---
   Antes: gradient + borde tintado que desbalanceaba la grilla.
   Ahora: número con halo + ring del primary, card igual al resto. */
.step-card--highlight .step-card__number {
  background: var(--primary);
  color: #fff;
  box-shadow: 0 0 0 4px var(--primary-ring);
}

/* --- Precios --- */
/* (Sección Precios pública removida — la cotización ahora es interna · ver /cotizador) */

/* --- Badge spot y KPI info --- */
.badge--spot {
  background: #e0e7ff;
  color: #3730a3;
  border: 1px solid rgba(55, 48, 163, 0.18);
}
.kpi-card--info {
  border-color: rgba(37, 99, 235, 0.25);
  background: var(--primary-light);
}
.kpi-card--info .kpi-card__value { color: var(--primary); }

/* --- Columna Asignado en tabla --- */
.td-asignado {
  display: flex;
  flex-direction: column;
  gap: 2px;
  line-height: 1.2;
}
.td-asignado__nombre { font-weight: 500; font-size: 0.82rem; }
.td-asignado__fecha { font-size: 0.7rem; color: var(--text-muted); }

/* --- Etiquetas dentro del modal --- */
.modal-info__tag {
  display: inline-flex;
  align-items: center;
  margin-left: 6px;
  padding: 2px 8px;
  font-size: 0.68rem;
  font-weight: 600;
  letter-spacing: 0.03em;
  text-transform: uppercase;
  border-radius: 999px;
}
.modal-info__tag--permanente { background: #ecfdf5; color: var(--status-ok); }
.modal-info__tag--eventual   { background: #fef3f2; color: #b91c1c; }
.modal-info__sub { color: var(--text-muted); font-weight: 400; }

/* --- Botón extra pequeño · solo para densidad de tablas. Subido a senior-friendly. --- */
.btn--xs {
  padding: 0.35rem 0.7rem;
  font-size: 0.82rem;
  border-radius: var(--radius-sm);
  min-height: 30px;
}

/* --- Scroll reveal --- */
.reveal {
  opacity: 0;
  transform: translateY(12px);
  transition: opacity 420ms ease, transform 420ms ease;
}
.reveal--on {
  opacity: 1;
  transform: none;
}

/* --- Responsive --- */
@media (max-width: 960px) {
  .bento-grid--permanente { grid-template-columns: 1fr; }
  .bento-grid--eventual   { grid-template-columns: 1fr; }
}

@media (max-width: 640px) {
  .landing-hero__title { font-size: clamp(1.5rem, 7vw, 2.2rem); }
  .bento-card--lg { padding: var(--space-xl); }
}

/* =============================================
   Identidad de vertical: transporte pesado
   ============================================= */

/* Datos numericos con mono tabular (patentes, dias, folios, montos) */
.td-patente,
.td-dias,
.kpi-card__value,
.landing-stat__value,
.tipos-card__count {
  font-variant-numeric: tabular-nums;
  font-feature-settings: "tnum" 1;
}

/* Patentes con look de placa */
.td-patente {
  font-family: var(--font-mono);
  letter-spacing: 0.04em;
  font-weight: 600;
  color: var(--color-ink, var(--text));
}
.td-patente::before {
  content: "";
  display: inline-block;
  width: 3px;
  height: 14px;
  margin-right: 8px;
  background: var(--primary);
  border-radius: 1px;
  vertical-align: middle;
}

/* KPIs numericos mas tecnicos */
.kpi-card__value {
  font-family: var(--font-mono);
  font-weight: 700;
  letter-spacing: -0.01em;
}
.landing-stat__value {
  font-family: var(--font-mono);
  font-weight: 800;
  letter-spacing: -0.02em;
}

/* Folios con mono */
.prov-cost__value,
.ejecucion input[type="text"] {
  font-family: var(--font-mono);
  font-size: 0.88em;
}

/* Pulse suave en badges de Vencido — "alert pulse" recomendado por UI skill */
@keyframes pulse-alert {
  0%, 100% { box-shadow: 0 0 0 0 rgba(153, 27, 27, 0.35); }
  50%      { box-shadow: 0 0 0 6px rgba(153, 27, 27, 0); }
}
.badge--vencido {
  animation: pulse-alert 2.2s ease-out infinite;
  border-radius: 999px;
}
@media (prefers-reduced-motion: reduce) {
  .badge--vencido { animation: none; }
}

/* Count animado tipo ticker para el valor UF en sticky */
.kpi-card--info .kpi-card__value {
  color: var(--accent-tracking);
}

/* Chips de categoria: colores del vertical */
.tipos-card__tag--permanente {
  background: var(--accent-delivered-bg);
  color: var(--accent-delivered);
}
.tipos-card__tag--eventual {
  background: var(--accent-tracking-bg);
  color: var(--accent-tracking);
}

/* Logo header: container para SVG de camion */
.header__logo {
  overflow: hidden;
  position: relative;
}
.header__logo svg {
  width: 22px;
  height: 22px;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.6;
  stroke-linecap: round;
  stroke-linejoin: round;
}

/* Hero con decoracion sutil de ruta + camion SVG */
.landing-hero { position: relative; overflow: hidden; }
.landing-hero__art {
  position: absolute;
  right: 8px;
  bottom: -20px;
  width: 460px;
  max-width: 48%;
  opacity: 0.92;
  pointer-events: none;
}
.landing-hero__art svg { width: 100%; height: auto; }
@media (max-width: 820px) {
  .landing-hero__art { display: none; }
}

/* ---- Hero: efecto de movimiento ---- */
.hero-route {
  stroke-dashoffset: 0;
  animation: hero-route-flow 1.1s linear infinite;
}
@keyframes hero-route-flow {
  from { stroke-dashoffset: 0; }
  to   { stroke-dashoffset: -32; }  /* multiplo del patron 6+10 */
}

.hero-truck {
  animation: hero-bob-truck 1.8s ease-in-out infinite;
  transform-origin: center;
}
.hero-bus {
  animation: hero-bob-bus 2.1s ease-in-out infinite;
  transform-origin: center;
}
@keyframes hero-bob-truck {
  0%, 100% { transform: translate(130px, 110px); }
  50%      { transform: translate(130px, 108.5px); }
}
@keyframes hero-bob-bus {
  0%, 100% { transform: translate(30px, 110px); }
  50%      { transform: translate(30px, 108.7px); }
}

.speed-lines line {
  stroke-dasharray: 20;
  stroke-dashoffset: 0;
}
.speed-lines--bus line:nth-child(1) { animation: hero-dash 0.7s linear infinite; }
.speed-lines--bus line:nth-child(2) { animation: hero-dash 0.7s linear infinite 0.12s; }
.speed-lines--bus line:nth-child(3) { animation: hero-dash 0.7s linear infinite 0.24s; }
@keyframes hero-dash {
  0%   { stroke-dashoffset: 20;  opacity: 0; }
  35%  { opacity: 0.5; }
  100% { stroke-dashoffset: -20; opacity: 0; }
}

.hero-doc {
  transform-box: fill-box;
  transform-origin: center;
  animation: hero-doc-float 3.2s ease-in-out infinite;
}
@keyframes hero-doc-float {
  0%, 100% { transform: translate(430px, 18px) rotate(-1.5deg); }
  50%      { transform: translate(430px, 13px) rotate(1.5deg); }
}

@media (prefers-reduced-motion: reduce) {
  .hero-route,
  .hero-truck,
  .hero-bus,
  .hero-doc,
  .speed-lines line,
  .wheel__spokes {
    animation: none !important;
  }
  .wheel__spokes { display: none; }
}

/* Patron de ruta discontinua debajo del hero */
.landing-hero::after {
  content: "";
  position: absolute;
  left: 0; right: 0; bottom: 0;
  height: 2px;
  background-image: linear-gradient(90deg, var(--primary) 50%, transparent 50%);
  background-size: 16px 2px;
  background-repeat: repeat-x;
  opacity: 0.25;
}

/* Input search: deja espacio para SVG en lugar del emoji */
.search-box__icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 18px;
  height: 18px;
  color: var(--text-muted);
}
.search-box__icon svg { width: 16px; height: 16px; stroke: currentColor; fill: none; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }

/* Portal cliente: bloque "5 tipos de trámite" */
.tipos-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  gap: var(--space-sm);
  margin-bottom: var(--space-md);
}
.tipos-card {
  display: flex;
  align-items: center;
  gap: var(--space-md);
  padding: var(--space-md);
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-sm);
  cursor: pointer;
  text-align: left;
  font-family: inherit;
  transition: transform 180ms ease, box-shadow 180ms ease, border-color 180ms ease;
}
.tipos-card:hover {
  transform: translateY(-1px);
  border-color: var(--primary);
  box-shadow: var(--shadow-md);
}
.tipos-card:focus-visible {
  outline: 2px solid var(--primary-ring);
}
.tipos-card__icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  width: 40px;
  height: 40px;
  border-radius: 10px;
  font-size: 1.1rem;
}
.tipos-card__icon svg,
.tipos-card__icon i[data-lucide] { width: 20px; height: 20px; stroke-width: 2; }
.tipos-card__body {
  display: flex;
  flex-direction: column;
  gap: 2px;
  min-width: 0;
  flex: 1;
}
.tipos-card__label {
  font-weight: 600;
  font-size: 0.88rem;
  color: var(--color-ink, var(--text));
  line-height: 1.2;
}
.tipos-card__meta {
  display: flex;
  align-items: center;
  gap: 6px;
  flex-wrap: wrap;
}
.tipos-card__count {
  font-weight: 700;
  font-size: 1.1rem;
  color: var(--text);
  line-height: 1;
}
.tipos-card__count-label {
  font-size: 0.72rem;
  color: var(--text-muted);
}
.tipos-card__tag {
  margin-left: auto;
  font-size: 0.62rem;
  font-weight: 600;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  padding: 2px 8px;
  border-radius: 999px;
}
.tipos-card__tag--permanente {
  background: #ecfdf5;
  color: #059669;
}
.tipos-card__tag--eventual {
  background: #fef3f2;
  color: #b91c1c;
}
@media (max-width: 820px) {
  .tipos-grid { grid-template-columns: 1fr 1fr; gap: 6px; }
  .tipos-card { padding: var(--space-sm); gap: var(--space-sm); }
  .tipos-card__icon { width: 34px; height: 34px; font-size: 1rem; }
  .tipos-card__label { font-size: 0.82rem; }
  .tipos-card__count { font-size: 0.95rem; }
}
@media (max-width: 380px) {
  .tipos-grid { grid-template-columns: 1fr; }
}

/* Selector de operador en header panel */
.header__operator {
  padding: 4px 10px;
  font-size: 0.8rem;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  background: var(--surface);
  color: var(--text);
  font-weight: 500;
  cursor: pointer;
  min-width: 140px;
  max-width: 180px;
}
.header__operator:focus {
  outline: 2px solid var(--primary-ring);
  border-color: var(--primary);
}

/* =============================================
   Portal cliente simplificado — Mi Flota
   ============================================= */

/* KPIs globales (compactos, arriba de la lista) */
.flota-kpis {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: var(--space-sm);
  margin-bottom: var(--space-lg);
}
.flota-kpi {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  padding: var(--space-md);
  display: flex;
  flex-direction: column;
  gap: 2px;
}
.flota-kpi__label {
  font-size: 0.7rem;
  font-weight: 600;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.04em;
}
.flota-kpi__value {
  font-family: var(--font-mono);
  font-size: 1.4rem;
  font-weight: 700;
  line-height: 1;
  font-variant-numeric: tabular-nums;
}
.flota-kpi--alert .flota-kpi__value { color: var(--status-30); }
.flota-kpi--danger .flota-kpi__value { color: var(--status-vencido); }

/* Toolbar (busqueda + filtros) */
.flota-toolbar {
  display: flex;
  flex-direction: column;
  gap: var(--space-sm);
  margin-bottom: var(--space-md);
}

/* Card de vehiculo (el hero del portal nuevo) */
.vehiculo-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  margin-bottom: var(--space-md);
  box-shadow: var(--shadow-sm);
  overflow: hidden;
  transition: box-shadow 180ms ease, border-color 180ms ease;
}
.vehiculo-card:hover {
  box-shadow: var(--shadow-md);
  border-color: var(--border-strong);
}
/* M1 · Vehiculo card sin side-stripe.
   Status comunicado por: borde top tinted (más sutil que side-stripe) y chip
   de estado prominente en el header. */
.vehiculo-card--vencido    { border-top: 2px solid var(--status-vencido); }
.vehiculo-card--alerta     { border-top: 2px solid var(--status-30); }
.vehiculo-card--en-tramite { border-top: 2px solid var(--accent-tracking); }
.vehiculo-card--al-dia     { border-top: 2px solid var(--status-ok); }

.vehiculo-card__head {
  display: flex;
  align-items: center;
  gap: var(--space-md);
  padding: var(--space-md) var(--space-lg);
  border-bottom: 1px solid var(--border);
  cursor: pointer;
  user-select: none;
  transition: background-color 160ms ease;
}
.vehiculo-card__head:hover { background: var(--bg, #f8fafc); }
.vehiculo-card__head:focus-visible {
  outline: 2px solid var(--primary);
  outline-offset: -2px;
}
.vehiculo-card__chevron {
  font-size: 1rem;
  color: var(--text-muted);
  margin-left: 4px;
  transition: transform 200ms ease;
  flex-shrink: 0;
}
.vehiculo-card--collapsed .vehiculo-card__chevron {
  transform: rotate(-90deg);
}
.vehiculo-card--collapsed .vehiculo-card__head {
  border-bottom: none;
}
.vehiculo-card--collapsed .vehiculo-card__body {
  display: none;
}

/* Próximo vencimiento (visible solo cuando la card está colapsada) */
.vehiculo-card__proximo {
  display: none;
  font-size: 0.78rem;
  color: var(--text-secondary);
  margin-top: 4px;
  font-weight: 500;
}
.vehiculo-card--collapsed .vehiculo-card__proximo { display: block; }
.vehiculo-card__proximo--alerta { color: #92400e; }
.vehiculo-card__proximo--urgente { color: #b91c1c; font-weight: 600; }
.vehiculo-card__proximo--vencido { color: #991b1b; font-weight: 700; }

/* Contadores en botones de filtro · contraste alto (post fix de badge topbar) */
.filter-count {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  background: var(--ck-neutral-200, #e5e7eb);
  color: var(--ck-text, #0f172a);
  font-weight: 700;
  font-size: 0.72rem;
  padding: 1px 8px;
  border-radius: 999px;
  margin-left: 6px;
  min-width: 20px;
  height: 18px;
  text-align: center;
  font-variant-numeric: tabular-nums;
  vertical-align: middle;
  line-height: 1;
}
.filter-btn--active .filter-count,
.is-active .filter-count {
  background: #ffffff;
  color: var(--ck-primary, #2563eb);
}
.vehiculo-card__icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 44px;
  height: 44px;
  border-radius: 12px;
  background: var(--primary-light);
  color: var(--primary);
  flex-shrink: 0;
}
.vehiculo-card__icon svg,
.vehiculo-card__icon i[data-lucide] { width: 24px; height: 24px; stroke-width: 1.8; }

.vehiculo-card__meta {
  display: flex;
  flex-direction: column;
  gap: 2px;
  min-width: 0;
  flex: 1;
}
.vehiculo-card__patente {
  font-family: var(--font-mono);
  font-weight: 700;
  font-size: 1.05rem;
  letter-spacing: 0.05em;
  color: var(--color-ink, var(--text));
  font-variant-numeric: tabular-nums;
}
.vehiculo-card__tipo {
  font-size: 0.78rem;
  color: var(--text-secondary);
}

.vehiculo-card__score {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 2px;
  padding: 6px 10px;
  border-radius: var(--radius-sm);
  cursor: pointer;
  transition: background-color 160ms ease;
  line-height: 1;
  margin-right: var(--space-xs);
}
.vehiculo-card__score:hover { background: var(--bg); }

.vehiculo-card__estado {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 4px 12px;
  border-radius: 999px;
  font-size: 0.75rem;
  font-weight: 600;
  white-space: nowrap;
}
.vehiculo-card__estado::before {
  content: "";
  width: 8px; height: 8px;
  border-radius: 50%;
  background: currentColor;
}
.vehiculo-card__estado--al-dia     { background: #ecfdf5; color: var(--status-ok); }
.vehiculo-card__estado--alerta     { background: #fffbeb; color: var(--status-30); }
.vehiculo-card__estado--vencido    { background: #fde8e8; color: var(--status-vencido); animation: pulse-alert 2.2s ease-out infinite; }
.vehiculo-card__estado--en-tramite { background: var(--accent-tracking-bg); color: var(--accent-tracking); }
@media (prefers-reduced-motion: reduce) {
  .vehiculo-card__estado--vencido { animation: none; }
}

/* Lista de tramites en la card */
.vehiculo-tramites {
  list-style: none;
  padding: var(--space-xs) 0;
  margin: 0;
}
.vehiculo-tramites__item {
  display: grid;
  grid-template-columns: 20px 1fr auto auto;
  gap: var(--space-sm);
  align-items: center;
  padding: var(--space-sm) var(--space-lg);
  font-size: 0.88rem;
  cursor: pointer;
  transition: background-color 160ms ease;
}
.vehiculo-tramites__item:hover { background: var(--bg); }
.vehiculo-tramites__item[data-clickable="false"] { cursor: default; }
.vehiculo-tramites__item[data-clickable="false"]:hover { background: transparent; }

.vehiculo-tramites__icon {
  display: inline-flex;
  color: var(--text-muted);
  width: 16px;
}
.vehiculo-tramites__icon svg { width: 16px; height: 16px; stroke-width: 1.7; }
.vehiculo-tramites__label { color: var(--text); font-weight: 500; }
.vehiculo-tramites__fecha {
  font-family: var(--font-mono);
  font-size: 0.8rem;
  color: var(--text-secondary);
  font-variant-numeric: tabular-nums;
}
.vehiculo-tramites__chip {
  font-size: 0.72rem;
  font-weight: 600;
  padding: 3px 10px;
  border-radius: 999px;
  white-space: nowrap;
}
.chip--vigente    { background: #ecfdf5; color: var(--status-ok); }
.chip--por-vencer { background: #fffbeb; color: var(--status-30); }
.chip--urgente    { background: #fff7ed; color: var(--status-15); }
.chip--vencido    { background: #fde8e8; color: var(--status-vencido); }
.chip--en-tramite { background: var(--accent-tracking-bg); color: var(--accent-tracking); }
.chip--spot       { background: #e0e7ff; color: #3730a3; }
.chip--solicitar {
  background: var(--accent-tracking-bg);
  color: var(--accent-tracking);
  border: 1px solid var(--accent-tracking);
  cursor: pointer;
  font-weight: 700;
}

/* Chip compacto de modalidad al lado del tramite */
.chip--modalidad {
  display: inline-flex;
  align-items: center;
  gap: 3px;
  padding: 2px 6px;
  margin-left: 6px;
  font-size: 0.65rem;
  font-weight: 600;
  letter-spacing: 0.02em;
  text-transform: lowercase;
  border-radius: var(--radius-sm);
  vertical-align: middle;
}
.chip--modalidad-terreno {
  background: var(--accent-tracking-bg);
  color: var(--accent-tracking);
}
.chip--modalidad-online {
  background: var(--primary-light);
  color: var(--primary-dark);
}
.chip--modalidad--override {
  outline: 1px dashed currentColor;
  outline-offset: -1px;
}

/* Chips de estado del cliente */
.chip--estado {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 3px 10px;
  font-size: 0.72rem;
  font-weight: 600;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  border-radius: 999px;
  white-space: nowrap;
}
.chip--estado::before {
  content: "";
  width: 6px; height: 6px;
  border-radius: 50%;
  background: currentColor;
}
.chip--estado-prospecto  { background: #fffbeb; color: var(--status-30); }
.chip--estado-activo     { background: #ecfdf5; color: var(--status-ok); }
.chip--estado-suspendido { background: #fef2f2; color: var(--status-vencido); }

/* Badge del rol del operador logueado en el header */
.header__rol-badge {
  display: inline-flex;
  align-items: center;
  padding: 3px 10px;
  margin-left: 6px;
  font-size: 0.7rem;
  font-weight: 600;
  letter-spacing: 0.03em;
  text-transform: uppercase;
  border-radius: 999px;
  background: var(--primary-light);
  color: var(--primary-dark);
  border: 1px solid rgba(37, 99, 235, 0.2);
}
.header__rol-badge--admin       { background: #fef3c7; color: #92400e; border-color: rgba(146, 64, 14, 0.25); }
.header__rol-badge--supervisor  { background: #ede9fe; color: #5b21b6; border-color: rgba(91, 33, 182, 0.25); }
.header__rol-badge--operador_terreno { background: var(--accent-tracking-bg); color: var(--accent-tracking); border-color: rgba(249, 115, 22, 0.3); }
.header__rol-badge--operador_online  { background: var(--primary-light); color: var(--primary-dark); border-color: rgba(37, 99, 235, 0.3); }
.chip--solicitar::after {
  content: " →";
  font-weight: 500;
}

/* Bandeja de documentos */
.vehiculo-docs {
  border-top: 1px solid var(--border);
  background: var(--bg);
  padding: var(--space-md) var(--space-lg);
  display: flex;
  align-items: center;
  gap: var(--space-sm);
}
.vehiculo-docs__list {
  display: flex;
  gap: var(--space-xs);
  overflow-x: auto;
  flex: 1;
  min-width: 0;
  -webkit-overflow-scrolling: touch;
  scrollbar-width: none;
}
.vehiculo-docs__list::-webkit-scrollbar { display: none; }
.vehiculo-docs__chip {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 6px 12px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 999px;
  font-size: 0.78rem;
  color: var(--text);
  white-space: nowrap;
  cursor: pointer;
  transition: background-color 160ms ease, border-color 160ms ease;
  font-family: inherit;
}
.vehiculo-docs__chip:hover {
  background: var(--primary-light);
  border-color: var(--primary);
  color: var(--primary-dark);
}
.vehiculo-docs__chip svg { width: 14px; height: 14px; stroke-width: 1.8; }
.vehiculo-docs__empty { font-size: 0.8rem; color: var(--text-muted); font-style: italic; flex: 1; }
.vehiculo-docs__zip {
  flex-shrink: 0;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 6px 12px;
  background: var(--primary);
  color: #fff;
  border: none;
  border-radius: 999px;
  font-size: 0.78rem;
  font-weight: 600;
  cursor: pointer;
  font-family: inherit;
}
.vehiculo-docs__zip:hover { background: var(--primary-dark); }
.vehiculo-docs__zip:disabled { opacity: 0.5; cursor: wait; }
.vehiculo-docs__zip svg { width: 14px; height: 14px; stroke-width: 2; }

/* Mi Cuenta */
.cuenta-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
  gap: var(--space-md);
}
.cuenta-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: var(--space-lg);
}
.cuenta-card__title {
  font-size: 0.82rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  color: var(--text-muted);
  margin-bottom: var(--space-sm);
}
.cuenta-field {
  display: flex;
  justify-content: space-between;
  padding: 6px 0;
  border-bottom: 1px dashed var(--border);
  font-size: 0.88rem;
}
.cuenta-field:last-child { border-bottom: none; }
.cuenta-field__label { color: var(--text-muted); }
.cuenta-field__value {
  font-weight: 500;
  font-family: var(--font-mono);
  font-variant-numeric: tabular-nums;
}

/* Empty state de flota */
.flota-empty {
  text-align: center;
  padding: var(--space-2xl);
  color: var(--text-muted);
}
.flota-empty svg { width: 64px; height: 64px; stroke-width: 1.2; opacity: 0.4; margin-bottom: var(--space-md); }

/* ============================================
   Reportes de operadores
   ============================================ */
.reportes-title {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: var(--space-md);
  margin-bottom: var(--space-lg);
  flex-wrap: wrap;
}
.reportes-title h1 {
  font-size: 1.5rem;
  font-weight: 700;
  color: var(--text);
  margin: 0;
}

.reportes-filtros {
  display: flex;
  flex-direction: column;
  gap: var(--space-md);
  padding: var(--space-md) var(--space-lg);
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  margin-bottom: var(--space-lg);
}
.reportes-filtros__row {
  display: flex;
  flex-wrap: wrap;
  gap: var(--space-md);
  align-items: flex-end;
}
.reportes-filtros__row .form-group {
  flex: 1 1 180px;
  min-width: 160px;
  margin: 0;
}
.reportes-filtros__quick {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}
.reportes-filtros__dates {
  display: flex;
  gap: var(--space-sm);
  flex-wrap: wrap;
  align-items: flex-end;
}

.rep-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.9rem;
}
.rep-table th {
  text-align: left;
  padding: var(--space-sm) var(--space-md);
  background: var(--bg);
  font-weight: 600;
  color: var(--text-secondary);
  border-bottom: 1px solid var(--border);
  font-size: 0.78rem;
  text-transform: uppercase;
  letter-spacing: 0.04em;
}
.rep-table td {
  padding: var(--space-sm) var(--space-md);
  border-bottom: 1px solid var(--border);
  vertical-align: middle;
}
.rep-row {
  cursor: pointer;
  transition: background-color 0.15s ease;
}
.rep-row:hover { background: var(--bg); }
.rep-row--expanded { background: var(--primary-light); }
.rep-row--expanded:hover { background: var(--primary-light); }
/* M1 · row atrasado sin side-stripe — usar background sutil + bullet */
.rep-row--atrasado { background: color-mix(in oklab, var(--warning) 8%, transparent); }
.rep-row--atrasado td:first-child::before { content: "▸ "; color: var(--warning); font-weight: 700; }

.rep-chevron {
  display: inline-block;
  width: 16px;
  transition: transform 0.2s ease;
  color: var(--text-muted);
  font-size: 0.72rem;
}
.rep-row--expanded .rep-chevron { transform: rotate(90deg); color: var(--primary); }

.rep-bar-td { min-width: 180px; }
.rep-bar {
  display: flex;
  height: 8px;
  width: 100%;
  background: var(--border);
  border-radius: 999px;
  overflow: hidden;
}
.rep-bar__seg { height: 100%; transition: width 0.3s ease; }
.rep-bar__seg--pendiente { background: var(--text-muted); }
.rep-bar__seg--gestion { background: var(--primary); }
.rep-bar__seg--completado { background: var(--success); }

.chip--antig-gt7 {
  background: var(--warning-light, rgba(234, 88, 12, 0.12));
  color: var(--warning, #ea580c);
  border-color: var(--warning, #ea580c);
}

@media (max-width: 768px) {
  .reportes-filtros { padding: var(--space-sm); }
  .reportes-filtros__row .form-group { flex-basis: 100%; }
  .rep-table { font-size: 0.82rem; }
  .rep-table th, .rep-table td { padding: 6px 8px; }
  .rep-bar-td { min-width: 120px; }
}

/* =========================================================
   Mis cargos — timeline cronológico desc en portal cliente
   ========================================================= */
.cargos-list {
  list-style: none;
  padding: 0;
  margin: 0;
  display: flex;
  flex-direction: column;
  gap: var(--space-sm);
}
.cargos-item {
  display: grid;
  grid-template-columns: 36px 1fr auto;
  gap: var(--space-md);
  align-items: center;
  padding: var(--space-md);
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
}
.cargos-item__icon {
  width: 36px; height: 36px; display: flex; align-items: center; justify-content: center;
  background: var(--bg-muted); border-radius: 50%; font-size: 1rem;
}
.cargos-item__body { min-width: 0; }
.cargos-item__top { display: flex; gap: var(--space-sm); align-items: center; flex-wrap: wrap; margin-bottom: 4px; }
.cargos-item__fecha { font-size: 0.78rem; color: var(--text-muted); font-family: var(--font-mono); }
.cargos-item__desc { font-size: 0.92rem; color: var(--text); }
.cargos-item__ref { font-size: 0.75rem; color: var(--text-muted); margin-top: 2px; font-family: var(--font-mono); }
.cargos-item__monto { display: flex; flex-direction: column; align-items: flex-end; gap: 4px; min-width: 110px; }
.cargos-item__monto strong { font-family: var(--font-mono); font-size: 1rem; color: var(--text); }
.cargos-item__monto small { font-size: 0.72rem; color: var(--text-muted); }
.kpi-card--primary { border-left-color: var(--primary); }
@media (max-width: 640px) {
  .cargos-item { grid-template-columns: 32px 1fr; }
  .cargos-item__monto { grid-column: 1 / -1; align-items: flex-start; flex-direction: row; flex-wrap: wrap; gap: var(--space-sm); }
}

/* =========================================================
   Skeleton loaders — sistema de carga uniforme
   Usar mientras se hidrata data async (KPIs, tablas, cards).
   Respeta prefers-reduced-motion automáticamente.
   ========================================================= */
.skeleton {
  display: block;
  background: linear-gradient(
    90deg,
    var(--bg-muted) 0%,
    rgba(255, 255, 255, 0.65) 50%,
    var(--bg-muted) 100%
  );
  background-size: 200% 100%;
  animation: skeleton-shimmer 1.4s ease-in-out infinite;
  border-radius: var(--radius-sm);
  color: transparent;
  user-select: none;
  pointer-events: none;
}
.skeleton-text { height: 0.9em; width: 100%; margin-bottom: var(--space-xs); }
.skeleton-text--sm { height: 0.7em; }
.skeleton-text--lg { height: 1.4em; }
.skeleton-text--w-25 { width: 25%; }
.skeleton-text--w-50 { width: 50%; }
.skeleton-text--w-75 { width: 75%; }
.skeleton-card {
  height: 96px;
  border-radius: var(--radius-lg);
}
.skeleton-row {
  height: 36px;
  border-radius: var(--radius-sm);
  margin-bottom: var(--space-sm);
}
.skeleton-circle {
  border-radius: 50%;
  width: 48px;
  height: 48px;
}
@keyframes skeleton-shimmer {
  0%   { background-position: 200% 0; }
  100% { background-position: -200% 0; }
}
@media (prefers-reduced-motion: reduce) {
  .skeleton { animation: none; }
}

/* =========================================================
   Gauge — visualización de score 0-100 reutilizable
   Variantes: --sm 40px, --md 72px, --lg 160px, --xl 320px
   Color automático según rango (verde/naranja/rojo).
   Composición: <div class="gauge gauge--lg gauge--ok">
                  <svg class="gauge__ring">…</svg>
                  <div class="gauge__label">
                    <strong>92</strong><small>/100</small>
                  </div>
                </div>
   ========================================================= */
.gauge {
  position: relative;
  display: inline-flex;
  flex-shrink: 0;
}
.gauge--sm { width: 40px;  height: 40px; }
.gauge--md { width: 72px;  height: 72px; }
.gauge--lg { width: 160px; height: 160px; }
.gauge--xl { width: 320px; height: 320px; }
.gauge__ring {
  width: 100%;
  height: 100%;
  transform: rotate(-90deg);
  transition: transform 220ms ease;
}
.gauge__ring-bg { fill: none; stroke: var(--bg-muted); }
.gauge__ring-fg {
  fill: none;
  stroke-linecap: round;
  transition: stroke-dashoffset 600ms cubic-bezier(0.4, 0, 0.2, 1),
              stroke 220ms ease;
}
.gauge--ok      .gauge__ring-fg { stroke: var(--status-ok); }
.gauge--warning .gauge__ring-fg { stroke: var(--status-30); }
.gauge--danger  .gauge__ring-fg { stroke: var(--status-vencido); }
.gauge__label {
  position: absolute;
  inset: 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  pointer-events: none;
  text-align: center;
  font-family: var(--font-mono);
  color: var(--text);
  line-height: 1;
}
.gauge__label strong { font-weight: 700; font-size: 1.6em; }
.gauge__label small  { font-weight: 500; font-size: 0.7em; color: var(--text-muted); margin-top: 2px; }
.gauge--sm .gauge__label strong { font-size: 0.95rem; }
.gauge--md .gauge__label strong { font-size: 1.4rem; }
.gauge--lg .gauge__label strong { font-size: 3rem; }
.gauge--xl .gauge__label strong { font-size: 6rem; }
.gauge--lg .gauge__label small,
.gauge--xl .gauge__label small { font-size: 0.85rem; margin-top: var(--space-xs); }
@media (prefers-reduced-motion: reduce) {
  .gauge__ring { transition: none; }
  .gauge__ring-fg { transition: stroke 220ms ease; }
}

/* =========================================================
   Cotizador wizard · modo asistido (paso a paso)
   ========================================================= */
.cotz-paso-step {
  padding: 6px 14px;
  border-radius: 999px;
  background: var(--bg-muted, #f1f5f9);
  color: var(--text-muted, #64748b);
  font-weight: 600;
  font-size: 0.9rem;
}
.cotz-paso-step--active {
  background: var(--primary, #2563eb);
  color: #fff;
}
.cotz-paso-step--done {
  background: var(--accent-delivered, #22c55e);
  color: #fff;
}
/* En modo asistido, mostrar solo el paso activo */
.modal--cotizador.modo-asistido [data-cotz-paso] { display: none; }
.modal--cotizador.modo-asistido [data-cotz-paso].cotz-paso--activo { display: block; }
/* En modo experto, todos visibles (default) */

/* =========================================================
   Modo de tabla · simple vs. detallada (senior-friendly)
   En modo "simple", oculta columnas secundarias (checkbox,
   días, gestión, responsable, último aviso) para que el
   operador vea solo lo importante.
   ========================================================= */
.modo-tabla-toggle {
  display: inline-flex;
  background: var(--bg-muted, #f1f5f9);
  border-radius: var(--radius-md);
  padding: 2px;
  gap: 2px;
}
.modo-tabla-toggle .filter-btn {
  border: none;
  background: transparent;
  font-size: 0.85rem;
  padding: 6px 12px;
}
.modo-tabla-toggle .filter-btn--active {
  background: var(--surface);
  box-shadow: 0 1px 3px rgba(0,0,0,0.08);
  color: var(--primary);
}

/* Vista simple: oculta columnas secundarias en tabla del panel.
   Columnas reales (post simplificación): 1·check 2·patente 3·empresa 4·tipo
   5·trámite 6·vencimiento 7·situación 8·responsable 9·último aviso */
#tabla-wrapper.modo-simple table .th-check,
#tabla-wrapper.modo-simple table tbody td:nth-child(1)  /* checkbox */,
#tabla-wrapper.modo-simple table thead th:nth-child(8)  /* responsable */,
#tabla-wrapper.modo-simple table tbody td:nth-child(8),
#tabla-wrapper.modo-simple table thead th:nth-child(9)  /* último aviso */,
#tabla-wrapper.modo-simple table tbody td:nth-child(9) {
  display: none;
}
#tabla-wrapper.modo-simple table {
  font-size: 1rem;
}
#tabla-wrapper.modo-simple table tbody td {
  padding-top: 14px;
  padding-bottom: 14px;
}

/* =========================================================
   Help FAB · botón flotante de ayuda WhatsApp (senior-friendly)
   Aparece en bottom-right en panel/solicitudes/cotizador.
   ========================================================= */
.help-fab {
  position: fixed;
  right: 24px;
  bottom: 24px;
  display: inline-flex;
  align-items: center;
  gap: 10px;
  padding: 14px 20px;
  background: #25d366;
  color: #fff;
  font-weight: 700;
  font-size: 0.98rem;
  text-decoration: none;
  border-radius: 999px;
  box-shadow: 0 4px 14px rgba(37, 211, 102, 0.45);
  z-index: 999;
  transition: transform 180ms ease, box-shadow 180ms ease;
}
.help-fab:hover {
  transform: translateY(-2px);
  box-shadow: 0 6px 20px rgba(37, 211, 102, 0.55);
}
.help-fab__icon { font-size: 1.4rem; line-height: 1; }
@media (max-width: 640px) {
  .help-fab { padding: 12px 14px; right: 16px; bottom: 16px; }
  .help-fab__label { display: none; }     /* solo ícono en mobile */
}

/* =========================================================
   Banner full-width — confirmaciones post-acción (senior-friendly)
   Reemplaza al Toast pequeño. Aparece debajo del header.
   ========================================================= */
.banner-fullwidth {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  display: flex;
  align-items: center;
  gap: var(--space-md);
  padding: var(--space-md) var(--space-xl);
  font-size: 1.05rem;
  font-weight: 600;
  color: #fff;
  background: var(--accent-delivered, #22c55e);
  box-shadow: 0 2px 8px rgba(0,0,0,0.12);
  transform: translateY(-100%);
  transition: transform 220ms ease;
  z-index: 10000;
}
.banner-fullwidth--visible { transform: translateY(0); }
.banner-fullwidth--error { background: #dc2626; }
.banner-fullwidth--warning { background: #f59e0b; color: #1f2937; }
.banner-fullwidth--info { background: var(--primary, #2563eb); }
.banner-fullwidth__icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 32px;
  height: 32px;
  border-radius: 50%;
  background: rgba(255,255,255,0.25);
  font-size: 1.1rem;
  font-weight: 700;
  flex-shrink: 0;
}
.banner-fullwidth__msg { flex: 1; line-height: 1.45; }
.banner-fullwidth__close {
  background: transparent;
  color: inherit;
  border: none;
  font-size: 1.6rem;
  cursor: pointer;
  padding: 0 8px;
  opacity: 0.85;
}
.banner-fullwidth__close:hover { opacity: 1; }
@media (max-width: 640px) {
  .banner-fullwidth { padding: var(--space-sm) var(--space-md); font-size: 0.95rem; }
  .banner-fullwidth__icon { width: 26px; height: 26px; }
}

/* =========================================================
   BANNERS · /impeccable · sistema unificado
   Variantes: --info / --primary / --tracking / --warning / --danger
   Estructura: ícono · mensaje · acción
   ========================================================= */
.banner {
  display: flex;
  align-items: center;
  gap: var(--space-md);
  padding: 12px 16px;
  border-radius: var(--radius-md);
  border: 1px solid var(--border);
  background: var(--surface);
  margin-bottom: var(--space-md);
  font-size: 0.92rem;
  line-height: var(--lh-snug);
  box-shadow: var(--shadow-xs);
  transition: box-shadow var(--duration-base) var(--ease-standard);
}
.banner:hover { box-shadow: var(--shadow-sm); }

.banner__icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  width: 36px;
  height: 36px;
  border-radius: var(--radius-full);
  background: var(--neutral-100);
  font-size: 1rem;
  line-height: 1;
}
.banner__msg {
  flex: 1;
  min-width: 0;
  color: var(--text-secondary);
}
.banner__msg strong {
  color: var(--text-primary);
  font-weight: var(--fw-semibold);
}
.banner__action {
  flex-shrink: 0;
}

/* Variantes con borde-izquierdo de color (no fondo saturado) */
.banner--primary {
  border-left: 4px solid var(--primary-600);
  background: linear-gradient(90deg, var(--primary-50) 0%, var(--surface) 60%);
}
.banner--primary .banner__icon { background: var(--primary-100); color: var(--primary-700); }
.banner--primary .banner__msg strong { color: var(--primary-900); }

.banner--info {
  border-left: 4px solid var(--primary-500);
  background: linear-gradient(90deg, var(--primary-50) 0%, var(--surface) 60%);
}
.banner--info .banner__icon { background: var(--primary-100); color: var(--primary-700); }

.banner--tracking {
  border-left: 4px solid var(--accent-tracking);
  background: linear-gradient(90deg, var(--accent-tracking-bg) 0%, var(--surface) 60%);
}
.banner--tracking .banner__icon { background: var(--accent-tracking-bg); color: var(--accent-tracking); }
.banner--tracking .banner__msg strong { color: var(--accent-tracking); }

.banner--warning {
  border-left: 4px solid var(--warning);
  background: linear-gradient(90deg, var(--warning-bg) 0%, var(--surface) 60%);
}
.banner--warning .banner__icon { background: var(--warning-bg); color: var(--warning); }
.banner--warning .banner__msg strong { color: var(--warning); }

.banner--danger {
  border-left: 4px solid var(--danger);
  background: linear-gradient(90deg, var(--danger-bg) 0%, var(--surface) 60%);
}
.banner--danger .banner__icon { background: var(--danger-bg); color: var(--danger); }
.banner--danger .banner__msg strong { color: var(--danger); }

@media (max-width: 640px) {
  .banner { flex-wrap: wrap; }
  .banner__icon { width: 32px; height: 32px; }
  .banner__action { width: 100%; margin-top: 6px; }
}

/* =========================================================
   ACTION TILES · 3 acciones gigantes en /panel.html
   /impeccable: gradient sutil top→primary on hover, ícono
   con halo, transition refinada.
   ========================================================= */
.action-tiles { display: grid; }

.action-tile {
  position: relative;
  cursor: pointer;
  overflow: hidden;
  transition: transform var(--duration-base) var(--ease-standard),
              box-shadow var(--duration-base) var(--ease-standard),
              border-color var(--duration-base) var(--ease-standard);
  border-radius: var(--radius-lg) !important;
  background: var(--surface) !important;
}
.action-tile::before {
  content: "";
  position: absolute;
  inset: 0;
  background: linear-gradient(135deg, var(--primary-50) 0%, transparent 60%);
  opacity: 0;
  transition: opacity var(--duration-base) var(--ease-standard);
  pointer-events: none;
}
.action-tile:hover {
  transform: translateY(-3px);
  box-shadow: var(--shadow-md);
  border-color: var(--primary-600) !important;
}
.action-tile:hover::before { opacity: 1; }
.action-tile:active { transform: translateY(-1px); }
.action-tile:focus-visible {
  outline: 3px solid var(--primary-ring);
  outline-offset: 3px;
}
.action-tile > * { position: relative; z-index: 1; }

/* =========================================================
   Stepper — usado en /estado.html y /registro.html
   ========================================================= */
.stepper {
  list-style: none;
  padding: 0;
  margin: 0;
  display: grid;
  grid-template-columns: repeat(6, minmax(0, 1fr));
  gap: 0;
}
.stepper__step {
  position: relative;
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  padding: 0 var(--space-xs);
}
.stepper__circle {
  width: 36px;
  height: 36px;
  border-radius: 50%;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-weight: 700;
  font-size: 0.95rem;
  background: var(--bg-muted, #f1f5f9);
  color: var(--text-muted, #64748b);
  border: 2px solid var(--border, #e2e8f0);
  z-index: 2;
  transition: all 200ms ease;
}
.stepper__line {
  position: absolute;
  top: 18px;
  left: 50%;
  width: 100%;
  height: 2px;
  background: var(--border, #e2e8f0);
  z-index: 1;
}
.stepper__body {
  margin-top: var(--space-xs);
  min-height: 48px;
}
.stepper__label {
  font-weight: 600;
  font-size: 0.85rem;
  color: var(--text, #0f172a);
  line-height: 1.25;
}
.stepper__desc {
  font-size: 0.74rem;
  color: var(--text-muted, #64748b);
  line-height: 1.3;
  margin-top: 2px;
}

/* Estado: completado */
.stepper__step--completado .stepper__circle {
  background: var(--accent-delivered, #22c55e);
  color: #fff;
  border-color: var(--accent-delivered, #22c55e);
}
.stepper__step--completado .stepper__line {
  background: var(--accent-delivered, #22c55e);
}

/* Estado: actual (en curso) */
.stepper__step--actual .stepper__circle {
  background: var(--primary, #2563eb);
  color: #fff;
  border-color: var(--primary, #2563eb);
  box-shadow: 0 0 0 4px var(--primary-ring, rgba(37, 99, 235, 0.12));
  animation: stepper-pulse 1.6s ease-in-out infinite;
}
.stepper__step--actual .stepper__label { color: var(--primary, #2563eb); }

@keyframes stepper-pulse {
  0%, 100% { box-shadow: 0 0 0 4px var(--primary-ring, rgba(37, 99, 235, 0.12)); }
  50%      { box-shadow: 0 0 0 8px var(--primary-ring, rgba(37, 99, 235, 0.18)); }
}

/* Estado: saltado (cotización opcional sin usar) */
.stepper__step--saltado .stepper__circle {
  background: #fff;
  color: var(--text-muted, #94a3b8);
  border-style: dashed;
}
.stepper__step--saltado .stepper__label { color: var(--text-muted, #94a3b8); }

/* Estado: cancelado / revocado */
.stepper__step--cancelado .stepper__circle {
  background: #fef2f2;
  color: #b91c1c;
  border-color: #fecaca;
}
.stepper__step--expirado .stepper__circle {
  background: #fff7ed;
  color: #c2410c;
  border-color: #fed7aa;
}

@media (max-width: 720px) {
  .stepper {
    grid-template-columns: 1fr;
    gap: var(--space-md);
  }
  .stepper__step {
    flex-direction: row;
    align-items: flex-start;
    text-align: left;
    gap: var(--space-md);
    padding: 0;
  }
  .stepper__line {
    top: 36px;
    left: 18px;
    width: 2px;
    height: 100%;
  }
  .stepper__body { margin-top: 0; min-height: 0; }
  .stepper__circle { flex-shrink: 0; }
}
@media (prefers-reduced-motion: reduce) {
  .stepper__step--actual .stepper__circle { animation: none; }
}

/* =========================================================
   IMPECCABLE · detalles finos del sistema (post /impeccable)
   ========================================================= */

/* Selection color — toque de marca */
::selection {
  background: var(--primary-100);
  color: var(--primary-900);
}
::-moz-selection {
  background: var(--primary-100);
  color: var(--primary-900);
}

/* Scrollbar refinado (Chrome/Safari/Edge) */
* {
  scrollbar-width: thin;
  scrollbar-color: var(--neutral-300) transparent;
}
*::-webkit-scrollbar { width: 10px; height: 10px; }
*::-webkit-scrollbar-track { background: transparent; }
*::-webkit-scrollbar-thumb {
  background: var(--neutral-300);
  border-radius: var(--radius-full);
  border: 2px solid transparent;
  background-clip: padding-box;
}
*::-webkit-scrollbar-thumb:hover { background: var(--neutral-400); background-clip: padding-box; }

/* Focus visible global · accesibilidad */
:focus-visible {
  outline: 3px solid var(--primary-ring);
  outline-offset: 2px;
  border-radius: var(--radius-sm);
}
button:focus-visible,
a:focus-visible {
  outline-offset: 3px;
}

/* Links · subrayado refinado, hover suave */
a {
  color: var(--primary-600);
  text-decoration: none;
  transition: color var(--duration-fast) var(--ease-standard);
}
/* No tocar el color en hover de anchors que están actuando como botón —
   el .btn--primary tiene fondo oscuro y texto blanco; el a:hover lo pisaba
   y dejaba texto azul sobre fondo azul (invisible). */
a:hover:not(.btn) { color: var(--primary-700); }
a.underline,
a:not([class]) {
  text-decoration: underline;
  text-decoration-color: var(--primary-200);
  text-underline-offset: 2px;
  transition: text-decoration-color var(--duration-fast) var(--ease-standard);
}
a.underline:hover,
a:not([class]):hover { text-decoration-color: var(--primary-600); }

/* Tablas · hover row sutil + zebra opcional */
table { border-collapse: collapse; width: 100%; }
table thead th {
  font-size: 0.78rem;
  font-weight: var(--fw-semibold);
  text-transform: uppercase;
  letter-spacing: var(--tracking-wide);
  color: var(--text-muted);
  text-align: left;
  padding: 10px 12px;
  border-bottom: 1px solid var(--border);
  background: var(--neutral-50);
}
table tbody td {
  padding: 12px;
  border-bottom: 1px solid var(--border);
  font-size: 0.92rem;
  color: var(--text);
}
table tbody tr {
  transition: background var(--duration-fast) var(--ease-standard);
}
table tbody tr:hover {
  background: var(--neutral-50);
}
table tbody tr:last-child td { border-bottom: none; }

/* Skip-target visual subtle highlight on linked-to elements */
*:target {
  scroll-margin-top: 80px;
}

/* Img defaults · evitar layout shift */
img { max-width: 100%; height: auto; display: block; }

/* Imprime-friendly */
@media print {
  .header, .nav-toggle, .btn, .help-fab, .banner-fullwidth { display: none !important; }
  body { background: white !important; }
  * { box-shadow: none !important; }
}

/* =========================================================
   COTIZADOR · sección "Solicitudes esperando cotización"
   Aparece en /cotizador.html arriba de los KPIs cuando hay leads
   sin cotización vinculada todavía.
   ========================================================= */
.cotz-pendientes-card {
  background: linear-gradient(180deg, #eff6ff 0%, #ffffff 100%);
  border: 1px solid var(--primary, #2563eb);
  border-radius: var(--radius-lg);
  padding: var(--space-md) var(--space-lg);
  box-shadow: var(--shadow-sm);
}
.cotz-pendientes-card__header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: var(--space-md);
  margin-bottom: var(--space-md);
  flex-wrap: wrap;
}
.cotz-pendientes-card__title {
  margin: 0 0 4px;
  font-size: 1.1rem;
  color: var(--primary, #2563eb);
  font-weight: 700;
}
.cotz-pendientes-card__sub {
  margin: 0;
  font-size: 0.85rem;
  color: var(--text-muted);
}
.cotz-pendientes-card__list {
  display: flex;
  flex-direction: column;
  gap: 4px;
}
.cotz-pendiente {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--space-md);
  padding: 10px 12px;
  background: var(--surface);
  border-radius: var(--radius-md);
  border: 1px solid var(--border);
  transition: border-color var(--duration-fast) var(--ease-standard), transform var(--duration-fast) var(--ease-standard);
}
.cotz-pendiente:hover {
  border-color: var(--primary);
  transform: translateX(2px);
}
.cotz-pendiente__info {
  flex: 1;
  min-width: 0;
}
.cotz-pendiente__nombre {
  font-weight: 600;
  font-size: 0.95rem;
  color: var(--text-primary, #0f172a);
  text-transform: capitalize;
}
.cotz-pendiente__empresa {
  font-size: 0.85rem;
  color: var(--text-secondary, #475569);
  text-transform: capitalize;
}
.cotz-pendiente__meta {
  font-size: 0.78rem;
  color: var(--text-muted);
}
.cotz-pendientes-card__more {
  margin-top: var(--space-sm);
  text-align: right;
  font-size: 0.82rem;
}
.cotz-pendientes-card__more a {
  color: var(--primary);
  text-decoration: none;
}
.cotz-pendientes-card__more a:hover { text-decoration: underline; }

/* =========================================================
   SOLICITUDES · grid moderna (rediseño post feedback "grilla fea")
   Reemplaza la tabla de 10 columnas (con fechas que rompían en 5 líneas)
   por una grilla CSS de 5 columnas con jerarquía interna en cada celda.
   ========================================================= */
.solicitudes-grid {
  display: flex;
  flex-direction: column;
  gap: 0;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  overflow: hidden;
  box-shadow: var(--shadow-xs);
}

.sol-card {
  display: grid;
  grid-template-columns:
    minmax(200px, 1.3fr)   /* Solicitante */
    minmax(180px, 1.4fr)   /* Empresa · Asunto */
    minmax(130px, 0.9fr)   /* Estado · Tipo · Fase */
    minmax(140px, 1fr)     /* Cotización */
    minmax(180px, auto);   /* Acciones */
  gap: var(--space-md);
  padding: var(--space-md) var(--space-lg);
  border-bottom: 1px solid var(--border);
  align-items: start;
  cursor: pointer;
  transition: background var(--duration-fast) var(--ease-standard);
  position: relative;
}
.sol-card:last-child { border-bottom: none; }
.sol-card:hover { background: var(--neutral-50); }

/* Borde lateral por estado del lead — señal visual rápida */
.sol-card::before {
  content: "";
  position: absolute;
  left: 0; top: 0; bottom: 0;
  width: 3px;
  background: var(--neutral-200);
}
.sol-card[data-estado="nuevo"]::before      { background: var(--status-30, #d97706); }
.sol-card[data-estado="contactado"]::before { background: var(--primary, #2563eb); }
.sol-card[data-estado="cerrado"]::before    { background: var(--neutral-300, #cbd5e1); }

.sol-card__col {
  display: flex;
  flex-direction: column;
  gap: 4px;
  min-width: 0; /* permite truncate */
}

/* Col 1: Solicitante */
.sol-card__nombre {
  font-weight: 600;
  font-size: 0.95rem;
  color: var(--text-primary, #0f172a);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  text-transform: capitalize;
}
.sol-card__email {
  font-size: 0.82rem;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.sol-card__email a {
  color: var(--text-muted);
  text-decoration: none;
}
.sol-card__email a:hover { color: var(--primary); text-decoration: underline; }
.sol-card__meta {
  font-size: 0.74rem;
  color: var(--text-muted);
  letter-spacing: 0.01em;
}

/* Col 2: Empresa · Asunto */
.sol-card__empresa {
  font-weight: 600;
  font-size: 0.92rem;
  color: var(--text-primary, #0f172a);
  text-transform: capitalize;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.sol-card__asunto {
  font-size: 0.82rem;
  color: var(--text-muted);
}

/* Col 3: Estado · Tipo · Fase */
.sol-card__col--estado { gap: 6px; }
.sol-card__estado-meta {
  font-size: 0.78rem;
}

/* Col 4: Cotización */
.sol-card__col--cotizacion { justify-content: center; }
.sol-card__empty {
  color: var(--text-muted);
  font-size: 0.82rem;
  font-style: italic;
}
.sol-card__cotz {
  display: flex;
  flex-direction: column;
  gap: 2px;
}
.sol-card__cotz-link {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  text-decoration: none;
  color: inherit;
  flex-wrap: wrap;
}
.sol-card__cotz-link:hover .sol-card__cotz-folio { text-decoration: underline; }
.sol-card__cotz-folio {
  font-size: 0.82rem;
  font-weight: 600;
  color: var(--primary);
  font-family: var(--font-mono, monospace);
}
.sol-card__cotz-estado {
  display: inline-block;
  padding: 1px 8px;
  border-radius: 999px;
  font-size: 0.7rem;
  font-weight: 600;
  text-transform: capitalize;
  white-space: nowrap;
}
.sol-card__cotz-meta {
  font-size: 0.72rem;
  color: var(--text-muted);
  letter-spacing: 0.01em;
}
/* Monto del plan · más prominente · sin abrir el cotizador */
.sol-card__cotz-monto {
  font-size: 0.95rem;
  font-weight: 700;
  color: var(--text);
  margin-top: 4px;
}
/* Indicador de espera del cliente · 3 niveles según días sin respuesta */
.sol-card__cotz-meta--warn {
  color: #b45309;
  font-weight: 600;
  background: #fef3c7;
  border: 1px solid #fcd34d;
  border-radius: 4px;
  padding: 2px 6px;
  display: inline-block;
}
.sol-card__cotz-meta--urgent {
  color: #b91c1c;
  font-weight: 600;
  background: #fee2e2;
  border: 1px solid #fca5a5;
  border-radius: 4px;
  padding: 2px 6px;
  display: inline-block;
}

/* Col 5: Pipeline + botón primario + menú secundario · stack vertical */
.sol-card__col--acciones {
  flex-direction: column;
  align-items: flex-end;
  justify-content: center;
  gap: 8px;
}
.sol-card__action-row {
  display: flex;
  align-items: center;
  gap: 6px;
  flex-wrap: wrap;
  justify-content: flex-end;
}

/* ----------------------------------------------------------------
   Pipeline horizontal · 5 pasos guiados del flujo comercial
   Lead → Cotizar → Enviar → Aceptar → Habilitar
   ---------------------------------------------------------------- */
.sol-pipeline {
  display: inline-flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 4px;
  font-size: 0.72rem;
  line-height: 1;
}
.sol-pipeline__step {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 3px 6px;
  border-radius: var(--radius-sm);
  white-space: nowrap;
  border: 1px solid transparent;
}
.sol-pipeline__dot {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 16px;
  height: 16px;
  border-radius: 50%;
  background: var(--neutral-200);
  color: var(--text-muted);
  font-weight: 700;
  font-size: 0.65rem;
  flex-shrink: 0;
}
.sol-pipeline__label {
  color: var(--text-muted);
  font-weight: 500;
}
.sol-pipeline__step--done .sol-pipeline__dot {
  background: var(--status-ok, #059669);
  color: #fff;
}
.sol-pipeline__step--done .sol-pipeline__label { color: var(--status-ok, #059669); }
.sol-pipeline__step--active .sol-pipeline__dot {
  background: var(--primary, #2563eb);
  color: #fff;
  box-shadow: 0 0 0 3px var(--primary-ring, rgba(37,99,235,0.2));
  animation: sol-pipeline-pulse 1.6s ease-in-out infinite;
}
.sol-pipeline__step--active .sol-pipeline__label {
  color: var(--primary, #2563eb);
  font-weight: 700;
}
.sol-pipeline__arrow {
  color: var(--neutral-300, #cbd5e1);
  font-size: 0.7rem;
  margin: 0 2px;
}
.sol-pipeline__folio {
  display: inline-flex;
  align-items: center;
  padding: 2px 6px;
  background: var(--primary-light, #eff6ff);
  border-radius: var(--radius-sm);
  border: 1px solid var(--primary, #2563eb);
}
.sol-pipeline__folio code {
  font-size: 0.7rem;
  color: var(--primary, #2563eb);
  font-weight: 600;
  font-family: var(--font-mono, monospace);
}
.sol-pipeline__terminal {
  font-size: 0.78rem;
  font-weight: 600;
  color: var(--text-muted);
  padding: 4px 8px;
  margin-top: 4px;
}
@keyframes sol-pipeline-pulse {
  0%, 100% { box-shadow: 0 0 0 3px var(--primary-ring, rgba(37,99,235,0.25)); }
  50%      { box-shadow: 0 0 0 5px rgba(37,99,235,0.10); }
}

/* Preview del mensaje del cliente · debajo del teléfono en col Empresa.
   Se trunca a 80 chars con "…" · tooltip al hover muestra el texto completo.
   El detalle completo se ve clickeando la card o el menú ⋯ → Ver detalle. */
.sol-card__mensaje-preview {
  margin-top: 6px;
  padding: 6px 8px;
  background: var(--bg-muted, #f8fafc);
  border-left: 2px solid var(--primary, #2563eb);
  border-radius: 0 4px 4px 0;
  font-size: 0.78rem;
  color: var(--text-secondary, #475569);
  line-height: 1.4;
  cursor: help;
  /* Truncar visualmente si por algún motivo el truncarTexto JS no alcanza */
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

/* Menú "..." de acciones secundarias */
.sol-card__menu {
  position: relative;
  display: inline-flex;
}
.sol-card__menu-btn {
  padding: 6px 10px;
  font-size: 1.1rem;
  line-height: 1;
  color: var(--text-muted);
  letter-spacing: 0.1em;
}
.sol-card__menu-btn:hover { color: var(--primary); }
.sol-card__menu-list {
  position: absolute;
  top: calc(100% + 4px);
  right: 0;
  z-index: 200;                /* sobre el banner sticky y otras cards */
  min-width: 240px;
  max-width: 320px;            /* limite para que no se haga gigante */
  max-height: calc(100vh - 100px);
  overflow-y: auto;            /* scroll interno si tiene muchas opciones */
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  box-shadow: var(--shadow-lg);
  padding: 4px;
  display: none;
}
.sol-card__menu--abierto .sol-card__menu-list { display: block; }

/* Variante: abre hacia ARRIBA cuando no hay espacio debajo del botón
   (típicamente la última card visible en el listado). El JS añade
   .sol-card__menu--up al medir el viewport en toggleMenuFila(). */
.sol-card__menu--up .sol-card__menu-list {
  top: auto;
  bottom: calc(100% + 4px);
}
.sol-card__menu-item {
  display: block;
  width: 100%;
  text-align: left;
  background: transparent;
  border: 0;
  padding: 8px 12px;
  font-size: 0.86rem;
  color: var(--text-primary, #0f172a);
  border-radius: var(--radius-sm);
  cursor: pointer;
  white-space: nowrap;          /* labels en una sola linea */
  overflow: hidden;
  text-overflow: ellipsis;      /* '...' si igual desborda */
  transition: background var(--duration-fast) var(--ease-standard);
}
.sol-card__menu-item:hover { background: var(--neutral-100); }

/* Mobile · stack vertical · sin truncate por nombre/empresa */
@media (max-width: 900px) {
  .sol-card {
    grid-template-columns: 1fr 1fr;
    grid-template-areas:
      "sol  estado"
      "emp  cotz"
      "acc  acc";
    padding: var(--space-md);
  }
  .sol-card__col--solicitante { grid-area: sol; }
  .sol-card__col--empresa     { grid-area: emp; }
  .sol-card__col--estado      { grid-area: estado; align-items: flex-end; }
  .sol-card__col--cotizacion  { grid-area: cotz; align-items: flex-end; }
  .sol-card__col--acciones    { grid-area: acc; justify-content: stretch; border-top: 1px dashed var(--border); padding-top: 10px; margin-top: 6px; }
}

@media (max-width: 480px) {
  .sol-card {
    grid-template-columns: 1fr;
    grid-template-areas:
      "sol"
      "emp"
      "estado"
      "cotz"
      "acc";
  }
  .sol-card__col--estado, .sol-card__col--cotizacion { align-items: flex-start; }
}

/* =========================================================
   CARRITO DE COTIZACIÓN DE SERVICIO (mig 050)
   Portal cliente · barra flotante + modal pedido + Mis pedidos
   ========================================================= */

/* Checkbox al inicio de cada fila de trámite en la card */
.tramite-check {
  width: 18px;
  height: 18px;
  flex-shrink: 0;
  cursor: pointer;
  accent-color: var(--primary);
  margin: 0;
}
.tramite-check-spacer {
  width: 18px;
  height: 18px;
  flex-shrink: 0;
  display: inline-block;
}

/* Chip Renovar inline (siguiente al checkbox) */
.chip-renovar {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  background: #fef3c7;
  color: #92400e;
  border: 1px solid #fde68a;
  border-radius: 999px;
  font-size: 0.75rem;
  font-weight: 600;
  padding: 3px 10px;
  cursor: pointer;
  transition: background-color 160ms, transform 160ms;
  white-space: nowrap;
}
.chip-renovar:hover {
  background: #fde68a;
  transform: scale(1.03);
}

/* Barra flotante del carrito */
.carrito-flotante {
  position: fixed;
  left: 50%;
  bottom: 18px;
  transform: translateX(-50%);
  background: var(--primary);
  color: #fff;
  padding: 12px 18px;
  border-radius: 999px;
  box-shadow: 0 12px 28px rgba(37, 99, 235, 0.35);
  display: flex;
  align-items: center;
  gap: 16px;
  z-index: 900;
  font-size: 0.95rem;
  max-width: calc(100vw - 24px);
  flex-wrap: wrap;
  animation: carrito-pop-in 220ms ease-out;
}
@keyframes carrito-pop-in {
  from { transform: translate(-50%, 30px); opacity: 0; }
  to   { transform: translate(-50%, 0);    opacity: 1; }
}
.carrito-flotante__info {
  display: inline-flex;
  align-items: baseline;
  gap: 6px;
}
.carrito-flotante__actions {
  display: inline-flex;
  align-items: center;
  gap: 8px;
}
.carrito-flotante .btn--ghost {
  background: transparent;
  color: rgba(255,255,255,0.9);
  border: 1px solid rgba(255,255,255,0.4);
}
.carrito-flotante .btn--ghost:hover {
  background: rgba(255,255,255,0.12);
}

/* Items dentro del modal "Mi pedido" */
.pedido-item {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 10px 12px;
  background: #f8fafc;
  border: 1px solid var(--border);
  border-radius: 6px;
  font-size: 0.92rem;
}
.pedido-item__info { flex: 1; min-width: 0; }
.pedido-item__remove {
  background: none;
  border: none;
  color: #b91c1c;
  font-size: 1.4rem;
  line-height: 1;
  width: 28px;
  height: 28px;
  cursor: pointer;
  border-radius: 50%;
  display: inline-flex;
  align-items: center;
  justify-content: center;
}
.pedido-item__remove:hover { background: #fee2e2; }

/* Badge numérico en sidebar (Mis pedidos) */
.badge-num {
  display: inline-block;
  background: #dc2626;
  color: #fff;
  border-radius: 999px;
  padding: 1px 7px;
  font-size: 0.72rem;
  font-weight: 700;
  margin-left: 4px;
  min-width: 18px;
  text-align: center;
}

/* Pedido cards (listado en sección "Mis pedidos") */
.pedido-card {
  background: #fff;
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: var(--space-md);
  margin-bottom: var(--space-sm);
  transition: box-shadow 160ms;
}
.pedido-card:hover { box-shadow: 0 4px 14px rgba(0,0,0,0.06); }
.pedido-card__head {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 12px;
  margin-bottom: var(--space-sm);
}
.pedido-card__folio {
  font-family: var(--font-mono);
  font-weight: 700;
  font-size: 1rem;
}
.pedido-card__fecha { color: var(--text-muted); font-size: 0.82rem; margin-top: 2px; }
.pedido-card__badge {
  display: inline-block;
  padding: 3px 10px;
  border-radius: 999px;
  font-size: 0.78rem;
  font-weight: 600;
  white-space: nowrap;
}
.pedido-card__body {
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
  gap: 8px;
}
.pedido-card__total {
  font-family: var(--font-mono);
  font-weight: 600;
  font-size: 1.05rem;
}

/* Utility · texto solo para lectores de pantalla (WCAG 1.3.1) */
.visually-hidden {
  position: absolute !important;
  width: 1px !important;
  height: 1px !important;
  padding: 0 !important;
  margin: -1px !important;
  overflow: hidden !important;
  clip: rect(0, 0, 0, 0) !important;
  white-space: nowrap !important;
  border: 0 !important;
}

/* =========================================================
   ACCESIBILIDAD · focus-visible baseline global (WCAG 2.1 AA)
   Garantiza outline visible al navegar con teclado en CUALQUIER
   elemento interactivo. Los componentes específicos pueden tener
   su propio :focus-visible (botones, modal close, etc.) que pisan
   este default cuando aplique.
   ========================================================= */
a:focus-visible,
button:focus-visible,
[role="button"]:focus-visible,
[tabindex]:focus-visible {
  outline: 2px solid var(--primary, #2563eb);
  outline-offset: 2px;
  border-radius: 4px;
}
/* Skip-to-content link · accesibilidad navegación teclado */
.skip-to-content {
  position: absolute;
  top: -40px;
  left: 0;
  background: var(--primary, #2563eb);
  color: #fff;
  padding: 8px 16px;
  z-index: 10000;
  text-decoration: none;
  font-weight: 600;
  transition: top 150ms ease;
}
.skip-to-content:focus { top: 0; }

/* Estados del pedido (badges) — colores semánticos */
.pedido-badge--borrador  { background: #f1f5f9; color: #475569; }
.pedido-badge--enviada   { background: #dbeafe; color: #1d4ed8; }
.pedido-badge--aceptada  { background: #dcfce7; color: #15803d; }
.pedido-badge--rechazada { background: #fee2e2; color: #b91c1c; }
.pedido-badge--vencida   { background: #fef3c7; color: #92400e; }

/* Progress tracker de la cotización (modal cliente) */
.cot-tracker {
  display: flex;
  align-items: center;
  gap: 4px;
  padding: var(--space-md) 0;
  flex-wrap: wrap;
}
.cot-tracker__step {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 4px;
  min-width: 70px;
  text-align: center;
}
.cot-tracker__dot {
  width: 28px;
  height: 28px;
  border-radius: 50%;
  background: #e5e7eb;
  color: #6b7280;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: 0.85rem;
  font-weight: 700;
  transition: background 200ms, color 200ms;
}
.cot-tracker__label {
  font-size: 0.72rem;
  color: var(--text-muted);
  font-weight: 500;
  line-height: 1.2;
}
.cot-tracker__step--done .cot-tracker__dot {
  background: var(--status-ok, #16a34a);
  color: #fff;
}
.cot-tracker__step--done .cot-tracker__label { color: var(--text-secondary); }
.cot-tracker__step--active .cot-tracker__dot {
  background: var(--primary, #2563eb);
  color: #fff;
  box-shadow: 0 0 0 4px rgba(37, 99, 235, 0.18);
}
.cot-tracker__step--active .cot-tracker__label {
  color: var(--primary, #2563eb);
  font-weight: 600;
}
.cot-tracker__line {
  flex: 1;
  height: 3px;
  background: #e5e7eb;
  border-radius: 2px;
  min-width: 16px;
  margin-top: -16px; /* alinea con los dots, no con los labels */
}
.cot-tracker__line--done { background: var(--status-ok, #16a34a); }
.cot-tracker--terminal {
  justify-content: center;
}
.cot-tracker__terminal {
  display: inline-block;
  padding: 8px 16px;
  background: #fee2e2;
  color: #991b1b;
  border-radius: 999px;
  font-weight: 600;
  font-size: 0.95rem;
}

/* Sección "Renovaciones próximas por cliente" (panel Marta) */
.renov-bloque {
  background: #fffbeb;
  border: 1px solid #fde68a;
  border-radius: 8px;
  padding: var(--space-md);
}
.renov-bloque__header {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-bottom: var(--space-sm);
  flex-wrap: wrap;
}
.renov-bloque__icon { font-size: 1.2rem; }
.renov-bloque__count {
  color: var(--text-secondary);
  font-size: 0.85rem;
  font-weight: 400;
}
.renov-bloque__list {
  list-style: none;
  padding: 0;
  margin: 0;
  display: flex;
  flex-direction: column;
  gap: 6px;
}
.renov-bloque__item {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 8px 12px;
  background: #fff;
  border: 1px solid #fde68a;
  border-radius: 6px;
  gap: 12px;
  flex-wrap: wrap;
}
.renov-bloque__nombre { font-weight: 600; }
.renov-bloque__detalles { font-size: 0.82rem; color: var(--text-secondary); margin-top: 2px; }

/* Mobile · barra flotante full-width + items apilados */
@media (max-width: 640px) {
  .carrito-flotante {
    left: 8px;
    right: 8px;
    transform: none;
    border-radius: 12px;
    flex-direction: column;
    text-align: center;
    bottom: 8px;
  }
  @keyframes carrito-pop-in {
    from { transform: translateY(30px); opacity: 0; }
    to   { transform: translateY(0);    opacity: 1; }
  }
  .carrito-flotante__actions { width: 100%; justify-content: center; }
  .renov-bloque__item { flex-direction: column; align-items: flex-start; }
}

/* =========================================================
   CARD DE VEHÍCULO · DISEÑO NUEVO (basado en propuesta Claude Design)
   Visual limpio con avatares coloreados por estado, tags inline,
   filas espaciadas y CTA "Pedir →" para eventuales no registrados.
   Mantiene infraestructura existente: chevron + collapsable +
   checkbox carrito + chip Renovar.
   ========================================================= */

/* Header de card · vehicle-info + status-badge */
.vehiculo-card__head.card-header {
  display: flex;
  align-items: center;
  gap: var(--space-md);
}
.vehicle-info {
  display: flex;
  align-items: center;
  gap: 12px;
  flex: 1;
  min-width: 0;
}
.vehicle-icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 44px;
  height: 44px;
  border-radius: 12px;
  background: var(--primary-light, #eff6ff);
  color: var(--primary, #2563eb);
  flex-shrink: 0;
}
.vehicle-icon svg,
.vehicle-icon i[data-lucide] { width: 24px; height: 24px; stroke-width: 1.8; }
.vehicle-plate {
  font-family: var(--font-mono);
  font-weight: 700;
  font-size: 1.05rem;
  letter-spacing: 0.05em;
  color: var(--text);
  font-variant-numeric: tabular-nums;
  line-height: 1.2;
}
.vehicle-type {
  font-size: 0.82rem;
  color: var(--text-secondary);
  margin-top: 2px;
}

/* Status badge (Vencido / Por vencer / Al día / En trámite) */
.status-badge {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 5px 12px;
  border-radius: 999px;
  font-size: 0.78rem;
  font-weight: 600;
  white-space: nowrap;
}
.status-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: currentColor;
}
.status-badge--vencido   { background: #fee2e2; color: #b91c1c; }
.status-badge--alerta    { background: #fef3c7; color: #92400e; }
.status-badge--en-tramite{ background: #dbeafe; color: #1d4ed8; }
.status-badge--al-dia    { background: #dcfce7; color: #15803d; }

/* Items list (cuerpo de la card) */
.items-list {
  display: flex;
  flex-direction: column;
}
.item {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 12px var(--space-lg);
  border-bottom: 1px solid var(--border);
  transition: background-color 120ms ease;
  cursor: default;
}
.item:last-child { border-bottom: none; }
.item[role="button"] { cursor: pointer; }
.item[role="button"]:hover { background: var(--bg, #f8fafc); }
.item[role="button"]:focus-visible {
  outline: 2px solid var(--primary, #2563eb);
  outline-offset: -2px;
}

.item .check {
  width: 18px;
  height: 18px;
  flex-shrink: 0;
  cursor: pointer;
  accent-color: var(--primary, #2563eb);
  margin: 0;
}
.check-spacer {
  width: 18px;
  flex-shrink: 0;
  display: inline-block;
}

/* Item icon avatares de color según estado del trámite */
.item-icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 36px;
  height: 36px;
  border-radius: 10px;
  flex-shrink: 0;
}
.item-icon svg,
.item-icon i[data-lucide] { width: 20px; height: 20px; stroke-width: 1.8; }
.icon-amber { background: #fffbeb; color: #b45309; }
.icon-red   { background: #fee2e2; color: #b91c1c; }
.icon-green { background: #dcfce7; color: #15803d; }
.icon-gray  { background: #f1f5f9; color: #64748b; }
.icon-blue  { background: #dbeafe; color: #1d4ed8; }

.item-body {
  flex: 1;
  min-width: 0;
  display: flex;
  flex-direction: column;
  gap: 4px;
}
.item-title {
  font-size: 0.95rem;
  font-weight: 600;
  color: var(--text);
  line-height: 1.3;
}

/* Tags inline (En cotización, Vencido, etc.) */
.tag {
  display: inline-flex;
  align-items: center;
  padding: 2px 10px;
  border-radius: 999px;
  font-size: 0.72rem;
  font-weight: 600;
  align-self: flex-start;
  white-space: nowrap;
}
.tag-amber { background: #fef3c7; color: #92400e; }
.tag-red   { background: #fee2e2; color: #b91c1c; }
.tag-green { background: #dcfce7; color: #15803d; }
.tag-gray  { background: #f1f5f9; color: #475569; }
.tag-blue  { background: #dbeafe; color: #1d4ed8; }
.tag-renovar {
  background: #fef3c7;
  color: #92400e;
  border: 1px solid #fde68a;
  cursor: pointer;
  transition: background 160ms, transform 160ms;
}
.tag-renovar:hover { background: #fde68a; transform: scale(1.03); }

.item-right {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-shrink: 0;
}
.item-date {
  font-family: var(--font-mono);
  font-size: 0.85rem;
  color: var(--text);
  font-variant-numeric: tabular-nums;
}
.item-dash {
  color: var(--text-muted);
  font-size: 0.95rem;
}

/* Botón "Pedir →" individual (atajo para eventuales no registrados) */
.btn-pedir {
  background: #ea580c;
  color: #fff;
  border: 0;
  padding: 6px 14px;
  border-radius: 999px;
  font-size: 0.82rem;
  font-weight: 600;
  cursor: pointer;
  transition: background 160ms, transform 160ms;
  white-space: nowrap;
}
.btn-pedir:hover  { background: #c2410c; transform: translateY(-1px); }
.btn-pedir:active { transform: translateY(0); }
.btn-pedir:focus-visible {
  outline: 2px solid #ea580c;
  outline-offset: 2px;
}

@media (max-width: 600px) {
  .item { padding: 10px var(--space-md); gap: 10px; }
  .item-icon { width: 32px; height: 32px; }
  .item-title { font-size: 0.9rem; }
  .item-date { font-size: 0.8rem; }
  .btn-pedir { padding: 5px 10px; font-size: 0.78rem; }
}
