/* ==========================================================================
   SIGAP Vijes - modules.css
   Styles of specific screens: welcome, dashboard, alerts, map, attention
   cards, finance matrix, scenarios, kanban, calendar, reports center and
   configuration.
   ========================================================================== */

.btn-row { display: flex; gap: 8px; flex-wrap: wrap; align-items: center; margin-top: 10px; }
.btn-row-end { justify-content: flex-end; margin-top: 14px; }
.txt-rojo { color: var(--rojo) !important; font-weight: 600; }
.txt-verde { color: var(--verde); font-weight: 600; }
.list-summary { display: flex; gap: 24px; flex-wrap: wrap; padding: 10px 14px; background: var(--primary-50); border-bottom: 1px solid var(--line-2); font-size: 13.5px; }
.nov-list { list-style: disc; padding-left: 20px; display: flex; flex-direction: column; gap: 6px; }
.doc-preview { margin-top: 12px; max-width: 320px; border-radius: 6px; overflow: hidden; border: 1px solid var(--line); }

/* ------------------------------ Boot ------------------------------------ */
.boot { height: 100%; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 14px; background: var(--navy); color: #dbe6f1; text-align: center; padding: 20px; }
.boot-name { font-family: var(--font-head); font-size: 30px; font-weight: 600; color: #fff; }
.boot .spinner { border-color: rgba(255, 255, 255, .25); border-top-color: var(--amber); width: 24px; height: 24px; }
.boot-error { max-width: 560px; background: #fff; color: var(--ink); border-radius: 8px; padding: 18px 20px; text-align: left; }

/* ----------------------------- Welcome ---------------------------------- */
.welcome { display: grid; grid-template-columns: minmax(0, 1.15fr) minmax(420px, 1fr); min-height: 100%; background: #fff; }
.welcome-art { position: relative; background: #0b1a2c; color: #fff; padding: 44px 52px 0; display: flex; flex-direction: column; overflow: hidden; }
.welcome-brand { display: flex; align-items: center; gap: 14px; position: relative; z-index: 1; }
.welcome-logo { width: 54px; height: 54px; object-fit: contain; background: #fff; border-radius: 10px; padding: 3px; }
.welcome-name { font-family: var(--font-head); font-size: 30px; font-weight: 600; line-height: 1.1; }
.welcome-muni { color: #a9bdd2; font-size: 13.5px; }
.welcome-full { font-family: var(--font-head); font-size: clamp(30px, 3.4vw, 46px); font-weight: 600; line-height: 1.12; margin-top: 54px; max-width: 16ch; letter-spacing: .2px; position: relative; z-index: 1; }
.welcome-sub { color: #c3d2e2; font-size: 16px; margin-top: 16px; max-width: 46ch; position: relative; z-index: 1; }
.welcome-scene { position: absolute; left: 0; right: 0; bottom: 0; width: 100%; height: 58%; display: block; }
.welcome-side { display: flex; flex-direction: column; justify-content: center; padding: 40px clamp(28px, 5vw, 76px); }
.welcome-panel { width: 100%; max-width: 480px; margin: 0 auto; }
.welcome-title { font-family: var(--font-head); font-size: 28px; font-weight: 600; line-height: 1.2; }
.welcome-desc { color: var(--ink-2); margin: 10px 0 22px; font-size: 14.5px; line-height: 1.5; }
.welcome-opts { display: flex; flex-direction: column; gap: 10px; margin-bottom: 20px; }
.welcome-opt { display: flex; align-items: center; gap: 14px; text-align: left; padding: 14px 16px; border: 1px solid var(--line); border-radius: 9px; background: #fff; cursor: pointer; }
.welcome-opt:hover { border-color: var(--primary); background: var(--primary-50); }
.welcome-opt.is-primary { background: var(--primary); border-color: var(--primary); color: #fff; }
.welcome-opt.is-primary:hover { background: var(--primary-600); }
.welcome-opt-icon { width: 42px; height: 42px; border-radius: 8px; background: var(--primary-50); color: var(--primary); display: flex; align-items: center; justify-content: center; flex: none; }
.welcome-opt.is-primary .welcome-opt-icon { background: rgba(255, 255, 255, .16); color: #fff; }
.welcome-opt-text { flex: 1; display: flex; flex-direction: column; gap: 2px; }
.welcome-opt-text strong { font-size: 15.5px; }
.welcome-opt-text span { font-size: 13px; color: var(--muted); }
.welcome-opt.is-primary .welcome-opt-text span { color: #d5e3f1; }
.welcome-form { display: flex; flex-direction: column; gap: 14px; margin-bottom: 18px; }
.welcome-form .input { height: 42px; font-size: 15px; }
.welcome-back { display: inline-flex; align-items: center; gap: 5px; background: none; border: 0; color: var(--primary); font-weight: 600; cursor: pointer; padding: 0; margin-bottom: 14px; }
.welcome-links { display: flex; flex-direction: column; gap: 8px; font-size: 13px; }
.welcome-foot { max-width: 480px; margin: 26px auto 0; width: 100%; font-size: 12px; color: var(--muted); }
.btn-lg.btn-block { margin-top: 4px; }

/* ---------------------------- Dashboard ---------------------------------
   Reading order: the luminaire park and what needs attention first, then one
   panel per subject, then the trends that have something to show.          */
.dash-top { display: grid; grid-template-columns: minmax(0, 1fr); gap: 18px; }
.dash-top > .card { margin-top: 0; display: flex; flex-direction: column; }
@media (min-width: 1500px) {
  .dash-top { grid-template-columns: minmax(0, 1fr) minmax(380px, 30%); align-items: stretch; }
  .dash-top.is-single { grid-template-columns: minmax(0, 1fr); }
}

.hero-body { display: flex; align-items: center; gap: 16px 48px; flex-wrap: wrap; padding: 18px 20px 22px; flex: 1; }
.hero-figure { display: flex; flex-wrap: wrap; align-items: baseline; gap: 2px 9px; text-decoration: none; color: var(--ink); flex: none; max-width: 100%; }
.hero-value { font-family: var(--font-head); font-size: 52px; font-weight: 600; line-height: 1; letter-spacing: .2px; font-variant-numeric: tabular-nums; }
.hero-unit { font-family: var(--font-head); font-size: 19px; font-weight: 600; color: var(--ink-2); }
.hero-sub { flex-basis: 100%; font-size: 13px; color: var(--muted); margin-top: 6px; }
a.hero-figure:hover .hero-value { color: var(--primary); }
.hero-mix { flex: 1 1 340px; min-width: 0; }
.hero-mix-title { font-size: 12.5px; font-weight: 600; color: var(--muted); margin-bottom: 8px; }
.hero > .grid-kpi { margin-top: auto; }

/* Composition bar (CH.stack) */
.stack-bar { display: flex; gap: 2px; height: 14px; border-radius: 4px; overflow: hidden; }
.stack-seg { flex: 1 1 0; min-width: 4px; }
.stack-seg.is-clickable { cursor: pointer; }
.stack-seg:hover { opacity: .85; }
.stack-legend { display: flex; flex-wrap: wrap; gap: 2px 20px; margin-top: 10px; font-size: 13px; }
.stack-legend-item { display: inline-flex; align-items: center; gap: 7px; background: none; border: 0; padding: 2px 4px; margin-left: -4px; border-radius: 4px; color: var(--ink-2); font-variant-numeric: tabular-nums; }
button.stack-legend-item { cursor: pointer; }
button.stack-legend-item:hover { background: var(--primary-50); }
.stack-legend-item strong { color: var(--ink); font-weight: 600; }
.stack-legend-pct { color: var(--muted); }

/* Alerts */
.alert-card > .empty { flex: 1; justify-content: center; }
.alert-counts { display: flex; flex-wrap: wrap; gap: 6px 18px; padding: 12px 20px 0; font-size: 12.5px; }
.alert-count { display: inline-flex; align-items: center; gap: 5px; text-decoration: none; color: var(--ink-2); }
.alert-count strong { font-family: var(--font-head); font-size: 15px; color: var(--ink); font-variant-numeric: tabular-nums; }
.alert-count.alert-critico .icon { color: var(--rojo); }
.alert-count.alert-atencion .icon { color: #b47b00; }
.alert-count.alert-info .icon { color: var(--azul); }
.alert-count.is-none, .alert-count.is-none strong { color: var(--muted); }
.alert-count.is-none .icon { color: var(--ink-3); }
.alert-count:hover span { text-decoration: underline; }
.alert-card .alert-list { margin-top: 10px; border-top: 1px solid var(--line-2); flex: 1; }
.alert-list { display: flex; flex-direction: column; }
.alert-item { display: grid; grid-template-columns: 30px minmax(0, 1fr) auto; gap: 12px; align-items: center; padding: 10px 20px; text-decoration: none; color: var(--ink); border-bottom: 1px solid var(--line-2); }
.alert-item:last-child { border-bottom: 0; }
.alert-item:hover { background: #f6f9fc; }
.alert-icon { width: 30px; height: 30px; border-radius: 50%; display: flex; align-items: center; justify-content: center; }
.alert-critico .alert-icon { background: var(--rojo-bg); color: var(--rojo); }
.alert-atencion .alert-icon { background: var(--amarillo-bg); color: var(--amarillo); }
.alert-info .alert-icon { background: var(--azul-bg); color: var(--azul); }
.alert-body { display: flex; flex-direction: column; min-width: 0; }
.alert-title { font-weight: 600; font-size: 13.5px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.alert-detail { color: var(--muted); font-size: 12.5px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.alert-meta { display: flex; flex-direction: column; align-items: flex-end; gap: 2px; font-size: 11.5px; white-space: nowrap; }
.alert-mod { font-size: 12px; color: var(--muted); white-space: nowrap; }
.alert-more { display: flex; align-items: center; justify-content: center; gap: 4px; padding: 10px 20px; border-top: 1px solid var(--line-2); font-size: 13px; font-weight: 600; text-decoration: none; color: var(--primary); border-radius: 0 0 var(--radius) var(--radius); }
.alert-more:hover { background: #f6f9fc; }
.alert-list-full .alert-title, .alert-list-full .alert-detail { white-space: normal; }
@media (min-width: 1500px) { .alert-card .alert-mod { display: none; } }

/* Charts of the dashboard */
.chart-pending .pending-list { display: grid; grid-template-columns: repeat(auto-fill, minmax(280px, 1fr)); gap: 0 28px; }
.pending-list li { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 8px 0; border-bottom: 1px solid var(--line-2); font-size: 13.5px; }
.pending-list .link { display: inline-flex; align-items: center; gap: 3px; font-size: 13px; white-space: nowrap; }
.dash-charts > .chart-pending .pending-list { grid-template-columns: minmax(0, 1fr); }
.mini-list { display: flex; flex-direction: column; }
.mini-item { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 8px 6px; border-bottom: 1px solid var(--line-2); text-decoration: none; color: var(--ink); border-radius: 5px; }
.mini-list li:last-child .mini-item { border-bottom: 0; }
.mini-item:hover { background: #f4f8fc; }
.mini-main { display: flex; flex-direction: column; min-width: 0; }
.mini-title { font-weight: 600; font-size: 13.5px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.mini-detail { font-size: 12.5px; color: var(--muted); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

/* ------------------------- Attention / progress ------------------------- */
.attention-card { margin-bottom: 16px; }
.attention-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 18px; margin-bottom: 16px; padding-bottom: 14px; border-bottom: 1px solid var(--line-2); }
.att-label { font-size: 12px; font-weight: 600; color: var(--muted); margin-bottom: 3px; }
.att-value { font-family: var(--font-head); font-size: 24px; font-weight: 600; line-height: 1.2; }
.att-value.att-small { font-size: 18px; }
.att-progress { margin-top: 8px; }
.progress-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(210px, 1fr)); gap: 16px 24px; align-items: start; }
.progress-grid .muted { font-size: 12.5px; margin-top: 3px; }
.progress-flag { grid-column: 1 / -1; }

/* -------------------------------- Map ----------------------------------- */
.map-layout { display: grid; grid-template-columns: minmax(0, 1fr) 300px; gap: 16px; align-items: start; }
.map-toolbar { padding: 11px 13px; border-bottom: 1px solid var(--line-2); }
.map-controls { display: flex; flex-direction: column; gap: 10px; }
.map-selects { display: flex; gap: 12px; flex-wrap: wrap; align-items: flex-end; }
.map-tiles-check { font-size: 13px; }
.map-stage { position: relative; height: clamp(380px, 62vh, 720px); overflow: hidden; background: #eef2f6; touch-action: none; }
.map-tiles { position: absolute; inset: 0; }
.map-tile { position: absolute; width: 256px; height: 256px; user-select: none; }
.map-canvas { position: absolute; inset: 0; cursor: grab; outline: none; }
.map-canvas:focus-visible { box-shadow: inset 0 0 0 2px var(--amber-600); }
.map-tip { position: absolute; z-index: 5; pointer-events: none; background: #14202e; color: #fff; border-radius: 6px; padding: 7px 10px; font-size: 12.5px; flex-direction: column; gap: 1px; max-width: 220px; box-shadow: var(--shadow-2); }
.map-tip span { color: #c6d2df; }
.map-attrib { position: absolute; right: 6px; bottom: 4px; font-size: 10.5px; background: rgba(255, 255, 255, .8); padding: 1px 5px; border-radius: 3px; }
.map-attrib:empty { display: none; }
.map-zoom { position: absolute; right: 10px; top: 10px; display: flex; flex-direction: column; gap: 4px; z-index: 4; }
.map-zoom .btn { box-shadow: var(--shadow-1); }
.map-foot { display: flex; justify-content: space-between; gap: 12px; flex-wrap: wrap; padding: 8px 13px; font-size: 12.5px; border-top: 1px solid var(--line-2); }
.map-side { display: flex; flex-direction: column; gap: 16px; }
.map-info .card-title { margin-bottom: 10px; display: flex; gap: 8px; align-items: center; flex-wrap: wrap; }
.map-info .dl { gap: 9px 14px; margin-bottom: 10px; }
.map-legend-title { font-family: var(--font-head); font-weight: 600; font-size: 15px; margin-bottom: 8px; }
.map-legend-item { display: grid; grid-template-columns: 16px minmax(0, 1fr) auto; gap: 8px; align-items: center; padding: 3px 0; font-size: 13px; }
.map-dot { width: 12px; height: 12px; border-radius: 50%; border: 2px solid #fff; box-shadow: 0 0 0 1px #c3ccd7; }
.map-dot-halo { background: rgba(208, 59, 59, .22); box-shadow: 0 0 0 1.5px #d03b3b; }

/* ------------------------------ Finance --------------------------------- */
.scenario-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(300px, 1fr)); gap: 16px; margin-bottom: 16px; }
.scenario { background: #fff; border: 1px solid var(--line); border-radius: var(--radius); padding: 14px 16px; box-shadow: var(--shadow-1); }
.scenario.is-active { border-color: var(--primary); box-shadow: 0 0 0 2px var(--primary-50); }
.scenario-head { display: flex; justify-content: space-between; gap: 10px; align-items: flex-start; margin-bottom: 6px; }
.scenario-desc { font-size: 12.5px; margin-bottom: 10px; }
.scenario .dl { gap: 9px 16px; }
.scenario-sup { font-size: 12.5px; color: var(--ink-2); margin-top: 10px; padding-top: 9px; border-top: 1px dashed var(--line); }
table.matrix th[scope="row"] { position: sticky; left: 0; background: #fff; z-index: 2; font-weight: 500; min-width: 240px; white-space: normal; color: var(--ink); font-size: 13px; }
table.matrix td { white-space: nowrap; }
table.matrix .row-group th { background: var(--surface-2); color: var(--navy-2); font-family: var(--font-head); font-size: 14.5px; font-weight: 600; position: static; border-top: 1px solid var(--line); border-bottom: 1px solid var(--line); padding-top: 9px; padding-bottom: 8px; }
table.matrix .row-total th, table.matrix .row-total td { font-weight: 700; background: var(--surface-2); border-top: 1px solid var(--line); }
table.matrix .row-saldo th, table.matrix .row-saldo td { font-weight: 600; }
table.matrix .row-acum th, table.matrix .row-acum td { font-weight: 700; background: var(--primary-50); }
table.matrix .col-total { font-weight: 700; border-left: 1px solid var(--line); }
.cell-link { color: inherit; text-decoration: none; border-bottom: 1px dotted #8fa3b8; }
.cell-link:hover { color: var(--primary); border-bottom-color: var(--primary); }

/* ------------------------------- Kanban --------------------------------- */
.kanban { display: grid; grid-template-columns: repeat(5, minmax(190px, 1fr)); gap: 12px; overflow-x: auto; }
.kanban-col { background: var(--surface-2); border: 1px solid var(--line-2); border-radius: 7px; min-width: 0; }
.kanban-head { display: flex; justify-content: space-between; align-items: center; padding: 9px 10px; border-bottom: 1px solid var(--line-2); }
.kanban-count { font-family: var(--font-head); font-weight: 600; font-size: 16px; }
.kanban-body { padding: 8px; display: flex; flex-direction: column; gap: 7px; }
.kanban-card { display: flex; flex-direction: column; gap: 2px; align-items: flex-start; background: #fff; border: 1px solid var(--line); border-radius: 6px; padding: 8px 10px; text-decoration: none; color: var(--ink); font-size: 12.5px; }
.kanban-card:hover { border-color: var(--primary); }
.kanban-card.is-alert { border-left: 3px solid var(--rojo); }
.kanban-card .badge { font-size: 11px; margin-top: 3px; white-space: normal; text-align: left; }
.kanban-more { font-size: 12.5px; font-weight: 600; text-align: center; padding: 4px; text-decoration: none; }
.kanban-empty { font-size: 12.5px; text-align: center; padding: 10px 0; }

/* ----------------------------- Reports ---------------------------------- */
.rep-cards { display: grid; grid-template-columns: repeat(auto-fill, minmax(320px, 1fr)); gap: 12px; }
.rep-card { display: flex; gap: 13px; align-items: flex-start; background: #fff; border: 1px solid var(--line); border-radius: var(--radius); padding: 14px 15px; text-decoration: none; color: var(--ink); box-shadow: var(--shadow-1); }
a.rep-card:hover { border-color: var(--primary); background: #fbfcfe; }
.rep-card.is-disabled { opacity: .62; }
.rep-card-icon { width: 42px; height: 42px; border-radius: 8px; background: var(--primary-50); color: var(--primary); display: flex; align-items: center; justify-content: center; flex: none; }
.rep-card-body { display: flex; flex-direction: column; gap: 3px; min-width: 0; }
.rep-card-body strong { font-family: var(--font-head); font-size: 15.5px; font-weight: 600; }
.rep-card-body span { font-size: 13px; color: var(--muted); line-height: 1.4; }
.rep-card-lock { display: inline-flex; gap: 4px; align-items: center; color: var(--amarillo) !important; font-weight: 600; }
.rep-reg { min-width: 300px; }
.rep-notes-field { flex: 1; min-width: 260px; }
.rep-notes-field textarea.input { height: auto; min-height: 34px; }
.rep-photos { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px; }
.rep-photos figure { border: 1px solid #cfd7e0; }
.rep-photos figcaption { font-size: 11.5px; padding: 4px 8px; }
.rep-signs-2 { grid-template-columns: repeat(2, 1fr); }

/* ----------------------------- Calendar --------------------------------- */
.cal-card { padding: 0 0 12px; }
.cal-toolbar { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 12px 14px; flex-wrap: wrap; }
.cal-nav { display: flex; gap: 6px; align-items: center; }
.cal-title { font-family: var(--font-head); font-size: 19px; font-weight: 600; flex: 1; text-align: center; }
.cal-views { display: inline-flex; border: 1px solid var(--line); border-radius: 7px; overflow: hidden; }
.seg { background: #fff; border: 0; border-right: 1px solid var(--line); padding: 7px 14px; font-weight: 600; font-size: 13px; cursor: pointer; color: var(--ink-2); }
.seg:last-child { border-right: 0; }
.seg.is-active { background: var(--navy-2); color: #fff; }
.cal-legend { display: flex; flex-wrap: wrap; gap: 6px 8px; padding: 0 14px 12px; }
.cal-legend-item { display: inline-flex; align-items: center; gap: 6px; background: #fff; border: 1px solid var(--line); border-radius: 13px; padding: 3px 10px; font-size: 12.5px; cursor: pointer; color: var(--ink-2); }
.cal-legend-item.is-off { opacity: .45; text-decoration: line-through; }
.cal-dot { width: 10px; height: 10px; border-radius: 3px; flex: none; background: var(--c, #8a96a5); }
.cal-ev-mant { --c: #2a78d6; } .cal-ev-orden { --c: #4a3aa7; } .cal-ev-pma { --c: #1a7a48; } .cal-ev-contrato { --c: #d03b3b; } .cal-ev-oblig { --c: #c2548a; }
.cal-ev-factura { --c: #eb6834; } .cal-ev-recaudo { --c: #c98400; } .cal-ev-sup { --c: #128a63; } .cal-ev-proyecto { --c: #0f5a8a; } .cal-ev-evento { --c: #556170; }
.cal-ev { display: block; width: 100%; text-align: left; border: 0; border-left: 3px solid var(--c, #8a96a5); background: #f3f6f9; border-radius: 3px; padding: 2px 6px; font-size: 12px; line-height: 1.35; color: var(--ink); text-decoration: none; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; cursor: pointer; margin-top: 3px; }
.cal-ev:hover { background: #e4edf6; }
.cal-ev.is-done { color: var(--muted); text-decoration: line-through; }
.cal-ev.is-alert { background: var(--rojo-bg); font-weight: 600; }
.cal-month { display: grid; grid-template-columns: repeat(7, minmax(0, 1fr)); border-top: 1px solid var(--line); border-left: 1px solid var(--line); margin: 0 14px; }
.cal-head { padding: 6px 8px; font-size: 12px; font-weight: 700; color: var(--ink-2); background: var(--surface-2); border-right: 1px solid var(--line); border-bottom: 1px solid var(--line); }
.cal-cell { min-height: 104px; padding: 4px 5px 6px; border-right: 1px solid var(--line); border-bottom: 1px solid var(--line); cursor: pointer; min-width: 0; }
.cal-cell:hover { background: #fafcfe; }
.cal-cell.is-out { background: #f7f8fa; }
.cal-cell.is-out .cal-daynum { color: #a5b1bf; }
.cal-daynum { font-size: 12.5px; font-weight: 600; width: 24px; height: 24px; display: flex; align-items: center; justify-content: center; border-radius: 50%; }
.cal-cell.is-today .cal-daynum { background: var(--amber); color: #2a1c00; }
.cal-more { font-size: 11.5px; color: var(--primary); font-weight: 600; margin-top: 3px; display: block; }
.cal-week { display: grid; grid-template-columns: repeat(7, minmax(0, 1fr)); gap: 8px; padding: 0 14px; }
.cal-weekcol { border: 1px solid var(--line); border-radius: 7px; padding: 0 6px 8px; min-height: 260px; min-width: 0; }
.cal-weekcol.is-today { border-color: var(--amber-600); box-shadow: 0 0 0 2px var(--amber-50); }
.cal-weekhead { display: flex; justify-content: space-between; align-items: baseline; width: 100%; background: none; border: 0; border-bottom: 1px solid var(--line-2); padding: 7px 2px; cursor: pointer; margin-bottom: 4px; font-size: 12.5px; color: var(--ink-2); }
.cal-weekhead strong { font-family: var(--font-head); font-size: 18px; color: var(--ink); }
.cal-week .cal-ev { white-space: normal; padding: 4px 6px; }
.cal-none { font-size: 12px; display: block; padding: 6px 2px; }
.agenda { padding: 0 14px; }
.agenda-day + .agenda-day { margin-top: 14px; }
.agenda-date { font-family: var(--font-head); font-size: 15px; font-weight: 600; padding-bottom: 5px; border-bottom: 2px solid var(--line-2); margin-bottom: 4px; }
.agenda-date.is-today { border-bottom-color: var(--amber); }
.agenda-list { display: flex; flex-direction: column; }
.agenda-item { display: flex; align-items: center; gap: 10px; padding: 8px 6px; border: 0; border-bottom: 1px solid var(--line-2); background: none; text-align: left; text-decoration: none; color: var(--ink); cursor: pointer; width: 100%; border-radius: 4px; }
.agenda-item:hover { background: #f4f8fc; }
.agenda-main { flex: 1; display: flex; flex-direction: column; min-width: 0; }
.agenda-main .muted { font-size: 12.5px; }
.agenda-when { font-size: 12px; font-weight: 600; color: var(--rojo); min-width: 76px; }

/* -------------------------- Configuration ------------------------------- */
.logo-row { display: flex; align-items: center; gap: 16px; flex-wrap: wrap; }
.logo-prev { width: 84px; height: 84px; border: 1px dashed var(--line); border-radius: 8px; display: flex; align-items: center; justify-content: center; background: var(--surface-2); padding: 6px; }
.logo-prev img { max-width: 100%; max-height: 100%; object-fit: contain; }
.logo-row .btn-row { margin-top: 0; }
.rule-group + .rule-group { margin-top: 6px; }
.rule-group .input { height: 32px; }
.cat-layout { display: grid; grid-template-columns: 270px minmax(0, 1fr); gap: 16px; align-items: start; }
.cat-nav { background: #fff; border: 1px solid var(--line); border-radius: var(--radius); padding: 8px; max-height: calc(100vh - 190px); overflow: auto; position: sticky; top: 0; }
.cat-group + .cat-group { margin-top: 8px; }
.cat-group-title { font-size: 11.5px; font-weight: 700; color: var(--muted); padding: 6px 8px 3px; }
.cat-link { display: flex; justify-content: space-between; align-items: center; gap: 8px; padding: 6px 8px; border-radius: 5px; text-decoration: none; color: var(--ink); font-size: 13.5px; }
.cat-link:hover { background: var(--primary-50); }
.cat-link.is-active { background: var(--navy-2); color: #fff; font-weight: 600; }
.cat-link.is-active .chip-count { background: rgba(255, 255, 255, .2); color: #fff; }
.estado-row { display: grid; grid-template-columns: 250px minmax(0, 1fr); gap: 14px; padding: 10px 0; border-bottom: 1px solid var(--line-2); align-items: start; }
.estado-name { display: flex; flex-direction: column; gap: 2px; }
.estado-name .muted { font-size: 12px; }
.estado-badges { display: flex; flex-wrap: wrap; gap: 6px; }
.perm-table .input { height: 30px; font-size: 13px; min-width: 112px; }
.perm-table select[data-nivel="0"] { color: var(--muted); }
.perm-table select[data-nivel="2"] { border-color: var(--azul-line); background: var(--azul-bg); font-weight: 600; }
.perm-table th[scope="row"] { background: #fff; font-weight: 600; color: var(--ink); position: static; }

@media (max-width: 1280px) {
  .map-layout { grid-template-columns: minmax(0, 1fr); }
  .map-side { flex-direction: row; flex-wrap: wrap; }
  .map-side > .card { flex: 1 1 280px; }
  .kanban { grid-template-columns: repeat(5, 210px); }
}
@media (max-width: 999px) {
  .welcome { grid-template-columns: minmax(0, 1fr); }
  .welcome-art { padding: 26px 24px 0; min-height: 300px; }
  .welcome-full { margin-top: 22px; font-size: 26px; }
  .welcome-scene { height: 46%; opacity: .7; }
  .welcome-side { padding: 28px 20px 40px; }
  .attention-grid, .cat-layout, .estado-row { grid-template-columns: minmax(0, 1fr); }
  .cat-nav { position: static; max-height: 260px; }
  .cal-cell { min-height: 74px; }
  .cal-week { grid-template-columns: minmax(0, 1fr); }
  .cal-weekcol { min-height: 0; }
  .import-summary { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .form-grid { grid-template-columns: minmax(0, 1fr); }
  .field-span-2, .field-span-3 { grid-column: auto; }
  .dl-3, .dl-4 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
@media print {
  .cal-card, .map-card { border: 0; }
  .cal-legend-item.is-off { display: none; }
  .dash-top { grid-template-columns: minmax(0, 1fr) !important; }
  table.matrix { font-size: 8.5pt; }
  table.matrix th[scope="row"] { position: static; min-width: 0; }
}

/* ==========================================================================
   Version 1.1 - Bodega, PQRS, validador del IAP y accesos por usuario
   ========================================================================== */

/* Segmented buttons (estrato, zona, periodicidad) */
.segc { display: inline-flex; flex-wrap: nowrap; border: 1px solid #c3cdd8; border-radius: 6px; overflow: hidden; background: #fff; align-self: flex-start; }
.segc-btn { min-width: 42px; height: 34px; padding: 0 13px; border: 0; border-right: 1px solid #c3cdd8; background: transparent; font: inherit; font-size: 13.5px; font-weight: 600; color: var(--ink-2); cursor: pointer; }
.segc-btn:last-child { border-right: 0; }
.segc-btn:hover { background: var(--surface-2); }
.segc-btn.is-on { background: var(--navy-2); color: #fff; }
.segc-btn:focus-visible { outline-offset: -2px; }

/* Validador del IAP: parámetros a la izquierda, liquidación a la derecha */
.iap-layout { display: grid; grid-template-columns: minmax(0, 1.08fr) minmax(0, 1fr); gap: 16px; align-items: start; }
.iap-layout > .card { margin-top: 0; }
.iap-result-card { position: sticky; top: 0; }
.iap-h { font-family: var(--font-head); font-size: 14.5px; font-weight: 600; color: var(--navy-2); margin: 18px 0 9px; }
.iap-form > .iap-h:first-child { margin-top: 0; }
.iap-form .form-grid { align-items: start; }

/* The liquidated amount reads like the total line of a tax receipt. */
.iap-total { display: flex; flex-direction: column; gap: 2px; padding: 15px 18px 14px; border-radius: var(--radius); background: var(--navy); color: #fff; border-left: 5px solid var(--amber); }
.iap-total-label { font-size: 12.5px; font-weight: 600; color: #b9c8d9; }
.iap-total-value { font-family: var(--font-head); font-size: 38px; font-weight: 700; line-height: 1.1; font-variant-numeric: tabular-nums; }
.iap-total-sub { font-size: 12.5px; color: #dbe5ef; }
.iap-total.is-empty { background: var(--surface-2); color: var(--ink); border: 1px dashed #c3cdd8; border-left: 5px solid #c3cdd8; }
.iap-total.is-empty .iap-total-label, .iap-total.is-empty .iap-total-sub { color: var(--muted); }
.iap-total.is-empty .iap-total-value { color: #9aa8b8; }

.iap-ledger { width: 100%; border-collapse: collapse; font-size: 13.5px; }
.iap-ledger td { padding: 7px 0; border-bottom: 1px solid var(--line-2); vertical-align: top; }
.iap-ledger td.num { text-align: right; white-space: nowrap; padding-left: 14px; font-variant-numeric: tabular-nums; font-weight: 600; }
.iap-step { font-weight: 600; }
.iap-step-detail { font-size: 12.5px; color: var(--muted); line-height: 1.4; }
.iap-ledger tfoot td { border-bottom: 0; border-top: 2px solid var(--navy); padding-top: 9px; font-family: var(--font-head); font-size: 15.5px; font-weight: 700; }

.iap-compare { margin-top: 12px; padding: 11px 13px 4px; border: 1px solid var(--line); border-radius: 6px; }
.iap-compare.iap-verde { background: var(--verde-bg); border-color: var(--verde-line); }
.iap-compare.iap-rojo { background: var(--rojo-bg); border-color: var(--rojo-line); }
.iap-compare.iap-amarillo { background: var(--amarillo-bg); border-color: var(--amarillo-line); }
.iap-compare-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 10px; margin: 9px 0 7px; }
.iap-compare-grid span { display: block; font-size: 12px; color: var(--ink-2); }
.iap-compare-grid strong { font-family: var(--font-head); font-size: 17px; font-variant-numeric: tabular-nums; }
.iap-compare p { font-size: 13px; margin: 0 0 8px; }
.iap-conclusion { font-size: 13.5px; line-height: 1.55; background: var(--surface-2); border: 1px solid var(--line-2); border-radius: 6px; padding: 10px 12px; margin: 0 0 8px; user-select: all; }
.iap-norma { font-size: 12px; color: var(--muted); margin: 12px 0 0; }
.iap-actions { margin-top: 14px; padding-top: 13px; border-top: 1px solid var(--line-2); align-items: center; }
.iap-tarifa { margin-top: 4px; }
.iap-detail { margin-bottom: 16px; }

/* Tarifas y parámetros del IAP */
.iap-formula { font-family: var(--font-head); font-size: 24px; font-weight: 700; color: var(--navy-2); margin: 0 0 12px; letter-spacing: .3px; }
.iap-table th, .iap-table td { vertical-align: middle; }
.iap-table thead th[colspan] { text-align: center; border-left: 1px solid var(--line); }
.iap-table th[scope="row"] { font-weight: 600; color: var(--ink); background: #fff; }
.input-cell { height: 30px; width: 96px; text-align: right; font-size: 13px; margin-left: auto; }
.iap-table .input-affix { justify-content: flex-end; }
.iap-table .input-affix .affix { font-size: 11.5px; padding: 0 6px; }
.iap-table .input-affix .input-cell { width: 78px; margin-left: 0; }
.iap-mark { color: var(--amber-600); font-weight: 700; }
.iap-foot { font-size: 12.5px; color: var(--muted); padding: 9px 16px 11px; margin: 0; }
.iap-acts { padding: 0 16px 12px; font-size: 13px; }
.iap-acts summary { cursor: pointer; font-weight: 600; color: var(--primary); padding: 4px 0; }
.iap-acts ul { margin: 6px 0 0; padding-left: 20px; columns: 2; column-gap: 28px; }
.iap-acts li { margin-bottom: 4px; break-inside: avoid; line-height: 1.4; }
.iap-params { display: flex; flex-direction: column; gap: 9px; }
.iap-param { display: flex; align-items: center; justify-content: space-between; gap: 14px; font-size: 13.5px; }
.iap-param .input-affix { flex: none; }
.iap-param .input-cell { margin-left: 0; }

/* Reglas de visualización por usuario */
.perm-toggle { font-weight: 600; margin: 4px 0 8px; }
.perm-presets { align-items: center; margin-bottom: 10px; }
.perm-user { max-height: 46vh; overflow: auto; border: 1px solid var(--line); border-radius: 6px; }
.perm-user thead th { position: sticky; top: 0; z-index: 1; }

@media (max-width: 1180px) {
  .iap-layout { grid-template-columns: minmax(0, 1fr); }
  .iap-result-card { position: static; }
  .iap-acts ul { columns: 1; }
}
@media print {
  .iap-layout { display: block; }
  .iap-result-card { position: static; margin-top: 12px; }
  .iap-total { background: #fff !important; color: #111 !important; border: 1px solid #555; border-left: 5px solid #111; }
  .iap-total-label, .iap-total-sub { color: #333 !important; }
  .iap-actions, .iap-acts summary { display: none !important; }
  .iap-conclusion { background: #fff; border-color: #999; }
}
.iap-form .input-pair { display: grid; grid-template-columns: minmax(0, 1fr) 82px; gap: 6px; }
.iap-form .input-pair .input { min-width: 0; padding-right: 6px; }
/* Seven roles must fit the permissions matrix at 1366 px. */
.perm-table th, .perm-table td { padding-left: 6px; padding-right: 6px; }
.perm-table .input { min-width: 106px; padding: 0 22px 0 7px; font-size: 12.5px; }
.perm-table th[scope="row"] { padding-left: 12px; }

/* ------------------------- Shared folder (OneDrive) ---------------------- */
.sync-pasos { list-style: decimal; padding-left: 22px; margin: 2px 0 6px; display: flex; flex-direction: column; gap: 12px; max-width: 78ch; }
.sync-pasos li::marker { font-weight: 700; color: var(--primary); }
.sync-pasos li strong { display: block; margin-bottom: 2px; }
.sync-pasos li span { color: var(--ink-2); line-height: 1.5; }
.sync-limites { max-width: 86ch; display: flex; flex-direction: column; gap: 7px; line-height: 1.5; }
.sync-modos { border: 0; padding: 0; margin: 16px 0 0; display: flex; flex-direction: column; gap: 8px; min-width: 0; }
.sync-modos legend { padding: 0; margin-bottom: 8px; }
.sync-modo { display: flex; gap: 10px; align-items: flex-start; padding: 10px 12px; border: 1px solid var(--line); border-radius: 7px; cursor: pointer; }
.sync-modo:has(input:checked) { border-color: var(--primary); background: var(--primary-50); }
.sync-modo input { width: 17px; height: 17px; margin-top: 2px; accent-color: var(--primary); flex: none; }
.sync-modo > span { display: flex; flex-direction: column; gap: 3px; }
.modal-body > .field { margin-top: 12px; }
.callout .btn-row { margin-top: 8px; }

/* ------------------- Insumos para el informe mensual -------------------- */
.ins-ayuda { background: #fff; border: 1px solid var(--line); border-radius: var(--radius); padding: 13px 18px; margin-bottom: 16px; }
.ins-ayuda p { margin: 0; max-width: 108ch; line-height: 1.5; }
.ins-ayuda p + p { margin-top: 5px; font-size: 13.5px; }
.ins-card { margin-bottom: 16px; }
.ins-frase { margin: 0 0 8px; max-width: 108ch; line-height: 1.55; }
.ins-tabla { margin-top: 14px; }
.ins-tabla:first-child { margin-top: 0; }
.ins-leyenda { display: flex; align-items: baseline; gap: 10px; margin: 0 0 6px; font-family: var(--font-head); font-size: 14.5px; font-weight: 600; color: var(--ink); }
.ins-cuenta { font-family: var(--font); font-size: 12.5px; font-weight: 400; color: var(--muted); }
.ins-tabla .table-wrap { border: 1px solid var(--line); border-radius: 8px; overflow-x: auto; }
.ins-tabla td { vertical-align: top; }
.ins-mas, .ins-nota { margin: 7px 0 0; font-size: 13px; color: var(--muted); }
.ins-nota { max-width: 108ch; line-height: 1.5; }
.ins-sin-cab thead { display: none; }

/* --------------------------- Fondo del mapa ----------------------------- */
.map-tile-box { position: absolute; overflow: hidden; }
.map-tile-box .map-tile { max-width: none; image-rendering: auto; }
.map-fondo { display: flex; align-items: center; gap: 8px; min-height: 38px; }
.map-fondo-pasos { margin: 0 0 14px; padding-left: 22px; list-style: decimal; display: flex; flex-direction: column; gap: 5px; line-height: 1.45; }
.map-fondo-form { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.map-fondo-ancho { grid-column: 1 / -1; }
.map-fondo-estado { margin: 10px 0 0; font-size: 13.5px; color: var(--ink); min-height: 20px; }
.map-fondo-estado:empty { display: none; }
.map-fondo-pasos li { list-style: decimal; }
