/* =====================================================================
   Ctrl+Diamante · tema visual (v3.4.8)
   Carga al final: redefine colores, tipografía y estructura sobre los estilos anteriores.
   Neutros fríos, un color de marca sobrio (verde petróleo) y colores de estado reservados.
   ===================================================================== */

@font-face { font-family: "IBM Plex Sans"; font-weight: 400; font-style: normal; font-display: swap; src: url(fonts/ibm-plex-sans-latin-400-normal.woff2) format("woff2"); }
@font-face { font-family: "IBM Plex Sans"; font-weight: 500; font-style: normal; font-display: swap; src: url(fonts/ibm-plex-sans-latin-500-normal.woff2) format("woff2"); }
@font-face { font-family: "IBM Plex Sans"; font-weight: 600; font-style: normal; font-display: swap; src: url(fonts/ibm-plex-sans-latin-600-normal.woff2) format("woff2"); }
@font-face { font-family: "IBM Plex Sans"; font-weight: 700; font-style: normal; font-display: swap; src: url(fonts/ibm-plex-sans-latin-700-normal.woff2) format("woff2"); }
@font-face { font-family: "IBM Plex Mono"; font-weight: 500; font-style: normal; font-display: swap; src: url(fonts/ibm-plex-mono-latin-500-normal.woff2) format("woff2"); }
@font-face { font-family: "IBM Plex Mono"; font-weight: 600; font-style: normal; font-display: swap; src: url(fonts/ibm-plex-mono-latin-600-normal.woff2) format("woff2"); }

:root {
  --ink: #101828; --ink-2: #344054; --muted: #667085; --muted-2: #98a2b3;
  --line: #eaecf0; --line-2: #d0d5dd; --bg: #f2f4f7; --surface: #ffffff; --soft: #f9fafb;
  --brand: #0f766e; --brand-2: #115e59; --brand-soft: #e6f4f2;
  --rail: #0c111d;
  --deep: #101828;           /* superficies oscuras (tooltips, avisos) */
  --mint: #0f766e;           /* acento: foco, activos, enlaces */
  --paper: #f2f4f7;
  --red: #d92d20; --red-ink: #b42318; --red-soft: #fef3f2;
  --amber: #f0a500; --amber-ink: #b54708; --amber-soft: #fffaeb;
  --green: #12b76a; --green-ink: #067647; --green-soft: #ecfdf3;
}

html, body { background: var(--bg); }
body, button, input, select, textarea { font-family: "IBM Plex Sans", system-ui, -apple-system, "Segoe UI", sans-serif; }
body { color: var(--ink); -webkit-font-smoothing: antialiased; font-variant-numeric: tabular-nums; }
::selection { background: #ccebe7; }

/* ---------- Estructura: barra lateral + encabezado + subvistas ---------- */
.shell {
  grid-template-columns: 64px auto minmax(0, 1fr) auto;
  grid-template-rows: auto auto minmax(0, 1fr) auto;
  grid-template-areas: "rail top top top" "rail sub sub sub" "rail left main right" "rail bottom bottom bottom";
}
.rail { grid-area: rail; background: var(--rail); display: flex; flex-direction: column; align-items: center; gap: 4px; padding: 12px 0; z-index: 25; }
.rail-logo { width: 36px; height: 36px; border-radius: 8px; background: var(--brand); display: grid; place-items: center; margin-bottom: 14px; }
.rail-logo svg { width: 20px; height: 20px; fill: none; stroke: #fff; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }
.rail-nav { display: flex; flex-direction: column; gap: 4px; }
.rail-spacer { flex: 1; }
.rail-btn, .rail .tab { position: relative; width: 52px; padding: 8px 0; margin: 0; border: 0; border-radius: 8px; background: transparent; color: #98a2b3; display: flex; flex-direction: column; align-items: center; gap: 4px; font: 500 10px/1.2 "IBM Plex Sans", sans-serif; cursor: pointer; transition: background .12s ease, color .12s ease; }
.rail-btn svg { width: 20px; height: 20px; fill: none; stroke: currentColor; stroke-width: 1.75; stroke-linecap: round; stroke-linejoin: round; }
.rail-btn:hover, .rail .tab:hover { background: rgba(255,255,255,.06); color: #e4e7ec; }
.rail-btn.active, .rail .tab.active { background: rgba(255,255,255,.1); color: #fff; border: 0; }
.rail-btn:focus-visible { outline: 2px solid #5fbf9a; outline-offset: 1px; }
.rail-btn[hidden] { display: none !important; }
.rail .tab.tab-restricted::after { content: ""; position: absolute; top: 6px; right: 9px; width: 7px; height: 7px; margin: 0; padding: 0; border-radius: 50%; background: var(--amber); box-shadow: 0 0 0 2px var(--rail); }
.tb-tabs { display: none !important; }

.topbar { background: var(--surface); color: var(--ink); box-shadow: none; border-bottom: 1px solid var(--line); z-index: 20; }
.tb-row { min-height: 56px; box-sizing: border-box; padding: 0 20px; gap: 16px; }
.tb-brand { flex: none; gap: 8px; align-items: center; font-size: 14px; }
.tb-brand .brand-mark { display: none; }
.tb-app { display: inline; font-size: 14px; letter-spacing: -.01em; text-transform: none; color: var(--ink); font-weight: 700; }
.tb-app i { font-style: normal; color: var(--brand); }
.tb-sep { color: var(--line-2); }
.topbar #mapTitle { margin: 0; font-size: 14px; font-weight: 500; letter-spacing: 0; color: #475467; }
.tb-sub { flex: 1; min-width: 0; align-items: center; }
.tb-sub p { margin: 0 !important; font-size: 12px !important; color: var(--muted); }
.topbar .week-badge { padding: 4px 10px; border-radius: 8px; background: var(--bg); color: var(--ink-2); white-space: nowrap; }
.topbar .week-badge b { color: var(--ink); font-weight: 600; }
.topbar .week-badge span { color: var(--muted); }
.topbar .sync-status { display: flex; align-items: center; gap: 6px; margin: 0; font-size: 12px; white-space: nowrap; }
.topbar .sync-status span { color: #475467; }
.topbar .sync-status i { background: var(--green); }
.topbar .sync-status[data-state="offline"] span { color: var(--red-ink); }
.topbar .sync-status[data-state="offline"] i { background: var(--red); }

.tb-levels { background: var(--bg); padding: 3px; border-radius: 8px; gap: 2px; }
.tb-levels .level-btn { padding: 0 12px; height: 30px; border-radius: 6px; color: #475467; font-weight: 500; }
.tb-levels .level-btn strong { font-size: 13px; font-weight: 500; }
.tb-levels .level-btn span { display: inline; font-size: 13px; margin-right: 4px; }
.tb-levels .level-btn.active { background: #fff; color: var(--ink); box-shadow: 0 1px 2px rgba(16,24,40,.1); }
.tb-levels .level-btn.active strong { font-weight: 600; }

.tb-right { gap: 12px; }
.mode-indicator { padding: 3px 10px; border-radius: 10px; background: var(--bg); color: var(--ink-2); font-size: 12px; font-weight: 600; }
.mode-indicator[data-mode="edit"] { background: #eff4ff; color: #1d4ed8; }
.mode-indicator[data-mode="plan"] { background: #f4f3ff; color: #5925dc; }
.mode-indicator[data-mode="carga"] { background: var(--amber-soft); color: var(--amber-ink); }
.mode-indicator[data-mode="admin"] { background: var(--red-soft); color: var(--red-ink); }
.mode-indicator[data-mode="polygons"] { background: var(--brand-soft); color: var(--brand-2); }
.topbar .compliance-metric { gap: 8px; }
.topbar .compliance-box { width: 36px; height: 36px; border: 1px solid var(--line-2); border-radius: 8px; background: var(--soft); box-shadow: none; }
.topbar .compliance-value { font-size: 11px; font-weight: 700; color: var(--ink); text-shadow: 0 0 2px #fff; }
.topbar .compliance-label { color: var(--muted); font-size: 11px; font-weight: 500; max-width: 80px; }
.notif-btn { width: 36px; height: 36px; border: 0; border-radius: 8px; color: #475467; }
.notif-btn:hover { background: var(--bg); border: 0; }
.notif-btn.has-unread { color: var(--red-ink); border: 0; }
.notif-count { top: 2px; right: 1px; min-width: 16px; height: 16px; line-height: 16px; font-size: 10px; font-weight: 700; background: var(--red); box-shadow: 0 0 0 2px #fff; }
.user-menu { display: flex; align-items: center; gap: 10px; padding-left: 12px; border-left: 1px solid var(--line); }
.avatar { width: 32px; height: 32px; border: 0; background: var(--brand); color: #fff; font-weight: 600; font-size: 12px; }
.avatar:hover, .avatar[aria-expanded="true"] { box-shadow: 0 0 0 3px rgba(15,118,110,.25); }
.tb-user { display: flex; flex-direction: column; line-height: 1.25; }
.tb-user b { font-size: 13px; font-weight: 600; white-space: nowrap; }
.tb-user small { font-size: 12px; color: var(--muted); }
.user-dropdown { top: calc(100% + 8px); border-radius: 10px; border: 1px solid var(--line); box-shadow: 0 12px 32px rgba(16,24,40,.14); }
.ud-item { border-radius: 6px; font-weight: 500; font-size: 13px; color: var(--ink); }
.ud-item:hover, .ud-item:focus-visible { background: var(--bg); }
.ud-item.current { color: var(--brand); }
.ud-check { color: var(--brand); }
.ud-head small { color: var(--muted); }

.hz-subbar { background: var(--surface); border-bottom: 1px solid var(--line); box-shadow: none; padding: 0 20px; min-height: 52px; box-sizing: border-box; align-items: stretch; }
.hz-subnav { background: transparent; border: 0; box-shadow: none; padding: 0; gap: 24px; border-radius: 0; }
.hz-subnav button { padding: 0; border-radius: 0; color: var(--muted); font-size: 14px; font-weight: 500; border-bottom: 2px solid transparent; margin-bottom: -1px; }
.hz-subnav button:hover { background: transparent; color: var(--ink); }
.hz-subnav button.active { background: transparent; color: var(--ink); font-weight: 600; box-shadow: none; border-bottom-color: var(--ink); }
.hz-subnav .hz-narrow { background: transparent; }

/* ---------- Paneles laterales: superficie blanca ---------- */
aside, .shell > aside { background: var(--surface); color: var(--ink); box-shadow: none; }
.panel-left { border-right: 1px solid var(--line); width: 340px; padding: 20px !important; }
.panel-right { border-left: 1px solid var(--line); width: 360px; box-shadow: none; padding: 20px !important; }
.panel-head h3 { font-size: 16px; font-weight: 600; }
.panel-close { border: 1px solid var(--line-2); color: #475467; background: #fff; border-radius: 8px; }
.panel-close:hover { border-color: var(--ink); color: var(--ink); }
.panel-close.light { background: transparent; }
.panel-help { color: var(--muted); font-size: 12.5px; }
.field-label { color: #475467; font-size: 12px; font-weight: 600; letter-spacing: 0; text-transform: none; margin-bottom: 6px; }
input, textarea, select { border: 1px solid var(--line-2); border-radius: 8px; color: var(--ink); background: #fff; box-shadow: 0 1px 2px rgba(16,24,40,.05); }
input:focus, textarea:focus, select:focus { border-color: var(--brand); box-shadow: 0 0 0 3px rgba(15,118,110,.15); }
input[type=checkbox], input[type=radio], input[type=range] { box-shadow: none; }
.position-note { color: #475467; background: var(--soft); border: 1px solid var(--line); border-radius: 8px; }
.add, .hz-primary, .hz-add, .new-user button, .program-load-button, .import-dialog .combine, .map-toolbar button { background: var(--ink); color: #fff; border: 0; border-radius: 8px; font-weight: 600; }
.add:hover, .hz-primary:hover, .hz-add:hover, .new-user button:hover, .program-load-button:hover { background: #1d2939; }
.hz-add.on { background: #fff; color: var(--ink); border: 1px solid var(--line-2); }
.hz-primary:disabled { background: #e4e7ec; color: var(--muted-2); }
.cancel-edit, .hz-secondary, .hz-x, .wizard-exit, .transfer-button, .user-actions button { background: #fff; color: var(--ink-2); border: 1px solid var(--line-2); border-radius: 8px; font-weight: 600; }
.cancel-edit:hover, .hz-secondary:hover, .transfer-button:hover, .transfer-button:focus-visible { border-color: var(--muted-2); background: var(--soft); }
.danger-button { border: 1px solid #fda29b; color: var(--red-ink); background: #fff; border-radius: 8px; font-weight: 600; }
.danger-button:hover { background: var(--red-soft); }
.link-light { color: var(--brand); font-weight: 600; }
.menu-card { border: 1px solid var(--line); background: #fff; color: var(--ink); border-radius: 10px; }
.menu-card:hover { border-color: var(--muted-2); }
.menu-card span { color: var(--muted); }
.work-row { background: var(--soft); border: 1px solid var(--line); border-radius: 8px; }
.work-row small { color: var(--muted); }
.delete { color: var(--muted-2); }
.works h2 { color: #475467; font-size: 12px; font-weight: 600; letter-spacing: 0; text-transform: none; }
.program-assignment { border: 1px solid var(--line); border-radius: 8px; }
.program-option.exclusive { color: #475467; border-top-color: var(--line); }
.program-option input, .progress-control input[type=range], .hz-check input, .hz-ptrow input, .poly-form input[type="range"], .merge-twin input { accent-color: var(--ink); }
.progress-number span { color: var(--muted); }
.admin-tabs { background: var(--bg); border-radius: 8px; padding: 3px; gap: 2px; grid-template-columns: repeat(3, minmax(0, 1fr)); }
.admin-tab { color: #475467; border-radius: 6px; font-weight: 500; }
.admin-tab.active { background: #fff; color: var(--ink); font-weight: 600; box-shadow: 0 1px 2px rgba(16,24,40,.1); }
.admin-accounts .table-wrap { border-color: var(--line); }
.admin-accounts .user-table { color: var(--ink); }
.admin-accounts .user-table tr { border-bottom-color: var(--line); }
.admin-accounts .user-table small, .user-table small { color: var(--muted); }
.admin-accounts .link-button { color: var(--brand); }
.admin-accounts .user-status, .user-status { color: var(--amber-ink); }
.user-name-input { border-color: var(--line-2); }
.module-row { background: #fff; border: 1px solid var(--line); }
.module-row small { color: var(--muted); }
.credential-box { background: var(--amber-soft); color: #93370d; }

/* planificación y asistente del trisemanal */
.program-load .field-label, .wizard-step { color: var(--brand); }
.wizard-bar { background: var(--line); }
.wizard-bar i { background: var(--brand); }
.wizard-counts, .wz-meta, .wz-leftovers small { color: var(--muted); }
.wz-chip { background: var(--brand-soft); color: var(--brand-2); }
.wz-chip.soft { background: var(--bg); color: #475467; }
.wz-chip.warn { background: var(--amber-soft); color: var(--amber-ink); }
.wz-tasks li, .plan-group li { background: var(--soft); border: 1px solid var(--line); }
.plan-group li small { color: var(--muted); }
.plan-action { border-color: var(--line-2); color: var(--ink); background: #fff; }
.wz-hint { color: var(--amber-ink); }
.wz-bulk { border: 1px dashed var(--brand); background: var(--brand-soft); color: var(--brand-2); }
.wz-leftovers { border-top-color: var(--line); }
.wizard-map-banner { background: var(--amber-soft); color: #93370d; border: 1px solid #fedf89; box-shadow: 0 4px 12px rgba(16,24,40,.08); }
.wizard-mode .marker.ghost:hover, .wizard-mode .marker.ghost:focus-visible { outline-color: var(--ink); }

/* polígonos (panel derecho y ficha) */
.poly-list li { background: var(--soft); border: 1px solid var(--line); }
.poly-list li:hover { background: var(--bg); }
.poly-list li small, .part-row small, .sub-chip small { color: var(--muted); }
.poly-list .empty-li { color: var(--muted); }
.poly-step span, .hole-tag, .part-tag { color: var(--brand); }
.part-tag { background: var(--brand-soft); }
.poly-status, .owner-empty, .sub-summary .sub-warn { color: var(--amber-ink); }
.owner-hint { color: var(--muted); } .owner-hint.official { color: var(--green-ink); } .owner-hint.provisional { color: var(--amber-ink); }
.owner-chip { background: var(--brand-soft); color: var(--brand-2); }
.owner-chip button { background: rgba(16,24,40,.08); color: var(--ink); }
.owner-none { color: var(--muted); }
.parts-box { background: var(--soft); border-color: var(--line); }
.part-row { background: #fff; border: 1px solid var(--line); }
.hole-row, .sub-summary p { color: var(--ink-2); }
.sub-chip { background: var(--soft); border: 1px solid var(--line); }
.provisional-tag, .hz-prov-dot { background: #fef0c7; color: #93370d; }

/* ---------- Plano ---------- */
.stage { background: var(--bg); padding: 12px !important; }
.map-shell { border: 1px solid var(--line); border-radius: 10px; box-shadow: none; background: #fcfcfd; }
.map-toolbar { background: var(--ink); border-radius: 8px; font-size: 13px; font-weight: 500; box-shadow: 0 4px 12px rgba(16,24,40,.16); }
.map-toolbar button { background: #fff; color: var(--ink); }
.appmode-edit .map-shell { outline: 2px solid #1d4ed8; outline-offset: -2px; }
.appmode-polygons .map-shell { outline: 2px solid var(--brand); outline-offset: -2px; }
.zoom-controls { filter: none; box-shadow: 0 1px 2px rgba(16,24,40,.08); border-radius: 8px; }
.zoom-controls button { border-color: var(--line); color: var(--ink-2); font-weight: 600; }
.zoom-controls button:hover { background: var(--soft); }
.add-hint { background: var(--ink); border-radius: 8px; font-size: 13px; }
.empty div { border-color: var(--line); color: var(--muted); border-radius: 10px; }
.hz-legend-bar { border: 1px solid var(--line); border-radius: 8px; box-shadow: 0 1px 2px rgba(16,24,40,.06); color: #475467; font-size: 12px; }
.poly-label { font-weight: 600; border-radius: 4px; }
.prog-reopen { background: #fff; color: var(--ink); border: 1px solid var(--line-2); border-radius: 8px; font-weight: 600; box-shadow: 0 1px 2px rgba(16,24,40,.08); }
.prog-reopen:hover { background: var(--soft); }

/* Tarjeta de actividad y avisos oscuros: grafito neutro */
.card { background: var(--ink); border-radius: 10px; box-shadow: 0 12px 28px rgba(16,24,40,.28); }
/* La ficha visible queda sobre todas las etiquetas del plano (incluidas las agrupadas, resaltadas y seleccionadas),
   pero bajo las barras y controles del mapa. */
.card.visible { z-index: 7; }
/* v3.4.8.5 · actividad agrupada: aviso "1 de N en este lugar" en la ficha y resalte del grupo */
.card-cluster { margin: 10px 0 0; padding-top: 8px; border-top: 1px solid rgba(255,255,255,.1); font-size: 12px; line-height: 1.4; color: #d0d5dd; }
.card-cluster b { color: #5fbf9a; font-weight: 600; }
.marker.pm.pm-cluster.loop-focus { z-index: 5; box-shadow: 3px -3px 0 -1px var(--pm-bg), 3px -3px 0 0 var(--pm-bd), 0 0 0 3px rgba(32,220,137,.55); }
.card.visible.card-over { z-index: 31; } /* ficha al pasar el mouse: sobre la lista de un grupo (z-index 30) */
.marker.pm.pm-cluster.sel { z-index: 6; box-shadow: 0 0 0 2px #fff, 0 0 0 4px #101828; }
.card:after, .card-tab { background: var(--ink); }
.card-tab:hover, .card-tab:focus-visible { background: #1d2939; color: #5fbf9a; }
.card .location, .progress-ring-label, .card-updated { color: #98a2b3; }
.schedule { border-top-color: rgba(255,255,255,.1); }
.schedule b { color: #5fbf9a; font-weight: 600; letter-spacing: .04em; }
.schedule p { color: #d0d5dd; }
.progress-ring:before { background: var(--ink); }
.program-badge { background: rgba(95,191,154,.16); color: #9fe0c4; }
.poly-info { background: var(--ink); border-radius: 10px; }
.poly-info p { color: #d0d5dd; }
.poly-owners span { color: #5fbf9a; }
.poly-info small, .poly-info-close { color: #98a2b3; }
.cloud-notice { background: var(--ink); border-radius: 8px; font-weight: 500; }
.hz-tip { background: var(--ink); }
.hz-pop { background: var(--ink); color: #e4e7ec; border-radius: 10px; }
.hz-pop header b { color: #5fbf9a; }
.hz-pop header button { background: #344054; }

/* ---------- Gestión de sitio: panel izquierdo (nuevo hallazgo y filtros) ---------- */
.hz-card { background: var(--soft); border: 1px solid #fedf89; border-radius: 10px; }
.hz-x { color: var(--ink-2); }
.hz-step { color: var(--brand); }
.hz-field input[type=text], .hz-field textarea { border: 1px solid var(--line-2); }
.hz-note { color: var(--muted); } .hz-note b { color: var(--ink); }
.hz-warn { color: var(--amber-ink); }
.hz-tile { border: 1px solid var(--line-2); background: #fff; color: var(--ink-2); font-weight: 600; }
.hz-tile[aria-pressed="true"] { border: 2px solid var(--red); background: var(--red-soft); color: var(--red-ink); }
.hz-check { color: var(--ink-2); }
.hz-photo button { background: var(--ink); }
.hz-photo-add { border-color: var(--line-2); color: var(--brand); background: #fff; }
.hz-done { background: var(--green-soft); border: 1px solid #abefc6; color: var(--ink); }
.hz-done > b { background: var(--green); color: #fff; }
.hz-done span small { color: var(--muted); }
.hz-done button { border-color: var(--line-2); color: var(--ink); background: #fff; }
.hz-seg { border: 0; background: var(--bg); padding: 3px; border-radius: 8px; gap: 2px; }
.hz-seg button { color: #475467; border-radius: 6px; font-weight: 500; }
.hz-seg button.on { background: #fff; color: var(--ink); font-weight: 600; box-shadow: 0 1px 2px rgba(16,24,40,.1); }
.hz-ptrow { color: var(--ink-2); }

/* ---------- Gestión de sitio: panel derecho ---------- */
.hz-kicker, .pv-kick { color: var(--muted); letter-spacing: .06em; font-weight: 600; }
.hz-title { font-weight: 600; }
.hz-org { border-top-color: var(--line); }
.hz-org span { color: var(--muted); }
.hz-owner, .hz-own, .hz-stats div, .hz-row { background: var(--soft); border: 1px solid var(--line); color: var(--ink); }
.hz-owner.hl, .hz-own.hl, .hz-row.hl { background: var(--bg); box-shadow: 0 0 0 2px var(--brand); }
.hz-row.sel { background: #fff; box-shadow: 0 0 0 2px var(--ink); }
.hz-owner-top em, .hz-row small, .hz-empty { color: var(--muted); }
.hz-owner-top small, .hz-row em.old { color: var(--red-ink); }
.hz-bar { background: var(--line); }
.hz-owner-sub, .hz-stats span, .hz-sum { color: var(--muted); }
.hz-row.sel small { color: var(--muted); }

/* ---------- Tablero, lista y dueños (vista principal) ---------- */
.hz-kpi, .hz-box { border-color: var(--line); border-radius: 10px; }
.hz-age, .hz-quick { background: var(--ink); color: #e4e7ec; border-radius: 10px; }
.hz-age > span { color: #5fbf9a; }
.hz-agebar { background: #344054; }
.hz-agelbl { color: #d0d5dd; }
.hz-quick b { color: #5fbf9a; }
.hz-seg2 i:first-child, .hz-seg2 i.a { background: var(--ink); }
.hz-b-seg, .hz-b-head select, .hz-lfilters select, .hz-goto, .hz-mini, .hz-f-close, .hz-f-foot .hz-light { border-color: var(--line-2); border-radius: 8px; }
.hz-f-foot .hz-primary { color: #fff; }

/* ---------- Programa y Actividades: panel derecho ---------- */
.pv-card { border-color: var(--line); border-radius: 10px; }
.pv-card.hv { border-color: var(--muted-2); box-shadow: none; }
.pv-card.on { border-color: var(--ink); box-shadow: 0 0 0 1px var(--ink); }
.pv-head b, .pv-head strong { font-weight: 600; }
.pv-sub { color: var(--muted); }
.pv-bar { background: var(--bg); height: 6px; }
.pv-bar i { background: #5fbf9a; }
.pv-complab { color: var(--muted); }
.pv-legend { background: var(--soft); border: 1px solid var(--line); color: var(--ink-2); }
.pv-legend small { color: var(--muted); }
.pv-clear { border-color: var(--line-2); color: var(--ink); background: #fff; }

/* ---------- Panel inferior (lista de actividades en Administración) ---------- */
.panel-bottom { background: var(--surface); color: var(--ink); border-top: 1px solid var(--line); box-shadow: none; }
.panel-bottom .work-row:hover { background: var(--bg); }
.transfer-status.error { color: var(--red-ink); }

/* ---------- Diálogos ---------- */
.import-dialog { border-radius: 12px; border: 1px solid var(--line); box-shadow: 0 20px 48px rgba(16,24,40,.2); }
.import-dialog .replace { background: #fff; color: var(--ink); border: 1px solid var(--line-2); }
.import-dialog p, .import-dialog .field-label, .history-date, .history-empty, .program-week-pick small { color: var(--muted); }

/* ---------- Inicio de sesión ---------- */
.login-screen { background: #fff; display: grid; grid-template-columns: minmax(0, 53fr) minmax(0, 47fr); place-items: stretch; padding: 0; }
.login-screen[hidden] { display: none; }
.login-hero { position: relative; overflow: hidden; background: var(--rail); color: #fff; padding: 48px 56px; display: flex; flex-direction: column; }
.login-plano { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; object-position: right bottom; pointer-events: none; user-select: none; }
.login-brand, .login-copy, .login-features { position: relative; }
.login-brand { display: flex; align-items: center; gap: 12px; font-size: 20px; }
.login-brand b { font-weight: 700; letter-spacing: -.01em; }
.login-brand i { font-style: normal; color: #5fbf9a; }
.login-mark { width: 40px; height: 40px; border-radius: 9px; background: var(--brand); display: grid; place-items: center; }
.login-mark svg { width: 24px; height: 24px; fill: none; stroke: #fff; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }
.login-copy { margin-top: auto; display: flex; flex-direction: column; gap: 18px; max-width: 540px; }
.login-kicker { font-family: "IBM Plex Mono", monospace; font-size: 12px; color: #5fbf9a; letter-spacing: .08em; }
.login-copy h1 { margin: 0; font-size: clamp(28px, 3vw, 40px); line-height: 1.15; font-weight: 600; letter-spacing: -.01em; }
.login-copy p { margin: 0; font-size: 16px; line-height: 1.6; color: #d0d5dd; }
.login-features { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 24px; margin-top: 40px; padding-top: 24px; border-top: 1px solid rgba(255,255,255,.12); }
.login-features div { display: flex; flex-direction: column; gap: 4px; }
.login-features b { font-size: 13px; font-weight: 600; }
.login-features span { font-size: 12.5px; line-height: 1.5; color: #98a2b3; }
.login-side { position: relative; display: flex; align-items: center; justify-content: center; padding: 48px; background: #fff; }
.login-card { width: min(380px, 100%); display: grid; gap: 6px; padding: 0; background: transparent; color: var(--ink); border: 0; box-shadow: none; border-radius: 0; }
.login-card h2 { margin: 0 0 14px; font-size: 26px; font-weight: 600; letter-spacing: -.01em; }
.login-card .field-label { color: var(--ink-2); font-size: 13px; font-weight: 500; margin: 10px 0 2px; }
.login-card input { height: 44px; padding: 0 14px; border: 1px solid var(--line-2); border-radius: 8px; background: #fff; color: var(--ink); font-size: 14px; }
.login-card input:focus { outline: none; border-color: var(--brand); box-shadow: 0 0 0 3px rgba(15,118,110,.15); }
.login-card .add { margin-top: 14px; height: 44px; font-size: 14px; }
.login-error { color: var(--red-ink); font-size: 13px; margin: 4px 0 0; min-height: 0; }
.login-help { margin: 12px 0 0; font-size: 13px; color: var(--muted); text-align: center; }
.login-foot { position: absolute; bottom: 28px; left: 0; right: 0; text-align: center; font-size: 12px; color: var(--muted-2); }
@media (max-width: 900px) {
  .login-screen { grid-template-columns: 1fr; overflow-y: auto; }
  .login-hero { padding: 28px 24px; min-height: 0; }
  .login-copy { margin-top: 28px; }
  .login-copy p, .login-features { display: none; }
}

/* ---------- Pantallas angostas ---------- */
@media (max-width: 900px) {
  .shell { grid-template-columns: 56px minmax(0, 1fr); grid-template-areas: "rail top" "rail sub" "rail main" "rail bottom"; }
  .rail { padding: 8px 0; }
  .rail-btn, .rail .tab { width: 48px; }
  .tb-row { flex-wrap: wrap; padding: 8px 12px; gap: 8px 12px; }
  .tb-user, .compliance-label, .tb-sub, .mode-indicator { display: none; }
  .tb-levels .level-btn span { display: none; }
  .panel-left, .panel-right { width: auto; }
}

/* ---------- Ajustes finos ---------- */
.program-option { color: var(--ink-2); }
.program-week { color: var(--muted); }
.program-load { background: var(--soft); border: 1px solid var(--line); border-radius: 10px; }
.admin-tab { font-size: 13px; }
.add, .danger-button, .cancel-edit { font-size: 14px; }
.hz-step { color: #475467; letter-spacing: .04em; font-weight: 600; }
.pv-top .hz-kicker { text-transform: none; letter-spacing: 0; font-size: 12.5px; font-weight: 400; line-height: 1.45; }
.appmode-edit .add-hint { top: 64px; }
#mapImage { filter: grayscale(1) contrast(1.6) brightness(.78); }
.compliance-fill { background: #5fbf9a !important; }
.hz-legend-bar { background: #fff; }
@media (max-width: 900px) {
  .hz-subbar { padding: 0 12px; }
  .hz-subnav { flex-wrap: nowrap; overflow-x: auto; gap: 18px; scrollbar-width: none; }
  .hz-subnav button { white-space: nowrap; padding: 14px 0; }
}

/* v3.4.8.1 · barra del modo edición con salida visible */
#editToolbar { gap: 8px; padding: 5px 5px 5px 12px; }
#editToolbar .et-mode { display: inline-flex; align-items: center; gap: 7px; font-weight: 600; color: #fff; }
#editToolbar .et-mode i { width: 8px; height: 8px; border-radius: 50%; background: #f0a500; box-shadow: 0 0 0 3px rgba(240,165,0,.25); }
#editToolbar .et-hint { color: #98a2b3; font-weight: 400; padding-right: 4px; }
#editToolbar #newActivity { background: rgba(255,255,255,.12); color: #fff; }
#editToolbar #newActivity:hover { background: rgba(255,255,255,.2); }
#editToolbar .et-exit { display: inline-flex; align-items: center; gap: 8px; background: #fff; color: var(--ink); }
#editToolbar .et-exit:hover { background: #f2f4f7; }
#editToolbar .et-exit kbd { font: 600 10.5px/1 "IBM Plex Mono", ui-monospace, monospace; padding: 3px 5px; border-radius: 4px; border: 1px solid #d0d5dd; color: #475467; background: #f9fafb; }
@media (max-width: 760px) { #editToolbar .et-hint, #editToolbar .et-exit kbd { display: none; } }

/* v3.4.8.2 · usuarios en línea (solo administradores) */
.online-menu { position: relative; }
.online-menu[hidden] { display: none; }
.online-btn { height: 28px; padding: 0 10px 0 8px; border: 0; border-radius: 14px; background: #f2f4f7; color: #344054; font-family: inherit; font-size: 12px; font-weight: 600; line-height: 1; display: inline-flex; align-items: center; gap: 6px; cursor: pointer; white-space: nowrap; }
.online-btn:hover, .online-btn[aria-expanded="true"] { background: #eaecf0; }
.online-btn i { width: 6px; height: 6px; border-radius: 50%; background: #12b76a; }
.online-dropdown { position: absolute; top: calc(100% + 8px); right: -8px; z-index: 60; width: 360px; border-radius: 10px; background: #fff; border: 1px solid #eaecf0; box-shadow: 0 12px 16px -4px rgba(16,24,40,.1), 0 4px 6px -2px rgba(16,24,40,.04); overflow: hidden; }
.online-head { display: flex; flex-direction: column; gap: 2px; padding: 12px 14px; border-bottom: 1px solid #f2f4f7; }
.online-head b { font-size: 13px; font-weight: 600; color: var(--ink); }
.online-head small { font-size: 12px; color: #667085; }
.online-row { display: grid; grid-template-columns: 30px 1fr auto; gap: 10px; align-items: center; padding: 8px 14px; }
.online-av { position: relative; width: 30px; height: 30px; border-radius: 50%; background: #f2f4f7; color: #344054; display: grid; place-items: center; font-size: 11px; font-weight: 600; }
.online-av i { position: absolute; right: -1px; bottom: -1px; width: 9px; height: 9px; border-radius: 50%; border: 2px solid #fff; background: #12b76a; }
.online-av i.idle { background: #f0a500; }
.online-who { display: flex; flex-direction: column; min-width: 0; }
.online-who b { font-size: 13px; font-weight: 600; color: var(--ink); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.online-who small { font-size: 11.5px; color: #667085; }
.online-when { font-size: 11.5px; color: #667085; }
.online-empty { margin: 0; padding: 12px 14px; font-size: 13px; color: #667085; }
@media (max-width: 760px) { .online-btn { font-size: 0; gap: 4px; } .online-btn #onlineCount { font-size: 12px; } }

/* v3.4.8.2 · paleta de polígonos y trazo más fino */
.poly { stroke-width: 1.5; }
.poly.selected { stroke-width: 2.5; }
.poly-swatches { display: flex; flex-wrap: wrap; gap: 6px; margin: 2px 0 4px; }
.poly-swatch { width: 26px; height: 26px; padding: 0; border-radius: 7px; border: 2px solid #fff; background: var(--sw); box-shadow: 0 0 0 1px #d0d5dd; cursor: pointer; }
.poly-swatch:hover { box-shadow: 0 0 0 1px var(--sw); }
.poly-swatch.on { box-shadow: 0 0 0 2px var(--ink); }

/* v3.4.8.3 · Administración › Actividades: búsqueda, duplicados y eliminación múltiple */
#workList .list-tools { grid-column: 1 / -1; position: sticky; top: 0; z-index: 2; display: flex; flex-wrap: wrap; align-items: center; gap: 8px; padding: 4px 0 8px; background: #fff; }
#workList .list-tools input[type=search] { width: 240px; height: 32px; padding: 0 10px; border: 1px solid #d0d5dd; border-radius: 8px; font-size: 13px; }
#workList .list-seg { display: inline-flex; padding: 3px; border-radius: 8px; background: #f2f4f7; }
#workList .list-seg button { height: 26px; padding: 0 10px; border: 0; border-radius: 6px; background: transparent; color: #475467; font-size: 12.5px; font-weight: 600; cursor: pointer; }
#workList .list-seg button.on { background: #fff; color: #101828; box-shadow: 0 1px 2px rgba(16,24,40,.1); }
#workList .list-all { display: inline-flex; align-items: center; gap: 6px; font-size: 12.5px; color: #344054; cursor: pointer; }
#workList .list-all input, #workList .list-pick { width: 16px; height: 16px; margin: 0; padding: 0; accent-color: #101828; flex: none; cursor: pointer; }
#workList .list-del { margin-left: auto; height: 32px; padding: 0 12px; font-size: 12.5px; }
#workList .list-del:disabled { opacity: .45; cursor: default; }
#workList .dup-tag { display: inline-block; margin-right: 4px; padding: 1px 7px; border-radius: 10px; background: #fef0c7; color: #93370d; font-size: 11px; font-weight: 600; vertical-align: 1px; }
.dup-dialog .import-dialog-actions { grid-template-columns: 1fr 1fr; }
.user-table small.user-seen { display: block; margin-top: 2px; color: #667085; font-size: 11.5px; }
.user-table small.user-seen.online { color: #067647; font-weight: 600; }
.user-table small.user-seen.online::before { content: ""; display: inline-block; width: 6px; height: 6px; margin-right: 5px; border-radius: 50%; background: #12b76a; vertical-align: 1px; }

/* v3.4.8.6 · barra superior de Programa (Mapa · Lista · Programa trisemanal), con el mismo aspecto que la de Sitio */
.prog-subbar { grid-area: sub; display: none; align-items: stretch; gap: 12px; padding: 0 20px; min-height: 52px; box-sizing: border-box; background: var(--surface); border-bottom: 1px solid var(--line); z-index: 5; }
.prog-sub-on .prog-subbar { display: flex; }
.hz-subnav button[hidden] { display: none; }
.list-count { font-size: 12px; color: var(--muted); }
@media (max-width: 900px) {
  .prog-subbar { padding: 0 12px; }
}
