/*
 * portal.css
 * Rediseño del Portal Ciudadano — M.I. Municipalidad de Guayaquil
 * Sidebar izquierdo + topbar + contenido
 * Compatible con Bootstrap 3 y jQuery existente en el proyecto
 */

/* ── Variables de color ───────────────────────────────────────
 * Paleta institucional MIMG / "Aquiles Alcalde" (guía de marca 2025):
 *   Navy   #132267  (Pantone 2756 C)
 *   Cyan   #1DA9E1  (Pantone Cyan)
 *   Amarillo #F6B827 (Pantone 7549 C)
 * Los 3 colores de marca son las anclas de identidad; los grises neutros y
 * los colores de estado (verde/rojo/ámbar) se conservan por legibilidad de UI.
 */
:root {
    --gye-navy: #132267;   /* navy de marca */
    --gye-navy2: #1B2E72;  /* navy más claro (derivado) */
    --gye-azul: #157AB0;   /* cyan oscurecido — texto/enlaces legibles sobre blanco */
    --gye-azul2: #1DA9E1;  /* cyan de marca — acentos, fondos, bordes, estados activos */
    --gye-oro: #F6B827;    /* amarillo de marca */
    --gye-oro-h: #E2A50F;  /* amarillo más oscuro (hover de botón dorado) */
    /* Tintes claros derivados del cyan para superficies, bordes y chips */
    --gye-azul-bg:  #E8F5FC;  /* superficie cyan muy clara (hover, chips) */
    --gye-azul-bg2: #D3ECF8;  /* superficie cyan clara (estado activo) */
    --gye-azul-bd:  #BFE3F4;  /* borde cyan claro */
    --gye-verde: #12B76A;
    --gye-rojo: #F04438;
    --gye-amber: #F79009;
    --gye-fondo: #F0F3FA;
    --gye-blanco: #FFFFFF;
    --gye-borde: #E2E8F4;
    --gye-txt1: #0D1529;
    --gye-txt2: #5A6A8A;
    --gye-txt3: #98A7C4;
    --sidebar-w: 250px;
    --topbar-h: 58px;
    /* Tipografía de marca: Barlow (Semi Bold en títulos, Regular en cuerpo).
       --gye-font es alias de --font para los estilos heredados que ya lo usaban. */
    --font: 'Barlow', 'Open Sans', sans-serif;
    --gye-font: var(--font);
    /* Carrusel del banner de bienvenida (STL10002 .welcome-strip): tiempo que cada
       imagen permanece visible y duración del crossfade entre una y la siguiente.
       El JS del carrusel lee --welcome-banner-duracion de aquí — para cambiar el
       tiempo alcanza con editar este valor, sin tocar el script. */
    --welcome-banner-duracion: 5s;
    --welcome-banner-transicion: 1.2s;
}

/* ── Reset básico para el wrapper portal ─────────────────── */
html,
body {
    height: 100%;
    margin: 0;
    padding: 0;
}

body {
    background-color: var(--gye-fondo);
    color: var(--gye-txt1);
    font-family: var(--font);
}

/* Desactiva el padding de body que Bootstrap 3 agrega por el navbar affix */
body.portal-bg {
    padding-top: 0 !important;
}

/* ── Layout principal ─────────────────────────────────────── */
.portal-layout {
    display: -webkit-box;
    display: -ms-flexbox;
    display: flex;
    min-height: 100vh;
}

/* ═══════════════════════════════════════════════════════════
   SIDEBAR
═══════════════════════════════════════════════════════════ */
.portal-sidebar {
    width: var(--sidebar-w);
    min-height: 100vh;
    background-color: var(--gye-navy);
    -ms-flex-negative: 0;
    flex-shrink: 0;
    position: -webkit-sticky;
    position: sticky;
    top: 0;
    height: 100vh;
    overflow-y: auto;
    overflow-x: hidden;
    z-index: 200;
    display: -webkit-box;
    display: -ms-flexbox;
    display: flex;
    -webkit-box-orient: vertical;
    -webkit-box-direction: normal;
    -ms-flex-direction: column;
    flex-direction: column;
    /* scrollbar thin */
    scrollbar-width: thin;
    scrollbar-color: rgba(255,255,255,.12) transparent;
}
.portal-sidebar::-webkit-scrollbar        { width: 4px; }
.portal-sidebar::-webkit-scrollbar-track  { background: transparent; }
.portal-sidebar::-webkit-scrollbar-thumb  { background: rgba(255,255,255,.18); border-radius: 4px; }

/* ── Cabecera del sidebar: logo institucional arriba ──────── */
.sb-brand-top {
    display: -webkit-box;
    display: -ms-flexbox;
    display: flex;
    -webkit-box-align: center;
    -ms-flex-align: center;
    align-items: center;            /* logo centrado verticalmente en la franja */
    height: var(--topbar-h);        /* misma altura que el portal-topbar */
    padding: 0;
    margin: 0;
    background: transparent;
    overflow: hidden;
    text-decoration: none;
    -ms-flex-negative: 0;
    flex-shrink: 0;
}
.sb-brand-top:hover { text-decoration: none; }
.sb-brand-top img {
    display: block;
    width: 100%;
    height: auto;
}

/* ── Cabecera del sidebar (Brand) ─────────────────────────── */
.sb-header {
    padding: 18px 16px 16px;
    border-bottom: 1px solid rgba(255,255,255,.08);
    display: -webkit-box;
    display: -ms-flexbox;
    display: flex;
    -webkit-box-align: center;
    -ms-flex-align: center;
    align-items: center;
    gap: 10px;
    text-decoration: none;
    -ms-flex-negative: 0;
    flex-shrink: 0;
}
.sb-header:hover { text-decoration: none; }

.sb-escudo-wrap {
    width: 38px;
    height: 38px;
    border-radius: 10px;
    background: var(--gye-azul2);
    display: -webkit-box;
    display: -ms-flexbox;
    display: flex;
    -webkit-box-align: center;
    -ms-flex-align: center;
    align-items: center;
    -webkit-box-pack: center;
    -ms-flex-pack: center;
    justify-content: center;
    overflow: hidden;
    -ms-flex-negative: 0;
    flex-shrink: 0;
}
.sb-escudo-img {
    width: 32px !important;
    height: 32px !important;
    object-fit: contain;
}

.sb-brand-txt {
    color: var(--gye-blanco);
    line-height: 1.25;
}
.sb-brand-txt strong {
    display: block;
    font-size: 12px;
    font-weight: 700;
    color: var(--gye-blanco);
}
.sb-brand-txt span {
    display: block;
    font-size: 10.5px;
    color: rgba(255,255,255,.45);
    margin-top: 1px;
}

/* ── Tarjeta de usuario ───────────────────────────────────── */
.sb-user-card {
    margin: 12px 12px 4px;
    padding: 11px 13px;
    border-radius: 12px;
    background: rgba(255,255,255,.11);
    border: 1px solid rgba(255,255,255,.16);
    -webkit-box-shadow: inset 0 1px 0 rgba(255,255,255,.05);
    box-shadow: inset 0 1px 0 rgba(255,255,255,.05);
    display: -webkit-box;
    display: -ms-flexbox;
    display: flex;
    -webkit-box-align: center;
    -ms-flex-align: center;
    align-items: center;
    gap: 9px;
    -ms-flex-negative: 0;
    flex-shrink: 0;
}
.sb-avatar {
    width: 32px;
    height: 32px;
    border-radius: 50%;
    background: var(--gye-oro);
    color: var(--gye-navy);
    font-weight: 800;
    font-size: 13px;
    display: -webkit-box;
    display: -ms-flexbox;
    display: flex;
    -webkit-box-align: center;
    -ms-flex-align: center;
    align-items: center;
    -webkit-box-pack: center;
    -ms-flex-pack: center;
    justify-content: center;
    -ms-flex-negative: 0;
    flex-shrink: 0;
    text-transform: uppercase;
}
.sb-user-name {
    font-size: 12px;
    font-weight: 600;
    color: var(--gye-blanco);
    line-height: 1.25;
    /* Nombres largos (empresas) se muestran en 2 líneas en vez de cortarse */
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
    word-break: break-word;
    max-width: 100%;
}
.sb-user-ci {
    font-size: 11.5px;
    font-weight: 500;
    letter-spacing: .3px;
    color: rgba(255,255,255,.66);
    margin-top: 2px;
}

/* Tarjeta de usuario como enlace */
a.sb-user-card-link {
    text-decoration: none !important;
    cursor: pointer;
    transition: background .15s;
}
a.sb-user-card-link:hover {
    background: rgba(255,255,255,.17) !important;
    border-color: rgba(255,255,255,.24);
    text-decoration: none !important;
}

/* ── Etiqueta de sección ──────────────────────────────────── */
.sb-section-label {
    padding: 14px 16px 5px;
    font-size: 9px;
    font-weight: 700;
    letter-spacing: 1.3px;
    text-transform: uppercase;
    color: rgba(255,255,255,.28);
    -ms-flex-negative: 0;
    flex-shrink: 0;
}

/* ── Navegación principal del sidebar ────────────────────── */
.sb-nav {
    -webkit-box-flex: 1;
    -ms-flex: 1 1 auto;
    flex: 1 1 auto;
    padding: 4px 8px;
}

/* Lista raíz */
.sb-menu-list {
    list-style: none;
    padding: 0;
    margin: 0;
}

/* Item de nivel 1 */
.sb-menu-item {
    margin-bottom: 1px;
}

/* Enlace de nivel 1 (categorías) — más prominente que los sub-niveles */
.sb-menu-link {
    display: -webkit-box;
    display: -ms-flexbox;
    display: flex;
    -webkit-box-align: center;
    -ms-flex-align: center;
    align-items: center;
    padding: 11px 12px;
    border-radius: 9px;
    color: rgba(255,255,255,.88);
    font-size: 14.5px;
    font-weight: 600;
    letter-spacing: .2px;
    text-decoration: none;
    -webkit-transition: background 0.15s, color 0.15s;
    transition: background 0.15s, color 0.15s;
    cursor: pointer;
    line-height: 1.3;
}
.sb-menu-link:hover,
.sb-menu-link:focus {
    background: rgba(255,255,255,.09);
    color: var(--gye-blanco);
    text-decoration: none;
}
.sb-menu-item.active > .sb-menu-link,
.sb-menu-link.activo {
    background: var(--gye-azul2);
    color: var(--gye-blanco);
}

/* Texto del enlace */
.sb-link-text {
    -webkit-box-flex: 1;
    -ms-flex: 1;
    flex: 1;
    white-space: normal;
    word-break: break-word;
    line-height: 1.35;
}

.sb-link {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 10px 14px;
    margin: 1px 8px;
    border-radius: 10px;
    text-decoration: none !important;
    color: rgba(255,255,255,.82);
    font-size: 14.5px;
    font-weight: 600;
    transition: all .16s;
    cursor: pointer;
}

    .sb-link:hover {
        background: rgba(255,255,255,.08);
        color: var(--gye-blanco);
        text-decoration: none;
    }

    .sb-link.activo {
        color: var(--gye-blanco);
    }

    .sb-link .ico {
        width: 20px;
        text-align: center;
        font-size: 17px;
        flex-shrink: 0;
    }

.sb-badge {
    margin-left: auto;
    background: var(--gye-oro);
    color: var(--gye-navy);
    border-radius: 20px;
    font-size: 10px;
    font-weight: 800;
    padding: 1px 7px;
    min-width: 20px;
    text-align: center;
}

/* Flecha expand */
.sb-caret {
    font-size: 17px;
    color: rgba(255,255,255,.35);
    -webkit-transition: -webkit-transform 0.2s;
    transition: transform 0.2s;
    -ms-flex-negative: 0;
    flex-shrink: 0;
    margin-left: 4px;
    display: inline-block;
    line-height: 1;
    vertical-align: middle;
}
.sb-menu-item.open > .sb-menu-link .sb-caret {
    -webkit-transform: rotate(180deg);
    transform: rotate(180deg);
    color: rgba(255,255,255,.7);
}

/* ── Sub-menú nivel 2 (base / mobile: acordeón) ──────────── */
.sb-sub-menu {
    list-style: none;
    padding: 2px 0 6px 10px;
    margin: 0 0 0 16px;
    display: none;
    border-left: 2px solid rgba(255,255,255,.1);
}

.sb-submenu-item { margin-bottom: 1px; }

.sb-submenu-link {
    display: -webkit-box;
    display: -ms-flexbox;
    display: flex;
    -webkit-box-align: center;
    -ms-flex-align: center;
    align-items: center;
    padding: 7px 10px;
    border-radius: 7px;
    color: rgba(255,255,255,.5);
    font-size: 13px;
    font-weight: 400;
    text-decoration: none;
    -webkit-transition: background .13s, color .13s;
    transition: background .13s, color .13s;
    gap: 6px;
}
.sb-submenu-link:hover,
.sb-submenu-link:focus {
    background: rgba(255,255,255,.07);
    color: rgba(255,255,255,.85);
    text-decoration: none;
}
.sb-submenu-link::before {
    content: '';
    width: 5px; height: 5px;
    border-radius: 50%;
    background: rgba(255,255,255,.25);
    -ms-flex-negative: 0;
    flex-shrink: 0;
    display: inline-block;
}
.sb-submenu-link:hover::before { background: var(--gye-azul2); }

/* Flecha L2 */
.sb-caret-2 {
    font-size: 15px;
    color: rgba(255,255,255,.25);
    -webkit-transition: -webkit-transform .2s;
    transition: transform .2s;
    -ms-flex-negative: 0;
    flex-shrink: 0;
    margin-left: auto;
}
.sb-submenu-item.open > .sb-submenu-link .sb-caret-2 {
    -webkit-transform: rotate(180deg);
    transform: rotate(180deg);
}

/* ── Sub-menú nivel 3 (base / mobile: acordeón) ──────────── */
.sb-sub3-menu {
    list-style: none;
    padding: 2px 0 4px 12px;
    margin: 0;
    display: none;
}
.sb-submenu-item.open > .sb-sub3-menu { display: block; }

.sb-sub3-link {
    display: block;
    padding: 5px 8px;
    border-radius: 6px;
    color: rgba(255,255,255,.38);
    font-size: 11.5px;
    text-decoration: none;
    -webkit-transition: color .13s;
    transition: color .13s;
}
.sb-sub3-link:hover,
.sb-sub3-link:focus {
    color: rgba(255,255,255,.7);
    text-decoration: none;
}

/* ── Desktop: flyout flotante (≥ 992px) ───────────────────── */
@media (min-width: 992px) {

    /* Caret L1 apunta a la derecha */
    .sb-caret {
        -webkit-transform: rotate(-90deg);
        transform: rotate(-90deg);
    }
    .sb-menu-item.open > .sb-menu-link .sb-caret {
        -webkit-transform: rotate(-90deg);
        transform: rotate(-90deg);
        color: rgba(255,255,255,.9);
    }

    /* Panel flotante nivel 2 */
    .sb-sub-menu {
        display: block !important; /* ignora el display:none del acordeón */
        position: fixed;
        z-index: 1050;
        padding: 6px 0;
        margin: 0;
        border-left: none;
        /* Apariencia */
        background: #ffffff;
        border-radius: 12px;
        -webkit-box-shadow: 0 8px 32px rgba(15,27,61,.16), 0 2px 6px rgba(0,0,0,.07);
        box-shadow: 0 8px 32px rgba(15,27,61,.16), 0 2px 6px rgba(0,0,0,.07);
        border: 1px solid var(--gye-borde);
        min-width: 224px;
        max-width: 284px;
        max-height: 72vh;
        overflow-y: auto;
        overflow-x: hidden;
        /* Estado oculto — SIN transform: un transform convertiría a este panel
           en bloque contenedor de los paneles L3 (position:fixed) y los recortaría
           con su overflow. Animamos solo con opacity. */
        opacity: 0;
        pointer-events: none;
        -webkit-transition: opacity .14s ease;
        transition: opacity .14s ease;
    }
    /* Visible cuando el padre tiene .open  O  cuando JS añade la clase directamente */
    .sb-menu-item.open > .sb-sub-menu,
    .sb-sub-menu.sb-flyout-visible {
        opacity: 1;
        pointer-events: auto;
    }

    /* Cabecera del panel (inyectada por JS) */
    .sb-flyout-header {
        padding: 8px 14px 5px;
        font-size: 10px;
        font-weight: 700;
        text-transform: uppercase;
        letter-spacing: .7px;
        color: var(--gye-txt3);
        border-bottom: 1px solid var(--gye-borde);
        margin-bottom: 3px;
        list-style: none;
        cursor: default;
    }

    /* Links nivel 2 sobre fondo blanco */
    .sb-submenu-link {
        color: #334155;
        padding: 8px 14px;
        border-radius: 0;
        font-size: 13px;
    }
    .sb-submenu-link:hover,
    .sb-submenu-link:focus {
        background: var(--gye-azul-bg);
        color: var(--gye-azul);
    }
    .sb-submenu-link::before { background: var(--gye-azul-bd); }
    .sb-submenu-link:hover::before { background: var(--gye-azul); }

    /* Caret L2 apunta a la derecha */
    .sb-caret-2 {
        -webkit-transform: rotate(-90deg);
        transform: rotate(-90deg);
        color: #b0bbce;
    }
    .sb-submenu-item.open > .sb-submenu-link .sb-caret-2 {
        -webkit-transform: rotate(-90deg);
        transform: rotate(-90deg);
        color: var(--gye-azul);
    }

    /* Panel flotante nivel 3 */
    .sb-sub3-menu {
        display: block !important;
        position: fixed;
        z-index: 1060;
        padding: 6px 0;
        margin: 0;
        background: #ffffff;
        border-radius: 12px;
        -webkit-box-shadow: 0 8px 32px rgba(15,27,61,.16), 0 2px 6px rgba(0,0,0,.07);
        box-shadow: 0 8px 32px rgba(15,27,61,.16), 0 2px 6px rgba(0,0,0,.07);
        border: 1px solid var(--gye-borde);
        min-width: 204px;
        max-width: 260px;
        max-height: 65vh;
        overflow-y: auto;
        overflow-x: hidden;
        opacity: 0;
        pointer-events: none;
        -webkit-transition: opacity .14s ease;
        transition: opacity .14s ease;
    }
    /* Visible cuando el padre tiene .open, .has-sub3:hover  O  cuando JS añade la clase */
    .sb-submenu-item.has-sub3:hover > .sb-sub3-menu,
    .sb-submenu-item.open > .sb-sub3-menu,
    .sb-sub3-menu.sb-flyout-visible {
        opacity: 1;
        pointer-events: auto;
    }

    /* Links nivel 3 sobre fondo blanco */
    .sb-sub3-link {
        display: block;
        padding: 7px 14px;
        border-radius: 0;
        color: #334155;
        font-size: 13px;
        text-decoration: none;
        -webkit-transition: background .12s, color .12s;
        transition: background .12s, color .12s;
    }
    .sb-sub3-link:hover,
    .sb-sub3-link:focus {
        background: var(--gye-azul-bg);
        color: var(--gye-azul);
        text-decoration: none;
    }
}

/* ── Desktop: colapsar / expandir el sidebar con el botón hamburguesa ─
   El botón está visible siempre; en desktop el usuario decide ocultar
   el menú izquierdo. El estado se conserva entre páginas vía localStorage. */
@media (min-width: 992px) {
    .portal-sidebar {
        -webkit-transition: width .25s ease;
        transition: width .25s ease;
    }
    .portal-layout.sb-collapsed .portal-sidebar {
        width: 0;
        min-width: 0;
        overflow: hidden;
        border-right: none;
    }
    /* Evita la animación de colapso al restaurar la preferencia en la carga */
    .portal-layout.sb-no-anim .portal-sidebar {
        -webkit-transition: none !important;
        transition: none !important;
    }
}

/* ── Enlace de login ──────────────────────────────────────── */
.sb-login-item {
    margin-top: 8px;
    border-top: 1px solid rgba(255,255,255,.08);
    padding-top: 8px;
}
.sb-login-link {
    display: -webkit-box;
    display: -ms-flexbox;
    display: flex;
    -webkit-box-align: center;
    -ms-flex-align: center;
    align-items: center;
    -webkit-box-pack: center;
    -ms-flex-pack: center;
    justify-content: center;
    padding: 11px 14px;
    border-radius: 9px;
    background: var(--gye-oro);
    color: var(--gye-navy) !important;
    font-size: 14px;
    font-weight: 700;
    text-decoration: none !important;
    border: none;
    -webkit-box-shadow: 0 2px 8px rgba(246,184,39,.35);
    box-shadow: 0 2px 8px rgba(246,184,39,.35);
    -webkit-transition: background 0.15s, box-shadow 0.15s;
    transition: background 0.15s, box-shadow 0.15s;
    gap: 7px;
}
.sb-login-link:hover {
    background: var(--gye-oro-h);
    color: var(--gye-navy) !important;
    -webkit-box-shadow: 0 4px 14px rgba(246,184,39,.5);
    box-shadow: 0 4px 14px rgba(246,184,39,.5);
}

/* ── Enlace de registro (secundario, cyan de marca) ───────── */
.sb-register-link {
    -webkit-box-sizing: border-box;
    box-sizing: border-box;
    display: -webkit-box;
    display: -ms-flexbox;
    display: flex;
    -webkit-box-align: center;
    -ms-flex-align: center;
    align-items: center;
    -webkit-box-pack: center;
    -ms-flex-pack: center;
    justify-content: center;
    margin-top: 8px;
    padding: 10px 14px;
    border-radius: 9px;
    background: var(--gye-azul2);
    color: #fff !important;
    border: 1.5px solid var(--gye-azul2);
    font-size: 14px;
    font-weight: 700;
    text-decoration: none !important;
    -webkit-transition: background 0.15s, color 0.15s, border-color 0.15s;
    transition: background 0.15s, color 0.15s, border-color 0.15s;
    gap: 7px;
}
.sb-register-link:hover {
    background: var(--gye-azul);
    color: #fff !important;
    border-color: var(--gye-azul);
    text-decoration: none !important;
}

/* ── Cerrar sesión ────────────────────────────────────────── */
.sb-logout-wrap {
    padding: 8px 16px 4px;
    -ms-flex-negative: 0;
    flex-shrink: 0;
}
.sb-logout-btn {
    -webkit-box-sizing: border-box;
    box-sizing: border-box; /* el width:100% incluye padding/borde */
    display: -webkit-box;
    display: -ms-flexbox;
    display: flex;
    -webkit-box-align: center;
    -ms-flex-align: center;
    align-items: center;
    -webkit-box-pack: center;
    -ms-flex-pack: center;
    justify-content: center;
    gap: 8px;
    width: 100%;
    padding: 10px 14px;
    border-radius: 9px;
    background: var(--gye-azul2) !important;
    border: 1px solid rgba(29,169,225,.45);
    color: var(--gye-blanco) !important;
    font-size: 13.5px;
    font-weight: 600;
    text-align: center;
    cursor: pointer;
    -webkit-transition: background 0.15s, border-color 0.15s, color 0.15s;
    transition: background 0.15s, border-color 0.15s, color 0.15s;
    text-decoration: none !important;
}
.sb-logout-btn .material-icons { font-size: 18px; line-height: 1; }
.sb-logout-btn:hover {
    background: var(--gye-azul) !important;
    border-color: var(--gye-azul) !important;
    color: var(--gye-blanco) !important;
    text-decoration: none !important;
}

/* ── Pie del sidebar ──────────────────────────────────────── */
.sb-footer {
    margin-top: auto;
    /*padding: 14px 16px 18px;*/
    padding: 14px 8px 14px 8px;
    border-top: 1px solid rgba(255,255,255,.07);
    font-size: 11.5px;
    color: rgba(255,255,255,.6);
    line-height: 1.7;
    -ms-flex-negative: 0;
    flex-shrink: 0;
}
.sb-footer b {
    color: rgba(255,255,255,.82);
    font-weight: 600;
}

/* ═══════════════════════════════════════════════════════════
   CONTENIDO PRINCIPAL (portal-main)
═══════════════════════════════════════════════════════════ */
.portal-main {
    -webkit-box-flex: 1;
    -ms-flex: 1 1 0%;
    flex: 1 1 0%;
    min-width: 0;
    display: -webkit-box;
    display: -ms-flexbox;
    display: flex;
    -webkit-box-orient: vertical;
    -webkit-box-direction: normal;
    -ms-flex-direction: column;
    flex-direction: column;
}

/* ── Top Bar ──────────────────────────────────────────────── */
.portal-topbar {
    background: var(--gye-blanco);
    border-bottom: 1px solid var(--gye-borde);
    height: var(--topbar-h);
    display: -webkit-box;
    display: -ms-flexbox;
    display: flex;
    -webkit-box-align: center;
    -ms-flex-align: center;
    align-items: center;
    -webkit-box-pack: justify;
    -ms-flex-pack: justify;
    justify-content: space-between;
    padding: 0 24px;
    position: -webkit-sticky;
    position: sticky;
    top: 0;
    z-index: 150;
    -webkit-box-shadow: 0 1px 3px rgba(0,0,0,.04);
    box-shadow: 0 1px 3px rgba(0,0,0,.04);
    -ms-flex-negative: 0;
    flex-shrink: 0;
}

.topbar-left {
    display: -webkit-box;
    display: -ms-flexbox;
    display: flex;
    -webkit-box-align: center;
    -ms-flex-align: center;
    align-items: center;
    gap: 14px;
    min-width: 0;
}

/* Botón hamburguesa (visible siempre: el usuario decide cuándo ocultar el menú) */
.sidebar-toggle-btn {
    display: block;
    background: none;
    border: none;
    cursor: pointer;
    padding: 6px;
    border-radius: 7px;
    -webkit-transition: background 0.15s;
    transition: background 0.15s;
    -ms-flex-negative: 0;
    flex-shrink: 0;
}
.sidebar-toggle-btn:hover { background: var(--gye-fondo); }
.sidebar-toggle-btn .icon-bar {
    display: block;
    width: 20px;
    height: 2px;
    background: var(--gye-txt2);
    border-radius: 2px;
    margin: 4px 0;
    -webkit-transition: background 0.15s;
    transition: background 0.15s;
}
.sidebar-toggle-btn:hover .icon-bar { background: var(--gye-txt1); }

.topbar-titles {
    min-width: 0;
}
.topbar-title {
    display: block;
    font-size: 15px;
    font-weight: 700;
    color: var(--gye-txt1);
    line-height: 1.2;
    white-space: nowrap;
}
.topbar-date,
span.topbar-date {
    display: block;
    font-size: 11.5px;
    color: var(--gye-txt2) !important;
    white-space: nowrap;
    line-height: 1.3;
    margin-top: 1px;
}

.topbar-right {
    display: -webkit-box;
    display: -ms-flexbox;
    display: flex;
    -webkit-box-align: center;
    -ms-flex-align: center;
    align-items: center;
    gap: 12px;
    -ms-flex-negative: 0;
    flex-shrink: 0;
}

/* ── Campana de notificaciones (topbar) ───────────────────── */
.topbar-notif-btn {
    position: relative;
    display: -webkit-inline-box;
    display: -ms-inline-flexbox;
    display: inline-flex;
    -webkit-box-align: center;
    -ms-flex-align: center;
    align-items: center;
    -webkit-box-pack: center;
    -ms-flex-pack: center;
    justify-content: center;
    width: 38px;
    height: 38px;
    border-radius: 10px;
    background: var(--gye-fondo);
    border: 1.5px solid var(--gye-borde);
    text-decoration: none !important;
    -webkit-transition: background .15s, border-color .15s;
    transition: background .15s, border-color .15s;
    -ms-flex-negative: 0;
    flex-shrink: 0;
}
.topbar-notif-btn:hover {
    background: var(--gye-azul-bg);
    border-color: var(--gye-azul2);
    text-decoration: none !important;
}
.topbar-notif-ico {
    font-size: 22px !important;
    color: var(--gye-txt2);
    font-variation-settings: 'FILL' 1, 'wght' 400, 'GRAD' 0, 'opsz' 24; /* aplica a material-symbols-outlined */
    -webkit-transition: color .15s;
    transition: color .15s;
}
.topbar-notif-btn:hover .topbar-notif-ico {
    color: var(--gye-azul2);
}

/* ── Botón de logout (topbar) — mismo base que campana, hover en rojo tenue ── */
.topbar-logout-btn {
    background: none;
    cursor: pointer;
    padding: 0;
    outline: none;
    border: 1.5px solid var(--gye-borde);
}
.topbar-logout-btn:hover {
    background: var(--gye-azul-bg) !important;
    border-color: var(--gye-azul2) !important;
}
.topbar-logout-btn:hover .topbar-notif-ico {
    color: var(--gye-azul2) !important;
}

.topbar-notif-badge {
    position: absolute;
    top: -6px;
    right: -6px;
    min-width: 18px;
    height: 18px;
    border-radius: 20px;
    background: var(--gye-rojo);
    color: #fff;
    font-size: 10px;
    font-weight: 800;
    padding: 0 5px;
    border: 2px solid var(--gye-blanco);
    /* flexbox para centrado vertical/horizontal perfecto */
    display: -webkit-inline-box;
    display: -ms-inline-flexbox;
    display: inline-flex;
    -webkit-box-align: center;
    -ms-flex-align: center;
    align-items: center;
    -webkit-box-pack: center;
    -ms-flex-pack: center;
    justify-content: center;
    line-height: 1;
    box-sizing: border-box;
}

/* Barra de búsqueda — reglas base (sobreescritas por el bloque BUSCADOR TOPBAR más abajo) */

/* ── Zona de notificaciones ───────────────────────────────── */
.portal-notifications {
    padding: 0 20px;
    background: var(--gye-blanco);
    border-bottom: 1px solid var(--gye-borde);
}

/* Overrides para pnlMensaje heredado */
.portal-notifications .pnlMensajeError,
.portal-notifications .pnlMensajeAdvertencia,
.portal-notifications .pnlMensajeExito {
    width: auto !important;
    border-radius: 8px;
    margin: 10px 0;
    display: block !important;
}

/* ── Área de contenido ────────────────────────────────────── */
.portal-content {
    -webkit-box-flex: 1;
    -ms-flex: 1 1 auto;
    flex: 1 1 auto;
    padding: 20px 24px;
    background: var(--gye-fondo);
    min-width: 0;
    overflow-x: hidden;
}

/* ── Footer ───────────────────────────────────────────────── */
.portal-footer {
    background: var(--gye-blanco);
    border-top: 1px solid var(--gye-borde);
    -ms-flex-negative: 0;
    flex-shrink: 0;
}

.portal-footer-inner {
    display: -webkit-box;
    display: -ms-flexbox;
    display: flex;
    -ms-flex-wrap: wrap;
    flex-wrap: wrap;
    -webkit-box-align: start;
    -ms-flex-align: start;
    align-items: flex-start;
    gap: 20px;
    padding: 20px 24px 16px;
}

.footer-logo-wrap {
    -ms-flex-negative: 0;
    flex-shrink: 0;
}
.footer-logo {
    height: auto;
    display: block;
}

.footer-info {
    -webkit-box-flex: 1;
    -ms-flex: 1;
    flex: 1;
    min-width: 220px;
}
.footer-channels-label {
    color: var(--gye-txt1);
    font-size: 13px;
    font-weight: 700;
    margin-bottom: 8px;
}
.footer-social {
    display: -webkit-box;
    display: -ms-flexbox;
    display: flex;
    gap: 8px;
    -webkit-box-align: center;
    -ms-flex-align: center;
    align-items: center;
    margin-bottom: 10px;
    -ms-flex-wrap: wrap;
    flex-wrap: wrap;
}
.footer-social-icon {
    width: 26px !important;
    height: 26px !important;
    border-radius: 6px;
    -webkit-transition: opacity 0.15s;
    transition: opacity 0.15s;
}
.footer-social a:hover .footer-social-icon { opacity: 0.8; }

/* Enlaces de redes sociales en el footer: sin subrayado (la "rayita" del hover) */
.canal-mini-dat a,
.canal-mini-dat a:hover,
.canal-mini-dat a:focus {
    text-decoration: none !important;
    display: inline-flex;
    align-items: center;
}
.canal-mini-dat a:hover .footer-social-icon { opacity: .8; }

.footer-contact {
    font-size: 12px;
    color: var(--gye-txt2);
    line-height: 2;
}
.footer-contact a {
    color: var(--gye-azul);
    text-decoration: none;
}
.footer-contact a:hover { text-decoration: underline; }
.footer-contact .material-icons { font-size: 13px !important; vertical-align: middle; }

.footer-browser-note {
    text-align: center;
    font-size: 10.5px;
    color: var(--gye-txt3);
    padding: 8px 24px 6px;
    border-top: 1px solid var(--gye-borde);
}
.footer-copyright {
    text-align: center;
    background: var(--gye-navy);
    color: rgba(255,255,255,.55);
    font-size: 11px;
    padding: 10px 24px;
}

/* ── Overlay móvil ────────────────────────────────────────── */
.portal-overlay {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0,0,0,.48);
    z-index: 199;
}
.portal-overlay.overlay-visible { display: block; }

/* ── Overrides de Bootstrap 3 para el contexto de sidebar ─── */

/* Anular el body.navbar-padding que aplica Bootstrap cuando hay un navbar fixed */
body.portal-bg { padding-top: 0 !important; }

/* Neutralizar estilos antiguos del header y navbar */
.portal-layout .header,
.portal-layout .AppTitlenuevo,
.portal-layout .date-right,
.portal-layout #nav-wrapper,
.portal-layout #nav { display: none !important; }

/* Anular center-div y su width fijo cuando está dentro del área de notificaciones */
.portal-notifications .center-div {
    width: auto;
    margin: 0;
}

/* ── DOS COLUMNAS ── */
.cols            { display: grid; grid-template-columns: 340px 1fr; gap: 18px; margin-bottom: 22px; align-items: stretch; }

/* Columna derecha: flex-column para apilar paneles internos con igual altura */
.col-derecha     { display: flex; flex-direction: column; gap: 14px; }
/* Cada panel dentro de la columna derecha se estira para igualar el alto de la izquierda */
.col-derecha > .panel { flex: 1; }

/* ─────────────────────────────────────────────────────────
   RESPONSIVE
───────────────────────────────────────────────────────── */

/* Tablets y móvil (Bootstrap 3 md breakpoint: < 992px) */
@media (max-width: 991px) {

    /* Las dos columnas principales se apilan en tablet/móvil */
    .cols { grid-template-columns: 1fr; }
    /* La columna derecha recupera su altura natural al apilarse */
    .col-derecha > .panel { flex: none; }

    /* Sidebar se convierte en off-canvas */
    .portal-sidebar {
        position: fixed;
        left: -270px;
        top: 0;
        height: 100%;
        min-height: unset;
        -webkit-transition: left 0.28s ease;
        transition: left 0.28s ease;
        z-index: 1001;
        -webkit-box-shadow: none;
        box-shadow: none;
    }
    .portal-sidebar.sidebar-open {
        left: 0;
        -webkit-box-shadow: 4px 0 24px rgba(0,0,0,.35);
        box-shadow: 4px 0 24px rgba(0,0,0,.35);
    }

    /* Botón hamburguesa visible */
    .sidebar-toggle-btn { display: block; }

    /* Ajuste del topbar sin el sidebar */
    .portal-topbar { padding: 0 16px; }

    /* Ocultar barra de búsqueda en móvil para ganar espacio */
    .topbar-search { display: none; }

    /* Contenido no desplazado por sidebar fijo */
    .portal-content { padding: 16px; }

    /* Footer interno en columna */
    .portal-footer-inner { -webkit-box-orient: vertical; -webkit-box-direction: normal; -ms-flex-direction: column; flex-direction: column; }
    .footer-logo { max-width: 220px; }
}

/* Móvil pequeño */
@media (max-width: 600px) {
    .topbar-title { font-size: 14px; }
    .topbar-date  { display: none; } /* se oculta para ahorrar espacio */
    .portal-content { padding: 12px; }
}

/* ─────────────────────────────────────────────────────────
   Correcciones de estilo para formularios dentro del contenido
───────────────────────────────────────────────────────── */

/* Garantizar que los formularios hijos no rompan el layout */
.portal-content .container,
.portal-content .container-fluid {
    padding-left: 0 !important;
    padding-right: 0 !important;
}
.portal-content .row-fluid { margin-left: 0; margin-right: 0; }

/* Ajustar el panel de mensajes heredado */
.portal-content .center-div {
    width: 100%;
    max-width: 700px;
}


/* ── CANALES FOOTER ── */
.canales-strip {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 12px;
    padding: 10px 5px 10px 5px;
}
/* Responsive: deben ir DESPUÉS de la regla base para que el cascade los aplique
   (los media queries no aumentan la especificidad). */
@media (max-width: 900px) {
    .canales-strip { grid-template-columns: repeat(2, 1fr); }
}
@media (max-width: 560px) {
    .canales-strip { grid-template-columns: 1fr; }
}

.canal-mini {
    background: var(--gye-blanco);
    border: 1px solid var(--gye-borde);
    border-radius: 14px;
    padding: 16px;
    display: flex;
    align-items: center;
    gap: 12px;
}

.canal-mini-ico {
    width: 40px;
    height: 40px;
    border-radius: 10px;
    flex-shrink: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 18px;
}

.cmi-azul { background: var(--gye-azul-bg); }
.cmi-rojo { background: #FEF0EA; }
.cmi-verde { background: #E6F9F0; }
.canal-mini-tit { font-size: 12px; font-weight: 700; margin-bottom: 2px; }
.canal-mini-dat { font-size: 11.5px; color: var(--gye-txt2); line-height: 1.4; }

/* ── BIENVENIDA ── */
.welcome-strip {
    /* El fondo ya no es una sola imagen fija: son dos capas (.welcome-bg) que se
       alternan con crossfade — ver más abajo y el JS del carrusel en STL10002.aspx. */
    border-radius: 18px;
    padding: 26px 30px;
    margin-bottom: 22px;
    /* Altura mínima fija: si el saludo pasa a 2 líneas (nombres largos), el banner
       no debe crecer — si no, el fondo "cover" se recorta distinto según el alto
       del contenido (con nombre corto se ve todo el skyline; con nombre largo se
       veía recortado). Con esta altura fija el recorte de la imagen es siempre el mismo. */
    min-height: 190px;
    box-sizing: border-box;
    display: flex;
    align-items: center;
    justify-content: flex-start;
    gap: 20px;
    position: relative;
    overflow: hidden;
}

/* Carrusel de imágenes de fondo del banner: dos capas absolutas superpuestas,
   el JS alterna cuál tiene la clase "activo" (opacity 1) cada
   --welcome-banner-duracion, con un crossfade de --welcome-banner-transicion.
   Agregar una imagen nueva al carrusel es solo sumar una ruta al array IMAGENES
   del script — no requiere tocar este CSS. */
.welcome-bg-wrap {
    position: absolute;
    inset: 0;
    z-index: 0;
}
.welcome-bg {
    position: absolute;
    inset: 0;
    background-size: cover;
    /* Valor por defecto — cada imagen del carrusel puede pisarlo con su propio
       background-position inline desde el JS (array IMAGENES), porque no todas
       necesitan el mismo anclaje vertical (depende de dónde esté el contenido
       importante en cada foto). */
    background-position: center right;
    background-repeat: no-repeat;
    opacity: 0;
    transition: opacity var(--welcome-banner-transicion) ease-in-out;
}
.welcome-bg.activo { opacity: 1; }

/* Saludo + clima apilados a la izquierda — deja libre el skyline de la foto (a la
   derecha) en vez de repartir el contenido en los dos extremos del banner. */
.welcome-left {
    position: relative;
    z-index: 1;
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    gap: 12px;
}

    .welcome-strip::before {
        content: '';
        position: absolute;
        right: -30px;
        top: -40px;
        width: 200px;
        height: 200px;
        border-radius: 50%;
        background: rgba(255,255,255,.05);
        pointer-events: none;
    }

    .welcome-strip::after {
        content: '';
        position: absolute;
        right: 60px;
        bottom: -60px;
        width: 140px;
        height: 140px;
        border-radius: 50%;
        background: rgba(246,184,39,.08);
        pointer-events: none;
    }

.welcome-txt h2 {
    font-size: 20px;
    font-weight: 800;
    color: var(--gye-blanco);
    margin-bottom: 4px;
}

    .welcome-txt h2 em {
        color: var(--gye-oro);
        font-style: normal;
    }

.welcome-txt p {
    font-size: 13px;
    color: rgba(255,255,255,.7);
    max-width: 420px;
}

/* ── Widget de clima (banner de bienvenida) — sólido, para resaltar sobre el
   degradado navy/cyan del banner (mismo criterio que .btn-w-blanco). ── */
.welcome-clima {
    display: flex;
    align-items: center;
    gap: 14px;
    background: var(--gye-blanco);
    border-radius: 16px;
    padding: 10px 20px 10px 12px;
    flex-shrink: 0;
    position: relative;
    z-index: 1;
    box-shadow: 0 6px 18px rgba(0,0,0,.22);
}
.welcome-clima-ico-wrap {
    width: 46px;
    height: 46px;
    border-radius: 50%;
    background: var(--gye-oro);
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    box-shadow: 0 2px 8px rgba(246,184,39,.45);
}
.welcome-clima-ico {
    font-size: 24px;
    line-height: 1;
}
.welcome-clima-info {
    display: flex;
    flex-direction: column;
    gap: 1px;
}
.welcome-clima-temp {
    font-size: 20px;
    font-weight: 800;
    color: var(--gye-navy);
    line-height: 1.1;
}
.welcome-clima-desc {
    font-size: 11px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: .3px;
    color: var(--gye-txt2);
    white-space: nowrap;
}

@media (max-width: 600px) {
    .welcome-clima { display: none; }
}

.welcome-btns {
    display: flex;
    gap: 10px;
    flex-shrink: 0;
}

.btn-w {
    padding: 10px 20px;
    border-radius: 10px;
    font-family: var(--gye-font);
    font-size: 13px;
    font-weight: 700;
    cursor: pointer;
    text-decoration: none;
    transition: all .16s;
    white-space: nowrap;
}

.btn-w-oro {
    background: var(--gye-oro);
    color: var(--gye-navy);
    border: none;
    -webkit-box-shadow: 0 2px 8px rgba(246,184,39,.35);
    box-shadow: 0 2px 8px rgba(246,184,39,.35);
    text-decoration: none !important;
}
    .btn-w-oro:hover {
        background: var(--gye-oro-h);
        color: var(--gye-navy);
        -webkit-box-shadow: 0 4px 14px rgba(246,184,39,.55);
        box-shadow: 0 4px 14px rgba(246,184,39,.55);
        -webkit-transform: translateY(-1px);
        transform: translateY(-1px);
        text-decoration: none !important;
    }
    .btn-w-oro:focus {
        color: var(--gye-navy);
        text-decoration: none !important;
    }

.btn-w-ghost {
    background: rgba(255,255,255,.12);
    border: 1.5px solid rgba(255,255,255,.25);
    color: var(--gye-blanco);
}
    .btn-w-ghost:hover {
        background: rgba(255,255,255,.2);
    }

/* Botón blanco sólido — resalta sobre fondos oscuros (banner bienvenida) */
.btn-w-blanco {
    background: var(--gye-blanco);
    color: var(--gye-navy);
    border: none;
    -webkit-box-shadow: 0 2px 10px rgba(0,0,0,.18);
    box-shadow: 0 2px 10px rgba(0,0,0,.18);
    display: inline-flex;
    align-items: center;
}
    .btn-w-blanco:hover {
        background: var(--gye-azul-bg);
        color: var(--gye-azul);
        text-decoration: none !important;
        -webkit-box-shadow: 0 4px 16px rgba(0,0,0,.22);
        box-shadow: 0 4px 16px rgba(0,0,0,.22);
    }
    .btn-w-blanco:focus {
        text-decoration: none !important;
        color: var(--gye-navy);
    }

/* ── KPI STRIP ── */
.kpi-row { display: grid; grid-template-columns: repeat(auto-fit, minmax(160px, 1fr)); gap: 14px; margin-bottom: 22px; }
.kpi {
  background: var(--gye-blanco); border: 1px solid var(--gye-borde);
  border-radius: 14px; padding: 16px 18px;
}
.kpi-label {
    font-size: 11px;
    font-weight: 600;
    color: var(--gye-txt2);
    text-transform: uppercase;
    letter-spacing: .6px;
    margin-bottom: 6px;
}
.kpi-val {
    font-size: 26px;
    font-weight: 800;
    color: var(--gye-txt1);
    line-height: 1;
}
.kpi-sub {
    font-size: 11px;
    color: var(--gye-txt3);
    margin-top: 4px;
}
.kpi-dot { display: inline-block; width: 7px; height: 7px; border-radius: 50%; margin-right: 5px; }
.dot-verde { background: var(--gye-verde); }
.dot-amber { background: var(--gye-amber); }
.dot-rojo  { background: var(--gye-rojo); }
.dot-azul  { background: var(--gye-azul2); }

/* ── BUSCADOR TOPBAR ── */
.topbar-search-wrap {
    -webkit-box-flex: 1;
    -ms-flex: 1 1 0px;
    flex: 1 1 0;
    min-width: 200px;
    max-width: 480px;
    margin: 0 14px;
    position: relative;
    -webkit-box-sizing: border-box;
    box-sizing: border-box;
}

/* Input container — ocupa todo el ancho del wrapper */
.topbar-search {
    display: -webkit-box;
    display: -ms-flexbox;
    display: flex;
    -webkit-box-align: center;
    -ms-flex-align: center;
    align-items: center;
    gap: 8px;
    width: 100%;
    -webkit-box-sizing: border-box;
    box-sizing: border-box;
    background: var(--gye-fondo);
    border: 1.5px solid var(--gye-borde);
    border-radius: 10px;
    padding: 0 14px;
    height: 38px;
    -webkit-transition: border-color .15s, background .15s, border-radius .12s;
    transition: border-color .15s, background .15s, border-radius .12s;
}
.topbar-search:focus-within {
    background: var(--gye-blanco);
    border-color: var(--gye-azul2);
}
/* Cuando el dropdown está abierto: aplana la parte inferior del input */
.topbar-search.expanded {
    border-radius: 10px 10px 0 0;
    border-bottom-color: var(--gye-borde);
    background: var(--gye-blanco);
    border-color: var(--gye-azul2);
}

.topbar-search-ico {
    font-size: 18px !important;
    color: var(--gye-txt3);
    -ms-flex-negative: 0;
    flex-shrink: 0;
}
.topbar-search-input {
    -webkit-box-flex: 1;
    -ms-flex: 1;
    flex: 1;
    border: none;
    outline: none;
    background: transparent;
    font-size: 13px;
    color: var(--gye-txt1);
    font-family: inherit;
    min-width: 0;
}
.topbar-search-input::-webkit-input-placeholder { color: var(--gye-txt3); }
.topbar-search-input::-moz-placeholder          { color: var(--gye-txt3); }
.topbar-search-input::placeholder               { color: var(--gye-txt3); }
.topbar-search-count {
    font-size: 11px;
    color: var(--gye-txt3);
    background: var(--gye-fondo);
    border: 1px solid var(--gye-borde);
    border-radius: 4px;
    padding: 1px 6px;
    white-space: nowrap;
    -ms-flex-negative: 0;
    flex-shrink: 0;
    display: none;
}

/* Dropdown — mismo ancho que el input (left:0;right:0 del wrapper) */
.topbar-search-dd {
    position: absolute;
    top: 100%;                           /* pegado inmediatamente bajo el input */
    left: 0; right: 0;
    -webkit-box-sizing: border-box;
    box-sizing: border-box;
    background: var(--gye-blanco);
    border: 1.5px solid var(--gye-azul2);
    border-top: none;                    /* se fusiona con el borde inferior del input */
    border-radius: 0 0 10px 10px;        /* mismo radio que el input */
    box-shadow: 0 6px 24px rgba(15,27,61,.12);
    z-index: 500;
    overflow: hidden;
    display: none;
}
.topbar-search-dd.visible { display: block; animation: tsdd-in .13s ease; }
@keyframes tsdd-in { from { opacity:0; transform:translateY(-4px); } to { opacity:1; transform:translateY(0); } }

/* Ítems de resultado */
.tsd-item {
    display: -webkit-box;
    display: -ms-flexbox;
    display: flex;
    -webkit-box-align: center;
    -ms-flex-align: center;
    align-items: center;
    gap: 11px;
    padding: 9px 14px;
    cursor: pointer;
    border-bottom: 1px solid var(--gye-borde);
    text-decoration: none !important;
    color: var(--gye-txt1);
    -webkit-transition: background .13s;
    transition: background .13s;
}
.tsd-item:last-of-type { border-bottom: none; }
.tsd-item:hover { background: var(--gye-azul-bg); }
.tsd-ico {
    width: 30px; height: 30px;
    border-radius: 7px;
    -ms-flex-negative: 0;
    flex-shrink: 0;
    display: -webkit-inline-box;
    display: -ms-inline-flexbox;
    display: inline-flex;
    -webkit-box-align: center;
    -ms-flex-align: center;
    align-items: center;
    -webkit-box-pack: center;
    -ms-flex-pack: center;
    justify-content: center;
}
.tsd-ico .material-symbols-outlined {
    font-size: 15px;
    font-variation-settings: 'FILL' 1, 'wght' 400, 'GRAD' 0, 'opsz' 20;
    line-height: 1;
}
.tsd-nom { font-size: 13px; font-weight: 600; line-height: 1.3; }
.tsd-cat { font-size: 11px; color: var(--gye-txt2); margin-top: 1px; }
.tsd-arr { margin-left: auto; font-size: 16px !important; color: var(--gye-txt3); -ms-flex-negative: 0; flex-shrink: 0; }
.tsd-empty { padding: 18px 16px; text-align: center; color: var(--gye-txt2); font-size: 13px; line-height: 1.6; }
/* Pie informativo de resultados — no es interactivo */
.tsd-info-footer {
    display: -webkit-box;
    display: -ms-flexbox;
    display: flex;
    -webkit-box-align: center;
    -ms-flex-align: center;
    align-items: center;
    gap: 7px;
    padding: 10px 14px;
    background: var(--gye-azul-bg);
    border-top: 1px solid var(--gye-azul-bd);
    font-size: 12px;
    color: var(--gye-txt2);
    cursor: default;
    -webkit-user-select: none;
    -moz-user-select: none;
    -ms-user-select: none;
    user-select: none;
}
.tsd-info-footer .tsd-count   { font-weight: 800; color: var(--gye-azul2); font-size: 13px; }
.tsd-info-footer .tsd-termino { font-weight: 700; color: var(--gye-txt1); }

/* Responsive: ocultar en pantallas pequeñas */
@media (max-width: 768px) {
    .topbar-search-wrap { display: none; }
}


/* ── TRAMITES RÁPIDOS ── */
.panel { background: var(--gye-blanco); border: 1px solid var(--gye-borde); border-radius: 16px; padding: 20px; }
.panel-head { display: flex; align-items: center; justify-content: space-between; margin-bottom: 16px; }
.panel-titulo { font-size: 15px; font-weight: 700; }
.panel-ver { font-size: 12px; color: var(--gye-azul2); font-weight: 600; text-decoration: none; }
.panel-ver:hover { color: var(--gye-azul); }

/* ── Botón favoritos (estrella) ─────────────────────────────── */
.panel-ver-fav {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 32px;
    height: 32px;
    border-radius: 50%;
    color: var(--gye-navy) !important; /* indigo-600 — neutro */
    background: var(--gye-azul-bg); /* indigo-50 */
    border: 1.5px solid var(--gye-azul-bd);
    outline: none; /* evita el anillo de foco tras el click */
    text-decoration: none !important; /* elimina el subrayado heredado del <a> */
    transition: background .16s, border-color .16s, transform .16s, color .16s;
}
.panel-ver-fav .material-symbols-outlined {
    font-size: 24px;
    font-variation-settings: 'FILL' 1, 'wght' 500, 'GRAD' 0, 'opsz' 20;
    line-height: 1;
}
.panel-ver-fav:hover {
    background: var(--gye-azul-bg2) !important;
    border-color: var(--gye-navy) !important;
    color: var(--gye-navy) !important;
    transform: scale(1.12);
    text-decoration: none !important;
}
/* Al soltar el click vuelve al estado base sin quedarse "presionado" */
.panel-ver-fav:focus,
.panel-ver-fav:active {
    background: var(--gye-azul-bg2) !important;
    border-color: var(--gye-navy) !important;
    color: var(--gye-navy) !important;
    transform: scale(1) !important;
    outline: none;
}
/* Solo mostrar foco visible al navegar con teclado (accesibilidad) */
.panel-ver-fav:focus-visible {
    outline: 2px solid #F43F5E;
    outline-offset: 2px;
}

/* ── Botón "Ver todos" (apps/grid) ─────────────────────────── */
.panel-ver-apps {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 32px; height: 32px;
    border-radius: 10px;                 /* cuadrado redondeado — diferencia visual del corazón circular */
    color: var(--gye-navy) !important;           /* indigo-600 — neutro, no compite con el rose del corazón */
    background: var(--gye-azul-bg);                 /* indigo-50 */
    border: 1.5px solid var(--gye-azul-bd);
    outline: none;
    text-decoration: none !important;
    transition: background .16s, border-color .16s, transform .16s, color .16s;
}
.panel-ver-apps .material-symbols-outlined,
.panel-ver-apps .material-icons {
    font-size: 24px;
    font-variation-settings: 'FILL' 1, 'wght' 400, 'GRAD' 0, 'opsz' 20;
    line-height: 1;
}
.panel-ver-apps:hover {
    background: var(--gye-azul-bg2) !important;
    border-color: var(--gye-navy) !important;
    color: var(--gye-navy) !important;
    transform: scale(1.10);
    text-decoration: none !important;
}
.panel-ver-apps:focus,
.panel-ver-apps:active {
    background: var(--gye-azul-bg2) !important;
    border-color: var(--gye-navy) !important;
    color: var(--gye-navy) !important;
    transform: scale(1) !important;
    outline: none;
}
.panel-ver-apps:focus-visible {
    outline: 2px solid var(--gye-navy);
    outline-offset: 2px;
}

.tramites-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.tramite-tile {
  border: 1.5px solid var(--gye-borde); border-radius: 12px; padding: 14px 16px;
  display: flex; align-items: flex-start; gap: 12px; cursor: pointer;
  text-decoration: none !important; color: var(--gye-txt1); transition: all .17s;
}
    .tramite-tile:hover { border-color: var(--gye-azul2); background: var(--gye-azul-bg); }
.t-ico {
  width: 38px; height: 38px; border-radius: 10px; flex-shrink: 0;
  display: flex; align-items: center; justify-content: center; font-size: 18px;
}
.t-ico .material-icons          { font-size: 20px; line-height: 1; }
.t-ico .material-symbols-outlined {
    font-size: 20px; line-height: 1;
    font-variation-settings: 'FILL' 1, 'wght' 400, 'GRAD' 0, 'opsz' 24;
}
.t-nombre { font-size: 13px; font-weight: 700; line-height: 1.3; margin-bottom: 2px; }
.t-cat { font-size: 11px; color: var(--gye-txt2); }

.ti-azul   { background: var(--gye-azul-bg); color: var(--gye-navy); }
.ti-verde  { background: #E6F9F0; color: #0B7A46; }
.ti-amber  { background: #FEF6E4; color: #92400E; }
.ti-oro    { background: #FFFAE6; color: #92400E; }
.ti-teal   { background: #DCF2F9; color: #0A6E86; }
.ti-purple { background: #EFF0FE; color: #5B21B6; }
.ti-rojo   { background: #FEE9E9; color: #B91C1C; }

/* ── SIDEBAR DERECHO ── */
.seg-panel {
    margin-bottom: 14px;
}

.seg-form {
    display: flex;
    flex-direction: column;
    gap: 8px;
    margin-top: 14px;
}

.seg-form .seg-input-f {
    padding: 10px 14px;
    border-radius: 10px;
    border: 1.5px solid var(--gye-borde);
    font-family: var(--gye-font);
    font-size: 13px;
    color: var(--gye-txt1);
    outline: none;
    transition: border-color .16s;
    width: auto;
}

    .seg-input-f:focus {
        border-color: var(--gye-azul2);
    }

    .seg-input-f::placeholder {
        color: var(--gye-txt3);
    }

.btn-consultar {
    padding: 10px;
    background: var(--gye-azul2);
    border: none;
    border-radius: 10px;
    color: var(--gye-blanco);
    font-weight: 700;
    font-size: 13px;
    font-family: var(--gye-font);
    cursor: pointer;
    transition: background .16s;
}
    .btn-consultar:hover { background: var(--gye-azul); }

/* ── LISTA CATEGORÍAS ── */
.cat-list { display: flex; flex-direction: column; gap: 6px; margin-top: 14px; }
.cat-row {
  display: flex; align-items: center; gap: 10px; padding: 10px 12px;
  border-radius: 10px; border: 1.5px solid var(--gye-borde);
  text-decoration: none !important; color: var(--gye-txt1); transition: all .16s; cursor: pointer;
}
    .cat-row:hover { background: var(--gye-azul-bg); border-color: var(--gye-azul2); }
.cat-row-ico { width: 32px; height: 32px; border-radius: 8px; display: flex; align-items: center; justify-content: center; font-size: 16px; flex-shrink: 0; }
.cat-row-ico .material-symbols-outlined {
    font-size: 18px; line-height: 1;
    font-variation-settings: 'FILL' 1, 'wght' 400, 'GRAD' 0, 'opsz' 24; /* relleno, igual que los tiles */
}
.cat-row-txt { flex: 1; }
.cat-row-nombre { font-size: 13.5px; font-weight: 700; }
.cat-row-n { font-size: 11px; color: var(--gye-txt2); }
.cat-row-arr { font-size: 13px; color: var(--gye-txt3); }

/* Categoría activa — acento sutil: fondo tenue + borde izquierdo */
.cat-activa {
    background: var(--gye-azul-bg) !important;
    border-color: var(--gye-azul2) !important;
    border-left-width: 3px !important;
}
.cat-activa .cat-row-nombre    { color: var(--gye-azul) !important; }
.cat-activa .cat-row-n         { color: var(--gye-txt2) !important; }
.cat-activa .cat-row-arr       { color: var(--gye-azul2) !important; }

/* Estado de carga del grid de trámites */
.tg-loading { grid-column: 1 / -1; display: flex; align-items: center; gap: 10px; padding: 28px 0; color: var(--gye-txt3); font-size: 13px; }
.tg-spinner { width: 20px; height: 20px; border-radius: 50%; border: 2px solid var(--gye-borde); border-top-color: var(--gye-azul2); animation: tg-spin .7s linear infinite; flex-shrink: 0; }
@keyframes tg-spin { to { transform: rotate(360deg); } }
.tg-vacio   { grid-column: 1 / -1; color: var(--gye-txt3); font-size: 13px; padding: 12px 0; }

/* ── ACTIVIDAD RECIENTE ── */
.actividad {
    margin-bottom: 22px;
}

.act-lista {
    display: flex;
    flex-direction: column;
}

.act-item {
    display: flex;
    align-items: center;
    gap: 14px;
    padding: 13px 18px;
    border-bottom: 1px solid var(--gye-borde);
    transition: background .14s;
}

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

    .act-item:hover {
        background: var(--gye-fondo);
    }

.act-ico {
    width: 36px;
    height: 36px;
    border-radius: 10px;
    flex-shrink: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 16px;
}

.act-info {
    flex: 1;
}

.act-nombre {
    font-size: 13px;
    font-weight: 600;
}

.act-fecha {
    font-size: 11px;
    color: var(--gye-txt2);
    margin-top: 1px;
}

.act-estado {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    font-size: 11px;
    font-weight: 700;
    padding: 4px 10px 4px 8px;
    border-radius: 20px;
    white-space: nowrap;
    flex-shrink: 0;
}

.act-estado::before {
    content: '';
    display: inline-block;
    width: 6px;
    height: 6px;
    border-radius: 50%;
    flex-shrink: 0;
}

/* ── Completado / Finalizado / Resuelto ── verde */
.est-ok {
    background: #E6F9F0;
    color: #0B7A46;
    border: 1px solid #A7E9C8;
}
.est-ok::before       { background: #0B7A46; }

/* ── En proceso / En trámite ── azul */
.est-prog {
    background: var(--gye-azul-bg);
    color: var(--gye-navy);
    border: 1px solid var(--gye-azul-bd);
}
.est-prog::before     { background: var(--gye-navy); }

/* ── Pendiente / En espera ── ámbar */
.est-pend {
    background: #FEF6E4;
    color: #8A5000;
    border: 1px solid #F5D88A;
}
.est-pend::before     { background: #D97706; }

/* ── Anulado / Cancelado / Rechazado ── rojo */
.est-anulado {
    background: #FEE9E9;
    color: #B91C1C;
    border: 1px solid #FCBCBC;
}
.est-anulado::before  { background: #B91C1C; }

/* ── En revisión / Observado ── violeta */
.est-revision {
    background: #F0EEFF;
    color: #5B21B6;
    border: 1px solid #C9BCF5;
}
.est-revision::before { background: #5B21B6; }

/* ── Modal Aviso Actualizar Datos (eMASMenu.Master — corre en toda página) ── */
.actd-overlay {
    display: none; position: fixed; inset: 0;
    background: rgba(13,21,41,.55); z-index: 2100;
    align-items: center; justify-content: center; padding: 20px;
}
.actd-overlay.visible { display: flex; }
.actd-modal {
    background: var(--gye-blanco); border-radius: 18px;
    width: 100%; max-width: 460px;
    box-shadow: 0 20px 60px rgba(0,0,0,.25); overflow: hidden;
    text-align: center;
}
.actd-modal-ico {
    width: 56px; height: 56px; border-radius: 50%;
    background: #FEF3E2; color: #F79009;
    display: flex; align-items: center; justify-content: center;
    margin: 28px auto 4px;
}
.actd-modal-ico .material-icons { font-size: 30px; }
.actd-modal-titulo { font-size: 16px; font-weight: 800; color: var(--gye-txt1); padding: 12px 24px 0; }
.actd-modal-texto { font-size: 13px; color: var(--gye-txt2); padding: 8px 28px 4px; line-height: 1.5; }
.actd-modal-acciones {
    display: flex; flex-direction: column; gap: 10px;
    padding: 20px 28px 28px;
}
.actd-btn-primario {
    background: var(--gye-azul2); color: #fff; border: none;
    border-radius: 10px; padding: 11px; font-size: 13px; font-weight: 700;
    cursor: pointer; transition: background .15s;
}
.actd-btn-primario:hover { background: var(--gye-azul); }
.actd-btn-secundario {
    background: transparent; color: var(--gye-txt2); border: none;
    font-size: 12.5px; font-weight: 600; cursor: pointer;
}
.actd-btn-secundario:hover { color: var(--gye-txt1); text-decoration: underline; }