/* ============================================================
   BROA APPS · Patient Safety — Sistema visual
   Tema clínico con identidad propia. Iconos SVG (no emojis).
   ============================================================ */
@import url('https://fonts.googleapis.com/css2?family=Inter:wght@400;500;600;700;800&display=swap');

:root {
  --bg: #f1f5f9;
  --surface: #ffffff;
  --surface-2: #f8fafc;
  --surface-3: #f1f5f9;
  --border: #e6ebf1;
  --border-strong: #d3dce6;
  --text: #0f2233;
  --text-soft: #5b7186;
  --text-faint: #90a2b3;
  --primary: #0e7c7b;         /* teal profundo */
  --primary-600: #0a5f5e;
  --primary-700: #084a49;
  --primary-050: #e0f2f1;
  --accent: #1d4ed8;
  --danger: #dc2626;
  --ok: #15803d;
  --warn: #b45309;
  --ink: #0b1f2e;             /* sidebar */
  --ink-2: #12324a;
  --ring: rgba(14,124,123,.16);
  --shadow-sm: 0 1px 2px rgba(11,31,46,.06);
  --shadow: 0 1px 3px rgba(11,31,46,.07), 0 10px 30px -12px rgba(11,31,46,.14);
  --radius: 16px;
  --radius-sm: 10px;
  --radius-xs: 8px;
}
@media (prefers-color-scheme: dark) {
  :root {
    --bg: #0a141d; --surface: #10212e; --surface-2: #0d1c28; --surface-3: #152836;
    --border: #21384a; --border-strong: #2b465c;
    --text: #e8f0f6; --text-soft: #9fb3c4; --text-faint: #6d8497;
    --primary: #2dd4bf; --primary-600: #14b8a6; --primary-700: #0d9488; --primary-050: #0c3b38;
    --accent: #60a5fa; --ink: #071019; --ink-2: #0e2233;
    --ring: rgba(45,212,191,.22);
    --shadow-sm: 0 1px 2px rgba(0,0,0,.35);
    --shadow: 0 1px 3px rgba(0,0,0,.4), 0 14px 34px -14px rgba(0,0,0,.5);
  }
}
* { box-sizing: border-box; }
[hidden] { display: none !important; }   /* gana sobre display:flex de overlays/modales */
html, body { margin: 0; padding: 0; }
body {
  font-family: 'Inter', system-ui, -apple-system, 'Segoe UI', Roboto, sans-serif;
  background: var(--bg); color: var(--text); font-size: 14.5px; line-height: 1.55;
  -webkit-font-smoothing: antialiased;
}
a { color: var(--accent); text-decoration: none; }
h1,h2,h3 { letter-spacing: -.01em; }
.ic { flex: 0 0 auto; vertical-align: middle; }

/* -------- Layout -------- */
.layout { display: flex; min-height: 100vh; }
.sidebar {
  width: 256px; background: var(--ink); color: #b8cbd9;
  display: flex; flex-direction: column; position: sticky; top: 0; height: 100vh; flex-shrink: 0;
  border-right: 1px solid rgba(255,255,255,.05);
}
.brand { display: flex; gap: 12px; align-items: center; padding: 20px 18px 18px; }
.brand-mark {
  width: 40px; height: 40px; display: grid; place-items: center; border-radius: 12px; color: #fff;
  background: linear-gradient(150deg, var(--primary) 0%, #12b3a6 60%, var(--accent) 130%);
  box-shadow: 0 6px 16px -4px rgba(14,124,123,.6);
}
.brand-mark .ic { width: 24px; height: 24px; }
.brand strong { display: block; font-size: 15px; color: #fff; font-weight: 800; letter-spacing: .2px; }
.brand small { color: #7f9bb0; font-size: 10.5px; text-transform: uppercase; letter-spacing: .8px; }

.nav { padding: 8px 12px; display: flex; flex-direction: column; gap: 2px; flex: 1; overflow-y: auto; }
.nav-label { font-size: 10.5px; text-transform: uppercase; letter-spacing: 1px; color: #5f7a8f; padding: 16px 12px 7px; font-weight: 700; }
.nav-item {
  display: flex; align-items: center; gap: 12px; padding: 10px 12px; border-radius: 10px;
  color: #b8cbd9; font-weight: 500; font-size: 14px; position: relative; transition: background .14s, color .14s;
}
.nav-item .ic { width: 19px; height: 19px; color: #7f9bb0; transition: color .14s; }
.nav-item:hover { background: rgba(255,255,255,.05); color: #fff; }
.nav-item:hover .ic { color: #cfe0ec; }
.nav-item.is-active { background: linear-gradient(90deg, rgba(14,124,123,.28), rgba(14,124,123,.05)); color: #fff; }
.nav-item.is-active .ic { color: var(--primary); }
.nav-item.is-active::before { content: ''; position: absolute; left: 0; top: 8px; bottom: 8px; width: 3px; border-radius: 0 3px 3px 0; background: var(--primary); }

.sidebar-foot { padding: 12px; border-top: 1px solid rgba(255,255,255,.07); }
.user-chip { display: flex; align-items: center; gap: 11px; padding: 8px; border-radius: 10px; margin-bottom: 8px; }
.avatar { width: 36px; height: 36px; border-radius: 10px; background: var(--ink-2); color: #fff; display: grid; place-items: center; font-weight: 700; font-size: 15px; }
.user-chip strong { display: block; font-size: 13px; color: #fff; }
.user-chip small { color: #7f9bb0; font-size: 11px; }
.btn-logout { display: flex; align-items: center; justify-content: center; gap: 8px; padding: 9px; border-radius: 9px; background: rgba(255,255,255,.05); color: #b8cbd9; font-size: 13px; font-weight: 500; }
.btn-logout .ic { width: 16px; height: 16px; }
.btn-logout:hover { background: rgba(255,255,255,.1); color: #fff; }

.main { flex: 1; display: flex; flex-direction: column; min-width: 0; }
.topbar {
  display: flex; align-items: center; gap: 14px; padding: 0 28px; height: 62px; background: var(--surface);
  border-bottom: 1px solid var(--border); position: sticky; top: 0; z-index: 5;
}
.topbar h1 { font-size: 18px; margin: 0; font-weight: 700; }
.hamb { display: none; background: none; border: 0; font-size: 22px; cursor: pointer; color: var(--text); }
.content { padding: 26px 28px; flex: 1; max-width: 1240px; width: 100%; }
.foot { display: flex; justify-content: space-between; padding: 16px 28px; color: var(--text-faint); font-size: 12px; border-top: 1px solid var(--border); }

/* -------- Stat cards -------- */
.cards { display: grid; grid-template-columns: repeat(auto-fill, minmax(224px, 1fr)); gap: 16px; margin-bottom: 22px; }
.stat {
  background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius);
  padding: 18px 20px; box-shadow: var(--shadow-sm); display: flex; align-items: center; gap: 15px;
}
.stat .chip { width: 46px; height: 46px; border-radius: 13px; display: grid; place-items: center; flex: 0 0 auto; }
.stat .chip .ic { width: 22px; height: 22px; }
.chip-teal { background: var(--primary-050); color: var(--primary); }
.chip-amber { background: #fef3c7; color: #b45309; }
.chip-blue { background: #dbeafe; color: #1d4ed8; }
.chip-green { background: #dcfce7; color: #15803d; }
.stat .k { color: var(--text-soft); font-size: 12.5px; font-weight: 500; }
.stat .v { font-size: 27px; font-weight: 800; letter-spacing: -.02em; line-height: 1.1; }

/* -------- Cards -------- */
.card { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); padding: 20px 22px; box-shadow: var(--shadow-sm); }
.card-head { display: flex; justify-content: space-between; align-items: center; margin-bottom: 16px; gap: 12px; }
.card-head h2 { font-size: 15.5px; margin: 0; font-weight: 700; }

/* -------- Buttons -------- */
.btn {
  display: inline-flex; align-items: center; gap: 8px; padding: 9px 15px; border-radius: 10px;
  border: 1px solid var(--border-strong); background: var(--surface); color: var(--text); font-weight: 600;
  cursor: pointer; font-size: 13.5px; font-family: inherit; transition: .14s; white-space: nowrap;
}
.btn .ic { width: 17px; height: 17px; }
.btn:hover { border-color: var(--primary); color: var(--primary-600); }
.btn-primary { background: var(--primary); border-color: var(--primary); color: #fff; box-shadow: 0 6px 14px -6px rgba(14,124,123,.6); }
.btn-primary:hover { background: var(--primary-600); border-color: var(--primary-600); color: #fff; }
.btn-danger { color: var(--danger); border-color: #f0cccc; }
.btn-danger:hover { background: #fef2f2; border-color: var(--danger); color: var(--danger); }
.btn-sm { padding: 7px 12px; font-size: 13px; }
.btn-sm .ic { width: 15px; height: 15px; }

/* -------- Tables -------- */
.table-wrap { overflow-x: auto; background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); box-shadow: var(--shadow-sm); }
table.data { width: 100%; border-collapse: collapse; min-width: 640px; }
table.data th, table.data td { padding: 13px 16px; text-align: left; border-bottom: 1px solid var(--border); font-size: 14px; }
table.data th { background: var(--surface-2); color: var(--text-soft); font-weight: 600; font-size: 11px; text-transform: uppercase; letter-spacing: .5px; }
table.data tr:last-child td { border-bottom: 0; }
table.data tbody tr { transition: background .12s; }
table.data tbody tr:hover td { background: var(--surface-2); }

/* -------- Badges -------- */
.badge { display: inline-flex; align-items: center; padding: 3px 10px; border-radius: 999px; font-size: 11.5px; font-weight: 600; letter-spacing: .1px; }
.badge-teal { background: var(--primary-050); color: var(--primary-600); }
.badge-blue { background: #dbeafe; color: #1d4ed8; }
.badge-amber { background: #fef3c7; color: #b45309; }
.badge-red { background: #fee2e2; color: #b91c1c; }
.badge-gray { background: var(--surface-3); color: var(--text-soft); border: 1px solid var(--border); }
.badge-green { background: #dcfce7; color: #15803d; }

/* -------- Forms -------- */
.form-card { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); box-shadow: var(--shadow-sm); padding: 26px; max-width: 1000px; }
.fieldset { border: 0; padding: 0; margin: 0 0 24px; }
.fieldset > legend { display: flex; align-items: center; gap: 9px; padding: 0; font-weight: 700; color: var(--text); font-size: 14px; margin-bottom: 14px; width: 100%; padding-bottom: 10px; border-bottom: 1px solid var(--border); }
.fieldset > legend .ic { width: 18px; height: 18px; color: var(--primary); }
.grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); gap: 16px; }
.grid-2 { grid-template-columns: repeat(auto-fit, minmax(320px, 1fr)); }
.field { display: flex; flex-direction: column; gap: 6px; }
.field.full { grid-column: 1 / -1; }
.field > label { font-size: 12.5px; font-weight: 600; color: var(--text-soft); }
.field .lbl-ic { display: inline-flex; align-items: center; gap: 7px; }
.field .lbl-ic .ic { width: 15px; height: 15px; color: var(--text-faint); }
.field input[type=text], .field input[type=date], .field input[type=number],
.field input[type=password], .field select, .field textarea {
  padding: 10px 12px; border: 1px solid var(--border-strong); border-radius: 9px; background: var(--surface);
  color: var(--text); font-size: 14px; font-family: inherit; width: 100%;
}
.field textarea { resize: vertical; min-height: 76px; }
.field input:focus, .field select:focus, .field textarea:focus {
  outline: none; border-color: var(--primary); box-shadow: 0 0 0 3px var(--ring);
}
.checks { display: grid; grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); gap: 10px; }
.check { display: flex; gap: 10px; align-items: flex-start; padding: 11px 13px; border: 1px solid var(--border-strong); border-radius: 10px; background: var(--surface); cursor: pointer; transition: .12s; }
.check:hover { border-color: var(--primary); background: var(--surface-2); }
.check input { margin-top: 2px; accent-color: var(--primary); }
.check span { font-size: 13.5px; }
.check span strong { font-weight: 600; }
.form-actions { display: flex; gap: 12px; margin-top: 6px; }

/* -------- Alerts -------- */
.alert { display: flex; align-items: center; gap: 10px; padding: 12px 16px; border-radius: 11px; margin-bottom: 18px; font-size: 13.5px; border: 1px solid transparent; }
.alert .ic { width: 18px; height: 18px; flex: 0 0 auto; }
.alert-ok { background: #ecfdf3; color: #15803d; border-color: #bbf7d0; }
.alert-error { background: #fef2f2; color: #b91c1c; border-color: #fecaca; }
.alert-info { background: #eff6ff; color: #1d4ed8; border-color: #bfdbfe; }

/* -------- Empty -------- */
.empty { text-align: center; padding: 52px 20px; color: var(--text-soft); }
.empty .big { width: 54px; height: 54px; margin: 0 auto 14px; border-radius: 16px; background: var(--surface-3); color: var(--text-faint); display: grid; place-items: center; }
.empty .big .ic { width: 26px; height: 26px; }

/* -------- Detail grid -------- */
.detail-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(190px, 1fr)); gap: 16px 24px; }
.detail-grid .k { display: block; color: var(--text-faint); font-size: 11px; text-transform: uppercase; letter-spacing: .5px; font-weight: 600; }
.detail-grid .v { display: block; font-weight: 600; margin-top: 3px; }

/* -------- Bars (dashboard) -------- */
.bar-row { margin-bottom: 13px; }
.bar-row .lab { display: flex; justify-content: space-between; font-size: 13px; margin-bottom: 5px; }
.bar-track { height: 8px; background: var(--surface-3); border-radius: 99px; overflow: hidden; }
.bar-fill { height: 100%; border-radius: 99px; background: linear-gradient(90deg, var(--primary), #14b8a6); }

/* -------- Method choice cards -------- */
.method-card { display: block; text-decoration: none; color: inherit; border: 1px solid var(--border-strong); border-radius: var(--radius); padding: 22px; transition: .15s; background: var(--surface); }
.method-card:hover { border-color: var(--primary); box-shadow: var(--shadow); transform: translateY(-2px); }
.method-card .mico { width: 44px; height: 44px; border-radius: 12px; background: var(--primary-050); color: var(--primary); display: grid; place-items: center; margin-bottom: 12px; }
.method-card .mico .ic { width: 24px; height: 24px; }
.method-card h3 { margin: 0 0 6px; font-size: 15px; }
.method-card p { margin: 0; }

/* -------- Auth (login / consulta / install) -------- */
.auth-wrap { min-height: 100vh; display: grid; grid-template-columns: 1.1fr .9fr; }
.auth-aside { background:
   radial-gradient(900px 500px at 20% 0%, rgba(20,179,166,.25), transparent),
   radial-gradient(800px 500px at 100% 100%, rgba(29,78,216,.22), transparent), var(--ink);
   color: #fff; padding: 56px 52px; display: flex; flex-direction: column; justify-content: space-between; }
.auth-aside .a-brand { display: flex; align-items: center; gap: 12px; }
.auth-aside .a-brand .brand-mark { width: 44px; height: 44px; }
.auth-aside .a-brand strong { font-size: 17px; font-weight: 800; }
.auth-aside .a-brand small { display: block; color: #8fb0c4; font-size: 11px; text-transform: uppercase; letter-spacing: 1px; }
.auth-aside .a-hero h2 { font-size: 30px; line-height: 1.2; margin: 0 0 14px; font-weight: 800; letter-spacing: -.02em; }
.auth-aside .a-hero p { color: #a9c3d5; font-size: 15px; max-width: 420px; }
.auth-feats { display: flex; flex-direction: column; gap: 12px; margin-top: 22px; }
.auth-feat { display: flex; align-items: center; gap: 11px; color: #cfe0ec; font-size: 14px; }
.auth-feat .ic { width: 18px; height: 18px; color: var(--primary); }
.auth-aside .a-foot { color: #6d8497; font-size: 12px; }
.auth-main { display: grid; place-items: center; padding: 32px; background: var(--bg); }
.auth-card { width: 100%; max-width: 380px; }
.auth-card > h1 { font-size: 22px; margin: 0 0 4px; }
.auth-card > .sub { color: var(--text-soft); margin: 0 0 26px; font-size: 14px; }
.auth-card .field { margin-bottom: 16px; }
.auth-card .btn-primary { width: 100%; justify-content: center; padding: 12px; font-size: 15px; }
.muted { color: var(--text-soft); font-size: 13px; }
.mobile-brand { display: none; }

.page-head { display: flex; justify-content: space-between; align-items: center; margin-bottom: 20px; gap: 12px; flex-wrap: wrap; }
.page-head h2 { margin: 0; font-size: 19px; font-weight: 700; }
.page-head .sub { color: var(--text-soft); font-size: 13px; margin: 3px 0 0; }
.searchbar { position: relative; max-width: 460px; margin-bottom: 16px; }
.searchbar .ic { position: absolute; left: 12px; top: 50%; transform: translateY(-50%); width: 17px; height: 17px; color: var(--text-faint); }
.searchbar input { width: 100%; padding: 10px 12px 10px 38px; border: 1px solid var(--border-strong); border-radius: 10px; background: var(--surface); color: var(--text); font-family: inherit; font-size: 14px; }
.searchbar input:focus { outline: none; border-color: var(--primary); box-shadow: 0 0 0 3px var(--ring); }

/* -------- Encuesta (Likert) -------- */
.likert-scale { display: flex; flex-wrap: wrap; gap: 8px 16px; margin-bottom: 14px; font-size: 12.5px; color: var(--text-soft); }
.likert-scale span { display: inline-flex; align-items: center; gap: 6px; }
.likert-scale b { width: 20px; height: 20px; border-radius: 6px; background: var(--primary-050); color: var(--primary-600); display: grid; place-items: center; font-size: 11px; }
.q-item { display: grid; grid-template-columns: 1fr auto; gap: 12px; align-items: center; padding: 12px 0; border-bottom: 1px solid var(--border); }
.q-item:last-child { border-bottom: 0; }
.q-item .q-txt { font-size: 14px; }
.q-item .q-txt .qc { color: var(--text-faint); font-weight: 700; margin-right: 7px; font-size: 12px; }
.q-opts { display: flex; gap: 6px; }
.q-opts label { cursor: pointer; }
.q-opts input { position: absolute; opacity: 0; width: 0; height: 0; }
.q-opts .dot { width: 34px; height: 34px; border-radius: 9px; border: 1px solid var(--border-strong); display: grid; place-items: center; font-size: 13px; font-weight: 600; color: var(--text-soft); background: var(--surface); transition: .12s; }
.q-opts label:hover .dot { border-color: var(--primary); }
.q-opts input:checked + .dot { background: var(--primary); border-color: var(--primary); color: #fff; }
@media (max-width: 640px) {
  .q-item { grid-template-columns: 1fr; }
  .q-opts .dot { width: 30px; height: 30px; }
}

/* -------- Encuesta wizard -------- */
.wiz-progress { margin-bottom: 20px; }
.wiz-bar { height: 8px; background: var(--surface-3); border-radius: 99px; overflow: hidden; }
.wiz-bar > span { display: block; height: 100%; background: linear-gradient(90deg, var(--primary), #14b8a6); transition: width .25s; }
.wiz-meta { display: flex; justify-content: space-between; margin-top: 8px; font-size: 13px; color: var(--text-soft); }
.wiz-meta b { color: var(--primary-600); }
.wiz-step { display: none; }
.wiz-step.active { display: block; animation: wizfade .2s ease; }
@keyframes wizfade { from { opacity: 0; transform: translateY(6px); } to { opacity: 1; transform: none; } }
.wiz-nav { display: flex; justify-content: space-between; gap: 12px; margin-top: 8px; }
.wiz-dots { display: flex; gap: 6px; align-items: center; flex-wrap: wrap; }
.wiz-dot { width: 26px; height: 26px; border-radius: 8px; display: grid; place-items: center; font-size: 12px; font-weight: 700; background: var(--surface-2); color: var(--text-faint); border: 1px solid var(--border); }
.wiz-dot.done { background: var(--primary-050); color: var(--primary-600); border-color: transparent; }
.wiz-dot.current { background: var(--primary); color: #fff; border-color: var(--primary); }

/* -------- Responsive -------- */
@media (max-width: 960px) {
  .auth-wrap { grid-template-columns: 1fr; }
  .auth-aside { display: none; }
  .mobile-brand { display: flex; align-items: center; gap: 10px; justify-content: center; margin-bottom: 20px; }
  .mobile-brand .brand-mark { width: 40px; height: 40px; }
}
@media (max-width: 900px) {
  .sidebar { position: fixed; left: 0; top: 0; z-index: 30; transform: translateX(-100%); transition: transform .2s; box-shadow: 0 0 60px rgba(0,0,0,.4); }
  .sidebar.open { transform: translateX(0); }
  .hamb { display: block; }
}

/* ============================================================
   Modales EV — overlay premium sobre el reporte
   ============================================================ */
body.ev-open { overflow: hidden; }

/* Tira de vigilancias activas (reemplaza el botón grande) */
.ev-chips { display: flex; flex-wrap: wrap; gap: 10px; margin-top: 14px; }
.ev-chips:empty { display: none; }
.ev-chip {
  display: inline-flex; align-items: center; gap: 10px; padding: 8px 8px 8px 14px;
  background: var(--surface); border: 1px solid var(--border-strong); border-radius: 999px;
  box-shadow: var(--shadow-sm); font-size: 13px; font-weight: 600; color: var(--text);
}
.ev-chip .ev-chip-ico { display: grid; place-items: center; width: 26px; height: 26px; border-radius: 8px;
  background: var(--primary-050); color: var(--primary-600); flex: none; }
.ev-chip .ev-chip-ico svg { width: 15px; height: 15px; }
.ev-chip .ev-chip-act { display: inline-flex; align-items: center; justify-content: center; width: 28px; height: 28px;
  border: 0; border-radius: 8px; background: var(--surface-3); color: var(--text-soft); cursor: pointer; transition: .12s; }
.ev-chip .ev-chip-act svg { width: 15px; height: 15px; }
.ev-chip .ev-chip-act.edit:hover { background: var(--primary); color: #fff; }
.ev-chip .ev-chip-act.del:hover { background: var(--danger); color: #fff; }

/* Overlay + difuminado hacia la pantalla principal */
.ev-modal { position: fixed; inset: 0; z-index: 80; display: flex; align-items: center; justify-content: center; padding: 24px; }
.ev-backdrop { position: absolute; inset: 0; background: rgba(6, 20, 30, .58);
  backdrop-filter: blur(6px) saturate(115%); -webkit-backdrop-filter: blur(6px) saturate(115%); animation: evbg .2s ease; }
@keyframes evbg { from { opacity: 0; } to { opacity: 1; } }
.ev-dialog { position: relative; width: 100%; max-width: 760px; max-height: 88vh; display: flex; flex-direction: column;
  background: var(--surface); border: 1px solid var(--border); border-radius: 20px;
  box-shadow: 0 30px 70px -20px rgba(6,20,30,.55), 0 8px 20px -8px rgba(6,20,30,.35);
  overflow: hidden; animation: evpop .22s cubic-bezier(.2,.8,.2,1); }
@keyframes evpop { from { opacity: 0; transform: translateY(18px) scale(.97); } to { opacity: 1; transform: none; } }
.ev-head { position: relative; display: flex; align-items: center; gap: 14px; padding: 20px 22px; overflow: hidden;
  background: linear-gradient(135deg, var(--primary-050), transparent 70%); border-bottom: 1px solid var(--border); }
.ev-head::before { content: ""; position: absolute; left: 0; top: 0; bottom: 0; width: 4px; background: var(--primary); }
.ev-head .ev-ico { display: grid; place-items: center; width: 46px; height: 46px; border-radius: 13px; flex: none;
  background: var(--primary); color: #fff; box-shadow: 0 8px 18px -8px var(--primary); }
.ev-head .ev-ico svg { width: 23px; height: 23px; }
.ev-head .ev-tt { display: flex; flex-direction: column; gap: 2px; min-width: 0; }
.ev-head .ev-tt strong { font-size: 17px; letter-spacing: -.01em; }
.ev-head .ev-tt small { color: var(--text-soft); font-size: 13px; }
.ev-x { margin-left: auto; display: grid; place-items: center; width: 36px; height: 36px; border: 0; border-radius: 10px;
  background: rgba(255,255,255,.5); color: var(--text-soft); font-size: 22px; line-height: 1; cursor: pointer; transition: .12s; }
.ev-x:hover { background: var(--danger); color: #fff; }
.ev-body { padding: 22px; overflow: auto; }
.ev-foot { display: flex; align-items: center; justify-content: flex-end; gap: 10px; padding: 16px 22px;
  border-top: 1px solid var(--border); background: var(--surface-2); }
.ev-foot .ev-spacer { margin-right: auto; font-size: 12.5px; color: var(--text-faint); }

/* ============================================================
   Encuesta — experiencia inmersiva, una pregunta por pantalla
   ============================================================ */
.sv-launch { position: relative; overflow: hidden; text-align: center; max-width: 600px; margin: 26px auto;
  padding: 46px 32px; border-radius: 22px; border: 1px solid var(--border);
  background:
    radial-gradient(120% 90% at 50% -20%, var(--primary-050), transparent 60%),
    var(--surface);
  box-shadow: var(--shadow); }
.sv-launch::before { content: ""; position: absolute; left: 0; right: 0; top: 0; height: 4px;
  background: linear-gradient(90deg, var(--primary), #14b8a6, var(--accent)); }
.sv-launch-ico { display: grid; place-items: center; width: 72px; height: 72px; margin: 0 auto 20px; border-radius: 20px;
  background: var(--primary); color: #fff; box-shadow: 0 16px 34px -14px var(--primary); }
.sv-launch-ico svg { width: 34px; height: 34px; }
.sv-launch h3 { font-size: 22px; margin-bottom: 10px; letter-spacing: -.02em; }
.sv-launch p { margin: 0 auto 26px; max-width: 420px; }
.btn-lg { padding: 14px 30px; font-size: 15px; border-radius: 12px; }

body.sv-lock { overflow: hidden; }
.sv-modal { position: fixed; inset: 0; z-index: 90; display: flex;
  background:
    radial-gradient(90% 60% at 50% -10%, var(--primary-050), transparent 55%),
    var(--bg);
  animation: evbg .22s ease; }
.sv-modal #svForm { position: relative; margin: auto; width: 100%; max-width: 720px; height: 100%;
  display: flex; flex-direction: column; padding: 0 24px; }

.sv-top { padding-top: 30px; }
.sv-bar { height: 7px; background: var(--surface-3); border-radius: 999px; overflow: hidden; box-shadow: inset 0 1px 2px rgba(0,0,0,.06); }
.sv-bar > span { display: block; height: 100%; width: 4%;
  background: linear-gradient(90deg, var(--primary), #14b8a6); border-radius: 999px; transition: width .35s cubic-bezier(.2,.8,.2,1); }
.sv-meta { display: flex; align-items: center; justify-content: space-between; margin-top: 12px; font-size: 13px; color: var(--text-soft); }
.sv-meta b { color: var(--primary-600); font-size: 14px; }
.sv-close { display: grid; place-items: center; width: 38px; height: 38px; border: 1px solid var(--border);
  background: var(--surface); border-radius: 10px; font-size: 22px; line-height: 1; color: var(--text-soft); cursor: pointer; transition: .12s; }
.sv-close:hover { background: var(--danger); color: #fff; border-color: var(--danger); }

.sv-stage { flex: 1; display: flex; flex-direction: column; justify-content: center; padding: 20px 0; overflow: auto; }
.sv-screen { animation: svslide .28s cubic-bezier(.2,.8,.2,1); }
@keyframes svslide { from { opacity: 0; transform: translateX(24px); } to { opacity: 1; transform: none; } }
.sv-tag { display: inline-flex; align-items: center; gap: 7px; font-size: 12px; font-weight: 700; letter-spacing: .02em;
  text-transform: uppercase; color: var(--primary-600); background: var(--primary-050);
  padding: 6px 13px; border-radius: 999px; margin-bottom: 20px; }
.sv-q { font-size: 27px; line-height: 1.28; letter-spacing: -.02em; margin-bottom: 10px; }
.sv-help { color: var(--text-soft); margin-bottom: 8px; font-size: 14.5px; }
.sv-likert, .sv-choices { display: flex; flex-direction: column; gap: 11px; margin-top: 26px; }
.sv-opt { display: block; cursor: pointer; }
.sv-opt input { position: absolute; opacity: 0; width: 0; height: 0; }
.sv-opt-in { display: flex; align-items: center; gap: 14px; padding: 16px 18px; border: 1.5px solid var(--border-strong);
  border-radius: 14px; background: var(--surface); font-size: 15.5px; font-weight: 500; transition: .14s;
  box-shadow: var(--shadow-sm); }
.sv-opt-in b { display: grid; place-items: center; width: 32px; height: 32px; border-radius: 10px; background: var(--surface-3);
  color: var(--text-soft); font-size: 14px; font-weight: 700; flex: none; transition: .14s; }
.sv-opt:hover .sv-opt-in { border-color: var(--primary); transform: translateY(-1px); box-shadow: 0 8px 18px -12px var(--primary); }
.sv-opt input:checked + .sv-opt-in { border-color: var(--primary); background: var(--primary-050); color: var(--primary-700); }
.sv-opt input:checked + .sv-opt-in b { background: var(--primary); color: #fff; }
.sv-opt input:focus-visible + .sv-opt-in { outline: none; box-shadow: 0 0 0 4px var(--ring); }
.sv-input { width: 100%; padding: 15px 17px; font-size: 16px; font-family: inherit; border: 1.5px solid var(--border-strong);
  border-radius: 14px; background: var(--surface); color: var(--text); margin-top: 10px; box-shadow: var(--shadow-sm); }
.sv-input:focus { outline: none; border-color: var(--primary); box-shadow: 0 0 0 4px var(--ring); }
textarea.sv-input { resize: vertical; min-height: 130px; }
.sv-nav { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 18px 0 30px; }
.sv-nav .btn:disabled { opacity: .35; cursor: not-allowed; }
.sv-skip { font-size: 13px; color: var(--text-faint); background: none; border: 0; cursor: pointer; text-decoration: underline; }
.sv-skip:hover { color: var(--text-soft); }

@media (max-width: 600px) {
  .sv-modal #svForm { padding: 0 16px; }
  .sv-q { font-size: 22px; }
  .ev-modal { padding: 12px; }
  .ev-head { padding: 16px; }
}

/* -------- Protocolo de Londres (análisis) -------- */
.grid-3 { display: grid; grid-template-columns: repeat(3, 1fr); gap: 14px; }
.method-card--reco { border-color: var(--primary); box-shadow: 0 10px 26px -16px var(--primary); }
.method-card--reco .mico { background: var(--primary); color: #fff; }
/* Campos del Protocolo de Londres — estilo premium unificado */
.london-analysis textarea {
  width: 100%; padding: 13px 15px; border: 1px solid var(--border-strong); border-radius: 12px;
  background: var(--surface); color: var(--text); font-size: 14.5px; font-family: inherit; line-height: 1.55;
  resize: vertical; min-height: 92px; box-shadow: var(--shadow-sm); transition: border-color .14s, box-shadow .14s;
}
.london-analysis textarea::placeholder { color: var(--text-faint); }
.london-analysis textarea:focus { outline: none; border-color: var(--primary); box-shadow: 0 0 0 4px var(--ring); }

.london-grid { display: grid; grid-template-columns: repeat(2, 1fr); gap: 16px; }
.london-factor { position: relative; border: 1px solid var(--border); border-radius: 16px; padding: 16px 18px;
  background: var(--surface); box-shadow: var(--shadow-sm); transition: border-color .14s, box-shadow .14s, transform .14s; }
.london-factor:focus-within { border-color: var(--primary); box-shadow: 0 12px 26px -18px var(--primary); transform: translateY(-1px); }
.london-factor .lbl-ic { display: flex; align-items: center; gap: 10px; font-weight: 700; font-size: 14.5px; color: var(--text); }
.london-factor .lf-num { display: grid; place-items: center; width: 26px; height: 26px; border-radius: 9px;
  background: var(--primary); color: #fff; font-size: 13px; font-weight: 800; flex: none; box-shadow: 0 6px 14px -6px var(--primary); }
.london-factor .lf-help { margin: 9px 0 11px; font-size: 12.5px; color: var(--text-soft); line-height: 1.5; }
.london-factor textarea { min-height: 72px; }
@media (max-width: 860px) { .grid-3 { grid-template-columns: 1fr; } .london-grid { grid-template-columns: 1fr; } }

/* -------- Jerarquía Política → Objetivos → Específicos -------- */
.obj-list { display: flex; flex-direction: column; gap: 10px; }
.obj-row { display: flex; align-items: center; gap: 14px; padding: 14px 16px; border: 1px solid var(--border-strong);
  border-radius: 14px; background: var(--surface); text-decoration: none; color: inherit; transition: .14s; box-shadow: var(--shadow-sm); }
.obj-row:hover { border-color: var(--primary); transform: translateY(-1px); box-shadow: 0 10px 22px -16px var(--primary); }
.obj-cod { display: grid; place-items: center; min-width: 62px; padding: 8px 10px; border-radius: 10px;
  background: var(--primary); color: #fff; font-weight: 800; font-size: 13px; flex: none; }
.obj-cod--alt { background: var(--accent); }
.obj-body { display: flex; flex-direction: column; gap: 3px; min-width: 0; flex: 1; }
.obj-body strong { font-size: 14.5px; color: var(--text); }
.obj-body small { font-size: 12.5px; color: var(--text-soft); }
.obj-meta { display: flex; align-items: center; gap: 10px; flex: none; color: var(--text-faint); }
.obj-meta .ic { width: 18px; height: 18px; }

/* -------- Anexos (archivos adjuntos) -------- */
.anexos { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 10px; }
.anexo-chip { display: inline-flex; align-items: center; gap: 7px; padding: 5px 8px 5px 10px; border: 1px solid var(--border-strong);
  border-radius: 10px; background: var(--surface-2); font-size: 12.5px; max-width: 100%; }
.anexo-chip a { display: inline-flex; align-items: center; gap: 6px; color: var(--text); text-decoration: none; min-width: 0; }
.anexo-chip a:hover { color: var(--primary-600); }
.anexo-chip a span { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; max-width: 180px; }
.anexo-chip a .ic { width: 15px; height: 15px; color: var(--primary-600); flex: none; }
.anexo-chip small { color: var(--text-faint); }
.anexo-chip form { display: inline; margin: 0; }
.anexo-x { border: 0; background: var(--surface-3); color: var(--text-soft); width: 20px; height: 20px; border-radius: 6px;
  cursor: pointer; font-size: 15px; line-height: 1; }
.anexo-x:hover { background: var(--danger); color: #fff; }

/* -------- Menú por periodicidad (Indicadores de Ley) -------- */
.per-menu { display: grid; grid-template-columns: repeat(auto-fit, minmax(180px, 1fr)); gap: 12px; margin-bottom: 16px; }
.per-card { display: flex; align-items: center; gap: 11px; padding: 14px 16px; border: 1px solid var(--border-strong);
  border-radius: 14px; background: var(--surface); text-decoration: none; color: inherit; transition: .14s; box-shadow: var(--shadow-sm); position: relative; }
.per-card:hover { border-color: var(--primary); transform: translateY(-1px); }
.per-card.is-active { border-color: var(--primary); background: var(--primary-050); }
.per-card .per-ico { display: grid; place-items: center; width: 38px; height: 38px; border-radius: 11px;
  background: var(--primary-050); color: var(--primary-600); flex: none; }
.per-card.is-active .per-ico { background: var(--primary); color: #fff; }
.per-card .per-ico .ic { width: 20px; height: 20px; }
.per-card .per-t { font-weight: 700; font-size: 13.5px; }
.per-card .per-n { margin-left: auto; font-weight: 800; font-size: 15px; color: var(--primary-600); }

.ind-search { display: flex; align-items: center; gap: 8px; margin-bottom: 18px; position: relative; }
.ind-search .ind-search-ico { position: absolute; left: 12px; color: var(--text-faint); display: grid; place-items: center; }
.ind-search .ind-search-ico .ic { width: 17px; height: 17px; }
.ind-search input[type=text] { flex: 1; padding: 10px 12px 10px 38px; border: 1px solid var(--border-strong);
  border-radius: 10px; background: var(--surface); color: var(--text); font-family: inherit; font-size: 14px; }
.ind-search input[type=text]:focus { outline: none; border-color: var(--primary); box-shadow: 0 0 0 3px var(--ring); }
.anexo-chip .anexo-fn { color: var(--text-faint); font-size: 11px; }

/* -------- Algoritmo de Naranjo -------- */
.nar-tbl td { vertical-align: middle; }
.nar-opt { display: inline-flex; cursor: pointer; }
.nar-opt input { position: absolute; opacity: 0; width: 0; height: 0; }
.nar-pt { display: grid; place-items: center; min-width: 38px; height: 30px; padding: 0 8px; border: 1.5px solid var(--border-strong);
  border-radius: 8px; background: var(--surface); font-weight: 700; font-size: 13px; color: var(--text-soft); transition: .12s; }
.nar-opt:hover .nar-pt { border-color: var(--primary); }
.nar-opt input:checked + .nar-pt { background: var(--primary); border-color: var(--primary); color: #fff; }
.nar-result { display: flex; align-items: center; gap: 14px; margin-top: 14px; font-size: 15px; }
.nar-result b { font-size: 20px; color: var(--primary-600); }
.nar-badge { display: inline-flex; align-items: center; padding: 5px 14px; border-radius: 999px; font-weight: 700; font-size: 13px;
  background: var(--surface-3); color: var(--text-soft); }
.nar-badge.nar-definida { background: #dcfce7; color: #15803d; }
.nar-badge.nar-probable { background: var(--primary-050); color: var(--primary-700); }
.nar-badge.nar-posible  { background: #fef3c7; color: #b45309; }
.nar-badge.nar-dudosa   { background: #fee2e2; color: #b91c1c; }

/* -------- Rondas de seguridad -------- */
.rs-step { font-weight: 800; font-size: 14px; color: var(--primary-700); background: var(--primary-050);
  border-radius: 10px; padding: 10px 14px; margin: 0 0 12px; }
.rs-sec { font-size: 13.5px; font-weight: 700; margin: 16px 0 6px; color: var(--text); border-bottom: 1px solid var(--border); padding-bottom: 5px; }
.rs-tbl { width: 100%; border-collapse: collapse; }
.rs-tbl td { padding: 7px 8px; border-bottom: 1px solid var(--border); vertical-align: top; font-size: 13px; }
.rs-tbl .rs-q { width: 46%; }
.rs-tbl .rs-ans { width: 30%; white-space: nowrap; }
.rs-tbl .rs-obs { width: 24%; }
.rs-tbl .rs-obs input { width: 100%; padding: 6px 8px; border: 1px solid var(--border-strong); border-radius: 8px; background: var(--surface); color: var(--text); font-size: 12.5px; }
.rs-tbl .rs-ans input { padding: 6px 8px; border: 1px solid var(--border-strong); border-radius: 8px; background: var(--surface); color: var(--text); }
.rs-enc td { background: var(--surface-2); font-size: 13px; }
.rs-opt { display: inline-flex; align-items: center; gap: 4px; margin-right: 10px; cursor: pointer; font-size: 12.5px; }
.rs-opt input { accent-color: var(--primary); }
@media (max-width: 760px) {
  .rs-tbl, .rs-tbl tbody, .rs-tbl tr, .rs-tbl td { display: block; width: 100% !important; }
  .rs-tbl .rs-q { font-weight: 600; border-bottom: 0; padding-bottom: 0; }
  .rs-tbl tr { border-bottom: 1px solid var(--border); margin-bottom: 6px; }
}
