/* =====================================================================
   NóminaPro · hoja de estilos
   ===================================================================== */
:root {
  --navy: #0b1f3a;
  --navy-2: #12305a;
  --ink: #0f172a;
  --text: #1e293b;
  --muted: #64748b;
  --line: #e2e8f0;
  --line-2: #cbd5e1;
  --bg: #f3f6fb;
  --surface: #ffffff;
  --primary: #1d4ed8;
  --primary-600: #1e40af;
  --primary-50: #eef3ff;
  --accent: #0d9488;
  --success: #047857;
  --success-50: #ecfdf5;
  --warn: #b45309;
  --warn-50: #fffbeb;
  --danger: #b91c1c;
  --danger-50: #fef2f2;
  --radius: 14px;
  --radius-sm: 9px;
  --shadow-sm: 0 1px 2px rgba(15, 23, 42, .06);
  --shadow: 0 1px 3px rgba(15, 23, 42, .06), 0 8px 24px -12px rgba(15, 23, 42, .18);
  --shadow-lg: 0 24px 60px -20px rgba(11, 31, 58, .35);
  --font: "Inter", "Segoe UI", system-ui, -apple-system, Roboto, "Helvetica Neue", Arial, sans-serif;
  --mono: ui-monospace, "Cascadia Mono", "SFMono-Regular", Consolas, monospace;
}

*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0; font-family: var(--font); font-size: 15px; line-height: 1.5; color: var(--text);
  background: var(--bg); -webkit-font-smoothing: antialiased;
}
h1, h2, h3 { color: var(--ink); line-height: 1.2; margin: 0 0 .5rem; letter-spacing: -.015em; }
h1 { font-size: clamp(1.5rem, 1.2rem + 1.2vw, 2.1rem); font-weight: 750; }
h2 { font-size: 1.25rem; font-weight: 700; }
h3 { font-size: 1.02rem; font-weight: 700; }
p { margin: 0 0 .75rem; }
a { color: var(--primary); }
small { font-size: .8em; }
[hidden] { display: none !important; }
.muted { color: var(--muted); }
.small { font-size: .84rem; }
.num { text-align: right; font-variant-numeric: tabular-nums; white-space: nowrap; }
.eyebrow { text-transform: uppercase; letter-spacing: .08em; font-size: .74rem; font-weight: 700; color: var(--primary); margin: 0 0 .35rem; }
.lead { font-size: 1.05rem; color: #334155; max-width: 60ch; }
:focus-visible { outline: 3px solid rgba(29, 78, 216, .45); outline-offset: 2px; border-radius: 6px; }

/* ---------- Botones ---------- */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: .5rem;
  font: inherit; font-weight: 600; font-size: .94rem; line-height: 1;
  padding: .72rem 1.15rem; border-radius: 10px; border: 1px solid transparent; cursor: pointer;
  transition: background .15s, border-color .15s, color .15s, box-shadow .15s, transform .05s;
  text-decoration: none; white-space: nowrap;
}
.btn:active { transform: translateY(1px); }
.btn:disabled { opacity: .6; cursor: not-allowed; }
.btn--primary { background: var(--primary); color: #fff; box-shadow: 0 6px 16px -8px rgba(29, 78, 216, .7); }
.btn--primary:hover:not(:disabled) { background: var(--primary-600); }
.btn--ghost { background: var(--surface); color: var(--ink); border-color: var(--line-2); }
.btn--ghost:hover:not(:disabled) { border-color: var(--primary); color: var(--primary); }
.btn--danger { background: var(--surface); color: var(--danger); border-color: #fecaca; }
.btn--danger:hover { background: var(--danger-50); }
.btn--lg { padding: .9rem 1.4rem; font-size: 1rem; }
.btn--sm { padding: .45rem .75rem; font-size: .84rem; border-radius: 8px; }
.btn--block { width: 100%; }
.btn.is-loading { position: relative; color: rgba(255, 255, 255, .85); }
.btn-row { display: flex; gap: .5rem; flex-wrap: wrap; }
.icon-btn { border: 0; background: transparent; color: var(--muted); font-size: 1rem; cursor: pointer; padding: .35rem .5rem; border-radius: 6px; }
.icon-btn:hover { background: var(--danger-50); color: var(--danger); }

/* ---------- Formularios ---------- */
.field { display: flex; flex-direction: column; gap: .35rem; margin-bottom: .9rem; }
.field > span:first-child { font-size: .84rem; font-weight: 600; color: #334155; }
input[type=text], input[type=email], input[type=password], input[type=number], input[type=time], select {
  font: inherit; color: var(--ink); background: #fff; width: 100%;
  border: 1px solid var(--line-2); border-radius: var(--radius-sm); padding: .65rem .8rem;
  transition: border-color .15s, box-shadow .15s;
}
input:focus, select:focus { outline: none; border-color: var(--primary); box-shadow: 0 0 0 4px rgba(29, 78, 216, .14); }
input:disabled, select:disabled { background: #f1f5f9; color: #94a3b8; }
input[type=color] { width: 42px; height: 34px; border: 1px solid var(--line-2); border-radius: 8px; padding: 2px; background: #fff; cursor: pointer; }
.field__pwd { position: relative; display: block; }
.field__pwd input { padding-right: 5.5rem; }
.field__toggle {
  position: absolute; right: .35rem; top: 50%; transform: translateY(-50%);
  border: 0; background: var(--primary-50); color: var(--primary); font: inherit; font-size: .78rem; font-weight: 600;
  padding: .35rem .6rem; border-radius: 7px; cursor: pointer;
}
.check { display: flex; align-items: flex-start; gap: .55rem; font-size: .9rem; margin: .35rem 0 .7rem; cursor: pointer; }
.check input { margin-top: .2rem; width: 16px; height: 16px; accent-color: var(--primary); }
.hint { font-size: .8rem; color: var(--muted); margin: -.25rem 0 .75rem; }
.form-error { color: var(--danger); background: var(--danger-50); border: 1px solid #fecaca; padding: .6rem .8rem; border-radius: 9px; font-size: .88rem; margin: .25rem 0 .9rem; }
.form-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(200px, 1fr)); gap: 0 1rem; }
.form-grid--2 { grid-template-columns: 1fr 1fr; }
.money-input { display: flex; align-items: center; border: 1px solid var(--line-2); border-radius: var(--radius-sm); background: #fff; overflow: hidden; }
.money-input:focus-within { border-color: var(--primary); box-shadow: 0 0 0 4px rgba(29, 78, 216, .14); }
.money-input > span { padding: 0 .2rem 0 .75rem; color: var(--muted); font-weight: 600; }
.money-input input { border: 0; box-shadow: none !important; padding-left: .3rem; font-variant-numeric: tabular-nums; }
.money-input input:disabled { background: transparent; }

/* ---------- Barra superior ---------- */
.topbar { background: var(--navy); color: #fff; position: sticky; top: 0; z-index: 50; box-shadow: 0 4px 20px -10px rgba(0, 0, 0, .5); }
.topbar__inner { max-width: 1280px; margin: 0 auto; padding: .7rem 1.25rem; display: flex; align-items: center; gap: 1.5rem; }
.brand { display: inline-flex; align-items: center; gap: .6rem; text-decoration: none; color: inherit; }
.brand__text { font-size: 1.15rem; letter-spacing: -.01em; color: #fff; font-weight: 500; display: flex; align-items: baseline; gap: .1rem; }
.brand__text strong { font-weight: 800; }
.brand__text small { margin-left: .5rem; font-size: .7rem; font-weight: 600; color: #93c5fd; letter-spacing: .04em; text-transform: uppercase; }
.mainnav { display: flex; gap: .25rem; flex: 1; }
.mainnav a { color: #cbd5e1; text-decoration: none; font-weight: 600; font-size: .92rem; padding: .5rem .85rem; border-radius: 8px; }
.mainnav a:hover { color: #fff; background: rgba(255, 255, 255, .08); }
.mainnav a.is-active { color: #fff; background: rgba(255, 255, 255, .14); }
.usermenu { position: relative; }
.usermenu__btn { display: flex; align-items: center; gap: .6rem; background: transparent; border: 0; color: #fff; cursor: pointer; font: inherit; padding: .3rem .4rem; border-radius: 10px; }
.usermenu__btn:hover { background: rgba(255, 255, 255, .08); }
.usermenu__name { display: flex; flex-direction: column; text-align: left; font-size: .88rem; font-weight: 600; line-height: 1.2; }
.usermenu__name small { color: #93c5fd; font-weight: 500; font-size: .74rem; }
.avatar { width: 34px; height: 34px; border-radius: 50%; display: grid; place-items: center; font-weight: 700; background: linear-gradient(135deg, #3b82f6, #14b8a6); color: #fff; }
.usermenu__panel { position: absolute; right: 0; top: calc(100% + .5rem); background: #fff; color: var(--text); border-radius: 12px; box-shadow: var(--shadow-lg); border: 1px solid var(--line); min-width: 240px; padding: .4rem; }
.usermenu__email { font-size: .8rem; color: var(--muted); padding: .55rem .7rem; border-bottom: 1px solid var(--line); margin-bottom: .3rem; word-break: break-all; }
.usermenu__panel button { display: block; width: 100%; text-align: left; background: none; border: 0; font: inherit; font-size: .9rem; padding: .6rem .7rem; border-radius: 8px; cursor: pointer; color: var(--ink); }
.usermenu__panel button:hover { background: var(--bg); }
.usermenu__panel button.danger { color: var(--danger); }

.container { max-width: 1280px; margin: 0 auto; padding: 2rem 1.25rem 4rem; }
.section-title { margin: 2.2rem 0 1rem; font-size: 1.05rem; color: #334155; }
.page-head { display: flex; justify-content: space-between; align-items: flex-end; gap: 1rem; margin-bottom: 1.5rem; flex-wrap: wrap; }
.card { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); box-shadow: var(--shadow-sm); padding: 1.4rem; }

/* ---------- Inicio ---------- */
.hero-card {
  display: grid; grid-template-columns: 1.4fr 1fr; gap: 2rem; align-items: center;
  background: radial-gradient(1200px 400px at 100% 0, #1e3a8a 0, transparent 60%), linear-gradient(135deg, var(--navy) 0%, var(--navy-2) 100%);
  color: #e2e8f0; border-radius: 20px; padding: 2.5rem; box-shadow: var(--shadow-lg); overflow: hidden;
}
.hero-card h1 { color: #fff; }
.hero-card .eyebrow { color: #93c5fd; }
.hero-card .lead { color: #cbd5e1; }
.hero-card__actions { display: flex; gap: .75rem; flex-wrap: wrap; margin-top: 1.5rem; }
.hero-card .btn--ghost { background: rgba(255, 255, 255, .08); color: #fff; border-color: rgba(255, 255, 255, .25); }
.hero-card .btn--primary { background: #fff; color: var(--navy); box-shadow: none; }
.hero-card .btn--primary:hover { background: #e0e7ff; }
.mini-cal { display: grid; grid-template-columns: repeat(7, 1fr); gap: 6px; padding: 1rem; background: rgba(255, 255, 255, .06); border-radius: 16px; border: 1px solid rgba(255, 255, 255, .1); transform: rotate(-3deg); }
.mini-cal span { aspect-ratio: 1; display: grid; place-items: center; font-weight: 800; font-size: .85rem; border-radius: 8px; color: #fff; }
.c-a { background: #2563eb; } .c-b { background: #d97706; } .c-c { background: #4f46e5; } .c-d { background: rgba(255, 255, 255, .15); } .c-f { background: #059669; } .c-g { background: #7c3aed; }
.stat-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(210px, 1fr)); gap: .9rem; }
.stat { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 1rem 1.1rem; display: flex; flex-direction: column; gap: .2rem; box-shadow: var(--shadow-sm); }
.stat__label { font-size: .78rem; font-weight: 600; color: var(--muted); text-transform: uppercase; letter-spacing: .04em; }
.stat__value { font-size: 1.35rem; color: var(--ink); font-variant-numeric: tabular-nums; }
.stat__hint { font-size: .8rem; color: var(--muted); }
.how { list-style: none; padding: 0; margin: 0; display: grid; grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); gap: .9rem; counter-reset: how; }
.how li { counter-increment: how; background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 1.1rem 1.1rem 1.1rem 3.4rem; position: relative; display: flex; flex-direction: column; gap: .2rem; }
.how li::before { content: counter(how); position: absolute; left: 1rem; top: 1.05rem; width: 1.75rem; height: 1.75rem; border-radius: 50%; background: var(--primary-50); color: var(--primary); display: grid; place-items: center; font-weight: 800; font-size: .85rem; }
.how span { color: var(--muted); font-size: .88rem; }

/* ---------- Asistente ---------- */
.stepper { list-style: none; display: flex; padding: 0; margin: 0 0 1.25rem; gap: .35rem; overflow-x: auto; scrollbar-width: none; }
.stepper li { flex: 1; min-width: 96px; }
.stepper button { width: 100%; display: flex; align-items: center; gap: .5rem; background: none; border: 0; font: inherit; padding: .55rem .4rem; cursor: pointer; color: var(--muted); border-bottom: 3px solid var(--line); }
.stepper button:disabled { cursor: default; }
.stepper__n { width: 1.6rem; height: 1.6rem; flex: none; border-radius: 50%; display: grid; place-items: center; font-size: .78rem; font-weight: 800; background: #e2e8f0; color: #475569; }
.stepper__t { font-size: .84rem; font-weight: 600; white-space: nowrap; }
.stepper .is-current button { color: var(--primary); border-color: var(--primary); }
.stepper .is-current .stepper__n { background: var(--primary); color: #fff; }
.stepper .is-done button { color: var(--success); border-color: #86efac; }
.stepper .is-done .stepper__n { background: var(--success-50); color: var(--success); }
.wizard-card { background: var(--surface); border: 1px solid var(--line); border-radius: 18px; box-shadow: var(--shadow); max-width: 920px; margin: 0 auto; }
.wizard-card--wide { max-width: none; }
.step { padding: 1.8rem 1.8rem .6rem; }
.step__head { margin-bottom: 1.4rem; }
.step__head p { color: var(--muted); margin: 0; }
.step__head--row { display: flex; justify-content: space-between; gap: 1rem; align-items: flex-start; flex-wrap: wrap; }
.step__head--row > div:first-child { max-width: 70ch; }
.wizard-nav { display: flex; justify-content: space-between; align-items: center; gap: 1rem; padding: 1rem 1.8rem; border-top: 1px solid var(--line); background: #fafbfd; border-radius: 0 0 18px 18px; position: sticky; bottom: 0; }
.wizard-nav__info { font-size: .84rem; color: var(--muted); }
.choice-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(250px, 1fr)); gap: .8rem; }
.choice-grid--2 { grid-template-columns: repeat(auto-fit, minmax(260px, 1fr)); }
.choice { position: relative; cursor: pointer; }
.choice input[type=radio] { position: absolute; opacity: 0; pointer-events: none; }
.choice__body { display: flex; flex-direction: column; gap: .35rem; height: 100%; padding: 1rem 1.1rem 1rem 2.9rem; border: 1.5px solid var(--line); border-radius: 12px; background: #fff; transition: border-color .15s, box-shadow .15s, background .15s; position: relative; }
.choice__body::before { content: ""; position: absolute; left: 1.05rem; top: 1.15rem; width: 18px; height: 18px; border-radius: 50%; border: 2px solid var(--line-2); background: #fff; transition: all .15s; }
.choice:hover .choice__body { border-color: #93c5fd; }
.choice input:checked + .choice__body { border-color: var(--primary); background: var(--primary-50); box-shadow: 0 0 0 3px rgba(29, 78, 216, .12); }
.choice input:checked + .choice__body::before { border-color: var(--primary); background: var(--primary); box-shadow: inset 0 0 0 3px #fff; }
.choice input:focus-visible + .choice__body { outline: 3px solid rgba(29, 78, 216, .45); outline-offset: 2px; }
.choice__title { font-weight: 700; color: var(--ink); }
.choice__value { font-size: 1.5rem; font-weight: 800; color: var(--ink); font-variant-numeric: tabular-nums; }
.choice__desc { font-size: .85rem; color: var(--muted); }
.choice .money-input { margin: .2rem 0; }
.choice .money-input input { font-size: 1.25rem; font-weight: 700; padding: .5rem .3rem; }
.badge { display: inline-block; font-style: normal; font-size: .72rem; font-weight: 700; padding: .18rem .5rem; border-radius: 999px; background: #e0e7ff; color: #3730a3; vertical-align: middle; }
.badge--muted { background: #f1f5f9; color: #475569; }
.badge--admin { background: #fef3c7; color: #92400e; }
.badge--warn { background: #fee2e2; color: #991b1b; }
.badge--holiday { background: #fee2e2; color: #b91c1c; font-size: .68rem; }
.optional { margin-top: 1.4rem; border: 1px dashed var(--line-2); border-radius: 12px; padding: .8rem 1rem; }
.optional summary { cursor: pointer; font-weight: 600; color: #334155; font-size: .92rem; }
.optional[open] summary { margin-bottom: 1rem; }
.callout { border-radius: 12px; padding: .9rem 1.1rem; margin: 1.2rem 0 .8rem; font-size: .9rem; border: 1px solid var(--line); background: #f8fafc; }
.callout ul { margin: .4rem 0 0; padding-left: 1.2rem; }
.callout--info { background: #eff6ff; border-color: #bfdbfe; color: #1e3a8a; }
.callout--warn { background: var(--warn-50); border-color: #fde68a; color: #78350f; }
.callout__note { margin: .6rem 0 0; font-weight: 600; }

/* ---------- Paleta y calendario ---------- */
.palette { display: flex; flex-wrap: wrap; gap: .5rem; margin-bottom: 1rem; align-items: center; }
.tool { --c: #64748b; display: flex; align-items: center; gap: .55rem; padding: .4rem .7rem .4rem .4rem; border-radius: 10px; border: 1.5px solid var(--line); background: #fff; cursor: pointer; font: inherit; text-align: left; transition: all .12s; }
.tool:hover { border-color: var(--c); }
.tool.is-active { border-color: var(--c); box-shadow: 0 0 0 3px color-mix(in srgb, var(--c) 22%, transparent); background: color-mix(in srgb, var(--c) 7%, #fff); }
.tool__code { min-width: 30px; height: 30px; padding: 0 .3rem; border-radius: 8px; background: var(--c); color: #fff; display: grid; place-items: center; font-weight: 800; font-size: .82rem; }
.tool__name { font-size: .82rem; font-weight: 700; color: var(--ink); line-height: 1.15; display: flex; flex-direction: column; }
.tool__name small { font-weight: 500; color: var(--muted); font-size: .72rem; }
.tool--custom { --c: #475569; } .tool--erase { --c: #b91c1c; }
.switch { display: inline-flex; align-items: center; gap: .45rem; font-size: .84rem; font-weight: 600; color: #334155; margin-left: auto; cursor: pointer; padding: .4rem .6rem; border-radius: 8px; background: var(--bg); }
.switch input { accent-color: var(--primary); width: 16px; height: 16px; }
.cal-layout { display: grid; grid-template-columns: minmax(0, 1fr) 280px; gap: 1.2rem; align-items: start; }
.calendar { user-select: none; -webkit-user-select: none; }
.cal-head, .cal-grid { display: grid; grid-template-columns: repeat(7, minmax(0, 1fr)); gap: 6px; }
.cal-head span { font-size: .74rem; font-weight: 700; color: var(--muted); text-transform: uppercase; letter-spacing: .05em; text-align: center; padding: .3rem 0; }
.day {
  position: relative; min-height: 96px; display: flex; flex-direction: column; align-items: stretch; gap: 3px;
  background: #fff; border: 1px solid var(--line); border-radius: 10px; padding: .4rem .45rem; cursor: pointer;
  font: inherit; text-align: left; transition: border-color .1s, box-shadow .1s; touch-action: manipulation;
}
.day:hover { border-color: var(--primary); box-shadow: 0 0 0 2px rgba(29, 78, 216, .12); }
.day__num { font-weight: 800; font-size: .9rem; color: var(--ink); }
.day__num small { font-weight: 600; color: var(--muted); font-size: .7rem; }
.day__fest { font-size: .64rem; line-height: 1.15; color: #b91c1c; font-weight: 600; overflow: hidden; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; }
.day__chips { display: flex; flex-wrap: wrap; gap: 3px; margin-top: auto; }
.day__hours { font-size: .68rem; color: var(--muted); font-weight: 600; }
.day.is-rest { background: #fafbff; }
.day.is-rest .day__num { color: #b91c1c; }
.day.is-holiday { background: #fff7f7; border-color: #fecaca; }
.day.is-holiday .day__num { color: #b91c1c; }
.day.is-context { opacity: .5; background: repeating-linear-gradient(135deg, #f8fafc, #f8fafc 6px, #f1f5f9 6px, #f1f5f9 12px); }
.day.is-context:hover { opacity: .85; }
.chip { --c: #475569; display: inline-flex; align-items: center; justify-content: center; min-width: 24px; padding: .12rem .4rem; border-radius: 6px; background: var(--c); color: #fff; font-weight: 800; font-size: .74rem; line-height: 1.3; white-space: nowrap; }
.chip--off { background: color-mix(in srgb, var(--c) 16%, #fff); color: var(--c); }
.chip--sm { font-size: .7rem; margin-right: 2px; }
.chip--btn { border: 0; cursor: pointer; font: inherit; font-weight: 800; padding: .35rem .65rem; }
.chip--clear { background: #f1f5f9; color: #475569; }
.pattern-chips { display: flex; gap: .4rem; flex-wrap: wrap; margin-bottom: 1rem; }
.cal-summary { position: sticky; top: 80px; background: #fafbfd; border: 1px solid var(--line); border-radius: 14px; padding: 1.1rem; }
.cal-summary h3 { font-size: .95rem; margin-bottom: .8rem; }
.kv { margin: 0 0 .9rem; display: grid; gap: .35rem; }
.kv div { display: flex; justify-content: space-between; font-size: .86rem; }
.kv dt { color: var(--muted); }
.kv dd { margin: 0; font-weight: 700; color: var(--ink); font-variant-numeric: tabular-nums; }
.kv--hours { border-top: 1px solid var(--line); padding-top: .8rem; }
.estimate { background: var(--navy); color: #fff; border-radius: 12px; padding: .9rem 1rem; display: flex; flex-direction: column; }
.estimate span { font-size: .78rem; color: #93c5fd; font-weight: 600; text-transform: uppercase; letter-spacing: .05em; }
.estimate strong { font-size: 1.45rem; font-variant-numeric: tabular-nums; }
.estimate small { color: #cbd5e1; }
.mini-warn { font-size: .8rem; color: var(--warn); margin: .7rem 0 0; }

/* ---------- Novedades ---------- */
.panel-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(320px, 1fr)); gap: 1rem; }
.panel { border: 1px solid var(--line); border-radius: 14px; padding: 1rem 1.1rem .4rem; margin: 0; min-width: 0; }
.panel legend { font-weight: 700; color: var(--ink); padding: 0 .4rem; font-size: .95rem; }
.desc-list { display: grid; gap: .5rem; margin-bottom: .6rem; }
.desc-row { display: grid; grid-template-columns: 1fr 150px auto; gap: .4rem; align-items: center; }

/* ---------- Diálogos ---------- */
.modal { border: 0; padding: 0; border-radius: 18px; box-shadow: var(--shadow-lg); width: min(520px, calc(100vw - 2rem)); max-height: calc(100vh - 2rem); color: var(--text); }
.modal--xl { width: min(1100px, calc(100vw - 2rem)); }
.modal::backdrop { background: rgba(11, 31, 58, .55); backdrop-filter: blur(3px); }
.modal__body { padding: 1.6rem; margin: 0; }
.modal__actions { display: flex; justify-content: flex-end; gap: .6rem; margin-top: 1.2rem; }
.modal__actions--split { justify-content: space-between; flex-wrap: wrap; }
.modal[open] { animation: pop .18s ease-out; }
@keyframes pop { from { transform: translateY(8px) scale(.98); opacity: 0; } to { transform: none; opacity: 1; } }

/* ---------- Tablas ---------- */
.table-wrap { overflow-x: auto; border: 1px solid var(--line); border-radius: 12px; background: #fff; }
.table { width: 100%; border-collapse: collapse; font-size: .9rem; }
.table th { text-align: left; font-size: .74rem; text-transform: uppercase; letter-spacing: .05em; color: var(--muted); font-weight: 700; background: #f8fafc; padding: .7rem .9rem; border-bottom: 1px solid var(--line); white-space: nowrap; }
.table td { padding: .7rem .9rem; border-bottom: 1px solid #eef2f7; vertical-align: middle; }
.table tbody tr:last-child td { border-bottom: 0; }
.table tbody tr:hover td { background: #fafcff; }
.table tfoot td { font-weight: 800; color: var(--ink); background: #f8fafc; border-top: 2px solid var(--line); padding: .8rem .9rem; }
.table--neg tfoot td:last-child { color: var(--danger); }
.table--compact td, .table--compact th { padding: .45rem .7rem; }
.table--edit td { padding: .4rem .35rem; }
.table--edit input, .table--edit select { padding: .45rem .5rem; font-size: .85rem; }
.table--edit .in-code { width: 64px; text-transform: uppercase; font-weight: 800; }
.table--edit .in-num { width: 78px; }
.table--edit .td-hours { font-weight: 700; white-space: nowrap; font-size: .85rem; }
.table tr.is-rest td:first-child strong { color: #b91c1c; }
.actions { display: flex; gap: .35rem; justify-content: flex-end; }
.status { display: inline-flex; align-items: center; gap: .35rem; font-size: .84rem; font-weight: 600; }
.status::before { content: ""; width: 8px; height: 8px; border-radius: 50%; }
.status--on { color: var(--success); } .status--on::before { background: #22c55e; }
.status--off { color: var(--muted); } .status--off::before { background: #94a3b8; }
.tabs { display: flex; gap: .3rem; border-bottom: 1px solid var(--line); margin-bottom: 1.2rem; }
.tab { background: none; border: 0; font: inherit; font-weight: 600; color: var(--muted); padding: .7rem 1rem; cursor: pointer; border-bottom: 3px solid transparent; margin-bottom: -1px; }
.tab.is-active { color: var(--primary); border-color: var(--primary); }

/* ---------- Informe ---------- */
.report-actions { display: flex; justify-content: space-between; gap: 1rem; margin-bottom: 1rem; flex-wrap: wrap; }
.report { background: var(--surface); border: 1px solid var(--line); border-radius: 18px; box-shadow: var(--shadow); padding: 2rem; }
.r-head { display: flex; justify-content: space-between; gap: 1rem; align-items: flex-start; padding-bottom: 1.2rem; border-bottom: 1px solid var(--line); flex-wrap: wrap; }
.r-head h1 { margin-bottom: .25rem; }
.r-head__meta { text-align: right; font-size: .84rem; display: flex; flex-direction: column; }
.r-head__meta span { color: var(--muted); }
.r-meta { display: grid; grid-template-columns: repeat(auto-fit, minmax(190px, 1fr)); gap: .8rem 1.5rem; margin: 1.2rem 0; }
.r-meta div { display: flex; flex-direction: column; }
.r-meta dt { font-size: .74rem; text-transform: uppercase; letter-spacing: .05em; color: var(--muted); font-weight: 700; }
.r-meta dd { margin: .1rem 0 0; font-weight: 600; color: var(--ink); }
.r-totals { display: grid; grid-template-columns: repeat(3, 1fr); gap: .9rem; margin: 1.2rem 0; }
.r-total { border: 1px solid var(--line); border-radius: 14px; padding: 1rem 1.2rem; display: flex; flex-direction: column; gap: .2rem; background: #fafbfd; }
.r-total span { font-size: .78rem; font-weight: 700; text-transform: uppercase; letter-spacing: .05em; color: var(--muted); }
.r-total strong { font-size: 1.6rem; font-variant-numeric: tabular-nums; color: var(--ink); }
.r-total--neg strong { color: var(--danger); }
.r-total--net { background: linear-gradient(135deg, var(--navy), #1e3a8a); border-color: transparent; }
.r-total--net span { color: #93c5fd; }
.r-total--net strong { color: #fff; font-size: 1.9rem; }
.r-cols { display: grid; grid-template-columns: 1fr; gap: 0; }
.r-sec { margin-top: 1.8rem; }
.r-sec h3 { margin-bottom: .8rem; display: flex; align-items: center; gap: .5rem; }
.hour-cards { display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: .6rem; margin-bottom: 1rem; }
.hour-card { border: 1px solid var(--line); border-radius: 12px; padding: .7rem .85rem; display: flex; flex-direction: column; }
.hour-card span { font-size: .74rem; color: var(--muted); font-weight: 600; }
.hour-card strong { font-size: 1.15rem; color: var(--ink); font-variant-numeric: tabular-nums; }
.hour-card.is-zero { opacity: .55; }
.r-norm { display: grid; grid-template-columns: repeat(auto-fit, minmax(230px, 1fr)); gap: .1rem 1.5rem; margin: 0 0 .8rem; }
.r-norm div { display: flex; justify-content: space-between; gap: 1rem; padding: .5rem 0; border-bottom: 1px dashed var(--line); font-size: .88rem; }
.r-norm dt { color: var(--muted); }
.r-norm dd { margin: 0; font-weight: 700; color: var(--ink); text-align: right; }
.notes { margin: 0; padding-left: 1.2rem; display: grid; gap: .45rem; font-size: .9rem; color: #334155; }
.r-daily summary { cursor: pointer; list-style: none; }
.r-daily summary::-webkit-details-marker { display: none; }
.r-daily summary h3::after { content: "▾"; color: var(--muted); font-size: .9rem; }
.r-foot { margin-top: 2rem; padding-top: 1rem; border-top: 1px solid var(--line); font-size: .8rem; color: var(--muted); }

/* ---------- Normativa ---------- */
.norm-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(420px, 1fr)); gap: 1rem; }
.card--wide { grid-column: 1 / -1; }
.timeline { list-style: none; padding: 0; margin: 0; display: grid; gap: .9rem; }
.timeline li { display: grid; grid-template-columns: 92px 1fr; gap: .8rem; }
.timeline__date { font-size: .78rem; font-weight: 800; color: var(--primary); background: var(--primary-50); border-radius: 8px; padding: .35rem .5rem; text-align: center; height: fit-content; }
.timeline p { margin: .15rem 0 0; font-size: .86rem; color: var(--muted); }
.holiday-list { display: grid; grid-template-columns: repeat(auto-fill, minmax(230px, 1fr)); gap: .6rem; margin-bottom: .8rem; }
.holiday { display: flex; gap: .7rem; align-items: center; border: 1px solid var(--line); border-radius: 12px; padding: .55rem .7rem; }
.holiday__date { width: 48px; flex: none; text-align: center; background: #fee2e2; color: #991b1b; border-radius: 9px; padding: .25rem 0; font-size: .7rem; text-transform: uppercase; font-weight: 700; display: flex; flex-direction: column; }
.holiday__date strong { font-size: 1.15rem; line-height: 1.1; }
.holiday small { display: block; color: var(--muted); text-transform: capitalize; }

/* ---------- Login ---------- */
.page-login { background: #fff; }
.login { display: grid; grid-template-columns: 1.1fr 1fr; min-height: 100vh; }
.login__hero {
  background: radial-gradient(900px 500px at 0% 100%, rgba(20, 184, 166, .28), transparent 60%),
              radial-gradient(800px 500px at 100% 0%, rgba(59, 130, 246, .35), transparent 60%),
              linear-gradient(160deg, var(--navy), #0a1830);
  color: #cbd5e1; display: flex; align-items: center; padding: 3rem clamp(2rem, 5vw, 5rem);
}
.login__hero-inner { max-width: 560px; }
.login__hero h1 { color: #fff; font-size: clamp(1.8rem, 1.3rem + 1.6vw, 2.6rem); margin: 2.2rem 0 1rem; }
.login__hero p { font-size: 1.02rem; }
.login__facts { list-style: none; padding: 0; margin: 2rem 0; display: grid; grid-template-columns: 1fr 1fr; gap: .7rem; }
.login__facts li { background: rgba(255, 255, 255, .06); border: 1px solid rgba(255, 255, 255, .1); border-radius: 12px; padding: .8rem 1rem; display: flex; flex-direction: column; }
.login__facts span { font-size: .76rem; color: #93c5fd; font-weight: 600; text-transform: uppercase; letter-spacing: .05em; }
.login__facts strong { color: #fff; font-size: 1.2rem; font-variant-numeric: tabular-nums; }
.login__legal { font-size: .8rem !important; color: #64748b; }
.brand--light .brand__text { font-size: 1.35rem; }
.login__panel { display: flex; align-items: center; justify-content: center; padding: 2rem; background: var(--bg); }
.login__form { width: 100%; max-width: 400px; background: #fff; border-radius: 20px; padding: 2.2rem; box-shadow: var(--shadow); border: 1px solid var(--line); }
.login__form h2 { font-size: 1.55rem; }
.login__form .muted { margin-bottom: 1.6rem; }
.login__secure { display: flex; align-items: center; justify-content: center; gap: .4rem; font-size: .78rem; color: var(--muted); margin: 1.2rem 0 0; }
.brand--mobile { display: none; margin-bottom: 1.5rem; }
.brand--mobile .brand__text { color: var(--navy); }

/* ---------- Notificaciones ---------- */
.toast-host { position: fixed; right: 1rem; bottom: 1rem; display: flex; flex-direction: column; gap: .5rem; z-index: 200; }
.toast { background: var(--ink); color: #fff; padding: .8rem 1.1rem; border-radius: 12px; box-shadow: var(--shadow-lg); font-size: .9rem; max-width: 380px; transform: translateY(10px); opacity: 0; transition: all .25s; border-left: 4px solid #22c55e; }
.toast.is-in { transform: none; opacity: 1; }
.toast--error { border-left-color: #ef4444; }
.toast--warn { border-left-color: #f59e0b; }

/* ---------- Responsivo ---------- */
@media (max-width: 1024px) {
  .cal-layout { grid-template-columns: 1fr; }
  .cal-summary { position: static; }
  .usermenu__name { display: none; }
}
@media (max-width: 860px) {
  .login { grid-template-columns: 1fr; }
  .login__hero { display: none; }
  .brand--mobile { display: inline-flex; }
  .hero-card { grid-template-columns: 1fr; padding: 1.8rem; }
  .hero-card__art { display: none; }
  .r-totals { grid-template-columns: 1fr; }
  .norm-grid { grid-template-columns: 1fr; }
  .brand__text small { display: none; }
}
@media (max-width: 640px) {
  body { font-size: 14px; }
  .topbar__inner { gap: .6rem; padding: .6rem .8rem; flex-wrap: wrap; }
  .mainnav { order: 3; flex-basis: 100%; overflow-x: auto; }
  .container { padding: 1.2rem .8rem 3rem; }
  .step { padding: 1.2rem 1rem .4rem; }
  .wizard-nav { padding: .8rem 1rem; }
  .wizard-nav__info { display: none; }
  .stepper__t { display: none; }
  .stepper li { min-width: 40px; }
  .day { min-height: 70px; padding: .3rem; }
  .day__fest, .day__hours { display: none; }
  .cal-head, .cal-grid { gap: 3px; }
  .chip { min-width: 0; padding: .1rem .25rem; font-size: .66rem; }
  .tool__name small { display: none; }
  .palette { flex-wrap: nowrap; overflow-x: auto; padding-bottom: .4rem; scroll-snap-type: x proximity; }
  .tool, .switch { flex: none; scroll-snap-align: start; }
  .tool { padding: .3rem .55rem .3rem .3rem; }
  .switch { margin-left: 0; }
  .report { padding: 1.1rem; }
  .form-grid--2 { grid-template-columns: 1fr; }
  .desc-row { grid-template-columns: 1fr 120px auto; }
  .login__form { padding: 1.6rem; }
}

/* ---------- Impresión ---------- */
/* ---------- Comparación con el volante ---------- */
.compare { margin-top: 1.5rem; }
.compare:empty { display: none; }
.cmp-head { display: flex; gap: 1.5rem; justify-content: space-between; align-items: flex-end; flex-wrap: wrap; margin-bottom: 1rem; }
.cmp-head h2 { margin: 0 0 .25rem; font-size: 1.25rem; color: var(--ink); }
.cmp-head p { margin: 0; max-width: 60ch; }
.cmp-vh { min-width: 240px; }
.cmp-vh .field { margin-bottom: .35rem; }
.cmp-vh .hint { margin: 0 0 .5rem; }
.cmp-table td { vertical-align: middle; }
.cmp-table td:first-child { min-width: 170px; }
.cmp-group + .cmp-group { border-top: 1px solid var(--line); }
.cmp-msg td { padding-top: 0 !important; font-size: .82rem; line-height: 1.5; border-top: 0 !important; }
.cmp-in { width: 6.5rem; padding: .35rem .5rem; border: 1px solid var(--line-2); border-radius: var(--radius-sm); text-align: right; font: inherit; font-variant-numeric: tabular-nums; background: #fff; }
.cmp-in--pct { width: 4.75rem; }
.cmp-in:focus { outline: none; border-color: var(--primary); box-shadow: 0 0 0 3px rgba(29, 78, 216, .14); }
.cmp-delta { font-weight: 700; }
.cmp-money td { background: #fafbfc; }
.cmp-bad td { background: var(--danger-50); }
.cmp-bad .cmp-msg td { color: var(--danger); font-weight: 600; }
.cmp-bad td:first-child { box-shadow: inset 3px 0 0 var(--danger); }
.cmp-ok .cmp-msg td { color: var(--success); }
.cmp-ok td:first-child { box-shadow: inset 3px 0 0 var(--success); }

@media print {
  @page { size: letter; margin: 14mm; }
  body { background: #fff; font-size: 11px; }
  .topbar, .no-print, .toast-host, #viewHome, #viewWizard { display: none !important; }
  .container { padding: 0; max-width: none; }
  .report { border: 0; box-shadow: none; padding: 0; }
  .r-total--net { background: #fff !important; border: 2px solid var(--navy); }
  .r-total--net span, .r-total--net strong { color: var(--navy) !important; }
  .table-wrap { overflow: visible; border-color: #ccc; }
  .r-sec { break-inside: avoid-page; }
  .r-daily { break-before: page; }
  .chip { -webkit-print-color-adjust: exact; print-color-adjust: exact; }
  .callout { -webkit-print-color-adjust: exact; print-color-adjust: exact; }
}
@media (prefers-reduced-motion: reduce) { *, *::before, *::after { transition: none !important; animation: none !important; } }
