/* =========================================================
   Control de Obra — UI "Taller"
   Paleta: papel cálido + terracota + pizarra
   ========================================================= */
@import url('https://fonts.googleapis.com/css2?family=Bricolage+Grotesque:opsz,wght@12..96,500;12..96,700;12..96,800&family=Source+Sans+3:wght@400;500;600;700&display=swap');

:root {
  --bg: #f4efe6;
  --bg-deep: #ebe3d4;
  --paper: #fffaf3;
  --card: #fffaf3;
  --card-soft: #f7f0e4;
  --ink: #1c1915;
  --ink-soft: #4a433a;
  --muted: #7a7164;
  --line: #e2d6c4;
  --line-strong: #cfc0a8;
  --accent: #c45c26;
  --accent-deep: #9a4115;
  --accent-soft: #f8e4d6;
  --teal: #0f6b5c;
  --teal-soft: #d8f0ea;
  --blue: #1e4d7b;
  --blue-soft: #dceaf8;
  --green: #1f7a45;
  --green-soft: #d9f0e2;
  --red: #b42318;
  --red-soft: #fde8e6;
  --amber: #b45309;
  --amber-soft: #fef3c7;
  --violet: #6d28d9;
  --shadow: 0 1px 2px rgba(28, 25, 21, 0.06), 0 8px 24px rgba(28, 25, 21, 0.06);
  --shadow-lg: 0 4px 8px rgba(28, 25, 21, 0.06), 0 20px 40px rgba(28, 25, 21, 0.1);
  --radius: 18px;
  --radius-sm: 12px;
  --header-h: 64px;
  --bottom-h: 72px;
  --wrap: 920px;
  --font-display: "Bricolage Grotesque", system-ui, sans-serif;
  --font-body: "Source Sans 3", system-ui, sans-serif;
}

*, *::before, *::after { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body {
  margin: 0;
  font-family: var(--font-body);
  background:
    radial-gradient(ellipse 80% 50% at 10% -10%, rgba(196, 92, 38, 0.08), transparent 50%),
    radial-gradient(ellipse 60% 40% at 100% 0%, rgba(15, 107, 92, 0.06), transparent 45%),
    linear-gradient(180deg, var(--bg) 0%, var(--bg-deep) 100%);
  background-attachment: fixed;
  color: var(--ink);
  line-height: 1.5;
  min-height: 100vh;
  padding-bottom: calc(var(--bottom-h) + 28px);
  -webkit-font-smoothing: antialiased;
}
a { color: var(--accent-deep); text-decoration: none; }
a:hover { text-decoration: underline; text-underline-offset: 3px; }
button, input, select, textarea { font-family: inherit; }
img { max-width: 100%; }

/* ---------- Cabecera ---------- */
header {
  position: sticky;
  top: 0;
  z-index: 40;
  background: rgba(255, 250, 243, 0.88);
  backdrop-filter: blur(14px) saturate(1.2);
  border-bottom: 1px solid var(--line);
  box-shadow: 0 1px 0 rgba(255,255,255,0.6) inset;
}
.hbar {
  max-width: var(--wrap);
  margin: 0 auto;
  padding: 12px 16px;
  min-height: var(--header-h);
  display: flex;
  align-items: center;
  gap: 12px;
}
.brand {
  display: flex;
  align-items: center;
  gap: 10px;
  min-width: 0;
  flex: 1;
  text-decoration: none;
  color: inherit;
}
.brand:hover { text-decoration: none; }
.brand-mark {
  width: 40px;
  height: 40px;
  border-radius: 12px;
  background: linear-gradient(145deg, var(--accent) 0%, var(--accent-deep) 100%);
  color: #fff;
  display: grid;
  place-items: center;
  font-size: 20px;
  flex: none;
  box-shadow: 0 4px 12px rgba(196, 92, 38, 0.35);
}
.brand-text { min-width: 0; }
.brand-text strong {
  display: block;
  font-family: var(--font-display);
  font-size: 15px;
  font-weight: 800;
  letter-spacing: -0.02em;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  line-height: 1.2;
}
.brand-text span {
  display: block;
  font-size: 12px;
  color: var(--muted);
  font-weight: 500;
}

.nav {
  display: none;
  align-items: center;
  gap: 6px;
  flex-wrap: wrap;
}
.nav a, .nav button, .nav-chip {
  font-size: 13px;
  font-weight: 600;
  padding: 8px 12px;
  border-radius: 999px;
  border: 1px solid transparent;
  background: transparent;
  color: var(--ink-soft);
  cursor: pointer;
  transition: background .15s, color .15s, border-color .15s;
  white-space: nowrap;
}
.nav a:hover, .nav button:hover {
  background: var(--card-soft);
  text-decoration: none;
  color: var(--ink);
}
.nav a.on {
  background: var(--accent-soft);
  color: var(--accent-deep);
  border-color: #efc9b0;
}
.nav form { display: inline; margin: 0; }
.nav button {
  background: var(--card-soft);
  border-color: var(--line);
}
.badge {
  display: inline-flex;
  align-items: center;
  gap: 3px;
  font-size: 10px;
  font-weight: 800;
  letter-spacing: 0.04em;
  padding: 3px 8px;
  border-radius: 999px;
  background: var(--amber-soft);
  color: var(--amber);
  vertical-align: middle;
  margin-left: 4px;
  white-space: nowrap;
}
.badge.user { background: var(--green-soft); color: var(--green); }
.badge.admin { background: var(--accent-soft); color: var(--accent-deep); }
.badge.propietario { background: var(--blue-soft); color: var(--blue); }
.badge.secretaria { background: #ede9fe; color: var(--violet); }
.badge.maestro { background: var(--amber-soft); color: var(--amber); }

.roles-guide { margin-bottom: 18px; }
.roles-grid { display: grid; gap: 12px; }
.role-chip {
  display: flex;
  gap: 12px;
  align-items: flex-start;
  padding: 10px 0;
  border-bottom: 1px dashed var(--line);
}
.role-chip:last-child { border-bottom: none; padding-bottom: 0; }
.role-banner {
  display: flex;
  gap: 12px;
  align-items: flex-start;
  padding: 14px 16px;
  margin-bottom: 16px;
  background: var(--amber-soft);
  border: 1px solid #f5d58a;
  border-radius: var(--radius-sm);
  font-size: 14.5px;
}
.role-banner > span { font-size: 22px; line-height: 1; }
tr.user-locked { opacity: 0.72; }

/* ---------- Multi-contrato (pisos / fases) ---------- */
.ctr-switcher {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-bottom: 14px;
}
.ctr-chip {
  display: inline-flex;
  flex-direction: column;
  gap: 2px;
  padding: 10px 14px;
  border-radius: 14px;
  border: 1px solid var(--line);
  background: var(--paper);
  color: var(--ink-soft);
  font-weight: 700;
  font-size: 13.5px;
  text-decoration: none;
  box-shadow: var(--shadow);
  transition: border-color .15s, transform .15s;
}
@media (max-width: 819px) {
  .ctr-switcher {
    flex-wrap: nowrap;
    gap: 6px;
    margin: 0 -16px 12px;
    padding: 0 16px 6px;
    overflow-x: auto;
    overflow-y: hidden;
    -webkit-overflow-scrolling: touch;
    scrollbar-width: thin;
    overscroll-behavior-x: contain;
  }
  .ctr-switcher::-webkit-scrollbar { height: 3px; }
  .ctr-switcher::-webkit-scrollbar-thumb {
    background: rgba(40, 28, 18, 0.2);
    border-radius: 99px;
  }
  .ctr-chip {
    flex: 0 0 auto;
    flex-direction: row;
    align-items: baseline;
    gap: 6px;
    padding: 7px 11px;
    border-radius: 12px;
    font-size: 12.5px;
    white-space: nowrap;
    box-shadow: 0 1px 3px rgba(40, 28, 18, 0.06);
  }
  .ctr-chip-sub {
    font-size: 11px;
  }
  .ctr-chip.on {
    box-shadow: 0 0 0 2px rgba(196, 92, 38, 0.14);
  }
}
.ctr-chip-title {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  min-width: 0;
  line-height: 1.2;
}
.ctr-chip-title .ico {
  width: 14px;
  height: 14px;
  margin: 0;
  flex: none;
}
.ctr-chip:hover { text-decoration: none; border-color: var(--line-strong); }
.ctr-chip.on {
  border-color: var(--accent);
  background: var(--accent-soft);
  color: var(--accent-deep);
  box-shadow: 0 0 0 3px rgba(196, 92, 38, 0.12);
}
.ctr-chip.add { border-style: dashed; color: var(--muted); }
.ctr-chip-sub {
  font-size: 11.5px;
  font-weight: 600;
  color: var(--muted);
}
.ctr-chip.on .ctr-chip-sub { color: var(--accent-deep); opacity: 0.85; }
.ctr-chip.ctr-chip-off {
  opacity: 0.72;
  border-style: dashed;
}
.ctr-chip.ctr-chip-off.on {
  opacity: 1;
  border-style: solid;
}
.tag.ctr-tag {
  background: var(--blue-soft);
  color: var(--blue);
}
.btn[disabled],
.btn:disabled {
  opacity: 0.45;
  cursor: not-allowed;
  transform: none !important;
  box-shadow: none !important;
  pointer-events: none;
}

.ctr-grid {
  display: grid;
  gap: 14px;
}
@media (min-width: 720px) {
  .ctr-grid { grid-template-columns: 1fr 1fr; }
}
.ctr-card {
  background: var(--paper);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 16px 18px;
  box-shadow: var(--shadow);
}
.ctr-card.ctr-inactivo { opacity: 0.55; }
.ctr-card.estado-run { border-color: #f0c48a; background: linear-gradient(180deg, #fff8ee, var(--paper)); }
.ctr-card.estado-done { border-color: #a7dcc0; }
.ctr-card.estado-plan { border-color: var(--line); }
.ctr-head {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  align-items: flex-start;
}
.ctr-head h3 {
  margin: 8px 0 0;
  font-family: var(--font-display);
  font-size: 18px;
}
.ctr-monto {
  font-family: var(--font-display);
  font-weight: 800;
  font-size: 18px;
  color: var(--blue);
  white-space: nowrap;
}
.ctr-stats {
  display: flex;
  flex-wrap: wrap;
  gap: 10px 16px;
  font-size: 13px;
  color: var(--ink-soft);
}
.ctr-stats b { color: var(--ink); font-variant-numeric: tabular-nums; }
.ctr-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-top: 14px;
  padding-top: 12px;
  border-top: 1px dashed var(--line);
}
.badge.estado-plan { background: var(--card-soft); color: var(--muted); }
.badge.estado-run { background: var(--amber-soft); color: var(--amber); }
.badge.estado-pause { background: var(--blue-soft); color: var(--blue); }
.badge.estado-done { background: var(--green-soft); color: var(--green); }
.badge.estado-cancel { background: var(--red-soft); color: var(--red); }
.section-title .btn.sm { margin-left: auto; }
.section-title { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; }

.ctr-masivo {
  margin-bottom: 16px;
  padding: 14px 16px;
}
.ctr-masivo-head {
  display: flex;
  flex-direction: column;
  gap: 4px;
  margin-bottom: 12px;
}
.ctr-masivo-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  align-items: center;
}
.ctr-head-right {
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  gap: 10px;
  flex: none;
}
.ctr-switch-form {
  margin: 0;
}
.ctr-switch {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  cursor: pointer;
  user-select: none;
  margin: 0;
}
.ctr-switch input {
  position: absolute;
  opacity: 0;
  width: 1px;
  height: 1px;
  pointer-events: none;
}
.ctr-switch-track {
  position: relative;
  width: 44px;
  height: 26px;
  border-radius: 999px;
  background: var(--line-strong);
  border: 1px solid var(--line);
  transition: background .2s ease, border-color .2s ease;
  flex: none;
}
.ctr-switch-thumb {
  position: absolute;
  top: 2px;
  left: 2px;
  width: 20px;
  height: 20px;
  border-radius: 50%;
  background: #fff;
  box-shadow: 0 1px 3px rgba(28, 25, 21, 0.28);
  transition: transform .2s ease;
}
.ctr-switch.on .ctr-switch-track,
.ctr-switch:has(input:checked) .ctr-switch-track {
  background: linear-gradient(180deg, #d4682e 0%, var(--accent) 100%);
  border-color: var(--accent-deep);
}
.ctr-switch.on .ctr-switch-thumb,
.ctr-switch:has(input:checked) .ctr-switch-thumb {
  transform: translateX(18px);
}
.ctr-switch-label {
  font-size: 12px;
  font-weight: 700;
  color: var(--muted);
  letter-spacing: 0.01em;
  white-space: nowrap;
}
.ctr-switch.on .ctr-switch-label,
.ctr-switch:has(input:checked) .ctr-switch-label {
  color: var(--amber);
}
.ctr-switch input:focus-visible + .ctr-switch-track {
  outline: 2px solid var(--accent);
  outline-offset: 2px;
}
.ctr-card .ctr-head h3 {
  display: block;
  margin: 8px 0 0;
}

/* Modal editar contrato */
.modal-root.ctr-edit-modal {
  z-index: 110;
}
.modal-root.ctr-edit-modal .modal-sheet {
  max-width: 720px;
  max-height: min(96vh, 920px);
  height: auto;
  width: min(92vw, 720px);
}
.modal-root.ctr-edit-modal #editCtrSlot {
  display: flex;
  flex-direction: column;
  flex: 1 1 auto;
  min-height: 0;
  overflow: hidden;
}
.modal-root.ctr-edit-modal #editCtrSlot .modal-form {
  display: flex;
  flex-direction: column;
  flex: 1 1 auto;
  min-height: 0;
  overflow: hidden;
}
.modal-root.ctr-edit-modal #editCtrSlot .modal-body {
  flex: 1 1 auto;
  min-height: 0;
  overflow-y: auto;
  -webkit-overflow-scrolling: touch;
}
.modal-root.ctr-edit-modal #editCtrSlot .modal-foot {
  flex: none;
  flex-direction: row;
  justify-content: flex-end;
  gap: 10px;
}
.modal-root.ctr-edit-modal #editCtrSlot .modal-foot .btn {
  flex: none;
  min-width: 120px;
}
@media (min-width: 560px) {
  .modal-root.ctr-edit-modal .modal-sheet {
    max-width: 780px;
    width: min(92vw, 780px);
    max-height: min(92vh, 920px);
    height: auto;
  }
}

.warn-irreversible {
  background: var(--red-soft);
  border: 1px solid #f0c4bf;
  border-radius: var(--radius-sm);
  padding: 12px 14px;
  margin-bottom: 14px;
  color: var(--red);
}
.warn-irreversible strong {
  display: block;
  font-size: 14px;
  margin-bottom: 4px;
}
.warn-irreversible p {
  margin: 0;
  font-size: 13.5px;
  font-weight: 500;
  color: var(--ink-soft);
  line-height: 1.45;
}
.ctr-confirm-check {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  margin-top: 14px;
  padding: 12px 14px;
  background: var(--card-soft);
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
  font-size: 14px;
  font-weight: 600;
  color: var(--ink);
  cursor: pointer;
}
.ctr-confirm-check input {
  width: 18px;
  height: 18px;
  margin-top: 2px;
  accent-color: var(--red);
  flex: none;
  cursor: pointer;
}
#btnArchivarConfirm:disabled {
  opacity: 0.45;
  cursor: not-allowed;
  transform: none;
  box-shadow: none;
}

/* Datos del proyecto: readonly + desbloquear */
.proj-card {
  position: relative;
  padding-top: 52px;
}
.proj-card-toolbar {
  position: absolute;
  top: 12px;
  right: 12px;
  display: flex;
  gap: 6px;
  z-index: 2;
}
.proj-card.is-locked input,
.proj-card.is-locked textarea,
.proj-card.is-locked select {
  background: var(--card-soft);
  color: var(--ink-soft);
  border-color: var(--line);
  cursor: default;
  box-shadow: none;
}
.proj-card.is-locked input:focus,
.proj-card.is-locked textarea:focus,
.proj-card.is-locked select:focus {
  outline: none;
  border-color: var(--line);
  box-shadow: none;
}
.proj-card.is-editing {
  border-color: #efc9b0;
  box-shadow: var(--shadow), 0 0 0 3px var(--accent-soft);
}
.proj-card.is-editing .proj-card-toolbar .btn {
  border-color: var(--line-strong);
  background: #fff;
}
.proj-save-row {
  margin-top: 8px;
}
.proj-card.is-locked .proj-save-row {
  display: none !important;
}
.proj-card.is-editing .proj-save-row {
  display: flex !important;
}
.proj-card.is-locked .proj-save-row .btn,
.proj-save-row .btn:disabled {
  opacity: 0.45;
  cursor: not-allowed;
  pointer-events: none;
  transform: none;
  box-shadow: none;
}

/* Modal ver pagos del contrato */
.modal-root.ctr-pagos-modal {
  z-index: 110;
}
.modal-root.ctr-pagos-modal .modal-sheet {
  max-width: 720px;
  width: min(92vw, 720px);
  max-height: min(92vh, 1100px);
  height: min(92vh, 1100px);
}
.modal-root.ctr-pagos-modal .ctr-pagos-body {
  padding: 0 !important;
  overflow: hidden !important;
  display: flex;
  flex-direction: column;
}
.ctr-pagos-layout {
  display: flex;
  flex-direction: column;
  flex: 1;
  min-height: 0;
  height: 100%;
}
.ctr-pagos-pin {
  flex: none;
  padding: 14px 18px 12px;
  border-bottom: 1px solid var(--line);
  background: linear-gradient(180deg, var(--paper) 70%, rgba(255, 250, 243, 0.92));
}
.ctr-pagos-scroll {
  flex: 1;
  min-height: 0;
  overflow-y: auto;
  -webkit-overflow-scrolling: touch;
  overscroll-behavior: contain;
  padding: 12px 18px 16px;
}
.ctr-pagos-lista .mov {
  margin-bottom: 8px;
}
.ctr-pagos-lista .mov:last-child {
  margin-bottom: 0;
}
.modal-root.ctr-pagos-modal .ctr-pagos-body > .hist-loading,
.modal-root.ctr-pagos-modal .ctr-pagos-body > .empty {
  margin: auto;
  padding: 48px 16px;
}
@media (min-width: 560px) {
  .modal-root.ctr-pagos-modal .modal-sheet {
    max-width: 780px;
    width: min(92vw, 780px);
  }
}

.hbar-rol {
  display: flex;
  align-items: center;
  flex: none;
  max-width: min(46vw, 180px);
  text-decoration: none;
  color: inherit;
}
.hbar-rol:hover { text-decoration: none; }
.hbar-rol .badge {
  margin-left: 0;
  max-width: 100%;
  overflow: hidden;
  text-overflow: ellipsis;
}
.menu-btn {
  display: grid;
  place-items: center;
  width: 42px;
  height: 42px;
  border-radius: 12px;
  border: 1px solid var(--line);
  background: var(--paper);
  color: var(--ink);
  cursor: pointer;
  flex: none;
  font-size: 18px;
}
.menu-btn:hover { background: var(--card-soft); }

/* Menú móvil: overlay (no empuja el contenido) */
.mobile-menu-scrim {
  display: none;
  position: fixed;
  inset: 0;
  z-index: 39;
  background: rgba(40, 28, 18, 0.28);
  border: none;
  padding: 0;
  cursor: pointer;
}
.mobile-menu-scrim.open { display: block; }
.mobile-menu {
  display: none;
  position: absolute;
  left: 0;
  right: 0;
  top: 100%;
  z-index: 41;
  border-top: 1px solid var(--line);
  background: var(--paper);
  padding: 10px 16px 16px;
  box-shadow: 0 18px 36px rgba(40, 28, 18, 0.2);
  max-height: min(70vh, calc(100dvh - var(--header-h) - 8px));
  overflow-y: auto;
  -webkit-overflow-scrolling: touch;
}
.mobile-menu.open { display: block; }
.mobile-menu a,
.mobile-menu button {
  display: flex;
  align-items: center;
  gap: 10px;
  width: 100%;
  text-align: left;
  padding: 12px 14px;
  border-radius: var(--radius-sm);
  border: none;
  background: transparent;
  color: var(--ink);
  font-size: 15px;
  font-weight: 600;
  cursor: pointer;
  text-decoration: none;
}
.mobile-menu a:hover,
.mobile-menu button:hover { background: var(--card-soft); text-decoration: none; }
.mobile-menu form { margin: 0; }
.mobile-menu .sep {
  height: 1px;
  background: var(--line);
  margin: 8px 0;
}

.wrap {
  max-width: var(--wrap);
  margin: 0 auto;
  padding: 18px 16px 8px;
}

/* ---------- Avisos (toast flotante) ---------- */
.flash-host {
  position: fixed;
  top: calc(var(--header-h) + 14px);
  left: 50%;
  transform: translateX(-50%);
  z-index: 200;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 8px;
  width: min(420px, calc(100vw - 32px));
  pointer-events: none;
}
.flash {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  width: 100%;
  padding: 12px 16px;
  border-radius: 12px;
  font-size: 14px;
  font-weight: 600;
  line-height: 1.35;
  text-align: center;
  justify-content: center;
  border: 1px solid var(--line);
  background: var(--paper);
  box-shadow: var(--shadow-lg);
  animation: flashIn .28s ease;
  pointer-events: none;
}
.flash.ok {
  background: var(--green-soft);
  border-color: #a7dcc0;
  color: #14532d;
}
.flash.error {
  background: var(--red-soft);
  border-color: #f5c2c0;
  color: #7f1d1d;
}
.flash.flash-out {
  animation: flashOut .32s ease forwards;
}
@keyframes flashIn {
  from { opacity: 0; transform: translateY(-10px) scale(0.98); }
  to { opacity: 1; transform: none; }
}
@keyframes flashOut {
  from { opacity: 1; transform: none; }
  to { opacity: 0; transform: translateY(-8px) scale(0.98); }
}
@media (max-width: 720px) {
  .flash-host {
    top: 12px;
  }
}

/* ---------- Pestañas (desktop / top) ---------- */
.tabs {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px;
  margin-bottom: 18px;
  padding: 5px;
  background: rgba(255, 250, 243, 0.7);
  border: 1px solid var(--line);
  border-radius: 16px;
  box-shadow: var(--shadow);
}
.tabs a {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 12px 10px;
  border-radius: 12px;
  color: var(--muted);
  font-weight: 700;
  font-size: 14px;
  text-decoration: none;
  transition: all .18s;
}
.tabs a:hover { color: var(--ink); background: rgba(255,255,255,0.5); text-decoration: none; }
.tabs a.on {
  background: var(--paper);
  color: var(--ink);
  box-shadow: var(--shadow);
  border: 1px solid var(--line);
}
.tabs .tab-ic {
  font-size: 18px;
  line-height: 1;
}
.tabs .tab-label { line-height: 1.15; }
.tabs .tab-sub {
  display: block;
  font-size: 11px;
  font-weight: 500;
  color: var(--muted);
  margin-top: 2px;
}
.tabs a.on .tab-sub { color: var(--accent); }

/* ---------- Tarjetas ---------- */
.card {
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 18px;
  box-shadow: var(--shadow);
}
.page-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 16px;
  flex-wrap: wrap;
}
.page-head h2 {
  margin: 0;
  font-family: var(--font-display);
  font-size: 22px;
  font-weight: 800;
  letter-spacing: -0.02em;
  text-transform: none;
  color: var(--ink);
}
.page-head p {
  margin: 4px 0 0;
  color: var(--muted);
  font-size: 14px;
}

.hero {
  position: relative;
  overflow: hidden;
  background:
    linear-gradient(135deg, #2a2118 0%, #3d2e22 45%, #5c3a24 100%);
  border-color: #4a3528;
  color: #faf6f0;
  padding: 22px 20px 20px;
}
.hero::before {
  content: "";
  position: absolute;
  inset: 0;
  background:
    radial-gradient(circle at 90% 10%, rgba(196, 92, 38, 0.45), transparent 40%),
    radial-gradient(circle at 10% 90%, rgba(15, 107, 92, 0.25), transparent 35%),
    repeating-linear-gradient(
      -12deg,
      transparent,
      transparent 12px,
      rgba(255,255,255,0.02) 12px,
      rgba(255,255,255,0.02) 13px
    );
  pointer-events: none;
}
.hero > * { position: relative; z-index: 1; }
.hero.casa {
  background: linear-gradient(135deg, #0f2f2a 0%, #164a42 50%, #1a5c52 100%);
  border-color: #1a4a42;
}
.hero.casa::before {
  background:
    radial-gradient(circle at 85% 15%, rgba(56, 189, 160, 0.3), transparent 40%),
    radial-gradient(circle at 15% 80%, rgba(196, 92, 38, 0.15), transparent 35%);
}
.hero-val-row {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
}
.hero-val-row .val {
  flex: 1;
  min-width: 0;
}
.hero-eye {
  appearance: none;
  flex: none;
  width: 36px;
  height: 36px;
  border-radius: 10px;
  border: 1px solid rgba(255, 255, 255, 0.18);
  background: rgba(255, 255, 255, 0.08);
  color: rgba(250, 246, 240, 0.9);
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  transition: background .15s ease, border-color .15s ease;
  padding: 0;
}
.hero-eye:hover {
  background: rgba(255, 255, 255, 0.16);
  border-color: rgba(255, 255, 255, 0.28);
}
.hero-eye-ico {
  width: 20px;
  height: 20px;
  display: block;
}
.hero-eye-ico.off { display: none; }
body.is-amt-hidden .hero-eye-ico.on,
.hero.is-amt-hidden .hero-eye-ico.on { display: none; }
body.is-amt-hidden .hero-eye-ico.off,
.hero.is-amt-hidden .hero-eye-ico.off { display: block; }
span[data-amt-hide] {
  display: inline-block;
}
body.is-amt-hidden [data-amt-hide],
.hero.is-amt-hidden [data-amt-hide] {
  filter: blur(9px);
  user-select: none;
  pointer-events: none;
}
body.is-amt-hidden .hero-eye,
.hero.is-amt-hidden .hero-eye {
  background: rgba(255, 255, 255, 0.18);
}
.hero .lbl {
  font-size: 13px;
  font-weight: 600;
  color: rgba(250, 246, 240, 0.72);
  margin-bottom: 6px;
  letter-spacing: 0.02em;
}
.hero .val {
  font-family: var(--font-display);
  font-size: clamp(32px, 8vw, 42px);
  font-weight: 800;
  letter-spacing: -0.03em;
  line-height: 1.05;
  font-variant-numeric: tabular-nums;
}
.hero .val.red { color: #fca5a5; }
.hero .sub {
  font-size: 13.5px;
  color: rgba(250, 246, 240, 0.65);
  margin-top: 8px;
}
.hero .bar {
  height: 10px;
  background: rgba(0, 0, 0, 0.35);
  border-radius: 999px;
  overflow: hidden;
  margin-top: 16px;
  border: 1px solid rgba(255,255,255,0.08);
}
.hero .bar > i {
  display: block;
  height: 100%;
  border-radius: 999px;
  background: linear-gradient(90deg, #34d399, #fbbf24);
  transition: width .5s ease;
}
.hero .bar.over > i {
  background: linear-gradient(90deg, #fbbf24, #f87171);
}
.hero-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 14px;
}
.pill {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 6px 11px;
  border-radius: 999px;
  font-size: 12.5px;
  font-weight: 600;
  background: rgba(255,255,255,0.1);
  border: 1px solid rgba(255,255,255,0.12);
  color: rgba(255,255,255,0.9);
  backdrop-filter: blur(4px);
}

/* Mini stats */
.minis {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
  margin-top: 12px;
}
.mini {
  background: var(--paper);
  border: 1px solid var(--line);
  border-radius: 14px;
  padding: 14px;
  box-shadow: var(--shadow);
  transition: transform .15s, box-shadow .15s;
}
.mini:hover {
  transform: translateY(-1px);
  box-shadow: var(--shadow-lg);
}
.mini .lbl {
  font-size: 12px;
  font-weight: 600;
  color: var(--muted);
  display: flex;
  align-items: center;
  gap: 6px;
}
.mini .val {
  font-family: var(--font-display);
  font-size: 20px;
  font-weight: 800;
  margin-top: 6px;
  letter-spacing: -0.02em;
  font-variant-numeric: tabular-nums;
  color: var(--ink);
}
.val.green { color: var(--green); }
.val.red { color: var(--red); }
.val.amber { color: var(--amber); }
.val.blue { color: var(--blue); }
.val.violet { color: var(--accent); }
.val.teal { color: var(--teal); }

.refbox {
  background: var(--blue-soft);
  border: 1px solid #bdd4ec;
  border-radius: 14px;
  padding: 14px 16px;
  margin-top: 12px;
  font-size: 14px;
  color: var(--blue);
  display: flex;
  gap: 12px;
  align-items: flex-start;
}
.refbox .ref-ic {
  font-size: 20px;
  line-height: 1;
  flex: none;
}
.refbox .ref-ic.ref-ic-svg {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 34px;
  height: 34px;
  border-radius: 10px;
  background: rgba(180, 83, 9, 0.12);
  color: var(--amber);
  font-size: 0;
}
.refbox .ref-ic.ref-ic-svg .ico {
  width: 18px;
  height: 18px;
}
.ico {
  display: inline-block;
  width: 1em;
  height: 1em;
  vertical-align: -0.15em;
  flex: none;
  overflow: visible;
}
.ico-estado-plan { color: var(--muted); }
.ico-estado-run { color: var(--amber); }
.ico-estado-pause { color: var(--blue); }
.ico-estado-done { color: var(--green); }
.ico-estado-cancel { color: var(--red); }
.badge .ico {
  width: 11px;
  height: 11px;
  margin: 0;
  display: block;
}
.ctr-chip .ico {
  opacity: 1;
}
.ctr-chip.estado-plan .ico { color: var(--muted); }
.ctr-chip.estado-run .ico { color: var(--amber); }
.ctr-chip.estado-pause .ico { color: var(--blue); }
.ctr-chip.estado-done .ico { color: var(--green); }
.ctr-chip.estado-cancel .ico { color: var(--red); }
.estado-inline {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  white-space: nowrap;
  vertical-align: middle;
}
.estado-inline .ico {
  width: 12px;
  height: 12px;
  margin: 0;
  display: block;
}
.refbox b { color: var(--ink); font-weight: 700; }
.refbox a { color: var(--accent-deep); font-weight: 600; }

.section-title {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  margin: 28px 2px 12px;
  flex-wrap: wrap;
}
.section-title h2 {
  margin: 0;
  font-family: var(--font-display);
  font-size: 15px;
  font-weight: 800;
  color: var(--ink-soft);
  text-transform: uppercase;
  letter-spacing: 0.06em;
}
.section-title .count {
  font-size: 12px;
  font-weight: 700;
  color: var(--muted);
  background: var(--card-soft);
  border: 1px solid var(--line);
  padding: 4px 10px;
  border-radius: 999px;
}

h2 {
  font-size: 13px;
  font-family: var(--font-display);
  color: var(--muted);
  margin: 24px 4px 10px;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  font-weight: 700;
}

/* ---------- Botones ---------- */
.btn {
  border: 1px solid var(--line-strong);
  border-radius: 12px;
  padding: 11px 16px;
  font-size: 14.5px;
  font-weight: 700;
  cursor: pointer;
  background: var(--paper);
  color: var(--ink);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  text-align: center;
  text-decoration: none;
  transition: transform .12s, box-shadow .12s, background .12s, border-color .12s;
  line-height: 1.2;
}
.btn:hover {
  background: var(--card-soft);
  text-decoration: none;
  transform: translateY(-1px);
  box-shadow: var(--shadow);
}
.btn:active { transform: translateY(0); }
.btn.primary {
  background: linear-gradient(180deg, #d4682e 0%, var(--accent) 100%);
  color: #fff;
  border-color: var(--accent-deep);
  box-shadow: 0 4px 14px rgba(196, 92, 38, 0.28);
}
.btn.primary:hover {
  background: linear-gradient(180deg, #db7340 0%, #ce5f2a 100%);
  filter: none;
  color: #fff;
}
.btn.teal {
  background: linear-gradient(180deg, #14806e 0%, var(--teal) 100%);
  color: #fff;
  border-color: #0a5247;
  box-shadow: 0 4px 14px rgba(15, 107, 92, 0.28);
}
.btn.teal:hover { color: #fff; }
.btn.violet {
  background: linear-gradient(180deg, #d4682e 0%, var(--accent) 100%);
  color: #fff;
  border-color: var(--accent-deep);
}
.btn.violet:hover { color: #fff; }
.btn.danger {
  background: var(--red-soft);
  color: var(--red);
  border-color: #f0b4b0;
}
.btn.ghost {
  background: transparent;
  border-color: var(--line);
  color: var(--ink-soft);
}
.btn.sm {
  padding: 7px 11px;
  font-size: 12.5px;
  border-radius: 10px;
  font-weight: 600;
}
.btn.block {
  width: 100%;
  padding: 15px;
  font-size: 16px;
  font-weight: 800;
  border-radius: 14px;
}
.btn-row {
  display: flex;
  gap: 10px;
  margin-top: 20px;
  flex-wrap: wrap;
}
.btn-row .btn { flex: 1; min-width: 120px; }

/* CTA flotante / acciones rápidas */
.quick-actions {
  display: flex;
  gap: 10px;
  margin: 16px 0 4px;
  flex-wrap: wrap;
}
.quick-actions .btn {
  flex: 1;
  min-width: 140px;
  padding: 14px 16px;
  font-size: 15px;
}

/* ---------- Formularios ---------- */
label {
  display: block;
  font-size: 13px;
  color: var(--ink-soft);
  margin: 14px 0 6px;
  font-weight: 700;
}
.field-hint {
  font-size: 12px;
  color: var(--muted);
  font-weight: 500;
  margin-left: 4px;
}
input, select, textarea {
  width: 100%;
  padding: 12px 14px;
  border-radius: 12px;
  border: 1.5px solid var(--line-strong);
  background: #fff;
  color: var(--ink);
  font-size: 16px;
  transition: border-color .15s, box-shadow .15s;
}
input:hover, select:hover, textarea:hover { border-color: #b8a78c; }
input:focus, select:focus, textarea:focus {
  outline: none;
  border-color: var(--accent);
  box-shadow: 0 0 0 4px rgba(196, 92, 38, 0.15);
}
input[type=file] {
  padding: 10px;
  font-size: 14px;
  background: var(--card-soft);
  border-style: dashed;
}
input[type=checkbox] { width: auto; accent-color: var(--accent); }
.grid2 {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
}
.hint {
  font-size: 12.5px;
  color: var(--muted);
  margin-top: 8px;
  line-height: 1.45;
}

.typegrid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px;
}
.typegrid label { display: block; margin: 0; cursor: pointer; }
.typegrid input { position: absolute; opacity: 0; pointer-events: none; }
.typegrid span {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  padding: 14px 10px;
  border-radius: 12px;
  border: 1.5px solid var(--line);
  background: #fff;
  color: var(--ink-soft);
  font-size: 14px;
  font-weight: 700;
  text-align: center;
  transition: all .15s;
}
.typegrid label:hover span {
  border-color: var(--line-strong);
  background: var(--card-soft);
}
.typegrid input:checked + span {
  border-color: var(--accent);
  background: var(--accent-soft);
  color: var(--accent-deep);
  box-shadow: 0 0 0 3px rgba(196, 92, 38, 0.12);
}
.typegrid.four { grid-template-columns: 1fr 1fr; }
@media (min-width: 560px) {
  .typegrid.four { grid-template-columns: repeat(4, 1fr); }
}

/* Calculadora */
.calc {
  background: linear-gradient(180deg, #fff 0%, var(--card-soft) 100%);
  border: 1px solid var(--line);
  border-radius: 14px;
  padding: 14px;
  margin-top: 12px;
}
.calc-title {
  font-size: 13px;
  font-weight: 700;
  color: var(--ink-soft);
  margin-bottom: 10px;
  display: flex;
  align-items: center;
  gap: 6px;
}
.calc .row3 {
  display: grid;
  grid-template-columns: 1fr auto 1fr;
  gap: 8px;
  align-items: end;
}
.calc .eq {
  text-align: center;
  padding-bottom: 12px;
  color: var(--muted);
  font-weight: 800;
  font-size: 18px;
}
.calc .res {
  margin-top: 12px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
  padding-top: 12px;
  border-top: 1px dashed var(--line);
}
.calc .res b {
  font-family: var(--font-display);
  font-size: 20px;
  color: var(--accent-deep);
  font-variant-numeric: tabular-nums;
}

/* ---------- Modal de registro ---------- */
.modal-root {
  position: fixed;
  inset: 0;
  z-index: 100;
  display: flex;
  align-items: flex-end;
  justify-content: center;
  padding: 0;
  opacity: 0;
  visibility: hidden;
  pointer-events: none;
  transition: opacity .22s ease, visibility .22s ease;
}
.modal-root.open {
  opacity: 1;
  visibility: visible;
  pointer-events: auto;
}
.modal-backdrop {
  position: absolute;
  inset: 0;
  background: rgba(28, 25, 21, 0.52);
  backdrop-filter: blur(5px);
  -webkit-backdrop-filter: blur(5px);
  border: none;
  padding: 0;
  margin: 0;
  cursor: pointer;
}
.modal-sheet {
  position: relative;
  z-index: 1;
  width: 100%;
  max-width: 480px;
  max-height: min(92vh, 820px);
  display: flex;
  flex-direction: column;
  background: var(--paper);
  border-radius: 22px 22px 0 0;
  box-shadow: 0 -8px 40px rgba(28, 25, 21, 0.22);
  border: 1px solid var(--line);
  border-bottom: none;
  transform: translateY(28px);
  transition: transform .28s cubic-bezier(.22, 1, .36, 1);
  overflow: hidden;
}
.modal-root.open .modal-sheet {
  transform: translateY(0);
}
.modal-root.modal-roomy .modal-sheet {
  max-width: 530px;
  max-height: min(92vh, 860px);
}
.modal-root#detalleSemana {
  z-index: 108;
}
.modal-root#detalleMov {
  z-index: 112;
}
.modal-root.modal-roomy .modal-form {
  flex: 1 1 auto;
  min-height: 0;
}
.modal-root.modal-roomy .modal-body {
  flex: 1 1 auto;
  min-height: 0;
  overflow-y: auto;
  -webkit-overflow-scrolling: touch;
}
.modal-root.edit-mov-modal #editarMovSlot {
  flex: 1 1 auto;
  min-height: 0;
  display: flex;
  flex-direction: column;
  overflow: hidden;
}
.modal-root.edit-mov-modal #editarMovSlot .modal-form,
.modal-root.edit-mov-modal #editarMovSlot > form {
  flex: 1 1 auto;
  min-height: 0;
  display: flex;
  flex-direction: column;
  overflow: hidden;
}
.modal-root.edit-mov-modal #editarMovSlot .modal-body {
  flex: 1 1 auto;
  min-height: 0;
  overflow-y: auto;
  -webkit-overflow-scrolling: touch;
}
.modal-root.edit-mov-modal #editarMovSlot .modal-foot {
  flex: none;
}
@media (min-width: 560px) {
  .modal-root.modal-roomy .modal-sheet {
    max-width: 530px;
    max-height: min(90vh, 840px);
  }
}
.modal-handle {
  width: 40px;
  height: 4px;
  border-radius: 999px;
  background: var(--line-strong);
  margin: 10px auto 0;
  flex: none;
}
.modal-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
  padding: 14px 18px 12px;
  border-bottom: 1px solid var(--line);
  flex: none;
  background: linear-gradient(180deg, #fff 0%, var(--card-soft) 100%);
}
.modal-head .modal-title-wrap {
  display: flex;
  align-items: flex-start;
  gap: 12px;
  min-width: 0;
}
.modal-head .modal-ic {
  width: 42px;
  height: 42px;
  border-radius: 13px;
  display: grid;
  place-items: center;
  font-size: 22px;
  background: var(--accent-soft);
  flex: none;
}
.modal-root.theme-teal .modal-head .modal-ic {
  background: var(--teal-soft);
}
.modal-head h2 {
  margin: 0;
  font-family: var(--font-display);
  font-size: 18px;
  font-weight: 800;
  letter-spacing: -0.02em;
  text-transform: none;
  color: var(--ink);
  line-height: 1.2;
}
.modal-head p {
  margin: 3px 0 0;
  font-size: 13px;
  color: var(--muted);
  font-weight: 500;
}
.modal-close {
  width: 40px;
  height: 40px;
  border-radius: 12px;
  border: 1px solid var(--line);
  background: #fff;
  color: var(--ink-soft);
  font-size: 20px;
  font-weight: 600;
  cursor: pointer;
  display: grid;
  place-items: center;
  flex: none;
  transition: background .15s, color .15s;
  line-height: 1;
}
.modal-close:hover {
  background: var(--red-soft);
  color: var(--red);
  border-color: #f0b4b0;
}
.modal-form {
  display: flex;
  flex-direction: column;
  flex: 1;
  min-height: 0;
  overflow: hidden;
}
.confirm-elim-phrase {
  display: inline-block;
  margin-left: 4px;
  padding: 2px 8px;
  border-radius: 6px;
  background: rgba(0, 0, 0, 0.06);
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  font-size: 0.92em;
  font-weight: 600;
  color: var(--ink, #1a1a1a);
  cursor: pointer;
  user-select: all;
  -webkit-user-select: all;
  vertical-align: baseline;
  transition: background 0.15s ease, color 0.15s ease;
}
.confirm-elim-phrase:hover,
.confirm-elim-phrase:focus-visible {
  background: rgba(180, 35, 24, 0.12);
  color: var(--danger, #b42318);
  outline: none;
}
.confirm-elim-phrase.is-copied {
  background: rgba(18, 120, 70, 0.14);
  color: #0f6b3c;
}
.modal-body {
  padding: 8px 18px 12px;
  overflow-y: auto;
  -webkit-overflow-scrolling: touch;
  flex: 1;
  min-height: 0;
  overscroll-behavior: contain;
}
.modal-foot {
  padding: 12px 18px calc(14px + env(safe-area-inset-bottom));
  border-top: 1px solid var(--line);
  background: rgba(255, 250, 243, 0.96);
  flex: none;
  display: flex;
  flex-direction: column;
  gap: 8px;
}
.modal-foot[hidden],
.modal-body[hidden],
[data-reg-step][hidden],
[data-reg-foot][hidden] {
  display: none !important;
}
.modal-foot .hint {
  margin: 0;
  text-align: center;
}
.reg-confirm-list {
  margin: 14px 0 0;
  padding: 0;
  display: grid;
  gap: 8px;
}
.reg-confirm-list > div {
  display: grid;
  grid-template-columns: 110px 1fr;
  gap: 8px 12px;
  align-items: start;
  padding: 8px 10px;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: var(--card-soft);
}
.reg-confirm-list dt {
  margin: 0;
  font-size: 11px;
  font-weight: 800;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: var(--muted);
}
.reg-confirm-list dd {
  margin: 0;
  font-size: 14px;
  font-weight: 650;
  color: var(--ink);
  word-break: break-word;
}
.reg-confirm-foot {
  flex-direction: column;
  gap: 8px;
}
.reg-saving-foot {
  align-items: center;
  justify-content: center;
  min-height: 76px;
}
.reg-saving {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  font-size: 14px;
  font-weight: 650;
  color: var(--ink-soft);
}
.reg-saving-spin {
  width: 18px;
  height: 18px;
  border-radius: 50%;
  border: 2px solid var(--line-strong);
  border-top-color: var(--teal);
  animation: regSpin .7s linear infinite;
  flex: none;
}
#formMaestro .reg-saving-spin {
  border-top-color: var(--violet, #6d28d9);
}
#formNuevoContrato .reg-saving-spin,
#formEditarContrato .reg-saving-spin {
  border-top-color: var(--accent);
}
@keyframes regSpin {
  to { transform: rotate(360deg); }
}
.mov.is-nuevo,
.mov-row.is-nuevo td {
  animation: movNuevoPulse 2.2s ease 1;
  background: #e7f6ee !important;
  box-shadow: inset 0 0 0 2px rgba(31, 122, 69, 0.35);
}
.mov-row.is-nuevo td:first-child {
  position: relative;
}
.mov-row.is-nuevo td:first-child::before {
  content: "Nuevo";
  display: inline-block;
  margin-right: 8px;
  padding: 2px 7px;
  border-radius: 999px;
  font-size: 10px;
  font-weight: 800;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: #14532d;
  background: #bbf7d0;
  vertical-align: middle;
}
@keyframes movNuevoPulse {
  0% { background: #bbf7d0; }
  40% { background: #e7f6ee; }
  100% { background: transparent; }
}
@media (min-width: 560px) {
  .reg-confirm-foot {
    flex-direction: row-reverse;
    align-items: center;
  }
  .reg-confirm-foot .btn.block {
    width: auto;
    min-width: 180px;
    flex: none;
  }
  .reg-confirm-foot .btn.ghost {
    flex: none;
  }
}
body.modal-open {
  overflow: hidden;
  touch-action: none;
}

/* ---------- Modal ver voucher ---------- */
.modal-root.voucher-modal {
  z-index: 110;
}
.modal-root.voucher-modal .modal-sheet {
  max-width: 560px;
  max-height: min(94vh, 900px);
}
.voucher-body {
  display: flex;
  flex-direction: column;
  gap: 14px;
  padding-top: 14px !important;
}
.voucher-preview {
  position: relative;
  background:
    linear-gradient(45deg, #ebe3d4 25%, transparent 25%),
    linear-gradient(-45deg, #ebe3d4 25%, transparent 25%),
    linear-gradient(45deg, transparent 75%, #ebe3d4 75%),
    linear-gradient(-45deg, transparent 75%, #ebe3d4 75%);
  background-size: 18px 18px;
  background-position: 0 0, 0 9px, 9px -9px, -9px 0;
  background-color: #f7f0e4;
  border: 1px solid var(--line);
  border-radius: 16px;
  overflow: hidden;
  min-height: 180px;
  display: grid;
  place-items: center;
}
.voucher-preview img {
  display: block;
  width: 100%;
  max-height: min(52vh, 460px);
  object-fit: contain;
  background: #1c1915;
  cursor: zoom-in;
}
.voucher-preview iframe {
  display: block;
  width: 100%;
  height: min(52vh, 460px);
  border: 0;
  background: #fff;
}
.voucher-fallback {
  text-align: center;
  padding: 36px 20px;
  color: var(--muted);
}
.voucher-fallback-ic {
  display: block;
  font-size: 40px;
  margin-bottom: 8px;
}
.voucher-fallback p {
  margin: 0;
  font-size: 14px;
  font-weight: 600;
}
.voucher-meta {
  margin: 0;
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px 14px;
}
.voucher-meta > div {
  background: var(--card-soft);
  border: 1px solid var(--line);
  border-radius: 12px;
  padding: 10px 12px;
}
.voucher-meta > div:first-child,
.voucher-meta > div:nth-child(2) {
  grid-column: 1 / -1;
}
.voucher-meta dt {
  margin: 0;
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: var(--muted);
}
.voucher-meta dd {
  margin: 3px 0 0;
  font-size: 15px;
  font-weight: 650;
  color: var(--ink);
  word-break: break-word;
}
.mov-detalle-hero {
  display: flex;
  align-items: flex-start;
  gap: 14px;
  margin: 0 0 16px;
  padding: 14px 14px;
  border-radius: 14px;
  background: var(--card-soft);
  border: 1px solid var(--line);
}
.mov-detalle-ic {
  font-size: 28px;
  line-height: 1;
  flex: 0 0 auto;
}
.mov-detalle-titulo {
  display: block;
  font-size: 16px;
  font-weight: 750;
  color: var(--ink);
  line-height: 1.25;
}
.mov-detalle-monto {
  margin-top: 4px;
  font-family: var(--font-display);
  font-size: 22px;
  font-weight: 800;
  color: var(--accent-deep);
  letter-spacing: -0.02em;
}
.theme-teal .mov-detalle-monto { color: var(--teal); }
.mov-detalle-voucher-link {
  display: block;
  border-radius: 12px;
  overflow: hidden;
  border: 1px solid var(--line);
  background: #fff;
}
.mov-detalle-voucher-img {
  display: block;
  width: 100%;
  max-height: 280px;
  object-fit: contain;
  background: #f3f0ea;
}
.pago-dias-head {
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  justify-content: space-between;
  gap: 6px 12px;
  margin: 16px 0 10px;
}
.pago-dias-head strong {
  font-size: 14px;
}
.pago-dias-list {
  list-style: none;
  margin: 0;
  padding: 0;
  border: 1px solid var(--line);
  border-radius: 12px;
  overflow: hidden;
  background: var(--paper);
}
.pago-dias-item {
  display: grid;
  grid-template-columns: 7.5rem 1fr auto auto;
  gap: 6px 10px;
  align-items: center;
  padding: 10px 12px;
  border-bottom: 1px solid var(--line);
  font-size: 13px;
}
.pago-dias-item:last-child { border-bottom: none; }
.pago-dias-item.presente { background: rgba(31, 122, 69, 0.06); }
.pago-dias-item.medio { background: rgba(180, 83, 9, 0.06); }
.pago-dias-item.horas { background: rgba(30, 77, 123, 0.06); }
.pago-dias-item.ausente { background: rgba(180, 35, 24, 0.05); }
.pago-dias-fecha { font-weight: 700; color: var(--ink); }
.pago-dias-est { color: var(--ink-soft); }
.pago-dias-fac {
  font-variant-numeric: tabular-nums;
  color: var(--muted);
  font-size: 12px;
}
.pago-dias-monto {
  font-weight: 750;
  font-variant-numeric: tabular-nums;
  text-align: right;
}
.pago-dias-nota {
  grid-column: 1 / -1;
  margin-top: -2px;
}
.pago-dias-tot {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 12px;
  margin-top: 10px;
  padding: 10px 12px;
  border-radius: 10px;
  background: var(--card-soft);
  font-size: 13.5px;
}
.pago-dias-tot strong {
  font-family: var(--font-display);
  font-size: 18px;
  font-weight: 800;
}
@media (max-width: 520px) {
  .pago-dias-item {
    grid-template-columns: 1fr 1fr;
  }
  .pago-dias-fac { grid-column: 1; }
  .pago-dias-monto { grid-column: 2; }
}
.voucher-meta .voucher-monto {
  font-family: var(--font-display);
  font-size: 22px;
  font-weight: 800;
  color: var(--accent-deep);
  font-variant-numeric: tabular-nums;
}
.modal-root.voucher-modal.theme-teal .voucher-monto {
  color: var(--teal);
}
.voucher-foot {
  flex-direction: row !important;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
}
.voucher-foot .btn {
  flex: none;
}
.voucher-foot .btn.ghost {
  text-decoration: none;
}

@media (min-width: 560px) {
  .modal-root.voucher-modal .modal-sheet {
    max-width: 640px;
    max-height: min(90vh, 860px);
  }
  .voucher-preview img,
  .voucher-preview iframe {
    max-height: min(56vh, 520px);
    height: auto;
  }
  .voucher-preview iframe {
    height: min(56vh, 520px);
  }
}

@media (max-width: 420px) {
  .voucher-meta {
    grid-template-columns: 1fr;
  }
  .voucher-meta > div:first-child,
  .voucher-meta > div:nth-child(2) {
    grid-column: auto;
  }
  .voucher-foot {
    flex-wrap: wrap;
  }
  .voucher-foot .btn {
    flex: 1 1 auto;
    justify-content: center;
  }
}

@media (min-width: 560px) {
  .modal-root {
    align-items: center;
    padding: 24px 16px;
  }
  .modal-sheet {
    border-radius: 22px;
    border-bottom: 1px solid var(--line);
    max-height: min(88vh, 780px);
    transform: translateY(16px) scale(0.97);
    box-shadow: var(--shadow-lg), 0 24px 64px rgba(28, 25, 21, 0.18);
  }
  .modal-root.open .modal-sheet {
    transform: translateY(0) scale(1);
  }
  .modal-handle { display: none; }
  .modal-foot {
    padding-bottom: 16px;
    flex-direction: row-reverse;
    align-items: center;
    gap: 12px;
  }
  .modal-foot .btn.block {
    width: auto;
    min-width: 160px;
    flex: none;
    padding: 13px 22px;
  }
  .modal-foot .hint {
    flex: 1;
    text-align: left;
    margin: 0;
  }
}

details.form {
  background: var(--paper);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 0;
  margin-top: 14px;
  box-shadow: var(--shadow);
  overflow: hidden;
}
details.form summary {
  cursor: pointer;
  font-weight: 800;
  font-size: 15px;
  font-family: var(--font-display);
  list-style: none;
  padding: 16px 18px;
  background: linear-gradient(180deg, #fff 0%, var(--card-soft) 100%);
  display: flex;
  align-items: center;
  gap: 8px;
}
details.form summary::-webkit-details-marker { display: none; }
details.form summary::marker { content: ""; }
details.form summary::after {
  content: "";
  margin-left: auto;
  width: 8px;
  height: 8px;
  border-right: 2.5px solid var(--muted);
  border-bottom: 2.5px solid var(--muted);
  transform: rotate(45deg);
  transition: transform 0.18s ease;
  flex: none;
  margin-top: -4px;
}
details.form[open] summary::after {
  transform: rotate(-135deg);
  margin-top: 4px;
}
details.form > *:not(summary) {
  margin-left: 18px;
  margin-right: 18px;
}
details.form form,
details.form > form {
  padding-bottom: 18px;
}
details.form > form > :first-child,
details.form form > input[type=hidden] + label,
details.form form > label:first-of-type {
  margin-top: 8px;
}

/* ---------- Lista de movimientos ---------- */
.toolbar {
  display: flex;
  gap: 8px;
  margin-bottom: 12px;
  flex-wrap: wrap;
  align-items: center;
}
.toolbar .pers-view-toggle {
  margin-left: 0;
  flex: none;
}
.search {
  flex: 1;
  min-width: 160px;
  position: relative;
}
.search input {
  padding-left: 40px;
  background: var(--paper);
}
.search::before {
  content: "⌕";
  position: absolute;
  left: 14px;
  top: 50%;
  transform: translateY(-50%);
  color: var(--muted);
  font-size: 16px;
  font-weight: 700;
  pointer-events: none;
  z-index: 1;
}

.mov {
  background: var(--paper);
  border: 1px solid var(--line);
  border-radius: 16px;
  padding: 14px;
  margin-bottom: 10px;
  display: flex;
  gap: 12px;
  align-items: flex-start;
  box-shadow: var(--shadow);
  transition: border-color .15s, box-shadow .15s;
}
.mov:hover {
  border-color: var(--line-strong);
  box-shadow: var(--shadow-lg);
}
.mov .ic {
  width: 44px;
  height: 44px;
  border-radius: 13px;
  flex: none;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 20px;
  background: var(--accent-soft);
}
.mov.casa-item .ic { background: var(--amber-soft); }
.mov .info { flex: 1; min-width: 0; }
.mov .t1 {
  font-weight: 700;
  font-size: 15px;
  display: flex;
  justify-content: space-between;
  gap: 10px;
  align-items: flex-start;
}
.mov .t1 .name {
  min-width: 0;
  word-break: break-word;
}
.mov .t1 .amt {
  white-space: nowrap;
  font-family: var(--font-display);
  font-weight: 800;
  font-size: 16px;
  color: var(--accent-deep);
  font-variant-numeric: tabular-nums;
}
.mov .t1 .amt.casa { color: var(--amber); }
.mov .t2 {
  font-size: 12.5px;
  color: var(--muted);
  margin-top: 5px;
  display: flex;
  flex-wrap: wrap;
  gap: 4px 8px;
  align-items: center;
}
.mov .tag {
  display: inline-flex;
  font-size: 11px;
  padding: 3px 8px;
  border-radius: 999px;
  font-weight: 800;
  background: var(--card-soft);
  color: var(--ink-soft);
  border: 1px solid var(--line);
}
.mov .acts {
  display: flex;
  gap: 6px;
  margin-top: 10px;
  flex-wrap: wrap;
}
.empty {
  text-align: center;
  color: var(--muted);
  padding: 40px 16px;
  font-size: 14.5px;
  border: 1.5px dashed var(--line-strong);
  border-radius: 16px;
  background: rgba(255, 250, 243, 0.5);
}
.empty .empty-ic {
  font-size: 36px;
  margin-bottom: 10px;
  display: block;
  opacity: 0.85;
}
.empty strong {
  display: block;
  color: var(--ink-soft);
  font-size: 16px;
  margin-bottom: 4px;
}

/* ---------- Tablas ---------- */
table {
  width: 100%;
  border-collapse: collapse;
  font-size: 14px;
}
th, td {
  padding: 12px 10px;
  text-align: left;
  border-bottom: 1px solid var(--line);
}
th {
  font-size: 11px;
  color: var(--muted);
  text-transform: uppercase;
  letter-spacing: 0.05em;
  font-weight: 700;
}
tr:last-child td { border-bottom: none; }
tr:hover td { background: rgba(247, 240, 228, 0.5); }
.tablecard {
  background: var(--paper);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 6px 10px;
  overflow-x: auto;
  box-shadow: var(--shadow);
}

/* ---------- Login ---------- */
.login-page {
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 24px 16px 40px;
  padding-bottom: 40px;
}
body:has(.login-page) { padding-bottom: 0; }
.loginbox {
  width: 100%;
  max-width: 400px;
}
.login-hero {
  text-align: center;
  margin-bottom: 20px;
}
.login-hero .logo {
  width: 64px;
  height: 64px;
  margin: 0 auto 14px;
  border-radius: 18px;
  background: linear-gradient(145deg, var(--accent), var(--accent-deep));
  display: grid;
  place-items: center;
  font-size: 32px;
  box-shadow: 0 10px 28px rgba(196, 92, 38, 0.35);
}
.login-hero h1 {
  font-family: var(--font-display);
  font-size: 26px;
  font-weight: 800;
  margin: 0 0 6px;
  letter-spacing: -0.02em;
}
.login-hero p {
  margin: 0;
  color: var(--muted);
  font-size: 14.5px;
}
.loginbox .card {
  padding: 24px;
}
.loginbox .btn.block { margin-top: 8px; }

/* =========================================================
   Landing / branding (/)
   ========================================================= */
.lp-body {
  padding-bottom: 0 !important;
  background:
    radial-gradient(ellipse 70% 45% at 0% -5%, rgba(196, 92, 38, 0.12), transparent 55%),
    radial-gradient(ellipse 50% 40% at 100% 10%, rgba(15, 107, 92, 0.08), transparent 50%),
    linear-gradient(180deg, var(--bg) 0%, var(--bg-deep) 100%);
}
.lp-top {
  position: sticky;
  top: 0;
  z-index: 50;
  background: rgba(255, 250, 243, 0.9);
  backdrop-filter: blur(14px) saturate(1.15);
  border-bottom: 1px solid var(--line);
}
.lp-top-inner {
  max-width: 1080px;
  margin: 0 auto;
  padding: 12px 18px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
}
.lp-brand {
  display: flex;
  align-items: center;
  gap: 10px;
  text-decoration: none;
  color: inherit;
}
.lp-brand:hover { text-decoration: none; }
.lp-mark {
  width: 40px;
  height: 40px;
  border-radius: 12px;
  display: grid;
  place-items: center;
  font-size: 20px;
  background: linear-gradient(145deg, var(--accent), var(--accent-deep));
  box-shadow: 0 4px 12px rgba(154, 65, 21, 0.25);
}
.lp-brand-text {
  display: flex;
  flex-direction: column;
  line-height: 1.15;
}
.lp-brand-text strong {
  font-family: var(--font-display);
  font-size: 16px;
  font-weight: 800;
}
.lp-brand-text span {
  font-size: 12px;
  color: var(--muted);
  font-weight: 600;
}
.lp-nav {
  display: none;
  align-items: center;
  gap: 6px 18px;
  font-size: 14px;
  font-weight: 600;
}
.lp-nav a {
  color: var(--ink-soft);
  text-decoration: none;
}
.lp-nav a:hover { color: var(--accent-deep); }
.lp-nav-ghost {
  padding: 8px 12px;
  border-radius: 999px;
  border: 1px solid var(--line-strong);
  background: var(--paper);
}
.lp-nav-cta {
  padding: 8px 14px;
  border-radius: 999px;
  background: var(--accent);
  color: #fff !important;
  box-shadow: 0 2px 8px rgba(196, 92, 38, 0.3);
}
.lp-nav-cta:hover { background: var(--accent-deep); }
.lp-top-mobile {
  display: flex;
  gap: 8px;
}
@media (min-width: 860px) {
  .lp-nav { display: flex; }
  .lp-top-mobile { display: none; }
}

.lp-hero {
  padding: 36px 18px 48px;
}
.lp-hero-inner {
  max-width: 1080px;
  margin: 0 auto;
  display: grid;
  gap: 36px;
  align-items: center;
}
@media (min-width: 900px) {
  .lp-hero-inner {
    grid-template-columns: 1.05fr 0.95fr;
    gap: 48px;
    padding: 24px 0 32px;
  }
}
.lp-eyebrow {
  display: inline-block;
  margin: 0 0 12px;
  padding: 6px 12px;
  border-radius: 999px;
  background: var(--accent-soft);
  color: var(--accent-deep);
  font-size: 12.5px;
  font-weight: 700;
  letter-spacing: 0.02em;
}
.lp-hero h1 {
  font-family: var(--font-display);
  font-size: clamp(32px, 5vw, 46px);
  font-weight: 800;
  line-height: 1.08;
  letter-spacing: -0.03em;
  margin: 0 0 16px;
  color: var(--ink);
}
.lp-grad {
  display: block;
  background: linear-gradient(110deg, var(--accent-deep), var(--accent) 50%, #d4783a);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
}
.lp-lead {
  margin: 0 0 22px;
  font-size: 17px;
  line-height: 1.55;
  color: var(--ink-soft);
  max-width: 34em;
}
.lp-cta-row {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin-bottom: 18px;
}
.lp-btn-lg {
  padding: 14px 20px !important;
  font-size: 15.5px !important;
  border-radius: 14px !important;
  font-weight: 700 !important;
}
.lp-trust {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  flex-wrap: wrap;
  gap: 8px 16px;
  font-size: 13.5px;
  font-weight: 600;
  color: var(--muted);
}

/* Videos de marca */
.lp-hero-visual {
  position: relative;
  padding: 8px 0 24px;
}
.lp-video-frame {
  border-radius: 20px;
  overflow: hidden;
  border: 1px solid var(--line);
  box-shadow: var(--shadow-lg);
  background: #1c1915;
  aspect-ratio: 16 / 9;
}
.lp-video-hero {
  transform: rotate(-1.2deg);
}
.lp-video {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: cover;
  vertical-align: middle;
}
.lp-video-frame .lp-video {
  aspect-ratio: 16 / 9;
}
.lp-float {
  position: absolute;
  font-size: 12.5px;
  font-weight: 700;
  padding: 10px 14px;
  border-radius: 12px;
  background: var(--paper);
  border: 1px solid var(--line);
  box-shadow: var(--shadow);
  white-space: nowrap;
  z-index: 2;
  pointer-events: none;
}
.lp-float-a {
  left: -4px;
  bottom: 8px;
  color: var(--violet);
}
.lp-float-b {
  right: 4px;
  top: 28px;
  color: var(--teal);
}
@media (max-width: 520px) {
  .lp-float { display: none; }
  .lp-video-hero { transform: none; }
}

.lp-section-videos {
  padding-top: 12px;
}
.lp-videos-grid {
  display: grid;
  gap: 20px;
}
@media (min-width: 760px) {
  .lp-videos-grid {
    grid-template-columns: 1fr 1fr;
    gap: 22px;
  }
}
.lp-video-card {
  margin: 0;
  background: var(--paper);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  overflow: hidden;
  box-shadow: var(--shadow);
}
.lp-video-card .lp-video-frame {
  border-radius: 0;
  border: none;
  border-bottom: 1px solid var(--line);
  box-shadow: none;
  transform: none;
}
.lp-video-card figcaption {
  padding: 14px 16px 16px;
  display: flex;
  flex-direction: column;
  gap: 4px;
}
.lp-video-card figcaption strong {
  font-family: var(--font-display);
  font-size: 16px;
  color: var(--ink);
}
.lp-video-card figcaption span {
  font-size: 13.5px;
  color: var(--muted);
  font-weight: 500;
}
.lp-video-card .lp-video {
  cursor: pointer;
}

/* Capturas reales por rol */
.lp-shots {
  display: grid;
  gap: 22px;
}
@media (min-width: 900px) {
  .lp-shots {
    grid-template-columns: repeat(3, 1fr);
    gap: 18px;
    align-items: start;
  }
}
.lp-shot {
  background: var(--paper);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  overflow: hidden;
  box-shadow: var(--shadow);
  display: flex;
  flex-direction: column;
}
.lp-shot-frame {
  position: relative;
  background: #1c1915;
  border-bottom: 1px solid var(--line);
  aspect-ratio: 16 / 10;
  overflow: hidden;
}
.lp-shot-frame img {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: top center;
}
.lp-shot-ph {
  height: 100%;
  min-height: 180px;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 6px;
  padding: 24px 16px;
  text-align: center;
  background:
    linear-gradient(145deg, var(--card-soft), var(--bg-deep));
  color: var(--muted);
}
.lp-shot-ph-ic {
  font-size: 36px;
  line-height: 1;
  margin-bottom: 4px;
}
.lp-shot-ph strong {
  font-family: var(--font-display);
  font-size: 15px;
  color: var(--ink-soft);
}
.lp-shot-ph span {
  font-size: 12.5px;
  max-width: 16em;
  line-height: 1.4;
}
.lp-shot-ph code {
  font-size: 11.5px;
  background: rgba(28, 25, 21, 0.06);
  padding: 1px 6px;
  border-radius: 6px;
}
.lp-shot-meta {
  padding: 14px 16px 18px;
  display: flex;
  flex-direction: column;
  gap: 6px;
  flex: 1;
}
.lp-shot-meta .badge {
  align-self: flex-start;
  margin-left: 0;
}
.lp-shot-meta h3 {
  font-family: var(--font-display);
  font-size: 17px;
  margin: 2px 0 0;
  font-weight: 800;
}
.lp-shot-meta p {
  margin: 0;
  font-size: 13.5px;
  color: var(--ink-soft);
  line-height: 1.45;
}
@media (min-width: 900px) {
  .lp-shot:nth-child(2) {
    margin-top: 18px;
  }
  .lp-shot:nth-child(3) {
    margin-top: 36px;
  }
}

.lp-section {
  padding: 48px 18px 56px;
}
.lp-section-alt {
  background: rgba(255, 250, 243, 0.55);
  border-top: 1px solid var(--line);
  border-bottom: 1px solid var(--line);
}
.lp-wrap {
  max-width: 1080px;
  margin: 0 auto;
}
.lp-sec-head {
  text-align: center;
  max-width: 520px;
  margin: 0 auto 32px;
}
.lp-sec-head h2 {
  font-family: var(--font-display);
  font-size: clamp(24px, 3.5vw, 32px);
  font-weight: 800;
  margin: 0 0 10px;
  letter-spacing: -0.02em;
}
.lp-sec-head p {
  margin: 0;
  color: var(--muted);
  font-size: 15.5px;
  line-height: 1.5;
}
.lp-grid3 {
  display: grid;
  gap: 14px;
}
@media (min-width: 700px) {
  .lp-grid3 { grid-template-columns: repeat(3, 1fr); }
}
.lp-card {
  background: var(--paper);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 20px 18px;
  box-shadow: var(--shadow);
}
.lp-ic {
  width: 44px;
  height: 44px;
  border-radius: 12px;
  display: grid;
  place-items: center;
  font-size: 22px;
  background: var(--accent-soft);
  margin-bottom: 12px;
}
.lp-card h3 {
  font-family: var(--font-display);
  font-size: 17px;
  margin: 0 0 8px;
}
.lp-card p {
  margin: 0;
  font-size: 14px;
  color: var(--ink-soft);
  line-height: 1.5;
}

.lp-modules {
  display: grid;
  gap: 12px;
}
@media (min-width: 700px) {
  .lp-modules { grid-template-columns: 1fr 1fr; }
}
.lp-mod {
  display: flex;
  gap: 14px;
  align-items: flex-start;
  padding: 18px;
  background: var(--paper);
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
  box-shadow: var(--shadow);
}
.lp-mod-ic {
  font-size: 28px;
  line-height: 1;
}
.lp-mod h3 {
  margin: 0 0 4px;
  font-family: var(--font-display);
  font-size: 16px;
}
.lp-mod p {
  margin: 0;
  font-size: 14px;
  color: var(--ink-soft);
  line-height: 1.45;
}

.lp-steps {
  list-style: none;
  margin: 0;
  padding: 0;
  display: grid;
  gap: 16px;
  counter-reset: none;
}
@media (min-width: 700px) {
  .lp-steps { grid-template-columns: repeat(3, 1fr); gap: 20px; }
}
.lp-steps li {
  background: var(--paper);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 22px 18px;
  box-shadow: var(--shadow);
  text-align: center;
}
.lp-step-n {
  display: inline-grid;
  place-items: center;
  width: 36px;
  height: 36px;
  border-radius: 50%;
  background: var(--accent);
  color: #fff;
  font-weight: 800;
  font-family: var(--font-display);
  margin-bottom: 12px;
}
.lp-steps h3 {
  font-family: var(--font-display);
  font-size: 16px;
  margin: 0 0 8px;
}
.lp-steps p {
  margin: 0;
  font-size: 14px;
  color: var(--ink-soft);
  line-height: 1.45;
}

.lp-cta-band {
  margin: 8px 18px 40px;
  padding: 36px 24px;
  border-radius: 24px;
  background:
    linear-gradient(135deg, #9a4115 0%, #c45c26 45%, #0f6b5c 160%);
  color: #fff;
  box-shadow: var(--shadow-lg);
}
.lp-cta-inner {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
}
.lp-cta-band h2 {
  font-family: var(--font-display);
  font-size: clamp(22px, 3vw, 28px);
  margin: 0 0 8px;
  font-weight: 800;
}
.lp-cta-band p {
  margin: 0;
  opacity: 0.9;
  font-size: 15px;
}
.lp-btn-on-dark {
  background: rgba(255,255,255,0.12) !important;
  border-color: rgba(255,255,255,0.35) !important;
  color: #fff !important;
}
.lp-btn-on-dark:hover {
  background: rgba(255,255,255,0.2) !important;
}

.lp-foot {
  padding: 28px 18px 40px;
  border-top: 1px solid var(--line);
  background: rgba(255, 250, 243, 0.7);
}
.lp-foot-inner {
  text-align: center;
  color: var(--muted);
  font-size: 13.5px;
}
.lp-brand-foot {
  justify-content: center;
  margin-bottom: 8px;
}
.lp-brand-foot strong {
  font-family: var(--font-display);
  color: var(--ink);
}
.lp-copy {
  margin: 12px 0 0;
  font-size: 12.5px;
  opacity: 0.85;
}

/* Error page */
.error-box {
  text-align: center;
  padding: 48px 24px;
  max-width: 420px;
  margin: 10vh auto;
}
.error-box .code {
  font-family: var(--font-display);
  font-size: 56px;
  font-weight: 800;
  color: var(--accent);
  letter-spacing: -0.04em;
  line-height: 1;
}
.error-box p {
  font-size: 16px;
  color: var(--ink-soft);
  margin: 14px 0 24px;
}

/* Bottom nav (móvil) */
.bottom-nav {
  position: fixed;
  left: 0;
  right: 0;
  bottom: 0;
  z-index: 50;
  background: rgba(255, 250, 243, 0.94);
  backdrop-filter: blur(16px);
  border-top: 1px solid var(--line);
  padding: 8px 12px calc(8px + env(safe-area-inset-bottom));
  display: grid;
  grid-template-columns: 1fr 1fr 1.15fr 1fr 1fr;
  gap: 4px;
  box-shadow: 0 -8px 24px rgba(28, 25, 21, 0.06);
}
.bottom-nav a,
.bottom-nav button {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 3px;
  padding: 8px 4px;
  border: none;
  background: transparent;
  color: var(--muted);
  font-size: 10.5px;
  font-weight: 700;
  text-decoration: none;
  border-radius: 12px;
  cursor: pointer;
  min-height: 52px;
}
.bottom-nav a:hover,
.bottom-nav button:hover {
  color: var(--ink);
  background: var(--card-soft);
  text-decoration: none;
}
.bottom-nav a.on {
  color: var(--accent-deep);
  background: var(--accent-soft);
}
.bottom-nav .bn-ic { font-size: 20px; line-height: 1; }
.bottom-nav .bn-add {
  background: linear-gradient(180deg, #d4682e, var(--accent));
  color: #fff !important;
  box-shadow: 0 4px 14px rgba(196, 92, 38, 0.35);
  margin-top: -6px;
  border-radius: 16px;
}
.bottom-nav .bn-add .bn-ic { font-size: 22px; }
.bottom-nav .bn-add:hover {
  background: linear-gradient(180deg, #db7340, #ce5f2a);
  color: #fff !important;
}

/* Desktop: ocultar bottom nav, mostrar nav superior */
@media (min-width: 820px) {
  body { padding-bottom: 40px; }
  .bottom-nav { display: none; }
  .menu-btn { display: none; }
  .hbar-rol { display: none; }
  .nav { display: flex; }
  .minis { grid-template-columns: repeat(4, 1fr); }
  .minis.two { grid-template-columns: 1fr 1fr; }
  .minis.three { grid-template-columns: repeat(3, 1fr); }
}

@media (max-width: 819px) {
  .minis { grid-template-columns: 1fr 1fr; }
  .minis.two { grid-template-columns: 1fr 1fr; }
  .minis.three { grid-template-columns: 1fr; }
}

@media (max-width: 520px) {
  .grid2 { grid-template-columns: 1fr; }
  .tabs a { font-size: 13px; padding: 11px 6px; }
  .hero .val { font-size: 34px; }
}

/* Utilidades */
.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0,0,0,0);
  border: 0;
}
.mt-0 { margin-top: 0; }
.hidden { display: none !important; }
.user-chip {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-weight: 600;
}
.account-card .name {
  font-family: var(--font-display);
  font-size: 20px;
  font-weight: 800;
  margin: 0 0 4px;
}
.account-card .meta {
  margin: 0;
  color: var(--muted);
  font-size: 14px;
}

/* Animación suave al abrir form */
details.form-panel[open] .form-body,
details.form[open] form {
  animation: fadeUp .22s ease;
}
@keyframes fadeUp {
  from { opacity: 0; transform: translateY(6px); }
  to { opacity: 1; transform: none; }
}

/* Filtro de lista: ocultar filas */
.mov[data-hidden="1"],
.mov-row[data-hidden="1"] { display: none; }
[data-mov-view-panel][hidden] {
  display: none !important;
}
.mov-table-wrap {
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  margin-bottom: 4px;
}
.mov-table {
  width: 100%;
  border-collapse: separate;
  border-spacing: 0;
  min-width: 860px;
  font-size: 13px;
}
.mov-table th,
.mov-table td {
  padding: 10px 12px;
  border-bottom: 1px solid var(--line);
  text-align: left;
  vertical-align: middle;
}
.mov-table th {
  font-size: 11px;
  font-weight: 700;
  color: var(--muted);
  text-transform: uppercase;
  letter-spacing: 0.04em;
  background: var(--card-soft);
  white-space: nowrap;
}
.mov-table tbody tr:last-child td { border-bottom: none; }
.mov-table tbody tr:hover td { background: rgba(196, 92, 38, 0.04); }
.mov-table .mov-row.eliminado td {
  opacity: 0.72;
  background: #faf6f2;
}
.mov-td-name {
  min-width: 160px;
  max-width: 240px;
}
.mov-td-name > div {
  display: flex;
  flex-direction: column;
  gap: 2px;
  min-width: 0;
}
.mov-td-name b {
  font-family: var(--font-display);
  font-size: 13.5px;
  font-weight: 700;
  line-height: 1.25;
}
.mov-td-ic {
  display: none;
}
.mov-td-amt {
  white-space: nowrap;
  font-family: var(--font-display);
  font-weight: 800;
  font-variant-numeric: tabular-nums;
  color: var(--accent-deep);
}
.mov-td-amt.casa { color: var(--amber); }
.mov-td-nota {
  max-width: 140px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  color: var(--ink-soft);
  font-size: 12.5px;
}
.mov-td-acts .acts {
  margin-top: 0;
  flex-wrap: nowrap;
}
.mov-td-acts .btn {
  white-space: nowrap;
}

/* ---------- Auditoría: eliminados, historial ---------- */
.mov.eliminado {
  opacity: 0.72;
  background: linear-gradient(135deg, var(--red-soft), transparent 60%);
  border-color: #f0c4bf;
}
.mov.eliminado .amt {
  text-decoration: line-through;
  opacity: 0.75;
}
.tag.elim {
  background: var(--red-soft);
  color: var(--red);
  border: 1px solid #f0c4bf;
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.02em;
  text-transform: uppercase;
  margin-left: 6px;
  vertical-align: middle;
}
.meta-line { opacity: 0.75; }
.edit-line { color: var(--blue); opacity: 0.95 !important; }
.elim-line { color: var(--red); opacity: 0.95 !important; }
.motivo {
  display: inline-block;
  margin-top: 2px;
  font-style: italic;
  color: var(--ink-soft);
}
.mov-nota {
  display: flex;
  gap: 10px;
  align-items: flex-start;
  margin-top: 8px;
  padding: 10px 12px;
  background: var(--blue-soft);
  border: 1px solid #c5d8ec;
  border-radius: 12px;
  color: var(--ink);
}
.mov-nota-ic {
  flex: none;
  font-size: 16px;
  line-height: 1.3;
}
.mov-nota-text {
  font-size: 13.5px;
  font-weight: 600;
  white-space: pre-wrap;
  word-break: break-word;
  line-height: 1.4;
}
.hist-summary.elim-card {
  border-color: #f0c4bf;
  background: linear-gradient(180deg, var(--red-soft), var(--paper));
}
.hist-meta {
  margin-top: 12px;
  padding-top: 12px;
  border-top: 1px dashed var(--line);
  font-size: 13.5px;
  color: var(--ink-soft);
  display: grid;
  gap: 4px;
}

textarea {
  width: 100%;
  padding: 12px 14px;
  border: 1px solid var(--line-strong);
  border-radius: var(--radius-sm);
  background: #fff;
  color: var(--ink);
  font-size: 15px;
  line-height: 1.45;
  resize: vertical;
  min-height: 88px;
}
textarea:focus {
  outline: none;
  border-color: var(--accent);
  box-shadow: 0 0 0 3px var(--accent-soft);
}

/* Timeline de historial */
.modal-root.hist-modal {
  z-index: 110;
}
.modal-root.hist-modal .modal-sheet {
  max-width: 640px;
  max-height: min(94vh, 920px);
}
.modal-root.hist-modal .hist-body {
  padding: 14px 0 0 !important;
  overflow: hidden !important;
  display: flex;
  flex-direction: column;
}
.modal-root.hist-modal .hist-layout {
  display: flex;
  flex-direction: column;
  flex: 1;
  min-height: 0;
  height: 100%;
}
.modal-root.hist-modal .hist-pin {
  flex: none;
  padding: 0 18px 12px;
  border-bottom: 1px solid var(--line);
  background: linear-gradient(180deg, var(--paper) 70%, rgba(255, 250, 243, 0.92));
  z-index: 2;
}
.modal-root.hist-modal .hist-body .card.hist-summary {
  margin: 0;
  box-shadow: none;
}
.modal-root.hist-modal .hist-scroll {
  flex: 1;
  min-height: 0;
  overflow-y: auto;
  -webkit-overflow-scrolling: touch;
  overscroll-behavior: contain;
  padding: 12px 18px 16px;
}
.modal-root.hist-modal .hist-body .section-title {
  margin-top: 0;
}
.modal-root.hist-modal .hist-body .section-title h2 {
  font-size: 16px;
}
.hist-loading {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  padding: 48px 16px;
  color: var(--muted);
  font-weight: 600;
  font-size: 15px;
  flex: 1;
}
.hist-loading-ic {
  font-size: 22px;
  animation: hist-pulse 1.1s ease-in-out infinite;
}
@keyframes hist-pulse {
  0%, 100% { opacity: 0.45; transform: scale(0.95); }
  50% { opacity: 1; transform: scale(1); }
}
@media (min-width: 560px) {
  .modal-root.hist-modal .modal-sheet {
    max-width: 720px;
  }
}

/* Página completa: flujo normal (sin pin fijo) */
.wrap > .hist-layout .hist-pin,
.wrap > .page-head + .hist-layout .hist-pin {
  padding: 0;
  border: none;
  background: none;
}
.wrap > .hist-layout .hist-scroll,
.wrap > .page-head + .hist-layout .hist-scroll {
  overflow: visible;
  padding: 16px 0 0;
}

.timeline {
  list-style: none;
  margin: 0;
  padding: 0 0 0 18px;
  position: relative;
}
.timeline::before {
  content: "";
  position: absolute;
  left: 5px;
  top: 8px;
  bottom: 8px;
  width: 2px;
  background: linear-gradient(180deg, var(--line-strong), var(--line));
  border-radius: 2px;
}
.tl-item {
  position: relative;
  padding: 0 0 16px 22px;
}
.tl-item:last-child { padding-bottom: 0; }
.tl-dot {
  position: absolute;
  left: -18px;
  top: 14px;
  width: 12px;
  height: 12px;
  border-radius: 50%;
  background: var(--paper);
  border: 2.5px solid var(--accent);
  box-shadow: 0 0 0 3px var(--accent-soft);
  z-index: 1;
}
.tl-item.tl-creado .tl-dot { border-color: var(--green); box-shadow: 0 0 0 3px var(--green-soft); }
.tl-item.tl-editado .tl-dot { border-color: var(--blue); box-shadow: 0 0 0 3px var(--blue-soft); }
.tl-item.tl-eliminado .tl-dot { border-color: var(--red); box-shadow: 0 0 0 3px var(--red-soft); }
.tl-card {
  background: var(--paper);
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
  padding: 14px 16px;
  box-shadow: var(--shadow);
}
.tl-head {
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  gap: 6px 12px;
  margin-bottom: 8px;
}
.tl-accion {
  font-weight: 700;
  font-family: var(--font-display);
  font-size: 15px;
}
.tl-fecha {
  font-size: 13px;
  color: var(--muted);
}
.tl-motivo {
  background: var(--amber-soft);
  color: var(--amber);
  border-radius: 8px;
  padding: 8px 10px;
  font-size: 13.5px;
  margin-bottom: 10px;
}
.diff-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 13.5px;
  margin-top: 6px;
}
.diff-table th,
.diff-table td {
  text-align: left;
  padding: 8px 10px;
  border-bottom: 1px solid var(--line);
  vertical-align: top;
}
.diff-table th {
  font-size: 11.5px;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  color: var(--muted);
  font-weight: 700;
  background: var(--card-soft);
}
.diff-antes { color: var(--red); word-break: break-word; }
.diff-despues { color: var(--green); word-break: break-word; font-weight: 600; }
.tl-snap {
  display: grid;
  gap: 6px;
  margin: 0;
  font-size: 13.5px;
}
.tl-snap > div {
  display: grid;
  grid-template-columns: 120px 1fr;
  gap: 8px;
}
.tl-snap dt {
  margin: 0;
  color: var(--muted);
  font-weight: 600;
}
.tl-snap dd { margin: 0; }
.audit-note {
  background: var(--blue-soft);
  border-color: #b7d0ea;
}

@media (max-width: 560px) {
  .tl-snap > div { grid-template-columns: 1fr; gap: 2px; }
  .diff-table th:first-child,
  .diff-table td:first-child { display: none; }
}

/* Modal ficha trabajador */
.modal-root.ficha-modal {
  z-index: 110;
}
.modal-root.ficha-modal .modal-sheet {
  max-width: 720px;
  width: min(94vw, 720px);
  max-height: min(92vh, 1100px);
  height: min(92vh, 980px);
  display: flex;
  flex-direction: column;
  overflow: hidden;
  padding: 0;
}
.modal-root.ficha-modal #fichaSlot {
  display: flex;
  flex-direction: column;
  flex: 1;
  min-height: 0;
  height: 100%;
}
.modal-root.ficha-modal .modal-head,
.modal-root.ficha-modal .modal-foot {
  flex: none;
}
.modal-root.ficha-modal .ficha-modal-body {
  flex: 1;
  min-height: 0;
  overflow-y: auto;
  -webkit-overflow-scrolling: touch;
  overscroll-behavior: contain;
  padding: 12px 18px 16px;
}
.modal-root.ficha-modal .ficha-modal-foot {
  display: flex;
  gap: 8px;
  justify-content: flex-end;
  flex-wrap: wrap;
  padding: 12px 16px 16px;
  border-top: 1px solid var(--line);
}
.modal-root.ficha-modal .hist-loading,
.modal-root.ficha-modal #fichaSlot > .empty {
  margin: auto;
  padding: 48px 16px;
}
@media (min-width: 560px) {
  .modal-root.ficha-modal .modal-sheet {
    max-width: 780px;
    width: min(92vw, 780px);
  }
}

/* ---------- Personal del maestro (Mi gente) ---------- */
.page-head-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  align-items: center;
}
.inline-form { display: inline; margin: 0; }
.pers-hero {
  margin-bottom: 14px;
}
.week-nav {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  margin: 0 0 18px;
  padding: 10px 12px;
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
}
.week-nav-label {
  text-align: center;
  flex: 1;
  min-width: 0;
}
.week-nav-label strong {
  display: block;
  font-family: var(--font-display);
  font-size: 14px;
}
.pers-grid {
  display: grid;
  gap: 12px;
}
@media (min-width: 720px) {
  .pers-grid { grid-template-columns: 1fr 1fr; }
}
[data-pers-view-panel][hidden] {
  display: none !important;
}
.pers-view-toggle {
  display: inline-flex;
  margin-left: auto;
  border: 1px solid var(--line);
  border-radius: 999px;
  overflow: hidden;
  background: var(--card);
}
.pers-view-btn {
  appearance: none;
  border: none;
  background: transparent;
  font: inherit;
  font-size: 12.5px;
  font-weight: 650;
  padding: 6px 12px;
  color: var(--muted);
  cursor: pointer;
}
.pers-view-btn + .pers-view-btn {
  border-left: 1px solid var(--line);
}
.pers-view-btn.is-on {
  background: #fff3dd;
  color: var(--ink);
}
.pers-view-btn:hover:not(.is-on) {
  background: var(--card-soft);
  color: var(--ink);
}
.pers-table-wrap {
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  margin-bottom: 4px;
}
.pers-table {
  width: 100%;
  border-collapse: separate;
  border-spacing: 0;
  min-width: 780px;
  font-size: 13px;
}
.pers-table th,
.pers-table td {
  padding: 10px 12px;
  border-bottom: 1px solid var(--line);
  text-align: left;
  vertical-align: middle;
}
.pers-table th {
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.03em;
  text-transform: uppercase;
  color: var(--muted);
  background: var(--card-soft);
  white-space: nowrap;
}
.pers-table tbody tr:last-child td { border-bottom: none; }
.pers-table tbody tr[hidden],
.pers-card[hidden] { display: none !important; }
.pers-table tbody tr.off { opacity: 0.65; }
.pers-table .num {
  font-variant-numeric: tabular-nums;
  white-space: nowrap;
}
.pers-table .num.due { color: var(--amber); font-weight: 700; }
.pers-table .num.ok { color: var(--green); font-weight: 650; }
.pers-table-periodo {
  font-size: 12.5px;
  white-space: nowrap;
  color: var(--muted);
}
.pers-table-acts {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  white-space: nowrap;
}
.pers-table .pers-name {
  font-size: 14px;
}
.pers-card {
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 14px 16px;
  box-shadow: var(--shadow);
}
.pers-card.off {
  opacity: 0.72;
  background: var(--card-soft);
}
.pers-card-top {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  align-items: flex-start;
}
.pers-name {
  font-family: var(--font-display);
  font-weight: 800;
  font-size: 17px;
  color: var(--ink);
  text-decoration: none;
}
.pers-name:hover { color: var(--accent-deep); }
.pers-saldo {
  text-align: right;
  font-family: var(--font-display);
  font-weight: 800;
  font-size: 18px;
  font-variant-numeric: tabular-nums;
  line-height: 1.1;
}
.pers-saldo span {
  display: block;
  font-size: 11px;
  font-weight: 600;
  color: var(--muted);
  font-family: var(--font-body);
}
.pers-saldo.due { color: var(--amber); }
.pers-saldo.ok { color: var(--green); }
.pers-periodo {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-top: 10px;
  padding: 8px 10px;
  background: var(--card-soft);
  border: 1px solid var(--line);
  border-radius: 10px;
}
.pers-periodo-item {
  display: flex;
  flex-direction: column;
  gap: 2px;
  min-width: 0;
}
.pers-periodo-item em {
  font-style: normal;
  font-size: 10.5px;
  font-weight: 700;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: var(--muted);
}
.pers-periodo-item strong {
  font-family: var(--font-display);
  font-size: 13.5px;
  font-weight: 800;
  color: var(--ink);
  font-variant-numeric: tabular-nums;
}
.pers-periodo-sep {
  color: var(--accent);
  font-weight: 800;
  font-size: 14px;
  flex-shrink: 0;
}
.pers-periodo-empty {
  justify-content: center;
}
.pers-periodo-empty .hint {
  margin: 0;
  text-align: center;
}
.pers-mini-meta {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 6px 8px;
  margin: 8px 0 10px;
  font-size: 12.5px;
  color: var(--muted);
}
.pers-card-acts {
  display: flex;
  flex-direction: column;
  gap: 8px;
}
.pers-card-acts > .btn.violet {
  width: 100%;
}
.pers-card-acts-sec {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}
.pers-card-acts-sec .btn {
  flex: 1 1 auto;
  min-width: 0;
}
.minis.three { grid-template-columns: repeat(3, 1fr); }
@media (max-width: 560px) {
  .minis.three { grid-template-columns: 1fr; }
}

.asist-wrap {
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
}
.asist-toolbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  flex-wrap: wrap;
  padding: 10px 12px;
  border-bottom: 1px solid var(--line);
  background: linear-gradient(180deg, #faf7f2 0%, var(--card) 100%);
}
.asist-week-nav {
  display: flex;
  align-items: center;
  gap: 8px;
  min-width: 0;
  flex: 1 1 auto;
}
.asist-week-nav .btn {
  flex: none;
  min-width: 36px;
  padding-left: 10px;
  padding-right: 10px;
  text-decoration: none;
}
.asist-week-nav [data-asist-week="hoy"] {
  min-width: 0;
  font-weight: 700;
}
.asist-week-label {
  text-align: center;
  min-width: 0;
  flex: 1;
}
.asist-week-label strong {
  display: block;
  font-family: var(--font-display);
  font-size: 13.5px;
  line-height: 1.25;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.asist-week-label .hint {
  display: block;
  font-size: 11.5px;
  margin-top: 1px;
}
.asist-wrap.is-loading-week {
  opacity: 0.55;
  pointer-events: none;
  transition: opacity .15s ease;
}
.asist-sim-tools {
  display: flex;
  align-items: center;
  gap: 10px;
  flex: none;
  margin-left: auto;
}
.asist-sim-toggle {
  display: flex;
  align-items: center;
  gap: 10px;
  cursor: pointer;
  user-select: none;
  margin: 0;
}
.asist-sim-toggle input {
  position: absolute;
  opacity: 0;
  width: 1px;
  height: 1px;
}
.asist-sim-switch {
  width: 40px;
  height: 22px;
  border-radius: 999px;
  background: #d5cdc2;
  border: 1px solid var(--line);
  position: relative;
  flex: none;
  transition: background .15s ease;
}
.asist-sim-switch::after {
  content: "";
  position: absolute;
  top: 2px;
  left: 2px;
  width: 16px;
  height: 16px;
  border-radius: 50%;
  background: #fff;
  box-shadow: 0 1px 2px rgba(0,0,0,.15);
  transition: transform .15s ease;
}
.asist-sim-toggle input:checked + .asist-sim-switch {
  background: var(--amber);
  border-color: #c98a2e;
}
.asist-sim-toggle input:checked + .asist-sim-switch::after {
  transform: translateX(18px);
}
.asist-sim-txt {
  display: flex;
  flex-direction: column;
  gap: 1px;
  line-height: 1.2;
}
.asist-sim-txt strong {
  font-size: 13.5px;
}
.asist-sim-txt em {
  font-style: normal;
  font-size: 11.5px;
  color: var(--muted);
}
.asist-sim-badge {
  font-size: 11.5px;
  font-weight: 700;
  letter-spacing: 0.02em;
  text-transform: uppercase;
  color: #8a5a12;
  background: #ffe8bf;
  border: 1px solid #efd09a;
  border-radius: 999px;
  padding: 4px 10px;
}
.asist-wrap.is-sim {
  border-color: #e0b86a;
  box-shadow: 0 0 0 2px rgba(210, 140, 40, 0.12), var(--shadow);
}
.asist-wrap.is-sim .asist-day-col.futuro {
  background: #fff6e4 !important;
}
.asist-wrap.is-sim .asist-day-btn.is-futuro.is-futuro-open,
.asist-wrap.is-sim .asist-day-btn.is-futuro.is-futuro-open.vacio {
  opacity: 1 !important;
  filter: none;
  color: var(--ink) !important;
  cursor: pointer;
  background: #fff6e4 !important;
}
.asist-wrap.is-sim .asist-day-btn.is-futuro.is-futuro-open .asist-day-val {
  color: var(--ink) !important;
}
.asist-table {
  width: 100%;
  border-collapse: separate;
  border-spacing: 0;
  min-width: 720px;
  font-size: 13px;
}
.asist-wrap-single .asist-table { min-width: 0; }
.asist-table th,
.asist-table td {
  padding: 0;
  border-right: 1px solid var(--line);
  border-bottom: 1px solid var(--line);
  text-align: center;
  vertical-align: middle;
}
.asist-table th:last-child,
.asist-table td:last-child { border-right: none; }
.asist-table tbody tr:last-child td { border-bottom: none; }
.asist-table th {
  font-size: 11px;
  color: var(--muted);
  font-weight: 700;
  background: var(--card-soft);
  padding: 10px 6px;
}
.asist-table th.hoy,
.asist-table td.hoy {
  background: rgba(196, 92, 38, 0.07);
}
.asist-table tbody tr:nth-child(even) td:not(.hoy):not(.locked) {
  background: rgba(0, 0, 0, 0.015);
}
.asist-name-col {
  text-align: left !important;
  width: 140px;
  max-width: 140px;
  min-width: 120px;
  padding: 10px 10px !important;
  position: sticky;
  left: 0;
  background: var(--card) !important;
  z-index: 1;
  border-right: 1px solid var(--line-strong);
}
.asist-table thead .asist-name-col {
  background: var(--card-soft) !important;
  z-index: 2;
}
.asist-name-col a {
  color: var(--ink);
  font-weight: 700;
  text-decoration: none;
  font-family: var(--font-display);
  font-size: 14px;
  display: block;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.asist-name-col .hint {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.asist-day-col {
  width: 68px;
  min-width: 64px;
}
.asist-num-col {
  width: 1%;
  max-width: 96px;
  min-width: 72px;
  padding: 8px 8px !important;
  font-variant-numeric: tabular-nums;
  font-weight: 700;
  font-size: 12.5px;
  white-space: nowrap;
  background: var(--card-soft);
}
.asist-num-col.due { color: var(--amber); }
.asist-num-col.ok { color: var(--green); }
.asist-dow {
  display: block;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  font-size: 10px;
}
.asist-dom {
  display: block;
  font-family: var(--font-display);
  font-size: 16px;
  font-weight: 800;
  color: var(--ink);
  line-height: 1.15;
  margin-top: 2px;
}
.asist-day-btn {
  position: relative;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 2px;
  width: 100%;
  min-height: 52px;
  margin: 0;
  padding: 6px 4px;
  border: none;
  background: transparent;
  cursor: pointer;
  touch-action: manipulation;
  -webkit-tap-highlight-color: transparent;
  font-family: var(--font-display);
  font-weight: 800;
  font-size: 16px;
  line-height: 1;
  color: var(--muted);
  transition: background 0.12s ease, color 0.12s ease;
}
.asist-day-btn:hover:not(:disabled) {
  background: rgba(196, 92, 38, 0.08);
}
.asist-day-btn:focus { outline: none; }
.asist-day-btn:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: -2px;
}
.asist-day-btn.busy { opacity: 0.5; pointer-events: none; }
.asist-day-btn.presente { color: var(--green); background: #e7f6ee; }
.asist-day-btn.medio { color: var(--amber); background: var(--amber-soft); }
.asist-day-btn.ausente { color: var(--red); background: #fde8e8; }
.asist-day-btn.vacio { color: #c4b8a8; }
.asist-day-btn.is-picking {
  z-index: 2;
  /* outline: 3px solid var(--accent); */
  outline: 1px solid #ce5f2a;
  outline-offset: -3px;
  box-shadow:
    0 0 0 4px rgba(196, 92, 38, 0.28),
    inset 0 0 0 2px rgba(255, 255, 255, 0.65);
  transform: scale(1.06);
  animation: asistPickPulse 1.1s ease-in-out infinite;
}
@keyframes asistPickPulse {
  0%, 100% { box-shadow: 0 0 0 4px rgba(196, 92, 38, 0.28), inset 0 0 0 2px rgba(255,255,255,0.65); }
  50% { box-shadow: 0 0 0 7px rgba(196, 92, 38, 0.16), inset 0 0 0 2px rgba(255,255,255,0.65); }
}
.asist-day-col:has(.is-picking) {
  background: rgba(196, 92, 38, 0.14) !important;
  position: relative;
  z-index: 3;
}
.asist-day-btn.horas { color: #2f6f9f; background: #e7f2fa; }
.asist-day-btn.is-locked,
.asist-day-btn:disabled {
  cursor: not-allowed;
  opacity: 0.9;
}
/* Días no disponibles (futuro / antes del alta): gris bien visible */
.asist-day-col.futuro,
.asist-day-col.pre-alta {
  background: #c8c8c8 !important;
}
.asist-day-btn.is-futuro,
.asist-day-btn.is-futuro.vacio,
.asist-day-btn.is-pre-alta,
.asist-day-btn.is-pre-alta.vacio {
  opacity: 1 !important;
  background: #c8c8c8 !important;
  color: #6a6a6a !important;
  border: none !important;
  box-shadow: none !important;
  filter: none;
  cursor: help;
}
.asist-day-btn.is-futuro:hover,
.asist-day-btn.is-futuro:hover:not(:disabled),
.asist-day-btn.is-pre-alta:hover,
.asist-day-btn.is-pre-alta:hover:not(:disabled) {
  background: #c8c8c8 !important;
  color: #6a6a6a !important;
}
.asist-day-btn.is-futuro .asist-day-val,
.asist-day-btn.is-pre-alta .asist-day-val {
  color: #6a6a6a !important;
}
.asist-day-btn.is-pre-alta {
  cursor: not-allowed;
}
.asist-day-btn.is-futuro.is-futuro-open {
  cursor: pointer;
  background: #d8d8d8 !important;
  color: #555 !important;
}
.asist-day-col.locked {
  background: rgba(15, 107, 92, 0.06);
}
.asist-day-col[data-tip] {
  cursor: help;
}
/* Tooltip flotante (fuera de la tabla, no estira el layout) */
.asist-float-tip {
  position: fixed;
  z-index: 400;
  max-width: 220px;
  padding: 8px 10px;
  border-radius: 8px;
  background: #2c241c;
  color: #fffaf3;
  font-size: 12px;
  font-weight: 600;
  line-height: 1.35;
  text-align: center;
  box-shadow: 0 8px 22px rgba(0, 0, 0, 0.3);
  pointer-events: none;
  transform: translate(-50%, 0);
}
.asist-float-tip[hidden] {
  display: none !important;
}
.asist-float-tip::before {
  content: "";
  position: absolute;
  left: 50%;
  transform: translateX(-50%);
  width: 0;
  height: 0;
  border-left: 7px solid transparent;
  border-right: 7px solid transparent;
}
.asist-float-tip.tip-below::before {
  bottom: 100%;
  border-bottom: 8px solid #2c241c;
}
.asist-float-tip.tip-above::before {
  top: 100%;
  border-top: 8px solid #2c241c;
}
.asist-lock-ic {
  font-size: 9px;
  line-height: 1;
  opacity: 0.85;
}
.asist-day-val { display: block; }

/* Mini selector asistencia */
.asist-pop {
  position: fixed;
  z-index: 140;
  width: 220px;
  padding: 8px;
  background: var(--card);
  border: 1px solid var(--line-strong);
  border-radius: 14px;
  box-shadow: 0 12px 32px rgba(40, 28, 18, 0.18), 0 2px 8px rgba(40, 28, 18, 0.08);
}
.asist-pop[hidden] { display: none !important; }
.asist-pop-horas[hidden],
.asist-pop-main[hidden] { display: none !important; }
.asist-pop-horas-lbl {
  font-size: 13px;
  font-weight: 700;
  color: var(--ink);
  padding: 2px 6px 8px;
}
.asist-pop-presets {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 6px;
  margin-bottom: 8px;
}
.asist-pop-presets button {
  border: 1px solid var(--line);
  background: var(--card-soft);
  border-radius: 8px;
  padding: 8px 4px;
  font-weight: 800;
  font-family: var(--font-display);
  cursor: pointer;
  color: var(--ink);
}
.asist-pop-presets button:hover {
  border-color: var(--accent);
  background: rgba(196, 92, 38, 0.08);
}
#asistHorasInput {
  width: 100%;
  box-sizing: border-box;
  border: 1px solid var(--line);
  border-radius: 10px;
  padding: 10px 12px;
  font-size: 16px;
  font-weight: 700;
}
.asist-pop-horas-acts {
  display: flex;
  justify-content: space-between;
  gap: 8px;
  margin-top: 10px;
}
.asist-pop-opt.horas .asist-pop-ic { background: #e7f2fa; color: #2f6f9f; }
.asist-pop-opt.horas.on {
  border-color: #5a9cc9;
  background: #e7f2fa;
  box-shadow: inset 0 0 0 1px rgba(90, 156, 201, 0.35);
}
.asist-pop-opt.horas.on::after { color: #2f6f9f; }
.asist-pop-title {
  font-size: 13px;
  font-weight: 800;
  letter-spacing: 0.02em;
  text-transform: none;
  color: var(--ink);
  font-family: var(--font-display);
  padding: 4px 8px 8px;
}
.asist-pop-opt {
  display: flex;
  align-items: center;
  gap: 10px;
  width: 100%;
  border: 1px solid transparent;
  background: transparent;
  border-radius: 10px;
  padding: 9px 10px;
  cursor: pointer;
  font-size: 14px;
  font-weight: 600;
  color: var(--ink);
  text-align: left;
}
.asist-pop-opt:hover { background: var(--card-soft); }
.asist-pop-opt.on {
  border-color: var(--accent);
  background: rgba(196, 92, 38, 0.12);
  box-shadow: inset 0 0 0 1px rgba(196, 92, 38, 0.25);
  font-weight: 800;
  position: relative;
}
.asist-pop-opt.on::after {
  content: "✓";
  margin-left: auto;
  color: var(--accent-deep);
  font-weight: 800;
  font-size: 15px;
}
.asist-pop-opt.presente.on {
  border-color: #5aab7a;
  background: #e7f6ee;
  box-shadow: inset 0 0 0 1px rgba(90, 171, 122, 0.35);
}
.asist-pop-opt.presente.on::after { color: var(--green); }
.asist-pop-opt.medio.on {
  border-color: #d4a017;
  background: var(--amber-soft);
  box-shadow: inset 0 0 0 1px rgba(212, 160, 23, 0.35);
}
.asist-pop-opt.medio.on::after { color: var(--amber); }
.asist-pop-opt.ausente.on {
  border-color: #d46a6a;
  background: #fde8e8;
  box-shadow: inset 0 0 0 1px rgba(212, 106, 106, 0.35);
}
.asist-pop-opt.ausente.on::after { color: var(--red); }
.asist-pop-opt.vacio.on {
  border-color: #b8a990;
  background: #f0ebe3;
}
.asist-pop-opt.vacio.on::after { color: #8a7a66; }
.asist-pop-ic {
  display: grid;
  place-items: center;
  width: 28px;
  height: 28px;
  border-radius: 8px;
  font-family: var(--font-display);
  font-weight: 800;
  font-size: 13px;
  flex-shrink: 0;
  background: var(--card-soft);
  color: var(--muted);
}
.asist-pop-opt.on .asist-pop-ic {
  transform: scale(1.08);
}
.asist-pop-opt.presente .asist-pop-ic { background: #e7f6ee; color: var(--green); }
.asist-pop-opt.medio .asist-pop-ic { background: var(--amber-soft); color: var(--amber); }
.asist-pop-opt.ausente .asist-pop-ic { background: #fde8e8; color: var(--red); }
.asist-pop-opt.vacio .asist-pop-ic { background: #f0ebe3; color: #a89884; }

@media (max-width: 560px) {
  .week-nav { flex-wrap: wrap; justify-content: center; }
  .week-nav .btn { flex: 1 1 auto; text-align: center; }
  .asist-week-nav {
    flex: 1 1 100%;
    justify-content: space-between;
  }
  .asist-sim-tools {
    flex: 1 1 100%;
    margin-left: 0;
    justify-content: space-between;
  }
  .asist-table { min-width: 680px; }
  .asist-day-col { width: 56px; min-width: 52px; }
  .asist-num-col { min-width: 64px; max-width: 88px; padding: 8px 6px !important; }
  .asist-day-btn { min-height: 46px; font-size: 15px; }
  .asist-pop { width: min(260px, calc(100vw - 16px)); }
}

/* Acciones rápidas Mi gente */
.pers-dash {
  display: grid;
  gap: 8px;
  margin: 0 0 12px;
  align-items: start;
}
.pers-dash[hidden],
#listaHoy[hidden],
#pendientesPers[hidden],
.pers-hoy-row[hidden],
#listaPagosPers[hidden],
[data-pagos-empty][hidden] {
  display: none !important;
}
@media (min-width: 820px) {
  .pers-dash:not(.solo) {
    grid-template-columns: 1fr 1fr;
  }
}
.pers-dash .pers-panel {
  margin: 0;
  min-width: 0;
  height: 100%;
}
.pers-panel {
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
  padding: 0;
  margin: 0 0 14px;
  scroll-margin-top: 88px;
  outline: none;
  overflow: hidden;
  transition: box-shadow .2s ease, border-color .2s ease, background .2s ease;
}
.pers-panel-asist {
  border-color: #c5ddd0;
}
.pers-panel-pago {
  border-color: #e8d0a8;
}
.pers-panel.is-focus {
  border-color: var(--amber);
  background: #fff8ec;
  box-shadow: 0 0 0 3px rgba(210, 140, 40, 0.28);
  animation: persPanelPulse 1.1s ease 1;
}
@keyframes persPanelPulse {
  0%   { transform: translateY(0); }
  30%  { transform: translateY(-2px); }
  100% { transform: translateY(0); }
}
.pers-panel-head {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 6px;
  padding: 8px 12px;
  margin: 0;
  border-bottom: 1px solid var(--line);
  flex-wrap: wrap;
}
.pers-panel-asist .pers-panel-head {
  background: linear-gradient(180deg, #eef7f1 0%, #f7faf8 100%);
}
.pers-panel-pago .pers-panel-head {
  background: linear-gradient(180deg, #fff6e8 0%, #fffaf3 100%);
}
.pers-panel-espera {
  opacity: 0.95;
}
.pers-pend-espera {
  padding: 10px 12px 12px;
  font-size: 13px;
  line-height: 1.4;
}
.pers-pend-espera p { margin: 0 0 6px; }
.pers-pend-espera p:last-child { margin: 0; }
.pers-panel-head strong {
  font-size: 0.95rem;
  display: block;
  line-height: 1.25;
}
.pers-panel-head .hint {
  font-size: 12px;
}
.pers-panel-head .btn {
  flex: none;
}
.pers-hoy-list,
.pers-pend-list,
.pers-masivo-list {
  display: flex;
  flex-direction: column;
  gap: 0;
  padding: 0;
}
.pers-hoy-table-wrap {
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
  border-top: 1px solid var(--line);
}
.pers-hoy-table {
  width: 100%;
  border-collapse: collapse;
  table-layout: fixed;
  font-size: 13px;
  min-width: 360px;
}
.pers-hoy-table thead th {
  font-size: 11px;
  font-weight: 800;
  color: var(--ink-soft);
  text-transform: uppercase;
  letter-spacing: 0.04em;
  background: #e8f3ec;
  white-space: nowrap;
  padding: 9px 12px;
  border-bottom: 1px solid #c5ddd0;
  border-right: 1px solid #d7e8de;
  text-align: left;
}
.pers-hoy-table thead th:last-child {
  border-right: none;
  text-align: center;
  width: 96px;
}
.pers-hoy-table thead th:nth-child(1) { width: 34%; }
.pers-hoy-table thead th:nth-child(2) { width: auto; }
.pers-hoy-table tbody td {
  padding: 8px 12px;
  border-bottom: 1px solid var(--line);
  border-right: 1px solid #efe8dc;
  text-align: left;
  vertical-align: middle;
  background: var(--card);
}
.pers-hoy-table tbody td:last-child {
  border-right: none;
  text-align: center;
  padding: 6px 8px;
}
.pers-hoy-table tbody tr:last-child td {
  border-bottom: none;
}
.pers-hoy-table tbody tr:nth-child(even) td {
  background: #fafcfb;
}
.pers-hoy-table tbody tr:hover td {
  background: rgba(15, 107, 92, 0.06);
}
.pers-hoy-td-name {
  min-width: 0;
}
.pers-hoy-td-name b {
  font-size: 13.5px;
  line-height: 1.25;
  font-family: var(--font-display);
  display: block;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.pers-hoy-td-contact {
  min-width: 0;
}
.pers-hoy-td-contact .hint {
  font-size: 11.5px;
  line-height: 1.25;
  display: block;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.pers-hoy-td-asist {
  width: 96px;
}
.pers-hoy-row[hidden] {
  display: none !important;
}
.pers-pend-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  padding: 6px 12px;
  border-bottom: 1px solid var(--line);
}
.pers-pend-row:last-child {
  border-bottom: none;
}
.pers-hoy-locked {
  color: var(--amber);
  font-weight: 650;
}
.asist-day-btn.pers-hoy-btn {
  width: 84px;
  min-width: 84px;
  max-width: 84px;
  min-height: 40px;
  margin: 0 auto;
  padding: 6px 8px;
  border-radius: 10px;
  border: 1px solid var(--line);
  font-size: 12px;
}
.asist-day-btn.pers-hoy-btn.vacio .asist-day-val {
  font-size: 11px;
  font-weight: 650;
  color: var(--muted);
  letter-spacing: 0;
}
.pers-tel a { color: var(--accent-deep); }
.pers-check {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 8px 10px;
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
  background: var(--card-soft);
  cursor: pointer;
}
.pers-check span { flex: 1; }
.pers-check b { font-variant-numeric: tabular-nums; }
.pers-resumen-txt {
  width: 100%;
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  font-size: 13px;
  line-height: 1.45;
  resize: vertical;
  min-height: 220px;
}
.asist-pop-nota {
  display: flex;
  gap: 6px;
  padding: 8px 10px 10px;
  border-top: 1px solid var(--line);
}
.asist-pop-nota input {
  flex: 1;
  min-width: 0;
  font-size: 13px;
  padding: 6px 8px;
}
.asist-day-btn.has-nota::after {
  content: "";
  position: absolute;
  top: 4px;
  right: 4px;
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: var(--amber);
}

@media print {
  .nav, .page-head-actions, .fab, .asist-pop, .modal-root,
  .week-nav .btn, .acts, .pers-card-acts, #fabAdd { display: none !important; }
  .pers-resumen-txt { border: none; }
}
