/* ════════════════════════════════════════════════════════════════════
   WM DEAL MAKERS — Estilos principales
   Paleta editorial validada en el demo
   ════════════════════════════════════════════════════════════════════ */

:root {
  --ink: #0b0d10;
  --paper: #f4efe6;
  --paper-2: #ebe4d6;
  --line: #1a1d22;
  --accent: #d94e1f;
  --accent-2: #1f6b4a;
  --gold: #b8923a;
  --muted: #6b6660;
  --card: #fbf7ee;
  --red: #c0392b;
  --shadow: 0 1px 0 var(--line), 0 8px 24px rgba(11, 13, 16, 0.06);
  
  /* Colores auxiliares para modo oscuro/claro */
  --bg-input: #ffffff;
  --bg-modal: #ffffff;
  --text-on-card: #0b0d10;
  --border-soft: #e6e1d5;
}

/* ─── MODO OSCURO ─── */
[data-theme="dark"] {
  /* Tonos cálidos derivados del logo dorado WM */
  --ink: #f0e8d4;              /* Crema cálida (texto principal) */
  --paper: #15110a;            /* Negro cálido con tinte dorado */
  --paper-2: #1f1a10;          /* Fondo secundario cálido */
  --line: #3a2f1c;             /* Bordes en tono dorado oscuro */
  --accent: #c4a572;           /* DORADO WM principal */
  --accent-2: #4a9970;         /* Verde para éxito */
  --gold: #d4b88a;             /* Dorado claro (mismo tono pero más vivo) */
  --muted: #8a7e62;            /* Texto secundario en dorado apagado */
  --card: #1a1610;             /* Tarjetas con fondo cálido */
  --red: #e74c3c;              /* Rojo de error */
  --shadow: 0 1px 0 rgba(196,165,114,0.1), 0 8px 24px rgba(0,0,0,0.5);
  --bg-input: #1f1a10;
  --bg-modal: #1a1610;
  --text-on-card: #f0e8d4;
  --border-soft: #3a2f1c;
  
  /* Variantes del dorado para diferentes estados */
  --gold-soft: rgba(196, 165, 114, 0.15);
  --gold-medium: rgba(196, 165, 114, 0.3);
  --gold-strong: rgba(196, 165, 114, 0.6);
}

/* Transición suave al cambiar de tema */
html, body, .dealer-card, .panel, .nav-item, .btn, input, select, textarea {
  transition: background-color .25s ease, color .25s ease, border-color .25s ease;
}

/* Ajustes específicos para modo oscuro */
[data-theme="dark"] input,
[data-theme="dark"] select,
[data-theme="dark"] textarea,
[data-theme="dark"] .field input,
[data-theme="dark"] .field select,
[data-theme="dark"] .field textarea {
  background: var(--bg-input) !important;
  color: var(--ink) !important;
  border-color: var(--gold-medium) !important;
}

[data-theme="dark"] input:hover,
[data-theme="dark"] select:hover,
[data-theme="dark"] textarea:hover,
[data-theme="dark"] .field input:hover,
[data-theme="dark"] .field select:hover,
[data-theme="dark"] .field textarea:hover {
  border-color: var(--gold) !important;
}

[data-theme="dark"] input:focus,
[data-theme="dark"] select:focus,
[data-theme="dark"] textarea:focus,
[data-theme="dark"] .field input:focus,
[data-theme="dark"] .field select:focus,
[data-theme="dark"] .field textarea:focus {
  background: var(--bg-input) !important;
  border-color: var(--gold) !important;
  box-shadow: 0 0 0 4px var(--gold-soft) !important;
  outline: none;
}

[data-theme="dark"] input::placeholder,
[data-theme="dark"] textarea::placeholder,
[data-theme="dark"] .field input::placeholder,
[data-theme="dark"] .field textarea::placeholder {
  color: var(--muted) !important;
  opacity: 0.7;
}

/* Opciones del select en oscuro */
[data-theme="dark"] select option {
  background: var(--bg-input);
  color: var(--ink);
}

/* Input de fecha en oscuro */
[data-theme="dark"] input[type="date"]::-webkit-calendar-picker-indicator {
  filter: invert(0.7) sepia(1) saturate(2) hue-rotate(15deg);
  cursor: pointer;
}

[data-theme="dark"] .panel,
[data-theme="dark"] .dealer-card {
  background: var(--card);
  border: 1px solid var(--gold-medium);
}

[data-theme="dark"] table {
  background: var(--card);
}

[data-theme="dark"] table th {
  background: var(--paper-2);
  color: var(--gold);
  border-bottom: 1px solid var(--gold-medium);
}

[data-theme="dark"] table tr:hover {
  background: var(--gold-soft);
}

[data-theme="dark"] table td {
  border-color: var(--line);
}

[data-theme="dark"] .modal-overlay {
  background: rgba(0,0,0,0.7);
}

[data-theme="dark"] .modal {
  background: var(--bg-modal);
}

[data-theme="dark"] .pill {
  background: var(--paper-2);
  color: var(--gold);
  border: 1px solid var(--gold-medium);
}

[data-theme="dark"] .pill.green {
  background: rgba(74, 153, 112, 0.2);
  color: var(--accent-2);
  border-color: rgba(74, 153, 112, 0.4);
}

[data-theme="dark"] .pill.red {
  background: rgba(231, 76, 60, 0.2);
  color: var(--red);
  border-color: rgba(231, 76, 60, 0.4);
}

[data-theme="dark"] .pill.gold {
  background: var(--gold-medium);
  color: var(--gold);
  border-color: var(--gold);
}

[data-theme="dark"] .pill.gray {
  background: var(--paper-2);
  color: var(--muted);
  border-color: var(--line);
}

[data-theme="dark"] .sidebar {
  background: #100c06;
  border-right: 1px solid var(--gold-medium);
}

[data-theme="dark"] .sidebar .brand-line {
  color: var(--muted);
}

[data-theme="dark"] .nav-item {
  color: var(--ink);
}

[data-theme="dark"] .nav-item:not(.active):hover {
  background: var(--gold-soft);
  color: var(--gold);
}

[data-theme="dark"] .nav-item.active {
  background: var(--gold-medium);
  color: var(--gold);
  border-left: 3px solid var(--gold);
}

[data-theme="dark"] hr {
  border-color: var(--line);
}

/* ─── FIX: Botón cerrar sesión en modo oscuro ─── */
[data-theme="dark"] .logout-btn {
  color: var(--gold);
  border-color: var(--gold-medium);
  background: transparent;
}

[data-theme="dark"] .logout-btn:hover {
  background: var(--accent);
  color: #15110a;
  border-color: var(--accent);
}

/* ─── FIX: Headers oscuros de cards en modo oscuro ─── */
/* Cuando una card tiene linear-gradient claro inline,
   forzar texto legible en modo oscuro */
[data-theme="dark"] [style*="background:linear-gradient(135deg"] h3,
[data-theme="dark"] [style*="background:linear-gradient(135deg"] h4 {
  color: var(--ink) !important;
}

/* Texto y headings con color hardcodeado a #0b0d10 o var(--ink) cuando ink se invierte */
[data-theme="dark"] h1,
[data-theme="dark"] h2,
[data-theme="dark"] h3,
[data-theme="dark"] h4,
[data-theme="dark"] h5,
[data-theme="dark"] h6 {
  color: var(--ink);
}

/* ─── FIX: Cards con fondo blanco hardcodeado ─── */
[data-theme="dark"] [style*="background:#fff"],
[data-theme="dark"] [style*="background: #fff"],
[data-theme="dark"] [style*="background:#FFFFFF"],
[data-theme="dark"] [style*="background: #FFFFFF"] {
  background: var(--card) !important;
}

/* ─── FIX v14.33: Headers de cards de dealers ─── */
/* NOTA: antes había un filter:brightness(0.4) que oscurecía TODO el header
   incluyendo el nombre del dealer. Eso ya no es necesario porque más abajo
   (líneas ~367-374) están los gradients oscuros correctos por clase.
   Aquí solo dejamos un override defensivo por si quedó alguna clase legacy. */
[data-theme="dark"] .dealer-card-header-light {
  background: linear-gradient(135deg, #1a1610 0%, #221c12 100%) !important;
}

/* ─── FIX: Botones outline en modo oscuro (dorados) ─── */
[data-theme="dark"] .btn {
  border-color: var(--gold-medium);
  color: var(--gold);
  background: transparent;
}

[data-theme="dark"] .btn:hover {
  background: var(--gold-soft);
  border-color: var(--gold);
  color: var(--gold);
}

[data-theme="dark"] .btn.btn-accent {
  background: var(--accent);
  color: #15110a;
  border-color: var(--accent);
  font-weight: 700;
}

[data-theme="dark"] .btn.btn-accent:hover {
  background: var(--gold);
  border-color: var(--gold);
  color: #15110a;
  filter: brightness(1.05);
}

[data-theme="dark"] .btn.btn-danger {
  color: var(--red);
  border-color: rgba(231,76,60,0.4);
  background: transparent;
}

[data-theme="dark"] .btn.btn-danger:hover {
  background: var(--red);
  color: #fff;
  border-color: var(--red);
}

/* ─── FIX: Toast en modo oscuro ─── */
[data-theme="dark"] .toast {
  background: var(--card);
  color: var(--ink);
  border: 1px solid var(--line);
}

/* ─── FIX: User chip ─── */
[data-theme="dark"] .user-chip {
  background: var(--paper-2);
}

[data-theme="dark"] .user-chip:hover {
  background: var(--card);
}

/* ─── FIX: Page head y crumb ─── */
[data-theme="dark"] .page-head h2 {
  color: var(--ink);
}

[data-theme="dark"] .crumb {
  color: var(--muted);
}

/* ─── FIX: empty state ─── */
[data-theme="dark"] .empty-state h4 {
  color: var(--ink);
}

[data-theme="dark"] .empty-state p {
  color: var(--muted);
}

/* ─── FIX: notice banner ─── */
[data-theme="dark"] .notice {
  background: var(--card);
  border-color: var(--line);
}

[data-theme="dark"] .notice-info {
  background: rgba(74,144,189,0.1);
}

[data-theme="dark"] .notice-warning {
  background: rgba(212,169,86,0.1);
}

[data-theme="dark"] .notice-danger {
  background: rgba(231,76,60,0.1);
}

/* ─── FIX: hints y labels en formularios ─── */
[data-theme="dark"] label {
  color: var(--ink);
}

[data-theme="dark"] .hint {
  color: var(--muted);
}

[data-theme="dark"] .field-row {
  color: var(--ink);
}

/* ─── FIX: textos con color hardcodeado oscuro ─── */
[data-theme="dark"] [style*="color:#0b0d10"],
[data-theme="dark"] [style*="color: #0b0d10"],
[data-theme="dark"] [style*="color:#1A1D22"],
[data-theme="dark"] [style*="color: #1A1D22"] {
  color: var(--ink) !important;
}

/* ─── Headers de dealer cards (modo claro Y oscuro) ─── */
.dealer-card-header-default {
  background: linear-gradient(135deg, #fafafa 0%, #f4f0e8 100%);
}

.dealer-card-header-gold {
  background: linear-gradient(135deg, #fffaeb 0%, #fff8e1 100%);
}

[data-theme="dark"] .dealer-card-header-default {
  background: linear-gradient(135deg, #1a1610 0%, #221c12 100%);
  border-bottom: 1px solid var(--gold-medium) !important;
}

[data-theme="dark"] .dealer-card-header-gold {
  background: linear-gradient(135deg, #2a2010 0%, #3a2c14 100%);
  border-bottom: 1px solid var(--gold) !important;
}

/* ─── Panel destacado de bonos ─── */
.panel-bonos-destacado {
  background: linear-gradient(135deg, #fffaeb 0%, #fff8e1 100%);
}

[data-theme="dark"] .panel-bonos-destacado {
  background: linear-gradient(135deg, #2a2010 0%, #3a2c14 100%);
  border-color: var(--gold) !important;
}

/* ─── v14.33: Banner de campañas activas (dashboard BDC) ─── */
.campana-banner {
  background: linear-gradient(135deg, rgba(196,165,114,0.18) 0%, rgba(196,165,114,0.08) 100%) !important;
  border-left: 4px solid var(--gold) !important;
}

[data-theme="dark"] .campana-banner {
  background: linear-gradient(135deg, rgba(212,184,138,0.18) 0%, rgba(212,184,138,0.06) 100%) !important;
  border-left: 4px solid var(--gold) !important;
}

/* Tarjetas internas de cada campaña dentro del banner */
.campana-banner > div > div[style*="background:var(--card)"] {
  border: 1px solid rgba(196,165,114,0.3);
}

[data-theme="dark"] .campana-banner > div > div[style*="background:var(--card)"] {
  border: 1px solid rgba(212,184,138,0.3);
}

/* ─── Dealer name (siempre legible en ambos modos) ─── */
.dealer-name {
  color: var(--ink);
}

[data-theme="dark"] .dealer-name {
  color: #f0e8d4 !important;   /* crema cálida fuerte, máximo contraste sobre header oscuro */
  text-shadow: 0 1px 2px rgba(0,0,0,.35);  /* sutil para que destaque sobre el gradient */
}

/* Línea pequeña "MIAMI, FL" arriba del nombre — uniforme en oscuro */
[data-theme="dark"] .dealer-card-header-default > div:first-child,
[data-theme="dark"] .dealer-card-header-gold > div:first-child {
  color: var(--gold) !important;
  opacity: 0.85;
}

/* ─── Tags de tipo de dealer (Centro Estético / Dealer Autos) ─── */
.dealer-tipo-tag {
  padding: 4px 10px;
  font-size: 10px;
  font-weight: 700;
  letter-spacing: .1em;
  text-transform: uppercase;
  border-radius: 6px;
  white-space: nowrap;
  flex-shrink: 0;
}

.dealer-tipo-tag.tag-estetico {
  background: var(--gold);
  color: #fff;
}

.dealer-tipo-tag.tag-autos {
  background: var(--ink);
  color: var(--paper);
}

[data-theme="dark"] .dealer-tipo-tag.tag-estetico {
  background: var(--gold);
  color: #15110a !important;
}

[data-theme="dark"] .dealer-tipo-tag.tag-autos {
  background: var(--gold-medium);
  color: var(--gold) !important;
  border: 1px solid var(--gold);
}

/* ─── Asegurar que pago-de-mes destacado se vea bien ─── */
[data-theme="dark"] [style*="background:rgba(244,239,230"] {
  /* mantener el color, ya es claro sobre oscuro */
}

/* Botón toggle de tema */
.theme-toggle {
  display: flex;
  align-items: center;
  gap: 4px;
  background: var(--paper-2);
  border: 1px solid var(--line);
  border-radius: 999px;
  padding: 3px;
  margin: 8px 0;
}

.theme-toggle button {
  background: transparent;
  border: none;
  padding: 6px 10px;
  font-size: 11px;
  color: var(--muted);
  cursor: pointer;
  border-radius: 999px;
  font-weight: 600;
  letter-spacing: .05em;
  transition: all .2s ease;
  display: flex;
  align-items: center;
  gap: 4px;
}

.theme-toggle button:hover {
  color: var(--ink);
}

.theme-toggle button.active {
  background: var(--ink);
  color: var(--paper);
}

[data-theme="dark"] .theme-toggle {
  background: var(--paper-2);
  border-color: var(--gold-medium);
}

[data-theme="dark"] .theme-toggle button {
  color: var(--muted);
}

[data-theme="dark"] .theme-toggle button:hover {
  color: var(--gold);
}

[data-theme="dark"] .theme-toggle button.active {
  background: var(--accent);
  color: #15110a;
}

* {
  box-sizing: border-box;
}

html, body {
  margin: 0;
  padding: 0;
  background: var(--paper);
  color: var(--ink);
  font-family: 'Inter Tight', -apple-system, BlinkMacSystemFont, sans-serif;
  -webkit-font-smoothing: antialiased;
  min-height: 100vh;
}

.serif { font-family: 'Fraunces', Georgia, serif; }
.mono  { font-family: 'JetBrains Mono', 'Courier New', monospace; }

button { font-family: inherit; cursor: pointer; }
input, select, textarea { font-family: inherit; }
a { color: inherit; }

/* ════════════════════════════════════════════════════════════════════
   LOGIN
   ════════════════════════════════════════════════════════════════════ */

/* ════════════════════════════════════════════════════════════════
   LOGIN — Diseño moderno v14.35
   Paleta WM dorado empresarial. Soporte modo claro y oscuro.
   ════════════════════════════════════════════════════════════════ */

.login-wrap {
  min-height: 100vh;
  display: grid;
  grid-template-columns: 1.05fr 0.95fr;
  background: var(--paper);
  position: relative;
  overflow: hidden;
}

/* ─── Lado izquierdo: branding hero ─── */
.login-left {
  padding: 56px 64px;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  position: relative;
  overflow: hidden;
  background:
    radial-gradient(circle at 15% 85%, rgba(196, 165, 114, 0.18), transparent 55%),
    radial-gradient(circle at 95% 15%, rgba(196, 165, 114, 0.10), transparent 50%),
    linear-gradient(135deg, #fbf7ee 0%, #f4efe6 100%);
}

[data-theme="dark"] .login-left {
  background:
    radial-gradient(circle at 15% 85%, rgba(212, 184, 138, 0.20), transparent 55%),
    radial-gradient(circle at 95% 15%, rgba(212, 184, 138, 0.10), transparent 50%),
    linear-gradient(135deg, #1a1610 0%, #15110a 100%);
}

/* Patrón decorativo de fondo: líneas diagonales muy sutiles */
.login-left::before {
  content: "";
  position: absolute;
  inset: 0;
  background-image:
    linear-gradient(rgba(11, 13, 16, 0.04) 1px, transparent 1px),
    linear-gradient(90deg, rgba(11, 13, 16, 0.04) 1px, transparent 1px);
  background-size: 64px 64px;
  mask-image: radial-gradient(ellipse 900px 700px at 30% 50%, #000 20%, transparent 75%);
  pointer-events: none;
}

[data-theme="dark"] .login-left::before {
  background-image:
    linear-gradient(rgba(212, 184, 138, 0.05) 1px, transparent 1px),
    linear-gradient(90deg, rgba(212, 184, 138, 0.05) 1px, transparent 1px);
}

/* Círculo dorado decorativo flotante (top right) */
.login-left::after {
  content: "";
  position: absolute;
  top: -200px;
  right: -200px;
  width: 500px;
  height: 500px;
  border-radius: 50%;
  background: radial-gradient(circle, rgba(196, 165, 114, 0.15), transparent 70%);
  pointer-events: none;
  animation: floatGold 12s ease-in-out infinite;
}

[data-theme="dark"] .login-left::after {
  background: radial-gradient(circle, rgba(212, 184, 138, 0.18), transparent 70%);
}

@keyframes floatGold {
  0%, 100% { transform: translate(0, 0) scale(1); }
  50% { transform: translate(-30px, 30px) scale(1.05); }
}

/* ─── Brand del top: logo + nombre ─── */
.brand {
  display: flex;
  align-items: center;
  gap: 16px;
  z-index: 2;
  position: relative;
}

.brand-logo {
  width: 96px;
  height: 96px;
  object-fit: contain;
  display: block;
  filter: drop-shadow(0 4px 16px rgba(196, 165, 114, 0.25));
  animation: fadeInDown 0.7s ease-out;
}

@keyframes fadeInDown {
  from { opacity: 0; transform: translateY(-12px); }
  to { opacity: 1; transform: translateY(0); }
}

.brand-mark {
  width: 54px;
  height: 54px;
  border: 1.5px solid var(--line);
  background: var(--ink);
  color: var(--paper);
  display: grid;
  place-items: center;
  border-radius: 50%;
  font-family: 'Fraunces', serif;
  font-weight: 800;
  font-size: 24px;
  letter-spacing: -1px;
}

.brand-text small {
  display: block;
  font-size: 10px;
  letter-spacing: 0.32em;
  text-transform: uppercase;
  color: var(--gold);
  font-weight: 700;
}

[data-theme="dark"] .brand-text small {
  color: var(--gold);
  opacity: 0.85;
}

.brand-text h1 {
  margin: 4px 0 0;
  font-family: 'Fraunces', serif;
  font-weight: 700;
  font-size: 24px;
  letter-spacing: -0.5px;
  color: var(--ink);
}

/* ─── Logo móvil (solo se ve <=1024px) ─── */
.mobile-logo {
  display: none;
  text-align: center;
  margin-bottom: 28px;
}

.mobile-logo img {
  width: 110px;
  height: 110px;
  object-fit: contain;
  filter: drop-shadow(0 4px 16px rgba(196, 165, 114, 0.25));
}

/* ─── Hero (mensaje principal) ─── */
.hero {
  z-index: 2;
  max-width: 540px;
  position: relative;
  animation: fadeInUp 0.8s ease-out 0.1s both;
}

@keyframes fadeInUp {
  from { opacity: 0; transform: translateY(20px); }
  to { opacity: 1; transform: translateY(0); }
}

.hero h2 {
  font-family: 'Fraunces', serif;
  font-weight: 600;
  font-size: 64px;
  line-height: 1.0;
  letter-spacing: -2.8px;
  margin: 0 0 22px;
  color: var(--ink);
}

.hero h2 em {
  font-style: italic;
  color: var(--gold);
  font-weight: 500;
  position: relative;
}

.hero h2 em::after {
  content: "";
  position: absolute;
  left: 0;
  right: 0;
  bottom: 4px;
  height: 8px;
  background: linear-gradient(90deg, rgba(196, 165, 114, 0.35), rgba(196, 165, 114, 0.05));
  z-index: -1;
  border-radius: 4px;
}

.hero p {
  font-size: 16.5px;
  line-height: 1.65;
  color: var(--ink);
  opacity: 0.78;
  max-width: 480px;
  font-weight: 400;
}

/* Stats / detalles bonitos abajo del hero (decorativos) */
.hero-stats {
  display: flex;
  gap: 32px;
  margin-top: 36px;
  z-index: 2;
  position: relative;
  animation: fadeInUp 0.8s ease-out 0.25s both;
}

.hero-stat {
  display: flex;
  flex-direction: column;
}

.hero-stat-value {
  font-family: 'Fraunces', serif;
  font-size: 28px;
  font-weight: 600;
  color: var(--gold);
  letter-spacing: -1px;
  line-height: 1;
}

.hero-stat-label {
  font-size: 11px;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: var(--muted);
  margin-top: 6px;
  font-weight: 500;
}

/* ─── Footer del lado izquierdo ─── */
.login-footer {
  z-index: 2;
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-size: 10px;
  letter-spacing: 0.24em;
  text-transform: uppercase;
  color: var(--muted);
  position: relative;
  font-weight: 600;
}

.login-footer span::before {
  content: "●";
  margin-right: 8px;
  color: var(--gold);
  font-size: 8px;
  vertical-align: middle;
}

/* ════════════════════════════════════════════════════════════════
   Lado derecho: formulario de login (card moderna)
   ════════════════════════════════════════════════════════════════ */
.login-right {
  padding: 56px 64px;
  display: flex;
  flex-direction: column;
  justify-content: center;
  background: var(--paper-2);
  position: relative;
  overflow: hidden;
}

/* Brillo decorativo de fondo en el lado derecho */
.login-right::before {
  content: "";
  position: absolute;
  bottom: -300px;
  left: -300px;
  width: 600px;
  height: 600px;
  border-radius: 50%;
  background: radial-gradient(circle, rgba(196, 165, 114, 0.10), transparent 70%);
  pointer-events: none;
}

[data-theme="dark"] .login-right::before {
  background: radial-gradient(circle, rgba(212, 184, 138, 0.12), transparent 70%);
}

.login-card {
  max-width: 420px;
  width: 100%;
  margin: 0 auto;
  z-index: 2;
  position: relative;
  animation: fadeInScale 0.7s ease-out 0.15s both;
}

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

/* Tag de "acceso restringido" */
.login-card .tag {
  font-size: 11px;
  letter-spacing: 0.24em;
  text-transform: uppercase;
  color: var(--gold);
  margin-bottom: 14px;
  display: inline-flex;
  align-items: center;
  gap: 10px;
  font-weight: 700;
  padding: 6px 12px;
  background: rgba(196, 165, 114, 0.12);
  border: 1px solid rgba(196, 165, 114, 0.25);
  border-radius: 20px;
}

[data-theme="dark"] .login-card .tag {
  background: rgba(212, 184, 138, 0.10);
  border-color: rgba(212, 184, 138, 0.30);
}

.login-card .tag::before {
  content: "";
  width: 6px;
  height: 6px;
  background: var(--gold);
  border-radius: 50%;
  display: inline-block;
  box-shadow: 0 0 0 3px rgba(196, 165, 114, 0.25);
  animation: pulseGold 2s ease-in-out infinite;
}

@keyframes pulseGold {
  0%, 100% { box-shadow: 0 0 0 3px rgba(196, 165, 114, 0.25); }
  50% { box-shadow: 0 0 0 6px rgba(196, 165, 114, 0); }
}

.login-card h3 {
  font-family: 'Fraunces', serif;
  font-weight: 600;
  font-size: 42px;
  letter-spacing: -1.4px;
  margin: 0 0 10px;
  line-height: 1.05;
  color: var(--ink);
}

.login-card .sub {
  color: var(--ink);
  opacity: 0.65;
  margin: 0 0 36px;
  font-size: 15px;
  line-height: 1.5;
}

/* ─── Form fields ─── */
.login-card .field {
  margin-bottom: 20px;
}

.login-card .field label {
  display: block;
  font-size: 11px;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  margin-bottom: 10px;
  color: var(--ink);
  opacity: 0.75;
  font-weight: 700;
}

.login-card .field input {
  width: 100%;
  padding: 16px 18px;
  border: 1.5px solid var(--line);
  background: var(--paper);
  font-size: 15px;
  border-radius: 12px;
  outline: none;
  transition: all 0.22s ease;
  font-family: inherit;
  color: var(--ink);
  font-weight: 500;
}

.login-card .field input:hover {
  border-color: var(--gold);
  background: var(--paper);
}

.login-card .field input:focus {
  border-color: var(--gold);
  background: var(--paper);
  box-shadow: 0 0 0 4px rgba(196, 165, 114, 0.18);
}

[data-theme="dark"] .login-card .field input {
  background: var(--card);
  border-color: rgba(212, 184, 138, 0.20);
  color: var(--ink);
}

[data-theme="dark"] .login-card .field input:hover {
  border-color: var(--gold);
}

[data-theme="dark"] .login-card .field input:focus {
  border-color: var(--gold);
  box-shadow: 0 0 0 4px rgba(212, 184, 138, 0.15);
}

.login-card .field input::placeholder {
  color: var(--muted);
  opacity: 0.55;
  font-weight: 400;
}

/* ─── Wrapper de input password con botón ojo ─── */
.password-wrapper {
  position: relative;
}

.password-wrapper input {
  padding-right: 50px !important;
}

.password-toggle {
  position: absolute;
  top: 50%;
  right: 6px;
  transform: translateY(-50%);
  width: 38px;
  height: 38px;
  background: transparent;
  border: none;
  border-radius: 8px;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  color: var(--muted);
  transition: all 0.18s ease;
  padding: 0;
}

.password-toggle:hover {
  color: var(--gold);
  background: rgba(196, 165, 114, 0.10);
}

.password-toggle:focus {
  outline: none;
  color: var(--gold);
  background: rgba(196, 165, 114, 0.12);
}

.password-toggle:active {
  transform: translateY(-50%) scale(0.92);
}

.password-toggle svg {
  display: block;
  pointer-events: none;
}

/* ─── Botón principal de submit ─── */
.btn-primary {
  width: 100%;
  padding: 17px 18px;
  background: linear-gradient(135deg, var(--ink) 0%, #2a2520 100%);
  color: var(--paper);
  border: 1px solid var(--ink);
  font-weight: 700;
  font-size: 13px;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  transition: all 0.25s cubic-bezier(0.4, 0, 0.2, 1);
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 12px;
  border-radius: 12px;
  cursor: pointer;
  margin-top: 8px;
  position: relative;
  overflow: hidden;
  box-shadow: 0 4px 12px rgba(11, 13, 16, 0.15);
}

[data-theme="dark"] .btn-primary {
  background: linear-gradient(135deg, var(--gold) 0%, #b8923a 100%);
  color: #15110a;
  border-color: var(--gold);
  box-shadow: 0 4px 16px rgba(196, 165, 114, 0.25);
}

.btn-primary::before {
  content: "";
  position: absolute;
  inset: 0;
  background: linear-gradient(135deg, var(--gold) 0%, #b8923a 100%);
  opacity: 0;
  transition: opacity 0.25s ease;
}

[data-theme="dark"] .btn-primary::before {
  background: linear-gradient(135deg, #e6cd9c 0%, var(--gold) 100%);
}

.btn-primary span {
  position: relative;
  z-index: 1;
}

.btn-primary:hover {
  transform: translateY(-2px);
  box-shadow: 0 10px 28px rgba(196, 165, 114, 0.35);
  color: #fff;
  border-color: var(--gold);
}

[data-theme="dark"] .btn-primary:hover {
  color: #15110a;
  box-shadow: 0 10px 28px rgba(212, 184, 138, 0.4);
}

.btn-primary:hover::before {
  opacity: 1;
}

.btn-primary:active {
  transform: translateY(0);
}

.btn-primary:disabled {
  background: var(--muted);
  border-color: var(--muted);
  color: var(--paper);
  cursor: not-allowed;
  transform: none;
  box-shadow: none;
  opacity: 0.7;
}

.btn-primary:disabled::before {
  opacity: 0;
}

/* ─── Spinner para estado loading ─── */
.spinner {
  width: 14px;
  height: 14px;
  border: 2px solid rgba(244, 239, 230, 0.3);
  border-top-color: var(--paper);
  border-radius: 50%;
  display: inline-block;
  animation: spin 0.7s linear infinite;
}

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

/* ─── Aviso de confidencialidad ─── */
.confidentiality-notice {
  margin-top: 28px;
  padding: 16px 18px;
  background: var(--paper);
  border: 1px solid rgba(196, 165, 114, 0.20);
  font-size: 11.5px;
  line-height: 1.6;
  color: var(--ink);
  opacity: 0.78;
  border-radius: 10px;
}

[data-theme="dark"] .confidentiality-notice {
  background: rgba(212, 184, 138, 0.05);
  border-color: rgba(212, 184, 138, 0.20);
}

.confidentiality-notice strong {
  display: block;
  font-size: 10px;
  letter-spacing: 0.22em;
  text-transform: uppercase;
  color: var(--gold);
  margin-bottom: 8px;
  font-weight: 700;
}

/* ─── Error de login ─── */
.err {
  background: rgba(231, 76, 60, 0.08);
  border-left: 3px solid #e74c3c;
  padding: 14px 16px;
  margin-bottom: 20px;
  font-size: 13.5px;
  color: #c0392b;
  border-radius: 0 8px 8px 0;
  display: none;
  animation: shakeX 0.4s ease-out;
}

[data-theme="dark"] .err {
  background: rgba(231, 76, 60, 0.12);
  color: #ff6b5e;
}

.err.show {
  display: block;
}

@keyframes shakeX {
  0%, 100% { transform: translateX(0); }
  20%, 60% { transform: translateX(-6px); }
  40%, 80% { transform: translateX(6px); }
}

/* ─── Toggle de tema en el login (esquina superior derecha) ─── */
.login-theme-toggle {
  position: fixed;
  top: 20px;
  right: 24px;
  z-index: 100;
  display: inline-flex;
  align-items: center;
  gap: 2px;
  padding: 4px;
  background: rgba(255, 255, 255, 0.7);
  border: 1px solid rgba(196, 165, 114, 0.25);
  border-radius: 999px;
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  box-shadow: 0 4px 16px rgba(11, 13, 16, 0.06);
}

[data-theme="dark"] .login-theme-toggle {
  background: rgba(26, 22, 16, 0.7);
  border-color: rgba(212, 184, 138, 0.30);
  box-shadow: 0 4px 16px rgba(0, 0, 0, 0.3);
}

.login-theme-toggle button {
  background: transparent;
  border: none;
  cursor: pointer;
  width: 32px;
  height: 32px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border-radius: 50%;
  color: var(--muted);
  transition: all 0.22s ease;
  padding: 0;
}

.login-theme-toggle button:hover {
  color: var(--gold);
  background: rgba(196, 165, 114, 0.10);
}

.login-theme-toggle button.active {
  background: var(--gold);
  color: #fff;
  box-shadow: 0 2px 8px rgba(196, 165, 114, 0.35);
}

[data-theme="dark"] .login-theme-toggle button.active {
  background: var(--gold);
  color: #15110a;
  box-shadow: 0 2px 8px rgba(212, 184, 138, 0.4);
}

.login-theme-toggle button svg {
  display: block;
  pointer-events: none;
}

/* En móvil, posición un poco más pequeña */
@media (max-width: 768px) {
  .login-theme-toggle {
    top: 12px;
    right: 12px;
    padding: 3px;
  }
  .login-theme-toggle button {
    width: 28px;
    height: 28px;
  }
}


.field {
  margin-bottom: 18px;
}

.field label {
  display: block;
  font-size: 11px;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  margin-bottom: 8px;
  color: var(--muted);
  font-weight: 600;
}

.field input,
.field select,
.field textarea {
  width: 100%;
  padding: 13px 16px;
  border: 1.5px solid var(--line);
  background: #fff;
  font-size: 14.5px;
  border-radius: 10px;
  outline: none;
  transition: all 0.18s ease;
  font-family: inherit;
  color: var(--ink);
}

.field input:hover,
.field select:hover,
.field textarea:hover {
  border-color: var(--muted);
}

.field input:focus,
.field select:focus,
.field textarea:focus {
  border-color: var(--accent);
  background: #fff;
  box-shadow: 0 0 0 4px rgba(217, 78, 31, 0.12);
}

.field input::placeholder,
.field textarea::placeholder {
  color: #b8b3a8;
}

.field .hint {
  font-size: 12px;
  color: var(--muted);
  margin-top: 7px;
  line-height: 1.5;
}

/* ════════════════════════════════════════════════════════════════════
   APP SHELL (después del login)
   ════════════════════════════════════════════════════════════════════ */

.app {
  display: none;
  min-height: 100vh;
  background: var(--paper);
}

.app.show {
  display: block;
}

.sidebar {
  border-right: 1px solid var(--line);
  padding: 20px 22px;
  background: var(--paper-2);
  display: flex;
  flex-direction: column;
  position: fixed;
  top: 0;
  left: 0;
  width: 260px;
  height: 100vh;
  overflow-y: auto;
  z-index: 50;
  box-sizing: border-box;
  scrollbar-width: thin;
  scrollbar-color: var(--line) transparent;
}

.main {
  margin-left: 260px;
}

.sidebar::-webkit-scrollbar {
  width: 6px;
}

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

.sidebar::-webkit-scrollbar-thumb {
  background: var(--line);
  border-radius: 3px;
}

.sidebar::-webkit-scrollbar-thumb:hover {
  background: var(--muted);
}

.side-brand {
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  gap: 6px;
  margin-bottom: 28px;
}

.side-brand .brand-mark {
  width: 38px;
  height: 38px;
  font-size: 17px;
}

.side-brand .brand-mark-img {
  width: 95px;
  height: 95px;
  object-fit: contain;
  display: block;
  flex-shrink: 0;
  margin-bottom: 2px;
}

.side-brand h1 {
  font-family: 'Fraunces', serif;
  font-weight: 700;
  font-size: 16px;
  margin: 0;
  letter-spacing: -0.3px;
}

.side-brand small {
  font-size: 9px;
  letter-spacing: 0.22em;
  text-transform: uppercase;
  color: var(--muted);
  display: block;
  margin-top: 2px;
}

.nav-section {
  font-size: 10px;
  letter-spacing: 0.22em;
  text-transform: uppercase;
  color: var(--muted);
  margin: 18px 8px 8px;
}

.nav-item {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 11px 14px;
  font-size: 14px;
  border-left: 2px solid transparent;
  color: var(--ink);
  text-decoration: none;
  cursor: pointer;
  transition: all 0.15s;
  border-radius: 0;
  background: transparent;
  width: 100%;
  text-align: left;
  border: none;
  border-left: 2px solid transparent;
}

.nav-item:hover {
  background: var(--paper);
}

.nav-item.active {
  background: var(--ink);
  color: var(--paper);
  border-left-color: var(--accent);
}

.nav-item .ico {
  width: 18px;
  height: 18px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
}

.nav-item.active .ico svg { stroke: var(--paper); }

.side-foot {
  margin-top: auto;
  padding-top: 20px;
  border-top: 1px solid var(--line);
}

.user-chip {
  display: flex;
  align-items: center;
  gap: 10px;
  font-size: 13px;
  padding: 8px 10px;
  margin: 0 -10px;
  border-radius: 4px;
  transition: background 0.15s ease;
}

.user-chip:hover {
  background: var(--card);
}

.avatar {
  width: 34px;
  height: 34px;
  border-radius: 50%;
  background: var(--accent);
  color: #fff;
  display: grid;
  place-items: center;
  font-weight: 600;
  font-family: 'Fraunces', serif;
  font-size: 14px;
  overflow: hidden;
  flex-shrink: 0;
}

.avatar img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  border-radius: 50%;
}

.user-chip .role {
  font-size: 10px;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: var(--muted);
}

.logout-btn {
  margin-top: 12px;
  width: 100%;
  padding: 9px;
  background: transparent;
  border: 1px solid var(--line);
  font-size: 11px;
  letter-spacing: 0.15em;
  text-transform: uppercase;
}

.logout-btn:hover {
  background: var(--ink);
  color: var(--paper);
}

.main {
  padding: 36px 48px;
  max-width: 1400px;
}

.confidentiality-banner {
  background: var(--ink);
  color: var(--paper);
  font-size: 11px;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  text-align: center;
  padding: 7px 16px;
  font-weight: 600;
}

.confidentiality-banner span {
  color: var(--accent);
}

.page-head {
  display: flex;
  justify-content: space-between;
  align-items: flex-end;
  margin-bottom: 32px;
  gap: 24px;
  flex-wrap: wrap;
}

.page-head h2 {
  font-family: 'Fraunces', serif;
  font-weight: 600;
  font-size: 42px;
  letter-spacing: -1.2px;
  margin: 0;
  line-height: 1;
}

.page-head .crumb {
  font-size: 11px;
  letter-spacing: 0.22em;
  text-transform: uppercase;
  color: var(--muted);
  margin-bottom: 6px;
}

.head-actions {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
}

.btn {
  padding: 10px 18px;
  border: 1.5px solid var(--line);
  background: #fff;
  font-size: 12px;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  font-weight: 600;
  transition: all 0.18s ease;
  border-radius: 10px;
  cursor: pointer;
  font-family: inherit;
  color: var(--ink);
}

.btn:hover {
  background: var(--ink);
  color: var(--paper);
  border-color: var(--ink);
  transform: translateY(-1px);
  box-shadow: 0 4px 12px rgba(11, 13, 16, 0.15);
}

.btn-accent {
  background: var(--ink);
  color: var(--paper);
}

.btn-accent:hover {
  background: var(--accent);
  border-color: var(--accent);
  box-shadow: 0 4px 14px rgba(217, 78, 31, 0.3);
}

.btn-danger {
  background: transparent;
  color: var(--red);
  border-color: var(--red);
}

.btn-danger:hover {
  background: var(--red);
  color: #fff;
  border-color: var(--red);
  box-shadow: 0 4px 14px rgba(192, 57, 43, 0.3);
}

.pag-btn {
  padding: 7px 13px;
  border: 1.5px solid var(--line);
  background: #fff;
  font-size: 12px;
  font-weight: 600;
  color: var(--ink);
  cursor: pointer;
  transition: all 0.15s;
  min-width: 36px;
  font-family: inherit;
  border-radius: 8px;
}

.pag-btn:hover:not(:disabled):not(.active) {
  background: var(--ink);
  color: var(--paper);
  border-color: var(--ink);
}

.pag-btn.active {
  background: var(--accent);
  color: #fff;
  border-color: var(--accent);
  cursor: default;
}

.pag-btn:disabled {
  opacity: 0.4;
  cursor: not-allowed;
}

/* ════════════════════════════════════════════════════════════
   CONFIRM MODAL — diálogos elegantes
   ════════════════════════════════════════════════════════════ */

.confirm-overlay {
  position: fixed;
  inset: 0;
  background: rgba(15, 17, 21, 0.55);
  backdrop-filter: blur(4px);
  -webkit-backdrop-filter: blur(4px);
  z-index: 9999;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 20px;
  opacity: 0;
  transition: opacity 0.18s ease;
}

.confirm-overlay.show {
  opacity: 1;
}

.confirm-dialog {
  background: var(--paper);
  border: 1px solid var(--line);
  box-shadow: 0 20px 60px rgba(0, 0, 0, 0.35), 0 2px 8px rgba(0, 0, 0, 0.15);
  max-width: 440px;
  width: 100%;
  padding: 36px 32px 26px;
  position: relative;
  transform: translateY(20px) scale(0.96);
  transition: transform 0.22s cubic-bezier(0.16, 1, 0.3, 1);
  border-radius: 2px;
}

.confirm-overlay.show .confirm-dialog {
  transform: translateY(0) scale(1);
}

.confirm-icon {
  width: 54px;
  height: 54px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 26px;
  font-weight: 700;
  margin: 0 auto 18px;
  border-radius: 50%;
  font-family: 'Fraunces', serif;
}

.confirm-icon.danger {
  background: #fff5f0;
  color: var(--accent);
  border: 2px solid var(--accent);
}

.confirm-icon.info {
  background: var(--card);
  color: var(--accent-2);
  border: 2px solid var(--accent-2);
}

.confirm-content {
  text-align: center;
  margin-bottom: 28px;
}

.confirm-title {
  font-family: 'Fraunces', serif;
  font-size: 22px;
  font-weight: 600;
  color: var(--ink);
  margin-bottom: 10px;
  line-height: 1.25;
}

.confirm-message {
  font-size: 14px;
  color: var(--muted);
  line-height: 1.6;
  max-width: 360px;
  margin: 0 auto;
}

.confirm-actions {
  display: flex;
  gap: 10px;
  justify-content: flex-end;
  padding-top: 18px;
  border-top: 1px solid var(--line);
}

.confirm-actions .btn {
  min-width: 110px;
  padding: 12px 22px;
}

.btn-danger-solid {
  background: var(--accent);
  color: #fff;
  border-color: var(--accent);
}

.btn-danger-solid:hover {
  background: #b13d18;
  border-color: #b13d18;
  color: #fff;
}

/* Mobile */
@media (max-width: 520px) {
  .confirm-dialog {
    padding: 30px 22px 20px;
  }
  .confirm-actions {
    flex-direction: column-reverse;
  }
  .confirm-actions .btn {
    width: 100%;
  }
}



.notice {
  position: relative;
  background: var(--paper);
  border: 1px solid var(--line);
  padding: 16px 20px 16px 50px;
  margin-bottom: 20px;
  font-size: 13px;
  line-height: 1.6;
  color: var(--ink);
  border-radius: 2px;
  transition: all 0.2s ease;
}

.notice::before {
  position: absolute;
  left: 18px;
  top: 18px;
  font-size: 16px;
  line-height: 1;
  opacity: 0.9;
}

.notice-title {
  font-size: 10px;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  font-weight: 700;
  margin-bottom: 6px;
  display: block;
}

.notice-body {
  color: var(--muted);
  font-size: 13px;
  line-height: 1.65;
}

.notice-body b, .notice-body strong {
  color: var(--ink);
  font-weight: 600;
}

.notice-divider {
  margin-top: 12px;
  padding-top: 10px;
  border-top: 1px dashed var(--line);
  font-size: 11px;
  color: var(--muted);
}

.notice-tags {
  display: inline-flex;
  gap: 6px;
  margin: 0 4px;
  flex-wrap: wrap;
}

.notice-tag {
  display: inline-block;
  padding: 2px 8px;
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 0.05em;
  text-transform: uppercase;
  border-radius: 2px;
  white-space: nowrap;
}

.notice-tag.pay {
  background: var(--accent);
  color: #fff;
}

.notice-tag.no-pay {
  background: var(--ink);
  color: var(--paper);
  opacity: 0.55;
}

.notice-tag.warning {
  background: var(--gold);
  color: #fff;
}

/* Tipos de notice */

.notice-info {
  border-left: 3px solid var(--accent-2);
  background: var(--card);
}
.notice-info::before { content: "ℹ"; color: var(--accent-2); font-size: 18px; font-weight: 700; }
.notice-info .notice-title { color: var(--accent-2); }

.notice-warning {
  border-left: 3px solid var(--gold);
  background: linear-gradient(90deg, #fffbf3 0%, var(--card) 100%);
}
.notice-warning::before { content: "⏱"; color: var(--gold); font-size: 17px; }
.notice-warning .notice-title { color: var(--gold); }

.notice-danger {
  border-left: 3px solid var(--accent);
  background: linear-gradient(90deg, #fff5f0 0%, var(--card) 100%);
}
.notice-danger::before { content: "⚠"; color: var(--accent); font-size: 18px; font-weight: 700; }
.notice-danger .notice-title { color: var(--accent); }

.notice-success {
  border-left: 3px solid var(--accent-2);
  background: var(--card);
}
.notice-success::before { content: "✓"; color: var(--accent-2); font-size: 16px; font-weight: 700; }
.notice-success .notice-title { color: var(--accent-2); }

.notice-tip {
  border-left: 3px solid var(--gold);
  background: var(--card);
  padding: 14px 18px 14px 46px;
  font-size: 12px;
}
.notice-tip::before { content: "💡"; left: 14px; top: 14px; font-size: 14px; }

/* Stats inline en notice */
.notice-stats {
  display: flex;
  gap: 22px;
  flex-wrap: wrap;
  margin: 10px 0 4px;
}

.notice-stats > div {
  display: flex;
  align-items: baseline;
  gap: 6px;
}

.notice-stats .num {
  font-family: 'Fraunces', serif;
  font-size: 22px;
  font-weight: 600;
  color: var(--ink);
  line-height: 1;
}

.notice-stats .lbl {
  font-size: 11px;
  color: var(--muted);
  text-transform: uppercase;
  letter-spacing: 0.06em;
}

/* Banner sutil */
.notice-banner {
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 12px 18px;
  background: var(--card);
  border: 1px solid var(--line);
  margin-bottom: 18px;
  font-size: 12px;
  flex-wrap: wrap;
}

.notice-banner-label {
  font-size: 10px;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  font-weight: 700;
  color: var(--muted);
}

/* Panels */

.panel {
  background: #fff;
  border: 1px solid rgba(0, 0, 0, 0.06);
  margin-bottom: 24px;
  border-radius: 14px;
  overflow: hidden;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.04), 0 8px 24px rgba(0, 0, 0, 0.03);
}

.panel-head {
  padding: 20px 24px;
  border-bottom: 1px solid var(--line);
  display: flex;
  justify-content: space-between;
  align-items: center;
  background: var(--card);
}

.panel-head h3 {
  font-family: 'Fraunces', serif;
  font-size: 22px;
  font-weight: 600;
  margin: 0;
  letter-spacing: -0.5px;
}

.panel-body {
  padding: 24px;
}

/* Tables */

table {
  width: 100%;
  border-collapse: collapse;
}

th {
  text-align: left;
  font-size: 10px;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: var(--muted);
  padding: 14px 22px;
  border-bottom: 1px solid var(--line);
  background: var(--paper-2);
  font-weight: 600;
}

td {
  padding: 16px 22px;
  border-bottom: 1px solid rgba(26, 29, 34, 0.08);
  font-size: 14px;
  vertical-align: middle;
}

tr:last-child td {
  border-bottom: none;
}

tr:hover td {
  background: var(--paper-2);
}

/* Pills */

.pill {
  display: inline-block;
  padding: 3px 10px;
  font-size: 10px;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  border: 1px solid var(--line);
  background: var(--paper);
  font-weight: 600;
}

.pill.green {
  background: var(--accent-2);
  color: #fff;
  border-color: var(--accent-2);
}

.pill.red {
  background: var(--accent);
  color: #fff;
  border-color: var(--accent);
}

.pill.gold {
  background: var(--gold);
  color: #fff;
  border-color: var(--gold);
}

.pill.gray {
  background: #ddd;
  color: #444;
  border-color: #bbb;
}

.money {
  font-family: 'JetBrains Mono', monospace;
  font-weight: 600;
}

/* Dealer cards */

.dealer-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
  gap: 18px;
}

.dealer-card {
  background: #fff;
  border: 1px solid rgba(0, 0, 0, 0.06);
  padding: 24px;
  transition: all 0.25s ease;
  border-radius: 16px;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.04), 0 6px 20px rgba(0, 0, 0, 0.03);
  position: relative;
  overflow: hidden;
}

.dealer-card::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 4px;
  background: linear-gradient(90deg, var(--accent) 0%, var(--gold) 100%);
  opacity: 0;
  transition: opacity 0.25s ease;
}

.dealer-card:hover {
  transform: translateY(-4px);
  box-shadow: 0 4px 8px rgba(0, 0, 0, 0.04), 0 16px 40px rgba(0, 0, 0, 0.08);
  border-color: rgba(0, 0, 0, 0.08);
}

.dealer-card:hover::before {
  opacity: 1;
}

.dealer-card .city {
  font-size: 10px;
  letter-spacing: 0.22em;
  text-transform: uppercase;
  color: var(--muted);
}

.dealer-card h4 {
  font-family: 'Fraunces', serif;
  font-weight: 600;
  font-size: 22px;
  letter-spacing: -0.5px;
  margin: 6px 0 14px;
}

.dealer-card .pills {
  margin-bottom: 14px;
  display: flex;
  gap: 6px;
  flex-wrap: wrap;
}

.dealer-card .meta {
  display: flex;
  justify-content: space-between;
  padding-top: 18px;
  border-top: 1px dashed var(--line);
  font-size: 12px;
  margin-top: 6px;
}

.dealer-card .meta b {
  font-family: 'Fraunces', serif;
  font-size: 18px;
  font-weight: 600;
  display: block;
}

.dealer-card .meta span {
  color: var(--muted);
  font-size: 10px;
  letter-spacing: 0.15em;
  text-transform: uppercase;
}

.dealer-card .actions {
  margin-top: 16px;
  display: flex;
  gap: 8px;
}

.dealer-card .actions .btn {
  flex: 1;
  font-size: 10px;
  padding: 9px;
}

/* Empty state */

.empty-state {
  padding: 80px 22px;
  text-align: center;
  color: var(--muted);
}

.empty-state h4 {
  font-family: 'Fraunces', serif;
  font-size: 26px;
  color: var(--ink);
  margin: 0 0 10px;
  font-weight: 600;
}

.empty-state p {
  font-size: 14px;
  max-width: 400px;
  margin: 0 auto 24px;
  line-height: 1.5;
}

/* Modal */

.modal-bg {
  position: fixed;
  inset: 0;
  background: rgba(11, 13, 16, 0.5);
  display: none;
  align-items: center;
  justify-content: center;
  z-index: 100;
  backdrop-filter: blur(6px);
  -webkit-backdrop-filter: blur(6px);
  padding: 20px;
}

.modal-bg.show {
  display: flex;
  animation: modalFadeIn 0.2s ease;
}

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

.modal {
  background: var(--paper);
  border: 1px solid rgba(0, 0, 0, 0.06);
  width: 100%;
  max-width: 580px;
  max-height: 90vh;
  overflow-y: auto;
  box-shadow: 0 25px 80px rgba(0, 0, 0, 0.25), 0 4px 12px rgba(0, 0, 0, 0.08);
  border-radius: 16px;
  animation: modalSlideUp 0.25s cubic-bezier(0.34, 1.56, 0.64, 1);
}

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

.modal-head {
  padding: 24px 28px;
  border-bottom: 1px solid var(--line);
  display: flex;
  justify-content: space-between;
  align-items: center;
  background: var(--card);
  border-radius: 16px 16px 0 0;
}

.modal-head h3 {
  font-family: 'Fraunces', serif;
  font-size: 24px;
  font-weight: 600;
  margin: 0;
  letter-spacing: -0.5px;
}

.modal-head .close {
  background: rgba(0, 0, 0, 0.04);
  border: none;
  font-size: 18px;
  color: var(--muted);
  width: 32px;
  height: 32px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: all 0.15s;
}

.modal-head .close:hover {
  background: var(--red);
  color: #fff;
  transform: rotate(90deg);
}

.modal-body {
  padding: 28px;
}

.modal-foot {
  padding: 18px 28px;
  border-top: 1px solid var(--line);
  display: flex;
  justify-content: flex-end;
  gap: 10px;
  background: var(--card);
  border-radius: 0 0 16px 16px;
}

.field-row {
  display: flex;
  gap: 14px;
}

.field-row .field {
  flex: 1;
}

/* Toast notifications */

.toast {
  position: fixed;
  bottom: 24px;
  right: 24px;
  background: var(--ink);
  color: var(--paper);
  padding: 14px 18px;
  font-size: 13px;
  z-index: 200;
  max-width: 360px;
  transform: translateY(20px);
  opacity: 0;
  transition: all 0.3s;
  border-left: 3px solid var(--accent-2);
}

.toast.show {
  transform: translateY(0);
  opacity: 1;
}

.toast.error {
  border-left-color: var(--accent);
}

.toast strong {
  display: block;
  font-size: 11px;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  margin-bottom: 4px;
  color: var(--accent);
}

/* Loading spinner */

.spinner {
  width: 14px;
  height: 14px;
  border: 2px solid rgba(255, 255, 255, 0.3);
  border-top-color: var(--paper);
  border-radius: 50%;
  animation: spin 0.6s linear infinite;
  display: inline-block;
}

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

.loading-page {
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 100vh;
  color: var(--muted);
  font-size: 12px;
  letter-spacing: 0.22em;
  text-transform: uppercase;
}

/* ════════════════════════════════════════════════════════════
   RESPONSIVE — Optimización para móvil y tablet
   ════════════════════════════════════════════════════════════ */

/* Reset global para evitar scroll horizontal */
html, body {
  max-width: 100%;
  overflow-x: hidden;
}

/* Mobile menu toggle button (solo visible en móvil) */
.mobile-menu-toggle {
  display: none;
  position: fixed;
  top: 12px;
  left: 12px;
  z-index: 100;
  width: 44px;
  height: 44px;
  background: var(--ink);
  color: var(--paper);
  border: none;
  border-radius: 4px;
  cursor: pointer;
  align-items: center;
  justify-content: center;
  font-size: 22px;
  box-shadow: 0 4px 12px rgba(0,0,0,0.18);
}

.mobile-menu-toggle svg {
  width: 22px;
  height: 22px;
}

/* Overlay para cuando el sidebar está abierto */
.sidebar-overlay {
  display: none;
  position: fixed;
  inset: 0;
  background: rgba(15, 17, 21, 0.55);
  backdrop-filter: blur(3px);
  z-index: 98;
}

.sidebar-overlay.show {
  display: block;
}

/* TABLET (≤ 1024px) */
@media (max-width: 1024px) {
  .login-wrap { grid-template-columns: 1fr; }
  .login-left { display: none; }
  .login-right { padding: 40px 28px; }
  .mobile-logo { display: block; }
  .login-card h3 { font-size: 36px; }
  
  .main { padding: 24px 20px; }
  .page-head h2 { font-size: 32px; }
  
  /* Grids → 2 columnas en tablet */
  .kpi-grid { grid-template-columns: repeat(2, 1fr) !important; }
  .dealer-grid { grid-template-columns: repeat(2, 1fr) !important; }
}

/* MOBILE (≤ 768px) — Cambio mayor: sidebar oculto, hamburguesa */
@media (max-width: 768px) {
  /* ════════════════════════════════════════════════════════
     CRÍTICO: Forzar TODOS los grids inline a adaptarse
     Cualquier elemento con display:grid que tenga columnas
     se vuelve responsive automáticamente
     ════════════════════════════════════════════════════════ */
  
  .main [style*="display:grid"],
  .main [style*="display: grid"],
  .main .kpi-grid {
    grid-template-columns: 1fr !important;
    width: 100% !important;
    max-width: 100% !important;
    gap: 12px !important;
    box-sizing: border-box;
  }
  
  /* KPIs siempre en 2 columnas para optimizar pantalla */
  .main .kpi-grid {
    grid-template-columns: 1fr 1fr !important;
    gap: 10px !important;
  }
  
  /* Cualquier hijo de un grid no se desborda */
  .main [style*="display:grid"] > *,
  .main [style*="display: grid"] > *,
  .main .kpi-grid > * {
    min-width: 0 !important;
    max-width: 100% !important;
    overflow: hidden;
    word-wrap: break-word;
  }
  
  /* Cualquier elemento con padding excesivo se ajusta */
  .main [style*="padding:32px"],
  .main [style*="padding: 32px"] {
    padding: 22px 16px !important;
  }
  
  /* Fuentes serif gigantes se reducen */
  .main [style*="font-size:54px"],
  .main [style*="font-size: 54px"] {
    font-size: 36px !important;
  }
  
  .main [style*="font-size:64px"],
  .main [style*="font-size: 64px"] {
    font-size: 38px !important;
  }
  
  .main [style*="font-size:36px"],
  .main [style*="font-size: 36px"] {
    font-size: 26px !important;
  }
  
  /* Línea divisora vertical → horizontal */
  .main [style*="border-left:1px solid rgba(244,239,230"],
  .main [style*="border-left: 1px solid rgba(244,239,230"] {
    border-left: none !important;
    border-top: 1px solid rgba(244,239,230,0.2);
    padding-left: 0 !important;
    padding-top: 18px !important;
    text-align: left !important;
  }
  
  .main [style*="border-left:1px solid var(--line)"] {
    border-left: none !important;
    border-top: 1px solid var(--line);
    padding-left: 0 !important;
    padding-top: 14px !important;
  }
  
  /* Layout principal */
  .app {
    grid-template-columns: 1fr;
    width: 100%;
    overflow-x: hidden;
  }
  
  .main {
    width: 100%;
    max-width: 100vw;
    overflow-x: hidden;
    padding: 64px 14px 24px;
    box-sizing: border-box;
  }
  
  /* Banner de confidencialidad ajustado */
  .confidentiality-banner {
    padding: 6px 56px 6px 56px;
    font-size: 9px;
    letter-spacing: 0.1em;
    line-height: 1.4;
  }
  
  /* Sidebar fijo deslizante */
  .sidebar {
    position: fixed;
    left: -280px;
    top: 0;
    width: 280px;
    height: 100vh;
    z-index: 99;
    transition: left 0.25s ease;
    box-shadow: 4px 0 20px rgba(0,0,0,0.15);
    overflow-y: auto;
  }
  
  .sidebar.open {
    left: 0;
  }
  
  /* En móvil, main no tiene margin izquierdo (sidebar oculto) */
  .main {
    margin-left: 0 !important;
  }
  
  /* Mostrar el botón hamburguesa */
  .mobile-menu-toggle {
    display: flex;
  }
  
  /* KPIs en sus tipografías grandes */
  .kpi-grid > div {
    padding: 14px !important;
    min-width: 0;
    overflow: hidden;
  }
  
  .kpi-grid > div [style*="font-size:32px"],
  .kpi-grid > div [style*="font-size: 32px"],
  .kpi-grid > div [style*="font-size:36px"],
  .kpi-grid > div [style*="font-size: 36px"] {
    font-size: 22px !important;
  }
  
  /* Page head ajustes */
  .page-head {
    flex-direction: column;
    align-items: flex-start;
    gap: 14px;
    margin-bottom: 20px;
  }
  
  .page-head h2 {
    font-size: 26px !important;
  }
  
  .crumb {
    font-size: 10px;
    letter-spacing: 0.12em;
  }
  
  /* Botones de acción full width */
  .head-actions {
    width: 100%;
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
  }
  
  .head-actions .btn {
    flex: 1;
    min-width: 120px;
    padding: 12px 14px;
  }
  
  /* Notice más compacto y NO se desborda */
  .notice {
    padding: 14px 14px 14px 44px;
    font-size: 12px;
    width: 100%;
    box-sizing: border-box;
    word-wrap: break-word;
    overflow-wrap: break-word;
  }
  
  .notice::before {
    left: 14px;
    top: 16px;
  }
  
  .notice-title {
    font-size: 9px;
    line-height: 1.4;
  }
  
  .notice-body {
    font-size: 12px;
    line-height: 1.55;
  }
  
  .notice-tag {
    font-size: 9px;
    padding: 2px 6px;
    display: inline-block;
    margin: 1px 2px;
    white-space: nowrap;
  }
  
  /* Stats dentro de notice → vertical en móvil */
  .notice-stats {
    flex-direction: column;
    gap: 6px;
    margin-top: 8px;
  }
  
  .notice-stats > div {
    flex-direction: row;
    align-items: baseline;
  }
  
  .notice-stats .num {
    font-size: 16px;
  }
  
  /* Tablas → scroll horizontal solo en el panel */
  .panel {
    width: 100%;
    max-width: 100%;
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
    box-sizing: border-box;
  }
  
  table {
    min-width: 600px;
  }
  
  /* Cards de dealers → 1 columna */
  .dealer-grid {
    grid-template-columns: 1fr !important;
    width: 100%;
  }
  
  /* Form rows en columna */
  .field-row {
    flex-direction: column;
    gap: 0;
  }
  
  /* Modales full screen */
  .modal {
    max-width: 100% !important;
    width: 100%;
    max-height: 100vh;
    height: 100vh;
    border-radius: 0;
    margin: 0;
  }
  
  .modal-body {
    max-height: calc(100vh - 130px);
  }
  
  /* Filtros stack vertical */
  .filter-bar {
    flex-direction: column;
    align-items: stretch !important;
  }
  
  .filter-bar > * {
    width: 100% !important;
    box-sizing: border-box;
  }
  
  /* Pills más legibles */
  .pill {
    font-size: 10px;
    padding: 3px 8px;
  }
  
  /* Botones de tabla más grandes para touch */
  table .btn {
    padding: 8px 12px !important;
    font-size: 11px !important;
    min-height: 36px;
  }
  
  /* Paginación responsive */
  .pag-btn {
    padding: 8px 10px;
    font-size: 11px;
    min-width: 32px;
  }
  
  /* Confirm modal en móvil */
  .confirm-dialog {
    padding: 28px 20px 18px;
    margin: 10px;
  }
  
  .confirm-actions {
    flex-direction: column-reverse;
  }
  
  .confirm-actions .btn {
    width: 100%;
  }
  
  /* Iconos en nav más grandes para touch */
  .nav-item {
    padding: 14px 16px !important;
    font-size: 14px !important;
  }
  
  /* Brand pequeño en sidebar */
  .side-brand h1 {
    font-size: 15px;
  }
  
  /* Toast no se sale de pantalla */
  .toast {
    left: 12px !important;
    right: 12px !important;
    bottom: 12px !important;
    max-width: calc(100vw - 24px);
    width: auto !important;
  }
  
  /* H3 titulares en secciones */
  .main h3 {
    font-size: 18px !important;
  }
}

/* MOBILE PEQUEÑO (≤ 480px) */
@media (max-width: 480px) {
  .main {
    padding: 64px 10px 20px;
  }
  
  .page-head h2 {
    font-size: 22px !important;
  }
  
  /* KPIs aún más compactos */
  .kpi-grid > div {
    padding: 10px !important;
  }
  
  .kpi-grid > div [style*="font-size:32px"],
  .kpi-grid > div [style*="font-size: 32px"] {
    font-size: 20px !important;
  }
  
  /* Banner confidencialidad muy compacto */
  .confidentiality-banner {
    padding: 5px 50px;
    font-size: 8px;
    letter-spacing: 0.08em;
  }
  
  /* Texto del crumb más pequeño */
  .crumb {
    font-size: 9px;
  }
  
  /* Modal aún más compacto */
  .modal-head {
    padding: 14px 16px !important;
  }
  
  .modal-body {
    padding: 16px !important;
  }
  
  .modal-foot {
    padding: 12px 16px !important;
  }
  
  /* Notice más compacto */
  .notice {
    padding: 12px 12px 12px 40px;
  }
  
  /* Dashboard banner de pago muy compacto */
  .main [style*="font-size:54px"] {
    font-size: 32px !important;
  }
  
  .main [style*="font-size:64px"] {
    font-size: 36px !important;
  }
}

/* ═══════════════════════════════════════════════════
   CELEBRACIÓN DE VENTA — Modal + Confeti
   ═══════════════════════════════════════════════════ */

.celebration-overlay {
  position: fixed;
  inset: 0;
  background: rgba(11, 13, 16, 0);
  z-index: 9999;
  display: flex;
  align-items: center;
  justify-content: center;
  opacity: 0;
  transition: opacity 0.4s ease, background 0.4s ease;
  pointer-events: none;
  overflow: hidden;
}

.celebration-overlay.show {
  opacity: 1;
  background: rgba(11, 13, 16, 0.85);
  pointer-events: auto;
}

.celebration-modal {
  background: linear-gradient(135deg, #fbf7ee 0%, #f4efe6 100%);
  border: 3px solid var(--gold);
  border-radius: 0;
  padding: 50px 60px;
  text-align: center;
  position: relative;
  z-index: 10;
  box-shadow: 0 30px 80px rgba(0,0,0,0.4), 0 0 0 1px rgba(184, 146, 58, 0.3);
  max-width: 480px;
  width: 90%;
  transform: scale(0.7) translateY(20px);
  transition: transform 0.5s cubic-bezier(0.34, 1.56, 0.64, 1);
}

.celebration-overlay.show .celebration-modal {
  transform: scale(1) translateY(0);
}

.celebration-trophy {
  font-size: 80px;
  line-height: 1;
  margin-bottom: 16px;
  animation: trophyBounce 1.2s cubic-bezier(0.34, 1.56, 0.64, 1) infinite alternate;
  display: inline-block;
}

@keyframes trophyBounce {
  from { transform: translateY(0) rotate(-5deg); }
  to { transform: translateY(-12px) rotate(5deg); }
}

.celebration-title {
  font-family: 'Fraunces', serif;
  font-size: 42px;
  font-weight: 700;
  color: var(--accent-2);
  letter-spacing: -1px;
  margin-bottom: 8px;
  text-shadow: 0 2px 0 rgba(31, 107, 74, 0.15);
}

.celebration-subtitle {
  font-size: 16px;
  color: var(--ink);
  font-weight: 500;
  letter-spacing: 0.5px;
  margin-bottom: 14px;
}

.celebration-cliente {
  font-family: 'Fraunces', serif;
  font-size: 22px;
  color: var(--gold);
  font-weight: 600;
  margin-bottom: 14px;
  padding: 8px 16px;
  background: rgba(184, 146, 58, 0.08);
  border-left: 3px solid var(--gold);
  display: inline-block;
}

.celebration-msg {
  font-size: 14px;
  color: var(--muted);
  margin-bottom: 28px;
  font-style: italic;
}

.celebration-btn {
  background: var(--accent-2);
  color: #fff;
  border: none;
  padding: 14px 36px;
  font-family: 'Inter Tight', sans-serif;
  font-size: 14px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  cursor: pointer;
  transition: all 0.2s;
  font-family: inherit;
}

.celebration-btn:hover {
  background: var(--ink);
  transform: translateY(-2px);
  box-shadow: 0 6px 20px rgba(31, 107, 74, 0.3);
}

/* Confeti animado */
.celebration-confetti {
  position: absolute;
  inset: 0;
  pointer-events: none;
  overflow: hidden;
}

.confetti-piece {
  position: absolute;
  top: -10px;
  width: 10px;
  height: 14px;
  opacity: 0.9;
  animation: confettiFall linear infinite;
}

@keyframes confettiFall {
  0% {
    transform: translateY(-100vh) rotate(0deg);
    opacity: 1;
  }
  100% {
    transform: translateY(100vh) rotate(720deg);
    opacity: 0.7;
  }
}

/* Responsive */
@media (max-width: 640px) {
  .celebration-modal {
    padding: 36px 28px;
  }
  
  .celebration-trophy {
    font-size: 64px;
  }
  
  .celebration-title {
    font-size: 32px;
  }
  
  .celebration-subtitle {
    font-size: 14px;
  }
  
  .celebration-cliente {
    font-size: 18px;
  }
}

/* ═══════════════════════════════════════════════════
   MODERNIZACIÓN GENERAL — Bordes redondeados y sombras
   ═══════════════════════════════════════════════════ */

/* KPI cards y otras tarjetas inline */
.kpi-grid > div,
.main [style*="background:var(--card)"][style*="border:1px solid var(--line)"],
.main [style*="background: var(--card)"][style*="border: 1px solid var(--line)"] {
  border-radius: 14px !important;
  box-shadow: 0 1px 2px rgba(0,0,0,0.03), 0 4px 16px rgba(0,0,0,0.03);
  transition: transform 0.2s, box-shadow 0.2s;
}

/* Hero card (la grande negra del dashboard) */
.main [style*="background:linear-gradient(135deg,var(--ink)"],
.main [style*="background: linear-gradient(135deg, var(--ink)"] {
  border-radius: 18px !important;
  box-shadow: 0 8px 30px rgba(11, 13, 16, 0.18), 0 2px 8px rgba(11, 13, 16, 0.08);
}

/* Pills más modernos */
.pill {
  border-radius: 999px !important;
  padding: 4px 11px !important;
  font-size: 10.5px;
  letter-spacing: 0.06em;
  font-weight: 600;
}

/* Notices con bordes redondeados */
.notice {
  border-radius: 12px !important;
}

/* Tablas dentro de paneles */
.panel table {
  border-radius: 0;
}

.panel table th {
  background: var(--card);
}

.panel table tr:hover td {
  background: var(--paper-2);
}

/* Sidebar más suave */
.side-brand .brand-mark-img {
  border-radius: 0;
}

/* Inputs número con altura uniforme */
.field input[type="number"] {
  -moz-appearance: textfield;
}

.field input[type="number"]::-webkit-inner-spin-button,
.field input[type="number"]::-webkit-outer-spin-button {
  -webkit-appearance: none;
  margin: 0;
}

/* Etiquetas obligatorias con asterisco más visible */
.field label::after {
  display: none;
}

/* Hover sutil en filas de tabla */
tr {
  transition: background 0.12s ease;
}

/* Selects con flecha custom mejor */
.field select {
  background-image: url("data:image/svg+xml;charset=utf-8,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 24 24' fill='none' stroke='%236b6660' stroke-width='2.5' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpolyline points='6 9 12 15 18 9'%3E%3C/polyline%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 14px center;
  background-size: 14px;
  padding-right: 42px;
  appearance: none;
  -webkit-appearance: none;
  -moz-appearance: none;
  cursor: pointer;
}

/* Excepción: selects que no son de .field (ej. en el modal de horas) */
select:not(.field select) {
  appearance: auto;
}

/* Mejor sombra del shadow base */
:root {
  --shadow: 0 1px 3px rgba(0,0,0,0.04), 0 8px 24px rgba(0,0,0,0.06);
}

/* Avatares un poco más suaves */
.avatar {
  box-shadow: 0 2px 6px rgba(0,0,0,0.1);
}

/* Toast más moderno */
.toast {
  border-radius: 12px !important;
  box-shadow: 0 4px 20px rgba(0,0,0,0.15) !important;
}

/* ═══════════════════════════════════════════════════
   RESPONSIVE — Tablets y Móvil
   ═══════════════════════════════════════════════════ */

/* Tablets (1024px y menos): Cards de dealer 2 por fila */
@media (max-width: 1024px) {
  /* Cards del detalle por dealer */
  [style*="minmax(380px,1fr)"] {
    grid-template-columns: 1fr 1fr !important;
  }
}

/* Tablet pequeño (768px y menos): 1 card por fila */
@media (max-width: 768px) {
  [style*="minmax(380px,1fr)"],
  [style*="minmax(340px,1fr)"],
  [style*="minmax(280px,1fr)"] {
    grid-template-columns: 1fr !important;
  }
  
  /* Grids de pipeline en 3 columnas en lugar de 6 */
  [style*="grid-template-columns:repeat(6,1fr)"] {
    grid-template-columns: repeat(3, 1fr) !important;
  }
  
  /* Grids de KPIs en 2 columnas en lugar de 3+ */
  [style*="grid-template-columns:repeat(3,1fr)"] {
    grid-template-columns: 1fr 1fr !important;
  }
  
  /* Tipografía un poco más grande en móvil */
  body {
    font-size: 15px;
  }
  
  .field input,
  .field select,
  .field textarea {
    font-size: 16px; /* 16px previene zoom en iOS */
  }
  
  /* Botones más cómodos para tap */
  .btn, .btn-primary, .btn-accent, .btn-danger {
    padding: 12px 18px;
    font-size: 13px;
  }
  
  /* Modal full-width en móvil */
  .modal {
    max-width: 96vw;
    max-height: 92vh;
    margin: 10px;
  }
  
  .modal-head {
    padding: 18px 20px;
  }
  
  .modal-body {
    padding: 20px;
  }
  
  .modal-foot {
    padding: 14px 20px;
    flex-direction: column-reverse;
  }
  
  .modal-foot .btn {
    width: 100%;
  }
  
  /* Field-row en móvil: stack vertical */
  .field-row {
    flex-direction: column;
    gap: 0;
  }
  
  /* Pages */
  .page-head {
    flex-direction: column;
    align-items: flex-start;
    gap: 12px;
  }
  
  .page-head h2 {
    font-size: 26px;
  }
  
  /* Filtros se apilan */
  .filter-bar {
    flex-direction: column;
    align-items: stretch !important;
  }
  
  .filter-bar > * {
    width: 100% !important;
  }
  
  /* Tablas con scroll horizontal */
  .panel {
    overflow-x: auto;
  }
  
  table {
    min-width: 600px;
  }
  
  /* Dealer cards también */
  .dealer-card {
    padding: 18px;
  }
}

/* Móvil pequeño (480px y menos) */
@media (max-width: 480px) {
  /* Pipeline en 2 columnas */
  [style*="grid-template-columns:repeat(6,1fr)"],
  [style*="grid-template-columns:repeat(3,1fr)"] {
    grid-template-columns: 1fr 1fr !important;
  }
  
  /* Ocultar etiquetas largas */
  .crumb {
    font-size: 10px;
  }
  
  /* Padding general más compacto */
  .main {
    padding: 16px !important;
  }
  
  /* Cards más compactas */
  [style*="padding:22px 24px"] {
    padding: 16px 18px !important;
  }
  
  /* Tipografías grandes más pequeñas en móvil */
  [style*="font-size:54px"] {
    font-size: 36px !important;
  }
  
  [style*="font-size:64px"] {
    font-size: 40px !important;
  }
  
  [style*="font-size:36px"] {
    font-size: 26px !important;
  }
  
  /* Header del page */
  .page-head h2 {
    font-size: 22px;
  }
}

/* Botón hamburguesa visible en móvil */
.mobile-menu-toggle {
  display: none;
  position: fixed;
  top: 14px;
  left: 14px;
  z-index: 100;
  width: 42px;
  height: 42px;
  background: var(--ink);
  color: var(--paper);
  border: none;
  border-radius: 10px;
  cursor: pointer;
  align-items: center;
  justify-content: center;
  box-shadow: 0 4px 12px rgba(0,0,0,0.2);
}

@media (max-width: 1024px) {
  .mobile-menu-toggle {
    display: flex;
  }
}

/* ════════════════════════════════════════════════════════════════
   v14.42: Cards de selección de aliados (modal BDC)
   ═══════════════════════════════════════════════════════════════ */

.aliado-card {
  transition: all 0.18s ease;
  position: relative;
}

.aliado-card:hover {
  transform: translateX(2px);
  border-color: var(--ink) !important;
  opacity: 1 !important;
}

.aliado-card.aliado-card-selected {
  background: linear-gradient(to right, rgba(196,165,114,0.05), rgba(255,255,255,0));
}

.aliado-card input[type="checkbox"] {
  margin: 0;
}

/* Modo oscuro */
[data-theme="dark"] .aliado-card {
  background: var(--paper-2) !important;
}

[data-theme="dark"] .aliado-card.aliado-card-selected {
  background: linear-gradient(to right, rgba(196,165,114,0.15), var(--paper-2)) !important;
}
