@font-face {
  font-family: KronosInter;
  src: url("/inter.woff2") format("woff2");
  font-weight: 100 900;
  font-display: swap;
}
:root {
  --action: #156441;
  --nav-highlight: #e6f4ec;
  --control-hover: color-mix(in srgb, var(--text-muted) 5%, white);
  --action-hover: color-mix(in srgb, var(--action) 90%, black);
  --link-hover: color-mix(in srgb, var(--action) 75%, black);
  --focus-color: var(--action);
  --text: #18212f;
  --text-muted: #526075;
  --panel-line: #d9e0ea;
  --error-line: #a12b22;
  --error-text: #84231c;
  --warning-bg: #fff5da;
  --control-radius: 6px;
  --touch-min: 44px;
  --control-height: 48px;
  --query-gap: 12px;
  --query-hint: #757575;
  --query-secondary: #66758a;
  --section-gap: 16px;
  --heading-gap: 12px;
  --detail-row-inset: 10px;
  --action-gap: 10px;
  --control-line: #c8d4e1;
  --panel-shadow: 0 10px 28px rgba(24,33,47,.045);
}

* { box-sizing: border-box; }
body { margin: 0; background: #f6f8fb; color: var(--text); font: 16px/1.5 KronosInter,Inter,system-ui,sans-serif; }
header,nav { background: #fff; }
nav { border-bottom: 1px solid var(--panel-line); }
header>div,nav>div,main,footer { max-width: 980px; margin: auto; padding: 16px 24px; }
header>div { padding-block: 8px; }
header>div,.row { display: flex; align-items: center; justify-content: space-between; gap: 12px; flex-wrap: wrap; }
.account-menu { position: relative; margin-inline-start: auto; }
.profile-avatar {
  cursor: pointer; border: 0; padding: 0; font-family: inherit;
  display: inline-grid; place-items: center; flex: none; margin-inline-start: auto;
  width: var(--touch-min); height: var(--touch-min); border-radius: 50%;
  background: var(--action); color: white; font-size: .9375rem; font-weight: 500; text-decoration: none;
}
.profile-avatar[aria-expanded="true"] { outline: 1px solid var(--action); outline-offset: 2px; }
.profile-avatar:focus-visible { outline: 2px solid var(--action); outline-offset: 3px; }
.account-panel {
  position: absolute; inset-inline-end: 0; top: calc(100% + 8px); z-index: 30;
  display: grid; gap: 2px; width: min(248px, calc(100vw - 32px)); padding: 8px;
  background: white; border: 1px solid var(--panel-line); border-radius: 12px; box-shadow: 0 16px 34px rgba(24,33,47,.14);
}
.account-summary { display: grid; padding: 7px 10px 9px; margin-bottom: 2px; border-bottom: 1px solid var(--panel-line); overflow-wrap: anywhere; }
.account-summary strong { font-weight: 600; font-size: 1rem; line-height: 1.25; }
.account-summary span { font-size: .82rem; font-weight: 400; line-height: 1.3; color: var(--text-muted); }
#account-context { color: var(--text); font-weight: 400; margin-top: 2px; }
.account-exit { margin-top: 2px; padding-top: 4px; border-top: 1px solid var(--panel-line); }
.action-icon {
  width: 18px; height: 18px; flex: 0 0 18px; fill: none; stroke: currentColor;
  stroke-width: 1.75; stroke-linecap: round; stroke-linejoin: round;
}
.account-panel .action-icon { color: var(--text-muted); }
.btn .action-icon { margin-inline-end: 8px; }
.account-panel :is(a, button) {
  display: flex; align-items: center; width: 100%; min-height: var(--touch-min); padding: 6px 10px; gap: 10px;
  font: inherit; font-size: .94rem; font-weight: 500; color: var(--text); background: transparent; border: 0; text-decoration: none; cursor: pointer;
}
.account-panel :is(a, button) { border-radius: 8px; }
.account-panel { --hover-bg: var(--nav-highlight); --hover-ink: var(--action); }
.account-panel a[aria-current="page"] { background: var(--nav-highlight); color: var(--action); }
.account-exit { --hover-bg: color-mix(in srgb, var(--error-text) 7%, white); --hover-ink: var(--error-text); }
.brand { display: inline-flex; align-items: center; flex-wrap: wrap; max-width: 100%; font-size: 23px; font-weight: 750; letter-spacing: -.04em; }
.brand a { display: inline-flex; align-items: center; gap: 8px; min-height: var(--touch-min); color: inherit; text-decoration: none; }
.brand small { font-weight: 450; font-size: 15px; letter-spacing: 0; border-left: 1px solid var(--panel-line); margin-left: 12px; padding-left: 12px; }
nav>div { display: flex; gap: 4px; padding-block: 0; flex-wrap: nowrap; overflow-x: auto; }
a { color: #145c44; text-decoration: none; }
nav a,.btn { display: inline-flex; align-items: center; min-height: var(--touch-min); padding: 8px 14px; text-decoration: none; font-weight: 600; }
nav a { position: relative; isolation: isolate; color: var(--text-muted); font-size: .9375rem; font-weight: 500; }
.nav-label { display: grid; }
.nav-label > span, .nav-label::after { grid-area: 1 / 1; }
.nav-label::after { content: attr(data-label); visibility: hidden; font-weight: 700; }
nav a::before {
  content: ""; position: absolute; inset-inline: var(--nav-highlight-inset, 0); inset-block-start: 50%;
  height: 1.75rem; transform: translateY(-50%); z-index: -1;
  pointer-events: none; border-radius: var(--control-radius);
}
nav a[aria-current] { font-weight: 700; }
nav a[aria-current], nav a:focus-visible { color: var(--action); }
nav a[aria-current]::before, nav a:focus-visible::before { background: var(--nav-highlight); }
main { padding-top: 32px; }
h1, .page-heading { margin: 4px 0 20px; }
h1 { font-size: clamp(28px,4vw,38px); letter-spacing: -.045em; }
.page-heading {
  display: flex; align-items: baseline; flex-wrap: wrap; gap: 2px var(--section-gap);
}
.page-heading h1 { margin: 0; }
.page-heading time {
  border-inline-start: 1px solid var(--panel-line);
  padding-inline-start: var(--section-gap);
  font-size: .94rem;
}
.page-heading time span:last-child { display: none; }
@media (max-width: 600px) {
  .page-heading time span:first-child { display: none; }
  .page-heading time span:last-child { display: inline; }
}
h2 { font-size: 20px; margin: 0 0 var(--heading-gap); }
.card { background: white; border: 1px solid var(--panel-line); border-radius: 12px; padding: 24px; margin-bottom: var(--section-gap); }
.grid { display: grid; grid-template-columns: 1.55fr 1fr; gap: var(--section-gap) 16px; }
.time { font-size: clamp(42px,8vw,64px); font-weight: 650; letter-spacing: -.06em; line-height: 1.2; font-variant-numeric: tabular-nums; margin: 6px 0; }
.muted,footer { color: var(--text-muted); }
.pill { display: inline-block; white-space: nowrap; border-radius: 20px; padding: 3px 10px; font-weight: 500; font-size: 14px; }
/* Avisos transversales de ambos portales. */
.warn, .ok, .error-notice {
  border-inline-start: 4px solid var(--notice-line);
  background: var(--notice-bg);
  color: var(--notice-text);
  padding: 12px;
  margin-block: var(--section-gap);
  overflow-wrap: anywhere;
}
.warn { --notice-bg: var(--warning-bg); --notice-line: #976720; --notice-text: var(--text); }
.ok { --notice-bg: #edf7ef; --notice-line: #18784e; --notice-text: #155a39; }
.error-notice { --notice-bg: #fff1ef; --notice-line: var(--error-line); --notice-text: var(--error-text); }
.warn:empty, .ok:empty, .error-notice:empty { display: none; }
.line {
  min-block-size: calc(var(--touch-min) + 1px);
  padding-block: var(--detail-row-inset);
  border-block-end: 1px solid #e3e8ec;
  overflow-wrap: anywhere;
}
.line:last-child { border-block-end-color: transparent; }
.line > span { max-inline-size: 100%; }
.line:has(> .line-value .pill, > .line-value a) { padding-block: 0; }
.line:not(.row):has(> .line-value :is(.pill, .edit-action)) {
  display: flex; flex-wrap: wrap; align-items: center; column-gap: .25em;
}
.line-value:has(.edit-action) { display: flex; align-items: center; gap: 4px; }
.big { font-size: 25px; font-weight: 700; }
label { display: grid; gap: 6px; margin: 14px 0; font-weight: 500; }
:focus-visible { outline: 2px solid var(--focus-color); outline-offset: 2px; }
nav a:focus-visible { outline-offset: -2px; }
:is(input, select, textarea):focus {
  border-color: var(--field-focus, var(--focus-color));
  outline: 2px solid transparent;
  outline-offset: 0;
  box-shadow: 0 0 0 3px color-mix(in srgb, var(--field-focus, var(--focus-color)) 18%, transparent);
}
[aria-invalid="true"] { --field-focus: var(--error-line); }
footer { font-size: 13px; }
details summary { cursor: pointer; min-height: var(--touch-min); }
details[data-break] { margin-block: 8px; padding: 0 12px; border: 1px solid var(--panel-line); border-radius: var(--control-radius); }
details[data-break] > summary { padding-block: 10px; font-weight: 600; overflow-wrap: anywhere; }
details[data-break][open] { padding-bottom: 12px; }
details a { display: inline-block; padding: 8px; }
.calendar { display: grid; grid-template-columns: repeat(7,1fr); text-align: center; gap: 1px; }
.calendar > span { padding: 6px 0; }
.calendar .weekday { font-weight: 500; }
.selected { background: var(--action); color: white; border-radius: 6px; }
@media (max-width: 680px) {
  .grid { grid-template-columns: 1fr; gap: 0; }
  header > div, main, footer { padding-inline: 16px; }
  nav > div { --nav-highlight-inset: 2px; padding-inline: 8px; gap: 0; }
  nav a { font-size: 14px; padding-inline: 8px; }
  .card { padding: 18px; }
  main { padding-top: 20px; }
  .actions--mobile-stack > .btn { width: 100%; }
  .brand small { font-size: 13px; }
  .row { gap: 6px; }
}
.pill.success { background: #e6f4ec; color: #155a39; }
.pill.info { background: #f2eaf6; color: #79518c; }
.pill.negative { background: #fce8e8; color: #962929; }
.pill.paused { background: #e7f1fb; color: #214f78; }
.pill.pending { background: #fff1ca; color: #694900; }
nav a { flex-shrink: 0; white-space: nowrap; }
[hidden] { display: none!important; }
button { font: inherit; cursor: pointer; }
button:disabled { cursor: not-allowed; opacity: .65; }
button:disabled[aria-busy="true"] { cursor: progress; }
.card,.grid>* { min-width: 0; overflow-wrap: anywhere; }
.compact { max-width: 520px; }
.calendar a { text-decoration: none; min-height: var(--touch-min); display: grid; place-items: center; }
.filters { display: flex; gap: var(--query-gap); align-items: end; flex-wrap: wrap; }
.filters label { flex: 1 1 145px; }
.filters--compact > input { flex: 0 1 15rem; min-width: 0; max-width: 100%; }
#notice { position: fixed; bottom: 18px; left: 50%; transform: translateX(-50%); width: max-content; max-width: 92vw; margin: 0; box-shadow: 0 2px 8px #0002; display: flex; align-items: center; gap: 14px; }
#notice button { background: transparent; color: inherit; border: 0; min-width: var(--touch-min); min-height: var(--touch-min); }
.line a { display: inline-flex; align-items: center; min-height: var(--touch-min); }
h1:focus:not(:focus-visible) { outline: 0; }


.card, .access-layout .page-panel { box-shadow: var(--panel-shadow); }
input, select, textarea {
  width: 100%; font: inherit; min-height: var(--control-height); padding: 10px 12px; border: 1px solid var(--control-line);
  border-radius: var(--control-radius); color: #263548; background-color: white; font-weight: 400;
}
textarea { min-height: 78px; }
.btn { justify-content: center; margin: 0; padding-inline: 16px; background: white; color: var(--text); border: 1px solid var(--control-line); border-radius: var(--control-radius); font-weight: 400; }

.pri { color: white; background: var(--action); border-color: var(--action); }

.access-mark, .access-brand { display: none; }
.access-layout > header { display: none; }
.access-layout main { width: 100%; max-width: 552px; padding: 60px 16px 48px; }
.access-layout .access-mark {
  display: grid; place-items: center; margin: 0 auto 34px; width: 76px; height: 76px;
  border-radius: 50%; background: var(--action); color: white; font-size: 44px;
  font-weight: 750; line-height: 1; box-shadow: 0 14px 22px #15644130;
}
.access-layout .page-panel {
  background: white; border: 1px solid var(--panel-line); border-radius: 12px;
  text-align: center; padding: 36px 34px 28px;
}
.access-layout .page-heading { display: block; margin: 0; }
.access-layout h1 { margin: 0; font-size: 1.8rem; line-height: 1.1; letter-spacing: 0; }
.access-copy, .access-help { color: #58667a; font-size: 1rem; line-height: 1.45; }
.access-copy { max-width: 390px; margin: 8px auto 0; }
.access-help { margin: 14px auto 0; }
.access-form { display: grid; gap: 20px; margin-top: 20px; }
.access-form label { display: block; margin: 0; }
.access-form label + label { margin-top: -4px; }
.access-form .btn { min-height: var(--control-height); width: 100%; margin: 0; }
.actions--links { --action-column-gap: var(--section-gap); }
.access-layout .actions--links { justify-content: center; margin-top: 12px; }
.actions--links .btn {
  border: 0; background: transparent; color: var(--action); padding: 0; margin: 0;
  font-size: .94rem;
}
.access-layout .access-brand {
  display: block; margin: 14px 0 0; font-size: .82rem; font-weight: 850;
  color: #657085; line-height: 1.45; letter-spacing: .08em; text-transform: uppercase;
}
.access-layout #message:not(:empty) { margin-top: 20px; text-align: left; }
.sr-only {
  position: absolute; width: 1px; height: 1px; margin: -1px; padding: 0;
  overflow: hidden; clip-path: inset(50%); white-space: nowrap; border: 0;
}

.dialog {
  width: min(640px, calc(100% - 36px)); max-height: min(760px, calc(100dvh - 48px));
  padding: 24px; color: inherit; border: 1px solid var(--panel-line); border-radius: 14px;
  box-shadow: 0 28px 80px rgba(24,33,47,.24);
}
.dialog::backdrop { background: #18212f66; }
.dialog-heading { display: flex; align-items: center; justify-content: space-between; gap: 12px; }
.dialog-heading h2 { margin: 0; font-size: 1.35rem; }
.dialog-heading .btn { min-width: var(--touch-min); border-radius: 50%; }
.dialog label { font-size: .875rem; color: var(--text-muted); }
.dialog input { font-size: 1rem; }

@media (forced-colors: active) {
  nav a[aria-current]::before { outline: 1px solid Highlight; }
  :focus-visible, :is(input, select, textarea):focus { outline-color: Highlight; }
}

body:is([data-operation-busy], :has(#content[aria-busy="true"])) {
  &, & * { cursor: progress !important; }
}

.select-control { position: relative; display: grid; min-width: 0; }
.select-control select { appearance: none; min-width: 0; padding-right: 36px; }
.select-control svg {
  position: absolute; right: 12px; top: 50%; transform: translateY(-50%);
  width: 16px; height: 16px; color: #657085; pointer-events: none;
}
@media (forced-colors: active) {
  .select-control select { appearance: auto; }
  .select-control svg { display: none; }
}
.filters { margin-bottom: var(--section-gap); }
.filters label, .filters .btn { margin: 0; }
/* Shared Zeus query controls. Editing forms retain their 48px fields. */
.filters, .module-toolbar, .btn-add { --query-height: 36px; --query-padding-y: 4px; }
@media (max-width: 820px), (pointer: coarse) {
  .filters, .module-toolbar, .btn-add { --query-height: 44px; --query-padding-y: 8px; }
}
:is(.filters, .module-toolbar) :is(input, select, .btn), .btn-add {
  height: var(--query-height); min-height: var(--query-height); min-width: 0;
  font-size: 1rem; line-height: 1.5; padding-block: var(--query-padding-y); font-weight: 400;
}
.filters:not(.filters--compact) > label { flex: 0 1 148px; max-width: 100%; min-width: 0; }
.filters:not(.filters--compact) > label:has(select[name="employee_id"]) {
  flex: 0 1 max-content;
  max-inline-size: min(100%, 32rem);
}
.filters:not(.filters--compact) > .module-search:has([name="employee_name"]) { flex: 1 1 14rem; max-width: 22rem; }
.filters:not(.filters--compact) > .query-date { flex-basis: 150px; }
.filters:not(.filters--compact) > label:has(select[name="preset"]) { flex-basis: 180px; }
.query-date { position: relative; }
.query-hint {
  display: none; position: absolute; inset: 0; align-items: center; padding-inline: 12px 36px;
  pointer-events: none; color: var(--query-hint); font-weight: 400; font-size: 1rem; white-space: nowrap;
}
.query-date[data-empty]:not(:focus-within) .query-hint,
.select-control:has(option:checked[value=""]) .query-hint { display: flex; }
.query-date[data-empty]:not(:focus-within) input,
.select-control:has(.query-hint) select:has(option:checked[value=""]) { color: transparent; }
.query-date[data-empty]:not(:focus-within) input::-webkit-datetime-edit { opacity: 0; }
.select-control select option { color: var(--text); }
@media (forced-colors: active) {
  .select-control .query-hint { visibility: hidden; }
  .select-control:has(.query-hint) select:has(option:checked[value=""]) { color: CanvasText; }
}
.actions { display: flex; flex-wrap: wrap; align-items: center; row-gap: var(--action-gap); column-gap: var(--action-column-gap, var(--action-gap)); }
.actions + .actions { margin-top: var(--action-gap); }
.actions--footer { margin-top: var(--section-gap); }
.action-stack { display: grid; gap: var(--action-gap); }

.pill.neutral { background: #eef1f5; color: #445366; }
.field-group + .field-group { padding-top: var(--action-gap); border-top: 1px solid var(--control-line); }
[data-field-error] { display: block; }
[aria-invalid="true"] { border-color: var(--error-line); }
#update { text-align: center; }

.table-scroll { overflow-x: auto; }
.table-scroll table { width: 100%; border-collapse: collapse; text-align: left; }
.table-scroll td, .table-scroll th { padding: 8px; border-bottom: 1px solid var(--panel-line); }
fieldset { min-width: 0; }

.data-table :is(th, td) { white-space: normal; overflow-wrap: anywhere; }


.dialog { overflow-wrap: anywhere; }

.data-table { table-layout: fixed; font-size: .9rem; }
.balanced-columns { min-width: 30rem; }
.data-table .state-cell { text-align: center; }
.data-table .pill { max-width: 100%; white-space: normal; }
.data-table thead th { border-bottom: 0; background: #f6f8fb; color: var(--text-muted); font-weight: 600; }
.data-table .numeric { text-align: right; font-variant-numeric: tabular-nums; }
.data-table tbody tr:is(:hover, :focus-within) { background: #f6f8fb; }
.data-table td:has(.table-link) { padding-block: 0; }
.table-link { display: inline-flex; align-items: center; min-height: var(--touch-min); }
@media (max-width: 600px) {
  .balanced-columns { min-width: 20rem; font-size: .8125rem; }
  .balanced-columns .state-cell .pill { padding-inline: 4px; font-size: .75rem; overflow-wrap: normal; }
  .data-table .pill { padding-inline: 5px; font-size: inherit; }
  .data-table :is(th, td) { padding-inline: 2px; }
  .data-table .numeric { white-space: normal; overflow-wrap: normal; }
}

/* Shared interaction states for the employee and manager portals. */
.pri, .profile-avatar, .calendar .selected { --hover-bg: var(--action-hover); --hover-ink: white; }
.calendar a { border-radius: var(--control-radius); }
.actions--links { --hover-bg: transparent; --hover-ink: var(--link-hover); }
:is(.btn, .profile-avatar, .account-panel a, .account-panel button, .calendar a):not(:disabled):focus-visible {
  background: var(--hover-bg, var(--control-hover)); color: var(--hover-ink, var(--text));
}
@media (hover: hover) {
  nav a:hover { color: var(--action); }
  nav a:hover::before { background: var(--nav-highlight); }
  :is(.btn, .profile-avatar, .account-panel a, .account-panel button, .calendar a):not(:disabled):hover {
    background: var(--hover-bg, var(--control-hover)); color: var(--hover-ink, var(--text));
  }
  a:not(.btn, nav a, .account-panel a, .calendar a):hover { color: var(--link-hover); }
  .account-panel :is(a, button):hover .action-icon { color: inherit; }
}

/* Authenticated workspaces share the panel, section and table hierarchy. */
body:not(.access-layout) main { padding-block-start: 20px; }
body:not(.access-layout) .page-panel {
  padding: 20px; border: 1px solid var(--panel-line); border-radius: 12px;
  background: white; box-shadow: var(--panel-shadow);
}
body:not(.access-layout) .page-heading { align-items: center; margin: 0 0 var(--section-gap); }
body:not(.access-layout) .page-heading h1 { font-size: 1.375rem; line-height: 1.25; letter-spacing: -.02em; }
.heading-with-action { display: flex; align-items: flex-start; justify-content: space-between; flex-wrap: wrap; gap: 8px; }
.heading-with-action:has(> h2) { margin-block-end: var(--heading-gap); }
.heading-with-action > h2 { margin: 0; }
.year-navigation { display: flex; gap: 4px; }
.year-navigation .btn { min-width: var(--touch-min); }
.page-panel .card { padding: 0; border: 0; border-radius: 0; box-shadow: none; }
/* Shared block flow. Rows, table cells and controls within a label keep their
   own density. In normal block layout adjacent vertical margins collapse. */
:where(body:not(.access-layout)) :where(#content, .card, form:not(.filters), details, .dialog, .field-group, .flow-note) >
  :not(:where([hidden], input[type=hidden])) + :where(.actions, .flow-note, details, form:not(.filters), p:not(:empty), .warn, .ok),
:where(.page-panel) .actions + :where(.card, .table-scroll) {
  margin-block-start: var(--section-gap);
}
:where(body:not(.access-layout)) :where(form:not(.filters), details, .field-group) > label {
  margin-block: var(--section-gap);
}
:where(body:not(.access-layout)) #message:not(:empty) { margin-block: var(--section-gap); }
.page-panel .card + .card { padding-block-start: var(--section-gap); border-top: 1px solid var(--panel-line); }
.page-panel .card:last-child,
.admin-panel .card:has(+ #delivery:empty:last-child) { margin-bottom: 0; }
.page-panel .card h2 { font-size: 1.0625rem; }
.save-feedback:empty, #status:empty { display: none; }
.admin-panel tr:has(a[data-person-id]) td:not(:has(.table-icon-action)) { cursor: pointer; }
/* Zeus uses the compact chip as the baseline for a one-line row. */
.admin-panel .data-table {
  --table-cell-padding-y: 6px;
  --table-row-content-height: calc(.984rem + 8px);
}
.admin-panel .data-table tbody tr { height: calc(var(--table-row-content-height) + 2 * var(--table-cell-padding-y) + 1px); }
.admin-panel .data-table tbody td { padding-block: var(--table-cell-padding-y); }
.admin-panel .data-table .pill { line-height: .984rem; padding-block: 4px; vertical-align: middle; }
.edit-action {
  display: inline-flex; align-items: center; justify-content: center; vertical-align: middle;
  width: 32px; height: 32px; color: var(--text-muted); border-radius: var(--control-radius);
}
.edit-action svg { width: 16px; height: 16px; fill: currentColor; }
.edit-action:is(:hover, :focus-visible) { color: var(--action); background: var(--nav-highlight); }
@media (max-width: 820px), (pointer: coarse) {
  .edit-action { width: var(--touch-min); height: var(--touch-min); }
}
.table-icon-action {
  position: relative; display: inline-grid; place-items: center; vertical-align: middle;
  width: 32px; height: var(--table-row-content-height); color: var(--action); border-radius: var(--control-radius);
}
.table-icon-action::after { content: ""; position: absolute; inset-inline: 0; height: 32px; top: 50%; transform: translateY(-50%); }
.table-icon-action .action-icon { width: 20px; height: 20px; stroke-width: 2; }
@media (max-width: 820px), (pointer: coarse) {
  .data-table td:has(.table-icon-action) { padding-block: 0; }
  .table-icon-action { min-height: var(--touch-min); min-width: var(--touch-min); }
}

@media (max-width: 600px) { body:not(.access-layout) .page-panel { padding: 16px; } }

/* Administración comparte una cabecera de módulo para sus seis pestañas. */
body:not(.access-layout) .admin-panel .page-heading h1 { font-size: 1.15rem; }
.page-heading[role="navigation"] h1 { min-width: 0; overflow-wrap: anywhere; }
.page-heading[role="navigation"] h1 a { padding-block: calc((var(--touch-min) - 1em) / 2); }
.page-heading[role="navigation"] h1 .list-back {
  display: inline-grid; place-items: center; vertical-align: middle;
  margin-inline-end: .5rem; min-height: 2.25rem; padding: 0;
}
.list-back-icon {
  display: inline-grid; place-items: center; width: 2rem; height: 2rem;
  border-radius: 50%; background: #e7e9ed; color: #263548;
}
.list-back-icon svg {
  width: 1rem; height: 1rem; fill: none; stroke: currentColor;
  stroke-width: 1.7; stroke-linecap: round; stroke-linejoin: round;
}
.list-back:focus-visible .list-back-icon { background: var(--panel-line); }
@media (hover: hover) { .list-back:hover .list-back-icon { background: var(--panel-line); } }
@media (max-width: 820px), (pointer: coarse) {
  .page-heading[role="navigation"] h1 .list-back { min-width: 2.75rem; min-height: 2.75rem; }
  .list-back-icon { width: 2.25rem; height: 2.25rem; }
}
.page-heading[role="navigation"] h1 > span[aria-hidden="true"] { font-weight: 400; color: var(--text-muted); }
.page-heading[role="navigation"] h1 [aria-current="page"] { font-size: .9375rem; font-weight: 500; color: var(--text-muted); }
.page-heading h1.attendance-trail a + span + a,
.page-heading h1.attendance-trail [aria-current="page"] { font-weight: 400; }
.page-heading h1.attendance-trail > a:first-child { font-weight: 700; }
.module-toolbar { display: flex; align-items: center; flex-wrap: wrap; gap: var(--query-gap); margin-block-end: var(--section-gap); }
.module-search { position: relative; flex: 1 1 12rem; max-width: 25rem; margin: 0; min-width: 0; }
.module-search .action-icon { position: absolute; inset-inline-start: 12px; top: 50%; transform: translateY(-50%); pointer-events: none; }
.module-search input { margin: 0; padding-inline-start: 2.5rem; }

/* Las columnas de contenido comparten el espacio que dejan los campos acotados. */
.data-table th.col-date { width: 7rem; }
.data-table th.col-instant { width: 35%; }
.data-table th.col-source { width: 6rem; }
.data-table th.col-count { width: 6.5rem; }
.data-table th.col-state { width: 9rem; }
.data-table th.col-action { width: 4.5rem; }
.data-table :is(.col-action, .col-state) { text-align: center; }
.data-table .col-date { white-space: nowrap; font-variant-numeric: tabular-nums; }
.data-table :is(.table-link,.person-name) { max-width: 100%; overflow-wrap: anywhere; }
.originals-table { min-width: 32rem; }
.summary-table { min-width: 55.5rem; }
.summary-table small { display:block; font-size:.78rem; color:var(--text-muted); }
.summary-table th:nth-child(3) { width:9rem; }
.summary-table th:nth-child(4) { width:9rem; }
.summary-table th:nth-child(5) { width:6.5rem; }
.summary-quick [aria-pressed="true"] { background:var(--green-soft,#e6f4ec); }
.summary-table th.col-state { width: 12rem; }
.summary-table :is(th, td).col-activity { padding-inline-start: 1.5rem; }
.summary-table .pill { white-space: nowrap; }
.summary-table .pill + small { margin-block-start: 3px; }
.summary-table th { white-space: nowrap; }
.summary-table th.col-count { width: 7.25rem; }
@media (min-width: 601px) {
  .attendance-table th.col-date { width: 7rem; }
  .attendance-table th.col-state, .attendance-table th.col-duration { width: 8rem; }
  .personal-attendance th.col-date { width: 30%; }
  .personal-attendance th.col-state { width: 30%; }
  .personal-attendance th.col-duration { width: auto; }
  .employee-table th.col-state { width: 9rem; }
  .originals-table th:nth-child(2) { width: 8rem; }
  .originals-table th.col-instant { width: 13rem; }
}
.table-excerpt { display: block; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.table-link.incident-link { display: flex; gap: .25em; padding-block: 4px; }
.incident-link .table-excerpt { max-width: 32ch; }
.incident-link strong { flex: none; white-space: nowrap; font-variant-numeric: tabular-nums; }
.case-table { min-width: 46rem; }
.admin-panel .case-table td:has(.incident-link) { padding-block: 0; }
.case-table .incident-link {
  min-height: calc(var(--table-row-content-height) + 2 * var(--table-cell-padding-y));
}
@media (max-width: 820px), (pointer: coarse) {
  .case-table .incident-link { min-height: var(--touch-min); }
}
.case-table th.col-person { width: 12rem; }
.case-table th.col-record-date { width: 6.5rem; }
@media (max-width: 600px) {
  .originals-table { min-width: 28rem; }
  .summary-table { font-size: .8125rem; }
  .data-table th.col-count, .data-table th.col-source { width: 5rem; }
  .case-table th.col-source { width: 6rem; }
  .data-table th.col-date { width: 6rem; }
  .data-table th.col-state { width: 6.5rem; }
  .data-table th.col-action { width: 3.5rem; }
  .ledger-table td.numeric { font-size: .75rem; padding-inline: 1px; }
  .ledger-table th:first-child { width: 4.75rem; }
  .ledger-table th.state-cell { width: 4.75rem; }
  .ledger-table th.col-action { width: 2.875rem; padding-inline: 0; }
  .ledger-table .table-link { white-space: nowrap; }
  .attendance-table { min-width: 20rem; font-size: .8125rem; }
  .attendance-table :is(th, td) { padding-inline: 4px; }
  .attendance-table th.col-date { width: 25%; }
  .attendance-table th.col-state { width: 27%; }
  .attendance-table th.col-duration { width: 22%; }
  .attendance-table:has(.col-action) { min-width: 28rem; }
  .attendance-table.personal-attendance { min-width: 20rem; }
  .attendance-table:has(.col-action) th.col-date { width: 5.25rem; }
  .attendance-table:has(.col-action) th.col-duration { width: 5.25rem; }
  .attendance-table:has(.col-action) .pill { white-space: nowrap; }
  .attendance-table:has(.col-action) th.col-state { width: 5.75rem; }
  .attendance-table:has(.col-action) th:first-child { white-space: nowrap; padding-inline-end: 0; }
  .attendance-table:has(.col-action) .col-state .pill { padding-inline: 3px; }
  .attendance-table th.col-action { width: 3.25rem; padding-inline: 0; white-space: nowrap; }
}

.person-name { display: inline-flex; align-items: center; }
.table-date { display: inline-flex; align-items: center; font-variant-numeric: tabular-nums; }
@media (max-width: 820px), (pointer: coarse) {
  .admin-panel .data-table td:has(.table-date, .person-name) { padding-block: 0; }
  .table-date, .person-name { min-height: var(--touch-min); }
}

.day-summary {
  display: grid; grid-auto-flow: column; grid-auto-columns: minmax(0, 1fr);
  margin: 0; padding: 14px 0; background: #f6f8fb;
  border: 1px solid var(--panel-line); border-radius: 8px;
}
.day-summary > div { padding-inline: 8px; overflow-wrap: anywhere; }
.day-summary dt { margin-bottom: 4px; color: var(--text-muted); font-size: .8125rem; font-weight: 550; }
.day-summary dd { margin: 0; font-size: 1.35rem; line-height: 1.3; font-weight: 650; font-variant-numeric: tabular-nums; }
.day-summary > div:first-child dd { display: flex; }
.day-summary .undetermined { color: var(--text-muted); font-size: 1rem; font-weight: 500; }
@media (max-width: 600px) {
  .day-summary dd { font-size: 1.05rem; }
  .day-summary .pill { white-space: normal; }
  .day-summary:has(> div:nth-child(2):last-child) { grid-auto-flow: row; gap: 10px; }
  .day-summary:has(> div:nth-child(2):last-child) > div:first-child {
    grid-column: 1 / -1; display: flex; align-items: center; gap: 10px; flex-wrap: wrap;
    border-bottom: 1px solid var(--panel-line); padding-bottom: 10px;
  }
  .day-summary:has(> div:nth-child(2):last-child) > div:first-child dt { margin: 0; }
}
.admin-panel .day-summary:has(> div:nth-child(3)) {
  grid-template-columns: minmax(0, 1fr) minmax(0, 1.25fr) minmax(0, 1fr);
  text-align: center;
}
.admin-panel .day-summary:has(> div:nth-child(3)) > div:first-child dd { justify-content: center; }
@media (max-width: 600px) {
  .admin-panel .day-summary:has(> div:nth-child(3)) {
    grid-auto-flow: row; grid-template-columns: repeat(2, minmax(0, 1fr)); row-gap: 12px;
  }
  .admin-panel .day-summary:has(> div:nth-child(3)) > div:first-child {
    grid-column: 1 / -1; display: flex; justify-content: center; align-items: center; gap: 8px;
  }
  .admin-panel .day-summary:has(> div:nth-child(3)) > div:first-child dt { margin: 0; }
}
.incident-table { table-layout: fixed; min-width: 36rem; }
.incident-table th:nth-child(2) { width: 7rem; }
.incident-table th:nth-child(3) { width: 8rem; }
.incident-table th:nth-child(4) { width: 21%; }
.case-table th.col-state, .incident-table th:last-child { width: 7.5rem; }
:is(.case-table, .incident-table) .pill { white-space: nowrap; }
.incident-table td { white-space: normal; overflow-wrap: anywhere; }
.incident-table td:nth-child(2), .incident-table time { font-variant-numeric: tabular-nums; }
.incident-table td:nth-child(2) { white-space: nowrap; }
.incident-table .table-link { max-width: 100%; }
@media (max-width: 600px) {
  .incident-table { font-size: .8125rem; }
  .incident-table th:nth-child(2) { width: 5.4rem; }
  .incident-table th:nth-child(3) { width: 7rem; }
}
.punch-table { table-layout: fixed; }
.punch-table th:first-child { width: 7rem; }
.punch-table th:last-child { width: 9rem; }
@media (max-width: 600px) {
  .punch-table th:first-child { width: 5.25rem; }
  .punch-table th:last-child { width: 6.5rem; }
}
.punch-table :is(th, td):nth-child(3) { text-align: center; }
.punch-table :is(td, th) { padding-inline: 8px; overflow-wrap: anywhere; }
.punch-table :is(td, th) { white-space: normal; vertical-align: middle; }
.punch-table .punch-hour { font-variant-numeric: tabular-nums; }
.punch-table .pill { white-space: normal; overflow-wrap: normal; }
.punch-table tbody td:has(.punch-toggle) { padding-block: 0; }
.punch-toggle { display: inline-flex; align-items: center; gap: 6px; min-height: 32px; max-width: 100%; padding: 0; border: 0; background: transparent; color: var(--action); font: inherit; text-align: start; cursor: pointer; }
.punch-toggle span { display: inline-block; font-size: 1.2em; }
.punch-toggle[aria-expanded=true] span { transform: rotate(90deg); }
.punch-facts { display: grid; grid-template-columns: repeat(auto-fit,minmax(min(100%,14rem),1fr)); gap: 12px 20px; margin: 0; padding: 8px; }
.punch-facts dt { font-size: .82rem; color: var(--text-muted); }
.punch-facts dd { margin: 2px 0 0; }
@media (max-width: 820px), (pointer: coarse) { .punch-toggle { min-height: var(--touch-min); } }

/* The shared page heading and date sit above the three home panels. */
body:not(.access-layout) .page-panel:has(.journey-dashboard) {
  padding: 0; border: 0; background: transparent; box-shadow: none;
}
.journey-dashboard, .journey-details { display: grid; gap: var(--section-gap); }
.journey-details { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.journey-dashboard .card, .journey-dashboard .card + .card {
  margin: 0; padding: 20px; border: 1px solid var(--panel-line);
  border-radius: 12px; box-shadow: var(--panel-shadow);
}
.journey-dashboard > .card { padding-block: 24px; text-align: center; }
.journey-dashboard [role="timer"] + .muted { position: relative; top: -9px; }
.journey-dashboard > .card .actions { justify-content: center; }
.journey-dashboard .actions:has(> [data-action="CLOCK_OUT"]) {
  display: grid; grid-template-columns: repeat(2, minmax(0, 12.5rem)); align-items: stretch;
}
.journey-dashboard .actions > [data-action] { grid-column: 1; min-width: 0; overflow-wrap: anywhere; }
.journey-dashboard .actions > [data-action="CLOCK_OUT"] { grid-column: 2; grid-row: 1; }
.journey-dashboard > .card :is(.warn, .ok) { max-width: 60ch; margin-inline: auto; text-align: start; }
@media (max-width: 680px) {
  .journey-dashboard .actions:has(> [data-action="CLOCK_OUT"]) > .btn {
    padding-inline: 4px; font-size: .9375rem;
  }
  .journey-dashboard .actions > [data-action] .action-icon { margin-inline-end: 4px; }
  .journey-details { grid-template-columns: minmax(0, 1fr); }
  .journey-dashboard .card, .journey-dashboard .card + .card { padding-inline: 16px; }
}

.punch-span { display: block; padding-bottom: 6px; color: var(--text-muted); font-variant-numeric: tabular-nums; }

.weekdays { display: flex; flex-wrap: wrap; gap: 6px 16px; margin-bottom: 14px; }
.weekdays label { display: inline-flex; align-items: center; gap: 6px; margin: 0; }
.weekdays input[type=checkbox] { width: 1.1rem; height: 1.1rem; min-height: 0; margin: 0; }
[data-flex-group] fieldset { margin-block: 12px; }

fieldset[data-mode], [data-flex-group], [data-flex-group] fieldset, [data-date-presence], [data-date-presence] fieldset {
  border: 0; padding: 0; margin-inline: 0;
}
[data-flex-group] { padding-block: 12px; }
[data-flex-group] legend, [data-date-presence] legend { font-weight: 500; }
[data-window] { display: flex; align-items: end; flex-wrap: wrap; gap: 8px; }
[data-window] legend { position: absolute; width: 1px; height: 1px; overflow: hidden; clip-path: inset(50%); }
[data-window] label { flex: 1 1 7.5rem; min-width: 0; margin: 0; }
.flex-summary { padding: 10px 12px; background: var(--panel-bg, #f6f8fb); }

.page-panel:has(> #content > .planning-tabs:first-child) > .page-heading {
  margin-block-end: var(--heading-gap);
}
.planning-tabs { margin-bottom: var(--section-gap); }
.planning-tabs:has(+ .card > .line:first-child) { margin-block-end: 0; }
.vacation-year { width: fit-content; margin-block-end: var(--section-gap); }
.vacation-year label { margin: 0; }
.planning-tabs > div { padding-inline: 0; }
@media (max-width: 600px) {
  .employee-tabs > div { flex-wrap: wrap; }
  .employee-tabs a { padding-inline: 6px; }
}
.page-panel .planning-tabs ~ [data-planning-part] { padding-top: 0; border-top: 0; margin-bottom: 0; }

.calendar a.vacation-day { box-shadow: inset 0 -3px var(--action); }

/* Preserve separation between consecutive visible sections inside tabbed panels. */
.page-panel .planning-tabs ~ [data-planning-part]:not([hidden]) ~ [data-planning-part]:not([hidden]) {
  margin-block-start: var(--section-gap);
  padding-block-start: var(--section-gap);
  border-block-start: 1px solid var(--panel-line);
}
.page-panel form + h3 { margin-block-start: var(--section-gap); }
.holiday-list { list-style: none; padding: 0; }
.holiday-list li { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding-block: 8px; border-bottom: 1px solid var(--panel-line); }
.holiday-list small { display: block; color: var(--text-muted); }
.holiday-list li > div { overflow-wrap: anywhere; }

.calendar .holiday-day:not(.selected) { background: #fce9e8; color: #872b29; }
.calendar .holiday-day { font-weight: 650; }
.calendar .sunday:not(.selected) {
  color: #872b29;
  font-weight: 700;
  --hover-ink: #872b29;
  --hover-bg: transparent;
}
.calendar .sunday.holiday-day:not(.selected) { --hover-bg: #fce9e8; }

.heading-with-help { display: flex; align-items: center; gap: 8px; margin-bottom: var(--heading-gap); }
.heading-with-help h2 { margin: 0; }
.help-tip {
  position: relative; display: inline-grid; place-items: center; width: 18px; height: 18px; padding: 0;
  border: 1px solid var(--control-line); border-radius: 50%; background: var(--nav-highlight); color: var(--text-muted);
  font-size: .75rem; font-weight: 800; line-height: 1; cursor: help;
}
.help-tip::before { content: ""; position: absolute; inset: -7px; }
.floating-help-tooltip {
  position: fixed; z-index: 1000; width: max-content; max-width: min(30rem, calc(100vw - 24px));
  padding: 8px 12px; border-radius: 8px; background: var(--text); color: white;
  box-shadow: 0 14px 32px rgb(24 33 47 / 18%); text-align: left;
  font-size: .875rem; font-weight: 400; line-height: 1.35; overflow-wrap: anywhere;
}

.excerpt-tooltip { white-space: pre-wrap; overflow-y: auto; }

.vacation-month, .vacation-legend { display: flex; align-items: center; justify-content: center; gap: .75rem; }
.vacation-month-picker { position: relative; display: grid; place-items: center; min-height: var(--touch-min); padding-inline: 1rem; margin: 0; border: 1px solid var(--control-line); border-radius: var(--control-radius); }
.vacation-month-picker input { position: absolute; inset: 0; width: 100%; height: 100%; margin: 0; opacity: 0; cursor: pointer; }
.vacation-month-picker:focus-within { outline: 2px solid var(--action); }
.vacation-grid { grid-template-columns: repeat(7,minmax(0,1fr)); touch-action: pan-y pinch-zoom; user-select: none; -webkit-user-select: none; }
.vacation-grid button { min-height: var(--touch-min); padding: 0; border: 0; background: transparent; color: inherit; border-radius: 5px; }
.vacation-grid button[aria-disabled=true] { color: var(--text-muted); cursor: default; }
.vacation-grid button[aria-pressed=true] { outline: 2px solid var(--action); outline-offset: -2px; background: #e6f2eb; }
.vacation-grid button:focus-visible { outline: 3px solid var(--text); outline-offset: -3px; }
.vacation-grid .vacation-pending { border-bottom: 3px dashed #905a10; }
.vacation-grid .vacation-approved { border-bottom: 3px solid var(--action); }
.vacation-legend { margin-block-start: var(--section-gap); flex-wrap: wrap; font-size: .8125rem; }
.vacation-grid button.coverage-blocked, .vacation-legend .coverage-blocked { background: rgb(195 52 54 / 22%); }
.vacation-grid button.coverage-demand, .vacation-legend .coverage-demand { background: rgb(239 177 25 / 25%); }
.vacation-legend .coverage-blocked, .vacation-legend .coverage-demand { padding-inline: .3rem; border-radius: 3px; }
.vacation-legend span:first-child { background: #fce9e8; padding-inline: .25rem; }
.vacation-legend span:nth-child(2) { border-bottom: 3px dashed #905a10; }
.vacation-grid .vacation-approved:where(:not(.holiday-day, [aria-pressed=true])), .vacation-legend .vacation-approved {
  background: rgb(21 100 65 / 14%);
}
.vacation-legend .vacation-approved { padding-inline: .3rem; border-radius: 3px; border-bottom: 3px solid var(--action); }
[data-holiday-detail]:empty { display: none; }

@media (max-width: 600px) {
  [data-form="vacation-preview"] > .actions { position: sticky; bottom: .5rem; z-index: 1; background: white; border-radius: var(--control-radius); }
  :is([data-vacation-quote].warn, [data-vacation-quote]:has(.warn)) ~ .actions:has([data-vacation-send]:disabled) { position: static; }
}

.filters.incident-filters > label:has(input[type="search"]) { flex: 1 1 14rem; }
.data-table .table-sort {
  display: inline-flex; align-items: center; gap: 4px; max-width: 100%;
  margin: 0; padding: 0; min-height: 0; border: 0; background: none;
  color: inherit; font: inherit; text-align: inherit;
}
.table-sort svg {
  flex: none; width: 1em; height: 1em; fill: none; stroke: currentColor;
  stroke-width: 1.5; stroke-linecap: round; stroke-linejoin: round; opacity: 0;
}
th:is([aria-sort="ascending"],[aria-sort="descending"]) .table-sort svg,
.table-sort:is(:hover,:focus-visible) svg { opacity: 1; }
@media (hover: none) { .table-sort svg { opacity: 1; } }
@media (max-width: 600px) {
  .data-table th:has(.table-sort) { padding-inline: 3px; }
  .data-table .table-sort { gap: 1px; }
  .summary-table th.col-state { width: 10.5rem; }
  .summary-table :is(th, td).col-activity { padding-inline-start: 1rem; }
  .summary-table th.col-count { width: 6rem; }
}

.data-table .table-sort span { white-space: nowrap; }
.filters .module-search input { padding-inline-start: 2.5rem; }
.filters.incident-filters > label:has(select[name="period"]) { flex-basis: 13rem; }
.module-search .action-icon, :is(.filters, .module-toolbar, .module-search) input::placeholder {
  color: var(--query-hint); opacity: 1;
}
:is(.filters, .module-toolbar) .select-control:not(:has(.query-hint)) select:has(option:checked[value=""]) {
  color: var(--query-hint);
}
.summary-quick button[aria-pressed="false"] { color: var(--query-secondary); }
.summary-period > span { color: var(--query-secondary); min-inline-size: 15ch; }
.summary-period, [data-summary-dates] { margin-block-end: var(--query-gap); }
.summary-period + [data-summary-dates] { margin-block-start: 0; }
.select-caption {
  position: absolute; inset-inline: 12px 34px; top: 3px; color: var(--text-muted);
  font-size: .75rem; line-height: 1.25; pointer-events: none;
}
.select-control:has(.select-caption) select { padding-block: 20px 4px; }

.checkbox-group { display: grid; gap: 0; }
.checkbox-group > label { margin: 0; font-weight: 400; }
.checkbox-group > label:first-child:not(:only-child) { padding-block-start: 4px; }
.checkbox-group > label:last-child:not(:only-child) { padding-block-end: 4px; }
.notification-option { display: flex; align-items: center; gap: .6rem; min-height: var(--touch-min); }
.notification-option input[type=checkbox] { flex: none; width: 1.1rem; height: 1.1rem; min-height: 0; margin: 0; }

/* Editing forms share field widths. Query toolbars and the access panel have
   their own layouts. Group only controls that belong to the same decision. */
.field-row { display: contents; }
form {
  --standard-field-width: 32rem;
  --short-field-width: 13rem;
}
body:not(.access-layout) form:not(.filters) label:where(:has(> :is(input:not([type=checkbox],[type=radio]), textarea), > .select-control)):not(:where(.vacation-month-picker)) {
  --field-width: var(--standard-field-width);
  max-inline-size: min(100%, var(--field-width));
}
body:not(.access-layout) form:not(.filters) label:has(> input[type=date]) {
  --field-width: var(--short-field-width);
}
body:not(.access-layout) form:not(.filters) label:has(> textarea, > input:is([name=customReason],[name=comment])) {
  --field-width: var(--long-field-width, 44rem);
}
body:not(.access-layout) form:not(.filters) input[type=number] {
  inline-size: min(100%, 8rem);
}
body:not(.access-layout) form:not(.filters) input[type=time] {
  inline-size: min(100%, 10rem);
}
body:not(.access-layout) form:not(.filters) label:has(> .select-control) {
  inline-size: fit-content;
  max-inline-size: 100%;
}
body:not(.access-layout) form[data-form=correction] label:has(select:is([name=action],[name=target],[name=reason])) {
  inline-size: min(100%, 17rem);
}
body:not(.access-layout) form[data-op=create] label:has(select:is([name=site_id],[name=department])) {
  inline-size: min(100%, 18rem);
}
.card label:has(select:is([name=first_month],[name=last_month])) {
  inline-size: min(100%, 14rem);
}
body:not(.access-layout) form[data-op=vacationPolicy] label:has(select:is([name=first_month],[name=last_month])) {
  inline-size: min(100%, 14rem);
}
body:not(.access-layout) form[data-op=deactivate] label:has(select[name=reason]) {
  inline-size: min(100%, var(--short-field-width));
}
form[data-op=deactivate] select[name=reason] { padding-inline-end: 30px; }
body:not(.access-layout) form[data-op=schedule] label:has(select:is([name=zone], [name=reason])) {
  inline-size: min(100%, 19.8125rem);
}
@media (min-width: 1024px) {
  form[data-op=calendar]:has(input[name=holiday_date]) {
    --long-field-width: calc(var(--standard-field-width) + var(--section-gap) + var(--short-field-width));
  }
  .field-row:has(input[name=holiday_date]) {
    max-inline-size: var(--long-field-width);
    flex-wrap: nowrap;
  }
  .field-row {
    display: flex; flex-wrap: wrap; align-items: end;
    gap: var(--section-gap); margin-block: var(--section-gap);
  }
  .field-row > label { flex: 0 1 var(--field-width); min-width: 0; margin: 0; }
  .field-row > label:has(> .select-control, > input:is([type=time],[type=number])) { flex-basis: auto; }
}
form:not(.filters) .select-control {
  grid-template-columns: minmax(0, 1fr);
  max-inline-size: 100%;
}
form:not(.filters) .select-control select {
  grid-area: 1 / 1;
  inline-size: auto;
  max-inline-size: 100%;
}
form:not(.filters) .select-control :is(.select-caption, .query-hint) {
  grid-area: 1 / 1;
  position: relative;
  inset: auto;
  z-index: 1;
}
form:not(.filters) .select-caption {
  align-self: start;
  margin: 3px 36px 29px 12px;
}
form:not(.filters) .select-control:has(.query-hint) .query-hint {
  display: flex;
  visibility: hidden;
}
form:not(.filters) .select-control:has(option:checked[value=""]) .query-hint {
  visibility: visible;
}
@media (forced-colors: active) {
  form:not(.filters) .select-control:has(option:checked[value=""]) .query-hint { visibility: hidden; }
}

/* El buscador sigue al título. El alta ocupa su propia columna. */
.admin-panel .page-heading:has(> #people-toolbar:not([hidden])) {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: start;
  gap: var(--section-gap);
}
#new-person { grid-column: 2; grid-row: 1 / span 2; }
#people-toolbar { grid-column: 1; grid-row: 2; margin: 0; }
@media (max-width: 600px) {
  .admin-panel .page-heading:has(> #people-toolbar:not([hidden])) { row-gap: var(--heading-gap); }
  #new-person { grid-row: 1; }
  #people-toolbar { grid-column: 1 / -1; }
}
.vacation-requests { min-width: 46rem; }
.vacation-requests:has(th.action) { min-width: 57rem; }
.vacation-requests:has(th.person) { min-width: 55.5rem; }
.vacation-requests:has(th.person):not(.pending-requests) th.period { width: 10rem; }
.vacation-requests th.period { width: 11.5rem; }
.vacation-requests th.days { width: 3rem; }
.vacation-requests th.state-cell { width: 12rem; }
.vacation-requests th.date { width: 6rem; }
.my-vacation-requests th.date, .pending-requests th.date { width: 7rem; }
.vacation-requests th.action { width: 11rem; }
.vacation-requests th.person { width: 8.5rem; }
.vacation-requests td.action .btn { width: 100%; text-align: center; font-size: inherit; padding-inline: 8px; white-space: nowrap; }
.vacation-requests:has(th.person) th.action { width: 4.5rem; padding-inline: 4px; }
.vacation-requests th { white-space: nowrap; }
.vacation-requests .state-cell .pill, .vacation-requests .date { white-space: nowrap; }
.vacation-requests td.action { padding-block: 8px; }

.vacation-table-scroll { container-type: inline-size; }
.vacation-requests.pending-requests:has(th.person) { min-width: 46rem; }
.pending-requests th.date { width: 8rem; }
.pending-requests th.person { width: auto; }
.pending-requests th.state-cell { width: 8rem; }
.vacation-detail-body { position: sticky; inset-inline-start: 8px; max-width: calc(100cqi - 16px); white-space: normal; }

.my-vacation-requests th.period { width: 10rem; }
.my-vacation-requests:has(th.action) { min-width: 54.5rem; }
@container (max-width: 54.49rem) {
  .my-vacation-requests { font-size: .8125rem; }
  .my-vacation-requests:has(th.action) { min-width: 46rem; }
  .my-vacation-requests :is(th, td) { padding-inline: 4px; }
  .my-vacation-requests th.period { width: 7rem; }
  .my-vacation-requests th.days { width: 2.5rem; }
  .my-vacation-requests th.state-cell { width: 10.25rem; }
  .my-vacation-requests th.date { width: 5.75rem; }
  .my-vacation-requests th.action { width: 10rem; }
  .my-vacation-requests .pill { font-size: inherit; padding-inline: 5px; }
}


.vacation-fields > summary { align-content: center; }
.vacation-fields > .field-row { margin-block-start: 0; }
.vacation-fields .field-row > label:first-child { margin-block-start: 0; }

/* El contenedor controla la separación cuando los filtros cambian de fila. */
.module-toolbar > label, [data-mode="daily"] > label { margin-block: 0; }
.access-form > [data-field-error] { margin-block: 0; }
.actions--footer:has(> .save-feedback:not(:empty)) { row-gap: var(--section-gap); }
.actions--footer > .save-feedback { margin-block: 0; }

[data-change] > label:first-child { margin-block-start: 0; }
[data-change] > .field-row:last-child,
[data-change] > .field-row:last-child > label:last-child { margin-block-end: 0; }
[data-decision-reason] > label, fieldset[data-mark] > label { margin-block: var(--section-gap); }
@media (max-width: 1023px) {
  .field-row > label { margin-block: var(--section-gap); }
}

/* El título y la primera línea mantienen su eje aunque las flechas sean más altas. */
.card > h2 + .line.row:has(.line-value br) { align-items: flex-start; }
.card > h2 + :is(form,fieldset):has(> .line:first-child) {
  margin-block-start: var(--heading-gap);
}
.card > h2 + fieldset[disabled]:has(> .line:first-child) {
  border: 0; padding: 0; margin-inline: 0;
}
.card > :is(h2,.heading-with-help) + p:not(.warn,.ok,.error-notice) {
  margin-block-start: var(--heading-gap); padding-block-start: var(--detail-row-inset);
}
.card[data-empty-holidays]:not([hidden]) {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  column-gap: var(--action-gap);
  row-gap: var(--heading-gap);
}
[data-empty-holidays] > .heading-with-action { display: contents; }
[data-empty-holidays] .year-navigation { grid-column: 2; grid-row: 1 / span 2; align-self: start; }
[data-empty-holidays] > p { grid-column: 1; margin: 0; padding-block-start: var(--detail-row-inset); }

.summary-more { display:none; }
.summary-period > .module-search { flex: 0 0 clamp(12rem, 38%, 25rem); }
.summary-period > label:has(select) { flex: 0 0 min(13.5rem, 100%); min-width: 0; }
@media (max-width: 600px) {
  .summary-period > .module-search { flex-basis: 100%; max-width: none; }
}
.summary-period > span, .summary-period select { font-variant-numeric: tabular-nums; }
.summary-step { min-width:2.5rem; }
@media (min-width:601px) and (max-width:950px) {
  .summary-table { min-width:45rem; }
  .summary-table th { white-space:normal; }
  .summary-table th.col-state { width:10.25rem; }
  .summary-table th:nth-child(3) { width:8.75rem; }
  .summary-table th:nth-child(4) { width:8rem; }
  .summary-table th.col-count { width:7rem; }
}
@media (max-width:600px) {
  .summary-table { display:block; min-width:0; }
  .admin-panel .summary-table tbody tr { height:auto; }
  .summary-table :is(thead,tbody) { display:block; }
  .summary-table tr { display:grid; grid-template-columns:minmax(0,1.15fr) minmax(0,1.1fr) minmax(0,.9fr); }
  .summary-table tr > :is(th,td):nth-child(n) { width:auto; min-width:0; white-space:normal; overflow-wrap:anywhere; }
  .summary-table th button { white-space:normal; }
  .summary-table .pill { white-space:normal; }
  .summary-table tr > :is(th,td):is(:nth-child(3),:nth-child(5),:nth-child(6)) { display:none; }
  .summary-table .summary-more { display:block; background:none; border:none; color:var(--text-muted); padding:0; min-height:44px; }
  .summary-table tr:has(.summary-more[aria-expanded=true]) > td:is(:nth-child(3),:nth-child(5),:nth-child(6)) {
    display:flex; grid-column:1/-1; justify-content:space-between; order:1;
  }
  .summary-table td:nth-child(3)::before { content:'Días trabajados'; }
  .summary-table td:nth-child(5)::before { content:'Vacaciones'; }
  .summary-table td:nth-child(6)::before { content:'Incidencias abiertas'; }
}
