/* ==========================================================================
   Thème Nuvaris pour Orchid — surcharge la palette teal par défaut avec
   le bleu de marque (#2563eb) + violet accent, et la sidebar navy Nuvaris.
   Chargé via Dashboard::registerResource('stylesheets', ...) (PlatformProvider).
   ========================================================================== */

:root,
[data-bs-theme='light'] {
    --bs-primary: #2563eb;
    --bs-primary-rgb: 37, 99, 235;
    --bs-primary-text-emphasis: #1d4ed8;
    --bs-primary-bg-subtle: #dbeafe;
    --bs-primary-border-subtle: #bfdbfe;

    --bs-link-color: #2563eb;
    --bs-link-color-rgb: 37, 99, 235;
    --bs-link-hover-color: #1d4ed8;
    --bs-link-hover-color-rgb: 29, 78, 216;

    --nv-brand: #2563eb;
    --nv-brand-dark: #1d4ed8;
    --nv-accent: #8b5cf6;
}

/* ---- Boutons primaires ------------------------------------------------ */
.btn-primary {
    --bs-btn-bg: var(--nv-brand);
    --bs-btn-border-color: var(--nv-brand);
    --bs-btn-hover-bg: var(--nv-brand-dark);
    --bs-btn-hover-border-color: var(--nv-brand-dark);
    --bs-btn-active-bg: #1e40af;
    --bs-btn-active-border-color: #1e40af;
    --bs-btn-disabled-bg: var(--nv-brand);
    --bs-btn-disabled-border-color: var(--nv-brand);
}
.btn-outline-primary {
    --bs-btn-color: var(--nv-brand);
    --bs-btn-border-color: var(--nv-brand);
    --bs-btn-hover-bg: var(--nv-brand);
    --bs-btn-hover-border-color: var(--nv-brand);
    --bs-btn-active-bg: var(--nv-brand-dark);
}

/* ---- Utilitaires de couleur ------------------------------------------ */
/* On ne force PAS .bg-primary/.text-primary en dur : la variable
   --bs-primary-rgb ci-dessus les recolore déjà tout en préservant les
   opacités (les badges .bg-opacity-25 restent des pastilles claires). */

/* Icônes/textes d'accent Orchid (liens de tableau, boutons-liens) */
.btn-link { --bs-btn-color: var(--nv-brand); --bs-btn-hover-color: var(--nv-brand-dark); }
a { color: var(--nv-brand); }
a:hover { color: var(--nv-brand-dark); }

/* ---- Champs de formulaire : focus bleu de marque --------------------- */
.form-control:focus,
.form-select:focus,
.form-check-input:focus {
    border-color: #93c5fd;
    box-shadow: 0 0 0 0.2rem rgba(37, 99, 235, 0.2);
}
.form-check-input:checked {
    background-color: var(--nv-brand);
    border-color: var(--nv-brand);
}

/* ---- Sidebar (aside) : navy Nuvaris + item actif en bleu ------------- */
.aside {
    background: linear-gradient(185deg, #0f1729 0%, #131d33 100%) !important;
    border-right: 1px solid rgba(148, 163, 184, 0.08);
}
/* Le logo dans la sidebar */
.header-brand .nv-brand-mark { filter: drop-shadow(0 2px 6px rgba(37, 99, 235, 0.35)); }

/* Bloc profil : contexte d'empilement au-dessus de la nav.
   transform:none — Orchid applique un transform à .profile-container, ce qui
   « piège » le menu déroulant en position:fixed (il devient relatif au bloc et
   se retrouve sous la nav). On le neutralise pour que le menu s'ancre bien au
   viewport et passe au-dessus de tout. */
#nv-profile { z-index: 1040; transform: none !important; }

/* Le menu du profil est en position fixe (ancré au coin bas-gauche) plutôt
   que géré par Popper : la sidebar est étroite, scrollable et le bloc profil
   est tout en bas — Popper positionnait le menu hors-champ / clippé. En fixed,
   il n'est jamais coupé et passe au-dessus de tout. */
#nv-profile .dropdown-menu {
    position: fixed;
    left: 0.75rem;
    bottom: 4.9rem;
    width: 15.5rem;
    max-width: calc(100vw - 1.5rem);
    z-index: 1060;
}

/* Item de menu actif : liseré + fond bleu de marque */
.aside .nav-link.active,
.aside .nav-link[aria-current='page'] {
    background: linear-gradient(90deg, rgba(37, 99, 235, 0.22), rgba(37, 99, 235, 0.06)) !important;
    color: #fff !important;
    box-shadow: inset 3px 0 0 var(--nv-brand);
    border-radius: 0.5rem;
}
.aside .nav-link:hover {
    background: rgba(148, 163, 184, 0.10);
    border-radius: 0.5rem;
}

/* Barre de recherche de la sidebar */
.aside .form-control {
    background: rgba(148, 163, 184, 0.10);
    border-color: rgba(148, 163, 184, 0.15);
    color: #e2e8f0;
}
.aside .form-control::placeholder { color: #94a3b8; }

/* ---- Avatar de profil : anneau bleu ---------------------------------- */
.aside .avatar,
.aside img.rounded-circle { box-shadow: 0 0 0 2px rgba(37, 99, 235, 0.5); }

/* ---- Pagination active ----------------------------------------------- */
.page-item.active .page-link {
    background-color: var(--nv-brand);
    border-color: var(--nv-brand);
}
.page-link { color: var(--nv-brand); }

/* ---- Spinner de chargement ------------------------------------------- */
.spinner-border, .spinner-grow { color: var(--nv-brand); }
