/* theme-refresh.css
   Habillage moderne posé au-dessus du template NiceAdmin (style.css) et de
   Bootstrap, chargé après les deux dans index.html. On ne modifie jamais
   style.css directement : ça reste le fichier vendor d'origine, on ne fait
   que le surcharger ici, ce qui rend la mise à jour du template plus sûre.
*/

:root {
  --sc-navy: #0b3c5d;
  --sc-navy-light: #164d74;
  --sc-navy-dark: #082a42;
  --sc-accent: #1e88c8;
  --sc-accent-light: #7dd3fc;
  --sc-accent-soft: #eaf4fb;
  --sc-success: #10b981;
  --sc-warning: #f59e0b;
  --sc-danger: #dc2626;
  --sc-bg: #f4f6fa;
  --sc-surface: #ffffff;
  --sc-border: #e7ebf2;
  --sc-text: #263449;
  --sc-text-muted: #6b7a90;
  --sc-radius-lg: 16px;
  --sc-radius-md: 12px;
  --sc-radius-sm: 8px;
  --sc-shadow-sm: 0 1px 2px rgba(11, 60, 93, 0.06), 0 1px 1px rgba(11, 60, 93, 0.04);
  --sc-shadow-md: 0 8px 24px -8px rgba(11, 60, 93, 0.16), 0 2px 6px rgba(11, 60, 93, 0.06);
  --sc-shadow-lg: 0 20px 48px -12px rgba(11, 60, 93, 0.22);
}

/* ---------------------------------------------------------------
   Fond général + typographie
   --------------------------------------------------------------- */
body {
  background: var(--sc-bg);
  color: var(--sc-text);
}

::selection {
  background: rgba(11, 60, 93, 0.16);
}

/* Scrollbar fine, dans le ton de la marque plutôt que le gris par défaut */
::-webkit-scrollbar {
  width: 10px;
  height: 10px;
}
::-webkit-scrollbar-track {
  background: transparent;
}
::-webkit-scrollbar-thumb {
  background: #c7d2e0;
  border-radius: 20px;
  border: 2px solid var(--sc-bg);
}
::-webkit-scrollbar-thumb:hover {
  background: #a8b8cf;
}

/* ---------------------------------------------------------------
   Cartes : plus d'air, plus de profondeur, coins plus doux
   --------------------------------------------------------------- */
.card {
  border-radius: var(--sc-radius-lg);
  box-shadow: var(--sc-shadow-sm);
  border: 1px solid var(--sc-border);
  transition: box-shadow 0.2s ease, transform 0.2s ease;
}

.card.shadow-sm {
  box-shadow: var(--sc-shadow-sm) !important;
}

.card:hover {
  box-shadow: var(--sc-shadow-md);
}

.card-header {
  border-radius: var(--sc-radius-lg) var(--sc-radius-lg) 0 0 !important;
  font-weight: 600;
}

/* ---------------------------------------------------------------
   Boutons : micro-interaction cohérente partout, même sans handler JS
   --------------------------------------------------------------- */
.btn {
  border-radius: var(--sc-radius-sm);
  font-weight: 600;
  transition: transform 0.15s ease, box-shadow 0.15s ease, background-color 0.15s ease, color 0.15s ease, border-color 0.15s ease;
}

.btn:hover {
  transform: translateY(-1px);
}

.btn:active {
  transform: translateY(0);
}

.btn:focus-visible,
a:focus-visible,
.form-control:focus-visible,
.nav-link:focus-visible {
  outline: 2px solid var(--sc-accent);
  outline-offset: 2px;
}

/* ---------------------------------------------------------------
   Formulaires : bordures nettes, focus visible dans la couleur de marque
   --------------------------------------------------------------- */
.form-control,
.form-select {
  border-radius: var(--sc-radius-sm);
  border-color: var(--sc-border);
  transition: border-color 0.15s ease, box-shadow 0.15s ease;
}

.form-control:focus,
.form-select:focus {
  border-color: var(--sc-accent);
  box-shadow: 0 0 0 3px rgba(30, 136, 200, 0.15);
}

/* ---------------------------------------------------------------
   Tableaux : en-tête discret, lignes qui réagissent au survol
   --------------------------------------------------------------- */
.table {
  --bs-table-bg: transparent;
}

.table thead th {
  text-transform: uppercase;
  font-size: 0.72rem;
  letter-spacing: 0.05em;
  font-weight: 700;
  color: var(--sc-text-muted);
  border-bottom: 2px solid var(--sc-border);
  background: transparent;
  padding-top: 0.85rem;
  padding-bottom: 0.85rem;
}

.table tbody tr {
  transition: background-color 0.12s ease;
}

.table tbody tr:hover {
  background-color: var(--sc-accent-soft);
}

.table td {
  vertical-align: middle;
}

/* ---------------------------------------------------------------
   Badges : un peu plus de respiration
   --------------------------------------------------------------- */
.badge {
  font-weight: 600;
  letter-spacing: 0.01em;
  padding: 0.4em 0.75em;
  border-radius: 999px;
}

/* ---------------------------------------------------------------
   Topbar
   --------------------------------------------------------------- */
.header {
  box-shadow: var(--sc-shadow-sm);
  border-bottom: 1px solid var(--sc-border);
}

.header .nav-profile img {
  border: 2px solid var(--sc-accent-soft);
}

.dropdown-menu {
  border: 1px solid var(--sc-border);
  border-radius: var(--sc-radius-md);
  box-shadow: var(--sc-shadow-md);
  padding: 0.5rem;
}

.dropdown-item {
  border-radius: var(--sc-radius-sm);
  padding: 0.55rem 0.75rem;
}

.dropdown-item:hover {
  background-color: var(--sc-accent-soft);
}

/* ---------------------------------------------------------------
   Sidebar : état actif plus affirmé (pilule pleine, pas juste un fond pâle)
   --------------------------------------------------------------- */
/* Le fond marine du panneau (.sidebar { background-color: #0B3C5D }) vient du
   template d'origine (style.css), pas d'ici — tout ce qui suit est calibré
   pour rester lisible sur CE fond-là, jamais sur du blanc. */
#sidebar {
  border-right: 1px solid rgba(255, 255, 255, 0.08);
}

.sidebar-nav .nav-link {
  border-radius: var(--sc-radius-sm);
  font-weight: 600;
  color: rgba(255, 255, 255, 0.72);
  background: transparent;
  margin: 2px 0;
  transition: background-color 0.15s ease, color 0.15s ease;
}

.sidebar-nav .nav-link i {
  color: rgba(255, 255, 255, 0.55);
}

.sidebar-nav .nav-link.collapsed {
  background: transparent;
  color: rgba(255, 255, 255, 0.72);
}

.sidebar-nav .nav-link.collapsed i {
  color: rgba(255, 255, 255, 0.55);
}

/* État actif : un vrai contraste avec le fond marine plutôt qu'un dégradé
   navy-sur-navy à peine visible — une pastille pleine, claire, avec le texte
   en marine dessus (inversion volontaire). */
.sidebar-nav .nav-link:not(.collapsed) {
  color: var(--sc-navy);
  background: #ffffff;
  box-shadow: var(--sc-shadow-sm);
}

.sidebar-nav .nav-link:not(.collapsed) i {
  color: var(--sc-accent);
}

.sidebar-nav .nav-link:hover {
  background: rgba(255, 255, 255, 0.1);
  color: #ffffff;
}

.sidebar-nav .nav-link:hover i {
  color: #ffffff;
}

.sidebar-nav .nav-link.collapsed:hover,
.sidebar-nav .nav-link:not(.collapsed):hover {
  background: rgba(255, 255, 255, 0.1);
}

.sidebar-nav .nav-link:not(.collapsed):hover {
  color: var(--sc-navy);
  background: #ffffff;
}

/* Sous-menus : le template d'origine les affiche déjà en blanc (lisible sur
   le marine) — on ne fait que renforcer l'état actif avec l'accent, jamais
   avec du marine qui se fondrait dans le fond. */
.sidebar-nav .nav-content a {
  color: rgba(255, 255, 255, 0.75);
}

.sidebar-nav .nav-content a:hover {
  color: #ffffff;
}

.sidebar-nav .nav-content a.active {
  color: #ffffff !important;
  font-weight: 700;
}

.sidebar-nav .nav-content a.active i {
  color: var(--sc-accent-light) !important;
}

/* ---------------------------------------------------------------
   Petits utilitaires réutilisables par les pages (widgets dashboard, etc.)
   --------------------------------------------------------------- */
.sc-elevated {
  border-radius: var(--sc-radius-lg);
  box-shadow: var(--sc-shadow-md);
}

.sc-pill {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  padding: 0.3rem 0.75rem;
  border-radius: 999px;
  font-size: 0.75rem;
  font-weight: 700;
}

/* ---------------------------------------------------------------
   Page de connexion : panneau de marque + panneau formulaire
   --------------------------------------------------------------- */
.auth-shell {
  min-height: 100vh;
  width: 100%;
  display: flex;
  background: var(--sc-bg);
  font-family: 'Inter', sans-serif;
}

.auth-visual {
  position: relative;
  flex: 0 0 44%;
  max-width: 640px;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  padding: 3rem 3.5rem;
  background: linear-gradient(160deg, var(--sc-navy-dark) 0%, var(--sc-navy) 55%, var(--sc-navy-light) 100%);
  color: #ffffff;
  overflow: hidden;
}

.auth-visual-glow {
  position: absolute;
  inset: -20% -20% auto auto;
  width: 480px;
  height: 480px;
  background: radial-gradient(circle, rgba(79, 195, 247, 0.35) 0%, rgba(79, 195, 247, 0) 70%);
  pointer-events: none;
}

.auth-visual::after {
  content: "";
  position: absolute;
  left: -15%;
  bottom: -25%;
  width: 420px;
  height: 420px;
  background: radial-gradient(circle, rgba(255, 255, 255, 0.08) 0%, rgba(255, 255, 255, 0) 70%);
  pointer-events: none;
}

.auth-visual-content {
  position: relative;
  z-index: 1;
  max-width: 420px;
}

.auth-visual-brand {
  display: flex;
  align-items: center;
  gap: 0.9rem;
  margin-bottom: 2.5rem;
}

.auth-visual-logo {
  flex: 0 0 auto;
  width: 56px;
  height: 56px;
  border-radius: 14px;
  background: #ffffff;
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: var(--sc-shadow-md);
}

.auth-visual-logo img {
  width: 70%;
  height: 70%;
  object-fit: contain;
}

.auth-visual-brand-name {
  font-family: 'Nunito', sans-serif;
  font-size: 1.4rem;
  font-weight: 800;
  color: #ffffff;
  letter-spacing: 0.01em;
}

.auth-visual-content h2 {
  font-family: 'Nunito', sans-serif;
  font-size: 1.9rem;
  font-weight: 700;
  line-height: 1.3;
  margin-bottom: 1rem;
  text-wrap: balance;
}

.auth-visual-content p {
  color: rgba(255, 255, 255, 0.78);
  font-size: 0.95rem;
  line-height: 1.6;
  margin-bottom: 2rem;
}

.auth-visual-points {
  list-style: none;
  padding: 0;
  margin: 0;
  display: flex;
  flex-direction: column;
  gap: 1rem;
}

.auth-visual-points li {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  font-size: 0.9rem;
  color: rgba(255, 255, 255, 0.92);
}

.auth-visual-points i {
  flex: 0 0 auto;
  width: 34px;
  height: 34px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 10px;
  background: rgba(255, 255, 255, 0.12);
  color: #ffffff;
  font-size: 1rem;
}

.auth-visual-footer {
  position: relative;
  z-index: 1;
  font-size: 0.8rem;
  color: rgba(255, 255, 255, 0.65);
  display: flex;
  align-items: center;
  gap: 0.4rem;
}

.auth-form-side {
  flex: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 20px;
}

.auth-mobile-header {
  display: none;
}

@media (max-width: 991px) {
  .auth-visual {
    display: none;
  }

  .auth-mobile-header {
    display: block;
  }
}

@media (prefers-reduced-motion: reduce) {
  * {
    transition: none !important;
  }
}
