:root {
  --bg: #f4f5f7;
  --surface: #ffffff;
  --surface-2: #f0f2f5;
  --text: #1c2330;
  --muted: #5d6778;
  --border: #dde1e7;
  --primary: #1c4430;
  --primary-ink: #ffffff;
  --primary-soft: #e1eee6;
  --ok: #1e7b4f;
  --ok-soft: #e1f3ea;
  --warn: #9a5b00;
  --warn-soft: #fdf1dc;
  --danger: #b3261e;
  --danger-soft: #fbe5e3;
  --pause: #6b4fa0;
  --pause-soft: #efe9f8;
  --radius: 12px;
  --shadow: 0 1px 2px rgba(16, 24, 40, .06), 0 1px 3px rgba(16, 24, 40, .08);
  color-scheme: light;
}
:root[data-theme="dark"] {
    --bg: #0f1419;
    --surface: #182029;
    --surface-2: #1f2933;
    --text: #e6e9ee;
    --muted: #9aa5b4;
    --border: #2c3744;
    --primary: #7cc39a;
    --primary-ink: #0b1f14;
    --primary-soft: #183226;
    --ok: #5cc79a;
    --ok-soft: #173427;
    --warn: #f0b44c;
    --warn-soft: #3a2d14;
    --danger: #f28b82;
    --danger-soft: #3d1e1c;
    --pause: #b89cf0;
    --pause-soft: #2a2140;
    --shadow: none;
    color-scheme: dark;
  
}
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --bg: #0f1419;
    --surface: #182029;
    --surface-2: #1f2933;
    --text: #e6e9ee;
    --muted: #9aa5b4;
    --border: #2c3744;
    --primary: #7cc39a;
    --primary-ink: #0b1f14;
    --primary-soft: #183226;
    --ok: #5cc79a;
    --ok-soft: #173427;
    --warn: #f0b44c;
    --warn-soft: #3a2d14;
    --danger: #f28b82;
    --danger-soft: #3d1e1c;
    --pause: #b89cf0;
    --pause-soft: #2a2140;
    --shadow: none;
    color-scheme: dark;
  
  }
}

* { box-sizing: border-box; }
[hidden] { display: none !important; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  font: 15px/1.5 system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  background: var(--bg);
  color: var(--text);
}
a { color: var(--primary); }
h1, h2, h3 { line-height: 1.25; margin: 0 0 .6em; }
h1 { font-size: 1.45rem; }
h2 { font-size: 1.15rem; }
h3 { font-size: 1rem; }
p { margin: 0 0 .8em; }
small, .muted { color: var(--muted); }
.num { font-variant-numeric: tabular-nums; }

/* ---------- Estructura ---------- */
.topbar {
  position: sticky; top: 0; z-index: 20;
  display: flex; align-items: center; gap: 16px;
  padding: 10px 16px;
  background: var(--surface);
  border-bottom: 1px solid var(--border);
}
.brand { display: flex; align-items: center; gap: 10px; min-width: 0; font-weight: 700; color: var(--text); text-decoration: none; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.brand .brand-sub { color: var(--muted); font-weight: 500; }
.brand img { width: 32px; height: 32px; flex: none; }
.brand .brand-text { overflow: hidden; text-overflow: ellipsis; }
.auth-logo { display: block; width: 72px; height: 72px; margin: 0 auto 20px; }
.report-logo { width: 56px; height: 56px; float: right; margin-left: 16px; }
@media (max-width: 420px) { .brand .brand-sub { display: none; } }
.topnav { display: flex; gap: 4px; margin-left: auto; flex-wrap: wrap; }
.topnav a, .bottomnav a {
  text-decoration: none; color: var(--muted); padding: 6px 10px; border-radius: 8px; font-weight: 500;
}
.topnav a.active, .topnav a:hover { background: var(--primary-soft); color: var(--primary); }
.bottomnav { display: none; }
main { max-width: 1100px; margin: 0 auto; padding: 20px 16px 96px; }

@media (max-width: 760px) {
  .topnav { display: none; }
  .bottomnav {
    display: flex; position: fixed; bottom: 0; left: 0; right: 0; z-index: 20;
    background: var(--surface); border-top: 1px solid var(--border);
    padding: 4px 4px calc(4px + env(safe-area-inset-bottom));
  }
  .bottomnav a {
    flex: 1; display: flex; flex-direction: column; align-items: center; gap: 2px;
    font-size: .72rem; padding: 6px 2px; min-width: 0;
  }
  .bottomnav a span { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; max-width: 100%; }
  .bottomnav a svg { width: 22px; height: 22px; }
  .bottomnav a.active { color: var(--primary); }
  main { padding: 16px 12px 96px; }
}

.admin-tabs { display: flex; flex-wrap: wrap; gap: 6px; margin: 0 0 16px; }
.admin-tabs a {
  white-space: nowrap; text-decoration: none; color: var(--muted); padding: 6px 12px;
  border: 1px solid var(--border); border-radius: 999px; background: var(--surface); font-size: .9rem;
}
.admin-tabs a.active { background: var(--primary); color: var(--primary-ink); border-color: var(--primary); }
.admin-tabs .count { background: var(--danger); color: #fff; border-radius: 999px; padding: 0 6px; font-size: .75rem; margin-left: 4px; }

/* ---------- Componentes ---------- */
.card {
  background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius);
  padding: 16px; box-shadow: var(--shadow); margin-bottom: 16px;
}
.card > h2:first-child, .card > h3:first-child { margin-top: 0; }
.grid { display: grid; gap: 16px; }
.grid-2 { grid-template-columns: repeat(auto-fit, minmax(280px, 1fr)); }
.grid-3 { grid-template-columns: repeat(auto-fit, minmax(200px, 1fr)); }
.grid-4 { grid-template-columns: repeat(auto-fit, minmax(160px, 1fr)); }
.stat { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); padding: 12px 14px; }
.stat .label { font-size: .8rem; color: var(--muted); text-transform: uppercase; letter-spacing: .03em; }
.stat .value { font-size: 1.4rem; font-weight: 700; font-variant-numeric: tabular-nums; }
.stat .sub { font-size: .85rem; color: var(--muted); }
.pos { color: var(--ok); }
.neg { color: var(--danger); }

.row { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; }
.spread { display: flex; justify-content: space-between; align-items: center; gap: 12px; flex-wrap: wrap; }
.stack > * + * { margin-top: 12px; }

.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 6px;
  font: inherit; font-weight: 600; border-radius: 10px; border: 1px solid var(--border);
  background: var(--surface); color: var(--text); padding: 8px 14px; cursor: pointer; text-decoration: none;
  min-height: 40px;
}
.btn:hover { background: var(--surface-2); }
.btn:disabled { opacity: .55; cursor: not-allowed; }
.btn.primary { background: var(--primary); border-color: var(--primary); color: var(--primary-ink); }
.btn.ok { background: var(--ok); border-color: var(--ok); color: #fff; }
.btn.danger { background: var(--danger); border-color: var(--danger); color: #fff; }
.btn.pause { background: var(--pause); border-color: var(--pause); color: #fff; }
.btn.ghost { background: transparent; border-color: transparent; color: var(--primary); }
.btn.small { min-height: 32px; padding: 4px 10px; font-size: .85rem; }
.btn.big { min-height: 64px; font-size: 1.15rem; border-radius: 14px; padding: 12px 24px; }
:root[data-theme="dark"] .btn.ok, :root[data-theme="dark"] .btn.danger, :root[data-theme="dark"] .btn.pause { color: #0b0f14; }
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) .btn.ok, :root:not([data-theme="light"]) .btn.danger, :root:not([data-theme="light"]) .btn.pause { color: #0b0f14; }
}

.badge {
  display: inline-block; font-size: .75rem; font-weight: 600; padding: 2px 8px; border-radius: 999px;
  background: var(--surface-2); color: var(--muted); white-space: nowrap;
}
.badge.ok { background: var(--ok-soft); color: var(--ok); }
.badge.warn { background: var(--warn-soft); color: var(--warn); }
.badge.danger { background: var(--danger-soft); color: var(--danger); }
.badge.pause { background: var(--pause-soft); color: var(--pause); }
.badge.info { background: var(--primary-soft); color: var(--primary); }

.alert { border-radius: 10px; padding: 10px 12px; margin-bottom: 12px; border: 1px solid transparent; }
.alert.warn { background: var(--warn-soft); color: var(--warn); }
.alert.danger { background: var(--danger-soft); color: var(--danger); }
.alert.info { background: var(--primary-soft); color: var(--primary); }
.alert.ok { background: var(--ok-soft); color: var(--ok); }

/* ---------- Formularios ---------- */
label { display: block; font-weight: 600; font-size: .9rem; margin-bottom: 4px; }
.field { margin-bottom: 12px; }
.field .hint { font-weight: 400; font-size: .82rem; color: var(--muted); margin-top: 2px; }
input, select, textarea {
  width: 100%; font: inherit; color: var(--text); background: var(--surface);
  border: 1px solid var(--border); border-radius: 10px; padding: 8px 10px; min-height: 40px;
}
input:focus, select:focus, textarea:focus, .btn:focus-visible { outline: 2px solid var(--primary); outline-offset: 1px; }
textarea { min-height: 72px; resize: vertical; }
input[type="checkbox"], input[type="radio"] { width: auto; min-height: 0; margin: 0 6px 0 0; accent-color: var(--primary); }
.check { display: flex; align-items: flex-start; gap: 4px; font-weight: 500; }
.check input { margin-top: 4px; }
.form-grid { display: grid; gap: 0 12px; grid-template-columns: repeat(auto-fit, minmax(200px, 1fr)); }

.segmented { display: inline-flex; border: 1px solid var(--border); border-radius: 10px; overflow: hidden; flex-wrap: wrap; }
.segmented button {
  font: inherit; border: 0; background: var(--surface); color: var(--muted); padding: 8px 12px; cursor: pointer; min-height: 40px;
}
.segmented button + button { border-left: 1px solid var(--border); }
.segmented button.active { background: var(--primary-soft); color: var(--primary); font-weight: 600; }

/* ---------- Tablas ---------- */
.table-wrap { overflow-x: auto; }
table { width: 100%; border-collapse: collapse; font-size: .9rem; }
th, td { text-align: left; padding: 8px 10px; border-bottom: 1px solid var(--border); vertical-align: top; }
th { font-size: .78rem; text-transform: uppercase; letter-spacing: .03em; color: var(--muted); font-weight: 600; }
td.r, th.r { text-align: right; }
td.r, td:first-child { white-space: nowrap; }
tr.detail td { white-space: normal; }
.show-sm { display: none; }
@media (max-width: 600px) {
  .hide-sm { display: none; }
  .show-sm { display: block; }
  table { font-size: .8rem; }
  td .badge { font-size: .68rem; padding: 1px 6px; }
  td.num .badge { display: inline-block; margin-top: 2px; }
  th { letter-spacing: 0; }
  td .badge { white-space: normal; border-radius: 8px; }
  td:first-child { width: 1%; }
  th, td { padding: 8px 6px; }
  .clock-card .segmented { display: flex; width: 100%; }
  .clock-card .segmented button { flex: 1; padding: 8px 4px; font-size: .88rem; }
}
tr.weekend td, tr.off td { color: var(--muted); background: var(--surface-2); }
tr.clickable { cursor: pointer; }
tr.clickable:hover td { background: var(--primary-soft); }
tr.detail td { background: var(--surface-2); }
.voided { text-decoration: line-through; color: var(--muted); }

/* ---------- Fichaje ---------- */
.clock-card { text-align: center; padding: 24px 16px; }
.clock { font-size: 3.2rem; font-weight: 700; font-variant-numeric: tabular-nums; letter-spacing: .02em; line-height: 1.1; }
.clock-date { color: var(--muted); margin-bottom: 12px; }
.state-pill { display: inline-flex; align-items: center; gap: 8px; padding: 6px 14px; border-radius: 999px; font-weight: 600; margin-bottom: 16px; }
.state-pill::before { content: ""; width: 10px; height: 10px; border-radius: 50%; background: currentColor; }
.state-pill.fuera { background: var(--surface-2); color: var(--muted); }
.state-pill.trabajando { background: var(--ok-soft); color: var(--ok); }
.state-pill.trabajando::before { animation: pulse 1.6s infinite; }
.state-pill.pausa { background: var(--pause-soft); color: var(--pause); }
@keyframes pulse { 50% { opacity: .3; } }
.worked-today { font-size: 1.1rem; margin-bottom: 16px; }
.worked-today strong { font-size: 1.6rem; font-variant-numeric: tabular-nums; }
.clock-actions { display: flex; gap: 12px; justify-content: center; flex-wrap: wrap; margin-top: 12px; }
.clock-actions .btn.big { min-width: 180px; }
.progress { height: 8px; border-radius: 99px; background: var(--surface-2); overflow: hidden; margin-top: 6px; }
.progress > div { height: 100%; background: var(--primary); border-radius: 99px; }
.progress.over > div { background: var(--warn); }
.timeline { list-style: none; padding: 0; margin: 0; }
.timeline li { display: flex; gap: 12px; padding: 8px 0; border-bottom: 1px dashed var(--border); align-items: center; }
.timeline li:last-child { border-bottom: 0; }
.timeline .t { font-weight: 700; font-variant-numeric: tabular-nums; min-width: 52px; }
.dot { width: 10px; height: 10px; border-radius: 50%; flex: none; background: var(--muted); }
.dot.entrada { background: var(--ok); }
.dot.salida { background: var(--danger); }
.dot.inicio_pausa, .dot.fin_pausa { background: var(--pause); }

/* ---------- Calendario ---------- */
.cal { display: grid; grid-template-columns: repeat(7, 1fr); gap: 4px; }
.cal .dow { text-align: center; font-size: .75rem; color: var(--muted); font-weight: 600; text-transform: uppercase; }
.cal .day { min-height: 84px; background: var(--surface); border: 1px solid var(--border); border-radius: 8px; padding: 4px; font-size: .75rem; overflow: hidden; }
.cal .day.out { visibility: hidden; }
.cal .day.weekend { background: var(--surface-2); }
.cal .day.holiday { background: var(--warn-soft); }
.cal .day.today { outline: 2px solid var(--primary); }
.cal .day .n { font-weight: 700; font-size: .85rem; }
.cal .chip { display: block; border-radius: 4px; padding: 1px 4px; margin-top: 2px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; background: var(--primary-soft); color: var(--primary); }
.cal .chip.pendiente { background: var(--surface-2); color: var(--muted); border: 1px dashed var(--border); }
.cal .chip.hol { background: transparent; color: var(--warn); padding: 0; }
@media (max-width: 600px) { .cal .day { min-height: 56px; } .cal .chip { font-size: .65rem; } }

/* ---------- Diálogos y avisos ---------- */
dialog {
  border: 0; border-radius: 16px; padding: 0; width: min(560px, calc(100vw - 24px));
  background: var(--surface); color: var(--text); box-shadow: 0 20px 50px rgba(0, 0, 0, .3);
}
dialog::backdrop { background: rgba(10, 15, 25, .5); }
dialog .dlg-body { padding: 20px; max-height: 80vh; overflow-y: auto; }
dialog .dlg-actions { display: flex; justify-content: flex-end; gap: 8px; margin-top: 16px; flex-wrap: wrap; }
.toast-box { position: fixed; left: 50%; transform: translateX(-50%); bottom: 88px; z-index: 100; display: grid; gap: 8px; width: min(420px, calc(100vw - 24px)); }
.toast { background: var(--text); color: var(--bg); padding: 10px 14px; border-radius: 10px; box-shadow: 0 6px 20px rgba(0, 0, 0, .25); }
.toast.error { background: var(--danger); color: #fff; }

.auth-wrap { max-width: 420px; margin: 8vh auto 0; }
.auth-wrap .card { padding: 24px; }
.empty { text-align: center; color: var(--muted); padding: 24px 8px; }
.loading { text-align: center; color: var(--muted); padding: 40px; }
.person-card .name { font-weight: 700; }
.kv { display: grid; grid-template-columns: max-content 1fr; gap: 4px 16px; font-size: .92rem; }
.kv dt { color: var(--muted); }
.kv dd { margin: 0; }
pre.mail { white-space: pre-wrap; font: inherit; font-size: .85rem; background: var(--surface-2); padding: 10px; border-radius: 8px; margin: 8px 0 0; }
.sched-row { display: grid; grid-template-columns: 110px 1fr 1fr 80px 80px; gap: 8px; align-items: center; margin-bottom: 6px; }
.sched-row.flex { grid-template-columns: 110px 110px 1fr; }
.sched-row label { margin: 0; }
.sched-head { font-size: .75rem; text-transform: uppercase; letter-spacing: .03em; color: var(--muted); font-weight: 600; margin-bottom: 2px; }
.sched-row .r { text-align: right; }
.week-total { margin: 8px 0 0; text-align: right; }
@media (max-width: 520px) {
  .sched-row { grid-template-columns: 1fr 1fr 1fr; }
  .sched-row .check { grid-column: 1 / -1; }
  .sched-row .r { grid-column: 1 / -1; text-align: left; font-size: .85rem; color: var(--muted); }
  .sched-head:not(.flex) { display: none; }
  .sched-row.flex { grid-template-columns: 1fr 1fr; }
}

/* ---------- Informe imprimible ---------- */
.report { background: #fff; color: #000; padding: 24px; border-radius: var(--radius); border: 1px solid var(--border); }
.report h1 { font-size: 1.3rem; }
.report table { font-size: .8rem; }
.report th, .report td { border: 1px solid #bbb; padding: 4px 6px; color: #000; }
.report th { color: #333; background: #f1f1f1; }
.report tr.off td { background: #f7f7f7; color: #555; }
.report .head { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; margin-bottom: 16px; font-size: .88rem; }
.report .head div { border: 1px solid #bbb; padding: 8px 10px; }
.report .signs { display: grid; grid-template-columns: 1fr 1fr; gap: 24px; margin-top: 16px; }
.report .signs .sig-space { height: 64px; display: flex; align-items: flex-end; }
.report .signs .sig-space img { height: 60px; width: auto; }
.report .signs .sig-line { border-top: 1px solid #000; padding-top: 6px; font-size: .85rem; min-height: 40px; }
.report .legal { font-size: .75rem; color: #444; margin-top: 16px; }

@media print {
  .topbar, .bottomnav, .no-print, .toast-box { display: none !important; }
  body { background: #fff; }
  main { padding: 0; max-width: none; }
  .report { border: 0; padding: 0; }
  @page { size: A4 landscape; margin: 12mm; }
}

/* ---------- Verificación en dos pasos ---------- */
.steps { padding-left: 20px; }
.steps li { margin-bottom: 8px; }
.qr { width: 200px; max-width: 100%; margin: 10px 0; background: #fff; padding: 6px; border-radius: 8px; border: 1px solid var(--border); }
.qr svg { display: block; width: 100%; height: auto; }
code.secret { font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace; font-size: .85rem; word-break: break-all; }
.otp-input { font-size: 1.6rem; letter-spacing: .4em; text-align: center; font-variant-numeric: tabular-nums; max-width: 240px; }
ul.codes {
  list-style: none; padding: 12px; margin: 0 0 16px; display: grid; grid-template-columns: repeat(2, 1fr); gap: 6px 16px;
  background: var(--surface-2); border-radius: 10px; font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace; font-size: 1rem;
}

/* ---------- Documentos ---------- */
ul.docs { list-style: none; padding: 0; margin: 0 0 8px; }
.doc { display: flex; gap: 12px; align-items: flex-start; padding: 10px 0; border-bottom: 1px solid var(--border); }
.doc:last-child { border-bottom: 0; }
.doc-ext {
  flex: none; width: 44px; height: 52px; border-radius: 6px; background: var(--primary-soft); color: var(--primary);
  display: grid; place-items: center; font-size: .7rem; font-weight: 700; letter-spacing: .03em;
}
.doc-main { flex: 1; min-width: 0; }
.doc-main strong { word-break: break-word; }
.doc-actions { display: flex; gap: 6px; flex-wrap: wrap; justify-content: flex-end; }
h3.doc-cat { font-size: .8rem; text-transform: uppercase; letter-spacing: .04em; color: var(--muted); margin: 14px 0 2px; }
@media (max-width: 520px) { .doc { flex-wrap: wrap; } .doc-actions { width: 100%; justify-content: flex-start; padding-left: 56px; } }

/* ---------- Selector de tema ---------- */
.theme-toggle {
  flex: none; display: inline-grid; place-items: center; width: 38px; height: 38px; border-radius: 10px;
  border: 1px solid var(--border); background: var(--surface); color: var(--muted); cursor: pointer; padding: 0;
}
.theme-toggle:hover { color: var(--primary); background: var(--primary-soft); }
.theme-toggle svg { width: 20px; height: 20px; }
@media (max-width: 760px) { .topbar .theme-toggle { margin-left: auto; } }

/* ---------- Hoja del QR de la oficina ---------- */
.qr-sheet { max-width: 640px; margin: 0 auto; text-align: center; background: #fff; color: #000; border-radius: var(--radius); padding: 32px 24px; border: 1px solid var(--border); }
.qr-sheet h1 { font-size: 2rem; margin-bottom: 4px; }
.qr-logo { width: 64px; height: 64px; }
.qr-company { font-size: 1.1rem; color: #333; }
.qr-big { width: min(360px, 80vw); margin: 16px auto; }
.qr-big svg { display: block; width: 100%; height: auto; }
.qr-steps { text-align: left; max-width: 420px; margin: 0 auto; color: #222; }
@media print { .qr-sheet { border: 0; } }

/* ---------- Planificador anual ---------- */
.segmented a.seg { display: inline-block; text-decoration: none; color: var(--muted); padding: 8px 14px; min-height: 40px; background: var(--surface); }
.segmented a.seg + a.seg { border-left: 1px solid var(--border); }
.segmented a.seg.active { background: var(--primary-soft); color: var(--primary); font-weight: 600; }
.planner-month + .planner-month { margin-top: 18px; }
.planner-month h3 { text-transform: capitalize; margin-bottom: 6px; }
table.planner { border-collapse: separate; border-spacing: 2px; width: auto; font-size: .68rem; }
table.planner th, table.planner td { padding: 0; border: 0; text-align: center; vertical-align: middle; }
table.planner thead th { color: var(--muted); font-weight: 600; min-width: 20px; line-height: 1.15; text-transform: none; letter-spacing: 0; }
table.planner thead th span { display: block; font-weight: 400; font-size: .6rem; }
table.planner thead th.we { opacity: .6; }
table.planner thead th.today { color: var(--primary); }
table.planner th.who { text-transform: none; letter-spacing: 0; text-align: left; padding-right: 8px; font-size: .78rem; color: var(--text); white-space: nowrap; max-width: 90px; overflow: hidden; text-overflow: ellipsis; position: sticky; left: 0; background: var(--surface); }
table.planner td { width: 20px; height: 20px; border-radius: 4px; background: var(--surface-2); }
table.planner td.we { background: transparent; }
table.planner td.hol { background: var(--warn-soft); box-shadow: inset 0 0 0 1px var(--warn); }
table.planner td.abs.vac { background: var(--primary); }
table.planner td.abs.otra { background: var(--pause); }
table.planner td.abs.pend { background: repeating-linear-gradient(45deg, var(--primary-soft) 0 3px, transparent 3px 6px); box-shadow: inset 0 0 0 1px var(--primary); }
table.planner td.abs.part { opacity: .55; }
table.planner tr.count td { background: transparent; color: var(--muted); font-size: .68rem; }
table.planner tr.count td.many { color: var(--danger); font-weight: 700; }
.planner-legend { display: flex; flex-wrap: wrap; gap: 6px 16px; margin: 8px 0 12px; font-size: .85rem; color: var(--muted); }
.planner-legend i { display: inline-block; width: 14px; height: 14px; border-radius: 3px; vertical-align: -2px; margin-right: 4px; background: var(--surface-2); }
.planner-legend i.vac { background: var(--primary); }
.planner-legend i.otra { background: var(--pause); }
.planner-legend i.pend { background: repeating-linear-gradient(45deg, var(--primary-soft) 0 3px, transparent 3px 6px); box-shadow: inset 0 0 0 1px var(--primary); }
.planner-legend i.hol { background: var(--warn-soft); box-shadow: inset 0 0 0 1px var(--warn); }
.planner-legend i.we { background: transparent; border: 1px dashed var(--border); }

/* Firma en pantalla: siempre sobre fondo blanco, como el papel. */
.sig-pad { position: relative; background: #fff; border: 1px dashed var(--border); border-radius: 10px; aspect-ratio: 3 / 1; width: 100%; max-width: 560px; margin: 8px auto 0; }
.sig-pad canvas { position: absolute; inset: 0; width: 100%; height: 100%; touch-action: none; cursor: crosshair; border-radius: 10px; }
.sig-pad::after { content: ''; position: absolute; left: 8%; right: 8%; bottom: 22%; border-bottom: 1px solid #c9ced6; pointer-events: none; }
.sig-hint { position: absolute; left: 0; right: 0; top: 50%; transform: translateY(-50%); text-align: center; color: #9aa3ae; font-size: .9rem; pointer-events: none; }
.sig-img { background: #fff; border: 1px solid var(--border); border-radius: 6px; height: 48px; width: auto; vertical-align: middle; }
