:root {
    --fondo: #f4f6f9;
    --barra: #1f3a52;
    --barra-texto: #c9d6e2;
    --acento: #2e7d9e;
    /* Pendientes: color fuerte */
    --novino: #e53935;
    --falta: #fb8c00;
    --menos: #fdd835;
    --imposible: #8e24aa;
    /* Resueltos: pastel muy suave */
    --ajus: #e2efda;
    --conf: #eef6ea;
    --fest: #fde9d9;
    --nolab: #eeeeee;
}

html, body { background: var(--fondo); }

.barra {
    display: flex; flex-wrap: wrap; gap: .25rem 1.25rem; align-items: center;
    padding: .6rem 1rem; background: var(--barra); color: var(--barra-texto);
}
.barra .marca { font-weight: 600; color: #fff; margin-right: 1rem; }
.barra a { color: var(--barra-texto); text-decoration: none; }
.barra a.active, .barra a:hover { color: #fff; }
.barra .usuario { margin-left: auto; }

.contenido { max-width: 1800px; margin: 0 auto; padding: 1rem; }
.contenido-solo { display: flex; justify-content: center; padding: 4rem 1rem; }
.contenido h1 { font-size: 1.5rem; margin-bottom: .75rem; }

.login-caja { width: 100%; max-width: 360px; background: #fff; padding: 2rem; border-radius: .5rem; box-shadow: 0 2px 8px rgba(0,0,0,.08); }
.login-caja h1 { font-size: 1.4rem; }

.table { background: #fff; }
.mono { font-family: ui-monospace, SFMono-Regular, Consolas, monospace; }
.corto { max-width: 7rem; }
.mini { max-width: 5rem; }
.serie { max-width: 10rem; }

/* ---- filtros y resumen ---- */
.filtros { display: flex; flex-wrap: wrap; gap: .5rem 1rem; align-items: flex-end; margin-bottom: .75rem; }
.filtros label { display: flex; flex-direction: column; font-size: .8rem; color: #555; gap: .15rem; }
.filtros label.check, label.check { flex-direction: row; align-items: center; gap: .35rem; font-size: .85rem; }
.filtros .botones { display: flex; gap: .4rem; }
.resumen { display: flex; flex-wrap: wrap; gap: .5rem 1.5rem; align-items: center; background: #fff;
           padding: .5rem 1rem; border-radius: .5rem; margin-bottom: .5rem; box-shadow: 0 1px 3px rgba(0,0,0,.06); }

/* ---- rejilla día × trabajador ---- */
.rejilla-caja { overflow: auto; max-height: calc(100vh - 260px); background: #fff; border-radius: .5rem;
                box-shadow: 0 1px 3px rgba(0,0,0,.06); }
.rejilla { border-collapse: separate; border-spacing: 0; font-size: .78rem; }
.rejilla th, .rejilla td { border-right: 1px solid #e3e6ea; border-bottom: 1px solid #e3e6ea; padding: 0 .2rem;
                           text-align: center; white-space: nowrap; }
.rejilla thead th { position: sticky; top: 0; background: #f8f9fa; z-index: 2; font-weight: 600; line-height: 1.1; padding: .2rem; }
.rejilla thead th small { font-weight: 400; color: #777; }
.rejilla th.dia.nolab { background: #ececec; }
.rejilla th.dia.fest { background: var(--fest); }
.rejilla .fija { position: sticky; background: #fff; z-index: 1; text-align: left; }
.rejilla thead .fija { z-index: 3; background: #f8f9fa; }
.rejilla .fija.id { left: 0; min-width: 3.2rem; text-align: right; padding-right: .4rem; color: #555; }
.rejilla .fija.nombre { left: 3.2rem; min-width: 14rem; max-width: 14rem; overflow: hidden; text-overflow: ellipsis; }
.rejilla .socio { display: inline-block; margin-left: .3rem; padding: 0 .25rem; font-size: .65rem; border-radius: .2rem;
                  background: var(--acento); color: #fff; }
.rejilla td.celda { min-width: 2.3rem; height: 1.6rem; cursor: pointer; }
.rejilla td.celda:hover { outline: 2px solid var(--acento); outline-offset: -2px; }
.rejilla td.celda.sel { outline: 2px solid #000; outline-offset: -2px; }
.rejilla td.tot { background: #f8f9fa; min-width: 3rem; text-align: right; padding-right: .35rem; }
.rejilla td.tot.fuerte, .rejilla th.tot.fuerte { font-weight: 700; }
.rejilla td.tot.neg { color: #c00000; }
.rejilla td.tot.pend { color: #fff; background: var(--novino); font-weight: 700; text-align: center; }

/* estados de la celda */
.fut { color: #999; }
.nolab { background: var(--nolab); }
.fest { background: var(--fest); color: #a0522d; }
.just { background: #dbe8f5; color: #345; }
.ajus { background: var(--ajus); }
.conf { background: var(--conf); color: #4a7a3a; }
.p-novino { background: var(--novino); color: #fff; font-weight: 700; }
.p-falta { background: var(--falta); color: #fff; font-weight: 700; }
.p-menos { background: var(--menos); color: #333; font-weight: 700; }
.p-imposible { background: var(--imposible); color: #fff; font-weight: 700; }

.leyenda { display: flex; flex-wrap: wrap; gap: .4rem 1rem; font-size: .8rem; margin-top: .6rem; color: #444; }
.leyenda span { display: inline-flex; align-items: center; gap: .3rem; }
.leyenda i { display: inline-block; width: 1rem; height: 1rem; border-radius: .2rem; border: 1px solid #ccc; }
.leyenda .sep { margin-left: .8rem; font-weight: 600; }

/* ---- ventana del día ---- */
.velo { position: fixed; inset: 0; background: rgba(0,0,0,.25); z-index: 50; }
.ventana-dia { position: fixed; top: 6vh; left: 50%; transform: translateX(-50%); z-index: 51;
               width: min(920px, 96vw); max-height: 88vh; overflow: auto; background: #fff;
               border-radius: .6rem; padding: 1rem 1.25rem; box-shadow: 0 8px 30px rgba(0,0,0,.25); }
.ventana-dia .cab { display: flex; justify-content: space-between; align-items: flex-start; gap: 1rem; margin-bottom: .6rem; }
.ventana-dia .estado { display: inline-block; padding: .2rem .7rem; border-radius: 1rem; font-weight: 600; margin-bottom: .5rem; border: 1px solid #ddd; }
.ventana-dia h6 { margin-top: .9rem; font-size: .9rem; color: var(--barra); }
.ventana-dia .dos-col { display: grid; grid-template-columns: 1fr 1.3fr; gap: 1.5rem; }
.ventana-dia .horas div span { display: inline-block; min-width: 10rem; color: #666; }
.ventana-dia .fila-form { display: flex; gap: .5rem; align-items: center; margin-bottom: .4rem; }
.ventana-dia .decisiones { padding-left: 1rem; font-size: .88rem; }
.ventana-dia .chip { display: inline-block; width: .8rem; height: .8rem; border-radius: .2rem; border: 1px solid #bbb; vertical-align: middle; }
.ventana-dia .pie { display: flex; justify-content: space-between; margin-top: 1rem; border-top: 1px solid #eee; padding-top: .6rem; }

/* ---- maestro ---- */
.tabla-maestro td { vertical-align: middle; }
.tabla-maestro tr.edicion td, tr.edicion td { background: #fff8e1; }
.ficha { background: #fff; border-radius: .5rem; padding: .75rem 1rem; margin-bottom: 1rem; }
.ficha span:first-child { display: inline-block; min-width: 13rem; color: #6c757d; }
.formulario { display: grid; grid-template-columns: repeat(auto-fit, minmax(260px, 1fr)); gap: .75rem; }
.formulario label { display: flex; flex-direction: column; gap: .25rem; font-size: .9rem; }

#blazor-error-ui {
    display: none; position: fixed; bottom: 0; left: 0; right: 0; z-index: 1000;
    padding: .6rem 1.25rem; background: #fff3cd; box-shadow: 0 -1px 2px rgba(0,0,0,.2);
}
#blazor-error-ui .dismiss { cursor: pointer; position: absolute; right: .75rem; top: .5rem; }

@media (max-width: 760px) {
    .ventana-dia .dos-col { grid-template-columns: 1fr; }
    .rejilla .fija.nombre { min-width: 9rem; max-width: 9rem; }
}
