/* ============================================================
   SGA — estilo.css
   Login, navbar, sidebar, contenido y tarjetas.

   Los colores son los de UNISAN, a proposito: es el sistema que
   el cliente ya conoce y la idea es que este se sienta el mismo.

     #438eb9  azul primario    — navbar, botones, acentos
     #2e7da6  azul oscuro      — hover, marca del navbar
     #2b3d51  encabezados      — titulos de tarjeta
     #222a2d  menu lateral
     #122d4e  fondo del login
     #f7f8fa  fondo del contenido
   ============================================================ */

*, *::before, *::after { box-sizing: border-box; }

body {
    margin: 0;
    font-family: "Segoe UI", "Open Sans", "Helvetica Neue", Helvetica, Arial, sans-serif;
    font-size: 13px;
    color: #333;
    background: #f7f8fa;
}

a { text-decoration: none; color: #438eb9; }
a:hover { color: #2e7da6; }
/* Bootstrap subraya al pasar el mouse; aqui no se usa. */
a:hover, a:focus { text-decoration: none; }


/* ============================================================
   LOGIN
   ============================================================ */

body.pagina-login {
    background: #122d4e;
    display: flex;
    align-items: center;
    justify-content: center;
    min-height: 100vh;
    padding: 20px;
}

.login-caja {
    width: 100%;
    max-width: 380px;
    background: #fff;
    border-radius: 4px;
    overflow: hidden;
    box-shadow: 0 4px 24px rgba(0,0,0,.45);
}

.login-encabezado {
    padding: 28px 28px 20px;
    border-bottom: 3px solid #438eb9;
    text-align: center;
}

.login-encabezado .marca {
    font-size: 30px;
    font-weight: 700;
    letter-spacing: 3px;
    color: #2b3d51;
    line-height: 1;
}

.login-encabezado p {
    margin: 10px 0 0;
    font-size: 12.5px;
    color: #888;
}

.login-cuerpo { padding: 26px 28px 22px; }

.campo-icono {
    display: flex;
    margin-bottom: 14px;
    border: 1px solid #ccc;
    border-radius: 3px;
    overflow: hidden;
}

.campo-icono i {
    background: #438eb9;
    color: #fff;
    width: 40px;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    font-size: 14px;
}

.campo-icono input {
    flex: 1;
    border: 0;
    padding: 0 12px;
    height: 40px;
    font-size: 14px;
    outline: none;
    min-width: 0;
}

.campo-icono:focus-within {
    border-color: #438eb9;
    box-shadow: 0 0 6px rgba(67,142,185,.45);
}

.btn-login {
    width: 100%;
    height: 40px;
    background: #438eb9;
    border: 1px solid #2e7da6;
    color: #fff;
    font-size: 15px;
    letter-spacing: .5px;
    border-radius: 3px;
    cursor: pointer;
    transition: background .2s;
}
.btn-login:hover  { background: #2e7da6; }
.btn-login:active { background: #256d93; }

.login-pie {
    padding: 12px 28px 20px;
    text-align: center;
    font-size: 11.5px;
    color: #aaa;
}

.aviso {
    padding: 10px 12px;
    border-radius: 3px;
    font-size: 12.5px;
    margin-bottom: 16px;
    border: 1px solid;
}
.aviso-error   { background: #fdf3f2; border-color: #d9534f; color: #a94442; }
.aviso-ok      { background: #f2f8f2; border-color: #5cb85c; color: #3c763d; }
.aviso-atencion{ background: #fdf6e3; border-color: #f0ad4e; color: #8a5a00; }


/* ============================================================
   NAVBAR
   ============================================================ */

#navbar {
    background: #438eb9;
    height: 45px;
    display: flex;
    align-items: center;
    position: fixed;
    top: 0; left: 0; right: 0;
    z-index: 1000;
    box-shadow: 0 1px 4px rgba(0,0,0,.25);
}

#navbar .marca {
    background: #2e7da6;
    width: 220px;
    height: 45px;
    display: flex;
    align-items: center;
    padding: 0 20px;
    color: #fff;
    font-size: 19px;
    font-weight: 700;
    letter-spacing: 2px;
    flex-shrink: 0;
    transition: width .25s ease;
}

#plegar {
    background: none;
    border: 0;
    color: #fff;
    font-size: 17px;
    padding: 0 14px;
    height: 45px;
    cursor: pointer;
}
#plegar:hover { background: rgba(0,0,0,.15); }

.navbar-empresa {
    color: #d8ecf7;
    font-size: 12.5px;
    padding: 0 14px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}
.navbar-empresa i { opacity: .8; margin-right: 5px; }

.navbar-derecha {
    margin-left: auto;
    display: flex;
    align-items: center;
    height: 45px;
}

.navbar-derecha a {
    color: #fff;
    padding: 0 13px;
    height: 45px;
    display: flex;
    align-items: center;
    gap: 7px;
    font-size: 12.5px;
}
.navbar-derecha a:hover { background: rgba(0,0,0,.15); color: #fff; }

.navbar-derecha img {
    width: 28px; height: 28px;
    border-radius: 50%;
    border: 2px solid rgba(255,255,255,.5);
}


/* ============================================================
   MENU LATERAL
   ============================================================ */

#lateral {
    width: 220px;
    background: #222a2d;
    position: fixed;
    top: 45px; bottom: 0; left: 0;
    overflow-y: auto;
    overflow-x: hidden;
    z-index: 900;
    transition: width .25s ease;
    scrollbar-width: thin;
    scrollbar-color: #3a4a50 #222a2d;
}
#lateral::-webkit-scrollbar { width: 4px; }
#lateral::-webkit-scrollbar-track { background: #222a2d; }
#lateral::-webkit-scrollbar-thumb { background: #3a4a50; border-radius: 2px; }

.lateral-usuario {
    background: #1a2226;
    padding: 14px 12px;
    display: flex;
    align-items: center;
    gap: 10px;
    border-bottom: 1px solid #2e3a3f;
}
.lateral-usuario img {
    width: 38px; height: 38px;
    border-radius: 50%;
    border: 2px solid #438eb9;
    object-fit: cover;
    flex-shrink: 0;
}
.lateral-usuario .datos { overflow: hidden; }
.lateral-usuario .nom {
    color: #cde; font-size: 13px; font-weight: 600;
    white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.lateral-usuario .rol { color: #6a8a9a; font-size: 11px; white-space: nowrap; }

/* El logo de la empresa, en el mismo recuadro: 220 x 66 px (10:3).
   El alto es el del bloque del usuario (14 + 38 + 14), para que el
   menu no salte de lugar entre una empresa con logo y una sin. */
.lateral-logo {
    height: 67px;
    background: #fff;
    border-bottom: 1px solid #2e3a3f;
    display: flex;
    align-items: center;
    justify-content: center;
    overflow: hidden;
}
.lateral-logo img {
    max-width: 100%;
    max-height: 66px;
    object-fit: contain;
}

.lateral-grupo {
    color: #4a6672;
    font-size: 10px;
    font-weight: 700;
    letter-spacing: 1px;
    text-transform: uppercase;
    padding: 14px 14px 4px;
    white-space: nowrap;
}

.lateral-nav { list-style: none; padding: 6px 0 24px; margin: 0; }
.lateral-nav li { position: relative; }

.lateral-nav > li > a {
    display: flex;
    align-items: center;
    gap: 10px;
    color: #9baab1;
    padding: 10px 14px;
    font-size: 13px;
    white-space: nowrap;
    overflow: hidden;
    transition: background .15s, color .15s;
}
.lateral-nav > li > a:hover,
.lateral-nav > li.activo > a {
    background: #2e3a3f;
    color: #e0eef5;
}
.lateral-nav > li.activo > a { border-left: 3px solid #438eb9; padding-left: 11px; }
.lateral-nav i { width: 16px; text-align: center; flex-shrink: 0; }

.flecha { margin-left: auto; font-size: 11px; transition: transform .2s; }
.flecha.abierta { transform: rotate(180deg); }

.submenu { list-style: none; margin: 0; padding: 0; display: none; background: #1a2226; }
.submenu.abierto { display: block; }
.submenu a {
    display: flex;
    align-items: center;
    gap: 9px;
    color: #8a9ba3;
    padding: 8px 14px 8px 32px;
    font-size: 12.5px;
}
.submenu a:hover { color: #e0eef5; background: #2e3a3f; }
.submenu a.activo { color: #fff; background: #2e3a3f; }
.submenu i { font-size: 7px; }


/* ============================================================
   CONTENIDO
   ============================================================ */

#envoltorio { padding-top: 45px; }

#contenido {
    margin-left: 220px;
    padding: 16px 20px 40px;
    min-height: calc(100vh - 45px);
    transition: margin-left .25s ease;
}

.barra-titulo {
    display: flex;
    align-items: center;
    justify-content: space-between;
    flex-wrap: wrap;
    gap: 8px;
    padding-bottom: 12px;
    margin-bottom: 16px;
    border-bottom: 1px solid #e2e6ea;
}
.barra-titulo h1 {
    margin: 0;
    font-size: 20px;
    font-weight: 300;
    color: #2b3d51;
}
.barra-titulo h1 i { color: #438eb9; margin-right: 8px; font-size: 18px; }

.migas { list-style: none; display: flex; gap: 8px; margin: 0; padding: 0;
         font-size: 12px; color: #999; }
.migas li + li::before { content: "/"; margin-right: 8px; color: #ccc; }


/* ── Tarjetas ─────────────────────────────────────────────── */

.tarjeta {
    background: #fff;
    border: 1px solid #e2e6ea;
    border-radius: 3px;
    margin-bottom: 18px;
}
.tarjeta > h2 {
    margin: 0;
    padding: 10px 16px;
    background: #2b3d51;
    color: #fff;
    font-size: 12.5px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: .04em;
    border-radius: 3px 3px 0 0;
}
.tarjeta > h2 i { margin-right: 7px; opacity: .85; }
.tarjeta > .cuerpo { padding: 16px; }


/* ── Fichas de resumen del dashboard ──────────────────────── */

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

.ficha {
    background: #fff;
    border: 1px solid #e2e6ea;
    border-left: 3px solid #438eb9;
    border-radius: 3px;
    padding: 14px 16px;
    display: flex;
    align-items: center;
    gap: 14px;
}
.ficha i { font-size: 26px; color: #438eb9; opacity: .85; }
.ficha .valor { font-size: 22px; font-weight: 600; color: #2b3d51; line-height: 1.1; }
.ficha .texto { font-size: 11.5px; color: #888; text-transform: uppercase; letter-spacing: .04em; }

.ficha.verde   { border-left-color: #5cb85c; }
.ficha.verde i { color: #5cb85c; }
.ficha.naranja   { border-left-color: #f0ad4e; }
.ficha.naranja i { color: #f0ad4e; }
.ficha.gris   { border-left-color: #98a2ab; }
.ficha.gris i { color: #98a2ab; }


/* ── Tablas ───────────────────────────────────────────────── */

table.datos { width: 100%; border-collapse: collapse; }
table.datos th, table.datos td {
    padding: 8px 10px;
    text-align: left;
    border-bottom: 1px solid #eee;
    font-size: 12.5px;
}
table.datos th { color: #555; font-weight: 600; background: #f7f8fa; }
table.datos tr:last-child td { border-bottom: 0; }

code {
    font-family: Consolas, Monaco, monospace;
    font-size: 12px;
    color: #2b3d51;          /* Bootstrap lo pinta rosado */
    background: #f7f8fa;
    padding: 1px 5px;
    border-radius: 2px;
}

.apagado { color: #999; }
.obligatorio { color: #d9534f; }


/* ============================================================
   MANTENEDORES
   Lo que comparten las pantallas de listado + formulario:
   botones, barra de herramientas, insignias, modal, campos y
   avisos flotantes. Se arma aqui y no con Bootstrap porque el
   resto del estilo ya es propio, y traer Bootstrap entero para
   un modal lo pisaria (tipografia, tablas, margenes).
   ============================================================ */

/* ── Botones ──────────────────────────────────────────────── */
/* Los de Bootstrap (.btn .btn-primary .btn-default .btn-danger),
   con el azul del sistema en vez del de Bootstrap. */

.btn { font-size: 12.5px; border-radius: 3px; }
.btn-primary,
.btn-primary:focus             { background: #438eb9; border-color: #2e7da6; }
.btn-primary:hover,
.btn-primary:active,
.btn-primary:active:focus      { background: #2e7da6; border-color: #256d93; }
.btn .fa                       { margin-right: 3px; }

/* El boton chico de las filas de la tabla: solo el icono. */
.btn-fila {
    width: 28px;
    height: 28px;
    border: 1px solid #dde3e8;
    border-radius: 3px;
    background: #fff;
    color: #5a7385;
    cursor: pointer;
    transition: background .15s, color .15s;
}
.btn-fila:hover          { background: #438eb9; border-color: #438eb9; color: #fff; }
.btn-fila.peligro:hover  { background: #d9534f; border-color: #d9534f; }
.btn-fila:disabled       { opacity: .35; cursor: default; background: #fff; color: #5a7385; border-color: #dde3e8; }

/* ── Barra sobre la tabla ─────────────────────────────────── */

.herramientas {
    display: flex;
    align-items: center;
    gap: 10px;
    flex-wrap: wrap;
    margin-bottom: 12px;
}
.herramientas .buscar {
    margin-left: auto;
    position: relative;
}
.herramientas .buscar i {
    position: absolute;
    left: 10px; top: 50%;
    transform: translateY(-50%);
    color: #aab4bc;
}
.herramientas .buscar input {
    height: 32px;
    width: 240px;
    max-width: 100%;
    padding: 0 10px 0 30px;
    border: 1px solid #ccd3d9;
    border-radius: 3px;
    font: inherit;
}
.herramientas .buscar input:focus { outline: none; border-color: #438eb9; }

/* ── Tabla de listado ─────────────────────────────────────── */

.tabla-envoltorio { overflow-x: auto; }

table.datos.listado tbody tr:hover td { background: #f5f9fc; }
table.datos.listado td.acciones,
table.datos.listado th.acciones { width: 1%; white-space: nowrap; text-align: right; }
table.datos.listado td.centro,
table.datos.listado th.centro   { text-align: center; }
table.datos.listado tr.inactivo td { color: #aaa; }
table.datos .vacio { text-align: center; color: #999; padding: 24px 10px; }
.sub { display: block; font-size: 11.5px; color: #999; margin-top: 2px; }

/* ── Insignias ────────────────────────────────────────────── */

.insignia {
    display: inline-block;
    padding: 2px 8px;
    border-radius: 10px;
    font-size: 11px;
    line-height: 1.5;
    background: #eef1f4;
    color: #5a6872;
    white-space: nowrap;
}
.insignia.verde   { background: #e6f4e6; color: #3c763d; }
.insignia.rojo    { background: #fbeaea; color: #a94442; }
.insignia.azul    { background: #e3eff7; color: #2e6d93; }
.insignia.naranja { background: #fdf1de; color: #8a5a00; }

/* ── Modales Bootbox ──────────────────────────────────────── */
/* Los de UNISAN (modulos.css): encabezado oscuro que sirve de
   manija para arrastrar, y el dialogo oculto hasta que comun.js
   le calcula la posicion, para que no aparezca y despues salte. */

.bootbox .modal-dialog {
    position: absolute !important;
    margin: 0 !important;
    top: 60px;
    max-width: calc(100vw - 20px);
    visibility: hidden;
}
.bootbox .modal-dialog.modal-visible {
    visibility: visible !important;
    animation: modal-aparece .28s ease forwards;
}
@keyframes modal-aparece {
    0%   { opacity: 0; transform: translateY(-12px) scale(.97); }
    100% { opacity: 1; transform: translateY(0) scale(1); }
}

/* Bootstrap solo le da ancho al dialogo desde 768px; abajo de eso,
   con position absolute, se encogeria al contenido. */
.bootbox .modal-dialog            { width: 600px; }
.bootbox .modal-dialog.modal-lg   { width: 900px; }
.bootbox.modal-angosto .modal-dialog { width: 420px; }

.bootbox .modal-content { border-radius: 5px; border: 0; box-shadow: 0 8px 40px rgba(0,0,0,.35); }
.bootbox .modal-header {
    background: #2b3d51;
    border-radius: 5px 5px 0 0;
    padding: 12px 16px;
    cursor: move;
    user-select: none;
}
.bootbox .modal-title { color: #fff; font-size: 14px; font-weight: 600; }
.bootbox .modal-title .fa { margin-right: 6px; opacity: .85; }
.bootbox .modal-header .close { color: #fff; opacity: .7; text-shadow: none; margin-top: 0; }
.bootbox .modal-header .close:hover { opacity: 1; }
.bootbox .modal-body { padding: 18px 18px 6px; }
.bootbox .modal-footer { background: #fafbfc; border-radius: 0 0 5px 5px; padding: 12px 18px; }
.bootbox .modal-footer .btn { min-width: 90px; font-weight: 600; }

/* ── Campos de formulario ─────────────────────────────────── */

.campo { margin-bottom: 14px; }
.campo label {
    display: block;
    margin-bottom: 5px;
    font-weight: 600;
    font-size: 12px;
    color: #4a5a66;
}
.campo input[type=text],
.campo input[type=email],
.campo input[type=password],
.campo input[type=date],
.campo select,
.campo textarea {
    width: 100%;
    height: 34px;
    padding: 0 10px;
    border: 1px solid #ccd3d9;
    border-radius: 3px;
    font: inherit;
    font-size: 13px;
    background: #fff;
    color: #333;
}
.campo textarea { height: auto; padding: 8px 10px; resize: vertical; }
.campo input:focus,
.campo select:focus,
.campo textarea:focus {
    outline: none;
    border-color: #438eb9;
    box-shadow: 0 0 4px rgba(67,142,185,.35);
}
.campo input:disabled,
.campo select:disabled { background: #f4f6f8; color: #888; }
.campo .ayuda { display: block; margin-top: 4px; font-size: 11.5px; color: #999; }

.campo-check { margin-bottom: 14px; }
.campo-check label { display: inline-flex; align-items: center; gap: 7px; cursor: pointer; font-weight: normal; margin: 0; }
.campo-check input[type=checkbox] { margin: 0; }
.campo-check .ayuda { display: block; margin: 3px 0 0 21px; font-size: 11.5px; color: #999; }

.fila-2 {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 0 14px;
}

.separador {
    margin: 4px 0 12px;
    padding-bottom: 5px;
    border-bottom: 1px solid #eef0f2;
    font-size: 11px;
    font-weight: 700;
    letter-spacing: .05em;
    text-transform: uppercase;
    color: #8a99a5;
}

.campo-error,
.campo input.campo-error,
.campo select.campo-error {
    border-color: #d9534f !important;
    box-shadow: 0 0 4px rgba(217,83,79,.35) !important;
}

/* El telefono: el +56 es del formulario, no del dato (ver validador.js). */
.fono-grupo { display: flex; }
.fono-prefijo {
    display: flex;
    align-items: center;
    padding: 0 10px;
    border: 1px solid #ccd3d9;
    border-right: 0;
    border-radius: 3px 0 0 3px;
    background: #f4f6f8;
    color: #777;
}
.fono-grupo input { flex: 1; min-width: 0; border-radius: 0 3px 3px 0 !important; }

/* ── Avisos flotantes ─────────────────────────────────────── */
/* #validador-aviso es el que crea validador.js; .aviso-flotante
   el de comun.js. Se ven igual a proposito. */

#validador-aviso,
.aviso-flotante {
    position: fixed;
    top: 58px;
    right: 18px;
    z-index: 3000;
    max-width: 380px;
    padding: 11px 14px;
    background: #fff;
    border-left: 4px solid #d9534f;
    border-radius: 3px;
    box-shadow: 0 4px 18px rgba(0,0,0,.2);
    color: #a94442;
    font-size: 12.5px;
}
.aviso-flotante.ok { border-left-color: #5cb85c; color: #3c763d; }
#validador-aviso i,
.aviso-flotante i { margin-right: 6px; }

/* ── Logo de la empresa (formulario de Empresas) ──────────── */
/* La vista previa mide lo mismo que el recuadro del menu
   lateral (220 x 66), para ver ahi mismo como va a quedar. */

.logo-editor { display: flex; gap: 14px; align-items: flex-start; margin-bottom: 14px; }
.logo-editor .ayuda { display: block; margin-top: 6px; font-size: 11.5px; color: #999; }
.logo-vista {
    flex: 0 0 220px;
    height: 66px;
    border: 1px dashed #ccd3d9;
    background: #fff;
    display: flex;
    align-items: center;
    justify-content: center;
    color: #aaa;
    overflow: hidden;
}
.logo-vista img { max-width: 100%; max-height: 100%; object-fit: contain; }

/* ── Tabla nutricional (Articulos) ────────────────────────── */

table.datos.nutri td, table.datos.nutri th { padding: 4px 8px; vertical-align: middle; }
table.datos.nutri th .copiar { display: block; margin-top: 3px; font-size: 11px; font-weight: 400; }
table.datos.nutri input.nut {
    width: 90px;
    height: 28px;
    padding: 0 6px;
    border: 1px solid #ccd3d9;
    border-radius: 3px;
    text-align: right;
    font: inherit;
}
table.datos.nutri input.nut:focus { outline: none; border-color: #438eb9; }

/* ── Pestañas dentro de un modal ──────────────────────────── */
/* Segmentadas, como en SGJ v3: el usuario las prefiere a las
   pestañas sueltas, que en una ventana se pierden. */

.pestanas {
    display: inline-flex;
    margin-bottom: 14px;
    border: 1px solid #ccd3d9;
    border-radius: 3px;
    overflow: hidden;
}
.pestana {
    border: 0;
    border-right: 1px solid #ccd3d9;
    background: #fff;
    color: #555;
    padding: 6px 14px;
    font: inherit;
    cursor: pointer;
}
.pestana:last-child { border-right: 0; }
.pestana:hover { background: #f2f5f7; }
.pestana.activa { background: #438eb9; color: #fff; }

/* ── Raciones (Establecimientos) ──────────────────────────── */

.cantidades {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(110px, 1fr));
    gap: 0 12px;
}
table.datos.grilla-raciones td, table.datos.grilla-raciones th { padding: 3px 6px; vertical-align: middle; }
table.datos.grilla-raciones tr.fin-semana td { background: #f6f7f9; }
table.datos.grilla-raciones input.cant-dia {
    width: 64px;
    height: 26px;
    padding: 0 6px;
    border: 1px solid #dde3e8;
    border-radius: 3px;
    text-align: right;
    font: inherit;
}
table.datos.grilla-raciones input.cant-dia::placeholder { color: #b5bec6; }
table.datos.grilla-raciones input.cant-dia.propio { border-color: #f0ad4e; background: #fffaf0; font-weight: 600; }
table.datos.grilla-raciones input.cant-dia:focus { outline: none; border-color: #438eb9; }

/* ── Ingredientes de un plato y composicion de un estrato ─── */

table.datos.ingredientes td, table.datos.composicion td { padding: 4px 6px; vertical-align: middle; }
table.datos.ingredientes input.art { width: 100%; height: 30px; padding: 0 8px; border: 1px solid #ccd3d9; border-radius: 3px; font: inherit; }
table.datos.ingredientes input.gr,
table.datos.composicion input.tipo { width: 100px; height: 30px; padding: 0 8px; border: 1px solid #ccd3d9; border-radius: 3px; text-align: right; font: inherit; }
table.datos.composicion select { width: 100%; height: 30px; border: 1px solid #ccd3d9; border-radius: 3px; font: inherit; }
table.datos.ingredientes input:focus, table.datos.composicion input:focus,
table.datos.composicion select:focus { outline: none; border-color: #438eb9; }
table.datos.ingredientes + .btn, table.datos.composicion + .btn { margin-top: 8px; }

.aporte-grilla {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(150px, 1fr));
    gap: 6px;
    margin-bottom: 10px;
}
.aporte-grilla .nutri {
    display: flex;
    justify-content: space-between;
    gap: 6px;
    padding: 5px 8px;
    border: 1px solid #e2e6ea;
    border-radius: 3px;
    font-size: 12px;
}
.aporte-grilla .nutri .nombre { color: #666; }
.aporte-grilla .nutri .valor  { font-weight: 600; color: #2b3d51; white-space: nowrap; }
.aporte-grilla .nutri small   { font-weight: 400; color: #999; }
.aporte-grilla .nutri.incompleto { border-color: #f0ad4e; background: #fffaf0; }

/* ── Calendario de colaciones ─────────────────────────────── */

.filtros-calendario { align-items: flex-end; }
.filtros-calendario .campo { margin-bottom: 0; min-width: 180px; }
.filtros-calendario .campo select,
.filtros-calendario .campo input { height: 32px; }
.filtros-calendario .acciones-calendario { margin-left: auto; display: flex; gap: 8px; }

table.datos.calendario th.servicio { background: #2b3d51; color: #fff; }
table.datos.calendario th.rubro { font-weight: 600; font-size: 11.5px; }
table.datos.calendario th.rubro .fa { color: #f0ad4e; }
table.datos.calendario td, table.datos.calendario th { padding: 3px 5px; vertical-align: top; }
table.datos.calendario td.dia,
table.datos.calendario th.dia {
    position: sticky;
    left: 0;
    background: #fff;
    z-index: 1;
    white-space: nowrap;
    min-width: 80px;
}
table.datos.calendario td.dia .sub { max-width: 110px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; color: #a94442; }
table.datos.calendario select {
    display: block;
    width: 170px;
    height: 26px;
    margin-bottom: 2px;
    border: 1px solid #dde3e8;
    border-radius: 3px;
    font: inherit;
    font-size: 12px;
}
table.datos.calendario .segundo { font-size: 11px; }
table.datos.calendario tr.fin-semana td { background: #f3f5f7; }
table.datos.calendario tr.feriado td { background: #fbeaea; }

/* ── Matriz de permisos ───────────────────────────────────── */

.permisos {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(240px, 1fr));
    gap: 12px;
    margin-bottom: 12px;
}
.permisos-grupo {
    border: 1px solid #e2e6ea;
    border-radius: 3px;
}
.permisos-grupo .titulo {
    display: flex;
    align-items: center;
    gap: 7px;
    padding: 7px 10px;
    background: #f4f6f8;
    border-bottom: 1px solid #e2e6ea;
    font-weight: 600;
    color: #2b3d51;
}
.permisos-grupo .titulo .todos { margin-left: auto; font-weight: 400; font-size: 11.5px; }
.permisos-grupo label {
    font-weight: normal;
    margin: 0;
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 6px 10px;
    border-bottom: 1px solid #f2f4f6;
    cursor: pointer;
}
.permisos-grupo label:last-child { border-bottom: 0; }
.permisos-grupo label:hover { background: #f8fafc; }
.permisos-grupo label.fijo { cursor: default; color: #777; }
.permisos-grupo label .fa-lock { margin-left: auto; color: #b0bac2; }


/* ============================================================
   PLEGADO  /  PANTALLAS CHICAS
   ============================================================ */

body.plegado #lateral        { width: 50px; }
body.plegado #contenido      { margin-left: 50px; }
body.plegado #navbar .marca  { width: 50px; padding: 0; justify-content: center; font-size: 14px; }
body.plegado .lateral-usuario .datos,
body.plegado .lateral-grupo,
body.plegado .lateral-nav span,
body.plegado .flecha         { display: none; }
body.plegado .lateral-usuario { justify-content: center; padding: 10px 0; }

@media (max-width: 760px) {
    #lateral   { width: 50px; }
    #contenido { margin-left: 50px; padding: 14px; }
    #navbar .marca { width: 50px; padding: 0; justify-content: center; font-size: 14px; }
    .lateral-usuario .datos, .lateral-grupo, .lateral-nav span, .flecha { display: none; }
    .navbar-empresa { display: none; }
    .navbar-derecha .nombre-usuario { display: none; }
    .fila-2 { grid-template-columns: 1fr; }
    .herramientas .buscar { margin-left: 0; width: 100%; }
    .herramientas .buscar input { width: 100%; }
    .bootbox .modal-dialog { top: 20px; }
    .logo-editor { flex-wrap: wrap; }
}
