/* ========== 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 {
  width: 220px;
  background: #192744;
  color: #fff;
  display: flex;
  flex-direction: column;
  align-items: center;
  padding: 2rem 0;
  min-width: 200px;
}
.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;
}
.sidebar nav ul {
  list-style: none;
  padding: 0;
  margin: 0;
  width: 100%;
}
.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;
}

/* ========== MAIN CONTENT ========== */
.main-content {
  flex: 1;
  padding: 2.4rem 6vw 2rem 6vw;
  /* display: flex;
  flex-direction: column; */
  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;
}

/* ========== 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;
}

/* ========== RESPONSIVE ========== */
@media (max-width: 900px) {
  .dashboard-container { flex-direction: column; }
  .sidebar { flex-direction: row; width: 100vw; min-width: 0; padding: 0.7em 1.2em; }
  .sidebar nav ul { display: flex; flex-direction: row; justify-content: center; }
  .sidebar nav li { width: auto; min-width: 100px; justify-content: center; padding: 0.7em 1.2em;}
  .main-content { padding: 1.4em 3vw; }
}

@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;}
}

/* ===== 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%;
  }
}
