/* KPI card */
.kpi {
  background: var(--panel); border: 1px solid var(--line); border-radius: var(--radius);
  padding: 14px 16px; display: flex; flex-direction: column; gap: 4px;
  box-shadow: var(--shadow);
}
.kpi-label { font-size: 11px; letter-spacing: .08em; text-transform: uppercase; color: var(--ink-mute); }
.kpi-value { font-size: 26px; font-weight: 700; color: var(--ink); font-variant-numeric: tabular-nums; line-height: 1.05; }
.kpi-unit { font-size: 13px; color: var(--ink-mute); margin-left: 4px; font-weight: 500; }
.kpi-sub { font-size: 12px; color: var(--ink-mute); }
.kpi.kpi-ok .kpi-value { color: #1e7a3b; }
.kpi.kpi-warn .kpi-value { color: #8a6300; }
.kpi.kpi-bad .kpi-value { color: #a92622; }

/* Chart container */
.chart-box {
  background: var(--panel); border: 1px solid var(--line); border-radius: var(--radius);
  padding: 14px; box-shadow: var(--shadow);
}
.chart-title { font-size: 14px; font-weight: 600; color: var(--ink); margin-bottom: 6px; }
.chart-sub { font-size: 12px; color: var(--ink-mute); margin-bottom: 10px; }
.chart-canvas { width: 100%; height: 260px; }
.chart-canvas.tall { height: 340px; }

/* Status dot */
.status-dot { width: 8px; height: 8px; border-radius: 50%; display: inline-block; margin-right: 6px; }
.status-dot.ok { background: #2da95a; box-shadow: 0 0 0 3px rgba(45,169,90,.15); }
.status-dot.warn { background: #e0a800; box-shadow: 0 0 0 3px rgba(224,168,0,.15); }
.status-dot.err { background: #d9534f; box-shadow: 0 0 0 3px rgba(217,83,79,.15); }
.status-dot.idle { background: #98a8a1; }

/* Tag */
.tag {
  display: inline-block; padding: 2px 8px; border-radius: 4px; font-size: 11px;
  font-weight: 600; letter-spacing: .04em; text-transform: uppercase;
  background: #eaf0fb; color: var(--eycot-navy-2); border: 1px solid #c5d3ed;
}
.tag.warn { background: #fff5db; color: #8a6300; border-color: #f0d99a; }
.tag.err { background: #fde9e8; color: var(--eycot-red-2); border-color: #f3b8b5; }

/* Lista medidores */
.meter-card {
  background: var(--panel); border: 1px solid var(--line); border-radius: var(--radius);
  padding: 14px 16px; margin-bottom: 10px; display: flex; align-items: center; gap: 12px;
  transition: opacity .2s, background .2s;
}
.meter-card.meter-excluded { opacity: .55; background: #f4f5f9; }
.meter-card.meter-excluded .meter-name::after { content: " · excluido del análisis"; font-weight: 400; color: var(--eycot-red-2); font-size: 11px; }
.meter-card .meter-name { font-weight: 600; }
.meter-card .meter-host { font-size: 12px; color: var(--ink-mute); }
.meter-card .meter-actions { margin-left: auto; display: flex; gap: 6px; align-items: center; }

/* Recommendations */
.reco-item {
  padding: 12px 14px; border-radius: 8px; border-left: 4px solid var(--eycot-navy-2);
  background: #f4f7fc; margin-bottom: 8px;
}
.reco-item.sev-1 { border-left-color: #2da95a; background: #f0f8f3; }
.reco-item.sev-2 { border-left-color: var(--eycot-amber); background: #fff8e6; }
.reco-item.sev-3 { border-left-color: var(--eycot-red); background: #fdeeed; }

/* Report footer */
.report-footer {
  display: flex; justify-content: space-between; align-items: center;
  font-size: 11px; color: var(--ink-mute); margin-top: 10px;
  letter-spacing: .02em;
}
.report-footer strong { color: var(--eycot-navy); font-weight: 600; }

/* Heatmap */
.heatmap { font-size: 12px; }
.heatmap-title { font-size: 14px; font-weight: 600; color: var(--ink); margin-bottom: 10px; }
.heatmap-grid {
  display: grid; gap: 2px;
  font-variant-numeric: tabular-nums;
}
.heatmap-rowhead, .heatmap-colhead {
  color: var(--ink-mute); font-size: 11px; font-weight: 600;
  display: flex; align-items: center; justify-content: center;
  letter-spacing: .03em;
}
.heatmap-rowhead { justify-content: flex-end; padding-right: 8px; }
.heat-cell {
  height: 22px; border-radius: 3px;
  transition: transform .08s;
}
.heat-cell:hover { transform: scale(1.18); cursor: help; outline: 1px solid var(--ink); }
.heat-empty { background: #f0f3f8; }
.heatmap-legend {
  display: flex; align-items: center; gap: 8px; justify-content: flex-end;
  margin-top: 8px; font-size: 11px; color: var(--ink-mute);
}
.heatmap-bar { width: 120px; height: 8px; border-radius: 4px; }

/* Mini list */
.mini-list { display: flex; flex-direction: column; gap: 6px; }
.mini-row {
  display: flex; align-items: center; gap: 10px;
  padding: 6px 8px; border-radius: 6px;
}
.mini-row:hover { background: #f4f7fc; }
.mini-row .mini-name { flex: 1; font-size: 13px; color: var(--ink); }
.mini-row .mini-val { font-size: 13px; font-weight: 600; font-variant-numeric: tabular-nums; color: var(--eycot-navy); }
.mini-bar {
  flex: 1; height: 8px; background: #eef2f8; border-radius: 4px; overflow: hidden;
}
.mini-bar-fill { height: 100%; background: linear-gradient(90deg, var(--eycot-navy-2), var(--eycot-red)); }

/* Health score */
.health-score {
  font-size: 32px; font-weight: 800; font-variant-numeric: tabular-nums;
  line-height: 1; letter-spacing: -.02em;
}
.health-ok { color: #1e7a3b; }
.health-warning { color: #8a6300; }
.health-bad { color: var(--eycot-red); }

/* Análisis IA */
.ai-loading {
  display: flex; align-items: center; gap: 14px;
  background: linear-gradient(90deg, #eaf0fb, #f4f7fc);
  border: 1px solid #c5d3ed; border-radius: 10px;
  padding: 18px 22px;
}
.ai-spinner {
  width: 32px; height: 32px; flex-shrink: 0;
  border: 3px solid #c5d3ed; border-top-color: var(--eycot-navy);
  border-radius: 50%; animation: ai-spin .8s linear infinite;
}
@keyframes ai-spin { to { transform: rotate(360deg); } }

.ai-result {
  background: linear-gradient(180deg, #f4f7fc 0%, #fff 100%);
  border: 1px solid #c5d3ed; border-radius: 12px;
  padding: 22px 24px;
}
.ai-result-head {
  display: flex; justify-content: space-between; align-items: flex-start; gap: 16px;
  border-bottom: 1px solid #dde2ec; padding-bottom: 16px; margin-bottom: 16px;
}
.ai-headline {
  font-size: 17px; font-weight: 700; color: var(--eycot-navy);
  line-height: 1.35; margin-top: 4px; max-width: 720px;
}
.ai-score {
  text-align: center; padding: 10px 16px; border-radius: 10px;
  background: #fff; border: 1px solid #dde2ec; flex-shrink: 0;
}
.ai-score-num { font-size: 28px; font-weight: 800; line-height: 1; font-variant-numeric: tabular-nums; }
.ai-score-ok .ai-score-num { color: #1e7a3b; }
.ai-score-warn .ai-score-num { color: #8a6300; }
.ai-score-bad .ai-score-num { color: var(--eycot-red); }

.ai-section { margin-bottom: 14px; }
.ai-section h4 {
  font-size: 13px; font-weight: 700; letter-spacing: .03em; text-transform: uppercase;
  color: var(--eycot-navy-2); margin: 0 0 6px;
}
.ai-section p { color: var(--ink); line-height: 1.6; margin: 0; font-size: 14px; }
.ai-section p b { color: var(--eycot-navy); }

.ai-footer {
  margin-top: 18px; padding-top: 14px; border-top: 1px solid #dde2ec;
  font-size: 11px; color: #8a93a8;
}
.ai-footer a { color: var(--eycot-navy-2); text-decoration: none; font-weight: 600; }

.ai-disclaimer {
  display: flex; gap: 12px;
  margin-top: 20px; padding: 14px 16px;
  background: #fff8e6; border: 1px solid #f0d99a; border-left: 4px solid var(--eycot-amber);
  border-radius: 8px;
}
.ai-disclaimer-icon { font-size: 20px; color: #8a6300; line-height: 1.2; flex-shrink: 0; }
.ai-disclaimer-title { font-weight: 700; color: #6f4e00; font-size: 12px; letter-spacing: .03em; text-transform: uppercase; margin-bottom: 4px; }
.ai-disclaimer-body { font-size: 13px; color: #5a4500; line-height: 1.5; }
.ai-disclaimer-body b { color: #4a3700; }

/* Hero card del Inicio */
.hero-card {
  position: relative;
  background: linear-gradient(135deg, #1B2D5C 0%, #122047 60%, #243B7A 100%);
  color: #fff;
  border-radius: 14px;
  padding: 28px 32px;
  margin-bottom: 16px;
  overflow: hidden;
  box-shadow: 0 6px 18px rgba(27,45,92,.18);
}
.hero-only-title {
  margin: 0;
  font-size: 26px;
  font-weight: 600;
  letter-spacing: .01em;
  color: #fff;
}
.hero-content { position: relative; z-index: 2; max-width: 720px; }
.hero-greeting {
  font-size: 12px;
  text-transform: uppercase;
  letter-spacing: .15em;
  color: rgba(255,255,255,.7);
  margin-bottom: 8px;
}
.hero-headline {
  font-size: 28px; font-weight: 700;
  margin: 0 0 8px;
  line-height: 1.2;
  letter-spacing: -.01em;
}
.hero-accent {
  background: linear-gradient(90deg, #ff8a8e, #D62229);
  -webkit-background-clip: text;
  background-clip: text;
  -webkit-text-fill-color: transparent;
  color: #D62229; /* fallback */
}
.hero-sub {
  font-size: 14px;
  color: rgba(255,255,255,.82);
  margin: 0;
  max-width: 600px;
  line-height: 1.55;
}
.hero-card .btn { background: rgba(255,255,255,.12); color: #fff; border-color: rgba(255,255,255,.2); }
.hero-card .btn:hover { background: rgba(255,255,255,.2); }
.hero-card .btn-primary { background: #D62229; color: #fff; border-color: #D62229; }
.hero-card .btn-primary:hover { background: #B41A20; }
.hero-circuit {
  position: absolute; right: 0; top: 0; bottom: 0;
  width: 300px; opacity: .55; pointer-events: none;
  display: flex; align-items: center;
}
.hero-circuit svg { width: 100%; height: 100%; }
@media (max-width: 720px) {
  .hero-headline { font-size: 22px; }
  .hero-circuit { display: none; }
}

/* Chat de Ayuda */
.chat-shell { display: flex; flex-direction: column; max-width: 880px; margin: 0 auto; height: calc(100vh - 140px); min-height: 500px; }
.chat-head {
  display: flex; align-items: center; gap: 12px;
  padding: 14px 18px; border-bottom: 1px solid var(--line);
  background: linear-gradient(180deg, #f4f7fc 0%, #fff 100%);
}
.chat-title { font-size: 15px; font-weight: 700; color: var(--ink); }
.chat-sub { font-size: 12px; color: var(--ink-mute); display: flex; align-items: center; gap: 4px; }

.chat-stream {
  flex: 1; overflow-y: auto;
  padding: 18px 18px 8px;
  background: #fafbfd;
  display: flex; flex-direction: column; gap: 14px;
}
.chat-msg { display: flex; gap: 10px; align-items: flex-start; }
.chat-msg-user { justify-content: flex-end; }
.chat-msg-ai { justify-content: flex-start; }
.chat-bubble {
  max-width: 75%;
  padding: 11px 14px;
  border-radius: 12px;
  font-size: 14px; line-height: 1.5;
}
.chat-bubble p { margin: 0 0 8px; color: inherit; }
.chat-bubble p:last-child { margin-bottom: 0; }
.chat-bubble strong { color: inherit; font-weight: 600; }
.chat-bubble code { background: rgba(0,0,0,.06); padding: 1px 5px; border-radius: 3px; font-size: 12.5px; }
.chat-bubble-user {
  background: var(--eycot-navy); color: #fff;
  border-bottom-right-radius: 3px;
}
.chat-bubble-ai {
  background: #fff; color: var(--ink);
  border: 1px solid var(--line); border-bottom-left-radius: 3px;
  box-shadow: 0 1px 2px rgba(0,0,0,.03);
}
.chat-bubble-title {
  font-size: 12px; font-weight: 700; color: var(--eycot-navy-2);
  letter-spacing: .04em; text-transform: uppercase;
  margin-bottom: 8px; padding-bottom: 6px;
  border-bottom: 1px solid var(--line);
}
.chat-bubble-claude-tag {
  display: inline-flex; align-items: center; gap: 6px;
  font-size: 10.5px; color: #6f7a96;
  margin-top: 10px; padding-top: 8px;
  border-top: 1px dashed var(--line-2);
  letter-spacing: .02em;
}
.chat-bubble-claude-tag .claude-dot {
  width: 7px; height: 7px; border-radius: 50%;
  background: linear-gradient(135deg, #D97757, #BFA37C);
  box-shadow: 0 0 0 2px rgba(217,119,87,.18);
}
.chat-avatar {
  width: 32px; height: 32px; border-radius: 50%; flex-shrink: 0;
  display: grid; place-items: center;
  font-size: 11px; font-weight: 700;
}
.chat-avatar-ai {
  background: #fff;
  color: #1B2D5C;
  position: relative;
  overflow: visible;
  animation: ai-breathing 4.5s ease-in-out infinite;
  box-shadow: 0 0 0 2px rgba(27,45,92,.18);
}
.chat-avatar-ai .chat-avatar-img {
  width: 100%; height: 100%; border-radius: 50%;
  object-fit: cover;
  display: block;
  position: relative;
  z-index: 1;
  background: #fff;
}
.chat-avatar-lg { width: 56px; height: 56px; }
.chat-avatar-user { background: var(--eycot-red); color: #fff; font-size: 13px; }

/* Halo navy mientras "pensando" — más fuerte */
.chat-msg-ai .chat-typing ~ * { display: none; }
.chat-msg-ai:has(.chat-typing) .chat-avatar-ai {
  animation: ai-thinking 1.4s ease-in-out infinite;
}

/* Glow rojo al aparecer una respuesta nueva */
.chat-msg-ai:last-child:not(:has(.chat-typing)) .chat-avatar-ai {
  animation: ai-breathing 4.5s ease-in-out infinite, ai-flash 1.2s ease-out 1;
}

/* Punto online verde con pulso */
.chat-online-dot {
  position: absolute; right: 2px; bottom: 2px;
  width: 11px; height: 11px; border-radius: 50%;
  background: #2da95a;
  border: 2px solid #fff;
  box-shadow: 0 0 0 0 rgba(45,169,90,.7);
  animation: ai-online-pulse 2.4s ease-in-out infinite;
}

@keyframes ai-breathing {
  0%, 100% { transform: scale(1); }
  50%      { transform: scale(1.04); }
}
@keyframes ai-thinking {
  0%, 100% { box-shadow: 0 0 0 0 rgba(27, 45, 92, 0.5); transform: scale(1); }
  50%      { box-shadow: 0 0 0 10px rgba(27, 45, 92, 0);  transform: scale(1.06); }
}
@keyframes ai-flash {
  0%   { box-shadow: 0 0 0 0 rgba(214, 34, 41, 0.5); }
  100% { box-shadow: 0 0 0 14px rgba(214, 34, 41, 0); }
}
@keyframes ai-online-pulse {
  0%, 100% { box-shadow: 0 0 0 0 rgba(45,169,90,.7); }
  50%      { box-shadow: 0 0 0 6px rgba(45,169,90,0); }
}

.chat-typing { display: inline-flex; gap: 4px; align-items: center; }
.chat-typing span {
  width: 7px; height: 7px; border-radius: 50%;
  background: var(--ink-mute); opacity: .3;
  animation: chat-pulse 1.2s infinite ease-in-out;
}
.chat-typing span:nth-child(2) { animation-delay: .2s; }
.chat-typing span:nth-child(3) { animation-delay: .4s; }
@keyframes chat-pulse {
  0%, 80%, 100% { opacity: .3; transform: scale(1); }
  40% { opacity: 1; transform: scale(1.2); }
}

.chat-suggestions {
  padding: 12px 18px;
  border-top: 1px solid var(--line);
  background: #fff;
  display: flex; flex-wrap: wrap; gap: 6px;
}
.chat-chip {
  font-size: 12px; padding: 6px 12px;
  border-radius: 999px; border: 1px solid var(--line-2);
  background: #fff; color: var(--eycot-navy-2); cursor: pointer;
  transition: background .12s, border-color .12s;
}
.chat-chip:hover { background: #eaf0fb; border-color: var(--eycot-navy-2); }

.chat-form {
  display: flex; gap: 8px; padding: 14px 18px;
  border-top: 1px solid var(--line); background: #fff;
}
.chat-input {
  flex: 1; padding: 11px 14px;
  border: 1px solid var(--line-2); border-radius: 999px;
  font-size: 14px; font-family: inherit;
  outline: none; transition: border-color .12s, box-shadow .12s;
}
.chat-input:focus {
  border-color: var(--eycot-navy-2);
  box-shadow: 0 0 0 3px rgba(27,45,92,.12);
}
.chat-send { border-radius: 999px; padding: 11px 22px; }

.chat-disclaimer {
  display: flex; align-items: center; gap: 8px;
  padding: 8px 18px;
  background: #fff8e6; border-top: 1px solid #f0d99a;
  font-size: 11px; color: #6f4e00;
}
.chat-disclaimer span:first-child { font-size: 14px; }
.reco-title { font-weight: 600; margin-bottom: 2px; }
.reco-detail { font-size: 13px; color: var(--ink-mute); }

/* ============================================================
   Cuestionario Unit Economics (UE)
   ============================================================ */
.ue-progress-bar {
  display: flex; align-items: center; gap: 14px;
  background: var(--panel); border: 1px solid var(--line); border-radius: var(--radius);
  padding: 12px 16px; margin: 8px 0 18px;
}
.ue-progress-track {
  flex: 1; height: 10px; background: #e9edf6; border-radius: 5px; overflow: hidden;
}
.ue-progress-fill {
  height: 100%;
  background: linear-gradient(90deg, var(--eycot-navy, #1B2D5C), var(--eycot-red, #D62229));
  transition: width .35s ease;
}
.ue-progress-label { font-size: 13px; color: var(--ink); white-space: nowrap; }
.ue-progress-label b { font-size: 16px; color: var(--eycot-navy, #1B2D5C); }

.ue-sections { display: flex; flex-direction: column; gap: 14px; }

.ue-section {
  background: white; border: 1px solid var(--line); border-radius: var(--radius);
  box-shadow: var(--shadow); overflow: hidden;
}
.ue-section-head {
  display: flex; align-items: center; justify-content: space-between;
  padding: 16px 20px; cursor: pointer; user-select: none;
  transition: background .15s;
}
.ue-section-head:hover { background: #f7f9fd; }
.ue-section-head-left { display: flex; align-items: center; gap: 14px; }
.ue-section-head-right { display: flex; align-items: center; gap: 10px; }
.ue-section-icon { font-size: 24px; }
.ue-section-num { font-size: 10px; letter-spacing: .12em; text-transform: uppercase; color: var(--ink-mute); font-weight: 600; }
.ue-section-title { font-size: 17px; font-weight: 700; color: var(--eycot-navy, #1B2D5C); margin-top: 2px; }
.ue-section-badge {
  display: inline-block; padding: 3px 10px; border-radius: 12px;
  font-size: 11px; font-weight: 600; letter-spacing: .04em;
  background: #eaf0fb; color: var(--eycot-navy-2, #243B7A);
}
.ue-section-badge.done { background: rgba(45,169,90,.15); color: #2da95a; }
.ue-section-badge.progress { background: #fff5db; color: #8a6300; }
.ue-section-chevron { font-size: 14px; color: var(--ink-mute); transition: transform .25s; }
.ue-section.collapsed .ue-section-chevron { transform: rotate(-90deg); }
.ue-section-body {
  padding: 6px 20px 18px;
  border-top: 1px solid var(--line);
  display: grid; grid-template-columns: repeat(2, 1fr); gap: 14px;
}
.ue-section.collapsed .ue-section-body { display: none; }
@media (max-width: 720px) {
  .ue-section-body { grid-template-columns: 1fr; }
}

.ue-q { display: flex; flex-direction: column; gap: 6px; }
.ue-q-label { font-size: 13px; font-weight: 600; color: var(--ink); }
.ue-q-req { color: var(--eycot-red, #D62229); margin-left: 2px; }
.ue-q-desc { font-size: 12px; color: var(--ink-mute); margin-top: -2px; }
.ue-q-input, .ue-q-textarea {
  width: 100%; box-sizing: border-box;
  padding: 9px 11px; font-size: 14px;
  border: 1px solid var(--line); border-radius: 6px;
  background: white; color: var(--ink);
  transition: border-color .15s, box-shadow .15s;
}
.ue-q-input:focus, .ue-q-textarea:focus {
  border-color: var(--eycot-navy, #1B2D5C);
  box-shadow: 0 0 0 3px rgba(27,45,92,.12);
  outline: none;
}
.ue-q-textarea { resize: vertical; min-height: 70px; font-family: inherit; }
.ue-q-with-unit { display: flex; align-items: center; gap: 8px; }
.ue-q-with-unit .ue-q-input { flex: 1; }
.ue-q-unit { font-size: 12px; color: var(--ink-mute); white-space: nowrap; }

.ue-q-chips { display: flex; flex-wrap: wrap; gap: 6px; }
.ue-chip {
  display: inline-flex; align-items: center; gap: 6px;
  padding: 6px 12px; border: 1px solid var(--line); border-radius: 16px;
  background: white; cursor: pointer; font-size: 12px;
  transition: all .15s; user-select: none;
}
.ue-chip input { display: none; }
.ue-chip:hover { border-color: var(--eycot-navy, #1B2D5C); }
.ue-chip.selected {
  background: var(--eycot-navy, #1B2D5C); color: white; border-color: var(--eycot-navy, #1B2D5C);
}

.ue-q-radio { display: flex; gap: 14px; }
.ue-q-radio label { display: flex; align-items: center; gap: 6px; font-size: 13px; cursor: pointer; }

.ue-actions {
  margin-top: 22px; padding-top: 16px; border-top: 1px solid var(--line);
  display: flex; align-items: center; gap: 12px;
}

/* Admin UE config */
.ue-admin-responses { display: flex; flex-direction: column; gap: 16px; margin-top: 12px; }
.ue-admin-section h4 {
  font-size: 13px; letter-spacing: .04em; color: var(--eycot-navy, #1B2D5C);
  margin: 0 0 6px; padding-bottom: 4px; border-bottom: 1px solid var(--line);
}
.kpi-row {
  background: var(--panel); border: 1px solid var(--line); border-radius: 6px;
  padding: 10px 12px; margin-bottom: 8px;
}
.grid-3 { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; }
@media (max-width: 720px) { .grid-3 { grid-template-columns: 1fr; } }

/* ============================================================
   SEU — Significant Energy Uses
   ============================================================ */
.seu-table { font-size: 13px; }
.seu-table th { font-size: 11px; letter-spacing: .04em; text-transform: uppercase; color: var(--ink-mute); }
.seu-table tr.seu-row td { background: rgba(214,34,41,.05); }
.seu-table tr.seu-row td:first-child { box-shadow: inset 3px 0 0 var(--eycot-red, #D62229); }

.seu-modal-backdrop {
  position: fixed; inset: 0; background: rgba(15,23,42,.55);
  display: flex; align-items: flex-start; justify-content: center;
  padding: 40px 20px; z-index: 1000;
  overflow-y: auto;
}
.seu-modal {
  background: white; max-width: 760px; width: 100%;
  margin: 0; box-shadow: 0 20px 60px rgba(15,23,42,.35);
  border-radius: var(--radius, 8px);
}
.seu-modal h3 { color: var(--eycot-navy, #1B2D5C); }

/* ============================================================
   Peak Shaving — gauge horizontal con marcadores
   ============================================================ */
.ps-gauge-track {
  position: relative; height: 16px; background: #e9edf6; border-radius: 8px;
  margin-top: 40px; overflow: visible;
}
.ps-gauge-fill {
  height: 100%; border-radius: 8px;
  background: linear-gradient(90deg, #2da95a 0%, #e0a800 60%, #D62229 90%);
  transition: width .4s ease;
}
.ps-gauge-marker {
  position: absolute; top: -6px; width: 2px; height: 28px;
}
.ps-gauge-peak { background: var(--eycot-navy, #1B2D5C); }
.ps-gauge-predicted { background: #D97706; border-left: 1px dashed white; }
.ps-gauge-contract { background: #5E7AC0; }
.ps-marker-label {
  position: absolute; top: -16px; left: 50%; transform: translateX(-50%);
  font-size: 9px; font-weight: 700; white-space: nowrap;
  color: var(--ink, #283246);
  background: white; padding: 1px 6px; border-radius: 3px;
  border: 1px solid currentColor;
}
.ps-gauge-peak .ps-marker-label { color: var(--eycot-navy, #1B2D5C); }
.ps-gauge-predicted .ps-marker-label { color: #D97706; }
.ps-gauge-contract .ps-marker-label { color: #5E7AC0; }

/* ============================================================
   EnPI Avanzado — selector de variables
   ============================================================ */
.enpi-vars-grid {
  display: grid; grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
  gap: 8px; margin-top: 8px;
}
.enpi-var-chip {
  display: flex; gap: 10px; align-items: flex-start;
  padding: 10px 12px; border: 1px solid var(--line);
  border-radius: 6px; cursor: pointer;
  transition: all .15s; background: white;
}
.enpi-var-chip:has(input:checked) {
  border-color: var(--eycot-navy, #1B2D5C);
  background: rgba(27,45,92,.04);
  box-shadow: 0 0 0 1px var(--eycot-navy,#1B2D5C) inset;
}
.enpi-var-chip input { margin: 2px 0 0; }
.enpi-var-label { font-weight: 600; font-size: 13px; color: var(--ink, #283246); }
.enpi-var-desc { font-size: 11px; color: var(--ink-mute); margin-top: 2px; }

/* ============================================================
   Management Review — preview de evidencia consolidada
   ============================================================ */
.mr-section {
  padding: 14px 0; border-bottom: 1px solid var(--line);
}
.mr-section:last-of-type { border-bottom: none; }
.mr-section h4 {
  font-size: 13px; font-weight: 700; color: var(--eycot-navy, #1B2D5C);
  margin: 0 0 8px; letter-spacing: .02em;
}
.mr-section ul, .mr-section ol { margin: 6px 0 4px 18px; line-height: 1.6; font-size: 13px; }
.mr-section p { margin: 4px 0; font-size: 13px; line-height: 1.6; }

/* ============================================================
   Cookies banner
   ============================================================ */
.cookie-banner {
  position: fixed; bottom: 0; left: 0; right: 0;
  background: var(--eycot-navy, #1B2D5C); color: white;
  z-index: 9999; box-shadow: 0 -8px 20px rgba(0,0,0,.18);
  padding: 14px 20px; font-size: 13px; line-height: 1.55;
}
.cookie-banner-inner {
  max-width: 1200px; margin: 0 auto;
  display: flex; gap: 20px; align-items: center; flex-wrap: wrap;
}
.cookie-banner-text { flex: 1; min-width: 280px; color: #DDE6F7; }
.cookie-banner-text b, .cookie-banner-text a { color: white; }
.cookie-banner-text a { text-decoration: underline; }
.cookie-banner-actions { display: flex; gap: 8px; flex-shrink: 0; }
.cookie-banner-actions .btn-ghost { color: white; border-color: #5E7AC0; }
.cookie-banner-actions .btn-ghost:hover { background: #243B7A; }

/* ============================================================
   Documentos legales (privacidad, T&C)
   ============================================================ */
.legal-doc { max-width: 800px; margin: 24px auto; line-height: 1.7; font-size: 14px; }
.legal-doc h1 { color: var(--eycot-navy, #1B2D5C); font-size: 26px; margin-bottom: 6px; }
.legal-doc h2 { color: var(--eycot-navy, #1B2D5C); font-size: 18px; margin-top: 26px; padding-bottom: 6px; border-bottom: 2px solid var(--eycot-red, #D62229); }
.legal-doc h3 { font-size: 15px; margin-top: 16px; color: var(--ink, #283246); }
.legal-doc ul, .legal-doc ol { margin: 6px 0 12px 22px; }
.legal-doc li { margin: 4px 0; }

/* ============================================================
   Pricing
   ============================================================ */
.pricing-hero {
  text-align: center; padding: 40px 20px;
  background: linear-gradient(135deg, var(--eycot-navy, #1B2D5C) 0%, #243B7A 100%);
  color: white; border-radius: 12px; margin-bottom: 24px;
}
.pricing-hero h1 { color: white; font-size: 32px; margin: 0 0 8px; }
.pricing-sub { color: #DDE6F7; font-size: 16px; margin: 0; }
.pricing-pills { display: flex; flex-wrap: wrap; gap: 8px; justify-content: center; margin-top: 14px; }
.pricing-pill {
  display: inline-block; padding: 4px 12px; border-radius: 14px;
  background: rgba(255,180,100,.18); color: #FFB464;
  font-size: 11px; font-weight: 700; letter-spacing: .04em;
}

.pricing-grid {
  display: grid; gap: 16px; margin-bottom: 30px;
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
}
.pricing-card {
  background: white; border: 1px solid var(--line, #DDE2EC); border-radius: 12px;
  padding: 22px; position: relative; display: flex; flex-direction: column;
  transition: transform .15s, box-shadow .15s;
}
.pricing-card:hover { transform: translateY(-3px); box-shadow: 0 12px 24px rgba(27,45,92,.12); }
.pricing-highlight { border: 2px solid var(--eycot-red, #D62229); box-shadow: 0 8px 24px rgba(214,34,41,.15); }
.pricing-badge {
  position: absolute; top: -12px; left: 50%; transform: translateX(-50%);
  background: var(--eycot-red, #D62229); color: white; padding: 4px 14px;
  border-radius: 12px; font-size: 10px; font-weight: 700; letter-spacing: .08em;
}
.pricing-card h3 { color: var(--eycot-navy, #1B2D5C); font-size: 20px; margin: 0 0 4px; }
.pricing-target { font-size: 12px; color: var(--ink-mute, #6E7890); margin: 0 0 14px; }
.pricing-price { margin: 12px 0; padding: 12px 0; border-top: 1px solid var(--line); border-bottom: 1px solid var(--line); }
.pricing-price .price-amount { font-size: 28px; font-weight: 700; color: var(--eycot-navy, #1B2D5C); }
.pricing-price .price-unit { font-size: 13px; color: var(--ink-mute); }
.pricing-features { list-style: none; padding: 0; margin: 0 0 18px; font-size: 13px; line-height: 1.85; flex: 1; }
.pricing-features li { color: var(--ink, #283246); }

.pricing-faq { max-width: 800px; margin: 30px auto; }
.pricing-faq h2 { color: var(--eycot-navy, #1B2D5C); }
.pricing-faq details { padding: 10px 0; border-bottom: 1px solid var(--line); }
.pricing-faq summary { cursor: pointer; font-size: 14px; padding: 6px 0; }
.pricing-faq details p { margin: 8px 0 4px; color: var(--ink-mute); font-size: 13px; line-height: 1.7; }

.pricing-cta-section { max-width: 800px; margin: 20px auto; text-align: center; padding: 30px; }

/* ============================================================
   Onboarding wizard
   ============================================================ */
.onboarding-backdrop {
  position: fixed; inset: 0; background: rgba(15,23,42,.55);
  display: flex; align-items: center; justify-content: center;
  z-index: 9998; padding: 20px;
}
.onboarding-card {
  background: white; max-width: 600px; width: 100%; max-height: 90vh; overflow-y: auto;
  border-radius: 12px; box-shadow: 0 20px 60px rgba(15,23,42,.35);
}
.onboarding-header {
  padding: 18px 22px; display: flex; justify-content: space-between; align-items: center;
  border-bottom: 1px solid var(--line);
}
.onboarding-logo { height: 32px; }
.onboarding-close {
  background: none; border: none; font-size: 26px; cursor: pointer;
  color: var(--ink-mute); padding: 4px 10px; border-radius: 4px;
}
.onboarding-close:hover { background: var(--panel); }
.onboarding-body { padding: 22px; }
.onboarding-body h2 { margin: 0 0 4px; color: var(--eycot-navy, #1B2D5C); }
.onboarding-steps { display: flex; flex-direction: column; gap: 10px; margin: 20px 0; }
.onboarding-step {
  display: flex; align-items: center; gap: 14px; padding: 14px;
  border: 1px solid var(--line); border-radius: 8px;
  text-decoration: none; color: var(--ink);
  transition: all .15s;
}
.onboarding-step:hover { border-color: var(--eycot-navy, #1B2D5C); background: rgba(27,45,92,.04); transform: translateX(2px); }
.step-number {
  width: 32px; height: 32px; border-radius: 50%;
  background: var(--eycot-navy, #1B2D5C); color: white;
  display: flex; align-items: center; justify-content: center;
  font-weight: 700; flex-shrink: 0;
}
.step-body { flex: 1; }
.step-title { font-weight: 600; font-size: 14px; }
.step-desc { font-size: 12px; color: var(--ink-mute); margin-top: 2px; }
.step-arrow { font-size: 18px; color: var(--ink-mute); }
.onboarding-actions { display: flex; justify-content: space-between; gap: 10px; }

/* ============================================================
   Mobile responsive — bloque general
   ============================================================ */
@media (max-width: 768px) {
  .sidebar {
    position: fixed; left: -260px; top: 0; bottom: 0; width: 240px;
    z-index: 100; transition: left .25s;
  }
  .sidebar.open { left: 0; }
  .main { margin-left: 0 !important; padding: 12px !important; }
  .topbar { padding: 10px 12px !important; }
  .grid, .grid-2, .grid-3, .grid-4 { grid-template-columns: 1fr !important; }
  .card { padding: 14px !important; }
  table { font-size: 12px; }
  table th, table td { padding: 6px 4px; }
  .kpi-value { font-size: 20px !important; }
  .chart-canvas { height: 220px !important; }
  .auth-card, .landing-card { margin: 14px; padding: 20px; }
  .pricing-hero { padding: 20px 12px; }
  .pricing-hero h1 { font-size: 22px; }
  .cookie-banner-inner { flex-direction: column; align-items: stretch; }
  .cookie-banner-actions { justify-content: stretch; }
  .cookie-banner-actions .btn { flex: 1; }
}

/* ============================================================
   Empty / Loading / Error states helpers
   ============================================================ */
.empty-state {
  text-align: center; padding: 40px 20px; color: var(--ink-mute);
}
.empty-state-icon { font-size: 48px; opacity: 0.4; margin-bottom: 8px; }
.empty-state-title { font-size: 15px; font-weight: 600; color: var(--ink); margin: 4px 0; }
.empty-state-desc { font-size: 13px; line-height: 1.5; max-width: 400px; margin: 8px auto 16px; }

.loading-skeleton {
  background: linear-gradient(90deg, var(--panel) 25%, #e8edf6 50%, var(--panel) 75%);
  background-size: 200% 100%; animation: skeleton-shimmer 1.4s ease-in-out infinite;
  border-radius: 4px; height: 14px;
}
@keyframes skeleton-shimmer {
  0% { background-position: 200% 0; }
  100% { background-position: -200% 0; }
}

.error-banner {
  padding: 12px 16px; border-radius: 6px; margin: 12px 0;
  background: rgba(214,34,41,.08); border-left: 4px solid var(--eycot-red, #D62229);
  font-size: 13px;
}
.error-banner-title { font-weight: 600; color: var(--eycot-red, #D62229); }
.error-banner-detail { color: var(--ink-mute); margin-top: 4px; font-family: monospace; font-size: 11px; }

/* ============================================================
   Microsoft SSO + Entra ID admin
   ============================================================ */
.btn-microsoft {
  background: white; color: #5E5E5E; border: 1px solid #8C8C8C;
  font-weight: 600; padding: 10px 14px; display: flex; align-items: center; justify-content: center;
  transition: all .15s;
}
.btn-microsoft:hover { background: #f3f3f3; border-color: #5E5E5E; }

.domain-chips { display: flex; flex-wrap: wrap; gap: 4px; align-items: center; }
.domain-chip {
  display: inline-flex; align-items: center; gap: 4px;
  padding: 3px 8px; border-radius: 12px;
  background: rgba(27,45,92,.08); color: var(--eycot-navy, #1B2D5C);
  font-size: 11px; font-family: monospace;
}
.domain-chip .chip-x {
  cursor: pointer; font-size: 14px; line-height: 1; color: var(--ink-mute);
  padding: 0 2px; border-radius: 50%;
}
.domain-chip .chip-x:hover { background: var(--bad, #D62229); color: white; }

/* ============================================================ */
/* Subscription status banner — trial / past_due / suspended    */
/* ============================================================ */
.sub-banner {
  position: sticky; top: 0; z-index: 90;
  padding: 8px 16px; font-size: 13.5px; line-height: 1.45;
  box-shadow: 0 1px 0 rgba(0,0,0,.06);
}
.sub-banner-info { background: linear-gradient(90deg, #1B2D5C 0%, #2a3f78 100%); color: #fff; }
.sub-banner-warn { background: linear-gradient(90deg, #b07000 0%, #d99400 100%); color: #fff; }
.sub-banner-block { background: linear-gradient(90deg, #8c1c1c 0%, #D62229 100%); color: #fff; }
.sub-banner-inner {
  max-width: 1400px; margin: 0 auto;
  display: flex; align-items: center; justify-content: space-between; gap: 12px; flex-wrap: wrap;
}
.sub-banner-msg b { font-weight: 700; }
.sub-banner-actions { display: inline-flex; align-items: center; gap: 8px; }
.sub-banner-close {
  background: transparent; border: 0; color: inherit; cursor: pointer;
  font-size: 20px; line-height: 1; padding: 2px 6px; opacity: .75;
}
.sub-banner-close:hover { opacity: 1; }
.btn-ghost-light {
  background: transparent !important; color: #fff !important;
  border: 1px solid rgba(255,255,255,.4) !important;
}
.btn-ghost-light:hover { background: rgba(255,255,255,.12) !important; }

