/*
 * @intranet-file styles/css/style.css
 * @intranet-file-version 2026.05.05.1
 * @intranet-file-date 2026-05-05
 * @intranet-file-owner CSIF Intranet
 */
:root {
    /* --- PALETA CORPORATIVA (Basada en #067b3b) --- */
    --primary: #067b3b;          /* Verde Institucional */
    --primary-dark: #045227;     /* Verde oscuro (hover y textos fuertes) */
    --primary-light: #eefbf3;    /* Verde menta muy claro (fondos suaves) */
    --accent: #0aa451;           /* Verde vibrante (para degradados y detalles) */
    
    /* --- NEUTROS Y FONDOS --- */
    --bg-body: #f1f5f9;          /* Gris neutro (fondo general) */
    --bg-card: #ffffff;          /* Blanco (tarjetas) */
    --bg-sidebar: #043b1d;       /* Verde muy oscuro/negro (barra lateral) */
    --bg-sidebar-header: rgba(0, 0, 0, 0.3);
    --bg-input: #f8fafc;         /* Gris casi blanco (inputs) */
    --bg-hover: rgba(255, 255, 255, 0.1); /* Hover en sidebar */
    
    /* --- BORDES --- */
    --border-light: #e2e8f0;     /* Bordes sutiles */
    --border-dark: #0a5a2c;      /* Bordes oscuros sutiles para el sidebar */
    --border-focus: rgba(6, 123, 59, 0.3); /* Anillo de foco (verde transparente) */

    /* --- TEXTOS --- */
    --text-main: #334155;        /* Texto principal (gris plomo) */
    --text-muted: #64748b;       /* Texto secundario */
    --text-sidebar: #ecfdf5;     /* Texto en sidebar (blanco menta) */
    --text-sidebar-hover: #ffffff;
    --text-inverse: #ffffff;

    /* --- ESTADOS (ALERTAS / ROLES) --- */
    --error-bg: #fee2e2;
    --error-text: #991b1b;
    --error-border: #fecaca;
    
    --success-bg: #dcfce7;
    --success-text: #045227;
    --success-border: #86efac;

    --danger-btn: #dc2626;       /* Botón logout (rojo) */
    --danger-btn-hover: #b91c1c;
}

/* =========================================================
   Tablas ordenables (estilo unificado)
   Uso: <table class="table-sortable"> ... <th data-sort-type="text|num|date"> ...
   ========================================================= */

table.table-sortable thead th.th-sortable{
    cursor: pointer;
    user-select: none;
    white-space: nowrap;
    position: relative;
    padding-right: 26px; /* espacio para indicador */
}

table.table-sortable thead th.th-sortable::after{
    content: "⇅";
    position: absolute;
    right: 10px;
    top: 50%;
    transform: translateY(-50%);
    font-size: .85em;
    opacity: .35;
}

table.table-sortable thead th.th-sortable[data-sort-dir="asc"]::after{
    content: "▲";
    opacity: .75;
}

table.table-sortable thead th.th-sortable[data-sort-dir="desc"]::after{
    content: "▼";
    opacity: .75;
}

table.table-sortable thead th.th-sortable:focus{
    outline: 2px solid rgba(6,123,59,.35);
    outline-offset: 2px;
    border-radius: 6px;
}

/* --- RESET Y BASE --- */
* {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
    font-family: 'Segoe UI', system-ui, sans-serif;
}

body {
    background: var(--bg-body);
    color: var(--text-main);
    overflow: hidden; /* El scroll lo manejan los contenedores internos */
}

/* --- LAYOUT LOGIN --- */
.login-body {
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 20px;
    background: linear-gradient(135deg, var(--bg-sidebar), var(--primary-dark));
}

.login-container {
    background: var(--bg-card);
    width: 100%;
    max-width: 420px;
    padding: 2.5rem;
    border-radius: 16px;
    box-shadow: 0 20px 25px -5px rgba(0, 0, 0, 0.3);
    animation: fadeIn 0.6s ease-out;
}

.login-header {
    text-align: center;
    margin-bottom: 2rem;
}

.login-header h2 {
    color: var(--primary);
    font-size: 1.8rem;
    font-weight: 700;
}

.login-header p {
    color: var(--text-muted);
}

.login-logo-img {
    max-height: 70px;
    width: auto;
    margin-bottom: 1rem;
    display: block;
    margin-left: auto;
    margin-right: auto;
}

/* --- FORMULARIOS --- */
.form-group {
    margin-bottom: 1.25rem;
}

.form-group label {
    display: block;
    margin-bottom: 0.5rem;
    color: var(--text-main);
    font-weight: 500;
}

.form-control {
    width: 100%;
    padding: 0.75rem 1rem;
    border: 2px solid var(--border-light);
    border-radius: 8px;
    font-size: 1rem;
    background: var(--bg-input);
    color: var(--text-main);
    transition: all 0.3s ease;
}

.form-control:focus {
    border-color: var(--primary);
    outline: none;
    box-shadow: 0 0 0 3px var(--border-focus);
    background: var(--bg-card);
}

/* --- BOTONES --- */
.btn-primary {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    padding: 0.85rem;
    background: linear-gradient(to right, var(--primary), var(--accent));
    color: var(--text-inverse);
    border: none;
    border-radius: 8px;
    font-size: 1rem;
    font-weight: 600;
    cursor: pointer;
    transition: transform 0.2s, box-shadow 0.2s;
}

.btn-primary:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 12px var(--border-focus);
}


/* --- LOGIN: BOTÓN A ANCHO COMPLETO --- */
.login-container .btn-primary {
    width: 100%;
}
/* --- CAPTCHA --- */
.captcha-container {
    display: flex;
    flex-direction: column;
    gap: 10px;
    margin-bottom: 1.5rem;
    background: var(--bg-input);
    padding: 10px;
    border-radius: 8px;
    align-items: center;
}

.captcha-img {
    border-radius: 6px;
    border: 1px solid var(--border-light);
}

/* --- ALERTS --- */
.alert {
    padding: 0.75rem;
    border-radius: 8px;
    margin-bottom: 1.5rem;
    font-size: 0.9rem;
    text-align: center;
    border: 1px solid transparent;
}

.alert-error {
    background-color: var(--error-bg);
    color: var(--error-text);
    border-color: var(--error-border);
}

/* --- PORTAL / DASHBOARD LAYOUT --- */
.portal-container {
    display: flex;
    height: 100vh;
    width: 100vw;
}

/* --- SIDEBAR BASE --- */
.sidebar {
    width: 260px;
    background: var(--bg-sidebar);
    color: var(--text-inverse);
    display: flex;
    flex-direction: column;
    border-right: 1px solid var(--border-dark);
    flex-shrink: 0;
    /* Nuevas propiedades para la animación */
    transition: all 0.3s ease-in-out;
    white-space: nowrap; /* Evita que el texto se rompa al cerrar */
    overflow: hidden;    /* Oculta lo que no cabe */
    position: relative;
    z-index: 50;
}

/* --- SIDEBAR COLAPSADO (CLASE ACTIVA CON JS) --- */
.sidebar.collapsed {
    width: 0;
    padding: 0;
    border-right: none;
    opacity: 0; /* Ayuda a la transición visual */
}

.sidebar-logo {
    display: flex;
    justify-content: center;
    align-items: center;
    flex-direction: column;
    gap: 0.35rem;
    padding: 1.5rem 1rem 1rem;
    border-bottom: 1px solid rgba(255, 255, 255, 0.05);
    margin-bottom: 1rem;
}

.sidebar-version {
    font-size: 0.72rem;
    letter-spacing: 0.02em;
    color: rgba(255, 255, 255, 0.70);
    padding: 0.15rem 0.55rem;
    border: 1px solid rgba(255, 255, 255, 0.10);
    border-radius: 999px;
    background: rgba(0, 0, 0, 0.15);
    line-height: 1.1;
}

.sidebar-logo img {
    max-width: 100%;
    height: auto;
    max-height: 60px;
    object-fit: contain;
}

.sidebar-header {
    padding: 1.5rem;
    border-bottom: 1px solid rgba(255,255,255,0.1);
    background: var(--bg-sidebar-header);
}

.user-info-mini {
    display: flex;
    align-items: center;
    gap: 10px;
}

.avatar-mini {
    width: 40px;
    height: 40px;
    background: var(--primary);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: bold;
    color: white;
    flex-shrink: 0; /* Evita que el avatar se aplaste */
}

.user-details h3 {
    font-size: 0.95rem;
    color: var(--text-inverse);
    margin: 0;
}

.user-details span {
    font-size: 0.75rem;
    color: #a7f3d0;
    text-transform: uppercase;
}

.nav-menu {
    flex: 1;
    overflow-y: auto;
    padding: 1rem 0;
}

.nav-group-title {
    padding: 1rem 1.5rem 0.5rem;
    font-size: 0.75rem;
    text-transform: uppercase;
    color: #6ee7b7;
    letter-spacing: 0.05em;
    font-weight: 700;
}



/* --- SIDEBAR: GRUPOS COLAPSABLES --- */
.nav-group {
    margin-top: 6px;
}

.nav-group-title-toggle {
    width: 100%;
    border: none;
    background: transparent;
    color: #6ee7b7;
    padding: 1rem 1.5rem 0.5rem;
    font-size: 0.75rem;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    font-weight: 900;
    display: flex;
    align-items: center;
    justify-content: space-between;
    cursor: pointer;
}

.nav-group-title-toggle:hover {
    background: rgba(255, 255, 255, 0.06);
}

.nav-group-title-main {
    min-width: 0;
    display: inline-flex;
    align-items: center;
    gap: 10px;
}

.nav-group-title-icon {
    width: 20px;
    height: 20px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    flex: 0 0 20px;
    color: inherit;
}

.nav-group-title-icon svg {
    width: 18px;
    height: 18px;
    display: block;
}

.nav-group-title-text {
    min-width: 0;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.nav-group-title-toggle .caret {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 22px;
    height: 22px;
    border-radius: 8px;
    background: rgba(255, 255, 255, 0.08);
    color: #ecfdf5;
    transition: transform 0.15s ease;
}

.nav-group.is-collapsed .nav-group-title-toggle .caret {
    transform: rotate(-90deg);
}

.nav-group-items {
    padding-bottom: 6px;
}

.nav-group.is-collapsed .nav-group-items {
    display: none;
}
.nav-item {
    display: flex;
    align-items: center;
    padding: 0.75rem 1.5rem;
    color: var(--text-sidebar);
    text-decoration: none;
    transition: all 0.2s;
    border-left: 3px solid transparent;
    cursor: pointer;
}

.nav-item:hover {
    background: var(--bg-hover);
    color: var(--text-sidebar-hover);
}

.nav-item.active {
    background: rgba(6, 123, 59, 0.25);
    border-left-color: var(--accent);
    color: #ffffff;
}

.nav-icon {
    margin-right: 12px;
    display: flex;
    align-items: center;
    flex-shrink: 0; /* El icono no debe encogerse */
}

.sidebar-footer {
    padding: 1rem;
    border-top: 1px solid rgba(255,255,255,0.1);
}

.btn-logout-mini {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    width: 100%;
    padding: 0.6rem;
    background: var(--danger-btn);
    color: var(--text-inverse);
    text-decoration: none;
    border-radius: 6px;
    font-size: 0.9rem;
    transition: background 0.2s;
    white-space: nowrap;
}

.btn-logout-mini:hover {
    background: var(--danger-btn-hover);
}

/* --- ÁREA PRINCIPAL --- */
.main-content {
    flex: 1;
    display: flex;
    flex-direction: column;
    background: var(--bg-card);
    position: relative; /* Necesario para el botón flotante */
    transition: margin-left 0.3s ease-in-out;
}

#app-frame {
    width: 100%;
    height: 100%;
    border: none;
    display: block;
}

/* --- DASHBOARD: MENU SUPERIOR / DOCK INFERIOR --- */
.menu-layout-top,
.menu-layout-dock {
    display: block;
    background: var(--bg-card);
}

.menu-layout-top .main-content,
.menu-layout-dock .main-content {
    width: 100vw;
    height: 100vh;
    overflow: hidden;
}

.menu-layout-top #app-frame,
.menu-layout-dock #app-frame {
    flex: 1 1 auto;
    min-height: 0;
}

.dashboard-launcher {
    flex: 0 0 auto;
    display: grid;
    grid-template-columns: minmax(130px, 1fr) auto minmax(130px, 1fr);
    align-items: center;
    gap: 16px;
    padding: 10px 18px;
    background: linear-gradient(135deg, var(--bg-sidebar), var(--primary));
    color: #fff;
    border-bottom: 1px solid rgba(255, 255, 255, 0.14);
    box-shadow: 0 8px 24px rgba(15, 23, 42, 0.18);
    z-index: 1100;
}

.dashboard-launcher-brand,
.dashboard-launcher-user,
.dashboard-launcher-actions {
    display: flex;
    align-items: center;
}

.dashboard-launcher-brand {
    min-width: 0;
    gap: 10px;
}

.dashboard-launcher-brand img {
    max-height: 34px;
    width: auto;
    object-fit: contain;
}

.dashboard-launcher-brand span {
    color: rgba(255, 255, 255, 0.76);
    font-weight: 800;
    font-size: 0.76rem;
    white-space: nowrap;
}

.dashboard-launcher-actions {
    justify-content: center;
    gap: 8px;
}

.launcher-button {
    appearance: none;
    border: 1px solid rgba(255, 255, 255, 0.16);
    background: rgba(255, 255, 255, 0.10);
    color: #fff;
    min-width: 78px;
    height: 54px;
    padding: 6px 10px;
    border-radius: 8px;
    display: inline-flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 4px;
    text-decoration: none;
    cursor: pointer;
    transition: background .18s ease, transform .18s ease, border-color .18s ease;
}

.launcher-button:hover,
.launcher-button:focus-visible,
.launcher-button.is-open,
.launcher-button.active {
    background: rgba(255, 255, 255, 0.94);
    border-color: rgba(255, 255, 255, 0.96);
    color: var(--primary-dark);
    transform: translateY(-1px);
    outline: none;
}

.launcher-button.active {
    border-left-color: rgba(255, 255, 255, 0.96);
}

.launcher-icon,
.launcher-icon svg {
    width: 22px;
    height: 22px;
}

.launcher-label {
    font-weight: 800;
    font-size: 0.76rem;
    line-height: 1;
    white-space: nowrap;
}

.dashboard-launcher-user {
    justify-content: flex-end;
    gap: 9px;
    min-width: 0;
}

.launcher-user-name {
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    font-weight: 800;
    color: rgba(255, 255, 255, 0.92);
}

.launcher-logout {
    width: 36px;
    height: 36px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border-radius: 8px;
    color: #fff;
    background: rgba(255, 255, 255, 0.10);
    border: 1px solid rgba(255, 255, 255, 0.16);
}

.launcher-logout:hover {
    background: var(--danger-btn);
}

.launcher-panels {
    position: absolute;
    left: 0;
    right: 0;
    top: 75px;
    z-index: 1200;
    pointer-events: none;
    display: flex;
    justify-content: center;
    padding: 0 18px;
}

.launcher-panel {
    display: none;
    pointer-events: auto;
    width: min(920px, calc(100vw - 36px));
    max-height: min(70vh, 620px);
    overflow: hidden;
    background: var(--bg-card);
    color: var(--text-main);
    border: 1px solid var(--border-light);
    border-radius: 8px;
    box-shadow: 0 24px 60px rgba(15, 23, 42, 0.28);
}

.launcher-panel.is-open {
    display: block;
}

.launcher-panel-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    padding: 14px 16px;
    border-bottom: 1px solid var(--border-light);
    background: var(--bg-body);
}

.launcher-panel-head strong,
.launcher-panel-head span {
    display: block;
}

.launcher-panel-head span {
    color: var(--text-muted);
    font-size: 0.86rem;
    margin-top: 2px;
}

.launcher-panel-close {
    width: 34px;
    height: 34px;
    border: 1px solid var(--border-light);
    border-radius: 8px;
    background: var(--bg-card);
    color: var(--text-main);
    cursor: pointer;
    font-weight: 900;
}

.launcher-panel-grid {
    padding: 14px;
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(230px, 1fr));
    gap: 10px;
    overflow-y: auto;
    max-height: calc(min(70vh, 620px) - 64px);
}

.launcher-option {
    min-height: 76px;
    display: flex;
    gap: 12px;
    align-items: center;
    padding: 12px;
    border: 1px solid var(--border-light);
    border-radius: 8px;
    color: var(--text-main);
    background: var(--bg-card);
    text-decoration: none;
    transition: background .18s ease, border-color .18s ease, transform .18s ease;
}

.launcher-option:hover,
.launcher-option.active {
    background: var(--bg-body);
    border-color: var(--primary);
    color: var(--primary-dark);
    transform: translateY(-1px);
}

.launcher-option-icon {
    width: 42px;
    height: 42px;
    margin: 0;
    flex: 0 0 42px;
    justify-content: center;
    border-radius: 8px;
    background: color-mix(in srgb, var(--primary) 9%, var(--bg-card));
    color: var(--primary);
}

.launcher-option-icon svg {
    width: 22px;
    height: 22px;
}

.launcher-option-copy {
    min-width: 0;
    display: grid;
    gap: 3px;
}

.launcher-option-copy strong,
.launcher-option-copy small {
    overflow: hidden;
    text-overflow: ellipsis;
}

.launcher-option-copy strong {
    white-space: nowrap;
}

.launcher-option-copy small {
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    color: var(--text-muted);
    line-height: 1.35;
}

.launcher-empty {
    grid-column: 1 / -1;
    padding: 22px;
    border: 1px dashed var(--border-light);
    border-radius: 8px;
    color: var(--text-muted);
    text-align: center;
    background: var(--bg-body);
}

.menu-layout-dock .main-content {
    padding-bottom: 82px;
}

.menu-layout-dock .dashboard-launcher {
    position: fixed;
    left: 50%;
    right: auto;
    bottom: 12px;
    top: auto;
    width: min(720px, calc(100vw - 24px));
    transform: translateX(-50%);
    grid-template-columns: auto 1fr auto;
    border: 1px solid rgba(255, 255, 255, 0.16);
    border-radius: 8px;
    padding: 8px 12px;
}

.menu-layout-dock .dashboard-launcher-brand span,
.menu-layout-dock .launcher-user-name {
    display: none;
}

.menu-layout-dock .launcher-panels {
    top: auto;
    bottom: 88px;
}

/* --- BOTÓN DE MENÚ (TOGGLE) --- */
.menu-toggle-btn {
    position: absolute;
    top: 6px;
    left: 6px;
    z-index: 1000; /* Siempre visible por encima del iframe */
    background: rgba(255, 255, 255, 0.9);
    color: var(--primary);
    border: 1px solid var(--border-light);
    border-radius: 999px;
    width: 32px;
    height: 32px;
    padding: 0;
    cursor: pointer;
    box-shadow: 0 4px 10px rgba(15, 23, 42, 0.12);
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s;
}

.menu-toggle-btn svg {
    width: 16px;
    height: 16px;
}

.menu-toggle-btn:hover {
    background: var(--primary);
    color: var(--text-inverse);
    transform: translateY(-1px);
}

/* --- ESTILOS IFRAME CONTENIDO --- */
.welcome-body {
    background: var(--bg-card);
    padding: 40px;
    overflow-y: auto;
}

.welcome-card {
    max-width: 1120px;
    margin: 0 auto;
}

.welcome-title {
    color: var(--text-main);
    font-size: 2.5rem;
    margin-bottom: 10px;
}

.welcome-subtitle {
    color: var(--text-muted);
    font-size: 1.1rem;
    margin-bottom: 40px;
}

.stats-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 20px;
    margin-bottom: 40px;
}

.stat-box {
    padding: 20px;
    border-radius: 12px;
    background: var(--bg-input);
    border: 1px solid var(--border-light);
}

.stat-label {
    font-size: 0.8rem;
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: 0.05em;
    display: block;
    margin-bottom: 5px;
}

.stat-value {
    font-size: 1.2rem;
    color: var(--text-main);
    font-weight: 600;
}

.stat-value.highlight {
    color: var(--primary);
}

.admin-notice {
    background: color-mix(in srgb, var(--bg-card) 82%, var(--primary) 18%);
    border-left: 4px solid var(--primary);
    border-top: 1px solid color-mix(in srgb, var(--primary) 18%, var(--border-light) 82%);
    border-right: 1px solid color-mix(in srgb, var(--primary) 18%, var(--border-light) 82%);
    border-bottom: 1px solid color-mix(in srgb, var(--primary) 18%, var(--border-light) 82%);
    padding: 15px;
    border-radius: 0 12px 12px 0;
    box-shadow: 0 8px 18px rgba(15, 23, 42, 0.06);
}

.admin-notice h4 {
    margin: 0 0 5px 0;
    color: var(--text-main);
}

.admin-notice p {
    margin: 0;
    color: var(--text-muted);
    font-size: 0.9rem;
}

.welcome-update-alert {
    margin-top: 18px;
    padding: 18px;
    border-radius: 12px;
    border: 1px solid color-mix(in srgb, var(--primary) 18%, var(--border-light) 82%);
    background: color-mix(in srgb, var(--bg-card) 86%, var(--primary-light) 14%);
    box-shadow: 0 10px 24px rgba(15, 23, 42, 0.07);
    display: grid;
    gap: 14px;
}

.welcome-update-alert--admin {
    border-left: 4px solid #d97706;
}

.welcome-update-alert--user {
    border-left: 4px solid var(--primary);
}

.welcome-update-alert-head {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 16px;
}

.welcome-update-alert h2 {
    margin: 0 0 4px;
    color: var(--text-main);
    font-size: 1.05rem;
}

.welcome-update-alert p {
    margin: 0;
    color: var(--text-muted);
    font-size: 0.93rem;
}

.welcome-update-actions {
    display: flex;
    align-items: center;
    gap: 8px;
    flex-wrap: wrap;
    justify-content: flex-end;
}

.welcome-update-actions a {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-height: 34px;
    padding: 7px 12px;
    border-radius: 8px;
    border: 1px solid color-mix(in srgb, var(--primary) 28%, var(--border-light) 72%);
    background: var(--bg-card);
    color: var(--primary-dark);
    text-decoration: none;
    font-size: 0.86rem;
    font-weight: 800;
}

.welcome-update-actions a:hover {
    background: var(--primary-light);
}

.welcome-update-summary {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
}

.welcome-update-summary span {
    display: inline-flex;
    align-items: center;
    min-height: 28px;
    padding: 5px 10px;
    border-radius: 999px;
    background: var(--bg-input);
    border: 1px solid var(--border-light);
    color: var(--text-main);
    font-size: 0.82rem;
    font-weight: 800;
}

.welcome-update-list {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
    gap: 10px;
}

.welcome-update-list article {
    display: grid;
    gap: 4px;
    min-width: 0;
    padding: 12px;
    border-radius: 8px;
    border: 1px solid var(--border-light);
    background: var(--bg-input);
}

.welcome-update-list strong {
    color: var(--text-main);
    font-size: 0.94rem;
}

.welcome-update-list span {
    color: var(--text-muted);
    font-size: 0.84rem;
    line-height: 1.35;
}

.welcome-frequent-section {
    margin-top: 34px;
    padding-top: 28px;
    border-top: 1px solid var(--border-light);
}

.welcome-section-heading {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 16px;
    margin-bottom: 16px;
}

.welcome-section-heading h2 {
    margin: 0;
    color: var(--text-main);
    font-size: 1.35rem;
}

.welcome-section-heading p {
    margin: 4px 0 0 0;
    color: var(--text-muted);
    line-height: 1.5;
}

.welcome-section-link {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-height: 38px;
    padding: 8px 13px;
    border-radius: 999px;
    border: 1px solid var(--border-light);
    background: var(--bg-card);
    color: var(--primary-dark);
    text-decoration: none;
    font-weight: 700;
    white-space: nowrap;
    transition: border-color .15s ease, box-shadow .15s ease, transform .15s ease;
}

.welcome-section-link:hover {
    border-color: var(--primary);
    box-shadow: 0 8px 18px rgba(15, 23, 42, 0.08);
    transform: translateY(-1px);
}

.welcome-frequent-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(190px, 1fr));
    gap: 14px;
}

.welcome-frequent-card {
    display: grid;
    grid-template-columns: 52px minmax(0, 1fr);
    gap: 12px;
    align-items: center;
    min-height: 82px;
    padding: 13px 14px;
    border: 1px solid var(--border-light);
    border-radius: 14px;
    color: var(--text-main);
    text-decoration: none;
    background: color-mix(in srgb, var(--bg-card) 92%, var(--bg-input) 8%);
    box-shadow: 0 12px 26px rgba(15, 23, 42, 0.08);
    transition: transform .15s ease, box-shadow .15s ease, border-color .15s ease, background .15s ease;
}

.welcome-frequent-card.is-app {
    background: color-mix(in srgb, var(--home-frequent-app-bg, #eaf8f0) 34%, var(--bg-card) 66%);
    border-color: color-mix(in srgb, var(--home-frequent-app-bg, #eaf8f0) 68%, var(--border-light) 32%);
    box-shadow: inset 4px 0 0 color-mix(in srgb, var(--home-frequent-app-bg, #eaf8f0) 86%, var(--primary) 14%), 0 12px 26px rgba(15, 23, 42, 0.08);
}

.welcome-frequent-card.is-link {
    background: color-mix(in srgb, var(--home-frequent-link-bg, #eef5ff) 34%, var(--bg-card) 66%);
    border-color: color-mix(in srgb, var(--home-frequent-link-bg, #eef5ff) 68%, var(--border-light) 32%);
    box-shadow: inset 4px 0 0 color-mix(in srgb, var(--home-frequent-link-bg, #eef5ff) 86%, var(--primary) 14%), 0 12px 26px rgba(15, 23, 42, 0.08);
}

.welcome-frequent-card:hover {
    transform: translateY(-2px);
    box-shadow: 0 16px 30px rgba(15, 23, 42, 0.12);
}

.welcome-frequent-card.is-app:hover {
    border-color: color-mix(in srgb, var(--home-frequent-app-bg, #eaf8f0) 52%, var(--primary) 48%);
    box-shadow: inset 4px 0 0 color-mix(in srgb, var(--home-frequent-app-bg, #eaf8f0) 72%, var(--primary) 28%), 0 16px 30px rgba(15, 23, 42, 0.12);
}

.welcome-frequent-card.is-link:hover {
    border-color: color-mix(in srgb, var(--home-frequent-link-bg, #eef5ff) 52%, var(--primary) 48%);
    box-shadow: inset 4px 0 0 color-mix(in srgb, var(--home-frequent-link-bg, #eef5ff) 72%, var(--primary) 28%), 0 16px 30px rgba(15, 23, 42, 0.12);
}

.welcome-frequent-icon {
    width: 52px;
    height: 52px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border-radius: 14px;
    background: color-mix(in srgb, var(--bg-card) 82%, white 18%);
    color: inherit;
    border: 1px solid color-mix(in srgb, var(--border-light) 76%, transparent 24%);
    overflow: hidden;
}

.welcome-frequent-icon img {
    width: 38px;
    height: 38px;
    object-fit: contain;
    display: block;
}

.welcome-frequent-icon-svg,
.welcome-frequent-icon-svg svg {
    width: 30px;
    height: 30px;
    display: inline-flex;
}

.welcome-frequent-letter {
    font-size: 1.1rem;
    font-weight: 900;
}

.welcome-frequent-copy {
    min-width: 0;
    display: grid;
    gap: 0;
}

.welcome-frequent-copy strong {
    overflow-wrap: anywhere;
    color: currentColor;
    font-size: .96rem;
    line-height: 1.2;
}

.welcome-empty-state {
    border: 1px dashed var(--border-light);
    border-radius: 14px;
    background: var(--bg-input);
    color: var(--text-muted);
    padding: 18px;
    line-height: 1.6;
}

html[data-theme-variant="medium"] .welcome-frequent-card,
html[data-theme="dark"] .welcome-frequent-card {
    background: color-mix(in srgb, var(--bg-card) 88%, var(--bg-body) 12%);
    color: var(--text-main);
}

html[data-theme-variant="medium"] .welcome-frequent-card.is-app,
html[data-theme="dark"] .welcome-frequent-card.is-app {
    background: color-mix(in srgb, var(--home-frequent-app-bg, #eaf8f0) 14%, var(--bg-card) 86%);
    border-color: color-mix(in srgb, var(--home-frequent-app-bg, #eaf8f0) 38%, var(--border-light) 62%);
    box-shadow: inset 4px 0 0 color-mix(in srgb, var(--home-frequent-app-bg, #eaf8f0) 62%, var(--primary) 38%), 0 12px 26px rgba(0, 0, 0, 0.18);
}

html[data-theme-variant="medium"] .welcome-frequent-card.is-link,
html[data-theme="dark"] .welcome-frequent-card.is-link {
    background: color-mix(in srgb, var(--home-frequent-link-bg, #eef5ff) 14%, var(--bg-card) 86%);
    border-color: color-mix(in srgb, var(--home-frequent-link-bg, #eef5ff) 38%, var(--border-light) 62%);
    box-shadow: inset 4px 0 0 color-mix(in srgb, var(--home-frequent-link-bg, #eef5ff) 62%, var(--primary) 38%), 0 12px 26px rgba(0, 0, 0, 0.18);
}

html[data-theme-variant="medium"] .welcome-frequent-card.is-app:hover,
html[data-theme="dark"] .welcome-frequent-card.is-app:hover {
    background: color-mix(in srgb, var(--home-frequent-app-bg, #eaf8f0) 19%, var(--bg-card) 81%);
    border-color: color-mix(in srgb, var(--home-frequent-app-bg, #eaf8f0) 56%, var(--primary) 44%);
    box-shadow: inset 4px 0 0 color-mix(in srgb, var(--home-frequent-app-bg, #eaf8f0) 72%, var(--primary) 28%), 0 16px 30px rgba(0, 0, 0, 0.22);
}

html[data-theme-variant="medium"] .welcome-frequent-card.is-link:hover,
html[data-theme="dark"] .welcome-frequent-card.is-link:hover {
    background: color-mix(in srgb, var(--home-frequent-link-bg, #eef5ff) 19%, var(--bg-card) 81%);
    border-color: color-mix(in srgb, var(--home-frequent-link-bg, #eef5ff) 56%, var(--primary) 44%);
    box-shadow: inset 4px 0 0 color-mix(in srgb, var(--home-frequent-link-bg, #eef5ff) 72%, var(--primary) 28%), 0 16px 30px rgba(0, 0, 0, 0.22);
}

html[data-theme-variant="medium"] .welcome-frequent-icon,
html[data-theme="dark"] .welcome-frequent-icon {
    background: color-mix(in srgb, var(--bg-input) 76%, var(--bg-card) 24%);
    border-color: color-mix(in srgb, var(--border-light) 82%, var(--text-main) 18%);
}

html[data-theme-variant="contrast"] .welcome-frequent-card {
    background: color-mix(in srgb, var(--bg-card) 90%, black 10%);
    color: var(--text-main);
}

html[data-theme-variant="contrast"] .welcome-frequent-card.is-app {
    background: color-mix(in srgb, var(--home-frequent-app-bg, #eaf8f0) 10%, var(--bg-card) 90%);
    border-color: color-mix(in srgb, var(--home-frequent-app-bg, #eaf8f0) 48%, var(--border-light) 52%);
    box-shadow: inset 4px 0 0 color-mix(in srgb, var(--home-frequent-app-bg, #eaf8f0) 70%, var(--primary) 30%), 0 12px 26px rgba(0, 0, 0, 0.28);
}

html[data-theme-variant="contrast"] .welcome-frequent-card.is-link {
    background: color-mix(in srgb, var(--home-frequent-link-bg, #eef5ff) 10%, var(--bg-card) 90%);
    border-color: color-mix(in srgb, var(--home-frequent-link-bg, #eef5ff) 48%, var(--border-light) 52%);
    box-shadow: inset 4px 0 0 color-mix(in srgb, var(--home-frequent-link-bg, #eef5ff) 70%, var(--primary) 30%), 0 12px 26px rgba(0, 0, 0, 0.28);
}

@media (max-width: 720px) {
    .welcome-body {
        padding: 24px 16px;
    }

    .welcome-title {
        font-size: 2rem;
    }

    .welcome-section-heading {
        align-items: stretch;
        flex-direction: column;
    }

    .welcome-section-link {
        width: fit-content;
    }

    .welcome-update-alert-head {
        display: grid;
    }

    .welcome-update-actions {
        justify-content: flex-start;
    }
}



/* ========================================================================== */
/* APP PAGES (APLICACIONES EN IFRAME / VISTA COMPLETA)                         */
/* ========================================================================== */

html.app-html {
    overflow-y: auto;
    height: auto;
    min-height: 100vh;
    background: var(--bg-body);
}

body.app-body {
    overflow-y: auto !important;
    overflow-x: hidden;
    height: auto !important;
    min-height: 100vh;
    margin: 0;
    padding: 20px;
    padding-bottom: 100px;
    box-sizing: border-box;
    background: var(--bg-body);
}

.app-container {
    width: 100% !important;
    max-width: 100% !important;
    margin: 0;
}

/* --- CABECERA CORPORATIVA --- */
.header-top,
header.header-intranet-top {
    background: linear-gradient(135deg, var(--bg-sidebar), var(--primary));
    border-radius: 12px;
    padding: 20px 30px;
    margin-bottom: 25px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    color: white;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.2);
    width: 100%;
    box-sizing: border-box;
}

.header-info h2,
.header-titles h2,
header.header-intranet-top .header-left h2 {
    margin: 0;
    font-size: 1.6rem;
    color: white;
}

.header-info p,
.header-titles p,
header.header-intranet-top .header-left p {
    margin: 5px 0 0 0;
    opacity: 0.9;
    font-size: 0.9rem;
}

.app-header-brand {
    display: inline-flex;
    align-items: center;
    gap: 14px;
}

.app-header-icon {
    width: 44px;
    height: 44px;
    border-radius: 14px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    background: rgba(255, 255, 255, 0.14);
    border: 1px solid rgba(255, 255, 255, 0.22);
    color: #fff;
    flex-shrink: 0;
}

.app-header-icon svg {
    width: 22px;
    height: 22px;
}

.app-header-icon img {
    width: 22px !important;
    height: 22px !important;
    max-width: 22px !important;
    max-height: 22px !important;
    object-fit: contain;
    border-radius: 6px;
    display: block;
}

.app-header-copy {
    display: grid;
    gap: 4px;
}

.app-header-copy h2,
.app-header-copy h1,
.app-header-copy h3,
.app-header-copy h4,
.app-header-copy h5,
.app-header-copy p {
    text-align: left;
}

.app-title-row {
    display: inline-flex;
    align-items: center;
    flex-wrap: wrap;
    gap: 10px;
}

.app-version-badge {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-height: 28px;
    padding: 0 10px;
    border-radius: 999px;
    font-size: 0.78rem;
    font-weight: 800;
    letter-spacing: 0.01em;
    color: var(--primary-dark);
    background: color-mix(in srgb, var(--primary-light) 72%, white 28%);
    border: 1px solid color-mix(in srgb, var(--primary) 26%, transparent 74%);
    white-space: nowrap;
}

/* Contenedor para acciones a la derecha de la cabecera (botón volver, navegación, etc.) */
.header-actions {
    display: flex;
    align-items: center;
    justify-content: flex-end;
    gap: 12px;
    flex-wrap: wrap;
}

.btn-back-main,
.btn-back-dashboard {
    background: rgba(255, 255, 255, 0.15);
    color: white;
    padding: 10px 20px;
    border-radius: 8px;
    text-decoration: none;
    font-weight: 600;
    border: 1px solid rgba(255, 255, 255, 0.3);
    transition: 0.3s;
    white-space: nowrap;
    display: inline-flex;
    align-items: center;
    gap: 8px;
}

.btn-back-main:hover,
.btn-back-dashboard:hover {
    background: white;
    color: var(--primary-dark);
}

/* --- NAV CABECERA (ENTREGAS) --- */
.header-nav ul {
    list-style: none;
    margin: 0;
    padding: 0;
    display: flex;
    gap: 10px;
    flex-wrap: wrap;
    justify-content: flex-end;
}

.header-nav a {
    color: white;
    text-decoration: none;
    font-weight: 700;
    padding: 8px 12px;
    border-radius: 10px;
    transition: 0.2s;
    background: rgba(255, 255, 255, 0.12);
    border: 1px solid rgba(255, 255, 255, 0.18);
}

.header-nav a:hover,
.header-nav a.active {
    background: rgba(255, 255, 255, 0.95);
    color: var(--primary-dark);
}

/* --- TARJETAS / SECCIONES --- */
.card {
    background: var(--bg-card);
    border-radius: 12px;
    padding: 25px;
    margin-bottom: 25px;
    border: 1px solid var(--border-light);
    box-shadow: 0 2px 5px rgba(0, 0, 0, 0.05);
    width: 100%;
    box-sizing: border-box;
}

.card-title {
    color: var(--primary);
    margin-bottom: 20px;
    font-size: 1.1rem;
    font-weight: 800;
    border-bottom: 2px solid var(--primary-light);
    padding-bottom: 10px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 10px;
}

/* --- TABLAS (APPS) --- */
.table-wrapper,
.table-responsive {
    width: 100%;
    border-radius: 8px;
    overflow-x: auto;
    border: 1px solid var(--border-light);
}

.app-body table {
    width: 100%;
    border-collapse: collapse;
    background: var(--bg-card);
}

.app-body th {
    background: var(--bg-input);
    color: var(--text-main);
    padding: 15px;
    font-weight: 800;
    text-transform: uppercase;
    font-size: 0.75rem;
    border-bottom: 2px solid var(--border-light);
    text-align: left;
    white-space: nowrap;
}

.app-body td {
    padding: 12px 15px;
    border-bottom: 1px solid var(--border-light);
    font-size: 0.92rem;
}

.app-body tr:hover td {
    background-color: var(--primary-light);
}

/* --- BADGES --- */
.badge {
    padding: 5px 12px;
    border-radius: 20px;
    font-size: 0.75rem;
    font-weight: 800;
    display: inline-block;
}

.badge-Pendiente { background: #fef3c7; color: #92400e; }
.badge-Tramitado { background: #dcfce7; color: #166534; }
.badge-Rechazado { background: #fee2e2; color: #991b1b; }


/* --- UTILIDADES --- */
.opacity-30 { opacity: 0.3; }
.opacity-40 { opacity: 0.4; }
.truncate { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
/* --- BOTONES (APPS) --- */
.btn-primary-intranet {
    background: var(--primary);
    color: white;
    border: none;
    padding: 12px 20px;
    border-radius: 10px;
    font-weight: 800;
    cursor: pointer;
    transition: all 0.2s ease;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
}

.btn-primary-intranet:hover {
    background: var(--primary-dark);
    transform: translateY(-1px);
}

.btn-intranet {
    background: var(--primary);
    color: white;
    border: none;
    padding: 10px 25px;
    border-radius: 8px;
    font-weight: 700;
    cursor: pointer;
    transition: 0.2s;
    display: inline-flex;
    align-items: center;
    gap: 8px;
}

.btn-intranet:hover {
    background: var(--primary-dark);
    transform: translateY(-1px);
}

.btn-secondary {
    background: #64748b;
    color: white;
    border: none;
    padding: 10px 16px;
    border-radius: 8px;
    font-weight: 700;
    cursor: pointer;
    transition: 0.2s;
    display: inline-flex;
    align-items: center;
    justify-content: center;
}

.btn-secondary:hover { filter: brightness(0.95); transform: translateY(-1px); }

.btn-danger {
    background: #dc2626;
    color: white;
    border: none;
    padding: 10px 16px;
    border-radius: 8px;
    font-weight: 700;
    cursor: pointer;
    transition: 0.2s;
}

.btn-danger:hover { filter: brightness(0.95); transform: translateY(-1px); }

.btn-icon {
    padding: 8px;
    border-radius: 10px;
    background: transparent;
    border: 1px solid rgba(15, 23, 42, 0.12);
    cursor: pointer;
}

.btn-icon:hover { background: rgba(15, 23, 42, 0.04); }

/* Botón de gestión (delegados) */
.btn-manage {
    background: var(--primary-light);
    color: var(--primary);
    border: 1px solid var(--primary);
    padding: 8px 15px;
    border-radius: 8px;
    cursor: pointer;
    font-weight: 800;
    transition: 0.2s;
}

.btn-manage:hover {
    background: var(--primary);
    color: white;
}

/* --- INPUT FILE (ENLACES) --- */
.app-body input[type="file"] {
    padding: 10px;
    background: var(--bg-input);
    border: 2px dashed var(--border-light);
    cursor: pointer;
    width: 100%;
    box-sizing: border-box;
}

/* --- MODALES (GENÉRICO) --- */
.overlay,
.modal-overlay {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.5);
    backdrop-filter: blur(4px);
    z-index: 999;
}

.modal {
    display: none;
    position: fixed;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: 95%;
    max-width: 700px;
    background: var(--bg-card);
    border: 1px solid var(--border-light);
    color: var(--text-main);
    border-radius: 16px;
    z-index: 1000;
    box-shadow: 0 20px 40px rgba(0, 0, 0, 0.3);
    overflow: hidden;
}

/* Algunos modales (compras) se renderizan con display:block. */
.modal.is-open { display: block; }

/* Estado abierto: usado por apps/compras (JS añade class="open" al overlay) */
.modal-overlay.open {
    display: flex;
    align-items: center;
    justify-content: center;
}

.modal-overlay.open .modal {
    display: block;
}

.modal-header {
    background: var(--primary);
    color: white;
    padding: 15px 25px;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.modal-body {
    padding: 25px;
    max-height: 75vh;
    overflow-y: auto;
    background: var(--bg-card);
    color: var(--text-main);
}

.modal-footer {
    padding: 15px 25px;
    background: var(--bg-input);
    border-top: 1px solid var(--border-light);
    text-align: right;
    display: flex;
    gap: 10px;
    justify-content: flex-end;
    flex-wrap: wrap;
}

/* --- KPIs / STATS --- */
.kpi-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 20px;
    margin-bottom: 25px;
}

.kpi-card {
    background: var(--bg-card);
    padding: 20px;
    border-radius: 12px;
    border: 1px solid var(--border-light);
    text-align: center;
    border-left: 5px solid var(--primary);
}

.kpi-card .label {
    font-size: 0.75rem;
    font-weight: 900;
    color: var(--text-muted);
    text-transform: uppercase;
}

.kpi-card .value {
    font-size: 1.8rem;
    font-weight: 900;
    color: var(--primary);
    margin-top: 5px;
}

.kpi-card.is-accent {
    border-left-color: var(--accent);
}

.card-filters {
    background: var(--bg-card);
    padding: 20px;
    border-radius: 12px;
    border: 1px solid var(--border-light);
    margin-bottom: 25px;
    box-shadow: 0 2px 5px rgba(0, 0, 0, 0.05);
}

.filter-grid {
    display: flex;
    gap: 20px;
    align-items: flex-end;
    flex-wrap: wrap;
}

.filter-group {
    flex: 1;
    min-width: 200px;
}

.filter-group label {
    display: block;
    font-size: 0.85rem;
    font-weight: 900;
    margin-bottom: 8px;
    color: var(--text-main);
}

.pill {
    background: #e2e8f0;
    padding: 2px 8px;
    border-radius: 10px;
    font-size: 0.75rem;
    font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, "Liberation Mono", "Courier New", monospace;
}

.pill-link {
    text-decoration: none;
    color: inherit;
}

.stats-filter-actions {
    display: inline-flex;
    align-items: stretch;
    gap: 12px;
}

.stats-filter-actions .btn-primary,
.stats-filter-actions .btn-secondary,
.stats-filter-actions .stats-action-link {
    min-height: 45px;
}

.stats-filter-actions .btn-primary,
.stats-filter-actions .stats-action-link {
    padding: 0 18px;
}

.stats-action-link {
    text-decoration: none;
}

.link-detail {
    color: var(--primary);
    font-weight: 900;
    text-decoration: none;
}

.link-detail:hover { text-decoration: underline; }

/* --- UTILIDADES COMUNES DE APPS --- */
.muted-help {
    color: var(--text-muted);
    font-size: 0.92rem;
    line-height: 1.55;
}

.card-table {
    background: var(--bg-card);
    border-radius: 12px;
    padding: 25px;
    margin-bottom: 25px;
    border: 1px solid var(--border-light);
    box-shadow: 0 2px 5px rgba(0, 0, 0, 0.05);
    width: 100%;
    box-sizing: border-box;
}

.app-shell {
    display: grid;
    gap: 14px;
}

.app-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 14px;
}

.app-kpis {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
    gap: 10px;
    margin-bottom: 14px;
}

.app-kpi {
    padding: 10px 12px;
    border: 1px solid var(--border-light);
    border-radius: 10px;
    background: color-mix(in srgb, var(--bg-card) 84%, var(--bg-input) 16%);
}

.app-kpi__n {
    font-size: 1.35rem;
    font-weight: 800;
    color: var(--primary);
}

.app-kpi__l {
    font-size: 0.92rem;
    color: var(--text-muted);
}

.app-flash {
    margin: 0 0 14px 0;
    padding: 10px 12px;
    border-radius: 10px;
    border: 1px solid var(--border-light);
    background: color-mix(in srgb, var(--bg-input) 78%, var(--bg-card) 22%);
}

.app-flash--success {
    background: var(--success-bg);
    border-color: var(--success-border);
    color: var(--success-text);
}

.app-flash--error {
    background: var(--error-bg);
    border-color: var(--error-border);
    color: var(--error-text);
}

.app-muted {
    opacity: 0.82;
    color: var(--text-muted);
}

.app-table {
    width: 100%;
    border-collapse: collapse;
}

.app-table th,
.app-table td {
    padding: 8px 10px;
    vertical-align: top;
    border-bottom: 1px solid var(--border-light);
}

.app-table th {
    text-align: left;
}

.app-input {
    width: 100%;
    box-sizing: border-box;
}

.app-label {
    display: block;
    margin: 10px 0 6px;
}

.ui-input-pad {
    padding: 10px 12px;
}

.content-grid-wide {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(450px, 1fr));
    gap: 25px;
    margin-bottom: 25px;
}

.ui-grid-2,
.ui-grid-3,
.ui-grid-3wide {
    display: grid;
    gap: 12px;
}

.ui-grid-2 {
    grid-template-columns: 1fr 1fr;
}

.ui-grid-3 {
    grid-template-columns: 2fr 1fr 1fr;
}

.ui-grid-3wide {
    grid-template-columns: 1fr 1fr 2fr;
}

.ui-checklist {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 10px 16px;
    margin-top: 14px;
}

.ui-check-card {
    display: flex;
    gap: 10px;
    align-items: flex-start;
    padding: 12px;
    border: 1px solid var(--border-light);
    border-radius: 12px;
    background: color-mix(in srgb, var(--bg-input) 78%, var(--bg-card) 22%);
    color: var(--text-main);
}

.ui-check-card input {
    margin-top: 3px;
}

.ui-actions {
    display: flex;
    gap: 10px;
    flex-wrap: wrap;
    align-items: center;
    margin-top: 16px;
}

.ui-count-badge {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 96px;
    padding: 6px 10px;
    border-radius: 999px;
    border: 1px solid var(--border-light);
    background: var(--bg-card);
    color: var(--text-muted);
    font-weight: 800;
}

.ui-surface-soft {
    border: 1px solid var(--border-light);
    border-radius: 14px;
    background: color-mix(in srgb, var(--bg-input) 82%, var(--bg-card) 18%);
}

.ui-title-stack h2,
.ui-title-stack p {
    margin: 0;
}

.ui-title-stack p + p {
    margin-top: 6px;
}

.chart-canvas-wrap {
    padding: 10px 10px 20px;
}

.inline-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
}

.metric-highlight {
    background: var(--primary-light);
    border: 1px solid color-mix(in srgb, var(--primary) 16%, transparent);
    border-radius: 12px;
    padding: 20px;
    text-align: center;
}

.metric-highlight + .metric-highlight {
    margin-top: 15px;
}

.metric-highlight .label {
    font-weight: 800;
    color: var(--text-muted);
}

.metric-highlight .value {
    font-size: 3rem;
    font-weight: 900;
    color: var(--primary);
}

.stack-20 {
    display: grid;
    gap: 20px;
}

.inc-actions {
    display: flex;
    gap: 10px;
    flex-wrap: wrap;
    align-items: center;
}

.inc-toolbar {
    display: flex;
    justify-content: space-between;
    gap: 12px;
    flex-wrap: wrap;
    align-items: center;
    margin-bottom: 15px;
}

.inc-muted {
    color: var(--text-muted);
    font-size: 0.9rem;
}

.inc-detail-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 16px;
}

.inc-kv {
    display: flex;
    gap: 10px;
    align-items: baseline;
    margin-bottom: 8px;
}

.inc-k {
    min-width: 140px;
    color: var(--text-muted);
    font-weight: 700;
    font-size: 0.85rem;
    text-transform: uppercase;
    letter-spacing: 0.02em;
}

.inc-v {
    color: var(--text-main);
    font-weight: 600;
}

.inc-comment {
    border: 1px solid var(--border-light);
    border-radius: 12px;
    padding: 14px;
    background: var(--bg-card);
    margin-bottom: 10px;
}

.inc-comment-meta {
    display: flex;
    gap: 10px;
    flex-wrap: wrap;
    align-items: center;
    margin-bottom: 8px;
    color: var(--text-muted);
    font-size: 0.85rem;
}

/* --- PATRONES COMPARTIDOS ENTRE APPS --- */
.app-surface-soft,
.app-entregas .ent-card-note,
.app-entregas .ent-summary,
.iban-tip,
.iban-result-card {
    background: var(--bg-input);
    border: 1px solid var(--border-light);
}

.app-inline-note,
.app-entregas .ent-card-note {
    margin-top: 18px;
    padding: 14px 16px;
    display: inline-flex;
    gap: 8px;
    align-items: center;
    flex-wrap: wrap;
    border-radius: 12px;
}

.app-summary-grid,
.app-entregas .ent-summary {
    padding: 16px;
    margin-bottom: 20px;
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 10px 20px;
    border-radius: 12px;
}

.app-surface-panel,
.iban-panel {
    background: var(--bg-card);
    border: 1px solid var(--border-light);
    border-radius: 18px;
    padding: 24px;
}

.app-tip-grid,
.iban-tip-list {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
    gap: 12px;
}

.app-tip-card,
.iban-tip {
    border-radius: 14px;
    padding: 14px 16px;
    color: var(--text-main);
    line-height: 1.55;
}

.app-results-grid,
.iban-results {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
    gap: 14px;
    margin-top: 24px;
}

.app-result-card,
.iban-result-card {
    border-radius: 16px;
    padding: 16px 18px;
}

.app-note-card,
.iban-note {
    background: color-mix(in srgb, var(--bg-input) 82%, var(--bg-card) 18%);
    border: 1px solid var(--border-light);
    border-radius: 16px;
    padding: 16px;
}

.app-note-card strong,
.iban-note strong {
    display: block;
    margin-bottom: 8px;
    color: var(--text-main);
}

.app-note-card p,
.iban-note p {
    margin: 0;
    color: var(--text-muted);
    line-height: 1.65;
}

.app-section-divider,
.app-entregas .ent-section-divider {
    border-top: 2px dashed var(--border-light);
    padding-top: 20px;
}

.app-section-title,
.app-entregas .ent-section-title {
    margin: 0 0 15px 0;
    color: var(--primary);
    font-size: 1.05rem;
}

.app-dialog-backdrop,
.app-entregas .ent-modal-backdrop {
    position: fixed;
    inset: 0;
    background: rgba(15, 23, 42, 0.45);
    display: none;
    z-index: 9998;
}

.app-dialog-window,
.app-entregas .ent-modal {
    position: fixed;
    left: 50%;
    top: 50%;
    transform: translate(-50%, -50%);
    width: min(980px, calc(100vw - 32px));
    max-height: calc(100vh - 48px);
    overflow: auto;
    background: var(--bg-card);
    border: 1px solid var(--border-light);
    border-radius: 18px;
    box-shadow: 0 24px 70px rgba(15, 23, 42, 0.22);
    display: none;
    z-index: 9999;
}

.app-dialog-window--sm,
.app-entregas .ent-modal--sm {
    width: min(440px, calc(100vw - 32px));
}

.app-dialog-head,
.app-entregas .ent-modal-head {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 12px;
    padding: 18px 20px;
    border-bottom: 1px solid var(--border-light);
    background: linear-gradient(135deg, var(--primary-dark), var(--primary));
    color: var(--text-inverse);
}

.app-dialog-head--danger,
.app-entregas .ent-modal-head--danger {
    background: linear-gradient(135deg, var(--error-text), #dc2626);
}

.app-dialog-title,
.app-entregas .ent-modal-title {
    margin: 0;
    font-size: 1.1rem;
    font-weight: 800;
}

.app-dialog-close,
.app-entregas .ent-modal-close {
    appearance: none;
    border: 0;
    background: rgba(255, 255, 255, 0.14);
    color: var(--text-inverse);
    width: 38px;
    height: 38px;
    border-radius: 10px;
    cursor: pointer;
    font-size: 1.25rem;
    line-height: 1;
}

.app-dialog-body,
.app-entregas .ent-modal-body {
    padding: 20px;
}

.app-dialog-body--center,
.app-entregas .ent-modal-body--center {
    text-align: center;
}

.app-control-block label,
.app-entregas .ent-form-group label,
.app-entregas .ent-block-label {
    display: block;
    margin-bottom: 7px;
    font-weight: 700;
    color: var(--text-main);
}

.app-control-field,
.app-entregas .ent-input,
.app-entregas .ent-select,
.app-entregas .ent-textarea {
    width: 100%;
    box-sizing: border-box;
    border: 1px solid var(--border-light);
    border-radius: 12px;
    padding: 11px 13px;
    font: inherit;
    background: var(--bg-input);
    color: var(--text-main);
    transition: border-color 0.18s ease, box-shadow 0.18s ease;
}

.app-control-field:focus,
.app-entregas .ent-input:focus,
.app-entregas .ent-select:focus,
.app-entregas .ent-textarea:focus {
    outline: none;
    border-color: var(--primary);
    box-shadow: 0 0 0 4px var(--border-focus);
}

.app-empty-state,
.app-entregas .ent-empty-state {
    padding: 18px;
    border: 1px dashed var(--border-light);
    border-radius: 12px;
    text-align: center;
    color: var(--text-muted);
    background: var(--bg-input);
}

.app-elevated-card,
.iban-intro-card,
.iban-workspace-card {
    box-shadow: 0 10px 24px rgba(15, 23, 42, 0.06);
}

html[data-theme="dark"] .app-surface-panel,
html[data-theme="dark"] .iban-panel,
html[data-theme="dark"] .app-elevated-card,
html[data-theme="dark"] .iban-intro-card,
html[data-theme="dark"] .iban-workspace-card {
    box-shadow: 0 16px 32px rgba(0, 0, 0, 0.22);
}

html[data-theme="dark"] .app-surface-panel,
html[data-theme="dark"] .iban-panel {
    background: color-mix(in srgb, var(--bg-card) 94%, black 6%);
}

html[data-theme="dark"] .app-tip-card,
html[data-theme="dark"] .iban-tip,
html[data-theme="dark"] .app-result-card,
html[data-theme="dark"] .iban-result-card,
html[data-theme="dark"] .app-note-card,
html[data-theme="dark"] .iban-note {
    background: color-mix(in srgb, var(--bg-input) 88%, var(--bg-card) 12%);
}

@media (max-width: 900px) {
    .app-grid,
    .ui-grid-2,
    .ui-grid-3,
    .ui-grid-3wide,
    .ui-checklist,
    .inc-detail-grid,
    .app-summary-grid,
    .app-entregas .ent-summary {
        grid-template-columns: 1fr;
    }
}

/* --- GRID DE ENLACES (LINKS / NNTT / NOVEDADES) --- */
.enlaces-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
    gap: 20px;
}

/* --- AGRUPACIÓN DESPLEGABLE DE ENLACES --- */
.link-groups {
    display: grid;
    gap: 14px;
}

.link-group {
    background: var(--bg-card);
    border: 1px solid var(--border-light);
    border-radius: 16px;
    box-shadow: 0 4px 10px rgba(0, 0, 0, 0.04);
    overflow: hidden;
}

.link-group summary {
    list-style: none;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    padding: 14px 16px;
    background: linear-gradient(180deg, rgba(6,123,59,0.10), rgba(6,123,59,0.04));
    border-bottom: 1px solid rgba(148,163,184,0.25);
    font-weight: 1000;
    color: var(--text-main);
}

.link-group summary::-webkit-details-marker { display: none; }

.link-group .group-title {
    display: inline-flex;
    align-items: center;
    gap: 10px;
}

.link-group .group-count {
    background: #e2e8f0;
    padding: 2px 10px;
    border-radius: 999px;
    font-size: 0.75rem;
    font-weight: 1000;
    color: #0f172a;
}

.link-group summary::after {
    content: "▾";
    font-size: 1.05rem;
    opacity: 0.8;
    transition: transform 0.15s ease;
}

.link-group[open] summary::after {
    transform: rotate(180deg);
}

.link-group .group-content {
    padding: 16px;
}

/* --- GESTIÓN DE ENLACES (ADMIN) --- */
.admin-toolbar {
    display: flex;
    gap: 10px;
    align-items: center;
    justify-content: space-between;
    flex-wrap: wrap;
    margin: 14px 0 18px;
}

.admin-toolbar .hint {
    color: var(--text-muted);
    font-size: 0.9rem;
}

.admin-table {
    width: 100%;
    border-collapse: collapse;
    background: var(--bg-card);
    border: 1px solid var(--border-light);
    border-radius: 16px;
    overflow: hidden;
    box-shadow: 0 4px 10px rgba(0,0,0,0.04);
}

.admin-table th,
.admin-table td {
    padding: 10px 12px;
    border-bottom: 1px solid rgba(148,163,184,0.18);
    vertical-align: top;
}

.admin-table th {
    text-align: left;
    font-weight: 1000;
    background: var(--bg-input);
}

/*
   Tablas de administración
   Importante: NO aplicar estilos de input "de texto" a checkboxes/radios.
   Si no, se desalinean (por ejemplo, width:100%) y separan el texto del label.
*/
.admin-table td input:not([type="checkbox"]):not([type="radio"]):not([type="hidden"]),
.admin-table td select,
.admin-table td textarea {
    width: 100%;
    padding: 8px 10px;
    border-radius: 10px;
    border: 1px solid var(--border-light);
    background: var(--bg-input);
    color: var(--text-main);
    font-size: 0.95rem;
    line-height: 1.2;
    box-sizing: border-box;
}

.admin-table td textarea {
    resize: vertical;
    min-height: 44px;
}

.admin-table td input[type="checkbox"],
.admin-table td input[type="radio"] {
    width: auto;
    padding: 0;
    border: 0;
    background: transparent;
    box-shadow: none;
    margin: 0;
}

.admin-table td label {
    font-size: 0.92rem;
    line-height: 1.2;
}

/* Acciones (Actualizar/Eliminar) y checkboxes dentro de tablas */
.admin-table .ge-actions,
.admin-table .ga-actions {
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.admin-table .ge-check {
    display: inline-flex;
    align-items: center;
    gap: 10px;
    font-weight: 900;
    white-space: nowrap;
}

.admin-table .ge-check.del {
    color: #b91c1c;
}

/* Asa de arrastre */
.admin-table td.ge-handle,
.admin-table td.ga-handle {
    vertical-align: middle;
    text-align: center;
    font-size: 18px;
    color: var(--text-muted);
    cursor: grab;
    user-select: none;
}

.admin-actions {
    display: flex;
    gap: 8px;
    justify-content: flex-end;
}

.btn-mini {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    padding: 9px 12px;
    border-radius: 12px;
    border: 1px solid var(--border-light);
    background: var(--bg-card);
    color: var(--text-main);
    font-weight: 900;
    cursor: pointer;
    text-decoration: none;
}

.btn-mini.primary {
    background: rgba(6,123,59,0.12);
    border-color: rgba(6,123,59,0.25);
    color: var(--primary);
}

.btn-mini.danger {
    background: rgba(220,38,38,0.10);
    border-color: rgba(220,38,38,0.25);
    color: #dc2626;
}

.enlace-card {
    display: flex;
    flex-direction: column;
    gap: 10px;
    text-decoration: none;
    background: var(--bg-card);
    border: 1px solid var(--border-light);
    border-radius: 14px;
    padding: 18px;
    box-shadow: 0 4px 10px rgba(0, 0, 0, 0.05);
    transition: transform 0.2s, box-shadow 0.2s, border-color 0.2s;
}

.enlace-card:hover {
    transform: translateY(-2px);
    border-color: rgba(16, 185, 129, 0.45);
    box-shadow: 0 10px 20px rgba(0, 0, 0, 0.08);
}

.enlace-card img {
    width: 42px;
    height: 42px;
    border-radius: 10px;
    object-fit: cover;
}

.enlace-card h3 {
    margin: 0;
    color: var(--text-main);
    font-weight: 900;
    font-size: 1.05rem;
}

.enlace-card p {
    margin: 0;
    color: var(--text-muted);
    font-size: 0.9rem;
    line-height: 1.4;

}

.enlace-titulo {
    margin: 0;
    color: var(--text-main);
    font-weight: 900;
    font-size: 1.05rem;
}

.aviso-vpn {
    margin-top: 10px;
    background: #fef3c7;
    color: #92400e;
    padding: 8px 10px;
    border-radius: 12px;
    font-size: 0.85rem;
    font-weight: 800;
    display: flex;
    align-items: center;
    gap: 8px;
}

/* --- LISTÍN (ACORDEONES) --- */
.search-container { position: relative; margin-bottom: 25px; width: 100%; }
.search-container .search-icon { position: absolute; left: 15px; top: 50%; transform: translateY(-50%); color: var(--text-muted); font-size: 1rem; }
.search-container input {
    width: 100%;
    padding: 15px 15px 15px 45px;
    border-radius: 12px;
    border: 1px solid var(--border-light);
    background: var(--bg-card);
    color: var(--text-main);
    font-size: 1.05rem;
    outline: none;
    box-shadow: 0 2px 5px rgba(0, 0, 0, 0.05);
    box-sizing: border-box;
}

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

.sector-wrapper {
    background: var(--bg-card);
    border-radius: 12px;
    margin-bottom: 15px;
    border: 1px solid var(--border-light);
    overflow: hidden;
    width: 100%;
    box-sizing: border-box;
}

.sector-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    cursor: pointer;
    padding: 18px 25px;
    background: var(--primary-light);
    color: var(--primary-dark);
    transition: background 0.2s;
}

.sector-header:hover { background: var(--bg-hover); }

.sector-content { display: none; padding: 25px; border-top: 1px solid var(--border-light); background: var(--bg-card); }
.sector-content.active { display: block !important; }

.contact-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(320px, 1fr));
    gap: 20px;
}

.contact-card {
    background: var(--bg-card);
    border: 1px solid var(--border-light);
    border-radius: 10px;
    padding: 20px;
    transition: 0.2s;
}

.contact-card:hover {
    border-color: var(--primary);
    transform: translateY(-2px);
    box-shadow: 0 5px 15px rgba(0, 0, 0, 0.05);
}

.contact-name { font-weight: 900; color: var(--text-main); font-size: 1.05rem; margin-bottom: 8px; }
.contact-info { font-size: 0.92rem; color: var(--text-muted); line-height: 1.7; }

.admin-btns {
    margin-top: 15px;
    padding-top: 12px;
    border-top: 1px dashed #cbd5e1;
    display: flex;
    gap: 15px;
    flex-wrap: wrap;
}

.btn-edit-small {
    color: #2563eb;
    font-size: 0.75rem;
    font-weight: 900;
    cursor: pointer;
    text-transform: uppercase;
}

.btn-delete-small {
    color: #dc2626;
    font-size: 0.75rem;
    font-weight: 900;
    cursor: pointer;
    background: none;
    border: none;
    text-transform: uppercase;
}


/* --- BANCOS (CONVERSOR) --- */
.app-bancos #formulario label {
    display: flex;
    gap: 10px;
    align-items: center;
    flex-wrap: wrap;
    margin: 10px 0;
    font-weight: 800;
    color: var(--text-main);
}

.app-bancos #formulario input[type="text"] {
    border: 1px solid var(--border-light);
    border-radius: 10px;
    padding: 10px 12px;
    background: var(--bg-input);
    outline: none;
}

.app-bancos #formulario textarea {
    width: 100%;
    border: 1px solid var(--border-light);
    border-radius: 10px;
    padding: 10px 12px;
    background: var(--bg-input);
    outline: none;
}

.app-bancos #formulario input[type="button"],
.app-bancos #formulario input[type="reset"] {
    background: var(--primary);
    color: white;
    border: none;
    border-radius: 10px;
    padding: 10px 18px;
    font-weight: 900;
    cursor: pointer;
}

.app-bancos #formulario input[type="button"]:hover,
.app-bancos #formulario input[type="reset"]:hover {
    background: var(--primary-dark);
}
/* --- ACCESO DENEGADO (app_guard) --- */
.centered-layout {
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 24px;
    background: var(--bg-body);
}

.msg-card {
    width: 100%;
    max-width: 760px;
    background: var(--bg-card);
    border: 1px solid var(--border-light);
    border-radius: 16px;
    box-shadow: 0 20px 30px rgba(0,0,0,0.08);
    overflow: hidden;
}

/* Variantes (feedback rápido) */
.msg-card.success {
    border-color: var(--success-border);
    background: var(--success-bg);
}

.msg-card.error {
    border-color: var(--error-border);
    background: var(--error-bg);
}

.msg-header {
    padding: 18px 22px;
    background: linear-gradient(135deg, var(--bg-sidebar), var(--primary));
    color: white;
    font-weight: 900;
}

.msg-body {
    padding: 22px;
    color: var(--text-main);
}

.msg-actions {
    padding: 16px 22px 22px;
    display: flex;
    gap: 12px;
    flex-wrap: wrap;
}

.msg-actions a {
    text-decoration: none;
}

/* --- FOOTER FIJO EN APPS --- */
.app-body footer {
    position: fixed;
    bottom: 0;
    left: 0;
    width: 100%;
    background: var(--bg-sidebar);
    color: white;
    text-align: center;
    padding: 12px;
    font-size: 0.85rem;
    z-index: 900;
}

/* --- APP: PERMISOS --- */
[x-cloak] { display: none !important; }

.app-permisos .perm-header-actions {
    display: flex;
    align-items: center;
    gap: 12px;
}

.app-permisos .perm-dashboard,
.app-permisos .perm-calendar-page,
.app-permisos .perm-reports,
.app-permisos .perm-add {
    display: flex;
    flex-direction: column;
    gap: 25px;
}

.app-permisos .perm-lead {
    margin: 0 0 10px 0;
    color: var(--text-muted);
    font-weight: 700;
}

.app-permisos .perm-search-input { padding-left: 45px; }

/* Colores de tipos (sin Tailwind) */
.app-permisos .perm-color-vacaciones { background: #10b981; }
.app-permisos .perm-color-asuntos    { background: #f59e0b; }
.app-permisos .perm-color-baja       { background: #8b5cf6; }
.app-permisos .perm-color-extra      { background: #0ea5e9; }
.app-permisos .perm-color-sinsueldo  { background: #64748b; }

/* Resumen de ausencias */
.app-permisos .perm-today-list {
    display: flex;
    flex-wrap: wrap;
    gap: 12px;
}

.app-permisos .perm-today-item {
    display: flex;
    align-items: center;
    gap: 10px;
    background: var(--bg-card);
    border: 1px solid var(--border-light);
    border-radius: 12px;
    padding: 10px 12px;
}

.app-permisos .perm-today-avatar {
    width: 36px;
    height: 36px;
    border-radius: 10px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 900;
    color: white;
}

.app-permisos .perm-today-name { font-weight: 900; color: var(--text-main); }
.app-permisos .perm-today-type { font-size: 0.85rem; color: var(--text-muted); font-weight: 800; }

/* Tarjetas de empleados */
.app-permisos .perm-employee-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
    gap: 16px;
}

.app-permisos .perm-employee-card {
    display: flex;
    align-items: center;
    gap: 12px;
    text-decoration: none;
    background: var(--bg-card);
    border: 1px solid var(--border-light);
    border-radius: 14px;
    padding: 14px;
    box-shadow: 0 4px 10px rgba(0, 0, 0, 0.05);
    transition: transform 0.2s, box-shadow 0.2s, border-color 0.2s;
}

.app-permisos .perm-employee-card:hover {
    transform: translateY(-2px);
    border-color: rgba(16, 185, 129, 0.45);
    box-shadow: 0 10px 20px rgba(0, 0, 0, 0.08);
}

.app-permisos .perm-employee-avatar {
    width: 42px;
    height: 42px;
    border-radius: 12px;
    background: var(--primary);
    color: white;
    font-weight: 900;
    display: flex;
    align-items: center;
    justify-content: center;
}

.app-permisos .perm-employee-info h3 {
    margin: 0;
    color: var(--text-main);
    font-weight: 900;
    font-size: 1.05rem;
}

.app-permisos .perm-employee-arrow {
    margin-left: auto;
    font-weight: 900;
    color: var(--primary);
}

.app-permisos .perm-empty {
    margin-top: 10px;
    padding: 12px;
    border: 1px dashed var(--border-light);
    border-radius: 12px;
    color: var(--text-muted);
    font-weight: 800;
    text-align: center;
    background: var(--bg-input);
}

/* Calendario: cabecera empleado */
.app-permisos .perm-emp-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-end;
    gap: 16px;
    flex-wrap: wrap;
}

.app-permisos .perm-title {
    margin: 8px 0 0 0;
    font-size: 1.6rem;
    font-weight: 900;
    color: var(--text-main);
}

.app-permisos .perm-subtitle {
    margin: 4px 0 0 0;
    color: var(--text-muted);
    font-weight: 800;
}

.app-permisos .perm-month-nav {
    display: flex;
    align-items: center;
    gap: 10px;
}

.app-permisos .perm-nav-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 38px;
    height: 38px;
    border-radius: 12px;
    background: var(--bg-card);
    border: 1px solid var(--border-light);
    color: var(--text-main);
    text-decoration: none;
    font-weight: 900;
    transition: 0.2s;
}

.app-permisos .perm-nav-btn:hover {
    background: var(--primary);
    border-color: var(--primary);
    color: white;
}

.app-permisos .perm-month-label {
    font-weight: 900;
    color: var(--text-main);
    padding: 6px 10px;
    border-radius: 12px;
    background: var(--bg-input);
    border: 1px solid var(--border-light);
}

/* Selector de tipos */
.app-permisos .perm-type-grid {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    align-items: center;
}

.app-permisos .perm-type-pill { position: relative; }
.app-permisos .perm-type-pill input {
    position: absolute;
    opacity: 0;
    pointer-events: none;
}

.app-permisos .perm-type-pill-ui {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    border: 1px solid var(--border-light);
    border-radius: 999px;
    padding: 8px 12px;
    font-weight: 900;
    background: var(--bg-card);
    color: var(--text-main);
    cursor: pointer;
    transition: 0.2s;
    user-select: none;
}

.app-permisos .perm-type-pill:hover .perm-type-pill-ui {
    transform: translateY(-1px);
    box-shadow: 0 8px 18px rgba(0, 0, 0, 0.08);
}

.app-permisos .perm-type-pill input:checked + .perm-type-pill-ui {
    border-color: var(--primary);
    box-shadow: 0 0 0 3px rgba(16, 185, 129, 0.20);
}

.app-permisos .perm-type-pill--erase .perm-type-pill-ui {
    background: #fff5f5;
    border-color: rgba(220, 38, 38, 0.25);
    color: #991b1b;
}

.app-permisos .perm-type-pill--erase input:checked + .perm-type-pill-ui {
    box-shadow: 0 0 0 3px rgba(220, 38, 38, 0.18);
    border-color: rgba(220, 38, 38, 0.55);
}

.app-permisos .perm-type-dot {
    width: 10px;
    height: 10px;
    border-radius: 999px;
}

.app-permisos .perm-type-count {
    margin-left: 2px;
    padding: 2px 8px;
    border-radius: 999px;
    background: var(--bg-input);
    color: var(--primary);
    font-size: 0.75rem;
    font-weight: 900;
}

.app-permisos .perm-type-separator { flex-basis: 100%; height: 0; }
.app-permisos .perm-type-erase { font-size: 1rem; }

/* Calendario */
.app-permisos .perm-calendar-week {
    display: grid;
    grid-template-columns: repeat(7, 1fr);
    gap: 8px;
    margin-bottom: 8px;
}

.app-permisos .perm-weekday {
    text-align: center;
    font-weight: 900;
    color: var(--text-muted);
    font-size: 0.85rem;
    padding: 6px 0;
}

.app-permisos .perm-calendar-grid {
    display: grid;
    grid-template-columns: repeat(7, 1fr);
    gap: 8px;
}

.app-permisos .perm-day {
    position: relative;
    border: 1px solid var(--border-light);
    border-radius: 12px;
    background: var(--bg-card);
    min-height: 86px;
    padding: 10px;
    cursor: pointer;
    user-select: none;
    transition: 0.2s;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
}

.app-permisos .perm-day--blank {
    background: transparent;
    border: 1px dashed rgba(0, 0, 0, 0.08);
    cursor: default;
}

.app-permisos .perm-day--weekend {
    background: var(--bg-input);
    color: var(--text-muted);
    cursor: not-allowed;
}

.app-permisos .perm-day--holiday {
    background: #fff7ed;
    border-color: rgba(245, 158, 11, 0.35);
    cursor: not-allowed;
}

.app-permisos .perm-day--empty:hover {
    border-color: rgba(16, 185, 129, 0.45);
    box-shadow: 0 10px 20px rgba(0, 0, 0, 0.08);
    transform: translateY(-1px);
}

.app-permisos .perm-day-number { font-weight: 900; color: var(--text-main); }

.app-permisos .perm-day--assigned {
    color: white;
    border-color: rgba(0, 0, 0, 0.08);
}

.app-permisos .perm-day--assigned.perm-color-vacaciones { background: #10b981; }
.app-permisos .perm-day--assigned.perm-color-asuntos    { background: #f59e0b; }
.app-permisos .perm-day--assigned.perm-color-baja       { background: #8b5cf6; }
.app-permisos .perm-day--assigned.perm-color-extra      { background: #0ea5e9; }
.app-permisos .perm-day--assigned.perm-color-sinsueldo  { background: #64748b; }

.app-permisos .perm-day--assigned .perm-day-number { color: rgba(255, 255, 255, 0.95); }

.app-permisos .perm-day-label {
    font-size: 0.75rem;
    font-weight: 900;
    opacity: 0.95;
}

.app-permisos .perm-day-label--holiday {
    font-size: 0.72rem;
    font-weight: 900;
    color: #92400e;
}

.app-permisos .perm-day.is-selected {
    outline: 3px solid rgba(16, 185, 129, 0.55);
    outline-offset: 2px;
}

.app-permisos .perm-day--weekend.is-selected,
.app-permisos .perm-day--holiday.is-selected,
.app-permisos .perm-day--blank.is-selected {
    outline: none;
}

/* Botón flotante */
.app-permisos .perm-save-fab {
    position: fixed;
    right: 18px;
    bottom: 70px;
    z-index: 950;
}

.app-permisos .perm-save-btn {
    border-radius: 14px;
    padding: 12px 16px;
    box-shadow: 0 12px 30px rgba(0, 0, 0, 0.18);
}

.app-permisos .perm-save-btn:disabled {
    opacity: 0.7;
    cursor: not-allowed;
    transform: none;
}

.app-permisos .perm-save-count {
    margin-left: 8px;
    background: rgba(255, 255, 255, 0.18);
    border: 1px solid rgba(255, 255, 255, 0.25);
    border-radius: 999px;
    padding: 2px 10px;
    font-weight: 900;
}

/* Toast */
.app-permisos .perm-toast {
    position: fixed;
    left: 18px;
    bottom: 70px;
    z-index: 950;
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 12px 14px;
    border-radius: 14px;
    color: white;
    font-weight: 900;
    box-shadow: 0 12px 30px rgba(0, 0, 0, 0.18);
}

.app-permisos .perm-toast--success { background: #16a34a; }
.app-permisos .perm-toast--error   { background: #dc2626; }

/* Formularios / filtros */
.app-permisos .perm-form {
    display: flex;
    flex-direction: column;
    gap: 16px;
}

.app-permisos .perm-form .form-group { margin-bottom: 0; }

.app-permisos .perm-form-actions {
    display: flex;
    gap: 12px;
    flex-wrap: wrap;
    align-items: center;
}

.app-permisos .perm-radio-row {
    display: flex;
    gap: 14px;
    flex-wrap: wrap;
    margin-bottom: 10px;
}

.app-permisos .perm-radio {
    display: inline-flex;
    gap: 8px;
    align-items: center;
    font-weight: 800;
    color: var(--text-main);
}

.app-permisos .perm-alert {
    border-radius: 12px;
    padding: 12px 14px;
    font-weight: 800;
    margin-bottom: 10px;
}

.app-permisos .perm-alert ul { margin: 0; padding-left: 18px; }

.app-permisos .perm-alert--error {
    background: #fee2e2;
    border: 1px solid #fecaca;
    color: #991b1b;
}

.app-permisos .perm-search-form {
    display: flex;
    gap: 12px;
    align-items: center;
    flex-wrap: wrap;
}

.app-permisos .perm-search-form .search-container {
    flex: 1;
    min-width: 240px;
}

/* Informes */
.app-permisos .perm-filters {
    display: flex;
    flex-direction: column;
    gap: 18px;
}

.app-permisos .perm-filters-row {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
    gap: 16px;
}

.app-permisos .perm-filters-cols {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    gap: 20px;
}

.app-permisos .perm-filters-actions {
    display: flex;
    align-items: flex-end;
    justify-content: space-between;
    gap: 16px;
    flex-wrap: wrap;
}

.app-permisos .perm-mode {
    display: flex;
    gap: 10px;
    flex-wrap: wrap;
}

.app-permisos .perm-mode-option { position: relative; }
.app-permisos .perm-mode-option input {
    position: absolute;
    opacity: 0;
    pointer-events: none;
}

.app-permisos .perm-mode-option span {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 8px 12px;
    border-radius: 999px;
    border: 1px solid var(--border-light);
    background: var(--bg-card);
    color: var(--text-main);
    font-weight: 900;
    cursor: pointer;
    user-select: none;
}

.app-permisos .perm-mode-option input:checked + span {
    border-color: var(--primary);
    box-shadow: 0 0 0 3px rgba(16, 185, 129, 0.20);
}

.app-permisos .perm-pill-list {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
}

.app-permisos .perm-pill-check { position: relative; }
.app-permisos .perm-pill-check input {
    position: absolute;
    opacity: 0;
    pointer-events: none;
}

.app-permisos .perm-pill-check span {
    display: inline-flex;
    padding: 7px 10px;
    border-radius: 999px;
    border: 1px solid var(--border-light);
    background: var(--bg-card);
    font-weight: 800;
    color: var(--text-main);
    cursor: pointer;
    user-select: none;
}

.app-permisos .perm-pill-check input:checked + span {
    background: var(--primary);
    border-color: var(--primary);
    color: white;
}

.app-permisos .perm-min-input { max-width: 140px; }

.app-permisos .perm-report-days { display: flex; flex-direction: column; gap: 18px; }

.app-permisos .perm-report-day {
    border: 1px solid var(--border-light);
    border-radius: 14px;
    background: var(--bg-card);
    padding: 14px;
}

.app-permisos .perm-report-day-title {
    font-weight: 900;
    color: var(--text-main);
    margin-bottom: 10px;
    display: flex;
    align-items: baseline;
    gap: 8px;
}

.app-permisos .perm-report-day-num { color: var(--text-muted); }

.app-permisos .perm-report-list {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
    gap: 12px;
}

.app-permisos .perm-report-item {
    display: flex;
    gap: 10px;
    align-items: center;
    border: 1px solid var(--border-light);
    border-radius: 12px;
    padding: 10px 12px;
    background: var(--bg-card);
}

.app-permisos .perm-report-bar {
    width: 10px;
    height: 38px;
    border-radius: 999px;
    flex-shrink: 0;
}

.app-permisos .perm-report-name { font-weight: 900; color: var(--text-main); }
.app-permisos .perm-report-detail { color: var(--text-muted); font-weight: 800; font-size: 0.85rem; }

.app-permisos .perm-total-pill {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 3px 10px;
    border-radius: 999px;
    background: var(--primary-light);
    color: var(--primary-dark);
    font-weight: 900;
}

/* --- ANIMACIONES --- */
@keyframes fadeIn {
    from { opacity: 0; transform: translateY(20px); }
    to { opacity: 1; transform: translateY(0); }
}

/* --- RESPONSIVE / MOBILE --- */
@media (max-width: 768px) {
    .dashboard-launcher {
        grid-template-columns: auto 1fr auto;
        gap: 8px;
        padding: 8px 10px;
    }

    .dashboard-launcher-brand img {
        max-height: 28px;
    }

    .dashboard-launcher-brand span,
    .launcher-user-name {
        display: none;
    }

    .dashboard-launcher-actions {
        gap: 6px;
        justify-content: center;
    }

    .launcher-button {
        min-width: 54px;
        width: 54px;
        height: 50px;
        padding: 6px;
    }

    .launcher-label {
        font-size: 0.65rem;
        max-width: 50px;
        overflow: hidden;
        text-overflow: ellipsis;
    }

    .launcher-panels {
        top: 66px;
        padding: 0 10px;
    }

    .launcher-panel {
        width: calc(100vw - 20px);
        max-height: calc(100vh - 90px);
    }

    .launcher-panel-grid {
        grid-template-columns: 1fr;
        max-height: calc(100vh - 164px);
    }

    .menu-layout-dock .dashboard-launcher {
        bottom: 8px;
        width: calc(100vw - 16px);
    }

    .menu-layout-dock .launcher-panels {
        bottom: 78px;
        top: auto;
    }

    .sidebar {
        position: absolute;
        height: 100%;
        z-index: 999;
        /* En móvil, por defecto está oculto (transform) */
        transform: translateX(-100%);
        width: 260px; /* Ancho fijo */
        opacity: 1; /* Asegurar opacidad base */
    }

    /* En móvil, la clase .collapsed hará que se MUESTRE (Invertimos lógica o usamos active)
       Para simplificar con el JS que usa 'toggle', definamos esto:
       
       JS por defecto: Si no tiene 'collapsed', desktop se ve.
       JS si tiene 'collapsed', desktop se oculta.
       
       Para Mobile, necesitamos que funcione igual:
       Si NO tiene collapsed -> Se ve (cubriendo pantalla).
       Si tiene collapsed -> Se oculta.
    */
    
    .sidebar {
        /* Estado visible en móvil */
        transform: translateX(0);
        box-shadow: 2px 0 10px rgba(0,0,0,0.5);
    }
    
    .sidebar.collapsed {
        /* Estado oculto en móvil */
        transform: translateX(-100%);
        width: 260px; /* Mantener ancho para que la transición de transform funcione bien */
    }
    
    /* El botón toggle en móvil debe estar siempre accesible */
.menu-toggle-btn {
        left: 10px;
        top: 10px;
    }
}

/* --- MODOS DE APARIENCIA --- */
html[data-theme-variant="medium"] {
    color-scheme: light;
    --bg-body: #8a939d;
    --bg-card: #959ca6;
    --bg-input: #8e95a0;
    --bg-hover: rgba(255, 255, 255, 0.085);
    --border-light: #909bab;
    --border-focus: rgba(6, 123, 59, 0.29);
    --text-main: #243447;
    --text-muted: #4f6276;
    --text-sidebar: #ecfdf5;
    --text-sidebar-hover: #ffffff;
    --text-inverse: #ffffff;
    --error-bg: #a38487;
    --error-text: #7f1d1d;
    --error-border: #ca868a;
    --success-bg: #7b9d8a;
    --success-text: #14532d;
    --success-border: #59af7d;
    --danger-btn: #d12727;
    --danger-btn-hover: #b01d1d;
}

html[data-theme-variant="dark"] {
    color-scheme: dark;
    --bg-body: #223041;
    --bg-card: #2a394d;
    --bg-input: #233144;
    --bg-hover: rgba(255, 255, 255, 0.07);
    --border-light: #3d4e66;
    --border-focus: rgba(222, 74, 74, 0.28);
    --text-main: #e2e8f0;
    --text-muted: #a9b6c8;
    --text-sidebar: #e5e7eb;
    --text-sidebar-hover: #ffffff;
    --text-inverse: #ffffff;
    --error-bg: #48262b;
    --error-text: #fecaca;
    --error-border: #96414a;
    --success-bg: #193d2c;
    --success-text: #d1fae5;
    --success-border: #2b6e4d;
    --danger-btn: #c62828;
    --danger-btn-hover: #a61e1e;
    --bg-sidebar-header: rgba(255, 255, 255, 0.04);
}

html[data-theme-variant="contrast"] {
    color-scheme: dark;
    --bg-body: #0a0f18;
    --bg-card: #0d1522;
    --bg-input: #08101b;
    --bg-hover: rgba(255, 255, 255, 0.12);
    --border-light: #314056;
    --border-focus: rgba(222, 74, 74, 0.42);
    --text-main: #f8fafc;
    --text-muted: #c4d0df;
    --text-sidebar: #f1f5f9;
    --text-sidebar-hover: #ffffff;
    --text-inverse: #ffffff;
    --error-bg: #3b1116;
    --error-text: #ffe4e6;
    --error-border: #a32739;
    --success-bg: #082814;
    --success-text: #dcfce7;
    --success-border: #1e7b43;
    --danger-btn: #cf2020;
    --danger-btn-hover: #b91c1c;
    --bg-sidebar-header: rgba(255, 255, 255, 0.06);
}

html[data-theme="dark"] body,
html[data-theme="dark"] .main-content,
html[data-theme="dark"] .welcome-body,
html[data-theme="dark"] body.app-body {
    background: var(--bg-body);
    color: var(--text-main);
}

html[data-theme="dark"] .login-container,
html[data-theme="dark"] .card,
html[data-theme="dark"] .welcome-card,
html[data-theme="dark"] .kpi-card,
html[data-theme="dark"] .card-filters,
html[data-theme="dark"] .link-group,
html[data-theme="dark"] .admin-table,
html[data-theme="dark"] .msg-card,
html[data-theme="dark"] .perm-today-item,
html[data-theme="dark"] .app-permisos .perm-employee-card,
html[data-theme="dark"] .enlace-card,
html[data-theme="dark"] .contact-card,
html[data-theme="dark"] .updates-stat,
html[data-theme="dark"] .updates-check {
    background: var(--bg-card);
    color: var(--text-main);
    border-color: var(--border-light);
}

html[data-theme-variant="medium"] .search-container input {
    background: color-mix(in srgb, var(--bg-input) 68%, var(--bg-card) 32%);
    color: var(--text-main);
    border-color: color-mix(in srgb, var(--border-light) 84%, var(--primary) 16%);
}

html[data-theme-variant="medium"] .search-container input:focus {
    border-color: color-mix(in srgb, var(--primary) 36%, var(--border-light) 64%);
    box-shadow: 0 0 0 3px rgba(222, 74, 74, 0.12);
}

html[data-theme-variant="medium"] .sector-wrapper {
    background: color-mix(in srgb, var(--bg-card) 86%, var(--bg-body) 14%);
    border-color: color-mix(in srgb, var(--border-light) 82%, var(--primary) 18%);
    box-shadow: 0 8px 18px rgba(15, 23, 42, 0.08);
}

html[data-theme-variant="medium"] .sector-header {
    background: color-mix(in srgb, var(--bg-card) 74%, var(--primary) 26%);
    color: var(--text-main);
}

html[data-theme-variant="medium"] .sector-header:hover {
    background: color-mix(in srgb, var(--bg-card) 62%, var(--primary) 38%);
}

html[data-theme-variant="medium"] .sector-content {
    background: color-mix(in srgb, var(--bg-card) 90%, var(--bg-body) 10%);
}

html[data-theme-variant="medium"] .contact-card {
    background: color-mix(in srgb, var(--bg-card) 92%, var(--bg-input) 8%);
    border-color: color-mix(in srgb, var(--border-light) 86%, var(--primary) 14%);
}

html[data-theme-variant="contrast"] .search-container input {
    background: color-mix(in srgb, var(--bg-input) 82%, var(--bg-card) 18%);
    color: var(--text-main);
    border-color: color-mix(in srgb, var(--border-light) 76%, var(--primary) 24%);
}

html[data-theme-variant="contrast"] .sector-wrapper {
    background: color-mix(in srgb, var(--bg-card) 90%, black 10%);
    border-color: color-mix(in srgb, var(--border-light) 70%, var(--primary) 30%);
    box-shadow: 0 12px 26px rgba(0, 0, 0, 0.2);
}

html[data-theme-variant="contrast"] .sector-header {
    background: color-mix(in srgb, var(--bg-card) 70%, var(--primary) 30%);
    color: var(--text-main);
}

html[data-theme-variant="contrast"] .sector-header:hover {
    background: color-mix(in srgb, var(--bg-card) 58%, var(--primary) 42%);
}

html[data-theme-variant="contrast"] .sector-content,
html[data-theme-variant="contrast"] .contact-card {
    background: color-mix(in srgb, var(--bg-card) 94%, black 6%);
    border-color: color-mix(in srgb, var(--border-light) 74%, var(--primary) 26%);
}

html[data-theme="dark"] .search-container input {
    background: color-mix(in srgb, var(--bg-input) 88%, var(--bg-card) 12%);
    color: var(--text-main);
    border-color: var(--border-light);
    box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.03);
}

html[data-theme="dark"] .search-container input:focus {
    border-color: color-mix(in srgb, var(--primary) 44%, var(--border-light) 56%);
    box-shadow: 0 0 0 3px rgba(222, 74, 74, 0.16);
}

html[data-theme="dark"] .sector-wrapper {
    background: color-mix(in srgb, var(--bg-card) 92%, black 8%);
    border-color: var(--border-light);
    box-shadow: 0 10px 24px rgba(0, 0, 0, 0.14);
}

html[data-theme="dark"] .sector-header {
    background: color-mix(in srgb, var(--bg-card) 84%, var(--primary) 16%);
    color: var(--text-main);
}

html[data-theme="dark"] .sector-header:hover {
    background: color-mix(in srgb, var(--bg-card) 72%, var(--primary) 28%);
}

html[data-theme="dark"] .sector-content {
    background: color-mix(in srgb, var(--bg-card) 96%, black 4%);
}

html[data-theme="dark"] .form-control,
html[data-theme="dark"] .admin-table td input:not([type="checkbox"]):not([type="radio"]):not([type="hidden"]),
html[data-theme="dark"] .admin-table td select,
html[data-theme="dark"] .admin-table td textarea,
html[data-theme="dark"] .pill {
    background: var(--bg-input);
    color: var(--text-main);
    border-color: var(--border-light);
}

html[data-theme="dark"] .app-body table,
html[data-theme="dark"] .table-wrapper,
html[data-theme="dark"] .table-responsive,
html[data-theme="dark"] .admin-table {
    background: var(--bg-card);
}

html[data-theme="dark"] .app-body th,
html[data-theme="dark"] .admin-table th,
html[data-theme="dark"] .modal-footer {
    background: #162033;
    color: var(--text-main);
    border-color: var(--border-light);
}

html[data-theme="dark"] .app-body tr:hover td,
html[data-theme="dark"] .link-group summary,
html[data-theme="dark"] .app-permisos .perm-empty {
    background: rgba(255, 255, 255, 0.04);
}

html[data-theme="dark"] .menu-toggle-btn {
    background: rgba(15, 23, 42, 0.92);
    color: var(--text-main);
    border-color: var(--border-light);
}

html[data-theme="dark"] .menu-toggle-btn:hover {
    color: #fff;
}

html[data-theme="dark"] .nav-group-title-toggle:hover,
html[data-theme="dark"] .nav-group-title-toggle .caret,
html[data-theme="dark"] .header-nav a,
html[data-theme="dark"] .btn-back-main,
html[data-theme="dark"] .btn-back-dashboard,
html[data-theme="dark"] .perm-header-nav a {
    background: rgba(255, 255, 255, 0.08);
}

html[data-theme="dark"] .app-header-icon {
    background: rgba(255, 255, 255, 0.08);
    border-color: rgba(255, 255, 255, 0.18);
}

html[data-theme="dark"] .header-nav a:hover,
html[data-theme="dark"] .header-nav a.active,
html[data-theme="dark"] .btn-back-main:hover,
html[data-theme="dark"] .btn-back-dashboard:hover,
html[data-theme="dark"] .perm-header-nav a:hover,
html[data-theme="dark"] .perm-header-nav a.active {
    background: rgba(255, 255, 255, 0.92);
    color: #111827;
}

html[data-theme="dark"] .link-group .group-count,
html[data-theme="dark"] .pill {
    background: #1e293b;
    color: #e2e8f0;
}

html[data-theme="dark"] .sidebar-version,
html[data-theme="dark"] .updates-meta,
html[data-theme="dark"] .admin-toolbar .hint {
    color: #cbd5e1;
}

html[data-theme-variant="medium"] .admin-notice,
html[data-theme="dark"] .admin-notice {
    background: color-mix(in srgb, var(--bg-card) 88%, var(--primary) 12%);
    border-left-color: var(--primary);
    border-top: 1px solid color-mix(in srgb, var(--primary) 16%, var(--border-light) 84%);
    border-right: 1px solid color-mix(in srgb, var(--primary) 16%, var(--border-light) 84%);
    border-bottom: 1px solid color-mix(in srgb, var(--primary) 16%, var(--border-light) 84%);
    border-radius: 0 12px 12px 0;
    box-shadow: 0 10px 24px rgba(0, 0, 0, 0.14);
}

html[data-theme-variant="contrast"] .admin-notice {
    background: color-mix(in srgb, var(--bg-card) 84%, var(--primary) 16%);
    border-top-color: color-mix(in srgb, var(--primary) 24%, var(--border-light) 76%);
    border-right-color: color-mix(in srgb, var(--primary) 24%, var(--border-light) 76%);
    border-bottom-color: color-mix(in srgb, var(--primary) 24%, var(--border-light) 76%);
    box-shadow: 0 12px 26px rgba(0, 0, 0, 0.22);
}

html[data-theme-variant="medium"] .admin-notice h4,
html[data-theme="dark"] .admin-notice h4,
html[data-theme-variant="contrast"] .admin-notice h4 {
    color: var(--text-main);
}

html[data-theme-variant="medium"] .admin-notice p,
html[data-theme="dark"] .admin-notice p,
html[data-theme-variant="contrast"] .admin-notice p {
    color: var(--text-muted);
}


