/* ============================================================
   CONTROLPARK - Estilos principales
   Mobile-first | Dark theme profesional
   ============================================================ */

/* Variables */
:root {
  --bg-primary:    #0a0f1e;
  --bg-secondary:  #111827;
  --bg-card:       #1a2236;
  --bg-card-hover: #1f2a42;
  --bg-input:      #0f1729;
  --border:        #2a3652;
  --border-light:  #1e2d4a;

  --accent:        #2563eb;
  --accent-light:  #3b82f6;
  --accent-glow:   rgba(37, 99, 235, 0.25);

  --success:       #10b981;
  --success-bg:    rgba(16, 185, 129, 0.15);
  --warning:       #f59e0b;
  --warning-bg:    rgba(245, 158, 11, 0.15);
  --danger:        #ef4444;
  --danger-bg:     rgba(239, 68, 68, 0.15);

  --text-primary:  #f0f4ff;
  --text-secondary:#8b9ab8;
  --text-muted:    #4a5a7a;

  --font-display:  'Rajdhani', sans-serif;
  --font-body:     'Inter', sans-serif;

  --radius-sm:     8px;
  --radius-md:     12px;
  --radius-lg:     16px;
  --radius-xl:     24px;

  --shadow-card:   0 4px 24px rgba(0,0,0,0.4);
  --shadow-glow:   0 0 24px var(--accent-glow);

  --nav-height:    68px;
  --header-height: 60px;
}

/* Reset */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
html { font-size: 16px; scroll-behavior: smooth; }
body {
  font-family: var(--font-body);
  background: var(--bg-primary);
  color: var(--text-primary);
  min-height: 100dvh;
  overflow-x: hidden;
  -webkit-font-smoothing: antialiased;
}
img { max-width: 100%; }
button { cursor: pointer; border: none; background: none; font-family: inherit; }
input, select, textarea {
  font-family: inherit;
  font-size: 1rem;
  outline: none;
  border: none;
}

/* ============================================================
   UTILIDADES
   ============================================================ */
.hidden { display: none !important; }
.active { display: block !important; }

/* ============================================================
   LOGIN
   ============================================================ */
.screen { min-height: 100dvh; }

.login-bg {
  min-height: 100dvh;
  background: radial-gradient(ellipse at 30% 20%, rgba(37,99,235,0.2) 0%, transparent 60%),
              radial-gradient(ellipse at 80% 80%, rgba(16,185,129,0.1) 0%, transparent 50%),
              var(--bg-primary);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 1.5rem;
}

.login-box {
  width: 100%;
  max-width: 380px;
  animation: fadeInUp 0.5s ease;
}

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

.login-logo {
  display: flex;
  align-items: center;
  gap: 1rem;
  margin-bottom: 2.5rem;
  justify-content: center;
}

.logo-shield {
  width: 64px;
  height: 64px;
  background: linear-gradient(135deg, #1d4ed8, #2563eb);
  border-radius: 14px 14px 20px 20px;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-direction: column;
  box-shadow: 0 8px 24px rgba(37,99,235,0.4);
  position: relative;
}

.logo-p {
  font-family: var(--font-display);
  font-size: 2rem;
  font-weight: 700;
  color: white;
  line-height: 1;
}

.logo-car { font-size: 0.75rem; margin-top: -4px; }

.logo-text h1 {
  font-family: var(--font-display);
  font-size: 2rem;
  font-weight: 700;
  color: var(--text-primary);
  letter-spacing: 1px;
  line-height: 1.1;
}

.logo-text p {
  font-size: 0.7rem;
  color: var(--text-secondary);
  letter-spacing: 0.5px;
}

.login-form {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-xl);
  padding: 2rem;
  box-shadow: var(--shadow-card);
}

.login-ver {
  text-align: center;
  color: var(--text-muted);
  font-size: 0.75rem;
  margin-top: 1.5rem;
}

/* ============================================================
   FORMS
   ============================================================ */
.form-group {
  margin-bottom: 1rem;
}

.form-group label {
  display: block;
  font-size: 0.8rem;
  font-weight: 500;
  color: var(--text-secondary);
  margin-bottom: 0.4rem;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.form-group input,
.form-group select,
.form-group textarea {
  width: 100%;
  background: var(--bg-input);
  border: 1.5px solid var(--border);
  border-radius: var(--radius-sm);
  color: var(--text-primary);
  padding: 0.75rem 1rem;
  transition: border-color 0.2s, box-shadow 0.2s;
}

.form-group input:focus,
.form-group select:focus,
.form-group textarea:focus {
  border-color: var(--accent);
  box-shadow: 0 0 0 3px var(--accent-glow);
}

.form-group select option { background: var(--bg-card); }

.form-textarea {
  width: 100%;
  background: var(--bg-input);
  border: 1.5px solid var(--border);
  border-radius: var(--radius-sm);
  color: var(--text-primary);
  padding: 0.75rem 1rem;
  resize: vertical;
  min-height: 80px;
  transition: border-color 0.2s;
}

.form-textarea:focus { border-color: var(--accent); }

.form-input-sm, .form-select-sm {
  background: var(--bg-input);
  border: 1.5px solid var(--border);
  border-radius: var(--radius-sm);
  color: var(--text-primary);
  padding: 0.5rem 0.75rem;
  font-size: 0.875rem;
  transition: border-color 0.2s;
}

.form-input-sm:focus, .form-select-sm:focus { border-color: var(--accent); }
.form-select-sm option { background: var(--bg-card); }

.input-prefix {
  display: flex;
  align-items: center;
  background: var(--bg-input);
  border: 1.5px solid var(--border);
  border-radius: var(--radius-sm);
  overflow: hidden;
  transition: border-color 0.2s;
}

.input-prefix:focus-within { border-color: var(--accent); box-shadow: 0 0 0 3px var(--accent-glow); }
.input-prefix span {
  padding: 0.75rem 0.75rem 0.75rem 1rem;
  color: var(--text-secondary);
  background: var(--bg-card);
  font-size: 0.9rem;
  border-right: 1px solid var(--border);
}
.input-prefix input {
  flex: 1;
  background: transparent;
  border: none;
  padding: 0.75rem;
}

.input-disabled { opacity: 0.5; cursor: not-allowed; }

/* Toggle switches */
.toggle-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0.75rem 0;
  border-bottom: 1px solid var(--border-light);
}

.toggle-row label {
  font-size: 0.875rem;
  color: var(--text-secondary);
}

.toggle {
  appearance: none;
  -webkit-appearance: none;
  width: 48px;
  height: 26px;
  background: var(--border);
  border-radius: 13px;
  position: relative;
  cursor: pointer;
  transition: background 0.3s;
  flex-shrink: 0;
}

.toggle:checked { background: var(--accent); }

.toggle::after {
  content: '';
  position: absolute;
  width: 20px;
  height: 20px;
  background: white;
  border-radius: 50%;
  top: 3px;
  left: 3px;
  transition: transform 0.3s;
  box-shadow: 0 2px 4px rgba(0,0,0,0.3);
}

.toggle:checked::after { transform: translateX(22px); }

/* ============================================================
   BUTTONS
   ============================================================ */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  padding: 0.75rem 1.25rem;
  border-radius: var(--radius-sm);
  font-family: var(--font-display);
  font-size: 1rem;
  font-weight: 600;
  letter-spacing: 0.5px;
  cursor: pointer;
  transition: all 0.2s;
  white-space: nowrap;
  border: none;
}

.btn:active { transform: scale(0.97); }
.btn:disabled { opacity: 0.5; cursor: not-allowed; }

.btn-full { width: 100%; }
.btn-xl { padding: 1rem 1.5rem; font-size: 1.1rem; min-height: 56px; }
.btn-sm { padding: 0.5rem 0.875rem; font-size: 0.875rem; }

.btn-primary { background: var(--accent); color: white; }
.btn-primary:hover { background: var(--accent-light); box-shadow: var(--shadow-glow); }

.btn-success { background: var(--success); color: white; }
.btn-success:hover { filter: brightness(1.1); box-shadow: 0 0 24px rgba(16,185,129,0.3); }

.btn-danger { background: var(--danger); color: white; }
.btn-danger:hover { filter: brightness(1.1); box-shadow: 0 0 24px rgba(239,68,68,0.3); }

.btn-warning { background: var(--warning); color: #1a1a1a; }
.btn-warning:hover { filter: brightness(1.05); }

.btn-outline {
  background: transparent;
  border: 1.5px solid var(--border);
  color: var(--text-secondary);
}
.btn-outline:hover { border-color: var(--accent); color: var(--accent); }

.btn-icon {
  width: 36px;
  height: 36px;
  border-radius: var(--radius-sm);
  background: var(--bg-card);
  border: 1px solid var(--border);
  color: var(--text-secondary);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1rem;
  transition: all 0.2s;
}
.btn-icon:hover { border-color: var(--danger); color: var(--danger); }

/* ============================================================
   ALERTS
   ============================================================ */
.alert {
  padding: 0.75rem 1rem;
  border-radius: var(--radius-sm);
  font-size: 0.875rem;
  margin-bottom: 1rem;
}
.alert-error { background: var(--danger-bg); color: var(--danger); border: 1px solid rgba(239,68,68,0.3); }
.alert-success { background: var(--success-bg); color: var(--success); border: 1px solid rgba(16,185,129,0.3); }
.alert-warning { background: var(--warning-bg); color: var(--warning); border: 1px solid rgba(245,158,11,0.3); }

/* ============================================================
   BADGES
   ============================================================ */
.badge {
  display: inline-flex;
  align-items: center;
  gap: 0.3rem;
  padding: 0.3rem 0.75rem;
  border-radius: 100px;
  font-size: 0.75rem;
  font-weight: 600;
  letter-spacing: 0.5px;
}
.badge-success { background: var(--success-bg); color: var(--success); }
.badge-warning { background: var(--warning-bg); color: var(--warning); }
.badge-danger  { background: var(--danger-bg);  color: var(--danger);  }
.badge-info    { background: var(--accent-glow); color: var(--accent-light); }

/* ============================================================
   APP LAYOUT
   ============================================================ */
.app-header {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  height: var(--header-height);
  background: rgba(10,15,30,0.95);
  backdrop-filter: blur(12px);
  border-bottom: 1px solid var(--border);
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 1rem;
  z-index: 100;
}

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

.header-logo {
  width: 36px;
  height: 36px;
  background: linear-gradient(135deg, #1d4ed8, #2563eb);
  border-radius: 8px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-family: var(--font-display);
  font-weight: 700;
  font-size: 0.875rem;
  color: white;
}

.header-info { display: flex; flex-direction: column; gap: 1px; }

#header-title {
  font-family: var(--font-display);
  font-size: 1rem;
  font-weight: 700;
  color: var(--text-primary);
  letter-spacing: 0.5px;
}

.header-time {
  font-size: 0.7rem;
  color: var(--text-muted);
  font-family: 'Courier New', monospace;
}

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

.status-dot {
  display: flex;
  align-items: center;
  gap: 0.4rem;
  font-size: 0.75rem;
  font-weight: 500;
  padding: 0.3rem 0.6rem;
  border-radius: 100px;
  border: 1px solid;
}

.status-dot .dot {
  width: 7px;
  height: 7px;
  border-radius: 50%;
}

.status-libre { border-color: var(--success); color: var(--success); }
.status-libre .dot { background: var(--success); animation: pulse-green 2s infinite; }
.status-ocupado { border-color: var(--warning); color: var(--warning); }
.status-ocupado .dot { background: var(--warning); animation: pulse-orange 1s infinite; }

@keyframes pulse-green {
  0%, 100% { box-shadow: 0 0 0 0 rgba(16,185,129,0.5); }
  50% { box-shadow: 0 0 0 4px rgba(16,185,129,0); }
}

@keyframes pulse-orange {
  0%, 100% { box-shadow: 0 0 0 0 rgba(245,158,11,0.6); }
  50% { box-shadow: 0 0 0 4px rgba(245,158,11,0); }
}

.app-main {
  padding-top: calc(var(--header-height) + 1rem);
  padding-bottom: calc(var(--nav-height) + 1rem);
  padding-left: 1rem;
  padding-right: 1rem;
  max-width: 640px;
  margin: 0 auto;
}

/* ============================================================
   VIEWS
   ============================================================ */
.view { display: none; animation: viewIn 0.3s ease; }
.view.active { display: block; }

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

.view-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 1.25rem;
}

.view-title {
  font-family: var(--font-display);
  font-size: 1.5rem;
  font-weight: 700;
  color: var(--text-primary);
  letter-spacing: 0.5px;
}

.view-date {
  font-size: 0.8rem;
  color: var(--text-muted);
}

/* ============================================================
   CARDS
   ============================================================ */
.card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 1.25rem;
  margin-bottom: 1rem;
  box-shadow: var(--shadow-card);
}

.section-title {
  font-family: var(--font-display);
  font-size: 1.1rem;
  font-weight: 600;
  color: var(--text-primary);
  margin-bottom: 1rem;
  letter-spacing: 0.3px;
}

/* Card entrada activa */
.card-activa {
  border-color: var(--warning);
  background: linear-gradient(135deg, rgba(245,158,11,0.08), var(--bg-card));
}

.activa-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 1rem;
}

.activa-timer {
  font-family: 'Courier New', monospace;
  font-size: 1.25rem;
  font-weight: 700;
  color: var(--warning);
  background: rgba(245,158,11,0.1);
  padding: 0.25rem 0.75rem;
  border-radius: var(--radius-sm);
}

.activa-info {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 0.5rem;
  margin-bottom: 1rem;
}

.activa-info div {
  background: var(--bg-input);
  border-radius: var(--radius-sm);
  padding: 0.6rem;
  text-align: center;
}

.activa-info label {
  display: block;
  font-size: 0.65rem;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.5px;
  margin-bottom: 0.2rem;
}

.activa-info span { font-size: 0.8rem; font-weight: 600; color: var(--text-primary); }

/* Card libre */
.card-libre {
  text-align: center;
  border: 2px dashed var(--border);
  background: transparent;
  padding: 1.25rem;
}

.libre-icon { font-size: 2rem; margin-bottom: 0.25rem; }
.card-libre p { color: var(--text-muted); margin-bottom: 1rem; font-size: .875rem; }

/* Config card */
.card-config { padding: 1rem 1.25rem; }
.config-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 0.5rem 0;
  border-bottom: 1px solid var(--border-light);
  font-size: 0.875rem;
  color: var(--text-secondary);
}
.config-row:last-child { border-bottom: none; }
.config-val { color: var(--accent-light); font-weight: 600; }

/* Stats grid */
.stats-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 0.75rem;
  margin-bottom: 1rem;
}

.stat-card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  padding: 1rem;
  text-align: center;
  transition: border-color 0.2s;
}

.stat-card:hover { border-color: var(--accent); }

.stat-icon { font-size: 1.5rem; margin-bottom: 0.25rem; }
.stat-value {
  font-family: var(--font-display);
  font-size: 1.25rem;
  font-weight: 700;
  color: var(--text-primary);
  margin-bottom: 0.2rem;
}
.stat-label { font-size: 0.7rem; color: var(--text-muted); text-transform: uppercase; letter-spacing: 0.5px; }

/* ============================================================
   MARCADOR
   ============================================================ */
.marcador-estado { text-align: center; padding: 1rem 0; }

.marcador-icon {
  font-size: 5rem;
  margin-bottom: 1rem;
  display: block;
  filter: drop-shadow(0 4px 12px rgba(0,0,0,0.3));
}

.marcador-icon.ocupado { animation: carPulse 2s infinite; }

@keyframes carPulse {
  0%, 100% { transform: scale(1); }
  50% { transform: scale(1.05); }
}

.marcador-estado h3 { font-family: var(--font-display); font-size: 1.5rem; margin-bottom: 0.5rem; }
.marcador-estado p { color: var(--text-muted); margin-bottom: 2rem; }

.marcador-tiempo {
  font-family: 'Courier New', monospace;
  font-size: 3rem;
  font-weight: 700;
  color: var(--warning);
  background: rgba(245,158,11,0.08);
  border: 1px solid rgba(245,158,11,0.2);
  border-radius: var(--radius-md);
  padding: 0.75rem 1.5rem;
  display: inline-block;
  margin-bottom: 1.5rem;
  letter-spacing: 4px;
}

.marcador-detalle {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  overflow: hidden;
  margin-bottom: 1rem;
  text-align: left;
}

.detalle-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 0.75rem 1rem;
  border-bottom: 1px solid var(--border-light);
  font-size: 0.875rem;
}
.detalle-row:last-child { border-bottom: none; }
.detalle-row label { color: var(--text-muted); }
.detalle-row span { font-weight: 600; }

/* ============================================================
   HISTORIAL
   ============================================================ */
.filter-bar {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  margin-bottom: 1rem;
  align-items: center;
}

.filter-pills {
  display: flex;
  gap: 0.375rem;
  flex-wrap: wrap;
}

.pill {
  padding: 0.4rem 0.875rem;
  border-radius: 100px;
  background: var(--bg-card);
  border: 1.5px solid var(--border);
  color: var(--text-secondary);
  font-size: 0.8rem;
  font-weight: 500;
  cursor: pointer;
  transition: all 0.2s;
  white-space: nowrap;
}

.pill:hover { border-color: var(--accent); color: var(--accent); }
.pill.active { background: var(--accent); border-color: var(--accent); color: white; }

.filtro-rango {
  display: flex;
  gap: 0.5rem;
  align-items: center;
  flex-wrap: wrap;
}

.resumen-filtro {
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-size: 0.8rem;
  color: var(--text-muted);
  margin-bottom: 0.75rem;
  padding: 0.5rem 0;
  border-bottom: 1px solid var(--border-light);
}

.resumen-filtro span:last-child { color: var(--success); font-weight: 600; }

/* Lista de registros */
.lista-registros { display: flex; flex-direction: column; gap: 0.625rem; }

.loader-text { text-align: center; color: var(--text-muted); padding: 2rem; font-size: 0.875rem; }
.empty-text { text-align: center; color: var(--text-muted); padding: 2rem; }

.registro-card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  padding: 1rem;
  cursor: pointer;
  transition: all 0.2s;
  position: relative;
  overflow: hidden;
}

.registro-card:hover { border-color: var(--accent); background: var(--bg-card-hover); }
.registro-card::before {
  content: '';
  position: absolute;
  left: 0;
  top: 0;
  bottom: 0;
  width: 3px;
  border-radius: 3px 0 0 3px;
}
.registro-card.estado-abierto::before { background: var(--warning); }
.registro-card.estado-cerrado::before { background: var(--success); }
.registro-card.estado-liquidado::before { background: var(--accent); }

.reg-header {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  margin-bottom: 0.5rem;
}

.reg-num { font-family: var(--font-display); font-weight: 600; font-size: 0.9rem; color: var(--text-primary); }
.reg-fecha { font-size: 0.75rem; color: var(--text-muted); }

.reg-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 0.5rem;
  margin-bottom: 0.5rem;
}

.reg-item { font-size: 0.75rem; }
.reg-item label { display: block; color: var(--text-muted); margin-bottom: 0.1rem; }
.reg-item span { color: var(--text-primary); font-weight: 500; }

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

.monto-final {
  font-family: var(--font-display);
  font-size: 1.1rem;
  font-weight: 700;
  color: var(--success);
}

.reg-actions {
  display: flex;
  gap: 0.375rem;
  margin-top: 0.75rem;
  padding-top: 0.75rem;
  border-top: 1px solid var(--border-light);
}

.paginacion { text-align: center; padding: 1rem 0; }

/* ============================================================
   LIQUIDACIONES
   ============================================================ */
.liq-card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  padding: 1rem;
  margin-bottom: 0.625rem;
  cursor: pointer;
  transition: all 0.2s;
}
.liq-card:hover { border-color: var(--accent); }

.liq-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 0.75rem;
}

.liq-num { font-family: var(--font-display); font-weight: 700; font-size: 1rem; }
.liq-periodo { font-size: 0.8rem; color: var(--text-muted); }

.liq-stats {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 0.5rem;
  font-size: 0.75rem;
  text-align: center;
}

.liq-stat label { display: block; color: var(--text-muted); margin-bottom: 0.1rem; }
.liq-stat span { font-weight: 600; color: var(--text-primary); }

.liq-total {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-top: 0.75rem;
  padding-top: 0.75rem;
  border-top: 1px solid var(--border-light);
}

.liq-monto {
  font-family: var(--font-display);
  font-size: 1.2rem;
  font-weight: 700;
  color: var(--success);
}

.liq-preview {
  background: var(--bg-input);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 1rem;
  margin-top: 1rem;
}

/* ============================================================
   AJUSTES TABS
   ============================================================ */
.ajustes-tabs {
  display: flex;
  gap: 0.375rem;
  flex-wrap: wrap;
  margin-bottom: 1.25rem;
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  padding: 0.5rem;
}

.atab {
  flex: 1;
  min-width: 80px;
  padding: 0.5rem 0.625rem;
  border-radius: var(--radius-sm);
  font-size: 0.75rem;
  font-weight: 500;
  color: var(--text-secondary);
  cursor: pointer;
  transition: all 0.2s;
  text-align: center;
  white-space: nowrap;
}

.atab:hover { color: var(--text-primary); }
.atab.active { background: var(--accent); color: white; }

.atab-content { display: none; }
.atab-content.active { display: block; }

/* ============================================================
   MODALES
   ============================================================ */
.modal {
  position: fixed;
  inset: 0;
  z-index: 200;
  display: flex;
  align-items: flex-end;
  justify-content: center;
}

.modal.active { display: flex !important; }

.modal-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,0.7);
  backdrop-filter: blur(4px);
}

.modal-box {
  position: relative;
  width: 100%;
  max-width: 520px;
  background: var(--bg-secondary);
  border: 1px solid var(--border);
  border-radius: var(--radius-xl) var(--radius-xl) 0 0;
  max-height: 90dvh;
  display: flex;
  flex-direction: column;
  animation: slideUp 0.3s ease;
  z-index: 1;
}

.modal-box-lg { max-height: 95dvh; }

@keyframes slideUp {
  from { transform: translateY(100%); opacity: 0; }
  to   { transform: translateY(0); opacity: 1; }
}

.modal-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 1.25rem 1.5rem;
  border-bottom: 1px solid var(--border);
}

.modal-header h3 {
  font-family: var(--font-display);
  font-size: 1.2rem;
  font-weight: 700;
}

.modal-close {
  width: 32px;
  height: 32px;
  border-radius: 50%;
  background: var(--bg-input);
  border: 1px solid var(--border);
  color: var(--text-secondary);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 0.875rem;
  cursor: pointer;
  transition: all 0.2s;
}

.modal-close:hover { background: var(--danger-bg); color: var(--danger); border-color: var(--danger); }

.modal-body { padding: 1.5rem; overflow-y: auto; flex: 1; }

.modal-footer {
  padding: 1rem 1.5rem;
  border-top: 1px solid var(--border);
  display: flex;
  gap: 0.75rem;
  justify-content: flex-end;
}

.modal-footer .btn { min-width: 120px; }

/* Resumen salida */
.resumen-salida {
  background: var(--bg-input);
  border-radius: var(--radius-md);
  overflow: hidden;
}

.resumen-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 0.75rem 1rem;
  border-bottom: 1px solid var(--border-light);
  font-size: 0.875rem;
}
.resumen-row:last-child { border-bottom: none; }
.resumen-row label { color: var(--text-muted); }
.total-row { background: rgba(16,185,129,0.05); }
.total-row label { font-weight: 700; color: var(--text-primary); }

.monto-grande {
  font-family: var(--font-display);
  font-size: 1.5rem;
  font-weight: 700;
  color: var(--success);
}

/* ============================================================
   BOTTOM NAVIGATION
   ============================================================ */
.bottom-nav {
  position: fixed;
  bottom: 0;
  left: 0;
  right: 0;
  height: var(--nav-height);
  background: rgba(10,15,30,0.98);
  backdrop-filter: blur(12px);
  border-top: 1px solid var(--border);
  display: flex;
  align-items: center;
  justify-content: space-around;
  padding: 0 0.5rem;
  padding-bottom: env(safe-area-inset-bottom, 0);
  z-index: 100;
}

.nav-btn {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 0.2rem;
  padding: 0.5rem;
  border-radius: var(--radius-sm);
  color: var(--text-muted);
  cursor: pointer;
  transition: all 0.2s;
  max-width: 80px;
}

.nav-btn:hover { color: var(--text-secondary); }
.nav-btn.active { color: var(--accent-light); }
.nav-btn.active .nav-icon { filter: drop-shadow(0 0 6px var(--accent)); }

.nav-icon { font-size: 1.4rem; line-height: 1; }
.nav-label { font-size: 0.65rem; font-weight: 500; text-align: center; letter-spacing: 0.3px; }

/* ============================================================
   TOAST NOTIFICATIONS
   ============================================================ */
#toast-container {
  position: fixed;
  top: calc(var(--header-height) + 0.75rem);
  right: 1rem;
  left: 1rem;
  z-index: 300;
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
  pointer-events: none;
}

.toast {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  padding: 0.875rem 1.25rem;
  font-size: 0.875rem;
  box-shadow: var(--shadow-card);
  animation: toastIn 0.3s ease;
  pointer-events: all;
  display: flex;
  align-items: center;
  gap: 0.75rem;
}

.toast.toast-success { border-color: var(--success); }
.toast.toast-error   { border-color: var(--danger);  }
.toast.toast-warning { border-color: var(--warning); }
.toast.toast-out { animation: toastOut 0.3s ease forwards; }

@keyframes toastIn { from { opacity: 0; transform: translateX(20px); } to { opacity: 1; transform: translateX(0); } }
@keyframes toastOut { from { opacity: 1; transform: translateX(0); } to { opacity: 0; transform: translateX(20px); } }

/* ============================================================
   AUDITORÍA
   ============================================================ */
.audit-card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 0.75rem 1rem;
  margin-bottom: 0.5rem;
  font-size: 0.8rem;
}

.audit-header { display: flex; justify-content: space-between; margin-bottom: 0.25rem; }
.audit-accion { font-weight: 600; color: var(--accent-light); }
.audit-fecha { color: var(--text-muted); }
.audit-body { color: var(--text-secondary); }
.audit-motivo { color: var(--warning); font-style: italic; margin-top: 0.25rem; }

/* ============================================================
   PRINT STYLES
   ============================================================ */
@media print {
  body { background: white; color: black; }
  .app-header, .bottom-nav, .btn, .filter-bar,
  .modal-overlay, #toast-container { display: none !important; }
  .app-main { padding: 0; }
  .card { border: 1px solid #ddd; box-shadow: none; page-break-inside: avoid; }
  .view.active { display: block !important; }
  
  .print-header { 
    text-align: center; 
    border-bottom: 2px solid #000; 
    padding-bottom: 1rem; 
    margin-bottom: 1rem; 
  }
  .print-header h2 { font-size: 1.2rem; }
  .print-header p { font-size: 0.8rem; color: #666; }
  
  table { width: 100%; border-collapse: collapse; font-size: 0.8rem; }
  th, td { border: 1px solid #ddd; padding: 0.4rem 0.6rem; text-align: left; }
  th { background: #f0f0f0; font-weight: 600; }
}

/* ============================================================
   DESKTOP RESPONSIVE
   ============================================================ */
@media (min-width: 640px) {
  .app-main { padding-left: 1.5rem; padding-right: 1.5rem; }
  .stats-grid { grid-template-columns: repeat(4, 1fr); }
  .modal-box { border-radius: var(--radius-xl); bottom: auto; }
  .modal { align-items: center; }
  .activa-info { grid-template-columns: repeat(3, 1fr); }
}

@media (min-width: 1024px) {
  .app-main { padding-left: 2rem; padding-right: 2rem; }
  .bottom-nav { max-width: 640px; left: 50%; transform: translateX(-50%); border-left: 1px solid var(--border); border-right: 1px solid var(--border); border-radius: var(--radius-xl) var(--radius-xl) 0 0; }
}
