/* Fichaje Guapos — Atlántico: tinta azul profunda, océano y amarillo retama */
:root {
  --ink: #12263a;
  --ink-2: #1c3550;
  --bg: #f2f5f7;
  --surface: #ffffff;
  --surface-2: #f6f8fa;
  --text: #12263a;
  --muted: #5c6c7b;
  --line: #e1e7ec;
  --brand: #0b6e8f;
  --brand-strong: #075873;
  --brand-soft: #e2f1f6;
  --on-brand: #ffffff;
  --retama: #e9b824;
  --retama-soft: #fdf4d8;
  --ok: #138a5e;    --ok-soft: #e0f3ea;
  --warn: #b77400;  --warn-soft: #fcf0d9;
  --danger: #c0392b; --danger-soft: #fbe6e3;
  --c-vac: #2f6fd0;  --c-vac-soft: #e5eefb;
  --c-libre: #7c4dcc; --c-libre-soft: #efe8fb;
  --c-guardia: #c98100; --c-guardia-soft: #fcefd6;
  --c-asunto: #0e8f86; --c-asunto-soft: #dcf3f1;
  --c-enf: #a8285c;  --c-enf-soft: #ffd8e8;  --c-enf-dot: #f7a1c0;   /* enfermo: rosa claro */
  --c-cumple: #3d6a0a; --c-cumple-soft: #daf7a6; --c-cumple-dot: #a3e635; /* cumpleaños: verde limón */
  --festivo-bg: #fbe3e0;   /* festivo: rojo */
  --r-lg: 22px; --r-md: 14px; --r-sm: 10px;
  --shadow-1: 0 1px 0 rgba(18, 38, 58, .04), 0 8px 24px -12px rgba(18, 38, 58, .18);
  --font-ui: "Figtree", system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  --font-display: "Sora", "Figtree", system-ui, sans-serif;
  --safe-b: env(safe-area-inset-bottom, 0px);
  color-scheme: light;
}
@media (prefers-color-scheme: dark) {
  :root {
    --bg: #0c1824;
    --surface: #13212f;
    --surface-2: #182a3b;
    --text: #e7eef4;
    --muted: #93a5b5;
    --line: #23384b;
    --brand: #4fb3d4;
    --brand-strong: #7cc9e2;
    --brand-soft: #143447;
    --on-brand: #04202c;
    --retama-soft: #3a3012;
    --ok: #4cc795;    --ok-soft: #12352a;
    --warn: #f0b24a;  --warn-soft: #3a2b10;
    --danger: #f08a7e; --danger-soft: #3d1c19;
    --c-vac: #7aa8f0;  --c-vac-soft: #182a47;
    --c-libre: #b18ef0; --c-libre-soft: #2a1f45;
    --c-guardia: #f0b24a; --c-guardia-soft: #3a2b10;
    --c-asunto: #4fd0c4; --c-asunto-soft: #0f3532;
    --c-enf: #ffb6d3;  --c-enf-soft: #4a2336;  --c-enf-dot: #f7a1c0;
    --c-cumple: #c4f26b; --c-cumple-soft: #2c3d0e; --c-cumple-dot: #a3e635;
    --festivo-bg: #3d1c19;
    --shadow-1: 0 1px 0 rgba(0,0,0,.3);
    color-scheme: dark;
  }
}

* { box-sizing: border-box; }
html, body { margin: 0; }
body {
  font-family: var(--font-ui);
  background: var(--bg);
  color: var(--text);
  font-size: 16px;
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
  -webkit-tap-highlight-color: transparent;
}
button, input, select, textarea { font: inherit; color: inherit; }
a { color: var(--brand); text-underline-offset: 3px; }
h1, h2, h3 { font-family: var(--font-display); letter-spacing: -.02em; line-height: 1.2; margin: 0; }
h1 { font-size: 1.625rem; font-weight: 600; }
h2 { font-size: 1.125rem; font-weight: 600; }
h3 { font-size: 1rem; font-weight: 600; }
p { margin: 0; }
.muted { color: var(--muted); }
.small { font-size: .875rem; }
.xs { font-size: .8125rem; }
.num { font-variant-numeric: tabular-nums; }
.hidden { display: none !important; }
:focus-visible { outline: 3px solid color-mix(in srgb, var(--brand) 45%, transparent); outline-offset: 2px; border-radius: 6px; }
svg.i { width: 22px; height: 22px; flex: none; stroke: currentColor; fill: none; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }

/* ---------- estructura ---------- */
.shell { min-height: 100dvh; display: grid; grid-template-columns: 1fr; }
.content { min-width: 0; padding-bottom: calc(84px + var(--safe-b)); }
main { width: 100%; padding: 8px 18px 32px; }
main.narrow { max-width: 680px; margin: 0 auto; }

.mtop {
  position: sticky; top: 0; z-index: 20;
  display: flex; align-items: center; gap: 12px;
  padding: 12px 18px; padding-top: max(12px, env(safe-area-inset-top));
  background: color-mix(in srgb, var(--bg) 88%, transparent);
  backdrop-filter: saturate(1.4) blur(14px); -webkit-backdrop-filter: saturate(1.4) blur(14px);
}
.mtop .who { flex: 1; min-width: 0; line-height: 1.2; }
.mtop .who strong { display: block; font-family: var(--font-display); font-weight: 600; letter-spacing: -.01em; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.mtop .who span { font-size: .8125rem; color: var(--muted); }
.avatar {
  width: 38px; height: 38px; border-radius: 50%; flex: none;
  display: grid; place-items: center;
  background: var(--ink); color: #fff; font-weight: 700; font-size: .875rem; letter-spacing: .02em;
}
.icon-btn {
  width: 40px; height: 40px; border-radius: 50%; border: 0; background: transparent; color: var(--muted);
  display: grid; place-items: center; cursor: pointer;
}
.icon-btn:hover { background: var(--surface-2); color: var(--text); }

/* Barra inferior (móvil) */
.bottombar {
  position: fixed; left: 0; right: 0; bottom: 0; z-index: 30;
  display: flex; justify-content: space-around;
  padding: 6px 6px calc(6px + var(--safe-b));
  background: color-mix(in srgb, var(--surface) 94%, transparent);
  backdrop-filter: blur(16px); -webkit-backdrop-filter: blur(16px);
  border-top: 1px solid var(--line);
}
.bottombar a {
  position: relative; flex: 1; max-width: 96px;
  display: flex; flex-direction: column; align-items: center; gap: 2px;
  padding: 6px 2px; border-radius: 14px;
  color: var(--muted); text-decoration: none; font-size: .6875rem; font-weight: 600;
}
.bottombar a .pill { display: grid; place-items: center; width: 52px; height: 30px; border-radius: 999px; transition: background .2s; }
.bottombar a.active { color: var(--brand-strong); }
.bottombar a.active .pill { background: var(--brand-soft); }
.badge {
  min-width: 18px; height: 18px; padding: 0 5px; border-radius: 999px;
  background: var(--danger); color: #fff; font-size: .6875rem; font-weight: 700;
  display: inline-grid; place-items: center; line-height: 1;
}
.bottombar .badge { position: absolute; top: 2px; right: calc(50% - 26px); }

/* Barra lateral (escritorio) */
.sidebar { display: none; }
@media (min-width: 960px) {
  .shell { grid-template-columns: 252px 1fr; }
  .content { padding-bottom: 0; }
  main { padding: 36px 40px 56px; }
  .mtop, .bottombar { display: none; }
  .sidebar {
    position: sticky; top: 0; height: 100dvh;
    display: flex; flex-direction: column; gap: 4px;
    padding: 26px 16px 18px;
    background: var(--ink); color: #c9d6e2;
  }
  .sidebar .brand { display: flex; align-items: center; gap: 12px; padding: 0 10px 26px; color: #fff; }
  .sidebar .brand b { font-family: var(--font-display); font-weight: 600; font-size: 1.0625rem; letter-spacing: -.02em; }
  .sidebar a.nav {
    display: flex; align-items: center; gap: 12px;
    padding: 10px 12px; border-radius: 12px;
    color: #c9d6e2; text-decoration: none; font-weight: 500;
  }
  .sidebar a.nav:hover { background: var(--ink-2); color: #fff; }
  .sidebar a.nav.active { background: #fff; color: var(--ink); font-weight: 600; }
  .sidebar a.nav .badge { margin-left: auto; }
  .sidebar .me { margin-top: auto; display: flex; align-items: center; gap: 10px; padding: 14px 8px 0; border-top: 1px solid var(--ink-2); }
  .sidebar .me .avatar { background: var(--retama); color: var(--ink); }
  .sidebar .me > div:not(.avatar) { flex: 1; min-width: 0; line-height: 1.25; }
  .sidebar .me strong { display: block; color: #fff; font-weight: 600; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
  .sidebar .me span { font-size: .8125rem; }
  .sidebar .icon-btn { color: #c9d6e2; }
  .sidebar .icon-btn:hover { background: var(--ink-2); color: #fff; }
}
.mark {
  width: 36px; height: 36px; border-radius: 11px; flex: none;
  display: grid; place-items: center; background: var(--retama); color: var(--ink);
}
.mark svg { width: 22px; height: 22px; stroke: currentColor; fill: none; stroke-width: 2.2; stroke-linecap: round; }

/* ---------- cabeceras de página ---------- */
.page-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; flex-wrap: wrap; margin: 6px 0 20px; }
.page-head p { margin-top: 2px; }
.section { margin-top: 28px; }
.section > .head { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-bottom: 12px; flex-wrap: wrap; }

.panel {
  background: var(--surface); border-radius: var(--r-lg);
  box-shadow: var(--shadow-1); padding: 20px;
}
.panel + .panel { margin-top: 14px; }
.panel.flush { padding: 6px 0; }
@media (min-width: 960px) { .panel { padding: 24px; } }

.row { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.row.between { justify-content: space-between; }
/* Dos columnas del mismo alto: cada una lleva su cabecera y su cuadro, y el cuadro rellena el espacio */
.grid-2 { display: grid; gap: 14px 20px; }
.grid-2 > * { min-width: 0; }
.grid-2 > .panel + .panel { margin-top: 0; }
@media (min-width: 860px) { .grid-2 { grid-template-columns: 1fr 1fr; align-items: stretch; } }
.col { display: flex; flex-direction: column; min-width: 0; }
.col > .head { display: flex; align-items: center; justify-content: space-between; gap: 12px; flex-wrap: wrap; min-height: 40px; margin-bottom: 12px; }
.col > .panel { flex: 1; }
.col > .panel + .panel { margin-top: 0; }

/* ---------- botones ---------- */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  min-height: 42px; padding: 0 18px; border-radius: 999px;
  border: 1px solid var(--line); background: var(--surface); color: var(--text);
  font-weight: 600; font-size: .9375rem; text-decoration: none; cursor: pointer;
  transition: background .15s, border-color .15s, transform .1s;
}
.btn:hover { border-color: color-mix(in srgb, var(--brand) 40%, var(--line)); }
.btn:active { transform: scale(.98); }
.btn:disabled { opacity: .55; cursor: not-allowed; transform: none; }
.btn.primary { background: var(--brand); border-color: var(--brand); color: var(--on-brand); }
.btn.primary:hover { background: var(--brand-strong); }
.btn.ink { background: var(--ink); border-color: var(--ink); color: #fff; }
.btn.danger { background: var(--danger); border-color: var(--danger); color: #fff; }
.btn.danger-ghost { color: var(--danger); border-color: color-mix(in srgb, var(--danger) 30%, var(--line)); }
.btn.ghost { background: transparent; border-color: transparent; color: var(--muted); }
.btn.ghost:hover { background: var(--surface-2); color: var(--text); }
.btn.sm { min-height: 34px; padding: 0 14px; font-size: .875rem; }
.btn.block { width: 100%; }
.btn svg.i { width: 18px; height: 18px; }

/* Selector segmentado */
.seg { display: inline-flex; padding: 4px; gap: 2px; border-radius: 999px; background: var(--surface-2); border: 1px solid var(--line); flex-wrap: wrap; }
.seg a, .seg button, .seg label {
  border: 0; background: transparent; cursor: pointer;
  padding: 7px 14px; border-radius: 999px; color: var(--muted); font-weight: 600; font-size: .875rem; text-decoration: none;
  display: inline-flex; align-items: center; gap: 6px;
}
.seg .active, .seg input:checked + span { background: var(--surface); color: var(--text); box-shadow: 0 1px 3px rgba(18,38,58,.12); }
.seg label { padding: 0; }
.seg label span { padding: 8px 16px; border-radius: 999px; }
.seg input { position: absolute; opacity: 0; pointer-events: none; }
.seg.full { display: flex; }
.seg.full > * { flex: 1; justify-content: center; }
.seg.full label span { width: 100%; text-align: center; }

.month-nav { display: inline-flex; align-items: center; gap: 4px; }
.month-nav .label { min-width: 132px; text-align: center; font-weight: 600; }
.month-nav .icon-btn { width: 36px; height: 36px; color: var(--text); }
.month-nav .icon-btn:disabled { opacity: .3; cursor: default; background: none; }

/* ---------- formularios ---------- */
.field { margin-bottom: 14px; }
.field > label, .label-text { display: block; font-size: .875rem; font-weight: 600; margin-bottom: 6px; }
input[type=text], input[type=password], input[type=number], input[type=date], input[type=datetime-local], select, textarea {
  width: 100%; min-height: 46px; padding: 10px 14px;
  border: 1px solid var(--line); border-radius: var(--r-md);
  background: var(--surface); outline: none;
}
textarea { min-height: 84px; resize: vertical; }
input:focus, select:focus, textarea:focus { border-color: var(--brand); box-shadow: 0 0 0 4px color-mix(in srgb, var(--brand) 16%, transparent); }
.fields-2 { display: grid; gap: 0 12px; grid-template-columns: 1fr; }
@media (min-width: 520px) { .fields-2 { grid-template-columns: 1fr 1fr; } }
.check { display: flex; align-items: center; gap: 10px; font-weight: 500; cursor: pointer; }
.check input { width: 20px; height: 20px; accent-color: var(--brand); }
.days { display: flex; gap: 6px; flex-wrap: wrap; }
.days label { cursor: pointer; }
.days input { position: absolute; opacity: 0; }
.days span {
  display: grid; place-items: center; width: 42px; height: 42px; border-radius: 50%;
  border: 1px solid var(--line); font-weight: 600; color: var(--muted);
}
.days input:checked + span { background: var(--ink); border-color: var(--ink); color: #fff; }
.days input:focus-visible + span { outline: 3px solid color-mix(in srgb, var(--brand) 45%, transparent); }
.error { color: var(--danger); background: var(--danger-soft); padding: 10px 14px; border-radius: var(--r-sm); font-size: .9rem; margin: 0 0 12px; }
.help { font-size: .8125rem; color: var(--muted); margin-top: 6px; }

/* ---------- etiquetas ---------- */
.tag {
  display: inline-flex; align-items: center; gap: 6px;
  padding: 3px 10px; border-radius: 999px;
  background: var(--surface-2); color: var(--muted);
  font-size: .75rem; font-weight: 600; white-space: nowrap; vertical-align: middle;
}
.tag::before { content: ""; width: 6px; height: 6px; border-radius: 50%; background: currentColor; }
.tag.plain::before { display: none; }
.tag.ok { background: var(--ok-soft); color: var(--ok); }
.tag.warn { background: var(--warn-soft); color: var(--warn); }
.tag.danger { background: var(--danger-soft); color: var(--danger); }
.tag.brand { background: var(--brand-soft); color: var(--brand-strong); }
.tag.vacaciones { background: var(--c-vac-soft); color: var(--c-vac); }
.tag.libre_eleccion { background: var(--c-libre-soft); color: var(--c-libre); }
.tag.guardia { background: var(--c-guardia-soft); color: var(--c-guardia); }
.tag.asunto_familiar { background: var(--c-asunto-soft); color: var(--c-asunto); }
.tag.enfermo { background: var(--c-enf-soft); color: var(--c-enf); }
.tag.cumpleanos { background: var(--c-cumple-soft); color: var(--c-cumple); }
.tag.cumpleanos::before { display: none; }
.tag.festivo { background: var(--festivo-bg); color: var(--danger); }
.tag svg.i, .chip svg.i { width: 14px; height: 14px; margin-right: -2px; }

.st { display: inline-flex; align-items: center; gap: 8px; font-weight: 600; font-size: .875rem; }
.st::before { content: ""; width: 9px; height: 9px; border-radius: 50%; background: var(--muted); }
.st-trabajando { color: var(--ok); } .st-trabajando::before { background: var(--ok); box-shadow: 0 0 0 4px var(--ok-soft); }
.st-pausa { color: var(--warn); } .st-pausa::before { background: var(--warn); box-shadow: 0 0 0 4px var(--warn-soft); }
.st-fuera { color: var(--muted); }

/* ---------- Fichar: la esfera ---------- */
.clock { text-align: center; padding: 8px 0 4px; }
.clock .date { color: var(--muted); font-size: .9375rem; }
.dial { position: relative; width: min(78vw, 290px); aspect-ratio: 1; margin: 18px auto 10px; }
.dial svg { width: 100%; height: 100%; transform: rotate(-90deg); }
.dial .track { stroke: var(--line); }
.dial .prog { stroke: var(--brand); transition: stroke-dashoffset .8s cubic-bezier(.2,.8,.2,1); }
.dial.st-trabajando .prog { stroke: var(--ok); }
.dial.st-pausa .prog { stroke: var(--warn); }
.dial .over { stroke: var(--retama); }
.dial .center { position: absolute; inset: 0; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 4px; }
.dial .time { font-family: var(--font-display); font-weight: 300; font-size: clamp(3.2rem, 15vw, 4.25rem); letter-spacing: -.05em; line-height: 1; font-variant-numeric: tabular-nums; }
.dial .sub { color: var(--muted); font-size: .875rem; }
.clock-actions { display: grid; gap: 10px; max-width: 420px; margin: 14px auto 0; }
.clock-actions.two { grid-template-columns: 1fr 1fr; }
.btn.huge { min-height: 60px; font-size: 1.0625rem; border-radius: 20px; }
.btn.huge.start { background: var(--brand); border-color: var(--brand); color: var(--on-brand); }
.btn.huge.pause { background: var(--warn-soft); border-color: transparent; color: var(--warn); }
.btn.huge.resume { background: var(--ok); border-color: var(--ok); color: #fff; }
.btn.huge.exit { background: var(--ink); border-color: var(--ink); color: #fff; }
@media (prefers-color-scheme: dark) { .btn.huge.exit { background: #e7eef4; color: var(--ink); border-color: #e7eef4; } }
.day-notes { display: flex; gap: 8px; justify-content: center; flex-wrap: wrap; margin-top: 12px; }

.figures { display: grid; grid-template-columns: repeat(auto-fit, minmax(120px, 1fr)); gap: 18px 14px; }
.fig .v { font-family: var(--font-display); font-size: 1.5rem; font-weight: 500; letter-spacing: -.03em; font-variant-numeric: tabular-nums; line-height: 1.15; }
.fig .l { font-size: .8125rem; color: var(--muted); margin-top: 2px; }
.fig .v.pos { color: var(--ok); }
.fig .v.neg { color: var(--danger); }
.pos { color: var(--ok); } .neg { color: var(--danger); }

/* Línea de tiempo de fichajes */
.tl { list-style: none; margin: 0; padding: 0; }
.tl li { position: relative; display: grid; grid-template-columns: 56px 1fr auto; align-items: center; gap: 10px; padding: 9px 0; }
.tl li + li::before { content: ""; position: absolute; left: 27px; top: -9px; height: 18px; border-left: 2px dotted var(--line); }
.tl .t { font-weight: 700; font-variant-numeric: tabular-nums; }
.tl .k { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.dot { width: 10px; height: 10px; border-radius: 50%; display: inline-block; flex: none; }
.dot.entrada { background: var(--ok); } .dot.pausa { background: var(--warn); } .dot.reanudar { background: var(--brand); } .dot.salida { background: var(--ink); }
@media (prefers-color-scheme: dark) { .dot.salida { background: var(--text); } }

/* Listas */
.list { list-style: none; margin: 0; padding: 0; }
.list > li { padding: 14px 0; border-top: 1px solid var(--line); }
.list > li:first-child { border-top: 0; }
.panel.flush .list > li { padding-left: 20px; padding-right: 20px; }

/* Día a día */
.day { display: grid; grid-template-columns: 48px 1fr auto; gap: 12px; padding: 14px 0; border-top: 1px solid var(--line); }
.day:first-child { border-top: 0; }
.day .date { text-align: center; line-height: 1.1; }
.day .date .n { font-family: var(--font-display); font-size: 1.375rem; font-weight: 500; }
.day .date .w { font-size: .75rem; color: var(--muted); font-weight: 600; }
.day .total { text-align: right; font-weight: 700; font-variant-numeric: tabular-nums; }
.day .tags { display: flex; gap: 6px; flex-wrap: wrap; margin-bottom: 4px; }
.day .tl li { padding: 5px 0; grid-template-columns: 50px 1fr auto; }
.day .tl li + li::before { left: 24px; top: -5px; height: 10px; }
.day.today .date .n { color: var(--brand); }
.nota-admin { margin: 2px 0 6px 60px; padding: 8px 12px; border-radius: var(--r-sm); background: var(--surface-2); font-size: .8125rem; color: var(--muted); }
.nota-admin div + div { margin-top: 4px; }

/* Tablas */
.table-wrap { overflow-x: auto; margin: 0 -20px; }
table { width: 100%; border-collapse: collapse; font-size: .9375rem; }
th, td { padding: 12px 20px; text-align: left; border-bottom: 1px solid var(--line); white-space: nowrap; }
th { font-size: .8125rem; color: var(--muted); font-weight: 600; }
tbody tr:last-child td { border-bottom: 0; }
td.r, th.r { text-align: right; font-variant-numeric: tabular-nums; }
tr.clickable { cursor: pointer; }
tr.clickable:hover td { background: var(--surface-2); }
tr.dim td { opacity: .55; }
.person { display: flex; align-items: center; gap: 12px; }
.person .avatar { width: 34px; height: 34px; font-size: .75rem; background: var(--brand-soft); color: var(--brand-strong); }
.person strong { display: block; }
@media (max-width: 720px) { .hide-sm { display: none; } }

/* Tarjetas de persona (panel en móvil) */
.people { display: grid; gap: 10px; }
@media (min-width: 720px) { .people { display: none; } .people + .table-wrap { display: block; } }
@media (max-width: 719px) { .people + .table-wrap { display: none; } }
.person-card { display: grid; grid-template-columns: auto 1fr auto; gap: 12px; align-items: center; padding: 14px 0; border-top: 1px solid var(--line); cursor: pointer; }
.person-card:first-child { border-top: 0; }
.person-card .avatar { width: 40px; height: 40px; background: var(--brand-soft); color: var(--brand-strong); }
.person-card .r { text-align: right; font-variant-numeric: tabular-nums; font-weight: 700; }

/* Avisos */
.notice { display: flex; gap: 12px; align-items: flex-start; padding: 14px 16px; border-radius: var(--r-md); background: var(--brand-soft); color: var(--brand-strong); margin-bottom: 14px; font-size: .9375rem; }
.notice.warn { background: var(--warn-soft); color: var(--warn); }
.notice svg.i { width: 20px; height: 20px; margin-top: 1px; }
.notice a { color: inherit; font-weight: 700; }

/* Estado vacío */
.empty { text-align: center; padding: 26px 10px; color: var(--muted); }
.empty svg.i { width: 34px; height: 34px; color: var(--line); margin-bottom: 6px; }

/* Cuadrante */
.legend { display: flex; flex-wrap: wrap; gap: 8px; }
.cal { display: grid; grid-template-columns: repeat(7, 1fr); gap: 4px; }
.cal .wd { text-align: center; font-size: .75rem; font-weight: 700; color: var(--muted); padding: 4px 0 6px; }
.cal .c {
  min-height: 62px; padding: 6px; border-radius: 12px; background: var(--surface-2);
  border: 2px solid transparent; cursor: pointer; text-align: left; display: flex; flex-direction: column; gap: 4px;
  font: inherit; color: inherit;
}
.cal .c.out { visibility: hidden; }
.cal .c.fest { background: var(--festivo-bg); }
.cal .c.sel { border-color: var(--brand); }
.cal .c.today .n { background: var(--ink); color: #fff; }
.cal .n { font-weight: 700; font-size: .8125rem; width: 24px; height: 24px; border-radius: 50%; display: grid; place-items: center; }
.cal .dots { display: flex; flex-wrap: wrap; gap: 3px; }
.cal .dots .dot { width: 8px; height: 8px; }
.cal .chips { display: none; }
.dot.vacaciones { background: var(--c-vac); } .dot.libre_eleccion { background: var(--c-libre); } .dot.guardia { background: var(--c-guardia); }
.dot.asunto_familiar { background: var(--c-asunto); } .dot.enfermo { background: var(--c-enf-dot); } .dot.cumpleanos { background: var(--c-cumple-dot); }
@media (min-width: 960px) {
  .cal { gap: 6px; }
  .cal .c { min-height: 112px; padding: 8px; cursor: default; }
  .cal .dots { display: none; }
  .cal .chips { display: flex; flex-direction: column; gap: 3px; }
  .cal .chip { font-size: .75rem; font-weight: 600; padding: 2px 7px; border-radius: 6px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
  .cal .chip.vacaciones { background: var(--c-vac-soft); color: var(--c-vac); }
  .cal .chip.libre_eleccion { background: var(--c-libre-soft); color: var(--c-libre); }
  .cal .chip.guardia { background: var(--c-guardia-soft); color: var(--c-guardia); }
  .cal .chip.asunto_familiar { background: var(--c-asunto-soft); color: var(--c-asunto); }
  .cal .chip.enfermo { background: var(--c-enf-soft); color: var(--c-enf); }
  .cal .chip.cumpleanos { background: var(--c-cumple-soft); color: var(--c-cumple); }
  .cal .chip svg.i { vertical-align: -2px; margin-right: 3px; }
  .cal .fname { font-size: .6875rem; color: var(--danger); font-weight: 600; line-height: 1.2; }
  .cal-detail { display: none; }
}
.cal .fname { display: none; }
@media (min-width: 960px) { .cal .fname { display: block; } }

/* Contadores de vacaciones */
.counter { display: grid; grid-template-columns: repeat(4, 1fr); gap: 8px; }
@media (max-width: 420px) { .counter { grid-template-columns: repeat(2, 1fr); gap: 16px 8px; } }
.big-left { display: flex; align-items: baseline; gap: 10px; }
.big-left .v { font-family: var(--font-display); font-size: 3rem; font-weight: 300; letter-spacing: -.05em; line-height: 1; }
.bar { height: 8px; border-radius: 999px; background: var(--surface-2); overflow: hidden; display: flex; margin: 14px 0 16px; }
.bar i { display: block; height: 100%; }
.bar .a { background: var(--c-vac); } .bar .p { background: color-mix(in srgb, var(--c-vac) 40%, transparent); }

/* ---------- autenticación ---------- */
.auth {
  min-height: 100dvh; display: grid; place-items: center; padding: 24px;
  background:
    radial-gradient(1200px 500px at 50% 115%, color-mix(in srgb, var(--brand) 22%, transparent), transparent 60%),
    var(--bg);
}
.auth-box { width: 100%; max-width: 400px; }
.auth-brand { display: flex; flex-direction: column; align-items: center; gap: 14px; margin-bottom: 26px; text-align: center; }
.auth-brand .mark { width: 60px; height: 60px; border-radius: 18px; }
.auth-brand .mark svg { width: 34px; height: 34px; }
.auth-brand h1 { font-size: 1.75rem; }
.auth .panel { padding: 26px; }

/* ---------- modal ---------- */
dialog#modal {
  border: 0; padding: 0; width: min(560px, 100%); max-height: 92dvh;
  border-radius: 24px; background: var(--surface); color: var(--text);
  box-shadow: 0 30px 80px -20px rgba(12, 24, 36, .45);
}
dialog#modal::backdrop { background: rgba(12, 24, 36, .5); backdrop-filter: blur(3px); }
@media (max-width: 600px) {
  dialog#modal { margin: auto 0 0; width: 100%; max-width: 100%; border-radius: 24px 24px 0 0; }
  dialog#modal[open] { animation: subir .28s cubic-bezier(.2,.8,.2,1); }
}
@keyframes subir { from { transform: translateY(40px); opacity: .4; } to { transform: none; opacity: 1; } }
.modal-body { padding: 24px 22px 8px; overflow-y: auto; max-height: calc(92dvh - 90px); }
.modal-body h2 { margin-bottom: 16px; font-size: 1.25rem; }
.modal-actions { display: flex; gap: 8px; justify-content: flex-end; flex-wrap: wrap; padding: 12px 22px calc(18px + var(--safe-b)); border-top: 1px solid var(--line); }
.modal-actions .left { margin-right: auto; }

.toast {
  position: fixed; left: 50%; bottom: calc(96px + var(--safe-b)); transform: translateX(-50%);
  z-index: 100; max-width: calc(100% - 32px);
  padding: 12px 18px; border-radius: 14px; background: var(--ink); color: #fff;
  font-weight: 500; box-shadow: 0 14px 40px -10px rgba(12,24,36,.5);
  animation: aparecer .25s ease-out;
}
@media (min-width: 960px) { .toast { bottom: 28px; } }
@keyframes aparecer { from { opacity: 0; transform: translate(-50%, 10px); } }

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation: none !important; transition: none !important; }
}

/* Avisos */
.icon-btn.bell { position: relative; color: var(--text); }
.icon-btn.bell.on { background: var(--brand-soft); color: var(--brand-strong); }
.icon-btn.bell .badge { position: absolute; top: 0; right: -2px; }
.aviso {
  display: grid; grid-template-columns: auto 1fr auto; gap: 12px; align-items: start;
  padding: 14px 16px; border-radius: var(--r-md); margin-bottom: 12px;
  background: var(--surface); box-shadow: var(--shadow-1); border-left: 4px solid var(--muted);
}
.aviso.danger { border-left-color: var(--danger); grid-template-columns: auto 1fr; }
.aviso.ok { border-left-color: var(--ok); }
.aviso.warn { border-left-color: var(--warn); }
.aviso-ic { width: 34px; height: 34px; border-radius: 50%; display: grid; place-items: center; background: var(--surface-2); }
.aviso.danger .aviso-ic { background: var(--danger-soft); color: var(--danger); }
.aviso.ok .aviso-ic { background: var(--ok-soft); color: var(--ok); }
.aviso.warn .aviso-ic { background: var(--warn-soft); color: var(--warn); }
.aviso-ic svg.i { width: 18px; height: 18px; }
.aviso-txt { min-width: 0; font-size: .9375rem; }
.aviso-txt strong { display: block; margin-bottom: 2px; }
.aviso-dias { list-style: none; margin: 8px 0 0; padding: 0; }
.aviso-dias li { display: flex; justify-content: space-between; gap: 10px; flex-wrap: wrap; padding: 6px 0; border-top: 1px solid var(--line); font-size: .875rem; }
.aviso-dias li span:last-child { color: var(--danger); font-weight: 600; }

/* Separador del menú lateral y menú "Más" */
.nav-sep { border: 0; border-top: 1px solid var(--ink-2); margin: 8px 10px; }
.menu-mas a { display: flex; align-items: center; gap: 14px; padding: 4px 2px; color: var(--text); text-decoration: none; font-weight: 600; }
.menu-mas a .badge { margin-left: auto; }

.panel.flush .table-wrap { margin: 0; }
.panel.flush th:first-child, .panel.flush td:first-child { padding-left: 20px; }
@media (min-width: 960px) { main.narrow { margin: 0 auto; } }

/* Mismas columnas en todos los grupos de Empleados */
@media (min-width: 721px) {
  .tbl-emp { table-layout: fixed; min-width: 760px; }
  .tbl-emp th:nth-child(1) { width: 30%; } .tbl-emp th:nth-child(2) { width: 12%; } .tbl-emp th:nth-child(3) { width: 13%; }
  .tbl-emp th:nth-child(4) { width: 19%; } .tbl-emp th:nth-child(5) { width: 14%; } .tbl-emp th:nth-child(6) { width: 12%; }
  .tbl-emp td { overflow: hidden; text-overflow: ellipsis; }
  .tbl-emp td.r { overflow: visible; text-overflow: clip; }
}

@media (max-width: 720px) {
  .panel.flush th, .panel.flush td { padding-left: 12px; padding-right: 12px; }
  .tbl-emp td.r .btn { padding: 0 10px; }
}

/* ======================================================================
   Alineación unificada: mismos espacios en todas las pantallas
   ====================================================================== */
:root { --pad: 20px; --head-h: 44px; }
@media (min-width: 960px) { :root { --pad: 24px; } }

/* Cabecera de página: el título siempre en el mismo sitio y los controles de su derecha centrados con él */
.page-head { align-items: flex-start; min-height: 68px; margin: 0 0 4px; }
.page-head h1 { line-height: 40px; }
.page-head p { margin-top: 0; line-height: 1.4; }
.page-head > .btn { height: 40px; min-height: 40px; }
.page-head .month-nav { min-height: 40px; }

/* Cabecera de sección: mismo alto y misma separación con su cuadro */
.head, .section > .head, .col > .head { display: flex; align-items: center; justify-content: space-between; gap: 12px; flex-wrap: wrap; min-height: var(--head-h); margin-bottom: 8px; }
.seg { padding: 3px; }
.page-head + .section, .notice + .section, .page-head + .grid-2 { margin-top: 0; }

/* Dos columnas exactamente iguales */
@media (min-width: 860px) { .grid-2 { grid-template-columns: repeat(2, minmax(0, 1fr)); } }

/* Cuadros y tablas con el mismo margen interior: las líneas de las tablas llegan justo al borde del cuadro */
.panel { padding: var(--pad); }
.panel.flush { padding: 6px 0; }
.table-wrap { margin: 0 calc(var(--pad) * -1); }
th, td { padding: 12px var(--pad); }
.panel.flush .table-wrap { margin: 0; }
.panel.flush .list > li { padding-left: var(--pad); padding-right: var(--pad); }
.panel.flush th:first-child, .panel.flush td:first-child { padding-left: var(--pad); }
.panel.flush th:last-child, .panel.flush td:last-child { padding-right: var(--pad); }
@media (max-width: 720px) {
  .panel.flush th, .panel.flush td { padding-left: 10px; padding-right: 10px; }
  .panel.flush th:first-child, .panel.flush td:first-child { padding-left: var(--pad); }
  .panel.flush th:last-child, .panel.flush td:last-child { padding-right: var(--pad); }
}
html { scrollbar-gutter: stable; }
/* Las listas largas de las columnas (festivos, guardias…) se desplazan dentro de su cuadro para no estirar al de al lado */
.col > .panel.flush { max-height: 420px; overflow-y: auto; }

/* Avisos: aviso del administrador y lista de días con su botón */
.aviso.brand { border-left-color: var(--brand); }
.aviso.brand .aviso-ic { background: var(--brand-soft); color: var(--brand-strong); }
.aviso-dias li.aviso-dia { align-items: center; }
.aviso-dias li.aviso-dia > div { min-width: 0; }
.aviso:not(.danger):has(.aviso-dias) { grid-template-columns: auto 1fr; }

/* Panel: encabezados de grupo (Trabajando, En descanso, Ausentes, Fuera de jornada) */
tr.grupo td { background: var(--surface-2); font-size: .8125rem; font-weight: 600; color: var(--muted); padding-top: 8px; padding-bottom: 8px; }
tr.grupo td span, .grupo-titulo span { margin-left: 6px; padding: 1px 8px; border-radius: 999px; background: var(--surface); color: var(--text); font-weight: 600; }
.grupo-titulo { margin: 14px 0 2px; padding: 0 2px; font-size: .8125rem; font-weight: 600; color: var(--muted); }
.grupo-titulo:first-child { margin-top: 0; }

/* Ayudas vacías (sin texto) no ocupan sitio */
.help:empty { display: none; }

/* ---------- Colores de los estados (Cuadrante y etiquetas), iguales en claro y oscuro ---------- */
.tag.festivo, .cal .chip.festivo { background: #FEE2E2; color: #B91C1C; }
.tag.guardia, .cal .chip.guardia { background: #FFEDD5; color: #C2410C; }
.tag.vacaciones, .cal .chip.vacaciones { background: #DCFCE7; color: #15803D; }
.tag.libre_eleccion, .cal .chip.libre_eleccion { background: #EDE9FE; color: #6D28D9; }
.tag.asunto_familiar, .cal .chip.asunto_familiar { background: #DBEAFE; color: #1D4ED8; }
.tag.enfermo, .cal .chip.enfermo { background: #E5E7EB; color: #4B5563; }
.tag.cumpleanos, .cal .chip.cumpleanos { background: #FEF3C7; color: #A16207; }
.dot.guardia { background: #C2410C; } .dot.vacaciones { background: #15803D; } .dot.libre_eleccion { background: #6D28D9; }
.dot.asunto_familiar { background: #1D4ED8; } .dot.enfermo { background: #4B5563; } .dot.cumpleanos { background: #A16207; }
.cal .c.fest { background: #FEE2E2; color: #1f2937; }
.cal .fname { color: #B91C1C; }
