/* =========================================================================
   PAUSA EPS · Panel administrativo — capa visual (Fase 21)
   =========================================================================

   Se carga DESPUES de `admin.css` y redefine su aspecto sin tocar las
   plantillas: las clases son las mismas (`.btn`, `.card`, `.table`,
   `.badge`...), cambia como se ven. Asi el rediseño no obliga a reescribir
   las 43 vistas ni a traer Bootstrap, cuyas clases chocarian con estas.

   Añade los componentes que el panel no tenia: modal, menu de acciones,
   tarjetas de indicadores y el aspecto de DataTables y SweetAlert2.

   ORGANIZACION
   ------------
   1. Tokens           6. Tablas y DataTables
   2. Base e iconos    7. Botones, formularios, estados
   3. Barra lateral    8. Modal y menu de acciones
   4. Barra superior   9. SweetAlert2
   5. Contenido       10. Login y paginas sin sesion
                      11. Responsive y movimiento
   ========================================================================= */

/* ---------------------------------------------------------------- 1. Tokens */
:root {
    --primary:       #0e7c93;
    --primary-dark:  #075668;
    --primary-deep:  #06394a;
    --primary-soft:  #e3f3f6;
    --secondary:     #12b5a0;

    --success:       #15803d;
    --success-soft:  #e8f6ed;
    --warning:       #b45309;
    --warning-soft:  #fdf3e3;
    --danger:        #c0262d;
    --danger-soft:   #fdecec;
    --info:          #2563eb;
    --info-soft:     #eaf1fe;

    --background:    #f3f6f9;
    --surface:       #ffffff;
    --surface-2:     #f7fafb;
    --border:        #e1e8ee;
    --border-strong: #cbd6de;
    --text:          #0f2733;
    --text-muted:    #637a86;
    /* `--muted` en admin.css es un FONDO (gris muy claro), no un texto:
       se mantiene con ese sentido para no oscurecer lo que lo usa. */
    --muted:         #f4f7f9;

    --radius-sm: 8px;
    --radius:    12px;
    --radius-lg: 16px;

    --shadow-sm: 0 1px 2px rgba(15, 39, 51, .06);
    --shadow:    0 2px 6px rgba(15, 39, 51, .06), 0 8px 24px rgba(15, 39, 51, .05);
    --shadow-lg: 0 20px 48px rgba(15, 39, 51, .18);
    --ring:      0 0 0 3px rgba(14, 124, 147, .22);

    --ease: cubic-bezier(.2, .7, .2, 1);

    /* Los nombres de admin.css, apuntando al sistema nuevo. */
    --brand:      var(--primary);
    --brand-dark: var(--primary-dark);
    --brand-soft: var(--primary-soft);
    --ok:         var(--success);
    --warn:       var(--warning);
    --bg:         var(--background);
    --text-soft:  var(--text-muted);

    --sidebar-w: 264px;
    --topbar-h:  68px;

    /* Bootstrap 5 tokens adaptados al tema de Pausa EPS */
    --bs-border-color:       #dee2e6;
    --bs-border-color-translucent: rgba(0, 0, 0, .125);
    --bs-focus-ring-color:   rgba(14, 124, 147, .25);
    --bs-form-control-bg:    #ffffff;
    --bs-form-control-disabled-bg: #f8fafc;
}

/* ----------------------------------------------------------- 2. Base e iconos */
body.admin {
    background: var(--background);
    color: var(--text);
    font-family: "Segoe UI Variable Text", "Segoe UI", system-ui, -apple-system, Roboto, "Helvetica Neue", Arial, sans-serif;
    font-size: 14.5px;
    -webkit-font-smoothing: antialiased;
}

body.admin h1, body.admin h2, body.admin h3 { letter-spacing: -.01em; }

a { color: var(--primary); }

:focus-visible { outline: none; box-shadow: var(--ring); border-radius: 6px; }

/* Iconos nuevos, misma tecnica que admin.css (mascara SVG, trazo 2).
   Una sola familia: trazos redondeados de 24x24. */
.ico--shield   { --svg: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M12 22s8-4 8-10V5l-8-3-8 3v7c0 6 8 10 8 10z'/%3E%3C/svg%3E"); }
.ico--key      { --svg: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Ccircle cx='7.5' cy='15.5' r='5.5'/%3E%3Cpath d='m21 2-9.6 9.6M15.5 7.5l3 3L22 7l-3-3'/%3E%3C/svg%3E"); }
.ico--history  { --svg: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M3 12a9 9 0 1 0 3-6.7L3 8'/%3E%3Cpath d='M3 3v5h5M12 7v5l4 2'/%3E%3C/svg%3E"); }
.ico--pause    { --svg: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Crect x='2' y='4' width='20' height='16' rx='3'/%3E%3Cpath d='m10 9 5 3-5 3z'/%3E%3C/svg%3E"); }
.ico--eye      { --svg: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M2 12s3.5-7 10-7 10 7 10 7-3.5 7-10 7S2 12 2 12z'/%3E%3Ccircle cx='12' cy='12' r='3'/%3E%3C/svg%3E"); }
.ico--edit     { --svg: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M17 3a2.85 2.83 0 1 1 4 4L7.5 20.5 2 22l1.5-5.5Z'/%3E%3C/svg%3E"); }
.ico--power    { --svg: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M12 2v10'/%3E%3Cpath d='M18.4 6.6a9 9 0 1 1-12.8 0'/%3E%3C/svg%3E"); }
.ico--dots     { --svg: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='black'%3E%3Ccircle cx='12' cy='5' r='2'/%3E%3Ccircle cx='12' cy='12' r='2'/%3E%3Ccircle cx='12' cy='19' r='2'/%3E%3C/svg%3E"); }
.ico--plus     { --svg: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='2.4' stroke-linecap='round'%3E%3Cpath d='M12 5v14M5 12h14'/%3E%3C/svg%3E"); }
.ico--close    { --svg: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='2.2' stroke-linecap='round'%3E%3Cpath d='M6 6l12 12M18 6 6 18'/%3E%3C/svg%3E"); }
.ico--search   { --svg: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='2' stroke-linecap='round'%3E%3Ccircle cx='11' cy='11' r='7'/%3E%3Cpath d='m20 20-3.5-3.5'/%3E%3C/svg%3E"); }
.ico--truck    { --svg: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M3 6h11v10H3zM14 10h4l3 3v3h-7'/%3E%3Ccircle cx='7' cy='18' r='2'/%3E%3Ccircle cx='17' cy='18' r='2'/%3E%3C/svg%3E"); }
.ico--ban      { --svg: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='2' stroke-linecap='round'%3E%3Ccircle cx='12' cy='12' r='9'/%3E%3Cpath d='m5.7 5.7 12.6 12.6'/%3E%3C/svg%3E"); }
.ico--pulse    { --svg: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M22 12h-4l-3 8-6-16-3 8H2'/%3E%3C/svg%3E"); }
.ico--star     { --svg: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='2' stroke-linejoin='round'%3E%3Cpath d='m12 3 2.8 5.7 6.2.9-4.5 4.4 1 6.2L12 17.3 6.5 20.2l1-6.2L3 9.6l6.2-.9z'/%3E%3C/svg%3E"); }

/* ------------------------------------------------------------ 3. Barra lateral */
.sidebar {
    background: linear-gradient(180deg, var(--primary-deep) 0%, #052e3b 100%);
    border-right: 0;
    color: #d9ecf1;
    box-shadow: 4px 0 24px rgba(5, 46, 59, .10);
}

.sidebar__head { border-bottom: 1px solid rgba(255, 255, 255, .08); padding: 0 18px; }

.sidebar .brand__mark {
    background: linear-gradient(135deg, var(--secondary), var(--primary));
    box-shadow: 0 6px 16px rgba(18, 181, 160, .35);
}
.sidebar .brand__name    { color: #fff; font-weight: 700; letter-spacing: .01em; }
.sidebar .brand__company { color: rgba(217, 236, 241, .62); }
.sidebar__close          { color: #fff; }

/* Logotipo de EPS RIOJA. Se fija el ancho y el alto sale de la proporcion. */
.brand__logo { display: block; flex: none; line-height: 0; }
.brand__logo img { display: block; width: 100%; height: auto; }

/* Barra lateral: placa blanca para que «RIOJA» (azul oscuro) se lea. */
.sidebar .brand { gap: 10px; }
.sidebar .brand__logo {
    width: 142px;
    max-width: 100%;
    padding: 7px 10px;
    background: #fff;
    border-radius: 10px;
    box-shadow: 0 4px 14px rgba(0, 0, 0, .18);
    box-sizing: border-box;
}
.sidebar .brand__name { font-size: 12.5px; color: rgba(217, 236, 241, .8); font-weight: 600; line-height: 1.2; white-space: nowrap; }

.sidebar__nav { padding: 16px 12px 24px; }

.sidebar__group {
    color: rgba(217, 236, 241, .45);
    font-size: 10.5px;
    font-weight: 700;
    letter-spacing: .12em;
    text-transform: uppercase;
    padding: 0 12px;
    margin: 0 0 6px;
}
.sidebar__list + .sidebar__group { margin-top: 22px; }

.sidebar__item {
    color: rgba(230, 243, 246, .82);
    border-radius: 10px;
    padding: 9px 12px;
    font-weight: 500;
    transition: background .18s var(--ease), color .18s var(--ease), transform .18s var(--ease);
}
.sidebar__item .ico { opacity: .85; }

a.sidebar__item:hover {
    background: rgba(255, 255, 255, .07);
    color: #fff;
}

a.sidebar__item.is-active {
    background: rgba(18, 181, 160, .16);
    color: #fff;
    box-shadow: inset 3px 0 0 var(--secondary);
}
a.sidebar__item.is-active .ico { opacity: 1; color: var(--secondary); }

.sidebar__foot { display: none; }

/* ------------------------------------------------------------ 4. Barra superior */
.topbar {
    background: rgba(255, 255, 255, .86);
    backdrop-filter: saturate(1.6) blur(10px);
    -webkit-backdrop-filter: saturate(1.6) blur(10px);
    border-bottom: 1px solid var(--border);
    padding: 0 24px;
}

.topbar__crumb {
    display: block;
    font-size: 11.5px;
    font-weight: 600;
    color: var(--text-muted);
    letter-spacing: .02em;
    margin-bottom: 1px;
}
.topbar__crumb span + span::before { content: "›"; margin: 0 6px; color: var(--border-strong); }

.topbar__title h1 { font-size: 18px; font-weight: 700; }
.topbar__title p  { color: var(--text-muted); }

.userchip {
    border: 1px solid var(--border);
    border-radius: 999px;
    padding: 4px 10px 4px 4px;
    background: var(--surface);
    transition: box-shadow .18s var(--ease), border-color .18s var(--ease);
}
.userchip:hover { border-color: var(--border-strong); box-shadow: var(--shadow-sm); }

.userchip__avatar {
    background: linear-gradient(135deg, var(--primary), var(--secondary));
    color: #fff;
    font-weight: 700;
}

.dropdown {
    border: 1px solid var(--border);
    border-radius: var(--radius);
    box-shadow: var(--shadow-lg);
    animation: ui-pop .16s var(--ease);
}

/* ------------------------------------------------------------- 5. Contenido */
.main {
    flex: 1 1 auto;
    width: 100%;
    max-width: 100%;
    padding: 24px 32px 48px;
    box-sizing: border-box;
}

.card,
.module,
.status,
.stat,
.table-wrap,
.empty {
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow);
}

.card {
    width: 100%;
    box-sizing: border-box;
    transition: box-shadow .2s var(--ease);
}

.section { margin-top: 32px; }
.section__head h3 { font-size: 16px; font-weight: 700; }

/* Bienvenida del escritorio */
.welcome {
    background:
        radial-gradient(900px 240px at 100% 0%, rgba(18, 181, 160, .25), transparent 60%),
        linear-gradient(135deg, var(--primary-deep), var(--primary));
    color: #fff;
    border: 0;
    border-radius: var(--radius-lg);
    padding: 26px 28px;
    box-shadow: var(--shadow);
}
.welcome h2 { color: #fff; font-size: 22px; }
.welcome p, .welcome__text p { color: rgba(255, 255, 255, .82); }
.welcome .tag, .welcome__badge { background: rgba(255, 255, 255, .16); color: #fff; border: 0; }

/* Indicadores (KPI) */
.stats { gap: 16px; }

.stat {
    position: relative;
    padding: 18px 18px 16px 18px;
    overflow: hidden;
    transition: transform .2s var(--ease), box-shadow .2s var(--ease);
}
.stat::before {
    content: "";
    position: absolute;
    inset: 0 auto 0 0;
    width: 4px;
    background: linear-gradient(180deg, var(--secondary), var(--primary));
}
.stat:hover { transform: translateY(-2px); box-shadow: var(--shadow-lg); }
.stat__label { color: var(--text-muted); font-size: 12px; font-weight: 700; text-transform: uppercase; letter-spacing: .06em; }
.stat__value { font-size: 28px; font-weight: 800; color: var(--text); letter-spacing: -.02em; font-variant-numeric: tabular-nums; }
.stat__hint  { color: var(--text-muted); font-size: 12.5px; }

.module { transition: transform .2s var(--ease), box-shadow .2s var(--ease), border-color .2s var(--ease); }
a.module:hover { transform: translateY(-2px); box-shadow: var(--shadow-lg); border-color: var(--primary-soft); }
.module__icon { background: var(--primary-soft); color: var(--primary); border-radius: 12px; }

.bar__track { background: var(--surface-2); border-radius: 999px; }
.bar__fill  { background: linear-gradient(90deg, var(--primary), var(--secondary)); border-radius: 999px; }

.feed__row { border-radius: var(--radius-sm); transition: background .15s; }
.feed__row:hover { background: var(--surface-2); }

.podium__pos { background: var(--primary-soft); color: var(--primary-dark); border-radius: 999px; font-weight: 800; }

/* Cabecera de pagina: barra de herramientas del listado con estetica Bootstrap 5 */
.toolbar {
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    padding: 14px 20px;
    box-shadow: var(--shadow-sm);
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    justify-content: space-between;
    gap: 14px;
    width: 100%;
    box-sizing: border-box;
}

.toolbar .filters {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 10px;
    flex: 1 1 auto;
}

.filters__search {
    flex: 1 1 260px;
    min-width: 200px;
    max-width: 440px;
}

.filters__field select {
    min-width: 150px;
}

.toolbar > .btn,
.toolbar > .btn--primary,
.toolbar > .toolbar__actions {
    margin-left: auto;
    flex-shrink: 0;
}

.filters input[type="search"],
.filters select {
    border-radius: 10px;
    border: 1px solid var(--border-strong);
    background: var(--surface);
    min-height: 40px;
    padding: 7px 13px;
    font: inherit;
    font-size: 13.5px;
    color: var(--text);
    transition: border-color .15s ease-in-out, box-shadow .15s ease-in-out;
}

.filters input[type="search"]:focus,
.filters select:focus {
    border-color: #86b7fe;
    box-shadow: 0 0 0 0.25rem rgba(14, 124, 147, .22);
    outline: 0;
    background: #ffffff;
}

.alert {
    border-radius: var(--radius);
    border-width: 1px;
    box-shadow: var(--shadow-sm);
}
.alert--info  { background: var(--success-soft); border-color: #c5e6cf; color: #0f5b2c; }
.alert--error { background: var(--danger-soft);  border-color: #f4c5c7; color: #8f1d22; }

.note { border-radius: var(--radius); background: var(--surface-2); border-color: var(--border); }

/* Estado vacio */
.empty {
    padding: 46px 24px;
    text-align: center;
}
.empty > .ico {
    width: 56px;
    height: 56px;
    padding: 14px;
    border-radius: 18px;
    background: var(--primary-soft);
    color: var(--primary);
    box-sizing: content-box;
}
.empty h3 { margin-top: 14px; font-size: 17px; }
.empty p  { color: var(--text-muted); }

/* Listas de definicion de las fichas */
.deflist dt { color: var(--text-muted); font-size: 11.5px; font-weight: 700; text-transform: uppercase; letter-spacing: .05em; }

.mono {
    font-family: ui-monospace, SFMono-Regular, "Segoe UI Mono", Menlo, Consolas, monospace !important;
    font-size: 12.5px;
}


/* ------------------------------------------------------- 6. Tablas y DataTables */
.table-wrap { overflow: hidden; padding: 0; }

.table thead th {
    background: var(--surface-2);
    color: var(--text-muted);
    font-size: 11.5px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: .06em;
    border-bottom: 1px solid var(--border);
    white-space: nowrap;
}
.table thead th a { color: inherit; text-decoration: none; }

.table tbody tr { transition: background .15s; }
.table tbody tr:hover { background: #f5fafb; }
.table td { border-bottom: 1px solid var(--border); vertical-align: middle; }
.table tbody tr:last-child td { border-bottom: 0; }

/* DataTables integrado: sus controles viven en la tarjeta de la tabla. */
.dt-container { font-size: 13.5px; }
.dt-container .dt-layout-row { margin: 0; padding: 12px 16px; }
.dt-container .dt-layout-row.dt-layout-table { padding: 0; }
/* Tablas con muchas columnas (Actividades): se desplazan dentro de la
   tarjeta en vez de recortar Estado y Acciones. */
.dt-container .dt-layout-table > .dt-layout-cell { overflow-x: auto; }
.dt-container .dt-layout-row:first-child { border-bottom: 1px solid var(--border); }
.dt-container .dt-layout-row:last-child  { border-top: 1px solid var(--border); background: var(--surface-2); }

.dt-container .dt-search input,
.dt-container .dt-length select {
    border: 1px solid var(--border);
    border-radius: 10px;
    background: var(--surface);
    padding: 7px 12px;
    font: inherit;
    color: var(--text);
}
.dt-container .dt-search input {
    min-width: 240px;
    padding-left: 36px !important;
    background: var(--surface) url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23637a86' stroke-width='2' stroke-linecap='round'%3E%3Ccircle cx='11' cy='11' r='7'/%3E%3Cpath d='m20 20-3.5-3.5'/%3E%3C/svg%3E") no-repeat 11px center / 16px;
}
.dt-container .dt-search input:focus,
.dt-container .dt-length select:focus { border-color: var(--primary); box-shadow: var(--ring); outline: 0; }
.dt-container .dt-search label,
.dt-container .dt-length label { color: var(--text-muted); }
.dt-container .dt-info { color: var(--text-muted); }

.dt-container .dt-paging .dt-paging-button {
    border: 1px solid transparent !important;
    border-radius: 9px !important;
    padding: 5px 11px !important;
    margin-left: 3px;
    color: var(--text) !important;
    background: none !important;
}
.dt-container .dt-paging .dt-paging-button:hover:not(.disabled) {
    background: var(--primary-soft) !important;
    color: var(--primary-dark) !important;
}
.dt-container .dt-paging .dt-paging-button.current {
    background: var(--primary) !important;
    color: #fff !important;
    box-shadow: 0 4px 10px rgba(14, 124, 147, .28);
}
.dt-container .dt-paging .dt-paging-button.disabled { color: var(--border-strong) !important; }

table.dataTable { margin: 0 !important; border-collapse: collapse !important; }
table.dataTable thead > tr > th.dt-orderable-asc:hover,
table.dataTable thead > tr > th.dt-orderable-desc:hover { outline: 0; color: var(--primary-dark); }
table.dataTable > thead > tr > th, table.dataTable > thead > tr > td { border-bottom: 1px solid var(--border) !important; }
table.dataTable.no-footer { border-bottom: 0 !important; }
table.dataTable td.dt-empty { padding: 40px 16px; color: var(--text-muted); }

/* Columna de acciones compacta y perfectamente alineada horizontal */
.table th.table__actions,
.table td.table__actions {
    text-align: right !important;
    white-space: nowrap !important;
    width: auto !important;
    min-width: 95px !important;
    padding-right: 18px !important;
    vertical-align: middle !important;
}

.table__actions {
    display: flex !important;
    flex-direction: row !important;
    flex-wrap: nowrap !important; /* JAMÁS partir en 2 filas */
    align-items: center !important;
    justify-content: flex-end !important;
    gap: 8px !important;
    white-space: nowrap !important;
    border: 0 !important;
    text-decoration: none !important;
}

.table__actions form {
    margin: 0 !important;
    padding: 0 !important;
    display: inline-flex !important;
    flex-direction: row !important;
    align-items: center !important;
    vertical-align: middle !important;
    border: 0 !important;
}

/* Enlaces de tabla limpios (sin subrayado estilo web antigua) */
.table tbody td a:not(.btn):not(.act) {
    text-decoration: none !important;
    font-weight: 600;
    color: var(--primary);
    transition: color .15s ease;
}
.table tbody td a:not(.btn):not(.act):hover {
    color: var(--primary-dark);
    text-decoration: underline !important;
    text-underline-offset: 3px;
    text-decoration-color: var(--primary-soft) !important;
}

/* Botones de acción ultra-atractivos, idénticos, nítidos y sin líneas fantasma */
.act,
a.act,
button.act {
    position: relative !important;
    display: inline-flex !important;
    align-items: center !important;
    justify-content: center !important;
    width: 34px !important;
    height: 34px !important;
    min-width: 34px !important;
    min-height: 34px !important;
    padding: 0 !important;
    border-radius: 9px !important;
    border: 1px solid #b5dbe3 !important;
    background: #f0f7f9 !important;
    color: #0b687c !important;
    cursor: pointer !important;
    line-height: 1 !important;
    text-decoration: none !important;
    text-decoration-line: none !important;
    border-bottom-style: solid !important;
    outline: none !important;
    vertical-align: middle !important;
    box-sizing: border-box !important;
    box-shadow: 0 1px 2px rgba(16, 42, 51, 0.05) !important;
    transition: background-color .15s ease, border-color .15s ease, color .15s ease, transform .15s ease, box-shadow .15s ease !important;
}
.act::before,
.act::after {
    content: none !important;
    display: none !important;
}
.act:hover,
a.act:hover,
button.act:hover,
.act:focus,
a.act:focus,
button.act:focus,
.act:active,
a.act:active,
button.act:active {
    text-decoration: none !important;
    text-decoration-line: none !important;
    outline: none !important;
}
.act:focus-visible,
a.act:focus-visible,
button.act:focus-visible {
    outline: 2px solid var(--primary) !important;
    outline-offset: 2px !important;
    box-shadow: 0 0 0 3px rgba(14, 124, 147, 0.2) !important;
}
.act:active,
a.act:active,
button.act:active {
    transform: scale(0.93) !important;
}

/* Ocultar texto invisible del lector para evitar subrayados fantasma del navegador */
.act .sr-only {
    display: none !important;
    text-decoration: none !important;
}

/* Iconos dentro del botón con micro-interacción */
.act .ico {
    width: 17px !important;
    height: 17px !important;
    color: inherit !important;
    display: inline-block !important;
    vertical-align: middle !important;
    transition: transform .18s cubic-bezier(0.16, 1, 0.3, 1), color .15s ease !important;
}
.act:hover .ico {
    transform: scale(1.12);
    color: #ffffff !important;
}

/* Variante principal / Editar / Ver (Azul Petróleo / Cyan moderno) */
.act,
a.act {
    background: #f0f7f9 !important;
    border-color: #b5dbe3 !important;
    color: #0b687c !important;
}
.act:hover,
a.act:hover {
    background: #0e7c93 !important;
    border-color: #0e7c93 !important;
    color: #ffffff !important;
    transform: translateY(-2px);
    box-shadow: 0 4px 10px rgba(14, 124, 147, 0.32) !important;
}

/* Variante Peligro / Desactivar / Eliminar (Rojo / Borgoña moderno) */
.act--danger,
a.act--danger,
button.act--danger {
    background: #fdf2f2 !important;
    border-color: #fca5a5 !important;
    color: #b91c1c !important;
}
.act--danger:hover,
a.act--danger:hover,
button.act--danger:hover {
    background: #dc2626 !important;
    border-color: #dc2626 !important;
    color: #ffffff !important;
    transform: translateY(-2px);
    box-shadow: 0 4px 10px rgba(220, 38, 38, 0.32) !important;
}

/* Variante Éxito / Activar / Aprobar (Verde Esmeralda moderno) */
.act--success,
a.act--success,
button.act--success {
    background: #f0fdf4 !important;
    border-color: #86efac !important;
    color: #15803d !important;
}
.act--success:hover,
a.act--success:hover,
button.act--success:hover {
    background: #16a34a !important;
    border-color: #16a34a !important;
    color: #ffffff !important;
    transform: translateY(-2px);
    box-shadow: 0 4px 10px rgba(22, 163, 74, 0.32) !important;
}

/* Variante Menú Más Acciones (...) */
.actmenu > .act {
    background: #f8fafc !important;
    border-color: #cbd5e1 !important;
    color: #475569 !important;
}
.actmenu > .act:hover {
    background: #334155 !important;
    border-color: #334155 !important;
    color: #ffffff !important;
    transform: translateY(-2px);
    box-shadow: 0 4px 10px rgba(51, 65, 85, 0.25) !important;
}



/* ----------------------------------------------- 7. Botones, formularios, estados */
.btn {
    border-radius: 10px;
    font-weight: 600;
    font-size: 13.5px;
    padding: 8px 18px;
    min-height: 40px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    line-height: 1.4;
    text-decoration: none;
    cursor: pointer;
    transition: background .15s ease-in-out, box-shadow .15s ease-in-out, transform .15s ease-in-out, border-color .15s ease-in-out, color .15s ease-in-out;
}
.btn:focus-visible {
    box-shadow: 0 0 0 0.25rem rgba(14, 124, 147, .25);
    outline: 0;
}
.btn:active {
    transform: scale(0.985);
}

.btn--primary {
    background: linear-gradient(180deg, #11889f, var(--primary));
    border: 1px solid var(--primary);
    color: #ffffff !important;
    box-shadow: 0 4px 12px rgba(14, 124, 147, .25);
}
.btn--primary:hover {
    background: linear-gradient(180deg, #0e7c93, var(--primary-dark));
    border-color: var(--primary-dark);
    box-shadow: 0 6px 16px rgba(14, 124, 147, .32);
    transform: translateY(-1px);
}

.btn--ghost {
    border: 1px solid var(--border-strong);
    background: var(--surface);
    color: var(--text);
}
.btn--ghost:hover {
    border-color: #aebec9;
    background: var(--surface-2);
    color: var(--primary-dark);
}

.btn--plain {
    background: transparent;
    border: 1px solid transparent;
    color: var(--text-muted);
}
.btn--plain:hover {
    background: var(--surface-2);
    color: var(--text);
    border-color: var(--border);
}

.btn--danger {
    color: var(--danger);
    border: 1px solid #f4c5c7;
    background: var(--surface);
}
.btn--danger:hover {
    background: var(--danger-soft);
    border-color: var(--danger);
}

.btn--sm {
    min-height: 32px;
    padding: 4px 12px;
    font-size: 12.5px;
    border-radius: 8px;
}

.btn--block {
    width: 100%;
    display: flex;
}

.btn[disabled], .btn.is-loading { opacity: .72; pointer-events: none; }

.spinner {
    display: inline-block;
    width: 15px;
    height: 15px;
    border: 2px solid currentColor;
    border-right-color: transparent;
    border-radius: 50%;
    animation: ui-spin .7s linear infinite;
    vertical-align: -2px;
    margin-right: 6px;
}

/* Formularios padre y estructura con estetica Bootstrap 5 */
.card--form {
    width: 100%;
    max-width: 100%;
    padding: 28px 32px;
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow);
    box-sizing: border-box;
}

.form-grid {
    display: grid;
    gap: 20px 24px;
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    width: 100%;
}

.form-grid--single {
    grid-template-columns: 1fr !important;
    width: 100%;
}

.form-grid--single .field {
    width: 100%;
}

.field {
    display: flex;
    flex-direction: column;
    gap: 6px;
    width: 100%;
}

.field label {
    font-weight: 600;
    font-size: 13px;
    color: var(--text);
    margin-bottom: 2px;
    display: flex;
    align-items: center;
    justify-content: space-between;
}

/* Casilla con su texto («Quitar el video actual»): juntos, no separados. */
.field label:has(> input[type="checkbox"]),
.field label:has(> input[type="radio"]) {
    justify-content: flex-start;
}
.field label > input[type="checkbox"],
.field label > input[type="radio"] {
    flex: none;
    width: 16px;
    height: 16px;
    min-height: 0;
    margin: 0;
    padding: 0;
}

.field label .muted {
    font-size: 12px;
    font-weight: 400;
    color: var(--text-muted);
}

.field input[type="text"],
.field input[type="search"],
.field input[type="email"],
.field input[type="password"],
.field input[type="number"],
.field input[type="tel"],
.field input[type="date"],
.field input[type="datetime-local"],
.field input[type="url"],
.field select,
.field textarea {
    width: 100%;
    min-height: 42px;
    border: 1px solid var(--border-strong);
    border-radius: 10px;
    background: var(--surface);
    padding: 8px 13px;
    font: inherit;
    font-size: 14px;
    color: var(--text);
    line-height: 1.5;
    box-sizing: border-box;
    transition: border-color .15s ease-in-out, box-shadow .15s ease-in-out, background-color .15s ease-in-out;
}

.field input:hover:not(:disabled),
.field select:hover:not(:disabled),
.field textarea:hover:not(:disabled) {
    border-color: #aebec9;
}

.field input:focus,
.field select:focus,
.field textarea:focus {
    border-color: #86b7fe;
    box-shadow: 0 0 0 0.25rem rgba(14, 124, 147, .22);
    outline: 0;
    background: #fff;
}

.field input:disabled,
.field select:disabled,
.field textarea:disabled {
    background-color: var(--muted);
    border-color: var(--border);
    color: var(--text-muted);
    cursor: not-allowed;
    opacity: 0.88;
}

.field textarea {
    min-height: 110px;
    resize: vertical;
}

.field input[type="file"] {
    border: 1px dashed var(--border-strong);
    border-radius: 10px;
    padding: 12px;
    background: var(--surface-2);
    cursor: pointer;
    transition: border-color .15s, background-color .15s;
}

.field input[type="file"]:hover {
    border-color: var(--primary);
    background: var(--primary-soft);
}

.field__hint {
    font-size: 12px;
    color: var(--text-muted);
    margin-top: 4px;
    line-height: 1.45;
}

.field.has-error input,
.field.has-error select,
.field.has-error textarea {
    border-color: var(--danger) !important;
    box-shadow: 0 0 0 0.25rem rgba(192, 38, 45, .18) !important;
}

.field__error {
    color: var(--danger);
    font-weight: 600;
    font-size: 12px;
    margin-top: 4px;
    display: flex;
    align-items: center;
    gap: 4px;
}

.form-section {
    font-size: 12px;
    font-weight: 800;
    text-transform: uppercase;
    letter-spacing: .08em;
    color: var(--primary-dark);
    padding-bottom: 8px;
    margin: 28px 0 16px;
    border-bottom: 1px solid var(--border);
    width: 100%;
}

.form-actions {
    display: flex;
    align-items: center;
    justify-content: flex-end;
    gap: 12px;
    margin-top: 26px;
    padding-top: 20px;
    border-top: 1px solid var(--border);
    width: 100%;
}

/* Casillas como interruptor, sin cambiar el campo (sigue siendo checkbox). */
.switch input[type="checkbox"],
.field input[type="checkbox"].is-switch {
    appearance: none;
    -webkit-appearance: none;
    width: 38px;
    height: 22px;
    border-radius: 999px;
    background: var(--border-strong);
    position: relative;
    cursor: pointer;
    transition: background .18s var(--ease);
    flex: none;
}
.switch input[type="checkbox"]::after,
.field input[type="checkbox"].is-switch::after {
    content: "";
    position: absolute;
    top: 3px;
    left: 3px;
    width: 16px;
    height: 16px;
    border-radius: 50%;
    background: #fff;
    box-shadow: 0 1px 3px rgba(0, 0, 0, .25);
    transition: transform .18s var(--ease);
}
.switch input[type="checkbox"]:checked,
.field input[type="checkbox"].is-switch:checked { background: var(--primary); }
.switch input[type="checkbox"]:checked::after,
.field input[type="checkbox"].is-switch:checked::after { transform: translateX(16px); }

/* Estados */
.badge {
    border-radius: 999px;
    font-weight: 700;
    font-size: 11.5px;
    padding: 3px 10px 3px 8px;
    letter-spacing: .01em;
}
.badge--ok     { background: var(--success-soft); border-color: #c5e6cf; color: #0f5b2c; }
.badge--danger { background: var(--danger-soft);  border-color: #f4c5c7; color: #8f1d22; }
.badge--soft   { background: var(--warning-soft); border-color: #f1d6ae; color: #8a4108; }
.badge--muted  { background: var(--surface-2);    border-color: var(--border); color: var(--text-muted); }

.tag { border-radius: 999px; font-weight: 600; }
.tag--role { background: var(--primary-soft); color: var(--primary-dark); }

/* ------------------------------------------------ 8. Modal y menu de acciones */
.ui-modal {
    position: fixed;
    inset: 0;
    z-index: 1050;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 24px 16px;
    background: rgba(8, 26, 34, 0.65);
    backdrop-filter: blur(6px);
    -webkit-backdrop-filter: blur(6px);
    overflow-y: auto;
    animation: ui-fade .2s var(--ease);
}
.ui-modal[hidden] { display: none; }

.ui-modal__dialog {
    position: relative;
    width: 100%;
    max-width: 620px;
    background: var(--surface);
    border-radius: 20px;
    border: 1px solid rgba(255, 255, 255, 0.4);
    box-shadow: 0 25px 65px -10px rgba(6, 30, 40, 0.38), 0 10px 25px -5px rgba(6, 30, 40, 0.15);
    display: flex;
    flex-direction: column;
    max-height: calc(100vh - 48px);
    animation: ui-rise .24s cubic-bezier(0.16, 1, 0.3, 1);
    overflow: hidden;
}
.ui-modal--md .ui-modal__dialog { max-width: 620px; }
.ui-modal--lg .ui-modal__dialog { max-width: 840px; }
.ui-modal--xl .ui-modal__dialog { max-width: 1060px; }

.ui-modal__head {
    display: flex;
    align-items: center;
    gap: 14px;
    padding: 20px 26px;
    border-bottom: 1px solid var(--border);
    background: var(--surface);
    flex-shrink: 0;
}
.ui-modal__icon {
    width: 44px;
    height: 44px;
    border-radius: 12px;
    background: linear-gradient(135deg, var(--primary-soft) 0%, #ddf0f4 100%);
    color: var(--primary);
    border: 1px solid #c2e5ed;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    box-shadow: 0 2px 6px rgba(14, 124, 147, 0.12);
}
.ui-modal__icon .ico { width: 22px; height: 22px; }
.ui-modal__title { flex: 1; min-width: 0; }
.ui-modal__title h2 {
    margin: 0;
    font-size: 18px;
    font-weight: 700;
    color: var(--text);
    letter-spacing: -0.01em;
    line-height: 1.3;
}
.ui-modal__title p {
    margin: 3px 0 0;
    font-size: 13px;
    color: var(--text-muted);
    line-height: 1.4;
}

.ui-modal__close {
    border: 1px solid var(--border);
    background: var(--surface-2);
    width: 36px;
    height: 36px;
    border-radius: 10px;
    color: var(--text-muted);
    display: inline-flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: all .16s ease;
}
.ui-modal__close:hover {
    background: #fee2e2;
    border-color: #fecaca;
    color: #ef4444;
    transform: rotate(90deg);
}

.ui-modal__body {
    padding: 24px 28px;
    overflow-y: auto;
    flex: 1;
    background: var(--surface);
}

/* Disposición de contenido limpio en el modal */
.ui-modal__body .toolbar {
    display: flex;
    align-items: center;
    justify-content: flex-end;
    gap: 8px;
    background: var(--surface-2);
    border: 1px solid var(--border);
    border-radius: 12px;
    padding: 8px 14px;
    margin-bottom: 20px;
    box-shadow: none;
}
.ui-modal__body .toolbar__lead {
    display: none !important;
}
.ui-modal__body .toolbar__actions {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    margin-left: auto;
}
.ui-modal__body .toolbar__actions form {
    margin: 0;
    display: inline-flex;
}
.ui-modal__body .toolbar__actions .btn {
    min-height: 34px;
    padding: 6px 14px;
    font-size: 13px;
    border-radius: 8px;
}

.ui-modal__body .section {
    margin-top: 22px;
}
.ui-modal__body .section:first-child,
.ui-modal__body .toolbar + .section {
    margin-top: 0;
}
.ui-modal__body .section__head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 14px;
    padding-bottom: 8px;
    border-bottom: 1px solid var(--border);
}
.ui-modal__body .section__head h2 {
    font-size: 15px;
    font-weight: 700;
    color: var(--text);
    letter-spacing: -0.01em;
    margin: 0;
}

.ui-modal__body .card {
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: 14px;
    padding: 18px 20px;
    box-shadow: 0 1px 3px rgba(16, 42, 51, 0.04);
    margin-bottom: 18px;
}
.ui-modal__body .card:last-child {
    margin-bottom: 0;
}
.ui-modal__body .card--form {
    border: 0 !important;
    box-shadow: none !important;
    padding: 0 !important;
    background: transparent !important;
    margin: 0 !important;
}

/* Cuadrícula de detalles y datos clave (Key-Value tiles modernos) */
.ui-modal__body .deflist {
    display: grid;
    gap: 12px 14px;
    grid-template-columns: repeat(auto-fit, minmax(210px, 1fr));
    margin: 0;
}
.ui-modal__body .deflist > div {
    background: var(--surface-2);
    border: 1px solid var(--border);
    border-radius: 10px;
    padding: 10px 14px;
    display: flex;
    flex-direction: column;
    gap: 4px;
    transition: border-color .15s ease, background-color .15s ease;
}
.ui-modal__body .deflist > div:hover {
    border-color: #bce3eb;
    background: #f7fbfd;
}
.ui-modal__body .deflist dt {
    font-size: 11px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: .06em;
    color: var(--text-muted);
}
.ui-modal__body .deflist dd {
    font-size: 13.5px;
    font-weight: 600;
    color: var(--text);
    margin: 0;
    line-height: 1.4;
}
.ui-modal__body .deflist__wide {
    grid-column: 1 / -1;
}

/* Indicadores de métricas en modal */
.ui-modal__body .stats {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(130px, 1fr));
    gap: 12px;
    margin-bottom: 16px;
}
.ui-modal__body .stat {
    background: var(--surface-2);
    border: 1px solid var(--border);
    border-radius: 12px;
    padding: 12px 16px;
    position: relative;
    overflow: hidden;
    box-shadow: none;
    transition: transform .15s ease, border-color .15s ease;
}
.ui-modal__body .stat:hover {
    transform: translateY(-2px);
    border-color: var(--primary-soft);
}
.ui-modal__body .stat::before {
    content: "";
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 3px;
    background: linear-gradient(90deg, var(--primary), var(--secondary));
}
.ui-modal__body .stat__value {
    font-size: 20px;
    font-weight: 800;
    color: var(--text);
    line-height: 1.2;
    display: block;
}
.ui-modal__body .stat__label {
    font-size: 12px;
    font-weight: 600;
    color: var(--text-muted);
    margin-top: 4px;
    display: block;
}

/* Notas, pasos y avisos en modal */
.ui-modal__body .note {
    background: var(--surface-2);
    border: 1px solid var(--border);
    border-left: 4px solid var(--primary);
    border-radius: 10px;
    padding: 12px 16px;
    margin: 14px 0;
    font-size: 13px;
    line-height: 1.5;
    display: flex;
    align-items: flex-start;
    gap: 10px;
}
.ui-modal__body .note--warn {
    background: #fffdf5;
    border-color: #fef3c7;
    border-left-color: #f59e0b;
    color: #92400e;
}
.ui-modal__body .steps {
    margin: 10px 0 0;
    padding: 0;
    list-style: none;
    display: flex;
    flex-direction: column;
    gap: 8px;
    counter-reset: step-counter;
}
.ui-modal__body .steps li {
    position: relative;
    padding-left: 32px;
    font-size: 13.5px;
    line-height: 1.5;
    color: var(--text);
}
.ui-modal__body .steps li::before {
    counter-increment: step-counter;
    content: counter(step-counter);
    position: absolute;
    left: 0;
    top: 1px;
    width: 22px;
    height: 22px;
    border-radius: 50%;
    background: var(--primary-soft);
    color: var(--primary-dark);
    font-size: 11px;
    font-weight: 700;
    display: flex;
    align-items: center;
    justify-content: center;
}
.ui-modal__body .form-section {
    font-size: 12px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: .06em;
    color: var(--text-muted);
    margin: 20px 0 10px;
    border-bottom: 1px dashed var(--border);
    padding-bottom: 6px;
}
.ui-modal__body .mono {
    font-family: ui-monospace, SFMono-Regular, "Cascadia Code", Consolas, monospace;
    font-size: 12px;
    background: var(--surface);
    border: 1px solid var(--border);
    padding: 2px 7px;
    border-radius: 6px;
    color: var(--primary-dark);
    display: inline-block;
}

/* Formularios dentro del modal */
.ui-modal__body .form-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 16px 20px;
    margin-bottom: 0;
}
.ui-modal__body .form-grid--single {
    grid-template-columns: 1fr;
    max-width: 100%;
}
.ui-modal__body .field.is-wide,
.ui-modal__body .form-grid > .is-wide,
.ui-modal__body .form-grid > .field:has(textarea),
.ui-modal__body .form-grid > .field:has(.perms) {
    grid-column: 1 / -1;
}
.ui-modal__body > .alert:first-child { margin-top: 0; }

/* Pie del modal */
.ui-modal__foot {
    display: flex;
    align-items: center;
    justify-content: flex-end;
    gap: 12px;
    padding: 16px 28px;
    border-top: 1px solid var(--border);
    background: var(--surface-2);
    border-radius: 0 0 20px 20px;
    flex-shrink: 0;
}
.ui-modal__foot:empty { display: none; }
.ui-modal__foot .form-actions {
    display: flex;
    align-items: center;
    justify-content: flex-end;
    gap: 12px;
    width: 100%;
    margin: 0;
    padding: 0;
    border: 0;
}
.ui-modal__foot .btn {
    min-height: 42px;
    padding: 9px 20px;
    font-size: 14px;
    font-weight: 600;
    border-radius: 10px;
}

.ui-modal__loading {
    padding: 60px 0;
    text-align: center;
    color: var(--text-muted);
    font-size: 15px;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
}

body.ui-modal-open { overflow: hidden; }

/* Menú de acciones desplegable (...) */
.actmenu { position: relative; display: inline-flex; vertical-align: middle; }
.actmenu__list {
    position: absolute;
    right: 0;
    top: calc(100% + 6px);
    z-index: 100;
    min-width: 200px;
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: 14px;
    box-shadow: 0 16px 36px -4px rgba(16, 42, 51, 0.2), 0 4px 12px rgba(16, 42, 51, 0.08);
    padding: 6px;
    animation: ui-pop .14s var(--ease);
}
.actmenu__list[hidden] { display: none; }
.actmenu__item {
    display: flex;
    align-items: center;
    gap: 10px;
    width: 100%;
    padding: 9px 12px;
    border: 0;
    border-radius: 8px;
    background: none;
    color: var(--text);
    font: inherit;
    font-size: 13.5px;
    font-weight: 500;
    text-align: left;
    text-decoration: none !important;
    cursor: pointer;
    transition: background .12s ease, color .12s ease;
}
.actmenu__item:hover { background: var(--surface-2); color: var(--primary-dark); }
.actmenu__item--danger { color: var(--danger); }
.actmenu__item--danger:hover { background: var(--danger-soft); color: var(--danger); }
.actmenu__item .ico { width: 16px; height: 16px; color: var(--text-muted); }
.actmenu__item--danger .ico { color: var(--danger); }

/* ---------------------------------------------------------- 9. SweetAlert2 */
.swal2-popup {
    border-radius: 18px !important;
    font-family: inherit !important;
    padding: 1.6em 1.4em 1.4em !important;
}
.swal2-title { font-size: 20px !important; color: var(--text) !important; }
.swal2-html-container { color: var(--text-muted) !important; font-size: 14.5px !important; }
.swal2-actions { gap: 8px; }
.swal2-styled { border-radius: 10px !important; font-weight: 600 !important; padding: .62em 1.3em !important; }
.swal2-styled:focus { box-shadow: var(--ring) !important; }
.swal2-toast { border-radius: 14px !important; box-shadow: var(--shadow-lg) !important; }

/* -------------------------------------------- 10. Login y paginas sin sesion */
body.admin--centered {
    background:
        radial-gradient(1200px 600px at 110% -10%, rgba(18, 181, 160, .35), transparent 60%),
        radial-gradient(900px 500px at -10% 110%, rgba(14, 124, 147, .45), transparent 60%),
        linear-gradient(135deg, var(--primary-deep), #041f28);
}

.card--auth {
    border: 0;
    border-radius: 22px;
    padding: 34px 32px 28px;
    box-shadow: 0 30px 70px rgba(0, 0, 0, .35);
    animation: ui-rise .35s var(--ease);
}
.card--auth .card__brand { display: flex; justify-content: center; margin-bottom: 10px; }
.card--auth .card__brand .brand { flex-direction: column; text-align: center; gap: 8px; }
.card--auth .card__brand .brand__text { align-items: center; }
.card--auth .brand__logo { width: 260px; max-width: 100%; }
.card--auth .brand__name { font-size: 13px; color: var(--text-muted); font-weight: 600; letter-spacing: .04em; }

.field__toggle {
    background: var(--surface-2);
    color: var(--primary-dark);
    border: 1px solid var(--border);
    border-radius: 8px;
    font-weight: 600;
    font-size: 12.5px;
}
.field__toggle:hover { background: var(--primary-soft); }
.card--auth .brand__mark {
    width: 52px;
    height: 52px;
    border-radius: 16px;
    background: linear-gradient(135deg, var(--secondary), var(--primary));
    box-shadow: 0 10px 22px rgba(18, 181, 160, .35);
    font-size: 20px;
}
.card--auth .card__title { text-align: center; font-size: 22px; font-weight: 800; }
.card--auth .card__lead  { text-align: center; color: var(--text-muted); }
.card--auth .btn--primary { min-height: 46px; font-size: 15px; }
.card--auth .card__note { text-align: center; color: var(--text-muted); }

.centered .card--error { border-radius: 22px; box-shadow: 0 30px 70px rgba(0, 0, 0, .35); }

/* -------------------------------------------------- 11. Responsive y movimiento */
@media (max-width: 1024px) {
    .main { padding: 22px 18px 40px; }
    .sidebar { box-shadow: 16px 0 40px rgba(5, 46, 59, .35); }
    .toolbar { padding: 12px 16px; }
    /* Aqui aparece la «×» del menu: el logotipo solo, sin el rotulo al lado. */
    .sidebar .brand__name { display: none; }
}

@media (max-width: 768px) {
    .toolbar {
        flex-direction: column;
        align-items: stretch;
    }
    .toolbar .filters {
        width: 100%;
    }
    .filters__search {
        max-width: none;
        width: 100%;
    }
    .toolbar > .btn,
    .toolbar > .btn--primary,
    .toolbar > .toolbar__actions {
        margin-left: 0;
        width: 100%;
        justify-content: center;
    }
}

@media (max-width: 640px) {
    .main { padding: 16px 12px 32px; }
    .topbar { padding: 0 12px; }
    .topbar__crumb { display: none; }

    .ui-modal { padding: 0; align-items: stretch; }
    .ui-modal__dialog,
    .ui-modal--lg .ui-modal__dialog,
    .ui-modal--xl .ui-modal__dialog { max-width: none; max-height: none; min-height: 100%; border-radius: 0; }
    .ui-modal__foot { border-radius: 0; position: sticky; bottom: 0; }

    .form-grid { grid-template-columns: 1fr !important; }

    .dt-container .dt-layout-row { flex-direction: column; align-items: stretch; gap: 10px; }
    .dt-container .dt-search input { min-width: 0; width: 100%; }
    .dt-container .dt-layout-cell { justify-content: flex-start !important; }

    /* En la vista de tarjetas la cabecera no se usa: la pone `data-label`. */
    table.dataTable thead { display: none; }

    .card--auth { padding: 26px 20px 22px; border-radius: 18px; }
}

@keyframes ui-fade { from { opacity: 0; } to { opacity: 1; } }
@keyframes ui-rise { from { opacity: 0; transform: translateY(14px) scale(.985); } to { opacity: 1; transform: none; } }
@keyframes ui-pop  { from { opacity: 0; transform: translateY(-4px) scale(.98); } to { opacity: 1; transform: none; } }
@keyframes ui-spin { to { transform: rotate(360deg); } }

@media (prefers-reduced-motion: reduce) {
    .ui-modal, .ui-modal__dialog, .actmenu__list, .dropdown, .card--auth { animation: none; }
    .stat:hover, a.module:hover, .act:hover { transform: none; }
}
