/* ===== CANON VISUAL DE NEXUS (ADR-004) ===================================
   Único bloque de color, tipografía, radios y sombras permitido en la
   aplicación. Ninguna ventana redefine estos valores ni declara los suyos;
   lo comprueba 06_herramientas/qa/canon.js. Hoy lo usa Dirección (y su
   ventana Gastos); las demás ventanas se irán pasando en el orden del ADR.
   Las variables --nexus-* de más abajo son las históricas del núcleo y se
   conservan para BREEFING mientras no se migre. */
:root {
  /* identidad */
  --navy: #0f2638; --navy-2: #16344b;
  --gold: #ffce3a; --amber: #ff9e3d; --gold-d: #9a6a00;
  /* texto y superficies */
  --ink: #1c2f41; --muted: #6a7c90; --line: #dde5ee;
  --panel: #ffffff; --soft: #f3f7fb; --soft2: #eaf0f7; --sel: #fff6da;
  /* semántica */
  --ok: #1f8f50; --warn: #e08a1e; --err: #c0392b; --info: #2c5d9e;
  /* estados de proyecto (lenguaje de negocio, intocables) */
  --c-estudio: #8a9db2; --c-oferta: #2c5d9e; --c-obra: #e08a1e; --c-ejec: #1f8f50; --c-deses: #b04545;
  /* tintes de estado: fondo de chips y avisos (el texto va en el color pleno) */
  --ok-soft: #e8f5ee; --warn-soft: #fff3e2; --err-soft: #fbebe9; --info-soft: #e9f0f8;
  /* escena: fondo lavado de las pantallas de trabajo (referencia BREEFING) */
  --wash-a: #eef4fa; --wash-b: #e3ecf5;
  /* texto secundario y separadores sobre la barra azul marino */
  --navy-muted: #a3b6c8; --navy-line: #21405a;
  /* velo de modales y cajones; dos sombras y no más */
  --veil: rgba(15, 38, 56, .42);
  --shadow-card: 0 12px 34px -20px rgba(15, 38, 56, .42);
  --shadow-pop: 0 30px 80px -28px rgba(15, 38, 56, .55);
  /* tipografía */
  --font: Inter, "Segoe UI", system-ui, sans-serif;
  --font-brand: Orbitron, Inter, "Segoe UI", sans-serif;
}

:root {
  --nexus-navy: #0f2638;
  --nexus-gold: #ffce3a;
  --nexus-amber: #ff9e3d;
  --nexus-ink: #16283a;
  --nexus-muted: #5d7188;
  --nexus-line: #d8e2ee;
  --nexus-panel: #ffffff;
  --nexus-soft: #f3f7fc;
  --nexus-soft-2: #eaf1f8;
  --nexus-danger: #b8322a;
  --nexus-ok: #1f7a4c;
  --nexus-shadow: 0 12px 34px -20px rgba(15, 38, 56, .42);
}

.ui-card {
  background: var(--nexus-panel);
  border: 1px solid var(--nexus-line);
  border-radius: 8px;
  box-shadow: var(--nexus-shadow);
}

.ui-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  min-height: 36px;
  border: 1px solid var(--nexus-line);
  border-radius: 8px;
  padding: 8px 14px;
  background: #fff;
  color: var(--nexus-navy);
  font: 700 12px/1 Inter, system-ui, sans-serif;
  cursor: pointer;
  text-decoration: none;
}

.ui-btn:hover {
  background: var(--nexus-soft);
}

.ui-btn.primary {
  border-color: transparent;
  background: linear-gradient(135deg, var(--nexus-gold), var(--nexus-amber));
  color: var(--nexus-navy);
}

.ui-btn.danger {
  border-color: #f0c5c0;
  color: var(--nexus-danger);
}

.ui-tabs {
  display: flex;
  align-items: center;
  gap: 8px;
}

.ui-tabs button {
  border: 1px solid var(--nexus-line);
  border-radius: 8px;
  background: #fff;
  color: var(--nexus-muted);
  padding: 8px 12px;
  cursor: pointer;
}

.ui-tabs button.on,
.ui-tabs button[aria-selected="true"] {
  border-color: transparent;
  background: linear-gradient(135deg, var(--nexus-gold), var(--nexus-amber));
  color: var(--nexus-navy);
}

.ui-table {
  width: 100%;
  border-collapse: collapse;
  background: #fff;
}

.ui-table th,
.ui-table td {
  border-bottom: 1px solid var(--nexus-line);
  padding: 10px 12px;
  text-align: left;
  vertical-align: top;
}

.ui-table th {
  color: var(--nexus-muted);
  font-size: 11px;
  letter-spacing: .06em;
  text-transform: uppercase;
}

.ui-modal-backdrop {
  position: fixed;
  inset: 0;
  z-index: 900;
  display: flex;
  align-items: center;
  justify-content: center;
  background: rgba(15, 38, 56, .38);
  -webkit-backdrop-filter:blur(3px);backdrop-filter:blur(3px);
}

.ui-modal {
  width: min(460px, calc(100vw - 32px));
  background: #fff;
  border: 1px solid var(--nexus-line);
  border-radius: 8px;
  box-shadow: 0 30px 80px -28px rgba(15, 38, 56, .55);
  padding: 18px;
}

.ui-state {
  display: flex;
  min-height: 96px;
  align-items: center;
  justify-content: center;
  border: 1px dashed var(--nexus-line);
  border-radius: 8px;
  background: var(--nexus-soft);
  color: var(--nexus-muted);
  font: 500 13px/1.45 Inter, system-ui, sans-serif;
  text-align: center;
  padding: 16px;
}

.ui-state.error {
  border-color: #efc7c1;
  background: #fff1ef;
  color: var(--nexus-danger);
}

.ui-state.loading::before {
  content: "";
  width: 14px;
  height: 14px;
  margin-right: 10px;
  border: 2px solid #c7d4e2;
  border-top-color: var(--nexus-amber);
  border-radius: 50%;
  animation: uiSpin .8s linear infinite;
}

@keyframes uiSpin {
  to { transform: rotate(360deg); }
}

.ui-toast-stack {
  position: fixed;
  left: 50%;
  bottom: 24px;
  z-index: 1200;
  display: flex;
  width: min(460px, calc(100vw - 32px));
  flex-direction: column;
  gap: 8px;
  transform: translateX(-50%);
  pointer-events: none;
}

.ui-toast {
  border: 1px solid var(--nexus-navy);
  border-radius: 8px;
  background: var(--nexus-navy);
  color: #fff;
  box-shadow: 0 18px 42px -24px rgba(0, 0, 0, .6);
  padding: 11px 14px;
  font: 600 13px/1.35 Inter, system-ui, sans-serif;
}

.ui-toast.warn {
  border-color: #e6c15d;
  background: #fff6d8;
  color: #7a5700;
}

.ui-toast.error {
  border-color: #efc7c1;
  background: #fff1ef;
  color: var(--nexus-danger);
}

.ui-toast.ok {
  border-color: #bfe5ce;
  background: #edf8f1;
  color: var(--nexus-ok);
}

.nexus-lock-banner {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  z-index: 1100;
  display: none;
  align-items: center;
  justify-content: center;
  min-height: 34px;
  padding: 7px 16px;
  border-bottom: 1px solid #e6c15d;
  background: #fff6d8;
  color: #6c4c00;
  font: 700 12px/1.35 Inter, system-ui, sans-serif;
  text-align: center;
  box-shadow: 0 10px 26px -24px rgba(15, 38, 56, .55);
}

.nexus-lock-banner.on {
  display: flex;
}
