:root {
  --sibo-blue: #1a4d96;
  --sibo-blue-2: #0057c9;
  --ink: #111827;
  --muted: #64748b;
  --line: #e2e8f0;
  --surface: #ffffff;
  --canvas: #f5f7fa;
  --success: #177245;
  --warning: #a15c00;
  --danger: #c62828;
  --radius-sm: 6px;
  --radius-md: 10px;
  --radius-lg: 16px;
  --shadow-sm: 0 4px 18px rgba(15, 23, 42, .08);
  --shadow-lg: 0 22px 60px rgba(15, 23, 42, .16);
  font-family: Inter, Roboto, "Segoe UI", Arial, sans-serif;
  color: var(--ink);
  background: var(--canvas);
  line-height: 1.5;
}
* { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body { margin: 0; min-height: 100vh; }
[hidden] { display:none !important; }
button, input, textarea, select { font: inherit; }
button, a { -webkit-tap-highlight-color: transparent; }
a { color: inherit; }
img { max-width: 100%; }
button { cursor: pointer; }
.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0,0,0,0); white-space: nowrap; }
.eyebrow { color: var(--sibo-blue); text-transform: uppercase; letter-spacing: .13em; font-size: .75rem; font-weight: 800; }
.button { min-height: 42px; border: 0; border-radius: var(--radius-sm); padding: 10px 16px; font-weight: 750; display: inline-flex; align-items: center; justify-content: center; gap: 8px; transition: .18s ease; }
.button:hover { transform: translateY(-1px); }
.button--primary { background: var(--sibo-blue); color: #fff; box-shadow: 0 7px 18px rgba(26,77,150,.22); }
.button--secondary { background: #eef4ff; color: var(--sibo-blue); border: 1px solid #cfe0ff; }
.button--danger { background: #fff1f1; color: var(--danger); border: 1px solid #ffd3d3; }
.button--ghost { background: transparent; color: var(--ink); border: 1px solid var(--line); }
.button--block { width: 100%; }
.button:disabled { cursor: not-allowed; opacity: .55; transform: none; }
.badge { display: inline-flex; align-items: center; min-height: 24px; padding: 3px 9px; border-radius: 999px; font-size: .72rem; font-weight: 800; letter-spacing: .02em; background: #edf2f7; color: #475569; }
.badge--success { background: #e8f7ef; color: #11673d; }
.badge--warning { background: #fff4dc; color: #8a5200; }
.badge--danger { background: #ffebeb; color: #a61f1f; }
.badge--blue { background: #eaf2ff; color: #174e9c; }
.card { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius-lg); box-shadow: var(--shadow-sm); }
.stack-form { display: grid; gap: 18px; }
.stack-form label, .field { display: grid; gap: 7px; font-size: .86rem; font-weight: 700; color: #334155; }
.stack-form input:not([type="checkbox"]):not([type="radio"]), .stack-form textarea, .stack-form select, .field input:not([type="checkbox"]):not([type="radio"]), .field textarea, .field select {
  width: 100%; min-height: 44px; border: 1px solid #cbd5e1; border-radius: var(--radius-sm); padding: 10px 12px; background: #fff; color: var(--ink); outline: 0;
}
.stack-form textarea, .field textarea { min-height: 120px; resize: vertical; }
.stack-form input:not([type="checkbox"]):not([type="radio"]):focus, .stack-form textarea:focus, .stack-form select:focus, .field input:not([type="checkbox"]):not([type="radio"]):focus, .field textarea:focus, .field select:focus {
  border-color: var(--sibo-blue-2); box-shadow: 0 0 0 3px rgba(0,87,201,.12);
}
.check-field { display:flex; align-items:flex-start; gap:10px; padding:12px 14px; border:1px solid #d7e0ea; border-radius:10px; background:#fff; font-size:.86rem; font-weight:700; color:#334155; }
.check-field input[type="checkbox"], .check-field input[type="radio"] { width:18px; height:18px; min-width:18px; min-height:18px; margin:1px 0 0; accent-color: var(--sibo-blue); }
.check-field__body { display:grid; gap:3px; }
.check-field__hint { font-size:.78rem; font-weight:500; color:#64748b; line-height:1.4; }
.form-error { min-height: 0; color: var(--danger); font-size: .85rem; font-weight: 650; }
.form-error[hidden], .form-error:empty { display:none !important; min-height:0 !important; height:0 !important; margin:0 !important; padding:0 !important; border:0 !important; background:transparent !important; }
/* Los contenedores de error vacíos nunca deben reservar espacio ni dibujar bordes. */
.form-error:empty { display:none !important; min-height:0 !important; margin:0 !important; padding:0 !important; border:0 !important; }
.empty-state { text-align: center; border: 1px dashed #cbd5e1; border-radius: var(--radius-lg); padding: 42px 24px; background: #f8fafc; color: var(--muted); }
.empty-state h3 { color: var(--ink); margin: 0 0 8px; }
/* Centro de notificaciones: se mueve al overlay/dialog activo para compartir su misma top-layer. */
.toast-region {
  position: fixed;
  inset: auto 20px 20px auto;
  margin: 0;
  padding: 0;
  border: 0;
  background: transparent;
  z-index: 2147483647;
  display: grid;
  gap: 10px;
  width: min(390px, calc(100vw - 40px));
  max-height: min(70vh, 620px);
  overflow: visible;
  pointer-events: none;
}
.toast { display:grid; grid-template-columns:minmax(0,1fr) auto; align-items:start; gap:10px; border-radius: 10px; padding: 13px 12px 13px 15px; color: #fff; box-shadow: 0 18px 48px rgba(15,23,42,.28); animation: toast-in .2s ease; background: #223047; pointer-events: auto; line-height:1.45; }
.toast__message { min-width:0; overflow-wrap:anywhere; }
.toast__close { width:28px; height:28px; border:0; border-radius:7px; background:rgba(255,255,255,.14); color:#fff; display:grid; place-items:center; padding:0; font-size:1rem; line-height:1; }
.toast__close:hover { background:rgba(255,255,255,.24); transform:none; }
.toast--success { background: #176b43; }
.toast--error { background: #a52626; }
.toast--warning { background:#8a5200; }
@keyframes toast-in { from { opacity: 0; transform: translateY(8px); } }
@media (max-width:650px) {
  .toast-region { inset:auto 12px 12px 12px; width:auto; }
}
.loading { display: grid; place-items: center; min-height: 260px; color: var(--muted); }
.loading::before { content: ""; width: 34px; height: 34px; border: 3px solid #dbe4ef; border-top-color: var(--sibo-blue); border-radius: 50%; animation: spin .75s linear infinite; margin-right: 10px; }
@keyframes spin { to { transform: rotate(360deg); } }
.actions { display: flex; flex-wrap: wrap; gap: 8px; }
.icon-button { width: 36px; height: 36px; display: inline-grid; place-items: center; border: 1px solid var(--line); background: #fff; border-radius: 7px; color: #334155; }
.icon-button:hover { border-color: #9fbce7; color: var(--sibo-blue); background: #f5f9ff; }
