/* =========================================================
   ATLAS - SITE.CSS LIMPIO
   Tema claro/oscuro, sidebar colapsable, UI compacta y fina
========================================================= */

/* ====== DESIGN TOKENS / THEME ====== */
:root {
    --atlas-bg: #f4f6f8;
    --atlas-surface: #ffffff;
    --atlas-surface-soft: #f8fafc;
    --atlas-ink: #0d1b2a;
    --atlas-muted: #6c757d;
    --atlas-brand: #0f4c75;
    --atlas-brand-light: #1b6ca8;
    --atlas-sidebar-bg-1: #0d1b2a;
    --atlas-sidebar-bg-2: #1a3550;
    --atlas-sidebar-text: #9fb3c8;
    --atlas-sidebar-active: #7bc8f6;
    --atlas-border: #e8edf2;
    --atlas-radius: 10px;
    --atlas-shadow: 0 4px 16px rgba(13,27,42,.08);
    --atlas-station-kpi: #1b6ca8;
    --atlas-station-button-bg: #0f172a;
    --atlas-station-button-hover: #172033;
    --atlas-station-button-border: #0f172a;
    --atlas-station-pill-bg: #0f172a;
    --atlas-station-pill-border: #0f172a;
}

html[data-theme="dark"] {
    --atlas-bg: #0b1220;
    --atlas-surface: #111827;
    --atlas-surface-soft: #172033;
    --atlas-ink: #e5e7eb;
    --atlas-muted: #9ca3af;
    --atlas-sidebar-bg-1: #020617;
    --atlas-sidebar-bg-2: #0f172a;
    --atlas-sidebar-text: #cbd5e1;
    --atlas-sidebar-active: #60c8f8;
    --atlas-border: #243244;
    --atlas-shadow: 0 4px 18px rgba(0,0,0,.35);
    --atlas-station-kpi: #3b82f6;
    --atlas-station-button-bg: #0f172a;
    --atlas-station-button-hover: #1e293b;
    --atlas-station-button-border: #334155;
    --atlas-station-pill-bg: #0f172a;
    --atlas-station-pill-border: #334155;
}

/* Evita brinco visual del sidebar al cambiar de pÃ¡gina */
html.sidebar-collapsed-start .sidebar-atlas {
    width: 70px;
    min-width: 70px;
    padding-left: 9px;
    padding-right: 9px;
}

html.sidebar-collapsed-start .sidebar-text,
html.sidebar-collapsed-start .sidebar-logo-text,
html.sidebar-collapsed-start .sidebar-role,
html.sidebar-collapsed-start .sidebar-section {
    display: none !important;
}

/* ====== GLOBAL ====== */
body {
    font-family: 'Outfit', sans-serif;
    background: var(--atlas-bg);
    color: var(--atlas-ink);
    transition: background .2s ease, color .2s ease;
}

a {
    color: var(--atlas-brand-light);
}

h1, h2, h3, h4, h5 {
    font-weight: 600;
    letter-spacing: -0.3px;
}

/* ====== LAYOUT ====== */
.layout-main {
    display: flex;
    min-height: 100vh;
    align-items: flex-start;
}

.content-atlas {
    flex: 1;
    background: var(--atlas-bg);
    color: var(--atlas-ink);
    padding: 25px;
    transition: background .2s ease, color .2s ease;
}

.atlas-workspace {
    flex: 1;
    min-width: 0;
}

.app-topbar {
    position: sticky;
    top: 0;
    z-index: 800;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 18px;
    min-height: 64px;
    padding: 12px 25px;
    background: color-mix(in srgb, var(--atlas-surface) 94%, transparent);
    border-bottom: 1px solid var(--atlas-border);
    box-shadow: 0 10px 24px rgba(15, 23, 42, .04);
    backdrop-filter: blur(10px);
}

.app-topbar-search {
    position: relative;
    display: flex;
    align-items: center;
    width: min(520px, 48vw);
}

.app-topbar-search i {
    position: absolute;
    left: 12px;
    color: var(--atlas-muted);
    font-size: 14px;
}

.app-topbar-search input {
    width: 100%;
    min-height: 38px;
    padding: 8px 12px 8px 36px;
    border: 1px solid var(--atlas-border);
    border-radius: 8px;
    font-size: 14px;
}

.app-topbar-actions {
    display: flex;
    align-items: center;
    gap: 10px;
    min-width: 0;
}

.app-topbar-icon,
.app-topbar-user {
    position: relative;
    min-height: 38px;
    border: 1px solid var(--atlas-border);
    border-radius: 8px;
    background: var(--atlas-surface);
    color: var(--atlas-ink);
    text-decoration: none;
}

.app-topbar-icon {
    display: inline-grid;
    width: 38px;
    place-items: center;
}

.app-topbar-user {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    max-width: 220px;
    padding: 0 12px;
    font-size: 13px;
    font-weight: 700;
}

.app-topbar-user span {
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.app-topbar-icon:hover,
.app-topbar-user:hover {
    border-color: var(--atlas-brand-light);
    color: var(--atlas-brand-light);
}

.app-topbar-dot {
    position: absolute;
    top: 9px;
    right: 9px;
    width: 7px;
    height: 7px;
    border-radius: 999px;
    background: #dc3545;
    border: 1px solid var(--atlas-surface);
}

.app-topbar-logout {
    color: #dc3545;
}

/* ====== SIDEBAR ====== */
.sidebar-atlas {
    position: sticky;
    top: 0;
    height: 100vh;
    width: 240px;
    min-width: 240px;
    background: linear-gradient(180deg, var(--atlas-sidebar-bg-1) 0%, var(--atlas-sidebar-bg-2) 100%);
    color: #fff;
    display: flex;
    flex-direction: column;
    padding: 18px 14px;
    z-index: 999;
    transition: width .25s ease, min-width .25s ease, padding .25s ease;
}

    .sidebar-atlas.collapsed {
        width: 70px;
        min-width: 70px;
        padding-left: 9px;
        padding-right: 9px;
    }

.sidebar-logo {
    display: flex;
    align-items: center;
    justify-content: space-between;
    font-weight: 700;
    font-size: 17px;
    margin-bottom: 18px;
    letter-spacing: -0.5px;
}

.sidebar-toggle {
    background: rgba(255,255,255,.03);
    border: 1px solid rgba(255,255,255,.22);
    color: #fff;
    width: 28px;
    height: 28px;
    border-radius: 7px;
    cursor: pointer;
    font-size: 16px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    transition: background .15s ease, border-color .15s ease;
}

    .sidebar-toggle:hover {
        background: rgba(255,255,255,.10);
        border-color: rgba(255,255,255,.35);
    }

.sidebar-menu {
    flex: 1 1 auto;
    min-height: 0;
    max-height: none;
    overflow-y: auto;
    padding-right: 2px;
}

.sidebar-section {
    margin: 13px 10px 6px;
    font-size: 10px;
    font-weight: 700;
    line-height: 1;
    text-transform: uppercase;
    letter-spacing: .1em;
    color: var(--atlas-sidebar-active);
}

.sidebar-link {
    position: relative;
    display: flex !important;
    align-items: center;
    gap: 11px;
    padding: 7px 11px;
    border-radius: 8px;
    color: var(--atlas-sidebar-text);
    text-decoration: none;
    font-size: 13px;
    line-height: 1.25;
    margin-bottom: 2px;
    transition: background .15s ease, color .15s ease, border .15s ease;
}

    .sidebar-link:hover {
        background: color-mix(in srgb, var(--atlas-brand-light) 18%, transparent);
        color: #ffffff;
    }

    .sidebar-link.active {
        background: linear-gradient(90deg, color-mix(in srgb, var(--atlas-brand-light) 30%, transparent), color-mix(in srgb, var(--atlas-brand-light) 12%, transparent));
        border: 1px solid color-mix(in srgb, var(--atlas-brand-light) 42%, transparent);
        color: #ffffff;
        box-shadow: inset 0 0 0 1px rgba(255,255,255,.05), 0 8px 20px rgba(0,0,0,.14);
        font-weight: 800;
    }

        .sidebar-link.active .sidebar-icon {
            color: var(--atlas-sidebar-active);
        }

        .sidebar-link.active::before,
        .sidebar-link:hover::before {
            content: "";
            position: absolute;
            left: -7px;
            top: 24%;
            height: 52%;
            width: 3px;
            background: var(--atlas-brand-light);
            border-radius: 999px;
        }

.sidebar-icon {
    min-width: 19px;
    font-size: 15px;
    text-align: center;
}

.sidebar-footer {
    border-top: 1px solid rgba(255,255,255,0.08);
    margin-top: auto;
    padding-top: 12px;
    flex: 0 0 auto;
}

.sidebar-user,
.sidebar-logout {
    display: flex !important;
    align-items: center;
    gap: 9px;
}

.sidebar-user {
    font-size: 12px;
    color: #cbd5e1;
    margin-bottom: 7px;
    border-radius: 8px;
    padding: 6px 8px;
}

.sidebar-user:hover {
    background: rgba(255,255,255,.08);
    color: #fff;
}

.sidebar-role {
    font-size: 10px;
    color: var(--atlas-sidebar-active);
    background: rgba(123,200,246,0.1);
    padding: 2px 6px;
    border-radius: 999px;
}

.sidebar-logout {
    font-size: 12px;
    color: #f87171;
    text-decoration: none;
}

    .sidebar-logout:hover {
        color: #fb7185;
        text-decoration: none;
    }

.sidebar-atlas.collapsed .sidebar-text,
.sidebar-atlas.collapsed .sidebar-logo-text,
.sidebar-atlas.collapsed .sidebar-role,
.sidebar-atlas.collapsed .sidebar-section {
    display: none !important;
}

.sidebar-atlas.collapsed .sidebar-logo,
.sidebar-atlas.collapsed .sidebar-link,
.sidebar-atlas.collapsed .sidebar-user,
.sidebar-atlas.collapsed .sidebar-logout {
    justify-content: center;
}

.sidebar-atlas.collapsed .sidebar-link {
    padding-left: 0;
    padding-right: 0;
    height: 34px;
}

.sidebar-atlas.collapsed .sidebar-toggle {
    margin: auto;
}

/* ====== THEME SELECTOR ====== */
.sidebar-theme-selector {
    display: flex;
    gap: 7px;
    margin-bottom: 12px;
}

.theme-btn {
    flex: 1;
    height: 32px;
    border-radius: 8px;
    border: 1px solid rgba(255,255,255,.14);
    background: rgba(255,255,255,.04);
    color: #ffffff;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: background .15s ease, border-color .15s ease, color .15s ease;
}

    .theme-btn:hover {
        background: rgba(255,255,255,.12);
        border-color: rgba(255,255,255,.26);
        color: #ffffff;
    }

.sidebar-atlas.collapsed .sidebar-theme-selector {
    flex-direction: column;
    align-items: center;
}

    .sidebar-atlas.collapsed .sidebar-theme-selector .theme-btn {
        width: 34px;
        flex: none;
    }

.theme-tools {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-left: auto;
}

.accent-dot {
    width: 22px;
    height: 22px;
    border: 2px solid rgba(255,255,255,.65);
    border-radius: 50%;
    cursor: pointer;
    box-shadow: 0 0 0 1px rgba(0,0,0,.12);
}

    .accent-dot[data-color="#0f4c75"] {
        background: #0f4c75;
    }

    .accent-dot[data-color="#2563eb"] {
        background: #2563eb;
    }

    .accent-dot[data-color="#16a34a"] {
        background: #16a34a;
    }

    .accent-dot[data-color="#9333ea"] {
        background: #9333ea;
    }

    .accent-dot[data-color="#dc2626"] {
        background: #dc2626;
    }

    .accent-dot[data-color="#ea580c"] {
        background: #ea580c;
    }

/* ====== CARDS ====== */
.card,
.card-atlas {
    background: var(--atlas-surface);
    color: var(--atlas-ink);
    border-radius: var(--atlas-radius);
    border: 1px solid var(--atlas-border);
    box-shadow: var(--atlas-shadow);
}

.card-header {
    background: var(--atlas-surface-soft);
    color: var(--atlas-ink);
    border-bottom-color: var(--atlas-border);
}

/* ====== TITLES ====== */
.title-atlas {
    font-weight: 700;
    letter-spacing: -0.3px;
}

.subtitle-atlas {
    font-size: 13px;
    color: var(--atlas-muted);
}

.page-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 20px;
}

.page-title {
    font-size: 18px;
    font-weight: 700;
    letter-spacing: -0.3px;
}

/* ====== INPUTS / FORMS ====== */
.input-atlas,
.form-control,
.form-select,
input,
select,
textarea {
    background-color: var(--atlas-surface);
    color: var(--atlas-ink);
    border-color: var(--atlas-border);
    border-radius: 8px;
}

.input-atlas {
    font-size: 14px;
    padding: 9px 10px;
    border: 1px solid var(--atlas-border);
}

    .input-atlas:focus,
    .form-control:focus,
    .form-select:focus,
    input:focus,
    select:focus,
    textarea:focus {
        background-color: var(--atlas-surface);
        color: var(--atlas-ink);
        border-color: var(--atlas-brand-light);
        box-shadow: 0 0 0 3px color-mix(in srgb, var(--atlas-brand-light) 20%, transparent);
    }

.form-atlas .form-label {
    font-size: 13px;
    font-weight: 600;
    margin-bottom: 4px;
}

.form-atlas .form-control {
    font-size: 14px;
    padding: 9px 10px;
    border: 1px solid var(--atlas-border);
}

.form-check-input {
    width: 18px;
    height: 18px;
}

.form-actions {
    display: flex;
    gap: 10px;
    margin-top: 15px;
}

/* ====== BUTTONS ====== */
.btn-atlas,
.btn-primary {
    background: linear-gradient(135deg, var(--atlas-brand), var(--atlas-brand-light));
    color: #fff;
    border: none;
    border-radius: 8px;
    font-weight: 600;
}

.btn-atlas {
    font-size: 14px;
    padding: 9px 12px;
}

    .btn-atlas:hover {
        opacity: .92;
        color: #fff;
    }

.btn-sm-atlas {
    font-size: 12px;
    padding: 4px 8px;
    border-radius: 6px;
}

.btn-outline-secondary {
    color: var(--atlas-muted);
    border-color: var(--atlas-border);
}

.btn-outline-primary {
    color: var(--atlas-brand-light);
    border-color: var(--atlas-brand-light);
}

/* ====== AUTH ====== */
.auth-container {
    min-height: 100vh;
}

.auth-card {
    width: 380px;
}

/* ====== TOPBAR MOBILE ====== */
.topbar-atlas {
    display: none;
    width: 100%;
    background: var(--atlas-surface);
    color: var(--atlas-ink);
    border-bottom: 1px solid var(--atlas-border);
    padding: 12px 16px;
    align-items: center;
    gap: 12px;
    box-shadow: var(--atlas-shadow);
}

.topbar-title {
    font-weight: 600;
    font-size: 15px;
}

.hamburger-btn {
    width: 36px;
    height: 36px;
    border: 1px solid var(--atlas-border);
    border-radius: 8px;
    background: var(--atlas-surface);
    display: flex;
    flex-direction: column;
    justify-content: center;
    gap: 4px;
    padding: 6px;
    cursor: pointer;
}

    .hamburger-btn span {
        height: 2px;
        background: var(--atlas-ink);
        border-radius: 2px;
        display: block;
    }

.sidebar-overlay {
    display: none;
    position: fixed;
    inset: 0;
    background: rgba(0,0,0,0.4);
    z-index: 998;
}

/* ====== TABLES ====== */
.table-responsive {
    overflow-x: auto;
}

.table {
    color: var(--atlas-ink);
}

    .table th,
    .table td {
        border-color: var(--atlas-border);
    }

.table-hover tbody tr:hover {
    background-color: var(--atlas-surface-soft);
}

.table-atlas {
    font-size: 12px;
    margin-bottom: 0;
    white-space: nowrap;
}

    .table-atlas thead {
        background: var(--atlas-surface-soft);
    }

    .table-atlas th {
        font-size: 11px;
        text-transform: uppercase;
        letter-spacing: .08em;
        color: var(--atlas-muted);
        border-bottom: 2px solid var(--atlas-border);
    }

    .table-atlas th,
    .table-atlas td {
        padding: 6px 8px;
        vertical-align: middle;
    }

    .table-atlas tbody tr {
        transition: background .2s ease;
    }

        .table-atlas tbody tr:hover {
            background: color-mix(in srgb, var(--atlas-brand-light) 5%, transparent);
        }

.table-actions {
    display: flex;
    justify-content: flex-end;
    gap: 6px;
}

/* ====== BADGES / INFO ====== */
.badge-atlas {
    padding: 4px 8px;
    border-radius: 999px;
    font-size: 11px;
    font-weight: 600;
}

.badge-success {
    background: #dcfce7;
    color: #166534;
}

.badge-danger {
    background: #fee2e2;
    color: #991b1b;
}

.info-box {
    background: var(--atlas-surface-soft);
    border: 1px solid var(--atlas-border);
    border-radius: var(--atlas-radius);
}

.text-muted {
    color: var(--atlas-muted) !important;
}

/* ====== ESTACIONES CARD KPI ====== */
.station-card-title {
    font-size: 17px;
    min-height: 48px;
    font-weight: 700;
    color: var(--atlas-ink);
    line-height: 1.3;
}

.station-kpi {
    border-top: 1px solid var(--atlas-border);
    margin-top: 16px;
    padding-top: 22px;
    margin-bottom: 22px;
    text-align: center;
}

.station-kpi-number {
    font-size: 38px;
    line-height: 1;
    font-weight: 750;
    color: var(--atlas-station-kpi);
    margin-bottom: 8px;
    letter-spacing: -1px;
}

.station-kpi-label {
    font-size: 11px;
    font-weight: 700;
    color: var(--atlas-muted);
    text-transform: uppercase;
    letter-spacing: .12em;
    margin-bottom: 16px;
}

.station-years {
    display: flex;
    justify-content: center;
    flex-wrap: wrap;
    gap: 7px;
}

.station-year-badge {
    background: var(--atlas-station-pill-bg);
    color: #fff;
    border: 1px solid var(--atlas-station-pill-border);
    border-radius: 999px;
    padding: 4px 10px;
    font-size: 11px;
    font-weight: 650;
    line-height: 1.25;
}

.btn-station-details {
    display: block;
    width: 100%;
    text-align: center;
    text-decoration: none;
    background: var(--atlas-station-button-bg);
    color: #fff;
    border: 1px solid var(--atlas-station-button-border);
    border-radius: 10px;
    padding: 9px 14px;
    font-size: 13px;
    font-weight: 650;
    line-height: 1.25;
    transition: background .15s ease, border-color .15s ease, transform .15s ease;
}

    .btn-station-details:hover {
        background: var(--atlas-station-button-hover);
        border-color: var(--atlas-brand-light);
        color: #fff;
        transform: translateY(-1px);
    }

.station-card .btn-dark,
.card .btn-station-details {
    border-radius: 10px;
}

/* ====== DARK MODE FIXES - BOOTSTRAP / VISTAS INTERNAS ====== */
html[data-theme="dark"] .table,
html[data-theme="dark"] .table tbody,
html[data-theme="dark"] .table tr,
html[data-theme="dark"] .table td,
html[data-theme="dark"] .table th {
    color: var(--atlas-ink) !important;
    border-color: var(--atlas-border) !important;
}

    html[data-theme="dark"] .table thead,
    html[data-theme="dark"] .table thead tr,
    html[data-theme="dark"] .table thead th,
    html[data-theme="dark"] .table-light,
    html[data-theme="dark"] thead.table-light,
    html[data-theme="dark"] .table > :not(caption) > * > * {
        background-color: var(--atlas-surface) !important;
        color: var(--atlas-ink) !important;
        border-color: var(--atlas-border) !important;
    }

        html[data-theme="dark"] .table thead th,
        html[data-theme="dark"] thead.table-light th {
            background-color: var(--atlas-surface-soft) !important;
            color: var(--atlas-ink) !important;
        }

html[data-theme="dark"] .table-hover tbody tr:hover,
html[data-theme="dark"] .table-hover > tbody > tr:hover > * {
    background-color: var(--atlas-surface-soft) !important;
    color: var(--atlas-ink) !important;
}

html[data-theme="dark"] .bg-white,
html[data-theme="dark"] .bg-light,
html[data-theme="dark"] .list-group-item,
html[data-theme="dark"] .dropdown-menu,
html[data-theme="dark"] .modal-content,
html[data-theme="dark"] .popover,
html[data-theme="dark"] .toast {
    background-color: var(--atlas-surface) !important;
    color: var(--atlas-ink) !important;
    border-color: var(--atlas-border) !important;
}

html[data-theme="dark"] .card,
html[data-theme="dark"] .card-body,
html[data-theme="dark"] .card-atlas,
html[data-theme="dark"] .info-box,
html[data-theme="dark"] .station-card,
html[data-theme="dark"] .xml-card,
html[data-theme="dark"] .border,
html[data-theme="dark"] .border-bottom,
html[data-theme="dark"] .border-top {
    border-color: var(--atlas-border) !important;
}

html[data-theme="dark"] .card,
html[data-theme="dark"] .card-atlas,
html[data-theme="dark"] .station-card,
html[data-theme="dark"] .xml-card,
html[data-theme="dark"] .info-box {
    background-color: var(--atlas-surface) !important;
    color: var(--atlas-ink) !important;
}

html[data-theme="dark"] .xml-month-card,
html[data-theme="dark"] .station-summary,
html[data-theme="dark"] .station-metric,
html[data-theme="dark"] .metric-card,
html[data-theme="dark"] .summary-card,
html[data-theme="dark"] .report-card {
    background-color: var(--atlas-surface-soft) !important;
    color: var(--atlas-ink) !important;
    border-color: var(--atlas-border) !important;
}

html[data-theme="dark"] .text-dark,
html[data-theme="dark"] .text-body,
html[data-theme="dark"] .text-black {
    color: var(--atlas-ink) !important;
}

html[data-theme="dark"] .text-muted,
html[data-theme="dark"] small.text-muted {
    color: var(--atlas-muted) !important;
}

html[data-theme="dark"] .form-control,
html[data-theme="dark"] .form-select,
html[data-theme="dark"] input,
html[data-theme="dark"] select,
html[data-theme="dark"] textarea,
html[data-theme="dark"] option {
    background-color: var(--atlas-surface) !important;
    color: var(--atlas-ink) !important;
    border-color: var(--atlas-border) !important;
}

    html[data-theme="dark"] .form-control::placeholder,
    html[data-theme="dark"] input::placeholder,
    html[data-theme="dark"] textarea::placeholder {
        color: var(--atlas-muted) !important;
    }

html[data-theme="dark"] .btn-outline-secondary {
    color: #cbd5e1 !important;
    border-color: #475569 !important;
}

    html[data-theme="dark"] .btn-outline-secondary:hover {
        background-color: #475569 !important;
        color: #ffffff !important;
    }

html[data-theme="dark"] .btn-outline-primary {
    color: var(--atlas-sidebar-active) !important;
    border-color: var(--atlas-brand-light) !important;
}

    html[data-theme="dark"] .btn-outline-primary:hover {
        background-color: var(--atlas-brand-light) !important;
        color: #ffffff !important;
    }

html[data-theme="dark"] .btn:disabled,
html[data-theme="dark"] .btn.disabled,
html[data-theme="dark"] a.disabled {
    opacity: .45;
    color: var(--atlas-muted) !important;
}

html[data-theme="dark"] .badge.bg-warning {
    color: #111827 !important;
}

html[data-theme="dark"] .badge.bg-danger,
html[data-theme="dark"] .badge.bg-success,
html[data-theme="dark"] .badge.bg-primary {
    color: #ffffff !important;
}

/* ====== MOBILE ====== */
@media (max-width: 768px) {
    .layout-main {
        flex-direction: column;
    }

    .app-topbar {
        display: none;
    }

    .topbar-atlas {
        display: flex;
    }

    .content-atlas {
        width: 100%;
        padding: 15px;
    }

    .atlas-workspace {
        width: 100%;
    }

    .station-context-strip {
        align-items: stretch;
        flex-direction: column-reverse;
        justify-content: flex-start;
    }

    .station-context-strip .btn,
    .station-context-switch {
        width: 100%;
    }

    .station-context-card .card-body {
        align-items: flex-start;
        flex-direction: column;
    }

    .station-context-section {
        font-size: 1.05rem;
    }

    .station-context-name {
        font-size: .9rem;
    }

    .station-context-filter-grid {
        grid-template-columns: 1fr 1fr;
    }

    .module-kpi-grid {
        grid-template-columns: 1fr 1fr;
    }

    .module-report-row,
    .module-finding-row {
        grid-template-columns: 1fr;
        align-items: stretch;
    }

    .station-catalog-row,
    .station-structure-grid,
    .station-readonly-strip {
        grid-template-columns: 1fr;
    }

    .station-context-filter-actions {
        grid-column: 1 / -1;
    }

    .station-context-filter-actions .btn {
        flex: 1;
    }

    .station-secondary-nav {
        display: grid;
        grid-template-columns: 1fr 1fr;
    }

    .station-secondary-nav a {
        justify-content: center;
        text-align: center;
    }

    .volumetric-station-bar .card-body,
    .volumetric-station-form {
        align-items: stretch;
        flex-direction: column;
    }

    .volumetric-station-form,
    .volumetric-station-form .form-select {
        width: 100%;
        min-width: 0;
    }

    .search-result-grid {
        grid-template-columns: 1fr;
    }

    .sidebar-atlas {
        position: fixed;
        top: 0;
        left: 0;
        height: 100%;
        transform: translateX(-100%);
        transition: transform .25s ease;
    }

        .sidebar-atlas.open {
            transform: translateX(0);
        }

    .sidebar-overlay.show {
        display: block;
    }
}
/* ====== ACCORDION ATLAS / DARK MODE ====== */
.accordion-item {
    background-color: var(--atlas-surface);
    color: var(--atlas-ink);
    border: 1px solid var(--atlas-border);
    border-radius: var(--atlas-radius);
    overflow: hidden;
}

.accordion-button {
    background-color: var(--atlas-surface);
    color: var(--atlas-ink);
    font-weight: 600;
    box-shadow: none;
}

    .accordion-button:not(.collapsed) {
        background-color: color-mix(in srgb, var(--atlas-brand-light) 12%, var(--atlas-surface));
        color: var(--atlas-brand-light);
        box-shadow: none;
    }

    .accordion-button:focus {
        box-shadow: 0 0 0 3px color-mix(in srgb, var(--atlas-brand-light) 20%, transparent);
        border-color: var(--atlas-brand-light);
    }

.accordion-body {
    background-color: var(--atlas-surface);
    color: var(--atlas-ink);
}

html[data-theme="dark"] .accordion-button::after {
    filter: invert(1);
}

/* ====== TABLAS RESPONSIVAS INTERNAS ====== */
.table-atlas-wrap,
.table-bitacoras-fixed,
.table-detalle-fixed {
    width: 100%;
    table-layout: fixed;
}

    .table-bitacoras-fixed th,
    .table-bitacoras-fixed td,
    .table-detalle-fixed th,
    .table-detalle-fixed td {
        white-space: normal !important;
        word-break: break-word;
        overflow-wrap: anywhere;
        vertical-align: top;
    }

.descripcion-bitacora,
.detalle-cfdi {
    white-space: normal !important;
    word-break: break-word;
    overflow-wrap: anywhere;
}

.xml-modal-body {
    overflow-x: hidden;
}

.xml-detail-view .table-responsive {
    overflow-x: visible;
}

.xml-detail-view .table-atlas {
    width: 100%;
}

.xml-detail-view .table-detalle-fixed,
.xml-detail-view .table-bitacoras-fixed {
    table-layout: fixed;
    white-space: normal;
}

.table-cfdi-detalle .col-rfc {
    width: 16%;
}

.table-cfdi-detalle .col-nombre {
    width: 24%;
}

.table-cfdi-detalle .col-permiso {
    width: 18%;
}

.table-cfdi-detalle .col-detalle {
    width: 42%;
}

.table-bitacoras-fixed .col-numero {
    width: 8%;
}

.table-bitacoras-fixed .col-fecha {
    width: 18%;
}

.table-bitacoras-fixed .col-tipo {
    width: 14%;
}

.table-bitacoras-fixed .col-descripcion {
    width: 60%;
}

.descripcion-bitacora {
    display: -webkit-box;
    line-height: 1.35;
    -webkit-line-clamp: 3;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.detalle-cfdi {
    line-height: 1.45;
}

.daily-product-section-title {
    color: var(--atlas-ink);
    font-size: .9rem;
    font-weight: 850;
    letter-spacing: .04em;
    margin: 10px 0 8px;
    text-transform: uppercase;
}

.daily-tank-grid {
    display: grid;
    gap: 12px;
}

.daily-tank-card {
    background: var(--atlas-surface);
    border: 1px solid var(--atlas-border);
    border-radius: 8px;
    padding: 14px;
}

.daily-tank-head {
    align-items: flex-start;
    border-bottom: 1px solid var(--atlas-border);
    display: flex;
    gap: 12px;
    justify-content: space-between;
    margin-bottom: 12px;
    padding-bottom: 10px;
}

.daily-field-grid {
    display: grid;
    gap: 8px;
    grid-template-columns: repeat(4, minmax(0, 1fr));
}

.daily-field-grid > div {
    background: var(--atlas-surface-soft);
    border: 1px solid var(--atlas-border);
    border-radius: 7px;
    min-width: 0;
    padding: 8px 10px;
}

.daily-field-grid span {
    color: var(--atlas-muted);
    display: block;
    font-size: 10px;
    font-weight: 800;
    letter-spacing: .04em;
    line-height: 1.25;
    text-transform: uppercase;
}

.daily-field-grid strong {
    color: var(--atlas-ink);
    display: block;
    font-size: 13px;
    font-weight: 750;
    line-height: 1.3;
    margin-top: 4px;
    overflow-wrap: anywhere;
}

.daily-field-grid-compact {
    grid-template-columns: repeat(2, minmax(0, 1fr));
}

.daily-subsection {
    margin-top: 12px;
}

.daily-subsection-title {
    color: var(--atlas-muted);
    font-size: 11px;
    font-weight: 850;
    letter-spacing: .06em;
    margin-bottom: 7px;
    text-transform: uppercase;
}

.daily-two-column {
    display: grid;
    gap: 12px;
    grid-template-columns: repeat(2, minmax(0, 1fr));
}

.daily-bitacora-filter {
    align-items: end;
    background: var(--atlas-surface-soft);
    border: 1px solid var(--atlas-border);
    border-radius: 8px;
    display: grid;
    gap: 10px;
    grid-template-columns: minmax(150px, .7fr) minmax(120px, .55fr) minmax(220px, 1fr) auto;
    padding: 12px;
}

.daily-bitacora-filter-actions {
    display: flex;
    gap: 8px;
}

@media (max-width: 992px) {
    .daily-field-grid,
    .daily-field-grid-compact,
    .daily-two-column,
    .daily-bitacora-filter {
        grid-template-columns: 1fr;
    }

    .daily-tank-head,
    .daily-bitacora-filter-actions {
        align-items: stretch;
        flex-direction: column;
    }
}

/* ====== SUBIDA XML / DROP ZONE ====== */
.drop-zone {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 6px;
    text-align: center;
    padding: 34px 20px;
    border: 2px dashed var(--atlas-border);
    border-radius: 14px;
    background: var(--atlas-surface-soft);
    color: var(--atlas-muted);
    cursor: pointer;
    transition: border-color .18s ease, background .18s ease, color .18s ease, transform .18s ease;
}

.upload-shortcut-panel {
    align-items: center;
    background: var(--atlas-surface-soft);
    border: 2px dashed var(--atlas-border);
    border-radius: 14px;
    color: var(--atlas-muted);
    display: flex;
    flex-direction: column;
    gap: 7px;
    justify-content: center;
    min-height: 190px;
    padding: 24px 18px;
    text-align: center;
}

    .drop-zone:hover {
        border-color: var(--atlas-brand-light);
        color: var(--atlas-ink);
    }

    .drop-zone.dragging {
        border-color: var(--atlas-brand-light);
        background: color-mix(in srgb, var(--atlas-brand-light) 12%, var(--atlas-surface));
        color: var(--atlas-brand-light);
        transform: translateY(-2px);
    }

.drop-zone-icon {
    font-size: 40px;
    line-height: 1;
    color: var(--atlas-brand-light);
}

.drop-zone-title {
    font-size: 15px;
    font-weight: 600;
    color: var(--atlas-ink);
}

.drop-zone-hint {
    font-size: 12px;
}

/* Lista de archivos seleccionados */
.upload-file-list {
    display: flex;
    flex-direction: column;
    gap: 6px;
    max-height: 260px;
    overflow-y: auto;
}

.upload-file-row {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 8px 12px;
    border: 1px solid var(--atlas-border);
    border-radius: 10px;
    background: var(--atlas-surface);
}

    .upload-file-row .file-name {
        font-size: 13px;
        font-weight: 600;
        word-break: break-all;
    }

    .upload-file-row .file-size {
        font-size: 11px;
        color: var(--atlas-muted);
        white-space: nowrap;
    }

.upload-summary-pill {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 6px 12px;
    border-radius: 999px;
    font-size: 12px;
    font-weight: 650;
}

.upload-loading-host {
    position: relative;
}

.upload-loading-overlay {
    position: absolute;
    inset: 0;
    z-index: 20;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 18px;
    border-radius: inherit;
    background: rgba(248, 250, 252, .82);
    backdrop-filter: blur(3px);
}

html[data-theme="dark"] .upload-loading-overlay {
    background: rgba(15, 23, 42, .78);
}

.upload-loading-box {
    min-width: min(280px, 100%);
    padding: 18px 20px;
    border: 1px solid var(--atlas-border);
    border-radius: 10px;
    background: var(--atlas-surface);
    box-shadow: 0 16px 40px rgba(15, 23, 42, .18);
    text-align: center;
}

.upload-loading-spinner {
    width: 34px;
    height: 34px;
    margin: 0 auto 10px;
    border: 3px solid color-mix(in srgb, var(--atlas-brand-light) 20%, transparent);
    border-top-color: var(--atlas-brand-light);
    border-radius: 50%;
    animation: atlas-spin .8s linear infinite;
}

.upload-loading-title {
    color: var(--atlas-ink);
    font-size: 15px;
    font-weight: 800;
}

.upload-loading-message {
    color: var(--atlas-muted);
    font-size: 12px;
    margin-top: 4px;
}

@keyframes atlas-spin {
    to {
        transform: rotate(360deg);
    }
}

/* ====== USUARIOS DASHBOARD ====== */
.user-kpi-card {
    display: block;
    height: 100%;
    padding: 16px;
    text-decoration: none;
}

.user-kpi-link {
    transition: border-color .15s ease, transform .15s ease, box-shadow .15s ease;
}

    .user-kpi-link:hover,
    .user-kpi-link.active {
        border-color: var(--atlas-brand-light);
        color: var(--atlas-ink);
        transform: translateY(-1px);
        text-decoration: none;
    }

.user-kpi-label {
    color: var(--atlas-muted);
    font-size: 11px;
    font-weight: 750;
    letter-spacing: .08em;
    text-transform: uppercase;
}

.user-kpi-value {
    color: var(--atlas-ink);
    font-size: 34px;
    font-weight: 750;
    line-height: 1;
    margin-top: 10px;
}

.user-kpi-meta {
    color: var(--atlas-muted);
    font-size: 12px;
    margin-top: 8px;
}

.user-activity-feed {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.user-activity-item {
    display: grid;
    grid-template-columns: 12px 1fr;
    gap: 12px;
}

.user-activity-dot {
    width: 10px;
    height: 10px;
    margin-top: 6px;
    border-radius: 50%;
    background: var(--atlas-brand-light);
    box-shadow: 0 0 0 4px color-mix(in srgb, var(--atlas-brand-light) 14%, transparent);
}

.user-activity-content {
    padding-bottom: 12px;
    border-bottom: 1px solid var(--atlas-border);
}

.user-activity-item:last-child .user-activity-content {
    padding-bottom: 0;
    border-bottom: 0;
}

.user-activity-text {
    color: var(--atlas-muted);
    font-size: 13px;
    margin-top: 3px;
    white-space: normal;
}

/* ====== ESTACIONES DASHBOARD ====== */
.station-dashboard-kpi {
    height: 100%;
    padding: 16px;
}

.station-dashboard-label {
    color: var(--atlas-muted);
    font-size: 11px;
    font-weight: 750;
    letter-spacing: .08em;
    text-transform: uppercase;
}

.station-dashboard-value {
    color: var(--atlas-ink);
    font-size: 34px;
    font-weight: 750;
    line-height: 1;
    margin-top: 10px;
}

.station-dashboard-period {
    font-size: 26px;
}

.station-dashboard-meta {
    color: var(--atlas-muted);
    font-size: 12px;
    margin-top: 8px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.station-list,
.recent-report-list {
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.station-list-row,
.recent-report-row {
    display: grid;
    gap: 14px;
    align-items: center;
    padding: 13px 0;
    border-bottom: 1px solid var(--atlas-border);
}

.station-list-row {
    grid-template-columns: minmax(220px, 1.1fr) minmax(190px, .9fr) minmax(260px, auto);
}

.recent-report-row {
    grid-template-columns: minmax(0, 1fr) auto;
}

.station-list-row:last-child,
.recent-report-row:last-child {
    border-bottom: 0;
}

.station-list-title {
    color: var(--atlas-ink);
    font-size: 14px;
    font-weight: 700;
    line-height: 1.25;
    overflow-wrap: anywhere;
}

.station-list-years {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
}

.station-list-years-main {
    min-height: 1px;
}

.station-list-years-bottom {
    grid-column: 1 / -1;
    margin-top: -6px;
}

.station-year-link {
    text-decoration: none;
    transition: background .15s ease, border-color .15s ease, transform .15s ease;
}

    .station-year-link:hover {
        border-color: var(--atlas-brand-light);
        color: #fff;
        transform: translateY(-1px);
        text-decoration: none;
    }

.station-list-actions,
.recent-report-actions {
    display: flex;
    justify-content: flex-end;
    flex-wrap: nowrap;
    gap: 6px;
    white-space: nowrap;
}

.report-monthly-kpi-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(310px, 1fr));
    gap: 14px;
}

.report-list-head {
    align-items: flex-start;
    display: flex;
    gap: 16px;
    justify-content: space-between;
}

.report-graph-open {
    align-items: center;
    display: inline-flex;
    gap: 8px;
    flex: 0 0 auto;
}

.report-graph-thumb {
    align-items: end;
    background: #f8fafc;
    border: 1px solid #cbd5e1;
    border-radius: 6px;
    display: inline-flex;
    gap: 2px;
    height: 22px;
    padding: 4px;
    width: 30px;
}

.report-graph-thumb span {
    background: #0c639e;
    border-radius: 2px 2px 0 0;
    display: block;
    flex: 1;
}

.report-graph-thumb span:nth-child(1) {
    height: 7px;
}

.report-graph-thumb span:nth-child(2) {
    background: #14915f;
    height: 12px;
}

.report-graph-thumb span:nth-child(3) {
    background: #f59e0b;
    height: 16px;
}

.report-summary-chart-wrap {
    height: min(68vh, 560px);
    min-height: 360px;
}

.report-monthly-kpi {
    border-left-width: 4px;
    overflow: hidden;
}

.report-monthly-kpi.merma-alert-ok {
    background: linear-gradient(90deg, rgba(22, 163, 74, .08), var(--atlas-surface) 50%);
}

.report-monthly-kpi.merma-alert-warning {
    background: linear-gradient(90deg, rgba(245, 158, 11, .10), var(--atlas-surface) 50%);
}

.report-monthly-kpi.merma-alert-danger,
.report-monthly-kpi.merma-alert-critical {
    background: linear-gradient(90deg, rgba(220, 38, 38, .09), var(--atlas-surface) 54%);
}

.report-monthly-head {
    align-items: flex-start;
    display: flex;
    gap: 12px;
    justify-content: space-between;
}

.report-card-period {
    color: var(--atlas-ink);
    font-size: 14px;
    font-weight: 850;
    line-height: 1.2;
}

.report-card-station-title {
    font-size: 17px;
    line-height: 1.18;
    overflow-wrap: anywhere;
}

.report-status-pill {
    border-radius: 7px;
    flex: 0 0 auto;
    font-size: 12px;
    font-weight: 850;
    line-height: 1;
    padding: 7px 9px;
}

.report-kpi-reading {
    color: var(--atlas-ink);
    font-size: 14px;
    font-weight: 700;
    line-height: 1.35;
    margin: 10px 0 12px;
}

.report-monthly-kpi .report-product-summary-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
}

.report-product-merma-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 0.45rem;
}

.report-product-merma-item {
    position: relative;
    display: flex;
    flex-direction: column;
    gap: 0.26rem;
    border: 1px solid #dbe3ec;
    border-left-width: 5px;
    border-radius: 7px;
    background: #f8fafc;
    padding: 0.58rem 0.65rem;
    font-size: 0.78rem;
    box-shadow: 0 8px 18px rgba(15, 23, 42, .04);
}

.report-product-merma-item.merma-alert-ok {
    border-color: rgba(22, 163, 74, .42);
    border-left-color: #16a34a;
    background: linear-gradient(135deg, rgba(22, 163, 74, .14), rgba(240, 253, 244, .95));
}

.report-product-merma-item.merma-alert-danger {
    border-color: rgba(220, 38, 38, .42);
    border-left-color: #dc2626;
    background: linear-gradient(135deg, rgba(220, 38, 38, .13), rgba(254, 242, 242, .96));
}

.report-product-merma-item:nth-child(3):last-child {
    grid-column: 1 / -1;
}

.report-product-merma-head {
    align-items: flex-start;
    display: flex;
    gap: 8px;
    justify-content: space-between;
}

.report-product-merma-item strong {
    font-weight: 800;
    font-size: 0.82rem;
    line-height: 1.15;
}

.report-product-merma-head small {
    border-radius: 999px;
    flex: 0 0 auto;
    font-size: 0.64rem;
    font-weight: 900;
    line-height: 1;
    padding: 0.26rem 0.38rem;
    text-transform: uppercase;
}

.report-product-merma-item.merma-alert-ok .report-product-merma-head small {
    background: #dcfce7;
    color: #166534;
}

.report-product-merma-item.merma-alert-danger .report-product-merma-head small {
    background: #fee2e2;
    color: #991b1b;
}

.report-product-merma-item em {
    color: #475569;
    font-size: 0.7rem;
    font-style: normal;
    font-weight: 800;
    line-height: 1;
}

.report-product-merma-item span {
    color: #475569;
    white-space: nowrap;
    line-height: 1.2;
}

.report-product-merma-item b {
    color: #001b38;
}

.report-product-merma-item.merma-alert-ok b {
    color: #15803d;
}

.report-product-merma-item.merma-alert-danger b {
    color: #b91c1c;
}

.report-initial-status {
    align-items: center;
    border: 1px solid var(--atlas-border);
    border-radius: 6px;
    color: var(--atlas-muted);
    display: inline-flex;
    font-size: 11px;
    font-weight: 800;
    line-height: 1.2;
    margin-top: 2px;
    padding: 5px 7px;
}

.report-initial-status.is-ok {
    background: rgba(22, 163, 74, .08);
    border-color: rgba(22, 163, 74, .28);
    color: #166534;
}

.report-initial-status.is-missing {
    background: rgba(245, 158, 11, .12);
    border-color: rgba(245, 158, 11, .38);
    color: #92400e;
}

.report-initial-editor {
    align-items: center;
    background: var(--atlas-surface-soft);
    border: 1px solid var(--atlas-border);
    border-radius: 8px;
    display: grid;
    gap: 10px;
    grid-template-columns: minmax(0, 1fr) minmax(210px, 300px);
    margin-bottom: 12px;
    padding: 9px 10px;
}

.report-initial-editor.is-missing {
    background: rgba(245, 158, 11, .10);
    border-color: rgba(245, 158, 11, .34);
}

.report-initial-editor strong,
.report-initial-editor small {
    display: block;
}

.report-initial-editor strong {
    font-size: 13px;
    line-height: 1.2;
}

.report-initial-editor small {
    color: var(--atlas-muted);
    font-size: 12px;
    line-height: 1.35;
    margin-top: 2px;
}

.report-initial-form {
    margin: 0;
}

.report-initial-form .form-control,
.report-initial-form .input-group-text,
.report-initial-form .btn {
    font-size: 12px;
    min-height: 32px;
}

@media (max-width: 768px) {
    .report-initial-editor {
        grid-template-columns: 1fr;
    }
}

.report-monthly-foot {
    align-items: center;
    display: flex;
    gap: 10px;
    justify-content: space-between;
}

.report-monthly-foot small {
    color: var(--atlas-muted);
    font-size: 12px;
}

.report-monthly-foot .btn {
    flex: 0 0 auto;
}

.report-list-compact {
    display: grid;
    gap: 10px;
}

.report-list-row {
    align-items: center;
    background: var(--atlas-surface);
    border: 1px solid var(--atlas-border);
    border-radius: 8px;
    display: grid;
    gap: 12px;
    grid-template-columns: minmax(0, 1fr) auto;
    padding: 12px 14px;
}

.report-list-row strong,
.report-list-row span,
.report-list-row small {
    display: block;
}

.report-list-row span,
.report-list-row small {
    color: var(--atlas-muted);
}

@media (max-width: 640px) {
    .report-list-row {
        grid-template-columns: 1fr;
    }

    .report-list-row .btn {
        width: 100%;
    }
}

.recent-report-actions .btn,
.module-report-actions .btn {
    flex: 0 0 auto;
}

.report-actions-stack {
    align-items: stretch;
    flex-direction: column;
    min-width: 112px;
}

.report-actions-stack .btn {
    width: 100%;
}

@media (max-width: 1400px) {
    .station-list-row {
        grid-template-columns: 1fr;
    }

    .station-list-actions {
        justify-content: flex-start;
    }
}

@media (max-width: 992px) {
    .station-list-row,
    .recent-report-row {
        grid-template-columns: 1fr;
    }

    .station-list-actions,
    .recent-report-actions {
        flex-wrap: wrap;
        justify-content: flex-start;
        white-space: normal;
    }

    .report-actions-stack {
        align-items: flex-start;
        flex-direction: row;
        min-width: 0;
    }

    .report-actions-stack .btn {
        width: auto;
    }

    .report-compact-row {
        grid-template-columns: 1fr;
    }

    .report-compact-main {
        align-items: flex-start;
    }

    .report-compact-meta {
        white-space: normal;
    }
}

.station-detail-report-row {
    min-height: 82px;
}

.report-compact-list {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.report-compact-row {
    align-items: center;
    border-bottom: 1px solid var(--atlas-border);
    display: grid;
    gap: 10px;
    grid-template-columns: minmax(0, 1fr) auto auto;
    padding: 10px 0;
}

.report-compact-row:last-child {
    border-bottom: 0;
}

.report-compact-main {
    align-items: center;
    display: flex;
    gap: 10px;
    min-width: 0;
}

.report-compact-meta {
    color: var(--atlas-muted);
    font-size: .86rem;
    white-space: nowrap;
}

.report-compact-meta strong {
    color: var(--atlas-ink);
    font-weight: 800;
}

.station-report-filter .form-select,
.station-report-filter .btn {
    min-height: 38px;
}

@media (max-width: 992px) {
    .report-compact-row {
        grid-template-columns: 1fr;
    }

    .report-compact-main {
        align-items: flex-start;
    }

    .report-compact-meta {
        white-space: normal;
    }
}

.station-context-nav {
    position: static;
}

.station-context-nav .card-body {
    display: flex;
    justify-content: space-between;
    gap: 14px;
    align-items: center;
    flex-wrap: wrap;
    padding: 12px 16px;
}

.station-context-title {
    color: var(--atlas-muted);
    font-size: 13px;
}

.station-context-title strong {
    color: var(--atlas-ink);
}

.station-context-links {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
}

.station-section {
    scroll-margin-top: 92px;
}

.station-section-heading {
    display: flex;
    justify-content: space-between;
    gap: 14px;
    align-items: flex-start;
    flex-wrap: wrap;
    margin-bottom: 12px;
}

.station-switcher {
    width: clamp(260px, 28vw, 360px);
}

.station-switcher .form-label {
    color: var(--atlas-muted);
    font-size: .72rem;
    font-weight: 800;
    letter-spacing: .04em;
    text-transform: uppercase;
}

.station-switcher .form-select {
    min-height: 34px;
}

.station-admin-header .card-body,
.page-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 18px;
}

.station-admin-header .card-body {
    padding: 18px;
}

.station-admin-section {
    color: var(--atlas-ink);
    font-size: 1.2rem;
    font-weight: 850;
    line-height: 1.2;
    margin-bottom: 8px;
    text-transform: uppercase;
}

.station-admin-header .page-title,
.page-header.station-admin-header .page-title {
    font-size: .92rem;
    font-weight: 800;
    line-height: 1.25;
    text-transform: uppercase;
}

.station-admin-header .subtitle-atlas {
    font-size: 0;
}

.station-admin-header .subtitle-atlas > * {
    font-size: .875rem;
}

.station-admin-actions {
    align-items: flex-end;
    display: flex;
    gap: 10px;
    justify-content: flex-end;
    min-width: min(460px, 100%);
}

.station-admin-toolbar {
    align-items: flex-end;
    background: #f8fafc;
    border: 1px solid #e6edf5;
    border-radius: 8px;
    box-shadow: 0 8px 18px rgba(15, 23, 42, .04);
    display: flex;
    gap: 12px;
    justify-content: flex-end;
    padding: 8px;
}

.station-admin-toolbar .btn {
    min-height: 34px;
}

.station-admin-toolbar .station-switcher {
    width: clamp(280px, 32vw, 370px);
}

.station-context-strip {
    display: flex;
    justify-content: flex-end;
    align-items: center;
    gap: 12px;
    padding: 8px;
    background: var(--atlas-surface-soft);
    border: 1px solid var(--atlas-border);
    border-radius: 8px;
    box-shadow: 0 8px 18px rgba(15, 23, 42, .04);
}

.station-breadcrumbs {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 6px;
    color: var(--atlas-muted);
    font-size: 12px;
    font-weight: 700;
}

.station-breadcrumbs a {
    color: var(--atlas-muted);
    text-decoration: none;
}

.station-breadcrumbs a:hover {
    color: var(--atlas-brand-light);
}

.station-breadcrumbs strong {
    color: var(--atlas-ink);
    font-weight: 850;
}

.station-context-switch {
    display: grid;
    gap: 4px;
    width: clamp(280px, 32vw, 390px);
}

.station-context-switch span {
    color: var(--atlas-muted);
    font-size: .72rem;
    font-weight: 800;
    letter-spacing: .04em;
    line-height: 1;
    text-transform: uppercase;
}

.station-context-card .card-body {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 18px;
    padding: 18px;
}

.station-context-section {
    color: var(--atlas-ink);
    font-size: 1.22rem;
    font-weight: 850;
    line-height: 1.2;
    margin-bottom: 8px;
    text-transform: uppercase;
}

.station-context-name {
    font-size: .94rem;
    font-weight: 800;
    line-height: 1.25;
    margin-bottom: 8px;
    text-transform: uppercase;
}

.station-context-meta {
    display: flex;
    flex-wrap: wrap;
    gap: 8px 18px;
    color: var(--atlas-muted);
    font-size: .875rem;
}

.station-context-meta strong {
    color: color-mix(in srgb, var(--atlas-ink) 78%, var(--atlas-muted));
}

.station-context-filter {
    display: grid;
    gap: 10px;
    padding: 12px;
    background: var(--atlas-surface);
    border: 1px solid var(--atlas-border);
    border-radius: 8px;
    box-shadow: var(--atlas-shadow);
}

.station-context-filter-title {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    justify-content: space-between;
    gap: 8px;
    color: var(--atlas-muted);
    font-size: 12px;
}

.station-context-filter-title span {
    font-weight: 850;
    letter-spacing: .04em;
    text-transform: uppercase;
}

.station-context-filter-title strong {
    color: var(--atlas-ink);
    font-size: 13px;
}

.station-context-filter-grid {
    display: grid;
    grid-template-columns: minmax(88px, .7fr) minmax(130px, 1fr) minmax(88px, .7fr) minmax(120px, 1fr) minmax(140px, 1fr) auto;
    gap: 10px;
    align-items: end;
}

.station-context-filter .form-label {
    color: var(--atlas-muted);
    font-size: 11px;
    font-weight: 800;
    line-height: 1;
    margin-bottom: 5px;
}

.station-context-filter-actions {
    display: flex;
    gap: 8px;
}

.station-secondary-nav {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    padding: 8px;
    background: var(--atlas-surface);
    border: 1px solid var(--atlas-border);
    border-radius: 8px;
    box-shadow: var(--atlas-shadow);
}

.station-secondary-nav a {
    display: inline-flex;
    align-items: center;
    min-height: 34px;
    padding: 7px 11px;
    border: 1px solid transparent;
    border-radius: 7px;
    color: var(--atlas-muted);
    font-size: 13px;
    font-weight: 750;
    line-height: 1.15;
    text-decoration: none;
}

.station-secondary-nav a:hover {
    border-color: var(--atlas-border);
    color: var(--atlas-brand-light);
}

.station-secondary-nav a.active {
    background: linear-gradient(135deg, var(--atlas-brand), var(--atlas-brand-light));
    border-color: var(--atlas-brand-light);
    color: #fff;
}

.station-title-link {
    color: var(--atlas-ink);
    display: inline-block;
    text-decoration: none;
}

.station-title-link:hover,
.station-title-link:focus {
    color: var(--atlas-brand);
    text-decoration: none;
}

.station-action-menu {
    min-width: 230px;
    padding: 6px;
    border-color: var(--atlas-border);
    border-radius: 8px;
    box-shadow: 0 14px 34px rgba(15, 23, 42, .16);
}

/* Permite que el menú de acciones salga del alto de la tabla en escritorio. */
.station-table-responsive {
    overflow: visible;
}

@media (max-width: 767.98px) {
    .station-table-responsive {
        overflow-x: auto;
    }
}

.station-action-menu .dropdown-item {
    display: flex;
    align-items: center;
    gap: 9px;
    border-radius: 7px;
    font-size: 13px;
    padding: 8px 10px;
}

.station-action-menu .dropdown-item i {
    color: var(--atlas-brand-light);
    width: 16px;
}

.station-catalog-row {
    grid-template-columns: minmax(210px, 1.1fr) minmax(220px, .9fr) auto;
}

.station-catalog-main {
    min-width: 0;
}

.station-structure-grid {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 8px;
    min-width: min(100%, 360px);
}

.station-structure-grid span,
.station-readonly-strip > div {
    display: grid;
    gap: 2px;
    padding: 8px 10px;
    border: 1px solid var(--atlas-border);
    border-radius: 8px;
    background: var(--atlas-surface-soft);
    color: var(--atlas-muted);
    font-size: 12px;
}

.station-structure-grid strong,
.station-readonly-strip strong {
    color: var(--atlas-ink);
    font-size: 16px;
    line-height: 1;
}

.station-readonly-strip {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 10px;
}

.station-card-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 16px;
}

.station-admin-card {
    display: grid;
    gap: 14px;
    padding: 16px;
    border: 1px solid var(--atlas-border);
    border-radius: 8px;
    background: var(--atlas-surface);
    box-shadow: 0 8px 20px rgba(15, 23, 42, .04);
}

.station-admin-head {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 12px;
}

.station-admin-meta {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 8px;
}

.station-admin-meta span {
    display: grid;
    gap: 2px;
    min-width: 0;
    padding: 8px 10px;
    border: 1px solid var(--atlas-border);
    border-radius: 8px;
    color: var(--atlas-muted);
    font-size: 11px;
    font-weight: 800;
    letter-spacing: .02em;
    text-transform: uppercase;
}

.station-admin-meta strong {
    overflow: hidden;
    color: var(--atlas-ink);
    font-size: 12px;
    font-weight: 750;
    letter-spacing: 0;
    text-overflow: ellipsis;
    text-transform: none;
    white-space: nowrap;
}

.station-admin-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    align-items: center;
}

@media (max-width: 992px) {
    .station-card-grid,
    .station-catalog-row,
    .station-structure-grid,
    .station-readonly-strip,
    .station-admin-meta {
        grid-template-columns: 1fr;
    }
}

.station-kpi-link {
    color: inherit;
    text-decoration: none;
    transition: border-color .15s ease, transform .15s ease, box-shadow .15s ease;
}

.station-kpi-link:hover {
    border-color: var(--atlas-brand-light);
    color: inherit;
    text-decoration: none;
    transform: translateY(-1px);
}

.module-page {
    display: grid;
    gap: 0;
}

.module-kpi-grid {
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 14px;
}

.module-kpi-card {
    display: grid;
    grid-template-columns: 34px minmax(0, 1fr);
    gap: 2px 12px;
    min-height: 118px;
    padding: 16px;
    color: var(--atlas-ink);
    text-decoration: none;
    transition: border-color .15s ease, transform .15s ease;
}

.module-kpi-card:hover {
    border-color: var(--atlas-brand-light);
    color: var(--atlas-ink);
    text-decoration: none;
    transform: translateY(-1px);
}

.module-kpi-card i {
    grid-row: span 3;
    color: var(--atlas-brand-light);
    font-size: 24px;
}

.module-kpi-card span {
    color: var(--atlas-muted);
    font-size: 12px;
    font-weight: 850;
    letter-spacing: .04em;
    text-transform: uppercase;
}

.module-kpi-card strong {
    font-size: 28px;
    line-height: 1;
}

.module-kpi-card small {
    color: var(--atlas-muted);
}

.module-report-list,
.module-finding-list {
    display: grid;
    gap: 10px;
}

.module-report-row,
.module-finding-row {
    background: var(--atlas-surface);
    border: 1px solid var(--atlas-border);
    border-radius: 8px;
    display: grid;
    grid-template-columns: minmax(0, 1fr) minmax(160px, auto);
    gap: 18px;
    align-items: center;
    padding: 14px 16px;
}

.module-report-row:last-child,
.module-finding-row:last-child {
    border-bottom: 1px solid var(--atlas-border);
}

.report-period-label {
    color: var(--atlas-ink);
    font-weight: 700;
}

.report-period-emphasis {
    color: var(--atlas-ink);
    font-weight: 800;
}

.report-metric-line {
    color: var(--atlas-muted);
    font-size: 13px;
    margin-top: 2px;
}

.report-metric-line strong {
    color: var(--atlas-ink);
    font-weight: 800;
}

.module-report-actions {
    align-items: center;
    display: flex;
    flex-wrap: nowrap;
    gap: 10px;
    justify-content: flex-end;
    white-space: nowrap;
}

.report-daily-context {
    align-items: center;
    background: #e0f2fe;
    border: 1px solid #7dd3fc;
    border-radius: 10px;
    box-shadow: 0 8px 20px rgba(15, 95, 158, .2);
    color: #075985 !important;
    display: flex;
    flex-wrap: wrap;
    gap: 8px 12px;
    padding: 12px 16px;
    width: fit-content;
}

.report-daily-context.is-monthly {
    background: #dcfce7;
    border-color: #86efac;
    color: #166534 !important;
}

.report-daily-context i {
    font-size: 20px;
}

.report-daily-context span {
    font-size: 12px;
    font-weight: 800;
    letter-spacing: .06em;
    text-transform: uppercase;
}

.report-daily-context strong {
    border-left: 1px solid currentColor;
    color: inherit !important;
    font-size: 17px;
    padding-left: 12px;
}

.report-daily-context span,
.report-daily-context i {
    color: inherit !important;
}

.module-report-title-line {
    align-items: center;
    display: flex;
    flex-wrap: wrap;
    gap: 7px;
    line-height: 1.25;
}

.module-report-period-line {
    align-items: baseline;
    color: var(--atlas-ink);
    display: flex;
    flex-wrap: wrap;
    gap: 4px;
    font-size: 14px;
    line-height: 1.35;
    margin-top: 2px;
}

.module-report-period-line strong {
    color: var(--atlas-ink);
    font-weight: 850;
}

.volumetric-side-upload .drop-zone,
.volumetric-side-upload .upload-shortcut-panel {
    min-height: 190px;
    padding: 22px 16px;
}

.volumetric-side-upload {
    align-self: flex-start;
}

.module-coverage-list {
    display: grid;
    gap: 10px;
}

.module-coverage-card {
    background: var(--atlas-surface);
    border: 1px solid var(--atlas-border);
    border-radius: 8px;
    color: var(--atlas-ink);
    display: grid;
    gap: 9px;
    padding: 14px 16px;
    text-decoration: none;
}

.module-coverage-card:hover {
    border-color: rgba(0, 102, 204, .35);
    color: var(--atlas-ink);
    transform: translateY(-1px);
}

.module-coverage-head {
    align-items: flex-start;
    display: flex;
    gap: 12px;
    justify-content: space-between;
}

.module-coverage-head strong {
    display: block;
    font-size: 16px;
    line-height: 1.2;
}

.module-coverage-head span:not(.badge),
.module-coverage-card small {
    color: var(--atlas-muted);
}

.report-analysis-page .module-filter-form {
    position: relative;
    z-index: 1;
}

.report-station-grid {
    display: grid;
    gap: 12px;
}

.report-station-card {
    background: var(--atlas-surface);
    border: 1px solid var(--atlas-border);
    border-radius: 8px;
    color: var(--atlas-ink);
    display: grid;
    gap: 12px;
    padding: 14px 16px;
    text-decoration: none;
    transition: border-color .15s ease, transform .15s ease;
}

.report-station-card:hover {
    border-color: var(--atlas-brand-light);
    color: var(--atlas-ink);
    text-decoration: none;
    transform: translateY(-1px);
}

.report-station-card strong,
.report-station-card small {
    display: block;
}

.report-card-metrics {
    display: grid;
    gap: 8px;
    grid-template-columns: repeat(4, minmax(0, 1fr));
}

.report-card-metrics span {
    background: var(--atlas-surface-soft);
    border: 1px solid var(--atlas-border);
    border-radius: 7px;
    color: var(--atlas-muted);
    font-size: 12px;
    padding: 8px 10px;
}

.report-card-metrics b {
    color: var(--atlas-ink);
    display: block;
    font-size: 14px;
}

.report-alert-stack {
    display: grid;
    gap: 10px;
}

.report-alert-card {
    background: var(--atlas-surface);
    border: 1px solid var(--atlas-border);
    border-left: 4px solid var(--atlas-brand);
    border-radius: 8px;
    color: var(--atlas-ink);
    display: grid;
    gap: 10px;
    padding: 12px 14px;
    text-decoration: none;
    transition: border-color .15s ease, transform .15s ease;
}

.report-alert-card:hover {
    color: var(--atlas-ink);
    text-decoration: none;
    transform: translateY(-1px);
}

.report-alert-card.is-critical,
.report-alert-card.merma-alert-danger {
    border-left-color: #dc2626;
}

.report-alert-card.is-warning,
.report-alert-card.merma-alert-warning {
    border-left-color: #f59e0b;
}

.report-alert-card.is-ok,
.report-alert-card.merma-alert-ok {
    border-left-color: #16a34a;
}

.report-alert-card strong,
.report-alert-card small {
    display: block;
}

.report-alert-card small {
    color: var(--atlas-muted);
    font-size: 12px;
}

.report-alert-metrics {
    color: var(--atlas-muted);
    display: grid;
    font-size: 12px;
    gap: 4px;
}

.report-alert-metrics b {
    color: var(--atlas-ink);
    font-weight: 850;
}

.report-kpi-grid {
    display: grid;
    gap: 14px;
    grid-template-columns: repeat(4, minmax(0, 1fr));
}

.report-balance-bars {
    display: grid;
    gap: 14px;
}

.report-balance-row {
    display: grid;
    gap: 7px;
}

.report-balance-row > div:first-child {
    align-items: center;
    display: flex;
    gap: 10px;
    justify-content: space-between;
}

.report-balance-row span {
    color: var(--atlas-muted);
    font-weight: 750;
}

.report-timeline {
    display: grid;
    gap: 10px;
    max-height: 520px;
    overflow-y: auto;
    padding-right: 4px;
}

.report-timeline-item {
    border: 1px solid var(--atlas-border);
    border-radius: 8px;
    padding: 10px 12px;
}

.report-timeline-item strong,
.report-timeline-item small {
    display: block;
}

.report-timeline-item p {
    color: var(--atlas-muted);
    font-size: 12px;
    line-height: 1.35;
    margin: 5px 0 0;
}

.report-product-stack {
    display: grid;
    gap: 16px;
}

.report-product-card {
    background: var(--atlas-surface);
    border: 1px solid var(--atlas-border);
    border-radius: 8px;
    padding: 16px;
}

.report-product-head {
    display: grid;
    gap: 6px;
}

.report-product-grid {
    display: grid;
    gap: 18px;
    grid-template-columns: minmax(0, 1.25fr) minmax(280px, .75fr);
    align-items: start;
}

.report-block-title {
    color: var(--atlas-ink);
    font-size: 13px;
    font-weight: 850;
    letter-spacing: .04em;
    margin: 0;
    text-transform: uppercase;
}

.report-table-fit {
    overflow-x: visible;
    width: 100%;
}

.report-balance-list {
    background: var(--atlas-surface-soft);
    border: 1px solid var(--atlas-border);
    border-radius: 8px;
    display: grid;
    gap: 0;
    overflow: hidden;
}

.report-balance-list > div {
    align-items: center;
    border-bottom: 1px solid var(--atlas-border);
    display: grid;
    gap: 12px;
    grid-template-columns: minmax(0, 1fr) minmax(120px, auto);
    padding: 9px 12px;
}

.report-balance-list > div:last-child {
    border-bottom: 0;
}

.report-balance-list span {
    color: var(--atlas-muted);
    font-size: 12px;
    font-weight: 850;
    letter-spacing: .03em;
    text-transform: uppercase;
}

.report-balance-list strong {
    color: var(--atlas-ink);
    font-size: 13px;
    text-align: right;
}

.report-mini-table {
    min-width: 0;
    table-layout: fixed;
    width: 100%;
}

.report-mini-table th,
.report-mini-table td {
    font-size: clamp(10px, .68vw, 12px);
    overflow-wrap: anywhere;
    padding: 8px 7px;
    white-space: normal;
}

.report-chart-box {
    background: var(--atlas-surface-soft);
    border: 1px solid var(--atlas-border);
    border-radius: 8px;
    padding: 12px;
}

.report-google-chart {
    min-height: 240px;
    width: 100%;
}

.report-product-summary-grid {
    display: grid;
    gap: 10px;
    grid-template-columns: repeat(4, minmax(0, 1fr));
}

.report-mini-kpi {
    background: var(--atlas-surface-soft);
    border: 1px solid var(--atlas-border);
    border-radius: 8px;
    padding: 10px 12px;
}

.report-mini-kpi span,
.report-mini-kpi strong,
.report-mini-kpi small {
    display: block;
}

.report-mini-kpi span {
    color: var(--atlas-muted);
    font-size: 10px;
    font-weight: 850;
    letter-spacing: .05em;
    text-transform: uppercase;
}

.report-mini-kpi strong {
    color: var(--atlas-ink);
    font-size: 20px;
    line-height: 1.15;
    margin-top: 4px;
}

.report-mini-kpi small {
    color: var(--atlas-muted);
    font-size: 11px;
    line-height: 1.3;
    margin-top: 3px;
}

.report-balance-compact {
    gap: 8px;
}

.report-balance-compact .report-balance-row {
    gap: 4px;
}

.report-balance-compact .report-balance-row > div:first-child {
    font-size: 11px;
}

.report-balance-compact .progress {
    height: 7px;
}

.report-comparison-bars {
    display: grid;
    gap: 7px;
}

.report-comparison-bars > div {
    align-items: center;
    background: var(--atlas-surface);
    border: 1px solid var(--atlas-border);
    border-radius: 7px;
    display: grid;
    gap: 8px;
    grid-template-columns: minmax(92px, .8fr) repeat(2, minmax(0, 1fr));
    padding: 8px 10px;
}

.report-comparison-bars span {
    color: var(--atlas-muted);
    font-size: 11px;
    font-weight: 850;
}

.report-comparison-bars b {
    color: var(--atlas-ink);
    font-size: 12px;
    text-align: right;
}

.report-vertical-chart {
    align-items: end;
    border-bottom: 1px solid var(--atlas-border);
    display: grid;
    gap: 10px;
    grid-template-columns: repeat(auto-fit, minmax(52px, 1fr));
    min-height: 205px;
    padding: 24px 8px 8px 34px;
    position: relative;
}

.report-vertical-chart::before {
    background: var(--atlas-border);
    bottom: 32px;
    content: "";
    left: 24px;
    position: absolute;
    top: 24px;
    width: 1px;
}

.report-vertical-chart::after {
    background: var(--atlas-border);
    bottom: 32px;
    content: "";
    height: 1px;
    left: 24px;
    position: absolute;
    right: 8px;
}

.report-chart-axis-max,
.report-chart-axis-min {
    color: var(--atlas-muted);
    font-size: 9px;
    font-weight: 800;
    left: 0;
    line-height: 1;
    max-width: 32px;
    overflow: hidden;
    position: absolute;
    text-align: right;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.report-chart-axis-max {
    top: 20px;
}

.report-chart-axis-min {
    bottom: 28px;
}

.report-chart-group {
    align-items: center;
    display: grid;
    gap: 8px;
    min-width: 0;
}

.report-chart-bars {
    align-items: end;
    display: flex;
    gap: 5px;
    height: 140px;
    justify-content: center;
}

.report-chart-bar {
    border-radius: 6px 6px 0 0;
    display: block;
    height: 0;
    min-height: 0;
    transform-origin: bottom;
    transition: height .85s cubic-bezier(.2, .8, .2, 1), box-shadow .2s ease, transform .2s ease;
    width: 18px;
}

.report-vertical-chart.is-visible .report-chart-bar {
    height: var(--bar-height, 4%);
    min-height: 4px;
}

.report-chart-bar:hover {
    box-shadow: 0 8px 18px rgba(15, 23, 42, .18);
    transform: translateY(-2px);
}

.report-vertical-chart-single .report-chart-bar {
    width: 24px;
}

.report-chart-operative {
    background: #0c639e;
}

.report-chart-fiscal {
    background: #14915f;
}

.report-chart-initial {
    background: #2563eb;
}

.report-chart-reception {
    background: #06b6d4;
}

.report-chart-delivery {
    background: #f59e0b;
}

.report-chart-calculated {
    background: #7c3aed;
}

.report-chart-real {
    background: #16a34a;
}

.report-chart-ok {
    background: #16a34a;
}

.report-chart-alert {
    background: #dc2626;
}

.report-chart-group small {
    color: var(--atlas-muted);
    display: block;
    font-size: 10px;
    font-weight: 800;
    line-height: 1.15;
    min-height: 14px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    text-align: center;
}

.report-merma-values-two {
    grid-template-columns: repeat(2, minmax(0, 1fr));
}

.report-merma-values em {
    color: var(--atlas-muted);
    display: block;
    font-size: 11px;
    font-style: normal;
    font-weight: 800;
    margin-top: 4px;
}

.report-timeline-paged {
    max-height: 720px;
    overflow-y: auto;
    padding-right: 4px;
}

.report-chart-legend {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    justify-content: center;
    margin-top: 10px;
}

.report-chart-legend span {
    align-items: center;
    color: var(--atlas-muted);
    display: inline-flex;
    font-size: 12px;
    font-weight: 800;
    gap: 5px;
}

.report-chart-legend i {
    border-radius: 999px;
    display: inline-block;
    height: 10px;
    width: 10px;
}

.report-doc-actions {
    display: grid;
    gap: 8px;
    grid-template-columns: repeat(2, minmax(0, 1fr));
}

.report-doc-actions .btn {
    width: 100%;
}

.report-doc-kpis {
    display: grid;
    gap: 10px;
    grid-template-columns: repeat(3, minmax(0, 1fr));
}

.report-doc-kpis > div {
    background: var(--atlas-surface-soft);
    border: 1px solid var(--atlas-border);
    border-radius: 8px;
    padding: 10px 12px;
}

.report-doc-kpis span {
    color: var(--atlas-muted);
    display: block;
    font-size: 11px;
    font-weight: 850;
    letter-spacing: .04em;
    text-transform: uppercase;
}

.report-doc-kpis strong {
    color: var(--atlas-ink);
    display: block;
    font-size: 18px;
    line-height: 1.2;
    margin-top: 4px;
}


@media (max-width: 640px) {
    .report-doc-actions {
        grid-template-columns: 1fr;
    }

    .report-doc-kpis {
        grid-template-columns: 1fr;
    }

}

.report-doc-list {
    display: grid;
    gap: 8px;
}

.report-doc-item {
    align-items: center;
    background: var(--atlas-surface-soft);
    border: 1px solid var(--atlas-border);
    border-radius: 8px;
    display: grid;
    gap: 10px;
    grid-template-columns: minmax(0, 1fr) auto;
    padding: 10px 12px;
}

.report-doc-item strong,
.report-doc-item small {
    display: block;
}

.report-doc-item small {
    color: var(--atlas-muted);
    line-height: 1.3;
}

.report-merma-panel {
    border: 1px solid var(--atlas-border);
    border-left: 4px solid var(--atlas-border);
    border-radius: 8px;
    display: grid;
    gap: 8px;
    padding: 12px;
}

.report-merma-panel.merma-alert-ok {
    border-left-color: #16a34a;
}

.report-merma-panel.merma-alert-warning {
    border-left-color: #f59e0b;
}

.report-merma-panel.merma-alert-danger {
    border-left-color: #dc2626;
    background: linear-gradient(90deg, rgba(220, 38, 38, .08), var(--atlas-surface) 58%);
}

.report-merma-panel > span {
    color: var(--atlas-muted);
    font-size: 11px;
    font-weight: 850;
    letter-spacing: .05em;
    text-transform: uppercase;
}

.report-merma-panel > strong {
    color: var(--atlas-ink);
    font-size: 22px;
    line-height: 1;
}

.report-merma-panel > small {
    color: var(--atlas-muted);
    line-height: 1.35;
}

.report-merma-values {
    display: grid;
    gap: 8px;
    grid-template-columns: repeat(3, minmax(0, 1fr));
}

.report-merma-values div {
    background: var(--atlas-surface-soft);
    border: 1px solid var(--atlas-border);
    border-radius: 7px;
    padding: 8px;
}

.report-merma-values b,
.report-merma-values small {
    display: block;
}

.report-merma-values small {
    color: var(--atlas-muted);
    font-size: 11px;
}

@media (max-width: 992px) {
    .report-product-grid,
    .report-doc-item {
        grid-template-columns: 1fr;
    }

    .report-product-summary-grid {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }

    .report-doc-item .text-end {
        text-align: left !important;
    }

    .report-merma-values {
        grid-template-columns: 1fr;
    }
}

@media (max-width: 576px) {
    .report-product-summary-grid {
        grid-template-columns: 1fr;
    }
}

.module-filter-form .form-label {
    color: var(--atlas-muted);
    font-size: 12px;
    font-weight: 800;
    letter-spacing: .04em;
    text-transform: uppercase;
}

.volumetric-station-bar .card-body {
    align-items: center;
    display: flex;
    gap: 16px;
    justify-content: space-between;
    padding: 14px 16px;
}

.volumetric-station-form {
    align-items: center;
    display: flex;
    gap: 10px;
    min-width: min(100%, 460px);
}

.volumetric-station-form .form-select {
    min-width: 260px;
}

.module-finding-row {
    grid-template-columns: auto minmax(0, 1fr) auto;
    color: var(--atlas-ink);
    text-decoration: none;
}

.module-finding-row:hover {
    color: var(--atlas-ink);
    text-decoration: none;
}

.module-finding-row small {
    display: block;
    color: var(--atlas-muted);
}

.module-filter-strip {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
}

.module-filter-strip span {
    display: inline-flex;
    align-items: center;
    min-height: 26px;
    padding: 4px 10px;
    border: 1px solid var(--atlas-border);
    border-radius: 999px;
    color: var(--atlas-muted);
    font-size: 12px;
    font-weight: 750;
}

.empty-state {
    padding: 28px 16px;
    border: 1px dashed var(--atlas-border);
    border-radius: 8px;
    color: var(--atlas-muted);
    text-align: center;
}

.station-data-grid {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 14px;
}

.station-tool-grid {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 14px;
}

.station-tool-card {
    display: grid;
    grid-template-columns: 34px minmax(0, 1fr);
    gap: 4px 12px;
    align-items: center;
    min-height: 104px;
    padding: 14px;
    border: 1px solid var(--atlas-border);
    border-radius: 8px;
    background: var(--atlas-surface);
    color: var(--atlas-ink);
    text-decoration: none;
    transition: border-color .15s ease, transform .15s ease;
}

.station-tool-card:hover {
    border-color: var(--atlas-brand-light);
    color: var(--atlas-ink);
    text-decoration: none;
    transform: translateY(-1px);
}

.station-tool-card i {
    grid-row: span 2;
    color: var(--atlas-brand);
    font-size: 22px;
}

.station-tool-card span {
    font-weight: 750;
}

.station-tool-card small {
    color: var(--atlas-muted);
    line-height: 1.35;
}

.station-tool-card-muted {
    cursor: default;
    opacity: .72;
}

.station-tool-card-muted:hover {
    border-color: var(--atlas-border);
    transform: none;
}

.report-type-badge {
    display: inline-flex;
    align-items: center;
    min-height: 22px;
    padding: 3px 8px;
    border-radius: 999px;
    border: 1px solid transparent;
    font-size: 11px;
    font-weight: 800;
    line-height: 1;
}

.report-type-daily {
    color: #075985;
    background: #e0f2fe;
    border-color: #7dd3fc;
}

.report-type-monthly {
    color: #166534;
    background: #dcfce7;
    border-color: #86efac;
}

.xml-summary-head {
    align-items: flex-start;
    background: #f8fafc;
    border: 1px solid #e6edf5;
    border-radius: 8px;
    display: flex;
    gap: 14px;
    justify-content: space-between;
    padding: 14px;
}

.xml-summary-period {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
    justify-content: flex-end;
}

.xml-summary-product-grid {
    display: grid;
    gap: 12px;
}

.xml-summary-product .card-body {
    padding: 14px;
}

.xml-summary-table {
    min-width: 760px;
}

.xml-summary-table th {
    white-space: nowrap;
}

.xml-summary-table td {
    white-space: nowrap;
}

@media (max-width: 992px) {
    .page-header .station-switcher {
        width: 100%;
    }

    .station-admin-header .card-body,
    .page-header {
        align-items: stretch;
        flex-direction: column;
    }

    .station-admin-actions {
        align-items: stretch;
        flex-direction: column-reverse;
        width: 100%;
    }

    .station-admin-toolbar {
        align-items: stretch;
        flex-direction: column-reverse;
        gap: 8px;
        padding: 10px;
    }

    .station-switcher {
        width: 100%;
    }

    .station-admin-toolbar .station-switcher {
        width: 100%;
    }

    .xml-summary-head {
        flex-direction: column;
    }

    .xml-summary-period {
        justify-content: flex-start;
    }

    .station-data-grid {
        grid-template-columns: 1fr;
    }

    .station-tool-grid {
        grid-template-columns: 1fr;
    }
}

/* ====== MERMAS ====== */
.merma-kpi-card {
    height: 100%;
    padding: 8px 10px;
    border-radius: 7px;
}

.merma-kpi-label {
    color: var(--atlas-muted);
    font-size: 9px;
    font-weight: 750;
    letter-spacing: .06em;
    text-transform: uppercase;
}

.merma-kpi-value {
    color: var(--atlas-ink);
    font-size: 16px;
    font-weight: 750;
    line-height: 1.1;
    margin-top: 3px;
    overflow-wrap: anywhere;
}

.merma-kpi-meta {
    color: var(--atlas-muted);
    font-size: 10px;
    margin-top: 3px;
}

.notification-card {
    border: 1px solid var(--atlas-border);
    border-left: 3px solid var(--atlas-brand);
    border-radius: 8px;
    padding: 12px;
    height: 100%;
    background: var(--atlas-surface);
}

.merma-initial-card {
    border: 1px solid rgba(245, 158, 11, .28);
    border-left: 4px solid #f59e0b;
    border-radius: 8px;
    color: var(--atlas-ink);
}

.merma-initial-form {
    background: var(--atlas-surface);
    border: 1px solid var(--atlas-border);
    border-radius: 8px;
    padding: 8px 10px;
}

.merma-chart-card {
    min-height: 380px;
}

    .merma-chart-card .card-body {
        height: 320px;
    }

.merma-table-wrap {
    max-height: none;
    overflow-x: visible !important;
}

    .merma-table-wrap table {
        width: 100%;
        min-width: 0;
        table-layout: fixed;
    }

    .merma-table-wrap th,
    .merma-table-wrap td {
        white-space: normal;
        overflow-wrap: anywhere;
        vertical-align: middle;
    }

    .merma-table-wrap th {
        font-size: 11px;
        line-height: 1.2;
    }

    .merma-table-wrap td {
        font-size: 12px;
    }

.merma-alert-card {
    height: 100%;
    padding: 10px 12px;
    border-left: 3px solid var(--atlas-border);
}

.merma-alert-ok {
    border-left-color: #16a34a;
}

.merma-alert-warning {
    border-left-color: #f59e0b;
}

.merma-alert-danger {
    border-left-color: #dc2626;
}

.merma-alert-critical {
    border-left-color: #111827;
    background: linear-gradient(90deg, rgba(17, 24, 39, .10), var(--atlas-surface) 48%);
    box-shadow: 0 0 0 1px rgba(17, 24, 39, .14), 0 10px 24px rgba(17, 24, 39, .10);
}

.merma-ticket-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
    gap: 10px;
}

.merma-ticket-month-list {
    display: grid;
    gap: 14px;
}

.merma-ticket-month-title {
    color: var(--atlas-muted);
    font-size: 11px;
    font-weight: 800;
    letter-spacing: .06em;
    margin-bottom: 7px;
    text-transform: uppercase;
}

.merma-ticket-grid-products {
    grid-template-columns: repeat(3, minmax(0, 1fr));
}

.merma-ticket-grid-analysis {
    grid-template-columns: repeat(6, minmax(0, 1fr));
}

.merma-ticket {
    min-height: 96px;
    padding: 9px 10px;
    border: 1px solid var(--atlas-border);
    border-left: 3px solid var(--atlas-border);
    border-radius: 8px;
    background: var(--atlas-surface);
}

.merma-ticket-ok {
    border-left-color: #16a34a;
}

.merma-ticket-warning {
    border-left-color: #f59e0b;
}

.merma-ticket-danger {
    border-left-color: #dc2626;
}

.merma-ticket-critical {
    border-left-color: #111827;
    background: linear-gradient(90deg, rgba(17, 24, 39, .12), var(--atlas-surface) 55%);
    box-shadow: 0 0 0 1px rgba(17, 24, 39, .16);
}

.merma-ticket-value {
    margin-top: 7px;
    color: var(--atlas-ink);
    font-size: 16px;
    font-weight: 750;
    line-height: 1;
}

@media (max-width: 768px) {
    .merma-kpi-value {
        font-size: 16px;
    }

    .merma-chart-card .card-body {
        height: 280px;
    }

    .merma-ticket-grid-products,
    .merma-ticket-grid-analysis {
        grid-template-columns: 1fr;
    }
}

@media (min-width: 769px) and (max-width: 1200px) {
    .merma-ticket-grid-analysis {
        grid-template-columns: repeat(3, minmax(0, 1fr));
    }
}

/* ====== XML DIARIO ====== */
.daily-kpi-grid,
.daily-workspace-grid,
.daily-coverage-grid,
.daily-report-grid {
    display: grid;
    gap: 14px;
}

.daily-kpi-grid {
    grid-template-columns: repeat(3, minmax(0, 1fr));
}

.daily-workspace-grid {
    grid-template-columns: minmax(360px, .95fr) minmax(420px, 1.05fr);
    align-items: start;
}

.daily-workspace-grid > .daily-panel:first-child,
.daily-workspace-grid > .alert:first-child {
    order: 2;
}

.daily-workspace-grid > .daily-panel:nth-child(2) {
    order: 1;
}

.daily-coverage-grid {
    grid-template-columns: repeat(3, minmax(0, 1fr));
}

.daily-report-grid {
    max-height: 560px;
    overflow-y: auto;
    padding-right: 4px;
}

.daily-panel {
    height: 100%;
}

.daily-filter-card .card-body {
    padding: 16px;
}

.daily-drop-zone {
    min-height: 136px;
    padding: 22px 16px;
}

.daily-report-card {
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto;
    gap: 12px;
    align-items: center;
    padding: 12px;
    border: 1px solid var(--atlas-border);
    border-radius: 8px;
    background: var(--atlas-surface);
}

.daily-report-actions {
    justify-content: flex-end;
}

.daily-kpi {
    height: 100%;
    padding: 14px 16px;
}

.daily-kpi-label {
    color: var(--atlas-muted);
    font-size: 11px;
    font-weight: 750;
    letter-spacing: .08em;
    text-transform: uppercase;
}

.daily-kpi-value {
    color: var(--atlas-ink);
    font-size: 30px;
    font-weight: 750;
    line-height: 1;
    margin-top: 8px;
}

.daily-kpi-meta {
    color: var(--atlas-muted);
    font-size: 12px;
    margin-top: 8px;
}

.daily-coverage-card {
    display: flex;
    flex-direction: column;
    gap: 12px;
    padding: 14px;
    border: 1px solid var(--atlas-border);
    border-radius: 8px;
    background: var(--atlas-surface);
}

.daily-coverage-head {
    display: flex;
    justify-content: space-between;
    gap: 10px;
    align-items: flex-start;
}

.daily-progress-cell {
    min-width: 0;
}

.daily-progress {
    height: 9px;
    background: var(--atlas-surface-soft);
}

.daily-missing {
    margin-top: 6px;
    color: var(--atlas-muted);
    font-size: 12px;
    overflow-wrap: anywhere;
}

.daily-complement-list {
    display: grid;
    gap: 8px;
}

.station-detail-coverage-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
}

.station-inline-upload {
    background: var(--atlas-surface-soft);
    border: 1px solid var(--atlas-border);
    border-radius: 8px;
    display: flex;
    flex-direction: column;
    padding: 16px;
}

.station-inline-upload .drop-zone,
.station-inline-upload .upload-shortcut-panel {
    min-height: 164px;
}

.home-hero {
    align-items: flex-start;
}

.home-module-grid {
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 16px;
}

.home-module-card {
    display: grid;
    grid-template-columns: 44px minmax(0, 1fr);
    gap: 14px;
    padding: 16px;
    text-decoration: none;
    color: inherit;
    min-height: 122px;
    transition: transform .16s ease, border-color .16s ease, box-shadow .16s ease;
}

.home-module-card:hover {
    color: inherit;
    border-color: rgba(12, 99, 158, .35);
    box-shadow: 0 12px 28px rgba(15, 23, 42, .09);
    transform: translateY(-1px);
}

.home-module-icon {
    width: 44px;
    height: 44px;
    border-radius: 8px;
    display: grid;
    place-items: center;
    color: var(--atlas-primary);
    background: rgba(12, 99, 158, .1);
    font-size: 20px;
}

.home-module-label {
    color: var(--atlas-muted);
    font-size: 11px;
    font-weight: 750;
    letter-spacing: .08em;
    text-transform: uppercase;
}

.home-module-value {
    color: var(--atlas-ink);
    font-size: 30px;
    font-weight: 800;
    line-height: 1;
    margin-top: 8px;
}

.home-module-meta {
    color: var(--atlas-muted);
    font-size: 12px;
    margin-top: 8px;
}

.search-result-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 16px;
}

.search-result-card {
    min-width: 0;
}

.home-action-grid {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 12px;
}

.home-action-item,
.home-coverage-item,
.home-compact-row,
.home-activity-item {
    border: 1px solid var(--atlas-border);
    border-radius: 8px;
    background: var(--atlas-surface);
}

.home-action-item {
    padding: 14px;
}

.home-compact-list,
.home-coverage-stack,
.home-activity-list {
    display: grid;
    gap: 10px;
}

.home-compact-row {
    display: grid;
    grid-template-columns: minmax(0, 1fr) minmax(170px, auto);
    gap: 18px;
    align-items: center;
    padding: 14px 16px;
}

.home-coverage-item {
    display: block;
    color: inherit;
    padding: 12px;
    text-decoration: none;
}

.home-coverage-item:hover {
    color: inherit;
    border-color: rgba(12, 99, 158, .35);
}

.home-mini-bars {
    height: 8px;
    border-radius: 999px;
    background: var(--atlas-surface-soft);
    overflow: hidden;
}

.home-mini-bars > div {
    height: 100%;
    border-radius: inherit;
    background: linear-gradient(90deg, var(--atlas-primary), #14915f);
}

.home-activity-item {
    display: grid;
    grid-template-columns: auto minmax(0, 1fr);
    align-items: start;
    gap: 10px;
    padding: 10px 12px;
}

.home-merma-alert-grid {
    display: grid;
    gap: 0.85rem;
}

.home-merma-alert-card {
    border: 1px solid #dbe3ec;
    border-left: 4px solid #0f8a53;
    border-radius: 8px;
    padding: 1rem;
    background: linear-gradient(90deg, rgba(15, 138, 83, 0.06), #fff 42%);
}

.home-merma-alert-card.merma-alert-warning {
    border-left-color: #f59e0b;
    background: linear-gradient(90deg, rgba(245, 158, 11, 0.08), #fff 42%);
}

.home-merma-alert-card.merma-alert-danger,
.home-merma-alert-card.merma-alert-critical {
    border-left-color: #dc2626;
    background: linear-gradient(90deg, rgba(220, 38, 38, 0.08), #fff 42%);
}

.home-merma-alert-card h6 {
    margin: 0;
    font-size: 1.05rem;
    font-weight: 800;
}

.home-merma-alert-card p {
    margin: 0.85rem 0;
    font-weight: 700;
    line-height: 1.35;
}

.home-merma-values {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 0.65rem;
}

.home-merma-values > div {
    border: 1px solid #dbe3ec;
    border-radius: 7px;
    background: #f8fafc;
    padding: 0.65rem;
}

.home-merma-values span,
.home-merma-values small {
    display: block;
    color: #64748b;
    font-size: 0.74rem;
    font-weight: 700;
}

.home-merma-values strong {
    display: block;
    font-size: 1.25rem;
    line-height: 1.1;
}

@media (max-width: 992px) {
    .daily-kpi-grid,
    .daily-workspace-grid,
    .daily-coverage-grid,
    .home-module-grid,
    .home-action-grid {
        grid-template-columns: 1fr;
    }

    .daily-report-card {
        grid-template-columns: 1fr;
    }

    .daily-report-actions {
        justify-content: flex-start;
    }

    .home-compact-row {
        grid-template-columns: 1fr;
    }
}

@media (min-width: 993px) and (max-width: 1280px) {
    .daily-coverage-grid,
    .home-module-grid,
    .home-action-grid {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }
}
.station-summary-page {
    display: block;
}

.station-summary-card-head {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 1rem;
    flex-wrap: wrap;
    margin-bottom: 1rem;
}

.station-summary-progress-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
}

.station-summary-chart-wrap {
    min-height: 340px;
    height: 38vh;
    max-height: 460px;
}

@media (max-width: 768px) {
    .station-summary-progress-grid {
        grid-template-columns: 1fr;
    }

    .station-summary-chart-wrap {
        min-height: 280px;
        height: 320px;
    }
}
