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

/* ESTILOS LOGIN GGH (FONDO CON LÍNEAS ANIMADAS) */
body {
    font-family: Arial, Helvetica, sans-serif;
    background: radial-gradient(ellipse at 30% 40%, #0a1022 0%, #03060e 100%);
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    position: relative;
    overflow-x: auto;
}

/* Fondo con líneas animadas - solo visible en login */
.animated-bg {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    pointer-events: none;
    z-index: 0;
    overflow: hidden;
}

.hline {
    position: absolute;
    width: 100%;
    height: 1px;
    background: linear-gradient(90deg, transparent, rgba(0, 170, 240, 0.3), rgba(0, 210, 255, 0.5), rgba(0, 170, 240, 0.3), transparent);
    animation: slideHorizontal 14s linear infinite;
    opacity: 0.5;
}

@keyframes slideHorizontal {
    0% { transform: translateX(-100%); opacity: 0; }
    10% { opacity: 0.5; }
    90% { opacity: 0.5; }
    100% { transform: translateX(100%); opacity: 0; }
}

.vline {
    position: absolute;
    width: 1px;
    height: 100%;
    background: linear-gradient(0deg, transparent, rgba(0, 150, 220, 0.25), rgba(0, 190, 240, 0.4), rgba(0, 150, 220, 0.25), transparent);
    animation: slideVertical 18s linear infinite;
    opacity: 0.4;
}

@keyframes slideVertical {
    0% { transform: translateY(-100%); opacity: 0; }
    10% { opacity: 0.4; }
    90% { opacity: 0.4; }
    100% { transform: translateY(100%); opacity: 0; }
}

/* Cuadrícula fija */
.static-grid {
    position: fixed;
    width: 100%;
    height: 100%;
    background-image: linear-gradient(rgba(0, 130, 210, 0.04) 1px, transparent 1px), linear-gradient(90deg, rgba(0, 130, 210, 0.04) 1px, transparent 1px);
    background-size: 40px 40px;
    pointer-events: none;
    z-index: 0;
}

.particle {
    position: fixed;
    width: 2px;
    height: 2px;
    background: #6ab5df;
    border-radius: 0;
    opacity: 0.2;
    pointer-events: none;
    z-index: 1;
    animation: floatParticle 20s infinite linear;
}

@keyframes floatParticle {
    0% { transform: translateY(100vh) translateX(0); opacity: 0; }
    15% { opacity: 0.25; }
    85% { opacity: 0.2; }
    100% { transform: translateY(-20vh) translateX(40px); opacity: 0; }
}

/* Login Container - ESTILO CUADRADO GGH */
.login-container {
    position: relative;
    z-index: 10;
    width: 100%;
    max-width: 500px;
    margin: 20px;
    background: rgba(6, 12, 24, 0.88);
    backdrop-filter: blur(14px);
    border: 1px solid rgba(0, 150, 210, 0.5);
    box-shadow: 0 15px 35px rgba(0, 0, 0, 0.3), inset 0 0 15px rgba(0, 150, 210, 0.05);
    border-radius: 0;
    transition: all 0.2s ease;
}

.login-container::before {
    content: "";
    position: absolute;
    top: -1px;
    left: -1px;
    right: -1px;
    bottom: -1px;
    background: linear-gradient(125deg, rgba(0, 160, 220, 0.1), transparent, rgba(0, 100, 160, 0.05));
    pointer-events: none;
    border-radius: 0;
    z-index: -1;
}

.form-content {
    padding: 40px 36px;
    position: relative;
}

/* TÍTULO MONITOR LOGÍSTICO */
.title-section {
    text-align: center;
    margin-bottom: 28px;
    position: relative;
}

.main-title {
    font-family: Arial, Helvetica, sans-serif;
    font-size: 1.55rem;
    font-weight: 800;
    letter-spacing: 3px;
    background: linear-gradient(135deg, #c0e4ff 0%, #70b8e8 80%);
    -webkit-background-clip: text;
    background-clip: text;
    color: transparent;
    text-shadow: 0 0 5px rgba(0, 160, 230, 0.3);
    margin-bottom: 18px;
    text-transform: uppercase;
}

/* LETRAS GGH CON EFECTO DE LÍNEAS RECORRIENDO */
.ggh-wrapper {
    position: relative;
    display: inline-block;
    margin: 10px 0 8px;
}

.ggh-letters {
    font-family: Arial, Helvetica, sans-serif;
    font-size: 3.3rem;
    font-weight: 900;
    letter-spacing: 14px;
    background: linear-gradient(135deg, #d0ecff 0%, #70b0e0 100%);
    -webkit-background-clip: text;
    background-clip: text;
    color: transparent;
    position: relative;
    display: inline-block;
    text-shadow: 0 0 4px rgba(0, 150, 230, 0.4);
}

/* Líneas verticales que recorren cada letra */
.scan-lines-over-ggh {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    pointer-events: none;
    overflow: hidden;
}

.letter-line {
    position: absolute;
    background: rgba(0, 210, 255, 0.6);
    width: 2px;
    height: 100%;
    top: 0;
    animation: moveVerticalLineRect 2.5s ease-in-out infinite;
    opacity: 0.7;
}

.letter-line:nth-child(1) { left: 12%; animation-delay: 0s; }
.letter-line:nth-child(2) { left: 38%; animation-delay: 0.55s; }
.letter-line:nth-child(3) { left: 62%; animation-delay: 1.1s; }
.letter-line:nth-child(4) { left: 86%; animation-delay: 1.65s; }

@keyframes moveVerticalLineRect {
    0% { top: -20%; height: 0%; opacity: 0; }
    20% { opacity: 0.8; height: 40%; }
    50% { opacity: 0.9; height: 100%; top: 0%; }
    80% { opacity: 0.5; height: 30%; top: 70%; }
    100% { top: 110%; height: 0%; opacity: 0; }
}

/* Línea horizontal que barre GGH */
.horizontal-scan {
    position: absolute;
    bottom: -10px;
    left: 0;
    width: 100%;
    height: 2px;
    background: linear-gradient(90deg, transparent, #40c0ff, #a0e0ff, #40c0ff, transparent);
    animation: hScanMoveRect 3s ease-in-out infinite;
    opacity: 0.6;
}

@keyframes hScanMoveRect {
    0% { width: 0%; left: 50%; opacity: 0; }
    20% { width: 30%; left: 35%; opacity: 0.7; }
    50% { width: 100%; left: 0%; opacity: 0.9; }
    80% { width: 30%; left: 35%; opacity: 0.6; }
    100% { width: 0%; left: 50%; opacity: 0; }
}

/* Esquinas decorativas */
.corner-brackets {
    position: absolute;
    width: 100%;
    height: 100%;
    top: 0;
    left: 0;
    pointer-events: none;
}
.corner-brackets::before,
.corner-brackets::after {
    content: '';
    position: absolute;
    width: 20px;
    height: 20px;
    border-color: #40b0e0;
    border-style: solid;
    border-width: 0;
}
.corner-brackets::before {
    top: -8px;
    left: -8px;
    border-top-width: 2px;
    border-left-width: 2px;
}
.corner-brackets::after {
    bottom: -8px;
    right: -8px;
    border-bottom-width: 2px;
    border-right-width: 2px;
}

/* Inputs estilo GGH */
.input-group-login {
    background: rgba(2, 8, 18, 0.7);
    border: 1px solid rgba(0, 140, 200, 0.5);
    padding: 6px 16px;
    display: flex;
    align-items: center;
    gap: 14px;
    transition: all 0.2s ease;
    margin-bottom: 22px;
    backdrop-filter: blur(4px);
    border-radius: 0;
}

.input-group-login:focus-within {
    border-color: rgba(0, 190, 240, 0.8);
    box-shadow: 0 0 10px rgba(0, 130, 210, 0.25);
    background: rgba(6, 14, 28, 0.9);
}

.input-icon {
    width: 44px;
    height: 44px;
    background: rgba(0, 30, 50, 0.6);
    border: 1px solid rgba(0, 150, 210, 0.5);
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 0;
}

.input-icon svg {
    width: 20px;
    height: 20px;
    color: #7abfdf;
    stroke-width: 1.5;
}

.input-content {
    flex: 1;
}

.input-group-login label {
    display: block;
    color: #8ac4e8;
    font-size: 0.55rem;
    font-weight: 600;
    letter-spacing: 2px;
    text-transform: uppercase;
    margin-bottom: 5px;
}

.input-group-login input {
    width: 100%;
    border: none;
    outline: none;
    background: transparent;
    color: #cde5f5;
    font-family: Arial, Helvetica, sans-serif;
    font-size: 0.85rem;
    padding: 0;
}

.input-group-login input::placeholder {
    color: rgba(100, 160, 200, 0.5);
    font-size: 0.68rem;
}

/* Botón GGH */
.sign {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 18px;
    width: 100%;
    background: linear-gradient(95deg, #0e3a55 0%, #1e6085 100%);
    padding: 13px;
    color: #e0f0ff;
    border: 1px solid rgba(0, 160, 220, 0.6);
    font-family: Arial, Helvetica, sans-serif;
    font-weight: 600;
    font-size: 0.8rem;
    letter-spacing: 3.5px;
    text-transform: uppercase;
    cursor: pointer;
    margin-top: 22px;
    transition: 0.2s;
    border-radius: 0;
    box-shadow: 0 4px 12px rgba(0, 60, 100, 0.3);
    position: relative;
    overflow: hidden;
}

.sign::before {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.1), transparent);
    transition: left 0.45s ease;
}

.sign:hover::before {
    left: 100%;
}

.sign:hover {
    background: linear-gradient(95deg, #124a68, #2878a8);
    transform: translateY(-1px);
    box-shadow: 0 6px 14px rgba(0, 80, 130, 0.35);
}

/* Separadores */
.social-message {
    display: flex;
    align-items: center;
    padding-top: 28px;
    margin-bottom: 20px;
}

.line {
    height: 1px;
    flex: 1;
    background: linear-gradient(90deg, transparent, #3e8eb0, transparent);
}

.social-message .message {
    padding: 0 16px;
    font-size: 0.55rem;
    color: #6ea5c9;
    letter-spacing: 2.2px;
    text-transform: uppercase;
}

.credentials-info {
    background: rgba(0, 15, 30, 0.6);
    padding: 14px;
    border-left: 3px solid #4f9fcf;
    border-radius: 0;
    backdrop-filter: blur(4px);
    text-align: center;
}

.credentials-info p {
    font-size: 0.6rem;
    color: #9bc2df;
    margin: 5px 0;
    letter-spacing: 0.6px;
}

.credentials-info strong {
    color: #b3d9ff;
}

.error-message {
    background: rgba(0, 120, 180, 0.12);
    color: #9acff5;
    padding: 10px;
    margin-bottom: 22px;
    font-size: 11px;
    text-align: center;
    display: none;
    border: 1px solid rgba(0, 150, 210, 0.5);
    border-radius: 0;
    backdrop-filter: blur(4px);
}

/* Loader */
.loader-container {
    display: flex;
    justify-content: center;
    align-items: center;
    min-height: 400px;
    width: 100%;
}
.loader {
    width: fit-content;
    height: fit-content;
    display: flex;
    align-items: center;
    justify-content: center;
}
.truckWrapper {
    width: 200px;
    height: 100px;
    display: flex;
    flex-direction: column;
    position: relative;
    align-items: center;
    justify-content: flex-end;
    overflow-x: hidden;
}
.truckBody {
    width: 130px;
    height: fit-content;
    margin-bottom: 6px;
    animation: motion 1s linear infinite;
}
@keyframes motion {
    0% { transform: translateY(0px); }
    50% { transform: translateY(3px); }
    100% { transform: translateY(0px); }
}
.truckTires {
    width: 130px;
    height: fit-content;
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0px 10px 0px 15px;
    position: absolute;
    bottom: 0;
}
.truckTires svg { width: 24px; }
.road {
    width: 100%;
    height: 1.5px;
    background-color: #1c6e9e;
    position: relative;
    bottom: 0;
    align-self: flex-end;
    border-radius: 0;
}
.road::before {
    content: "";
    position: absolute;
    width: 20px;
    height: 100%;
    background-color: #1c6e9e;
    right: -50%;
    border-radius: 0;
    animation: roadAnimation 1.4s linear infinite;
    border-left: 10px solid #eef2f8;
}
.road::after {
    content: "";
    position: absolute;
    width: 10px;
    height: 100%;
    background-color: #1c6e9e;
    right: -65%;
    border-radius: 0;
    animation: roadAnimation 1.4s linear infinite;
    border-left: 4px solid #eef2f8;
}
.lampPost {
    position: absolute;
    bottom: 0;
    right: -90%;
    height: 90px;
    animation: roadAnimation 1.4s linear infinite;
}
@keyframes roadAnimation {
    0% { transform: translateX(0px); }
    100% { transform: translateX(-350px); }
}
.trucksvg path:first-child { stroke: #0a4b6e; fill: #1c6e9e; }
.trucksvg path:nth-child(2) { stroke: #0a4b6e; fill: #2c7cb0; }
.trucksvg path:nth-child(3) { stroke: #0a4b6e; fill: #0a4b6e; }
.tiresvg circle:first-child { stroke: #0a4b6e; fill: #0a4b6e; }
.lampPost path { fill: #1c6e9e; }

/* Dashboard - Fondo sólido claro, TODO CUADRADO */
/* La estructura del tablero (barra lateral + contenido) vive en app.css,
   compartida con Órdenes de Compra. Acá solo queda el arranque oculto: el
   tablero recién aparece cuando el login pasa, y ahí el JS le pone
   display:flex por estilo en línea. */
#mainScreen { display: none; }
.app-header {
    background: var(--surface);
    padding: 15px 25px;
    margin-bottom: 20px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    box-shadow: 0 2px 8px rgba(0,0,0,0.08);
    border: 1px solid var(--line);
    border-radius: 0;
}
.app-header h1 {
    color: var(--text);
    font-size: 1.5rem;
    font-weight: 600;
}
/* --- Barra de acciones del encabezado -----------------------------------
   Antes eran cuatro botones de colores distintos y tamaño grande, que se
   partían en dos filas. Ahora comparten una sola forma compacta y el color
   queda solo como marca fina a la izquierda, para distinguirlos sin gritar. */
/* Los botones caben en una fila: lo que los empujaba abajo era el título, que
   se partía en dos líneas y se comía el ancho. Con el título en una línea la
   barra entra completa, y si la ventana se angosta de verdad, recién ahí baja. */
.header-actions { display: flex; gap: 6px; align-items: center; flex-wrap: wrap; justify-content: flex-end; flex: 1; }
.user-info { display: flex; gap: 6px; align-items: center; flex-shrink: 0; }
.app-header { gap: var(--sp-4); }
.app-header h1 { white-space: nowrap; flex-shrink: 0; }

.btn-oc, .btn-graficos, .btn-excel, .btn-pdf, .logout-btn, .btn-tema {
    background: var(--surface-3);
    color: var(--text);
    border: 1px solid var(--line-strong);
    border-left-width: 3px;
    font-family: Arial, Helvetica, sans-serif;
    font-weight: 600;
    letter-spacing: .04em;
    line-height: 1.5;
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    gap: 6px;
    white-space: nowrap;   /* si no, "Órdenes de Compra" parte en dos y sube la barra */
    transition: background .15s, border-color .15s, color .15s;
}
.btn-oc      { border-left-color: #7a5cc4; }
.btn-graficos{ border-left-color: var(--ok); }
.btn-excel   { border-left-color: var(--accent); }
.btn-pdf     { border-left-color: var(--bad); }
.logout-btn  { border-left-color: var(--bad); }
.btn-tema    { border-left-color: var(--line-strong); }

.btn-oc:hover      { background: #7a5cc4; border-color: #7a5cc4; color: #fff; }
.btn-graficos:hover{ background: var(--ok); border-color: var(--ok); color: #fff; }
.btn-excel:hover   { background: var(--accent); border-color: var(--accent); color: #fff; }
.btn-pdf:hover,
.logout-btn:hover  { background: var(--bad); border-color: var(--bad); color: #fff; }
.btn-tema:hover    { background: var(--accent); border-color: var(--accent); color: #fff; }

/* El usuario es un dato, no un botón: va como texto y no como bloque de color */
.user-badge {
    color: var(--text-dim);
    font-size: .72rem;
    letter-spacing: .03em;
    padding: 5px 10px;
    border: 1px solid var(--line);
    background: transparent;
}




.stats {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 20px;
    margin-bottom: 20px;
}
.card {
    background: var(--surface);
    padding: 20px;
    text-align: center;
    cursor: pointer;
    box-shadow: 0 2px 5px rgba(0,0,0,0.05);
    border: 1px solid var(--line);
    border-radius: 0;
    transition: all 0.3s ease;
}
/* El realce de las tarjetas y sus barras de color laterales los define ahora
   app.css, junto con el ícono de cada una. */
.card-title { font-size: 14px; color: var(--text-dim); margin-bottom: 10px; font-weight: 600; }
.card-value { font-size: 32px; font-weight: bold; color: var(--text); }
.card-sub { font-size: 12px; color: var(--text-faint); margin-top: 5px; }
.filters {
    background: var(--surface);
    padding: 20px;
    margin-bottom: 20px;
    border: 1px solid var(--line);
    border-radius: 0;
}
.filters-row {
    display: flex;
    flex-wrap: wrap;
    gap: 15px;
    align-items: flex-end;
    justify-content: flex-start;
}
.filter-group {
    display: flex;
    flex-direction: column;
    gap: 5px;
    flex: 1;
    min-width: 140px;
}
.filter-group label { font-size: 12px; color: var(--text-dim); font-weight: 600; }
input, select {
    padding: 8px 12px;
    border: 1px solid var(--line-strong);
    font-size: 13px;
    width: 100%;
    background: var(--surface);
    border-radius: 0;
    transition: all 0.3s ease;
}
input:focus, select:focus {
    outline: none;
    border-color: var(--accent);
    box-shadow: 0 0 0 3px rgba(28,110,158,0.1);
}
.filter-buttons { display: flex; gap: 10px; flex-shrink: 0; }
/* Un solo tamaño de botón para toda la pantalla. Las clases de más abajo
   cambian el color, nunca el porte. */
button {
    background: var(--accent);
    color: #fff;
    border: none;
    padding: 6px 14px;
    font-family: Arial, Helvetica, sans-serif;
    font-size: .78rem;
    font-weight: 600;
    line-height: 1.5;
    white-space: nowrap;   /* si no, "Rechazar" se parte en dos líneas */
    cursor: pointer;
    transition: background .2s ease, border-color .2s ease, color .2s ease;
}
button:hover { filter: brightness(1.15); }
.refresh-btn { background: var(--ok); }
.refresh-btn:hover { background: var(--ok); }
.filter-info {
    margin-top: 15px;
    padding-top: 15px;
    border-top: 1px solid var(--line);
    font-size: 12px;
    color: var(--text-dim);
    text-align: center;
}
.table-container {
    background: var(--surface);
    overflow: auto;
    max-height: 550px;
    border: 1px solid var(--line);
    border-radius: 0;
}
table {
    width: 100%;
    border-collapse: collapse;
    font-size: 13px;
    table-layout: fixed;
}
th {
    background: var(--surface-2);
    padding: 12px;
    text-align: left;
    border-bottom: 1px solid var(--line);
    position: sticky;
    top: 0;
    z-index: 2;              /* si no, las filas se pintan por encima al desplazar */
    font-weight: 600;
    color: var(--text);
    white-space: nowrap;     /* "Fecha Entrega" en una línea, no en dos */
}
td { padding: 10px 12px; border-bottom: 1px solid var(--bg); text-align: left; }
/* Con table-layout:fixed y sin anchos, las 10 columnas salían todas al 10%:
   Empresa y N° Guía sobraban de ancho y Cliente y Dirección quedaban apretadas. */
.table-container th:nth-child(1),
.table-container td:nth-child(1) { width: 6%; }    /* Empresa */
/* El nombre de la empresa es dato de contexto, no el principal de la fila */
.table-container td:nth-child(1) { font-size: 11px; }
.table-container th:nth-child(2),
.table-container td:nth-child(2) { width: 6%; }    /* N° Guía */
.table-container th:nth-child(3),
.table-container td:nth-child(3) { width: 19%; }   /* Cliente */
.table-container th:nth-child(4),
.table-container td:nth-child(4) { width: 20%; }   /* Dirección */
.table-container th:nth-child(5),
.table-container td:nth-child(5) { width: 8%; }    /* Fecha Entrega */
.table-container th:nth-child(6),
.table-container td:nth-child(6) { width: 9%; }    /* Chofer */
.table-container th:nth-child(7),
.table-container td:nth-child(7) { width: 8%; }    /* Estado */
.table-container th:nth-child(8),
.table-container td:nth-child(8) { width: 9%; }    /* Total Neto */
.table-container th:nth-child(9),
.table-container td:nth-child(9) { width: 5%; }    /* Imagen */
.table-container th:nth-child(10),
.table-container td:nth-child(10){ width: 10%; }   /* Acciones */
tr { transition: background 0.2s ease; }
tr:hover { background: var(--surface-2); }
.badge-pendiente {
    background: var(--warn-tint);
    color: var(--warn);
    padding: 4px 8px;
    font-size: 11px;
    font-weight: 600;
    display: inline-block;
    border-radius: 0;
}
.badge-entregado {
    background: var(--ok-tint);
    color: var(--ok);
    padding: 4px 8px;
    font-size: 11px;
    font-weight: 600;
    display: inline-block;
    border-radius: 0;
}
.badge-rechazada {
    background: var(--bad);
    color: var(--surface);
    padding: 2px 8px;
    font-size: 10px;
    margin-left: 5px;
    cursor: pointer;
    display: inline-block;
    border-radius: 0;
    transition: all 0.2s ease;
}
.badge-rechazada:hover {
    background: var(--bad);
    transform: scale(1.05);
}
.chofer-click {
    cursor: pointer;
    color: var(--accent);
    text-decoration: underline;
    text-decoration-style: dotted;
    font-weight: 500;
    transition: all 0.2s ease;
}
.chofer-click:hover {
    color: var(--accent);
    text-decoration-style: solid;
}
.loading { text-align: center; padding: 40px; color: var(--text-faint); }

.direccion-cell {
    max-width: 320px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    position: relative;
    cursor: pointer;
}
.direccion-cell[data-full-text]::after {
    content: attr(data-full-text);
    position: fixed;
    background: var(--text);
    color: var(--surface);
    padding: 8px 12px;
    border-radius: 0;
    font-size: 12px;
    white-space: normal;
    word-break: break-word;
    max-width: 400px;
    z-index: 1000;
    display: none;
    box-shadow: 0 5px 15px rgba(0,0,0,0.2);
    pointer-events: none;
}
.direccion-cell:hover::after { display: block; animation: fadeIn 0.2s ease; }
@keyframes fadeIn {
    from { opacity: 0; transform: translateY(-5px); }
    to { opacity: 1; transform: translateY(0); }
}

.modal-graficos {
    display: none;
    position: fixed;
    z-index: 1000;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0,0,0,0.6);
    animation: fadeInModal 0.3s ease;
}
@keyframes fadeInModal {
    from { opacity: 0; }
    to { opacity: 1; }
}
.modal-graficos-content {
    background-color: var(--surface);
    margin: 2% auto;
    padding: 24px;
    width: 95%;
    max-width: 1400px;
    border: 1px solid var(--line);
    border-radius: 0;
    max-height: 95vh;
    overflow-y: auto;
    animation: slideUp 0.3s ease;
}
@keyframes slideUp {
    from { transform: translateY(50px); opacity: 0; }
    to { transform: translateY(0); opacity: 1; }
}
.modal-graficos-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    border-bottom: 1px solid var(--line);
    padding-bottom: 12px;
    margin-bottom: 20px;
}
.modal-graficos-header h2 { font-size: 20px; color: var(--text); }
.close-graficos {
    font-size: 28px;
    font-weight: bold;
    cursor: pointer;
    color: var(--text-faint);
    transition: all 0.2s ease;
}
.close-graficos:hover {
    color: var(--text);
    transform: scale(1.1);
}
.graficos-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 25px;
}
.grafico-card {
    background: var(--surface-2);
    border: 1px solid var(--line);
    padding: 20px;
    border-radius: 0;
    display: flex;
    flex-direction: column;
    transition: all 0.3s ease;
}
.grafico-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 10px 25px rgba(0,0,0,0.1);
}
.grafico-card h3 {
    font-size: 16px;
    color: var(--text);
    margin-bottom: 15px;
    text-align: center;
}
.grafico-card canvas { max-height: 280px; width: 100%; transition: all 0.3s ease; }
@media (max-width: 1200px) {
    .stats { grid-template-columns: repeat(2, 1fr); }
    .graficos-grid { grid-template-columns: repeat(2, 1fr); }
}
@media (max-width: 768px) {
    .stats { grid-template-columns: 1fr; }
    .graficos-grid { grid-template-columns: 1fr; }
    .filters-row { flex-direction: column; align-items: stretch; }
    .filter-group { width: 100%; }
    .filter-buttons { width: 100%; }
    .filter-buttons button { flex: 1; }
    .login-container { margin: 20px; }
    .header-actions { flex-direction: column; gap: 8px; }
    .app-header { flex-direction: column; gap: 15px; text-align: center; }
    .form-content { padding: 30px 24px; }
    .main-title { font-size: 1.2rem; letter-spacing: 2px; }
    .ggh-letters { font-size: 2.2rem; letter-spacing: 8px; }
    .table-container { overflow-x: auto; -webkit-overflow-scrolling: touch; }
    table { min-width: 820px; font-size: 11px; }
    th, td { padding: 8px 6px; white-space: normal; word-break: break-word; }
}

.modal {
    display: none;
    position: fixed;
    z-index: 1000;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0,0,0,0.5);
    animation: fadeInModal 0.3s ease;
}
.modal-content {
    background-color: var(--surface);
    margin: 8% auto;
    padding: 24px;
    width: 90%;
    max-width: 500px;
    border: 1px solid var(--line);
    border-radius: 0;
    animation: slideUp 0.3s ease;
}
.modal-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    border-bottom: 1px solid var(--line);
    padding-bottom: 12px;
    margin-bottom: 20px;
}
.modal-body .input-group { margin-bottom: 15px; }
.modal-body label {
    display: block;
    margin-bottom: 5px;
    font-size: 13px;
    color: var(--text-dim);
    font-weight: 500;
}
.modal-body input, .modal-body select {
    width: 100%;
    padding: 8px;
    border: 1px solid var(--line-strong);
    border-radius: 0;
}
.modal-footer {
    margin-top: 20px;
    text-align: right;
}
.btn-guardar { background: var(--ok); margin-left: 10px; border-radius: 0; }
.btn-cancelar { background: var(--text-dim); border-radius: 0; }
.close-modal {
    font-size: 28px;
    font-weight: bold;
    cursor: pointer;
    color: var(--text-faint);
    transition: all 0.2s ease;
}
.close-modal:hover {
    color: var(--text);
    transform: scale(1.1);
}

@keyframes chartPop {
    from { transform: scale(0.95); opacity: 0; }
    to { transform: scale(1); opacity: 1; }
}
canvas { animation: chartPop 0.5s ease; }

.modal-confirmacion {
    display: none;
    position: fixed;
    z-index: 2000;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.6);
    backdrop-filter: blur(3px);
    animation: fadeInModal 0.3s ease;
}
.modal-confirmacion-content {
    background: var(--surface);
    margin: 15% auto;
    width: 90%;
    max-width: 420px;
    border: 1px solid var(--line);
    border-radius: 0;
    box-shadow: 0 25px 45px -12px rgba(0, 0, 0, 0.3);
    animation: slideUp 0.3s ease;
    position: relative;
    overflow: hidden;
}
.modal-confirmacion-content::before {
    content: "";
    display: block;
    height: 4px;
    background: linear-gradient(90deg, var(--bad) 0%, var(--bad) 50%, var(--bad) 100%);
}
.modal-confirmacion-header {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 24px 24px 16px 24px;
    border-bottom: 1px solid var(--line);
}
.modal-confirmacion-icon {
    width: 48px;
    height: 48px;
    background: var(--bad-tint);
    border-radius: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}
.modal-confirmacion-icon svg { width: 28px; height: 28px; color: var(--bad); }
.modal-confirmacion-header h2 {
    font-size: 1.3rem;
    color: var(--text);
    font-weight: 600;
    margin: 0;
}
.modal-confirmacion-body {
    padding: 20px 24px;
    color: var(--text-dim);
    font-size: 0.9rem;
    line-height: 1.5;
}
.modal-confirmacion-body p { margin: 8px 0; }
.modal-confirmacion-body .user-highlight {
    background: var(--surface-3);
    padding: 8px 12px;
    margin: 12px 0;
    font-weight: 500;
    color: var(--accent);
    border-left: 3px solid var(--accent);
    font-size: 0.85rem;
    border-radius: 0;
}
.modal-confirmacion-footer {
    display: flex;
    gap: 12px;
    padding: 16px 24px 24px;
    border-top: 1px solid var(--line);
    justify-content: flex-end;
}
.btn-confirmar {
    background: var(--bad);
    color: var(--surface);
    border: none;
    cursor: pointer;
    font-weight: 600;
    letter-spacing: 0.5px;
    text-transform: uppercase;
    transition: all 0.3s ease;
    border-radius: 0;
}
.btn-confirmar:hover {
    background: var(--bad);
    transform: translateY(-2px);
    box-shadow: 0 5px 15px rgba(220, 53, 69, 0.3);
}
.btn-cancelar-confirmacion {
    background: var(--text-dim);
    color: var(--surface);
    border: none;
    cursor: pointer;
    font-weight: 600;
    letter-spacing: 0.5px;
    text-transform: uppercase;
    transition: all 0.3s ease;
    border-radius: 0;
}
.btn-cancelar-confirmacion:hover {
    background: #475569;
    transform: translateY(-2px);
}

/* Modal motivacional */
.modal-motivacion {
    display: none;
    position: fixed;
    z-index: 3000;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.7);
    backdrop-filter: blur(5px);
    animation: fadeInModal 0.3s ease;
    justify-content: center;
    align-items: center;
}
.modal-motivacion-content {
    background: linear-gradient(135deg, var(--bad-tint) 0%, var(--surface) 100%);
    margin: auto;
    width: 90%;
    max-width: 500px;
    border: 2px solid var(--bad);
    box-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.3);
    animation: slideUp 0.4s cubic-bezier(0.34, 1.56, 0.64, 1);
    position: relative;
    text-align: center;
    padding: 40px 30px;
    border-radius: 0;
}
/* Rosa que se traza sola: cada path parte oculto con el guion del largo de su
   propia línea y se va descubriendo. Los largos y los tiempos los pone
   dibujarRosa() en el JS, porque dependen de cuánto mide cada trazo. */
.rosa-dibujo {
    width: 62px;
    height: 81px;
    display: block;
    margin: 0 auto 2px auto;
}
.rosa-dibujo path {
    fill: none;
    stroke-width: 2.2;
    stroke-linecap: round;
    stroke-linejoin: round;
    transition: stroke-dashoffset 0.7s ease-in-out;
}
.rosa-dibujo .flor { stroke: #e0245e; }
.rosa-dibujo .hoja { stroke: #2f9e44; }
.motivacion-mensaje {
    font-size: 1.5rem;
    font-weight: 700;
    color: var(--warn);
    margin: 20px 0 25px 0;
    line-height: 1.4;
}
.btn-cerrar-motivacion {
    background: linear-gradient(135deg, var(--bad) 0%, var(--warn) 100%);
    color: var(--surface);
    border: none;
    font-weight: 600;
    cursor: pointer;
    border-radius: 0;
    transition: all 0.3s ease;
    margin-top: 10px;
    letter-spacing: 1px;
}
.btn-cerrar-motivacion:hover {
    transform: translateY(-2px);
    box-shadow: 0 10px 25px rgba(230, 126, 34, 0.3);
}
/* Modal motivo rechazo profesional */
.modal-motivo {
    display: none;
    position: fixed;
    z-index: 2000;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0,0,0,0.6);
    backdrop-filter: blur(4px);
    animation: fadeInModal 0.3s ease;
}
.modal-motivo-content {
    background: var(--surface);
    margin: 8% auto;
    width: 90%;
    max-width: 550px;
    border-radius: 0;
    animation: slideUp 0.3s ease;
    box-shadow: 0 25px 50px -12px rgba(0,0,0,0.3);
    overflow: hidden;
}
.modal-motivo-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 20px 24px;
    background: linear-gradient(135deg, var(--bad-tint) 0%, var(--bad-tint) 100%);
    border-bottom: 1px solid var(--bad-tint);
}
.modal-motivo-header h2 {
    margin: 0;
    color: var(--bad);
    font-size: 1.4rem;
    font-weight: 600;
    display: flex;
    align-items: center;
    gap: 10px;
}
.modal-motivo-header h2::before { content: "🚫"; font-size: 1.4rem; }
.close-motivo {
    font-size: 28px;
    font-weight: bold;
    cursor: pointer;
    color: var(--text-faint);
    transition: all 0.2s ease;
    width: 32px;
    height: 32px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 0;
}
.close-motivo:hover {
    color: var(--bad);
    background: rgba(220,53,69,0.1);
    transform: rotate(90deg);
}
.modal-motivo-body { padding: 24px; }
.info-card {
    background: var(--surface-2);
    border-radius: 0;
    padding: 16px;
    margin-bottom: 20px;
    border-left: 4px solid var(--bad);
}
.info-row { display: flex; margin-bottom: 10px; font-size: 14px; }
.info-label { font-weight: 600; color: var(--text-dim); width: 100px; flex-shrink: 0; }
.info-value { color: var(--text); word-break: break-word; }
.input-group-motivo { margin: 20px 0; }
.input-group-motivo label {
    display: block;
    margin-bottom: 8px;
    font-weight: 600;
    color: var(--text);
}
.input-group-motivo textarea {
    width: 100%;
    padding: 12px;
    border: 1px solid var(--line);
    font-family: Arial, Helvetica, sans-serif;
    font-size: 14px;
    resize: vertical;
    border-radius: 0;
    transition: all 0.2s ease;
}
.input-group-motivo textarea:focus {
    outline: none;
    border-color: var(--bad);
    box-shadow: 0 0 0 3px rgba(220,53,69,0.1);
}
.info-nota {
    background: var(--warn-tint);
    padding: 12px;
    margin-top: 15px;
    border-radius: 0;
    border-left: 3px solid var(--warn);
    font-size: 12px;
    color: #856404;
}
.modal-motivo-footer {
    padding: 16px 24px 24px;
    border-top: 1px solid var(--line);
    display: flex;
    justify-content: flex-end;
    gap: 12px;
}
.btn-cancelar-motivo {
    background: var(--text-faint);
    color: var(--surface);
    border: none;
    cursor: pointer;
    font-weight: 500;
    border-radius: 0;
    transition: all 0.3s ease;
}
.btn-cancelar-motivo:hover {
    background: var(--text-faint);
    transform: translateY(-2px);
}
.btn-confirmar-motivo {
    background: var(--bad);
    color: var(--surface);
    border: none;
    cursor: pointer;
    font-weight: 500;
    border-radius: 0;
    transition: all 0.3s ease;
}
.btn-confirmar-motivo:hover {
    background: var(--bad);
    transform: translateY(-2px);
    box-shadow: 0 5px 15px rgba(220,53,69,0.3);
}

/* Modal ver motivo profesional */
.modal-ver-motivo {
    display: none;
    position: fixed;
    z-index: 2000;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0,0,0,0.6);
    backdrop-filter: blur(4px);
    animation: fadeInModal 0.3s ease;
}
.modal-ver-motivo-content {
    background: var(--surface);
    margin: 10% auto;
    width: 90%;
    max-width: 500px;
    border-radius: 0;
    animation: slideUp 0.3s ease;
    box-shadow: 0 25px 50px -12px rgba(0,0,0,0.3);
    overflow: hidden;
}
.modal-ver-motivo-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 20px 24px;
    background: linear-gradient(135deg, var(--bad-tint) 0%, var(--bad-tint) 100%);
    border-bottom: 1px solid var(--bad-tint);
}
.modal-ver-motivo-header h2 {
    margin: 0;
    color: var(--bad);
    font-size: 1.4rem;
    font-weight: 600;
    display: flex;
    align-items: center;
    gap: 10px;
}
.modal-ver-motivo-header h2::before { content: "📋"; font-size: 1.4rem; }
.close-ver-motivo {
    font-size: 28px;
    font-weight: bold;
    cursor: pointer;
    color: var(--text-faint);
    transition: all 0.2s ease;
    width: 32px;
    height: 32px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 0;
}
.close-ver-motivo:hover {
    color: var(--bad);
    background: rgba(220,53,69,0.1);
    transform: rotate(90deg);
}
.modal-ver-motivo-body { padding: 24px; }
.motivo-detail-card {
    background: var(--surface-2);
    border-radius: 0;
    padding: 20px;
}
.motivo-field { margin-bottom: 16px; display: flex; flex-direction: column; gap: 6px; }
.motivo-field .label {
    font-size: 12px;
    font-weight: 600;
    color: var(--text-faint);
    text-transform: uppercase;
    letter-spacing: 0.5px;
}
.motivo-field .value {
    font-size: 15px;
    color: var(--text);
    font-weight: 500;
    padding: 8px 12px;
    background: var(--surface);
    border: 1px solid var(--line);
}
.motivo-field .value.motivo-text {
    background: var(--bad-tint);
    border-left: 3px solid var(--bad);
    font-weight: normal;
}
.motivo-divider {
    height: 1px;
    background: linear-gradient(90deg, transparent, var(--line), transparent);
    margin: 16px 0;
}
.modal-ver-motivo-footer {
    padding: 16px 24px 24px;
    border-top: 1px solid var(--line);
    display: flex;
    justify-content: flex-end;
}
.btn-cerrar-ver-motivo {
    background: var(--text-faint);
    color: var(--surface);
    border: none;
    cursor: pointer;
    font-weight: 500;
    border-radius: 0;
    transition: all 0.3s ease;
}
.btn-cerrar-ver-motivo:hover {
    background: var(--text-faint);
    transform: translateY(-2px);
}

/* Modal desmarcar profesional */
.modal-desmarcar {
    display: none;
    position: fixed;
    z-index: 2000;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0,0,0,0.6);
    backdrop-filter: blur(4px);
    animation: fadeInModal 0.3s ease;
}
.modal-desmarcar-content {
    background: var(--surface);
    margin: 15% auto;
    width: 90%;
    max-width: 420px;
    border-radius: 0;
    animation: slideUp 0.3s ease;
    box-shadow: 0 25px 50px -12px rgba(0,0,0,0.3);
    overflow: hidden;
}
.modal-desmarcar-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 20px 24px;
    background: linear-gradient(135deg, var(--ok-tint) 0%, #c8e6c9 100%);
    border-bottom: 1px solid #a5d6a7;
}
.modal-desmarcar-header h2 {
    margin: 0;
    color: var(--ok);
    font-size: 1.4rem;
    font-weight: 600;
    display: flex;
    align-items: center;
    gap: 10px;
}
.modal-desmarcar-header h2::before { content: "✓"; font-size: 1.6rem; font-weight: bold; }
.close-desmarcar {
    font-size: 28px;
    font-weight: bold;
    cursor: pointer;
    color: var(--text-faint);
    transition: all 0.2s ease;
    width: 32px;
    height: 32px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 0;
}
.close-desmarcar:hover {
    color: var(--ok);
    background: rgba(46,125,50,0.1);
    transform: rotate(90deg);
}
.modal-desmarcar-body { padding: 24px; text-align: center; }
.desmarcar-icon {
    width: 70px;
    height: 70px;
    background: var(--ok-tint);
    border-radius: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    margin: 0 auto 20px;
}
.desmarcar-icon svg { width: 40px; height: 40px; color: var(--ok); }
.desmarcar-message { font-size: 16px; color: var(--text-dim); margin-bottom: 10px; }
.desmarcar-folio {
    font-weight: 700;
    color: var(--ok);
    background: var(--ok-tint);
    padding: 6px 12px;
    border-radius: 0;
    display: inline-block;
    margin: 10px 0;
}
.modal-desmarcar-footer {
    padding: 16px 24px 24px;
    border-top: 1px solid var(--line);
    display: flex;
    justify-content: center;
    gap: 12px;
}
.btn-cancelar-desmarcar {
    background: var(--text-faint);
    color: var(--surface);
    border: none;
    cursor: pointer;
    font-weight: 500;
    border-radius: 0;
    transition: all 0.3s ease;
}
.btn-cancelar-desmarcar:hover {
    background: var(--text-faint);
    transform: translateY(-2px);
}
.btn-confirmar-desmarcar {
    background: var(--ok);
    color: var(--surface);
    border: none;
    cursor: pointer;
    font-weight: 500;
    border-radius: 0;
    transition: all 0.3s ease;
}
.btn-confirmar-desmarcar:hover {
    background: #1b5e20;
    transform: translateY(-2px);
    box-shadow: 0 5px 15px rgba(46,125,50,0.3);
}

.action-buttons { display: flex; gap: 5px; flex-wrap: wrap; }
.btn-desmarcar {
    background: #28a745;
    color: var(--surface);
    border: none;
    cursor: pointer;
    font-weight: 500;
    border-radius: 0;
    transition: all 0.3s ease;
}
.btn-desmarcar:hover {
    background: #218838;
    transform: translateY(-2px);
}
.btn-rechazar {
    background: var(--bad);
    color: var(--surface);
    border: none;
    cursor: pointer;
    font-weight: 500;
    border-radius: 0;
    transition: all 0.3s ease;
}
.btn-rechazar:hover {
    background: var(--bad);
    transform: translateY(-2px);
}
.btn-ver-motivo {
    background: var(--text-faint);
    color: var(--surface);
    border: none;
    cursor: pointer;
    font-weight: 500;
    border-radius: 0;
    transition: all 0.3s ease;
}
.btn-ver-motivo:hover {
    background: var(--text-faint);
    transform: translateY(-2px);
}

/* =====================================================================
   GRÁFICOS — cifras junto a cada gráfico y exportación
   ===================================================================== */
.graficos-acciones { display: flex; align-items: center; gap: var(--sp-4, 16px); }
.btn-excel-graficos {
    background: var(--ok, #27ae60);
    color: #fff;
    border: none;
    padding: 9px 16px;
    font-family: inherit;
    font-size: .82rem;
    font-weight: 600;
    cursor: pointer;
    white-space: nowrap;
}
.btn-excel-graficos:hover { filter: brightness(1.1); }

/* Cifras de cabecera: lo que antes había que deducir mirando la torta */
.graficos-kpis {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
    gap: 12px;
    margin-bottom: 18px;
}
.gk {
    background: var(--surface-2, #171c26);
    border: 1px solid var(--line-strong, #333c4d);
    border-top: 3px solid var(--accent, #1c6e9e);
    padding: 12px 14px;
}
.gk.ok   { border-top-color: #27ae60; }
.gk.bad  { border-top-color: #c0392b; }
.gk.warn { border-top-color: #e67e22; }
.gk-n { display: block; font-size: 1.5rem; font-weight: 700; font-variant-numeric: tabular-nums; }
.gk.ok .gk-n   { color: #27ae60; }
.gk.bad .gk-n  { color: #c0392b; }
.gk.warn .gk-n { color: #e67e22; }
.gk-t { display: block; margin-top: 4px; font-size: .74rem; line-height: 1.3; opacity: .85; }

/* Tabla de datos bajo cada gráfico */
.grafico-datos { margin-top: 12px; }
.tabla-mini { width: 100%; border-collapse: collapse; font-size: .78rem; }
.tabla-mini th {
    text-align: left;
    padding: 5px 6px;
    border-bottom: 1px solid var(--line-strong, #333c4d);
    font-size: .68rem;
    text-transform: uppercase;
    letter-spacing: .06em;
    opacity: .75;
}
.tabla-mini th:not(:first-child), .tabla-mini td:not(:first-child) { text-align: right; }
.tabla-mini td {
    padding: 5px 6px;
    border-bottom: 1px solid var(--line, #252c39);
    font-variant-numeric: tabular-nums;
}
.tabla-mini tr:last-child td { border-bottom: none; }
/* Punto de color que ata cada fila con su porción del gráfico */
.pt { display: inline-block; width: 9px; height: 9px; margin-right: 7px; vertical-align: middle; }
.pt.ok { background: #27ae60; } .pt.bad { background: #c0392b; } .pt.warn { background: #e67e22; }
.nota-mini { margin-top: 8px; font-size: .7rem; opacity: .65; }
.sin-datos { padding: 20px 0; text-align: center; font-size: .85rem; opacity: .7; }
/* Una tarjeta que ocupa toda la fila: para tablas anchas de comparación */
.grafico-card.ancho-total { grid-column: 1 / -1; }

/* Tabla de guías arrastradas: tiene más columnas que las demás tablas mini y
   con los encabezados en una sola línea "Chofer inicial" se salía de su celda. */
.tabla-arrastre th { white-space: normal; }
.tabla-arrastre td:nth-child(2) { max-width: 190px; }

/* =====================================================================
   MAPA DE CALOR POR COMUNA
   ===================================================================== */
.mapa-cabecera {
    display: flex;
    flex-wrap: wrap;
    gap: 12px;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 14px;
}
.mapa-cabecera h3 { margin: 0; }
.mapa-metricas { display: flex; gap: 6px; }
.mapa-btn {
    padding: 6px 12px;
    font-size: .74rem;
    font-weight: 600;
    color: var(--text-dim, #d3d9e2);
    background: transparent;
    border: 1px solid var(--line-strong, #333c4d);
    border-radius: 0;
    cursor: pointer;
    transition: all .15s ease;
}
.mapa-btn:hover { border-color: var(--accent, #2879ff); }
.mapa-btn.activa {
    color: #fff;
    background: var(--accent, #2879ff);
    border-color: var(--accent, #2879ff);
}
/* El mapa manda el alto; el panel lateral acompaña a la derecha y, cuando
   no hay ancho, se va abajo. */
.mapa-cuerpo {
    display: grid;
    grid-template-columns: minmax(0, 1.15fr) minmax(240px, .85fr);
    gap: 20px;
    align-items: start;
}
.mapa-lienzo { position: relative; }
.mapa-lienzo svg { display: block; width: 100%; height: auto; max-height: 620px; }
.mapa-lienzo path {
    stroke: var(--surface, #12161f);
    stroke-width: 1.1;
    stroke-linejoin: round;
    cursor: default;
    transition: opacity .12s ease;
}
/* Gris neutro y no un azul muy oscuro: sobre fondo noche, el tono más alto de
   la escala y "sin entregas" se confundían. */
.mapa-lienzo path.vacia { fill: #454b58; }
[data-tema="dia"] .mapa-lienzo path.vacia { fill: #dfe3e9; }
.mapa-lienzo path:hover { opacity: .75; stroke: var(--text, #fff); stroke-width: 1.6; }
/* Etiqueta flotante: los nombres no caben dibujados sobre las comunas chicas
   de Santiago, así que el detalle se muestra al pasar el mouse. */
/* Detalle de la comuna. Mismas clases que en el monitor de supervisores: el
   contenido lo arma el módulo compartido /js/mapa-comunas.js. */
.tip-titulo {
    font-weight: 700; font-size: .82rem; margin-bottom: 6px;
    padding-bottom: 5px; border-bottom: 1px solid var(--line-strong, #333c4d);
}
.tip-sub {
    margin: 7px 0 3px; font-size: .62rem; text-transform: uppercase;
    letter-spacing: .07em; color: var(--text-faint, #aab3c0);
}
.tip-fila {
    display: flex; justify-content: space-between; gap: 18px;
    line-height: 1.5; white-space: nowrap;
}
.tip-fila > span { color: var(--text-faint, #aab3c0); }
.tip-fila > b { font-variant-numeric: tabular-nums; }
.tip-fila.ok > b   { color: var(--verde, #27ae60); }
.tip-fila.warn > b { color: var(--naranjo, #e67e22); }
.tip-fila.bad > b  { color: var(--rojo, #c0392b); }

.mapa-tip {
    display: none;
    position: absolute;
    z-index: 5;
    max-width: 300px;
    padding: 9px 11px;
    font-size: .74rem;
    line-height: 1.35;
    color: var(--text, #fff);
    background: var(--surface, #12161f);
    border: 1px solid var(--line-strong, #333c4d);
    border-radius: 0;
    box-shadow: 0 6px 18px rgba(0, 0, 0, .35);
    pointer-events: none;
}
.mapa-lateral { display: flex; flex-direction: column; gap: 16px; }
.mapa-leyenda { font-size: .74rem; }
.leyenda-titulo {
    margin-bottom: 8px;
    font-size: .68rem;
    text-transform: uppercase;
    letter-spacing: .06em;
    opacity: .75;
}
.leyenda-fila { display: flex; align-items: center; gap: 8px; padding: 2px 0; }
.leyenda-fila i {
    width: 16px;
    height: 12px;
    border-radius: 0;
    flex: none;
}
.leyenda-fila i.vacia { background: #454b58; }
[data-tema="dia"] .leyenda-fila i.vacia { background: #dfe3e9; }

@media (max-width: 900px) {
    .mapa-cuerpo { grid-template-columns: 1fr; }
}
