/* build: movil-fix-v3 (hamburguesa + drawer) */
:root {
  --ink:      #16211f;
  --canvas:   #f4f6f5;
  --surface:  #ffffff;
  --line:     #e3e8e6;
  --line-2:   #cfd8d5;
  --muted:    #5f6f6b;
  --text:     #1d2a28;

  --brand:      #0f6e56;
  --brand-600:  #0c5744;
  --brand-700:  #094536;
  --brand-050:  #e4f1ec;

  --danger:   #a32d2d;
  --danger-050:#fbeceb;
  --amber:    #854f0b;
  --amber-050:#faeeda;
  --ok:       #0f6e56;

  --rail:     #12211e;
  --rail-hov: #1b2f2b;
  --rail-txt: #9db3ac;

  --radius:   10px;
  --shadow:   0 1px 2px rgba(16,32,28,.06), 0 8px 24px rgba(16,32,28,.05);
}

* { box-sizing: border-box; }
html, body { margin: 0; padding: 0; }
body {
  font-family: 'Inter', system-ui, sans-serif;
  color: var(--text);
  background: var(--canvas);
  -webkit-font-smoothing: antialiased;
  font-size: 14px;
  line-height: 1.55;
}
h1, h2, h3, .display { font-family: 'Plus Jakarta Sans', 'Inter', sans-serif; }
a { color: var(--brand); text-decoration: none; }
a:hover { text-decoration: underline; }

/* ---- Shell -------------------------------------------------------------- */
.shell { display: grid; grid-template-columns: 256px 1fr; min-height: 100vh; }

.rail {
  background: var(--rail);
  color: var(--rail-txt);
  display: flex; flex-direction: column;
  padding: 20px 14px;
  position: sticky; top: 0; height: 100vh;
}
.rail__brand { display: flex; align-items: center; gap: 11px; padding: 6px 8px 22px; }
.rail__mark {
  width: 34px; height: 34px; border-radius: 9px; flex: none;
  background: var(--brand); color: #fff;
  display: grid; place-items: center; font-weight: 700; font-size: 15px;
  font-family: 'Plus Jakarta Sans', sans-serif;
}
.rail__brandtext b { color: #fff; font-size: 14px; font-weight: 600; display: block; letter-spacing: -.01em; }
.rail__brandtext span { font-size: 11px; color: var(--rail-txt); }

.rail__label { font-size: 10.5px; text-transform: uppercase; letter-spacing: .09em; color: #5c716b; padding: 14px 10px 6px; }
.rail__nav { display: flex; flex-direction: column; gap: 2px; }
.rail__item {
  display: flex; align-items: center; gap: 11px;
  padding: 9px 11px; border-radius: 8px;
  color: var(--rail-txt); font-weight: 500; font-size: 13.5px;
  border-left: 3px solid transparent;
}
.rail__item:hover { background: var(--rail-hov); color: #e6efec; text-decoration: none; }
.rail__item.is-active { background: var(--rail-hov); color: #fff; border-left-color: var(--brand); }
.rail__item svg { width: 18px; height: 18px; opacity: .85; }
.rail__foot { margin-top: auto; padding-top: 14px; border-top: 1px solid #21332f; }

/* ---- Topbar ------------------------------------------------------------- */
.main { display: flex; flex-direction: column; min-width: 0; }
.topbar {
  height: 62px; background: var(--surface); border-bottom: 1px solid var(--line);
  display: flex; align-items: center; justify-content: space-between;
  padding: 0 26px; position: sticky; top: 0; z-index: 20;
}
.topbar__title { font-weight: 600; font-size: 15px; letter-spacing: -.01em; }
.usermenu { display: flex; align-items: center; gap: 10px; cursor: pointer; padding: 5px 8px; border-radius: 8px; }
.usermenu:hover { background: var(--canvas); }
.avatar {
  width: 32px; height: 32px; border-radius: 50%; flex: none;
  background: var(--brand-050); color: var(--brand-700);
  display: grid; place-items: center; font-weight: 600; font-size: 12.5px;
}
.usermenu__name { font-size: 13px; font-weight: 500; }
.usermenu__role { font-size: 11px; color: var(--muted); }
.dropdown {
  position: absolute; right: 0; top: calc(100% + 6px); min-width: 190px;
  background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius);
  box-shadow: var(--shadow); padding: 6px; z-index: 40;
}
.dropdown a { display: block; padding: 8px 10px; border-radius: 6px; color: var(--text); font-size: 13px; }
.dropdown a:hover { background: var(--canvas); text-decoration: none; }

/* ---- Content ------------------------------------------------------------ */
.content { padding: 26px; max-width: 1180px; width: 100%; }
.page-head { display: flex; align-items: flex-end; justify-content: space-between; gap: 16px; margin-bottom: 20px; }
.page-head h1 { margin: 0; font-size: 22px; font-weight: 600; letter-spacing: -.02em; }
.page-head p { margin: 3px 0 0; color: var(--muted); font-size: 13px; }

.card { background: var(--surface); border: 1px solid var(--line); border-radius: 14px; box-shadow: var(--shadow); }
.card__body { padding: 20px; }
.card__head { padding: 16px 20px; border-bottom: 1px solid var(--line); display: flex; align-items: center; justify-content: space-between; gap: 12px; }
.card__head h2 { margin: 0; font-size: 15px; font-weight: 600; }

/* ---- Stat cards --------------------------------------------------------- */
.stats { display: grid; grid-template-columns: repeat(3, 1fr); gap: 16px; margin-bottom: 22px; }
.stat { background: var(--surface); border: 1px solid var(--line); border-radius: 14px; padding: 18px 20px; box-shadow: var(--shadow); }
.stat__label { font-size: 12px; color: var(--muted); font-weight: 500; }
.stat__value { font-size: 30px; font-weight: 700; letter-spacing: -.02em; font-family: 'Plus Jakarta Sans', sans-serif; margin-top: 4px; }
.stat__value span { font-size: 13px; color: var(--muted); font-weight: 500; }

/* ---- Tabla -------------------------------------------------------------- */
.table-wrap { overflow-x: auto; }
table.grid { width: 100%; border-collapse: collapse; font-size: 13.5px; }
.grid th { text-align: left; font-size: 11px; text-transform: uppercase; letter-spacing: .05em; color: var(--muted); font-weight: 600; padding: 11px 14px; border-bottom: 1px solid var(--line); background: #fafbfb; }
.grid td { padding: 12px 14px; border-bottom: 1px solid var(--line); vertical-align: middle; }
.grid tr:last-child td { border-bottom: 0; }
.grid tr:hover td { background: #fafcfb; }
.u-name { font-weight: 500; }
.u-sub { color: var(--muted); font-size: 12px; }

/* ---- Badges ------------------------------------------------------------- */
.badge { display: inline-flex; align-items: center; gap: 5px; font-size: 11.5px; font-weight: 600; padding: 3px 9px; border-radius: 999px; }
.badge--ok { background: var(--brand-050); color: var(--brand-700); }
.badge--off { background: #eef1f0; color: #6b7a76; }
.badge--warn { background: var(--amber-050); color: var(--amber); }
.badge--perfil { background: #eef2fb; color: #2f4f8f; }

/* ---- Botones ------------------------------------------------------------ */
.btn { display: inline-flex; align-items: center; gap: 7px; font: inherit; font-size: 13px; font-weight: 500; padding: 9px 15px; border-radius: 9px; border: 1px solid transparent; cursor: pointer; transition: .12s; }
.btn svg { width: 15px; height: 15px; }
.btn:hover { text-decoration: none; }
.btn--primary { background: var(--brand); color: #fff; }
.btn--primary:hover { background: var(--brand-600); color: #fff; }
.btn--ghost { background: var(--surface); color: var(--text); border-color: var(--line-2); }
.btn--ghost:hover { background: var(--canvas); }
.btn--danger { background: var(--surface); color: var(--danger); border-color: #e6c7c5; }
.btn--danger:hover { background: var(--danger-050); }
.btn--sm { padding: 6px 10px; font-size: 12.5px; border-radius: 8px; }

/* Acciones rápidas en tabla */
.actions { display: flex; gap: 6px; justify-content: flex-end; }
.iconbtn { width: 32px; height: 32px; display: grid; place-items: center; border-radius: 8px; border: 1px solid var(--line-2); background: var(--surface); color: var(--muted); cursor: pointer; }
.iconbtn:hover { background: var(--canvas); color: var(--text); text-decoration: none; }
.iconbtn svg { width: 16px; height: 16px; }
.iconbtn--danger:hover { color: var(--danger); border-color: #e6c7c5; background: var(--danger-050); }

/* ---- Formularios -------------------------------------------------------- */
.form-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; }
.field { display: flex; flex-direction: column; gap: 6px; }
.field--full { grid-column: 1 / -1; }
.field label { font-size: 12.5px; font-weight: 600; color: #3a4744; }
.field .req { color: var(--danger); }
.input, .select {
  font: inherit; font-size: 14px; padding: 10px 12px; border-radius: 9px;
  border: 1px solid var(--line-2); background: var(--surface); color: var(--text); width: 100%;
}
.input:focus, .select:focus { outline: none; border-color: var(--brand); box-shadow: 0 0 0 3px var(--brand-050); }
.hint { font-size: 12px; color: var(--muted); }
.form-actions { display: flex; gap: 10px; justify-content: flex-end; margin-top: 20px; padding-top: 18px; border-top: 1px solid var(--line); }

/* ---- Flash -------------------------------------------------------------- */
.flash { display: flex; align-items: center; gap: 10px; padding: 12px 16px; border-radius: 10px; font-size: 13.5px; margin-bottom: 18px; border: 1px solid; }
.flash--ok { background: var(--brand-050); border-color: #bfe0d4; color: var(--brand-700); }
.flash--error { background: var(--danger-050); border-color: #ecc9c7; color: var(--danger); }

/* ---- Detalle ------------------------------------------------------------ */
.dl { display: grid; grid-template-columns: 160px 1fr; gap: 0; }
.dl dt { padding: 12px 0; color: var(--muted); font-size: 12.5px; border-bottom: 1px solid var(--line); }
.dl dd { padding: 12px 0; margin: 0; font-size: 14px; border-bottom: 1px solid var(--line); }
.dl > :nth-last-child(1), .dl > :nth-last-child(2) { border-bottom: 0; }

/* ---- Login -------------------------------------------------------------- */
.auth-wrap { min-height: 100vh; display: grid; place-items: center; background:
  radial-gradient(1200px 600px at 20% -10%, #eaf3ef 0%, transparent 55%),
  radial-gradient(900px 500px at 100% 110%, #e7f0eb 0%, transparent 50%), var(--canvas); padding: 24px; }
.auth-card { width: 100%; max-width: 400px; background: var(--surface); border: 1px solid var(--line); border-radius: 16px; box-shadow: 0 20px 50px rgba(16,32,28,.10); padding: 34px 32px; }
.auth-brand { display: flex; align-items: center; gap: 11px; margin-bottom: 22px; }
.auth-brand .rail__mark { width: 40px; height: 40px; font-size: 17px; }
.auth-brand b { display: block; font-size: 15px; font-weight: 600; color: var(--text); font-family: 'Plus Jakarta Sans', sans-serif; }
.auth-brand span { font-size: 12px; color: var(--muted); }
.auth-card h1 { font-size: 19px; margin: 0 0 4px; font-weight: 600; }
.auth-card .sub { color: var(--muted); font-size: 13px; margin: 0 0 22px; }
.auth-card .field { margin-bottom: 14px; }
.auth-foot { text-align: center; margin-top: 20px; font-size: 12px; color: var(--muted); }

.empty { text-align: center; padding: 46px 20px; color: var(--muted); }
.empty svg { width: 34px; height: 34px; opacity: .5; margin-bottom: 8px; }

@media (max-width: 860px) {
  .shell { grid-template-columns: 1fr; }
  .rail {
    position: fixed; top: 0; left: 0; z-index: 60;
    width: 262px; height: 100vh; height: 100dvh;
    transform: translateX(-100%); transition: transform .22s ease;
  }
  .rail--open { transform: translateX(0); box-shadow: 0 0 50px rgba(0,0,0,.45); }
  .rail-backdrop { position: fixed; inset: 0; background: rgba(10,20,17,.5); z-index: 55; }
  .hamburger { display: inline-flex; }
  .topbar { padding: 0 14px; }
  .content { padding: 16px 14px; }
  .content--wide { max-width: none; }
  .usermenu__text { display: none; }
  .page-head { flex-direction: column; align-items: flex-start; }
  .form-grid, .stats { grid-template-columns: 1fr; }
  .stat-row { grid-template-columns: 1fr 1fr; }
  .dash-grid { grid-template-columns: 1fr; }
  .norm-cards { grid-template-columns: 1fr; }
  .chart-box { height: 260px; }
  .modal { max-width: 100%; }
}
@media (max-width: 480px) {
  .stat-row { grid-template-columns: 1fr; }
  .page-head h1 { font-size: 19px; }
}

/* ==== (norm-card se define más abajo, rediseñado) ======================== */

/* ==== Visor seguro ======================================================== */
.visor-head { margin-bottom: 14px; }
.visor-head h1 { font-size: 21px; margin: 4px 0 2px; font-weight: 600; letter-spacing: -.02em; }
.visor-sub { color: var(--muted); font-size: 13px; }
.visor-back { font-size: 12.5px; color: var(--muted); font-weight: 500; }
.visor-back:hover { color: var(--brand); text-decoration: none; }

.visor-note {
  display: flex; align-items: center; gap: 10px;
  background: var(--amber-050); color: var(--amber);
  border: 1px solid #ecd9b3; border-radius: 10px;
  padding: 10px 14px; font-size: 12.5px; margin-bottom: 18px;
}
.visor-note svg { width: 17px; height: 17px; flex: none; }

.visor { -webkit-user-select: none; -moz-user-select: none; user-select: none; }
.visor-paginas { display: flex; flex-direction: column; align-items: center; gap: 18px; }
.visor-pag {
  width: 100%; max-width: 860px; background: var(--surface);
  border: 1px solid var(--line); border-radius: 8px; box-shadow: var(--shadow);
  overflow: hidden; min-height: 200px; position: relative;
}
.visor-canvas { display: block; width: 100%; height: auto; pointer-events: none; }
.visor-pag__err { padding: 30px; text-align: center; color: var(--muted); font-size: 13px; }

.visor-fin { text-align: center; padding: 30px 16px 10px; max-width: 860px; margin: 0 auto; }
.visor-fin .hint { margin-bottom: 12px; }

/* Bloquear "guardar imagen" por arrastre y capa transparente anti-selección */
.visor img, .visor canvas { -webkit-user-drag: none; user-drag: none; }

/* ==== Selector de áreas (alcance de normativa) =========================== */
.area-check { display: grid; grid-template-columns: repeat(auto-fill, minmax(200px, 1fr)); gap: 8px; }
.area-check__item { display: flex; align-items: center; gap: 8px; padding: 9px 11px; border: 1px solid var(--line-2); border-radius: 9px; font-size: 13px; cursor: pointer; }
.area-check__item:hover { background: var(--canvas); }
.area-check__item input { width: 15px; height: 15px; }

/* ==== Modal de confirmación de acuse ===================================== */
.modal-backdrop {
  position: fixed; inset: 0; z-index: 100;
  background: rgba(16, 32, 28, .5);
  display: flex; align-items: center; justify-content: center; padding: 20px;
}
.modal {
  background: var(--surface); border-radius: 16px; width: 100%; max-width: 440px;
  box-shadow: 0 24px 60px rgba(16,32,28,.28); overflow: hidden;
}
.modal__head { display: flex; align-items: center; justify-content: space-between; padding: 18px 22px 12px; }
.modal__head h3 { margin: 0; font-size: 17px; font-weight: 600; }
.modal__x { background: none; border: 0; font-size: 24px; line-height: 1; color: var(--muted); cursor: pointer; padding: 0 4px; }
.modal__x:hover { color: var(--text); }
.modal__body { padding: 0 22px 6px; }
.modal__foot { display: flex; justify-content: flex-end; gap: 10px; padding: 16px 22px 20px; }

.modal-dl { display: grid; grid-template-columns: 90px 1fr; gap: 0; margin: 0 0 16px; }
.modal-dl dt { padding: 7px 0; color: var(--muted); font-size: 12.5px; border-bottom: 1px solid var(--line); }
.modal-dl dd { padding: 7px 0; margin: 0; font-size: 13.5px; font-weight: 500; border-bottom: 1px solid var(--line); }
.modal-dl > :nth-last-child(1), .modal-dl > :nth-last-child(2) { border-bottom: 0; }

.modal-doc { background: var(--brand-050); border: 1px solid #bfe0d4; border-radius: 10px; padding: 12px 14px; margin-bottom: 14px; }
.modal-doc__t { font-weight: 600; font-size: 14px; color: var(--brand-700); }
.modal-doc__s { font-size: 12.5px; color: var(--brand-600); margin-top: 2px; }

.modal-decl { font-size: 12.5px; color: #4a5652; line-height: 1.6; margin: 0; padding: 12px 14px; background: var(--canvas); border-radius: 10px; border-left: 3px solid var(--brand); border-radius: 0 10px 10px 0; }

/* ==== Dashboard: ancho completo ========================================= */
.content--wide { max-width: none; }

/* ==== Tarjetas de estadística =========================================== */
.stat-row { display: grid; grid-template-columns: repeat(auto-fit, minmax(210px, 1fr)); gap: 16px; margin-bottom: 20px; }
.stat { display: flex; align-items: center; gap: 14px; background: var(--surface); border: 1px solid var(--line); border-radius: 14px; padding: 18px 20px; }
.stat--hi { background: linear-gradient(135deg, var(--brand-700), var(--brand)); border: 0; color: #fff; }
.stat--hi .stat__lbl { color: rgba(255,255,255,.85); }
.stat__ico { width: 44px; height: 44px; border-radius: 11px; display: grid; place-items: center; flex-shrink: 0; }
.stat__ico svg { width: 22px; height: 22px; }
.stat__ico--a { background: #e7f2ee; color: var(--brand-700); }
.stat__ico--b { background: #eaf0fb; color: #3a63b8; }
.stat__ico--c { background: #e9f6ec; color: #2f8f4e; }
.stat__ico--d { background: rgba(255,255,255,.18); color: #fff; }
.stat__num { font-size: 26px; font-weight: 700; line-height: 1.1; }
.stat__lbl { font-size: 12.5px; color: var(--muted); margin-top: 2px; }

/* ==== Rejilla de gráficos =============================================== */
.dash-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; margin-bottom: 20px; }
@media (max-width: 900px) { .dash-grid { grid-template-columns: 1fr; } }
.chart-box { position: relative; height: 300px; }

/* ==== Barra de progreso en tablas ======================================= */
.bar { height: 8px; background: #eef1ef; border-radius: 99px; overflow: hidden; display: inline-block; width: 110px; vertical-align: middle; }
.bar__fill { height: 100%; border-radius: 99px; }
.bar__fill.is-ok  { background: var(--brand); }
.bar__fill.is-mid { background: #c99a1e; }
.bar__fill.is-low { background: #c0562f; }
.bar__pct { font-size: 12.5px; font-weight: 600; margin-left: 8px; vertical-align: middle; }

/* ==== Avisos del trabajador ============================================= */
.alerta-pend { display: flex; gap: 14px; align-items: center; background: #fdf6e3; border: 1px solid #f0e0b0; border-left: 4px solid #d9a419; border-radius: 12px; padding: 16px 18px; margin-bottom: 20px; }
.alerta-pend__ico { width: 40px; height: 40px; flex-shrink: 0; border-radius: 10px; background: #f6e6bd; color: #a97d10; display: grid; place-items: center; }
.alerta-pend__ico svg { width: 22px; height: 22px; }
.alerta-pend strong { display: block; font-size: 15px; }
.alerta-pend span { font-size: 13px; color: var(--muted); }
.alerta-ok { display: flex; gap: 12px; align-items: center; background: #eaf7ee; border: 1px solid #bfe3c9; border-radius: 12px; padding: 16px 18px; margin-bottom: 20px; color: #256e3c; }
.alerta-ok svg { width: 24px; height: 24px; flex-shrink: 0; }
.alerta-ok strong { display: block; }
.alerta-ok span { font-size: 13px; color: #3f7a52; }
.sec-title { font-size: 15px; font-weight: 600; margin: 26px 0 12px; color: var(--muted); }

/* ==== Card de normativa (rediseñado, más grande y legible) ============== */
.norm-cards { display: grid; grid-template-columns: repeat(auto-fill, minmax(280px, 1fr)); gap: 16px; }
.norm-card {
  display: flex; flex-direction: column; gap: 10px;
  background: var(--surface); border: 1px solid var(--line); border-radius: 16px;
  padding: 20px; text-decoration: none; color: var(--text);
  transition: transform .12s ease, box-shadow .12s ease, border-color .12s ease;
}
.norm-card:hover { transform: translateY(-2px); box-shadow: 0 10px 26px rgba(16,32,28,.10); border-color: #cfe0d9; }
.norm-card--pend { border-left: 4px solid #d9a419; }
.norm-card--done { border-left: 4px solid var(--brand); }
.norm-card__top { display: flex; align-items: center; justify-content: space-between; }
.norm-card__cat { font-size: 11px; font-weight: 600; letter-spacing: .04em; text-transform: uppercase; color: var(--brand-700); background: var(--brand-050); padding: 4px 10px; border-radius: 99px; }
.norm-card__flag { font-size: 11.5px; font-weight: 600; color: #a97d10; background: #fbf1d4; padding: 4px 10px; border-radius: 99px; }
.norm-card__flag--ok { color: var(--brand-700); background: #e2f1ea; }
.norm-card__title { font-size: 17px; font-weight: 650; line-height: 1.3; margin: 2px 0 0; }
.norm-card__meta { font-size: 12.5px; color: var(--muted); }
.norm-card__cta { margin-top: auto; display: inline-flex; align-items: center; gap: 6px; font-size: 13.5px; font-weight: 600; color: var(--brand-700); padding-top: 8px; }
.norm-card__cta svg { width: 16px; height: 16px; }
.norm-card__cta--muted { color: var(--muted); }
.btn--sm { padding: 6px 12px; font-size: 12.5px; }
.norm-card__desc { font-size: 13px; color: #55605b; line-height: 1.55; margin: 2px 0 0; }

/* ==== Hamburger + topbar responsive ===================================== */
.topbar__left { display: flex; align-items: center; gap: 12px; min-width: 0; }
.topbar__title { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.hamburger {
  display: none; align-items: center; justify-content: center;
  width: 38px; height: 38px; border: 1px solid var(--line); border-radius: 9px;
  background: var(--surface); color: var(--text); cursor: pointer; flex: none;
}
.hamburger:hover { background: var(--canvas); }
.hamburger svg { width: 20px; height: 20px; }
/* En escritorio no hay backdrop ni drawer */
.rail-backdrop { display: none; }
@media (max-width: 860px) { .rail-backdrop { display: block; } }

/* ==== Panel informativo (por qué leer) ================================== */
.info-panel { display: flex; gap: 14px; background: var(--brand-050); border: 1px solid #cfe6dc; border-radius: 14px; padding: 16px 18px; margin-bottom: 20px; }
.info-panel__ico { width: 38px; height: 38px; flex: none; border-radius: 10px; background: #d6ece2; color: var(--brand-700); display: grid; place-items: center; }
.info-panel__ico svg { width: 22px; height: 22px; }
.info-panel__txt strong { display: block; font-size: 14.5px; color: var(--brand-700); margin-bottom: 3px; }
.info-panel__txt p { margin: 0; font-size: 13px; color: #45524d; line-height: 1.6; }

/* ==== Progreso en card de pendiente ===================================== */
.progress { margin-top: 2px; }
.progress__bar { height: 6px; background: #ecefed; border-radius: 99px; overflow: hidden; }
.progress__fill { height: 100%; background: var(--brand); border-radius: 99px; }
.progress__txt { display: block; font-size: 11.5px; color: var(--muted); margin-top: 5px; }

/* ==== Acciones en card aceptada ========================================= */
.norm-card__actions { margin-top: auto; display: flex; gap: 8px; flex-wrap: wrap; padding-top: 8px; }
.norm-card__actions .btn { flex: 1; justify-content: center; min-width: 120px; }

/* ==== FIX cascada móvil: estas reglas deben ir AL FINAL para ganar ======= */
@media (max-width: 860px) {
  .hamburger { display: inline-flex; }
  .rail {
    position: fixed; top: 0; left: 0; z-index: 60;
    width: 262px; height: 100vh; height: 100dvh;
    transform: translateX(-100%); transition: transform .22s ease;
  }
  .rail--open { transform: translateX(0); box-shadow: 0 0 50px rgba(0,0,0,.45); }
  .rail-backdrop { display: block; }
}
@media (min-width: 861px) {
  .hamburger { display: none; }
  .rail-backdrop { display: none; }
}

/* ==== TEMAS (acento vivo, se aplica por [data-theme] en <html>) ========== */
[data-theme="verde"]  { --brand:#0f6e56; --brand-600:#0c5744; --brand-700:#094536; --brand-050:#e4f1ec; --rail:#12211e; --rail-hov:#1b2f2b; }
[data-theme="azul"]   { --brand:#2563eb; --brand-600:#1d4ed8; --brand-700:#1e3a8a; --brand-050:#e9f0fe; --rail:#111a2e; --rail-hov:#1c2942; }
[data-theme="morado"] { --brand:#7c3aed; --brand-600:#6d28d9; --brand-700:#5b21b6; --brand-050:#f1ebfe; --rail:#1c1330; --rail-hov:#2a1e45; }
[data-theme="teal"]   { --brand:#0d9488; --brand-600:#0b7d73; --brand-700:#0f5f58; --brand-050:#e2f5f2; --rail:#0f2320; --rail-hov:#163530; }
[data-theme="naranja"]{ --brand:#ea580c; --brand-600:#c2410c; --brand-700:#9a3412; --brand-050:#fdeede; --rail:#2a1a10; --rail-hov:#3d2717; }
[data-theme="rosa"]   { --brand:#db2777; --brand-600:#be185d; --brand-700:#9d174d; --brand-050:#fdecf4; --rail:#2b1220; --rail-hov:#3f1b30; }

/* ==== Selector de tema (en el menú del avatar) ========================== */
.theme-picker { padding: 8px 10px 4px; border-top: 1px solid var(--line); margin-top: 4px; }
.theme-picker__lbl { font-size: 11px; color: var(--muted); text-transform: uppercase; letter-spacing: .06em; display: block; margin-bottom: 8px; }
.theme-dots { display: flex; gap: 8px; }
.theme-dot { width: 24px; height: 24px; border-radius: 50%; border: 2px solid transparent; cursor: pointer; padding: 0; outline: 2px solid transparent; outline-offset: 2px; transition: transform .1s; }
.theme-dot:hover { transform: scale(1.12); }
.theme-dot--verde{background:#0f6e56;} .theme-dot--azul{background:#2563eb;} .theme-dot--morado{background:#7c3aed;}
.theme-dot--teal{background:#0d9488;} .theme-dot--naranja{background:#ea580c;} .theme-dot--rosa{background:#db2777;}
/* resalta el tema activo segun el data-theme del html */
[data-theme="verde"]  .theme-dot--verde,
[data-theme="azul"]   .theme-dot--azul,
[data-theme="morado"] .theme-dot--morado,
[data-theme="teal"]   .theme-dot--teal,
[data-theme="naranja"].theme-dot--naranja,
[data-theme="rosa"]   .theme-dot--rosa { border-color: var(--surface); outline-color: currentColor; }

/* ==== Mi perfil ========================================================= */
.perfil-grid { display: grid; grid-template-columns: 1.1fr 1fr; gap: 16px; align-items: start; }
@media (max-width: 860px) { .perfil-grid { grid-template-columns: 1fr; } }
.perfil-id { display: flex; align-items: center; gap: 14px; padding-bottom: 16px; margin-bottom: 4px; border-bottom: 1px solid var(--line); }
.perfil-id__av { width: 56px; height: 56px; border-radius: 50%; background: var(--brand-050); color: var(--brand-700); display: grid; place-items: center; font-weight: 700; font-size: 20px; flex: none; }
.perfil-id__n { font-size: 17px; font-weight: 600; }
.perfil-id__r { font-size: 12.5px; color: var(--muted); }
.ro-list { list-style: none; margin: 0; padding: 0; }
.ro-list li { display: flex; justify-content: space-between; gap: 14px; padding: 11px 0; border-bottom: 1px solid var(--line); font-size: 13.5px; }
.ro-list li:last-child { border-bottom: 0; }
.ro-list .k { color: var(--muted); }
.ro-list .v { font-weight: 500; text-align: right; }
.lock { font-size: 11px; color: var(--muted); background: var(--canvas); border: 1px solid var(--line); padding: 2px 8px; border-radius: 99px; }

/* ==== Logo en login ===================================================== */
.auth-logo-wrap { text-align: center; margin-bottom: 20px; }
.auth-logo { height: 84px; width: auto; max-width: 220px; object-fit: contain; }
.auth-logo-fallback { width: 56px; height: 56px; font-size: 22px; margin: 0 auto; }
.auth-card h1 { text-align: center; }
.auth-card .sub { text-align: center; }
.head-actions { display: flex; gap: 8px; flex-wrap: wrap; }

/* ==== Login en dos paneles ============================================== */
.auth-split { width: 100%; max-width: 900px; background: var(--surface); border-radius: 18px; overflow: hidden; box-shadow: 0 24px 60px rgba(16,32,28,.14); display: flex; }
.auth-info { flex: 0 0 45%; background: linear-gradient(160deg, #0f6e56 0%, #0b4a3a 100%); color: #eaf3ef; padding: 40px 34px; display: flex; flex-direction: column; }
.auth-info__logo { height: 66px; width: auto; align-self: center; margin-bottom: 22px; filter: drop-shadow(0 2px 6px rgba(0,0,0,.25)); }
.auth-info h2 { font-family: 'Plus Jakarta Sans', sans-serif; font-size: 20px; line-height: 1.25; margin: 0 0 12px; color: #fff; }
.auth-info__lead { font-size: 13.5px; line-height: 1.6; color: #cfe4dc; margin: 0 0 22px; }
.auth-info__lead b { color: #fff; }
.auth-points { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 16px; }
.auth-points li { display: flex; gap: 12px; align-items: flex-start; font-size: 13px; line-height: 1.5; color: #e4f0eb; }
.auth-points svg { width: 20px; height: 20px; flex: none; color: #7fd0b6; margin-top: 1px; }
.auth-info__note { margin: 26px 0 0; padding-top: 18px; border-top: 1px solid rgba(255,255,255,.14); font-size: 12px; color: #bfd8ce; }
.auth-info__note b { color: #fff; }

.auth-form { flex: 1; padding: 44px 40px; display: flex; flex-direction: column; justify-content: center; }
.auth-form h1 { font-size: 21px; margin: 0 0 4px; font-weight: 650; }
.auth-form .sub { color: var(--muted); font-size: 13px; margin: 0 0 22px; }
.auth-form .field { margin-bottom: 14px; }
.auth-foot { margin: 20px 0 0; font-size: 11.5px; color: var(--muted); line-height: 1.5; text-align: center; }

@media (max-width: 720px) {
  .auth-split { flex-direction: column; max-width: 420px; }
  .auth-info { flex: none; padding: 28px 26px; }
  .auth-info__logo { height: 54px; margin-bottom: 16px; }
  .auth-info h2 { font-size: 18px; }
  .auth-form { padding: 30px 26px; }
}

/* ==== Aviso de cierre por inactividad =================================== */
.idle-warn { position: fixed; inset: 0; z-index: 200; background: rgba(16,32,28,.55); display: flex; align-items: center; justify-content: center; padding: 20px; }
.idle-warn__box { background: var(--surface); border-radius: 16px; max-width: 380px; width: 100%; padding: 26px 24px; text-align: center; box-shadow: 0 24px 60px rgba(16,32,28,.3); }
.idle-warn__ico { width: 48px; height: 48px; border-radius: 50%; background: var(--amber-050); color: var(--amber); display: grid; place-items: center; margin: 0 auto 14px; }
.idle-warn__ico svg { width: 26px; height: 26px; }
.idle-warn__box h3 { margin: 0 0 8px; font-size: 17px; }
.idle-warn__box p { margin: 0 0 18px; font-size: 13.5px; color: var(--muted); line-height: 1.55; }
.idle-warn__box p b { color: var(--danger); font-size: 15px; }
.idle-warn__btns { display: flex; gap: 10px; justify-content: center; flex-wrap: wrap; }
.idle-warn__btns .btn { flex: 1; justify-content: center; min-width: 130px; }

/* ==== Overlay de carga de documento ===================================== */
.upload-overlay { position: fixed; inset: 0; z-index: 200; background: rgba(16,32,28,.6); display: flex; align-items: center; justify-content: center; padding: 20px; }
.upload-overlay[hidden] { display: none; }
.upload-box { background: var(--surface); border-radius: 16px; max-width: 400px; width: 100%; padding: 30px 26px; text-align: center; box-shadow: 0 24px 60px rgba(16,32,28,.32); }
.upload-spin { width: 42px; height: 42px; margin: 0 auto 16px; border: 3px solid var(--brand-050); border-top-color: var(--brand); border-radius: 50%; animation: upspin .8s linear infinite; }
@keyframes upspin { to { transform: rotate(360deg); } }
.upload-box h3 { margin: 0 0 6px; font-size: 17px; }
.upload-box p { margin: 0 0 16px; font-size: 13.5px; color: var(--muted); }
.upload-bar { height: 8px; background: #eef1ef; border-radius: 99px; overflow: hidden; }
.upload-bar__fill { height: 100%; width: 0; background: var(--brand); border-radius: 99px; transition: width .4s ease; }
.upload-note { margin: 14px 0 0 !important; font-size: 11.5px !important; line-height: 1.5; }

/* ==== Panel "ya aceptaste" (visor) ====================================== */
.acuse-ok { background: var(--surface); border: 1px solid #bfe3c9; border-left: 4px solid var(--brand); border-radius: 14px; padding: 22px 24px; text-align: left; max-width: 620px; margin: 0 auto; }
.acuse-ok__head { display: flex; gap: 14px; align-items: center; margin-bottom: 18px; }
.acuse-ok__check { width: 44px; height: 44px; flex: none; border-radius: 50%; background: #e2f1ea; color: var(--brand); display: grid; place-items: center; }
.acuse-ok__check svg { width: 24px; height: 24px; }
.acuse-ok__head h3 { margin: 0; font-size: 17px; color: var(--brand-700); }
.acuse-ok__head p { margin: 2px 0 0; font-size: 13px; color: var(--muted); }
.acuse-ok__dl { display: grid; grid-template-columns: 150px 1fr; gap: 0; margin: 0 0 16px; }
.acuse-ok__dl dt { padding: 8px 0; font-size: 12.5px; color: var(--muted); border-bottom: 1px solid var(--line); }
.acuse-ok__dl dd { padding: 8px 0; margin: 0; font-size: 13.5px; border-bottom: 1px solid var(--line); }
.acuse-ok__dl > :nth-last-child(1), .acuse-ok__dl > :nth-last-child(2) { border-bottom: 0; }
.acuse-ok__hash { background: var(--canvas); border-radius: 9px; padding: 10px 12px; margin-bottom: 16px; }
.acuse-ok__hash span { display: block; font-size: 10.5px; text-transform: uppercase; letter-spacing: .05em; color: var(--muted); margin-bottom: 4px; }
.acuse-ok__hash code { font-size: 10.5px; color: #4a5652; word-break: break-all; line-height: 1.5; }
.acuse-ok__btn { width: 100%; justify-content: center; }
@media (max-width: 620px) { .acuse-ok__dl { grid-template-columns: 1fr; } .acuse-ok__dl dt { padding-bottom: 0; border-bottom: 0; } .acuse-ok__dl dd { padding-top: 2px; } }

/* ==== Visor en dos columnas ============================================= */
.visor-layout { display: grid; grid-template-columns: minmax(0,1fr) 330px; gap: 22px; align-items: start; }
.visor-doc { min-width: 0; }
.visor-side { position: sticky; top: 18px; }

.side-card { background: var(--surface); border: 1px solid var(--line); border-radius: 14px; padding: 18px; box-shadow: var(--shadow); }
.side-card--ok { border-color: #bfe3c9; border-top: 3px solid var(--brand); }
.side-card__t { display: flex; align-items: center; gap: 8px; font-size: 13px; font-weight: 600; color: var(--brand-700); margin-bottom: 14px; }
.side-card__t svg { width: 18px; height: 18px; }
.side-card__btn { width: 100%; justify-content: center; }

.side-prog { margin-bottom: 14px; }
.side-prog__top { display: flex; justify-content: space-between; align-items: baseline; font-size: 12.5px; color: var(--muted); margin-bottom: 6px; }
.side-prog__top b { color: var(--brand-700); font-size: 14px; }
.side-prog__txt { display: block; font-size: 11.5px; color: var(--muted); margin-top: 5px; }

.visor-side .acuse-ok__head { margin-bottom: 14px; }
.visor-side .acuse-ok__head h3 { font-size: 15px; }
.visor-side .acuse-ok__dl { grid-template-columns: 92px 1fr; margin: 14px 0 0; }
.visor-side .acuse-ok__dl dt,
.visor-side .acuse-ok__dl dd { padding: 7px 0; font-size: 12px; }
.acuse-ok__hash-d { margin-top: 12px; border-top: 1px solid var(--line); padding-top: 10px; }
.acuse-ok__hash-d summary { font-size: 11px; text-transform: uppercase; letter-spacing: .04em; color: var(--muted); cursor: pointer; }
.acuse-ok__hash-d code { display: block; margin-top: 8px; font-size: 10px; color: #4a5652; word-break: break-all; line-height: 1.5; background: var(--canvas); padding: 8px; border-radius: 7px; }

@media (max-width: 1000px) {
  .visor-layout { grid-template-columns: 1fr; }
  .visor-side { position: static; }
  /* Si ya aceptó, el panel va arriba (es lo que quiere ver) */
  .visor-layout--ok .visor-side { order: -1; margin-bottom: 4px; }
}

/* ==== Historial de lectura (BI) ========================================= */
.side-hist { margin-top: 14px; }
.hist-tiles { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; margin-bottom: 12px; }
.hist-tile { background: var(--canvas); border-radius: 10px; padding: 10px 11px; }
.hist-tile__k { display: block; font-size: 10.5px; text-transform: uppercase; letter-spacing: .04em; color: var(--muted); margin-bottom: 3px; }
.hist-tile__v { font-size: 16px; font-weight: 700; color: var(--text); line-height: 1.1; }
.hist-tile__v small { font-size: 11px; font-weight: 500; color: var(--muted); }

.hist-ritmo { display: flex; justify-content: space-between; align-items: center; padding: 9px 11px; border-radius: 9px; font-size: 12px; margin-bottom: 14px; }
.hist-ritmo span { color: var(--muted); }
.hist-ritmo b { font-size: 12.5px; }
.hist-ritmo.r-ok   { background: #e9f6ec; } .hist-ritmo.r-ok b   { color: #2f8f4e; }
.hist-ritmo.r-mid  { background: #fdf6e3; } .hist-ritmo.r-mid b  { color: #a97d10; }
.hist-ritmo.r-low  { background: #fbeceb; } .hist-ritmo.r-low b  { color: var(--danger); }
.hist-ritmo.r-none { background: var(--canvas); } .hist-ritmo.r-none b { color: var(--muted); }

.hist-line { list-style: none; margin: 0 0 12px; padding: 0 0 0 4px; }
.hist-line li { position: relative; padding: 0 0 14px 18px; border-left: 2px solid var(--line); }
.hist-line li:last-child { border-left-color: transparent; padding-bottom: 0; }
.hist-line__d { position: absolute; left: -5px; top: 3px; width: 8px; height: 8px; border-radius: 50%; background: var(--line-2); }
.hist-line li.is-ok .hist-line__d { background: var(--brand); box-shadow: 0 0 0 3px var(--brand-050); }
.hist-line b { display: block; font-size: 12px; font-weight: 600; }
.hist-line i { font-style: normal; font-size: 11.5px; color: var(--muted); }

.hist-meta { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; padding-top: 12px; border-top: 1px solid var(--line); }
.hist-meta span { display: block; font-size: 10.5px; color: var(--muted); text-transform: uppercase; letter-spacing: .04em; }
.hist-meta b { font-size: 11.5px; font-weight: 500; word-break: break-all; }
.hist-note { margin: 12px 0 0; font-size: 10.5px; color: var(--muted); line-height: 1.5; }

/* ==== Declaración expresa en el modal de acuse ========================== */
.check-decl { display: flex; gap: 10px; align-items: flex-start; background: var(--canvas); border: 1px solid var(--line); border-radius: 10px; padding: 12px 13px; cursor: pointer; margin-top: 14px; }
.check-decl input { width: 17px; height: 17px; flex: none; margin-top: 1px; accent-color: var(--brand); }
.check-decl span { font-size: 12.5px; line-height: 1.5; color: var(--text); }
.check-decl:hover { border-color: var(--line-2); }

/* ============ REDISEÑO SIDEBAR + HEADER (gana por ir al final) ========== */
.rail { display: flex; flex-direction: column; }
.rail__brand { display: flex; align-items: center; gap: 11px; padding: 18px 16px; border-bottom: 1px solid rgba(255,255,255,.07); }
.rail__logo { width: 36px; height: 36px; object-fit: contain; flex: none; border-radius: 8px; background: rgba(255,255,255,.06); padding: 3px; }
.rail__brandtext b { display: block; font-family: 'Plus Jakarta Sans', sans-serif; font-size: 13.5px; color: #fff; line-height: 1.2; }
.rail__brandtext span { font-size: 10.5px; color: var(--rail-txt); }
.rail__x { display: none; margin-left: auto; background: none; border: 0; color: var(--rail-txt); cursor: pointer; padding: 4px; }
.rail__x svg { width: 20px; height: 20px; }

.rail__nav { flex: 1; padding: 10px 10px 16px; overflow-y: auto; }
.rail__label { font-size: 10px; text-transform: uppercase; letter-spacing: .09em; color: #6b8078; padding: 16px 8px 7px; font-weight: 600; }
.rail__nav > .rail__label:first-child { padding-top: 6px; }
.rail__item { display: flex; align-items: center; gap: 11px; padding: 10px 11px; border-radius: 9px; color: var(--rail-txt); text-decoration: none; font-size: 13.5px; font-weight: 500; margin-bottom: 2px; transition: background .12s, color .12s; }
.rail__item svg { width: 18px; height: 18px; flex: none; opacity: .8; }
.rail__item:hover { background: var(--rail-hov); color: #fff; }
.rail__item.is-active { background: var(--brand); color: #fff; font-weight: 600; }
.rail__item.is-active svg { opacity: 1; }

.rail__me { display: flex; align-items: center; gap: 10px; padding: 12px 14px; margin: 0 10px 12px; border-radius: 10px; background: rgba(255,255,255,.05); text-decoration: none; transition: background .12s; }
.rail__me:hover { background: rgba(255,255,255,.1); }
.rail__me-t { min-width: 0; flex: 1; }
.rail__me-t b { display: block; font-size: 12.5px; color: #fff; font-weight: 600; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.rail__me-t span { font-size: 10.5px; color: var(--rail-txt); }
.rail__me-i { width: 15px; height: 15px; color: var(--rail-txt); flex: none; }
.avatar--sm { width: 30px; height: 30px; font-size: 11px; flex: none; }

/* Header */
.topbar { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 0 18px; height: 62px; background: var(--surface); border-bottom: 1px solid var(--line); position: sticky; top: 0; z-index: 40; }
.topbar__title { font-family: 'Plus Jakarta Sans', sans-serif; font-size: 14px; font-weight: 600; letter-spacing: -.01em; }
.topbar__right { display: flex; align-items: center; gap: 8px; }
.tb-user { display: flex; align-items: center; gap: 9px; padding: 5px 10px 5px 5px; border-radius: 99px; text-decoration: none; color: var(--text); transition: background .12s; }
.tb-user:hover { background: var(--canvas); }
.tb-user__name { font-size: 12.5px; font-weight: 600; line-height: 1.2; }
.tb-user__role { font-size: 10.5px; color: var(--muted); }
.tb-icon { display: grid; place-items: center; width: 36px; height: 36px; border: 1px solid var(--line); border-radius: 9px; background: var(--surface); color: var(--muted); cursor: pointer; }
.tb-icon:hover { background: var(--canvas); color: var(--text); }
.tb-icon svg { width: 18px; height: 18px; }
.tb-salir { display: inline-flex; align-items: center; gap: 7px; padding: 8px 14px; border-radius: 9px; background: var(--danger-050); color: var(--danger); border: 1px solid #f0d3d1; font-size: 13px; font-weight: 600; text-decoration: none; transition: background .12s; }
.tb-salir:hover { background: var(--danger); color: #fff; border-color: var(--danger); }
.tb-salir svg { width: 17px; height: 17px; }
.dropdown--tema { padding: 12px 14px; min-width: 190px; }
.dropdown--tema .theme-picker__lbl { border: 0; margin-bottom: 8px; padding: 0; }

@media (max-width: 860px) {
  .rail__x { display: block; }
  .tb-user__text { display: none; }
  .tb-salir span { display: none; }
  .tb-salir { padding: 8px 10px; }
  .topbar { padding: 0 12px; }
}

/* ============ LOGIN ESTILO LANDING ===================================== */
.body--landing { background: var(--surface); }
.lp { min-height: 100vh; display: flex; flex-direction: column; }

.lp-nav { border-bottom: 1px solid var(--line); background: rgba(255,255,255,.9); backdrop-filter: blur(8px); position: sticky; top: 0; z-index: 10; }
.lp-nav__in { max-width: 1120px; margin: 0 auto; padding: 12px 22px; display: flex; align-items: center; justify-content: space-between; }
.lp-brand { display: flex; align-items: center; gap: 11px; }
.lp-brand img { height: 38px; width: auto; }
.lp-brand b { display: block; font-family: 'Plus Jakarta Sans', sans-serif; font-size: 14px; line-height: 1.2; }
.lp-brand span { font-size: 11px; color: var(--muted); }
.lp-nav__cta { font-size: 13px; font-weight: 600; color: var(--brand-700); text-decoration: none; padding: 8px 16px; border: 1px solid #bfe0d4; border-radius: 99px; }
.lp-nav__cta:hover { background: var(--brand-050); }

.lp-hero { background: linear-gradient(170deg, var(--brand-050) 0%, var(--surface) 62%); padding: 56px 22px 60px; }
.lp-hero__in { max-width: 1120px; margin: 0 auto; display: grid; grid-template-columns: 1.05fr 400px; gap: 48px; align-items: center; }
.lp-chip { display: inline-block; font-size: 11px; font-weight: 700; letter-spacing: .06em; text-transform: uppercase; color: var(--brand-700); background: #d6ece2; padding: 5px 12px; border-radius: 99px; margin-bottom: 16px; }
.lp-hero__txt h1 { font-family: 'Plus Jakarta Sans', sans-serif; font-size: 38px; line-height: 1.15; letter-spacing: -.025em; margin: 0 0 14px; color: var(--ink); }
.lp-hero__txt p { font-size: 15px; line-height: 1.65; color: #45524d; margin: 0 0 22px; max-width: 46ch; }
.lp-badges { display: flex; gap: 20px; flex-wrap: wrap; }
.lp-badges span { display: inline-flex; align-items: center; gap: 7px; font-size: 12.5px; color: var(--brand-700); font-weight: 500; }
.lp-badges svg { width: 17px; height: 17px; }

.lp-form { background: var(--surface); border: 1px solid var(--line); border-radius: 18px; padding: 30px 28px; box-shadow: 0 20px 50px rgba(16,32,28,.12); }
.lp-form h2 { font-size: 20px; margin: 0 0 4px; font-weight: 650; }
.lp-form__sub { font-size: 12.5px; color: var(--muted); margin: 0 0 20px; }
.lp-form .field { margin-bottom: 14px; }
.lp-form__foot { margin: 18px 0 0; font-size: 11.5px; color: var(--muted); text-align: center; }

.lp-pasos { padding: 56px 22px 60px; border-top: 1px solid var(--line); }
.lp-pasos__in { max-width: 1120px; margin: 0 auto; }
.lp-pasos h2 { font-family: 'Plus Jakarta Sans', sans-serif; font-size: 24px; text-align: center; margin: 0 0 34px; letter-spacing: -.02em; }
.lp-steps { display: grid; grid-template-columns: repeat(3, 1fr); gap: 20px; }
.lp-step { background: var(--canvas); border: 1px solid var(--line); border-radius: 14px; padding: 24px 22px; }
.lp-step__n { width: 32px; height: 32px; border-radius: 9px; background: var(--brand); color: #fff; display: grid; place-items: center; font-weight: 700; font-size: 14px; margin-bottom: 12px; }
.lp-step h3 { font-size: 15px; margin: 0 0 6px; font-weight: 650; }
.lp-step p { font-size: 13px; line-height: 1.6; color: #55605b; margin: 0; }
.lp-legal { margin: 30px auto 0; max-width: 720px; text-align: center; font-size: 12.5px; color: var(--muted); background: var(--brand-050); border-radius: 10px; padding: 12px 16px; }
.lp-legal b { color: var(--brand-700); }

.lp-foot { margin-top: auto; border-top: 1px solid var(--line); padding: 20px 22px; display: flex; justify-content: space-between; gap: 10px; flex-wrap: wrap; max-width: 1120px; margin-left: auto; margin-right: auto; width: 100%; }
.lp-foot span { font-size: 11.5px; color: var(--muted); }

@media (max-width: 940px) {
  .lp-hero__in { grid-template-columns: 1fr; gap: 32px; }
  .lp-hero__txt h1 { font-size: 29px; }
  .lp-steps { grid-template-columns: 1fr; }
  .lp-hero { padding: 36px 18px 44px; }
  .lp-pasos { padding: 40px 18px; }
  .lp-nav__cta { display: none; }
}

/* ==== Auditoría ========================================================= */
.aud-filtros { display: grid; grid-template-columns: 1.6fr 1.2fr .9fr .9fr auto; gap: 12px; align-items: end; }
.aud-filtros .field { margin: 0; }
.aud-filtros__btns { display: flex; gap: 8px; }
@media (max-width: 900px) { .aud-filtros { grid-template-columns: 1fr 1fr; } .aud-filtros__btns { grid-column: 1 / -1; } }
.aud-badge { display: inline-block; font-size: 11.5px; font-weight: 600; padding: 4px 10px; border-radius: 99px; white-space: nowrap; }
.aud-badge--n  { background: var(--canvas);     color: var(--muted); }
.aud-badge--ok { background: #e9f6ec;           color: #2f8f4e; }
.aud-badge--w  { background: var(--amber-050);  color: var(--amber); }
.aud-badge--d  { background: var(--danger-050); color: var(--danger); }
.aud-det { font-size: 12.5px; color: #4a5652; }
.stat--alerta { border-color: #f0c9c4; background: #fdf4f3; }
.stat__ico--e { background: var(--danger-050); color: var(--danger); }
.pager { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 14px 18px; border-top: 1px solid var(--line); flex-wrap: wrap; }
.pager__info { font-size: 12.5px; color: var(--muted); }
.pager__btns { display: flex; gap: 8px; }

/* ==== Landing: header más alto (va al final: gana) ====================== */
.lp-nav__in { padding: 22px 22px; justify-content: center; }
.lp-brand { gap: 14px; }
.lp-brand img { height: 54px; }
.lp-brand b { font-size: 17px; letter-spacing: -.01em; }
.lp-brand span { font-size: 12px; }
@media (max-width: 940px) {
  .lp-nav__in { padding: 16px 18px; }
  .lp-brand img { height: 42px; }
  .lp-brand b { font-size: 15px; }
}

/* ==== Notas personales ================================================== */
.side-notas { margin-top: 14px; }
.notas-badge { margin-left: auto; background: var(--brand-050); color: var(--brand-700); font-size: 11px; font-weight: 700; padding: 2px 8px; border-radius: 99px; }
.notas-lista { max-height: 340px; overflow-y: auto; display: flex; flex-direction: column; gap: 8px; }
.notas-vacio { font-size: 12px; color: var(--muted); line-height: 1.55; margin: 0; }
.notas-priv { display: flex; align-items: center; gap: 6px; margin: 12px 0 0; padding-top: 10px; border-top: 1px solid var(--line); font-size: 10.5px; color: var(--muted); }
.notas-priv svg { width: 13px; height: 13px; flex: none; }

.nota-item { border-radius: 9px; padding: 9px 11px; border-left: 3px solid; }
.nota-item--amarillo { background: #fdf6e3; border-color: #d9a419; }
.nota-item--verde    { background: #e9f6ec; border-color: #2f8f4e; }
.nota-item--azul     { background: #e9f0fe; border-color: #3a63b8; }
.nota-item--rosa     { background: #fdecf4; border-color: #db2777; }
.nota-item__h { display: flex; align-items: center; justify-content: space-between; margin-bottom: 4px; }
.nota-item__pag { background: none; border: 0; padding: 0; font-size: 11px; font-weight: 700; color: var(--muted); cursor: pointer; text-decoration: underline; }
.nota-item__pag:hover { color: var(--brand-700); }
.nota-item__acc { display: flex; gap: 3px; }
.nota-item__acc button { background: none; border: 0; padding: 2px; color: var(--muted); cursor: pointer; }
.nota-item__acc button:hover { color: var(--text); }
.nota-item__acc svg { width: 14px; height: 14px; }
.nota-item__t { margin: 0; font-size: 12.5px; line-height: 1.5; color: #3d4744; white-space: pre-wrap; word-break: break-word; }

/* Barra bajo cada página del visor */
.pag-bar { display: flex; align-items: center; gap: 10px; padding: 8px 12px; border-top: 1px solid var(--line); background: var(--canvas); border-radius: 0 0 12px 12px; }
.pag-bar__n { font-size: 11.5px; color: var(--muted); font-weight: 600; }
.pag-bar__add { display: inline-flex; align-items: center; gap: 5px; background: var(--surface); border: 1px solid var(--line-2); border-radius: 7px; padding: 4px 10px; font-size: 11.5px; font-weight: 600; color: var(--brand-700); cursor: pointer; }
.pag-bar__add:hover { background: var(--brand-050); border-color: #bfe0d4; }
.pag-bar__add svg { width: 13px; height: 13px; }
.pag-bar__marks { display: flex; gap: 4px; margin-left: auto; }
.pag-mark { width: 13px; height: 13px; border-radius: 4px; border: 0; cursor: pointer; }
.pag-mark--amarillo { background: #d9a419; } .pag-mark--verde { background: #2f8f4e; }
.pag-mark--azul { background: #3a63b8; }     .pag-mark--rosa  { background: #db2777; }

/* Modal de nota */
.nota-modal { position: fixed; inset: 0; z-index: 150; background: rgba(16,32,28,.5); display: flex; align-items: center; justify-content: center; padding: 20px; }
.nota-box { background: var(--surface); border-radius: 14px; width: 100%; max-width: 420px; padding: 20px; box-shadow: 0 20px 50px rgba(16,32,28,.28); }
.nota-box__h { display: flex; align-items: baseline; justify-content: space-between; margin-bottom: 12px; }
.nota-box__h b { font-size: 15px; }
.nota-box__h span { font-size: 12px; color: var(--muted); }
.nota-ta { width: 100%; min-height: 120px; border: 1px solid var(--line-2); border-radius: 9px; padding: 10px 12px; font: inherit; font-size: 13.5px; resize: vertical; }
.nota-ta:focus { outline: 0; border-color: var(--brand); box-shadow: 0 0 0 3px var(--brand-050); }
.nota-colores { display: flex; gap: 8px; margin-top: 12px; }
.nota-color { width: 26px; height: 26px; border-radius: 50%; border: 2px solid transparent; cursor: pointer; }
.nota-color.is-sel { border-color: var(--text); }
.nota-color--amarillo { background: #d9a419; } .nota-color--verde { background: #2f8f4e; }
.nota-color--azul { background: #3a63b8; }     .nota-color--rosa  { background: #db2777; }
.nota-box__f { display: flex; justify-content: flex-end; gap: 8px; margin-top: 16px; }

/* ==== Notas ancladas al punto exacto (marcadores sobre la página) ======== */
.visor-pag { position: relative; }
.pag-capa { position: absolute; inset: 0; pointer-events: none; }
.pag-mk {
  position: absolute; transform: translate(-50%, -50%);
  width: 26px; height: 26px; border-radius: 50%; border: 2px solid #fff;
  color: #fff; font-size: 12px; font-weight: 700; line-height: 1;
  display: grid; place-items: center; cursor: pointer; pointer-events: auto;
  box-shadow: 0 2px 8px rgba(16,32,28,.35); transition: transform .12s;
}
.pag-mk:hover { transform: translate(-50%, -50%) scale(1.18); z-index: 5; }
.pag-mk--suelta { transform: none; }
.pag-mk--suelta:hover { transform: scale(1.15); }
.pag-mk--amarillo { background: #d9a419; } .pag-mk--verde { background: #2f8f4e; }
.pag-mk--azul     { background: #3a63b8; } .pag-mk--rosa  { background: #db2777; }
.pag-mk.is-flash { animation: mkFlash 1.6s ease; z-index: 6; }
@keyframes mkFlash {
  0%, 100% { box-shadow: 0 2px 8px rgba(16,32,28,.35); }
  30%      { box-shadow: 0 0 0 10px rgba(15,110,86,.35); }
  60%      { box-shadow: 0 0 0 4px rgba(15,110,86,.25); }
}

/* Modo "colocar nota" */
.visor-pag.is-anotando { cursor: crosshair; outline: 3px dashed var(--brand); outline-offset: 3px; }
.visor-pag.is-anotando .pag-capa { background: rgba(15,110,86,.05); }
.anotar-hint {
  position: fixed; left: 50%; bottom: 26px; transform: translateX(-50%); z-index: 120;
  background: var(--ink); color: #fff; padding: 11px 18px; border-radius: 99px;
  font-size: 13px; box-shadow: 0 10px 30px rgba(16,32,28,.35); display: flex; align-items: center; gap: 12px;
}
.anotar-hint button { background: rgba(255,255,255,.16); border: 0; color: #fff; font: inherit; font-size: 12px; padding: 4px 12px; border-radius: 99px; cursor: pointer; }
.anotar-hint button:hover { background: rgba(255,255,255,.3); }

.pag-bar__c { margin-left: auto; font-size: 11px; color: var(--muted); }
.nota-item__num { display: inline-grid; place-items: center; width: 17px; height: 17px; border-radius: 50%; background: currentColor; color: #fff; font-size: 10px; font-weight: 700; margin-right: 3px; }
.nota-item--amarillo .nota-item__num { background: #d9a419; color: #fff; }
.nota-item--verde .nota-item__num    { background: #2f8f4e; color: #fff; }
.nota-item--azul .nota-item__num     { background: #3a63b8; color: #fff; }
.nota-item--rosa .nota-item__num     { background: #db2777; color: #fff; }
.nota-item__pag { display: inline-flex; align-items: center; gap: 4px; }
