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

:root {
  /* Semantic Variables (Dark Mode Default) */
  --bg-app:       #0A111E;
  --bg-panel:     #080D17;
  --bg-card:      #0F172A;
  --bg-header:    #0F1A2D;
  --bg-input:     #1E293B;
  
  --text-main:    #FFFFFF;
  --text-muted:   #94A3B8;
  --text-invert:  #0F172A;
  
  --border-subtle: rgba(255, 255, 255, 0.08);
  --border-strong: rgba(255, 255, 255, 0.15);
  
  --accent-primary: #0284C7;
  --accent-hover:   #0369A1;
  --accent-glow:    rgba(0, 240, 255, 0.35);
  
  --cyan:         #00F0FF;
  --blue-elec:    #2563EB;
  --green:        #10B981;
  --red:          #EF4444;
  --gold:         #F59E0B;
  --amber:        #D97706;
  
  --iblu:         rgba(37, 99, 235, 0.12);
  --igrn:         rgba(16, 185, 129, 0.12);
  --iamb:         rgba(245, 158, 11, 0.12);
  --ired:         rgba(239, 68, 68, 0.12);

  /* Legacy variable mappings (for backwards compatibility) */
  --navy:         var(--bg-app);
  --navy-header:  var(--bg-header);
  --off:          var(--bg-panel);
  --lgray:        var(--bg-input);
  --dark:         var(--bg-card);
  --white:        var(--text-main);
  --mid:          var(--text-muted);
  --teal:         var(--accent-primary);
  --teal2:        var(--accent-hover);
  --cyan-glow:    var(--accent-glow);
  --cyan-dim:     rgba(0, 240, 255, 0.08);
  --border-card:  var(--border-subtle);
  --border-bright:var(--border-strong);


  /* Tipografía */
  --font:         'Plus Jakarta Sans', -apple-system, system-ui, sans-serif;
  --font-display: 'Space Grotesk', sans-serif;
  --font-mono:    'JetBrains Mono', monospace;

  /* Radios & Sombras */
  --radius-sm: 6px;
  --radius-md: 10px;
  --radius-lg: 14px;
  --shadow-sm: 0 2px 8px rgba(0,0,0,0.3);
  --shadow-md: 0 8px 24px rgba(0,0,0,0.4);
  --shadow-card: 0 10px 30px rgba(0, 0, 0, 0.45);
}

:root.light-mode {
  --bg-app:       #F8FAFC;
  --bg-panel:     #F1F5F9;
  --bg-card:      #FFFFFF;
  --bg-header:    #FFFFFF;
  --bg-input:     #F8FAFC;
  
  --text-main:    #0F172A;
  --text-muted:   #64748B;
  --text-invert:  #FFFFFF;
  
  --border-subtle: #E2E8F0;
  --border-strong: #CBD5E1;
  
  --accent-primary: #0284C7;
  --accent-hover:   #0369A1;
  --accent-glow:    rgba(2, 132, 199, 0.15);
  
  --cyan:         #0284C7; /* Adapting cyan to a readable blue in light mode */
  
  --shadow-sm: 0 1px 3px rgba(0,0,0,0.1);
  --shadow-md: 0 4px 6px rgba(0,0,0,0.05);
  --shadow-card: 0 4px 12px rgba(0, 0, 0, 0.05);
}

html {
  overscroll-behavior-y: contain;
  background-color: var(--bg-app);
}

body {
  font-family: var(--font);
  background: var(--navy);
  color: var(--text-main);
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  overscroll-behavior-y: contain;
}

/* ── SCROLLBARS PROFESIONALES Y FÁCILES DE USAR EN LAPTOP ── */
::-webkit-scrollbar {
  width: 12px;
  height: 12px;
}
::-webkit-scrollbar-track {
  background: var(--bg-panel);
}
::-webkit-scrollbar-thumb {
  background: #25476E;
  border-radius: 6px;
  border: 2px solid #0B1424;
}
::-webkit-scrollbar-thumb:hover {
  background: #00F0FF;
}
::-webkit-scrollbar-corner {
  background: var(--bg-panel);
}


/* ── PANTALLA DE CARGA (splash) con animación de auto y check ── */
#loading-screen {
  position: fixed;
  inset: 0;
  z-index: 9999;
  background: radial-gradient(circle at 50% 38%, #132D4B 0%, #0A192F 60%, #050B14 100%);
  display: flex;
  align-items: center;
  justify-content: center;
  transition: opacity 0.5s cubic-bezier(0.16, 1, 0.3, 1), visibility 0.5s ease;
}
#loading-screen.ag-hidden {
  opacity: 0;
  visibility: hidden;
  pointer-events: none;
}

.ag-loading-inner {
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  padding: 2rem 1.5rem;
  max-width: 380px;
  width: 100%;
}

.ag-car-stage {
  position: relative;
  width: 140px;
  height: 140px;
  display: flex;
  align-items: center;
  justify-content: center;
}

.ag-speed-trail {
  position: absolute;
  left: -40px;
  top: 50%;
  transform: translateY(-50%);
  width: 100px;
  height: 4px;
  background: linear-gradient(90deg, transparent, rgba(56, 189, 248, 0.8), transparent);
  border-radius: 99px;
  filter: blur(1px);
  opacity: 0;
  animation: ag-speed-flash 0.65s ease-out forwards;
}

.ag-logo-wrapper {
  position: relative;
  width: 96px;
  height: 96px;
  background: var(--bg-card);
  border-radius: 24px;
  padding: 10px;
  box-sizing: border-box;
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 14px 35px rgba(0, 0, 0, 0.45), 0 0 24px rgba(56, 189, 248, 0.35);
  animation: ag-car-drive 0.65s cubic-bezier(0.22, 1, 0.36, 1) forwards 0.05s;
  opacity: 0;
}

.ag-logo-img {
  width: 100%;
  height: 100%;
  object-fit: contain;
  display: block;
}

/* 2. El check de aprobación se estampa encima con resorte y glow */
.ag-check-overlay {
  position: absolute;
  bottom: -8px;
  right: -8px;
  width: 40px;
  height: 40px;
  opacity: 0;
  transform: scale(0.2) rotate(-20deg);
  filter: drop-shadow(0 4px 12px rgba(245, 166, 35, 0.9));
  animation: ag-check-pop 0.55s cubic-bezier(0.34, 1.56, 0.64, 1) forwards 0.6s;
}

.ag-check-svg {
  width: 100%;
  height: 100%;
}

.ag-wordmark {
  margin-top: 1.35rem;
  font-size: 1.75rem;
  font-weight: 900;
  letter-spacing: -0.02em;
  color: var(--text-main);
  text-shadow: 0 2px 10px rgba(0, 0, 0, 0.4);
  animation: ag-fade-up 0.5s ease forwards 0.75s;
  opacity: 0;
}
.ag-wordmark .ag-accent { color: #F5A623; }

.ag-progress-track {
  margin-top: 1.75rem;
  width: 200px;
  height: 4px;
  border-radius: 99px;
  background: rgba(255, 255, 255, 0.12);
  overflow: hidden;
  position: relative;
}
.ag-progress-fill {
  height: 100%;
  width: 40%;
  border-radius: 99px;
  background: linear-gradient(90deg, #F5A623 0%, #38BDF8 100%);
  box-shadow: 0 0 10px rgba(56, 189, 248, 0.8);
  animation: ag-progress 1.5s ease-in-out infinite alternate;
}

.ag-loading-text {
  margin-top: 0.85rem;
  font-size: 0.68rem;
  font-weight: 700;
  letter-spacing: 0.2em;
  color: rgba(255, 255, 255, 0.45);
  animation: ag-fade-in 0.5s ease forwards 0.85s;
  opacity: 0;
}

@keyframes ag-car-drive {
  0% {
    opacity: 0;
    transform: translateX(-140px) scale(0.85);
  }
  60% {
    opacity: 1;
    transform: translateX(12px) scale(1.04);
  }
  80% {
    transform: translateX(-3px) scale(0.99);
  }
  100% {
    opacity: 1;
    transform: translateX(0) scale(1);
  }
}

@keyframes ag-speed-flash {
  0%   { opacity: 0; transform: translateY(-50%) scaleX(0.2); }
  50%  { opacity: 1; transform: translateY(-50%) scaleX(1.4); }
  100% { opacity: 0; transform: translateY(-50%) scaleX(0.5); }
}

@keyframes ag-check-pop {
  0% {
    opacity: 0;
    transform: scale(0.2) rotate(-20deg);
  }
  60% {
    opacity: 1;
    transform: scale(1.25) rotate(4deg);
  }
  80% {
    transform: scale(0.96) rotate(-2deg);
  }
  100% {
    opacity: 1;
    transform: scale(1) rotate(0deg);
  }
}

@keyframes ag-fade-up {
  from { opacity: 0; transform: translateY(8px); }
  to   { opacity: 1; transform: translateY(0); }
}

@keyframes ag-fade-in {
  to { opacity: 1; }
}

@keyframes ag-progress {
  0%   { transform: translateX(-40%); width: 30%; }
  50%  { width: 65%; }
  100% { transform: translateX(240%); width: 35%; }
}

/* ── LOGIN ── */
#login-screen {
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  background: radial-gradient(circle at 50% 30%, #102138 0%, var(--off) 70%, #03060A 100%);
  padding: 1.5rem;
}

.login-card {
  background: var(--dark);
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: 18px;
  padding: 2.5rem 2rem;
  width: 100%;
  max-width: 400px;
  box-shadow: 0 25px 60px rgba(0,0,0,0.6), 0 0 30px rgba(0, 240, 255, 0.1);
  backdrop-filter: blur(16px);
}

.login-logo {
  text-align: center;
  margin-bottom: 1.5rem;
}

.login-logo-img {
  width: 160px;
  height: auto;
  border-radius: 12px;
}

.login-title {
  font-family: var(--font-display);
  font-size: 1.5rem;
  font-weight: 800;
  color: var(--text-main);
  text-align: center;
  margin-bottom: 0.25rem;
  letter-spacing: -0.02em;
}

.login-sub {
  font-size: 0.85rem;
  color: var(--mid);
  text-align: center;
  margin-bottom: 1.75rem;
}

.field {
  margin-bottom: 1.1rem;
}

.field label {
  display: block;
  font-size: 0.76rem;
  font-weight: 700;
  color: var(--mid);
  margin-bottom: 0.4rem;
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

.field input {
  width: 100%;
  padding: 0.75rem 1rem;
  background: var(--lgray);
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: 9px;
  font-size: 0.95rem;
  color: var(--text-main);
  transition: all 0.2s ease;
  outline: none;
}

.field input:focus {
  border-color: var(--cyan);
  box-shadow: 0 0 0 3px rgba(0, 240, 255, 0.15);
}

.login-btn {
  width: 100%;
  padding: 0.85rem;
  background: linear-gradient(135deg, var(--cyan) 0%, var(--blue-elec) 100%);
  color: var(--text-invert);
  border: none;
  border-radius: 9px;
  font-family: var(--font-display);
  font-size: 1rem;
  font-weight: 800;
  cursor: pointer;
  margin-top: 0.75rem;
  transition: all 0.2s ease;
  text-transform: uppercase;
  letter-spacing: 0.03em;
  box-shadow: 0 0 20px rgba(0, 240, 255, 0.3);
}

.login-btn:hover {
  transform: translateY(-1px);
  box-shadow: 0 0 25px rgba(0, 240, 255, 0.45);
}

.login-error {
  background: rgba(239, 68, 68, 0.15);
  color: #F87171;
  border: 1px solid rgba(239, 68, 68, 0.3);
  border-radius: 8px;
  padding: 0.65rem 0.9rem;
  font-size: 0.82rem;
  margin-top: 0.75rem;
  display: none;
  text-align: center;
}

/* ── APP ── */
#app-screen { display: none; flex-direction: column; min-height: 100vh; }

/* Header */
.app-header {
  background: rgba(15, 26, 45, 0.85);
  backdrop-filter: blur(14px);
  padding: 0 1.25rem;
  height: 60px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  position: sticky;
  top: 0;
  z-index: 100;
  border-bottom: 1px solid rgba(255, 255, 255, 0.08);
  box-shadow: 0 4px 20px rgba(0,0,0,0.35);
}

.header-left {
  display: flex;
  align-items: center;
  gap: 0.75rem;
}

.header-logo {
  height: 32px;
  border-radius: 6px;
}

.header-title {
  font-family: var(--font-display);
  font-size: 1.1rem;
  font-weight: 800;
  color: var(--text-main);
  letter-spacing: -0.01em;
}

.header-right {
  display: flex;
  align-items: center;
  gap: 0.75rem;
}

.user-badge {
  font-size: 0.8rem;
  color: var(--mid);
  display: flex;
  align-items: center;
  gap: 0.4rem;
}

.user-badge span {
  background: rgba(0, 240, 255, 0.12);
  color: var(--cyan);
  font-weight: 700;
  padding: 0.25rem 0.65rem;
  border-radius: 20px;
  border: 1px solid rgba(0, 240, 255, 0.25);
  font-size: 0.8rem;
}

.logout-btn {
  background: var(--lgray);
  color: #E2E8F0;
  border: 1px solid rgba(255,255,255,0.1);
  border-radius: 8px;
  padding: 0.4rem 0.8rem;
  font-size: 0.78rem;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.2s ease;
}

.logout-btn:hover {
  border-color: var(--cyan);
  color: var(--cyan);
  box-shadow: 0 0 10px rgba(0, 240, 255, 0.2);
}

/* Tabs */
.tabs {
  background: var(--off);
  display: flex;
  gap: 0.35rem;
  padding: 0.5rem 1rem;
  overflow-x: auto;
  scrollbar-width: none;
  border-bottom: 1px solid rgba(255,255,255,0.06);
}

.tabs::-webkit-scrollbar { display: none; }

.tab {
  padding: 0.55rem 0.95rem;
  color: var(--mid);
  font-size: 0.82rem;
  font-weight: 600;
  white-space: nowrap;
  cursor: pointer;
  border-radius: 8px;
  border: 1px solid transparent;
  transition: all 0.2s ease;
  letter-spacing: 0.02em;
}

.tab:hover {
  color: var(--text-main);
  background: rgba(255, 255, 255, 0.05);
}

.tab.active {
  color: var(--text-main);
  background: linear-gradient(135deg, rgba(0, 240, 255, 0.15) 0%, rgba(37, 99, 235, 0.25) 100%);
  border-color: var(--cyan);
  box-shadow: 0 0 12px rgba(0, 240, 255, 0.2);
  font-weight: 700;
}

/* Content */
.app-content {
  flex: 1;
  background: var(--off);
  padding: 1.25rem;
  background-image: 
    radial-gradient(circle at 50% 0%, rgba(37, 99, 235, 0.08) 0%, transparent 60%),
    linear-gradient(to right, rgba(255,255,255,0.015) 1px, transparent 1px),
    linear-gradient(to bottom, rgba(255,255,255,0.015) 1px, transparent 1px);
  background-size: 100% 100%, 32px 32px, 32px 32px;
}

.panel { display: none; animation: ag-fade-up 0.25s ease-out; }
.panel.active { display: block; }

/* ── CALCULADORA PANEL ── */
.calc-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 1.25rem;
  max-width: 900px;
  margin: 0 auto;
}

@media (max-width: 720px) {
  .calc-grid { grid-template-columns: 1fr; }
}

.card {
  background: var(--dark);
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 14px;
  padding: 1.35rem;
  box-shadow: 0 10px 30px rgba(0,0,0,0.35);
  transition: border-color 0.2s ease, box-shadow 0.2s ease;
}

.card:hover {
  border-color: rgba(0, 240, 255, 0.2);
}

.card-full { grid-column: 1 / -1; }

.card-title {
  font-family: var(--font-display);
  font-size: 0.85rem;
  font-weight: 700;
  color: var(--cyan);
  text-transform: uppercase;
  letter-spacing: 0.06em;
  margin-bottom: 1.1rem;
  padding-bottom: 0.55rem;
  border-bottom: 1px solid rgba(255, 255, 255, 0.08);
  display: flex;
  align-items: center;
  gap: 0.45rem;
}

/* Inputs */
.input-row {
  display: flex;
  align-items: center;
  gap: 0.6rem;
  margin-bottom: 0.75rem;
}

.input-row:last-child { margin-bottom: 0; }
@media (max-width: 560px) {
  #panel-calc .input-row { align-items:stretch; flex-wrap:wrap; gap:0.35rem; }
  #panel-calc .input-icon { width:26px; }
  #panel-calc .input-label { width:calc(100% - 32px); }
  #panel-calc .input-field { width:100% !important; min-width:0; }
  #panel-calc #c-precio-sugerido { max-width:none !important; padding-left:0; }
}

.input-icon {
  font-size: 1.1rem;
  width: 24px;
  text-align: center;
  flex-shrink: 0;
}

.input-label {
  font-size: 0.8rem;
  font-weight: 600;
  color: var(--mid);
  flex: 1;
}

.input-field {
  width: 130px;
  padding: 0.45rem 0.65rem;
  border: 1.5px solid var(--lgray);
  border-radius: 7px;
  font-size: 0.9rem;
  font-weight: 600;
  color: var(--white);
  text-align: center;
  outline: none;
  transition: border-color 0.2s;
  background: var(--lgray);
  flex-shrink: 0;
}

.input-field:focus {
  border-color: var(--gold);
  box-shadow: 0 0 0 3px rgba(200,146,42,0.15);
}

select.input-field {
  cursor: pointer;
  appearance: none;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='8' viewBox='0 0 12 8'%3E%3Cpath d='M1 1l5 5 5-5' stroke='%234A5568' stroke-width='1.5' fill='none' stroke-linecap='round'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 8px center;
  padding-right: 28px;
}

/* Resultado */
.result-header {
  display: grid;
  grid-template-columns: 1fr 1fr 1fr;
  gap: 0.5rem;
  margin-bottom: 0.75rem;
}

.result-col-label {
  font-size: 0.7rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  padding: 0.4rem 0.5rem;
  border-radius: 6px;
  text-align: center;
}

.result-col-label.lbl-empty { background: transparent; }
.result-col-label.lbl-max { background: var(--teal); color: var(--text-main); }
.result-col-label.lbl-min { background: var(--green); color: var(--text-main); }

.result-row {
  display: grid;
  grid-template-columns: 1fr 1fr 1fr;
  gap: 0.5rem;
  margin-bottom: 0.5rem;
  align-items: center;
}

.result-row-label {
  font-size: 0.8rem;
  font-weight: 600;
  color: var(--mid);
  display: flex;
  align-items: center;
  gap: 0.35rem;
}

.result-value {
  text-align: center;
  padding: 0.55rem 0.4rem;
  border-radius: 8px;
  font-size: 1.05rem;
  font-weight: 700;
  color: var(--white);
}

.result-value.max-val { background: var(--iblu); border: 1.5px solid var(--teal); }
.result-value.min-val { background: var(--igrn); border: 1.5px solid var(--green); }

.result-detail {
  font-size: 0.7rem;
  color: #888;
  text-align: center;
  font-style: italic;
  margin-top: 0.25rem;
}

.result-empty {
  text-align: center;
  color: #aaa;
  font-size: 0.85rem;
  padding: 1.5rem 0;
}

/* ── Tarjetas de opción (Calculadora — todas las combinaciones válidas) ── */
.opcion-card {
  background: var(--off);
  border: 1.5px solid var(--lgray);
  border-radius: 10px;
  padding: 0.75rem 0.9rem;
  transition: border-color 0.15s, background 0.15s;
}
.opcion-card.opcion-activa {
  border-color: var(--teal);
  background: var(--iblu);
}
.opcion-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
  gap: 0.4rem;
  margin-bottom: 0.5rem;
}
.opcion-certs {
  font-size: 0.85rem;
  font-weight: 700;
  color: var(--white);
}
.opcion-valores {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 0.5rem;
}
.opcion-valor {
  display: flex;
  flex-direction: column;
  background: var(--lgray);
  border-radius: 7px;
  padding: 0.4rem 0.55rem;
}
.opcion-valor .lbl {
  font-size: 0.66rem;
  font-weight: 600;
  color: var(--mid);
  text-transform: uppercase;
  letter-spacing: 0.03em;
}
.opcion-valor .val {
  font-size: 1rem;
  font-weight: 800;
  color: var(--white);
}
.opcion-detalle {
  font-size: 0.72rem;
  color: var(--mid);
  margin-top: 0.45rem;
  font-style: italic;
}

/* ── COMPARADOR PANEL ── */
.comp-table {
  width: 100%;
  border-collapse: separate;
  border-spacing: 0;
  border-radius: 10px;
  overflow: hidden;
  box-shadow: 0 1px 4px rgba(0,0,0,0.07);
}

.comp-table th {
  padding: 0.65rem 0.75rem;
  font-size: 0.78rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  text-align: center;
}

.comp-table td {
  padding: 0.6rem 0.75rem;
  font-size: 0.9rem;
  border-top: 1px solid var(--lgray);
  text-align: center;
}

.comp-table tr:first-child th:first-child { border-radius: 10px 0 0 0; }
.comp-table tr:first-child th:last-child  { border-radius: 0 10px 0 0; }

.th-label { background: var(--lgray); color: var(--mid); text-align: left; }
.th-24    { background: var(--navy);  color: var(--text-main); }
.th-18    { background: var(--teal);  color: var(--text-main); }
.th-1p    { background: var(--green); color: var(--text-main); }

.td-label { text-align: left; font-weight: 600; color: var(--mid); background: var(--lgray); }
.td-24    { background: rgba(255, 255, 255, 0.05); font-weight: 600; color: var(--white); }
.td-18    { background: var(--iblu); font-weight: 600; color: var(--white); }
.td-1p    { background: var(--igrn); font-weight: 600; color: var(--white); }
.td-same  { color: #888; font-style: italic; font-size: 0.8rem; }

.comp-input-row {
  display: flex;
  gap: 0.75rem;
  align-items: center;
  flex-wrap: wrap;
  margin-bottom: 1rem;
  background: var(--lgray);
  padding: 1rem;
  border-radius: 10px;
  box-shadow: 0 1px 4px rgba(0,0,0,0.07);
}

.comp-input-row label {
  font-size: 0.8rem;
  font-weight: 600;
  color: var(--mid);
  white-space: nowrap;
}

.comp-input-row input, .comp-input-row select {
  padding: 0.45rem 0.65rem;
  border: 1.5px solid var(--lgray);
  border-radius: 7px;
  font-size: 0.9rem;
  font-weight: 600;
  color: var(--white);
  background: var(--lgray);
  outline: none;
  transition: border-color 0.2s;
}

.comp-input-row input:focus,
.comp-input-row select:focus {
  border-color: var(--gold);
}

/* ── Mensaje WA ── */
.msg-box {
  background: var(--lgray);
  border: 1.5px solid var(--cyan);
  border-radius: 12px;
  padding: 1rem 1.25rem;
  font-size: 0.88rem;
  line-height: 1.6;
  color: var(--white);
  white-space: pre-wrap;
  word-break: break-word;
  font-family: 'Courier New', monospace;
  max-height: 320px;
  overflow-y: auto;
}

.copy-btn {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  background: var(--teal);
  color: var(--text-main);
  border: none;
  border-radius: 7px;
  padding: 0.5rem 1rem;
  font-size: 0.82rem;
  font-weight: 600;
  cursor: pointer;
  margin-top: 0.75rem;
  transition: background 0.2s;
}

.copy-btn:hover { background: var(--teal2); }
.copy-btn.copied { background: var(--green); }

/* ── CLIENTES (CRM) PANEL ── */
.cli-toolbar {
  display: flex;
  gap: 0.75rem;
  align-items: center;
  flex-wrap: wrap;
  margin-bottom: 1rem;
}

.cli-add-btn {
  background: var(--navy);
  color: var(--text-main);
  border: none;
  border-radius: 8px;
  padding: 0.6rem 1.1rem;
  font-size: 0.82rem;
  font-weight: 700;
  cursor: pointer;
  transition: background 0.2s;
}
.cli-add-btn:hover { background: var(--teal); }

.cli-chips {
  display: flex;
  gap: 0.4rem;
  flex-wrap: wrap;
}

.chip {
  padding: 0.4rem 0.85rem;
  border-radius: 20px;
  font-size: 0.75rem;
  font-weight: 700;
  cursor: pointer;
  border: 1.5px solid var(--lgray);
  background: var(--lgray);
  color: var(--mid);
  text-transform: uppercase;
  letter-spacing: 0.03em;
  transition: all 0.15s;
}
.chip:hover { border-color: var(--teal); }
.chip.active { background: var(--navy); border-color: var(--text-main); color: var(--text-main); }

.cli-summary {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 0.75rem;
  margin-bottom: 1rem;
}
@media (max-width: 700px) { .cli-summary { grid-template-columns: repeat(2, 1fr); } }

.cli-stat {
  background: var(--lgray);
  border-radius: 10px;
  padding: 0.85rem 1rem;
  box-shadow: 0 1px 4px rgba(0,0,0,0.07);
  text-align: center;
}
.cli-stat .num { font-size: 1.4rem; font-weight: 800; color: var(--text-main); }
.cli-stat .lbl { font-size: 0.68rem; font-weight: 700; color: var(--mid); text-transform: uppercase; letter-spacing: 0.05em; margin-top: 0.15rem; }
.cli-stat.alert-stat .num { color: var(--red); }

.cli-card {
  background: var(--lgray);
  border-radius: 12px;
  padding: 1rem 1.1rem;
  box-shadow: 0 1px 4px rgba(0,0,0,0.07);
  margin-bottom: 0.75rem;
  border-left: 5px solid var(--lgray);
}
.cli-card.alert-red   { border-left-color: var(--red); }
.cli-card.alert-amber { border-left-color: var(--amber); }
.cli-card.alert-ok    { border-left-color: var(--green); }
.cli-card.st-cerrada  { opacity: 0.7; }
.cli-card.st-perdida  { opacity: 0.55; }

.cli-top {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 0.75rem;
  flex-wrap: wrap;
}

.cli-name { font-size: 0.98rem; font-weight: 700; color: var(--white); }
.cli-sub  { font-size: 0.78rem; color: var(--mid); margin-top: 0.15rem; }

.badge {
  display: inline-block;
  padding: 0.2rem 0.6rem;
  border-radius: 20px;
  font-size: 0.68rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  white-space: nowrap;
}
.badge-enviada     { background: var(--iblu); color: var(--teal2); }
.badge-negociacion { background: var(--iamb); color: var(--amber); }
.badge-cerrada     { background: var(--igrn); color: var(--green); }
.badge-perdida     { background: var(--ired); color: var(--red); }
.badge-no-atendido { background: var(--lgray); color: var(--mid); }
.badge-citado      { background: #EDE9FE; color: #6D28D9; }

.alert-tag {
  font-size: 0.72rem;
  font-weight: 700;
  padding: 0.25rem 0.6rem;
  border-radius: 7px;
  display: inline-flex;
  align-items: center;
  gap: 0.3rem;
}
.alert-tag.red   { background: var(--ired); color: var(--red); }
.alert-tag.amber { background: var(--iamb); color: var(--amber); }
.alert-tag.ok    { background: var(--igrn); color: var(--green); }
.alert-tag.gray  { background: var(--lgray); color: var(--mid); }

.cli-meta {
  display: flex;
  gap: 1.1rem;
  flex-wrap: wrap;
  margin-top: 0.6rem;
  font-size: 0.8rem;
  color: var(--mid);
}
.cli-meta b { color: var(--white); }

.cli-actions {
  display: flex;
  gap: 0.5rem;
  margin-top: 0.75rem;
  flex-wrap: wrap;
}

.mini-btn {
  font-size: 0.74rem;
  font-weight: 700;
  padding: 0.4rem 0.75rem;
  border-radius: 6px;
  border: 1.5px solid var(--lgray);
  background: var(--off);
  color: var(--mid);
  cursor: pointer;
  transition: all 0.15s;
}
.mini-btn:hover { border-color: var(--teal); color: var(--teal2); }
.mini-btn.primary { background: var(--teal); color: var(--text-main); border-color: var(--teal); }
.mini-btn.primary:hover { background: var(--teal2); }

.proforma-row {
  background: var(--off);
  border-radius: 9px;
  padding: 0.65rem 0.85rem;
  margin-top: 0.5rem;
}
.proforma-top {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 0.6rem;
  flex-wrap: wrap;
}
.proforma-veh { font-size: 0.86rem; font-weight: 700; color: var(--white); }
.proforma-sub { font-size: 0.75rem; color: var(--mid); margin-top: 0.1rem; }

.proforma-toggle {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-top: 0.75rem;
  padding-top: 0.6rem;
  border-top: 1px solid var(--lgray);
  font-size: 0.78rem;
  font-weight: 700;
  color: var(--teal2);
  cursor: pointer;
  user-select: none;
}
.proforma-toggle:hover { color: var(--teal); }

select.mini-select {
  font-size: 0.74rem;
  font-weight: 700;
  padding: 0.35rem 0.5rem;
  border-radius: 6px;
  border: 1.5px solid var(--lgray);
  color: var(--mid);
  cursor: pointer;
}

/* ── PROYECCIÓN ── */
.mes-group { margin-bottom: 1.5rem; }
.mes-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  background: var(--navy);
  color: var(--text-main);
  padding: 0.6rem 1rem;
  border-radius: 10px 10px 0 0;
}
.mes-header .mes-nombre { font-size: 0.85rem; font-weight: 700; text-transform: capitalize; }
.mes-header .mes-total { font-size: 1.05rem; font-weight: 800; color: #FFD700; }
.mes-body {
  background: var(--lgray);
  border-radius: 0 0 10px 10px;
  box-shadow: 0 1px 4px rgba(0,0,0,0.07);
  overflow: hidden;
}
.venta-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 0.75rem;
  padding: 0.75rem 1rem;
  border-top: 1px solid var(--lgray);
  flex-wrap: wrap;
}
.venta-row:first-child { border-top: none; }
.venta-info .venta-cliente { font-size: 0.88rem; font-weight: 700; color: var(--white); }
.venta-info .venta-sub { font-size: 0.76rem; color: var(--mid); margin-top: 0.1rem; }
.venta-monto { text-align: right; }
.venta-monto .venta-neto { font-size: 0.95rem; font-weight: 800; color: var(--green); }
.venta-monto .venta-bruto { font-size: 0.7rem; color: #999; }

/* Modal nuevo cliente */
.modal-overlay {
  display: none;
  position: fixed;
  inset: 0;
  background: rgba(15,25,40,0.55);
  z-index: 200;
  align-items: center;
  justify-content: center;
  padding: 1rem;
}
.modal-overlay.open { display: flex; }

.modal-box {
  background: var(--lgray);
  border-radius: 14px;
  padding: 1.5rem;
  width: 100%;
  max-width: 420px;
  max-height: 90vh;
  overflow-y: auto;
  box-shadow: 0 25px 60px rgba(0,0,0,0.3);
}

.modal-title {
  font-size: 1.05rem;
  font-weight: 800;
  color: var(--text-main);
  margin-bottom: 1rem;
}

.modal-field { margin-bottom: 0.85rem; }
.modal-field label {
  display: block;
  font-size: 0.72rem;
  font-weight: 700;
  color: var(--mid);
  text-transform: uppercase;
  letter-spacing: 0.04em;
  margin-bottom: 0.3rem;
}
.modal-field input, .modal-field select, .modal-field textarea {
  width: 100%;
  padding: 0.6rem 0.75rem;
  background: var(--bg-input);
  border: 1.5px solid var(--lgray);
  border-radius: 7px;
  font-size: 0.9rem;
  color: var(--text-main);
  outline: none;
  font-family: inherit;
}
.modal-field input:focus, .modal-field select:focus, .modal-field textarea:focus { border-color: var(--gold); }
.modal-field textarea { resize: vertical; min-height: 70px; }

.modal-actions {
  display: flex;
  gap: 0.6rem;
  margin-top: 1.1rem;
}
.modal-actions .mini-btn { flex: 1; padding: 0.65rem; font-size: 0.85rem; }

/* ── Footer ── */
.app-footer {
  background: var(--navy);
  color: rgba(255,255,255,0.4);
  text-align: center;
  font-size: 0.7rem;
  padding: 0.6rem;
  line-height: 1.6;
}
.app-footer .dev-credit {
  color: rgba(255,255,255,0.55);
  font-weight: 600;
  letter-spacing: 0.02em;
}
.app-footer .footer-disclaimer {
  display: inline-block;
  margin-top: 0.35rem;
  color: rgba(255,255,255,0.35);
  font-size: 0.65rem;
  max-width: 420px;
  line-height: 1.5;
}
   TOASTS -- reemplazan alert(). Se apilan abajo-centro en celular
   (donde alert() se siente peor) y abajo-derecha en desktop.
   ══════════════════════════════════════════════ */
#toast-container {
  position: fixed;
  bottom: 1.1rem;
  right: 1.1rem;
  left: 1.1rem;
  z-index: 3000;
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
  align-items: flex-end;
  pointer-events: none;
}
@media (min-width: 761px) {
  #toast-container { left: auto; width: 360px; }
}
.toast {
  pointer-events: auto;
  display: flex;
  align-items: flex-start;
  gap: 0.55rem;
  width: 100%;
  max-width: 420px;
  background: var(--bg-card);
  border-radius: 10px;
  box-shadow: 0 6px 20px rgba(0,0,0,0.18);
  padding: 0.75rem 0.85rem;
  font-size: 0.85rem;
  line-height: 1.35;
  color: var(--dark, #1a1a1a);
  border-left: 4px solid #999;
  opacity: 0;
  transform: translateY(12px);
  transition: opacity 0.22s ease, transform 0.22s ease;
}
.toast.show { opacity: 1; transform: translateY(0); }
.toast-error   { border-left-color: var(--red, #DC2626); }
.toast-warning { border-left-color: var(--amber, #D97706); }
.toast-success { border-left-color: var(--green, #16A34A); }
.toast-info    { border-left-color: #2563EB; }
.toast-icon { flex-shrink: 0; font-size: 1rem; line-height: 1.3; }
.toast-msg { flex: 1; word-break: break-word; }
.toast-close {
  flex-shrink: 0;
  cursor: pointer;
  color: #aaa;
  font-size: 0.8rem;
  padding: 0 0.1rem;
}
.toast-close:hover { color: #666; }

/* ── PANEL HOY ── */
.hoy-acciones {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  margin: 0.9rem 0 1.1rem;
}
.hoy-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 1rem;
}
@media (max-width: 760px) {
  .hoy-grid { grid-template-columns: 1fr; }
}
.hoy-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.6rem;
  padding: 0.6rem 0;
  border-bottom: 1px solid var(--lgray);
}
.hoy-item:last-child { border-bottom: none; }
.hoy-item-info { min-width: 0; }
.hoy-item-nombre { font-weight: 700; font-size: 0.88rem; }
.hoy-item-detalle { font-size: 0.76rem; color: var(--mid); }
.hoy-vacio { color: var(--mid); font-size: 0.83rem; padding: 0.5rem 0; }
.hoy-stat-chip {
  display: inline-block;
  background: var(--off);
  border-radius: 8px;
  padding: 0.55rem 0.8rem;
  font-size: 0.78rem;
  color: var(--mid);
  margin-bottom: 0.7rem;
}
.hoy-stat-chip b { color: var(--white); font-size: 0.95rem; }

/* ── FICHA TÉCNICA DEL VEHÍCULO (MODERNA & RESPONSIVE) ── */
.ficha-container {
  display: flex;
  flex-direction: column;
  gap: 0.85rem;
  width: 100%;
  max-width: 100%;
  box-sizing: border-box;
  animation: ficha-fade-in 0.35s cubic-bezier(0.16, 1, 0.3, 1) forwards;
}

@keyframes ficha-fade-in {
  from { opacity: 0; transform: translateY(8px); }
  to   { opacity: 1; transform: translateY(0); }
}

.ficha-hero {
  position: relative;
  border-radius: 12px;
  overflow: hidden;
  background: linear-gradient(145deg, #0D1B2A 0%, #17375E 60%, #0D6E8A 120%);
  border: 1px solid rgba(255, 255, 255, 0.12);
  box-shadow: 0 4px 14px rgba(0, 0, 0, 0.15);
  width: 100%;
  box-sizing: border-box;
}

.ficha-hero-img-wrap {
  position: relative;
  width: 100%;
  min-height: 150px;
  max-height: 200px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: radial-gradient(circle at 50% 50%, rgba(255,255,255,0.08) 0%, rgba(0,0,0,0.3) 100%);
  padding: 0.6rem;
  box-sizing: border-box;
}

.ficha-hero-img {
  width: 100%;
  max-height: 180px;
  object-fit: contain;
  transition: transform 0.4s cubic-bezier(0.16, 1, 0.3, 1);
  filter: drop-shadow(0 6px 10px rgba(0,0,0,0.35));
}

.ficha-hero:hover .ficha-hero-img {
  transform: scale(1.03);
}

.ficha-hero-badge {
  position: absolute;
  top: 0.6rem;
  left: 0.6rem;
  background: rgba(13, 27, 42, 0.88);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  color: #F5A623;
  font-size: 0.7rem;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  padding: 0.25rem 0.6rem;
  border-radius: 20px;
  border: 1px solid rgba(245, 166, 35, 0.35);
  box-shadow: 0 2px 6px rgba(0,0,0,0.3);
  z-index: 2;
}

.ficha-hero-actions {
  position: absolute;
  bottom: 0.6rem;
  right: 0.6rem;
  z-index: 2;
}

.ficha-share-btn {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  background: rgba(255, 255, 255, 0.94);
  color: #17375E;
  font-size: 0.73rem;
  font-weight: 700;
  padding: 0.35rem 0.75rem;
  border-radius: 20px;
  border: none;
  cursor: pointer;
  box-shadow: 0 2px 8px rgba(0,0,0,0.25);
  transition: all 0.2s ease;
}

.ficha-share-btn:hover {
  background: var(--bg-card);
  transform: translateY(-1px);
  box-shadow: 0 4px 12px rgba(0,0,0,0.35);
  color: #0D6E8A;
}

.ficha-summary-banner {
  background: var(--off);
  border-left: 3.5px solid var(--teal);
  padding: 0.65rem 0.85rem;
  border-radius: 0 8px 8px 0;
  font-size: 0.82rem;
  color: var(--white);
  line-height: 1.45;
  word-break: break-word;
}

/* Grilla de Especificaciones Técnicas */
#ficha-card,
#ficha-vehiculo-contenido,
#ficha-vehiculo-datos {
  width: 100%;
  max-width: 100%;
  min-width: 0;
  box-sizing: border-box;
  overflow: hidden;
}

.ficha-specs-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 0.5rem;
  width: 100%;
  max-width: 100%;
  box-sizing: border-box;
}

.ficha-spec-card {
  background: var(--off);
  border: 1px solid var(--lgray);
  border-radius: 8px;
  padding: 0.6rem 0.75rem;
  display: flex;
  align-items: center;
  gap: 0.6rem;
  min-width: 0;
  max-width: 100%;
  box-sizing: border-box;
  overflow: hidden;
  transition: border-color 0.2s ease, transform 0.2s ease, box-shadow 0.2s ease;
}

.ficha-spec-card:hover {
  border-color: var(--text-muted);
  transform: translateY(-1px);
  box-shadow: 0 2px 6px rgba(0,0,0,0.04);
}

.ficha-spec-icon {
  font-size: 1.2rem;
  line-height: 1;
  flex-shrink: 0;
}

.ficha-spec-meta {
  display: flex;
  flex-direction: column;
  min-width: 0;
  flex: 1;
  overflow: hidden;
}

.ficha-spec-label {
  font-size: 0.64rem;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--mid);
  font-weight: 600;
  line-height: 1.2;
}

.ficha-spec-value {
  font-size: 0.82rem;
  font-weight: 700;
  color: var(--white);
  line-height: 1.35;
  overflow-wrap: anywhere;
  word-break: break-word;
  white-space: normal;
}

/* Sección ADAS y Confort */
.ficha-section-title {
  font-size: 0.81rem;
  font-weight: 700;
  color: var(--text-main);
  margin-bottom: 0.35rem;
  display: flex;
  align-items: center;
  gap: 0.35rem;
}

.ficha-chips-wrap {
  display: flex;
  flex-wrap: wrap;
  gap: 0.35rem;
  width: 100%;
  max-width: 100%;
  box-sizing: border-box;
}

.ficha-chip-adas {
  display: inline-flex;
  align-items: center;
  gap: 0.3rem;
  background: #EBF8FA;
  color: #0A5C75;
  border: 1px solid rgba(13, 110, 138, 0.25);
  font-size: 0.72rem;
  font-weight: 600;
  padding: 0.25rem 0.6rem;
  border-radius: 12px;
  overflow-wrap: anywhere;
  word-break: break-word;
  max-width: 100%;
  box-sizing: border-box;
}

.ficha-confort-list {
  list-style: none;
  padding: 0;
  margin: 0;
  display: grid;
  grid-template-columns: 1fr;
  gap: 0.35rem;
  width: 100%;
  box-sizing: border-box;
}

.ficha-confort-item {
  font-size: 0.78rem;
  color: var(--white);
  display: flex;
  align-items: flex-start;
  gap: 0.45rem;
  background: var(--off);
  padding: 0.4rem 0.6rem;
  border-radius: 6px;
  border: 1px solid rgba(226, 232, 240, 0.7);
  overflow-wrap: anywhere;
  word-break: break-word;
  line-height: 1.35;
  box-sizing: border-box;
  max-width: 100%;
}

.ficha-confort-item .check {
  color: #0D6E8A;
  font-weight: 800;
  flex-shrink: 0;
}

/* Tabla de Competidores */
.ficha-table-wrap {
  border: 1px solid var(--lgray);
  border-radius: 8px;
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
  width: 100%;
  max-width: 100%;
  margin-top: 0.3rem;
  box-sizing: border-box;
}

.ficha-table {
  width: 100%;
  min-width: 240px;
  border-collapse: collapse;
  font-size: 0.77rem;
}

.ficha-table th {
  background: #17375E;
  color: var(--text-main);
  font-weight: 600;
  padding: 0.4rem 0.55rem;
  text-align: left;
  font-size: 0.72rem;
  letter-spacing: 0.02em;
}

.ficha-table th:last-child {
  text-align: right;
}

.ficha-table td {
  padding: 0.38rem 0.55rem;
  border-bottom: 1px solid var(--lgray);
  font-size: 0.78rem;
  color: var(--white);
}

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

.ficha-table tr:nth-child(even) {
  background: rgba(255, 255, 255, 0.05);
}

.ficha-price-badge {
  display: inline-block;
  background: #E9F7EF;
  color: #1E5E34;
  font-weight: 700;
  font-size: 0.74rem;
  padding: 0.15rem 0.4rem;
  border-radius: 6px;
  white-space: nowrap;
}

/* Banner de Tips de Venta */
.ficha-tip-box {
  background: linear-gradient(135deg, #FEF9E7 0%, #FEF3E2 100%);
  border: 1px solid rgba(200, 146, 42, 0.3);
  border-radius: 8px;
  padding: 0.65rem 0.8rem;
  overflow-wrap: anywhere;
  word-break: break-word;
  width: 100%;
  max-width: 100%;
  box-sizing: border-box;
}

.ficha-tip-title {
  font-size: 0.8rem;
  font-weight: 700;
  color: #B7791F;
  margin-bottom: 0.3rem;
  display: flex;
  align-items: center;
  gap: 0.35rem;
}

.ficha-tip-list {
  margin: 0;
  padding-left: 1.1rem;
  font-size: 0.78rem;
  color: #5C3D10;
  line-height: 1.4;
}

/* Skeleton Loading */
.ficha-skeleton {
  display: flex;
  flex-direction: column;
  gap: 0.65rem;
  padding: 0.3rem 0;
  width: 100%;
  max-width: 100%;
  box-sizing: border-box;
}

.ficha-skeleton-hero {
  height: 140px;
  border-radius: 10px;
  background: linear-gradient(90deg, #E2E8F0 25%, #F1F5F9 50%, #E2E8F0 75%);
  background-size: 200% 100%;
  animation: ficha-shimmer 1.5s infinite;
  width: 100%;
}

.ficha-skeleton-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 0.5rem;
  width: 100%;
}

.ficha-skeleton-item {
  height: 44px;
  border-radius: 8px;
  background: linear-gradient(90deg, #E2E8F0 25%, #F1F5F9 50%, #E2E8F0 75%);
  background-size: 200% 100%;
  animation: ficha-shimmer 1.5s infinite;
}

@media (max-width: 680px) {
  .ficha-specs-grid,
  .ficha-skeleton-grid {
    grid-template-columns: 1fr !important;
    gap: 0.45rem !important;
  }
  .ficha-spec-card {
    padding: 0.6rem 0.75rem;
  }
}

@media (max-width: 560px) {
  .app-content {
    padding: 0.75rem 0.4rem;
    max-width: 100vw;
    overflow-x: hidden;
  }
  .card {
    padding: 1rem 0.75rem;
    max-width: 100%;
    overflow: hidden;
  }
  .ficha-hero-img-wrap {
    min-height: 130px;
    max-height: 160px;
  }
}

/* Util */
.section-title {
  font-size: 0.95rem;
  font-weight: 700;
  color: var(--text-main);
  margin-bottom: 0.75rem;
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

/* ── Secciones plegables (Supervisión) ── */
.sup-section {
  background: var(--lgray);
  border-radius: 12px;
  box-shadow: 0 1px 4px rgba(0,0,0,0.07);
  margin-bottom: 1rem;
  overflow: hidden;
}
.sup-section summary {
  list-style: none;
  cursor: pointer;
  padding: 1rem 1.1rem;
  font-size: 0.92rem;
  font-weight: 700;
  color: var(--white);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.5rem;
}
.sup-section summary::-webkit-details-marker { display: none; }
.sup-section summary::marker { content: ''; }
.sup-section .sup-chevron { transition: transform 0.15s; color: var(--mid); font-size: 0.8rem; }
.sup-section[open] .sup-chevron { transform: rotate(90deg); }
.sup-section .sup-body { padding: 0 1.1rem 1.1rem 1.1rem; }
.sup-section.sup-pinned summary { background: var(--off); }

.pill {
  background: var(--lgray);
  color: var(--mid);
  font-size: 0.7rem;
  font-weight: 600;
  padding: 0.15rem 0.5rem;
  border-radius: 20px;
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

hr.divider {
  border: none;
  border-top: 2px solid var(--navy);
  margin: 1rem 0;
  opacity: 0.08;
}

/* ── HORARIOS (calendario) ── */
.hcal-scroll {
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
  margin: 0 -0.5rem;
  padding: 0.5rem;
}
.hcal-grid {
  display: grid;
  grid-template-columns: repeat(7, minmax(100px, 1fr));
  gap: 0.5rem;
  min-width: 720px;
}
.hcal-header {
  margin-bottom: 0.5rem;
  font-size: 0.72rem;
  font-weight: 800;
  color: var(--mid);
  text-transform: uppercase;
  text-align: center;
  letter-spacing: 0.05em;
  padding-bottom: 0.25rem;
  border-bottom: 2px solid var(--lgray);
}
.hcal-cell {
  min-height: 90px;
  border: 1px solid var(--lgray);
  border-radius: 10px;
  padding: 0.5rem;
  background: var(--bg-card);
  transition: all 0.2s ease;
  display: flex;
  flex-direction: column;
  gap: 0.35rem;
  box-shadow: var(--shadow-sm);
}
.hcal-empty { border: none; background: transparent; box-shadow: none; }
.hcal-domingo { background: rgba(239, 68, 68, 0.03); border-color: rgba(239, 68, 68, 0.15); }
.hcal-clickable { cursor: pointer; }
.hcal-clickable:hover { border-color: var(--teal); box-shadow: var(--shadow-md); transform: translateY(-1px); }
.hcal-num { 
  font-size: 0.9rem; 
  font-weight: 700; 
  color: var(--text-main); 
  align-self: flex-end; 
  opacity: 0.8;
}
.hcal-domingo .hcal-num { color: var(--red); opacity: 0.9; }
.hcal-tag {
  display: flex;
  align-items: center;
  gap: 0.25rem;
  font-size: 0.65rem;
  font-weight: 700;
  padding: 0.2rem 0.4rem;
  border-radius: 6px;
  line-height: 1.2;
  word-break: break-word;
}
.hcal-tag-conces    { background: var(--iblu); color: var(--teal2); border: 1px solid rgba(2, 132, 199, 0.2); }
.hcal-tag-mall      { background: var(--iamb); color: var(--amber); border: 1px solid rgba(217, 119, 6, 0.2); }
.hcal-tag-tienda    { background: rgba(139, 92, 246, 0.1); color: #8B5CF6; border: 1px solid rgba(139, 92, 246, 0.2); }
.hcal-tag-ambos     { background: var(--igrn); color: var(--green); border: 1px solid rgba(16, 185, 129, 0.2); }
.hcal-tag-bloqueado { background: var(--ired); color: var(--red); border: 1px solid rgba(239, 68, 68, 0.2); }

.horario-fila {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 0.5rem;
  padding: 0.75rem 0;
  border-bottom: 1px solid var(--border-subtle);
}
.horario-fila:last-child { border-bottom: none; }
.horario-fila-nombre {
  font-size: 0.9rem;
  font-weight: 700;
  color: var(--text-main);
  flex-shrink: 0;
  width: 90px;
}

/* ── Hamburguesa + Sidebar (navegación móvil) ── */
.hamburger-btn {
  display: none;
  background: transparent;
  border: none;
  color: var(--text-main);
  font-size: 1.35rem;
  line-height: 1;
  cursor: pointer;
  padding: 0.2rem 0.4rem 0.2rem 0;
}

.sidebar-overlay {
  display: none;
  position: fixed;
  inset: 0;
  background: rgba(10,15,25,0.55);
  z-index: 300;
  opacity: 0;
  transition: opacity 0.2s;
}
.sidebar-overlay.open { display: block; opacity: 1; }

.sidebar-drawer {
  position: fixed;
  top: 0;
  left: 0;
  height: 100%;
  width: 78%;
  max-width: 300px;
  background: var(--navy);
  z-index: 301;
  transform: translateX(-100%);
  transition: transform 0.25s ease;
  display: flex;
  flex-direction: column;
  box-shadow: 4px 0 24px rgba(0,0,0,0.35);
}
.sidebar-drawer.open { transform: translateX(0); }

.sidebar-drawer-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 1rem 1.1rem;
  border-bottom: 1px solid rgba(255,255,255,0.12);
  flex-shrink: 0;
}

.sidebar-close-btn {
  background: rgba(255,255,255,0.1);
  border: none;
  color: var(--text-main);
  width: 30px;
  height: 30px;
  border-radius: 6px;
  font-size: 0.95rem;
  cursor: pointer;
  flex-shrink: 0;
}

.sidebar-nav {
  flex: 1;
  overflow-y: auto;
  padding: 0.5rem 0;
}

.sidebar-tab {
  padding: 0.9rem 1.1rem;
  color: rgba(255,255,255,0.75);
  font-size: 0.86rem;
  font-weight: 600;
  cursor: pointer;
  border-left: 3px solid transparent;
  text-transform: none;
  letter-spacing: normal;
  white-space: normal;
}
.sidebar-tab:hover { background: rgba(255,255,255,0.06); color: var(--text-main); }
.sidebar-tab.active { background: rgba(255,255,255,0.1); color: var(--text-main); border-left-color: #FFD700; }

.sidebar-drawer-footer {
  padding: 1rem 1.1rem;
  border-top: 1px solid rgba(255,255,255,0.12);
  flex-shrink: 0;
}

@media (max-width: 760px) {
  .hamburger-btn { display: inline-block; }
  .tabs { display: none; }
  .header-title { display: none; }
  .sidebar-tab[data-tab="msg"] { display: none !important; }
  #header-logout-btn, #header-password-btn { display: none; }
}

/* ═══════════════════════════════════════════════
   ESTILOS DEL GENERADOR DE FLYERS 4:5 (AutoGestión+)
   ═══════════════════════════════════════════════ */
.flyers-grid {
  display: grid;
  grid-template-columns: 380px 1fr;
  gap: 1.5rem;
  max-width: 1080px;
  margin: 0 auto;
  align-items: start;
}

@media (max-width: 900px) {
  .flyers-grid {
    grid-template-columns: 1fr;
  }
}

#panel-flyers .input-row {
  display: flex;
  align-items: center;
  gap: 0.6rem;
  margin-bottom: 0.75rem;
}

#panel-flyers .input-label {
  font-size: 0.8rem;
  font-weight: 600;
  color: var(--mid);
  flex: 1;
}

#panel-flyers .input-field {
  padding: 0.5rem 0.75rem;
  background: var(--lgray);
  border: 1px solid rgba(255,255,255,0.12);
  border-radius: 8px;
  color: var(--text-main);
  font-size: 0.85rem;
  text-align: left;
}

#panel-flyers .input-field:focus {
  border-color: var(--cyan);
  box-shadow: 0 0 0 3px rgba(0, 240, 255, 0.15);
}

@media (max-width: 560px) {
  #panel-flyers .input-row {
    flex-direction: column;
    align-items: stretch;
    gap: 0.3rem;
  }
  #panel-flyers .input-field {
    width: 100% !important;
  }
}

.btn-glow-accent {
  background: linear-gradient(135deg, var(--cyan) 0%, var(--blue-elec) 100%) !important;
  color: #030712 !important;
  box-shadow: 0 0 20px rgba(0, 240, 255, 0.3) !important;
  transition: all 0.2s ease !important;
}

.btn-glow-accent:hover {
  transform: translateY(-2px);
  box-shadow: 0 0 30px rgba(0, 240, 255, 0.5) !important;
}

.flyer-preview-wrapper {
  width: 100%;
  max-width: 480px;
  display: flex;
  justify-content: center;
}

.flyer-canvas-root {
  position: relative;
  width: 100%;
  aspect-ratio: 4 / 5;
  background: #05070a;
  border: 2px solid rgba(0, 240, 255, 0.3);
  box-shadow: 0 25px 60px rgba(0, 0, 0, 0.9), 0 0 30px rgba(0, 240, 255, 0.15);
  border-radius: 6px;
  overflow: hidden;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  padding: 1.5rem;
  box-sizing: border-box;
  background-image: 
    radial-gradient(ellipse at 50% 35%, rgba(37, 99, 235, 0.3) 0%, transparent 65%),
    linear-gradient(180deg, rgba(0, 240, 255, 0.05) 0%, transparent 40%),
    repeating-linear-gradient(0deg, transparent, transparent 2px, rgba(0, 240, 255, 0.02) 2px, rgba(0, 240, 255, 0.02) 4px);
}

/* HUD Corners */
.fl-hud-corner {
  position: absolute;
  width: 14px;
  height: 14px;
  border-color: var(--cyan);
  border-style: solid;
  pointer-events: none;
  z-index: 10;
}
.fl-tl { top: 10px; left: 10px; border-width: 2px 0 0 2px; }
.fl-tr { top: 10px; right: 10px; border-width: 2px 2px 0 0; }
.fl-bl { bottom: 10px; left: 10px; border-width: 0 0 2px 2px; }
.fl-br { bottom: 10px; right: 10px; border-width: 0 2px 2px 0; }

.fl-hud-grid {
  position: absolute;
  inset: 0;
  background-image: 
    linear-gradient(90deg, rgba(255, 255, 255, 0.02) 1px, transparent 1px),
    linear-gradient(180deg, rgba(255, 255, 255, 0.02) 1px, transparent 1px);
  background-size: 12.5% 10%;
  pointer-events: none;
  z-index: 1;
}

/* Header */
.fl-header {
  position: relative;
  z-index: 5;
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
}

.fl-brand-block { display: flex; flex-direction: column; }

.fl-logo-text {
  font-family: var(--font-display);
  font-weight: 800;
  font-size: 1.15rem;
  color: var(--text-main);
  letter-spacing: -0.02em;
  display: flex;
  align-items: center;
  gap: 0.35rem;
}

.fl-logo-plus {
  background: linear-gradient(135deg, var(--cyan) 0%, var(--blue-elec) 100%);
  color: var(--text-invert);
  font-weight: 900;
  width: 22px;
  height: 22px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border-radius: 4px;
  font-size: 0.9rem;
}

.fl-accent-plus { color: var(--gold); font-size: 1.25rem; }

.fl-logo-sub {
  font-family: var(--font-mono);
  font-size: 0.58rem;
  color: var(--cyan);
  letter-spacing: 1.5px;
  margin-top: 2px;
}

.fl-year-badge {
  font-family: var(--font-mono);
  font-size: 0.65rem;
  font-weight: 800;
  color: var(--cyan);
  background: rgba(0, 240, 255, 0.08);
  border: 1px solid var(--cyan);
  padding: 0.25rem 0.55rem;
  letter-spacing: 1px;
  box-shadow: 0 0 10px rgba(0, 240, 255, 0.2);
}

/* Title */
.fl-hero-title-wrap {
  position: relative;
  z-index: 5;
  margin-top: 0.35rem;
}

.fl-tag-sub {
  font-family: var(--font-mono);
  font-size: 0.62rem;
  color: var(--mid);
  letter-spacing: 2px;
  display: block;
}

.fl-main-title {
  font-family: var(--font-display);
  font-size: 2rem;
  font-weight: 800;
  line-height: 1;
  color: var(--text-main);
  text-transform: uppercase;
  letter-spacing: -0.03em;
}

.fl-title-glow {
  color: transparent;
  -webkit-text-stroke: 1.5px var(--cyan);
  text-shadow: 0 0 15px rgba(0, 240, 255, 0.4);
}

/* Car Stage */
.fl-car-stage {
  position: relative;
  z-index: 4;
  width: 100%;
  height: 160px;
  display: flex;
  align-items: center;
  justify-content: center;
}

.fl-vehicle-img {
  max-width: 92%;
  max-height: 155px;
  object-fit: contain;
  filter: drop-shadow(0 15px 25px rgba(0, 240, 255, 0.35));
  z-index: 5;
  transition: all 0.3s ease;
}

.fl-hud-laser {
  position: absolute;
  left: 0;
  right: 0;
  height: 2px;
  background: linear-gradient(90deg, transparent, var(--cyan), transparent);
  box-shadow: 0 0 10px var(--cyan);
  top: 35%;
  opacity: 0.6;
}

.fl-car-shadow-glow {
  position: absolute;
  bottom: 5px;
  width: 75%;
  height: 16px;
  background: radial-gradient(ellipse, rgba(0, 240, 255, 0.5) 0%, transparent 70%);
}

.fl-float-tag {
  position: absolute;
  font-family: var(--font-mono);
  font-size: 0.55rem;
  color: var(--text-main);
  background: rgba(13, 17, 26, 0.9);
  border: 1px solid var(--cyan);
  padding: 0.2rem 0.35rem;
  border-radius: 3px;
  z-index: 6;
  display: flex;
  align-items: center;
  gap: 0.3rem;
  box-shadow: 0 4px 10px rgba(0,0,0,0.5);
}

.fl-tag-1 { top: 5%; right: 0; }
.fl-tag-2 { bottom: 5%; left: 0; }

.fl-dot-pulse {
  width: 5px;
  height: 5px;
  background: var(--cyan);
  border-radius: 50%;
  box-shadow: 0 0 6px var(--cyan);
}

/* Highlights */
.fl-highlights {
  position: relative;
  z-index: 5;
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
}

.fl-price-hero {
  background: linear-gradient(135deg, rgba(0, 240, 255, 0.12) 0%, rgba(37, 99, 235, 0.2) 100%);
  border: 1.5px solid var(--cyan);
  padding: 0.6rem 0.85rem;
  display: flex;
  align-items: center;
  justify-content: space-between;
  box-shadow: 0 0 20px rgba(0, 240, 255, 0.2);
  border-radius: 6px;
}

.fl-price-label {
  font-family: var(--font-display);
  font-size: 0.68rem;
  font-weight: 800;
  color: var(--cyan);
  letter-spacing: 0.5px;
}

.fl-price-sublabel {
  font-family: var(--font-mono);
  font-size: 0.62rem;
  color: var(--text-muted);
}

.fl-price-number {
  font-family: var(--font-display);
  font-size: 1.85rem;
  font-weight: 800;
  color: var(--text-main);
  text-shadow: 0 0 10px var(--cyan);
  line-height: 1;
}

.fl-month-span {
  font-size: 0.85rem;
  color: var(--cyan);
  font-weight: 700;
}

.fl-benefits-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 0.4rem;
}

.fl-benefit-box {
  background: rgba(19, 25, 36, 0.95);
  border: 1px solid rgba(255,255,255,0.08);
  border-left: 3px solid var(--cyan);
  padding: 0.45rem 0.6rem;
  display: flex;
  gap: 0.35rem;
  align-items: flex-start;
}

.fl-b-icon { color: var(--cyan); font-size: 0.9rem; line-height: 1; }

.fl-b-title {
  display: block;
  font-family: var(--font-display);
  font-size: 0.72rem;
  font-weight: 700;
  color: var(--text-main);
  line-height: 1.1;
}

.fl-b-desc {
  display: block;
  font-family: var(--font-mono);
  font-size: 0.58rem;
  color: var(--mid);
  line-height: 1.2;
}

.fl-spec-strip {
  display: flex;
  gap: 0.35rem;
}

.fl-spec-pill {
  flex: 1;
  background: rgba(255, 255, 255, 0.03);
  border: 1px solid rgba(255, 255, 255, 0.08);
  padding: 0.25rem 0.2rem;
  text-align: center;
  font-family: var(--font-mono);
  font-size: 0.55rem;
  color: var(--text-muted);
  text-transform: uppercase;
}

.fl-spec-pill strong {
  display: block;
  font-size: 0.65rem;
  color: var(--cyan);
}

/* Footer CTA */
.fl-footer {
  position: relative;
  z-index: 5;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.6rem;
  margin-top: 0.35rem;
  padding-top: 0.45rem;
  border-top: 1px dashed rgba(255,255,255,0.1);
}

.fl-cta-banner {
  flex: 1;
  background: linear-gradient(90deg, var(--cyan) 0%, var(--blue-elec) 100%);
  color: var(--text-invert);
  font-family: var(--font-display);
  font-size: 0.82rem;
  font-weight: 800;
  padding: 0.65rem 0.85rem;
  border-radius: 6px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  box-shadow: 0 0 15px rgba(0, 240, 255, 0.25);
}

.fl-qr-box {
  width: 36px;
  height: 36px;
  background: var(--bg-card);
  border: 1px solid var(--cyan);
  border-radius: 4px;
  display: flex;
  align-items: center;
  justify-content: center;
}





