:root {
  --bg: #f4f5f7; --card: #fff; --line: #e4e7ec; --line-2: #f0f2f5;
  --text: #101828; --muted: #667085;
  --accent: #0b6e69; --accent-2: #e6f4f3;
  --danger: #d92d20; --danger-bg: #fef3f2;
  --warn: #b54708; --warn-bg: #fffaeb;
  --info: #175cd3; --info-bg: #eff8ff;
  --ok: #067647; --ok-bg: #ecfdf3;
  --purple: #6941c6; --purple-bg: #f4f3ff;
  --radius: 12px;
}
* { box-sizing: border-box; }
/* Atkinson Hyperlegible Next: diseñada para máxima legibilidad (letras que no se confunden: 1 l I, 0 O), pensada para socios de todas las edades y para leer en celular a pleno sol */
body { margin: 0; font-family: 'Atkinson Hyperlegible Next', 'Atkinson Hyperlegible', system-ui, -apple-system, sans-serif; background: var(--bg); color: var(--text); font-size: 14.5px; line-height: 1.45; }
.num, .kpi-v, .tbl td.num, .dc-amt, .fund-nums b { font-variant-numeric: tabular-nums; }
:focus-visible { outline: 2.5px solid var(--accent); outline-offset: 2px; border-radius: 4px; }
@media (prefers-reduced-motion: reduce) { * { transition: none !important; animation: none !important; scroll-behavior: auto !important; } }
a { color: var(--accent); }
h1 { font-size: 22px; margin: 0 0 2px; letter-spacing: -.01em; }
h2 { font-size: 18px; margin: 0 0 10px; }
h3 { font-size: 14px; margin: 0 0 10px; font-weight: 600; }
.muted { color: var(--muted); }
.sm { font-size: 12px; }
.mono { font-family: ui-monospace, Menlo, monospace; font-size: 12px; color: var(--muted); }
.pre { white-space: pre-wrap; }
.neg { color: var(--danger); }
.pos { color: var(--ok); }
.nowrap { white-space: nowrap; }
code { background: var(--line-2); padding: 1px 5px; border-radius: 4px; }

/* Encabezado */
header.top { position: sticky; top: 0; z-index: 20; background: #fff; border-bottom: 1px solid var(--line); display: flex; align-items: center; gap: 18px; padding: 10px 22px; flex-wrap: wrap; }
.brand { display: flex; flex-direction: column; line-height: 1.2; }
.brand b { font-size: 15px; }
.brand span { font-size: 12px; color: var(--muted); }
nav.tabs { display: flex; gap: 2px; flex-wrap: wrap; }
nav.tabs a { padding: 7px 12px; border-radius: 8px; color: var(--muted); text-decoration: none; font-weight: 500; }
nav.tabs a:hover { background: var(--line-2); }
nav.tabs a.on { background: var(--accent-2); color: var(--accent); }
.persona { margin-left: auto; display: flex; align-items: center; gap: 8px; }
.bell { position: relative; text-decoration: none; font-size: 16px; margin-right: 10px; }
.bell b { position: absolute; top: -6px; right: -10px; background: var(--danger); color: #fff; font-size: 10px; border-radius: 10px; padding: 1px 5px; }
.banner { background: var(--warn-bg); color: var(--warn); border-bottom: 1px solid #fedf89; padding: 8px 22px; font-size: 13px; }

/* Controles */
select, input, textarea { font: inherit; border: 1px solid var(--line); border-radius: 8px; padding: 7px 10px; background: #fff; color: inherit; min-width: 0; }
input:focus, select:focus, textarea:focus { outline: 2px solid var(--accent-2); border-color: var(--accent); }
textarea { width: 100%; min-height: 72px; resize: vertical; }
input[type=color] { padding: 2px; width: 44px; height: 32px; }
input[type=checkbox] { width: 16px; height: 16px; accent-color: var(--accent); }
.btn { font: inherit; font-weight: 500; border: 1px solid var(--line); background: #fff; color: var(--text); border-radius: 8px; padding: 7px 14px; cursor: pointer; text-decoration: none; display: inline-flex; align-items: center; gap: 6px; }
.btn:hover { background: var(--line-2); }
.btn.primary { background: var(--accent); color: #fff; border-color: var(--accent); }
.btn.primary:hover { filter: brightness(1.08); }
.btn.danger { background: var(--danger); border-color: var(--danger); color: #fff; }
.btn.ghost { border-color: transparent; background: transparent; color: var(--muted); }
.btn.ghost:hover { color: var(--text); background: var(--line-2); }
.btn.sm { padding: 4px 10px; font-size: 12px; }
.btn:disabled { opacity: .6; cursor: default; }
.chk { display: inline-flex; align-items: center; gap: 6px; cursor: pointer; }
.row-gap { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; }

/* Layout */
main { max-width: 1260px; margin: 0 auto; padding: 22px; }
.card { background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); padding: 16px 18px; margin-bottom: 16px; }
.card.empty { text-align: center; padding: 40px 20px; }
.card-head { display: flex; justify-content: space-between; align-items: flex-start; gap: 12px; margin-bottom: 8px; }
.card-head h3 { margin: 0 0 2px; }
.page-head { display: flex; justify-content: space-between; align-items: flex-end; gap: 16px; margin-bottom: 16px; flex-wrap: wrap; }
.page-head p { margin: 0; }
.grid2 { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; }
.grid3 { display: grid; grid-template-columns: repeat(3, 1fr); gap: 16px; }
.grid2 > *, .grid3 > * { min-width: 0; }
.empty-s { padding: 8px 0; }
.callout { border-left: 4px solid var(--accent); }
.callout.warn, p.callout.warn { border-left: 4px solid var(--warn); background: var(--warn-bg); padding: 8px 12px; border-radius: 8px; }
.filters { display: flex; gap: 8px; flex-wrap: wrap; align-items: center; }
.filters #fq { flex: 1; min-width: 220px; }
.filters.inline { margin: 0; }
ul.plain { margin: 0; padding-left: 18px; }

/* KPIs */
.kpis { display: grid; grid-template-columns: repeat(auto-fit, minmax(160px, 1fr)); gap: 12px; margin-bottom: 16px; }
.kpis.small { grid-template-columns: repeat(auto-fit, minmax(120px, 1fr)); gap: 8px; margin: 10px 0; }
.kpi { background: #fff; border: 1px solid var(--line); border-radius: 10px; padding: 12px 14px; }
.kpi-l { font-size: 12px; color: var(--muted); }
.kpi-v { font-size: 22px; font-weight: 600; margin-top: 2px; font-variant-numeric: tabular-nums; }
.kpis.small .kpi-v { font-size: 16px; }
.kpi-s { font-size: 12px; color: var(--muted); }
.kpi.danger { border-color: #fecdca; background: var(--danger-bg); } .kpi.danger .kpi-v { color: var(--danger); }
.kpi.warn { border-color: #fedf89; background: var(--warn-bg); } .kpi.warn .kpi-v { color: var(--warn); }
.kpi.ok .kpi-v { color: var(--ok); }

/* Pills, chips, badges */
.pill { display: inline-block; font-size: 12px; font-weight: 500; padding: 2px 9px; border-radius: 20px; white-space: nowrap; }
.s-gray { background: #f2f4f7; color: #475467; } .s-blue { background: var(--info-bg); color: var(--info); }
.s-amber { background: var(--warn-bg); color: var(--warn); } .s-purple { background: var(--purple-bg); color: var(--purple); }
.s-green { background: var(--ok-bg); color: var(--ok); } .s-red { background: var(--danger-bg); color: var(--danger); }
.s-teal { background: var(--accent-2); color: var(--accent); } .s-dark { background: #344054; color: #fff; }
.chip { display: inline-flex; align-items: center; gap: 6px; font-size: 12px; white-space: nowrap; }
.chip i, .achip i { width: 9px; height: 9px; border-radius: 3px; display: inline-block; }
.badge { display: inline-block; font-size: 11px; font-weight: 600; padding: 1px 7px; border-radius: 6px; background: #f2f4f7; color: #475467; white-space: nowrap; }
.badge.danger { background: var(--danger-bg); color: var(--danger); } .badge.warn { background: var(--warn-bg); color: var(--warn); }
.badge.ok { background: var(--ok-bg); color: var(--ok); }
.tag { font-size: 12px; color: var(--muted); border: 1px solid var(--line); padding: 1px 8px; border-radius: 20px; }
.ver { font-family: ui-monospace, Menlo, monospace; font-size: 11px; background: #101828; color: #fff; padding: 1px 6px; border-radius: 5px; }
.seg { display: inline-flex; border: 1px solid var(--line); border-radius: 8px; overflow: hidden; }
.seg button { font: inherit; font-size: 12px; border: 0; background: #fff; padding: 4px 10px; cursor: pointer; color: var(--muted); }
.seg button.on { background: var(--accent-2); color: var(--accent); font-weight: 600; }

/* Tablas */
.tbl-wrap { overflow-x: auto; }
.tbl { width: 100%; border-collapse: collapse; }
.tbl th { text-align: left; font-size: 12px; font-weight: 500; color: var(--muted); border-bottom: 1px solid var(--line); padding: 8px; white-space: nowrap; }
.tbl td { border-bottom: 1px solid var(--line-2); padding: 9px 8px; vertical-align: top; }
.tbl td input:not([type=checkbox]):not([type=color]), .tbl td select { width: 100%; }
.tbl .num { text-align: right; font-variant-numeric: tabular-nums; white-space: nowrap; }
.tbl tr.clickable { cursor: pointer; } .tbl tr.clickable:hover td { background: #fafbfc; }
.tbl.compact td, .tbl.compact th { padding: 6px; }
.done-row td { color: var(--muted); } .done-row b { text-decoration: line-through; }
.sel-row td { background: var(--ok-bg); }
.grp-h { display: flex; align-items: center; gap: 10px; margin: 14px 0 4px; font-weight: 600; }
.grp-h:first-child { margin-top: 0; }

/* Alertas */
ul.alerts { list-style: none; margin: 0; padding: 0; }
.al { display: flex; gap: 10px; padding: 9px 10px; border-radius: 8px; cursor: pointer; align-items: flex-start; }
.al:hover { background: var(--line-2); }
.al .dot { width: 8px; height: 8px; border-radius: 50%; margin-top: 6px; flex: none; }
.al.danger .dot { background: var(--danger); } .al.warn .dot { background: #f79009; } .al.info .dot { background: #84adff; }
.al-t { font-weight: 500; } .al-s { font-size: 12px; color: var(--muted); }

/* Tarjetas de proyecto */
.pcards { display: grid; grid-template-columns: repeat(auto-fill, minmax(250px, 1fr)); gap: 12px; }
.pcard { border: 1px solid var(--line); border-radius: 10px; padding: 12px; cursor: pointer; display: flex; flex-direction: column; gap: 6px; }
.pcard:hover { border-color: var(--accent); }
.pcard-top { display: flex; justify-content: space-between; gap: 6px; }
.bar { height: 6px; background: var(--line-2); border-radius: 4px; overflow: hidden; }
.bar.big { height: 10px; margin: 8px 0 4px; }
.bar span { display: block; height: 100%; background: var(--accent); border-radius: 4px; }
.bar span.over { background: var(--danger); }

/* Áreas */
.area-chips { display: flex; gap: 6px; flex-wrap: wrap; margin-bottom: 16px; }
.achip { font: inherit; display: inline-flex; align-items: center; gap: 7px; border: 1px solid var(--line); background: #fff; border-radius: 20px; padding: 6px 12px; cursor: pointer; }
.achip.on { border-color: var(--accent); background: var(--accent-2); color: var(--accent); font-weight: 600; }
.people { display: flex; gap: 8px; flex-wrap: wrap; }
.person { border: 1px solid var(--line); border-radius: 8px; padding: 6px 10px; display: flex; flex-direction: column; }
.person small { color: var(--muted); font-size: 11px; }
.person.lead { border-color: var(--accent); background: var(--accent-2); }
.area-prog { display: flex; gap: 14px; flex-wrap: wrap; margin: 6px 0 10px; font-size: 12px; }

/* Proyecto */
.crumbs { font-size: 12px; color: var(--muted); margin-bottom: 8px; }
.phead { display: flex; justify-content: space-between; gap: 16px; flex-wrap: wrap; }
.phead-top { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; margin-bottom: 6px; }
.phead p { margin: 2px 0 0; }
.phead-act { display: flex; gap: 8px; align-items: flex-start; flex-wrap: wrap; }
.stepper { display: flex; gap: 4px; margin-bottom: 14px; overflow-x: auto; }
.step { flex: 1; min-width: 110px; display: flex; align-items: center; gap: 6px; font-size: 12px; color: var(--muted); padding: 8px 10px; background: #fff; border: 1px solid var(--line); border-radius: 8px; }
.step span { width: 20px; height: 20px; border-radius: 50%; background: var(--line-2); display: grid; place-items: center; font-size: 11px; font-weight: 600; }
.step.done { color: var(--ok); } .step.done span { background: var(--ok-bg); }
.step.cur { border-color: var(--accent); color: var(--accent); font-weight: 600; } .step.cur span { background: var(--accent); color: #fff; }
.step.cur.bad { border-color: var(--danger); color: var(--danger); } .step.cur.bad span { background: var(--danger); }
.ptabs { display: flex; gap: 2px; border-bottom: 1px solid var(--line); margin-bottom: 16px; overflow-x: auto; }
.ptabs button { font: inherit; border: 0; background: none; padding: 9px 14px; cursor: pointer; color: var(--muted); border-bottom: 2px solid transparent; white-space: nowrap; }
.ptabs button.on { color: var(--accent); border-bottom-color: var(--accent); font-weight: 600; }
dl.stats { display: grid; grid-template-columns: 1fr auto; gap: 6px 12px; margin: 0; }
dl.stats dt { color: var(--muted); } dl.stats dd { margin: 0; font-weight: 600; text-align: right; font-variant-numeric: tabular-nums; }
ul.check { list-style: none; padding: 0; margin: 0 0 12px; }
ul.check li { padding: 4px 0; } ul.check li.ok { color: var(--ok); } ul.check li.no { color: var(--warn); }

/* Votación */
.meter { margin: 10px 0 14px; }
.meter-l { font-weight: 600; margin-bottom: 4px; }
.meter-t { position: relative; height: 12px; background: var(--line-2); border-radius: 6px; margin-bottom: 4px; }
.meter-t span { display: block; height: 100%; background: var(--purple); border-radius: 6px; }
.meter-t i { position: absolute; top: -4px; bottom: -4px; width: 2px; background: #101828; }
.vote-row { display: flex; gap: 8px; margin: 8px 0 12px; flex-wrap: wrap; }
.btn.vote { flex: 1; justify-content: center; padding: 12px; font-weight: 600; }
.btn.vote.yes.on { background: var(--ok); color: #fff; border-color: var(--ok); }
.btn.vote.no.on { background: var(--danger); color: #fff; border-color: var(--danger); }
.btn.vote.abs.on { background: #475467; color: #fff; border-color: #475467; }

/* Control de cambios */
ol.timeline { list-style: none; margin: 0; padding: 0 0 0 14px; border-left: 2px solid var(--line); }
ol.timeline li { position: relative; padding: 0 0 18px 14px; }
ol.timeline li::before { content: ''; position: absolute; left: -21px; top: 4px; width: 12px; height: 12px; border-radius: 50%; background: #fff; border: 2px solid var(--accent); }
ol.timeline li.tl-estado::before { border-color: var(--purple); }
.tl-h { display: flex; gap: 6px; align-items: center; flex-wrap: wrap; }
.tl-r { margin: 6px 0; font-style: italic; color: #344054; }
.diff { margin-top: 6px; font-size: 13px; max-width: 900px; table-layout: fixed; }
.diff th:first-child { width: 190px; }
.diff td.from { color: var(--danger); text-decoration: line-through; text-decoration-color: rgba(217,45,32,.4); }
.diff td.to { color: var(--ok); }

/* Gráficos */
.vbars { display: flex; align-items: flex-end; gap: 8px; height: 220px; padding-top: 18px; }
.vb { flex: 1; display: flex; flex-direction: column; align-items: center; justify-content: flex-end; height: 100%; min-width: 0; }
.vb-bar { width: 70%; max-width: 46px; border-radius: 5px 5px 0 0; min-height: 0; }
.vb-n { font-size: 11px; font-weight: 600; margin-bottom: 3px; font-variant-numeric: tabular-nums; }
.vb-l { font-size: 11px; color: var(--muted); margin-top: 5px; border-top: 1px solid var(--line); width: 100%; text-align: center; padding-top: 4px; }
.hbars { display: flex; flex-direction: column; gap: 8px; }
.hb, .hb2 { display: grid; grid-template-columns: minmax(80px, 140px) 1fr auto; gap: 10px; align-items: center; font-size: 13px; }
.hb-l { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.hb-t, .hb2-t { background: var(--line-2); border-radius: 4px; height: 12px; }
.hb2-t { height: auto; background: none; display: flex; flex-direction: column; gap: 3px; }
.hb2-t .hb-bar { height: 9px; }
.hb-bar { height: 100%; border-radius: 4px; min-width: 2px; }
.hb-bar.light { opacity: .35; }
.hb-v { font-variant-numeric: tabular-nums; font-weight: 600; text-align: right; font-size: 12px; }
.legend { display: flex; gap: 14px; font-size: 12px; color: var(--muted); margin-top: 10px; flex-wrap: wrap; }
.legend span { display: inline-flex; align-items: center; gap: 5px; }
.lg { width: 12px; height: 8px; border-radius: 2px; display: inline-block; background: var(--accent); }
.lg.light { opacity: .35; }

/* Gantt */
.gantt { display: flex; flex-direction: column; gap: 5px; }
.g-row { display: grid; grid-template-columns: minmax(120px, 220px) 1fr; gap: 10px; align-items: center; }
.g-lab { font-size: 12px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; cursor: pointer; }
.g-lab:hover { color: var(--accent); }
.g-track { position: relative; height: 18px; background: var(--line-2); border-radius: 4px; }
.g-head .g-track { background: none; height: 18px; }
.g-tick { position: absolute; font-size: 10px; color: var(--muted); transform: translateX(-2px); border-left: 1px solid var(--line); padding-left: 3px; white-space: nowrap; }
.g-tick.today { color: var(--danger); font-weight: 600; border-color: var(--danger); top: -2px; transform: translateX(-50%); border: 0; }
.g-seg { position: absolute; top: 3px; bottom: 3px; border-radius: 3px; }
.g-vote, .lg.g-vote { background: var(--purple); }
.g-exec, .lg.g-exec { background: #12b76a; opacity: .75; }
.g-today { position: absolute; top: -3px; bottom: -3px; width: 2px; background: var(--danger); }

/* Formularios y modales */
.modal { position: fixed; inset: 0; background: rgba(16, 24, 40, .45); display: none; align-items: flex-start; justify-content: center; padding: 40px 16px; overflow-y: auto; z-index: 50; }
.modal.open { display: flex; }
.modal.layer2 { z-index: 60; background: rgba(16, 24, 40, .35); }
.modal-card { background: #fff; border-radius: 14px; padding: 22px; width: 100%; max-width: 760px; box-shadow: 0 20px 50px rgba(16, 24, 40, .25); }
.modal-card.small { max-width: 480px; }
.fgrid { display: grid; grid-template-columns: 1fr 1fr; gap: 12px 14px; margin: 10px 0; }
.fgrid label { display: flex; flex-direction: column; gap: 4px; font-size: 13px; font-weight: 500; }
.fgrid label small { font-weight: 400; }
.fgrid .full, form > label.full { grid-column: 1 / -1; display: flex; flex-direction: column; gap: 4px; font-size: 13px; font-weight: 500; }
.fgrid label.chk { flex-direction: row; font-weight: 400; }
fieldset { border: 1px solid var(--line); border-radius: 8px; padding: 10px 12px; }
legend { font-size: 13px; font-weight: 500; padding: 0 4px; }
.member-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(170px, 1fr)); gap: 10px; }
.member-grid > div { display: flex; flex-direction: column; gap: 4px; }
.reason textarea { border-color: #fedf89; background: #fffcf5; }
.factions { display: flex; justify-content: flex-end; gap: 8px; margin-top: 14px; }
.ferr { color: var(--danger); font-size: 13px; margin: 6px 0 0; min-height: 1em; }

#toast { position: fixed; bottom: 22px; left: 50%; transform: translateX(-50%) translateY(20px); background: #101828; color: #fff; padding: 10px 16px; border-radius: 10px; font-size: 13px; opacity: 0; pointer-events: none; transition: .2s; z-index: 80; max-width: 90vw; }
#toast.show { opacity: 1; transform: translateX(-50%); }
#toast.ok { background: var(--ok); } #toast.warn { background: var(--warn); } #toast.danger { background: var(--danger); }

@media (max-width: 900px) {
  .grid2, .grid3 { grid-template-columns: 1fr; }
  .fgrid { grid-template-columns: 1fr; }
  header.top { padding: 10px 14px; gap: 10px; }
  .persona { margin-left: 0; width: 100%; }
  .persona select { flex: 1; }
  main { padding: 14px; }
  .g-row { grid-template-columns: 110px 1fr; }
}

/* ---------- Usuarios, roles y sesión ---------- */
.avatar { --rc: #667085; width: 30px; height: 30px; border-radius: 50%; display: inline-grid; place-items: center; flex: none;
  background: color-mix(in srgb, var(--rc) 16%, #fff); color: var(--rc); font-weight: 700; font-size: 11px; border: 1.5px solid color-mix(in srgb, var(--rc) 45%, #fff); }
.avatar.lg { width: 44px; height: 44px; font-size: 15px; }
.rpill { --rc: #667085; display: inline-block; font-size: 11px; font-weight: 600; padding: 1px 8px; border-radius: 20px; white-space: nowrap;
  background: color-mix(in srgb, var(--rc) 12%, #fff); color: var(--rc); border: 1px solid color-mix(in srgb, var(--rc) 30%, #fff); }
th .rpill { --rc: inherit; }
.persona { position: relative; }
.usermenu-btn { font: inherit; display: flex; align-items: center; gap: 8px; background: none; border: 1px solid var(--line); border-radius: 30px; padding: 3px 10px 3px 3px; cursor: pointer; }
.usermenu-btn:hover { background: var(--line-2); }
.um-txt { display: flex; flex-direction: column; align-items: flex-start; line-height: 1.2; font-size: 13px; }
.caret { color: var(--muted); font-size: 11px; }
.usermenu { display: none; position: absolute; right: 0; top: calc(100% + 8px); background: #fff; border: 1px solid var(--line); border-radius: 12px; box-shadow: 0 12px 30px rgba(16,24,40,.15); width: 280px; padding: 8px; z-index: 40; }
.usermenu.open { display: block; }
.usermenu > button { display: block; width: 100%; text-align: left; font: inherit; background: none; border: 0; padding: 8px 10px; border-radius: 8px; cursor: pointer; }
.usermenu > button:hover { background: var(--line-2); }
.danger-t { color: var(--danger); }
.um-head { display: flex; gap: 10px; align-items: center; padding: 6px 6px 10px; border-bottom: 1px solid var(--line-2); margin-bottom: 6px; }
.ro-badge { font-size: 12px; color: var(--muted); border: 1px dashed var(--line); padding: 6px 10px; border-radius: 8px; }
.ucell { display: flex; gap: 10px; align-items: center; }
tr.inactive td { opacity: .55; }
.person.row { flex-direction: row; align-items: center; gap: 8px; }
.person.row > span:last-child { display: flex; flex-direction: column; }
.btn.block { width: 100%; justify-content: center; padding: 10px; }
.center { text-align: center; }

.role-strip { display: flex; gap: 8px; flex-wrap: wrap; margin-bottom: 16px; }
.role-card { --rc: #667085; font: inherit; display: flex; align-items: center; gap: 8px; border: 1px solid var(--line); background: #fff; border-radius: 10px; padding: 8px 14px; cursor: pointer; border-left: 4px solid var(--rc); }
.role-card b { font-size: 18px; color: var(--rc); }
.role-card.on { background: color-mix(in srgb, var(--rc) 10%, #fff); border-color: var(--rc); }
.role-cards { display: grid; grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); gap: 12px; margin-bottom: 16px; }
.rcard { --rc: #667085; background: #fff; border: 1px solid var(--line); border-top: 4px solid var(--rc); border-radius: 10px; padding: 12px 14px; display: flex; flex-direction: column; }
.rcard p { flex: 1; margin: 6px 0 8px; }
.rcard-h { display: flex; align-items: center; gap: 6px; }
.rdot { width: 10px; height: 10px; border-radius: 50%; background: var(--rc); }
.rcard-f { display: flex; justify-content: space-between; align-items: center; }

table.matrix { border-collapse: separate; border-spacing: 0; width: 100%; }
.matrix th { position: sticky; top: 0; background: #fff; padding: 10px 6px; border-bottom: 2px solid var(--line); text-align: center; font-weight: 500; vertical-align: bottom; min-width: 104px; }
.matrix th .rpill { font-size: 12px; }
.matrix th.perm-h { text-align: left; min-width: 280px; }
.matrix td { border-bottom: 1px solid var(--line-2); padding: 6px; }
.matrix .perm-l { font-size: 13px; }
.matrix .perm-l .mono { font-size: 10px; }
.matrix tr.mgroup td { background: var(--line-2); font-weight: 600; font-size: 12px; text-transform: uppercase; letter-spacing: .04em; color: #475467; padding: 6px 8px; }
.matrix tr:not(.mgroup):hover td { background: #fafbfc; }
.mcell { text-align: center; }
.mcell.on { background: color-mix(in srgb, var(--rc) 7%, #fff); }
.mchk { display: inline-grid; place-items: center; cursor: pointer; }
.mchk input { position: absolute; opacity: 0; pointer-events: none; }
.mchk span { width: 26px; height: 26px; border-radius: 7px; border: 1.5px solid var(--line); display: grid; place-items: center; font-weight: 700; color: #fff; transition: .12s; }
.mcell.on .mchk span { background: var(--rc); border-color: var(--rc); }
.mchk:hover span { border-color: var(--rc); }
.mchk.locked { cursor: not-allowed; opacity: .75; }
.mchk input:focus-visible + span { outline: 2px solid var(--rc); outline-offset: 2px; }

.perm-preview { display: grid; grid-template-columns: repeat(auto-fill, minmax(210px, 1fr)); gap: 10px; margin-top: 8px; padding: 10px; background: var(--line-2); border-radius: 8px; }
.pp { font-size: 12px; padding: 1px 0; }
.pp.on { color: var(--ok); }
.pp.off { color: #98a2b3; }

/* Ingreso */
body.is-login header.top { display: none; }
body.is-login { background: linear-gradient(135deg, #e6f4f3 0%, #f4f5f7 50%, #eef2ff 100%); min-height: 100vh; }
.login-wrap { display: flex; gap: 24px; justify-content: center; align-items: flex-start; flex-wrap: wrap; padding-top: 6vh; }
.login-card { background: #fff; border: 1px solid var(--line); border-radius: 16px; padding: 32px; width: 380px; max-width: 100%; box-shadow: 0 20px 50px rgba(16,24,40,.08); }
.login-card h1 { margin-top: 10px; }
.login-card form { display: flex; flex-direction: column; gap: 12px; margin: 20px 0 12px; }
.login-card label { display: flex; flex-direction: column; gap: 4px; font-size: 13px; font-weight: 500; }
.login-card input { padding: 10px 12px; }
.login-logo { width: 44px; height: 44px; border-radius: 12px; background: var(--accent); color: #fff; display: grid; place-items: center; font-size: 22px; }
.login-demo { background: rgba(255,255,255,.8); border: 1px solid var(--line); border-radius: 16px; padding: 22px; width: 520px; max-width: 100%; }
.demo-group { margin: 12px 0; }
.demo-users { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 6px; }
.demo-user { font: inherit; font-size: 13px; background: #fff; border: 1px solid var(--line); border-radius: 8px; padding: 6px 10px; cursor: pointer; display: flex; flex-direction: column; align-items: flex-start; }
.demo-user small { color: var(--muted); font-size: 11px; }
.demo-user:hover { border-color: var(--accent); background: var(--accent-2); }
@media (max-width: 900px) { .um-txt { display: none; } }

/* ================= Turismo ================= */
.tur-tabs { display: flex; gap: 6px; flex-wrap: wrap; margin: -6px 0 18px; }
.tur-tabs a { display: inline-flex; align-items: center; gap: 6px; padding: 8px 14px; border-radius: 10px; background: #fff; border: 1px solid var(--line); color: var(--text); text-decoration: none; font-weight: 500; white-space: nowrap; }
.tur-tabs a.on { background: #fff7ed; border-color: #d97706; color: #b45309; }
.tur-tabs a .badge { margin-left: 2px; }
.modal.wide .modal-card { max-width: 1180px; }
.fgrid.four { grid-template-columns: repeat(4, 1fr); }
.fgrid .span2 { grid-column: span 2; }
.plate { font-family: ui-monospace, Menlo, monospace; background: #fef9c3; border: 1px solid #eab308; padding: 0 6px; border-radius: 4px; letter-spacing: .05em; }
.badge.purple { background: var(--purple-bg); color: var(--purple); }
.mini-bar { display: inline-block; width: 60px; height: 6px; background: var(--line-2); border-radius: 3px; vertical-align: middle; overflow: hidden; margin-right: 6px; }
.mini-bar span { display: block; height: 100%; background: var(--ok); }
.clickable { cursor: pointer; }

/* Aforo */
.sector-card { border-top: 4px solid var(--sc); }
.gauge { margin: 6px 0 14px; }
.gauge-n b { font-size: 40px; font-weight: 700; color: var(--sc); font-variant-numeric: tabular-nums; }
.gauge-n span { color: var(--muted); margin-left: 6px; }
.gauge-t { height: 14px; background: var(--line-2); border-radius: 7px; overflow: hidden; margin-top: 4px; }
.gauge-t span { display: block; height: 100%; background: var(--sc, var(--accent)); border-radius: 7px; transition: width .3s; }
.gauge-t span.warm { background: #f79009; } .gauge-t span.hot { background: var(--danger); }
.slots { display: flex; gap: 6px; align-items: flex-end; height: 130px; margin-top: 6px; }
.slot { flex: 1; display: flex; flex-direction: column; align-items: center; height: 100%; min-width: 0; }
.slot-t { flex: 1; width: 100%; max-width: 38px; background: var(--line-2); border-radius: 6px; display: flex; align-items: flex-end; overflow: hidden; }
.slot-t span { width: 100%; background: var(--sc, var(--accent)); opacity: .85; }
.slot.closed .slot-t { background: repeating-linear-gradient(45deg, #fee4e2, #fee4e2 6px, #fff 6px, #fff 12px); }
.slot-h { font-size: 11px; color: var(--muted); margin-bottom: 3px; }
.slot-n { font-size: 11px; font-weight: 600; margin-top: 3px; font-variant-numeric: tabular-nums; }

/* Formulario de reserva */
.vtable input, .vtable select { width: 100%; min-width: 90px; padding: 6px 8px; }
.vtable td { vertical-align: middle; }
.vtable tr.blocked td { background: var(--danger-bg); }
.vwarn td { padding-top: 0 !important; border-bottom: 1px solid var(--line-2); }
.bf-total { display: flex; justify-content: space-between; align-items: center; gap: 10px; flex-wrap: wrap; background: var(--line-2); border-radius: 10px; padding: 10px 14px; margin-top: 10px; font-size: 15px; }
.bf-total b { font-size: 22px; }
.payform { display: flex; gap: 8px; flex-wrap: wrap; align-items: center; background: var(--ok-bg); padding: 10px; border-radius: 10px; margin-top: 8px; }
.payform .ferr { width: 100%; margin: 0; }
.check-list { display: flex; flex-direction: column; gap: 6px; margin: 10px 0; }

/* Tickets */
.tickets { display: grid; grid-template-columns: repeat(auto-fill, minmax(420px, 1fr)); gap: 12px; }
.ticket { display: flex; gap: 14px; align-items: center; border: 2px dashed #cbd5e1; border-radius: 14px; padding: 12px; background: #fff; text-align: left; break-inside: avoid; }
.ticket-body { display: flex; flex-direction: column; gap: 2px; min-width: 0; }
.ticket-name { font-size: 18px; }
.ticket-prod { font-weight: 600; color: var(--accent); margin-top: 4px; }
svg.qr { display: block; border-radius: 8px; }

/* Control QR (pensado para celular) */
.ctl-head { display: flex; gap: 14px; flex-wrap: wrap; align-items: stretch; margin-bottom: 14px; }
.ctl-sectors { display: flex; gap: 6px; flex-wrap: wrap; align-items: center; }
.ctl-gauge { flex: 1; min-width: 240px; background: #fff; border: 1px solid var(--line); border-left: 6px solid var(--sc); border-radius: 12px; padding: 10px 16px; }
.ctl-gauge b { font-size: 34px; color: var(--sc); } .ctl-gauge span { color: var(--muted); margin-left: 6px; }
.ctl-gauge small { color: var(--muted); }
.scan-card { text-align: center; }
.scan-btn { font-size: 20px; padding: 16px 30px; border-radius: 14px; width: 100%; max-width: 420px; justify-content: center; }
.scan-manual { display: flex; gap: 8px; max-width: 420px; margin: 12px auto; }
.scan-manual input { flex: 1; }
.scanner { position: relative; max-width: 420px; margin: 10px auto; }
.scanner video { width: 100%; border-radius: 14px; background: #000; }
.scan-frame { position: absolute; inset: 18% 18% 28% 18%; border: 4px solid #fff; border-radius: 18px; box-shadow: 0 0 0 9999px rgba(0,0,0,.25); pointer-events: none; }
.scan-res { text-align: left; border-radius: 14px; padding: 16px; margin-top: 12px; border: 2px solid var(--line); }
.scan-res.good { background: var(--ok-bg); border-color: #75e0a7; }
.scan-res.bad { background: var(--danger-bg); border-color: #fda29b; }
.scan-res.info { background: var(--info-bg); border-color: #b2ddff; }
.scan-title { font-size: 20px; font-weight: 700; margin-bottom: 10px; }
.scan-person { display: flex; flex-direction: column; gap: 4px; margin-bottom: 10px; }
.scan-person b { font-size: 22px; }
.scan-meta { display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 8px 14px; margin-bottom: 12px; }
.scan-meta small { display: block; color: var(--muted); font-size: 11px; text-transform: uppercase; letter-spacing: .03em; }
.scan-actions { display: flex; gap: 8px; flex-wrap: wrap; }
.btn.big { font-size: 18px; padding: 14px 22px; flex: 1; justify-content: center; }
ul.mov li { padding: 5px 0; border-bottom: 1px solid var(--line-2); }

/* Agenda */
.season-row { display: flex; gap: 10px; flex-wrap: wrap; }
.season { border: 1px solid var(--line); border-radius: 10px; padding: 10px 14px; display: flex; flex-direction: column; gap: 4px; min-width: 230px; }
.season.on { border-color: var(--accent); background: var(--accent-2); }
.notice.closing { border-left: 5px solid var(--danger); }
section.inactive { opacity: .6; }

/* Tesorería */
.caja.open { border-top: 4px solid var(--ok); }
.signs { display: flex; justify-content: space-around; margin-top: 60px; }
.signs div { border-top: 1px solid var(--text); width: 220px; text-align: center; padding-top: 6px; font-size: 13px; }
tr.sub td { padding-top: 0 !important; border-bottom: 0; }

@media (max-width: 900px) {
  .fgrid.four { grid-template-columns: 1fr 1fr; }
  .tickets { grid-template-columns: 1fr; }
  .tur-control .page-head { display: none; }
}

/* Impresión de tickets y comprobantes */
@media print {
  body.printing > *:not(#modal1) { display: none !important; }
  body.printing #modal1 { position: static; background: none; padding: 0; display: block; }
  body.printing .modal-card { box-shadow: none; max-width: none; padding: 0; }
  .no-print { display: none !important; }
  .tickets { grid-template-columns: 1fr 1fr; }
}

/* Datos y recuperación de contraseña */
.ds-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(330px, 1fr)); gap: 10px; }
.ds { border: 1px solid var(--line); border-radius: 10px; padding: 12px 14px; display: flex; flex-direction: column; justify-content: space-between; gap: 10px; }
.ds p { margin: 4px 0; }
.mail-preview { border: 1px solid var(--line); border-radius: 10px; padding: 12px; background: #fafbfc; }
.mail-preview pre { white-space: pre-wrap; font-family: inherit; margin: 10px 0 0; word-break: break-all; }
ul.pw-rules { list-style: none; padding: 0; margin: -4px 0 4px; font-size: 12px; color: var(--muted); }
.pw-rule::before { content: '○ '; } .pw-rule.ok { color: var(--ok); } .pw-rule.ok::before { content: '✓ '; }
.login-card h1 { font-size: 22px; }

/* Complementos de la visita (reserva interna y página pública) */
.extras-pick { margin: 10px 0; border: 1px solid var(--line); border-radius: 12px; padding: 10px 14px; background: #fcfcfd; }
.extras-pick summary { cursor: pointer; }
.extras-grid, .xgrid { display: grid; grid-template-columns: repeat(auto-fit, minmax(240px, 1fr)); gap: 14px; margin-top: 10px; }
.extras-grid h4, .xcat h4 { margin: 0 0 6px; }
.xrow { display: flex; align-items: center; justify-content: space-between; gap: 10px; padding: 6px 0; border-bottom: 1px dashed var(--line); font-size: 14px; flex-direction: row !important; }
.xrow span:first-child { display: flex; flex-direction: column; }
.xrow small { color: var(--muted); font-weight: 400; font-size: 12px; }
.xrow input { width: 64px; }
.qty { display: inline-flex; align-items: center; gap: 6px; } .qty b { min-width: 18px; text-align: center; }
.callout-soon { background: #eff6ff; border: 1px solid #bfdbfe; border-radius: 8px; padding: 6px 8px; margin: 0 0 6px; }
.xrow .badge { align-self: flex-start; }

/* ===== Organigrama ===== */
.org-wrap { overflow-x: auto; padding: 28px 18px; }
.org-tree { display: inline-block; min-width: 100%; text-align: center; }
.org-tree ul { display: flex; justify-content: center; padding-top: 22px; position: relative; margin: 0; padding-left: 0; list-style: none; }
.org-tree > ul { padding-top: 0; }
.org-tree li { position: relative; padding: 22px 8px 0; display: flex; flex-direction: column; align-items: center; }
.org-tree > ul > li { padding-top: 0; }
.org-tree li::before, .org-tree li::after { content: ''; position: absolute; top: 0; width: 50%; height: 22px; border-top: 2px solid #cbd5e1; }
.org-tree li::before { right: 50%; } .org-tree li::after { left: 50%; border-left: 2px solid #cbd5e1; }
.org-tree li:only-child::before, .org-tree li:only-child::after { display: none; }
.org-tree li:only-child { padding-top: 22px; }
.org-tree > ul > li:only-child { padding-top: 0; }
.org-tree li:first-child::before, .org-tree li:last-child::after { border: 0 none; }
.org-tree li:last-child::before { border-right: 2px solid #cbd5e1; border-radius: 0 6px 0 0; }
.org-tree li:first-child::after { border-radius: 6px 0 0 0; }
.org-tree ul ul::before { content: ''; position: absolute; top: 0; left: 50%; height: 22px; border-left: 2px solid #cbd5e1; }
.org-tree li:only-child > .org-node::before { content: ''; position: absolute; top: -22px; left: 50%; height: 22px; border-left: 2px solid #cbd5e1; }
.org-tree > ul > li:only-child > .org-node::before { display: none; }
.org-node { position: relative; background: #fff; border: 1px solid var(--line); border-top: 5px solid var(--oc); border-radius: 12px; padding: 10px 12px; min-width: 150px; max-width: 220px; text-align: left; box-shadow: 0 2px 6px rgba(16,24,40,.06); font-size: 13px; }
.org-node[data-act] { cursor: pointer; } .org-node[data-act]:hover { box-shadow: 0 4px 14px rgba(16,24,40,.14); }
.org-node.organo { background: color-mix(in srgb, var(--oc) 9%, #fff); min-width: 220px; }
.org-node.administracion { background: color-mix(in srgb, var(--oc) 6%, #fff); min-width: 190px; }
.org-head b { display: block; font-size: 14px; line-height: 1.25; }
.org-short { display: inline-block; font-size: 11px; font-weight: 700; color: var(--oc); text-transform: uppercase; letter-spacing: .03em; margin-bottom: 2px; }
.org-holders { margin-top: 6px; display: flex; flex-direction: column; gap: 3px; }
.org-holder { display: flex; flex-direction: column; } .org-holder span { font-size: 11px; color: var(--muted); } .org-holder b { font-weight: 600; font-size: 13px; }
.org-note { margin-top: 6px; font-size: 11.5px; color: var(--muted); }
.org-area { margin-top: 6px; font-size: 11.5px; color: var(--muted); display: flex; align-items: center; gap: 5px; } .org-area i { width: 8px; height: 8px; border-radius: 50%; }
.org-legend { display: flex; gap: 18px; margin-top: 8px; } .org-legend .lg { display: inline-block; width: 12px; height: 12px; border-radius: 3px; margin-right: 5px; vertical-align: -1px; border: 1px solid var(--line); }
.org-legend .lg.organo { background: #f2e9e4; } .org-legend .lg.administracion { background: #eef6fb; } .org-legend .lg.unidad { background: #fff; }
@media print {
  body.print-org header, body.print-org nav, body.print-org .org-tools, body.print-org #toast { display: none !important; }
  body.print-org .org-wrap { overflow: visible; border: 0; box-shadow: none; }
  body.print-org .org-node { box-shadow: none; }
  @page { size: landscape; margin: 10mm; }
}
.org-page { width: min(1560px, 96vw); position: relative; left: 50%; transform: translateX(-50%); }
.org-tree ul.stack { flex-direction: column; align-items: stretch; gap: 8px; padding-top: 22px; }
.org-tree ul.stack > li { padding: 0; }
.org-tree ul.stack > li::before, .org-tree ul.stack > li::after { display: none; }
.org-tree ul.stack > li > .org-node { max-width: none; width: 100%; min-width: 190px; padding: 7px 10px; }
.org-tree ul.stack > li > .org-node::before { display: none; }
.org-tree ul.stack .org-holders { flex-direction: row; gap: 6px; margin-top: 3px; }
.org-tree ul.stack .org-holder { flex-direction: row; gap: 4px; align-items: baseline; }
.org-tree ul.stack .org-note { margin-top: 2px; }
@media print { body.print-org .org-page { width: auto; left: 0; transform: none; } }
.org-shared { display: inline-grid; place-items: center; width: 18px; height: 18px; border-radius: 50%; background: #7c3aed; color: #fff; font-size: 11px; font-weight: 700; margin-left: 3px; vertical-align: 1px; }
.org-members { display: flex; flex-wrap: wrap; gap: 3px; margin-top: 6px; }
.org-mem { display: inline-grid; place-items: center; width: 24px; height: 24px; border-radius: 50%; background: #e2e8f0; color: #334155; font-size: 10px; font-weight: 700; }
.org-mem.shared { background: #7c3aed; color: #fff; box-shadow: 0 0 0 2px #ddd6fe; }
.org-mem.more { background: #f1f5f9; }
.org-bridge { display: grid; grid-template-columns: 180px 1fr 180px; gap: 12px; align-items: center; background: #fff; border: 1px solid var(--line); border-radius: 14px; padding: 12px 16px; margin-bottom: 14px; }
.ob-side { border-left: 5px solid var(--oc); padding: 8px 12px; border-radius: 8px; background: color-mix(in srgb, var(--oc) 8%, #fff); text-align: center; }
.ob-mid { text-align: center; display: flex; flex-direction: column; gap: 4px; }
.ob-arrow { font-size: 13px; font-weight: 600; padding: 4px 10px; border-radius: 999px; background: #f1f5f9; }
@media print { body.print-org .org-bridge { break-inside: avoid; } }

/* ===== Costos y financiamiento ===== */
.cbar { height: 8px; background: #e2e8f0; border-radius: 4px; overflow: hidden; margin: 6px 0 4px; }
.cbar i { display: block; height: 100%; border-radius: 4px; } .cbar i.ok { background: #16a34a; } .cbar i.warn { background: #f59e0b; } .cbar i.danger { background: #dc2626; }
.fund-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(320px, 1fr)); gap: 14px; }
.fund { cursor: pointer; } .fund:hover { box-shadow: 0 4px 14px rgba(16,24,40,.12); } .fund.cerrada { opacity: .6; }
.fund h3 { margin: 4px 0; }
.fund-nums { display: grid; grid-template-columns: repeat(4, 1fr); gap: 6px; margin: 10px 0 2px; }
.fund-nums div { display: flex; flex-direction: column; } .fund-nums b { font-size: 14px; } .fund-nums span { font-size: 11px; color: var(--muted); }
.chip { display: inline-block; background: #f1f5f9; border-radius: 999px; padding: 2px 8px; font-size: 12px; margin: 2px 2px 0 0; }
.fund-line { padding: 8px 10px; border: 1px solid var(--line); border-radius: 10px; margin: 6px 0; cursor: pointer; }
.hbars { display: flex; flex-direction: column; gap: 10px; }
.hb-row { display: grid; grid-template-columns: 170px 1fr 120px; gap: 10px; align-items: center; cursor: pointer; }
.hb-l { display: flex; flex-direction: column; } .hb-v { text-align: right; }
.hb-b { position: relative; height: 22px; }
.hb-fund { position: absolute; inset: 0 auto 0 0; border: 2px dashed #94a3b8; border-radius: 6px; }
.hb-stack { position: absolute; top: 4px; bottom: 4px; left: 2px; right: 0; display: flex; } .hb-stack i { display: block; height: 100%; }
.hb-stack i:first-child { border-radius: 4px 0 0 4px; }
.donut-row { display: flex; gap: 16px; align-items: center; } .donut { width: 150px; height: 150px; transform: rotate(-90deg); flex: none; }
.legend { list-style: none; padding: 0; margin: 0; display: flex; flex-direction: column; gap: 5px; font-size: 13px; flex: 1; }
.legend li { display: grid; grid-template-columns: 12px 1fr auto 40px; gap: 6px; align-items: center; } .legend i { width: 10px; height: 10px; border-radius: 3px; }
.legend b { text-align: right; } .legend span { text-align: right; }
.vbars { display: flex; gap: 10px; align-items: flex-end; height: 170px; padding-top: 10px; }
.vb { flex: 1; display: flex; flex-direction: column; align-items: center; justify-content: flex-end; gap: 4px; } .vb i { width: 70%; background: #0ea5e9; border-radius: 6px 6px 0 0; min-height: 2px; }

/* ===== Abastecimiento, licitaciones, ejecución y RR.HH. ===== */
.pill.ok { background: var(--ok-bg); color: var(--ok); } .pill.warn { background: var(--warn-bg); color: var(--warn); }
.pill.danger { background: var(--danger-bg); color: var(--danger); } .pill.info { background: #eff8ff; color: #175cd3; } .pill.muted { background: #f2f4f7; color: #667085; }
.tbl tr.click { cursor: pointer; } .tbl tr.click:hover td { background: #fafbfc; } li.click { cursor: pointer; } li.click:hover { color: var(--accent); }
.tbl tr.muted td { opacity: .55; }
.t-ok { color: var(--ok); } .t-warn { color: var(--warn); } .t-danger { color: var(--danger); font-weight: 600; }
ul.timeline { list-style: none; margin: 0; padding: 0 0 0 12px; border-left: 2px solid var(--line); }
ul.timeline li { padding: 0 0 10px 10px; position: relative; }
ul.timeline li::before { content: ''; position: absolute; left: -18px; top: 6px; width: 8px; height: 8px; border-radius: 50%; background: var(--accent); }
.tbl.items input, .tbl.items select { width: 100%; min-width: 0; padding: 6px 8px; }
.tbl.items td { padding: 4px; vertical-align: middle; }
.pbar2 { position: relative; height: 10px; background: #e2e8f0; border-radius: 5px; margin: 6px 0 2px; }
.pbar2 i { position: absolute; inset: 0 auto 0 0; border-radius: 5px; background: #0ea5e9; } .pbar2 i.ok { background: #16a34a; } .pbar2 i.warn { background: #f59e0b; } .pbar2 i.danger { background: #dc2626; }
.pbar2 b { position: absolute; top: -3px; bottom: -3px; width: 2px; background: #0f172a; border-radius: 1px; }
.pbar2 b[style="left:0%"] { display: none; }
.cbar.stack { display: flex; } .cbar.stack i { border-radius: 0; } .cbar i.comm { background: repeating-linear-gradient(45deg, #fbbf24, #fbbf24 4px, #fde68a 4px, #fde68a 8px); }
.hb { margin: 6px 0; } .hb .cbar { margin: 0; }
.al.ok { background: var(--ok-bg); cursor: default; } .al.ok, .al.danger, .al.warn { padding: 10px 12px; }
p.al { display: block; }
.qa { border-top: 1px solid var(--line); padding: 8px 0; font-size: 14px; }
.fund.closed { opacity: .6; }
details summary { cursor: pointer; margin: 10px 0; }

/* ===== Ingresos: mapa de flujos ===== */
.sankey { width: 100%; height: auto; overflow: visible; margin: 6px 0 22px; }
.sankey path:hover { fill-opacity: .5; }
.sk-t { font-size: 12px; font-weight: 600; fill: #1d2939; } .sk-s { font-weight: 400; fill: #667085; font-size: 11px; } .sk-h { font-size: 10px; letter-spacing: .08em; fill: #98a2b3; font-weight: 600; }
.ie-chart { display: grid; grid-template-columns: repeat(12, 1fr); gap: 6px; height: 170px; align-items: end; margin: 8px 0; }
.ie-col { display: flex; flex-direction: column; height: 100%; align-items: center; gap: 4px; } .ie-col span { font-size: 11px; color: var(--muted); }
.ie-bars { flex: 1; display: flex; align-items: flex-end; gap: 2px; width: 100%; justify-content: center; }
.ie-bars i { width: 42%; border-radius: 3px 3px 0 0; min-height: 1px; } .ie-bars i.in, .lg.in { background: #16a34a; } .ie-bars i.out, .lg.out { background: #f97316; }
.lg { display: inline-block; width: 10px; height: 10px; border-radius: 2px; margin: 0 4px 0 10px; vertical-align: -1px; }
.dotc { display: inline-block; width: 9px; height: 9px; border-radius: 50%; margin-right: 6px; }

/* ===== Menú por módulos ===== */
.navg { position: relative; }
.navg-b { background: none; border: 0; font: inherit; padding: 7px 12px; border-radius: 8px; color: var(--muted); font-weight: 500; cursor: pointer; }
.navg-b:hover, .navg:hover .navg-b { background: var(--line-2); } .navg-b.on { background: var(--accent-2); color: var(--accent); }
.navg-m { display: none; position: absolute; top: 100%; left: 0; z-index: 60; background: #fff; border: 1px solid var(--line); border-radius: 10px; box-shadow: 0 12px 30px rgba(16,24,40,.14); padding: 6px; min-width: 210px; }
.navg:hover .navg-m, .navg:focus-within .navg-m { display: flex; flex-direction: column; }
.navg-m a { white-space: nowrap; }
.nbadge { background: var(--danger); color: #fff; border-radius: 10px; font-size: 10px; padding: 1px 6px; margin-left: 3px; vertical-align: 1px; }

/* ===== Notificaciones ===== */
.bellwrap { position: relative; }
button.bell { background: none; border: 0; cursor: pointer; padding: 6px; }
.notif-panel { display: none; position: absolute; right: 0; top: 120%; width: 380px; max-width: 92vw; background: #fff; border: 1px solid var(--line); border-radius: 12px; box-shadow: 0 16px 40px rgba(16,24,40,.18); z-index: 80; }
.notif-panel.open { display: block; }
.np-head { display: flex; justify-content: space-between; align-items: center; padding: 12px 14px; border-bottom: 1px solid var(--line); }
.linkbtn { background: none; border: 0; color: var(--accent); cursor: pointer; font-size: 12px; }
.np-list { max-height: 420px; overflow: auto; } .np-list.full { max-height: none; }
.np-item { display: flex; gap: 10px; align-items: flex-start; width: 100%; text-align: left; background: none; border: 0; border-bottom: 1px solid var(--line-2); padding: 10px 14px; cursor: pointer; font: inherit; }
.np-item:hover { background: #f9fafb; } .np-item.unread { background: #f0f9ff; } .np-item.resolved { opacity: .55; }
.np-item span { display: flex; flex-direction: column; gap: 2px; } .np-item small { color: var(--muted); } .np-item i { font-style: normal; font-size: 11px; color: #98a2b3; }
.np-foot { display: block; text-align: center; padding: 10px; font-size: 13px; color: var(--accent); text-decoration: none; }
.sem { display: inline-block; width: 11px; height: 11px; border-radius: 50%; flex: none; margin: 4px 6px 0 0; vertical-align: -1px; box-shadow: inset 0 0 0 1px rgba(0,0,0,.08); }
.sem.ok { background: #16a34a; } .sem.warn { background: #f59e0b; } .sem.danger { background: #dc2626; }
.tasks { display: grid; gap: 6px; }
.task { display: flex; justify-content: space-between; gap: 10px; padding: 10px 12px; border-radius: 10px; border-left: 4px solid #16a34a; background: #f9fafb; color: inherit; text-decoration: none; }
.task.warn { border-color: #f59e0b; background: #fffbeb; } .task.danger { border-color: #dc2626; background: #fef2f2; }
.task:hover { filter: brightness(.98); } .task span { display: flex; flex-direction: column; } .task small { color: var(--muted); } .task em { font-style: normal; font-size: 12px; color: var(--muted); white-space: nowrap; }
.radio-cards { display: grid; grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); gap: 10px; margin-top: 10px; }
.rcard { border: 1px solid var(--line); border-radius: 12px; padding: 12px; cursor: pointer; display: flex; flex-direction: column; gap: 4px; }
.rcard.on { border-color: var(--accent); box-shadow: 0 0 0 2px var(--accent-2); } .rcard input { display: none; } .rcard small { color: var(--muted); }
pre.code { background: #0f172a; color: #e2e8f0; padding: 12px; border-radius: 8px; font-size: 12px; overflow: auto; }
.sem-kpis button.kpi { text-align: left; cursor: pointer; font: inherit; } .sem-kpis .kpi.sel { outline: 2px solid var(--accent); }
.sem-tbl td { vertical-align: top; } .sem-tbl td .sm { color: #475467; }
.card.focus { border-left: 4px solid #dc2626; }


/* ===== Por decidir (Directiva) ===== */
.pulse { display: flex; gap: 8px; flex-wrap: wrap; margin: 0 0 14px; text-decoration: none; color: var(--text); }
.pulse span { background: #fff; border: 1px solid var(--line); border-radius: 999px; padding: 6px 12px; font-size: 13px; }
.pulse b { font-variant-numeric: tabular-nums; }
.chips-row { display: flex; gap: 6px; overflow-x: auto; margin-bottom: 12px; padding-bottom: 2px; }
.chipf { border: 1px solid var(--line); background: #fff; border-radius: 999px; padding: 6px 12px; font: inherit; font-size: 13px; cursor: pointer; white-space: nowrap; }
.chipf.on { background: var(--text); color: #fff; border-color: var(--text); }
.decisions { display: grid; grid-template-columns: repeat(auto-fill, minmax(340px, 1fr)); gap: 14px; align-items: start; }
.dcard { background: #fff; border: 1px solid var(--line); border-radius: 14px; padding: 16px 16px 14px; position: relative; overflow: hidden; }
.dcard::before { content: ''; position: absolute; inset: 0 auto 0 0; width: 5px; background: #16a34a; }
.dcard.warn::before { background: #f59e0b; } .dcard.danger::before { background: #dc2626; }
.dc-top { display: flex; justify-content: space-between; align-items: baseline; gap: 10px; }
.dc-kind { font-size: 12px; color: var(--muted); font-weight: 600; }
.dc-amt { font-size: 20px; font-weight: 700; } .dc-amt small { font-size: 11px; font-weight: 400; color: var(--muted); }
.dcard h2 { font-size: 16px; margin: 6px 0 4px; line-height: 1.3; } .dcard h2 a { color: inherit; }
.dc-meta { font-size: 12.5px; color: var(--muted); margin: 0 0 8px; }
.dc-note { font-size: 13px; margin: 0 0 12px; padding: 8px 10px; background: var(--line-2); border-radius: 8px; }
.dc-actions { display: flex; gap: 8px; flex-wrap: wrap; }
.dc-actions .btn { min-height: 44px; flex: 1 1 auto; }
.dc-actions .btn[disabled] { opacity: .45; cursor: not-allowed; }

/* ===== Navegación móvil ===== */
.mnav { display: none; }
#more:empty { display: none; }
@media (max-width: 820px) {
  body { font-size: 15px; }
  header.top { padding: 8px 12px; gap: 8px; flex-wrap: nowrap; }
  header.top nav.tabs { display: none; }
  .brand span { display: none; } .brand b { font-size: 14px; max-width: 46vw; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
  .persona { width: auto; margin-left: auto; }
  body.has-mnav main { padding-bottom: calc(84px + env(safe-area-inset-bottom)); }
  .mnav { display: grid; grid-template-columns: repeat(5, 1fr); position: fixed; left: 0; right: 0; bottom: 0; z-index: 40; background: #fff; border-top: 1px solid var(--line);
    padding: 4px 4px calc(4px + env(safe-area-inset-bottom)); box-shadow: 0 -6px 20px rgba(16,24,40,.06); }
  .mnav a, .mnav button { position: relative; display: flex; flex-direction: column; align-items: center; gap: 1px; padding: 6px 2px; min-height: 52px; justify-content: center;
    font: inherit; font-size: 11px; color: var(--muted); text-decoration: none; background: none; border: 0; border-radius: 10px; cursor: pointer; }
  .mnav i { font-style: normal; font-size: 19px; line-height: 1; }
  .mnav .on { color: var(--accent); background: var(--accent-2); font-weight: 600; }
  .mnav b { position: absolute; top: 3px; left: 54%; background: var(--danger); color: #fff; font-size: 10px; border-radius: 10px; padding: 0 5px; min-width: 16px; text-align: center; }
  .sheet-back { position: fixed; inset: 0; background: rgba(16,24,40,.4); z-index: 41; }
  .sheet { position: fixed; left: 0; right: 0; bottom: 0; z-index: 42; background: #fff; border-radius: 18px 18px 0 0; max-height: 78vh; overflow-y: auto;
    padding: 8px 16px calc(84px + env(safe-area-inset-bottom)); display: grid; gap: 12px; }
  .sheet-grip { width: 40px; height: 4px; border-radius: 2px; background: var(--line); margin: 4px auto 0; }
  .sheet-g h4 { margin: 4px 0 4px; font-size: 12px; color: var(--muted); font-weight: 600; }
  .sheet-g a { display: flex; align-items: center; gap: 6px; padding: 11px 10px; border-radius: 10px; text-decoration: none; color: var(--text); font-size: 15px; }
  .sheet-g a.on { background: var(--accent-2); color: var(--accent); font-weight: 600; }

  main { padding: 12px; }
  h1 { font-size: 20px; }
  .page-head { align-items: flex-start; }
  .page-head > .row-gap, .page-head > div:last-child:not(:first-child) { width: 100%; }
  .page-head .btn { flex: 1 1 auto; justify-content: center; }
  .kpis { grid-template-columns: 1fr 1fr; gap: 8px; } .kpis .kpi-v { font-size: 18px; word-break: break-word; }
  .filters > * { flex: 1 1 100%; min-width: 0; }
  .filters select, .filters input { width: 100%; }
  .btn { min-height: 40px; }
  .decisions { grid-template-columns: 1fr; }
  .grid2.ctl > div:last-child { order: -1; }

  /* Tablas → tarjetas */
  .tbl:not(.nohead) thead { display: none; }
  .tbl:not(.nohead), .tbl:not(.nohead) tbody, .tbl:not(.nohead) tr, .tbl:not(.nohead) td { display: block; width: 100%; }
  .tbl:not(.nohead) tr { border: 1px solid var(--line); border-radius: 12px; padding: 8px 12px; margin-bottom: 8px; background: #fff; }
  .tbl:not(.nohead) td { border: 0 !important; padding: 3px 0 !important; text-align: left !important; display: grid; grid-template-columns: minmax(84px, 34%) 1fr; gap: 10px; align-items: baseline; }
  .tbl:not(.nohead) td[data-label]::before { content: attr(data-label); color: var(--muted); font-size: 12px; }
  .tbl:not(.nohead) td[data-label=""], .tbl:not(.nohead) td:not([data-label]) { display: block; }
  .tbl:not(.nohead) td[data-label=""]::before, .tbl:not(.nohead) td:not([data-label])::before { content: none; }
  .tbl:not(.nohead) td:empty { display: none; }
  .tbl:not(.nohead) td:first-child { font-size: 15px; }
  .tbl:not(.nohead) td:first-child::before { content: none; }
  .tbl:not(.nohead) td:first-child, .tbl:not(.nohead) td:first-child > * { text-align: left; display: block; }
  .card .tbl:not(.nohead) tr { box-shadow: none; }
  .card:has(> .tbl) { background: transparent; border: 0; padding: 0; box-shadow: none; }
  .tbl.items td, .tbl.items tr { display: block; } .tbl.items td::before { content: none !important; }

  /* Ventanas → hojas desde abajo */
  .modal { align-items: flex-end; padding: 0; }
  .modal-card, .modal.wide .modal-card, .modal-card.small { max-width: none; width: 100%; border-radius: 18px 18px 0 0; max-height: 94vh; overflow-y: auto; padding: 18px 14px calc(18px + env(safe-area-inset-bottom)); }
  .factions { position: sticky; bottom: calc(-18px - env(safe-area-inset-bottom)); background: #fff; padding: 10px 0; margin-bottom: -10px; flex-wrap: wrap; }
  .factions .btn { flex: 1 1 auto; }
  .card-head { flex-wrap: wrap; }

  .notif-panel { position: fixed; left: 8px; right: 8px; top: 56px; width: auto; }
  svg.sankey { min-width: 820px; } section.card:has(svg.sankey) { overflow-x: auto; }
  .navg-m { position: static; box-shadow: none; }
  .ie-chart { height: 130px; } .ie-col span { font-size: 9px; }
  .pbar2 { margin-top: 2px; }
  .sem-tbl tr { display: grid !important; grid-template-columns: 22px 1fr; }
  .sem-tbl td:first-child { grid-row: span 1; }
  .sem-tbl td:nth-child(2) { display: block !important; font-size: 15px; } .sem-tbl td:nth-child(2)::before { content: none !important; }
  .sem-tbl td:nth-child(n+3) { grid-column: 1 / -1; }
}
@media (min-width: 821px) { #more { display: none; } }

/* ===== Zonas de espera (transición) ===== */
.ctl-gauge.wait { --sc: #b45309; border-left-color: #d6d3d1; }
.ctl-gauge.wait.on { border-left-color: #f59e0b; background: #fffbeb; }
.scan-res.wait { background: #fffbeb; border-color: #fcd34d; }
.scan-wait { font-size: 15px; margin: 4px 0 10px; }
.wait-card { border-left: 5px solid #f59e0b; }
.wait-groups { display: grid; gap: 6px; }
.wg { display: grid; grid-template-columns: 30px 1fr auto; gap: 10px; align-items: center; padding: 8px 10px; background: #fffbeb; border-radius: 10px; }
.wg-n { width: 26px; height: 26px; border-radius: 50%; background: #f59e0b; color: #fff; display: grid; place-items: center; font-weight: 700; font-size: 13px; }
.agenda { margin-top: 10px; } .agenda summary { margin: 6px 0; }
.tbl tr.warnrow td { background: #fffbeb; }
@media (max-width: 820px) { .wg { grid-template-columns: 30px 1fr; } .wg .btn { grid-column: 1 / -1; } }

/* ===== Check-in en caja ===== */
.ci-people tr.hl td { background: #eff8ff; }
.ci-actions { display: flex; gap: 10px; align-items: flex-end; flex-wrap: wrap; margin-top: 12px; }
.ci-actions label { display: flex; flex-direction: column; font-size: 12px; color: var(--muted); }
.scan-res.info { background: #eff8ff; border-color: #b2ddff; }
.mcell.blocked { background: repeating-linear-gradient(135deg, #f8fafc, #f8fafc 6px, #f1f5f9 6px, #f1f5f9 12px); }
.mcell.blocked span { opacity: .45; font-size: 11px; }
.area-only { color: #b54708; margin-top: 2px; }

/* ===== Bitácora y documentos del proyecto ===== */
ol.blog { list-style: none; margin: 10px 0 0; padding: 0; display: grid; gap: 10px; }
.blog-i { border: 1px solid var(--line); border-left: 4px solid #94a3b8; border-radius: 12px; padding: 10px 14px; background: #fff; }
.blog-i.k-aporte { border-left-color: #0ea5e9; } .blog-i.k-acta { border-left-color: #7c3aed; } .blog-i.k-cotizacion { border-left-color: #16a34a; } .blog-i.k-informe { border-left-color: #f59e0b; }
.blog-h { display: flex; gap: 8px; align-items: baseline; flex-wrap: wrap; } .blog-h .linkbtn { margin-left: auto; }
.blog-k { font-size: 12px; font-weight: 600; color: var(--muted); }
.blog-i p { margin: 6px 0; }
.fchips { display: flex; gap: 6px; flex-wrap: wrap; margin-top: 6px; }
a.fchip { display: inline-flex; gap: 4px; align-items: center; border: 1px solid var(--line); border-radius: 8px; padding: 4px 8px; text-decoration: none; color: var(--text); background: #f9fafb; font-size: 13px; }
a.fchip:hover { border-color: var(--accent); } a.fchip small { color: var(--muted); }

/* ===== Contabilidad y liquidaciones ===== */
.tbl.journal tr.jhead td { background: var(--bg-soft, #f6f7f9); border-top: 2px solid var(--line, #e4e7ec); }
.tbl tr.tot td { border-top: 2px solid var(--ink, #101828); }
.tbl th.c { text-align: center; }
.pill.info { background: #e0f2fe; color: #075985; }
.liq { font-size: 14px; }
.liq-head { display: flex; justify-content: space-between; gap: 16px; border-bottom: 2px solid var(--ink, #101828); padding-bottom: 8px; margin-bottom: 10px; }
.liq-cols { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; }
.liq-cols h3 { margin: 12px 0 4px; font-size: 14px; }
.liq-total { text-align: right; font-size: 18px; margin: 12px 0; padding: 10px; border: 2px solid var(--ink, #101828); border-radius: 8px; }
.liq-sign { display: grid; grid-template-columns: 1fr 1fr; gap: 40px; margin-top: 56px; text-align: center; }
.liq-sign div { border-top: 1px solid var(--ink, #101828); padding-top: 6px; font-size: 12px; }
@media (max-width: 700px) { .liq-cols { grid-template-columns: 1fr; } }
@media print {
  body.print-modal > *:not(#modal1) { display: none !important; }
  body.print-modal #modal1 { position: static !important; background: none !important; display: block !important; }
  body.print-modal #modal1 > * { box-shadow: none !important; max-width: none !important; width: 100% !important; max-height: none !important; overflow: visible !important; }
  body.print-modal .noprint, body.print-modal .factions { display: none !important; }
}
