/* ═══════════════════════════════════════════════════════
   CASE SHARED UI — Dark Mode Institucional
   Versión: 1.0  |  Fecha: 2026-04-12
   Uso: enlazar desde cada index.html de la línea CASE
   ═══════════════════════════════════════════════════════ */

/* ── Variables ── */
:root {
  --bg:             #0f1410;
  --bg-card:        #161e14;
  --bg-elevated:    #1e2b1b;
  --bg-input:       #111811;
  --border:         #263022;
  --border-light:   #344e2e;

  --text-primary:   #d8e8d2;
  --text-secondary: #8aa884;
  --text-muted:     #516c4a;

  --accent:         #4a8a4a;
  --accent-dim:     #253e22;

  /* semánticos */
  --bajo-bg:        #0f2e1e;
  --bajo-border:    #1e5c3a;
  --bajo-text:      #6ecf96;

  --medio-bg:       #2a1e00;
  --medio-border:   #5a3e00;
  --medio-text:     #e8b840;

  --alto-bg:        #2a0e0e;
  --alto-border:    #5a1e1e;
  --alto-text:      #e87070;

  --sin-datos-bg:   #161e14;
  --sin-datos-text: #516c4a;

  --radius:    8px;
  --radius-sm: 5px;
  --font:      'Segoe UI', system-ui, sans-serif;
}

/* ── Reset ── */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

/* ── Base ── */
body {
  font-family: var(--font);
  background: linear-gradient(180deg, #020617 0%, #020617 60%, #020617 100%);
  color: #e5e7eb;
  min-height: 100vh;
  padding: 2rem 1rem;
}

.global-header {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-bottom: 20px;
}

.global-logo {
  width: 36px;
  height: 36px;
  border-radius: 8px;
  box-shadow: 0 0 8px rgba(0, 0, 0, 0.4);
}

.global-banner {
  background: linear-gradient(90deg, #052e16, #064e3b);
  border: 1px solid #065f46;
  color: #d1fae5;
}

/* ════════════════════════════════
   LAYOUT
   ════════════════════════════════ */

.case-page {
  max-width: 760px;
  margin: 0 auto;
  display: flex;
  flex-direction: column;
  gap: 2rem;
}

/* ════════════════════════════════
   HEADER
   ════════════════════════════════ */

.case-header {
  background: var(--bg-elevated);
  border: 1px solid var(--border-light);
  padding: 1.25rem 1.5rem;
  border-radius: var(--radius);
}
.case-header__label {
  font-size: 1.05rem;
  font-weight: 700;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--text-primary);
  display: block;
}
.case-header__sub {
  font-size: 0.78rem;
  color: var(--text-secondary);
  margin-top: 0.3rem;
  display: block;
}
.case-header h1 {
  font-size: 1.42rem;
  font-weight: 700;
  letter-spacing: 0.03em;
  text-transform: none;
  color: var(--text-primary);
}
.case-header p {
  font-size: 0.92rem;
  color: var(--text-secondary);
  margin-top: 0.45rem;
}

/* ════════════════════════════════
   TARJETAS
   ════════════════════════════════ */

.card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 1.5rem;
}

.case-card,
.card {
  background-color: #0f172a;
  border: 1px solid #1e293b;
}
.card__label {
  font-size: 1rem;
  font-weight: 700;
  letter-spacing: 0.02em;
  text-transform: none;
  color: var(--text-primary);
  margin-bottom: 0.5rem;
}

.section-title {
  margin: 0 0 0.5rem 0;
  font-size: 1.08rem;
  font-weight: 700;
  color: var(--text-primary);
}

.section-lead {
  margin: 0 0 1rem 0;
  font-size: 0.84rem;
  color: #9fb2c7;
  line-height: 1.5;
}

/* ════════════════════════════════
   BADGES DE ESTADO
   ════════════════════════════════ */

.estado-badge {
  display: inline-block;
  font-size: 1.1rem;
  font-weight: 800;
  letter-spacing: 0.06em;
  padding: 0.3rem 1rem;
  border-radius: var(--radius-sm);
  margin-bottom: 0.65rem;
}
.estado-badge.estable   { background: var(--bajo-bg);     color: var(--bajo-text);     border: 1px solid var(--bajo-border); }
.estado-badge.atencion  { background: var(--medio-bg);    color: var(--medio-text);    border: 1px solid var(--medio-border); }
.estado-badge.critico   { background: var(--alto-bg);     color: var(--alto-text);     border: 1px solid var(--alto-border); }
.estado-badge.sin_datos { background: var(--sin-datos-bg); color: var(--sin-datos-text); border: 1px solid var(--border); }

.estado-motivo {
  font-size: 0.84rem;
  color: var(--text-secondary);
  line-height: 1.5;
}

/* ════════════════════════════════
   BADGES DE RIESGO
   ════════════════════════════════ */

.riesgo-badge {
  display: inline-block;
  font-size: 0.66rem;
  font-weight: 700;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  padding: 0.2rem 0.65rem;
  border-radius: 4px;
}
.riesgo-badge.bajo  { background: var(--bajo-bg);  color: var(--bajo-text);  border: 1px solid var(--bajo-border); }
.riesgo-badge.medio { background: var(--medio-bg); color: var(--medio-text); border: 1px solid var(--medio-border); }
.riesgo-badge.alto  { background: var(--alto-bg);  color: var(--alto-text);  border: 1px solid var(--alto-border); }

/* ════════════════════════════════
   MÉTRICAS (grid 4 col)
   ════════════════════════════════ */

.metricas {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 0.75rem;
  margin-top: 0.25rem;
}
.metrica {
  text-align: center;
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 0.75rem 0.4rem;
}
.metrica__num {
  font-size: 1.7rem;
  font-weight: 800;
  line-height: 1;
}
.metrica__num.total { color: var(--text-primary); }
.metrica__num.bajo  { color: var(--bajo-text); }
.metrica__num.medio { color: var(--medio-text); }
.metrica__num.alto  { color: var(--alto-text); }
.metrica__sub {
  font-size: 0.62rem;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--text-muted);
  margin-top: 0.35rem;
}

/* ════════════════════════════════
   ÚLTIMO CASO
   ════════════════════════════════ */

.ultimo-ts {
  font-size: 0.73rem;
  color: var(--text-muted);
  margin-bottom: 0.35rem;
}
.ultimo-desc {
  font-size: 0.93rem;
  color: var(--text-primary);
  margin-bottom: 0.5rem;
  line-height: 1.45;
}

/* ════════════════════════════════
   ACCESOS (grid 2 col)
   ════════════════════════════════ */

.accesos {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 0.75rem;
  margin-top: 0.25rem;
}
.acceso-btn {
  display: block;
  background: var(--bg);
  border: 1px solid var(--border-light);
  color: var(--text-secondary);
  text-decoration: none;
  text-align: center;
  padding: 0.7rem 0.5rem;
  border-radius: var(--radius-sm);
  font-size: 0.76rem;
  font-weight: 600;
  letter-spacing: 0.07em;
  text-transform: uppercase;
  transition: background 0.15s, color 0.15s, border-color 0.15s;
}
.acceso-btn:hover {
  background: var(--bg-elevated);
  color: var(--text-primary);
  border-color: var(--accent);
}

/* ════════════════════════════════
   BOTÓN PRIMARY
   ════════════════════════════════ */

.btn-primary {
  width: 100%;
  padding: 0.85rem 1rem;
  background: #1e293b;
  color: #e5e7eb;
  border: 1px solid #334155;
  border-radius: 8px;
  font-size: 0.82rem;
  font-weight: 700;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  cursor: pointer;
  transition: background 0.15s, border-color 0.15s;
}
.btn-primary:hover    { background: #334155; border-color: #475569; }
.btn-primary:disabled { background: var(--bg-elevated); color: var(--text-muted); border-color: var(--border); cursor: default; }

.btn-update {
  background-color: #1e293b;
  color: #e5e7eb;
  border: 1px solid #334155;
}

.btn-update:hover {
  background-color: #334155;
  border-color: #475569;
}

/* ════════════════════════════════
   INPUT / TEXTAREA
   ════════════════════════════════ */

.case-input {
  width: 100%;
  background: var(--bg-input);
  border: 1px solid var(--border-light);
  border-radius: 8px;
  color: var(--text-primary);
  font-family: var(--font);
  font-size: 0.95rem;
  line-height: 1.45;
  padding: 0.85rem 0.95rem;
  resize: vertical;
}
.case-input:focus {
  outline: none;
  border-color: var(--accent);
}
.case-input::placeholder       { color: #cbd5f5; opacity: 0.9; }
.case-input:focus::placeholder { color: #cbd5f5; opacity: 0.5; }

/* ════════════════════════════════
   CAMPOS DE SALIDA (Report Engine)
   ════════════════════════════════ */

.field-block {
  margin-bottom: 1rem;
}
.field-block:last-child { margin-bottom: 0; }
.field-block__label {
  font-size: 0.72rem;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: #8aa0b7;
  margin-bottom: 0.45rem;
}
.field-block__value {
  font-size: 0.94rem;
  color: var(--text-primary);
  line-height: 1.55;
}

.acciones-list {
  margin: 0.35rem 0 0 1.1rem;
  padding: 0;
  color: var(--text-primary);
  font-size: 0.9rem;
  line-height: 1.45;
}

.acciones-list li {
  margin-bottom: 0.3rem;
}

.result-top-chips {
  display: grid;
  grid-template-columns: repeat(3, minmax(140px, 1fr));
  gap: 0.9rem;
  margin-bottom: 1rem;
}

.result-chip {
  min-width: 0;
  overflow: hidden;
  padding: 0.75rem 1rem;
  border: 1px solid #38506a;
  border-radius: 9px;
  background: rgba(21, 33, 54, 0.74);
}

.result-chip__label {
  display: block;
  color: #9db2c8;
  font-size: 0.7rem;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  margin: 0 0 0.35rem 0;
  font-weight: 700;
}

.result-chip__value {
  display: block;
  color: #e5e7eb;
  font-size: 1.05rem;
  font-weight: 700;
  line-height: 1.2;
  word-break: break-word;
  overflow-wrap: anywhere;
}

.decision-layout {
  margin-top: 0.25rem;
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 1.25rem;
  align-items: start;
}

#resultado-card {
  background: #142033;
  border-color: #2f4560;
}

#plan-card {
  background: #101b2b;
  border-color: #253749;
}

.plan-card {
  min-height: 100%;
}

.plan-table-wrap {
  width: 100%;
  overflow-x: auto;
}

.plan-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.84rem;
  color: var(--text-primary);
}

.plan-table th,
.plan-table td {
  border-bottom: 1px solid #1e293b;
  padding: 0.88rem 0.62rem;
  vertical-align: top;
  text-align: left;
}

.plan-table th {
  color: #9cb2c8;
  font-size: 0.72rem;
  text-transform: uppercase;
  letter-spacing: 0.06em;
}

#plan-body td:first-child {
  color: #dce7f3;
  font-weight: 600;
}

.plan-chip {
  display: inline-block;
  font-size: 0.77rem;
  padding: 0.25rem 0.62rem;
  border-radius: 999px;
  border: 1px solid;
  white-space: nowrap;
}

.plan-footnote {
  margin: 0.85rem 0 0 0;
  font-size: 0.78rem;
  color: #94a3b8;
  font-style: italic;
}

.ctx-subtitle {
  margin: -0.1rem 0 1rem 0;
  font-size: 0.84rem;
  color: #b8c4d0;
}

.narrative-table td {
  line-height: 1.55;
}

.narrative-table .plan-chip {
  font-size: 0.74rem;
}

.plan-chip--alto {
  background: rgba(127, 29, 29, 0.35);
  color: #fca5a5;
  border-color: #7f1d1d;
}

.plan-chip--medio {
  background: rgba(120, 53, 15, 0.35);
  color: #fcd34d;
  border-color: #78350f;
}

.plan-chip--bajo {
  background: rgba(6, 78, 59, 0.35);
  color: #86efac;
  border-color: #065f46;
}

@media (max-width: 900px) {
  .decision-layout {
    grid-template-columns: 1fr;
  }

  .result-top-chips {
    grid-template-columns: repeat(2, minmax(140px, 1fr));
  }
}

@media (max-width: 560px) {
  .result-top-chips {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 640px) {
  .plan-table thead {
    display: none;
  }

  .plan-table,
  .plan-table tbody,
  .plan-table tr,
  .plan-table td {
    display: block;
    width: 100%;
  }

  .plan-table tr {
    border: 1px solid #2a3d56;
    border-radius: 10px;
    margin-bottom: 0.85rem;
    padding: 0.55rem;
    background: #0f172a;
    box-shadow: 0 0 0 1px rgba(71, 97, 128, 0.15) inset;
  }

  .plan-table td {
    border: none;
    padding: 0.44rem 0.48rem;
  }

  .plan-table td + td {
    border-top: 1px dashed #223349;
  }

  .plan-table td::before {
    content: attr(data-label);
    display: block;
    color: #96abc2;
    font-size: 0.64rem;
    text-transform: uppercase;
    letter-spacing: 0.07em;
    margin-bottom: 0.22rem;
    font-weight: 700;
  }

  .plan-table td[data-label="Accion sugerida"] {
    color: #dce7f3;
    font-weight: 700;
  }

  .ctx-subtitle {
    margin-bottom: 0.8rem;
  }
}

/* ════════════════════════════════
   HISTORIAL (History Engine)
   ════════════════════════════════ */

.history-panel {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 1.25rem;
}
@media (max-width: 560px) {
  .history-panel { grid-template-columns: 1fr; }
  .metricas { grid-template-columns: repeat(2, 1fr); }
}
.history-list {
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
}
.history-item {
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 0.65rem 0.9rem;
  cursor: pointer;
  transition: border-color 0.15s;
}
.history-item:hover    { border-color: var(--border-light); }
.history-item.selected { border-color: var(--accent); }
.history-item__ts {
  font-size: 0.67rem;
  color: var(--text-muted);
  margin-bottom: 0.2rem;
}
.history-item__desc {
  font-size: 0.83rem;
  color: var(--text-primary);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

/* ════════════════════════════════
   SEÑALES (Alert Engine — grid 3 col)
   ════════════════════════════════ */

.signals {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 0.75rem;
  margin-top: 0.25rem;
}
.signal-card {
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 0.75rem 0.5rem;
  text-align: center;
}
.signal-card__num {
  font-size: 1.7rem;
  font-weight: 800;
  color: var(--text-primary);
  line-height: 1;
}
.signal-card__sub {
  font-size: 0.62rem;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--text-muted);
  margin-top: 0.35rem;
}

/* ════════════════════════════════
   UTILIDADES
   ════════════════════════════════ */

.sin-datos { color: var(--text-muted); font-style: italic; font-size: 0.84rem; }

.entry-cta {
  margin: 24px 0;
  padding: 20px;
  background: #0f172a;
  border: 1px solid #1e293b;
  border-radius: 12px;
}

.entry-cta h3 {
  margin: 0 0 8px 0;
  color: var(--text-primary);
  font-size: 1rem;
}

.entry-cta p {
  margin: 0 0 14px 0;
  color: #b8c4d0;
  font-size: 0.85rem;
}

/* ── Survey block ── */
.survey-block {
  margin-top: 1.25rem;
}

.survey-details {
  background: #0f172a;
  border: 1px solid #1e293b;
  border-radius: 10px;
  overflow: hidden;
}

.survey-summary {
  cursor: pointer;
  padding: 16px 20px;
  color: #e5e7eb;
  font-size: 0.95rem;
  font-weight: 600;
  list-style: none;
  display: flex;
  align-items: center;
  gap: 10px;
  user-select: none;
}

.survey-summary::-webkit-details-marker { display: none; }

.survey-details[open] .survey-summary {
  border-bottom: 1px solid #1e293b;
}

.survey-summary__tag {
  font-size: 0.72rem;
  padding: 2px 8px;
  background: #1e293b;
  color: #94a3b8;
  border-radius: 999px;
  font-weight: 400;
}

.survey-form {
  padding: 20px;
  display: flex;
  flex-direction: column;
  gap: 18px;
}

.survey-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 14px;
}

.survey-group {
  display: flex;
  flex-direction: column;
  gap: 7px;
}

.survey-label {
  font-size: 0.8rem;
  color: #b8c4d0;
  font-weight: 500;
  line-height: 1.35;
}

.survey-select {
  background: #1e293b;
  color: #e5e7eb;
  border: 1px solid #334155;
  border-radius: 7px;
  padding: 9px 10px;
  font-size: 0.85rem;
  outline: none;
}

.survey-select:focus {
  border-color: #475569;
}

.survey-select--wide {
  max-width: 380px;
}

.survey-textarea {
  background: #1e293b;
  color: #e5e7eb;
  border: 1px solid #334155;
  border-radius: 7px;
  padding: 10px;
  font-size: 0.85rem;
  line-height: 1.45;
  resize: vertical;
  outline: none;
  font-family: inherit;
}

.survey-textarea:focus {
  border-color: #475569;
}

.survey-actions {
  margin-top: 6px;
}

/* ── Context / narrative blocks ── */
.ctx-block {
  margin-top: 1.5rem;
  padding: 22px 24px;
  background: #0f172a;
  border: 1px solid #1e293b;
  border-radius: 12px;
}

.ctx-title {
  margin: 0 0 18px 0;
  font-size: 0.95rem;
  font-weight: 600;
  color: #e5e7eb;
}

.ctx-cols {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 20px;
}

.ctx-col__heading {
  margin: 0 0 8px 0;
  font-size: 0.78rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.06em;
}

.ctx-col--before .ctx-col__heading { color: #f87171; }
.ctx-col--after  .ctx-col__heading { color: #4ade80; }

.ctx-list {
  margin: 0;
  padding: 0;
  list-style: none;
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.ctx-list li {
  font-size: 0.84rem;
  padding-left: 1.4em;
  position: relative;
  color: #cbd5e1;
  line-height: 1.45;
}

.ctx-list--bad  li::before { content: '\2715'; position: absolute; left: 0; color: #f87171; }
.ctx-list--good li::before { content: '\2714'; position: absolute; left: 0; color: #4ade80; }

.ctx-footer {
  margin: 18px 0 0 0;
  font-size: 0.82rem;
  color: #94a3b8;
  font-style: italic;
}

.ctx-hint {
  margin: 12px 0 0 0;
  font-size: 0.8rem;
  color: #b8c4d0;
  line-height: 1.5;
}

.entry-card {
  border-color: #2f4560;
  box-shadow: 0 0 0 1px rgba(84, 126, 168, 0.15) inset;
}

.input-guide-block {
  border-color: #2b3d57;
}

.ctx-bridge {
  margin-top: 1.25rem;
  padding: 14px 20px;
  background: #0f172a;
  border-left: 3px solid #475569;
  border-radius: 0 8px 8px 0;
  font-size: 0.875rem;
  color: #b8c4d0;
  font-style: italic;
}

/* --- SIN / CON layout -------------------------------------------------- */
.sin-con-layout {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 1rem;
  margin-bottom: 0.5rem;
}

.sin-sistema,
.con-sistema {
  border-radius: 10px;
  padding: 1.1rem 1.35rem 1.25rem;
}

.sin-sistema {
  background: rgba(122, 31, 31, 0.22);
  border: 1px solid #7a1f1f;
}

.con-sistema {
  background: rgba(20, 83, 45, 0.28);
  border: 1px solid #166534;
}

.sin-con__title {
  margin: 0 0 0.7rem 0;
  font-size: 0.85rem;
  font-weight: 700;
  letter-spacing: 0.04em;
  text-transform: uppercase;
}

.sin-sistema .sin-con__title { color: #f87171; }
.con-sistema .sin-con__title { color: #86efac; }

.sin-con__list {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  flex-direction: column;
  gap: 0.55rem;
}

.sin-con__list li {
  font-size: 0.875rem;
  line-height: 1.5;
  color: #cbd5e1;
  padding-left: 0;
}

.input-guide-block {
  margin-top: 1.1rem;
}

.input-guide-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 0.95rem;
}

.input-guide-card {
  background: rgba(15, 23, 42, 0.62);
  border: 1px solid #24324a;
  border-radius: 10px;
  padding: 0.85rem;
}

.input-guide-card__title {
  margin: 0 0 0.7rem 0;
  font-size: 0.79rem;
  font-weight: 700;
  letter-spacing: 0.05em;
  text-transform: uppercase;
  color: #e2e8f0;
}

.input-guide-table th {
  color: #93c5fd;
}

.input-guide-table td {
  color: #cbd5e1;
  line-height: 1.45;
}

.guide-chip {
  display: inline-block;
  font-size: 0.72rem;
  padding: 0.2rem 0.45rem;
  border-radius: 999px;
  border: 1px solid transparent;
  white-space: nowrap;
}

.guide-chip--teal {
  background: rgba(13, 148, 136, 0.2);
  border-color: #0f766e;
  color: #99f6e4;
}
/* ----------------------------------------------------------------------- */

@media (max-width: 640px) {
  .ctx-cols { grid-template-columns: 1fr; }
  .sin-con-layout { grid-template-columns: 1fr; }
  .input-guide-grid { grid-template-columns: 1fr; }
}

@media (max-width: 640px) {
  .survey-row { grid-template-columns: 1fr; }
  .survey-select--wide { max-width: 100%; }

/* ════════════════════════════════
   VERB_CONGRUENCE_GATE CARD
   ════════════════════════════════ */

.gate-card {
  border-left: 3px solid #e8b840;
  background: #1a1600;
}

.gate-card__label {
  color: #e8b840;
}

.gate-card__label--incongruente {
  color: var(--alto-text);
}

.gate-card__mensaje {
  color: var(--text-primary);
  font-size: 0.92rem;
  line-height: 1.55;
  margin-top: 0.6rem;
  margin-bottom: 1rem;
}

.gate-sugerencias__intro {
  font-size: 0.78rem;
  font-weight: 700;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--text-muted);
  margin: 0 0 0.35rem 0;
  line-height: 1.35;
}

.gate-sugerencias {
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
}

.gate-sugerencia-btn {
  display: block;
  width: 100%;
  text-align: left;
  background: var(--bg-elevated);
  border: 1px solid var(--border-light);
  border-radius: var(--radius-sm);
  color: var(--text-secondary);
  font-family: var(--font);
  font-size: 0.85rem;
  line-height: 1.45;
  padding: 0.62rem 0.8rem;
  margin: 0;
  cursor: pointer;
  transition: border-color 0.15s, color 0.15s;
}

.gate-sugerencia-btn:hover {
  border-color: var(--accent);
  color: var(--text-primary);
}

.gate-card__label--incongruente ~ .gate-card__mensaje {
  /* no cambia el texto; el color del label ya señala la severidad */
}
}

.top-nav {
  display: flex;
  gap: 16px;
  margin: 0 0 28px 0;
  padding: 10px 14px;
  background: rgba(15, 23, 42, 0.9);
  border: 1px solid #1e293b;
  border-radius: 10px;
  width: fit-content;
}

.top-nav__link {
  display: inline-block;
  padding: 8px 12px;
  color: #cbd5e1;
  text-decoration: none;
  font-size: 14px;
  border-radius: 8px;
  transition: background 0.2s ease, color 0.2s ease;
}

.top-nav__link:hover {
  background: #1e293b;
  color: #ffffff;
}

.top-nav__link[aria-current="page"] {
  background: #1e293b;
  color: #ffffff;
  border: 1px solid #334155;
}

.feedback-box {
  margin-top: 32px;
  padding: 20px;
  background-color: #0f172a;
  border: 1px solid #2a3b53;
  border-radius: 10px;
}

.feedback-box h3 {
  font-size: 1rem;
  margin-bottom: 0.4rem;
  color: #e5e7eb;
}

.feedback-box p {
  color: #94a3b8;
  font-size: 0.85rem;
  margin-bottom: 0.65rem;
}

.feedback-box textarea {
  width: 100%;
  min-height: 80px;
  background: #020617;
  color: #e5e7eb;
  border: 1px solid #334155;
  padding: 10px;
  border-radius: 6px;
  margin-top: 10px;
  resize: vertical;
}
.feedback-box textarea::placeholder       { color: #cbd5f5; opacity: 0.9; }
.feedback-box textarea:focus::placeholder { color: #cbd5f5; opacity: 0.5; }

.global-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 1rem;
  margin-top: 1.25rem;
}

.linea-card {
  display: flex;
  flex-direction: column;
  gap: 0.8rem;
}

.linea-head {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 1rem;
}

.linea-nombre {
  font-size: 0.78rem;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--text-muted);
}

.linea-total {
  font-size: 0.82rem;
  color: var(--text-secondary);
}

.linea-motivo {
  color: var(--text-secondary);
  font-size: 0.82rem;
  min-height: 2.2em;
}

.global-section-margin {
  margin-top: 1rem;
}

.global-actions-right {
  margin-top: 1rem;
  display: flex;
  justify-content: flex-end;
}

@media (max-width: 820px) {
  .global-grid {
    grid-template-columns: 1fr;
  }

  .accesos {
    grid-template-columns: 1fr;
  }
}

/* Forced override to neutralize older button cascades */
button,
.btn,
.btn-primary {
  background: #1e293b !important;
  color: #e5e7eb !important;
  border: 1px solid #334155 !important;
  box-shadow: none !important;
}

button:hover,
.btn:hover,
.btn-primary:hover {
  background: #334155 !important;
  border-color: #475569 !important;
}


