/* ===========================================================
   🎨 SALON-APP - THEME GLOBAL
   Version : 1.0
   Auteur  : Projet Salon-App (XAMPP)
   =========================================================== */

/* 🌈 Variables de thème */
:root {
  --primary: #111;
  --accent: #e91e63;
  --muted: #777;
  --ok: #1b9e3c;
  --warn: #d9822b;
  --err: #c0392b;
  --bg: #f6f8fb;
  --text: #2c3e50;
  --white: #fff;
  --shadow: rgba(0,0,0,0.08);
}

/* ⚙️ Base */
* { box-sizing: border-box; }

body {
  margin: 0;
  font-family: system-ui, -apple-system, 'Segoe UI', Roboto, Arial, sans-serif;
  background: var(--bg);
  color: var(--text);
}

/* HEADER & FOOTER */
header, footer {
  background: var(--white);
  border-bottom: 1px solid #eee;
  padding: 12px 20px;
}

/* MAIN */
main {
  max-width: 1100px;
  margin: 20px auto;
  padding: 0 20px;
}

/* TITRES */
h1 {
  margin: 12px 0 18px;
  font-weight: 600;
  color: var(--primary);
}

/* ===========================================================
   🧩 TABLES
   =========================================================== */
.table {
  width: 100%;
  background: var(--white);
  border-collapse: collapse;
  border-radius: 12px;
  overflow: hidden;
  box-shadow: 0 4px 12px var(--shadow);
}

.table th, .table td {
  padding: 12px 14px;
  border-bottom: 1px solid #f0f0f0;
  font-size: 14px;
}

.table th {
  text-align: left;
  background: #fafafa;
  color: #444;
  font-weight: 600;
}

.table tr:hover {
  background: #fdf1f4;
  transition: background 0.2s ease;
}

/* ===========================================================
   🔖 BADGES
   =========================================================== */
.badge {
  padding: 4px 8px;
  border-radius: 999px;
  font-size: 12px;
  display: inline-block;
  font-weight: 600;
}
.badge.pending   { background: #fff5cc; color: #7a5b00; }
.badge.confirmed { background: #e6fff0; color: #165a2c; }
.badge.cancelled { background: #ffeaea; color: #8a1f1f; }
.badge.no_show   { background: #f0f0f0; color: #555; }

/* ===========================================================
   💬 FLASH MESSAGES
   =========================================================== */
.flash {
  margin: 12px 0;
  padding: 12px 14px;
  border-radius: 8px;
  font-size: 14px;
  border: 1px solid transparent;
}

.flash.success {
  background: #e6fff0;
  color: #165a2c;
  border-color: #bfe9cf;
}

.flash.error {
  background: #ffeaea;
  color: #8a1f1f;
  border-color: #f1c1c1;
}

.flash.info {
  background: #eaf2ff;
  color: #113c8b;
  border-color: #bdd1f9;
}

/* ===========================================================
   🧾 FORMULAIRES
   =========================================================== */
.form-inline {
  display: flex;
  gap: 8px;
  align-items: center;
}

select, button {
  padding: 8px 10px;
  border: 1px solid #ddd;
  border-radius: 8px;
  background: var(--white);
  font-size: 14px;
}

button.primary {
  background: linear-gradient(90deg, #e91e63, #f06292);
  color: #fff;
  border: none;
  padding: 8px 16px;
  border-radius: 12px;
  transition: all 0.2s ease;
  cursor: pointer;
}

button.primary:hover {
  transform: translateY(-2px);
  box-shadow: 0 4px 10px rgba(0,0,0,0.2);
}

/* ===========================================================
   🧭 LAYOUT GLOBAL (Sidebar + Topbar)
   =========================================================== */
.dashboard-container {
  display: flex;
  min-height: 100vh;
}

/* SIDEBAR */
.sidebar {
  background: #1f2937;
  color: var(--white);
  width: 230px;
  padding: 20px;
  display: flex;
  flex-direction: column;
}

.sidebar .logo {
  font-size: 1.3em;
  font-weight: bold;
  margin-bottom: 20px;
}

.sidebar .nav a {
  display: block;
  color: #d1d5db;
  text-decoration: none;
  margin: 10px 0;
  padding: 10px 12px;
  border-radius: 8px;
  transition: 0.2s;
}

.sidebar .nav a:hover {
  background: #374151;
  color: #fff;
}

/* MAIN CONTENT */
.main-content {
  flex-grow: 1;
  display: flex;
  flex-direction: column;
}

.topbar {
  background: var(--white);
  border-bottom: 1px solid #e5e7eb;
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 12px 20px;
}

.user-info {
  color: #4b5563;
  font-size: 0.9em;
}

.logout-btn {
  background: #e11d48;
  color: #fff;
  padding: 8px 14px;
  border-radius: 8px;
  text-decoration: none;
  transition: 0.2s;
}

.logout-btn:hover {
  background: #be123c;
}

/* CONTENT */
.content {
  padding: 20px;
}

/* ===========================================================
   📱 RESPONSIVE
   =========================================================== */
@media (max-width: 768px) {
  .sidebar {
    width: 180px;
    font-size: 0.9em;
  }
  .content {
    padding: 12px;
  }
}
/* ===========================================================
   🌙 THEME SOMBRE / CLAIR
   =========================================================== */

/* Mode clair (par défaut) */
:root {
  --bg: #f6f8fb;
  --text: #2c3e50;
  --sidebar-bg: #1f2937;
  --sidebar-link: #d1d5db;
  --sidebar-hover: #374151;
  --card-bg: #ffffff;
  --table-bg: #ffffff;
  --topbar-bg: #ffffff;
}

/* Mode sombre */
html[data-theme="dark"] {
  --bg: #111827;
  --text: #e5e7eb;
  --sidebar-bg: #000000;
  --sidebar-link: #9ca3af;
  --sidebar-hover: #374151;
  --card-bg: #1f2937;
  --table-bg: #1f2937;
  --topbar-bg: #1f2937;
  --accent: #f472b6;
}

/* Appliquer les variables */
body {
  background: var(--bg);
  color: var(--text);
}

.sidebar {
  background: var(--sidebar-bg);
}

.sidebar .nav a {
  color: var(--sidebar-link);
}

.sidebar .nav a:hover {
  background: var(--sidebar-hover);
  color: #fff;
}

.topbar {
  background: var(--topbar-bg);
}

.table, .card {
  background: var(--table-bg);
}

/* Bouton toggle */
.theme-toggle {
  background: var(--accent);
  color: #fff;
  border: none;
  padding: 6px 10px;
  border-radius: 6px;
  cursor: pointer;
  font-size: 0.9em;
  margin-left: 10px;
  transition: 0.2s;
}
.theme-toggle:hover {
  opacity: 0.85;
}
/* ===========================================================
   🔔 NOTIFICATIONS
   =========================================================== */
.notif-wrapper {
  position: relative;
}

.notif-dot {
  position: absolute;
  top: 2px;
  right: 2px;
  width: 10px;
  height: 10px;
  background: #e11d48;
  border-radius: 50%;
  animation: pulse 1.5s infinite;
}

@keyframes pulse {
  0% { transform: scale(1); opacity: 1; }
  50% { transform: scale(1.3); opacity: 0.5; }
  100% { transform: scale(1); opacity: 1; }
}

.notif-panel {
  position: absolute;
  right: 0;
  top: 40px;
  background: var(--card-bg, #fff);
  box-shadow: 0 2px 10px rgba(0,0,0,0.2);
  border-radius: 8px;
  width: 260px;
  z-index: 10;
}

.notif-header {
  padding: 8px 12px;
  font-weight: bold;
  border-bottom: 1px solid #eee;
}

#notifList {
  list-style: none;
  margin: 0;
  padding: 0;
  max-height: 260px;
  overflow-y: auto;
}

#notifList li {
  padding: 8px 12px;
  border-bottom: 1px solid #f2f2f2;
  font-size: 0.9em;
}

#notifList li.empty {
  text-align: center;
  color: #888;
  font-style: italic;
}
.muted { color: var(--muted); font-size: 12px; }
input[type="text"], input[type="email"], input[type="number"], input[type="password"], textarea {
  width: 100%; padding: 10px; border:1px solid #ddd; border-radius: 8px; background:#fff; margin-top:6px;
}
label { font-weight: 600; display:block; }
form .muted code { background:#f3f4f6; padding:2px 6px; border-radius:6px; }

h2 { margin-top: 24px; font-size: 20px; color: var(--primary); }
.table td select { font-size: 12px; }
