/**
 * ==============================================================================
 * SISTEMA DE IDENTIDAD VISUAL - TREN INTERURBANO MÉXICO-TOLUCA "EL INSURGENTE"
 * Basado en las directrices de diseño y componentes de Reunion_2026.
 * Versión: 1.0.0
 * ==============================================================================
 */

/* --- 1. FUENTES TIPOGRÁFICAS --- */
@import url('https://fonts.googleapis.com/css2?family=Audiowide&family=Montserrat:ital,wght@0,300;0,400;0,500;0,600;0,700;0,800;1,400;1,600&display=swap');

@font-face {
    font-family: 'MovilidadIntegrada';
    src: url('../fonts/MOVILIDAD_INTEGRADA_CDMX.otf') format('opentype');
    font-weight: normal;
    font-style: normal;
    font-display: swap;
}

@font-face {
    font-family: 'Metro-DF';
    src: url('../fonts/METRO-DF.TTF') format('truetype');
    font-weight: normal;
    font-style: normal;
    font-display: swap;
}

/* --- 2. DESIGN TOKENS Y SISTEMA DE TEMAS (DÍA / NOCHE) --- */
:root,
[data-theme="light"] {
    /* --- PALETA PRIMARIA: PETRÓLEO INSTITUCIONAL --- */
    --timt-primary: #103e4d;
    --timt-primary-hover: #0c2d38;
    --timt-primary-dark: #0d3b43;
    --timt-primary-light: #15404d;
    --timt-primary-border: #1a5965;
    --timt-primary-rgb: 16, 62, 77;
    --timt-primary-tint: rgba(16, 62, 77, 0.08);
    --timt-primary-tint-hover: rgba(16, 62, 77, 0.15);
    --timt-primary-accent: #103e4d;
    --timt-primary-text: #103e4d;
    --timt-outline-color: #103e4d;
    --timt-wine-accent: #8b2b2b;

    /* --- PALETA SECUNDARIA: ROJO / VINO INSTITUCIONAL --- */
    --timt-wine: #8b2b2b;
    --timt-wine-dark: #80242b;
    --timt-wine-hover: #552826;
    --timt-red-accent: #b63f35;
    --timt-red-rgb: 182, 63, 53;
    --timt-wine-rgb: 139, 43, 43;

    /* --- PALETA DE FONDO (MODO DÍA: CREMA CÁLIDO INSTITUCIONAL) --- */
    --timt-bg-cream: #f2e9d3;
    --timt-border-cream: #dcd4c6;
    --timt-surface: #ffffff;
    --timt-surface-alt: #fbf8f1;
    --timt-surface-card: #ffffff;
    --timt-header-bg: #f2e9d3;
    --timt-input-bg: #ffffff;
    --timt-input-border: #d1d5db;
    --timt-code-bar-bg: #0d2832;

    /* --- PALETA AUXILIAR: QUEJAS Y ATENCIÓN CIUDADANA --- */
    --timt-muddy-waters: #b2875a;
    --timt-muddy-hover: #c79f75;
    --timt-satin-linen: #ece8df;
    --timt-cape-cod: #495555;
    --timt-sanguine-brown: #863a36;

    /* --- COLORES DE ESTADO Y ALERTAS --- */
    --timt-success: #1b7a43;
    --timt-success-light: #e8f5e9;
    --timt-success-border: #a5d6a7;
    --timt-success-text: #0d542b;

    --timt-warning: #d97706;
    --timt-warning-light: #fef3c7;
    --timt-warning-border: #fcd34d;
    --timt-warning-text: #92400e;

    --timt-danger: #d93025;
    --timt-danger-dark: #80242b;
    --timt-danger-light: #fde8e8;
    --timt-danger-border: #fca5a5;
    --timt-danger-text: #991b1b;

    --timt-info: #103e4d;
    --timt-info-light: #e0f2fe;
    --timt-info-border: #7dd3fc;
    --timt-info-text: #075985;

    /* --- TEXTOS Y NEUTROS --- */
    --timt-text-main: #1a1a1a;
    --timt-text-muted: #555555;
    --timt-text-subtle: #777777;
    --timt-text-light: #ffffff;
    --timt-text-footer: #e0e0e0;
    --timt-border-color: #e2e8f0;

    /* --- RADIOS Y SOMBRAS --- */
    --timt-radius-sm: 6px;
    --timt-radius-md: 12px;
    --timt-radius-lg: 20px;
    --timt-radius-full: 9999px;

    --timt-shadow-sm: 0 2px 4px rgba(0, 0, 0, 0.05);
    --timt-shadow-md: 0 4px 12px rgba(0, 0, 0, 0.08);
    --timt-shadow-lg: 0 10px 25px rgba(0, 0, 0, 0.12);
    --timt-shadow-elevated: 0 20px 50px rgba(0, 0, 0, 0.15);
    --timt-shadow-wine: 0 8px 20px rgba(182, 63, 53, 0.4);

    /* --- TIPOGRAFÍA --- */
    --timt-font-sans: 'Montserrat', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    --timt-font-serif: 'Times New Roman', Georgia, serif;
    --timt-font-display: 'Audiowide', cursive;
    --timt-font-metro: 'MovilidadIntegrada', 'Metro-DF', sans-serif;

    /* --- TRANSICIONES --- */
    --timt-transition: all 0.25s ease-in-out;
}

/* --- TEMA NOCHE (DARK MODE FERROVIARIO SLATE) --- */
[data-theme="dark"],
body.timt-dark {
    /* Fondo profundo nocturno y superficies elevadas */
    --timt-bg-cream: #091519;
    --timt-border-cream: #1e3944;
    --timt-surface: #10232a;
    --timt-surface-alt: #0b1a20;
    --timt-surface-card: #132730;
    --timt-header-bg: #0c1c22;
    --timt-input-bg: #0b1a20;
    --timt-input-border: #234350;
    --timt-code-bar-bg: #08161b;

    /* Textos de alto contraste */
    --timt-text-main: #edf6f9;
    --timt-text-muted: #9bb7c2;
    --timt-text-subtle: #72919d;
    --timt-border-color: #1e3a45;

    /* Tintes con brillo en modo nocturno */
    --timt-primary-tint: rgba(34, 211, 238, 0.12);
    --timt-primary-tint-hover: rgba(34, 211, 238, 0.22);
    --timt-primary-accent: #38bdf8;
    --timt-primary-text: #38bdf8;
    --timt-outline-color: #38bdf8;
    --timt-wine-accent: #f87171;
    --timt-satin-linen: #152b34;
    --timt-cape-cod: #a4bcc4;

    /* Alertas en modo oscuro */
    --timt-success-light: rgba(27, 122, 67, 0.25);
    --timt-success-border: #1b7a43;
    --timt-success-text: #6ee7b7;

    --timt-warning-light: rgba(217, 119, 6, 0.25);
    --timt-warning-border: #d97706;
    --timt-warning-text: #fcd34d;

    --timt-danger-light: rgba(217, 48, 37, 0.25);
    --timt-danger-border: #d93025;
    --timt-danger-text: #fca5a5;

    --timt-info-light: rgba(16, 62, 77, 0.4);
    --timt-info-border: #38bdf8;
    --timt-info-text: #7dd3fc;

    /* Sombras nocturnas profundas */
    --timt-shadow-sm: 0 2px 6px rgba(0, 0, 0, 0.5);
    --timt-shadow-md: 0 6px 16px rgba(0, 0, 0, 0.6);
    --timt-shadow-lg: 0 12px 30px rgba(0, 0, 0, 0.7);
    --timt-shadow-elevated: 0 20px 50px rgba(0, 0, 0, 0.85);
}

/* Fallback automático cuando no se haya forzado un data-theme específico */
@media (prefers-color-scheme: dark) {
    :root:not([data-theme="light"]):not([data-theme="dark"]) {
        --timt-bg-cream: #091519;
        --timt-border-cream: #1e3944;
        --timt-surface: #10232a;
        --timt-surface-alt: #0b1a20;
        --timt-surface-card: #132730;
        --timt-header-bg: #0c1c22;
        --timt-input-bg: #0b1a20;
        --timt-input-border: #234350;
        --timt-code-bar-bg: #08161b;
        --timt-text-main: #edf6f9;
        --timt-text-muted: #9bb7c2;
        --timt-text-subtle: #72919d;
        --timt-border-color: #1e3a45;
        --timt-primary-tint: rgba(34, 211, 238, 0.12);
        --timt-primary-tint-hover: rgba(34, 211, 238, 0.22);
        --timt-primary-accent: #38bdf8;
        --timt-primary-text: #38bdf8;
        --timt-outline-color: #38bdf8;
        --timt-wine-accent: #f87171;
        --timt-satin-linen: #152b34;
        --timt-cape-cod: #a4bcc4;
        --timt-success-light: rgba(27, 122, 67, 0.25);
        --timt-success-border: #1b7a43;
        --timt-success-text: #6ee7b7;
        --timt-warning-light: rgba(217, 119, 6, 0.25);
        --timt-warning-border: #d97706;
        --timt-warning-text: #fcd34d;
        --timt-danger-light: rgba(217, 48, 37, 0.25);
        --timt-danger-border: #d93025;
        --timt-danger-text: #fca5a5;
        --timt-info-light: rgba(16, 62, 77, 0.4);
        --timt-info-border: #38bdf8;
        --timt-info-text: #7dd3fc;
        --timt-shadow-sm: 0 2px 6px rgba(0, 0, 0, 0.5);
        --timt-shadow-md: 0 6px 16px rgba(0, 0, 0, 0.6);
        --timt-shadow-lg: 0 12px 30px rgba(0, 0, 0, 0.7);
        --timt-shadow-elevated: 0 20px 50px rgba(0, 0, 0, 0.85);
    }
}

/* --- 3. REGLAS BASE --- */
*, *::before, *::after {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

body.timt-theme {
    background-color: var(--timt-bg-cream);
    color: var(--timt-text-main);
    font-family: var(--timt-font-sans);
    line-height: 1.6;
    min-height: 100vh;
    display: flex;
    flex-direction: column;
    -webkit-font-smoothing: antialiased;
}

/* --- 4. ENCABEZADO OFICIAL (HEADER) --- */
.timt-header {
    background-color: var(--timt-bg-cream);
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 15px 50px;
    border-bottom: 1px solid var(--timt-border-cream);
    position: relative;
    z-index: 100;
}

.timt-header-divider {
    height: 14px;
    background-color: var(--timt-primary);
    width: 100%;
}

.timt-logo-container {
    display: flex;
    align-items: center;
    gap: 15px;
}

.timt-logo-container img {
    max-height: 55px;
    width: auto;
    object-fit: contain;
}

.timt-nav-menu {
    display: flex;
    gap: 10px;
    align-items: center;
    list-style: none;
}

.timt-nav-menu a {
    text-decoration: none;
    color: var(--timt-text-main);
    font-weight: 700;
    font-size: 14px;
    padding: 8px 18px;
    border-radius: var(--timt-radius-full);
    transition: var(--timt-transition);
    display: inline-block;
}

.timt-nav-menu a:hover {
    background-color: var(--timt-primary-tint);
    color: var(--timt-primary-accent);
}

.timt-nav-menu a.active {
    background-color: var(--timt-primary);
    color: var(--timt-text-light);
}

.timt-nav-menu a.active:hover {
    background-color: var(--timt-primary-hover);
    color: var(--timt-text-light);
}

/* --- 5. BOTONES INSTITUCIONALES --- */
.timt-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    font-family: var(--timt-font-sans);
    font-weight: 700;
    font-size: 0.92rem;
    padding: 11px 24px;
    border-radius: var(--timt-radius-sm);
    border: 2px solid transparent;
    cursor: pointer;
    text-decoration: none;
    transition: var(--timt-transition);
    outline: none;
    line-height: 1.4;
}

.timt-btn:disabled, .timt-btn[disabled] {
    opacity: 0.6;
    cursor: not-allowed;
    pointer-events: none;
}

/* Botón Primario: Petróleo */
.timt-btn-primary {
    background-color: var(--timt-primary);
    color: var(--timt-text-light);
    border-color: var(--timt-primary);
}

.timt-btn-primary:hover {
    background-color: var(--timt-primary-hover);
    border-color: var(--timt-primary-hover);
    color: var(--timt-text-light);
    transform: translateY(-1px);
    box-shadow: var(--timt-shadow-md);
}

/* Botón Secundario: Vino */
.timt-btn-secondary {
    background-color: var(--timt-wine);
    color: var(--timt-text-light);
    border-color: var(--timt-wine);
}

.timt-btn-secondary:hover {
    background-color: var(--timt-wine-hover);
    border-color: var(--timt-wine-hover);
    color: var(--timt-text-light);
    transform: translateY(-1px);
    box-shadow: 0 5px 15px rgba(108, 52, 49, 0.35);
}

/* Botón Contorno (Outline) */
.timt-btn-outline {
    background-color: transparent;
    border-color: var(--timt-outline-color, var(--timt-primary));
    color: var(--timt-outline-color, var(--timt-primary));
    border-radius: 30px;
}

.timt-btn-outline:hover {
    background-color: var(--timt-primary-tint-hover, rgba(16, 62, 77, 0.15));
    border-color: var(--timt-outline-color, var(--timt-primary));
    color: var(--timt-outline-color, var(--timt-primary));
    transform: translateY(-1px);
}

/* Botón Alerta / Peligro */
.timt-btn-danger {
    background-color: var(--timt-danger);
    color: var(--timt-text-light);
    border-color: var(--timt-danger);
}

.timt-btn-danger:hover {
    background-color: var(--timt-wine-dark);
    border-color: var(--timt-wine-dark);
    color: var(--timt-text-light);
}

/* Botón Éxito */
.timt-btn-success {
    background-color: var(--timt-success);
    color: var(--timt-text-light);
    border-color: var(--timt-success);
}

.timt-btn-success:hover {
    background-color: #145e33;
    border-color: #145e33;
}

/* Botones de Redes Sociales Circulares */
.timt-btn-social {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 44px;
    height: 44px;
    background-color: var(--timt-wine);
    border-radius: 50%;
    border: none;
    cursor: pointer;
    transition: transform 0.2s ease, background-color 0.2s ease, box-shadow 0.2s ease;
    padding: 0;
    color: #ffffff;
    text-decoration: none;
}

.timt-btn-social:hover {
    transform: translateY(-3px);
    background-color: var(--timt-wine-hover);
    box-shadow: 0 5px 15px rgba(108, 52, 49, 0.45);
}

.timt-btn-social svg {
    width: 22px;
    height: 22px;
    fill: currentColor;
}

/* --- 5.1 SELECTOR OFICIAL DE TEMA (DÍA / NOCHE / AUTOMÁTICO) --- */
.timt-theme-switcher {
    display: inline-flex;
    align-items: center;
    background: var(--timt-surface-alt, #f7f3ea);
    border: 1.5px solid var(--timt-border-color, #dcd4c6);
    border-radius: 30px;
    padding: 3px;
    gap: 3px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.05);
    transition: var(--timt-transition);
    user-select: none;
}

[data-theme="dark"] .timt-theme-switcher,
body.timt-dark .timt-theme-switcher {
    background: #0b1a20;
    border-color: #1e3a45;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.4);
}

.timt-theme-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 5px;
    background: transparent;
    border: none;
    border-radius: 20px;
    padding: 5px 12px;
    font-size: 0.8rem;
    font-weight: 700;
    font-family: var(--timt-font-sans);
    color: var(--timt-text-muted);
    cursor: pointer;
    transition: all 0.2s ease;
    white-space: nowrap;
}

[data-theme="dark"] .timt-theme-btn,
body.timt-dark .timt-theme-btn {
    color: #9bb7c2;
}

.timt-theme-btn:hover {
    color: var(--timt-text-main);
    background: rgba(16, 62, 77, 0.08);
}

[data-theme="dark"] .timt-theme-btn:hover,
body.timt-dark .timt-theme-btn:hover {
    color: #ffffff;
    background: rgba(56, 189, 248, 0.15);
}

.timt-theme-btn.active {
    background: var(--timt-primary);
    color: #ffffff !important;
    box-shadow: 0 2px 8px rgba(16, 62, 77, 0.35);
}

[data-theme="dark"] .timt-theme-btn.active,
body.timt-dark .timt-theme-btn.active {
    background: #1a627a;
    color: #ffffff !important;
    box-shadow: 0 0 12px rgba(34, 211, 238, 0.45);
}

.timt-theme-btn .theme-icon {
    font-size: 0.95rem;
    display: inline-block;
    transition: transform 0.2s ease;
}

.timt-theme-btn:hover .theme-icon {
    transform: scale(1.15);
}

/* --- 6. TARJETAS (CARDS) --- */
.timt-card {
    background-color: var(--timt-surface);
    border-radius: var(--timt-radius-lg);
    padding: 35px 30px;
    box-shadow: var(--timt-shadow-elevated);
    border: 1px solid rgba(0, 0, 0, 0.04);
    position: relative;
    transition: var(--timt-transition);
}

.timt-card:hover {
    box-shadow: 0 25px 60px rgba(0, 0, 0, 0.18);
}

.timt-card-dark {
    background-color: var(--timt-primary);
    color: var(--timt-text-light);
    border-radius: 16px;
    padding: 30px;
    box-shadow: var(--timt-shadow-lg);
}

.timt-card-dark h1, 
.timt-card-dark h2, 
.timt-card-dark h3 {
    color: var(--timt-text-light);
}

/* --- 7. BADGES, CHIPS Y ALERTAS DE CUPO --- */
.timt-badge {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 6px 14px;
    border-radius: var(--timt-radius-full);
    font-size: 0.82rem;
    font-weight: 700;
    letter-spacing: 0.3px;
    text-transform: uppercase;
}

.timt-badge-petroleo {
    background-color: var(--timt-primary);
    color: #ffffff;
}

.timt-badge-date {
    background-color: var(--timt-red-accent);
    color: #ffffff;
    padding: 10px 28px;
    border-radius: 40px;
    font-size: 1.1rem;
    box-shadow: var(--timt-shadow-wine);
    animation: timtPulse 2.5s infinite;
}

.timt-badge-cupo {
    color: var(--timt-danger);
    background-color: var(--timt-danger-light);
    border: 1px solid var(--timt-danger-border);
    font-weight: 700;
    font-size: 0.85rem;
    padding: 4px 10px;
    border-radius: var(--timt-radius-sm);
    display: inline-block;
}

@keyframes timtPulse {
    0% { box-shadow: 0 0 0 0 rgba(182, 63, 53, 0.6); }
    70% { box-shadow: 0 0 0 16px rgba(182, 63, 53, 0); }
    100% { box-shadow: 0 0 0 0 rgba(182, 63, 53, 0); }
}

/* --- 8. SISTEMA DE ALERTAS (HTML BANNERS NATIVOS) --- */
.timt-alert {
    display: flex;
    align-items: flex-start;
    gap: 14px;
    padding: 16px 20px;
    border-radius: var(--timt-radius-md);
    margin-bottom: 18px;
    font-size: 0.95rem;
    position: relative;
    border-left: 6px solid transparent;
    box-shadow: var(--timt-shadow-sm);
    animation: timtFadeIn 0.3s ease-out forwards;
}

.timt-alert-icon {
    flex-shrink: 0;
    width: 24px;
    height: 24px;
    margin-top: 1px;
}

.timt-alert-content {
    flex: 1;
}

.timt-alert-title {
    font-weight: 700;
    margin-bottom: 4px;
    font-size: 1.02rem;
}

.timt-alert-close {
    background: transparent;
    border: none;
    cursor: pointer;
    color: inherit;
    opacity: 0.6;
    font-size: 1.2rem;
    padding: 0 4px;
    transition: opacity 0.2s;
}

.timt-alert-close:hover {
    opacity: 1;
}

/* Tipos de Alerta */
.timt-alert-success {
    background-color: var(--timt-success-light);
    border-left-color: var(--timt-success);
    color: var(--timt-success-text);
}
.timt-alert-success .timt-alert-title { color: var(--timt-success); }

.timt-alert-warning {
    background-color: var(--timt-warning-light);
    border-left-color: var(--timt-warning);
    color: var(--timt-warning-text);
}
.timt-alert-warning .timt-alert-title { color: var(--timt-warning); }

.timt-alert-danger {
    background-color: var(--timt-danger-light);
    border-left-color: var(--timt-danger);
    color: var(--timt-danger-text);
}
.timt-alert-danger .timt-alert-title { color: var(--timt-danger); }

.timt-alert-info {
    background-color: var(--timt-info-light);
    border-left-color: var(--timt-info);
    color: var(--timt-info-text);
}
.timt-alert-info .timt-alert-title { color: var(--timt-info); }

/* --- 9. FORMULARIOS E INPUTS --- */
.timt-form-group {
    margin-bottom: 20px;
    text-align: left;
}

.timt-label {
    display: block;
    margin-bottom: 7px;
    font-weight: 600;
    font-size: 0.92rem;
    color: var(--timt-text-main);
}

.timt-input, 
.timt-select, 
.timt-textarea {
    width: 100%;
    padding: 12px 16px;
    font-size: 0.95rem;
    font-family: var(--timt-font-sans);
    color: var(--timt-text-main);
    background-color: var(--timt-input-bg, #ffffff);
    border: 1.5px solid var(--timt-input-border, var(--timt-border-color));
    border-radius: var(--timt-radius-sm);
    transition: var(--timt-transition);
    outline: none;
}

.timt-input::placeholder,
.timt-textarea::placeholder {
    color: var(--timt-text-subtle);
    opacity: 0.75;
}

.timt-input:focus, 
.timt-select:focus, 
.timt-textarea:focus {
    border-color: var(--timt-primary-accent);
    box-shadow: 0 0 0 4px var(--timt-primary-tint);
}

.timt-input.is-invalid {
    border-color: var(--timt-danger);
    box-shadow: 0 0 0 4px rgba(217, 48, 37, 0.12);
}

.timt-input.is-valid {
    border-color: var(--timt-success);
    box-shadow: 0 0 0 4px rgba(27, 122, 67, 0.12);
}

.timt-form-error {
    color: var(--timt-danger);
    font-size: 0.83rem;
    font-weight: 600;
    margin-top: 5px;
}

/* --- 10. PIE DE PÁGINA (FOOTER) --- */
.timt-footer {
    background-color: var(--timt-primary-dark);
    color: var(--timt-text-footer);
    padding: 45px 50px 22px;
    margin-top: auto;
}

.timt-footer-content {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    flex-wrap: wrap;
    gap: 35px;
    max-width: 1200px;
    margin: 0 auto;
}

.timt-footer-col {
    flex: 1;
    min-width: 250px;
}

.timt-footer-col h3 {
    color: #ffffff;
    font-size: 1.15rem;
    margin-bottom: 16px;
    font-weight: 700;
}

.timt-footer-col p,
.timt-footer-col a {
    color: var(--timt-text-footer);
    font-size: 0.92rem;
    line-height: 1.65;
    text-decoration: none;
    display: block;
    margin-bottom: 8px;
    transition: color 0.2s;
}

.timt-footer-col a:hover {
    color: #ffffff;
    text-decoration: underline;
}

.timt-footer-bottom {
    text-align: center;
    padding-top: 22px;
    margin-top: 35px;
    border-top: 1px solid var(--timt-primary-border);
    font-size: 0.85rem;
    color: #b0b0b0;
    font-weight: 500;
}

/* --- 11. ANIMACIONES GLOBALES --- */
@keyframes timtFadeIn {
    from { opacity: 0; transform: translateY(6px); }
    to { opacity: 1; transform: translateY(0); }
}

@keyframes timtPopIn {
    0% { opacity: 0; transform: scale(0.9) translateY(20px); }
    100% { opacity: 1; transform: scale(1) translateY(0); }
}

.timt-fade-in {
    animation: timtFadeIn 0.5s ease-out forwards;
}

/* --- 12. RESPONSIVIDAD --- */
@media (max-width: 992px) {
    .timt-header {
        flex-direction: column;
        padding: 20px;
        gap: 15px;
    }
    .timt-nav-menu {
        flex-wrap: wrap;
        justify-content: center;
    }
}

@media (max-width: 768px) {
    .timt-header {
        padding: 15px;
    }
    .timt-nav-menu {
        flex-direction: column;
        width: 100%;
        gap: 8px;
    }
    .timt-nav-menu a {
        text-align: center;
        width: 100%;
    }
    .timt-footer {
        padding: 30px 20px 20px;
    }
    .timt-footer-content {
        flex-direction: column;
        align-items: center;
        text-align: center;
    }
    .timt-footer-col {
        display: flex;
        flex-direction: column;
        align-items: center;
    }
}

/* ==============================================================================
   13. COMPONENTES DE ATENCIÓN CIUDADANA, QUEJAS Y SUGERENCIAS (TIMT)
   Basado en el sistema de gestión de folios y análisis de QuejasySugerencias
   ============================================================================== */

/* --- INSIGNIA DE FOLIO OFICIAL --- */
.timt-folio-badge {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    background-color: var(--timt-surface-alt);
    color: var(--timt-primary);
    border: 1.5px solid var(--timt-primary);
    padding: 6px 14px;
    border-radius: var(--timt-radius-sm);
    font-family: var(--timt-font-display);
    font-size: 1.05rem;
    letter-spacing: 1px;
    box-shadow: 0 2px 6px rgba(16, 62, 77, 0.08);
    user-select: all;
    transition: var(--timt-transition);
}

.timt-folio-badge:hover {
    background-color: var(--timt-primary);
    color: #ffffff;
    cursor: copy;
}

/* --- BADGES DE ESTATUS DE SEGUIMIENTO --- */
.timt-status-badge {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 5px 12px;
    border-radius: var(--timt-radius-full);
    font-size: 0.82rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.4px;
    border: 1px solid transparent;
}

.timt-status-abierto {
    background-color: var(--timt-info-light);
    color: var(--timt-info-text);
    border-color: var(--timt-info-border);
}

.timt-status-proceso {
    background-color: var(--timt-warning-light);
    color: var(--timt-warning-text);
    border-color: var(--timt-warning-border);
}

.timt-status-resuelto {
    background-color: var(--timt-success-light);
    color: var(--timt-success-text);
    border-color: var(--timt-success-border);
}

.timt-status-concluido {
    background-color: #f3f4f6;
    color: #374151;
    border-color: #d1d5db;
}

.timt-status-rechazado {
    background-color: var(--timt-danger-light);
    color: var(--timt-danger-text);
    border-color: var(--timt-danger-border);
}

/* --- BADGES DE ANÁLISIS DE SENTIMIENTO IA --- */
.timt-sentiment-badge {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 6px 14px;
    border-radius: 20px;
    font-size: 0.88rem;
    font-weight: 700;
    border: 1px solid transparent;
}

.timt-sentiment-badge img {
    width: 22px;
    height: 22px;
    object-fit: contain;
}

.timt-sentiment-pos {
    background-color: #e8f5e9;
    color: #1b7a43;
    border-color: #a5d6a7;
}

.timt-sentiment-neu {
    background-color: #fef3c7;
    color: #92400e;
    border-color: #fcd34d;
}

.timt-sentiment-neg {
    background-color: #fde8e8;
    color: #991b1b;
    border-color: #fca5a5;
}

.timt-sentiment-pending {
    background-color: #e0f2fe;
    color: #075985;
    border-color: #7dd3fc;
}

/* --- LÍNEA DE TIEMPO DE PROGRESO DE CASO (TIMELINE) --- */
.timt-timeline {
    display: flex;
    justify-content: space-between;
    position: relative;
    margin: 35px 0 25px;
}

.timt-timeline::before {
    content: '';
    position: absolute;
    top: 15px;
    left: 20px;
    right: 20px;
    height: 4px;
    background-color: #e2e8f0;
    z-index: 1;
}

.timt-timeline-step {
    position: relative;
    z-index: 2;
    display: flex;
    flex-direction: column;
    align-items: center;
    flex: 1;
    text-align: center;
}

.timt-timeline-dot {
    width: 34px;
    height: 34px;
    border-radius: 50%;
    background-color: #ffffff;
    border: 3px solid #cbd5e1;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 700;
    font-size: 0.85rem;
    color: #64748b;
    transition: var(--timt-transition);
}

.timt-timeline-step.completed .timt-timeline-dot {
    background-color: var(--timt-success);
    border-color: var(--timt-success);
    color: #ffffff;
}

.timt-timeline-step.active .timt-timeline-dot {
    background-color: var(--timt-primary);
    border-color: var(--timt-primary);
    color: #ffffff;
    box-shadow: 0 0 0 5px rgba(16, 62, 77, 0.2);
}

.timt-timeline-label {
    margin-top: 10px;
    font-size: 0.82rem;
    font-weight: 600;
    color: #475569;
    max-width: 110px;
    line-height: 1.3;
}

.timt-timeline-step.active .timt-timeline-label {
    color: var(--timt-primary);
    font-weight: 700;
}

/* --- ÁREA DE CARGA DE ARCHIVOS / EVIDENCIAS (DROPZONE) --- */
.timt-dropzone {
    border: 2px dashed #cbd5e1;
    border-radius: var(--timt-radius-md);
    background-color: #fafaf9;
    padding: 25px;
    text-align: center;
    cursor: pointer;
    transition: var(--timt-transition);
}

.timt-dropzone:hover, .timt-dropzone.dragover {
    border-color: var(--timt-primary);
    background-color: rgba(16, 62, 77, 0.04);
}

.timt-dropzone-icon {
    font-size: 2.2rem;
    color: var(--timt-primary);
    margin-bottom: 8px;
}

.timt-dropzone-text {
    font-size: 0.92rem;
    font-weight: 600;
    color: var(--timt-text-main);
}

.timt-dropzone-sub {
    font-size: 0.8rem;
    color: var(--timt-text-subtle);
    margin-top: 4px;
}

/* --- CONTADOR DE CARACTERES --- */
.timt-char-counter {
    display: flex;
    justify-content: flex-end;
    font-size: 0.8rem;
    color: var(--timt-text-subtle);
    margin-top: 5px;
    font-weight: 500;
}

/* --- BADGE DE TARJETA TUMI (8 DÍGITOS) --- */
.timt-tumi-badge {
    background-color: #f3f4f6;
    border: 1px solid #d1d5db;
    padding: 3px 8px;
    border-radius: 4px;
    font-family: monospace;
    font-weight: 700;
    color: #1e293b;
    font-size: 0.85rem;
}

/* ==============================================================================
   14. ESTILOS DE IMPRESIÓN OFICIAL (REPORTES Y ACTAS TAMAÑO CARTA)
   Basado en reporte_folio.php de QuejasySugerencias
   ============================================================================== */
@media print {
    @page {
        size: letter portrait;
        margin: 1.5cm 1.2cm;
    }

    body.timt-theme {
        background-color: #ffffff !important;
        color: #000000 !important;
        font-size: 10.5pt;
    }

    .no-print, .timt-header, .timt-footer, .timt-header-divider, .manual-quicknav, .alert-playground, .btn-copy-code {
        display: none !important;
    }

    .timt-card {
        box-shadow: none !important;
        border: 1px solid #000000 !important;
        padding: 20px !important;
        page-break-inside: avoid;
    }

    .timt-print-header {
        display: flex !important;
        justify-content: space-between;
        align-items: center;
        border-bottom: 2px solid #000000;
        padding-bottom: 12px;
        margin-bottom: 20px;
    }

    .timt-print-signatures {
        display: flex !important;
        justify-content: space-between;
        margin-top: 50px;
        page-break-inside: avoid;
    }

    .timt-signature-box {
        text-align: center;
        border-top: 1px solid #000000;
        padding-top: 8px;
        width: 40%;
        font-size: 9pt;
    }
}

/* ==============================================================================
   15. COMPONENTES DE TRANSPORTE Y OPERACIÓN FERROVIARIA
   Derivados de Conin_escaner, Generador_Tickets_Sinteticos, Monitor-equipos y Cuenta_Atras
   ============================================================================== */

/* --- A. BOLETO / TICKET TÉRMICO DE PASAJE --- */
.timt-transport-ticket {
    background-color: #ffffff;
    border-radius: 16px;
    box-shadow: 0 15px 35px rgba(0, 0, 0, 0.12);
    max-width: 380px;
    margin: 0 auto;
    position: relative;
    overflow: hidden;
    border: 1px solid #e2e8f0;
    font-family: var(--timt-font-sans);
}

.timt-ticket-header {
    background: linear-gradient(135deg, #103e4d 0%, #0d3b43 100%);
    color: #ffffff;
    padding: 20px;
    text-align: center;
    position: relative;
}

.timt-ticket-header img {
    height: 40px;
    margin-bottom: 6px;
}

.timt-ticket-route {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 22px 20px;
    background-color: #fafaf9;
    border-bottom: 2px dashed #cbd5e1;
    position: relative;
}

/* Muescas circulares de corte en los bordes del boleto */
.timt-ticket-route::before,
.timt-ticket-route::after {
    content: '';
    position: absolute;
    bottom: -12px;
    width: 24px;
    height: 24px;
    background-color: var(--timt-bg-cream);
    border-radius: 50%;
    z-index: 5;
}

.timt-ticket-route::before {
    left: -12px;
    box-shadow: inset -2px 0 3px rgba(0,0,0,0.06);
}

.timt-ticket-route::after {
    right: -12px;
    box-shadow: inset 2px 0 3px rgba(0,0,0,0.06);
}

.timt-ticket-station {
    text-align: left;
}

.timt-ticket-station.destination {
    text-align: right;
}

.timt-ticket-station-code {
    font-family: var(--timt-font-display);
    font-size: 1.5rem;
    color: var(--timt-primary);
    font-weight: 700;
    line-height: 1;
}

.timt-ticket-station-name {
    font-size: 0.8rem;
    color: var(--timt-text-muted);
    font-weight: 600;
    margin-top: 4px;
}

.timt-ticket-arrow {
    color: var(--timt-wine);
    font-size: 1.5rem;
    font-weight: bold;
}

.timt-ticket-body {
    padding: 20px;
}

.timt-ticket-row {
    display: flex;
    justify-content: space-between;
    margin-bottom: 10px;
    font-size: 0.88rem;
}

.timt-ticket-label {
    color: var(--timt-text-muted);
}

.timt-ticket-value {
    font-weight: 700;
    color: var(--timt-text-main);
}

.timt-ticket-qr-box {
    text-align: center;
    padding: 15px 0 10px;
    border-top: 1px solid #f1f5f9;
}

.timt-ticket-qr-box img {
    width: 130px;
    height: 130px;
    object-fit: contain;
}

.timt-ticket-barcode {
    height: 38px;
    width: 80%;
    margin: 10px auto 0;
    background: repeating-linear-gradient(
        90deg,
        #000 0px,
        #000 2px,
        transparent 2px,
        transparent 5px,
        #000 5px,
        #000 8px,
        transparent 8px,
        transparent 10px
    );
}

/* --- B. VISOR DE ESCÁNER QR CON LÁSER ANIMADO --- */
.timt-scanner-box {
    position: relative;
    width: 100%;
    max-width: 440px;
    height: 320px;
    background-color: #0f172a;
    border-radius: 16px;
    overflow: hidden;
    margin: 0 auto;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.3);
    display: flex;
    align-items: center;
    justify-content: center;
}

.timt-scanner-frame {
    width: 200px;
    height: 200px;
    position: relative;
    border: 2px solid rgba(255, 255, 255, 0.2);
    border-radius: 12px;
}

/* Esquinas de enfoque estilo cámara */
.timt-scanner-frame::before,
.timt-scanner-frame::after {
    content: '';
    position: absolute;
    width: 25px;
    height: 25px;
    border-color: #38bdf8;
    border-style: solid;
    pointer-events: none;
}

.timt-scanner-frame::before {
    top: -2px;
    left: -2px;
    border-width: 4px 0 0 4px;
    border-top-left-radius: 8px;
}

.timt-scanner-frame::after {
    bottom: -2px;
    right: -2px;
    border-width: 0 4px 4px 0;
    border-bottom-right-radius: 8px;
}

.timt-scanner-laser {
    position: absolute;
    left: 0;
    right: 0;
    height: 3px;
    background: linear-gradient(90deg, transparent 0%, #d93025 50%, transparent 100%);
    box-shadow: 0 0 12px #d93025;
    animation: timtLaserScan 2s infinite ease-in-out alternate;
}

@keyframes timtLaserScan {
    0% { top: 10px; opacity: 0.3; }
    50% { opacity: 1; }
    100% { top: 185px; opacity: 0.3; }
}

.timt-scanner-status {
    position: absolute;
    bottom: 12px;
    left: 0;
    right: 0;
    text-align: center;
    color: #e2e8f0;
    font-size: 0.82rem;
    font-weight: 600;
    letter-spacing: 0.5px;
}

/* --- C. MONITOREO DE NODOS, SERVIDORES Y PING --- */
.timt-node-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
    gap: 18px;
    margin: 20px 0;
}

.timt-node-card {
    background: #ffffff;
    border: 1px solid #e2e8f0;
    border-radius: 14px;
    padding: 18px 20px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.04);
    transition: var(--timt-transition);
}

.timt-node-card:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 20px rgba(0, 0, 0, 0.08);
}

.timt-node-info h4 {
    color: var(--timt-primary);
    font-size: 1rem;
    margin-bottom: 4px;
}

.timt-node-ip {
    font-family: monospace;
    font-size: 0.8rem;
    color: var(--timt-text-muted);
}

.timt-node-status {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 0.85rem;
    font-weight: 700;
}

.timt-ping-dot {
    width: 12px;
    height: 12px;
    border-radius: 50%;
    position: relative;
    display: inline-block;
}

.timt-ping-online {
    background-color: var(--timt-success);
    box-shadow: 0 0 0 0 rgba(27, 122, 67, 0.7);
    animation: timtPingPulse 1.8s infinite;
}

.timt-ping-offline {
    background-color: var(--timt-danger);
    box-shadow: 0 0 0 0 rgba(217, 48, 37, 0.7);
    animation: timtPingPulse 1.8s infinite;
}

.timt-ping-warn {
    background-color: var(--timt-warning);
    box-shadow: 0 0 0 0 rgba(217, 119, 6, 0.7);
    animation: timtPingPulse 1.8s infinite;
}

@keyframes timtPingPulse {
    0% { box-shadow: 0 0 0 0 rgba(27, 122, 67, 0.6); }
    70% { box-shadow: 0 0 0 9px rgba(27, 122, 67, 0); }
    100% { box-shadow: 0 0 0 0 rgba(27, 122, 67, 0); }
}

.timt-latency-pill {
    background-color: #f1f5f9;
    padding: 3px 8px;
    border-radius: 12px;
    font-family: monospace;
    font-size: 0.75rem;
    font-weight: 600;
    color: #475569;
}

/* --- D. CONTADOR REGRESIVO DIGITAL (COUNTDOWN) --- */
.timt-countdown {
    display: flex;
    justify-content: center;
    gap: 15px;
    flex-wrap: wrap;
    margin: 25px 0;
}

.timt-countdown-unit {
    background: linear-gradient(180deg, #103e4d 0%, #0c2d38 100%);
    color: #ffffff;
    border-radius: 14px;
    padding: 16px 20px;
    min-width: 90px;
    text-align: center;
    box-shadow: 0 10px 25px rgba(16, 62, 77, 0.25);
    border: 1px solid rgba(255, 255, 255, 0.1);
}

.timt-countdown-num {
    font-family: var(--timt-font-display);
    font-size: 2.4rem;
    font-weight: 700;
    line-height: 1;
    color: #ffffff;
    text-shadow: 0 2px 8px rgba(0, 0, 0, 0.3);
}

.timt-countdown-label {
    font-size: 0.75rem;
    text-transform: uppercase;
    letter-spacing: 1px;
    margin-top: 6px;
    color: #cbd5e1;
    font-weight: 600;
}

/* --- E. CREDENCIAL DIGITAL / GAFFETE OFICIAL DE ACCESO --- */
.timt-id-badge {
    width: 320px;
    max-width: 100%;
    background-color: #ffffff !important;
    border-radius: 20px;
    box-shadow: 0 16px 40px rgba(0, 0, 0, 0.15);
    overflow: hidden;
    margin: 0 auto;
    border: 1px solid #cbd5e1;
    text-align: center;
    position: relative;
    color: #1e293b;
    font-family: var(--timt-font-sans);
    transition: var(--timt-transition);
}

[data-theme="dark"] .timt-id-badge {
    box-shadow: 0 20px 48px rgba(0, 0, 0, 0.55);
    border-color: #334155;
}

/* Ranura de cordón institucional */
.timt-badge-lanyard-slot {
    background: #f8fafc;
    padding: 12px 16px 8px;
    border-bottom: 1px solid #e2e8f0;
}

.timt-badge-lanyard-hole {
    width: 50px;
    height: 10px;
    background-color: #cbd5e1;
    border-radius: 6px;
    margin: 10px auto 8px;
    box-shadow: inset 0 2px 3px rgba(0, 0, 0, 0.25);
    border: 1px solid #94a3b8;
}

/* Cinta de identidad superior */
.timt-badge-strip {
    background: #103e4d;
    color: #ffffff;
    font-size: 0.66rem;
    font-weight: 700;
    letter-spacing: 1px;
    text-transform: uppercase;
    padding: 5px 12px;
}

/* Cabecera institucional con fondo blanco garantizado para logos transparentes */
.timt-badge-header {
    background: #ffffff !important;
    padding: 12px 18px 8px;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    border-bottom: 2px solid #f1f5f9;
}

.timt-badge-header img,
.timt-badge-header .mk-logo-nav {
    height: 32px;
    max-width: 220px;
    width: auto;
    object-fit: contain;
    filter: none !important;
    opacity: 1 !important;
    display: block;
    margin: 0 auto;
}

.timt-badge-header-caption {
    font-size: 0.65rem;
    color: #64748b;
    letter-spacing: 0.5px;
    text-transform: uppercase;
    margin-top: 4px;
    font-weight: 600;
}

/* Fotografía o Avatar en círculo sin sobreposición */
.timt-badge-avatar-wrap {
    margin: 16px auto 10px;
    display: flex;
    flex-direction: column;
    align-items: center;
    position: relative;
}

.timt-badge-avatar {
    width: 105px;
    height: 105px;
    border-radius: 50%;
    border: 3.5px solid #103e4d;
    box-shadow: 0 4px 16px rgba(16, 62, 77, 0.18);
    margin: 14px auto 10px !important;
    object-fit: contain;
    background-color: #ffffff !important;
    padding: 8px;
    display: block;
    box-sizing: border-box;
}

/* Indicador de vigencia activa */
.timt-badge-status-chip {
    display: inline-flex;
    align-items: center;
    gap: 5px;
    background: #e6f4ea;
    color: #137333;
    font-size: 0.68rem;
    font-weight: 700;
    padding: 3px 10px;
    border-radius: 12px;
    margin: 2px auto 10px;
    border: 1px solid #ceead6;
    letter-spacing: 0.3px;
}

.timt-badge-status-dot {
    width: 6px;
    height: 6px;
    border-radius: 50%;
    background: #1e8e3e;
}

/* Tipografía y datos de adscripción */
.timt-badge-info {
    padding: 0 16px;
}

.timt-badge-name {
    font-weight: 800;
    font-size: 1.2rem;
    color: #103e4d;
    padding: 0 10px;
    line-height: 1.25;
    margin-bottom: 3px;
}

.timt-badge-role {
    font-size: 0.82rem;
    color: #8b2b2b;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    margin-bottom: 12px;
}

/* Grilla de metadatos */
.timt-badge-meta-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 8px;
    background: #f8fafc;
    border: 1px solid #e2e8f0;
    border-radius: 10px;
    padding: 10px 12px;
    margin: 0 12px 14px;
    text-align: left;
}

.timt-badge-meta-item {
    display: flex;
    flex-direction: column;
}

.timt-badge-meta-label {
    font-size: 0.64rem;
    font-weight: 700;
    color: #64748b;
    text-transform: uppercase;
    letter-spacing: 0.4px;
}

.timt-badge-meta-val {
    font-size: 0.82rem;
    font-weight: 600;
    color: #0f172a;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.timt-badge-station {
    font-size: 0.8rem;
    color: #475569;
    margin: 4px auto 10px;
    padding: 0 12px;
}

/* Sección QR y validación */
.timt-badge-qr {
    padding: 12px 16px;
    border-top: 1px dashed #cbd5e1;
    margin-top: 6px;
    background-color: #f8fafc;
    display: flex;
    align-items: center;
    justify-content: space-around;
    gap: 12px;
}

.timt-badge-qr-box {
    background: #ffffff !important;
    padding: 6px;
    border-radius: 8px;
    border: 1px solid #cbd5e1;
    box-shadow: 0 2px 6px rgba(0, 0, 0, 0.05);
    display: inline-flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}

.timt-badge-qr img,
.timt-badge-qr-box img,
.timt-badge-qr .mk-qr-code {
    width: 70px !important;
    height: 70px !important;
    max-width: 70px !important;
    max-height: 70px !important;
    object-fit: contain;
    display: block;
    margin: 0 auto;
    filter: none !important;
}

.timt-badge-qr-info {
    text-align: left;
    flex: 1;
}

.timt-badge-qr-title {
    font-size: 0.68rem;
    font-weight: 700;
    color: #103e4d;
    text-transform: uppercase;
    margin-bottom: 2px;
}

.timt-badge-qr-folio {
    font-size: 0.72rem;
    font-family: monospace;
    font-weight: 700;
    color: #475569;
    margin-bottom: 3px;
}

.timt-badge-qr-desc {
    font-size: 0.64rem;
    color: #64748b;
    line-height: 1.25;
}

/* Reverso de credencial oficial */
.timt-id-badge-back {
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    min-height: 480px;
}

.timt-badge-back-terms {
    padding: 18px 20px;
    text-align: left;
    font-size: 0.7rem;
    color: #475569;
    line-height: 1.45;
}

.timt-badge-back-terms p {
    margin-bottom: 8px;
}

.timt-badge-signature-box {
    margin: 15px auto 10px;
    text-align: center;
    width: 180px;
}

.timt-badge-signature-line {
    border-bottom: 1.5px solid #0f172a;
    height: 25px;
    margin-bottom: 4px;
}

.timt-badge-signature-label {
    font-size: 0.65rem;
    font-weight: 700;
    color: #64748b;
    text-transform: uppercase;
}

/* Franja inferior decorativa */
.timt-badge-footer-ribbon {
    height: 10px;
    background: linear-gradient(90deg, #103e4d 0%, #b63f35 50%, #8b2b2b 100%);
    width: 100%;
}


