* { margin: 0; padding: 0; box-sizing: border-box; }

:root {
  color-scheme: light;
  --bg: #f0ede6;
  --surface: #fbfbfb;
  --soft: #efece4;
  --line: #e2ded2;
  --line-soft: #e8e4da;
  --ink: #2b2a26;
  --gray: #8a8578;
  --charcoal: #3a372f;
  --featured-ink: #ffffff;
  --muted-on-featured: #b3ac9a;
  --featured-veil: rgba(255, 255, 255, .14);
  --sidebar: #35322b;
  --sidebar-deep: #2a2822;
  --sidebar-ink: #b7b0a0;
  --sidebar-hi: #ffffff;
  --sidebar-hi-ink: #2b2a26;
  --hover-row: #f4f1ea;
  --badge: #e6e2d8;
  --overlay: rgba(43, 42, 38, .45);
  --c1: #2b2a26;
  --c2: #767162;
  --c3: #a29b89;
  --c4: #d3ccba;
}

[data-theme="oscuro"] {
  color-scheme: dark;
  --bg: #171613;
  --surface: #201f1b;
  --soft: #2a2924;
  --line: #3a3831;
  --line-soft: #2e2c26;
  --ink: #e8e6df;
  --gray: #9d9789;
  --charcoal: #e8e6df;
  --featured-ink: #201f1b;
  --muted-on-featured: #6f6a5b;
  --featured-veil: rgba(32, 31, 27, .10);
  --sidebar: #1c1b17;
  --sidebar-deep: #141310;
  --sidebar-ink: #8f897b;
  --sidebar-hi: #e8e6df;
  --sidebar-hi-ink: #201f1b;
  --hover-row: #262520;
  --badge: #3a3831;
  --overlay: rgba(0, 0, 0, .6);
  --c1: #e8e6df;
  --c2: #b3ac9a;
  --c3: #8f897b;
  --c4: #5c574b;
}

body {
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  background: var(--bg);
  color: var(--ink);
  -webkit-tap-highlight-color: transparent;
}

.shell { display: flex; height: 100vh; height: 100dvh; overflow: hidden; }

/* ---------- Sidebar ---------- */
.sidebar {
  width: 68px; background: var(--sidebar);
  display: flex; flex-direction: column; align-items: center;
  transition: width .2s ease; overflow: hidden; flex: none;
}
.sidebar-toggle {
  width: 68px; height: 64px; flex: none;
  background: var(--sidebar-deep); border: none; color: var(--sidebar-hi);
  display: grid; place-items: center; cursor: pointer;
}
.nav { display: flex; flex-direction: column; gap: 8px; align-items: center; padding: 16px 0; flex: 1; width: 100%; }
.nav-item {
  width: 44px; height: 44px; flex: none;
  border: none; border-radius: 10px; background: transparent;
  color: var(--sidebar-ink); cursor: pointer;
  display: flex; align-items: center; justify-content: center; gap: 12px;
}
.nav-item span { display: none; font-size: 14px; font-weight: 600; white-space: nowrap; }
.nav-item:hover { color: var(--sidebar-hi); background: rgba(255,255,255,.08); }
.nav-item.active { background: var(--sidebar-hi); color: var(--sidebar-hi-ink); }
.sidebar-bottom { padding: 16px 0; display: flex; justify-content: center; width: 100%; }

.sidebar.expanded { width: 220px; align-items: stretch; }
.sidebar.expanded .sidebar-toggle { width: 100%; }
.sidebar.expanded .nav { padding: 16px 12px; }
.sidebar.expanded .nav-item { width: 100%; justify-content: flex-start; padding: 0 12px; }
.sidebar.expanded .nav-item span { display: inline; }
.sidebar.expanded .sidebar-bottom { padding: 16px 12px; justify-content: flex-start; }

/* ---------- Bottom bar ---------- */
.bottombar {
  display: none;
  position: fixed; left: 0; right: 0; bottom: 0; z-index: 50;
  background: var(--surface);
  border-top: 1px solid var(--line);
  padding-bottom: env(safe-area-inset-bottom);
}
.bottombar .slider {
  display: flex;
  overflow-x: auto;
  overscroll-behavior-x: contain;
  -webkit-overflow-scrolling: touch;
  scrollbar-width: none;
  padding: 6px;
}
.bottombar .slider::-webkit-scrollbar { display: none; }
.bottombar .nav-item {
  width: auto; min-width: 74px; height: 52px;
  margin: 0 3px; padding: 0 12px; border-radius: 12px;
  flex-direction: column; gap: 3px;
  color: var(--gray);
}
.bottombar .nav-item span { display: block; font-size: 10px; font-weight: 600; }
.bottombar .nav-item:hover { background: transparent; color: var(--gray); }
.bottombar .nav-item:active { transform: scale(.96); }
.bottombar .nav-item.active { background: var(--charcoal); color: var(--featured-ink); }

/* ---------- Topbar ---------- */
.main { flex: 1; display: flex; flex-direction: column; min-width: 0; }
.topbar {
  height: 64px; flex: none; background: var(--surface);
  border-bottom: 1px solid var(--line-soft);
  display: flex; align-items: center; justify-content: space-between;
  padding: 0 24px;
  padding-top: env(safe-area-inset-top);
}
.brand { display: flex; align-items: center; gap: 10px; font-weight: 700; font-size: 16px; }
.brand-logo { width: 32px; height: 32px; border: 2px solid var(--ink); border-radius: 50%; display: grid; place-items: center; }
.topbar-right { display: flex; align-items: center; gap: 12px; }
.bell { position: relative; background: none; border: none; cursor: pointer; color: var(--ink); padding: 6px; }
.bell-badge {
  position: absolute; top: -2px; right: -4px;
  background: var(--badge); color: var(--ink);
  font-size: 10px; font-weight: 700;
  min-width: 16px; height: 16px; border-radius: 8px;
  display: grid; place-items: center; padding: 0 4px;
}
.user { display: flex; align-items: center; gap: 10px; }
.user-meta { text-align: right; line-height: 1.25; }
.user-name { display: block; font-size: 13px; font-weight: 700; }
.user-role { display: block; font-size: 11px; color: var(--gray); }
.avatar { width: 36px; height: 36px; border-radius: 50%; background: var(--badge); color: var(--charcoal); display: grid; place-items: center; }

/* Switch de tema: luna en claro, sol en oscuro */
.theme-toggle .icon-sun { display: none; }
[data-theme="oscuro"] .theme-toggle .icon-sun { display: block; }
[data-theme="oscuro"] .theme-toggle .icon-moon { display: none; }

/* ---------- Viewport ---------- */
.viewport { flex: 1; overflow: auto; padding: 24px; }

/* ---------- Cards / KPIs ---------- */
.card { background: var(--surface); border: 1px solid var(--line); border-radius: 8px; }
.kpi-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 20px; margin-bottom: 20px; }
.kpi { padding: 18px 20px; display: flex; justify-content: space-between; align-items: flex-start; }
.kpi .label { font-size: 14px; font-weight: 600; color: var(--charcoal); }
.kpi .value { font-size: 26px; font-weight: 800; margin: 6px 0 4px; }
.kpi .sub { font-size: 12px; color: var(--gray); }
.kpi .kicon { width: 38px; height: 38px; border-radius: 8px; flex: none; background: var(--soft); color: var(--ink); display: grid; place-items: center; }
.kpi.dark { background: var(--charcoal); border-color: var(--charcoal); }
.kpi.dark .label { color: var(--surface); }
.kpi.dark .value { color: var(--featured-ink); }
.kpi.dark .sub { color: var(--muted-on-featured); }
.kpi.dark .kicon { background: var(--featured-veil); color: var(--featured-ink); }

/* ---------- Charts ---------- */
.charts-grid { display: grid; grid-template-columns: 1.9fr 1fr; gap: 20px; margin-bottom: 20px; }
.card-head { display: flex; justify-content: space-between; align-items: center; padding: 16px 20px; }
.card-title { font-size: 15px; font-weight: 700; }
.icon-btn { width: 32px; height: 32px; border: none; border-radius: 8px; background: var(--soft); color: var(--charcoal); display: grid; place-items: center; cursor: pointer; }
.legend { display: flex; gap: 18px; justify-content: center; padding: 0 20px 8px; flex-wrap: wrap; }
.legend span { display: flex; align-items: center; gap: 6px; font-size: 11px; color: var(--gray); }
.legend .dot { width: 8px; height: 8px; border-radius: 50%; }
.line-svg { width: 100%; height: auto; display: block; padding: 0 12px 12px; }
.donut-svg { width: 170px; height: 170px; display: block; margin: 8px auto 20px; }
.axis { font-size: 10px; fill: var(--gray); text-anchor: middle; }

/* ---------- Tabla ---------- */
.table-wrap { overflow-x: auto; }
.data-table { width: 100%; border-collapse: collapse; }
.data-table th { text-align: left; padding: 12px 16px; font-size: 12px; font-weight: 700; border-bottom: 1px solid var(--line); }
.data-table td { padding: 14px 16px; font-size: 12px; border-bottom: 1px solid var(--line-soft); }
.data-table tr:hover td { background: var(--hover-row); }
.link { background: none; border: none; cursor: pointer; font-size: 11px; font-weight: 700; color: var(--ink); text-decoration: underline; }
.pagination { display: flex; justify-content: center; gap: 8px; padding: 16px; }
.page { min-width: 28px; height: 28px; border: none; border-radius: 6px; background: var(--soft); color: var(--charcoal); font-size: 12px; font-weight: 600; cursor: pointer; }
.page.active { background: var(--charcoal); color: var(--featured-ink); }
.page.dots { background: transparent; cursor: default; }

/* ---------- Módulo vacío ---------- */
.empty-card { padding: 60px 20px; text-align: center; color: var(--gray); }
.empty-card h2 { color: var(--ink); font-size: 20px; margin-bottom: 8px; }

/* ===== Kit compartido ===== */
.toolbar { display: flex; gap: 12px; align-items: center; flex-wrap: wrap; margin-bottom: 16px; }
.search { flex: 1; min-width: 220px; height: 40px; display: flex; align-items: center; gap: 8px; padding: 0 12px; background: var(--surface); border: 1px solid var(--line); border-radius: 8px; color: var(--gray); }
.search input { flex: 1; border: none; outline: none; background: transparent; font-size: 13px; color: var(--ink); }
.chips { display: flex; gap: 8px; }
.chip { height: 40px; padding: 0 14px; border: 1px solid var(--line); border-radius: 8px; background: var(--surface); font-size: 12px; font-weight: 600; color: var(--charcoal); cursor: pointer; }
.chip.active { background: var(--charcoal); border-color: var(--charcoal); color: var(--featured-ink); }
.btn-primary { height: 40px; padding: 0 16px; border: none; border-radius: 8px; background: var(--charcoal); color: var(--featured-ink); font-size: 13px; font-weight: 600; cursor: pointer; display: inline-flex; align-items: center; gap: 8px; }
.btn-primary:active { transform: scale(.98); }
.btn-ghost { height: 38px; padding: 0 14px; border: 1px solid var(--line); border-radius: 8px; background: var(--surface); font-size: 13px; font-weight: 600; color: var(--charcoal); cursor: pointer; }
.count { color: var(--gray); font-weight: 600; font-size: 13px; }
.cell-sub { font-size: 11px; color: var(--gray); margin-top: 2px; }
.badge-state { display: inline-flex; align-items: center; gap: 6px; font-size: 11px; font-weight: 600; color: var(--charcoal); white-space: nowrap; }
.badge-state .dot { width: 8px; height: 8px; border-radius: 50%; background: var(--c4); }
.badge-state.activo .dot { background: var(--c1); }
.badge-state.tratamiento .dot { background: var(--c2); }
.badge-state.inactivo { color: var(--gray); }

/* Modales */
.modal-backdrop { position: fixed; inset: 0; z-index: 100; background: var(--overlay); display: flex; align-items: center; justify-content: center; padding: 16px; }
.modal { background: var(--surface); border-radius: 12px; width: 100%; max-width: 460px; max-height: 85vh; overflow: auto; }
.modal-head { display: flex; align-items: center; justify-content: space-between; padding: 16px 20px; border-bottom: 1px solid var(--line); }
.modal-title { font-size: 15px; font-weight: 700; }
.modal-body { padding: 20px; display: grid; gap: 12px; }
.modal-foot { display: flex; justify-content: flex-end; gap: 8px; padding: 16px 20px; border-top: 1px solid var(--line); }
.grid-2 { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.field label { display: block; font-size: 11px; font-weight: 700; letter-spacing: .03em; text-transform: uppercase; color: var(--gray); margin-bottom: 6px; }
.field input, .field select { width: 100%; height: 40px; padding: 0 12px; border: 1px solid var(--line); border-radius: 8px; background: var(--soft); font-size: 13px; color: var(--ink); outline: none; }
.field input:focus, .field select:focus { border-color: var(--charcoal); }
.ficha-row { display: flex; justify-content: space-between; gap: 16px; padding: 9px 0; border-bottom: 1px dashed var(--line); font-size: 13px; }
.ficha-row:last-child { border-bottom: none; }
.ficha-row span:first-child { color: var(--gray); }

/* ---------- Responsive ---------- */
@media (max-width: 1100px) {
  .kpi-grid { grid-template-columns: repeat(2, 1fr); }
  .charts-grid { grid-template-columns: 1fr; }
}
@media (max-width: 768px) {
  .sidebar { display: none; }
  .bottombar { display: block; }
  .topbar { padding: 0 16px; }
  .viewport { padding: 16px; padding-bottom: calc(84px + env(safe-area-inset-bottom)); }
}
@media (max-width: 640px) {
  .user-meta { display: none; }
}
@media (max-width: 520px) {
  .kpi-grid { grid-template-columns: 1fr; }
}
@media (max-width: 480px) {
  .grid-2 { grid-template-columns: 1fr; }
}


/* ===== Login ===== */
.login-screen { position: fixed; inset: 0; z-index: 200; background: var(--bg); display: flex; align-items: center; justify-content: center; padding: 16px; }
.login-card { width: 100%; max-width: 360px; padding: 28px; display: grid; gap: 14px; justify-items: center; text-align: center; }
.login-brand { display: flex; align-items: center; gap: 10px; font-weight: 700; font-size: 18px; }
.login-card .field { width: 100%; text-align: left; }
.field-msg { font-size: 11px; color: var(--gray); min-height: 15px; margin-top: 4px; }
.field-msg.error { color: var(--ink); font-weight: 700; }

/* ===== Propietario inteligente ===== */
.prop-status { margin-top: 6px; display: flex; gap: 6px; align-items: center; flex-wrap: wrap; }
.prop-chip { display: inline-flex; align-items: center; gap: 6px; background: var(--soft); border: 1px solid var(--line); border-radius: 999px; padding: 4px 10px; font-size: 11px; font-weight: 700; color: var(--charcoal); }
.prop-chip button { border: none; background: none; cursor: pointer; color: var(--gray); font-size: 12px; line-height: 1; }
.prop-chip.ok::before { content: '✔'; }
.prop-chip.no::before { content: '✖'; }
.prop-cands { margin-top: 6px; display: grid; gap: 4px; max-height: 140px; overflow: auto; }
.prop-cand { display: flex; justify-content: space-between; gap: 10px; background: var(--surface); border: 1px solid var(--line); border-radius: 8px; padding: 8px 10px; font-size: 12px; cursor: pointer; color: var(--ink); text-align: left; }
.prop-cand:hover { background: var(--soft); }
.prop-cand span:last-child { color: var(--gray); }

/* ===== Panel Cliente: desktop al costado / móvil encima ===== */
.modal-backdrop.panel-cliente { z-index: 120; background: rgba(0, 0, 0, .25); justify-content: flex-end; padding: 24px; }
.modal-backdrop.panel-cliente .modal { width: 380px; max-height: calc(100vh - 48px); }
@media (max-width: 768px) {
  .modal-backdrop.panel-cliente { justify-content: center; padding: 16px; }
  .modal-backdrop.panel-cliente .modal { width: 100%; }
}

/* ===== Varios ===== */
.check { display: flex; gap: 8px; align-items: center; font-size: 12px; color: var(--gray); cursor: pointer; }
.check input { accent-color: var(--charcoal); }
.toast { position: fixed; left: 50%; bottom: 24px; transform: translateX(-50%); z-index: 300; background: var(--charcoal); color: var(--featured-ink); border-radius: 10px; padding: 10px 16px; font-size: 13px; font-weight: 600; }
.badge-state.baja { color: var(--gray); }
.badge-state.baja .dot { background: var(--c4); }


/* ===== Listador fusionado ===== */
.lz-filtros { display: flex; gap: 8px; flex-wrap: wrap; margin-bottom: 12px; }
.lz-badges { display: flex; gap: 8px; flex-wrap: wrap; margin-bottom: 12px; min-height: 8px; }
.lz-filtro { min-width: 160px; }
.lz-badge { display: inline-flex; align-items: center; gap: 6px; background: var(--soft); border: 1px solid var(--line); border-radius: 999px; padding: 4px 10px; font-size: 11px; color: var(--charcoal); animation: badgeIn .2s ease; }
.lz-badge strong { color: var(--ink); }
.lz-badge .remove-btn { border: none; background: none; cursor: pointer; color: var(--gray); font-size: 14px; line-height: 1; padding: 0 2px; }
.lz-badge .remove-btn:hover { color: var(--ink); }
.lz-clear { border: none; background: var(--soft); border: 1px solid var(--line); border-radius: 999px; padding: 4px 10px; font-size: 11px; font-weight: 700; color: var(--charcoal); cursor: pointer; }
.lz-clear:hover { background: var(--line); }
.lz-export { margin-left: auto; }
mark.hl { background: #fef3c7; color: #78350f; padding: 1px 3px; border-radius: 3px; font-weight: 700; }
[data-theme="oscuro"] mark.hl { background: #78350f; color: #fef3c7; }
@keyframes badgeIn { from { opacity: 0; transform: translateY(-4px); } to { opacity: 1; transform: none; } }
select.chip { height: 40px; padding: 0 12px; }
code { background: var(--soft); padding: 1px 6px; border-radius: 4px; font-size: 11px; }


/* ===== Listador v3: móvil ===== */
.m-only { display: none; }
@media (max-width: 768px) {
  .viewport { padding-top: 0; }
  .toolbar { position: sticky; top: 0; z-index: 30; background: var(--bg); padding: 12px 0 8px; }
  .m-hide, .m-actions { display: none; }
  .m-only { display: inline; }
  .data-table tbody tr { cursor: pointer; }
  .data-table tbody tr td:first-child { position: relative; padding-right: 26px; }
  .data-table tbody tr td:first-child::after {
    content: '›'; position: absolute; right: 10px; top: 50%;
    transform: translateY(-50%); color: var(--gray); font-size: 18px;
  }
  .modal-foot { flex-direction: column; gap: 8px; }
  .modal-foot .btn-ghost, .modal-foot .btn-primary { width: 100%; justify-content: center; height: 44px; }
}

/* ===== Agenda ===== */
.ag-bar { gap: 8px; }
.ag-week { display: grid; grid-template-columns: repeat(auto-fit, minmax(110px, 1fr)); gap: 8px; margin-bottom: 12px; }
.ag-daycard { padding: 10px 12px; cursor: pointer; text-align: left; border: 1px solid var(--line); border-radius: 8px; background: var(--surface); color: var(--ink); }
.ag-daycard.active { border-color: var(--charcoal); box-shadow: inset 0 0 0 1px var(--charcoal); }
.ag-daycard .occ { height: 6px; background: var(--soft); border-radius: 3px; overflow: hidden; margin-top: 6px; }
.ag-daycard .occ i { display: block; height: 100%; background: var(--charcoal); }
.ag-huecos { display: flex; gap: 6px; flex-wrap: wrap; }
.ag-hueco { height: 34px; }
.ag-row { display: flex; gap: 10px; align-items: center; padding: 10px 16px; border-bottom: 1px solid var(--line-soft); flex-wrap: wrap; }
.ag-row:last-child { border-bottom: none; }
.ag-hora { font-weight: 800; min-width: 74px; }
.ag-hora small { display: block; font-weight: 600; color: var(--gray); }
.ag-main { flex: 1; min-width: 180px; }
.ag-actions { display: flex; gap: 6px; flex-wrap: wrap; }
.ag-btn { height: 28px; padding: 0 10px; font-size: 11px; }
.badge-state.solid { background: var(--charcoal); color: var(--featured-ink); padding: 3px 10px; border-radius: 999px; }
.badge-state.solid .dot { background: var(--featured-ink); }
.badge-state.en_espera .dot { background: var(--c2); }
.badge-state.no_asistio .dot, .badge-state.cancelada .dot { background: var(--c4); }
@media (max-width: 768px) {
  .ag-hora { min-width: 60px; }
  .ag-actions .ag-btn { flex: 1 1 40%; justify-content: center; display: inline-flex; align-items: center; }
}



/* ===== Agenda Pro (namespaced agp-) ===== */
.agp-summary { display: flex; gap: 8px; flex-wrap: wrap; margin-bottom: 10px; }
.agp-layout { display: grid; grid-template-columns: 175px 1fr; gap: 12px; align-items: start; }
.agp-filtros { background: var(--surface); border: 1px solid var(--line); border-radius: 8px; padding: 10px; display: flex; flex-direction: column; gap: 10px; }
.agp-fgroup { display: flex; flex-direction: column; gap: 4px; }
.agp-fgroup strong { font-size: 11px; text-transform: uppercase; letter-spacing: .04em; color: var(--gray); }
.agp-board { display: grid; grid-template-columns: repeat(4, 1fr); gap: 10px; }
.agp-col { background: var(--surface); border: 1px solid var(--line); border-radius: 8px; padding: 8px; min-height: 240px; }
.agp-col-head { font-size: 12px; font-weight: 800; text-transform: uppercase; letter-spacing: .04em; color: var(--gray); padding: 2px 4px 8px; }
.agp-card { border: 1px solid var(--line); border-radius: 8px; background: var(--bg); padding: 8px; margin-bottom: 8px; }
.agp-card.p-alta { /* sin regla extra */ }
.agp-card.p-urgencia { border-color: var(--agp-warn); } /* único borde no-neutral: urgencia (justificado: alertar clínicamente) */
.agp-pac { cursor: pointer; color: var(--ink); font-weight: 700; } /* sin subrayado; cursor:pointer sigue comunicando click */.agp-pac { cursor: pointer; text-decoration: underline dotted; }
.agp-hora { font-weight: 800; }
.agp-card-actions { display: flex; gap: 4px; flex-wrap: wrap; margin-top: 6px; }
.agp-timer { font-size: 11px; font-weight: 700; color: var(--charcoal); margin-top: 4px; }
.agp-otras { grid-column: 1 / -1; display: flex; gap: 6px; flex-wrap: wrap; align-items: center; padding: 8px; background: var(--surface); border: 1px dashed var(--line); border-radius: 8px; font-size: 12px; }
.agp-mini { max-width: 330px; }
.agp-mini-wrap { z-index: 130; }
@media (max-width: 1000px) { .agp-board { grid-template-columns: repeat(2, 1fr); } }
@media (max-width: 768px) {
  .agp-layout { grid-template-columns: 1fr; }
  .agp-filtros { flex-direction: row; flex-wrap: wrap; }
  .agp-fgroup { min-width: 130px; }
}
@media (max-width: 560px) { .agp-board { grid-template-columns: 1fr; } }


/* ===== Agenda Pro v2: clínico, sin emojis, tríada de color ===== */
:root { --agp-blue: #4a8fe0; --agp-yellow: #e0b64a; --agp-orange: #e08a4a; --agp-green: #5cb87a; --agp-warn: #c0563f; }
.agp-title { font-size: 18px; font-weight: 800; margin: 0 0 10px; }
.agp-badge { border: 1px solid var(--charcoal); color: var(--charcoal); border-radius: 6px; padding: 4px 10px; font-size: 10px; font-weight: 800; letter-spacing: .08em; }
.agp-summary { display: flex; gap: 8px; flex-wrap: wrap; margin-bottom: 10px; }
.agp-sum { display: inline-flex; align-items: center; justify-content: center; gap: 7px; background: var(--surface); border: 1px solid var(--line); border-radius: 8px; padding: 7px 14px; font-size: 12px; font-weight: 700; color: var(--ink); }
.agp-sum i, .agp-col-head i, .agp-alert i { width: 8px; height: 8px; border-radius: 50%; flex: none; display: inline-block; }
.agp-timer::before { content: ''; width: 8px; height: 8px; border-radius: 50%; flex: none; }
.s-prox i { background: var(--agp-blue); } .s-sala i { background: var(--agp-yellow); }
.s-aten i { background: var(--agp-orange); } .s-comp i { background: var(--agp-green); }
.s-urg i { background: var(--agp-warn); }
.agp-col { border-top: 3px solid transparent; }
.agp-col.c-prox { border-top-color: var(--agp-blue); }
.agp-col.c-sala { border-top-color: var(--agp-yellow); }
.agp-col.c-aten { border-top-color: var(--agp-orange); }
.agp-col.c-comp { border-top-color: var(--agp-green); }
.agp-col-head { display: flex; align-items: center; gap: 6px; }
.c-prox .agp-col-head i { background: var(--agp-blue); } .c-sala .agp-col-head i { background: var(--agp-yellow); }
.c-aten .agp-col-head i { background: var(--agp-orange); } .c-comp .agp-col-head i { background: var(--agp-green); }
.agp-card { display: flex; flex-direction: column; min-height: 118px; }
.agp-card-actions { margin-top: auto; }
.agp-hora, .agp-timer { font-variant-numeric: tabular-nums; }
.agp-tag { font-size: 10px; font-weight: 800; letter-spacing: .06em; color: var(--gray); }
.agp-line { font-size: 11px; margin-top: 3px; }
.agp-muted { color: var(--gray); }
.agp-alert { display: flex; align-items: center; gap: 6px; font-size: 11px; font-weight: 600; margin-top: 3px; }
.agp-alert.a-warn, .agp-alert.a-warn i { color: var(--agp-warn); background-color: transparent; }
.agp-alert.a-warn i { background: var(--agp-warn); }
.agp-alert.a-info i { background: var(--agp-blue); }
.agp-timer { display: flex; align-items: center; gap: 6px; font-size: 11px; font-weight: 700; margin-top: 4px; }
.agp-timer.t-sala::before { background: var(--agp-yellow); }
.agp-timer.t-aten::before { background: var(--agp-orange); }

/* ===== Panel de vets con procesos + semana enriquecida ===== */
.agv-strip { display: flex; gap: 8px; flex-wrap: wrap; margin-bottom: 10px; }
.agv-card { position: relative; display: flex; flex-direction: column; gap: 2px; align-items: flex-start; text-align: left; background: var(--surface); border: 1px solid var(--line); border-radius: 8px; padding: 8px 36px 8px 12px; cursor: pointer; color: var(--ink); min-width: 150px; }
.agv-card.active { border-color: var(--charcoal); box-shadow: inset 0 0 0 1px var(--charcoal); }
.agv-libre { font-size: 11px; font-weight: 700; }
.agv-carga { font-size: 10px; color: var(--gray); }
.agv-add, .agw-add { position: absolute; right: 8px; top: 8px; width: 22px; height: 22px; border-radius: 6px; border: 1px solid var(--line); background: var(--bg); color: var(--ink); font-weight: 800; cursor: pointer; line-height: 1; }
.agv-add:hover, .agw-add:hover { background: var(--soft); }
.ag-daycard { position: relative; }
.agw-vets { display: flex; gap: 4px; flex-wrap: wrap; margin-top: 6px; }
.agw-vet { border: 1px solid var(--line); border-radius: 999px; padding: 1px 7px; font-size: 10px; font-weight: 700; color: var(--gray); background: var(--bg); cursor: pointer; }
.agw-vet:hover { color: var(--ink); }


/* ===== FIX FINAL: cards Pro + panel de vets (al final de styles.css) ===== */
.agp-card { display: flex; flex-direction: column; min-height: 118px; border: 1px solid var(--line); border-radius: 8px; background: var(--bg); padding: 8px; margin-bottom: 8px; }
.agp-card.p-alta { border-color: var(--line); }
.agp-card.p-urgencia { border-color: var(--agp-warn); }
.agp-card-top { display: flex; justify-content: space-between; align-items: baseline; gap: 10px; }
.agp-card-top strong { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.agp-hora { flex: none; font-weight: 800; font-variant-numeric: tabular-nums; }
.agp-pac { cursor: pointer; color: var(--ink); font-weight: 700; text-decoration: none !important; }
.agp-pac:hover { color: var(--charcoal); text-decoration: none !important; }
.agp-line { font-size: 11px; margin-top: 3px; }
.agp-muted { color: var(--gray); }
.agp-card-actions { margin-top: auto; padding-top: 6px; display: flex; gap: 4px; flex-wrap: wrap; }
.agv-card { position: relative; display: flex; flex-direction: column; gap: 2px; align-items: flex-start; text-align: left; background: var(--surface); border: 1px solid var(--line); border-radius: 8px; padding: 8px 36px 8px 12px; cursor: pointer; color: var(--ink); min-width: 150px; }
.agv-card.active { border-color: var(--charcoal); box-shadow: inset 0 0 0 1px var(--charcoal); }
.agv-libre { display: block; font-size: 11px; font-weight: 700; }
.agv-carga { display: block; font-size: 10px; color: var(--gray); }
.agv-add, .agw-add { position: absolute; right: 8px; top: 8px; width: 22px; height: 22px; border-radius: 6px; border: 1px solid var(--line); background: var(--bg); color: var(--ink); font-weight: 800; cursor: pointer; line-height: 1; }


/* ===== VetGroup: Splash + Shimmer premium ===== */
#vg-splash {
  position: fixed; inset: 0; z-index: 9999;
  background: var(--bg);
  display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 18px;
  transition: opacity 400ms ease, visibility 400ms ease;
}
#vg-splash.vg-hide { opacity: 0; visibility: hidden; pointer-events: none; }
#vg-splash .vg-brand { font-size: 22px; font-weight: 800; letter-spacing: -0.02em; color: var(--ink); }
#vg-splash .vg-brand span { color: var(--gray); font-weight: 500; margin-left: 6px; font-size: 14px; }
#vg-splash .vg-dots { display: flex; gap: 6px; }
#vg-splash .vg-dots i { width: 6px; height: 6px; border-radius: 50%; background: var(--charcoal); animation: vg-pulse 1.2s ease-in-out infinite; }
#vg-splash .vg-dots i:nth-child(2) { animation-delay: .15s; }
#vg-splash .vg-dots i:nth-child(3) { animation-delay: .3s; }
#vg-splash .vg-sub { font-size: 11px; color: var(--gray); letter-spacing: .12em; }
@keyframes vg-pulse { 0%,80%,100% { opacity:.25; transform:scale(.85);} 40% { opacity:1; transform:scale(1);} }

.sk {
  display: block;
  background: linear-gradient(90deg, var(--surface) 0%, rgba(128,128,128,.10) 40%, var(--surface) 80%);
  background-size: 200% 100%;
  border-radius: 6px;
  animation: vg-shimmer 1.6s ease-in-out infinite;
}
.sk-bar { height: 14px; margin: 8px 0; }
.sk-row { display: grid; grid-template-columns: 74px 1fr 180px; gap: 10px; align-items: center; padding: 10px 16px; border-bottom: 1px solid var(--line-soft, rgba(128,128,128,.08)); }
.sk-row .sk { height: 12px; }
.sk-row .sk.sm { height: 8px; width: 60%; }
.vg-shimmer { display: flex; flex-direction: column; gap: 10px; padding: 8px 0; }
.sk-kanban { display: grid; grid-template-columns: repeat(4, 1fr); gap: 10px; }
.sk-col { background: var(--surface); border: 1px solid var(--line); border-radius: 8px; padding: 10px; min-height: 240px; display: flex; flex-direction: column; gap: 8px; }
.sk-card { height: 110px; }
@keyframes vg-shimmer { 0% { background-position: 200% 0; } 100% { background-position: -200% 0; } }
@media (max-width: 900px) { .sk-kanban { grid-template-columns: repeat(2, 1fr); } }
@media (max-width: 560px) { .sk-kanban { grid-template-columns: 1fr; } .sk-row { grid-template-columns: 60px 1fr; } .sk-row .sk:last-child { display: none; } }


/* ===== Agenda Pro v4: layout 3 columnas + Fase 2 ===== */
.agp-layout { display: grid; grid-template-columns: 170px 1fr 250px; gap: 12px; align-items: start; }
.agp-center { display: flex; flex-direction: column; gap: 10px; min-width: 0; }
.agp-side-right { display: flex; flex-direction: column; gap: 12px; }
.agp-section { background: var(--surface); border: 1px solid var(--line); border-radius: 8px; padding: 12px; }
.agp-section h3 { font-size: 11px; font-weight: 800; text-transform: uppercase; letter-spacing: .06em; color: var(--gray); margin: 0 0 8px; }
.agp-wide { width: 100%; margin-top: 8px; justify-content: center; display: inline-flex; }
.agp-btn-urg { background: var(--agp-warn); border-color: var(--agp-warn); color: #fff; font-weight: 700; }
.agp-btn-urg:hover { background: var(--agp-warn); opacity: .9; }
.agp-le-card { border: 1px solid var(--line); border-radius: 6px; padding: 8px; margin-bottom: 8px; background: var(--bg); }
.agp-le-card.p-alta { border-left: 3px solid var(--agp-warn); }
.agp-gap-card { border: 1px dashed var(--line); border-radius: 6px; padding: 8px; margin-bottom: 8px; }
.agp-gap-cands { margin-top: 6px; display: flex; flex-direction: column; gap: 4px; }
.agp-gap-cand { text-align: left; padding: 5px 8px; border: 1px solid var(--line); border-radius: 4px; background: var(--bg); color: var(--ink); font-size: 11px; cursor: pointer; }
.agp-gap-cand:hover { background: var(--soft); }
.agp-prio-alta { display: inline-block; padding: 1px 6px; background: var(--agp-warn); color: #fff; border-radius: 3px; font-size: 9px; font-weight: 800; }
.urg-impacto-box { padding: 12px; background: var(--surface); border: 1px solid var(--line); border-radius: 6px; font-size: 12px; }
.urg-impacto-box ul { margin: 8px 0 0 18px; }
@media (max-width: 1100px) {
  .agp-layout { grid-template-columns: 160px 1fr; }
  .agp-side-right { grid-column: 1 / -1; flex-direction: row; flex-wrap: wrap; }
  .agp-side-right .agp-section { flex: 1 1 240px; }
}
@media (max-width: 768px) {
  .agp-layout { grid-template-columns: 1fr; }
}



/* ===== Farmacia v1 ===== */
.fm-chips { display: flex; gap: 8px; flex-wrap: wrap; margin-bottom: 10px; }
.fm-chip { display: inline-flex; align-items: center; gap: 7px; background: var(--surface); border: 1px solid var(--line); border-radius: 8px; padding: 7px 14px; font-size: 12px; font-weight: 700; }
.fm-chip i { width: 8px; height: 8px; border-radius: 50%; }
.fm-chip.ok i { background: var(--agp-green); } .fm-chip.aten i { background: var(--agp-yellow); } .fm-chip.acc i { background: var(--agp-warn); }
.fm-sev-row { display: flex; gap: 8px; flex-wrap: wrap; margin-bottom: 12px; }
.fm-sev { font-size: 11px; font-weight: 800; letter-spacing: .04em; padding: 4px 10px; border-radius: 6px; }
.fm-sev.s-ahora { background: var(--agp-warn); color: #fff; }
.fm-sev.s-hoy { background: var(--agp-orange); color: #fff; }
.fm-sev.s-semana { background: var(--agp-yellow); color: #201f1b; }
.fm-band { display: flex; flex-direction: column; }
.fm-alert { display: flex; justify-content: space-between; gap: 10px; align-items: center; padding: 10px 16px; border-bottom: 1px solid var(--line-soft); flex-wrap: wrap; }
.fm-alert.sev-ahora { border-left: 3px solid var(--agp-warn); }
.fm-alert.sev-hoy { border-left: 3px solid var(--agp-orange); }
.fm-alert.sev-semana { border-left: 3px solid var(--agp-yellow); }
.fm-alert-txt { font-size: 12px; flex: 1; min-width: 220px; }
.fm-alert-acts { display: flex; gap: 6px; }
.fm-crit { display: inline-block; padding: 1px 7px; border-radius: 4px; font-size: 10px; font-weight: 800; }
.fm-crit.c-critico { background: var(--agp-warn); color: #fff; }
.fm-crit.c-importante { background: var(--agp-orange); color: #fff; }
.fm-crit.c-atencion { background: var(--agp-yellow); color: #201f1b; }
.fm-crit.c-informativo { background: var(--soft); color: var(--gray); }
.fm-nivel { display: inline-block; padding: 1px 6px; border-radius: 3px; font-size: 9px; font-weight: 800; border: 1px solid var(--line); color: var(--gray); }
.fm-nivel.n-prediccion { border-color: var(--agp-orange); color: var(--agp-orange); }
.fm-nivel.n-accion { border-color: var(--agp-warn); color: var(--agp-warn); }
.fm-duo { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; margin-top: 12px; }
.fm-riesgo { display: grid; grid-template-columns: 1fr 90px 40px; gap: 8px; align-items: center; padding: 6px 16px; font-size: 12px; }
.fm-riesgo-bar { height: 6px; background: var(--soft); border-radius: 3px; overflow: hidden; }
.fm-riesgo-bar i { display: block; height: 100%; background: var(--agp-warn); }
.fm-compra { padding: 8px 16px; border-bottom: 1px solid var(--line-soft); font-size: 12px; }
.fm-lote-opt { display: block; width: 100%; text-align: left; padding: 7px 10px; margin-top: 4px; border: 1px solid var(--line); border-radius: 6px; background: var(--bg); color: var(--ink); font-size: 12px; cursor: pointer; }
.fm-lote-opt.rec { border-color: var(--agp-green); }
.fm-lote-opt.sel { box-shadow: inset 0 0 0 1px var(--charcoal); }
.fm-usar { display: inline-block; padding: 1px 6px; background: var(--agp-green); color: #fff; border-radius: 3px; font-size: 9px; font-weight: 800; }
@media (max-width: 768px) { .fm-duo { grid-template-columns: 1fr; } }


/* ===== Sidebar: sección "Próximamente" ===== */
.nav-divider { height: 1px; background: var(--line); margin: 10px 14px 6px; }
.nav-section-title { font-size: 10px; font-weight: 800; letter-spacing: .08em; text-transform: uppercase; color: var(--gray); padding: 4px 18px 6px; }
.nav-soon { opacity: .55; cursor: default; }
.nav-soon:hover { background: transparent; }
.nav-soon-tag { margin-left: auto; font-size: 9px; font-weight: 800; letter-spacing: .06em; padding: 2px 6px; border: 1px solid var(--line); border-radius: 4px; color: var(--gray); }



/* ===== Historial Clínico: línea de tiempo ===== */
.hl-wrap { position: relative; padding-left: 18px; }
.hl-wrap::before { content: ''; position: absolute; left: 6px; top: 4px; bottom: 4px; width: 2px; background: var(--line); }
.hl-item { position: relative; padding: 0 0 14px 12px; }
.hl-item::before { content: ''; position: absolute; left: -16px; top: 5px; width: 10px; height: 10px; border-radius: 50%; }
.hl-item.t-consulta::before { background: var(--agp-green); }
.hl-item.t-medicacion::before { background: var(--agp-blue); }
.hl-item.t-falta::before { background: var(--gray); }
.hl-fecha { font-size: 11px; font-weight: 800; color: var(--gray); letter-spacing: .04em; }
.hl-card { background: var(--surface); border: 1px solid var(--line); border-radius: 8px; padding: 8px 12px; margin-top: 4px; }
.hl-title { font-weight: 700; font-size: 13px; }
.hl-sub { font-size: 11px; color: var(--gray); }
.hl-resumen { display: flex; gap: 8px; flex-wrap: wrap; margin-bottom: 10px; }
@media print {
  .sidebar, .topbar, .bottombar, .toolbar, .hl-no-print, .prop-cands { display: none !important; }
  .main { margin: 0; }
  .hl-card { border: 1px solid #999; }
}


/* ===== Dashboard v2: métricas reales ===== */
.db-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(200px, 1fr)); gap: 12px; margin-bottom: 16px; }
.db-kpi { padding: 16px; }
.db-kpi .card-title { font-size: 12px; font-weight: 600; color: var(--gray); margin-bottom: 8px; }
.db-num { font-size: 36px; font-weight: 800; line-height: 1; margin-bottom: 6px; }
.db-sub { font-size: 11px; color: var(--gray); }
.db-urg { border-left: 4px solid var(--agp-warn); }
.db-list { padding: 0; }
.db-item { display: flex; align-items: center; gap: 12px; padding: 10px 16px; border-bottom: 1px solid var(--line); }
.db-item:last-child { border-bottom: none; }
.db-item-hora { font-weight: 800; font-size: 14px; min-width: 50px; }
.db-item-main { flex: 1; }
.db-item-state { flex-shrink: 0; }
.db-duo { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; margin-top: 16px; }
.db-shortcuts { display: flex; flex-wrap: wrap; gap: 8px; padding: 12px; }
.db-shortcut { min-width: 100px; }
.db-status { padding: 12px; }
.db-stat { display: flex; align-items: center; gap: 8px; padding: 6px 0; font-size: 12px; }
.db-stat .dot { width: 8px; height: 8px; border-radius: 50%; background: var(--agp-green); }
@media (max-width: 768px) {
  .db-grid { grid-template-columns: 1fr 1fr; }
  .db-duo { grid-template-columns: 1fr; }
}


/* ===== Tooltips DataRAM ===== */
.d-tip { position: fixed; z-index: 9998; max-width: 260px; background: var(--surface); border: 1px solid var(--line); border-radius: 8px; padding: 8px 10px; font-size: 11px; line-height: 1.5; color: var(--ink); box-shadow: 0 6px 20px rgba(0,0,0,.18); opacity: 0; pointer-events: none; transition: opacity .12s ease; }
.d-tip strong { display: block; margin-bottom: 2px; }
.d-tip .tt-sub { color: var(--gray); }
circle[data-tip] { cursor: pointer; transition: opacity .12s; }
circle[data-tip]:hover { opacity: .7; }
.kpi[data-tip], .agp-sum[data-tip], tr[data-tip] { cursor: help; }
tr[data-tip]:hover td { background: var(--soft); }
.db-ram { display: inline-flex; align-items: center; gap: 6px; font-size: 10px; font-weight: 800; letter-spacing: .05em; color: var(--gray); border: 1px solid var(--line); border-radius: 999px; padding: 3px 10px; margin-left: auto; }
.db-ram i { width: 6px; height: 6px; border-radius: 50%; background: var(--agp-green); animation: vg-pulse 1.6s ease-in-out infinite; }




/* ===== Modales: altura máxima, scroll interno y pie anclado ===== */
.modal { display: flex; flex-direction: column; max-height: 90vh; }
.modal-head { flex: 0 0 auto; }
.modal-body { overflow-y: auto; flex: 1 1 auto; min-height: 0; }
.modal-foot { flex: 0 0 auto; position: sticky; bottom: 0; background: var(--surface); }

/* ===== Farmacia: filas accionables en ficha de lote ===== */
.fm-act-row { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 8px 0; border-top: 1px solid var(--line-soft, rgba(128,128,128,.08)); }
.fm-act-row .fm-act-txt { flex: 1; min-width: 0; }
.fm-act-row .fm-act-txt strong { display: block; font-size: 12px; }
.fm-act-row .fm-act-txt span { font-size: 11px; color: var(--gray); }



/* ===== Control Farmacia: facetas con chips acumulativos ===== */
.fm-facets { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; margin: 0 0 10px; }
.fm-facet-sel select { height: 30px; border: 1px solid var(--line); border-radius: 8px; background: var(--surface); color: var(--ink); font-size: 12px; padding: 0 8px; max-width: 240px; }
.fm-facet-chips { display: flex; gap: 6px; flex-wrap: wrap; }
.fm-chip-lab { display: inline-flex; align-items: center; gap: 6px; border: 1px solid var(--charcoal); background: var(--soft); border-radius: 999px; padding: 3px 10px; font-size: 11px; font-weight: 700; }
.fm-chip-lab button { border: 0; background: none; cursor: pointer; font-weight: 800; color: var(--gray); padding: 0; }
.fm-facet-toggle { border: 1px solid var(--line); border-radius: 999px; padding: 4px 12px; font-size: 11px; font-weight: 700; background: var(--surface); color: var(--gray); cursor: pointer; }
.fm-facet-toggle.on-si { border-color: var(--agp-blue); color: var(--agp-blue); }
.fm-facet-toggle.on-no { border-color: var(--agp-warn); color: var(--agp-warn); }


/* ===== Centro de informes y documento imprimible ===== */
.inf-modal .modal { max-width: 860px; }
.inf-cat { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.inf-cat-item { text-align: left; border: 1px solid var(--line); border-radius: 8px; padding: 12px; background: var(--bg); cursor: pointer; display: flex; flex-direction: column; gap: 4px; }
.inf-cat-item strong { font-size: 13px; }
.inf-cat-item span { font-size: 11px; color: var(--gray); }
.inf-cat-item:hover { background: var(--soft); }
.inf-params label { display: block; font-size: 11px; font-weight: 700; margin: 8px 0 4px; }
.inf-params select, .inf-params input { width: 100%; border: 1px solid var(--line); border-radius: 8px; padding: 7px 9px; font: inherit; font-size: 12px; background: var(--surface); color: var(--ink); }
.inf-params-acts { display: flex; justify-content: flex-end; gap: 8px; margin-top: 14px; }
.inf-bar { display: flex; gap: 8px; flex-wrap: wrap; margin-bottom: 12px; padding-bottom: 10px; border-bottom: 1px solid var(--line); }
.inf-doc { border: 1px solid var(--line); border-radius: 8px; padding: 16px; background: #fff; color: #201f1b; max-height: 52vh; overflow-y: auto; }
.inf-doc table { border-collapse: collapse; width: 100%; font-size: 10px; }
.inf-doc th { background: #efeee9; text-align: left; }
.inf-doc th, .inf-doc td { border: 1px solid #d8d5cd; padding: 4px 6px; }
#inf-print { display: none; }
@media print {
  body * { visibility: hidden; }
  #inf-print, #inf-print * { visibility: visible; }
  #inf-print { display: block; position: absolute; inset: 0; padding: 24px; }
  .modal-backdrop { display: none !important; }
}
@media (max-width: 700px) { .inf-cat { grid-template-columns: 1fr; } }


/* ===== Presentación SWETTCOM ===== */
.pres-est { display: flex; gap: 14px; margin-bottom: 18px; }
.pres-est-n { font-size: 26px; font-weight: 800; color: var(--gray); min-width: 44px; }
.pres-est-b { flex: 1; min-width: 0; }
.pres-est-b h3 { font-size: 15px; margin-bottom: 4px; }
.pres-ancla { font-style: italic; color: var(--gray); margin: 4px 0 10px; }
.pres-note { font-size: 12px; color: var(--gray); margin-top: 10px; line-height: 1.6; }
.pres-estado { display: inline-block; margin-top: 8px; font-size: 10px; font-weight: 800; letter-spacing: .05em; padding: 3px 9px; border: 1px solid var(--line); border-radius: 999px; color: var(--gray); }
.pres-codes { display: grid; grid-template-columns: repeat(3, 1fr); gap: 10px; }
.pres-code { border: 1px solid var(--line); border-radius: 8px; padding: 10px; display: flex; flex-direction: column; gap: 6px; font-size: 11px; color: var(--gray); }
.pres-code strong { color: var(--ink); font-size: 12px; }
.pres-sym { width: 44px; height: 44px; border-radius: 4px; }
.sym-1d { background: repeating-linear-gradient(90deg, var(--ink) 0 2px, transparent 2px 5px); }
.sym-dm { background: repeating-conic-gradient(var(--ink) 0 25%, transparent 0 50%) 0 0/8px 8px; }
.sym-qr { background: repeating-conic-gradient(var(--ink) 0 25%, transparent 0 50%) 0 0/10px 10px; border: 4px solid var(--ink); }
.pres-fed { display: grid; grid-template-columns: repeat(3, 1fr); gap: 10px; }
.pres-suc { border: 1px solid var(--line); border-radius: 8px; padding: 10px; text-align: center; font-size: 12px; font-weight: 700; }
.pres-suc small { display: block; font-weight: 400; color: var(--gray); font-size: 10px; }
.pres-arrow { text-align: center; font-size: 10px; color: var(--gray); padding: 6px 0; }
.pres-consola { border: 2px solid var(--charcoal); border-radius: 8px; padding: 10px; text-align: center; font-size: 12px; font-weight: 800; }
.pres-pir { display: flex; flex-direction: column; gap: 6px; }
.pres-pir-row { display: grid; grid-template-columns: 110px 1fr 130px; gap: 8px; align-items: center; font-size: 11px; }
.pres-pir-row i { display: block; height: 10px; background: var(--line); border-radius: 5px; }
.pres-pir-row.ok i { background: var(--agp-green); }
.pres-pir-row em { color: var(--gray); font-style: normal; }
.pres-arco { display: grid; grid-template-columns: repeat(4, 1fr); gap: 10px; }
.pres-arco div { border: 1px solid var(--line); border-radius: 8px; padding: 10px; font-size: 11px; color: var(--gray); }
.pres-arco strong { display: block; color: var(--ink); font-size: 12px; margin-bottom: 4px; }
.pres-sec { margin-bottom: 18px; }
.pres-sec h3 { font-size: 15px; margin-bottom: 10px; }
.pres-pasos { border: 1px solid var(--line); border-radius: 8px; padding: 10px 14px; margin-bottom: 10px; font-size: 12px; }
.pres-pasos strong { display: block; margin-bottom: 4px; }
.pres-pasos ol { margin-left: 18px; }
.pres-notas-mod { margin-bottom: 12px; }
.pres-notas-mod strong { font-size: 12px; }
.pres-nota { font-size: 12px; padding: 4px 0; border-bottom: 1px dashed var(--line); }
.pres-nota-t { color: var(--gray); font-size: 10px; font-weight: 800; }
.pres-cob { background: var(--soft); border-radius: 8px; padding: 8px 12px; font-size: 12px; margin: 10px 0; }
.pres-rol { margin-bottom: 14px; }
.pres-rol h4 { font-size: 13px; margin-bottom: 6px; }
.pres-rol-item { display: flex; align-items: center; gap: 8px; padding: 4px 0; font-size: 12px; flex-wrap: wrap; }
.pres-rol-item span { flex: 1; min-width: 200px; }
.pres-rol-item button { font-size: 10px; padding: 3px 8px; border: 1px solid var(--line); border-radius: 999px; background: var(--surface); cursor: pointer; }
.pres-serv { margin-left: 18px; font-size: 13px; line-height: 1.9; }
#pres-print { display: none; }
@media print {
  #pres-print, #pres-print * { visibility: visible; }
  #pres-print { display: block; position: absolute; inset: 0; padding: 24px; }
}
@media (max-width: 800px) { .pres-codes, .pres-fed, .pres-arco { grid-template-columns: 1fr; } }


/* ===== Acto Final: modo pizarra ===== */
.piz { background: var(--bg); border: 1px solid var(--line); border-radius: 14px; padding: 24px; max-width: 760px; margin: 0 auto; }
.piz-top { display: flex; align-items: center; justify-content: space-between; margin-bottom: 16px; }
.piz-dots { display: flex; gap: 7px; }
.piz-dots i { width: 11px; height: 11px; border-radius: 50%; background: var(--line); }
.piz-dots i.on { background: var(--charcoal); }
.piz-nav { display: flex; gap: 8px; }
.piz-nav button { font-size: 18px; min-width: 40px; }
.lam-n { font-size: 42px; font-weight: 800; color: var(--gray); line-height: 1; }
.lam h3 { font-size: 26px; margin: 4px 0 10px; line-height: 1.2; }
.lam-gancho { font-size: 16px; font-style: italic; color: var(--gray); margin-bottom: 14px; line-height: 1.5; }
.lam-dibujo { background: var(--surface); border: 1px dashed var(--line); border-radius: 12px; padding: 12px 8px 4px; margin: 14px 0; text-align: center; color: var(--ink); }
.lam-dibujo svg { max-width: 100%; height: auto; }
.lam-frase { font-size: 19px; font-weight: 800; margin: 12px 0; line-height: 1.4; }
.lam-cuerpo { font-size: 14px; line-height: 1.7; color: var(--ink); }
.lam-magic { margin-top: 14px; }
.lam-reveal { margin-top: 12px; border: 1px solid var(--line); border-radius: 10px; padding: 12px 14px; background: var(--surface); font-size: 13px; line-height: 1.6; }
.lam-reveal em { color: var(--gray); }
.lam-cierre { font-size: 13px; color: var(--gray); margin-top: 12px; line-height: 1.6; }
.lam-preg { font-size: 12px; font-style: italic; color: var(--gray); margin-top: 10px; padding-top: 10px; border-top: 1px dashed var(--line); }




