:root {
    /* Base oscura compartida por toda la app (misma familia que la card de detalle). */
    --bg: #0a1120;
    --surface: #131f38;
    --surface-soft: rgba(255, 255, 255, 0.04);
    --surface-strong: rgba(255, 255, 255, 0.08);
    --border: rgba(255, 255, 255, 0.09);
    --text: #f5f7fb;
    --muted: #8fa0c2;
    --faint: #64749a;
    --brand: #2979ff;
    --brand-hover: #1f6feb;
    --brand-soft: rgba(41, 121, 255, 0.14);

    /* Colores sólidos para lo que se dibuja sobre el mapa (claro): marcadores,
       flecha de rumbo y el avatar del vehículo. */
    --marker-moving: #2e7d32;
    --marker-stopped: #d32f2f;
    --marker-offline: #6b7280;

    /* Paleta de estado/telemetría sobre fondo oscuro — mismos criterios que
       app-client en vehiculo_page.dart (motor verde/rojo, velocidad azul, fecha de
       comunicación naranja, odómetro violeta), aclarados para que contrasten. */
    --color-moving: #4ade80;
    --color-moving-bg: rgba(46, 125, 50, 0.2);
    --color-stopped: #f87171;
    --color-stopped-bg: rgba(211, 47, 47, 0.2);
    --color-offline: #9aa5c0;
    --color-offline-bg: rgba(148, 163, 184, 0.16);
    --color-accent: #7dabff;
    --color-accent-bg: rgba(41, 121, 255, 0.18);
    --color-warning: #ffa347;
    --color-warning-bg: rgba(239, 108, 0, 0.2);
    --color-violet: #b28dff;
    --color-violet-bg: rgba(124, 77, 255, 0.22);
    --color-info: #7dabff;
    --color-info-bg: rgba(41, 121, 255, 0.18);
    --color-caution: #f9ab00;
}

* { box-sizing: border-box; }

body {
    margin: 0;
    font-family: -apple-system, "Segoe UI", Roboto, Arial, sans-serif;
    color: var(--text);
    background: var(--bg);
}

/* ---- login ---- */
.login-body {
    height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    background: radial-gradient(1100px 600px at 50% -10%, #1d3055 0%, #0a1120 70%);
}

.login-card {
    background: linear-gradient(180deg, var(--surface) 0%, #0d1526 100%);
    border: 1px solid var(--border);
    padding: 2.5rem;
    border-radius: 16px;
    box-shadow: 0 24px 55px rgba(0, 0, 0, 0.55), 0 0 40px rgba(37, 99, 235, 0.12);
    width: 320px;
    display: flex;
    flex-direction: column;
}

.login-card h1 {
    margin: 0 0 0.25rem;
    font-size: 1.5rem;
}

.subtitle {
    margin: 0 0 1.5rem;
    color: var(--muted);
    font-size: 0.9rem;
}

.login-card label {
    font-size: 0.85rem;
    margin-bottom: 0.25rem;
    color: var(--muted);
}

.login-card input {
    padding: 0.6rem 0.75rem;
    margin-bottom: 1rem;
    border: 1px solid var(--border);
    border-radius: 8px;
    font-size: 1rem;
    background: rgba(255, 255, 255, 0.05);
    color: var(--text);
}

.login-card input::placeholder {
    color: var(--faint);
}

.login-card input:focus {
    outline: none;
    border-color: var(--brand);
}

.login-card button {
    padding: 0.7rem;
    background: var(--brand);
    color: #fff;
    border: none;
    border-radius: 8px;
    font-size: 1rem;
    font-weight: 600;
    cursor: pointer;
}

.login-card button:hover {
    background: var(--brand-hover);
}

.alert {
    padding: 0.6rem 0.75rem;
    border-radius: 6px;
    font-size: 0.85rem;
    margin-bottom: 1rem;
}

.alert-error { background: var(--color-stopped-bg); color: var(--color-stopped); }
.alert-info { background: var(--color-accent-bg); color: var(--color-accent); }

/* ---- dashboard shell ---- */
.topbar {
    height: 56px;
    background: #0d1526;
    border-bottom: 1px solid var(--border);
    color: var(--text);
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0 1.25rem;
}

.brand { font-weight: 600; font-size: 1.1rem; }

.topbar-left {
    display: flex;
    align-items: center;
    gap: 1.5rem;
}

.topbar-nav-btn {
    padding: 0.4rem 0.9rem;
    border-radius: 8px;
    border: 1px solid var(--border);
    background: var(--surface-soft);
    color: var(--muted);
    font-weight: 600;
    font-size: 0.85rem;
    cursor: pointer;
    transition: background 0.15s ease, border-color 0.15s ease, color 0.15s ease;
}

.topbar-nav-btn:hover {
    background: var(--brand-soft);
    border-color: var(--brand);
    color: var(--text);
}

.topbar-right {
    display: flex;
    align-items: center;
    gap: 1rem;
    font-size: 0.9rem;
}

.topbar-user {
    display: flex;
    flex-direction: column;
    gap: 0.05rem;
    line-height: 1.1;
}

.topbar-user-label {
    font-size: 0.65rem;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    color: var(--faint);
}

.topbar-user-value {
    font-size: 0.85rem;
    font-weight: 600;
    color: var(--text);
}

.topbar-logout-btn {
    padding: 0.4rem 0.9rem;
    border-radius: 8px;
    border: 1px solid var(--border);
    background: var(--surface-soft);
    color: var(--text);
    cursor: pointer;
    font-size: 0.82rem;
    font-weight: 600;
    transition: background 0.15s ease, border-color 0.15s ease;
}

.topbar-logout-btn:hover {
    background: var(--color-stopped-bg);
    border-color: var(--color-stopped);
    color: var(--color-stopped);
}

.layout {
    display: flex;
    height: calc(100vh - 56px);
}

/* Scrollbars acordes al tema oscuro (si no, quedan barras blancas del sistema). */
.sidebar,
.vehicle-list,
.vehicle-detail-body,
.action-panel {
    scrollbar-width: thin;
    scrollbar-color: rgba(255, 255, 255, 0.18) transparent;
}

.sidebar::-webkit-scrollbar,
.vehicle-list::-webkit-scrollbar,
.vehicle-detail-body::-webkit-scrollbar,
.action-panel::-webkit-scrollbar {
    width: 8px;
}

.sidebar::-webkit-scrollbar-thumb,
.vehicle-list::-webkit-scrollbar-thumb,
.vehicle-detail-body::-webkit-scrollbar-thumb,
.action-panel::-webkit-scrollbar-thumb {
    background: rgba(255, 255, 255, 0.16);
    border-radius: 999px;
}

.sidebar::-webkit-scrollbar-track,
.vehicle-list::-webkit-scrollbar-track,
.vehicle-detail-body::-webkit-scrollbar-track,
.action-panel::-webkit-scrollbar-track {
    background: transparent;
}

.sidebar {
    width: 320px;
    flex-shrink: 0;
    background: var(--surface);
    border-right: 1px solid var(--border);
    display: flex;
    flex-direction: column;
    padding: 1rem;
    overflow: hidden;
}

/* ---- switch Vehículos / Reportes ---- */
.sidebar-tabs {
    display: flex;
    gap: 0.4rem;
    margin-bottom: 0.85rem;
    flex-shrink: 0;
    background: var(--surface-soft);
    border-radius: 10px;
    padding: 0.25rem;
}

.sidebar-tab {
    flex: 1;
    padding: 0.45rem 0.6rem;
    border: none;
    border-radius: 8px;
    background: transparent;
    color: var(--muted);
    font-weight: 700;
    font-size: 0.82rem;
    cursor: pointer;
    transition: background 0.15s ease, color 0.15s ease;
}

.sidebar-tab:hover {
    color: var(--text);
}

.sidebar-tab.active {
    background: var(--brand);
    color: #fff;
}

.sidebar-panel {
    flex: 1;
    display: flex;
    flex-direction: column;
    min-height: 0;
}

.sidebar-panel[hidden] {
    display: none;
}

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

.sidebar-header h2 {
    margin: 0;
    font-size: 1.05rem;
}

.badge {
    background: var(--brand);
    color: #fff;
    border-radius: 999px;
    padding: 0.1rem 0.6rem;
    font-size: 0.8rem;
}

#vehicle-filter {
    padding: 0.5rem 0.75rem;
    border: 1px solid var(--border);
    border-radius: 8px;
    margin-bottom: 0.75rem;
    font-size: 0.9rem;
    background: rgba(255, 255, 255, 0.05);
    color: var(--text);
}

#vehicle-filter::placeholder {
    color: var(--faint);
}

#vehicle-filter:focus {
    outline: none;
    border-color: var(--brand);
}

.vehicle-list {
    list-style: none;
    margin: 0;
    padding: 0;
    flex: 1;
    overflow-y: auto;
}

/* ---- menú de Reportes (Horómetro / Temperaturas / Velocidades máximas) ---- */
.reports-menu {
    list-style: none;
    margin: 0;
    padding: 0;
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

.reports-menu-item {
    display: flex;
    align-items: center;
    gap: 0.65rem;
    width: 100%;
    padding: 0.65rem 0.8rem;
    border-radius: 10px;
    border: 1px solid var(--border);
    background: var(--surface-soft);
    color: var(--text);
    cursor: pointer;
    text-align: left;
    text-decoration: none;
    box-sizing: border-box;
    transition: background 0.15s ease, border-color 0.15s ease;
}

.reports-menu-item:hover {
    background: var(--brand-soft);
    border-color: var(--brand);
}

.reports-menu-item.active {
    background: var(--brand-soft);
    border-color: var(--brand);
}

.reports-menu-item-icon {
    width: 34px;
    height: 34px;
    flex-shrink: 0;
    border-radius: 9px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: var(--surface-strong);
    color: var(--color-accent);
}

.reports-menu-item-icon svg {
    width: 18px;
    height: 18px;
}

.reports-menu-item-label {
    flex: 1;
    font-weight: 700;
    font-size: 0.85rem;
}

.reports-menu-item-chevron {
    width: 15px;
    height: 15px;
    flex-shrink: 0;
    color: var(--faint);
}

.reports-placeholder {
    margin-top: 0.85rem;
    padding: 0.7rem 0.8rem;
    border-radius: 10px;
    background: var(--surface-soft);
    border: 1px solid var(--border);
    color: var(--muted);
    font-size: 0.82rem;
    text-align: center;
}

.reports-placeholder[hidden] {
    display: none;
}

.reports-placeholder p {
    margin: 0;
}

.group-header {
    display: flex;
    align-items: center;
    gap: 0.4rem;
    padding: 0.5rem 0.4rem;
    margin-top: 0.25rem;
    cursor: pointer;
    user-select: none;
    border-radius: 8px;
    background: var(--surface-soft);
}

.group-header:hover {
    background: var(--surface-strong);
}

.group-chevron {
    display: inline-block;
    transition: transform 0.15s ease;
    color: var(--muted);
    font-size: 0.8rem;
}

.group-chevron.collapsed {
    transform: rotate(-90deg);
}

.group-name {
    flex: 1;
    font-weight: 600;
    font-size: 0.85rem;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.group-count {
    font-size: 0.75rem;
    color: var(--muted);
    background: var(--surface-strong);
    border-radius: 999px;
    padding: 0.05rem 0.5rem;
}

.vehicle-item {
    padding: 0.6rem 0.5rem 0.6rem 1.1rem;
    border-radius: 8px;
    cursor: pointer;
    margin-bottom: 0.35rem;
    border: 1px solid transparent;
}

.vehicle-item:hover {
    background: var(--surface-soft);
}

.vehicle-item.selected {
    background: var(--brand-soft);
    border-color: var(--brand);
}

.vehicle-item .patente {
    font-weight: 600;
    display: flex;
    align-items: center;
    gap: 0.4rem;
}

.vehicle-item .detail {
    font-size: 0.8rem;
    color: var(--muted);
}

.status-dot {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    display: inline-block;
    background: var(--color-offline);
}

.status-dot.moving { background: var(--color-moving); }
.status-dot.stopped { background: var(--color-stopped); }
.status-dot.offline { background: var(--color-offline); }

.map-container {
    flex: 1;
    position: relative;
}

#map {
    width: 100%;
    height: 100%;
}


/* ---- card de detalle del vehículo (reemplaza el popup del mapa) ----
   Tema oscuro "flotando" sobre el mapa, calcado de referencia_card.png. */
.vehicle-detail {
    position: absolute;
    left: 16px;
    right: 16px;
    bottom: 16px;
    max-height: calc(62% - 16px);
    background: linear-gradient(180deg, var(--surface) 0%, #0d1526 100%);
    border: 1px solid var(--border);
    box-shadow: 0 24px 55px rgba(0, 0, 0, 0.55), 0 0 40px rgba(37, 99, 235, 0.12);
    z-index: 1000;
    display: flex;
    flex-direction: column;
    border-radius: 20px;
    overflow: hidden;
    color: var(--text);

    /* Alias a la paleta global para que la card no tenga colores propios. */
    --panel-bg: var(--surface-soft);
    --panel-bg-strong: var(--surface-strong);
    --panel-border: var(--border);
    --text-strong: var(--text);
    --text-soft: var(--muted);
    --text-faint: var(--faint);
}

.vehicle-detail[hidden] {
    display: none;
}

.vehicle-detail-header {
    display: flex;
    align-items: center;
    gap: 0.7rem;
    padding: 0.7rem 1rem;
    flex-shrink: 0;
    flex-wrap: wrap;
    row-gap: 0.5rem;
}

.vehicle-detail-avatar {
    width: 40px;
    height: 40px;
    flex-shrink: 0;
    border-radius: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 6px 14px rgba(0, 0, 0, 0.35);
    background: var(--marker-offline);
}

.vehicle-detail-avatar.moving { background: var(--marker-moving); }
.vehicle-detail-avatar.stopped { background: var(--marker-stopped); }
.vehicle-detail-avatar.offline { background: var(--marker-offline); }

.vehicle-detail-avatar svg {
    width: 21px;
    height: 21px;
}

.vehicle-detail-heading {
    display: flex;
    flex-direction: column;
    min-width: 0;
}

.vehicle-detail-title {
    font-weight: 800;
    font-size: 1.05rem;
    line-height: 1.2;
    color: var(--text-strong);
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.vehicle-detail-subtitle {
    font-size: 0.75rem;
    font-weight: 600;
    color: var(--color-accent);
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.status-pill {
    display: inline-flex;
    align-items: center;
    gap: 0.4rem;
    flex-shrink: 0;
    font-size: 0.72rem;
    font-weight: 700;
    padding: 0.25rem 0.65rem;
    border-radius: 999px;
    background: var(--color-offline-bg);
    border: 1px solid var(--color-offline-bg);
    color: var(--color-offline);
}

.status-pill::before {
    content: '';
    width: 7px;
    height: 7px;
    border-radius: 50%;
    background: currentColor;
    flex-shrink: 0;
}

.status-pill.moving { background: var(--color-moving-bg); border-color: var(--color-moving-bg); color: var(--color-moving); }
.status-pill.stopped { background: var(--color-stopped-bg); border-color: var(--color-stopped-bg); color: var(--color-stopped); }
.status-pill.offline { background: var(--color-offline-bg); border-color: var(--color-offline-bg); color: var(--color-offline); }

.vehicle-detail-header-divider {
    width: 1px;
    align-self: stretch;
    background: rgba(255, 255, 255, 0.1);
    margin: 0 0.1rem;
}

.vehicle-detail-close {
    background: none;
    border: none;
    font-size: 1.25rem;
    line-height: 1;
    cursor: pointer;
    color: var(--text-faint);
    padding: 0.1rem 0.4rem;
    border-radius: 8px;
    flex-shrink: 0;
    margin-left: auto;
}

.vehicle-detail-close:hover {
    color: var(--text-strong);
    background: rgba(255, 255, 255, 0.08);
}

/* ---- franja de datos rápidos (fecha de posición, comunicación, velocidad, batería) ---- */
.quickstats {
    display: flex;
    align-items: center;
    gap: 1.1rem;
    flex-wrap: wrap;
    flex: 1;
    min-width: 0;
}

.quickstat {
    display: flex;
    align-items: center;
    gap: 0.45rem;
    min-width: 0;
}

.quickstat-icon {
    width: 28px;
    height: 28px;
    flex-shrink: 0;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    background: var(--surface-strong);
    color: var(--color-accent);
}

.quickstat-icon svg {
    width: 14px;
    height: 14px;
}

.quickstat-icon.tone-moving { background: var(--color-moving-bg); color: var(--color-moving); }
.quickstat-icon.tone-violet { background: var(--color-violet-bg); color: var(--color-violet); }

.quickstat-text {
    display: flex;
    flex-direction: column;
    gap: 0.15rem;
    min-width: 0;
}

.quickstat-label {
    font-size: 0.6rem;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    color: var(--text-faint);
    white-space: nowrap;
}

.quickstat-value {
    display: flex;
    align-items: center;
    gap: 0.35rem;
    font-size: 0.78rem;
    font-weight: 700;
    color: var(--text-strong);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    max-width: 220px;
}

.quickstat.tone-moving .quickstat-value { color: var(--color-moving); }
.quickstat.tone-violet .quickstat-value { color: var(--color-violet); }

.freshness-dot {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    flex-shrink: 0;
}

.freshness-dot.good { background: var(--color-moving); }
.freshness-dot.warn { background: var(--color-caution); }
.freshness-dot.bad { background: var(--color-stopped); }

.vehicle-detail-body {
    overflow-y: auto;
    padding: 0 1rem 0.85rem;
    display: flex;
    flex-direction: column;
    gap: 0.6rem;
}

/* ---- dirección: franja propia de ancho completo, para que una dirección larga
   tenga dónde crecer en vez de cortarse en la columna angosta de la caja de abajo.
   Se limita a 2 líneas (line-clamp) para que no dispare el alto de la card. ---- */
.detail-address {
    display: flex;
    align-items: flex-start;
    gap: 0.55rem;
    padding: 0.5rem 0.7rem;
    background: var(--panel-bg);
    border: 1px solid var(--panel-border);
    border-radius: 10px;
}

.detail-address-icon {
    width: 26px;
    height: 26px;
    flex-shrink: 0;
    border-radius: 8px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: var(--color-info-bg);
    color: var(--color-info);
}

.detail-address-icon svg {
    width: 14px;
    height: 14px;
}

.detail-address-text {
    align-self: center;
    font-size: 0.82rem;
    font-weight: 600;
    color: var(--text-strong);
    line-height: 1.3;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

/* ---- caja de datos secundarios (motor, odómetro, etc.) ---- */
.detail-info-box {
    display: flex;
    flex-wrap: wrap;
    background: var(--panel-bg);
    border: 1px solid var(--panel-border);
    border-radius: 12px;
    padding: 0.5rem 0;
}

.detail-info-box[hidden] {
    display: none;
}

.body-stat {
    display: flex;
    align-items: center;
    gap: 0.55rem;
    min-width: 150px;
    flex: 1;
    padding: 0.15rem 0.8rem;
}

.body-stat:not(:last-child) {
    border-right: 1px solid var(--panel-border);
}

.body-stat-icon {
    width: 32px;
    height: 32px;
    flex-shrink: 0;
    border-radius: 10px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: var(--surface-strong);
    color: var(--text-soft);
}

.body-stat-icon svg {
    width: 16px;
    height: 16px;
}

.body-stat-icon.tone-moving { background: var(--color-moving-bg); color: var(--color-moving); }
.body-stat-icon.tone-stopped { background: var(--color-stopped-bg); color: var(--color-stopped); }
.body-stat-icon.tone-neutral { background: var(--color-offline-bg); color: var(--color-offline); }
.body-stat-icon.tone-accent { background: var(--color-accent-bg); color: var(--color-accent); }
.body-stat-icon.tone-warning { background: var(--color-warning-bg); color: var(--color-warning); }
.body-stat-icon.tone-violet { background: var(--color-violet-bg); color: var(--color-violet); }
.body-stat-icon.tone-info { background: var(--color-info-bg); color: var(--color-info); }

.body-stat-text {
    display: flex;
    flex-direction: column;
    gap: 0.15rem;
    min-width: 0;
}

.detail-label {
    font-size: 0.62rem;
    text-transform: uppercase;
    letter-spacing: 0.04em;
    color: var(--text-faint);
}

.detail-value {
    font-size: 0.82rem;
    font-weight: 700;
    color: var(--text-strong);
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

/* ---- botones de acción (Zonas / Estacionado / Vel. máxima) ---- */
.vehicle-detail-actions {
    display: flex;
    gap: 0.5rem;
    flex-wrap: wrap;
}

.action-btn {
    flex: 1;
    min-width: 160px;
    display: flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.45rem 0.7rem;
    border-radius: 10px;
    border: 1px solid var(--panel-border);
    background: var(--panel-bg);
    cursor: pointer;
    color: var(--text-soft);
    transition: background 0.15s ease, border-color 0.15s ease, color 0.15s ease;
}

.action-btn-icon-badge {
    width: 26px;
    height: 26px;
    flex-shrink: 0;
    border-radius: 8px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: rgba(255, 255, 255, 0.06);
    transition: background 0.15s ease;
}

.action-btn-icon {
    width: 14px;
    height: 14px;
    color: var(--text-soft);
    transition: color 0.15s ease;
}

.action-btn-label {
    flex: 1;
    text-align: left;
    font-weight: 700;
    font-size: 0.78rem;
    color: var(--text-strong);
    transition: color 0.15s ease;
}

.action-btn-chevron {
    width: 14px;
    height: 14px;
    flex-shrink: 0;
    color: var(--text-faint);
    transition: color 0.15s ease;
}

.action-btn:hover {
    border-color: var(--brand);
    background: var(--brand-soft);
}

.action-btn.active {
    border-color: var(--brand);
    background: var(--brand-soft);
}

.action-btn.active .action-btn-icon-badge { background: var(--color-accent-bg); }
.action-btn.active .action-btn-icon,
.action-btn.active .action-btn-label,
.action-btn.active .action-btn-chevron { color: var(--color-accent); }

.action-btn.on .action-btn-icon-badge { background: var(--color-moving-bg); }
.action-btn.on .action-btn-icon { color: var(--color-moving); }

.action-btn.on.active {
    border-color: var(--color-moving);
    background: var(--color-moving-bg);
}

.action-btn.on.active .action-btn-icon-badge { background: var(--color-moving-bg); }
.action-btn.on.active .action-btn-icon,
.action-btn.on.active .action-btn-label,
.action-btn.on.active .action-btn-chevron { color: var(--color-moving); }

.action-panel {
    border: 1px solid var(--panel-border);
    border-radius: 12px;
    padding: 0.75rem 0.9rem;
    background: var(--panel-bg);
    font-size: 0.82rem;
    color: var(--text-soft);
}

.action-panel[hidden] {
    display: none;
}

.action-panel hr {
    border: none;
    border-top: 1px solid var(--panel-border);
    margin: 0.8rem 0;
}

.action-panel .panel-row {
    display: flex;
    gap: 0.6rem;
    align-items: center;
    flex-wrap: wrap;
    margin-bottom: 0.6rem;
}

.action-panel input[type="text"],
.action-panel input[type="number"] {
    padding: 0.45rem 0.65rem;
    border: 1px solid var(--panel-border);
    border-radius: 8px;
    font-size: 0.85rem;
    background: rgba(255, 255, 255, 0.05);
    color: var(--text-strong);
}

.action-panel input::placeholder {
    color: var(--text-faint);
}

.action-panel input[type="number"] {
    width: 110px;
}

.action-panel label {
    display: flex;
    align-items: center;
    gap: 0.35rem;
    font-size: 0.82rem;
    color: var(--text-soft);
}

.action-panel button {
    padding: 0.5rem 1rem;
    border-radius: 9px;
    border: 1px solid var(--panel-border);
    background: rgba(255, 255, 255, 0.05);
    cursor: pointer;
    font-weight: 700;
    font-size: 0.82rem;
    color: var(--text-strong);
    transition: background 0.15s ease, border-color 0.15s ease;
}

.action-panel button:hover:not(:disabled) {
    background: var(--brand-soft);
    border-color: var(--brand);
}

.action-panel button.primary {
    background: var(--brand);
    border-color: var(--brand);
    color: #fff;
}

.action-panel button.primary:hover:not(:disabled) {
    background: var(--brand-hover);
    border-color: var(--brand-hover);
}

.action-panel button:disabled {
    opacity: 0.5;
    cursor: default;
}

.action-panel .muted {
    color: var(--text-faint);
    font-size: 0.8rem;
}

.action-panel .error {
    color: var(--color-stopped);
    font-size: 0.8rem;
    margin-top: 0.5rem;
}

.zone-item {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0.5rem 0;
    border-bottom: 1px solid var(--panel-border);
    color: var(--text-strong);
}

.zone-item:last-child {
    border-bottom: none;
}

/* Odómetro parcial: mismo body-stat pero clickeable, con un ícono de reinicio. */
.body-stat-clickable {
    cursor: pointer;
    border-radius: 10px;
    transition: background 0.15s ease;
}

.body-stat-clickable:hover {
    background: var(--surface-strong);
}

.body-stat-action-icon {
    margin-left: auto;
    flex-shrink: 0;
    color: var(--text-faint);
}

.body-stat-action-icon svg {
    width: 16px;
    height: 16px;
}

/* ---- modal de confirmación genérico (reiniciar odómetro parcial, etc.) ---- */
.confirm-modal {
    position: fixed;
    inset: 0;
    z-index: 2000;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 1rem;
}

.confirm-modal[hidden] {
    display: none;
}

.confirm-modal-backdrop {
    position: absolute;
    inset: 0;
    background: rgba(5, 9, 18, 0.65);
}

.confirm-modal-dialog {
    position: relative;
    background: linear-gradient(180deg, var(--surface) 0%, #0d1526 100%);
    border: 1px solid var(--border);
    border-radius: 16px;
    box-shadow: 0 24px 55px rgba(0, 0, 0, 0.55);
    padding: 1.5rem;
    width: min(360px, 100%);
    color: var(--text);
}

.confirm-modal-message {
    margin: 0 0 1.3rem;
    font-size: 0.95rem;
    line-height: 1.45;
}

.confirm-modal-actions {
    display: flex;
    justify-content: flex-end;
    gap: 0.6rem;
}

.confirm-modal-actions button {
    padding: 0.5rem 1.1rem;
    border-radius: 9px;
    border: 1px solid var(--border);
    background: var(--surface-strong);
    color: var(--text);
    font-weight: 700;
    font-size: 0.85rem;
    cursor: pointer;
    transition: filter 0.15s ease;
}

.confirm-modal-actions button.primary {
    background: var(--brand);
    border-color: var(--brand);
    color: #fff;
}

.confirm-modal-actions button:hover {
    filter: brightness(1.15);
}

.confirm-modal-actions button[hidden] {
    display: none;
}

/* ---- menú de opciones (doble click en un vehículo de la lista) ---- */
.options-modal-header {
    display: flex;
    align-items: center;
    gap: 0.6rem;
    margin-bottom: 0.9rem;
}

.options-modal-title {
    flex: 1;
    font-weight: 800;
    font-size: 1.05rem;
    color: var(--text);
}

.options-modal-list {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

.options-modal-item {
    display: flex;
    align-items: center;
    gap: 0.65rem;
    width: 100%;
    padding: 0.65rem 0.8rem;
    border-radius: 10px;
    border: 1px solid var(--border);
    background: var(--surface-soft);
    color: var(--text);
    cursor: pointer;
    text-align: left;
    transition: background 0.15s ease, border-color 0.15s ease;
}

.options-modal-item:hover {
    background: var(--brand-soft);
    border-color: var(--brand);
}

.options-modal-item-icon {
    width: 34px;
    height: 34px;
    flex-shrink: 0;
    border-radius: 9px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: var(--surface-strong);
    color: var(--color-accent);
}

.options-modal-item-icon svg {
    width: 18px;
    height: 18px;
}

.options-modal-item-label {
    flex: 1;
    font-weight: 700;
    font-size: 0.88rem;
}

.options-modal-item-chevron {
    width: 15px;
    height: 15px;
    flex-shrink: 0;
    color: var(--faint);
}

/* ---- reporte histórico ---- */
.history-report-dialog {
    width: min(420px, 100%);
}

.history-report-range {
    display: flex;
    gap: 0.5rem;
    margin-bottom: 0.9rem;
}

.range-btn {
    flex: 1;
    padding: 0.5rem 0.6rem;
    border-radius: 9px;
    border: 1px solid var(--border);
    background: var(--surface-soft);
    color: var(--text);
    font-weight: 700;
    font-size: 0.82rem;
    cursor: pointer;
    transition: background 0.15s ease, border-color 0.15s ease, color 0.15s ease;
}

.range-btn:hover {
    border-color: var(--brand);
}

.range-btn.active {
    background: var(--brand);
    border-color: var(--brand);
    color: #fff;
}

.history-report-body {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

.history-report-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0.6rem 0.8rem;
    border-radius: 10px;
    background: var(--surface-soft);
    border: 1px solid var(--border);
}

.history-report-row span {
    font-size: 0.85rem;
    color: var(--muted);
}

.history-report-row strong {
    font-size: 0.95rem;
    color: var(--text);
}

.history-report-body .muted {
    color: var(--faint);
    font-size: 0.85rem;
    text-align: center;
    padding: 0.5rem 0;
}

.history-report-body .error {
    color: var(--color-stopped);
    font-size: 0.85rem;
    text-align: center;
    padding: 0.5rem 0;
}

.empty-state {
    padding: 1rem 0.5rem;
    color: var(--muted);
    font-size: 0.9rem;
    text-align: center;
}

/* ---- reporte de horómetro: diálogo de fechas/vehículos ---- */
.horometro-dialog {
    width: min(420px, 100%);
    display: flex;
    flex-direction: column;
    max-height: min(640px, 90vh);
}

.horometro-dialog-field {
    margin-bottom: 1rem;
}

.horometro-dialog-field-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.horometro-dialog-label {
    display: block;
    font-size: 0.78rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.04em;
    color: var(--faint);
    margin-bottom: 0.5rem;
}

.horometro-dialog-range {
    display: flex;
    gap: 0.5rem;
    margin-bottom: 0.6rem;
}

.horometro-dialog-dates {
    display: flex;
    gap: 0.6rem;
}

.horometro-dialog-dates label {
    flex: 1;
    display: flex;
    flex-direction: column;
    gap: 0.3rem;
    font-size: 0.8rem;
    color: var(--muted);
}

.horometro-dialog-dates input[type="date"] {
    padding: 0.45rem 0.6rem;
    border-radius: 8px;
    border: 1px solid var(--border);
    background: var(--surface-soft);
    color: var(--text);
    font-size: 0.85rem;
    color-scheme: dark;
}

.horometro-select-all {
    border: none;
    background: none;
    color: var(--brand);
    font-weight: 700;
    font-size: 0.78rem;
    cursor: pointer;
    padding: 0;
}

.horometro-select-all:hover {
    text-decoration: underline;
}

.horometro-vehicle-list {
    list-style: none;
    margin: 0;
    padding: 0;
    max-height: 220px;
    overflow-y: auto;
    border: 1px solid var(--border);
    border-radius: 10px;
    background: var(--surface-soft);
}

.horometro-vehicle-item {
    display: flex;
    align-items: center;
    gap: 0.6rem;
    padding: 0.55rem 0.7rem;
    border-bottom: 1px solid var(--border);
    font-size: 0.85rem;
    color: var(--text);
    cursor: pointer;
}

.horometro-vehicle-item:last-child {
    border-bottom: none;
}

.horometro-vehicle-item:hover {
    background: var(--surface-strong);
}

.horometro-vehicle-item input[type="checkbox"] {
    accent-color: var(--brand);
    width: 15px;
    height: 15px;
    flex-shrink: 0;
}

.horometro-vehicle-item-client {
    color: var(--faint);
    font-weight: 400;
}

/* ---- reporte de viajes: diálogo (mes + calendario de días + vehículos) ---- */
.viajes-dialog {
    width: min(680px, 95vw);
    max-height: min(760px, 92vh);
    overflow-y: auto;
}

.viajes-dialog input[type="month"] {
    width: 100%;
    padding: 0.45rem 0.6rem;
    border-radius: 8px;
    border: 1px solid var(--border);
    background: var(--surface-soft);
    color: var(--text);
    font-size: 0.85rem;
    color-scheme: dark;
}

.viajes-calendar-actions {
    display: flex;
    gap: 0.9rem;
}

/* Las celdas no llevan borde propio: el gap de 1px deja ver el fondo del
   contenedor (var(--border)) entre ellas, como las líneas de una tabla — así
   quedan "pegadas" en vez de flotar como cuadrados sueltos con aire alrededor. */
.viajes-calendar-grid {
    display: grid;
    grid-template-columns: repeat(7, 1fr);
    gap: 1px;
    padding: 1px;
    border: 1px solid var(--border);
    border-radius: 10px;
    overflow: hidden;
    background: var(--border);
}

.viajes-calendar-day-name {
    text-align: center;
    font-size: 0.7rem;
    font-weight: 700;
    color: var(--faint);
    text-transform: uppercase;
    padding: 0.4rem 0;
    background: var(--surface-strong);
}

.viajes-calendar-day-empty {
    background: var(--surface-soft);
}

.viajes-calendar-day {
    display: flex;
    align-items: center;
    justify-content: center;
    aspect-ratio: 1;
    background: var(--surface-strong);
    color: var(--text);
    font-size: 0.85rem;
    font-weight: 600;
    cursor: pointer;
    transition: background 0.15s ease;
}

.viajes-calendar-day:hover {
    background: var(--brand-soft);
}

.viajes-calendar-day.selected {
    background: var(--brand);
    color: #fff;
}

.viajes-calendar-day.disabled {
    cursor: default;
    opacity: 0.35;
    background: var(--surface-soft);
}

.viajes-calendar-day.disabled:hover {
    background: var(--surface-soft);
}

.viajes-dialog-actions {
    flex-wrap: wrap;
}

/* ---- reporte de horómetro: pantalla completa ---- */
.fullscreen-report {
    position: fixed;
    inset: 0;
    z-index: 3000;
    display: flex;
    flex-direction: column;
    background: var(--bg);
}

.fullscreen-report[hidden] {
    display: none;
}

.fullscreen-report-header {
    display: flex;
    align-items: center;
    gap: 0.9rem;
    padding: 0.9rem 1.3rem;
    border-bottom: 1px solid var(--border);
    background: linear-gradient(180deg, var(--surface) 0%, #0d1526 100%);
    flex-shrink: 0;
}

.fullscreen-report-back {
    width: 38px;
    height: 38px;
    flex-shrink: 0;
    border-radius: 10px;
    border: 1px solid var(--border);
    background: var(--surface-soft);
    color: var(--text);
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
}

.fullscreen-report-back svg {
    width: 18px;
    height: 18px;
}

.fullscreen-report-back:hover {
    background: var(--surface-strong);
}

.fullscreen-report-heading {
    flex: 1;
    min-width: 0;
}

.fullscreen-report-heading h1 {
    margin: 0;
    font-size: 1.05rem;
    font-weight: 800;
    color: var(--text);
}

.fullscreen-report-subtitle {
    margin: 0.2rem 0 0;
    font-size: 0.82rem;
    color: var(--muted);
}

.horometro-legend {
    display: flex;
    gap: 1rem;
    flex-shrink: 0;
}

.horometro-legend-item {
    display: flex;
    align-items: center;
    gap: 0.4rem;
    font-size: 0.82rem;
    color: var(--muted);
    font-weight: 600;
}

.horometro-legend-swatch {
    width: 10px;
    height: 10px;
    border-radius: 3px;
    flex-shrink: 0;
}

.horometro-legend-swatch.on { background: var(--marker-moving); }
.horometro-legend-swatch.off { background: var(--marker-stopped); }

.fullscreen-report-body {
    flex: 1;
    overflow-y: auto;
    padding: 1.3rem;
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

.horometro-chart-card {
    background: linear-gradient(180deg, var(--surface) 0%, #0d1526 100%);
    border: 1px solid var(--border);
    border-radius: 14px;
    padding: 1rem 1.1rem 1.2rem;
}

.horometro-chart-card-header {
    display: flex;
    align-items: baseline;
    justify-content: space-between;
    gap: 0.8rem;
    margin-bottom: 0.7rem;
}

.horometro-chart-card-title {
    font-size: 0.95rem;
    font-weight: 800;
    color: var(--text);
}

.horometro-chart-card-total {
    font-size: 0.78rem;
    color: var(--muted);
}

.horometro-table-toggle {
    border: 1px solid var(--border);
    background: var(--surface-soft);
    color: var(--text);
    border-radius: 8px;
    padding: 0.3rem 0.6rem;
    font-size: 0.75rem;
    font-weight: 700;
    cursor: pointer;
    flex-shrink: 0;
}

.horometro-table-toggle:hover {
    border-color: var(--brand);
}

.horometro-chart-scroll {
    overflow-x: auto;
}

.horometro-chart-scroll svg {
    display: block;
}

.horometro-bar-hit {
    fill: transparent;
    cursor: pointer;
}

.horometro-bar-group.hovered .horometro-bar-on,
.horometro-bar-group.hovered .horometro-bar-off {
    filter: brightness(1.2);
}

.horometro-bar-on { fill: var(--marker-moving); }
.horometro-bar-off { fill: var(--marker-stopped); }
.horometro-bar-empty { fill: var(--faint); opacity: 0.5; }

.horometro-axis-line {
    stroke: var(--border);
    stroke-width: 1;
}

.horometro-axis-label {
    fill: var(--faint);
    font-size: 10px;
}

.horometro-day-label {
    fill: var(--faint);
    font-size: 10px;
}

.horometro-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 0.82rem;
}

.horometro-table-wrap {
    overflow-x: auto;
}

/* ---- reporte de viajes ---- */
.viajes-vehicle-section {
    display: flex;
    flex-direction: column;
    gap: 0.6rem;
    border: 1px solid var(--border);
    border-radius: 14px;
    padding: 1rem 1.1rem 1.2rem;
    background: var(--surface);
}

.viajes-vehicle-title {
    font-size: 0.95rem;
    font-weight: 800;
    color: var(--text);
    margin: 0;
}

.viajes-table-title {
    font-size: 0.8rem;
    font-weight: 700;
    color: var(--muted);
    margin: 0.4rem 0 -0.2rem;
}

/* ---- reporte de posiciones ---- */
.positions-report-body {
    overflow-y: hidden;
}

.positions-map {
    height: 420px;
    border-radius: 14px;
    border: 1px solid var(--border);
    flex-shrink: 0;
}

.positions-table-note {
    margin: 0;
    font-size: 0.8rem;
    color: var(--faint);
}

.positions-loading {
    position: absolute;
    inset: 0;
    z-index: 50;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 1rem;
    background: rgba(10, 17, 32, 0.85);
    backdrop-filter: blur(2px);
}

.positions-loading[hidden] {
    display: none;
}

.positions-loading-spinner {
    width: 44px;
    height: 44px;
    border-radius: 50%;
    border: 4px solid var(--border);
    border-top-color: var(--brand);
    animation: positions-spin 0.8s linear infinite;
}

@keyframes positions-spin {
    to { transform: rotate(360deg); }
}

.positions-loading-text {
    font-size: 0.95rem;
    font-weight: 700;
    color: var(--text);
}

.positions-loading-bar-track {
    width: min(280px, 70vw);
    height: 8px;
    border-radius: 999px;
    background: var(--surface-strong);
    overflow: hidden;
}

.positions-loading-bar-fill {
    height: 100%;
    width: 0%;
    background: var(--brand);
    border-radius: 999px;
    transition: width 0.15s ease;
}

.positions-table-toolbar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 1rem;
    flex-shrink: 0;
}

.positions-table-toolbar .positions-table-note {
    flex: 1;
}

.positions-table-toolbar .horometro-table-toggle {
    flex-shrink: 0;
    white-space: nowrap;
    margin-left: auto;
}

.positions-table-toolbar .horometro-table-toggle:disabled {
    opacity: 0.5;
    cursor: default;
}

.positions-report-body .horometro-table-wrap {
    flex: 1;
    overflow-y: auto;
    border: 1px solid var(--border);
    border-radius: 12px;
}

.positions-report-body .horometro-table thead th {
    position: sticky;
    top: 0;
    background: var(--surface);
    z-index: 1;
}

.positions-report-body .horometro-table tbody tr {
    cursor: pointer;
    transition: background 0.1s ease;
}

.positions-report-body .horometro-table tbody tr:hover {
    background: var(--surface-strong);
}

.positions-report-body .horometro-table tbody tr.selected {
    background: var(--brand-soft);
}

.horometro-table th,
.horometro-table td {
    text-align: left;
    padding: 0.4rem 0.6rem;
    border-bottom: 1px solid var(--border);
    color: var(--text);
    font-variant-numeric: tabular-nums;
}

.horometro-table th {
    color: var(--faint);
    font-weight: 700;
    font-size: 0.72rem;
    text-transform: uppercase;
    letter-spacing: 0.03em;
}

.horometro-tooltip {
    position: fixed;
    z-index: 4000;
    pointer-events: none;
    background: linear-gradient(180deg, var(--surface) 0%, #0d1526 100%);
    border: 1px solid var(--border);
    border-radius: 10px;
    padding: 0.55rem 0.7rem;
    font-size: 0.8rem;
    color: var(--text);
    box-shadow: 0 12px 28px rgba(0, 0, 0, 0.5);
    min-width: 190px;
}

.horometro-tooltip[hidden] {
    display: none;
}

.horometro-tooltip-date {
    font-weight: 800;
    margin-bottom: 0.35rem;
}

.horometro-tooltip-row {
    display: flex;
    align-items: center;
    gap: 0.4rem;
    justify-content: space-between;
    padding: 0.1rem 0;
}

.horometro-tooltip-key {
    display: flex;
    align-items: center;
    gap: 0.35rem;
    color: var(--muted);
}

.horometro-tooltip-key::before {
    content: "";
    width: 10px;
    height: 2px;
    border-radius: 1px;
    background: currentColor;
}

.horometro-tooltip-row.on .horometro-tooltip-key { color: var(--marker-moving); }
.horometro-tooltip-row.off .horometro-tooltip-key { color: var(--marker-stopped); }

.horometro-tooltip-value {
    font-weight: 700;
    color: var(--text);
}

.horometro-tooltip-total {
    margin-top: 0.35rem;
    padding-top: 0.35rem;
    border-top: 1px solid var(--border);
    display: flex;
    justify-content: space-between;
    font-weight: 800;
}

/* ---- administración (equivalente web de app-admin) ---- */
.admin-list {
    list-style: none;
    margin: 0;
    padding: 0;
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

.admin-list-item {
    display: flex;
    align-items: center;
    gap: 0.8rem;
    padding: 0.75rem 1rem;
    border-radius: 12px;
    border: 1px solid var(--border);
    background: linear-gradient(180deg, var(--surface) 0%, #0d1526 100%);
}

.admin-list-item-icon {
    width: 40px;
    height: 40px;
    flex-shrink: 0;
    border-radius: 10px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: var(--surface-strong);
    color: var(--color-accent);
}

.admin-list-item-icon svg {
    width: 20px;
    height: 20px;
}

.admin-list-item-text {
    flex: 1;
    min-width: 0;
}

.admin-list-item-title {
    font-weight: 700;
    font-size: 0.9rem;
    color: var(--text);
}

.admin-list-item-subtitle {
    font-size: 0.78rem;
    color: var(--faint);
    margin-top: 0.15rem;
}

.admin-list-item-subtitle svg {
    width: 11px;
    height: 11px;
    vertical-align: -1px;
    margin-right: 3px;
}

.admin-status-pill {
    padding: 0.25rem 0.7rem;
    border-radius: 20px;
    font-size: 0.7rem;
    font-weight: 700;
    flex-shrink: 0;
}

.admin-status-pill.enabled { background: var(--color-moving-bg); color: var(--color-moving); }
.admin-status-pill.disabled { background: var(--color-stopped-bg); color: var(--color-stopped); }
.admin-status-pill.neutral { background: var(--color-offline-bg); color: var(--color-offline); }

.admin-text-input {
    width: 100%;
    padding: 0.5rem 0.7rem;
    border-radius: 8px;
    border: 1px solid var(--border);
    background: var(--surface-soft);
    color: var(--text);
    font-size: 0.85rem;
}

.admin-text-input:focus {
    outline: none;
    border-color: var(--brand);
}

/* ---- combo buscable (reemplaza <select>, ver searchable-select.js) ---- */
.searchable-select {
    position: relative;
}

.searchable-select-input {
    width: 100%;
    cursor: text;
}

.searchable-select-input:disabled {
    opacity: 0.5;
    cursor: default;
}

.searchable-select-list {
    position: absolute;
    top: calc(100% + 4px);
    left: 0;
    right: 0;
    max-height: 220px;
    overflow-y: auto;
    margin: 0;
    padding: 0.3rem;
    list-style: none;
    background: linear-gradient(180deg, var(--surface) 0%, #0d1526 100%);
    border: 1px solid var(--border);
    border-radius: 10px;
    box-shadow: 0 12px 28px rgba(0, 0, 0, 0.5);
    z-index: 20;
}

.searchable-select-list[hidden] {
    display: none;
}

.searchable-select-option {
    padding: 0.5rem 0.65rem;
    border-radius: 6px;
    font-size: 0.85rem;
    color: var(--text);
    cursor: pointer;
}

.searchable-select-option:hover,
.searchable-select-option.highlighted {
    background: var(--brand-soft);
}

.searchable-select-option.group-option {
    font-weight: 700;
    color: var(--color-violet);
}

.searchable-select-option.group-option:hover {
    background: var(--color-violet-bg);
}

.searchable-select-empty {
    padding: 0.5rem 0.65rem;
    font-size: 0.82rem;
    color: var(--faint);
}

/* ---- autocompletar de selección múltiple (chips), ver createMultiSearchSelect ---- */
.multi-search-select {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

.multi-select-chips {
    list-style: none;
    margin: 0;
    padding: 0;
    display: flex;
    flex-wrap: wrap;
    gap: 0.4rem;
}

.multi-select-chip {
    display: flex;
    align-items: center;
    gap: 0.4rem;
    padding: 0.3rem 0.4rem 0.3rem 0.7rem;
    border-radius: 20px;
    background: var(--brand-soft);
    border: 1px solid var(--brand);
    color: var(--text);
    font-size: 0.8rem;
    font-weight: 600;
    max-width: 100%;
}

.multi-select-chip span {
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.multi-select-chip-remove {
    border: none;
    background: none;
    color: var(--muted);
    font-size: 1rem;
    line-height: 1;
    cursor: pointer;
    padding: 0 0.2rem;
    flex-shrink: 0;
}

.multi-select-chip-remove:hover {
    color: var(--color-stopped);
}

.admin-user-dialog {
    width: min(460px, 100%);
    max-height: min(680px, 90vh);
    overflow-y: auto;
}

.admin-checklist {
    max-height: 220px;
    overflow-y: auto;
    border: 1px solid var(--border);
    border-radius: 10px;
    gap: 0;
}

.admin-checklist .admin-list-item {
    border-radius: 0;
    border: none;
    border-bottom: 1px solid var(--border);
    background: transparent;
    cursor: pointer;
}

.admin-checklist .admin-list-item:last-child {
    border-bottom: none;
}

.admin-checklist .admin-list-item:hover {
    background: var(--surface-strong);
}

.admin-checklist .admin-list-item input[type="checkbox"] {
    accent-color: var(--brand);
    width: 16px;
    height: 16px;
    flex-shrink: 0;
}

/* ---- páginas de administración standalone (se abren en pestaña aparte) ---- */
.admin-page-body {
    max-width: 760px;
    margin: 0 auto;
    padding: 1.5rem 1.25rem 3rem;
}

.admin-page-header {
    display: flex;
    align-items: baseline;
    justify-content: space-between;
    gap: 0.8rem;
    margin-bottom: 1rem;
}

.admin-page-header h1 {
    margin: 0;
    font-size: 1.3rem;
    font-weight: 800;
    color: var(--text);
}

.admin-page-count {
    font-size: 0.85rem;
    color: var(--faint);
    margin-left: 0.6rem;
    font-weight: 500;
}

.admin-search-input {
    width: 100%;
    padding: 0.6rem 0.9rem;
    border-radius: 10px;
    border: 1px solid var(--border);
    background: var(--surface-soft);
    color: var(--text);
    font-size: 0.9rem;
    margin-bottom: 1rem;
}

.admin-search-input:focus {
    outline: none;
    border-color: var(--brand);
}

.admin-search-input::placeholder {
    color: var(--faint);
}

.admin-pagination {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 1rem;
    margin-top: 1.2rem;
}

.admin-pagination button {
    padding: 0.45rem 1rem;
    border-radius: 8px;
    border: 1px solid var(--border);
    background: var(--surface-soft);
    color: var(--text);
    font-weight: 700;
    font-size: 0.85rem;
    cursor: pointer;
}

.admin-pagination button:hover:not(:disabled) {
    border-color: var(--brand);
    background: var(--brand-soft);
}

.admin-pagination button:disabled {
    opacity: 0.4;
    cursor: default;
}

.admin-pagination-info {
    font-size: 0.82rem;
    color: var(--muted);
}

/* ---- marcador de vehículo (mismo estilo que la pantalla principal de app-client:
   círculo de color con ícono de camión + patente debajo) ---- */
.vehicle-marker-wrapper {
    background: transparent;
    border: none;
}

.vehicle-marker {
    display: flex;
    flex-direction: column;
    align-items: center;
    cursor: pointer;
}

.vehicle-marker-shape {
    position: relative;
    width: 44px;
    height: 44px;
}

.vehicle-marker-badge {
    width: 44px;
    height: 44px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    border: 3px solid rgba(255, 255, 255, 0.9);
    box-shadow: 0 1px 4px rgba(0, 0, 0, 0.45);
}

/* Flecha de rumbo (course): un triángulo pegado al borde del círculo que rota
   alrededor de su centro, visible solo mientras el vehículo está en movimiento. */
.vehicle-marker-direction {
    position: absolute;
    inset: 0;
    transform-origin: center center;
    pointer-events: none;
}

.vehicle-marker-direction::before {
    content: '';
    position: absolute;
    top: -9px;
    left: 50%;
    margin-left: -7px;
    border-left: 7px solid transparent;
    border-right: 7px solid transparent;
    border-bottom: 11px solid var(--marker-moving);
    filter: drop-shadow(0 1px 1px rgba(0, 0, 0, 0.4));
}

.vehicle-marker-badge svg {
    width: 22px;
    height: 22px;
}

.vehicle-marker-badge.moving { background: var(--marker-moving); }
.vehicle-marker-badge.stopped { background: var(--marker-stopped); }
.vehicle-marker-badge.offline { background: var(--marker-offline); }

.vehicle-marker-label {
    margin-top: 2px;
    font-size: 12px;
    font-weight: 700;
    background: #fff;
    padding: 1px 6px;
    border-radius: 10px;
    white-space: nowrap;
    color: #1c2128;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.25);
}

/* ---- cluster de vehículos (mismo estilo que app-client: círculo azul con halo) ---- */
.vehicle-cluster-wrapper {
    background: transparent;
    border: none;
}

.vehicle-cluster-badge {
    width: 46px;
    height: 46px;
    border-radius: 50%;
    background: rgba(59, 111, 209, 0.35);
    display: flex;
    align-items: center;
    justify-content: center;
}

.vehicle-cluster-badge span {
    width: 34px;
    height: 34px;
    border-radius: 50%;
    background: #3b6fd1;
    color: #fff;
    font-weight: 700;
    font-size: 14px;
    display: flex;
    align-items: center;
    justify-content: center;
}
