/* Fichaje Las Cortes · sistema visual "tabla de mareas"
   Azules atlánticos sobre cartulina blanca. Cifras condensadas tabulares (Archivo, eje wdth). */

@font-face {
  font-family: "Archivo";
  src: url("../fonts/archivo-var.woff2") format("woff2-variations"), url("../fonts/archivo-var.woff2") format("woff2");
  font-weight: 100 900;
  font-stretch: 62% 125%;
  font-display: swap;
}

:root {
  color-scheme: light;
  --abyss: oklch(0.26 0.07 252);
  --abyss-2: oklch(0.31 0.08 253);
  --deep: oklch(0.38 0.12 254);
  --sea: oklch(0.5 0.16 255);
  --sea-strong: oklch(0.44 0.16 255);
  --sea-soft: oklch(0.93 0.035 245);
  --wave: oklch(0.72 0.11 242);
  --shallow: oklch(0.87 0.06 238);
  --foam: oklch(0.968 0.013 240);
  --paper: oklch(1 0 0);
  --paper-2: oklch(0.985 0.008 240);
  --ink: oklch(0.24 0.045 254);
  --ink-2: oklch(0.42 0.045 254);
  --ink-3: oklch(0.52 0.035 254);
  --on-dark: oklch(0.97 0.012 240);
  --on-dark-2: oklch(0.82 0.04 245);
  --rule: oklch(0.89 0.025 245);
  --rule-strong: oklch(0.8 0.04 245);
  --alga: oklch(0.55 0.12 162);
  --alga-soft: oklch(0.94 0.04 162);
  --alga-ink: oklch(0.38 0.09 162);
  --sand: oklch(0.82 0.13 80);
  --sand-soft: oklch(0.96 0.05 85);
  --sand-ink: oklch(0.45 0.1 65);
  --buoy: oklch(0.55 0.19 30);
  --buoy-soft: oklch(0.95 0.035 30);
  --buoy-ink: oklch(0.47 0.17 30);
  --sun: oklch(0.86 0.15 88);
  --violet: oklch(0.55 0.14 295);
  --violet-soft: oklch(0.95 0.03 295);
  --teal: oklch(0.58 0.09 200);
  --teal-soft: oklch(0.95 0.025 200);
  --rose: oklch(0.6 0.13 10);
  --rose-soft: oklch(0.95 0.03 10);
  --slate-soft: oklch(0.94 0.012 250);

  --font: "Archivo", "Avenir Next", "Segoe UI", sans-serif;
  --fs-xs: 0.8125rem;
  --fs-sm: 0.875rem;
  --fs-md: 1rem;
  --fs-lg: 1.125rem;
  --fs-xl: 1.375rem;
  --fs-2xl: 1.75rem;
  --fs-3xl: 2.25rem;
  --s1: 4px; --s2: 8px; --s3: 12px; --s4: 16px; --s5: 24px; --s6: 32px; --s7: 48px; --s8: 64px;
  --r-sm: 8px; --r-md: 12px; --r-lg: 18px; --r-xl: 26px; --r-pill: 999px;
  --shadow-1: 0 1px 2px oklch(0.26 0.07 252 / 0.06), 0 2px 6px -2px oklch(0.26 0.07 252 / 0.08);
  --shadow-2: 0 2px 4px oklch(0.26 0.07 252 / 0.05), 0 14px 32px -16px oklch(0.26 0.07 252 / 0.32);
  --shadow-3: 0 8px 18px -6px oklch(0.26 0.07 252 / 0.25), 0 28px 60px -28px oklch(0.26 0.07 252 / 0.45);
  --ease-out: cubic-bezier(0.16, 1, 0.3, 1);
  --ease-in-out: cubic-bezier(0.65, 0, 0.35, 1);
  --t-fast: 140ms;
  --t-mid: 220ms;
  --t-slow: 420ms;
  --rail-w: 252px;
  --tabbar-h: 64px;
  --safe-b: env(safe-area-inset-bottom, 0px);
  --focus: 0 0 0 3px var(--paper), 0 0 0 5px var(--sea);
  --on-sea: oklch(1 0 0);
  --on-buoy: oklch(1 0 0);
  --on-alga: oklch(1 0 0);
  --exit-bg: var(--abyss);
  --exit-fg: oklch(0.98 0.005 240);
}

@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    color-scheme: dark;
    --abyss: oklch(0.15 0.035 256);
    --abyss-2: oklch(0.2 0.045 256);
    --deep: oklch(0.72 0.1 248);
    --sea: oklch(0.7 0.14 250);
    --sea-strong: oklch(0.76 0.13 248);
    --sea-soft: oklch(0.3 0.06 252);
    --wave: oklch(0.52 0.12 250);
    --shallow: oklch(0.36 0.08 252);
    --foam: oklch(0.175 0.03 256);
    --paper: oklch(0.215 0.035 256);
    --paper-2: oklch(0.24 0.035 256);
    --ink: oklch(0.95 0.012 240);
    --ink-2: oklch(0.82 0.025 245);
    --ink-3: oklch(0.72 0.03 245);
    --rule: oklch(0.31 0.035 255);
    --rule-strong: oklch(0.4 0.04 255);
    --alga: oklch(0.72 0.13 162);
    --alga-soft: oklch(0.3 0.05 162);
    --alga-ink: oklch(0.86 0.09 162);
    --sand: oklch(0.82 0.13 80);
    --sand-soft: oklch(0.32 0.05 80);
    --sand-ink: oklch(0.88 0.1 85);
    --buoy: oklch(0.7 0.16 30);
    --buoy-soft: oklch(0.3 0.06 30);
    --buoy-ink: oklch(0.86 0.09 30);
    --violet-soft: oklch(0.3 0.05 295);
    --teal-soft: oklch(0.3 0.04 200);
    --rose-soft: oklch(0.3 0.05 10);
    --slate-soft: oklch(0.28 0.02 250);
    --shadow-1: 0 1px 2px oklch(0 0 0 / 0.3);
    --shadow-2: 0 2px 4px oklch(0 0 0 / 0.25), 0 16px 36px -18px oklch(0 0 0 / 0.6);
    --shadow-3: 0 10px 24px -8px oklch(0 0 0 / 0.5), 0 30px 60px -30px oklch(0 0 0 / 0.7);
    --on-sea: oklch(0.17 0.04 256);
    --on-buoy: oklch(0.17 0.04 256);
    --on-alga: oklch(0.17 0.04 256);
    --teal: oklch(0.8 0.08 200);
    --violet: oklch(0.8 0.09 295);
    --rose: oklch(0.8 0.09 10);
    --exit-bg: oklch(0.93 0.02 240);
    --exit-fg: oklch(0.2 0.045 256);
  }
}
:root[data-theme="dark"] {
  color-scheme: dark;
  --abyss: oklch(0.15 0.035 256);
  --abyss-2: oklch(0.2 0.045 256);
  --deep: oklch(0.72 0.1 248);
  --sea: oklch(0.7 0.14 250);
  --sea-strong: oklch(0.76 0.13 248);
  --sea-soft: oklch(0.3 0.06 252);
  --wave: oklch(0.52 0.12 250);
  --shallow: oklch(0.36 0.08 252);
  --foam: oklch(0.175 0.03 256);
  --paper: oklch(0.215 0.035 256);
  --paper-2: oklch(0.24 0.035 256);
  --ink: oklch(0.95 0.012 240);
  --ink-2: oklch(0.82 0.025 245);
  --ink-3: oklch(0.72 0.03 245);
  --rule: oklch(0.31 0.035 255);
  --rule-strong: oklch(0.4 0.04 255);
  --alga: oklch(0.72 0.13 162);
  --alga-soft: oklch(0.3 0.05 162);
  --alga-ink: oklch(0.86 0.09 162);
  --sand-soft: oklch(0.32 0.05 80);
  --sand-ink: oklch(0.88 0.1 85);
  --buoy: oklch(0.7 0.16 30);
  --buoy-soft: oklch(0.3 0.06 30);
  --buoy-ink: oklch(0.86 0.09 30);
  --violet-soft: oklch(0.3 0.05 295);
  --teal-soft: oklch(0.3 0.04 200);
  --rose-soft: oklch(0.3 0.05 10);
  --slate-soft: oklch(0.28 0.02 250);
  --shadow-1: 0 1px 2px oklch(0 0 0 / 0.3);
  --shadow-2: 0 2px 4px oklch(0 0 0 / 0.25), 0 16px 36px -18px oklch(0 0 0 / 0.6);
  --shadow-3: 0 10px 24px -8px oklch(0 0 0 / 0.5), 0 30px 60px -30px oklch(0 0 0 / 0.7);
  --on-sea: oklch(0.17 0.04 256);
  --on-buoy: oklch(0.17 0.04 256);
  --on-alga: oklch(0.17 0.04 256);
  --teal: oklch(0.8 0.08 200);
  --violet: oklch(0.8 0.09 295);
  --rose: oklch(0.8 0.09 10);
  --exit-bg: oklch(0.93 0.02 240);
  --exit-fg: oklch(0.2 0.045 256);
}

/* --- Base -------------------------------------------------------------------------------------- */
*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; text-size-adjust: 100%; scroll-padding-top: 80px; background: var(--foam); }
body {
  margin: 0;
  font-family: var(--font);
  font-size: var(--fs-md);
  line-height: 1.5;
  color: var(--ink);
  background: var(--foam);
  font-optical-sizing: auto;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}
::selection { background: var(--sea); color: var(--paper); }
img, svg { display: block; max-width: 100%; }
a { color: var(--sea); text-underline-offset: 0.18em; text-decoration-thickness: 1px; }
a:hover { color: var(--sea-strong); }
h1, h2, h3, h4 { margin: 0; line-height: 1.2; letter-spacing: -0.01em; text-wrap: balance; }
h1 { font-size: var(--fs-2xl); font-weight: 680; }
h2 { font-size: var(--fs-xl); font-weight: 650; }
h3, .h3 { font-size: var(--fs-lg); font-weight: 620; }
p { margin: 0 0 var(--s3); max-width: 70ch; }
p:last-child { margin-bottom: 0; }
small, .small { font-size: var(--fs-sm); }
.muted { color: var(--ink-2); }
.num, .tnum { font-variant-numeric: tabular-nums lining-nums; }
.cond { font-stretch: 78%; }
:focus-visible { outline: none; box-shadow: var(--focus); border-radius: var(--r-sm); }
.visually-hidden { position: absolute !important; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
.icon { width: 1.25em; height: 1.25em; flex: none; }
.icon-sm { width: 1em; height: 1em; }
.icon-lg { width: 1.6em; height: 1.6em; }
hr { border: 0; border-top: 1px solid var(--rule); margin: var(--s5) 0; }
* { scrollbar-width: thin; scrollbar-color: var(--rule-strong) transparent; }
::-webkit-scrollbar { width: 10px; height: 10px; }
::-webkit-scrollbar-thumb { background: var(--rule-strong); border-radius: 10px; border: 3px solid var(--foam); }
::-webkit-scrollbar-track { background: transparent; }
input, select, textarea, button { font: inherit; color: inherit; }
[hidden] { display: none !important; }

@view-transition { navigation: auto; }
::view-transition-old(root), ::view-transition-new(root) { animation-duration: 220ms; animation-timing-function: var(--ease-out); }
::view-transition-old(main-content) { animation: vt-out 160ms var(--ease-in-out) both; }
::view-transition-new(main-content) { animation: vt-in 260ms var(--ease-out) both; }
@keyframes vt-out { to { opacity: 0; transform: translateY(-6px); } }
@keyframes vt-in { from { opacity: 0; transform: translateY(8px); } }

/* --- Shell ------------------------------------------------------------------------------------- */
.shell { min-height: 100dvh; }
.rail { display: none; }
.topbar {
  position: sticky; top: 0; z-index: 30;
  display: flex; align-items: center; gap: var(--s3);
  padding: calc(var(--s3) + env(safe-area-inset-top, 0px)) var(--s4) var(--s3);
  background: var(--abyss); color: var(--on-dark);
}
.topbar__title { flex: 1; min-width: 0; }
.topbar__title strong { display: block; font-size: var(--fs-lg); font-weight: 650; line-height: 1.2; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.topbar__title > span { display: block; font-size: var(--fs-xs); color: var(--on-dark-2); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.topbar .btn-icon { color: var(--on-dark); }
.topbar .btn-icon:hover { background: oklch(1 0 0 / 0.08); }
.brand { display: flex; align-items: center; gap: var(--s3); color: inherit; text-decoration: none; }
.brand__mark { width: 34px; height: 34px; flex: none; }
.brand__text { line-height: 1.05; }
.brand__text b { display: block; font-size: 1.05rem; font-weight: 700; letter-spacing: -0.01em; }
.brand__text span { display: block; font-size: 0.78rem; color: var(--on-dark-2); letter-spacing: 0.02em; }

.content {
  view-transition-name: main-content;
  width: 100%; max-width: 1180px; margin: 0 auto;
  padding: var(--s4) var(--s4) calc(var(--tabbar-h) + var(--safe-b) + var(--s6));
}
.page-head { display: flex; flex-wrap: wrap; align-items: flex-end; justify-content: space-between; gap: var(--s3); margin: var(--s2) 0 var(--s5); }
.page-head h1 { font-size: var(--fs-2xl); }
.page-head__sub { color: var(--ink-2); margin-top: var(--s1); font-size: var(--fs-sm); }
.page-head__actions { display: flex; flex-wrap: wrap; gap: var(--s2); }

.tabbar {
  position: fixed; inset: auto 0 0 0; z-index: 40;
  display: grid; grid-template-columns: repeat(5, 1fr);
  height: calc(var(--tabbar-h) + var(--safe-b)); padding-bottom: var(--safe-b);
  background: color-mix(in oklch, var(--paper) 94%, transparent);
  backdrop-filter: saturate(1.4) blur(14px);
  border-top: 1px solid var(--rule);
}
.tabbar--4 { grid-template-columns: repeat(4, 1fr); }
.tabbar a {
  position: relative; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 3px;
  color: var(--ink-2); text-decoration: none; font-size: 0.72rem; font-weight: 560; letter-spacing: 0.01em;
  -webkit-tap-highlight-color: transparent;
}
.tabbar a .icon { width: 24px; height: 24px; transition: transform var(--t-mid) var(--ease-out); }
.tabbar a[aria-current="page"] { color: var(--sea); }
.tabbar a[aria-current="page"]::before {
  content: ""; position: absolute; top: 0; left: 30%; right: 30%; height: 3px; border-radius: 0 0 3px 3px; background: var(--sea);
}
.tabbar a:active .icon { transform: scale(0.9); }
.tabbar .dot { position: absolute; top: 9px; left: calc(50% + 6px); min-width: 18px; height: 18px; padding: 0 5px; border-radius: 9px; background: var(--buoy); color: var(--on-buoy); font-size: 0.72rem; font-weight: 700; display: grid; place-items: center; border: 2px solid var(--paper); }

@media (min-width: 1024px) {
  .shell { display: grid; grid-template-columns: var(--rail-w) 1fr; background: linear-gradient(90deg, var(--abyss) var(--rail-w), var(--foam) var(--rail-w)); }
  .rail {
    display: flex; flex-direction: column; gap: var(--s4);
    position: sticky; top: 0; height: 100dvh; overflow-y: auto;
    padding: var(--s5) var(--s4);
    background: var(--abyss); color: var(--on-dark);
  }
  .rail nav { display: flex; flex-direction: column; gap: 2px; }
  .rail__label { margin: var(--s4) var(--s3) var(--s2); font-size: 0.72rem; font-weight: 650; letter-spacing: 0.08em; text-transform: uppercase; color: var(--on-dark-2); }
  .rail a.nav-item {
    display: flex; align-items: center; gap: var(--s3); padding: 9px var(--s3); border-radius: var(--r-md);
    color: var(--on-dark-2); text-decoration: none; font-weight: 520; font-size: 0.95rem;
    transition: background var(--t-fast), color var(--t-fast);
  }
  .rail a.nav-item:hover { background: oklch(1 0 0 / 0.07); color: var(--on-dark); }
  .rail a.nav-item[aria-current="page"] { background: oklch(1 0 0 / 0.13); color: var(--on-dark); font-weight: 620; }
  .rail a.nav-item[aria-current="page"] .icon { color: var(--wave); }
  .rail a.nav-item .badge { margin-left: auto; }
  /* Fijo al pie aunque el rail se desplace (la administración tiene muchas entradas); el relleno opaco y el
     degradado tapan lo que pasa por detrás. */
  .rail__user {
    position: sticky; bottom: 0; z-index: 1; margin-top: auto;
    display: flex; align-items: center; gap: var(--s1); padding: var(--s2); border-radius: var(--r-md);
    background: color-mix(in oklch, var(--abyss), white 6%);
  }
  .rail__user::before, .rail__user::after { content: ""; position: absolute; left: calc(-1 * var(--s4)); right: calc(-1 * var(--s4)); pointer-events: none; }
  .rail__user::before { bottom: 100%; height: 16px; background: linear-gradient(to top, var(--abyss), transparent); }
  .rail__user::after { top: 100%; height: calc(var(--s5) + 1px); background: var(--abyss); }
  /* Todo el bloque de nombre es un enlace a «Más»; las reglas van con clase propia para no tocar el avatar. */
  .rail__me {
    display: flex; align-items: center; gap: var(--s3); flex: 1; min-width: 0; min-height: 44px; padding: 6px var(--s2);
    border-radius: var(--r-sm); color: var(--on-dark); text-decoration: none; transition: background var(--t-fast);
  }
  .rail__me:hover { background: oklch(1 0 0 / 0.08); color: var(--on-dark); }
  /* El selector de empresa sobre abisal: pista translúcida y la activa como un elemento de navegación activo. */
  .rail .company-switch { background: oklch(1 0 0 / 0.06); margin-top: calc(-1 * var(--s1)); }
  .rail .company-switch__opt { justify-content: flex-start; min-height: 36px; color: var(--on-dark-2); font-weight: 520; }
  .rail .company-switch__opt:hover { background: oklch(1 0 0 / 0.07); color: var(--on-dark); }
  .rail .company-switch__opt[aria-current="true"] { background: oklch(1 0 0 / 0.13); color: var(--on-dark); font-weight: 620; box-shadow: none; }
  .rail .company-switch__state--dentro { background: oklch(0.83 0.13 162); }
  .rail .company-switch__state--pausa { background: oklch(0.86 0.12 82); }
  .rail .company-switch__opt .badge--count { margin-left: auto; }
  .rail__me[aria-current="page"] { background: oklch(1 0 0 / 0.13); }
  .rail__who { display: grid; min-width: 0; flex: 1; line-height: 1.25; }
  .rail__who b { font-size: 0.9rem; font-weight: 600; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
  .rail__who small { font-size: 0.75rem; color: var(--on-dark-2); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
  .rail .btn-icon { color: var(--on-dark-2); }
  .rail .btn-icon:hover { color: var(--on-dark); background: oklch(1 0 0 / 0.08); }
  .topbar { display: none; }
  .tabbar { display: none; }
  .content { padding: var(--s6) var(--s6) var(--s7); }
  .page-head h1 { font-size: var(--fs-3xl); }
}

/* --- Botones ------------------------------------------------------------------------------------ */
.btn {
  --btn-bg: var(--paper); --btn-fg: var(--ink); --btn-bd: var(--rule-strong);
  display: inline-flex; align-items: center; justify-content: center; gap: var(--s2);
  min-height: 44px; padding: 0 var(--s4); border-radius: var(--r-md);
  border: 1px solid var(--btn-bd); background: var(--btn-bg); color: var(--btn-fg);
  font-weight: 600; font-size: var(--fs-md); text-decoration: none; cursor: pointer; white-space: nowrap;
  transition: background var(--t-fast), border-color var(--t-fast), color var(--t-fast), transform var(--t-fast) var(--ease-out), box-shadow var(--t-mid);
  -webkit-tap-highlight-color: transparent;
}
.btn:hover { --btn-bg: var(--paper-2); --btn-bd: var(--deep); }
a.btn, a.btn:hover, a.btn:visited { color: var(--btn-fg); }
.btn:active { transform: translateY(1px) scale(0.99); }
.btn[disabled], .btn[aria-disabled="true"] { opacity: 0.5; cursor: not-allowed; transform: none; }
.btn--primary { --btn-bg: var(--sea); --btn-fg: var(--on-sea); --btn-bd: transparent; box-shadow: 0 6px 16px -8px oklch(0.5 0.16 255 / 0.6); }
.btn--primary:hover { --btn-bg: var(--sea-strong); --btn-fg: var(--on-sea); --btn-bd: transparent; }
.btn--danger { --btn-bg: var(--buoy-soft); --btn-fg: var(--buoy-ink); --btn-bd: transparent; }
.btn--danger:hover { --btn-bg: var(--buoy); --btn-fg: var(--on-buoy); --btn-bd: transparent; }
.btn--ok { --btn-bg: var(--alga-soft); --btn-fg: var(--alga-ink); --btn-bd: transparent; }
.btn--ok:hover { --btn-bg: var(--alga); --btn-fg: var(--on-alga); --btn-bd: transparent; }
.btn--quiet { --btn-bg: transparent; --btn-bd: transparent; --btn-fg: var(--sea); }
.btn--quiet:hover { --btn-bg: var(--sea-soft); --btn-bd: transparent; --btn-fg: var(--sea-strong); }
.btn--sm { min-height: 36px; padding: 0 var(--s3); font-size: var(--fs-sm); border-radius: var(--r-sm); }
.btn--lg { min-height: 56px; padding: 0 var(--s5); font-size: var(--fs-lg); border-radius: var(--r-lg); }
.btn--block { width: 100%; }
.btn-icon {
  display: inline-grid; place-items: center; width: 44px; height: 44px; border-radius: var(--r-md);
  border: 0; background: transparent; color: var(--ink-2); cursor: pointer; text-decoration: none;
  transition: background var(--t-fast), color var(--t-fast);
}
.btn-icon:hover { background: var(--sea-soft); color: var(--sea); }
.btn-row { display: flex; flex-wrap: wrap; gap: var(--s2); align-items: center; }
.btn-row--end { justify-content: flex-end; }
form.inline { display: inline; }

/* --- Tarjetas y secciones ------------------------------------------------------------------------ */
.card {
  background: var(--paper); border-radius: var(--r-lg);
  border: 1px solid var(--rule);
  padding: var(--s5);
}
.card + .card, .stack > * + * { margin-top: var(--s4); }
.card--tight { padding: var(--s4); }
.card--flush { padding: 0; overflow: hidden; }
.card__head { display: flex; align-items: center; justify-content: space-between; gap: var(--s3); margin-bottom: var(--s4); }
.card__head h2 { font-size: var(--fs-lg); }
.card__head .muted { font-size: var(--fs-sm); }
.section { margin-top: var(--s6); }
.section > h2 { margin-bottom: var(--s3); font-size: var(--fs-lg); }
.grid { display: grid; gap: var(--s4); }
.grid > *, .stack > *, .main, .content { min-width: 0; }
.grid > .card + .card { margin-top: 0; }
@media (min-width: 760px) { .grid--2 { grid-template-columns: repeat(2, minmax(0, 1fr)); } .grid--3 { grid-template-columns: repeat(3, minmax(0, 1fr)); } }
@media (min-width: 1100px) { .grid--main { grid-template-columns: minmax(0, 1.25fr) minmax(0, 1fr); align-items: start; } }

/* --- Formularios -------------------------------------------------------------------------------- */
.form { display: grid; gap: var(--s4); }
.form > *, .form-row > * { min-width: 0; }
.time-pair { display: flex; align-items: center; gap: 6px; min-width: 0; }
.time-pair .input { flex: 1 1 0; width: auto; min-width: 0; max-width: 8.2em; padding-inline: 8px; }
.table--stack td .time-pair { flex: 1; justify-content: flex-end; }
fieldset.week { padding: var(--s3) var(--s4) var(--s4); }
fieldset.week legend { font-size: var(--fs-md); }
.week__head { display: flex; flex-wrap: wrap; justify-content: space-between; align-items: center; gap: var(--s2); margin-bottom: var(--s2); }
.form-row { display: grid; gap: var(--s4); }
@media (min-width: 640px) { .form-row--2 { grid-template-columns: 1fr 1fr; } .form-row--3 { grid-template-columns: repeat(3, 1fr); } .form-row--4 { grid-template-columns: repeat(4, 1fr); } }
.field { display: grid; gap: 6px; min-width: 0; }
.field > label, .field > .label { font-size: var(--fs-sm); font-weight: 600; color: var(--ink); }
.field__hint { font-size: var(--fs-xs); color: var(--ink-2); }
.input, .select, .textarea {
  width: 100%; min-height: 44px; padding: 10px 12px; border-radius: var(--r-md);
  border: 1px solid var(--rule-strong); background: var(--paper); color: var(--ink); font-size: 1rem;
  transition: border-color var(--t-fast), box-shadow var(--t-fast);
}
.textarea { min-height: 96px; resize: vertical; line-height: 1.5; }
.select { appearance: none; padding-right: 38px; background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='20' height='20' viewBox='0 0 24 24' fill='none' stroke='%234a5f78' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='m6 9 6 6 6-6'/%3E%3C/svg%3E"); background-repeat: no-repeat; background-position: right 10px center; }
.input:hover, .select:hover, .textarea:hover { border-color: var(--deep); }
.input:focus, .select:focus, .textarea:focus { outline: none; border-color: var(--sea); box-shadow: 0 0 0 3px color-mix(in oklch, var(--sea) 25%, transparent); }
.input::placeholder, .textarea::placeholder { color: var(--ink-3); }
.input[type="time"], .input[type="date"] { font-variant-numeric: tabular-nums; }
.input--num { font-variant-numeric: tabular-nums; max-width: 9rem; }
.field--error .input, .field--error .select, .field--error .textarea { border-color: var(--buoy); }
.field__error { color: var(--buoy-ink); font-size: var(--fs-sm); font-weight: 560; }
.check { display: flex; align-items: flex-start; gap: var(--s3); cursor: pointer; font-size: var(--fs-md); min-height: 32px; }
.check input { width: 20px; height: 20px; margin: 2px 0 0; accent-color: var(--sea); flex: none; }
.check span small { display: block; color: var(--ink-2); }
.checks { display: grid; gap: var(--s2); }
@media (min-width: 640px) { .checks--cols { grid-template-columns: repeat(2, 1fr); } }
fieldset { border: 1px solid var(--rule); border-radius: var(--r-md); padding: var(--s4); margin: 0; min-width: 0; }
legend { padding: 0 var(--s2); font-weight: 620; font-size: var(--fs-sm); }

.segmented { display: inline-grid; grid-auto-flow: column; grid-auto-columns: 1fr; gap: 2px; padding: 3px; border-radius: var(--r-md); background: var(--sea-soft); max-width: 100%; }
.segmented input { position: absolute; opacity: 0; pointer-events: none; }
.segmented label { display: grid; place-items: center; min-height: 38px; padding: 0 var(--s3); border-radius: 9px; font-size: var(--fs-sm); font-weight: 600; color: var(--ink-2); cursor: pointer; text-align: center; transition: background var(--t-fast), color var(--t-fast), box-shadow var(--t-fast); }
.segmented input:checked + label { background: var(--paper); color: var(--ink); box-shadow: var(--shadow-1); }
.segmented input:focus-visible + label { box-shadow: var(--focus); }
.segmented a { display: grid; place-items: center; min-height: 38px; padding: 0 var(--s3); border-radius: 9px; font-size: var(--fs-sm); font-weight: 600; color: var(--ink-2); text-decoration: none; }
.segmented a[aria-current="page"] { background: var(--paper); color: var(--ink); box-shadow: var(--shadow-1); }

/* Empresa activa, para quien trabaja en varias. Mismo lenguaje que el segmentado: pista mar suave y la activa en
   papel. Cada opción es un envío; la otra empresa lleva el punto de estado si su jornada sigue abierta. */
.company-switch { display: grid; gap: 2px; padding: 3px; border-radius: var(--r-md); background: var(--sea-soft); }
.company-switch--row { grid-auto-flow: column; grid-auto-columns: minmax(0, 1fr); }
.company-switch__opt {
  display: flex; align-items: center; justify-content: center; gap: var(--s2); min-height: 40px; min-width: 0; padding: 0 var(--s3);
  border: 0; border-radius: 9px; background: none; font: inherit; font-size: var(--fs-sm); font-weight: 600; color: var(--ink-2);
  cursor: pointer; transition: background var(--t-fast), color var(--t-fast), box-shadow var(--t-fast);
}
.company-switch__opt:hover { color: var(--ink); background: color-mix(in oklch, var(--paper) 55%, transparent); }
.company-switch__opt:focus-visible { outline: none; box-shadow: var(--focus); }
.company-switch__opt[aria-current="true"] { background: var(--paper); color: var(--ink); box-shadow: var(--shadow-1); cursor: default; }
.company-switch__name { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.company-switch__state { flex: none; width: 8px; height: 8px; border-radius: 50%; }
.company-switch__state--dentro { background: var(--alga); }
.company-switch__state--pausa { background: var(--sand); }
.company-pick { margin-bottom: var(--s5); }
/* Con rail (escritorio) el cambio de empresa ya está en él: en la portada solo hace falta en móvil. */
@media (min-width: 1024px) { .clock-zone > .company-switch { display: none; } }
.company-pick > h2 { margin-bottom: var(--s3); font-size: var(--fs-lg); }

/* --- Etiquetas de estado ---------------------------------------------------------------------- */
.badge {
  display: inline-flex; align-items: center; gap: 6px; padding: 3px 10px; border-radius: var(--r-pill);
  font-size: var(--fs-xs); font-weight: 650; line-height: 1.4; white-space: nowrap;
  background: var(--slate-soft); color: var(--ink-2);
}
.badge--dot::before { content: ""; width: 7px; height: 7px; border-radius: 50%; background: currentColor; }
.badge--in { background: var(--alga-soft); color: var(--alga-ink); }
.badge--pause { background: var(--sand-soft); color: var(--sand-ink); }
.badge--out { background: var(--slate-soft); color: var(--ink-2); }
.badge--alert { background: var(--buoy-soft); color: var(--buoy-ink); }
.badge--info, .badge--sea { background: var(--sea-soft); color: var(--deep); }
.badge--pending { background: transparent; color: var(--deep); outline: 1.5px dashed color-mix(in oklch, var(--deep) 70%, transparent); outline-offset: -1.5px; box-shadow: none; }
.badge--violet { background: var(--violet-soft); color: var(--violet); }
.badge--teal { background: var(--teal-soft); color: var(--teal); }
.badge--rose { background: var(--rose-soft); color: var(--rose); }
.badge--sand { background: var(--sand-soft); color: var(--sand-ink); }
.badge--slate { background: var(--slate-soft); color: var(--ink-2); }
.badge--count { background: var(--buoy); color: var(--on-buoy); padding: 1px 7px; min-width: 22px; justify-content: center; }
.rail .badge--count { border: 0; }

.stamp {
  display: inline-block; padding: 1px 7px; border: 1.5px solid currentColor; border-radius: 5px;
  font-size: 0.68rem; font-weight: 750; letter-spacing: 0.08em; text-transform: uppercase; transform: rotate(-2deg);
}
.stamp--void { color: var(--buoy-ink); }
.stamp--fix { color: var(--deep); }
.is-superseded { color: var(--ink-3); }
.is-superseded .entry-time { text-decoration: line-through; text-decoration-thickness: 1.5px; }

/* --- Avisos flash, toasts y diálogos --------------------------------------------------------------- */
.flashes { display: grid; gap: var(--s2); margin-bottom: var(--s4); }
.flash { display: flex; align-items: flex-start; gap: var(--s3); padding: var(--s3) var(--s4); border-radius: var(--r-md); font-weight: 520; animation: flash-in var(--t-slow) var(--ease-out) both; }
.flash--ok { background: var(--alga-soft); color: var(--alga-ink); }
.flash--error { background: var(--buoy-soft); color: var(--buoy-ink); }
.flash--info { background: var(--sea-soft); color: var(--deep); }
@keyframes flash-in { from { opacity: 0; transform: translateY(-6px); } }
.toaster { position: fixed; z-index: 80; left: 50%; bottom: calc(var(--tabbar-h) + var(--safe-b) + var(--s4)); transform: translateX(-50%); display: grid; gap: var(--s2); width: min(92vw, 440px); pointer-events: none; }
@media (min-width: 1024px) { .toaster { bottom: var(--s6); } }
.toast { pointer-events: auto; display: flex; align-items: center; gap: var(--s3); padding: var(--s3) var(--s4); border-radius: var(--r-md); background: var(--abyss); color: var(--on-dark); box-shadow: var(--shadow-3); font-weight: 560; animation: toast-in 320ms var(--ease-out) both; }
.toast--error { background: var(--buoy); color: var(--on-buoy); }
.toast.is-leaving { animation: toast-out 200ms var(--ease-in-out) both; }
@keyframes toast-in { from { opacity: 0; transform: translateY(14px) scale(0.98); } }
@keyframes toast-out { to { opacity: 0; transform: translateY(8px); } }
.offline-bar { position: sticky; top: 0; z-index: 35; display: flex; align-items: center; justify-content: center; gap: var(--s2); padding: 8px var(--s4); background: var(--sand); color: oklch(0.25 0.05 70); font-size: var(--fs-sm); font-weight: 600; }

dialog.dialog {
  width: min(92vw, 480px); padding: 0; border: 0; border-radius: var(--r-xl); background: var(--paper); color: var(--ink);
  box-shadow: var(--shadow-3);
}
dialog.dialog::backdrop { background: oklch(0.2 0.05 252 / 0.45); backdrop-filter: blur(3px); }
dialog.dialog[open] { animation: dialog-in 280ms var(--ease-out); }
@keyframes dialog-in { from { opacity: 0; transform: translateY(16px) scale(0.98); } }
.dialog__body { padding: var(--s5); display: grid; gap: var(--s4); }
.dialog__body h2 { font-size: var(--fs-xl); }
@media (max-width: 640px) {
  dialog.dialog { width: 100vw; max-width: 100vw; margin: auto 0 0; border-radius: var(--r-xl) var(--r-xl) 0 0; padding-bottom: var(--safe-b); }
  dialog.dialog[open] { animation: sheet-in 320ms var(--ease-out); }
  @keyframes sheet-in { from { transform: translateY(100%); } }
}

/* --- Listas y tablas ----------------------------------------------------------------------------- */
.list { list-style: none; margin: 0; padding: 0; }
.list > li { display: flex; align-items: center; gap: var(--s3); padding: var(--s3) 0; border-bottom: 1px solid var(--rule); min-width: 0; }
.list > li:last-child { border-bottom: 0; }
.list__main { flex: 1; min-width: 0; }
.list__title { font-weight: 600; overflow-wrap: anywhere; }
.list__meta { font-size: var(--fs-sm); color: var(--ink-2); overflow-wrap: anywhere; }
.list__end { flex: none; text-align: right; }
a.list__link { display: flex; align-items: center; gap: var(--s3); color: inherit; text-decoration: none; flex: 1; min-width: 0; }
a.list__link:hover .list__title { color: var(--sea); }

.table-wrap { overflow-x: auto; border-radius: var(--r-lg); }
.table { width: 100%; border-collapse: collapse; font-size: var(--fs-sm); }
.table th { text-align: left; font-weight: 650; color: var(--ink-2); font-size: var(--fs-xs); letter-spacing: 0.04em; text-transform: uppercase; padding: 10px 12px; border-bottom: 1.5px solid var(--rule-strong); white-space: nowrap; background: var(--paper-2); position: sticky; top: 0; }
.table td { padding: 10px 12px; border-bottom: 1px solid var(--rule); vertical-align: middle; }
.table tr:last-child td { border-bottom: 0; }
.table tbody tr { transition: background var(--t-fast); }
.table tbody tr:hover { background: color-mix(in oklch, var(--sea-soft) 45%, transparent); }
.table .num { text-align: right; font-variant-numeric: tabular-nums; white-space: nowrap; }
.table .actions { text-align: right; white-space: nowrap; }
.table a { font-weight: 560; }
@media (max-width: 760px) {
  .table--stack thead { display: none; }
  .table--stack, .table--stack tbody, .table--stack tr, .table--stack td { display: block; width: 100%; }
  .table--stack tr { padding: var(--s3) var(--s4); border-bottom: 1px solid var(--rule); }
  .table--stack td { display: flex; justify-content: space-between; gap: var(--s3); border: 0; padding: 3px 0; text-align: right; }
  .table--stack td::before { content: attr(data-label); font-weight: 600; color: var(--ink-2); text-align: left; }
  .table--stack td.cell-title { display: block; text-align: left; font-size: var(--fs-md); font-weight: 650; padding-bottom: 6px; }
  .table--stack td.cell-title::before { display: none; }
  .table--stack td.actions { justify-content: flex-end; padding-top: var(--s2); }
  .table--stack td.actions::before { display: none; }
  .table--stack .num { text-align: right; }
}

.empty { display: grid; justify-items: center; gap: var(--s2); padding: var(--s6) var(--s4); text-align: center; color: var(--ink-2); }
.empty .icon { width: 40px; height: 40px; color: var(--wave); }
.empty strong { color: var(--ink); font-size: var(--fs-lg); }
.empty p { max-width: 42ch; margin: 0; }

.filters { display: flex; flex-wrap: wrap; align-items: flex-end; gap: var(--s3); margin-bottom: var(--s4); }
.filters .field { flex: 1 1 150px; }
.filters .btn { flex: none; }
.pager { display: flex; align-items: center; justify-content: space-between; gap: var(--s3); }
.pager__label { font-weight: 650; font-size: var(--fs-lg); text-align: center; flex: 1; }

.avatar { display: inline-grid; place-items: center; width: 38px; height: 38px; border-radius: 50%; background: var(--sea-soft); color: var(--deep); font-weight: 700; font-size: 0.85rem; flex: none; letter-spacing: 0.02em; }
.rail .avatar, .topbar .avatar { background: oklch(1 0 0 / 0.14); color: var(--on-dark); }
.avatar--sm { width: 30px; height: 30px; font-size: 0.75rem; }
.kv { display: grid; grid-template-columns: max-content 1fr; gap: 6px var(--s4); font-size: var(--fs-sm); }
.kv dt { color: var(--ink-2); }
.kv dd { margin: 0; font-weight: 560; overflow-wrap: anywhere; }
.code { font-family: ui-monospace, "SF Mono", Menlo, monospace; font-size: 0.8rem; overflow-wrap: anywhere; color: var(--ink-2); }
.tabs { display: flex; gap: var(--s1); overflow-x: auto; margin: 0 0 var(--s5); padding-bottom: 2px; border-bottom: 1px solid var(--rule); scrollbar-width: none; }
.tabs a { flex: none; padding: 10px var(--s3); color: var(--ink-2); text-decoration: none; font-weight: 600; font-size: var(--fs-sm); border-bottom: 2.5px solid transparent; margin-bottom: -1px; white-space: nowrap; }
.tabs a:hover { color: var(--ink); }
.tabs a[aria-current="page"] { color: var(--sea); border-bottom-color: var(--sea); }
.note { padding: var(--s3) var(--s4); border-radius: var(--r-md); background: var(--sea-soft); color: var(--deep); font-size: var(--fs-sm); }
.note--warn { background: var(--sand-soft); color: var(--sand-ink); }
.note--alert { background: var(--buoy-soft); color: var(--buoy-ink); }
.figures { display: flex; flex-wrap: wrap; gap: var(--s2) var(--s6); }
.figure { min-width: 0; }
.figure b { display: block; font-size: var(--fs-2xl); font-weight: 650; font-stretch: 80%; font-variant-numeric: tabular-nums; letter-spacing: -0.01em; line-height: 1.1; }
.figure > span { font-size: var(--fs-sm); color: var(--ink-2); }
.pos { color: var(--alga-ink); }
.neg { color: var(--buoy-ink); }

/* Portada: dos columnas en escritorio, orden pensado para el pulgar en móvil */
.home { display: flex; flex-direction: column; gap: var(--s4); }
.home__col { display: contents; }
.home [data-order="1"] { order: 1; } .home [data-order="2"] { order: 2; } .home [data-order="3"] { order: 3; } .home [data-order="4"] { order: 4; }
@media (min-width: 1100px) {
  .home { display: grid; grid-template-columns: minmax(0, 1.2fr) minmax(0, 1fr); align-items: start; }
  .home__col { display: flex; flex-direction: column; gap: var(--s4); min-width: 0; }
  /* El reloj acompaña mientras se recorre la semana: el hueco bajo él es deliberado. */
  .home--clock > .home__col:first-child { position: sticky; top: var(--s6); align-self: start; }
}

/* --- Firma: la marea ---------------------------------------------------------------------------- */
.clock-card {
  position: relative; overflow: hidden; isolation: isolate;
  border-radius: var(--r-xl); background: var(--paper); box-shadow: var(--shadow-2);
  border: 1px solid color-mix(in oklch, var(--rule) 70%, transparent);
}
.clock-card__top { position: relative; z-index: 3; padding: var(--s5) var(--s5) 0; display: grid; gap: var(--s2); }
.clock-card__state { display: flex; flex-wrap: wrap; align-items: center; gap: var(--s2); justify-content: space-between; }
.timer {
  font-size: clamp(3.2rem, 15vw, 4.6rem); font-weight: 640; font-stretch: 72%; letter-spacing: -0.02em; line-height: 0.95;
  font-variant-numeric: tabular-nums lining-nums; color: var(--ink);
}
.timer small { font-size: 0.42em; font-stretch: 100%; font-weight: 560; color: var(--ink-2); letter-spacing: 0; margin-left: 0.15em; }
.clock-card__meta { color: var(--ink-2); font-size: var(--fs-sm); font-variant-numeric: tabular-nums; }
.clock-card__meta b { color: var(--ink); font-weight: 650; }

.tide {
  --level: 0; --mark: 0.78;
  position: relative; height: clamp(170px, 30vh, 260px); margin-top: var(--s4);
  background: linear-gradient(to bottom, var(--paper), color-mix(in oklch, var(--sea-soft) 60%, var(--paper)));
  border-top: 1px solid var(--rule);
}
.tide__water {
  position: absolute; inset: auto 0 0 0;
  height: calc(min(var(--level), 1.28) * var(--mark) * 100%);
  background: linear-gradient(to bottom, var(--wave), var(--sea) 70%);
  transition: height 900ms var(--ease-out);
}
.js .tide:not(.is-ready) .tide__water { height: 0; transition: none; }
.tide__water.is-over { background: linear-gradient(to bottom, var(--wave), var(--deep) 85%); }
.tide__waves { position: absolute; left: 0; right: 0; bottom: 100%; height: 22px; overflow: hidden; pointer-events: none; }
.tide__waves svg { position: absolute; bottom: -1px; left: 0; width: 200%; max-width: none; height: 22px; }
.tide__waves .w1 { fill: var(--wave); opacity: 0.55; }
.tide__waves .w2 { fill: var(--wave); }
.tide.is-working .tide__waves svg { animation: drift 7s linear infinite; }
.tide.is-working .tide__waves svg.back { animation-duration: 11s; animation-direction: reverse; }
@keyframes drift { to { transform: translateX(-50%); } }
.tide__mark {
  position: absolute; left: 0; right: 0; bottom: calc(var(--mark) * 100%); height: 0; z-index: 2;
  border-top: 2px dashed color-mix(in oklch, var(--deep) 70%, transparent);
}
.tide__mark span {
  position: absolute; right: 56px; bottom: 6px; padding: 2px 8px; border-radius: var(--r-pill);
  background: var(--paper); color: var(--deep); font-size: var(--fs-xs); font-weight: 650; font-variant-numeric: tabular-nums; box-shadow: var(--shadow-1);
}
.tide__staff {
  position: absolute; top: 10px; bottom: 0; right: 14px; width: 30px; z-index: 2;
  display: flex; flex-direction: column-reverse; justify-content: space-between; align-items: flex-end;
  pointer-events: none;
}
.tide__staff i { display: block; height: 2px; width: 10px; border-radius: 2px; background: color-mix(in oklch, var(--deep) 55%, transparent); }
.tide__staff i:nth-child(4n + 1) { width: 22px; background: var(--deep); }
.tide__label { position: absolute; left: var(--s5); bottom: var(--s4); z-index: 2; color: var(--on-sea); font-size: var(--fs-sm); font-weight: 650; text-shadow: 0 1px 2px color-mix(in oklch, var(--sea) 70%, transparent); font-variant-numeric: tabular-nums; }
.tide__label.is-dry { color: var(--ink-2); text-shadow: none; }
.tide.is-pause .tide__water { background: linear-gradient(to bottom, color-mix(in oklch, var(--wave) 70%, var(--sand)), var(--sea) 80%); }

.clock-actions { position: relative; z-index: 3; display: grid; grid-template-columns: 1fr auto; gap: var(--s3); padding: var(--s4) var(--s5) var(--s5); background: var(--paper); }
.clock-actions .btn--primary { min-height: 64px; font-size: 1.15rem; border-radius: var(--r-lg); }
.clock-actions .btn--secondary { min-height: 64px; min-width: 64px; border-radius: var(--r-lg); padding: 0 var(--s4); }
.clock-actions .btn--primary.is-exit, .clock-actions .btn--primary.is-exit:hover { --btn-bg: var(--exit-bg); --btn-fg: var(--exit-fg); box-shadow: var(--shadow-2); }
.ripple { position: absolute; z-index: 1; border-radius: 50%; pointer-events: none; background: color-mix(in oklch, var(--sea) 22%, transparent); transform: scale(0); animation: ripple 700ms var(--ease-out) forwards; }
@keyframes ripple { to { transform: scale(1); opacity: 0; } }
.pause-menu { display: grid; grid-template-columns: repeat(2, 1fr); gap: var(--s2); }
.pause-menu button { min-height: 52px; }

/* Ruta del día (estaciones) */
.route { list-style: none; margin: 0; padding: 0; position: relative; }
/* El tramo de vía va de cada estación a la siguiente, así nunca sobresale bajo la última aunque el texto ocupe varias líneas. */
.route li { position: relative; display: grid; grid-template-columns: 34px 1fr auto; align-items: start; gap: var(--s3); padding: 8px 0; }
.route li:not(:last-child)::before { content: ""; position: absolute; left: 15px; top: 24px; height: 100%; width: 3px; background: var(--shallow); }
.route li > :nth-child(2) { padding-top: 3px; }
.route .station { position: relative; z-index: 1; width: 32px; height: 32px; border-radius: 50%; display: grid; place-items: center; background: var(--paper); border: 3px solid var(--sea); color: var(--sea); }
.route .station .icon { width: 15px; height: 15px; }
.route li[data-action="pausa"] .station { border-color: var(--sand); color: var(--sand-ink); }
.route li[data-action="salida"] .station { border-color: var(--exit-bg); background: var(--exit-bg); color: var(--exit-fg); }
.route li.is-superseded .station { border-style: dashed; border-color: var(--rule-strong); color: var(--ink-3); }
.route .time { font-size: var(--fs-lg); font-weight: 650; font-stretch: 80%; font-variant-numeric: tabular-nums; }
.route .what { font-size: var(--fs-sm); color: var(--ink-2); }

/* Barra del día (curva de marea horizontal) */
.daybar { position: relative; height: 12px; border-radius: 6px; background: var(--slate-soft); overflow: hidden; }
.daybar i { position: absolute; top: 0; bottom: 0; border-radius: 6px; background: var(--sea); }
.daybar i.p { background: var(--sand); border-radius: 0; }
.daybar i.live { background: linear-gradient(90deg, var(--sea), var(--wave)); }
.daybar b { position: absolute; top: -3px; bottom: -3px; width: 2px; background: var(--deep); opacity: 0.4; }

/* Tabla de mareas (semana) */
.tidetable { display: grid; gap: 2px; }
.tt-row {
  display: grid; grid-template-columns: 74px 1fr auto; align-items: center; gap: var(--s3);
  padding: 10px var(--s3); border-radius: var(--r-md); color: inherit; text-decoration: none;
  transition: background var(--t-fast);
}
a.tt-row:hover { background: var(--sea-soft); }
.tt-row.is-today { background: color-mix(in oklch, var(--sea-soft) 80%, transparent); }
.tt-row.is-today .tt-day b { color: var(--sea); }
.tt-day b { display: block; font-weight: 650; text-transform: capitalize; }
.tt-day span { font-size: var(--fs-xs); color: var(--ink-2); }
.tt-mid { display: grid; gap: 5px; min-width: 0; }
.tt-mid .spans { font-size: var(--fs-sm); color: var(--ink-2); font-variant-numeric: tabular-nums; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.tt-end { text-align: right; font-variant-numeric: tabular-nums; min-width: 64px; }
.tt-end b { display: block; font-size: var(--fs-lg); font-weight: 650; font-stretch: 80%; }
.tt-end span { font-size: var(--fs-xs); }
.tt-row.is-off { opacity: 0.72; }
.tt-row .tags { display: flex; flex-wrap: wrap; gap: 4px; }
.tt-total { display: flex; justify-content: space-between; gap: var(--s3); padding: var(--s3); border-top: 1.5px solid var(--rule-strong); margin-top: var(--s2); font-variant-numeric: tabular-nums; }
.tt-wrap { container-type: inline-size; }
.tt-cols, .tt-c { display: none; }
@container (min-width: 600px) {
  .tt-row, .tt-cols { grid-template-columns: 124px minmax(0, 1fr) 76px 76px 72px; }
  .tt-cols { display: grid; gap: var(--s3); padding: 0 var(--s3) 6px; font-size: var(--fs-xs); font-weight: 650; color: var(--ink-2); text-transform: uppercase; letter-spacing: 0.04em; }
  .tt-cols span:nth-child(n+3) { text-align: right; }
  .tt-c { display: block; text-align: right; font-weight: 600; font-variant-numeric: tabular-nums; }
  .tt-row .tt-end { display: none; }
}

/* Mes como calendario de niveles */
.monthtide { display: grid; grid-template-columns: repeat(7, minmax(0, 1fr)); gap: 4px; }
.monthtide .dow { font-size: var(--fs-xs); font-weight: 650; color: var(--ink-2); text-align: center; padding-bottom: 4px; }
.mt-cell {
  --level: 0; position: relative; aspect-ratio: 1 / 1.05; min-height: 52px; border-radius: var(--r-md); overflow: hidden;
  background: var(--paper); border: 1px solid var(--rule); color: inherit; text-decoration: none; isolation: isolate;
  display: flex; flex-direction: column; justify-content: space-between; padding: 6px;
  transition: transform var(--t-fast) var(--ease-out), box-shadow var(--t-fast);
}
a.mt-cell:hover { transform: translateY(-1px); box-shadow: var(--shadow-1); }
.mt-cell { --cap: 0.66; }
.mt-cell::after { content: ""; position: absolute; inset: auto 0 0 0; height: calc(min(var(--level), 1) * var(--cap) * 100%); background: linear-gradient(to bottom, var(--shallow), var(--wave)); z-index: -1; transition: height 700ms var(--ease-out); }
.mt-cell::before { content: ""; position: absolute; left: 0; right: 0; bottom: calc(var(--cap) * 100%); border-top: 1.5px dashed color-mix(in oklch, var(--deep) 45%, transparent); z-index: -1; }
.mt-cell.is-out::before, .mt-cell.is-holiday::before, .mt-cell.is-absence::before { display: none; }
.mt-cell.is-over::after { background: linear-gradient(to bottom, var(--sea), var(--deep)); }
.mt-cell .d { font-weight: 650; font-size: var(--fs-sm); font-variant-numeric: tabular-nums; }
.mt-cell .v { align-self: flex-start; padding: 0 5px; border-radius: 5px; background: color-mix(in oklch, var(--paper) 88%, transparent); font-size: 0.72rem; font-weight: 650; font-stretch: 80%; font-variant-numeric: tabular-nums; color: var(--ink); line-height: 1.5; }
.mt-cell .v:empty { display: none; }
.mt-cell.is-out { opacity: 0.35; }
.mt-cell.is-today { border: 2px solid var(--sea); }
.mt-cell.is-alert { box-shadow: inset 0 0 0 2px var(--buoy); }
.mt-cell.is-absence { background: var(--violet-soft); border-color: transparent; }
.mt-cell.is-holiday { background: var(--sand-soft); border-color: transparent; }
.mt-cell .flag { position: absolute; top: 6px; right: 6px; width: 8px; height: 8px; border-radius: 50%; background: var(--buoy); }

/* Calendario de equipo */
.teamcal { display: grid; grid-template-columns: repeat(7, minmax(0, 1fr)); gap: 4px; }
.tc-cell { min-height: 92px; border-radius: var(--r-md); background: var(--paper); border: 1px solid var(--rule); padding: 6px; display: grid; align-content: start; gap: 3px; min-width: 0; }
.tc-cell.is-out { opacity: 0.4; }
.tc-cell.is-today { border: 2px solid var(--sea); }
.tc-cell.is-holiday { background: var(--sand-soft); }
.tc-cell .d { font-size: var(--fs-xs); font-weight: 700; }
.tc-item { font-size: 0.7rem; font-weight: 600; border-radius: 5px; padding: 2px 5px; background: var(--sea-soft); color: var(--deep); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.tc-item.is-pending { background: transparent; outline: 1.5px dashed var(--deep); outline-offset: -1.5px; }
.tc-item.c-teal { background: var(--teal-soft); color: var(--teal); }
.tc-item.c-violet { background: var(--violet-soft); color: var(--violet); }
.tc-item.c-rose { background: var(--rose-soft); color: var(--rose); }
.tc-item.c-sand { background: var(--sand-soft); color: var(--sand-ink); }
.tc-item.c-slate { background: var(--slate-soft); color: var(--ink-2); }
@media (max-width: 640px) { .tc-cell { min-height: 64px; padding: 4px; } .tc-item { font-size: 0.6875rem; padding: 1px 3px; } }

/* Tablero de equipo */
.board { display: grid; gap: var(--s2); }
.board-row { display: grid; grid-template-columns: auto 1fr auto; align-items: center; gap: var(--s3); padding: var(--s3); border-radius: var(--r-md); background: var(--paper); border: 1px solid var(--rule); color: inherit; text-decoration: none; }
a.board-row:hover { border-color: var(--wave); }
.board-row .who b { display: block; font-weight: 620; }
.board-row .who span { font-size: var(--fs-xs); color: var(--ink-2); font-variant-numeric: tabular-nums; }
.board-row .lvl { width: 90px; }
@media (min-width: 760px) { .board--cols { grid-template-columns: repeat(2, minmax(0, 1fr)); } }

/* Saldos */
.balance { display: grid; gap: var(--s2); }
.balance__head { display: flex; justify-content: space-between; align-items: baseline; gap: var(--s3); }
.balance__value { font-size: var(--fs-3xl); font-weight: 650; font-stretch: 78%; font-variant-numeric: tabular-nums; line-height: 1; }
.balance__bar { height: 10px; border-radius: 5px; background: var(--slate-soft); overflow: hidden; display: flex; }
.balance__bar i { display: block; height: 100%; }
.balance__bar .used { background: var(--sea); }
.balance__bar .pend { background: color-mix(in oklch, var(--wave) 55%, transparent); }

/* Acceso */
.auth { min-height: 100dvh; display: grid; place-items: center; padding: var(--s5) var(--s4); background:
  radial-gradient(120% 70% at 50% 110%, color-mix(in oklch, var(--sea) 40%, transparent), transparent 60%),
  linear-gradient(to bottom, var(--abyss), var(--abyss-2)); }
.auth__card { width: min(100%, 420px); background: var(--paper); border-radius: var(--r-xl); box-shadow: var(--shadow-3); padding: var(--s6) var(--s5); }
.auth__brand { display: flex; align-items: center; gap: var(--s3); margin-bottom: var(--s5); color: var(--ink); }
.auth__brand .brand__text span { color: var(--ink-2); }
.auth h1 { font-size: var(--fs-2xl); margin-bottom: var(--s2); }
.auth .divider { display: flex; align-items: center; gap: var(--s3); color: var(--ink-2); font-size: var(--fs-sm); margin: var(--s4) 0; }
.auth .divider::before, .auth .divider::after { content: ""; flex: 1; height: 1px; background: var(--rule); }
.google-slot { min-height: 44px; display: grid; justify-items: center; }
.auth__foot { margin-top: var(--s5); text-align: center; font-size: var(--fs-sm); color: var(--ink-2); }
.auth__wave { position: fixed; inset: auto 0 0 0; height: 90px; pointer-events: none; opacity: 0.5; }
.protocol-text { white-space: pre-wrap; max-height: 52vh; overflow-y: auto; padding: var(--s4); border-radius: var(--r-md); background: var(--paper-2); border: 1px solid var(--rule); font-size: var(--fs-sm); line-height: 1.6; }

/* Skeleton */
.skeleton { background: linear-gradient(90deg, var(--slate-soft), var(--paper-2), var(--slate-soft)); background-size: 200% 100%; animation: shimmer 1.4s linear infinite; border-radius: var(--r-sm); }
@keyframes shimmer { to { background-position: -200% 0; } }

/* Entrada escalonada de listas */
.stagger > * { animation: rise 420ms var(--ease-out) both; }
.stagger > *:nth-child(2) { animation-delay: 30ms; } .stagger > *:nth-child(3) { animation-delay: 60ms; }
.stagger > *:nth-child(4) { animation-delay: 90ms; } .stagger > *:nth-child(5) { animation-delay: 120ms; }
.stagger > *:nth-child(6) { animation-delay: 150ms; } .stagger > *:nth-child(n+7) { animation-delay: 180ms; }
@keyframes rise { from { opacity: 0; transform: translateY(6px); } }

.done-burst { animation: burst 700ms var(--ease-out); }
@keyframes burst { 0% { box-shadow: 0 0 0 0 color-mix(in oklch, var(--sun) 70%, transparent); } 100% { box-shadow: 0 0 0 22px transparent; } }

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: 1ms !important; animation-iteration-count: 1 !important; transition-duration: 1ms !important; }
  .tide.is-working .tide__waves svg { animation: none !important; }
  ::view-transition-old(main-content), ::view-transition-new(main-content) { animation: none; }
}

@media print {
  .rail, .topbar, .tabbar, .page-head__actions, .btn, .toaster { display: none !important; }
  body { background: #fff; }
  .card { box-shadow: none; border: 1px solid #ccc; }
}

/* --- Ajustes de la revisión final -------------------------------------------------------------- */
@media (max-width: 1023px) { .hide-mobile { display: none; } }
.topbar .avatar { text-decoration: none; }
.topbar-state { display: inline-flex; align-items: center; gap: 5px; font-weight: 650; }
.topbar-state::before { content: ""; width: 7px; height: 7px; border-radius: 50%; background: currentColor; }
.topbar-state--dentro { color: oklch(0.83 0.13 162); }
.topbar-state--pausa { color: oklch(0.86 0.12 82); }
.topbar-state--fuera { color: var(--on-dark-2); }
.tide--static { height: clamp(130px, 20vh, 180px); margin-top: var(--s3); }
.clock-card__foot { padding: var(--s4) var(--s5) var(--s5); border-top: 1px solid var(--rule); }
.daybar-scale { position: relative; height: 16px; margin-top: 4px; font-size: 0.72rem; color: var(--ink-2); font-variant-numeric: tabular-nums; }
.daybar-scale span { position: absolute; transform: translateX(-50%); }
.daybar-scale span:nth-child(1) { left: 0; transform: none; } .daybar-scale span:nth-child(2) { left: 17.65%; }
.daybar-scale span:nth-child(3) { left: 35.29%; } .daybar-scale span:nth-child(4) { left: 52.94%; }
.daybar-scale span:nth-child(5) { left: 70.59%; } .daybar-scale span:nth-child(6) { left: 88.24%; }
.route .stamp { margin-left: 4px; vertical-align: 1px; }
.route li.is-superseded .what { color: var(--ink-3); }
.tt-row + .tt-row { border-top: 1px solid var(--rule); border-top-left-radius: 0; border-top-right-radius: 0; }
.tt-day b, .tt-cols, .tt-total, .tt-c, .tt-end b { font-stretch: 84%; }
.tt-total .num { text-align: right; }
.notice { padding: 0 !important; }
.notice__form { flex: 1; min-width: 0; margin: 0; }
.notice__row { all: unset; box-sizing: border-box; display: flex; align-items: center; gap: var(--s3); width: 100%; padding: var(--s3) 0; cursor: pointer; border-radius: var(--r-sm); }
.notice__row:hover .list__title { color: var(--sea); }
.notice__row:focus-visible { box-shadow: var(--focus); }
.notice__row .list__title, .notice__row .list__meta, .notice__row .small { display: block; }
.notice.is-unread .avatar { background: var(--sea); color: var(--on-sea); }
.notice__row > .icon { flex: none; color: var(--ink-3); }

/* Ajustes tras la segunda revisión: etiqueta del total sin partir, días libres sin marca de previsto */
.tt-total > .muted { white-space: nowrap; }
.mt-cell.is-free::before { display: none; }
.tt-total .seg { white-space: nowrap; }

/* --- Portada: la acción en el primer pantallazo (revisión del 10/10/2026) ----------------------- */
/* En móvil la zona de fichar ocupa el alto visible que dejan la barra superior y la inferior; la marea
   cede altura (con un mínimo) para que el botón quede siempre sobre la barra inferior, en la zona del pulgar. */
:root { --topbar-h: calc(24px + 2.6rem + env(safe-area-inset-top, 0px)); }
.clock-zone { display: grid; gap: var(--s4); }
@media (max-width: 1023px) {
  .page-head--home { position: absolute !important; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; margin: 0; }
  .clock-zone {
    --zone-h: calc(100vh - var(--topbar-h) - var(--s4) - var(--tabbar-h) - var(--safe-b) - var(--s3));
    display: flex; flex-direction: column; gap: var(--s3);
    min-height: min(var(--zone-h), 46rem);
  }
  @supports (height: 100svh) {
    .clock-zone { --zone-h: calc(100svh - var(--topbar-h) - var(--s4) - var(--tabbar-h) - var(--safe-b) - var(--s3)); }
  }
  .clock-zone.is-compact { min-height: 0; }
  .clock-zone > .clock-card { flex: 1 0 auto; display: flex; flex-direction: column; }
  .clock-zone .tide { flex: 1 1 0; height: auto; min-height: 64px; }
}

/* Línea de estado en una sola línea: estado y, si hay, fichajes pendientes de enviar */
.clock-card__state { justify-content: flex-start; }

/* Pausa de un toque: el botón dice qué motivo va a registrar */
.btn--pause .btn__stack { display: grid; text-align: left; line-height: 1.15; }
.btn--pause .btn__stack small { font-size: var(--fs-xs); font-weight: 560; color: var(--ink-2); }
.btn--pause .btn__stack small:empty { display: none; }
html:not(.js) .js-only { display: none !important; }

/* Pie de la tarjeta: el centro plegado a la izquierda y «Pausa con otro motivo» a la derecha */
.clock-foot {
  position: relative; z-index: 3; display: flex; align-items: center; gap: var(--s2);
  margin-top: calc(-1 * var(--s3)); padding: 0 var(--s4) var(--s3) var(--s5); background: var(--paper);
}
.clock-foot .btn { flex: none; min-height: 40px; margin-left: auto; }
.workplace {
  position: relative; display: inline-flex; flex: 0 1 auto; align-items: center; gap: 6px; min-width: 0; max-width: 100%; min-height: 40px;
  padding: 0 var(--s2); margin-left: calc(-1 * var(--s2)); border-radius: var(--r-sm);
  color: var(--ink-2); font-size: var(--fs-sm); font-weight: 560; cursor: pointer; transition: background var(--t-fast), color var(--t-fast);
}
.workplace:hover { background: var(--sea-soft); color: var(--ink); }
.workplace:focus-within { box-shadow: var(--focus); }
.workplace__name { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
/* Con JavaScript, el selector nativo queda invisible encima del texto (tamaño 16 px: iOS no amplía al tocarlo). */
.js .workplace__select { position: absolute; inset: 0; width: 100%; min-height: 0; height: 100%; padding: 0; border: 0; opacity: 0; cursor: pointer; font-size: 16px; }
html:not(.js) .workplace__name, html:not(.js) .workplace > .icon { display: none; }
html:not(.js) .workplace__select { width: auto; min-height: 36px; border-radius: var(--r-pill); }

/* Jornada anterior sin salida: arriba y con la acción a mano */
.stale { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: var(--s2) var(--s3); }
.stale p { margin: 0; flex: 1 1 220px; }
.stale .btn { flex: none; }

/* Hoy en una línea (móvil); en escritorio ancho, la ruta completa en su tarjeta */
.today-line {
  display: flex; align-items: center; gap: var(--s3); min-height: 48px; padding: var(--s3) var(--s4);
  border: 1px solid var(--rule); border-radius: var(--r-lg); background: var(--paper);
  color: var(--ink); text-decoration: none; font-size: var(--fs-sm);
  transition: border-color var(--t-fast);
}
.today-line:hover { color: var(--ink); border-color: var(--rule-strong); }
.today-line__label { flex: none; font-weight: 650; }
.today-line__text { flex: 1; min-width: 0; color: var(--ink-2); font-variant-numeric: tabular-nums; }
.today-line__text .time { color: var(--ink); font-weight: 650; font-stretch: 80%; }
.today-line__text s { color: var(--ink-3); }
.today-line > .icon { color: var(--ink-3); }
.card--today { display: none; }
@media (min-width: 1100px) {
  .card--today { display: block; }
  .today-line { display: none !important; }
}

/* Días con el registro incompleto: «por corregir» en lugar de un saldo que parecería una deuda */
.fix { color: var(--buoy-ink); font-weight: 600; white-space: nowrap; }
.tt-row.is-fix .tt-end b { color: var(--ink-3); }
@container (min-width: 600px) {
  .tt-row, .tt-cols { grid-template-columns: 124px minmax(0, 1fr) 76px 76px 92px; }
}

/* Fila de lista que es un botón (tema en «Más») */
.list__button { all: unset; box-sizing: border-box; display: flex; align-items: center; gap: var(--s3); flex: 1; min-width: 0; cursor: pointer; border-radius: var(--r-sm); }
.list__button:hover .list__title { color: var(--sea); }
.list__button:focus-visible { box-shadow: var(--focus); }

/* Avisos en la portada: arriba, para no tapar los botones de fichar que están sobre la barra inferior */
@media (max-width: 1023px) {
  .toaster--top { bottom: auto; top: calc(var(--topbar-h) + var(--s3)); }
  .toaster--top .toast:not(.is-leaving) { animation-name: toast-in-top; }
}
@keyframes toast-in-top { from { opacity: 0; transform: translateY(-14px) scale(0.98); } }

/* Tabla de la semana: las etiquetas largas parten línea y no invaden la columna del total */
.tt-mid { grid-template-columns: minmax(0, 1fr); }
.tt-row .tags .badge { white-space: normal; }

/* Pantallas bajas (iPhone SE con barras del navegador): la tarjeta se compacta y la marea puede ceder del todo */
@media (max-width: 1023px) and (max-height: 640px) {
  .clock-card__top { padding-top: var(--s4); }
  .timer { font-size: clamp(2.8rem, 13vw, 3.4rem); }
  .clock-zone .tide { min-height: 0; margin-top: var(--s3); overflow: hidden; }
  .clock-actions { padding-top: var(--s3); }
}

/* --- Administración: seis destinos, formularios plegados y tablas legibles (reorganización del 11/10/2026) --- */
/* Subnavegación de administración bajo la barra superior (solo sin rail). Hereda el abisal de la barra. */
.subnav { position: sticky; top: var(--topbar-h); z-index: 29; display: flex; gap: 2px; overflow-x: auto; padding: 0 var(--s3) 8px; background: var(--abyss); scrollbar-width: none; }
.subnav::-webkit-scrollbar { display: none; }
.subnav a { flex: none; display: inline-flex; align-items: center; gap: 6px; min-height: 36px; padding: 0 var(--s3); border-radius: var(--r-pill); color: var(--on-dark-2); text-decoration: none; font-size: var(--fs-sm); font-weight: 600; -webkit-tap-highlight-color: transparent; }
.subnav a .icon { width: 1.1em; height: 1.1em; }
.subnav a[aria-current="page"] { background: oklch(1 0 0 / 0.13); color: var(--on-dark); }
.subnav a[aria-current="page"] .icon { color: var(--wave); }
@media (min-width: 1024px) { .subnav { display: none; } }

/* Diálogo de formulario: la lista se ve primero; el alta se abre encima y conserva los valores si hay error. */
dialog.dialog--form { width: min(94vw, 600px); overflow: hidden; }
dialog.dialog--wide { width: min(96vw, 900px); }
.dialog--form .dialog__body { max-height: 92dvh; overflow-y: auto; overscroll-behavior: contain; }
.dialog__head { display: flex; align-items: flex-start; justify-content: space-between; gap: var(--s3); }
.dialog__head h2 { font-size: var(--fs-xl); }
.dialog__head p { margin: 4px 0 0; }
.dialog__head .btn-icon { margin: -8px -8px 0 0; flex: none; }
.dialog--form .form > .btn-row { justify-content: flex-end; }
@media (max-width: 640px) {
  dialog.dialog--form, dialog.dialog--wide { width: 100vw; max-width: 100vw; }
  .dialog--form .dialog__body { max-height: calc(94dvh - var(--safe-b)); }
}

/* Tablas en móvil como tarjetas de fila: título, una línea de datos y los badges, sin repetir cada cabecera en su línea.
   Las celdas fluyen en línea; `cell-lead` abre una línea nueva (un grupo de columnas por línea). */
@media (max-width: 760px) {
  .table--cards thead { display: none; }
  .table--cards, .table--cards tbody { display: block; width: 100%; }
  .table--cards tr { display: block; padding: var(--s3) var(--s4); border-bottom: 1px solid var(--rule); line-height: 1.65; }
  .table--cards tr:last-child { border-bottom: 0; }
  .table--cards td { display: inline; border: 0; padding: 0; margin-right: var(--s3); font-size: var(--fs-sm); color: var(--ink-2); white-space: normal; text-align: left; }
  .table--cards td[data-label]::before { content: attr(data-label) " "; color: var(--ink-3); }
  .table--cards td.cell-lead ~ td.cell-lead::before { content: "\A" attr(data-label) " "; white-space: pre-line; }
  .table--cards td.cell-title { display: block; margin: 0; font-size: var(--fs-md); font-weight: 650; color: var(--ink); line-height: 1.4; }
  .table--cards td.cell-title .small { display: inline; margin-left: 6px; font-weight: 400; }
  .table--cards td.cell-wide { display: block; margin: 6px 0 2px; }
  .table--cards td.cell-wide::before { display: none; }
  .table--cards td.cell-badges { display: flex; flex-wrap: wrap; gap: 4px; margin: 4px 0 0; }
  .table--cards td.cell-badges::before { display: none; }
  .table--cards td.cell-badges:empty { display: none; }
  .table--cards td.num { color: var(--ink); font-weight: 600; }
  .table--cards td.actions { display: flex; justify-content: flex-end; gap: var(--s2); margin: 6px 0 0; }
  .table--cards td.actions::before { display: none; }
}
/* Filas enlazables: toda la fila lleva al mismo sitio que su título. */
.table tr[data-href] { cursor: pointer; }

/* Selector de personas */
.picker { display: grid; gap: var(--s2); }
.picker__tools { display: flex; gap: var(--s2); }
.picker__tools .input { flex: 1; min-height: 40px; }
.picker__tools .btn { min-height: 40px; }
.picker__list { max-height: 260px; overflow-y: auto; display: grid; gap: 2px; padding: 2px; }
.picker__list .check { min-height: 36px; padding: 4px 6px; border-radius: var(--r-sm); align-items: center; }
.picker__list .check:hover { background: var(--sea-soft); }
.picker [data-picker-count] { margin: 0; }

/* Unidad dentro del campo */
.field--unit .field__control { position: relative; }
.field--unit .input { padding-right: 5.2rem; }
.field--unit .field__unit { position: absolute; right: 12px; top: 50%; transform: translateY(-50%); font-size: var(--fs-sm); color: var(--ink-2); pointer-events: none; white-space: nowrap; }

/* Atajos de periodo en los filtros */
.filters .quick { display: flex; flex-wrap: wrap; gap: 2px; flex-basis: 100%; margin: -4px 0 -6px; align-items: center; }
.filters .quick a { font-size: var(--fs-sm); font-weight: 600; padding: 8px 10px; border-radius: var(--r-pill); color: var(--sea); text-decoration: none; }
.filters .quick a:hover, .filters .quick a[aria-current="true"] { background: var(--sea-soft); color: var(--sea-strong); }

/* Resumen de la ficha de persona: bloques de datos que enlazan a su pestaña */
.facts { display: grid; gap: var(--s4); }
@media (min-width: 760px) { .facts { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
@media (min-width: 1180px) { .facts { grid-template-columns: repeat(3, minmax(0, 1fr)); } }
.facts > .card { margin: 0; display: grid; gap: var(--s3); align-content: start; }
.facts .card__head { margin-bottom: 0; }
.facts .kv { font-size: var(--fs-sm); }
.facts .figures { gap: var(--s2) var(--s5); }
.facts .figure b { font-size: var(--fs-xl); }

/* Panel: el cierre pendiente y lo que está por revisar llevan sus acciones */
.todo { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: var(--s3); }
.todo p { margin: 0; flex: 1 1 240px; }
.list > li.is-wrap { flex-wrap: wrap; }
.list .row-actions { display: flex; flex-wrap: wrap; gap: var(--s2); width: 100%; justify-content: flex-end; }

/* Auditoría legible: acción en texto y el detalle como pares clave-valor */
.audit-detail { display: inline-flex; flex-wrap: wrap; gap: 2px 10px; font-size: var(--fs-xs); color: var(--ink-2); }
.audit-detail span b { font-weight: 600; color: var(--ink-3); }

/* Año entre las flechas (calendario y saldos) */
.yearnav { display: inline-flex; align-items: center; gap: 2px; }
.yearnav b { min-width: 3.6em; text-align: center; font-weight: 650; font-variant-numeric: tabular-nums; }

/* Fila plegable con indicador: el chevron gira al abrir */
details.fold > summary { cursor: pointer; display: flex; justify-content: space-between; gap: var(--s3); align-items: center; list-style: none; }
details.fold > summary::-webkit-details-marker { display: none; }
details.fold > summary .fold__chevron { flex: none; color: var(--ink-3); transition: transform var(--t-fast); }
details.fold[open] > summary .fold__chevron { transform: rotate(180deg); }
.nowrap { white-space: nowrap; }
