/* ============================================================
   SafeGuard Pro — styles.css  |  Mobile-first
   ============================================================ */

:root {
  --ro:   #E53935;
  --am:   #FF8F00;
  --ve:   #00C853;
  --azul: #1565C0;
  --az2:  #1E88E5;
  --gris: #263238;
  --f1:   #0D1117;
  --f2:   #161B22;
  --f3:   #21262D;
  --f4:   #30363D;
  --tx:   #E6EDF3;
  --td:   #8B949E;
  --bo:   #30363D;
  --radius: 12px;
  --radius-sm: 8px;
  --shadow: 0 4px 24px rgba(0,0,0,.5);
  --font: 'Segoe UI', system-ui, -apple-system, sans-serif;
}

*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

html { font-size: 16px; -webkit-text-size-adjust: 100%; }

body {
  font-family: var(--font);
  background: var(--f1);
  color: var(--tx);
  min-height: 100dvh;
  overflow-x: hidden;
}

/* ── PANTALLAS ─────────────────────────────────────────────── */
.screen { display: none; }
.screen.active { display: block; }


/* ══ LOGIN ═══════════════════════════════════════════════════ */
.login-bg {
  min-height: 100dvh;
  background: linear-gradient(160deg, #0d1117 0%, #1a2332 60%, #0d1117 100%);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 24px 16px;
}
.login-card {
  width: 100%;
  max-width: 400px;
  background: var(--f2);
  border: 1px solid var(--bo);
  border-radius: var(--radius);
  padding: 32px 24px;
  box-shadow: var(--shadow);
}
.login-logo {
  font-size: 28px;
  font-weight: 900;
  color: var(--am);
  letter-spacing: 3px;
  text-align: center;
  margin-bottom: 4px;
}
.login-norm {
  font-size: 10px;
  color: var(--td);
  text-align: center;
  letter-spacing: 1.5px;
  margin-bottom: 24px;
}
.login-titulo {
  font-size: 18px;
  font-weight: 700;
  margin-bottom: 20px;
  text-align: center;
}
.pass-wrap { position: relative; }
.pass-eye {
  position: absolute;
  right: 12px;
  top: 50%;
  transform: translateY(-50%);
  background: none;
  border: none;
  cursor: pointer;
  font-size: 18px;
  color: var(--td);
}
.link-forgot {
  color: var(--az2);
  font-size: 13px;
  text-align: center;
  margin-top: 12px;
  cursor: pointer;
  text-decoration: underline;
}


/* ══ TOPBAR ═══════════════════════════════════════════════════ */
.topbar {
  position: fixed;
  top: 0; left: 0; right: 0;
  height: 56px;
  background: var(--f2);
  border-bottom: 1px solid var(--bo);
  display: flex;
  align-items: center;
  padding: 0 16px;
  gap: 12px;
  z-index: 100;
}
.burger {
  background: none;
  border: none;
  color: var(--tx);
  font-size: 22px;
  cursor: pointer;
  padding: 4px;
  flex-shrink: 0;
}
.topbar-title {
  font-size: 16px;
  font-weight: 700;
  flex: 1;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.topbar-user {
  font-size: 11px;
  color: var(--td);
  text-align: right;
  flex-shrink: 0;
  max-width: 120px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}


/* ══ SIDENAV ══════════════════════════════════════════════════ */
.nav-overlay {
  display: none;
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,.6);
  z-index: 150;
}
.nav-overlay.active { display: block; }

.sidenav {
  position: fixed;
  top: 0; left: 0; bottom: 0;
  width: 280px;
  background: var(--f2);
  border-right: 1px solid var(--bo);
  z-index: 200;
  overflow-y: auto;
  transform: translateX(-100%);
  transition: transform .28s cubic-bezier(.4,0,.2,1);
  display: flex;
  flex-direction: column;
}
.sidenav.open { transform: translateX(0); }
.sidenav::-webkit-scrollbar { width: 2px; }
.sidenav::-webkit-scrollbar-thumb { background: var(--bo); }

.nav-user-panel {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 20px 16px;
  border-bottom: 1px solid var(--bo);
  background: var(--f3);
}
.nav-av {
  width: 40px;
  height: 40px;
  border-radius: 50%;
  background: linear-gradient(135deg, var(--am), var(--ro));
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 14px;
  font-weight: 800;
  color: #fff;
  flex-shrink: 0;
}
.nav-nombre { font-size: 14px; font-weight: 700; }
.nav-rol {
  font-size: 10px;
  color: var(--am);
  letter-spacing: 1px;
  text-transform: uppercase;
  margin-top: 2px;
}
.nav-section { padding: 8px 0; border-bottom: 1px solid var(--bo); }
.nav-head {
  font-size: 9px;
  color: var(--td);
  letter-spacing: 2px;
  padding: 8px 16px 4px;
  text-transform: uppercase;
}
.nav-item {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 12px 16px;
  font-size: 14px;
  cursor: pointer;
  color: var(--td);
  border-left: 3px solid transparent;
  transition: all .15s;
}
.nav-item:hover { background: rgba(255,255,255,.04); color: var(--tx); }
.nav-item.active { color: var(--am); border-left-color: var(--am); background: rgba(255,143,0,.07); font-weight: 600; }
.nav-bottom {
  margin-top: auto;
  padding: 16px;
  border-top: 1px solid var(--bo);
}


/* ══ MAIN CONTENT ═════════════════════════════════════════════ */
.main-content {
  margin-top: 56px;
  padding: 16px;
  min-height: calc(100dvh - 56px);
}
.page { display: none; animation: fadeIn .2s ease; }
.page.active-page { display: block; }
@keyframes fadeIn { from { opacity: 0; transform: translateY(8px); } to { opacity: 1; transform: none; } }

.page-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 16px;
  gap: 12px;
}
.page-title { font-size: 20px; font-weight: 800; }
.page-hint { font-size: 13px; color: var(--td); margin-bottom: 16px; }


/* ══ WIZARD ═══════════════════════════════════════════════════ */
.wizard-step { display: none; }
.wizard-step.active-step { display: block; animation: fadeIn .2s ease; }
.step-label {
  font-size: 10px;
  letter-spacing: 2px;
  color: var(--am);
  text-transform: uppercase;
  margin-bottom: 16px;
  font-weight: 700;
}
.wizard-nav {
  display: flex;
  gap: 12px;
  justify-content: space-between;
}


/* ══ FORMULARIO ═══════════════════════════════════════════════ */
.form-field { margin-bottom: 14px; }
.form-field-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 14px;
}
.flabel {
  display: block;
  font-size: 11px;
  color: var(--td);
  letter-spacing: 1px;
  text-transform: uppercase;
  margin-bottom: 6px;
  font-weight: 600;
}
.req { color: var(--ro); }
.finput, .fselect, .ftextarea {
  width: 100%;
  padding: 12px 14px;
  background: var(--f3);
  border: 1px solid var(--bo);
  border-radius: var(--radius-sm);
  color: var(--tx);
  font-size: 15px;
  font-family: var(--font);
  outline: none;
  transition: border-color .15s;
  -webkit-appearance: none;
}
.finput:focus, .fselect:focus, .ftextarea:focus { border-color: var(--am); }
.finput::placeholder, .ftextarea::placeholder { color: var(--td); }
.fselect {
  cursor: pointer;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='8'%3E%3Cpath d='M0 0l6 8 6-8z' fill='%238B949E'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 14px center;
  padding-right: 36px;
}
.ftextarea { resize: vertical; min-height: 80px; line-height: 1.5; }
.finput-sm, .fselect-sm {
  padding: 8px 12px;
  background: var(--f3);
  border: 1px solid var(--bo);
  border-radius: var(--radius-sm);
  color: var(--tx);
  font-size: 13px;
  outline: none;
}


/* ══ BOTONES ══════════════════════════════════════════════════ */
.btn-primary {
  background: var(--am);
  color: #000;
  border: none;
  border-radius: var(--radius-sm);
  padding: 13px 20px;
  font-size: 14px;
  font-weight: 700;
  cursor: pointer;
  letter-spacing: .5px;
  transition: all .15s;
  white-space: nowrap;
}
.btn-primary:hover { background: #e65100; box-shadow: 0 4px 16px rgba(255,143,0,.3); }
.btn-primary:disabled { opacity: .4; cursor: not-allowed; }

.btn-secondary {
  background: rgba(30,136,229,.12);
  color: var(--az2);
  border: 1px solid rgba(30,136,229,.25);
  border-radius: var(--radius-sm);
  padding: 12px 18px;
  font-size: 14px;
  font-weight: 600;
  cursor: pointer;
  transition: all .15s;
}
.btn-secondary:hover { background: rgba(30,136,229,.2); }

.btn-success {
  background: var(--ve);
  color: #000;
  border: none;
  border-radius: var(--radius-sm);
  padding: 14px 20px;
  font-size: 15px;
  font-weight: 800;
  cursor: pointer;
  transition: all .15s;
}
.btn-success:hover { background: #00a846; box-shadow: 0 4px 16px rgba(0,200,83,.3); }

.btn-ghost {
  background: transparent;
  color: var(--td);
  border: 1px solid var(--bo);
  border-radius: var(--radius-sm);
  padding: 12px 18px;
  font-size: 14px;
  cursor: pointer;
  transition: all .15s;
}
.btn-ghost:hover { color: var(--tx); border-color: var(--tx); }

.btn-ghost-sm {
  background: transparent;
  color: var(--ro);
  border: none;
  font-size: 13px;
  cursor: pointer;
  padding: 4px 8px;
}

.btn-draft {
  background: rgba(255,255,255,.05);
  color: var(--td);
  border: 1px solid var(--bo);
  border-radius: var(--radius-sm);
  padding: 12px 18px;
  font-size: 14px;
  cursor: pointer;
  transition: all .15s;
  width: 100%;
}
.btn-logout {
  width: 100%;
  padding: 12px;
  background: rgba(229,57,53,.08);
  color: var(--ro);
  border: 1px solid rgba(229,57,53,.25);
  border-radius: var(--radius-sm);
  font-size: 14px;
  font-weight: 700;
  cursor: pointer;
}
.btn-sm {
  padding: 8px 14px;
  background: var(--am);
  color: #000;
  border: none;
  border-radius: var(--radius-sm);
  font-size: 13px;
  font-weight: 700;
  cursor: pointer;
}

.full { width: 100%; }
.mt8  { margin-top: 8px; }
.mt12 { margin-top: 12px; }
.mt16 { margin-top: 16px; }


/* ── Grupo de botones opción ── */
.btn-group {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-top: 4px;
}
.btn-opt {
  padding: 9px 14px;
  border-radius: 20px;
  border: 1px solid var(--bo);
  background: var(--f3);
  color: var(--td);
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
  transition: all .15s;
  white-space: nowrap;
}
.btn-opt:hover  { border-color: var(--am); color: var(--am); }
.btn-opt.active { background: var(--am); border-color: var(--am); color: #000; }
.btn-opt.btn-leve.active   { background: var(--am);  border-color: var(--am);  color: #000; }
.btn-opt.btn-grave.active  { background: #FF6D00;    border-color: #FF6D00;    color: #000; }
.btn-opt.btn-muygrv.active { background: var(--ro);  border-color: var(--ro);  color: #fff; }


/* ══ TABS ═════════════════════════════════════════════════════ */
.tabs {
  display: flex;
  gap: 4px;
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
  scrollbar-width: none;
  border-bottom: 1px solid var(--bo);
  margin-bottom: 4px;
}
.tabs::-webkit-scrollbar { display: none; }
.tab {
  padding: 10px 16px;
  background: none;
  border: none;
  border-bottom: 2px solid transparent;
  color: var(--td);
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
  white-space: nowrap;
  transition: all .15s;
}
.tab:hover  { color: var(--tx); }
.tab.active { color: var(--am); border-bottom-color: var(--am); }


/* ══ SEMÁFORO ═════════════════════════════════════════════════ */
.semaforo-bar {
  background: var(--f3);
  border: 1px solid var(--bo);
  border-radius: var(--radius);
  padding: 14px 16px;
  display: flex;
  align-items: center;
  gap: 14px;
  margin-bottom: 12px;
}
.sem-luces {
  display: flex;
  flex-direction: column;
  gap: 5px;
}
.sem-luz {
  width: 18px;
  height: 18px;
  border-radius: 50%;
  transition: all .4s;
}
.sem-luz.off { opacity: .15; filter: grayscale(1); }
.sem-data { flex: 1; }
.sem-pct  { font-size: 28px; font-weight: 900; line-height: 1; }
.sem-etiqueta { font-size: 10px; letter-spacing: 1.5px; text-transform: uppercase; color: var(--td); }
.sem-chips { display: flex; flex-direction: column; gap: 3px; }
.chip-mg   { font-size: 11px; font-weight: 700; color: var(--ro); background: rgba(229,57,53,.12); border-radius: 4px; padding: 2px 7px; }
.chip-g    { font-size: 11px; font-weight: 700; color: #FF6D00;   background: rgba(255,109,0,.1);  border-radius: 4px; padding: 2px 7px; }
.chip-l    { font-size: 11px; font-weight: 700; color: var(--am); background: rgba(255,143,0,.1);  border-radius: 4px; padding: 2px 7px; }


/* ══ GPS ══════════════════════════════════════════════════════ */
.gps-card {
  background: var(--f3);
  border: 1px solid var(--bo);
  border-radius: var(--radius);
  padding: 24px 20px;
  text-align: center;
}
.gps-icon { font-size: 48px; margin-bottom: 8px; }
.gps-titulo { font-size: 17px; font-weight: 700; }
.gps-sub { font-size: 13px; color: var(--td); margin-top: 6px; line-height: 1.4; }
.gps-status { margin-top: 12px; font-size: 13px; color: var(--ve); min-height: 18px; }


/* ══ FOTOS ════════════════════════════════════════════════════ */
.foto-zone {
  border: 2px dashed var(--bo);
  border-radius: var(--radius-sm);
  padding: 20px;
  text-align: center;
  cursor: pointer;
  font-size: 14px;
  color: var(--td);
  transition: all .15s;
}
.foto-zone:hover { border-color: var(--am); color: var(--am); }
.foto-zone-sm {
  border: 1px dashed var(--bo);
  border-radius: var(--radius-sm);
  padding: 12px;
  text-align: center;
  cursor: pointer;
  font-size: 13px;
  color: var(--td);
}
.fotos-preview { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 8px; }
.foto-thumb {
  width: 80px;
  height: 80px;
  border-radius: 8px;
  object-fit: cover;
  border: 1px solid var(--bo);
}
.foto-item-prev { position: relative; }


/* ══ CARDS DE LISTA ═══════════════════════════════════════════ */
.card-list { display: flex; flex-direction: column; gap: 10px; }
.card {
  background: var(--f2);
  border: 1px solid var(--bo);
  border-radius: var(--radius);
  padding: 14px 16px;
  cursor: pointer;
  transition: border-color .15s, transform .15s;
}
.card:hover { border-color: rgba(255,143,0,.3); transform: translateY(-1px); }
.card-top  { display: flex; align-items: center; gap: 10px; margin-bottom: 6px; }
.card-ico  { font-size: 20px; flex-shrink: 0; }
.card-title{ font-size: 14px; font-weight: 700; flex: 1; }
.card-badge{
  font-size: 10px;
  font-weight: 700;
  border-radius: 4px;
  padding: 2px 8px;
  letter-spacing: .5px;
}
.badge-verde    { background: rgba(0,200,83,.18);  color: #005a25; border: 1px solid rgba(0,200,83,.35);
                  font-weight: 800; }
.badge-amarillo { background: rgba(255,143,0,.22);  color: #7a4500; border: 1px solid rgba(255,143,0,.4);
                  font-weight: 800; }
.badge-rojo     { background: rgba(229,57,53,.18);  color: #8b1212; border: 1px solid rgba(229,57,53,.35);
                  font-weight: 800; }
.badge-borrador { background: rgba(255,255,255,.05); color: var(--td); border: 1px solid var(--bo); }
.card-meta { font-size: 12px; color: var(--td); }
.card-stats{ display: flex; gap: 12px; flex-wrap: wrap; margin-top: 6px; }
.stat-chip { font-size: 11px; font-weight: 600; padding: 2px 8px; border-radius: 4px; }


/* ══ ÍTEMS DEL REPORTE ════════════════════════════════════════ */
.items-list { display: flex; flex-direction: column; gap: 8px; }
.item-card {
  background: var(--f3);
  border: 1px solid var(--bo);
  border-radius: var(--radius-sm);
  border-left: 4px solid var(--bo);
  padding: 12px 14px;
  position: relative;
}
.item-card.LEVE     { border-left-color: var(--am); }
.item-card.GRAVE    { border-left-color: #FF6D00; }
.item-card.MUY-GRAVE{ border-left-color: var(--ro); }
.item-card.NA       { border-left-color: var(--td); }
.item-header { display: flex; align-items: center; gap: 8px; margin-bottom: 6px; }
.item-num    { font-size: 11px; font-family: monospace; color: var(--td); flex-shrink: 0; }
.item-desc   { font-size: 13px; font-weight: 600; flex: 1; }
.item-obs    { font-size: 12px; color: var(--td); margin-top: 4px; }
.item-acciones{ display: flex; gap: 8px; margin-top: 8px; }
.btn-icon {
  padding: 6px 10px;
  background: var(--f4);
  border: 1px solid var(--bo);
  border-radius: 6px;
  font-size: 13px;
  cursor: pointer;
  color: var(--td);
}
.btn-icon:hover { color: var(--tx); }
.item-resuelto { font-size: 11px; color: var(--ve); margin-top: 4px; }


/* ══ PRELLENAR ════════════════════════════════════════════════ */
.prellenar-card {
  background: rgba(255,143,0,.06);
  border: 1px solid rgba(255,143,0,.2);
  border-radius: var(--radius-sm);
  padding: 14px;
  display: flex;
  align-items: center;
  gap: 12px;
  flex-wrap: wrap;
  margin-bottom: 8px;
}
.prellenar-icon { font-size: 28px; flex-shrink: 0; }
.prellenar-titulo { font-size: 14px; font-weight: 700; color: var(--am); }
.prellenar-sub { font-size: 12px; color: var(--td); }


/* ══ SUGERENCIAS ══════════════════════════════════════════════ */
.sug-list { display: flex; flex-direction: column; gap: 8px; }
.sug-item {
  background: var(--f3);
  border: 1px solid var(--bo);
  border-radius: var(--radius-sm);
  padding: 12px 14px;
  display: flex;
  align-items: flex-start;
  gap: 10px;
}
.sug-check { flex-shrink: 0; width: 20px; height: 20px; accent-color: var(--ve); cursor: pointer; }
.sug-body { flex: 1; }
.sug-titulo-t { font-size: 13px; font-weight: 600; }
.sug-desc-t   { font-size: 12px; color: var(--td); margin-top: 3px; }


/* ══ KPI GRID ═════════════════════════════════════════════════ */
.kpi-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.kpi-card {
  background: var(--f2);
  border: 1px solid var(--bo);
  border-radius: var(--radius-sm);
  padding: 16px;
  text-align: center;
  border-top: 3px solid var(--am);
}
.kpi-val { font-size: 32px; font-weight: 900; color: var(--am); }
.kpi-lbl { font-size: 11px; color: var(--td); letter-spacing: 1px; text-transform: uppercase; margin-top: 4px; }


/* ══ INDICADORES ══════════════════════════════════════════════ */
.indicadores-body { display: flex; flex-direction: column; gap: 16px; }
.indic-card {
  background: var(--f2);
  border: 1px solid var(--bo);
  border-radius: var(--radius);
  overflow: hidden;
}
.indic-head { padding: 10px 14px; background: var(--f3); border-bottom: 1px solid var(--bo); font-size: 13px; font-weight: 700; }
.indic-body { padding: 14px; }
.indic-row  { display: flex; justify-content: space-between; align-items: center; padding: 8px 0; border-bottom: 1px solid var(--bo); font-size: 13px; }
.indic-row:last-child { border-bottom: none; }
.indic-num  { font-size: 18px; font-weight: 800; }


/* ══ INFO BOX ═════════════════════════════════════════════════ */
.info-box {
  background: rgba(30,136,229,.07);
  border: 1px solid rgba(30,136,229,.2);
  border-radius: var(--radius-sm);
  padding: 12px 14px;
  font-size: 13px;
  margin-bottom: 12px;
}
.detalle-box {
  background: var(--f4);
  border-radius: var(--radius-sm);
  padding: 10px 12px;
  font-size: 12px;
  color: var(--td);
  margin-bottom: 10px;
  line-height: 1.5;
}


/* ══ RESUMEN CARD ═════════════════════════════════════════════ */
.resumen-card {
  background: var(--f3);
  border: 1px solid var(--bo);
  border-radius: var(--radius);
  padding: 16px;
}
.resumen-titulo { font-size: 14px; font-weight: 700; margin-bottom: 12px; }


/* ══ FILTER BAR ═══════════════════════════════════════════════ */
.filter-bar { display: flex; gap: 8px; flex-wrap: wrap; margin-bottom: 14px; }


/* ══ SECTION DIVIDER ══════════════════════════════════════════ */
.section-divider {
  font-size: 10px;
  letter-spacing: 2px;
  color: var(--td);
  text-transform: uppercase;
  font-weight: 700;
  padding: 10px 0 6px;
  border-bottom: 1px solid var(--bo);
  margin-bottom: 10px;
}


/* ══ MODAL ════════════════════════════════════════════════════ */
.modal-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,.75);
  z-index: 300;
  display: flex;
  align-items: flex-end;
  padding: 0;
}
.modal-card {
  background: var(--f2);
  border-radius: var(--radius) var(--radius) 0 0;
  border: 1px solid var(--bo);
  border-bottom: none;
  width: 100%;
  max-height: 90dvh;
  overflow-y: auto;
  padding: 20px 16px 32px;
  animation: slideUp .25s cubic-bezier(.4,0,.2,1);
}
.modal-wide { max-width: 600px; margin: auto; border-radius: var(--radius); border-bottom: 1px solid var(--bo); }
@keyframes slideUp { from { transform: translateY(30px); opacity: 0; } to { transform: none; opacity: 1; } }
.modal-titulo { font-size: 18px; font-weight: 800; margin-bottom: 18px; }
.modal-actions { display: flex; gap: 10px; margin-top: 20px; justify-content: flex-end; }


/* ══ SWITCH TOGGLE ════════════════════════════════════════════ */
.switch { position: relative; display: inline-block; width: 48px; height: 26px; }
.switch input { opacity: 0; width: 0; height: 0; }
.slider {
  position: absolute;
  inset: 0;
  background: var(--bo);
  border-radius: 26px;
  cursor: pointer;
  transition: background .2s;
}
.slider::before {
  content: '';
  position: absolute;
  height: 18px;
  width: 18px;
  left: 4px;
  bottom: 4px;
  background: #fff;
  border-radius: 50%;
  transition: transform .2s;
}
input:checked + .slider { background: var(--ve); }
input:checked + .slider::before { transform: translateX(22px); }


/* ══ TOAST ════════════════════════════════════════════════════ */
.toast {
  position: fixed;
  bottom: 24px;
  left: 50%;
  transform: translateX(-50%) translateY(80px);
  background: var(--f2);
  border: 1px solid var(--bo);
  border-radius: var(--radius);
  padding: 12px 20px;
  font-size: 14px;
  font-weight: 600;
  z-index: 11000;
  opacity: 0;
  transition: all .3s cubic-bezier(.34,1.56,.64,1);
  max-width: calc(100vw - 32px);
  text-align: center;
  white-space: nowrap;
  box-shadow: var(--shadow);
}
.toast.show { opacity: 1; transform: translateX(-50%) translateY(0); }
.toast.ok   { border-color: var(--ve); color: var(--ve); }
.toast.err  { border-color: var(--ro); color: var(--ro); }
.toast.warn { border-color: var(--am); color: var(--am); }


/* ══ LOADING ══════════════════════════════════════════════════ */
.loading-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,.65);
  z-index: 400;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 14px;
}
.loading-spinner {
  width: 44px;
  height: 44px;
  border: 3px solid var(--bo);
  border-top-color: var(--am);
  border-radius: 50%;
  animation: spin .8s linear infinite;
}
@keyframes spin { to { transform: rotate(360deg); } }
.loading-txt { font-size: 14px; color: var(--td); }


/* ══ MENSAJES ═════════════════════════════════════════════════ */
.msg-err { font-size: 13px; color: var(--ro); text-align: center; min-height: 16px; margin-top: 8px; }
.msg-ok  { font-size: 13px; color: var(--ve); text-align: center; margin-top: 8px; }


/* ══ RESPONSIVE: tablets y desktop ═══════════════════════════ */
@media (min-width: 640px) {
  .main-content { padding: 20px 24px; max-width: 800px; margin-left: auto; margin-right: auto; }
  .kpi-grid { grid-template-columns: repeat(4, 1fr); }
  .sidenav {
    position: fixed;
    transform: translateX(0);
    width: 260px;
  }
  .main-content {
    margin-left: 260px;
    max-width: none;
  }
  .nav-overlay { display: none !important; }
  #burger-btn { display: none; }
  .modal-overlay { align-items: center; }
  .modal-card { border-radius: var(--radius); border-bottom: 1px solid var(--bo); }
}

@media (min-width: 900px) {
  .main-content { padding: 24px 32px; }
}

/* ══ ASIGNACIONES DE PERSONAL (modal obra) ════════════════ */
.asig-list {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  min-height: 32px;
  padding: 6px;
  background: var(--f3);
  border: 1px solid var(--bo);
  border-radius: var(--radius-sm);
}
.asig-tag {
  display: flex;
  align-items: center;
  gap: 6px;
  background: rgba(255,143,0,.1);
  border: 1px solid rgba(255,143,0,.25);
  border-radius: 20px;
  padding: 4px 10px;
  font-size: 12px;
  font-weight: 600;
  color: var(--am);
}
.asig-tag button {
  background: none;
  border: none;
  color: var(--ro);
  cursor: pointer;
  font-size: 14px;
  line-height: 1;
  padding: 0;
}
.asig-empty {
  font-size: 12px;
  color: var(--td);
  padding: 4px;
}

/* ══ KPI BANNER ═══════════════════════════════════════════ */
.kpi-banner {
  background: var(--f2);
  border: 1px solid var(--bo);
  border-radius: var(--radius);
  padding: 14px 16px;
  display: flex;
  align-items: center;
  gap: 16px;
  margin-bottom: 14px;
  flex-wrap: wrap;
}
.kpi-banner-block { text-align: center; flex: 1; min-width: 70px; }
.kpi-banner-val   { font-size: 26px; font-weight: 900; color: var(--am); line-height: 1; }
.kpi-banner-lbl   { font-size: 10px; color: var(--td); letter-spacing: 1px; text-transform: uppercase; margin-top: 3px; }
.kpi-banner-sep   { width: 1px; height: 40px; background: var(--bo); flex-shrink: 0; }

/* ══ KPI CARD DE USUARIO ══════════════════════════════════ */
.kpi-card-usr {
  background: var(--f2);
  border: 1px solid var(--bo);
  border-radius: var(--radius);
  padding: 14px 16px;
  margin-bottom: 10px;
}
.kpi-card-header {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-bottom: 10px;
}
.kpi-av {
  width: 38px;
  height: 38px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 13px;
  font-weight: 800;
  color: #fff;
  flex-shrink: 0;
}
.kpi-av-verde    { background: linear-gradient(135deg,#00c853,#00a846); }
.kpi-av-amarillo { background: linear-gradient(135deg,#ff8f00,#e65100); }
.kpi-av-rojo     { background: linear-gradient(135deg,#e53935,#b71c1c); }
.kpi-nombre      { font-size: 14px; font-weight: 700; flex: 1; }
.kpi-empresa     { font-size: 11px; color: var(--td); }
.kpi-badge       { font-size: 10px; font-weight: 700; padding: 3px 9px; border-radius: 12px; white-space: nowrap; }

.kpi-progress-wrap { margin-bottom: 8px; }
.kpi-progress-label {
  display: flex;
  justify-content: space-between;
  font-size: 11px;
  color: var(--td);
  margin-bottom: 4px;
}
.kpi-progress-label b { color: var(--tx); font-size: 13px; }
.kpi-bar-bg {
  background: var(--f3);
  border-radius: 20px;
  height: 10px;
  overflow: hidden;
}
.kpi-bar-fill {
  height: 100%;
  border-radius: 20px;
  transition: width .6s cubic-bezier(.4,0,.2,1);
}
.kpi-bar-verde    { background: linear-gradient(90deg,#00c853,#69f0ae); }
.kpi-bar-amarillo { background: linear-gradient(90deg,#ff8f00,#ffd54f); }
.kpi-bar-rojo     { background: linear-gradient(90deg,#e53935,#ff7043); }

.kpi-stats {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
  margin-top: 8px;
  font-size: 11px;
  color: var(--td);
}
.kpi-stat { display: flex; align-items: center; gap: 4px; }
.kpi-stat b { color: var(--tx); }
.kpi-tend-up   { color: var(--ve); }
.kpi-tend-down { color: var(--ro); }
.kpi-tend-eq   { color: var(--td); }
.kpi-inactivo  { opacity: .45; }

/* ══ PREVISIONISTA — STATS BANNER ════════════════════════════ */
.prev-stats-banner {
  background: var(--f2);
  border: 1px solid var(--bo);
  border-radius: var(--radius);
  padding: 14px 16px;
  margin-bottom: 14px;
}
.prev-stats-kpis {
  display: flex;
  align-items: center;
  gap: 0;
  margin-bottom: 12px;
  overflow-x: auto;
}
.prev-stat-block { flex: 1; text-align: center; min-width: 60px; }
.prev-stat-val   { font-size: 24px; font-weight: 900; color: var(--am); line-height: 1; }
.prev-stat-lbl   { font-size: 10px; color: var(--td); letter-spacing: .8px;
                   text-transform: uppercase; margin-top: 3px; }
.prev-stat-sep   { width: 1px; height: 36px; background: var(--bo); flex-shrink: 0; margin: 0 4px; }

.prev-stats-semaforos {
  display: flex;
  gap: 12px;
  flex-wrap: wrap;
  padding-top: 10px;
  border-top: 1px solid var(--bo);
  margin-bottom: 10px;
}
.prev-sem-item { display: flex; align-items: center; gap: 4px; font-size: 13px; font-weight: 600; }
.prev-sem-num  { font-size: 18px; font-weight: 900; }

.prev-stats-top { padding-top: 10px; border-top: 1px solid var(--bo); }
.prev-stats-top-titulo {
  font-size: 11px; color: var(--td); letter-spacing: 1px;
  text-transform: uppercase; margin-bottom: 8px;
}
.prev-stats-top-lista { display: flex; flex-wrap: wrap; gap: 6px; }
.prev-top-chip {
  padding: 4px 10px; border-radius: 20px; font-size: 12px;
  font-weight: 700; border: 1px solid; background: rgba(255,255,255,.03);
}

/* ══ PREVISIONISTA — TARJETA REPORTE ═════════════════════════ */
.prev-rep-card { transition: border-color .15s, transform .12s; }
.prev-rep-card:hover { border-color: rgba(30,136,229,.35); transform: translateY(-1px); }

.prev-rep-bar-wrap { margin-top: 8px; display: flex; align-items: center; gap: 8px; }
.prev-rep-bar {
  flex: 1; height: 8px; border-radius: 20px;
  background: var(--f3); overflow: hidden; display: flex;
}
.prev-rep-bar-seg { height: 100%; transition: width .4s; }
.prev-rep-bar-lbl { font-size: 11px; color: var(--td); white-space: nowrap; flex-shrink: 0; }

/* ══ TIPO DE INSPECCION — SELECTOR ══════════════════════════ */
.tipos-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px;
}
.tipo-btn {
  background: var(--f3);
  border: 2px solid var(--bo);
  border-radius: var(--radius-sm);
  padding: 12px 10px;
  cursor: pointer;
  text-align: center;
  transition: all .15s;
  color: var(--tx);
}
.tipo-btn:hover  { border-color: var(--az2); background: rgba(30,136,229,.07); }
.tipo-btn.sel    { border-color: var(--az2); background: rgba(30,136,229,.12); }
.tipo-ico        { font-size: 22px; margin-bottom: 4px; }
.tipo-nom        { font-size: 12px; font-weight: 700; line-height: 1.3; }
.tipo-desc       { font-size: 10px; color: var(--td); margin-top: 3px; line-height: 1.3; }

/* ══ CHECKLIST INTELIGENTE ══════════════════════════════════ */
.cl-modulo-header {
  background: var(--f3);
  border: 1px solid var(--bo);
  border-radius: var(--radius-sm);
  padding: 8px 12px;
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 1px;
  text-transform: uppercase;
  color: var(--td);
  margin: 12px 0 6px;
  display: flex;
  align-items: center;
  gap: 8px;
}
.cl-item {
  background: var(--f2);
  border: 1px solid var(--bo);
  border-radius: var(--radius-sm);
  margin-bottom: 6px;
  overflow: hidden;
  transition: border-color .15s;
}
.cl-item.cl-ok       { border-left: 4px solid var(--ve); }
.cl-item.cl-desv     { border-left: 4px solid var(--am); }
.cl-item.cl-no-aplica{ border-left: 4px solid var(--td); opacity: .6; }

.cl-item-header {
  display: flex;
  align-items: flex-start;
  gap: 8px;
  padding: 10px 12px;
}
.cl-item-num   { font-size: 10px; font-family: monospace; color: var(--td); flex-shrink: 0; padding-top: 2px; }
.cl-item-desc  { font-size: 13px; font-weight: 600; flex: 1; line-height: 1.35; }

.cl-item-btns  { display: flex; gap: 4px; flex-shrink: 0; flex-direction: column; }
@media(min-width:480px) { .cl-item-btns { flex-direction: row; } }

.cl-btn {
  padding: 5px 10px;
  border-radius: 6px;
  border: 1px solid var(--bo);
  background: var(--f3);
  color: var(--td);
  font-size: 12px;
  font-weight: 700;
  cursor: pointer;
  white-space: nowrap;
  transition: all .12s;
}
.cl-btn.cl-btn-ok    { background: rgba(0,200,83,.15);  color: var(--ve); border-color: rgba(0,200,83,.3); }
.cl-btn.cl-btn-desv  { background: rgba(255,143,0,.15); color: var(--am); border-color: rgba(255,143,0,.3); }
.cl-btn.cl-btn-na    { background: rgba(255,255,255,.05);color: var(--td); border-color: var(--bo); }

.cl-item-detalle {
  font-size: 11px;
  color: var(--td);
  padding: 0 12px 8px 12px;
  line-height: 1.5;
  border-top: 1px solid var(--bo);
  padding-top: 6px;
  display: none;
}
.cl-item.cl-desv .cl-item-extra,
.cl-item-extra { display: none; padding: 0 12px 10px; }
.cl-item.cl-desv .cl-item-extra { display: block; }

.cl-tipif-group { display: flex; gap: 5px; flex-wrap: wrap; margin-top: 6px; }
.cl-tipif-btn {
  padding: 5px 10px;
  border-radius: 16px;
  border: 1px solid var(--bo);
  background: var(--f3);
  color: var(--td);
  font-size: 11px;
  font-weight: 700;
  cursor: pointer;
}
.cl-tipif-btn.t-leve.active    { background: var(--am); color: #000; border-color: var(--am); }
.cl-tipif-btn.t-grave.active   { background: #FF6D00;   color: #000; border-color: #FF6D00; }
.cl-tipif-btn.t-muygrv.active  { background: var(--ro); color: #fff; border-color: var(--ro); }

/* ══ CHECKLIST — ZONA DE ARCHIVO ════════════════════════════ */
.cl-file-btn {
  background: var(--f3);
  border: 1px dashed var(--bo);
  border-radius: 6px;
  padding: 8px 12px;
  font-size: 12px;
  color: var(--td);
  cursor: pointer;
  transition: all .15s;
  display: inline-block;
  width: 100%;
  text-align: center;
}
.cl-file-btn:hover { border-color: var(--az2); color: var(--az2); }

.cl-file-preview {
  margin-top: 6px;
  display: flex;
  flex-direction: column;
  gap: 4px;
}
.cl-file-thumb {
  display: flex;
  align-items: center;
  gap: 8px;
  background: var(--f3);
  border: 1px solid var(--bo);
  border-radius: 6px;
  padding: 6px 10px;
}
.cl-file-pdf { border-color: rgba(30,136,229,.3); }

/* ══ FECHA DISPLAY ══════════════════════════════════════════ */
#fecha-display {
  border-left: 3px solid var(--am);
}

/* ══ CONSULTA MODAL TABS ════════════════════════════════════ */
.cons-tab { animation: fadeIn .2s ease; }
.cons-tab.active-tab { display: block; }

/* ══ PANEL NOTIFICACIONES ══════════════════════════════════ */
#notif-panel {
  z-index: 500;
}
#modal-notificacion {
  z-index: 600;
}

/* ══ PERFIL — AVATAR CON FOTO ════════════════════════════════ */
.nav-av img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  border-radius: 50%;
}
#perfil-av {
  transition: opacity .2s;
  border: 3px solid rgba(255,143,0,.4);
}
#perfil-av:hover { opacity: .85; }

/* ─── Tabs simples ──────────────────────────────────────── */
.btn-tab{
  background:transparent;
  color:var(--tx);
  border:1px solid var(--bo);
  padding:10px 22px;
  border-radius:24px;
  font-size:13px;
  font-weight:700;
  cursor:pointer;
  transition:all .18s ease;
  letter-spacing:.2px;
}
.btn-tab:hover{
  background:var(--f3);
  border-color:var(--tx);
}
.btn-tab.btn-tab-active{
  background:var(--ac);
  color:#000;
  border-color:var(--ac);
  box-shadow:0 2px 8px rgba(255,143,0,.35);
}
.btn-tab.btn-tab-active:hover{
  background:var(--ac);
  border-color:var(--ac);
}

/* ─── Tiles de desempeño (tarjetas previsionista) ──────── */
.kpi-tiles{
  display:grid;
  grid-template-columns:repeat(auto-fill, minmax(170px, 1fr));
  gap:10px;
  margin-top:12px;
}
.kpi-tile{
  background:var(--f3);
  border:1px solid var(--bo);
  border-radius:10px;
  padding:10px 12px;
  display:flex;
  gap:10px;
  align-items:flex-start;
  transition:transform .15s ease;
}
.kpi-tile:hover{ transform:translateY(-1px); }
.kpi-tile-icon{
  font-size:20px;
  line-height:1;
  flex-shrink:0;
}
.kpi-tile-body{ flex:1; min-width:0; }
.kpi-tile-val{
  font-size:18px;
  font-weight:800;
  line-height:1.1;
  margin-bottom:2px;
}
.kpi-tile-lbl{
  font-size:10px;
  color:var(--td);
  text-transform:uppercase;
  letter-spacing:.5px;
  font-weight:700;
}
.kpi-tile-sub{
  font-size:10px;
  color:var(--td);
  margin-top:3px;
  font-style:italic;
}
