:root {
  --ink: #071a2b;
  --ink-2: #0d2639;
  --ink-3: #15364a;
  --paper: #f4f7f5;
  --white: #ffffff;
  --line: #dce6e4;
  --muted: #61747f;
  --quiet: #8ca0a8;
  --mint: #83f4c5;
  --mint-strong: #23d39a;
  --cyan: #5fd5e8;
  --coral: #ff7d6c;
  --amber: #ffc864;
  --radius: 10px;
  --shadow: 0 22px 60px rgba(7, 26, 43, 0.09);
  --font: "Avenir Next", Avenir, "Helvetica Neue", Arial, sans-serif;
}

* { box-sizing: border-box; }
html { color-scheme: light; scroll-behavior: smooth; }
body { margin: 0; color: var(--ink); background: var(--paper); font-family: var(--font); -webkit-font-smoothing: antialiased; }
button, input, select, textarea { font: inherit; }
button, a { -webkit-tap-highlight-color: transparent; }
a { color: inherit; text-decoration: none; }
svg { display: block; }

.app-shell { display: grid; grid-template-columns: 260px minmax(0, 1fr); min-height: 100vh; }
.sidebar { position: sticky; top: 0; height: 100vh; padding: 28px 22px 22px; color: #dfe9ea; background: var(--ink); display: flex; flex-direction: column; z-index: 20; overflow: hidden; }
.sidebar::before { content: ""; position: absolute; width: 260px; height: 260px; border: 1px solid rgba(131, 244, 197, .1); border-radius: 50%; top: -165px; right: -110px; box-shadow: 0 0 0 38px rgba(131, 244, 197, .025), 0 0 0 76px rgba(131, 244, 197, .018); pointer-events: none; }
.brand { position: relative; display: inline-flex; align-items: center; gap: 9px; width: fit-content; font-weight: 800; letter-spacing: -.05em; font-size: 24px; color: white; }
.brand-mark { width: 34px; height: 34px; display: inline-flex; align-items: center; justify-content: center; }
.brand-mark svg { width: 34px; height: 34px; overflow: visible; }
.brand-mark path:not(.brand-line) { stroke: var(--mint); stroke-width: 3; stroke-linecap: round; }
.brand-mark .brand-line { fill: none; stroke: var(--coral); stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }
.brand-mark circle { fill: var(--coral); }
.brand-word > span { color: var(--mint); }
.brand-light { color: white; }

.workspace-chip { position: relative; margin-top: 36px; padding: 14px; display: flex; align-items: center; gap: 11px; background: rgba(255,255,255,.055); border: 1px solid rgba(255,255,255,.08); border-radius: 13px; }
.workspace-avatar, .user-avatar { flex: 0 0 auto; display: grid; place-items: center; width: 35px; height: 35px; border-radius: 11px; color: var(--ink); background: var(--mint); font-weight: 800; text-transform: uppercase; }
.workspace-chip span:last-child, .sidebar-user > span:nth-child(2) { min-width: 0; display: flex; flex-direction: column; }
.workspace-chip small, .sidebar-user small { color: #87a0aa; font-size: 10px; letter-spacing: .06em; text-transform: uppercase; }
.workspace-chip strong { margin-top: 3px; overflow: hidden; color: #f8fbfb; font-size: 13px; text-overflow: ellipsis; white-space: nowrap; }

.main-nav { display: flex; flex-direction: column; gap: 7px; margin-top: 30px; }
.main-nav a { position: relative; display: flex; align-items: center; gap: 12px; padding: 12px 13px; color: #93a9b1; border-radius: 11px; font-size: 14px; font-weight: 650; transition: .2s ease; }
.main-nav a:hover { color: white; background: rgba(255,255,255,.055); transform: translateX(2px); }
.main-nav a[aria-current="page"] { color: var(--ink); background: var(--mint); box-shadow: 0 12px 26px rgba(35, 211, 154, .18); }
.main-nav a[aria-current="page"]::before { content: ""; position: absolute; left: -22px; width: 3px; height: 22px; border-radius: 0 3px 3px 0; background: var(--mint); }
.main-nav .nav-section { margin: 16px 13px 2px; color: #5f7780; font-size: 10px; font-weight: 800; letter-spacing: .09em; text-transform: uppercase; }
.main-nav svg, .icon-button svg, .metric-icon svg, .date-control svg, .button svg, .survey-icon svg { width: 20px; height: 20px; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }
.main-nav svg { width: 18px; height: 18px; }
.main-nav a:first-child svg { fill: currentColor; stroke: none; }
.nav-count { margin-left: auto; min-width: 21px; padding: 2px 6px; color: white; background: var(--coral); border-radius: 20px; text-align: center; font-size: 10px; }

.sidebar-note { margin-top: auto; padding: 13px; display: flex; align-items: flex-start; gap: 10px; border-top: 1px solid rgba(255,255,255,.08); border-bottom: 1px solid rgba(255,255,255,.08); }
.pulse-dot { position: relative; width: 8px; height: 8px; margin-top: 4px; border-radius: 50%; background: var(--mint); box-shadow: 0 0 0 5px rgba(131,244,197,.1); }
.pulse-dot::after { content: ""; position: absolute; inset: -5px; border: 1px solid var(--mint); border-radius: 50%; animation: pulse 2s infinite; }
@keyframes pulse { 0%, 100% { opacity: 0; transform: scale(.7); } 45% { opacity: .6; transform: scale(1.1); } }
.sidebar-note p { margin: 0; display: flex; flex-direction: column; gap: 3px; }
.sidebar-note strong { color: #dce8e8; font-size: 11px; }
.sidebar-note small { color: #718b95; font-size: 10px; }
.sidebar-user { padding: 18px 4px 0; display: grid; grid-template-columns: auto 1fr auto; align-items: center; gap: 10px; }
.sidebar-user .user-avatar { width: 34px; height: 34px; border-radius: 50%; background: #1f4354; color: var(--mint); }
.sidebar-user strong { overflow: hidden; color: #f4f8f8; font-size: 12px; text-overflow: ellipsis; white-space: nowrap; }
.sidebar-user small { margin-top: 2px; font-size: 8px; }
.icon-button { width: 34px; height: 34px; padding: 7px; color: #8ca4ac; background: transparent; border: 0; border-radius: 9px; cursor: pointer; }
.icon-button:hover { color: white; background: rgba(255,255,255,.07); }
.icon-button span { display: block; width: 18px; height: 2px; margin: 3px auto; background: currentColor; border-radius: 2px; }

.app-main { min-width: 0; }
.mobile-header { display: none; }
.page { width: min(1480px, 100%); margin: 0 auto; padding: 38px 42px 54px; }
.page-header { display: flex; justify-content: space-between; align-items: flex-end; gap: 30px; margin-bottom: 30px; }
.page-header > div:first-child { flex: 1 0 320px; }
.page-header h1 { margin: 5px 0 3px; font-size: clamp(30px, 3vw, 44px); line-height: 1.05; letter-spacing: -.045em; }
.page-header p { margin: 0; color: var(--muted); font-size: 15px; }
.dashboard-live-status { display: block; margin-top: 8px; color: var(--muted); font-size: 11px; }
.eyebrow { color: #37806b; font-size: 10px; font-weight: 800; letter-spacing: .16em; text-transform: uppercase; }
.header-actions { display: flex; align-items: center; gap: 10px; }
.date-control, .button { min-height: 42px; padding: 0 17px; display: inline-flex; align-items: center; justify-content: center; gap: 9px; border: 0; border-radius: 11px; cursor: pointer; font-size: 12px; font-weight: 750; transition: transform .2s ease, box-shadow .2s ease, background .2s ease; }
.date-control { color: var(--ink-3); background: white; border: 1px solid var(--line); }
.date-control svg { width: 17px; height: 17px; }
.page-header .period-summary { margin-top: 8px; color: var(--ink-3); font-size: 13px; }
.page-header .period-alert { margin: 10px 0 0; }
.header-actions { flex-wrap: wrap; justify-content: flex-end; }
.period-form { display: flex; flex-wrap: wrap; align-items: flex-end; gap: 8px; }
.period-field { display: flex; flex-direction: column; gap: 4px; }
.period-field label { color: #546a73; font-size: 10px; font-weight: 750; }
.period-field select, .period-field input { min-height: 42px; padding: 0 10px; color: var(--ink); background: white; border: 1px solid var(--line); border-radius: 11px; outline: none; }
.period-field select:focus, .period-field input:focus, .date-control:focus-visible { border-color: #38c795; box-shadow: 0 0 0 3px rgba(35,211,154,.18); }
.period-hint { flex-basis: 100%; color: var(--quiet); font-size: 10px; }
.button:hover, .date-control:hover { transform: translateY(-1px); }
.button-primary { color: var(--ink); background: var(--mint); box-shadow: 0 12px 24px rgba(35,211,154,.18); }
.button-primary:hover { background: #95f7d0; box-shadow: 0 15px 30px rgba(35,211,154,.24); }
.button-secondary { color: var(--ink); background: #edf3f1; border: 1px solid #d6e2df; }
.button-muted { color: #49616c; background: white; border: 1px solid var(--line); }
.button-wide { width: 100%; }

.message-stack { position: fixed; top: 24px; right: 24px; width: min(380px, calc(100vw - 48px)); z-index: 90; }
.message { padding: 14px 16px; color: #173e32; background: #dff9ee; border: 1px solid #aeead2; border-radius: 12px; box-shadow: var(--shadow); font-size: 13px; }
.form-alert, .field-error { color: #a3382d; background: #fff0ed; border: 1px solid #ffd3cc; border-radius: 10px; }
.form-alert { margin: 18px 0; padding: 12px 14px; font-size: 12px; }
.field-error { padding: 8px 10px; font-size: 11px; }

.metric-grid { display: grid; grid-template-columns: 1.2fr repeat(3, 1fr); gap: 14px; }
.metric-card { position: relative; min-height: 166px; padding: 20px; background: white; border: 1px solid var(--line); border-radius: var(--radius); overflow: hidden; }
.metric-featured { color: white; background: var(--ink-2); border-color: var(--ink-2); }
.metric-top { position: relative; display: flex; justify-content: space-between; align-items: center; color: var(--muted); font-size: 11px; font-weight: 700; letter-spacing: .035em; }
.metric-featured .metric-top { color: #a7bac1; }
.trend { padding: 4px 7px; border-radius: 20px; font-size: 9px; }
.trend.positive { color: #65e0b3; background: rgba(35,211,154,.12); }
.trend.neutral { color: #a7bac1; background: rgba(255,255,255,.08); }
.trend.negative { color: #ffa497; background: rgba(255,125,108,.16); }
.metric-value.is-thin { color: #a7bac1; }
.metric-card .sample-flag { padding: 7px 9px; color: #ffd892; background: rgba(255,200,100,.1); border: 1px solid rgba(255,200,100,.22); border-radius: 9px; }
.metric-card .nps-change { max-width: none; }
.metric-card .nps-change .trend { margin-right: 4px; font-size: 10px; font-weight: 800; white-space: nowrap; }
.metric-featured .nps-shares { margin-top: 6px; color: #c4d4d9; font-weight: 700; }
.metric-icon { width: 30px; height: 30px; display: grid; place-items: center; border-radius: 9px; }
.metric-icon svg { width: 15px; height: 15px; }
.metric-icon.mint { color: #208b68; background: #e0f9ef; }
.metric-icon.cyan { color: #207d8d; background: #e4f8fb; }
.metric-icon.coral { color: #b64a3d; background: #ffebe8; }
.metric-value { position: relative; margin-top: 13px; font-size: 42px; line-height: 1; font-weight: 780; letter-spacing: -.05em; }
.metric-card p { position: relative; max-width: 240px; margin: 12px 0 0; color: var(--muted); font-size: 11px; line-height: 1.55; }
.metric-featured p { color: #91a9b2; }
.mini-spectrum { position: relative; width: 80%; height: 4px; margin-top: 15px; display: flex; border-radius: 5px; overflow: visible; }
.mini-spectrum i { flex: 1; }
.mini-spectrum i:nth-child(1) { background: var(--coral); border-radius: 5px 0 0 5px; }
.mini-spectrum i:nth-child(2) { background: var(--amber); }
.mini-spectrum i:nth-child(3) { background: var(--mint); border-radius: 0 5px 5px 0; }
.mini-spectrum span { position: absolute; left: var(--position); top: -3px; width: 10px; height: 10px; background: white; border: 2px solid var(--ink); border-radius: 50%; box-shadow: 0 0 0 2px white; }

.dashboard-section + .dashboard-section { margin-top: 38px; }
.section-heading { margin-bottom: 16px; display: flex; justify-content: space-between; align-items: flex-end; gap: 20px; }
.section-heading h2 { margin: 4px 0 3px; font-size: 22px; letter-spacing: -.035em; }
.section-heading p { max-width: 640px; margin: 0; color: var(--muted); font-size: 12px; line-height: 1.5; }
.section-link { flex: none; color: #23795c; font-size: 11px; font-weight: 800; }
.dashboard-metrics { grid-template-columns: 1.2fr repeat(2, 1fr); }
.area-panel.is-wide { grid-column: 1 / -1; }
.case-kpi-grid { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 14px; }
.kpi-card { padding: 18px 20px; display: flex; flex-direction: column; gap: 8px; background: white; border: 1px solid var(--line); border-radius: var(--radius); }
.kpi-card.is-alert { border-color: #ffd3cc; box-shadow: inset 4px 0 0 var(--coral); }
.kpi-label { color: var(--muted); font-size: 11px; font-weight: 700; letter-spacing: .02em; }
.kpi-value { font-size: 32px; line-height: 1; font-weight: 780; letter-spacing: -.045em; }
.kpi-value.is-empty { color: var(--quiet); }
.kpi-note { margin: 0; color: var(--muted); font-size: 10px; line-height: 1.5; }
.kpi-note .on-time { color: #23795c; }
/* Cada tarjeta lleva a la lista donde se actúa sobre lo que cuenta. */
a.kpi-card, a.metric-card { display: flex; flex-direction: column; transition: border-color .2s ease; }
a.kpi-card:hover, a.metric-card:hover { border-color: #b7cbc5; }
a.kpi-card:focus-visible, a.metric-card:focus-visible { outline: 2px solid var(--mint-strong); outline-offset: 2px; }
.kpi-action, .metric-action { position: relative; margin-top: auto; padding-top: 12px; color: #23795c; font-size: 11px; font-weight: 800; }
.metric-featured .metric-action { color: var(--mint); }
a.kpi-card:hover .kpi-action, a.metric-card:hover .metric-action { text-decoration: underline; }
.priority-count { margin-right: 6px; padding: 3px 7px; display: inline-block; color: #8a5a12; background: #fff3dc; border-radius: 20px; font-weight: 800; }
.priority-count.high, .priority-count.critical { color: #9a4138; background: #ffebe8; }
.call-list { margin: 14px 0 0; padding: 0; list-style: none; background: white; border: 1px solid var(--line); border-radius: var(--radius); overflow: hidden; }
.call-row + .call-row { border-top: 1px solid #edf2f0; }
.call-row a { padding: 13px 18px; display: grid; grid-template-columns: 74px minmax(0, 1fr) auto; align-items: center; gap: 14px; }
.call-row a:hover { background: #fafcfb; }
.call-priority { padding: 4px 8px; color: #8a5a12; background: #fff3dc; border-radius: 20px; font-size: 9px; font-weight: 800; text-align: center; }
.call-priority.high, .call-priority.critical { color: #9a4138; background: #ffebe8; }
.call-copy { min-width: 0; display: flex; flex-direction: column; gap: 3px; }
.call-copy strong { font-size: 12px; }
.call-copy small { overflow: hidden; color: var(--muted); font-size: 10px; text-overflow: ellipsis; white-space: nowrap; }
.call-state { display: flex; flex-direction: column; align-items: flex-end; gap: 4px; }
.call-state small { font-size: 9px; font-weight: 700; }
.doing-list { margin: 14px 0 10px; padding: 0; list-style: none; background: white; border: 1px solid var(--line); border-radius: var(--radius); overflow: hidden; }
.doing-row + .doing-row { border-top: 1px solid #edf2f0; }
.doing-row a { padding: 13px 18px; display: grid; grid-template-columns: minmax(0, 1fr) auto; align-items: center; gap: 14px; }
.doing-row a:hover { background: #fafcfb; }
.doing-copy { min-width: 0; display: flex; flex-direction: column; gap: 3px; }
.doing-copy strong { font-size: 12px; }
.doing-copy small { color: var(--muted); font-size: 10px; }
.doing-reading { display: flex; flex-direction: column; align-items: flex-end; gap: 4px; color: var(--ink); font-size: 10px; text-align: right; }
.doing-reading small { color: var(--muted); font-size: 9px; }
.doing-reading .trend { font-weight: 800; white-space: nowrap; }
.doing-reading .trend.positive { color: #1f8a64; background: #e2f6ee; }
.doing-reading .trend.negative { color: #a8463b; background: #ffebe8; }
.doing-reading .trend.neutral { color: #4e6870; background: #edf3f1; }
.panel-header h3 { margin: 4px 0 0; font-size: 15px; letter-spacing: -.02em; }
.delivery-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 14px; }
.delivery-grid + .delivery-grid, .empty-state.panel + .delivery-grid { margin-top: 14px; }
.funnel-steps { margin: 18px 0 0; padding: 0; list-style: none; display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 8px; }
.funnel-steps li { padding: 12px 14px; display: flex; flex-direction: column; gap: 3px; background: #f4f8f6; border-radius: 12px; }
.funnel-steps li + li { background: #e9f5f0; }
.funnel-steps li:last-child { color: white; background: var(--ink-2); }
.funnel-steps span { font-size: 10px; font-weight: 800; letter-spacing: .03em; }
.funnel-steps strong { font-size: 26px; line-height: 1.1; letter-spacing: -.04em; }
.funnel-steps small { color: var(--quiet); font-size: 9px; }
.funnel-rate { margin: 14px 0 0; color: var(--muted); font-size: 11px; line-height: 1.6; }
.funnel-rate strong { color: var(--ink); }
.funnel-rate .trend.positive { color: #1f8a64; background: #e2f6ee; }
.funnel-rate .trend.negative { color: #a8463b; background: #ffebe8; }
.funnel-rate .trend.neutral { color: #4e6870; background: #edf3f1; }
.delivery-subtitle { margin: 18px 0 8px; color: var(--ink-3); font-size: 12px; }
.funnel-outcomes, .error-list { margin: 0; padding: 0; list-style: none; display: flex; flex-direction: column; }
.funnel-outcomes li { padding: 7px 0; display: flex; justify-content: space-between; gap: 12px; border-bottom: 1px solid #edf2f0; color: var(--muted); font-size: 11px; }
.funnel-outcomes li b { color: var(--ink); }
.funnel-outcomes li.is-risk, .funnel-outcomes li.is-risk b { color: #a8463b; }
.channel-table { width: 100%; margin-top: 14px; border-collapse: collapse; font-size: 11px; }
.channel-table th, .channel-table td { padding: 9px 6px; border-bottom: 1px solid #edf2f0; text-align: right; }
.channel-table th:first-child, .channel-table td:first-child { text-align: left; }
.channel-table thead th { color: var(--quiet); font-size: 9px; font-weight: 800; letter-spacing: .04em; text-transform: uppercase; }
.channel-table .muted { color: var(--quiet); }
.channel-panel .panel-note { margin-top: 12px; }
.error-list { margin-top: 12px; gap: 10px; }
.error-list li { display: flex; flex-direction: column; gap: 3px; }
.error-head { display: flex; justify-content: space-between; gap: 10px; font-size: 11px; }
.error-head b { color: #a8463b; }
.error-list small { color: var(--muted); font-size: 10px; line-height: 1.45; overflow-wrap: anywhere; }
.errors-panel .panel-note, .public-panel .panel-note { margin-top: 12px; }
.public-total { margin: 14px 0 0; color: var(--ink-3); font-size: 13px; font-weight: 700; }
.dashboard-grid { margin-top: 14px; display: grid; grid-template-columns: minmax(0, 1.65fr) minmax(290px, .75fr); gap: 14px; }
.panel { padding: 23px; background: white; border: 1px solid var(--line); border-radius: var(--radius); }
.panel-header { display: flex; justify-content: space-between; align-items: flex-start; gap: 20px; }
.panel-header h2 { margin: 4px 0 0; font-size: 17px; letter-spacing: -.025em; }
.panel-header > a { color: #287f66; font-size: 11px; font-weight: 750; }
.quiet-label { padding: 6px 9px; color: var(--quiet); background: #f4f7f6; border-radius: 8px; font-size: 9px; }
.trend-panel { min-height: 320px; }
.bar-chart { position: relative; height: 220px; margin-top: 20px; padding: 15px 8px 24px; display: flex; align-items: stretch; gap: 12px; border-bottom: 1px solid var(--line); }
.chart-grid-lines { position: absolute; inset: 15px 0 24px; display: flex; flex-direction: column; justify-content: space-between; pointer-events: none; }
.chart-grid-lines i { width: 100%; height: 1px; background: #edf2f0; }
.bar-column { position: relative; z-index: 1; flex: 1; min-width: 20px; display: flex; flex-direction: column; justify-content: flex-end; align-items: center; }
.bar-column > i { width: min(28px, 68%); height: var(--height); min-height: 9px; background: linear-gradient(to top, #1ecb92, #8bf5ca); border-radius: 6px 6px 2px 2px; box-shadow: 0 7px 14px rgba(35,211,154,.17); transition: .3s ease; }
.bar-column:hover > i { filter: saturate(1.2); transform: scaleX(1.08); }
.bar-column small { position: absolute; bottom: -21px; color: var(--quiet); font-size: 8px; white-space: nowrap; }
.bar-column.is-empty > i { min-height: 2px; background: #e3ebe8; box-shadow: none; }
.bar-chart.is-dense { gap: 3px; padding-left: 4px; padding-right: 4px; }
.bar-chart.is-dense .bar-column { min-width: 0; }
.bar-chart.is-dense .bar-column > i { width: min(18px, 80%); }
.chart-note { margin-top: 26px; }
.bar-value { margin-bottom: 5px; color: #4a626b; font-size: 9px; font-weight: 700; opacity: 0; transition: .2s; }
.bar-column:hover .bar-value { opacity: 1; }
.empty-chart { width: 100%; display: grid; place-items: center; align-content: center; color: var(--quiet); font-size: 12px; }
.empty-chart span { width: 70%; height: 50px; border-bottom: 2px dashed #dfe8e5; transform: skewY(-5deg); }

.nps-composition { min-height: 320px; }
.composition-visual { min-height: 180px; display: flex; align-items: center; justify-content: center; gap: 25px; }
.score-orbit { width: 130px; height: 130px; padding: 9px; display: grid; place-items: center; border-radius: 50%; background: conic-gradient(var(--mint-strong) 0 var(--score, 0%), #edf2f0 var(--score, 0%) 100%); }
.score-orbit::before { content: ""; width: 102px; height: 102px; grid-area: 1/1; background: white; border-radius: 50%; }
.score-orbit > span { grid-area: 1/1; z-index: 1; display: flex; flex-direction: column; text-align: center; font-size: 30px; font-weight: 800; letter-spacing: -.05em; }
.score-orbit small { margin-top: 2px; color: var(--quiet); font-size: 8px; letter-spacing: .12em; }
.composition-legend { display: flex; flex-direction: column; gap: 12px; }
.composition-legend p { margin: 0; display: flex; align-items: center; gap: 9px; }
.composition-legend i { width: 8px; height: 8px; border-radius: 50%; }
.legend-promoter { background: var(--mint-strong); }
.legend-detractor { background: var(--coral); }
.legend-passive { background: var(--amber); }
.composition-legend span { min-width: 80px; display: flex; justify-content: space-between; gap: 15px; color: var(--muted); font-size: 10px; }
.composition-legend strong { color: var(--ink); }
.panel-note { margin: 0; padding-top: 13px; color: var(--muted); border-top: 1px solid var(--line); font-size: 10px; line-height: 1.5; }

.area-panel, .cases-panel { min-height: 285px; }
.area-list { margin-top: 22px; display: flex; flex-direction: column; gap: 17px; }
.area-row { display: grid; grid-template-columns: 150px 1fr 38px; align-items: center; gap: 13px; }
.area-copy { display: flex; flex-direction: column; gap: 3px; }
.area-copy strong { font-size: 11px; }
.area-copy span { color: var(--quiet); font-size: 8px; }
.area-track { height: 7px; background: #edf2f0; border-radius: 10px; overflow: hidden; }
.area-track i { display: block; width: var(--fill); height: 100%; background: linear-gradient(90deg, #63dcb3, var(--mint)); border-radius: inherit; }
.area-score { justify-self: end; padding: 4px 6px; color: #805c18; background: #fff6dd; border-radius: 7px; font-size: 10px; font-weight: 800; }
.area-score.good { color: #19785b; background: #ddf8ed; }
.area-score.risk { color: #a8463b; background: #ffebe7; }
.area-change { font-weight: 800; white-space: nowrap; }
.area-change.positive { color: #19785b; }
.area-change.negative { color: #a8463b; }
.area-change.neutral { color: var(--muted); }

.hotspot-panel { grid-column: 1 / -1; }
.hotspot-lede { margin: 10px 0 0; color: var(--muted); font-size: 11px; line-height: 1.55; }
.hotspot-grid { margin-top: 18px; display: grid; grid-template-columns: repeat(auto-fit, minmax(230px, 1fr)); gap: 22px; }
.hotspot-group { min-width: 0; display: flex; flex-direction: column; gap: 10px; }
.hotspot-group h3 { margin: 0; color: var(--ink-3); font-size: 12px; letter-spacing: -.01em; }
.hotspot-list { margin: 0; padding: 0; list-style: none; display: flex; flex-direction: column; gap: 12px; }
.hotspot-row { display: grid; grid-template-columns: minmax(0, 1fr) auto; align-items: center; gap: 5px 10px; }
.hotspot-row .area-track { grid-column: 1 / -1; grid-row: 2; }
.hotspot-share { color: #a8463b; font-size: 10px; font-weight: 800; text-align: right; }
.area-track.risk i { background: linear-gradient(90deg, #ffb2a7, var(--coral)); }
.area-track.watch i { background: linear-gradient(90deg, #ffe2a8, var(--amber)); }
.hotspot-empty { color: var(--quiet); font-size: 10px; line-height: 1.5; }
.hotspot-group .panel-note { padding-top: 8px; }

/* Pantalla de cortes */
.segments-summary { grid-template-columns: minmax(0, 1fr) minmax(0, 2fr); }
.segments-note { align-self: center; max-width: 60ch; margin: 0; color: var(--muted); font-size: 13px; line-height: 1.6; }
.panel-caption { margin: 3px 0 0; color: var(--muted); font-size: 11px; }
.segments-grid { margin-top: 14px; display: grid; grid-template-columns: repeat(auto-fit, minmax(330px, 1fr)); gap: 14px; align-items: start; }
.segment-panel .area-list { margin-top: 18px; }
/* Un segmento sin muestra suficiente se ve, pero no compite por la mirada:
   está ahí para que nadie crea que el grupo no existe. */
.area-row.is-thin .area-copy strong { color: var(--muted); font-weight: 650; }
.area-track.muted { background: repeating-linear-gradient(115deg, #eef2f1 0 5px, #f7faf9 5px 10px); }
.area-score.muted { color: var(--quiet); background: #f4f7f6; font-weight: 700; }
.compact-list { margin-top: 16px; display: flex; flex-direction: column; }
.compact-item { padding: 12px 4px; display: grid; grid-template-columns: auto 1fr auto; align-items: center; gap: 10px; border-bottom: 1px solid #edf2f0; }
.compact-item:hover { background: #fafcfb; }
.priority-dot { width: 7px; height: 7px; border-radius: 50%; background: var(--amber); box-shadow: 0 0 0 4px #fff4dc; }
.priority-dot.high, .priority-dot.critical { background: var(--coral); box-shadow: 0 0 0 4px #ffebe8; }
.compact-item > span:nth-child(2) { display: flex; flex-direction: column; gap: 3px; }
.compact-item strong { font-size: 10px; }
.compact-item small { color: var(--quiet); font-size: 8px; }
.compact-item em { padding: 5px 7px; color: #4e6870; background: #edf3f1; border-radius: 6px; font-size: 8px; font-style: normal; }

.empty-state { color: var(--muted); text-align: center; }
.empty-state.wide { grid-column: 1/-1; padding: 70px 20px; background: white; border: 1px dashed #cddbd8; border-radius: var(--radius); }
.empty-state.compact { padding: 35px 20px; }
.empty-symbol { width: 40px; height: 40px; margin: 0 auto 11px; display: grid; place-items: center; color: #208b68; background: #e1f8ef; border-radius: 50%; font-weight: 800; }
.empty-state strong { display: block; color: var(--ink); font-size: 12px; }
.empty-state p { max-width: 330px; margin: 5px auto 0; font-size: 10px; line-height: 1.5; }

.survey-grid { display: grid; grid-template-columns: repeat(3, minmax(250px, 1fr)); gap: 16px; }
.survey-card { min-height: 360px; padding: 23px; display: flex; flex-direction: column; background: white; border: 1px solid var(--line); border-radius: var(--radius); }
.survey-card-top { display: flex; justify-content: space-between; align-items: center; }
.channel-badge, .live-status, .improvement-status, .case-kind { padding: 5px 8px; border-radius: 20px; font-size: 8px; font-weight: 800; letter-spacing: .05em; text-transform: uppercase; }
.channel-badge { color: #296b7a; background: #e4f7fb; }
.channel-badge.kiosk { color: #755d18; background: #fff5d8; }
.live-status { display: flex; align-items: center; gap: 5px; color: #26765e; background: #e3f8f0; }
.live-status.is-scheduled { color: #8b681d; background: #fff4d6; }
.live-status.is-ended { color: #39728b; background: #e3f3f8; }
.live-status.is-deactivated { color: var(--muted); background: #eef1f4; }
.live-status i, .improvement-status i { width: 5px; height: 5px; background: currentColor; border-radius: 50%; }
.survey-icon { width: 54px; height: 54px; margin-top: 25px; display: grid; place-items: center; color: #298c70; background: #e2f9f0; border-radius: 15px; }
.survey-icon svg { width: 27px; height: 27px; }
.survey-card h2 { margin: 20px 0 6px; font-size: 18px; letter-spacing: -.025em; }
.survey-card > p { min-height: 38px; margin: 0; color: var(--muted); font-size: 11px; line-height: 1.55; }
.survey-card dl { margin: 19px 0; padding-top: 14px; display: flex; flex-direction: column; gap: 9px; border-top: 1px solid var(--line); }
.survey-card dl div { display: flex; justify-content: space-between; gap: 15px; font-size: 9px; }
.survey-card dt { color: var(--quiet); }
.survey-card dd { margin: 0; color: var(--ink-3); font-weight: 700; }
.survey-card .button { margin-top: auto; }

.filter-row { margin: -10px 0 18px; display: flex; gap: 8px; }
.filter-chip { flex: none; display: inline-block; white-space: nowrap; padding: 8px 13px; color: var(--muted); background: white; border: 1px solid var(--line); border-radius: 20px; cursor: pointer; font-size: 10px; font-weight: 700; }
.filter-chip.active { color: white; background: var(--ink-2); border-color: var(--ink-2); }
.filter-chip:focus-visible { outline: 2px solid var(--mint-strong); outline-offset: 2px; }
.case-summary { min-width: 120px; padding: 11px 15px; display: flex; align-items: baseline; gap: 7px; background: white; border: 1px solid var(--line); border-radius: 12px; }
.case-summary strong { font-size: 24px; }
.case-summary span { color: var(--quiet); font-size: 9px; }
.case-list { display: flex; flex-direction: column; gap: 11px; }
.case-card { position: relative; padding: 20px 20px 20px 25px; display: grid; grid-template-columns: 1fr 200px; gap: 25px; background: white; border: 1px solid var(--line); border-radius: 15px; overflow: hidden; }
.case-accent { position: absolute; inset: 0 auto 0 0; width: 5px; background: var(--amber); }
.case-accent.high, .case-accent.critical { background: var(--coral); }
.case-title-row { display: flex; align-items: center; gap: 9px; }
.case-kind { color: #9a4138; background: #ffebe8; }
.case-title-row small { color: var(--quiet); font-size: 9px; }
.case-deadline { padding: 4px 8px; color: #4e6870; background: #edf3f1; border-radius: 20px; font-size: 9px; font-weight: 800; }
.case-deadline.is-overdue, .case-deadline.is-finished-late { color: #9a4138; background: #ffebe8; }
.case-deadline.is-due-soon { color: #8a5a12; background: #fff3dc; }
.case-deadline.is-finished { color: #23795c; background: #e6f6ef; }
.case-contact-state { color: #9a4138; }
.case-contact-state.is-reached { color: #23795c; }
.case-main h2 { margin: 10px 0 5px; font-size: 15px; }
.case-main > p { margin: 0; color: var(--muted); font-size: 11px; line-height: 1.55; }
.case-meta { margin-top: 13px; display: flex; gap: 17px; color: #526a73; font-size: 9px; font-weight: 650; }
.case-timeline { margin: 14px 0 0; padding: 0 0 0 14px; list-style: none; display: flex; flex-direction: column; gap: 9px; border-left: 2px solid #e3ebe8; }
.case-event { display: flex; flex-direction: column; gap: 2px; }
.case-event-head { display: flex; flex-wrap: wrap; align-items: baseline; gap: 7px; }
.case-event-head strong { color: var(--ink-3); font-size: 10px; }
.case-event-head small { color: var(--quiet); font-size: 9px; }
.case-event-note { color: var(--muted); font-size: 10px; line-height: 1.5; }
.case-event.contact .case-event-head strong { color: #23795c; }
.case-contact { margin-top: 13px; }
.case-improvements { margin: 10px 0 0; padding: 0; display: flex; flex-wrap: wrap; gap: 8px; list-style: none; }
.case-improvements li { padding: 5px 10px; display: flex; align-items: center; gap: 8px; background: #eef7f3; border-radius: 20px; font-size: 10px; }
.case-improvements a { color: #23795c; font-weight: 800; }
.case-improvements form { margin: 0; }
.link-button { padding: 0; color: var(--muted); background: none; border: 0; font: inherit; font-size: 9px; text-decoration: underline; cursor: pointer; }
.case-contact summary { width: fit-content; color: #23795c; font-size: 10px; font-weight: 800; cursor: pointer; }
.case-contact-form { margin-top: 10px; max-width: 460px; display: grid; gap: 7px; }
.case-contact-form label { color: #546a73; font-size: 10px; font-weight: 750; }
.case-contact-form textarea, .case-contact-form select { width: 100%; padding: 9px 12px; color: var(--ink); background: #f8faf9; border: 1px solid #d8e3e0; border-radius: 9px; font: inherit; font-size: 11px; }
.case-contact-form select { min-height: 40px; }
.case-contact-form button { justify-self: start; }
.case-action { align-self: center; display: grid; grid-template-columns: 1fr; gap: 7px; }
.case-action label, .stacked-form label, .auth-form label { color: #546a73; font-size: 10px; font-weight: 750; }
.case-action select, .stacked-form input, .stacked-form textarea, .stacked-form select, .auth-form input { width: 100%; min-height: 42px; padding: 0 12px; color: var(--ink); background: #f8faf9; border: 1px solid #d8e3e0; border-radius: 9px; outline: none; }
.case-action select:focus, .stacked-form input:focus, .stacked-form textarea:focus, .stacked-form select:focus, .auth-form input:focus { border-color: #38c795; box-shadow: 0 0 0 3px rgba(35,211,154,.11); }

.improvement-board { display: grid; grid-template-columns: repeat(3, minmax(250px, 1fr)); gap: 16px; }
.improvement-card { min-height: 270px; padding: 22px; display: flex; flex-direction: column; background: white; border: 1px solid var(--line); border-radius: var(--radius); }
.improvement-status { width: fit-content; display: flex; align-items: center; gap: 6px; color: #8b681d; background: #fff4d6; }
.improvement-status.active { color: #247258; background: #dff7ed; }
.improvement-status.completed { color: #39728b; background: #e3f3f8; }
.improvement-card h2 { margin: 20px 0 7px; font-size: 17px; line-height: 1.25; letter-spacing: -.025em; }
.improvement-card > p { margin: 0; color: var(--muted); font-size: 11px; line-height: 1.55; }
.target-line { margin-top: 20px; padding: 12px; display: flex; flex-direction: column; gap: 4px; background: #f4f8f6; border-radius: 10px; }
.target-line span { color: var(--quiet); font-size: 8px; text-transform: uppercase; letter-spacing: .08em; }
.target-line strong { font-size: 10px; }
.improvement-status.cancelled { color: #6b7280; background: #eef0f2; }
.improvement-facts { margin: 14px 0 0; display: grid; gap: 6px; }
.improvement-facts div { display: grid; grid-template-columns: 70px 1fr; gap: 8px; font-size: 10px; }
.improvement-facts dt { color: var(--quiet); font-size: 8px; text-transform: uppercase; letter-spacing: .08em; padding-top: 2px; }
.improvement-facts dd { margin: 0; color: var(--ink); }
.improvement-edit { margin-top: 13px; }
.improvement-edit summary { width: fit-content; color: #23795c; font-size: 10px; font-weight: 800; cursor: pointer; }
.improvement-edit-form { margin-top: 10px; display: grid; gap: 7px; }
.improvement-edit-form label { color: #546a73; font-size: 10px; font-weight: 750; }
.improvement-edit-form select, .improvement-edit-form input { width: 100%; min-height: 40px; padding: 0 12px; color: var(--ink); background: #f8faf9; border: 1px solid #d8e3e0; border-radius: 9px; font: inherit; font-size: 11px; }
.improvement-edit-form button { justify-self: start; }
.before-after { margin-top: 16px; display: grid; gap: 8px; }
.before-after-windows, .before-after-pending { margin: 0; color: var(--muted); font-size: 10px; line-height: 1.5; }
.before-after-table { width: 100%; border-collapse: collapse; font-size: 10px; table-layout: fixed; }
.before-after-table th, .before-after-table td { padding: 7px 4px; border-bottom: 1px solid #edf2f0; text-align: left; vertical-align: top; overflow-wrap: break-word; hyphens: auto; }
.before-after-table thead th { color: var(--quiet); font-size: 8px; font-weight: 700; text-transform: uppercase; letter-spacing: .06em; }
.before-after-table tbody th { font-weight: 700; }
.before-after-table thead th:first-child { width: 32%; }
.before-after-table td strong, .before-after-table td small { display: block; }
.before-after-table td small { color: var(--muted); font-size: 9px; }
.before-after-table .muted { color: var(--quiet); }
.before-after .trend { white-space: nowrap; font-weight: 800; }
.before-after .trend.positive { color: #1f8a64; background: #e2f6ee; }
.before-after .trend.negative { color: #a8463b; background: #ffebe8; }
.before-after .trend.neutral { color: #4e6870; background: #edf3f1; }
.before-after .panel-note { margin: 0; }
.before-after-goal { margin: 0; padding: 12px; display: flex; flex-direction: column; gap: 4px; background: #f4f8f6; border-radius: 10px; }
.before-after-goal span { color: var(--quiet); font-size: 8px; text-transform: uppercase; letter-spacing: .08em; }
.before-after-goal strong { font-size: 10px; }
.before-after-goal small { color: var(--muted); font-size: 10px; }
.improvement-card footer { margin-top: auto; padding-top: 15px; display: flex; align-items: center; gap: 8px; border-top: 1px solid var(--line); color: var(--muted); font-size: 9px; }
.improvement-card footer .icon-button { margin-left: auto; color: var(--ink); }
.user-avatar.small { width: 27px; height: 27px; border-radius: 50%; font-size: 10px; }
.dialog { width: min(520px, calc(100vw - 30px)); padding: 30px; border: 0; border-radius: 20px; box-shadow: 0 35px 100px rgba(7,26,43,.25); }
.dialog::backdrop { background: rgba(3,18,29,.68); backdrop-filter: blur(5px); }
.dialog h2 { margin: 7px 0 5px; font-size: 28px; letter-spacing: -.04em; }
.dialog > p { margin: 0 0 20px; color: var(--muted); font-size: 12px; }
.dialog-close-form { position: absolute; top: 15px; right: 15px; }
.dialog-close-form button { width: 34px; height: 34px; color: var(--muted); background: #f1f5f3; border: 0; border-radius: 50%; cursor: pointer; font-size: 20px; }
.stacked-form p { margin: 0 0 13px; }
.stacked-form label { display: block; margin-bottom: 6px; }
.stacked-form textarea { padding-top: 10px; resize: vertical; }
.stacked-form .errorlist { margin: 0 0 5px; padding: 0; color: #ad4438; list-style: none; font-size: 10px; }

.login-body { background: var(--ink); }
.login-shell { min-height: 100vh; display: grid; grid-template-columns: 1.12fr .88fr; }
.login-story { position: relative; min-height: 100vh; padding: 42px 54px; color: white; background: var(--ink); overflow: hidden; }
.login-story::before { content: ""; position: absolute; width: 560px; height: 560px; right: -220px; bottom: -250px; border: 1px solid rgba(131,244,197,.12); border-radius: 50%; box-shadow: 0 0 0 65px rgba(131,244,197,.025), 0 0 0 130px rgba(131,244,197,.018), 0 0 0 195px rgba(131,244,197,.012); }
.login-story::after { content: ""; position: absolute; width: 280px; height: 1px; left: 12%; top: 28%; background: linear-gradient(90deg, transparent, rgba(131,244,197,.3), transparent); transform: rotate(-28deg); box-shadow: 95px 85px 0 rgba(131,244,197,.08), 170px 160px 0 rgba(131,244,197,.05); }
.story-content { position: relative; z-index: 1; max-width: 620px; margin: 15vh auto 0; }
.story-kicker { display: flex; align-items: center; gap: 9px; color: #a8bec5; font-size: 11px; font-weight: 700; letter-spacing: .06em; text-transform: uppercase; }
.story-kicker i { width: 25px; height: 2px; background: var(--mint); }
.story-content h1 { margin: 18px 0; font-size: clamp(45px, 5vw, 76px); line-height: .98; letter-spacing: -.065em; }
.story-content h1 em { color: var(--mint); font-style: normal; }
.story-content > p { max-width: 470px; color: #9ab0b8; font-size: 16px; line-height: 1.65; }
.story-metric { margin-top: 48px; display: flex; align-items: center; gap: 20px; }
.story-orbit { width: 95px; height: 95px; display: grid; place-items: center; border: 1px solid rgba(131,244,197,.24); border-radius: 50%; box-shadow: 0 0 0 8px rgba(131,244,197,.035); }
.story-orbit span { display: flex; flex-direction: column; color: var(--mint); font-size: 30px; font-weight: 800; text-align: center; }
.story-orbit small { color: #78949d; font-size: 8px; letter-spacing: .14em; }
.story-metric > div:last-child strong { font-size: 13px; }
.story-metric > div:last-child p { margin: 4px 0 0; color: #7f99a2; font-size: 11px; }
.story-foot { position: absolute; left: 54px; bottom: 35px; color: #607c87; font-size: 10px; }
.login-panel { padding: 40px; display: grid; place-items: center; background: #f7faf8; }
.login-form-wrap { width: min(410px, 100%); }
.login-form-wrap h2 { margin: 7px 0; font-size: 33px; line-height: 1.08; letter-spacing: -.045em; }
.login-form-wrap > p { margin: 0; color: var(--muted); font-size: 12px; line-height: 1.55; }
.auth-form { margin-top: 28px; }
.auth-form > label { display: block; margin: 14px 0 6px; }
.auth-form input { min-height: 48px; background: white; }
.password-field { position: relative; }
.password-field button { position: absolute; top: 50%; right: 10px; padding: 5px 8px; color: #397d69; background: transparent; border: 0; transform: translateY(-50%); cursor: pointer; font-size: 9px; font-weight: 800; }
.auth-form .button { margin-top: 22px; min-height: 50px; }
.demo-access { margin-top: 24px; padding: 13px 15px; display: grid; grid-template-columns: 1fr; gap: 5px; color: #667b83; background: #edf4f1; border-radius: 11px; }
.demo-access span { margin-bottom: 2px; color: #426057; font-size: 8px; font-weight: 800; letter-spacing: .09em; text-transform: uppercase; }
.demo-access code { font-family: var(--font); font-size: 10px; }

.brand-logo { display: block; max-width: 180px; max-height: 44px; object-fit: contain; }
.branding-preview { margin: 0 0 18px; padding: 14px; display: flex; align-items: center; gap: 12px; background: var(--ink); border-radius: 12px; }
.branding-preview figcaption { color: var(--quiet); font-size: 11px; }
.survey-body { min-height: 100vh; color: #f5fbf9; background: var(--ink); }
.survey-body::before { content: ""; position: fixed; inset: 0; background: radial-gradient(circle at 15% 0%, rgba(95,213,232,.11), transparent 34%), radial-gradient(circle at 95% 40%, rgba(131,244,197,.1), transparent 30%); pointer-events: none; }
.respond-shell { position: relative; z-index: 1; width: min(920px, calc(100% - 30px)); margin: 0 auto; padding: 28px 0 45px; }
.respond-header { padding: 0 5px 24px; display: flex; justify-content: space-between; align-items: center; color: #8da5ae; font-size: 10px; }
.respond-card { display: grid; grid-template-columns: 290px 1fr; background: white; border-radius: 24px; box-shadow: 0 35px 100px rgba(0,0,0,.25); overflow: hidden; }
.respond-intro { position: relative; padding: 42px 32px; color: white; background: #103146; overflow: hidden; }
.respond-intro::after { content: ""; position: absolute; width: 260px; height: 260px; left: -130px; bottom: -150px; border: 1px solid rgba(131,244,197,.16); border-radius: 50%; box-shadow: 0 0 0 35px rgba(131,244,197,.03), 0 0 0 70px rgba(131,244,197,.02); }
.respond-intro .eyebrow { color: var(--mint); }
.respond-intro h1 { margin: 16px 0 12px; font-size: 35px; line-height: 1.02; letter-spacing: -.05em; }
.respond-intro > p { color: #a6bbc2; font-size: 12px; line-height: 1.6; }
.time-note { position: relative; z-index: 1; margin-top: 30px; padding-top: 15px; display: flex; align-items: center; gap: 8px; color: #8fa8b0; border-top: 1px solid rgba(255,255,255,.1); font-size: 9px; }
.time-note span { width: 22px; height: 22px; display: grid; place-items: center; color: var(--ink); background: var(--mint); border-radius: 50%; font-weight: 800; }
.survey-form { padding: 38px 42px 42px; color: var(--ink); }
.survey-question { position: relative; margin: 0 0 31px; padding: 0 0 28px 38px; border: 0; border-bottom: 1px solid var(--line); }
.survey-question:last-of-type { border-bottom: 0; }
.question-count { position: absolute; left: 0; top: 0; color: #29a47f; font-size: 10px; font-weight: 800; }
.survey-question legend { width: 100%; padding: 0; font-size: 15px; font-weight: 750; line-height: 1.35; }
.survey-question > p { margin: 5px 0; color: var(--muted); font-size: 10px; }
.scale-labels { margin: 18px 0 6px; display: flex; justify-content: space-between; color: var(--quiet); font-size: 8px; }
.score-scale { display: grid; grid-template-columns: repeat(11, 1fr); gap: 4px; }
.score-scale input, .sentiment-scale input { position: absolute; opacity: 0; pointer-events: none; }
.score-scale span { height: 37px; display: grid; place-items: center; color: #50666e; background: #f1f5f4; border: 1px solid transparent; border-radius: 8px; cursor: pointer; font-size: 10px; font-weight: 750; transition: .18s ease; }
.score-scale label:hover span { color: var(--ink); background: #e6f6f0; transform: translateY(-2px); }
.score-scale input:checked + span { color: var(--ink); background: var(--mint); border-color: #41d9a4; box-shadow: 0 5px 13px rgba(35,211,154,.22); }
.sentiment-scale { margin-top: 16px; display: grid; grid-template-columns: repeat(5, 1fr); gap: 7px; }
.sentiment-scale label > span { min-height: 55px; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 3px; color: #5d7178; background: #f3f6f5; border: 1px solid transparent; border-radius: 9px; cursor: pointer; transition: .18s; }
.sentiment-scale b { font-size: 13px; }
.sentiment-scale small { font-size: 7px; }
.sentiment-scale input:checked + span { color: var(--ink); background: #e3f9f0; border-color: #73dfba; transform: translateY(-2px); }
.survey-question textarea { width: 100%; margin-top: 15px; padding: 13px; color: var(--ink); background: #f7f9f8; border: 1px solid #d9e4e1; border-radius: 10px; outline: none; resize: vertical; font-size: 11px; }
.survey-question textarea:focus { border-color: #49cf9f; box-shadow: 0 0 0 3px rgba(35,211,154,.1); }
.survey-context legend small { color: var(--quiet); font-weight: 600; }
.context-fields { margin-top: 15px; display: grid; grid-template-columns: 1fr 110px; gap: 10px; }
.context-field { display: flex; flex-direction: column; gap: 5px; }
.context-field > span { color: var(--muted); font-size: 9px; font-weight: 750; letter-spacing: .04em; text-transform: uppercase; }
.context-field select, .context-field input { width: 100%; padding: 11px 12px; color: var(--ink); background: #f7f9f8; border: 1px solid #d9e4e1; border-radius: 10px; outline: none; font-size: 11px; font-family: inherit; }
.context-field select:focus, .context-field input:focus { border-color: #49cf9f; box-shadow: 0 0 0 3px rgba(35,211,154,.1); }
.context-correction { margin: -9px 0 28px 38px; padding: 10px 0; color: var(--muted); }
.context-correction summary { width: fit-content; color: #258267; cursor: pointer; font-size: 10px; font-weight: 700; }
.context-correction summary:focus-visible { outline: 2px solid #49cf9f; outline-offset: 3px; }
.context-correction p { margin: 10px 0 0; font-size: 10px; line-height: 1.5; }
.privacy-check { display: grid; grid-template-columns: auto 1fr; align-items: start; gap: 9px; cursor: pointer; }
.privacy-check input { position: absolute; opacity: 0; }
.privacy-check > span { width: 18px; height: 18px; border: 1px solid #c4d3cf; border-radius: 5px; }
.privacy-check input:checked + span { background: var(--mint); border-color: var(--mint-strong); box-shadow: inset 0 0 0 4px white; }
.privacy-check p { margin: 1px 0 0; color: var(--muted); font-size: 11px; line-height: 1.5; }
.privacy-check input:focus-visible + span { outline: 2px solid #258267; outline-offset: 3px; }
.privacy-acknowledgment > a { display: inline-block; margin: 5px 0 0 27px; color: #258267; font-size: 11px; text-decoration: underline; }
.privacy-acknowledgment > a:focus-visible { outline: 2px solid #258267; outline-offset: 3px; }
.privacy-notice-card { padding: 40px 48px; color: var(--ink); background: white; border-radius: 22px; box-shadow: 0 35px 100px rgba(0,0,0,.25); }
.privacy-notice-card h1 { margin: 14px 0 20px; font-size: clamp(29px, 5vw, 40px); line-height: 1.12; letter-spacing: -.04em; }
.privacy-notice-card h2 { margin: 28px 0 8px; font-size: 18px; }
.privacy-notice-card p { margin: 0 0 14px; color: #415966; font-size: 14px; line-height: 1.65; }
.privacy-notice-warning { margin: 28px 0 18px; padding: 17px 19px; color: #254738; background: #effbf6; border-left: 4px solid #23d39a; border-radius: 8px; font-size: 13px; line-height: 1.6; }
.privacy-notice-card .privacy-notice-close { margin: 0; font-size: 12px; }
.respond-submit { min-height: 50px; margin-top: 22px; }
.respond-footer { padding: 17px; color: #718b95; text-align: center; font-size: 9px; }

.thanks-shell { position: relative; z-index: 1; min-height: 100vh; padding: 30px; display: flex; flex-direction: column; align-items: center; }
.thanks-shell > .brand { align-self: flex-start; max-width: 100%; }
.thanks-shell .brand-logo { width: auto; height: auto; max-width: min(220px, 100%); max-height: 80px; object-fit: contain; }
.thanks-card { width: min(520px, 100%); margin: auto; padding: 55px 45px; color: var(--ink); background: white; border-radius: 24px; box-shadow: 0 35px 100px rgba(0,0,0,.25); text-align: center; }
.thanks-check { width: 70px; height: 70px; margin: 0 auto 25px; display: grid; place-items: center; color: #15805e; background: #dff9ee; border-radius: 50%; box-shadow: 0 0 0 10px #f0fbf7; }
.thanks-check svg { width: 36px; height: 36px; fill: none; stroke: currentColor; stroke-width: 4; stroke-linecap: round; stroke-linejoin: round; }
.thanks-card h1 { margin: 11px 0; font-size: 36px; line-height: 1.05; letter-spacing: -.05em; }
.thanks-card > p { color: var(--muted); font-size: 12px; line-height: 1.6; }
.thanks-line { width: 45px; height: 2px; margin: 25px auto 15px; background: var(--mint-strong); }
.thanks-card small { color: var(--quiet); font-size: 9px; }
/* Reinicio manual del tótem: la recarga automática es lo que corresponde,
   pero quien atiende necesita poder dejar la pantalla lista sin esperarla.
   Grande a propósito — se toca con el dedo, de pie y con apuro. */
.thanks-restart { display: inline-block; margin-top: 18px; padding: 14px 26px; min-height: 48px; color: #19785b; background: #ddf8ed; border-radius: 12px; font-size: 12px; font-weight: 750; }

/* El enlace usado, vencido o reemplazado nunca muestra datos de la encuesta:
   comparte la página genérica y la marca de xMetrics con todos los casos. */
.unavailable-shell > .brand { align-self: flex-start; }
.unavailable-card { max-width: 560px; }
.unavailable-card .eyebrow { color: #a64e44; }
.unavailable-card > p { font-size: 13px; }
.unavailable-icon { width: 70px; height: 70px; margin: 0 auto 25px; display: grid; place-items: center; color: #b95b4f; background: #fff0ed; border-radius: 50%; box-shadow: 0 0 0 10px #fff8f6; }
.unavailable-icon svg { width: 36px; height: 36px; fill: none; stroke: currentColor; stroke-width: 3; stroke-linecap: round; stroke-linejoin: round; }
.unavailable-card small { display: block; font-size: 11px; line-height: 1.6; }

@media (max-width: 1100px) {
  .metric-grid { grid-template-columns: repeat(2, 1fr); }
  .survey-grid, .improvement-board { grid-template-columns: repeat(2, minmax(250px, 1fr)); }
  .dashboard-grid { grid-template-columns: 1fr; }
  .case-kpi-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .delivery-grid { grid-template-columns: 1fr; }
  .segments-summary { grid-template-columns: 1fr; }
  .nps-composition { min-height: auto; }
}

@media (max-width: 820px) {
  .app-shell { display: block; }
  .sidebar { position: fixed; left: 0; transform: translateX(-105%); width: min(300px, 86vw); transition: transform .25s ease; box-shadow: 25px 0 70px rgba(0,0,0,.25); }
  .sidebar.is-open { transform: translateX(0); }
  .mobile-header { height: 64px; padding: 0 18px; display: flex; align-items: center; justify-content: space-between; color: white; background: var(--ink); }
  .page { padding: 26px 18px 45px; }
  .page-header { align-items: flex-start; flex-direction: column; }
  .page-header > div:first-child { flex: none; }
  .header-actions { width: 100%; }
  .metric-grid { grid-template-columns: 1fr 1fr; }
  .survey-grid, .improvement-board { grid-template-columns: 1fr; }
  .case-card { grid-template-columns: 1fr; }
  .section-heading { align-items: flex-start; flex-direction: column; }
  .call-row a { grid-template-columns: 1fr; gap: 8px; }
  .doing-row a { grid-template-columns: 1fr; gap: 8px; }
  .doing-reading { align-items: flex-start; text-align: left; }
  .call-priority { justify-self: start; }
  .call-state { align-items: flex-start; }
  .login-shell { grid-template-columns: 1fr; }
  .login-story { display: none; }
  .login-panel { min-height: 100vh; padding: 28px; }
  .respond-card { grid-template-columns: 1fr; }
  .respond-intro { padding: 30px; }
  .respond-intro h1 { font-size: 29px; }
}

@media (max-width: 560px) {
  .privacy-notice-card { padding: 28px 22px; }
  .metric-grid { grid-template-columns: 1fr; }
  .case-kpi-grid { grid-template-columns: 1fr; }
  .funnel-steps { grid-template-columns: 1fr; }
  .channel-panel { overflow-x: auto; }
  .metric-card { min-height: 150px; }
  .page-header h1 { font-size: 32px; }
  .header-actions { align-items: stretch; flex-direction: column; }
  .date-control, .header-actions .button { width: 100%; }
  .period-form { width: 100%; }
  .period-field { flex: 1 1 130px; }
  .period-field select, .period-field input { width: 100%; }
  .panel { padding: 18px; }
  .area-row { grid-template-columns: 105px 1fr 35px; }
  .bar-chart { gap: 4px; }
  .bar-column { min-width: 0; }
  .filter-row { overflow-x: auto; padding-bottom: 5px; }
  .case-meta { flex-direction: column; gap: 4px; }
  .survey-form { padding: 28px 18px; }
  .survey-question { padding-left: 28px; }
  .context-correction { margin-left: 28px; }
  .score-scale { gap: 2px; }
  .score-scale span { height: 34px; border-radius: 6px; font-size: 9px; }
  .context-fields { grid-template-columns: 1fr; }
  .sentiment-scale { grid-template-columns: 1fr; }
  .sentiment-scale label > span { min-height: 42px; flex-direction: row; gap: 8px; }
  .thanks-shell { padding: 20px; }
  .thanks-card { padding: 45px 23px; }
  .thanks-card h1 { font-size: 30px; }
}

/* --- Cuestionarios ----------------------------------------------------- */
/* El riel de versiones. Las versiones SON una secuencia y su número es como
   el cliente las nombra, así que numerarlas dice algo cierto. El candado no
   es adorno: es la regla del dominio hecha visible. */
.version-rail { margin-top: 16px; display: flex; flex-direction: column; }
.version-node { position: relative; padding: 11px 0 11px 30px; display: flex; align-items: center; gap: 12px; border-left: 2px solid var(--line); }
.version-node:last-child { border-left-color: transparent; }
.version-node::before { content: ""; position: absolute; left: -7px; top: 15px; width: 12px; height: 12px; border: 2px solid var(--line); border-radius: 50%; background: var(--white); }
.version-node.is-draft::before { border-color: var(--mint-strong); background: var(--mint); }
.version-node.is-draft { border-left-color: var(--mint-strong); }
.version-number { min-width: 34px; color: var(--quiet); font-size: 11px; font-weight: 800; letter-spacing: .04em; }
.version-node.is-draft .version-number { color: #29a47f; }
.version-meta { min-width: 0; display: flex; flex-direction: column; gap: 2px; }
.version-meta strong { font-size: 13px; letter-spacing: -.02em; }
.version-meta small { color: var(--quiet); font-size: 10px; }
.version-node > a, .version-node > form { margin-left: auto; }

.state-badge { padding: 5px 8px; border-radius: 20px; font-size: 8px; font-weight: 800; letter-spacing: .05em; text-transform: uppercase; }
.state-badge.draft { color: #1c6f57; background: #ddf7ec; }
.state-badge.published { color: #296b7a; background: #e4f7fb; }
.state-badge.archived { color: #6a7a80; background: #eef2f1; }

/* El editor. Dos columnas: lo escrito a la izquierda, la herramienta a la
   derecha, para que agregar no empuje la lista fuera de la vista. */
.editor-grid { display: grid; grid-template-columns: minmax(0, 1.6fr) minmax(300px, .9fr); gap: 22px; align-items: start; }
.question-row { padding: 15px 4px; display: grid; grid-template-columns: 30px minmax(0, 1fr) auto; align-items: start; gap: 13px; border-bottom: 1px solid #edf2f0; }
.question-row:last-child { border-bottom: 0; }
.question-order { color: var(--quiet); font-size: 12px; font-weight: 800; }
.question-body { min-width: 0; display: flex; flex-direction: column; gap: 7px; }
.question-body p { margin: 0; font-size: 14px; line-height: 1.35; }
.question-tags { display: flex; flex-wrap: wrap; align-items: center; gap: 6px; }
.question-options { margin: 0; padding: 0; display: flex; flex-wrap: wrap; gap: 5px; list-style: none; }
.question-options li { padding: 4px 8px; color: #4e6870; background: #f2f6f5; border: 1px solid #e5edeb; border-radius: 7px; font-size: 11px; }
.kind-badge { padding: 4px 8px; color: #296b7a; background: #e4f7fb; border-radius: 20px; font-size: 8px; font-weight: 800; letter-spacing: .05em; text-transform: uppercase; }
.required-flag { color: #a3382d; font-size: 10px; font-weight: 750; }

/* El aviso antes de publicar. Ámbar y no coral: no es un error, es una
   puerta de una sola dirección. */
.freeze-note { margin: 0 0 18px; padding: 13px 15px; color: #6b4c07; background: #fff8e6; border: 1px solid #ffe1a3; border-radius: 12px; font-size: 12px; line-height: 1.5; }
.freeze-note strong { display: block; margin-bottom: 3px; }

.column-list { margin: 0; padding: 0; list-style: none; border-top: 1px solid var(--line); }
.column-list li { display: grid; grid-template-columns: auto 1fr; gap: 2px 8px; align-items: center; padding: 8px 0; border-bottom: 1px solid #edf2f0; font-size: 12px; }
.column-list code { font-weight: 750; }
.column-list small { grid-column: 1 / -1; color: var(--muted); font-size: 11px; }
.column-tag { justify-self: start; padding: 2px 7px; border-radius: 999px; background: #edf2f0; color: var(--quiet); font-size: 9px; font-weight: 800; letter-spacing: .08em; text-transform: uppercase; }
.column-tag.is-required { background: var(--mint); color: var(--ink); }
.import-errors { width: 100%; margin-top: 14px; border-collapse: collapse; font-size: 12px; }
.import-errors th { padding: 7px 9px; color: var(--quiet); text-align: left; border-bottom: 1px solid var(--line); font-size: 9px; font-weight: 800; letter-spacing: .1em; text-transform: uppercase; }
.import-errors td { padding: 9px; border-bottom: 1px solid #edf2f0; vertical-align: top; }
.import-errors td:first-child, .import-errors td:nth-child(2) { color: #a3382d; font-weight: 750; white-space: nowrap; }

@media (max-width: 1080px) { .editor-grid { grid-template-columns: minmax(0, 1fr); } }

/* Una casilla es una respuesta de sí o no: va al lado de su etiqueta, no
   debajo, donde `as_p` la deja flotando sin contexto. */
.stacked-form p:has(input[type="checkbox"]) { display: flex; align-items: center; gap: 9px; }
.stacked-form p:has(input[type="checkbox"]) label { order: 2; margin-bottom: 0; }
.stacked-form input[type="checkbox"] { width: 17px; height: 17px; accent-color: var(--mint-strong); }

/* Eliminar es una acción secundaria: no puede pesar más que la pregunta. */
.question-row .button { padding: 7px 11px; font-size: 11px; }

/* Sin panel de edición al lado, la lista ocupa el ancho completo. */
.editor-grid.is-readonly { grid-template-columns: minmax(0, 1fr); }

/* El candado hace visible la regla: esta versión ya no se toca. */
.lock-mark { width: 13px; height: 13px; fill: none; stroke: var(--quiet); stroke-width: 2; stroke-linecap: round; }
.version-node .lock-mark { margin-left: 2px; }

/* El texto de ayuda es ayuda, no titular: Django lo deja al tamaño del
   cuerpo y termina pesando más que el campo que explica. */
.stacked-form .helptext { display: block; margin-top: 5px; color: var(--muted); font-size: 11px; line-height: 1.45; }

/* El selector de archivo nativo es lo único de estas pantallas que el
   navegador dibuja a su gusto: un botón gris de sistema dentro de un campo
   que sigue el sistema. `::file-selector-button` es la única parte de un
   input de archivo que admite estilo, y alcanza — el texto («Seleccionar
   archivo», «Sin archivos seleccionados») lo pone el navegador en el idioma
   del usuario y no se toca desde CSS.

   El botón toma la piel de `.button-secondary` y el campo queda de
   contenedor, así que el conjunto se lee como el resto de los formularios en
   vez de como una pieza importada. */
.stacked-form input[type="file"] { padding: 4px; color: var(--muted); cursor: pointer; font-size: 12px; }
.stacked-form input[type="file"]::file-selector-button {
  margin-right: 11px;
  min-height: 32px;
  padding: 0 14px;
  color: var(--ink);
  background: #edf3f1;
  border: 1px solid #d6e2df;
  border-radius: 6px;
  cursor: pointer;
  font: inherit;
  font-weight: 750;
  transition: background .2s ease, border-color .2s ease;
}
.stacked-form input[type="file"]::file-selector-button:hover { background: #e3ece9; border-color: #c5d5d1; }
.stacked-form input[type="file"]::file-selector-button:active { background: #d9e5e1; }
