/* SIRUTA - estilos de interfaz consolidados para reutilización.
   Fuente: vistas Blade del proyecto. No requiere Tailwind ni Vite.
   Uso: <link rel="stylesheet" href="siruta-estilos-completos.css">
*/

/* Base y temas - resources/views/layouts/app.blade.php */
/* =========================================================
           VARIABLES DE TEMA
        ========================================================= */

        /* Claro por defecto (:root) para evitar flash oscuro al cargar.
           Oscuro solo con data-theme="dark" ya presente en el HTML. */
        :root {
            --bg-main: #f4f7f6;
            --bg-header: #ffffff;
            --bg-card: #ffffff;
            --bg-card-secondary: #f8fafc;

            --border: #d8e0e7;
            --border-light: #cbd5df;

            --text-primary: #142033;
            --text-secondary: #58718c;
            --text-muted: #7890a5;

            --green: #16a34a;
            --green-hover: #15803d;

            --red: #ef4444;
            --red-hover: #dc2626;

            --blue: #2563eb;
            --purple: #7c3aed;

            --input-bg: #ffffff;
            --input-border: #cbd5e1;

            --shadow: 0 15px 40px rgba(15, 23, 42, 0.10);
        }

        html[data-theme="dark"] {
            --bg-main: #0f141b;
            --bg-header: #151c25;
            --bg-card: #1b2430;
            --bg-card-secondary: #202c39;

            --border: #334354;
            --border-light: #3d4d5f;

            --text-primary: #f4f7fa;
            --text-secondary: #91abc4;
            --text-muted: #71869b;

            --green: #16a34a;
            --green-hover: #15803d;

            --red: #ef4444;
            --red-hover: #dc2626;

            --blue: #3b82f6;
            --purple: #7c3aed;

            --input-bg: #202c39;
            --input-border: #405266;

            --shadow: 0 20px 50px rgba(0, 0, 0, 0.25);
        }

        /* =========================================================
           BASE
        ========================================================= */

        * {
            box-sizing: border-box;
        }

        html,
        body {
            margin: 0;
            padding: 0;
            min-height: 100%;
        }

        body {
            font-family:
                Inter,
                ui-sans-serif,
                system-ui,
                -apple-system,
                BlinkMacSystemFont,
                "Segoe UI",
                sans-serif;

            background: var(--bg-main);
            color: var(--text-primary);
        }

        a {
            color: inherit;
            text-decoration: none;
        }

        button,
        input,
        select {
            font: inherit;
        }

        /* =========================================================
           ENCABEZADO GLOBAL
        ========================================================= */

        .app-header {
            width: 100%;
            min-height: 80px;

            background: var(--bg-header);
            border-bottom: 1px solid var(--border);

            transition:
                background-color 0.25s ease,
                border-color 0.25s ease;
        }

        .app-header-inner {
            width: min(1260px, calc(100% - 48px));
            min-height: 80px;

            margin: 0 auto;
            /* Espacio para el botón fijo «Menú» (no debe tapar el logo) */
            padding: 12px 0 12px 64px;
            box-sizing: border-box;

            display: flex;
            align-items: center;
            justify-content: space-between;

            gap: 20px;
        }

        .brand-area {
            display: flex;
            align-items: center;
            justify-content: flex-start;
            gap: 16px;
            min-width: 0;
            flex: 1 1 auto;
        }

        .brand {
            font-size: 22px;
            line-height: 1.15;
            font-weight: 700;
            letter-spacing: 0.28em;
            text-transform: uppercase;

            color: var(--text-primary);

            max-width: 260px;
        }

        /* Logo rectangular (~172:77). Solo altura fija; ancho automático. */
        .brand-logo {
            display: block;
            height: 52px;
            width: auto;
            max-width: min(160px, 36vw);
            aspect-ratio: 172 / 77;
            object-fit: contain;
            object-position: left center;
            border-radius: 6px;
            flex-shrink: 0;
            background: #fff;
            padding: 3px 5px;
            filter: none;
            box-shadow: 0 0 0 1px color-mix(in srgb, var(--border) 80%, transparent);
        }

        .header-title h1 {
            font-size: 26px;
        }

        .brand-divider {
            width: 1px;
            height: 44px;
            background: var(--border);
            flex-shrink: 0;
        }

        .header-title {
            min-width: 0;
        }

        .header-title h1 {
            margin: 0;

            font-size: 30px;
            line-height: 1.1;
            font-weight: 750;

            color: var(--text-primary);
        }

        .header-title p {
            margin: 7px 0 0;

            font-size: 16px;
            color: var(--text-secondary);
        }

        .header-actions {
            display: flex;
            align-items: center;
            gap: 14px;
            flex-shrink: 0;
        }

        .theme-button {
            width: 6px;
            height: 6px;

            border: 1px solid var(--border);
            border-radius: 50%;

            background: transparent;
            color: var(--text-primary);

            display: flex;
            align-items: center;
            justify-content: center;

            cursor: pointer;

            font-size: 23px;

            transition:
                background-color 0.2s ease,
                border-color 0.2s ease,
                transform 0.2s ease;
        }

        .theme-button:hover {
            background: var(--bg-card-secondary);
            border-color: var(--border-light);
            transform: scale(1.04);
        }

        .header-user {
            color: var(--text-secondary);
            font-size: 15px;
            white-space: nowrap;
        }

        .logout-button {
            border: 0;
            border-radius: 8px;

            background: var(--red);
            color: #ffffff;

            padding: 13px 20px;

            font-weight: 700;
            font-size: 14px;

            cursor: pointer;

            transition:
                background-color 0.2s ease,
                transform 0.2s ease;
        }

        .logout-button:hover {
            background: var(--red-hover);
            transform: translateY(-1px);
        }

        /* =========================================================
           CONTENIDO
        ========================================================= */

        .app-main {
            width: min(1260px, calc(100% - 48px));
            margin: 0 auto;

            padding: 46px 0 70px;
        }

        /* =========================================================
           BOTÓN VOLVER
        ========================================================= */

        .back-button {
            display: inline-flex;
            align-items: center;
            gap: 7px;

            padding: 11px 16px;

            border: 1px solid var(--border);
            border-radius: 8px;

            background: var(--bg-card);
            color: var(--text-secondary);

            font-size: 14px;
            font-weight: 700;

            transition:
                background-color 0.2s ease,
                border-color 0.2s ease,
                color 0.2s ease,
                transform 0.2s ease;
        }

        .back-button:hover {
            background: var(--bg-card-secondary);
            border-color: var(--border-light);
            color: var(--text-primary);
            transform: translateY(-1px);
        }

        /* =========================================================
           TARJETAS
        ========================================================= */

        .card {
            background: var(--bg-card);

            border: 1px solid var(--border);
            border-radius: 16px;

            box-shadow: var(--shadow);

            transition:
                background-color 0.25s ease,
                border-color 0.25s ease;
        }

        /* =========================================================
           FORMULARIOS
        ========================================================= */

        .form-label {
            display: block;

            margin-bottom: 8px;

            color: var(--text-primary);

            font-size: 14px;
            font-weight: 700;
        }

        .required {
            color: #ef4444;
        }

        .form-input,
        .form-select {
            width: 100%;

            min-height: 48px;

            padding: 12px 14px;

            border: 1px solid var(--input-border);
            border-radius: 8px;

            background: var(--input-bg);
            color: var(--text-primary);

            outline: none;

            transition:
                border-color 0.2s ease,
                box-shadow 0.2s ease,
                background-color 0.25s ease,
                color 0.25s ease;
        }

        .form-input::placeholder {
            color: var(--text-muted);
        }

        .form-input:focus,
        .form-select:focus {
            border-color: var(--green);

            box-shadow:
                0 0 0 3px rgba(22, 163, 74, 0.12);
        }

        .form-help {
            margin-top: 6px;

            color: var(--text-secondary);

            font-size: 12px;
        }

        /* =========================================================
           BOTONES
        ========================================================= */

        .btn {
            display: inline-flex;
            align-items: center;
            justify-content: center;
            gap: 7px;

            min-height: 44px;

            padding: 10px 18px;

            border-radius: 8px;

            font-size: 14px;
            font-weight: 700;

            cursor: pointer;

            border: 1px solid transparent;

            transition:
                background-color 0.2s ease,
                border-color 0.2s ease,
                color 0.2s ease,
                transform 0.2s ease;
        }

        .btn:hover {
            transform: translateY(-1px);
        }

        .btn-green {
            background: var(--green);
            color: #ffffff;
        }

        .btn-green:hover {
            background: var(--green-hover);
        }

        .btn-secondary {
            background: var(--bg-card-secondary);
            border-color: var(--border);
            color: var(--text-primary);
        }

        .btn-secondary:hover {
            border-color: var(--border-light);
        }

        .btn-red {
            background: var(--red);
            color: #ffffff;
        }

        .btn-red:hover {
            background: var(--red-hover);
        }

        .btn:disabled {
            opacity: 0.6;
            cursor: not-allowed;
            transform: none;
        }

        .pqrsd-modal {
            width: min(440px, calc(100vw - 32px));
            max-width: calc(100vw - 32px);
            margin: auto;
            padding: 0;
            border: 1px solid var(--border);
            border-radius: 12px;
            background: var(--bg-card);
            color: var(--text-primary);
            box-shadow: var(--shadow);
        }

        .pqrsd-modal::backdrop {
            background: rgba(15, 20, 27, 0.62);
        }

        html[data-theme="light"] .pqrsd-modal::backdrop {
            background: rgba(20, 32, 51, 0.4);
        }

        .pqrsd-modal-contenido {
            padding: 22px;
        }

        .pqrsd-modal h2 {
            margin: 0 0 8px;
            color: var(--text-primary);
            font-size: 1.15rem;
        }

        .pqrsd-modal p {
            margin: 0 0 18px;
            color: var(--text-secondary);
        }

        .pqrsd-modal-acciones {
            display: flex;
            gap: 10px;
            flex-wrap: wrap;
            justify-content: flex-end;
        }

        .pqrsd-modal .form-input {
            width: 100%;
            margin: 0 0 18px;
        }

        .pqrsd-retorno {
            margin: 0 0 6px;
        }

        .pqrsd-retorno a {
            color: var(--text-secondary);
            font-weight: 700;
            text-decoration: none;
        }

        .pqrsd-modal [hidden],
        #pqrsd-aviso[hidden] {
            display: none !important;
        }

        /* =========================================================
           MENSAJES
        ========================================================= */

        .alert {
            border-radius: 9px;
            padding: 13px 15px;
            margin-bottom: 20px;

            font-size: 14px;
        }

        .alert-error {
            background: rgba(239, 68, 68, 0.10);
            border: 1px solid rgba(239, 68, 68, 0.35);
            color: #ef4444;
        }

        .alert-success {
            background: rgba(22, 163, 74, 0.10);
            border: 1px solid rgba(22, 163, 74, 0.30);
            color: var(--green);
        }

        /* =========================================================
           RESPONSIVE
        ========================================================= */

        @media (max-width: 900px) {
            .app-header-inner {
                min-height: auto;
                padding: 14px 0 14px 80px;

                align-items: center;
            }

            .brand-area {
                gap: 12px;
            }

            .brand-logo {
                height: 44px;
                max-width: min(140px, 42vw);
            }

            .brand-divider {
                display: none;
            }

            .header-title h1 {
                font-size: 23px;
            }

            .header-title p {
                font-size: 13px;
            }

            .brand {
                font-size: 16px;
                max-width: 180px;
            }

            .header-user {
                display: none;
            }
        }

        @media (max-width: 650px) {
            .app-header-inner,
            .app-main {
                width: min(100% - 28px, 1260px);
            }

            .app-header-inner {
                flex-wrap: wrap;
                gap: 10px;
                padding: 12px 0 12px 88px;
            }

            .brand-area {
                width: auto;
                flex: 1 1 auto;
                min-width: 0;
                gap: 10px;
            }

            .brand-logo {
                height: 36px;
                max-width: min(112px, 40vw);
            }

            .header-actions {
                flex-shrink: 0;
                justify-content: flex-end;
            }

            .app-main {
                padding-top: 28px;
            }
        }

/* Navegación - resources/views/navigation.blade.php */
.siruta-menu-trigger {
            position: fixed;
            top: 14px;
            left: 14px;
            z-index: 1200;
            border: 1px solid #58718c;
            border-radius: 9px;
            padding: 10px 14px;
            background: #19222d;
            color: #fff;
            cursor: pointer;
            font: 600 14px system-ui, sans-serif;
            box-shadow: 0 8px 24px rgb(0 0 0 / 25%);
        }
        .siruta-menu-backdrop {
            position: fixed;
            inset: 0;
            z-index: 1290;
            border: 0;
            margin: 0;
            padding: 0;
            background: rgb(0 0 0 / 45%);
            cursor: pointer;
        }
        .siruta-menu-backdrop[hidden] { display: none; }
        .siruta-navigation {
            position: fixed;
            top: 0;
            left: 0;
            bottom: 0;
            z-index: 1300;
            width: min(320px, 88vw);
            height: 100dvh;
            margin: 0;
            border: 0;
            border-right: 1px solid #334252;
            padding: 24px;
            background: #19222d;
            color: #f4f7fa;
            font: 15px system-ui, sans-serif;
            overflow-y: auto;
            transform: translateX(-105%);
            transition: transform 0.22s ease;
            box-shadow: 12px 0 40px rgb(0 0 0 / 35%);
        }
        .siruta-navigation.is-open { transform: translateX(0); }
        .siruta-navigation header {
            display: flex;
            align-items: center;
            justify-content: space-between;
            margin-bottom: 24px;
            gap: 12px;
        }
        .siruta-navigation button {
            cursor: pointer;
            background: transparent;
            color: inherit;
            border: 1px solid #58718c;
            border-radius: 8px;
            padding: 8px 12px;
        }
        .siruta-navigation a {
            display: block;
            padding: 12px;
            margin: 5px 0;
            color: inherit;
            text-decoration: none;
            border-radius: 8px;
        }
        .siruta-navigation a:hover,
        .siruta-navigation a[aria-current="page"] {
            background: rgb(22 163 74 / 18%);
            box-shadow: inset 3px 0 #16a34a;
        }
        .siruta-navigation small {
            display: block;
            font-size: 12px;
            margin-top: 5px;
            color: #a5b9cb;
        }
        .siruta-navigation h2 {
            margin-top: 24px;
            font-size: 13px;
            text-transform: uppercase;
            letter-spacing: .07em;
        }
        html:not([data-theme="dark"]) .siruta-navigation,
        html:not([data-theme="dark"]) .siruta-menu-trigger {
            background: #fff;
            color: #142033;
            border-color: #d8e0e5;
        }
        html:not([data-theme="dark"]) .siruta-navigation small { color: #58718c; }
        html.siruta-menu-open { overflow: hidden; }

/* Selección de programa - resources/views/programa-la-maria.blade.php */
.la-maria-hub {
            width: min(760px, 100%);
            margin: 28px auto 0;
            padding: 32px;
        }

        .la-maria-hub h2 {
            margin: 0;
            font-size: 26px;
        }

        .la-maria-hub > p {
            margin: 12px 0 28px;
            color: var(--text-secondary);
            line-height: 1.6;
        }

        .la-maria-hub-choices {
            display: grid;
            gap: 14px;
        }

        .la-maria-hub-choices a {
            display: block;
            padding: 18px 20px;
            border: 1px solid var(--border-soft);
            border-radius: 10px;
            color: inherit;
            text-decoration: none;
            background: var(--surface-soft);
        }

        .la-maria-hub-choices a:hover {
            border-color: var(--green);
            box-shadow: inset 3px 0 var(--green);
        }

        .la-maria-hub-choices strong {
            display: block;
            font-size: 18px;
        }

        .la-maria-hub-choices small {
            display: block;
            margin-top: 6px;
            color: var(--text-secondary);
            line-height: 1.5;
        }

/* Seguimiento de rutas - resources/views/seguimiento-rutas.blade.php */
.route-follow-up-card {
            width: min(760px, 100%);
            margin: 28px auto 0;
            padding: 32px;
        }

        .route-follow-up-card h2 {
            margin: 0;
            font-size: 26px;
        }

        .route-follow-up-card > p {
            margin: 12px 0 28px;
            color: var(--text-secondary);
            line-height: 1.6;
        }

        .route-follow-up-form {
            display: grid;
            gap: 20px;
        }

        .route-follow-up-actions {
            display: flex;
            align-items: center;
            gap: 12px;
            flex-wrap: wrap;
        }

        .route-follow-up-rules {
            margin: 0;
            padding-left: 20px;
            color: var(--text-secondary);
            line-height: 1.75;
        }

        .catalog-readiness {
            margin: 0;
            padding: 16px;
            border: 1px solid var(--border-soft);
            border-radius: 10px;
            color: var(--text-secondary);
            line-height: 1.65;
        }

        .catalog-readiness ul {
            margin: 8px 0 0;
            padding-left: 20px;
        }

        .catalog-ready {
            color: var(--green);
            font-weight: 700;
        }

        .catalog-pending {
            color: var(--red);
            font-weight: 700;
        }

        .upload-progress {
            padding: 14px;
            border: 1px solid var(--border-soft);
            border-radius: 10px;
            background: var(--surface-soft);
        }

        .upload-progress[hidden],
        .upload-progress-error[hidden] {
            display: none;
        }

        .upload-progress-label {
            display: flex;
            justify-content: space-between;
            gap: 16px;
            margin-bottom: 9px;
            color: var(--text-secondary);
            font-size: 13px;
            font-weight: 700;
        }

        .upload-progress-track {
            height: 9px;
            overflow: hidden;
            border-radius: 999px;
            background: var(--border-soft);
        }

        .upload-progress-bar {
            width: 0;
            height: 100%;
            border-radius: inherit;
            background: var(--green);
            transition: width 0.2s ease;
        }

        .upload-progress-error {
            margin: 0;
            color: var(--red);
            font-size: 13px;
            line-height: 1.5;
        }

        @media (max-width: 650px) {
            .route-follow-up-card {
                padding: 24px;
            }

            .route-follow-up-actions .btn {
                width: 100%;
            }
        }

/* Componentes La María - resources/views/la-maria/estilos.blade.php */
.la-maria-result {
        margin-top: 20px;
        display: grid;
        gap: 12px;
    }

    .la-maria-result h3 {
        margin: 12px 0 0;
        font-size: 17px;
    }

    .la-maria-result-warning {
        margin: 0;
        padding: 12px 14px;
        border: 1px solid var(--border-soft);
        border-left: 4px solid var(--red);
        border-radius: 10px;
        color: var(--text-secondary);
        line-height: 1.6;
    }

    .la-maria-result details {
        padding: 10px 12px;
        border: 1px solid var(--border-soft);
        border-radius: 10px;
    }

    .la-maria-result summary {
        cursor: pointer;
        font-weight: 700;
    }

    .la-maria-table-wrap {
        overflow-x: auto;
        margin-top: 8px;
    }

    .la-maria-table-wrap.tall {
        max-height: 460px;
        overflow-y: auto;
    }

    .la-maria-table-wrap table {
        width: 100%;
        border-collapse: collapse;
        font-size: 12.5px;
    }

    .la-maria-table-wrap th,
    .la-maria-table-wrap td {
        padding: 6px 8px;
        border-bottom: 1px solid var(--border-soft);
        text-align: left;
        vertical-align: top;
    }

    .la-maria-table-wrap th {
        position: sticky;
        top: 0;
        background: var(--surface-soft);
        white-space: nowrap;
    }

    .la-maria-table-wrap td.num {
        text-align: right;
        white-space: nowrap;
        font-variant-numeric: tabular-nums;
    }

    .la-maria-table-wrap td.cause {
        min-width: 320px;
        color: var(--text-secondary);
    }

    .la-maria-table-wrap tr.total td {
        font-weight: 700;
        background: var(--surface-soft);
    }

    .file-selection-summary {
        margin: 10px 0 0;
        font-weight: 700;
    }

    .file-selection-error {
        margin: 6px 0 0;
        color: var(--red);
        font-size: 13px;
    }

    .file-selection-error[hidden],
    .file-selection-summary[hidden] {
        display: none;
    }

    .file-selection-list {
        margin: 8px 0 0;
        padding-left: 22px;
        max-height: 260px;
        overflow-y: auto;
        font-size: 13px;
    }

    .file-selection-list li {
        padding: 3px 0;
    }

    .file-selection-list li span {
        margin-right: 10px;
    }

    .file-selection-remove {
        border: 0;
        background: none;
        color: var(--red);
        cursor: pointer;
        font-size: 12px;
        text-decoration: underline;
    }

    .file-selection-clear {
        margin-top: 8px;
    }
