/* ═══════════════════════════════════════════
   CSJB LIMA v2 — Design System
   Paleta: Rojo-Naranja-Dorado
═══════════════════════════════════════════ */

:root {
  --bg:          #120200;
  --bg-card:     #1e0400;
  --bg-mid:      #2a0600;
  --bg-hover:    #380800;

  --accent:      #e05a20;
  --accent-dim:  #c04010;
  --accent-glow: rgba(224,90,32,0.35);

  --rojo:        #c0392b;
  --rojo-glow:   rgba(192,57,43,0.35);

  --gold:        #c4920a;
  --gold-light:  #e8b030;
  --gold-dim:    rgba(196,146,10,0.15);

  --silver:      #ede0d8;
  --text:        #d4c0b8;
  --text2:       #a88878;
  --text3:       #6a4838;

  --success:     #2dd4a0;
  --warning:     #e8b030;
  --danger:      #e05555;
  --info:        #e8a070;

  --border:        1px solid rgba(196,146,10,0.15);
  --border-accent: 1px solid rgba(224,90,32,0.35);
  --border-gold:   1px solid rgba(196,146,10,0.4);

  --radius:    16px;
  --radius-sm: 10px;
  --radius-lg: 24px;

  --font-titulo: 'Cinzel', 'Cormorant Garamond', serif;
  --font-body:   'Montserrat', 'Inter', sans-serif;
}

/* ── Reset + Fondo global ── */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

html {
  font-size: 16px;
  -webkit-text-size-adjust: 100%;
  background: #120200 !important;
  background-color: #120200 !important;
  min-height: 100%;
}

body {
  font-family: var(--font-body);
  background: #120200 !important;
  background-color: #120200 !important;
  color: var(--text);
  min-height: 100vh;
  -webkit-font-smoothing: antialiased;
}

/* ── Layout ── */
.layout { display: flex; min-height: 100vh; background: #120200; }
.main-content {
  flex: 1; display: flex; flex-direction: column;
  min-width: 0; padding-bottom: 80px;
  background: #120200;
}
.contenido {
  padding: 16px; max-width: 680px;
  margin: 0 auto; width: 100%;
}

/* ── Topbar ── */
.topbar {
  display: flex; align-items: center; justify-content: space-between;
  padding: 12px 16px;
  background: rgba(18,2,0,0.97);
  border-bottom: 1px solid rgba(196,146,10,0.2);
  backdrop-filter: blur(10px); -webkit-backdrop-filter: blur(10px);
  position: sticky; top: 0; z-index: 100;
}
.topbar-left { display: flex; align-items: center; gap: 10px; }
.topbar-titulo {
  font-family: var(--font-titulo); font-size: 18px;
  font-weight: 700; color: var(--silver); letter-spacing: 0.5px;
}
.topbar-fecha { font-size: 13px; color: var(--gold); font-weight: 600; }
.btn-hamburger {
  background: none; border: none; color: var(--gold);
  font-size: 20px; cursor: pointer; padding: 4px 8px;
  border-radius: 8px; transition: background 0.2s;
}
.btn-hamburger:hover { background: rgba(196,146,10,0.1); }

/* ── Cards ── */
.card {
  background: linear-gradient(160deg, #1e0400, #2a0800);
  border: var(--border); border-radius: var(--radius);
  padding: 18px; margin-bottom: 12px;
}
.titulo {
  font-family: var(--font-titulo); font-size: 20px;
  font-weight: 700; color: var(--silver); letter-spacing: 0.3px;
}

/* ── Sidebar ── */
.sidebar {
  width: 260px;
  background: linear-gradient(180deg, #160300 0%, #1e0400 100%);
  border-right: 1px solid rgba(196,146,10,0.15);
  height: 100vh; position: fixed; left: -260px; top: 0;
  z-index: 200; transition: left 0.3s cubic-bezier(0.4,0,0.2,1);
  overflow-y: auto; display: flex; flex-direction: column;
}
.sidebar.abierto { left: 0; }
.sidebar-logo {
  padding: 20px 16px 14px;
  border-bottom: 1px solid rgba(196,146,10,0.15);
  display: flex; align-items: center; gap: 12px;
}
.sidebar-logo img { width: 44px; height: 44px; border-radius: 10px; }
.sidebar-logo-text .nombre {
  font-family: var(--font-titulo); font-size: 15px;
  font-weight: 700; color: var(--silver);
}
.sidebar-logo-text .sub { font-size: 11px; color: var(--gold); margin-top: 1px; }
.sidebar-section-label {
  font-size: 9px; font-weight: 700; letter-spacing: 2px;
  text-transform: uppercase; color: var(--text3); padding: 14px 16px 6px;
}
.sidebar-item {
  display: flex; align-items: center; gap: 10px;
  padding: 10px 16px; color: var(--text2); text-decoration: none;
  font-size: 14px; font-weight: 500; transition: all 0.2s;
  border-left: 3px solid transparent;
}
.sidebar-item:hover, .sidebar-item.activo {
  background: rgba(196,146,10,0.08); color: var(--gold-light);
  border-left-color: var(--gold);
}
.sidebar-item .icon { width: 20px; text-align: center; font-size: 16px; }
.sidebar-overlay {
  display: none; position: fixed; inset: 0;
  background: rgba(0,0,0,0.65); z-index: 199;
  backdrop-filter: blur(2px);
}
.sidebar-overlay.activo { display: block; }

/* ── Panel menu bottom ── */
.panel-menu {
  position: fixed; bottom: 0; left: 0; right: 0;
  background: rgba(18,2,0,0.97);
  border-top: 1px solid rgba(196,146,10,0.2);
  display: flex; justify-content: space-around; align-items: center;
  padding: 8px 0 max(8px, env(safe-area-inset-bottom));
  z-index: 150; backdrop-filter: blur(10px);
}
.panel-item {
  display: flex; flex-direction: column; align-items: center; gap: 3px;
  text-decoration: none; color: var(--text3); font-size: 10px;
  font-weight: 500; padding: 4px 12px; border-radius: 10px; transition: all 0.2s;
}
.panel-item.activo, .panel-item:hover { color: var(--gold); }
.panel-item .pi { font-size: 20px; }

/* ── Botones ── */
.btn {
  display: inline-flex; align-items: center; justify-content: center;
  gap: 8px; padding: 12px 24px; border-radius: 50px;
  font-family: var(--font-titulo); font-size: 18px; font-weight: 700;
  cursor: pointer; border: none; transition: all 0.2s;
  text-decoration: none; letter-spacing: 0.3px;
}
.btn-primary {
  background: linear-gradient(135deg, #c0392b, #7a1f15);
  color: #fff; box-shadow: 0 4px 16px rgba(192,57,43,0.4);
}
.btn-primary:hover { transform: translateY(-1px); opacity: 0.92; }
.btn-accent {
  background: linear-gradient(135deg, #e05a20, #a03a10);
  color: #fff; box-shadow: 0 4px 16px rgba(224,90,32,0.4);
}
.btn-accent:hover { transform: translateY(-1px); opacity: 0.92; }
.btn-gold {
  background: linear-gradient(135deg, #c4920a, #8a6607);
  color: #fff; box-shadow: 0 4px 16px rgba(196,146,10,0.35);
}
.btn-gold:hover { transform: translateY(-1px); opacity: 0.92; }
.btn-outline {
  background: rgba(196,146,10,0.08); border: var(--border-gold);
  color: var(--gold-light);
}
.btn-outline:hover { background: rgba(196,146,10,0.15); }
.btn-success {
  background: linear-gradient(135deg, #2dd4a0, #1ab080);
  color: #fff; box-shadow: 0 4px 16px rgba(45,212,160,0.3);
}
.btn:disabled { opacity: 0.4; cursor: not-allowed; transform: none !important; }
.btn-full { width: 100%; }

/* ── Formularios ── */
.form-group { margin-bottom: 14px; }
.form-label {
  display: block; font-size: 11px; font-weight: 600;
  letter-spacing: 1.5px; text-transform: uppercase;
  color: var(--text3); margin-bottom: 6px;
}
.form-control {
  width: 100%; padding: 12px 14px;
  background: rgba(10,2,0,0.8); border: var(--border);
  border-radius: var(--radius-sm); color: var(--text);
  font-family: var(--font-body); font-size: 15px;
  outline: none; transition: border-color 0.2s; -webkit-appearance: none;
}
.form-control:focus {
  border-color: rgba(196,146,10,0.5);
  box-shadow: 0 0 0 3px rgba(196,146,10,0.08);
}
.form-control::placeholder { color: var(--text3); }
.form-control:-webkit-autofill,
.form-control:-webkit-autofill:focus {
  -webkit-box-shadow: 0 0 0 1000px #1e0400 inset;
  -webkit-text-fill-color: var(--silver);
}

/* ── Alertas ── */
.alerta {
  display: flex; align-items: flex-start; gap: 10px;
  padding: 12px 16px; border-radius: var(--radius-sm);
  font-size: 13px; line-height: 1.5; margin-bottom: 12px;
}
.alerta-ok    { background: rgba(45,212,160,0.08);  border: 1px solid rgba(45,212,160,0.25);  color: var(--success); }
.alerta-error { background: rgba(224,85,85,0.08);   border: 1px solid rgba(224,85,85,0.25);   color: var(--danger); }
.alerta-warn  { background: rgba(196,146,10,0.08);  border: 1px solid rgba(196,146,10,0.25);  color: var(--warning); }
.alerta-info  { background: rgba(232,160,112,0.08); border: 1px solid rgba(232,160,112,0.25); color: var(--info); }

/* ── Chips ── */
.chip {
  display: inline-flex; align-items: center; gap: 5px;
  padding: 4px 12px; border-radius: 20px;
  font-size: 12px; font-weight: 600;
}
.chip-rojo    { background: rgba(192,57,43,0.15);  border: 1px solid rgba(192,57,43,0.3);   color: #ff8070; }
.chip-naranja { background: rgba(224,90,32,0.15);  border: 1px solid rgba(224,90,32,0.3);   color: #ff9060; }
.chip-gold    { background: rgba(196,146,10,0.15); border: 1px solid rgba(196,146,10,0.35); color: var(--gold-light); }
.chip-plata   { background: rgba(237,224,216,0.08);border: 1px solid rgba(237,224,216,0.2); color: var(--silver); }

/* ── GPS ── */
.gps-dot { width:10px; height:10px; border-radius:50%; background:var(--text3); flex-shrink:0; }
.gps-dot.ok      { background:var(--success); box-shadow:0 0 8px rgba(45,212,160,0.5); }
.gps-dot.error   { background:var(--danger); }
.gps-dot.loading { background:var(--warning); animation:blink 1s infinite; }
@keyframes blink { 0%,100%{opacity:1} 50%{opacity:0.3} }

/* ── Utils ── */
.mt-8  { margin-top: 8px; }
.mt-12 { margin-top: 12px; }
.mt-16 { margin-top: 16px; }
.text-muted { font-size: 12px; color: var(--text3); margin-top: 4px; }
.divider-gold {
  height: 1px;
  background: linear-gradient(90deg, transparent, rgba(196,146,10,0.4), transparent);
  margin: 16px 0;
}

/* ── Scrollbar ── */
::-webkit-scrollbar { width: 4px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb { background: rgba(196,146,10,0.2); border-radius: 4px; }