:root {
  --ink: #102a3b;
  --ink-soft: #476071;
  --muted: #6e8391;
  --line: #dce6e9;
  --line-strong: #c7d7dc;
  --canvas: #f4f7f6;
  --surface: #ffffff;
  --surface-soft: #f8faf9;
  --navy: #123c51;
  --teal: #168a8a;
  --teal-dark: #0d6f70;
  --teal-soft: #e8f5f3;
  --blue-soft: #eaf2fb;
  --violet-soft: #f1edfa;
  --amber-soft: #fff5df;
  --coral-soft: #fff0eb;
  --danger: #b53b45;
  --shadow-sm: 0 1px 2px rgba(16, 42, 59, .05), 0 8px 24px rgba(16, 42, 59, .06);
  --shadow-lg: 0 28px 70px rgba(12, 42, 57, .18);
  --radius-sm: 10px;
  --radius: 16px;
  --radius-lg: 24px;
  color-scheme: light;
  font-family: Inter, ui-sans-serif, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}

* { box-sizing: border-box; }

html { min-width: 320px; background: var(--canvas); }

body {
  margin: 0;
  min-height: 100vh;
  color: var(--ink);
  background: var(--canvas);
  -webkit-font-smoothing: antialiased;
}

button, input { font: inherit; }

button, summary, a { -webkit-tap-highlight-color: transparent; }

button { color: inherit; }

.skip-link {
  position: fixed;
  z-index: 1000;
  top: 10px;
  left: 10px;
  padding: 10px 14px;
  color: #fff;
  background: var(--navy);
  border-radius: 8px;
  transform: translateY(-150%);
}

.skip-link:focus { transform: translateY(0); }

:focus-visible {
  outline: 3px solid rgba(22, 138, 138, .34);
  outline-offset: 3px;
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: 12px;
  color: var(--ink);
  text-decoration: none;
  white-space: nowrap;
}

.brand-symbol {
  display: inline-grid;
  place-items: center;
  width: 42px;
  height: 42px;
  flex: 0 0 42px;
  color: var(--teal-dark);
}

.brand-symbol svg { width: 39px; height: 39px; overflow: visible; fill: none; stroke: currentColor; stroke-width: 2.2; stroke-linecap: round; stroke-linejoin: round; }

.brand > span:last-child { display: grid; gap: 2px; }
.brand strong { font-size: 18px; letter-spacing: -.02em; }
.brand small { color: var(--muted); font-size: 12px; font-weight: 500; }
.brand-light { color: #fff; }
.brand-light small { color: rgba(255,255,255,.72); }
.brand-light .brand-symbol { color: #9aebe3; }

.eyebrow,
.panel-kicker {
  margin: 0 0 8px;
  color: var(--teal-dark);
  font-size: 11px;
  font-weight: 800;
  letter-spacing: .13em;
  text-transform: uppercase;
}

.eyebrow-light { color: #7dd9d1; }

/* Acceso */

.bis-login-page {
  position: relative;
  display: grid;
  place-items: center;
  overflow: hidden;
  padding: 32px;
  background:
    radial-gradient(circle at 7% 12%, rgba(62, 177, 170, .13), transparent 25%),
    radial-gradient(circle at 90% 90%, rgba(50, 117, 149, .13), transparent 27%),
    #eef4f2;
}

.login-decoration {
  position: fixed;
  width: 360px;
  height: 360px;
  border: 1px solid rgba(22, 138, 138, .12);
  border-radius: 50%;
  pointer-events: none;
}

.login-decoration-one { top: -220px; right: -70px; }
.login-decoration-two { bottom: -250px; left: -90px; width: 440px; height: 440px; }

.login-shell {
  position: relative;
  z-index: 1;
  display: grid;
  grid-template-columns: minmax(380px, 1.12fr) minmax(390px, .88fr);
  width: min(1050px, 100%);
  min-height: 650px;
  overflow: hidden;
  background: var(--surface);
  border: 1px solid rgba(255,255,255,.8);
  border-radius: 28px;
  box-shadow: var(--shadow-lg);
}

.login-story {
  position: relative;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  overflow: hidden;
  padding: 42px 48px;
  color: #fff;
  background:
    linear-gradient(160deg, rgba(16, 58, 78, .96), rgba(13, 98, 101, .96)),
    var(--navy);
}

.login-story::before,
.login-story::after {
  content: "";
  position: absolute;
  border: 1px solid rgba(255,255,255,.12);
  border-radius: 50%;
  pointer-events: none;
}

.login-story::before { width: 390px; height: 390px; right: -240px; top: 90px; }
.login-story::after { width: 230px; height: 230px; left: -120px; bottom: 50px; }

.story-copy { position: relative; z-index: 1; max-width: 480px; }
.story-copy h1 { margin: 0 0 20px; max-width: 520px; font-size: clamp(34px, 4vw, 48px); line-height: 1.08; letter-spacing: -.045em; }
.story-copy > p:not(.eyebrow) { margin: 0; color: rgba(255,255,255,.76); font-size: 17px; line-height: 1.65; }

.story-points { display: grid; gap: 14px; margin: 32px 0 0; padding: 0; list-style: none; }
.story-points li { display: flex; align-items: center; gap: 12px; color: rgba(255,255,255,.88); font-size: 14px; }
.story-points span { display: grid; place-items: center; width: 26px; height: 26px; flex: 0 0 26px; color: #9aebe3; border: 1px solid rgba(154,235,227,.36); border-radius: 50%; font-size: 11px; font-weight: 800; }
.prototype-label { position: relative; z-index: 1; margin: 0; color: rgba(255,255,255,.5); font-size: 12px; }

.login-card { position: relative; z-index: 1; display: flex; flex-direction: column; justify-content: center; padding: 58px 64px; }
.login-card h2 { margin: 0; font-size: 34px; letter-spacing: -.035em; }
.login-intro { margin: 10px 0 32px; color: var(--ink-soft); line-height: 1.55; }
.mobile-brand { display: none; }

#bis-login-form { display: grid; gap: 20px; }
#change-password-form { display: grid; gap: 14px; }
#recover-password-form { display: grid; gap: 20px; }
.field { display: grid; gap: 8px; }
.field > span:first-child { color: var(--ink); font-size: 13px; font-weight: 750; }
.field input {
  width: 100%;
  height: 48px;
  padding: 0 14px;
  color: var(--ink);
  background: #fbfcfc;
  border: 1px solid var(--line-strong);
  border-radius: 10px;
  transition: border-color .18s, box-shadow .18s, background .18s;
}
.field input::placeholder { color: #9aa9b1; }
.field input:focus { outline: none; background: #fff; border-color: var(--teal); box-shadow: 0 0 0 4px rgba(22,138,138,.1); }
.password-wrap { position: relative; display: block; }
.password-wrap input { padding-right: 58px; }
.password-toggle { position: absolute; top: 7px; right: 7px; height: 34px; padding: 0 10px; color: var(--teal-dark); background: transparent; border: 0; border-radius: 7px; font-size: 12px; font-weight: 800; cursor: pointer; }
.password-toggle:hover { background: var(--teal-soft); }

.primary-button {
  min-height: 48px;
  padding: 0 20px;
  color: #fff;
  background: linear-gradient(135deg, var(--teal), var(--teal-dark));
  border: 0;
  border-radius: 10px;
  box-shadow: 0 10px 22px rgba(22,138,138,.2);
  font-weight: 800;
  cursor: pointer;
  transition: transform .18s, box-shadow .18s;
}
.primary-button:hover { transform: translateY(-1px); box-shadow: 0 13px 26px rgba(22,138,138,.26); }
.primary-button:disabled { opacity: .65; transform: none; cursor: wait; }
button[aria-disabled="true"], .button-link[aria-disabled="true"] {
  opacity: .58;
  transform: none !important;
  box-shadow: none !important;
  cursor: not-allowed !important;
}
.login-button { margin-top: 2px; }
.form-message { min-height: 21px; margin: -4px 0 0; color: var(--danger); font-size: 13px; }
.form-message.ok { color: var(--teal-dark); }
.login-links { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; margin-top: 14px; }
.account-action { display: flex; align-items: center; justify-content: center; min-height: 42px; padding: 8px 12px; color: var(--teal-dark); background: #fff; border: 1px solid var(--line-strong); border-radius: 9px; font-size: 12px; font-weight: 800; line-height: 1.3; text-align: center; text-decoration: none; transition: background .18s, border-color .18s, box-shadow .18s; }
.account-action:hover { background: var(--surface-soft); border-color: var(--teal); box-shadow: 0 5px 14px rgba(16,42,59,.07); }
.recovery-action { color: #fff; background: var(--navy); border-color: var(--navy); }
.recovery-action:hover { color: #fff; background: #0c3144; border-color: #0c3144; }
.login-links-single { display: block; margin-top: 20px; }
.login-links-single .account-action { width: 100%; }
.login-success { margin: -16px 0 22px; padding: 11px 13px; color: var(--teal-dark); background: var(--teal-soft); border: 1px solid #c9e5df; border-radius: 10px; font-size: 12px; line-height: 1.45; }
.password-policy { margin: -2px 0 0; color: var(--muted); font-size: 11px; line-height: 1.45; }
.recovery-note { margin: 22px 0 0; padding: 12px 14px; color: var(--muted); background: var(--surface-soft); border: 1px solid var(--line); border-radius: 10px; font-size: 11px; line-height: 1.5; }
.recovery-warning { color: #7b5421; background: #fff7e8; border-color: #ead8b6; }
.change-password-shell { min-height: 720px; }
.change-password-card { justify-content: center; padding-top: 38px; padding-bottom: 38px; }
.login-footnote { display: flex; align-items: flex-start; gap: 10px; margin-top: 30px; padding-top: 22px; color: var(--muted); border-top: 1px solid var(--line); font-size: 12px; line-height: 1.5; }
.lock-dot { width: 8px; height: 8px; flex: 0 0 8px; margin-top: 5px; background: var(--teal); border-radius: 50%; box-shadow: 0 0 0 4px var(--teal-soft); }

/* Panel principal */

.bis-app-page { min-height: 100vh; background: var(--canvas); }

.app-header {
  position: sticky;
  z-index: 50;
  top: 0;
  display: grid;
  grid-template-columns: auto minmax(320px, 620px) auto;
  align-items: center;
  gap: 28px;
  min-height: 76px;
  padding: 12px clamp(22px, 4vw, 64px);
  background: rgba(255,255,255,.96);
  border-bottom: 1px solid var(--line);
  backdrop-filter: blur(14px);
}

.work-context {
  display: flex;
  align-items: center;
  gap: 11px;
  min-width: 0;
  padding: 9px 10px 9px 13px;
  background: var(--surface-soft);
  border: 1px solid var(--line);
  border-radius: 12px;
}
.context-icon { color: #d3952d; font-size: 13px; }
.work-context > span:nth-child(2) { display: grid; min-width: 0; gap: 1px; }
.work-context small { color: var(--muted); font-size: 10px; font-weight: 700; letter-spacing: .04em; text-transform: uppercase; }
.work-context strong { overflow: hidden; font-size: 13px; text-overflow: ellipsis; white-space: nowrap; }
.context-change { margin-left: auto; padding: 7px 10px; color: var(--teal-dark); background: #fff; border: 1px solid var(--line-strong); border-radius: 8px; font-size: 12px; font-weight: 800; cursor: pointer; }
.context-change:hover { border-color: var(--teal); }

.dashboard-context-highlight { position: relative; overflow: hidden; background: linear-gradient(120deg,#f3fbfa 0%,#f8faf7 72%,#fff9eb 100%); border-color:#b8d9d5; box-shadow:0 4px 14px rgba(31,102,104,.09); }
.dashboard-context-highlight::before { position:absolute; inset:0 auto 0 0; width:4px; background:linear-gradient(180deg,var(--teal),#d79c32); content:""; }
.dashboard-context-highlight .context-icon { display:grid;place-items:center;width:20px;height:20px;flex:0 0 20px;background:#fff3d9;border-radius:50%;font-size:10px; }
.dashboard-context-highlight strong { color:#173f4f; }
.dashboard-context-highlight .context-change { color:#fff;background:var(--teal-dark);border-color:var(--teal-dark);box-shadow:0 2px 7px rgba(16,105,103,.14); }
.dashboard-context-highlight .context-change:hover { background:#0d706e;border-color:#0d706e; }

.header-actions { display: flex; align-items: center; justify-content: flex-end; gap: 12px; }
.help-button { display: inline-flex; align-items: center; gap: 7px; min-height: 40px; padding: 0 13px; color: var(--ink-soft); background: #fff; border: 1px solid var(--line); border-radius: 10px; font-size: 12px; font-weight: 750; cursor: pointer; }
.help-button span { display: grid; place-items: center; width: 20px; height: 20px; color: var(--teal-dark); background: var(--teal-soft); border-radius: 50%; font-size: 12px; font-weight: 900; }
.help-button:hover { color: var(--ink); border-color: var(--line-strong); }
.dashboard-ask-highlight { color:#125f69;background:linear-gradient(135deg,#eefaf8,#edf5ff);border-color:#b6d9d6;box-shadow:0 4px 13px rgba(31,105,151,.10);text-decoration:none; }
.dashboard-ask-highlight span { color:#fff;background:linear-gradient(135deg,var(--teal),#3178af);box-shadow:0 2px 6px rgba(32,108,143,.18); }
.dashboard-ask-highlight:hover { color:#0c515b;background:linear-gradient(135deg,#e5f7f4,#e5f1fc);border-color:#82bbb7;box-shadow:0 6px 17px rgba(31,105,151,.14);transform:translateY(-1px); }

.user-identity { display: flex; align-items: center; gap: 8px; padding: 3px 2px; }
.user-symbol { display: grid; place-items: center; width: 32px; height: 32px; flex: 0 0 32px; color: var(--teal-dark); }
.user-symbol svg { width: 29px; height: 29px; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }
.user-copy { display: grid; gap: 1px; min-width: 90px; }
.user-copy strong { font-size: 12px; }
.user-copy small { color: var(--muted); font-size: 10px; }
.logout-button { min-height: 38px; padding: 0 14px; color: #99434b; background: #fff; border: 1px solid #e2c7ca; border-radius: 9px; font-size: 12px; font-weight: 800; cursor: pointer; }
.logout-button:hover { color: #7e2d35; background: #fff4f4; border-color: #dbaeb3; }

.dashboard { width: min(1600px, 100%); margin: 0 auto; padding: 24px clamp(22px, 4vw, 64px) 48px; }
.welcome-row { display: flex; align-items: flex-end; justify-content: space-between; gap: 28px; margin-bottom: 25px; }
.welcome-row h1 { margin: 0; font-size: clamp(27px, 3vw, 38px); line-height: 1.1; letter-spacing: -.035em; }
.welcome-row p:not(.eyebrow) { max-width: 720px; margin: 9px 0 0; color: var(--ink-soft); font-size: 14px; line-height: 1.55; }
.screen-help { display: inline-flex; align-items: center; gap: 8px; flex: 0 0 auto; padding: 10px 13px; color: var(--teal-dark); background: var(--teal-soft); border: 0; border-radius: 10px; font-size: 12px; font-weight: 800; cursor: pointer; }
.screen-help span { display: grid; place-items: center; width: 20px; height: 20px; background: #fff; border-radius: 50%; }

.dashboard-grid { display: grid; grid-template-columns: minmax(260px, .82fr) minmax(500px, 1.58fr) minmax(250px, .75fr); align-items: start; gap: 20px; }
.dashboard-panel { min-width: 0; overflow: hidden; background: var(--surface); border: 1px solid #cbdadd; border-radius: var(--radius); box-shadow: var(--shadow-sm); }
.panel-heading { padding: 24px 24px 20px; background: #eef3f4; border-bottom: 1px solid #cbdadd; box-shadow: inset 4px 0 0 #8fb7b6; }
.panel-heading h2 { margin: 0; font-size: 20px; letter-spacing: -.025em; }
.panel-heading > p { margin: 8px 0 0; color: var(--ink-soft); font-size: 12px; line-height: 1.55; }

.menu-intro { display: flex; align-items: center; gap: 9px; min-height: 48px; padding: 10px 17px; color: #49616e; background: #f8faf9; border-bottom: 1px solid var(--line); }
.menu-intro > span:last-child { display: grid; gap: 1px; }
.menu-intro strong { color: var(--teal-dark); font-size: 10px; font-weight: 900; letter-spacing: .09em; text-transform: uppercase; }
.menu-intro small { color: var(--muted); font-size: 10px; }
.menu-intro-icon { display: grid; place-items: center; width: 25px; height: 25px; flex: 0 0 25px; color: #fff; background: var(--teal-dark); border-radius: 7px; font-size: 11px; font-weight: 900; }

.feature-list { display: grid; gap: 8px; padding: 12px 14px 14px; background: #f3f6f6; }
.feature-card { position: relative; display: grid; grid-template-columns: 40px minmax(0,1fr) auto; align-items: center; gap: 12px; width: 100%; padding: 12px 10px; background: #fff; border: 1px solid #d5e0e3; border-radius: 11px; box-shadow: 0 1px 2px rgba(16,42,59,.04); text-align: left; cursor: pointer; transition: border-color .18s, box-shadow .18s, transform .18s; }
.feature-link { color: inherit; text-decoration: none; }
.feature-card:hover, .feature-card:focus-visible { background: #fff; border-color: #77afad; box-shadow: 0 7px 18px rgba(16,81,83,.11); transform: translateY(-1px); }
.feature-card > span:nth-child(2), .insight-card > span:nth-child(2), .help-item > span:nth-child(2) { display: grid; min-width: 0; gap: 4px; }
.feature-card strong, .insight-card strong { font-size: 13px; line-height: 1.3; }
.feature-card small, .insight-card small { color: var(--muted); font-size: 11px; line-height: 1.35; }
.feature-icon { display: grid; place-items: center; width: 38px; height: 38px; border-radius: 11px; font-size: 10px; font-weight: 900; letter-spacing: .04em; }
.feature-icon.aqua { color: #0c7475; background: var(--teal-soft); }
.feature-icon.blue { color: #2e669d; background: var(--blue-soft); }
.feature-icon.violet { color: #7053a2; background: var(--violet-soft); }
.feature-icon.amber { color: #95691c; background: var(--amber-soft); }
.feature-icon.coral { color: #a95943; background: var(--coral-soft); }
.card-arrow { display: grid; place-items: center; width: 25px; height: 25px; color: var(--teal-dark); background: var(--teal-soft); border-radius: 50%; font-size: 15px; transition: color .18s, background .18s, transform .18s; }
.feature-card:hover .card-arrow, .feature-card:focus-visible .card-arrow { color: #fff; background: var(--teal-dark); transform: translateX(2px); }

.monthly-panel { border-color: #cfe1e1; }
.monthly-heading { position: relative; padding-right: 128px; background: #eaf2f2; }
.monthly-heading > div { display: block; }
.progress-summary { position: absolute; top: 24px; right: 22px; padding: 6px 9px; color: var(--teal-dark); background: var(--teal-soft); border-radius: 20px; font-size: 10px; font-weight: 800; }
.process-columns { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); align-items: start; gap: 13px; padding: 14px; background: #f3f6f6; }
.process-group { min-width: 0; overflow: hidden; background: #eef3f3; border: 1px solid #cfdddf; border-radius: 12px; }
.process-group-heading { display: grid; grid-template-columns: 28px minmax(0, 1fr); align-items: center; gap: 9px; min-height: 62px; padding: 11px 12px; background: #dfe9ea; border-bottom: 1px solid #c6d7d9; }
.process-group-heading > span:last-child { display: grid; gap: 2px; min-width: 0; }
.process-group-heading strong { font-size: 12px; line-height: 1.25; }
.process-group-heading small { overflow: hidden; color: var(--muted); font-size: 9px; text-overflow: ellipsis; white-space: nowrap; }
.process-group-index { display: grid; place-items: center; width: 27px; height: 27px; color: var(--teal-dark); background: var(--teal-soft); border-radius: 8px; font-size: 10px; font-weight: 900; }
.process-list { display: grid; gap: 7px; margin: 0; padding: 9px; list-style: none; counter-reset: none; }
.process-step { position: relative; }
.process-step button { position: relative; z-index: 1; display: grid; grid-template-columns: 34px minmax(0,1fr) auto; align-items: center; gap: 8px; width: 100%; min-height: 54px; padding: 8px 7px; background: #fff; border: 1px solid #d5e0e3; border-radius: 10px; box-shadow: 0 1px 2px rgba(16,42,59,.04); text-align: left; cursor: pointer; transition: border-color .18s, box-shadow .18s, transform .18s; }
.process-step button:hover, .process-step button:focus-visible { background: #fff; border-color: #77afad; box-shadow: 0 6px 15px rgba(16,81,83,.10); transform: translateY(-1px); }
.step-number { display: grid; place-items: center; width: 30px; height: 30px; color: #69808d; background: #f4f7f7; border: 1px solid #dce6e8; border-radius: 50%; font-size: 10px; font-weight: 900; }
.process-step button > span:nth-child(2) { display: grid; gap: 2px; min-width: 0; }
.process-step strong { font-size: 11px; line-height: 1.3; }
.process-step small { overflow: hidden; color: var(--muted); font-size: 10px; text-overflow: ellipsis; white-space: nowrap; }
.step-status { padding: 4px 6px; color: #8496a0; background: #f4f7f7; border-radius: 20px; font-size: 8px; font-weight: 800; }
.process-step.is-next button { padding: 10px 8px; background: linear-gradient(135deg, #eef8f6, #f8fcfb); border: 2px solid #58a7a2; box-shadow: 0 5px 16px rgba(16,105,103,.13); }
.process-step.is-next .step-number { color: #fff; background: var(--teal); border-color: var(--teal); box-shadow: 0 0 0 4px var(--teal-soft); }
.process-step.is-next .step-status { color: #fff; background: var(--teal); }

.insight-list { display: grid; gap: 10px; padding: 14px 17px 17px; background: #f3f6f6; }
.insight-card { display: grid; grid-template-columns: 40px minmax(0,1fr) auto; align-items: center; gap: 11px; width: 100%; padding: 14px; color: inherit; background: #fff; border: 1px solid #d5e0e3; border-radius: 12px; box-shadow: 0 1px 2px rgba(16,42,59,.04); text-align: left; text-decoration: none; cursor: pointer; transition: border-color .18s, box-shadow .18s, transform .18s; }
.insight-card:hover, .insight-card:focus-visible { background: #fff; border-color: #77afad; box-shadow: 0 7px 18px rgba(16,81,83,.11); transform: translateY(-1px); }
.insight-card > span:last-child { display: grid; place-items: center; width: 25px; height: 25px; color: var(--teal-dark); background: var(--teal-soft); border-radius: 50%; }
.insight-card:hover > span:last-child, .insight-card:focus-visible > span:last-child { color: #fff; background: var(--teal-dark); }
.insight-icon { display: grid; place-items: center; width: 38px; height: 38px; color: var(--teal-dark); background: var(--teal-soft); border-radius: 11px; font-size: 18px; font-weight: 800; }
.chart-icon { color: #7256a3; background: var(--violet-soft); }
.download-icon { color: #95691c; background: var(--amber-soft); }
.context-tip { display: flex; gap: 10px; margin: 0; padding: 14px 17px 17px; color: #536d7a; background: #eef3f4; border-top: 1px solid #d4e0e2; }
.context-tip > span { display: grid; place-items: center; width: 22px; height: 22px; flex: 0 0 22px; color: #fff; background: #6f9498; border-radius: 50%; font-size: 11px; font-weight: 900; }
.context-tip p { margin: 0; font-size: 11px; line-height: 1.5; }

.page-end-actions { display: flex; flex-wrap: wrap; justify-content: center; gap: 12px; width: min(680px, 100%); margin: 34px auto 4px; padding-top: 22px; border-top: 1px solid var(--line); }
.page-end-action { display: inline-flex; align-items: center; justify-content: center; min-width: 210px; min-height: 42px; padding: 9px 18px; border: 1px solid transparent; border-radius: 10px; font: inherit; font-size: 12px; font-weight: 800; line-height: 1.2; text-align: center; text-decoration: none; cursor: pointer; }
.page-end-primary { color: #fff; background: var(--teal-dark); border-color: var(--teal-dark); }
.page-end-primary:hover, .page-end-primary:focus-visible { color: #fff; background: #0d706e; border-color: #0d706e; outline: 3px solid rgba(16, 105, 103, .18); outline-offset: 2px; }
.page-end-logout { color: #8f3942; background: #fff; border-color: #ddbfc3; }
.page-end-logout:hover, .page-end-logout:focus-visible { color: #722830; background: #fff4f4; border-color: #ce9fa5; outline: 3px solid rgba(153, 67, 75, .14); outline-offset: 2px; }

.app-footer { display: flex; justify-content: space-between; gap: 20px; padding: 18px clamp(22px, 4vw, 64px); color: var(--muted); background: #fff; border-top: 1px solid var(--line); font-size: 10px; }

.assistant-orb { display: grid; place-items: center; width: 40px; height: 40px; background: rgba(255,255,255,.12); border: 1px solid rgba(255,255,255,.16); border-radius: 12px; font-size: 18px; }

.toast { position: fixed; z-index: 150; left: 50%; bottom: 26px; max-width: min(520px, calc(100vw - 32px)); padding: 13px 17px; color: #fff; background: #173b4d; border-radius: 11px; box-shadow: var(--shadow-lg); font-size: 12px; font-weight: 650; opacity: 0; pointer-events: none; transform: translate(-50%, 18px); transition: opacity .18s, transform .18s; }
.toast.is-visible { opacity: 1; transform: translate(-50%, 0); }
.toast.is-error { background: var(--danger); }

@media (max-width: 1180px) {
  .app-header { grid-template-columns: auto 1fr auto; gap: 16px; }
  .help-button { width: 40px; justify-content: center; padding: 0; font-size: 0; }
  .user-copy { display: none; }
  .dashboard-grid { grid-template-columns: minmax(240px, .78fr) minmax(0, 1.62fr); }
  .insights-panel { grid-column: 1 / -1; }
  .insight-list { grid-template-columns: repeat(3, 1fr); }
  .context-tip { max-width: 420px; }
}

@media (max-width: 820px) {
  .bis-login-page { padding: 18px; }
  .login-shell { grid-template-columns: 1fr; width: min(500px, 100%); min-height: 0; }
  .login-story { display: none; }
  .login-card { padding: 38px 32px; }
  .mobile-brand { display: inline-flex; margin-bottom: 38px; }
  .app-header { position: static; grid-template-columns: 1fr auto; padding: 12px 18px; }
  .app-header > .brand small { display: none; }
  .work-context { grid-column: 1 / -1; grid-row: 2; }
  .header-actions { grid-column: 2; grid-row: 1; }
  .dashboard { padding: 28px 18px 38px; }
  .welcome-row { align-items: flex-start; }
  .screen-help { font-size: 0; }
  .screen-help span { font-size: 12px; }
  .dashboard-grid { grid-template-columns: 1fr; }
  .monthly-panel, .insights-panel { grid-column: auto; }
  .insight-list { grid-template-columns: 1fr; }
  .app-footer { flex-direction: column; }
}

@media (max-width: 520px) {
  .bis-login-page { padding: 0; background: #fff; }
  .login-shell { width: 100%; min-height: 100vh; border: 0; border-radius: 0; box-shadow: none; }
  .login-card { justify-content: flex-start; padding: 28px 22px; }
  .login-card h2 { font-size: 29px; }
  .login-links { grid-template-columns: 1fr; }
  .app-header { gap: 8px; }
  .app-header > .brand > span:last-child { display: none; }
  .help-button { display: none; }
  .help-button.button-link { display: inline-flex; }
  .user-identity { padding: 0; }
  .logout-button { min-height: 34px; padding: 0 10px; }
  .welcome-row { display: grid; }
  .screen-help { justify-self: start; font-size: 11px; }
  .screen-help span { font-size: 11px; }
  .monthly-heading { padding-right: 24px; padding-bottom: 52px; }
  .progress-summary { top: auto; right: auto; bottom: 18px; left: 24px; }
  .process-columns { grid-template-columns: 1fr; }
  .process-step button { grid-template-columns: 34px minmax(0,1fr); }
  .step-status { display: none; }
  .process-step small { white-space: normal; }
  .page-end-actions { display: grid; gap: 8px; margin-top: 24px; padding-top: 16px; }
  .page-end-action { width: 100%; min-width: 0; }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { scroll-behavior: auto !important; transition-duration: .01ms !important; }
}

/* Administradores especiales e historial con ámbitos */
.management-note { display: flex; gap: 10px; margin-top: 14px; padding: 14px 16px; color: #526b78; background: #f2f7f7; border: 1px solid var(--line); border-radius: 11px; }
.management-note strong { flex: 0 0 auto; color: var(--ink); font-size: 12px; }
.management-note p, .form-guidance { margin: 0; color: var(--muted); font-size: 11px; line-height: 1.55; }
.form-guidance { padding: 11px 13px; background: var(--surface-soft); border-radius: 9px; }
.history-filter-shell { display: flex; flex: 1 1 auto; flex-wrap: wrap; align-items: end; gap: 12px; }
.history-scope-toggle { flex: 1 0 100%; }
.history-scope-toggle label[hidden] { display: none; }
.history-value-field { min-width: 260px; }
.history-doctor-field { min-width: min(380px, 100%); }
.doctor-autocomplete { position: relative; }
.doctor-autocomplete > input[type="search"] { width: 100%; }
.doctor-autocomplete-results { position: absolute; z-index: 45; top: calc(100% + 5px); left: 0; width: min(520px, 82vw); max-height: 290px; overflow: auto; background: #fff; border: 1px solid var(--line-strong); border-radius: 10px; box-shadow: var(--shadow-lg); }
.doctor-autocomplete-option { display: grid; gap: 3px; width: 100%; padding: 11px 13px; color: var(--ink); background: #fff; border: 0; border-bottom: 1px solid var(--line); text-align: left; cursor: pointer; }
.doctor-autocomplete-option:last-child { border-bottom: 0; }
.doctor-autocomplete-option:hover { background: var(--surface-soft); }
.doctor-autocomplete-option strong { font-size: 12px; }
.doctor-autocomplete-option small, .doctor-autocomplete-empty { color: var(--muted); font-size: 10px; line-height: 1.4; }
.doctor-autocomplete-empty { margin: 0; padding: 13px; }
.history-summary { display: grid; grid-template-columns: repeat(4, minmax(90px, 1fr)); gap: 8px; flex: 0 0 min(430px, 100%); }
.history-summary > div { display: grid; gap: 2px; padding: 9px 11px; background: var(--surface-soft); border-radius: 9px; }
.history-summary small { color: var(--muted); font-size: 9px; font-weight: 750; text-transform: uppercase; }
.history-summary strong { font-size: 15px; }
.history-heading-actions { display: flex; flex-wrap: wrap; align-items: center; justify-content: flex-end; gap: 9px; }
.history-heading-actions input { min-width: 250px; }
.history-table td { white-space: nowrap; }
.history-temporal-badge { display: inline-flex; align-items: center; min-height: 24px; padding: 0 9px; border-radius: 999px; font-size: 9px; font-weight: 850; }
.history-temporal-badge.realizada { color: #52636b; background: #e9eff0; }
.history-temporal-badge.planificada { color: #11645d; background: #ddf2ed; }
.history-pagination { display: flex; align-items: center; justify-content: center; gap: 15px; padding: 15px; border-top: 1px solid var(--line); }
.history-pagination span { color: var(--muted); font-size: 11px; font-weight: 700; }
.statistics-filter-shell { display: flex; flex: 1 1 auto; flex-wrap: wrap; align-items: end; gap: 12px; }
.statistics-scope-toggle { flex: 1 0 100%; }
.statistics-group-field { min-width: 270px; }
.statistics-doctor-field { min-width: min(380px, 100%); }
.statistics-doctor-field[hidden] { display: none !important; }
.statistics-dimension-row { display: flex; flex: 1 0 100%; flex-wrap: wrap; align-items: end; gap: 12px; }
.statistics-dimension-row .compact-field { min-width: 150px; }
.statistics-percentage { min-height: 38px; margin: 0; }
.statistics-matrix-meta { padding: 11px 18px; color: var(--muted); background: var(--surface-soft); border-bottom: 1px solid var(--line); font-size: 11px; font-weight: 650; }
.statistics-matrix-wrap { max-height: 620px; }
.statistics-matrix-table { border-collapse: separate; border-spacing: 0; }
.statistics-matrix-table thead th { position: sticky; z-index: 4; top: 0; min-width: 104px; background: #f5f9f9; }
.statistics-matrix-table .statistics-row-heading { position: sticky; z-index: 3; left: 0; min-width: 170px; background: #f8fbfb; text-align: left; }
.statistics-matrix-table thead .statistics-row-heading { z-index: 6; }
.statistics-total-heading, .statistics-total-cell, .statistics-total-row > * { background: #eef7f5 !important; font-weight: 800; }
.statistics-cell-button { display: grid; justify-items: end; gap: 2px; width: 100%; min-width: 72px; padding: 4px 2px; color: var(--ink); background: transparent; border: 0; text-align: right; cursor: pointer; }
.statistics-cell-button:hover { color: var(--teal-dark); }
.statistics-cell-button strong { font-size: 12px; }
.statistics-cell-button small { color: var(--muted); font-size: 9px; font-weight: 650; }
.statistics-detail-dialog { width: min(980px, calc(100vw - 32px)); }
.statistics-detail-dialog > div { max-height: min(760px, calc(100vh - 40px)); overflow: auto; }

@media (max-width: 820px) {
  .history-summary { grid-template-columns: repeat(2, minmax(90px, 1fr)); flex-basis: 100%; }
  .history-heading-actions, .history-heading-actions input { width: 100%; }
  .history-heading-actions { justify-content: flex-start; }
  .history-value-field, .history-doctor-field { min-width: 100%; }
  .statistics-group-field, .statistics-doctor-field { min-width: 100%; }
}
