@charset "UTF-8";

/* ================================
   GLOBAL (thème pastel)
================================ */
html,
body {
    height: 100%;
    margin: 0;
    display: flex;
    flex-direction: column;
    font-family: "Segoe UI", system-ui, -apple-system, Arial, sans-serif;
}

body {
    background: #eef4ff;
    /* bleu pastel doux */
}

/* Liens utilitaires (icônes) */
a.btn-edit,
a.btn-delete,
a.btn-duplicate,
a i {
    text-decoration: none !important;
}

/* ================================
   HEADER / FOOTER
================================ */
header,
footer {
    background: linear-gradient(180deg, #0d6efd, #0a58ca);
    /* même que la sidebar */
    color: white;
    padding: 10px 20px;
    font-weight: 500;
}

/* ================================
   LOGIN
================================ */
.login-page {
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  /* fond doux */
  background: radial-gradient(1200px 600px at 50% -20%, #cfe3ff 0%, transparent 60%), #eef5ff;
}

.login-card {
  width: 480px;
  border-radius: 12px;
  overflow: hidden; /* pour arrondir aussi l'en-tête */
  box-shadow: 0 10px 30px rgba(13, 110, 253, .15);
}

.login-card .card-header {
  background: linear-gradient(135deg, #0d6efd, #0a58ca);
  color: #fff;
  padding: 14px 18px;
}

.login-card .card-body {
  background: #ffffff; /* garantit un fond blanc sous les labels */
}

.login-card .form-label {
  color: #0b2244;      /* contraste élevé */
  font-weight: 600;
}

.login-card .form-control {
  background: #fff;
}

.login-card .btn-primary {
  background: #0d6efd;
  border-color: #0d6efd;
}

.login-icon {
  font-size: 3rem;
  color: #0d6efd;
  display: block;
  text-align: center;
  margin-bottom: 12px;
}

/* ================================
   LAYOUT / CONTENT
================================ */
.content {
    flex: 1;
    padding: 20px;
    background: transparent;
}

/* Zone centrale (certaines pages) */
#main_affichage {
    flex: 1;
    background: transparent;
    display: flex;
    align-items: flex-start;
    justify-content: center;
    padding: 20px;
    margin-top: 20px;
}

#main_affichage .container {
    max-width: 600px;
    text-align: center;
}

/* ================================
   CARDS & TABLES look & feel
================================ */
.card {
    border: 0;
    border-radius: 16px;
    box-shadow: 0 4px 14px rgba(13, 110, 253, .08);
    background: #fff;
}

.card-header {
    background: linear-gradient(180deg, #ffffff, #f6faff);
    border-bottom: 1px solid #e6eefc;
    border-radius: 16px 16px 0 0 !important;
}

.table thead.table-light th {
    background: #f3f7ff !important;
    border-bottom: 1px solid #e6eefc !important;
}

table.table td,
table.table th {
    vertical-align: middle;
}

/* Badges plus “vifs” mais lisibles sur pastel */
.badge.bg-success {
    background-color: #16a34a !important;
}

.badge.bg-danger {
    background-color: #dc2626 !important;
}

.badge.bg-warning {
    background-color: #f59e0b !important;
}

.badge.bg-info {
    background-color: #0ea5e9 !important;
}

/* Boutons arrondis */
.btn {
    border-radius: 10px;
}

/* ================================
   SIDEBAR (nouvelle version)
================================ */
nav {
    background-color: #001f3f;
}

nav a.nav-link {
    padding: 6px 12px;
    border-radius: 6px;
}

nav a.nav-link:hover,
nav a.nav-link.active {
    background-color: #0d6efd;
    color: #fff !important;
}

.text-info {
    color: #0dcaf0 !important;
}

/* Nouveau composant sidebar-wrapper (cf. includes/sidebar.php V2) */
.sidebar-wrapper {
  position: sticky;
  top: 56px; /* hauteur du header */
  left: 0;
  z-index: 1020;

  width: 260px !important;
  min-width: 260px !important;
  max-width: 260px !important;
  flex: 0 0 260px !important;

  height: calc(100vh - 56px);
  background: linear-gradient(180deg, #0d6efd, #0a58ca);
  color: #fff;

  transform: translateX(0);
  transition: transform .2s ease;
  border-right: 1px solid rgba(255,255,255,.15);
}

.sidebar-section+.sidebar-section {
    border-top: 1px solid rgba(255, 255, 255, .15);
}

.sidebar-title {
    padding: .75rem 1rem;
    font-size: .9rem;
    text-transform: uppercase;
    opacity: .9;
    letter-spacing: .04em;
    display: flex;
    align-items: center;
    justify-content: space-between;
    cursor: pointer;
}

.sidebar-title .chev {
    transition: transform .2s ease;
    opacity: .85;
}

.sidebar-title.collapsed .chev {
    transform: rotate(-90deg);
}

.sidebar-items {
    padding-bottom: .5rem;
}

.sidebar-item {
    display: flex;
    align-items: center;
    gap: .5rem;
    padding: .55rem 1rem;
    font-size: .95rem;
    color: #e9f2ff;
    text-decoration: none;
    border-left: 3px solid transparent;
}

.sidebar-item i {
    width: 18px;
    text-align: center;
    opacity: .95;
}

.sidebar-item:hover {
    background: rgba(255, 255, 255, .08);
}

.sidebar-item.active {
    background: rgba(255, 255, 255, .18);
    border-left-color: #ffc107;
    color: #fff;
    font-weight: 600;
}

/* ==== LAYOUT SIDEBAR + CONTENU (corrigé) ==== */

/* Sidebar fixe à gauche */
.sidebar {
  width: 260px;
  min-height: 100vh;
  background: #fff;
  border-right: 1px solid #e5e7eb;
  position: sticky;
  top: 0;
  left: 0;
  z-index: 1020;
  transition: transform .2s ease;
}

/* Contenu : prend tout l’espace restant */
.content {
  flex: 1 1 auto;
  min-width: 0;
  padding: 20px;
  background: transparent;
  transition: margin-left .2s ease;
}

/* Masquer/afficher la sidebar */
body.sidebar-hidden .sidebar { transform: translateX(-100%); }
body.sidebar-hidden .content { margin-left: 0; }

/* Chevron animé pour les collapses */
.sidebar .nav-link[aria-expanded="true"] .fa-chevron-down {
  transform: rotate(180deg);
  transition: transform .2s ease;
}

/* Comportement mobile */
@media (max-width: 991.98px) {
  .sidebar {
    position: fixed;
    height: 100vh;
    transform: translateX(-100%);
  }
  body.sidebar-hidden .sidebar { transform: translateX(-100%); }
  body:not(.sidebar-hidden) .sidebar { transform: translateX(0); }
}

/* ================================
   DATATABLES (skin pastel)
================================ */
.dataTables_wrapper .dataTables_length,
.dataTables_wrapper .dataTables_filter {
    margin: .75rem 0;
}

.dataTables_wrapper .dataTables_filter input {
    border-radius: 10px;
    border: 1px solid #cbd8ff;
    background: #fff;
}

table.dataTable tbody tr:hover {
    background-color: #f7faff !important;
}

table.dataTable thead th,
table.dataTable tfoot th {
    border-bottom: 2px solid #e6eefc !important;
}

/* Pagination plus douce */
.dataTables_wrapper .dataTables_paginate .paginate_button {
    border-radius: 8px !important;
    border: 1px solid transparent !important;
}

.dataTables_wrapper .dataTables_paginate .paginate_button:hover {
    background: #e9f1ff !important;
    border-color: #cbd8ff !important;
}

/* ================================
   PETITS PLUS
================================ */
.nowrap {
    white-space: nowrap;
}

.table-warning {
    transition: background-color .3s ease;
}
/* === Overrides Sidebar sombre (prend le dessus) === */
.sidebar {
  background: linear-gradient(180deg, #0d6efd, #0a58ca) !important;
  color: #fff !important;
}
.sidebar-item {
  color: #e9f2ff !important;
}
.sidebar-item:hover {
  background: rgba(255,255,255,.08) !important;
}
.sidebar-item.active {
  background: rgba(255,255,255,.18) !important;
  border-left-color: #ffc107 !important;
  color: #fff !important;
}
/* ==== Sidebar V2 (fonction toggle) ==== */
.sidebar-wrapper{
  width:260px;
  /* si ton header fait ~56px */
  position: sticky;
  top:56px;
  left:0;
  z-index:1020;
  transform: translateX(0);
  transition: transform .2s ease;
}

/* Mode sidebar masquée (piloté par le bouton) */
body.sidebar-hidden .sidebar-wrapper{
  transform: translateX(-100%);
  position: fixed; /* évite de décaler le layout pendant l'animation */
}

/* Si tu utilises un layout sans marge-left (flex), rien à faire ici.
   Si AU CONTRAIRE tu avais donné une marge au contenu, ajoute la règle suivante : */
/* .content{ margin-left:260px; transition: margin-left .2s ease; }
   body.sidebar-hidden .content{ margin-left:0; } */
   /* Entêtes de carte – lisibles partout */
.card-header {
  background: #f7faff;                 /* clair par défaut */
  border-bottom: 1px solid #e6eefc;
  border-radius: 16px 16px 0 0 !important;
  color: #0b2244;                      /* texte sombre => lisible */
}
.card-header .card-title,
.card-header h4,
.card-header h5 {
  margin: 0;
  font-weight: 600;
  color: #0b2244;                      /* force la couleur du titre */
}

/* Variante sombre optionnelle (si besoin ponctuel) */
.card-header-dark {
  background: linear-gradient(180deg, #0d6efd, #0a58ca);
  color: #fff;
  border-bottom-color: rgba(255,255,255,.25);
}
.card-header-dark .card-title,
.card-header-dark h4,
.card-header-dark h5 {
  color: #fff;
}