/**
 * Tema ZonnaGPS — paleta navy/naranja, IBM Plex Sans
 */
@import url('https://fonts.googleapis.com/css2?family=IBM+Plex+Sans:ital,wght@0,300;0,400;0,500;0,600;0,700;1,400;1,600&display=swap');

:root {
    /* Tipografía */
    --font-family: 'IBM Plex Sans', system-ui, -apple-system, sans-serif;
    /* Escala tipográfica */
    --text-xs:   0.6875rem;  /* 11px — timestamps, metadatos */
    --text-sm:   0.8125rem;  /* 13px — celdas de tabla, labels */
    --text-base: 0.9375rem;  /* 15px — cuerpo */
    --text-md:   1.0625rem;  /* 17px — subtítulos de panel */
    --text-lg:   1.25rem;    /* 20px — títulos de sección */
    --text-xl:   1.5rem;     /* 24px — títulos de página */
    --text-kpi:  2.25rem;    /* 36px — números KPI dashboard */

    /* Colores de marca */
    --color-brand-bg: #010440;
    --color-brand-bg-soft: #0f172a;
    --color-brand-text: #ffffff;
    --color-accent: #c64106;
    --color-accent-hover: #a93605;
    --color-accent-light: #f06a2a;
    --color-accent-muted: rgba(198, 65, 6, 0.16);

    /* Estado de dispositivos */
    --state-online: #15803d;
    --state-moving: #0b63ce;
    --state-warning: #d97706;
    --state-danger: #b42318;
    --state-offline: #737373;

    /* Estados de marcador en mapa */
    --marker-online:   #15803d;
    --marker-offline:  #737373;
    --marker-caution:  #d97706;
    --marker-alert:    #c64106;
    --marker-incident: #dc2626;

    /* Radio de bordes */
    --radius-sm: 4px;
    --radius-md: 8px;
    --radius-lg: 12px;
    --radius-xl: 16px;
    --radius-pill: 9999px;

    /* Bootstrap: naranja de marca como color primario */
    --bs-primary: #c64106;
    --bs-primary-rgb: 198, 65, 6;
    --bs-link-color: #c64106;
    --bs-link-hover-color: #a93605;

    /* Aliases legacy — se usan en plantillas Blade; no eliminar hasta migración completa */
    --logo-bg: var(--color-brand-bg);
    --logo-bg-soft: var(--color-brand-bg-soft);
    --logo-text: var(--color-brand-text);
    --logo-blue: var(--color-accent);
    --logo-blue-hover: var(--color-accent-hover);
    --logo-blue-light: var(--color-accent-light);
    --logo-blue-muted: var(--color-accent-muted);
}

[data-bs-theme="dark"],
[data-theme="dark"] {
    color-scheme: dark;
    --bs-body-bg: #0f172a;
    --bs-body-color: #e5e7eb;
    --bs-card-bg: #111827;
    --bs-border-color: #334155;
    --color-brand-bg-soft: #111827;
}

[data-bs-theme="dark"] body,
[data-theme="dark"] body {
    background: #0f172a;
    color: #e5e7eb;
}

[data-bs-theme="dark"] .card,
[data-theme="dark"] .card,
[data-bs-theme="dark"] .dropdown-menu,
[data-theme="dark"] .dropdown-menu,
[data-bs-theme="dark"] .modal-content,
[data-theme="dark"] .modal-content {
    background-color: #111827;
    color: #e5e7eb;
    border-color: #334155;
}

/* Fuente principal */
html,
body {
    font-family: var(--font-family);
}

/* Bootstrap overrides con colores del logo */
.btn-primary,
.bg-primary {
    background-color: var(--logo-blue) !important;
    border-color: var(--logo-blue) !important;
}
.btn-primary:hover {
    background-color: var(--logo-blue-hover) !important;
    border-color: var(--logo-blue-hover) !important;
}
.btn-outline-primary {
    color: var(--logo-blue);
    border-color: var(--logo-blue);
}
.btn-outline-primary:hover {
    background-color: var(--logo-blue-muted);
    color: var(--logo-blue-hover);
    border-color: var(--logo-blue-hover);
}
.form-control:focus,
.form-select:focus {
    border-color: var(--logo-blue);
    box-shadow: 0 0 0 0.2rem var(--logo-blue-muted);
}
.text-primary { color: var(--logo-blue) !important; }
.border-primary { border-color: var(--logo-blue) !important; }

/* Navbar superior: ayuda, notificaciones, usuario y logout */
.app-navbar {
    background: var(--logo-bg);
    min-height: 3.5rem;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.2);
    position: sticky;
    top: 0;
    z-index: 1030;
}
.app-navbar .container-fluid {
    max-width: 100%;
}
.app-navbar-logo {
    text-decoration: none;
}
.app-navbar-logo-img {
    height: 2rem;
    width: auto;
    max-width: 180px;
    object-fit: contain;
}
.app-navbar-btn {
    color: rgba(255, 255, 255, 0.7) !important;
    text-decoration: none;
    transition: color 0.2s, background 0.2s;
}
.app-navbar-btn:hover {
    color: #fff !important;
    background: rgba(255, 255, 255, 0.08);
}
.app-navbar-dropdown {
    min-width: 220px;
    margin-top: 0.25rem;
}
.app-navbar-dropdown .navbar-notifications-list .navbar-alert-item:last-child {
    border-bottom: none !important;
    margin-bottom: 0 !important;
}
.app-navbar-dropdown .navbar-alert-item .btn-sm {
    font-size: 0.75rem;
}

/* Sidebar: fija a la izquierda, debajo de la navbar, siempre visible */
.sidebar {
    --sidebar-width: 88px;
    width: var(--sidebar-width);
    height: calc(100vh - 3.5rem);
    max-height: calc(100vh - 3.5rem);
    overflow-y: auto;
    overflow-x: hidden;
    position: fixed;
    top: 3.5rem;
    left: 0;
    z-index: 1020;
    background: var(--logo-bg);
    color: var(--logo-text);
    padding: 12px 0;
    display: flex;
    flex-direction: column;
}
/* Scrollbar fina y discreta */
.sidebar::-webkit-scrollbar { width: 4px; }
.sidebar::-webkit-scrollbar-track { background: transparent; }
.sidebar::-webkit-scrollbar-thumb { background: rgba(255,255,255,0.2); border-radius: 2px; }
.sidebar::-webkit-scrollbar-thumb:hover { background: rgba(255,255,255,0.4); }
.sidebar { scrollbar-width: thin; scrollbar-color: rgba(255,255,255,0.2) transparent; }
.row > .sidebar {
    flex: 0 0 var(--sidebar-width, 88px);
    width: var(--sidebar-width, 88px);
    min-width: var(--sidebar-width, 88px);
    padding-left: 0;
    padding-right: 0;
    box-sizing: border-box;
}
.row > .sidebar > nav {
    flex: 1;
    width: 100%;
}
/* Columna principal: desplazada a la derecha del sidebar fijo */
.row > .sidebar + [class*="col-"] {
    flex: 1 1 0%;
    min-width: 0;
    max-width: none;
    margin-left: var(--sidebar-width, 88px);
}
.sidebar > nav {
    flex: 1;
    width: 100%;
}
/* Item: icono arriba, nombre abajo */
.sidebar .nav-link.sidebar-item {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    color: rgba(255, 255, 255, 0.85);
    padding: 8px 6px;
    margin: 2px 0;
    border-radius: 0;
    transition: all 0.2s;
    text-align: center;
    text-decoration: none;
    width: 100%;
    box-sizing: border-box;
}
.sidebar .nav-link.sidebar-item .bi {
    font-size: 1.35rem;
    margin-bottom: 2px;
    display: block;
}
.sidebar .nav-link.sidebar-item .sidebar-item-label {
    font-size: 0.78rem;
    line-height: 1.2;
    word-break: break-word;
}
.sidebar .nav-link.sidebar-item:hover {
    background: var(--logo-blue);
    color: var(--logo-text);
}
.sidebar .nav-link.sidebar-item.active {
    background: var(--logo-blue);
    color: var(--logo-text);
    border-radius: 0;
}
.sidebar .btn-outline-light:hover {
    background: var(--logo-blue);
    border-color: var(--logo-blue);
    color: var(--logo-text);
}

/* Sidebar: grupo Configuración colapsable */
.sidebar-config-group {
    margin: 6px 0;
    width: 100%;
}
.sidebar-config-toggle {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    font-size: 0.845rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.02em;
    color: rgba(255, 255, 255, 0.6) !important;
    cursor: pointer;
    padding: 10px 6px !important;
    margin: 4px 0 !important;
    border: none;
    background: transparent;
    border-radius: 0;
    transition: color 0.2s, background 0.2s;
    min-height: auto;
    line-height: 1.2;
    width: 100%;
    text-align: center;
    box-sizing: border-box;
}
.sidebar-config-toggle .bi:first-of-type {
    font-size: 1.35rem;
    margin-bottom: 2px;
}
.sidebar-config-toggle .sidebar-item-label {
    font-size: 0.78rem;
    margin-bottom: 2px;
}
.sidebar-config-chevron {
    font-size: 13px !important;
    width: 13px !important;
    height: 13px !important;
    min-width: 13px;
    min-height: 13px;
    display: block;
    flex-shrink: 0;
    transition: transform 0.2s ease;
    line-height: 1;
}
.sidebar-config-toggle:hover {
    background: rgba(255, 255, 255, 0.08);
    color: rgba(255, 255, 255, 0.9) !important;
}
.sidebar-config-group:not(.collapsed) .sidebar-config-toggle {
    color: var(--logo-blue-light) !important;
}
.sidebar-config-group:not(.collapsed) .sidebar-config-chevron {
    transform: rotate(-180deg);
}
.sidebar-config-items {
    padding-left: 0;
    overflow: hidden;
    max-height: 400px;
    transition: max-height 0.25s ease, opacity 0.2s ease;
    width: 100%;
    display: flex;
    flex-direction: column;
    align-items: center;
}
.sidebar-config-group.collapsed .sidebar-config-items {
    max-height: 0 !important;
    opacity: 0;
    margin: 0;
    padding: 0;
    visibility: hidden;
}
.sidebar .nav-link-sub.sidebar-item {
    padding: 8px 6px;
    margin: 2px 0;
    border-radius: 0;
    width: 100%;
    box-sizing: border-box;
}
.sidebar .nav-link-sub.sidebar-item .sidebar-item-label {
    font-size: 0.78rem;
}
.sidebar .nav-link-sub.sidebar-item.active {
    border-radius: 0;
}

/* Cards y stat-cards con acento azul */
.stat-card.primary {
    background: linear-gradient(135deg, var(--logo-blue) 0%, var(--logo-blue-hover) 100%);
    color: var(--logo-text);
}
.card-header.bg-primary {
    background-color: var(--logo-blue) !important;
    color: var(--logo-text);
}
.alert-primary {
    background-color: var(--logo-blue-muted);
    border-color: var(--logo-blue);
    color: var(--logo-blue);
}

/* Login: fondo negro, card blanca, acento azul */
.body-login {
    background: var(--logo-bg);
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
}
.login-card {
    background: var(--logo-text);
    border-radius: var(--radius-xl, 16px);
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.4);
    padding: 2.5rem;
    max-width: 400px;
    width: 100%;
}
.login-header .logo-img {
    max-width: 180px;
    margin-bottom: 1rem;
}
.login-header h2 {
    color: var(--logo-bg);
    font-weight: 700;
}
.login-header .text-muted {
    color: #64748b !important;
}

/* ============================================================
   Autenticación — rediseño hero navy + tarjeta (login / 2FA)
   Inspirado en el diseño de la app móvil, paleta de marca.
   ============================================================ */
.body-auth {
    margin: 0;
    min-height: 100vh;
    font-family: var(--font-family);
    background: #f5f7fa;
}
.auth-card {
    display: flex;
    width: 100%;
    min-height: 100vh;
    background: #f5f7fa;
}

/* — Panel navy (hero) — */
.auth-hero {
    position: relative;
    overflow: hidden;
    width: 520px;
    flex-shrink: 0;
    padding: 60px 40px;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    background: #0b1d3a;
}
.auth-hero::before {
    /* rejilla sutil de puntos */
    content: "";
    position: absolute;
    inset: 0;
    background-image: radial-gradient(circle, rgba(255, 255, 255, 0.045) 1px, transparent 1px);
    background-size: 30px 30px;
    pointer-events: none;
}
.auth-hero__glow {
    /* resplandor azul centrado */
    position: absolute;
    left: 50%;
    top: 50%;
    transform: translate(-50%, -50%);
    width: 420px;
    height: 420px;
    background: radial-gradient(circle, rgba(28, 110, 247, 0.16) 0%, transparent 65%);
    pointer-events: none;
}
.auth-rings {
    position: absolute;
    left: 50%;
    top: 50%;
    transform: translate(-50%, -65%);
    width: 72px;
    height: 72px;
    z-index: 1;
}
.auth-rings .ring {
    position: absolute;
    inset: 0;
    border-radius: 50%;
    border: 1.5px solid rgba(28, 110, 247, 0.25);
    animation: auth-ping 3s ease-out infinite;
    pointer-events: none;
}
.auth-rings .ring2 { animation-delay: 1s; }
.auth-rings .ring3 { animation-delay: 2s; }
.auth-rings .dot {
    position: absolute;
    left: 50%;
    top: 50%;
    transform: translate(-50%, -50%);
    width: 10px;
    height: 10px;
    border-radius: 50%;
    background: #1c6ef7;
    box-shadow: 0 0 16px rgba(28, 110, 247, 0.9);
}
@keyframes auth-ping {
    0%   { transform: scale(1);   opacity: 0.45; }
    100% { transform: scale(4.5); opacity: 0;    }
}
.auth-hero__content {
    position: relative;
    z-index: 2;
    display: flex;
    flex-direction: column;
    align-items: center;
    text-align: center;
    margin-top: 60px;
}
.auth-logo {
    width: 180px;
    margin: 0 0 18px;
}
.auth-logo svg { width: 100%; height: auto; display: block; }
.auth-logo .cls-2 { fill: #ffffff; }
.auth-logo .cls-1 { fill: #e13530; }
.auth-tagline {
    margin: 0 0 48px;
    font-size: 11px;
    letter-spacing: 3px;
    text-transform: uppercase;
    font-weight: 500;
    color: rgba(255, 255, 255, 0.3);
}
.auth-hero__value { max-width: 320px; }
.auth-hero__headline {
    margin: 0 0 12px;
    font-size: 22px;
    font-weight: 300;
    line-height: 1.4;
    letter-spacing: -0.2px;
    color: rgba(255, 255, 255, 0.85);
}
.auth-hero__headline strong { font-weight: 700; color: #fff; }
.auth-hero__features {
    margin: 0;
    font-size: 13px;
    font-weight: 400;
    line-height: 1.6;
    color: rgba(255, 255, 255, 0.35);
}
.auth-status {
    position: absolute;
    bottom: 28px;
    left: 0;
    right: 0;
    display: flex;
    justify-content: center;
    z-index: 2;
}
.auth-status__pill {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    background: rgba(255, 255, 255, 0.06);
    border: 1px solid rgba(255, 255, 255, 0.09);
    border-radius: 20px;
    padding: 7px 14px;
    font-size: 11px;
    font-weight: 500;
    color: rgba(255, 255, 255, 0.45);
}
.auth-status__dot {
    width: 6px;
    height: 6px;
    border-radius: 50%;
    background: #22c55e;
    box-shadow: 0 0 6px rgba(34, 197, 94, 0.8);
}

/* — Cuerpo / formulario (panel claro) — */
.auth-body {
    flex: 1;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 60px 72px;
    background: #f5f7fa;
}
.auth-body > * {
    width: 100%;
    max-width: 380px;
}

@media (max-width: 860px) {
    .auth-hero { display: none; }
    .auth-body { padding: 40px 22px; }
}
.auth-heading { margin: 0 0 30px; }
.auth-heading--icon {
    display: flex;
    align-items: center;
    gap: 12px;
}
.auth-lock-badge {
    width: 50px;
    height: 50px;
    flex-shrink: 0;
    border-radius: 14px;
    background: #eef4ff;
    border: 1.5px solid #d4e4ff;
    color: #1c6ef7;
    display: flex;
    align-items: center;
    justify-content: center;
}
.auth-title {
    margin: 0 0 4px;
    font-size: 28px;
    font-weight: 700;
    letter-spacing: -0.4px;
    color: #0b1d3a;
}
.auth-heading--icon .auth-title { font-size: 24px; letter-spacing: -0.3px; }
.auth-subtitle {
    margin: 0;
    font-size: 13px;
    font-weight: 400;
    color: #8a93a0;
}

.auth-field { margin-bottom: 14px; }
.auth-label {
    display: block;
    margin-bottom: 7px;
    font-size: 12px;
    font-weight: 600;
    letter-spacing: 0.1px;
    color: #0b1d3a;
}
.auth-input-wrap {
    display: flex;
    align-items: center;
    gap: 10px;
    background: #fff;
    border: 1.5px solid #dde3ec;
    border-radius: 11px;
    padding: 0 14px;
    transition: border-color 0.15s, box-shadow 0.15s;
}
.auth-input-wrap:focus-within {
    border-color: #1c6ef7;
    box-shadow: 0 0 0 3px rgba(28, 110, 247, 0.1);
}
.auth-input-wrap.is-invalid { border-color: var(--state-danger); }
.auth-input-wrap > svg { color: #b3bac4; flex-shrink: 0; }
.auth-input {
    flex: 1;
    border: 0;
    outline: 0;
    background: transparent;
    padding: 13px 0;
    font-size: 14px;
    font-weight: 400;
    color: #1f2a3a;
    font-family: inherit;
    min-width: 0;
}
.auth-input::placeholder { color: #b3bac4; }
.auth-pw-toggle {
    border: 0;
    background: transparent;
    color: #b3bac4;
    cursor: pointer;
    padding: 4px;
    display: flex;
    line-height: 0;
}
.auth-pw-toggle:hover { color: #6b7380; }

/* Fila de opciones: recordarme (izq) + olvidé contraseña (der) */
.auth-options {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    margin: 4px 0 24px;
}
.auth-forgot a {
    font-size: 13px;
    font-weight: 600;
    color: #e13530;
    text-decoration: none;
    white-space: nowrap;
}
.auth-forgot a:hover { text-decoration: underline; }

.auth-remember {
    display: flex;
    align-items: center;
    gap: 9px;
    cursor: pointer;
    user-select: none;
}
.auth-remember input { position: absolute; opacity: 0; pointer-events: none; }
.auth-remember .box {
    width: 18px;
    height: 18px;
    flex-shrink: 0;
    border-radius: 5px;
    border: 1.5px solid #c5cdda;
    background: #fff;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: background 0.15s, border-color 0.15s;
}
.auth-remember .box svg { opacity: 0; }
.auth-remember input:checked + .box {
    background: #0b1d3a;
    border-color: #0b1d3a;
}
.auth-remember input:checked + .box svg { opacity: 1; }
.auth-remember .label { font-size: 13px; color: #6b7380; }

.auth-submit {
    width: 100%;
    border: 0;
    cursor: pointer;
    background: #0b1d3a;
    color: #fff;
    border-radius: 11px;
    padding: 16px 24px;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    font-size: 15px;
    font-weight: 600;
    letter-spacing: 0.1px;
    font-family: inherit;
    transition: background 0.15s, transform 0.05s;
}
.auth-submit:hover { background: #11294d; }
.auth-submit:disabled { opacity: 0.7; cursor: default; }
.auth-submit:active { transform: translateY(1px); }
.auth-submit svg { opacity: 0.6; }

.auth-link-row {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    margin-top: 18px;
}
.auth-link-row a {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    font-size: 13px;
    font-weight: 500;
    color: #6b7380;
    text-decoration: none;
}
.auth-link-row a:hover { color: #0b1d3a; }

.auth-alert {
    border-radius: 11px;
    padding: 12px 14px;
    margin-bottom: 16px;
    font-size: 13px;
    line-height: 1.45;
}
.auth-alert ul { margin: 0; padding-left: 18px; }
.auth-alert--danger {
    background: #fef2f2;
    border: 1px solid #fbd5d5;
    color: #b42318;
}
.auth-alert--success {
    background: #ecfdf3;
    border: 1px solid #c4e9d3;
    color: #15803d;
}
.auth-info {
    display: flex;
    gap: 10px;
    align-items: flex-start;
    background: #f4f6fa;
    border: 1px solid #e8ecf2;
    border-left: 3px solid #1c6ef7;
    border-radius: 10px;
    padding: 12px 14px;
    margin-bottom: 18px;
    font-size: 12px;
    line-height: 1.5;
    color: #4b5563;
}
.auth-info svg { color: #1c6ef7; flex-shrink: 0; margin-top: 1px; }

/* — Campo de código 2FA — */
.auth-code-wrap { margin-bottom: 8px; }
.auth-code {
    width: 100%;
    border: 1.5px solid #dde3ec;
    border-radius: 12px;
    background: #fff;
    padding: 16px 0;
    text-align: center;
    font-size: 28px;
    font-weight: 700;
    letter-spacing: 0.6rem;
    text-indent: 0.6rem;
    color: #0b1d3a;
    font-family: inherit;
    outline: 0;
    transition: border-color 0.15s, box-shadow 0.15s;
}
.auth-code::placeholder { color: #c5cdda; font-weight: 600; }
.auth-code:focus {
    border-color: #1c6ef7;
    box-shadow: 0 0 0 3px rgba(28, 110, 247, 0.1);
}
.auth-code.is-invalid { border-color: var(--state-danger); }
.auth-resend {
    text-align: center;
    margin: 14px 0 22px;
    font-size: 12px;
    color: #b0bac6;
}
.auth-resend button {
    border: 0;
    background: transparent;
    cursor: pointer;
    font-size: 12px;
    font-weight: 600;
    color: #1c6ef7;
    font-family: inherit;
    padding: 0;
}
.auth-resend button:hover { text-decoration: underline; }

.auth-privacy {
    text-align: center;
    font-size: 11px;
    line-height: 1.6;
    color: #b0bac6;
    margin: 32px 0 0;
}
.auth-privacy a,
.auth-privacy strong {
    color: #0b1d3a;
    font-weight: 600;
    text-decoration: underline;
    text-underline-offset: 2px;
}

/* Dispositivos: lista estilo moderno (divide-y, hover, flex) */
.devices-list-modern {
    list-style: none;
    padding: 0;
    margin: 0;
    border: 1px solid #e5e7eb;
    border-radius: var(--radius-md, 8px);
    background: #fff;
    overflow: hidden;
}
.devices-list-modern li {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 1rem;
    padding: 1rem 1.25rem;
    border-bottom: 1px solid #f3f4f6;
    transition: background 0.15s ease;
}
.devices-list-modern li:last-child {
    border-bottom: none;
}
.devices-list-modern li:hover {
    background: #f9fafb;
}
.devices-list-modern .device-list-left {
    display: flex;
    align-items: center;
    gap: 1rem;
    min-width: 0;
    flex: 1;
}
.devices-list-modern .device-list-icon {
    width: 48px;
    height: 48px;
    flex-shrink: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
    background: #f3f4f6;
    color: #6b7280;
    font-size: 1.25rem;
}
.devices-list-modern .device-list-icon.online {
    background: rgba(16, 185, 129, 0.15);
    color: #059669;
}
.devices-list-modern .device-list-icon.offline {
    background: rgba(107, 114, 128, 0.15);
    color: #6b7280;
}
.devices-list-modern .device-list-body {
    min-width: 0;
    flex: 1;
}
.devices-list-modern .device-list-name {
    font-size: 0.875rem;
    font-weight: 600;
    color: #111827;
    text-decoration: none;
    display: block;
    line-height: 1.35;
}
.devices-list-modern .device-list-name:hover {
    color: var(--logo-blue);
}
.devices-list-modern .device-list-imei {
    margin-top: 0.25rem;
    font-size: 0.75rem;
    color: #6b7280;
    font-family: ui-monospace, monospace;
}
.devices-list-modern .device-list-right {
    display: flex;
    align-items: center;
    gap: 1rem;
    flex-shrink: 0;
}
.devices-list-modern .device-list-meta {
    text-align: right;
}
@media (max-width: 575.98px) {
    .devices-list-modern .device-list-meta { display: none; }
}
.devices-list-modern .device-list-meta .device-list-role {
    font-size: 0.875rem;
    color: #111827;
}
.devices-list-modern .device-list-meta .device-list-seen {
    margin-top: 0.25rem;
    font-size: 0.75rem;
    color: #6b7280;
}
.devices-list-modern .device-list-actions {
    display: flex;
    align-items: center;
    gap: 0.35rem;
    flex-shrink: 0;
}
.devices-list-modern .device-list-btn-config,
.devices-list-modern .device-list-btn-stream {
    white-space: nowrap;
    padding: 0.25rem 0.5rem;
    font-size: 0.75rem;
}
.devices-list-modern .device-list-chevron {
    flex-shrink: 0;
    width: 20px;
    height: 20px;
    color: #9ca3af;
    text-decoration: none;
    display: flex;
    align-items: center;
    justify-content: center;
}
.devices-list-modern .device-list-chevron:hover {
    color: var(--logo-blue);
}
.devices-list-modern .device-list-chevron .bi {
    font-size: 1.25rem;
}
/* Vista grid: misma lista en 2 columnas, cada li como tarjeta */
.devices-view-grid.devices-list-wrapper .devices-list-modern {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(340px, 1fr));
    gap: 1rem;
    border: none;
    background: transparent;
}
.devices-view-grid.devices-list-wrapper .devices-list-modern li {
    border: 1px solid #e5e7eb;
    border-radius: var(--radius-md, 8px);
    border-bottom: 1px solid #e5e7eb;
    background: #fff;
    flex-direction: column;
    align-items: stretch;
    gap: 0.75rem;
}
.devices-view-grid.devices-list-wrapper .devices-list-modern li:hover {
    background: #f9fafb;
}
.devices-view-list.devices-list-wrapper .devices-list-modern {
    max-width: 100%;
}
.view-toggle .btn { padding: 0.4rem 0.6rem; }
.view-toggle .btn.active {
    background: var(--logo-blue);
    color: white;
    border-color: var(--logo-blue);
}

/* Gestión de cámaras: tabla estilo "Latest activity" */
.cameras-activity-section {
    background: #fff;
    padding: 2.5rem 0;
}
.cameras-activity-section .cameras-activity-title {
    padding-left: 1rem;
    padding-right: 1rem;
    font-size: 1rem;
    line-height: 1.5;
    font-weight: 600;
    color: #111827;
}
@media (min-width: 640px) {
    .cameras-activity-section .cameras-activity-title { padding-left: 1.5rem; }
}
@media (min-width: 1024px) {
    .cameras-activity-section .cameras-activity-title { padding-left: 2rem; }
}
.cameras-activity-table {
    margin-top: 1.5rem;
    width: 100%;
    text-align: left;
    white-space: nowrap;
    border-collapse: collapse;
}
.cameras-activity-table thead {
    border-bottom: 1px solid #e5e7eb;
    font-size: var(--text-xs, 0.75rem);
    line-height: 1.5;
    color: #111827;
    text-transform: uppercase;
    letter-spacing: .04em;
}
.cameras-activity-table thead th {
    padding: 0.5rem 2rem 0.5rem 1rem;
    font-weight: 600;
}
.cameras-activity-table thead th:first-child {
    padding-left: 1rem;
}
@media (min-width: 640px) {
    .cameras-activity-table thead th:first-child { padding-left: 1.5rem; }
}
@media (min-width: 1024px) {
    .cameras-activity-table thead th:first-child { padding-left: 2rem; }
}
.cameras-activity-table thead th.cameras-th-commit { padding-right: 2rem; }
@media (min-width: 1024px) {
    .cameras-activity-table thead th.cameras-th-status { padding-right: 5rem; }
    .cameras-activity-table thead th.cameras-th-meta { padding-right: 2rem; }
    .cameras-activity-table thead th.cameras-th-date { padding-right: 2rem; }
}
.cameras-activity-table tbody tr {
    border-bottom: 1px solid #f3f4f6;
}
.cameras-activity-table tbody tr:last-child {
    border-bottom: none;
}
.cameras-activity-table tbody td {
    padding: 1rem 2rem 1rem 1rem;
    font-size: var(--text-sm, 0.875rem);
    line-height: 1.5;
    vertical-align: middle;
    font-variant-numeric: tabular-nums;
}
.cameras-activity-table tbody td:first-child {
    padding-left: 1rem;
}
@media (min-width: 640px) {
    .cameras-activity-table tbody td:first-child { padding-left: 1.5rem; }
}
@media (min-width: 1024px) {
    .cameras-activity-table tbody td:first-child { padding-left: 2rem; }
}
.cameras-activity-table .cameras-cell-camera {
    display: flex;
    align-items: center;
    gap: 1rem;
}
.cameras-activity-table .cameras-cell-icon {
    width: 32px;
    height: 32px;
    flex-shrink: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
    background: #f3f4f6;
    color: #6b7280;
    font-size: 1rem;
}
.cameras-activity-table .cameras-cell-icon.online,
.cameras-activity-table .cameras-cell-icon-status.online {
    background: rgba(16, 185, 129, 0.15);
    color: #059669;
}
.cameras-activity-table .cameras-cell-icon.offline,
.cameras-activity-table .cameras-cell-icon-status.offline {
    background: rgba(107, 114, 128, 0.15);
    color: #6b7280;
}
.cameras-activity-table .cameras-cell-name {
    font-weight: 500;
    color: #111827;
    text-decoration: none;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    max-width: 200px;
    display: inline-block;
}
.cameras-activity-table .cameras-cell-name:hover {
    color: var(--logo-blue);
}
.cameras-activity-table .cameras-cell-commit {
    display: flex;
    gap: 0.75rem;
    align-items: center;
}
.cameras-activity-table .cameras-cell-commit .cameras-imei {
    font-family: ui-monospace, monospace;
    font-size: 0.875rem;
    color: #6b7280;
}
.cameras-activity-table .cameras-cell-commit .cameras-badge {
    border-radius: var(--radius-sm, 0.375rem);
    background: #f3f4f6;
    padding: 0.25rem 0.5rem;
    font-size: var(--text-xs, 0.75rem);
    font-weight: 500;
    color: #4b5563;
}
.cameras-activity-table .cameras-cell-status {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    justify-content: flex-end;
}
@media (min-width: 640px) {
    .cameras-activity-table .cameras-cell-status { justify-content: flex-start; }
}
.cameras-activity-table .cameras-cell-meta {
    font-size: var(--text-sm, 0.875rem);
    color: #6b7280;
}
.cameras-activity-table .cameras-cell-date {
    text-align: right;
    font-size: var(--text-sm, 0.875rem);
    color: #6b7280;
}
.cameras-activity-table .cameras-cell-date time {
    font-size: inherit;
    color: inherit;
}
@media (max-width: 639.98px) {
    .cameras-activity-table .cameras-cell-status .cameras-status-text { display: none; }
    .cameras-activity-table .cameras-cell-date .cameras-date-full { display: none; }
}
@media (max-width: 767.98px) {
    .cameras-activity-table .cameras-th-commit,
    .cameras-activity-table .cameras-cell-commit,
    .cameras-activity-table .cameras-th-meta,
    .cameras-activity-table .cameras-cell-meta { display: none; }
}
@media (min-width: 768px) {
    .cameras-activity-table .cameras-cell-date .cameras-date-mobile { display: none; }
}

/* Dashboard: widgets compactos */
.dashboard .stat-card {
    border-radius: var(--radius-md, 8px);
    padding: 8px 12px;
    margin-bottom: 8px;
    box-shadow: 0 1px 4px rgba(0,0,0,0.08);
}
.dashboard .stat-card .stat-label { font-size: 0.7rem; opacity: 0.95; font-weight: 600; }
.dashboard .stat-card .stat-value { font-size: 1.25rem; font-weight: 700; line-height: 1.2; }
.dashboard .stat-card.primary,
.dashboard .stat-card.success,
.dashboard .stat-card.warning,
.dashboard .stat-card.info {
    background: var(--logo-bg);
    color: var(--logo-text);
    border: 1px solid rgba(198, 65, 6, 0.28);
    border-top: 3px solid var(--logo-blue);
}
.dashboard .device-card {
    border-radius: 6px;
    padding: 6px 10px;
    margin-bottom: 6px;
}
.dashboard .device-card h6 { font-size: 0.85rem; margin-bottom: 2px; }
.dashboard .device-card small { font-size: 0.7rem; }
.dashboard .device-card .status-badge { padding: 2px 8px; font-size: 0.7rem; border-radius: 10px; }
.dashboard .card { margin-bottom: 0.75rem; }
.dashboard .card-header { padding: 6px 12px; font-size: 0.8rem; font-weight: 600; }
.dashboard .card-body { padding: 10px 12px; }
.dashboard .storage-mini-card { padding: 8px; text-align: center; }
.dashboard .storage-mini-card .bi { font-size: 1.1rem; }
.dashboard .storage-mini-card h6 { font-size: 0.75rem; margin: 4px 0 2px; }
.dashboard .storage-mini-card .storage-value { font-size: 0.95rem; font-weight: 700; }
.dashboard .storage-mini-card small { font-size: 0.65rem; }
.dashboard .chart-mini { max-width: 100px; max-height: 100px; }

/* Videos: grid de tarjetas (agrupación por dispositivo y día) */
.videos-grid {
    list-style: none;
    padding: 0;
    margin: 0;
    display: grid;
    grid-template-columns: 1fr;
    gap: 1.5rem;
}
@media (min-width: 640px) {
    .videos-grid { grid-template-columns: repeat(2, 1fr); }
}
@media (min-width: 1024px) {
    .videos-grid { grid-template-columns: repeat(3, 1fr); }
}
.videos-card {
    border-top: 1px solid #e5e7eb;
    border-radius: var(--radius-md, 0.5rem);
    background: #fff;
    box-shadow: 0 1px 3px 0 rgba(0, 0, 0, 0.1), 0 1px 2px -1px rgba(0, 0, 0, 0.1);
    overflow: hidden;
}
.videos-card-header {
    display: flex;
    width: 100%;
    align-items: center;
    justify-content: space-between;
    gap: 1rem;
    padding: 1.5rem;
}
.videos-card-header-left {
    flex: 1;
    min-width: 0;
}
.videos-card-title {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    flex-wrap: wrap;
}
.videos-card-title h3 {
    margin: 0;
    font-size: 0.875rem;
    font-weight: 500;
    color: #111827;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}
.videos-card-badge {
    display: inline-flex;
    align-items: center;
    border-radius: var(--radius-pill, 9999px);
    background: rgba(22, 163, 74, 0.1);
    color: #15803d;
    padding: 0.125rem 0.375rem;
    font-size: 0.75rem;
    font-weight: 500;
    flex-shrink: 0;
}
.videos-card-subtitle {
    margin-top: 0.25rem;
    font-size: 0.875rem;
    color: #6b7280;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}
.videos-card-icon {
    width: 2.5rem;
    height: 2.5rem;
    flex-shrink: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
    background: #f3f4f6;
    color: #6b7280;
    outline: 1px solid rgba(0, 0, 0, 0.05);
    outline-offset: -1px;
}
.videos-card-icon .bi { font-size: 1.25rem; }
.videos-card-actions {
    display: flex;
    border-top: 1px solid #e5e7eb;
}
.videos-card-actions a,
.videos-card-actions button.videos-card-action {
    flex: 1 1 0;
    min-width: 0;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.75rem;
    padding: 1rem;
    font-size: 0.875rem;
    font-weight: 600;
    color: #111827;
    text-decoration: none;
    background: transparent;
    border: none;
    border-right: 1px solid #e5e7eb;
    cursor: pointer;
    transition: background 0.15s;
}
.videos-card-actions a:first-child,
.videos-card-actions button.videos-card-action:first-child {
    border-radius: 0 0 0 0.5rem;
}
.videos-card-actions a:last-child,
.videos-card-actions button.videos-card-action:last-child {
    border-right: none;
    border-radius: 0 0 0.5rem 0;
}
.videos-card-actions a:hover,
.videos-card-actions button.videos-card-action:hover {
    background: #f9fafb;
}
.videos-card-actions .bi { font-size: 1.25rem; color: #9ca3af; }
.videos-card-collapse {
    border-top: 1px solid #e5e7eb;
    background: #f9fafb;
}
.videos-card-collapse .channel-section {
    margin: 0;
    border-radius: 0;
    border: none;
    border-bottom: 1px solid #e5e7eb;
    background: #fff;
}
.videos-card-collapse .channel-section:last-child { border-bottom: none; }
.videos-card-collapse .video-item {
    margin: 0 0.5rem 0.5rem;
    border-radius: var(--radius-sm, 0.375rem);
}
.videos-card-collapse .video-item:last-child { margin-bottom: 0.5rem; }

/* Panel de ayuda lateral derecho: ~30% de la pantalla */
.help-offcanvas.offcanvas {
    width: 30%;
    max-width: 30vw;
}
@media (max-width: 992px) {
    .help-offcanvas.offcanvas {
        width: 85%;
        max-width: 85vw;
    }
}
.help-offcanvas .offcanvas-body {
    overflow-y: auto;
}
.help-offcanvas .help-section h3 {
    font-weight: 600;
}

/* ========== SOS: notificación y página de streaming (alineado con tema app) ========== */
.sirena-notification {
    font-family: var(--font-family) !important;
    background: var(--logo-bg) !important;
    color: var(--logo-text) !important;
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: var(--radius-md, 8px);
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.4);
}
.sirena-notification__header {
    display: flex;
    align-items: center;
    gap: 12px;
    margin-bottom: 12px;
}
.sirena-notification__title {
    font-weight: 600;
    font-size: 1rem;
}
.sirena-notification__subtitle {
    font-size: 0.8125rem;
    opacity: 0.9;
}
.sirena-notification__close {
    background: none;
    border: none;
    color: var(--logo-text);
    font-size: 1.25rem;
    cursor: pointer;
    padding: 0;
    line-height: 1;
    opacity: 0.8;
}
.sirena-notification__close:hover {
    opacity: 1;
}
.sirena-notification__content {
    background: var(--logo-bg-soft);
    padding: 10px 12px;
    border-radius: var(--radius-md, 8px);
    margin-bottom: 12px;
    font-size: 0.8125rem;
}
.sirena-notification__content-title {
    margin-bottom: 4px;
}
.sirena-notification__content-desc {
    opacity: 0.85;
}
.sirena-notification__actions-label {
    font-size: 0.6875rem;
    opacity: 0.85;
    margin-bottom: 10px;
}
.sirena-notification__actions {
    display: flex;
    gap: 8px;
}
.sirena-notification__actions button {
    font-family: var(--font-family);
    border: none;
    padding: 10px 12px;
    border-radius: var(--radius-md, 8px);
    cursor: pointer;
    font-size: 0.8125rem;
    font-weight: 600;
    transition: background 0.2s, color 0.2s;
}
.sirena-notification .btn-sirena-live {
    flex: 1;
    background: #16a34a;
    color: white;
}
.sirena-notification .btn-sirena-live:hover {
    background: #15803d;
    color: white;
}
.sirena-notification .btn-sirena-videos {
    flex: 1;
    background: var(--logo-blue);
    color: white;
}
.sirena-notification .btn-sirena-videos:hover {
    background: var(--logo-blue-hover);
    color: white;
}
.sirena-notification .btn-sirena-ok {
    background: rgba(255, 255, 255, 0.1);
    color: white;
}
.sirena-notification .btn-sirena-ok:hover {
    background: rgba(255, 255, 255, 0.2);
    color: white;
}

/* SOS streaming: estilos legacy eliminados — ahora la vista usa estilos inline (sos-streaming.blade.php) */

/* ── Dashboard: card headers y tabla de incidentes ──────────────────────── */

/* Card header con más peso visual */
.dashboard .card-header {
    background: #f8fafc;
    border-bottom: 1px solid #e2e8f0;
    color: #0f172a;
    font-weight: 600;
    font-size: .875rem;
    padding: .75rem 1rem;
    letter-spacing: .01em;
}

/* Tabla de incidentes: cabecera con más contraste */
.dashboard .table-light th {
    background: #f1f5f9;
    color: #334155;
    font-weight: 600;
    font-size: .78rem;
    text-transform: uppercase;
    letter-spacing: .04em;
    border-bottom: 2px solid #cbd5e1;
}

/* Filas con hover más visible */
.dashboard .table-hover > tbody > tr:hover > * {
    background-color: #f8fafc;
    color: #0f172a;
}

/* Texto de celdas: asegurar contraste mínimo */
.dashboard .table td {
    color: #1e293b;
    font-size: .85rem;
    vertical-align: middle;
}

/* "text-muted" en dashboard: color más oscuro para mejor legibilidad */
.dashboard .text-muted {
    color: #475569 !important;
}

/* ════════════════════════════════════════════════════════════════════════
   MODO OSCURO — cobertura completa
   Las KPI cards y navbar/sidebar ya son navy en ambos modos. Aquí se cubren
   las superficies claras (headers, tablas, bordes, texto secundario, inputs)
   y los componentes del dashboard que usan colores claros fijos.
   ════════════════════════════════════════════════════════════════════════ */

/* Superficie base de la zona de contenido */
[data-theme="dark"] .container-fluid,
[data-bs-theme="dark"] .container-fluid {
    background: transparent;
}

/* Card headers (en claro son #f8fafc) */
[data-theme="dark"] .card-header,
[data-bs-theme="dark"] .card-header,
[data-theme="dark"] .dashboard .card-header,
[data-bs-theme="dark"] .dashboard .card-header {
    background: #1a2336;
    border-bottom-color: #334155;
    color: #e5e7eb;
}

/* Tablas */
[data-theme="dark"] .table,
[data-bs-theme="dark"] .table {
    --bs-table-bg: transparent;
    --bs-table-color: #e5e7eb;
    color: #e5e7eb;
}
[data-theme="dark"] .table-light th,
[data-bs-theme="dark"] .table-light th,
[data-theme="dark"] .dashboard .table-light th,
[data-bs-theme="dark"] .dashboard .table-light th {
    background: #1a2336;
    color: #cbd5e1;
    border-bottom-color: #475569;
}
[data-theme="dark"] .dashboard .table td,
[data-bs-theme="dark"] .dashboard .table td {
    color: #cbd5e1;
}
[data-theme="dark"] .dashboard .table-hover > tbody > tr:hover > *,
[data-bs-theme="dark"] .dashboard .table-hover > tbody > tr:hover > * {
    background-color: #1e293b;
    color: #f1f5f9;
}
[data-theme="dark"] .table > :not(caption) > * > *,
[data-bs-theme="dark"] .table > :not(caption) > * > * {
    border-bottom-color: #334155;
}

/* Texto secundario */
[data-theme="dark"] .text-muted,
[data-bs-theme="dark"] .text-muted,
[data-theme="dark"] .dashboard .text-muted,
[data-bs-theme="dark"] .dashboard .text-muted {
    color: #94a3b8 !important;
}

/* Bordes claros fijos repartidos por componentes (#e5e7eb / #e2e8f0 / #f3f4f6) */
[data-theme="dark"] .devices-list-modern,
[data-bs-theme="dark"] .devices-list-modern,
[data-theme="dark"] .videos-card,
[data-bs-theme="dark"] .videos-card,
[data-theme="dark"] .cameras-activity-section,
[data-bs-theme="dark"] .cameras-activity-section {
    background: #111827;
    border-color: #334155;
    color: #e5e7eb;
}
[data-theme="dark"] .devices-list-modern li,
[data-bs-theme="dark"] .devices-list-modern li {
    border-bottom-color: #1f2a3d;
}
[data-theme="dark"] .devices-list-modern li:hover,
[data-bs-theme="dark"] .devices-list-modern li:hover {
    background: #1a2336;
}

/* Dashboard: storage mini-cards (texto fijo oscuro -> claro) */
[data-theme="dark"] .storage-mini-card h6,
[data-bs-theme="dark"] .storage-mini-card h6 {
    color: #e5e7eb;
}
[data-theme="dark"] .storage-mini-card .storage-value,
[data-bs-theme="dark"] .storage-mini-card .storage-value {
    color: #f8fafc;
}
[data-theme="dark"] .storage-mini-card small.text-muted,
[data-bs-theme="dark"] .storage-mini-card small.text-muted {
    color: #94a3b8 !important;
}

/* Formularios */
[data-theme="dark"] .form-control,
[data-bs-theme="dark"] .form-control,
[data-theme="dark"] .form-select,
[data-bs-theme="dark"] .form-select {
    background-color: #111827;
    border-color: #334155;
    color: #e5e7eb;
}
[data-theme="dark"] .form-control::placeholder,
[data-bs-theme="dark"] .form-control::placeholder {
    color: #64748b;
}

/* Dropdown items en oscuro */
[data-theme="dark"] .dropdown-item,
[data-bs-theme="dark"] .dropdown-item {
    color: #e5e7eb;
}
[data-theme="dark"] .dropdown-item:hover,
[data-bs-theme="dark"] .dropdown-item:hover,
[data-theme="dark"] .dropdown-item:focus,
[data-bs-theme="dark"] .dropdown-item:focus {
    background-color: #1e293b;
    color: #fff;
}
[data-theme="dark"] .dropdown-divider,
[data-bs-theme="dark"] .dropdown-divider,
[data-theme="dark"] .border-bottom,
[data-bs-theme="dark"] .border-bottom,
[data-theme="dark"] .border-top,
[data-bs-theme="dark"] .border-top {
    border-color: #334155 !important;
}

/* Encabezados de sección y títulos genéricos */
[data-theme="dark"] h1,
[data-bs-theme="dark"] h1,
[data-theme="dark"] h2,
[data-bs-theme="dark"] h2,
[data-theme="dark"] h3,
[data-bs-theme="dark"] h3,
[data-theme="dark"] h4,
[data-bs-theme="dark"] h4,
[data-theme="dark"] h5,
[data-bs-theme="dark"] h5,
[data-theme="dark"] h6,
[data-bs-theme="dark"] h6 {
    color: #f1f5f9;
}
