/* ==========================================================================
   Security A&M Control - styles.css (UNIFICADO PRO)
   - Paleta con identidad de marca (003049, 1d3557, e63946, 457b9d)
   - Accesibilidad (foco visible), dark mode, reduced motion
   - Layout responsive, utilidades, componentes y estados
   - Sin depender de estilos inline (prepara el camino para CSP dura)
   ========================================================================== */

/* 0) Base, Reset mínimo y Variables --------------------------------------- */

:root{
  /* Superficie y texto */
  --bg: #f5f7fb;
  --bg-elev: #ffffff;
  --text: #0f172a;
  --muted: #5b6b82;
  --border: #e5e7eb;

  /* Paleta de marca */
  --brand: #003049;
  --brand-2: #1d3557;
  --accent: #457b9d;
  --accent-2: #366b8e;
  --danger: #e63946;
  --success: #16a34a;
  --warning: #f59e0b;

  /* Efectos */
  --focus: #2563eb;
  --ring: 0 0 0 3px rgba(37,99,235,.35);
  --card-shadow: 0 1px 2px rgba(0,0,0,.06), 0 8px 24px rgba(0,0,0,.06);

  /* Tipografía + radios */
  --font-sans: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
  --fs-12: 12px; --fs-14: 14px; --fs-16: 16px; --fs-18: 18px; --fs-24: 24px;
  --radius: 12px; --radius-lg: 16px;

  /* Layout */
  --sidebar-w: 280px;
  --container-max: 1200px;
}

@media (prefers-color-scheme: dark){
  :root{
    --bg: #0b1220;
    --bg-elev: #0f172a;
    --text: #e5e7eb;
    --muted: #a6b2c7;
    --border: #1f2937;

    --brand: #0f2134;
    --brand-2: #132640;
    --accent: #6aa9d6;
    --accent-2: #558fb9;
    --danger: #f87171;

    --ring: 0 0 0 3px rgba(96,165,250,.35);
    --card-shadow: 0 1px 2px rgba(0,0,0,.45), 0 8px 28px rgba(0,0,0,.4);
  }
}

*,
*::before,
*::after{ box-sizing: border-box; }

html, body{ height: 100%; }

html{ -webkit-text-size-adjust: 100%; scroll-behavior: smooth; }

body{
  margin: 0;
  font-family: var(--font-sans);
  font-size: var(--fs-16);
  line-height: 1.45;
  color: var(--text);
  background: var(--bg);
}

:focus-visible{ outline: none; box-shadow: var(--ring); border-radius: 8px; }

a{ color: var(--accent); text-decoration: none; }
a:hover{ text-decoration: underline; }

h1,h2,h3{ margin: 0 0 10px; line-height: 1.2; }
h1{ font-size: 26px; }
h2{ font-size: 20px; }
h3{ font-size: 18px; }

/* 1) Utilidades (para eliminar inline style) ------------------------------- */

.is-hidden{ display: none !important; }
.visually-hidden{
  position:absolute!important;clip:rect(1px,1px,1px,1px);clip-path:inset(50%);height:1px;width:1px;overflow:hidden;white-space:nowrap;border:0;padding:0;margin:-1px;
}

.mt-4{ margin-top: 4px !important; }
.mt-6{ margin-top: 6px !important; }
.mt-8{ margin-top: 8px !important; }
.mt-10{ margin-top: 10px !important; }
.mt-12{ margin-top: 12px !important; }
.mt-15{ margin-top: 15px !important; }
.mt-20{ margin-top: 20px !important; }

.mb-8{ margin-bottom: 8px !important; }
.mb-12{ margin-bottom: 12px !important; }
.mb-16{ margin-bottom: 16px !important; }

.p-8{ padding: 8px !important; }
.p-12{ padding: 12px !important; }
.p-16{ padding: 16px !important; }

.rounded{ border-radius: 8px !important; }
.rounded-lg{ border-radius: var(--radius-lg) !important; }
.shadow-soft{ box-shadow: var(--card-shadow) !important; }

.text-muted{ color: var(--muted) !important; }
.text-secondary{ color: #444 !important; }
@media (prefers-color-scheme: dark){ .text-secondary{ color: #c9d2e3 !important; } }

.container{ max-width: var(--container-max); margin: 0 auto; padding: 0 16px; }

/* 2) Login ----------------------------------------------------------------- */

.login-container{
  min-height: 100dvh;
  display: grid;
  place-items: center;
  padding: 20px;
  background:
    radial-gradient(1200px 600px at 100% 0%, rgba(69,123,157,.18), transparent 40%),
    radial-gradient(900px 400px at 0% 100%, rgba(230,57,70,.12), transparent 35%),
    var(--brand);
}

.login-box{
  width: 420px; max-width: 92%;
  background: linear-gradient(135deg, #0a1a33, #122240);
  padding: 40px 32px;
  border-radius: 20px;
  box-shadow: 0 8px 30px rgba(0,0,0,.5);
  text-align: center;
  color: #cbd6f7;
  display: flex; flex-direction: column; gap: 22px;
  transition: transform .15s ease;
}
.login-box:hover{ transform: translateY(-3px); }

.login-logo{
  width: 150px; height: auto; margin: 0 auto 8px auto; display: block;
}

.login-box h2{
  color: #fff; font-size: 2rem; font-weight: 800; letter-spacing: .5px; margin: 0;
}

#login-form{ display: grid; gap: 10px; }

#login-form label{
  font-size: var(--fs-12);
  color: #aab6de;
  text-align: left;
}

#login-form input[type="email"],
#login-form input[type="password"]{
  width: 100%;
  padding: 12px 14px;
  border: 1px solid rgba(255,255,255,.25);
  border-radius: 12px;
  background: rgba(255,255,255,.10);
  color: #eaf0ff;
  outline: none;
  box-shadow: inset 0 0 8px rgba(255,255,255,.12);
  transition: background .2s ease, box-shadow .2s ease;
}
#login-form input::placeholder{ color: #a1a9d0; opacity: .85; }
#login-form input:focus{ background: rgba(255,255,255,.22); box-shadow: 0 0 0 3px rgba(92,114,244,.35); }

#login-submit{
  background: #1b2e60;
  border: none;
  padding: 14px 0;
  font-size: 1.05rem;
  font-weight: 700;
  border-radius: 15px;
  color: #c7d0ff;
  cursor: pointer;
  box-shadow: 0 6px 15px rgba(27,46,96,.55);
  transition: filter .15s ease, transform .08s ease;
}
#login-submit:hover{ filter: brightness(1.05); }
#login-submit:active{ transform: translateY(1px) scale(.98); }

.error-msg{ color: #ff6b6b; margin-top: 8px; min-height: 1lh; }

/* 3) Layout general -------------------------------------------------------- */

.app-container{ display: flex; min-height: 100dvh; overflow: hidden; }

.sidebar{
  width: var(--sidebar-w);
  background: var(--brand);
  color: #fff;
  display: flex; flex-direction: column;
  padding: 18px 16px;
}

.user-profile{
  display: grid; grid-template-columns: 40px 1fr; gap: 10px; align-items: center;
  padding: 10px;
  border: 1px solid rgba(255,255,255,.12);
  border-radius: 12px;
  background: rgba(255,255,255,.06);
}
.user-avatar{
  width: 40px; height: 40px; border-radius: 999px;
  display: grid; place-items: center; font-size: 20px;
  background: rgba(255,255,255,.12);
}
.user-info span:first-child{ font-weight: 700; }
.user-info span:last-child{ font-size: var(--fs-12); opacity: .9; }

.sidebar-title{
  font-size: 18px; font-weight: 800; text-align: center; margin: 10px 0 4px;
}

.menu-list{ list-style: none; padding: 0; margin: 0; display: grid; gap: 6px; }

.menu-btn{
  width: 100%; text-align: left;
  background: transparent; border: 0;
  color: #fff; padding: 12px;
  cursor: pointer; font-size: 16px; border-radius: 10px;
  transition: background .15s ease, filter .15s ease;
}
.menu-btn:hover, .menu-btn.active{ background: var(--brand-2); }
.menu-btn.logout{
  margin-top: auto;
  background: linear-gradient(180deg, var(--danger), #c92f3b);
  color: #fff; font-weight: 700;
}
.menu-btn.logout:hover{ filter: brightness(1.05); }

.main-content{
  flex: 1; min-width: 0;
  padding: 24px;
  background: var(--bg);
  overflow-y: auto;
}

/* 4) Secciones / Tarjetas / Panel Resumen --------------------------------- */

.section-content{
  display: none;
  background: var(--bg-elev);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 18px;
  box-shadow: var(--card-shadow);
}
.section-content.active{ display: block; }

.dashboard-cards{
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 14px;
  margin: 10px 0 16px;
}
.card{
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 14px;
  box-shadow: var(--card-shadow);
}
.card h3{ font-size: 15px; color: var(--muted); margin: 0 0 6px; }
.card p{ font-size: 24px; font-weight: 700; margin: 0; }

#grafico-rondas{
  width: 100%; height: 240px; display: block;
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: 12px; padding: 6px;
  box-shadow: var(--card-shadow);
}

/* 5) Formularios ----------------------------------------------------------- */

form label{ font-size: var(--fs-12); color: var(--muted); }

form input, form select{
  margin: 6px 8px 6px 0;
  padding: 10px 12px;
  border-radius: 10px;
  border: 1px solid var(--border);
  background: #fff;
  color: var(--text);
}

form button{
  padding: 10px 16px;
  border: none;
  background: var(--accent);
  color: #fff;
  border-radius: 10px;
  cursor: pointer;
  transition: filter .15s ease, transform .08s ease;
}
form button:hover{ filter: brightness(1.05); }
form button:active{ transform: translateY(1px) scale(.98); }

/* Variantes de botón (opcional general) */
.btn{ padding: 10px 14px; border-radius: 10px; border: 0; cursor: pointer; }
.btn-primary{ background: linear-gradient(180deg, var(--accent), var(--accent-2)); color:#fff; }
.btn-danger{ background: linear-gradient(180deg, #ef4444, #dc2626); color:#fff; }
.btn-ghost{ background: transparent; border:1px solid var(--border); color: var(--text); }

/* Inline form (ocurrencias) */
.form-inline{
  display: grid;
  grid-template-columns: repeat(6, minmax(0,1fr));
  gap: 10px; align-items: end; margin-bottom: 14px;
}

/* Reportes form */
#reportes-form{
  display: grid;
  grid-template-columns: repeat(2, minmax(0,1fr));
  gap: 12px; align-items: end;
}
#reportes-form input[type="text"],
#reportes-form input[type="file"]{ width: 100%; }

/* 6) Tablas (Ocurrencias / Rondas / Checklist / Usuarios) ------------------ */

.styled-table{
  width: 100%;
  border-collapse: separate; border-spacing: 0;
  margin-top: 16px; overflow: hidden;
  border-radius: 10px;
  border: 1px solid var(--border);
  background: var(--bg-elev);
  box-shadow: var(--card-shadow);
}
.styled-table thead th{
  background: linear-gradient(180deg, #f3f4f6, #e5e7eb);
  color: #111827;
  font-size: var(--fs-14);
  text-align: left;
  padding: 10px;
  border-bottom: 1px solid var(--border);
  position: sticky; top: 0; z-index: 1; /* cabecera pegajosa útil en móviles */
}
@media (prefers-color-scheme: dark){
  .styled-table thead th{
    background: linear-gradient(180deg, #111827, #0f172a);
    color: #dbe4f0;
    border-bottom-color: #1f2937;
  }
}
.styled-table tbody tr:nth-child(odd){ background: rgba(0,0,0,.015); }
@media (prefers-color-scheme: dark){
  .styled-table tbody tr:nth-child(odd){ background: rgba(255,255,255,.02); }
}
.styled-table tbody td{
  padding: 10px;
  border-bottom: 1px solid var(--border);
  vertical-align: top;
  font-size: var(--fs-14);
}
.styled-table tbody tr:last-child td{ border-bottom: 0; }
.styled-table tbody tr:hover{ background: rgba(69,123,157,.08); }
@media (prefers-color-scheme: dark){
  .styled-table tbody tr:hover{ background: rgba(106,169,214,.12); }
}

.styled-table button.delete-btn{
  background: linear-gradient(180deg, #ef4444, #dc2626);
  color: #fff; border: 0; padding: 6px 10px; border-radius: 8px; cursor: pointer;
}

/* Campos editables */
.editable-hora-salida, .editable-observacion{
  background: var(--bg);
  border-radius: 6px;
  min-height: 34px;
  outline: none;
}

/* 7) IA (Sugerencias) ------------------------------------------------------ */

.sugerencias-box{
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 12px;
  box-shadow: var(--card-shadow);
}
.sugerencia-box{
  background: var(--bg-elev);
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 10px;
  margin-bottom: 10px;
  box-shadow: var(--card-shadow);
}
.sugerencia-box button{
  margin-right: 8px; margin-top: 6px;
  padding: 6px 10px; border-radius: 8px; border: 0;
  background: linear-gradient(180deg, #10b981, #059669);
  color: #fff; cursor: pointer;
}
.sugerencia-box button + button{
  background: linear-gradient(180deg, #6b7280, #4b5563);
}

/* 8) Reportes multimedia --------------------------------------------------- */

.reporte-item{
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 10px;
  box-shadow: var(--card-shadow);
  margin-bottom: 12px;
}
.reporte-item img{
  max-width: 180px;
  border-radius: 8px;
  margin-top: 6px;
  display: block;
}

/* 9) GPS / Leaflet --------------------------------------------------------- */

.gps-info{
  display: grid;
  grid-template-columns: repeat(4, minmax(0,1fr));
  gap: 12px; align-items: end;
}
#gps-mapa{
  height: 450px;
  margin-top: 20px;
  border-radius: 8px;
  box-shadow: var(--card-shadow);
  border: 1px solid var(--border);
  overflow: hidden;
}

/* Toolbar dinámica (agregada por JS) */
#gps-toolbar-added{
  display: flex; gap: 8px; flex-wrap: wrap; align-items: center; margin: 10px 0 4px;
}
#gps-toolbar-added label{
  display: flex; flex-direction: column; gap: 4px;
  font-size: 12px; color: #b7c4d8;
}
#gps-toolbar-added select{
  padding: 8px 10px; background: #0c1629; color: #e9f1fb;
  border: 1px solid #1c2942; border-radius: 8px;
}
#gps-toolbar-added > div > button{
  padding: 8px 12px; background: #0c1629; color: #e9f1fb; border: 0; cursor: pointer;
}
#gps-toolbar-added > div > button.active{ background: #12203a; }

/* Popups de Leaflet en dark mode */
.leaflet-popup-content-wrapper{ border-radius: 10px; }
@media (prefers-color-scheme: dark){
  .leaflet-popup-content-wrapper{ background: #0f172a; color: #e5e7eb; }
  .leaflet-popup-tip{ background: #0f172a; }
}

/* 10) Checklist ------------------------------------------------------------ */

.checklist-items{
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(270px, 1fr));
  gap: 10px; margin: 15px 0;
}
.checklist-items label{
  display: flex; align-items: center; gap: 8px;
  padding: 6px 8px; border-radius: 8px;
  transition: background .15s ease;
}
.checklist-items label:hover{ background: rgba(69,123,157,.08); }

/* 11) Gestión de Usuarios -------------------------------------------------- */

#gestion-usuarios-section p{ margin: 0 0 6px 0; }
#tabla-usuarios{ width: 100%; }

/* 12) Notificaciones/avisos ------------------------------------------------ */

.notice{
  margin-top: 8px;
  padding: 10px 12px;
  border: 1px solid var(--border);
  border-radius: 10px;
  background: var(--bg);
  color: var(--text);
  box-shadow: var(--card-shadow);
}
.notice--danger{
  border-color: rgba(230,57,70,.45);
  background: rgba(230,57,70,.08);
  color: #7f1d1d;
}

/* Feedback breve accesible */
[aria-live="polite"].flash{
  background-color: rgba(37, 99, 235, .08);
  transition: background-color .6s ease;
}

/* 13) Botón SOS ------------------------------------------------------------ */

.sos-button{
  position: fixed;
  bottom: 20px; right: 20px;
  background: var(--danger);
  color: #fff;
  padding: 14px 20px;
  border-radius: 50px;
  font-weight: bold; font-size: 18px;
  box-shadow: 0 10px 24px rgba(230,57,70,.35);
  z-index: 50;
  border: none;
  text-decoration: none;
  cursor: pointer;
  transition: transform .08s ease, filter .15s ease;
}
.sos-button:hover{ filter: brightness(1.03); }
.sos-button:active{ transform: translateY(1px) scale(.98); }

/* 14) Estados de UI -------------------------------------------------------- */

button:disabled, input:disabled, select:disabled{ opacity: .6; cursor: not-allowed; }

input::placeholder{ color: #9aa6ba; }
@media (prefers-color-scheme: dark){ input::placeholder{ color: #8fa3c0; } }

/* 15) Responsive ----------------------------------------------------------- */

@media (max-width: 1280px){
  .dashboard-cards{ grid-template-columns: 1fr 1fr; }
}

@media (max-width: 1100px){
  .form-inline{ grid-template-columns: repeat(3, minmax(0,1fr)); }
  #reportes-form{ grid-template-columns: 1fr; }
  .gps-info{ grid-template-columns: repeat(2, minmax(0,1fr)); }
}

@media (max-width: 860px){
  .app-container{ flex-direction: column; }
  .sidebar{
    width: 100%;
    flex-direction: row; flex-wrap: wrap; justify-content: space-around;
    padding: 10px; position: sticky; top: 0; z-index: 30;
    border-bottom: 1px solid rgba(255,255,255,.15);
  }
  .main-content{ padding: 16px; }
  .dashboard-cards{ grid-template-columns: 1fr; }
  .form-inline{ grid-template-columns: 1fr; }
  .gps-info{ grid-template-columns: 1fr; }
}

@media (max-width: 480px){
  .login-box{ padding: 28px 22px; }
  .login-logo{ width: 120px; }
}

/* 16) Impresión ------------------------------------------------------------ */

@media print{
  body{ background: #fff; color: #000; }
  .sidebar, .sos-button{ display: none !important; }
  .section-content{ border: 1px solid #000; box-shadow: none; }
  .styled-table{ border: 1px solid #000; }
  .styled-table thead th{ background: #e5e5e5 !important; color: #000 !important; }
}

/* 17) Extras: badges & chips (opcional reutilizable) ---------------------- */

.badge{
  display: inline-flex; align-items: center; gap: 6px;
  padding: 4px 8px; border-radius: 999px; font-size: var(--fs-12);
  border: 1px solid var(--border); background: var(--bg-elev); color: var(--text);
}
.badge--success{ border-color: rgba(22,163,74,.35); background: rgba(22,163,74,.08); color: #14532d; }
.badge--warn{ border-color: rgba(245,158,11,.35); background: rgba(245,158,11,.08); color: #7c3a00; }
.badge--danger{ border-color: rgba(230,57,70,.45); background: rgba(230,57,70,.08); color: #7f1d1d; }
/* ===== Ajustes finos RBAC + UX + accesibilidad (añadir al final) ===== */

/* 0) Fix prefers-reduced-motion (el bloque original tenía un selector inválido) */
@media (prefers-reduced-motion: reduce){
  *, *::before, *::after{
    animation-duration: .001ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: .001ms !important;
    scroll-behavior: auto !important;
  }
}

/* 1) Menú activo cuando JS marca aria-current="page" */
.menu-btn[aria-current="page"]{
  background: var(--brand-2);
  filter: brightness(1.02);
}

/* 2) Botones ocupados (spinner discreto para login / acciones lentas) */
button[aria-busy="true"]{
  position: relative;
  pointer-events: none;
  opacity: .85;
}
button[aria-busy="true"]::after{
  content: "";
  position: absolute;
  right: 12px;
  top: 50%;
  width: 14px; height: 14px; margin-top: -7px;
  border-radius: 50%;
  border: 2px solid rgba(255,255,255,.65);
  border-top-color: transparent;
  animation: sa-spin .7s linear infinite;
}
@keyframes sa-spin { to { transform: rotate(360deg); } }

/* 3) Toolbar GPS: deshabilitados claros (además de la regla general) */
#gps-toolbar-added select:disabled,
#gps-toolbar-added button:disabled{
  opacity: .6;
  cursor: not-allowed;
  filter: grayscale(.15);
}

/* 4) Mensaje flash de guardado (GPS) más notorio */
#gps-status.flash{
  background-color: rgba(16,185,129,.12);
  border-radius: 8px;
  padding: 4px 8px;
}

/* 5) Login: evita que el autofill de navegador rompa el color */
#login-form input:-webkit-autofill,
#login-form input:-webkit-autofill:hover,
#login-form input:-webkit-autofill:focus{
  -webkit-text-fill-color: #eaf0ff;
  -webkit-box-shadow: 0 0 0px 1000px rgba(255,255,255,.10) inset;
  transition: background-color 9999s ease-in-out 0s;
}

/* 6) Leaflet: mejor contraste en popups en modo claro */
.leaflet-popup-content-wrapper{ color:#111827; }

/* 7) Celdas editables: foco visible */
.editable-hora-salida:focus,
.editable-observacion:focus{
  box-shadow: 0 0 0 3px rgba(37,99,235,.25);
}

/* 8) Botón SOS: foco accesible */
.sos-button:focus-visible{ box-shadow: var(--ring); }



/* ===========================================================
   PATCH 2025-10-02 — Historial Detallado + GPS coherencia
   - Estilos nativos para #historial-detallado-section
   - Inputs/Selects alineados a la paleta y componentes
   - Tabla con encabezado sticky, contenedor con scroll
   =========================================================== */

#historial-detallado-section .section-header h2{
  margin: 0 0 8px;
  font-size: 22px;
}

#historial-detallado-section .filters{
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  align-items: flex-end;
  margin-bottom: 8px;
}
#historial-detallado-section .filters label{
  display: flex;
  flex-direction: column;
  gap: 4px;
}
#historial-detallado-section .filters label span{
  font-size: var(--fs-12);
  color: var(--muted);
}
#historial-detallado-section select,
#historial-detallado-section input[type="datetime-local"]{
  padding: 8px 10px;
  border-radius: 8px;
  border: 1px solid var(--border);
  background: #fff;
  color: var(--text);
}
@media (prefers-color-scheme: dark){
  #historial-detallado-section select,
  #historial-detallado-section input[type="datetime-local"]{
    background: #0c1629;
    color: #e9f1fb;
    border-color: #1c2942;
  }
}

#hp-status{
  margin: 6px 0;
  color: var(--muted);
}

#hp-map{
  height: 360px;
  border-radius: var(--radius);
  overflow: hidden;
  background: var(--bg);
  border: 1px solid var(--border);
  box-shadow: var(--card-shadow);
  margin-bottom: 10px;
}

/* Tabla dentro del panel */
#historial-detallado-section .table-wrap{
  max-height: 340px;
  overflow: auto;
  border: 1px solid var(--border);
  border-radius: 12px;
  background: var(--bg-elev);
  box-shadow: var(--card-shadow);
}
#historial-detallado-section table{
  width: 100%;
  border-collapse: collapse;
  font-size: var(--fs-14);
}
#historial-detallado-section thead th{
  position: sticky;
  top: 0;
  background: linear-gradient(180deg, #f3f4f6, #e5e7eb);
  color: #111827;
  padding: 10px;
  text-align: left;
  border-bottom: 1px solid var(--border);
  z-index: 1;
}
@media (prefers-color-scheme: dark){
  #historial-detallado-section thead th{
    background: linear-gradient(180deg, #111827, #0f172a);
    color: #dbe4f0;
    border-bottom-color: #1f2937;
  }
}
#historial-detallado-section tbody td{
  padding: 10px;
  border-bottom: 1px solid var(--border);
  vertical-align: top;
}
#historial-detallado-section tbody tr:nth-child(odd){
  background: rgba(0,0,0,.015);
}
@media (prefers-color-scheme: dark){
  #historial-detallado-section tbody tr:nth-child(odd){
    background: rgba(255,255,255,.02);
  }
}
#historial-detallado-section tbody tr:hover{
  background: rgba(69,123,157,.08);
}
@media (prefers-color-scheme: dark){
  #historial-detallado-section tbody tr:hover{
    background: rgba(106,169,214,.12);
  }
}

/* Paginación */
#historial-detallado-section .pager{
  display: flex;
  gap: 8px;
  margin-top: 8px;
}
#historial-detallado-section .pager .btn{
  padding: 8px 12px;
  border: 1px solid var(--border);
  background: var(--bg-elev);
  color: var(--text);
  border-radius: 10px;
  cursor: pointer;
}
@media (prefers-color-scheme: dark){
  #historial-detallado-section .pager .btn{
    border-color: #1c2942;
    background: #0c1629;
    color: #e9f1fb;
  }
}
#historial-detallado-section .pager .btn:hover{ filter: brightness(1.03); }

/* GPS toolbar: armonizar botones activos con color */
#gps-toolbar-added > div > button.active{
  background: #12203a;
  filter: brightness(1.02);
}