/**
 * Tokens de marca Nexuma Smart Campus
 * Azul logo #0045B2 · Navy #001B4D · Soft #E8F0FC
 * Cargar después de Bootstrap; tenant_theme puede sobrescribir --primary / --primary-dark.
 */
:root {
  /* ── Marca Nexuma ────────────────────────────────────────────── */
  --primary:       #0045B2;
  --primary-600:   #003A96;
  --primary-700:   #002B70;
  --primary-50:    #eef3fc;
  --primary-100:   #d4e2f8;
  --primary-dark:  #001B4D;
  --accent:        #3B6FE0;
  --accent-soft:   #E8F0FC;
  --accent-deep:   #001B4D;
  --accent-deep-rgb: 0, 27, 77;

  /* ── Neutros tipográficos ────────────────────────────────────── */
  --ink:     #0f1724;
  --ink-2:   #1a2336;
  --muted:   #64748b;
  --line:    rgba(0, 69, 178, 0.14);
  --line-strong: rgba(0, 69, 178, 0.26);

  /* ── Superficies ─────────────────────────────────────────────── */
  --bg:      #F5F7FB;
  --paper:   #ffffff;
  --paper-2: #EEF2F8;

  /* Tintes dinámicos del primario */
  --primary-tint-08: color-mix(in srgb, var(--primary) 8%, white);
  --primary-tint-05: color-mix(in srgb, var(--primary) 5%, white);
  --primary-tint-04: color-mix(in srgb, var(--primary) 4%, white);

  /* ── Semánticos ──────────────────────────────────────────────── */
  --secondary: #6b7280;
  --success:   #0045B2;
  --danger:    #ef4444;
  --warning:   #f59e0b;
  --info:      #3B6FE0;
  --light:     var(--paper-2);
  --dark:      var(--ink-2);
  --white:     #ffffff;

  /* ── Sidebar (claro) ─────────────────────────────────────────── */
  --sidebar-bg:          #ffffff;
  --sidebar-border:      rgba(0, 27, 77, 0.08);
  --sidebar-text:        #334155;
  --sidebar-muted:       #64748b;
  --sidebar-active-bg:   #dbe7fb;
  --sidebar-active-text: #001B4D;
  --sidebar-hover-bg:    #f4f7fc;
  --sidebar-active-bar:  #0045B2;
  --sidebar-icon:        #0045B2;

  /* ── Header (claro, como antes) ──────────────────────────────── */
  --header-bg:      #ffffff;
  --header-text:    #1a2336;

  /* ── Radios ──────────────────────────────────────────────────── */
  --radius-sm: 10px;
  --radius:    18px;
  --radius-lg: 28px;

  /* ── Tipografía ──────────────────────────────────────────────── */
  --font: "Poppins", system-ui, -apple-system, "Segoe UI", sans-serif;

  /* ── Sombras azules suaves ───────────────────────────────────── */
  --shadow-brand-1: 0 1px 0 rgba(0, 69, 178, 0.06), 0 1px 3px rgba(0, 27, 77, 0.08);
  --shadow-brand-2: 0 6px 20px -6px rgba(0, 69, 178, 0.28), 0 2px 6px rgba(0, 27, 77, 0.10);
  --shadow-sm: var(--shadow-brand-1);
  --shadow-md: var(--shadow-brand-2);
  --shadow-lg: 0 12px 32px rgba(0, 69, 178, 0.18);

  /* ── Bootstrap 5.3 bridge ────────────────────────────────────── */
  --bs-primary:          var(--primary);
  --bs-primary-rgb:      0, 69, 178;
  --bs-link-color:       var(--primary-600);
  --bs-link-hover-color: var(--primary-700);
  --bs-body-bg:          var(--bg);
  --bs-body-color:       var(--ink-2);
  --bs-border-color:     var(--line);
  --bs-border-radius:    0.625rem;
  --bs-secondary-color:  var(--muted);
}

/* Fallback color-mix */
@supports not (background: color-mix(in srgb, red 50%, white)) {
  :root {
    --primary-tint-08: rgba(0, 69, 178, 0.08);
    --primary-tint-05: rgba(0, 69, 178, 0.05);
    --primary-tint-04: rgba(0, 69, 178, 0.04);
  }
}

/* ── Gradientes de cabezote / hero (siguen paleta tenant) ─────────── */
:root {
  --brand-hero-gradient: linear-gradient(
    120deg,
    #0B1220 0%,
    var(--primary-700, #002B70) 48%,
    var(--primary, #0045B2) 100%
  );
  --brand-header-gradient: linear-gradient(
    135deg,
    var(--primary-dark, #001B4D),
    var(--primary, #0045B2)
  );
  --brand-card-header-gradient: linear-gradient(
    135deg,
    var(--primary-600, #003A96),
    var(--primary, #0045B2)
  );
}

/* ── Utilitarios Bootstrap ───────────────────────────────────────── */
.bg-primary {
  --bs-bg-opacity: 1;
  background-color: var(--primary) !important;
}

.text-bg-primary {
  color: #fff !important;
  background-color: var(--primary) !important;
}

/* Cabezotes de tarjeta / secciones (muchas plantillas usan esta clase) */
.bg-gradient-primary {
  background: var(--brand-card-header-gradient) !important;
  color: #fff !important;
}

.card-header.bg-primary,
.modal-header.bg-primary,
.card-header.bg-gradient-primary,
.modal-header.bg-gradient-primary {
  background: var(--brand-card-header-gradient) !important;
  border-color: transparent !important;
  color: #fff !important;
}

/* Tipografía / iconos de título con azul marca */
.text-primary {
  color: var(--primary) !important;
}

/* ── Botón primario Nexuma ───────────────────────────────────────── */
.btn-primary {
  --bs-btn-color:              #fff;
  --bs-btn-bg:                 var(--primary);
  --bs-btn-border-color:       var(--primary);
  --bs-btn-hover-color:        #fff;
  --bs-btn-hover-bg:           var(--primary-600);
  --bs-btn-hover-border-color: var(--primary-600);
  --bs-btn-focus-shadow-rgb:   0, 69, 178;
  --bs-btn-active-color:       #fff;
  --bs-btn-active-bg:          var(--primary-700);
  --bs-btn-active-border-color: var(--primary-700);
  --bs-btn-disabled-color:     #fff;
  --bs-btn-disabled-bg:        var(--accent);
  --bs-btn-disabled-border-color: var(--accent);
}

/* ── Sidebar claro Nexuma ────────────────────────────────────────── */
#sidebar {
  background: var(--sidebar-bg) !important;
  border-right: 1px solid var(--sidebar-border, rgba(0, 27, 77, 0.08));
}
#sidebar .nav-link {
  color: var(--sidebar-text);
}
#sidebar .nav-link:hover {
  background: var(--sidebar-hover-bg);
  color: var(--primary-dark, #001B4D);
}
#sidebar .nav-link.active,
#sidebar .nav-link[aria-current="page"] {
  background: var(--sidebar-active-bg);
  color: var(--sidebar-active-text);
  border-left: 3px solid var(--sidebar-active-bar);
  font-weight: 600;
}

/* ── Header Nexuma ───────────────────────────────────────────────── */
#header-bar {
  background: var(--header-bg) !important;
}

/* ── Badges de estado ────────────────────────────────────────────── */
.badge.bg-success  { background-color: var(--primary) !important; }
.text-success      { color: var(--primary) !important; }
.border-success    { border-color: var(--primary) !important; }
