/* ========== GLOBALS & RESET ========== */
body {
  font-family: 'Segoe UI', Arial, sans-serif;
  background: #f8f8fa;
  color: #222;
  margin: 0;
}
img { max-width: 100%; display: block; }
a { color: #2060d0; text-decoration: none; }
a:hover { text-decoration: underline; }
.hidden { display: none !important; }

/* ========== DASHBOARD LAYOUT ========== */
.dashboard-container {
  display: flex;
  min-height: 100vh;
  background: #fafbff;
}

/* Sidebar latérale (desktop) */
.sidebar {
  width: 220px;
  background: #192744;
  color: #fff;
  display: flex;
  flex-direction: column;
  align-items: center;
  padding: 2rem 0;
  min-width: 200px;
  position: relative;
  z-index: 10;
  box-shadow: none;
  transition: none;
}
.sidebar .logo {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 100%;
  margin-bottom: 2.2em;
}
.sidebar .logo img {
  width: 74px;
  border-radius: 0.6em;
  background: #fff3;
  padding: 0.2em;
}
/* Navigation */
.sidebar nav {
  width: 100%;
}
.sidebar nav ul {
  list-style: none;
  padding: 0;
  margin: 0;
  width: 100%;
  display: block;
  flex-direction: column;
}
.sidebar nav li, 
.sidebar nav a {
  display: flex;
  align-items: center;
  gap: 0.7em;
  padding: 0.7em 1.2em;
  width: 100%;
  font-size: 1.08em;
  background: none;
  border: none;
  outline: none;
  color: inherit;
  cursor: pointer;
  border-radius: 8px;
  transition: background 0.18s, color 0.18s;
  margin: 0 0 0.3em 0;
  box-sizing: border-box;
}
.sidebar nav li.active,
.sidebar nav li:hover,
.sidebar nav a.active,
.sidebar nav a:hover {
  background: #24335a;
  color: #9ac2fa;
}
.sidebar nav i {
  flex-shrink: 0;
}

/* ===== BURGER BUTTON MODERNE ===== */
.burger-btn {
  display: none;
  background: none;
  border: none;
  cursor: pointer;
}
.burger-btn .burger-bar {
  display: block;
  height: 4px;
  width: 30px;
  background: #24335a;
  margin: 6px auto;
  border-radius: 3px;
  box-shadow: 0 1px 4px #0001;
  transition: all 0.30s cubic-bezier(.77,0,.18,1);
}
.burger-btn.active .burger-bar:nth-child(1) {
  transform: translateY(10px) rotate(45deg);
  background: #2060d0;
}
.burger-btn.active .burger-bar:nth-child(2) {
  opacity: 0;
}
.burger-btn.active .burger-bar:nth-child(3) {
  transform: translateY(-10px) rotate(-45deg);
  background: #2060d0;
}

/* ========== RESPONSIVE - DRAWER MODE ========== */
@media (max-width: 900px) {
  .sidebar {
    position: fixed;
    left: 0; top: 0; bottom: 0;
    width: 234px;
    min-width: unset;
    max-width: 90vw;
    z-index: 1002;
    transform: translateX(-110%);
    transition: transform 0.26s cubic-bezier(.77,0,.18,1);
    box-shadow: 4px 0 24px #0005;
    background: #10192a;
    padding: 2.3em 0 1em 0;
    align-items: flex-start;
    border-top-right-radius: 18px;
    border-bottom-right-radius: 18px;
    display: block;
    height: 100vh;
  }
  .sidebar.open { transform: translateX(0); }
  .sidebar nav { width: 100%; }
  .sidebar nav ul {
    display: block !important;
    flex-direction: column !important;
    width: 100%;
    padding: 0;
    margin: 0;
  }
  .sidebar .logo { width: 100%; margin-bottom: 2.2em; }
  .main-content { margin-left: 0 !important; }
  .burger-btn {
    display: block !important;
    position: fixed;
    top: 18px; left: 10px;
    z-index: 1103;
    background: none;
    border: none;
    width: 48px; height: 48px;
    padding: 0; outline: none;
    border-radius: 15px;
    box-shadow: 0 2px 7px #0001, 0 0.5px 0 #fff4 inset;
    background: #fff8;
    transition: background 0.18s;
  }
  .burger-btn:active, .burger-btn.active { background: #dbeafe; }
  .sidebar:not(.open) nav { display: none; }
}

/* MODE XS */
@media (max-width: 600px) {
  .sidebar .logo { display: none; }
  .sidebar nav li { font-size: 1em; min-width: 70px;}
  .main-content { padding: 0.7em 1vw;}
  #dashboard-title { font-size: 1.25em;}
}

/* ========== MAIN CONTENT, RESTE INCHANGÉ ========== */
.main-content {
  flex: 1;
  padding: 2.4rem 6vw 2rem 6vw;
  min-width: 0;
}
.dashboard-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 2rem;
}
#dashboard-title {
  font-size: 2.1em;
  margin: 0;
}
.account-menu {
  font-size: 1em;
  color: #333;
}
.account-menu button {
  margin-left: 1em;
  background: #eee;
  color: #214077;
  border: none;
  border-radius: 4px;
  padding: 0.45em 1.1em;
  font-size: 1em;
  cursor: pointer;
  transition: background .2s;
}
.account-menu button:hover {
  background: #ccd8ea;
  color: #1a2e54;
}
/* ========== SECTION VISIBILITY ========== */
.dashboard-section {
  display: block;
  margin-bottom: 2.5em;
}
.dashboard-section.hidden {
  display: none !important;
}
/* ========== FACTURES TABLEAU ========== */
#factures-table-container table {
  width: 100%;
  border-collapse: collapse;
  margin-bottom: 2em;
  background: #fff;
  border-radius: 10px;
  overflow: hidden;
  box-shadow: 0 2px 20px #0001;
}
#factures-table-container h3 {
  background: #f7faff;
  color: #225;
  padding: 0.7em 1em 0 0;
  margin: 2.2em 0 0.7em 0;
  font-weight: normal;
  font-size: 1.18em;
}
#factures-table-container th, #factures-table-container td {
  padding: 1.1em 0.9em;
  text-align: left;
}
#factures-table-container tr:nth-child(even) {
  background: #f8f9fb;
}
.facture-download {
  color: #456efd;
  font-size: 1.3em;
  cursor: pointer;
  transition: color 0.14s;
}
.facture-download:hover {
  color: #233473;
}
/* ========== FORM & BOUTONS (DASHBOARD UNIQUEMENT!) ========== */
form label {
  display: block; margin-bottom: 18px; font-weight: 500;
}
form input[type="text"], form input[type="email"] {
  width: 100%;
  margin-top: 0.5em;
  background: #fafdfe;
  border-radius: 5px;
  padding: 0.65em;
  border: 1px solid #c4ceee;
  font-size: 1em;
  box-sizing: border-box;
}
form input[readonly] { background: #eef1f3; color: #666; }
form button,
.primary {
  background: #2d62fb;
  color: #fff;
  font-weight: bold;
  border: none;
  border-radius: 6px;
  padding: 0.74em 1.3em;
  margin-top: 0.9em;
  font-size: 1em;
  cursor: pointer;
  transition: background 0.2s, color 0.2s;
}
form button:hover,
.primary:hover {
  background: #1745a3;
}
.danger {
  background: #f85b5b;
  color: #fff;
  border: none;
  border-radius: 6px;
  padding: 0.74em 1.3em;
  font-size: 1em;
  cursor: pointer;
  transition: background 0.2s;
}
.danger:hover { background: #ba1a1a; }

/* ========== ABONNEMENT SECTION ========== */
.abo-info {
  display: flex;
  gap: 1em;
  align-items: center;
  margin: 1.5em 0 0.5em 0;
  flex-wrap: wrap;
}

/* ===== CHATBOT CUSTOM LAYOUT ===== */
#chatbot-flex-row {
  display: flex;
  flex-direction: row;
  align-items: flex-start;
  gap: 2.6em;
  width: 100%;
  margin: 0;
  box-sizing: border-box;
}
#chatbot-config-form {
  flex: 1 1 360px;
  min-width: 340px;
  max-width: 500px;
  margin: 0;
}
#chatbot-preview-container {
  flex: 1 1 320px;
  min-width: 300px;
  max-width: 440px;
  margin: 0;
}
@media (max-width: 1000px) {
  #chatbot-flex-row {
    flex-direction: column;
    gap: 1.4em;
  }
  #chatbot-config-form, #chatbot-preview-container {
    max-width: 100% !important;
    min-width: 0 !important;
    width: 100%;
  }
}


.commande-card {
  background: #fff;
  padding: 1.15em 1em;
  border-radius: 18px;
  box-shadow: 0 1px 8px #0002;
  margin-bottom: 1.6em;
  font-size: 1.12em;
  transition: box-shadow 0.18s;
  position: relative;
}
.commandes-actions-row {
  display: flex;
  gap: 0.85em;
  margin-top: 1.1em;
  justify-content: flex-start;
}
.btn-cmd {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 56px;
  height: 56px;
  border: none;
  border-radius: 15px;
  font-size: 2.1em;
  background: #e5eafc;
  color: #192744;
  transition: background 0.17s, color 0.17s, box-shadow 0.19s;
  box-shadow: 0 1px 4px #0001;
  cursor: pointer;
  outline: none;
  touch-action: manipulation;
}
.btn-accept    { background: #22ce72; color: #fff; }
.btn-accept:hover, .btn-accept:focus { background: #169945; color: #fff; }
.btn-refuse    { background: #f75c5c; color: #fff; }
.btn-refuse:hover, .btn-refuse:focus { background: #ba2222; color: #fff; }
.btn-modif-hr  { background: #ffe399; color: #a97c13; }
.btn-modif-hr:hover, .btn-modif-hr:focus { background: #ffd047; color: #784c02;}

@media (max-width: 640px) {
  .commandes-actions-row {
  display: flex;
  gap: 1em;
  margin-top: 1.1em;
  justify-content: flex-start;
}
.btn-cmd {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 60px;
  height: 60px;
  border: none;
  border-radius: 16px;
  background: #e5eafc;
  font-size: 2.25em;
  color: #192744;
  transition: background 0.17s, color 0.17s, box-shadow 0.19s;
  box-shadow: 0 1px 4px #0001;
  cursor: pointer;
  outline: none;
  touch-action: manipulation;
  padding: 0;
}
.btn-cmd i { 
  font-size: 1em !important;
  /* On gardera la couleur forcée en mobile via css ci-dessous */
}

/* Couleur par bouton, cible explicitement l'icône */
.btn-accept      { background: #22ce72; }
.btn-accept i    { color: #fff !important; }
.btn-refuse      { background: #f75c5c; }
.btn-refuse i    { color: #fff !important; }
.btn-modif-hr    { background: #ffe399; }
.btn-modif-hr i  { color: #a97c13 !important; }

.btn-accept:hover, .btn-accept:focus { background: #169945; }
.btn-refuse:hover, .btn-refuse:focus { background: #ba2222; }
.btn-modif-hr:hover, .btn-modif-hr:focus { background: #ffd047; }

@media (max-width: 700px) {
  .commandes-actions-row {
    gap: 0.7em;
    justify-content: center;
  }
  .btn-cmd {
    width: 58px;
    height: 58px;
    border-radius: 14px;
    font-size: 2.2em;
  }
}
@media (max-width: 530px) {
  .btn-cmd      { width: 96vw !important; max-width: 110px; height: 54px; font-size: 2em;}
  .commandes-actions-row { gap: 0.5em; }
}
@media (max-width: 390px) {
  .btn-cmd { min-width: 39vw !important; max-width: 88px; height: 44px; font-size: 1.7em;}
}
  .commande-card {
    padding: 1em 0.6em;
    font-size: 1em;
  }
}

#switch-vue-btn {
  font-size: 1.13em;
  padding: 0.5em 1.2em;
  border-radius: 10px;
  background: #fafdfe;
  color: #1e223a !important;
  border: 1.5px solid #1e59d9;
  margin-left: 1.4em;
  transition: background 0.18s;
}
#switch-vue-btn:hover, #switch-vue-btn.active {
  background: #eaefff;
  color: #144a88 !important;
}

.btn-payer      { background: #51e2d6; }
.btn-payer i    { color: #075568 !important; }
.btn-payer:hover, .btn-payer:focus { background: #19b4a2; }
.carte-actions {
  display: flex;
  gap: 1.3em;
  margin-top: 1em;
  justify-content: center;
}
.btn-cmd {
  width: 56px;
  height: 56px;
  border-radius: 13px;
  font-size: 2em;
  display: flex;
  align-items: center;
  justify-content: center;
}
@media (max-width: 512px) {
  .carte-actions { gap: 0.5em; }
  .btn-cmd { width: 44px; height: 44px; font-size: 1.28em; border-radius: 8px; }
}

.badge-horaire {
  display: inline-flex;
  align-items: center;
  padding: 0.42em 1.28em;
  border-radius: 32px;
  font-size: 1.48em;
  font-weight: bold;
  background: #f4f6fa;  /* gris clair, adapte si tu veux! */
  color: #1b223a;
  box-shadow: 0 1px 8px #0001;
  margin-bottom: 0.14em;
}
.badge-horaire i {
  margin-right: 0.65em;
  font-size: 1.10em;
  color: #5166d2;
}
@media (max-width: 600px) {
  .badge-horaire {
    font-size: 1.24em;
    padding: 0.38em 0.7em;
  }
}
.badge-horaire-stack {
  display: inline-flex;
  flex-direction: column;
  align-items: flex-end;
  position: relative;
  padding-bottom: 0.65em;
  /* conserve le design général */
}
.badge-horaire-stack .horaire-main {
  font-size: 1.13em;
  font-weight: bold;
  color: #1b223a;
}
.badge-horaire-stack .mini-heure {
  display: block;
  font-size: 0.50em;
  color: #8ea0c4;
  margin: 0.06em 0.08em 0 0;
}
.badge-num {
  display: inline-block;
  font-size: 1.45em;
  font-weight: bold;
  color: #23539b;
  background: linear-gradient(90deg, #d1eaff 60%, #93c5fd 100%);
  box-shadow: 0 1px 7px #b0cbfa77;
  padding: 0.45em 1.5em 0.45em 1.4em;
  border-radius: 2.7em;
  letter-spacing: 0.03em;
  margin-right: 0.95em;
  margin-bottom: 0.1em;
}
@media (max-width: 600px) {
  .badge-num {
    font-size: 1.1em;
    padding: 0.23em 0.9em 0.23em 0.85em;
  }
}
.carte-detail-produits {
  text-align: center;
}

.ligne-produit {
  display: block;
  text-align: center;
  font-size: 1.26em;
  margin-bottom: 0.38em;
  word-break: break-word;
}

.prod-remarque {
  color: #ec9706;
  font-style: italic;
  font-size: 1em;
  margin-left: 0.3em;
}

.carte-total {
  display: flex;
  gap: 0.9em;
  align-items: center;
  justify-content: center;
  font-size: 1.18em;
  margin: 1.1em 0 0.3em 0;
}

.total-prix-bulle {
  display: inline-block;
  background: linear-gradient(90deg, #e0fdc3 70%, #96ffac 100%);
  color: #228C44;
  font-weight: bold;
  font-size: 1.53em;
  border-radius: 2em;
  padding: 0.33em 1.42em 0.33em 1.3em;
  box-shadow: 0 1px 9px #81e88a39;
  letter-spacing: 0.02em;
  transition: background 0.16s, color 0.17s;
}

@media (max-width: 600px) {
  .carte-total { font-size: 1.03em; }
  .total-prix-bulle { font-size: 1.13em; padding: 0.23em 0.8em 0.23em 0.7em; }
}

.dashboard-header h1#dashboard-title {
  flex: 1 1 100%;
  text-align: center;
  justify-content: center;
  align-self: center;
  margin: 0 auto 1em auto;
}

#commandes-etat-switcher {
  margin-bottom: 2.2em;
  gap: 1.34em;
}
.etat-switch-btn {
  min-width: 125px;
  font-size: 1.16em;
  padding: .65em 1.1em;
  font-weight: bold;
  border-radius: 25px;
  transition: background .14s, color .14s;
}
.etat-switch-btn.active {
  background: #123b71;
  color: #fff !important;
  border: 2.5px solid #123b71 !important;
}
@media (max-width:700px) {
  #commandes-etat-switcher { flex-wrap: wrap; gap: .4em; }
  .etat-switch-btn { font-size: 1em; min-width: 94px; padding: .49em 0.8em;}
}

#baby-palette-couleurs {
  gap: 1em;
}
#baby-palette-couleurs > div {
  display: flex;
  gap: 1.1em;
}
#baby-palette-couleurs label {
  font-size: 0.97em;
}
@media (max-width: 600px) {
  #baby-palette-couleurs > div {
    gap: 0.5em;
  }
}

/* Couleur verte douce quand actif */
.form-switch .form-check-input:checked {
  background-color: #52c176 !important; /* Vert pastel/menthe */
  border-color: #52c176 !important;
  box-shadow: 0 0 0 0.10rem rgba(82, 193, 118, 0.21);
}
/* Couleur rouge douce quand inactif */
.form-switch .form-check-input:not(:checked) {
  background-color: #f2c6c6; /* Rouge pâle */
  border-color: #e89b9b;
  box-shadow: 0 0 0 0.10rem rgba(232, 155, 155, 0.21);
}