/*
 * Tema del sistema anterior (AdminLTE skin-blue-light + hoja «convenios») aplicado a TODA la aplicación.
 * Se carga al final de <head>, así que sobrescribe los componentes de layouts/base y layouts/google-admin
 * (.panel, .barra, .boton, tablas, formularios, menú lateral y cabecera) sin tocar cada vista.
 * Los colores salen de las vistas originales: azul #2c6ecb, azul oscuro #1f2d3d, cabecera #3c8dbc.
 */
:root, :root:not([data-theme="light"]) {
    color-scheme: light;
    --fondo: #ecf0f5; --tarjeta: #fff; --texto: #333; --suave: #777; --acento: #2c6ecb; --acento-fondo: #e7f0fd; --acento-texto: #2c6ecb;
    --error: #dd4b39; --ok: #00a65a; --aviso: #f39c12; --borde: #e2e8f0; --hover: #f5f9ff; --sombra: 0 1px 3px rgba(0, 0, 0, .05);
    --fuente: "Source Sans Pro", "Helvetica Neue", Helvetica, Arial, sans-serif; --mono: Consolas, "Courier New", monospace;
}
@media (prefers-color-scheme: dark) {
    :root, :root:not([data-theme="light"]) {
        color-scheme: light;
        --fondo: #ecf0f5; --tarjeta: #fff; --texto: #333; --suave: #777; --acento: #2c6ecb; --acento-fondo: #e7f0fd; --acento-texto: #2c6ecb;
        --error: #dd4b39; --ok: #00a65a; --aviso: #f39c12; --borde: #e2e8f0; --hover: #f5f9ff; --sombra: 0 1px 3px rgba(0, 0, 0, .05);
    }
    button, .boton { color: #fff; }
    .secundario, .peligro { color: inherit; }
}
body { font-size: 14px; line-height: 1.42857; }
a { color: #2c6ecb; }
a:hover { color: #1f4e94; text-decoration: none; }
h1 { font-size: 18px; font-weight: 600; color: #1f2d3d; }
h2 { font-size: 16px; font-weight: 600; color: #1f2d3d; }
code { background: #f4f4f4; color: #c7254e; border-radius: 3px; }

/* Paneles: tarjeta blanca y, si abre con barra de título, cabecera oscura como el cb-panel-header. */
.panel { background: #fff; border: 1px solid #e2e8f0; border-radius: 4px; box-shadow: 0 1px 3px rgba(0, 0, 0, .05); padding: 20px; }
.panel > .barra:first-child { background: #1f2d3d; color: #fff; margin: -20px -20px 18px; padding: 13px 20px; border-radius: 3px 3px 0 0; }
.panel > .barra:first-child h1, .panel > .barra:first-child h2 { color: #fff; margin: 0; font-size: 17px; }
.panel > .barra:first-child .pill { background: rgba(255, 255, 255, .22); color: #fff; }
.panel > .barra:first-child .boton, .panel > .barra:first-child button, .panel > .barra:first-child .secundario, .panel > .barra:first-child .peligro {
    margin: 0; background: rgba(255, 255, 255, .14); border: 1px solid rgba(255, 255, 255, .3); color: #fff;
}
.panel > .barra:first-child .boton:hover, .panel > .barra:first-child button:hover { background: rgba(255, 255, 255, .26); color: #fff; box-shadow: none; filter: none; }
.panel > .barra:first-child a { color: #fff; }
.panel > h1:first-child, .panel > h2:first-child { margin-top: 0; }

/* Botones (cb-btn-*) */
button, .boton { margin-top: 0; padding: 6px 12px; font-size: 13px; font-weight: 500; border-radius: 4px; background: #2c6ecb; border: 1px solid #2c6ecb; color: #fff; line-height: 1.4; gap: 5px; }
button:hover, .boton:hover { background: #245aa6; border-color: #245aa6; color: #fff; filter: none; box-shadow: none; }
.secundario { background: #fff; color: #334155; border-color: #cbd5e1; }
.secundario:hover { background: #f1f5f9; border-color: #94a3b8; color: #1f2d3d; }
.peligro { background: #fff; color: #c0392b; border-color: #f1c6c1; }
.peligro:hover { background: #fdf1f1; border-color: #e6a8a1; color: #a93226; }
form button[type=submit]:not(.secundario):not(.peligro) { margin-top: 12px; }
td button, td .boton { padding: 3px 9px; font-size: 12px; }

/* Formularios (cb-label, form-control input-sm) */
label { font-size: 11.5px; font-weight: 600; letter-spacing: .02em; text-transform: uppercase; color: #5a6472; margin: 12px 0 4px; }
input:not([type=checkbox]):not([type=radio]):not([type=file]), select, textarea { padding: 5px 10px; font-size: 13px; border: 1px solid #d2d6de; border-radius: 3px; background: #fff; color: #333; }
input:not([type=checkbox]):not([type=radio]):not([type=file]), select { height: 32px; }
input:focus, select:focus, textarea:focus { outline: none; border-color: #2c6ecb; box-shadow: 0 0 0 2px rgba(44, 110, 203, .15); }
.checks label, label:has(> input[type=checkbox]), label:has(> input[type=radio]) { text-transform: none; font-weight: 400; letter-spacing: 0; color: #333; font-size: 13px; }

/* Tablas (table table-hover cb-table) */
table { font-size: 13px; }
th { background: #f7f9fb; color: #5a6472; font-size: 12px; font-weight: 600; padding: 9px 8px; border-bottom: 2px solid #e2e8f0; }
td { padding: 8px; border-bottom: 0; border-top: 1px solid #eef0f2; }
tbody tr:hover { background: #f5f9ff; }
thead tr:hover { background: transparent; }

/* Etiquetas y avisos */
.pill { background: #eef1f4; color: #5a6472; border-radius: 10px; font-family: inherit; font-size: 11.5px; font-weight: 600; padding: 1px 9px; }
p.error, p.ok { padding: 10px 14px; border-radius: 4px; border: 1px solid transparent; margin: 0 0 12px; font-size: 13px; }
p.error { background: #fdf1f1; border-color: #f1c6c1; color: #a93226; }
p.ok { background: #e8f6ee; border-color: #c3e6d0; color: #137333; }
.filtros { gap: 12px 16px; }

/* Menú lateral (skin-blue-light): fondo claro, borde izquierdo en el activo, iconos FontAwesome */
.lateral { background: #f9fafc; border-right: 1px solid #d2d6de; }
.marca { height: 50px; background: #3c8dbc; color: #fff; border-bottom: 0; padding: 0 16px; font-size: 19px; font-weight: 300; letter-spacing: .3px; }
.marca-logo { background: #fff; color: #3c8dbc; border-radius: 3px; width: 26px; height: 26px; }
.grupo-titulo { background: #f9fafc; color: #848484; font-size: 12px; font-weight: 400; letter-spacing: 0; text-transform: none; padding: 10px 16px 6px; }
.item { height: 40px; margin: 0; padding: 0 14px; border-radius: 0; border-left: 3px solid transparent; color: #444; font-size: 14px; gap: 10px; }
.item:hover { background: #f4f4f5; color: #3c8dbc; }
.item.activo { background: #f4f4f5; color: #3c8dbc; border-left-color: #3c8dbc; font-weight: 600; }
.item .fa { width: 20px; flex: none; text-align: center; font-size: 15px; }
.item .flecha-sub { display: none; }
.item[data-padre]::after { content: "\f104"; font-family: FontAwesome; margin-left: auto; transition: transform .2s; }
.padre.abierto > .item[data-padre]::after { transform: rotate(-90deg); }
.padre .sub { background: #f4f4f5; padding: 0; }
.subitem { margin: 0; padding: 0 14px 0 42px; border-radius: 0; line-height: 30px; font-size: 13px; color: #777; }
.subitem::before { content: "\f10c"; font-family: FontAwesome; font-size: 8px; background: none; width: auto; height: auto; left: 22px; top: 0; margin: 0; opacity: .8; line-height: 30px; }
.subitem:hover { background: #f4f4f5; color: #3c8dbc; }
.subitem.activo { background: #f4f4f5; color: #3c8dbc; font-weight: 600; }

/* Cabecera (skin-blue-light): barra azul con el buscador y el menú de usuario */
.superior { height: 50px; background: #3c8dbc; border-bottom: 0; color: #fff; }
.superior .icono { color: #fff; width: 40px; height: 40px; border-radius: 0; font-size: 18px; }
.superior .icono:hover { background: rgba(0, 0, 0, .1); }
.buscador input#buscar-global { height: 34px; border-radius: 3px; background: rgba(255, 255, 255, .2); border-color: transparent; color: #fff; padding-left: 38px; }
.buscador input#buscar-global::placeholder { color: rgba(255, 255, 255, .8); }
.buscador input#buscar-global:focus { background: #fff; color: #333; border-color: #fff; box-shadow: none; }
.buscador .fa-search { position: absolute; left: 12px; top: 10px; color: rgba(255, 255, 255, .85); pointer-events: none; }
.buscador input#buscar-global:focus ~ .fa-search { color: #777; }
.resultados { border-radius: 3px; box-shadow: 0 6px 12px rgba(0, 0, 0, .175); }
.resultados a { border-radius: 0; }
.avatar { background: #fff; color: #3c8dbc; border-radius: 50%; width: 30px; height: 30px; font-size: .8rem; font-weight: 700; }
.usuario summary, .idiomas summary { color: #fff; }
.idiomas summary { border-color: rgba(255, 255, 255, .45); border-radius: 3px; height: 30px; color: #fff; }
.idiomas summary:hover { background: rgba(0, 0, 0, .1); }
.usuario-menu, .idiomas-menu { border-radius: 3px; box-shadow: 0 6px 12px rgba(0, 0, 0, .175); color: #333; }
.idiomas-menu a { border-radius: 0; color: #333; }
.trabajo { padding: 20px; }

/* Acceso y páginas sin menú */
.caja { border-radius: 4px; box-shadow: 0 1px 3px rgba(0, 0, 0, .1); }

/* Iconos FontAwesome incrustados (x-icono) */
i.ico { display: inline-block; line-height: 1; text-align: center; vertical-align: -.125em; }

.superior .icono, .superior button.icono { background: transparent; border: 0; color: #fff; }
.superior .icono:hover { background: rgba(0, 0, 0, .1); }

.acceso-idioma .idiomas summary { color: #555; border-color: #ced4da; }
.acceso-idioma .idiomas summary:hover { background: #f4f4f4; }
