/* ===== MAABO FASTFOOD — GLOBAL STYLES ===== */
/* Police: Aptos (Microsoft 365 / Windows 11 préinstallé) */

:root {
  /* Brand Palette */
  --red:        #E53935;
  --red-dark:   #B71C1C;
  --red-light:  #FF6B6B;
  --red-glow:   rgba(229, 57, 53, 0.15);
  --black:      #121212;
  --black-2:    #1E1E1E;
  --black-3:    #2A2A2A;
  --white:      #FFFFFF;
  --gray-light: #F5F5F5;
  --gray-100:   #EEEEEE;
  --gray-200:   #E0E0E0;
  --gray-400:   #BDBDBD;
  --gray-600:   #757575;
  --gray-800:   #424242;

  /* Status */
  --success:    #2E7D32;
  --success-bg: #E8F5E9;
  --warning:    #F57F17;
  --warning-bg: #FFFDE7;
  --info:       #1565C0;
  --info-bg:    #E3F2FD;
  --danger:     #C62828;
  --danger-bg:  #FFEBEE;

  /* Typography */
  --font-display: 'Aptos', 'Aptos Display', 'Segoe UI', system-ui, sans-serif;
  --font-body:    'Aptos', 'Aptos Text', 'Segoe UI', system-ui, -apple-system, BlinkMacSystemFont, sans-serif;

  /* Spacing */
  --sidebar-w: 260px;
  --radius-sm:  6px;
  --radius-md:  12px;
  --radius-lg:  20px;
  --radius-xl:  28px;

  /* Shadows */
  --shadow-sm:  0 1px 3px rgba(0,0,0,0.08), 0 1px 2px rgba(0,0,0,0.06);
  --shadow-md:  0 4px 16px rgba(0,0,0,0.10);
  --shadow-lg:  0 8px 32px rgba(0,0,0,0.14);
  --shadow-red: 0 4px 20px rgba(229,57,53,0.3);

  /* Transitions */
  --transition: all 0.22s cubic-bezier(0.4, 0, 0.2, 1);
}

*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

html { font-size: 16px; scroll-behavior: smooth; }

body {
  font-family: var(--font-body);
  background: var(--gray-light);
  color: var(--black);
  line-height: 1.5;
  min-height: 100vh;
  -webkit-font-smoothing: antialiased;
}

/* ===== SIDEBAR ===== */
.sidebar {
  position: fixed;
  top: 0; left: 0;
  width: var(--sidebar-w);
  height: 100vh;
  background: var(--black);
  display: flex;
  flex-direction: column;
  z-index: 100;
  transition: var(--transition);
  overflow: hidden;
}

.sidebar-logo {
  padding: 28px 24px 20px;
  border-bottom: 1px solid rgba(255,255,255,0.06);
}

.sidebar-logo .brand {
  display: flex;
  align-items: center;
  gap: 12px;
  text-decoration: none;
}

.sidebar-logo .logo-icon {
  width: 40px; height: 40px;
  background: var(--red);
  border-radius: var(--radius-sm);
  display: flex; align-items: center; justify-content: center;
  font-size: 20px;
  box-shadow: var(--shadow-red);
  flex-shrink: 0;
}

.sidebar-logo .brand-name {
  font-family: var(--font-display);
  font-size: 18px;
  font-weight: 700;
  color: var(--white);
  line-height: 1.1;
}

.sidebar-logo .brand-sub {
  font-size: 10px;
  font-weight: 500;
  color: var(--red);
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.sidebar-nav {
  flex: 1;
  padding: 16px 0;
  overflow-y: auto;
  scrollbar-width: none;
}

.sidebar-nav::-webkit-scrollbar { display: none; }

.nav-section-label {
  font-size: 10px;
  font-weight: 600;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--gray-600);
  padding: 12px 24px 6px;
}

.nav-item {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 11px 24px;
  color: var(--gray-400);
  text-decoration: none;
  font-size: 14px;
  font-weight: 500;
  border-radius: 0;
  transition: var(--transition);
  position: relative;
  cursor: pointer;
}

.nav-item:hover {
  color: var(--white);
  background: rgba(255,255,255,0.05);
}

.nav-item.active {
  color: var(--white);
  background: rgba(229,57,53,0.12);
}

.nav-item.active::before {
  content: '';
  position: absolute;
  left: 0; top: 50%;
  transform: translateY(-50%);
  width: 3px; height: 28px;
  background: var(--red);
  border-radius: 0 3px 3px 0;
}

.nav-item .nav-icon {
  font-size: 18px;
  width: 22px;
  text-align: center;
  flex-shrink: 0;
}

.nav-item .nav-badge {
  margin-left: auto;
  background: var(--red);
  color: var(--white);
  font-size: 10px;
  font-weight: 700;
  padding: 2px 7px;
  border-radius: 20px;
}

.sidebar-footer {
  padding: 16px 24px;
  border-top: 1px solid rgba(255,255,255,0.06);
}

.sidebar-user {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px;
  border-radius: var(--radius-md);
  cursor: pointer;
  transition: var(--transition);
}

.sidebar-user:hover { background: rgba(255,255,255,0.05); }

.user-avatar {
  width: 36px; height: 36px;
  background: var(--red);
  border-radius: 50%;
  display: flex; align-items: center; justify-content: center;
  font-weight: 700;
  color: var(--white);
  font-size: 14px;
  flex-shrink: 0;
}

.user-info .user-name {
  font-size: 13px;
  font-weight: 600;
  color: var(--white);
}

.user-info .user-role {
  font-size: 11px;
  color: var(--gray-600);
}

/* ===== MAIN LAYOUT ===== */
.main-content {
  margin-left: var(--sidebar-w);
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}

.topbar {
  background: var(--white);
  padding: 0 32px;
  height: 64px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  border-bottom: 1px solid var(--gray-200);
  position: sticky;
  top: 0;
  z-index: 50;
  box-shadow: var(--shadow-sm);
}

.topbar-left { display: flex; align-items: center; gap: 16px; }
.topbar-right { display: flex; align-items: center; gap: 12px; }

.page-title {
  font-family: var(--font-display);
  font-size: 18px;
  font-weight: 700;
  color: var(--black);
}

.topbar-btn {
  width: 38px; height: 38px;
  border-radius: var(--radius-sm);
  background: var(--gray-light);
  border: 1px solid var(--gray-200);
  display: flex; align-items: center; justify-content: center;
  cursor: pointer;
  font-size: 16px;
  transition: var(--transition);
  text-decoration: none;
  color: var(--black);
  position: relative;
}

.topbar-btn:hover { background: var(--gray-100); }

.notif-dot {
  position: absolute;
  top: 6px; right: 6px;
  width: 8px; height: 8px;
  background: var(--red);
  border-radius: 50%;
  border: 2px solid var(--white);
}

.notif-count {
  position: absolute;
  top: -3px; right: -6px;
  min-width: 18px;
  height: 18px;
  padding: 0 5px;
  background: var(--red);
  color: #FFFFFF;
  border-radius: 999px;
  font-size: 10px;
  font-weight: 800;
  line-height: 18px;
  display: none;
  box-shadow: 0 2px 6px rgba(229, 57, 53, 0.4);
}

.page-body {
  padding: 28px 32px;
  flex: 1;
}

/* ===== CARDS ===== */
.card {
  background: var(--white);
  border-radius: var(--radius-lg);
  padding: 24px;
  box-shadow: var(--shadow-sm);
  border: 1px solid var(--gray-200);
}

.card-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 20px;
}

.card-title {
  font-family: var(--font-display);
  font-size: 15px;
  font-weight: 700;
  color: var(--black);
}

/* ===== BUTTONS ===== */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 10px 20px;
  border-radius: var(--radius-sm);
  font-family: var(--font-body);
  font-size: 14px;
  font-weight: 600;
  cursor: pointer;
  transition: var(--transition);
  border: none;
  outline: none;
  text-decoration: none;
  white-space: nowrap;
}

.btn-primary {
  background: var(--red);
  color: var(--white);
  box-shadow: var(--shadow-red);
}

.btn-primary:hover {
  background: var(--red-dark);
  box-shadow: 0 6px 24px rgba(229,57,53,0.4);
  transform: translateY(-1px);
}

.btn-secondary {
  background: var(--gray-light);
  color: var(--black);
  border: 1px solid var(--gray-200);
}

.btn-secondary:hover { background: var(--gray-100); }

.btn-dark {
  background: var(--black);
  color: var(--white);
}

.btn-dark:hover { background: var(--black-2); }

.btn-ghost {
  background: transparent;
  color: var(--gray-800);
  border: 1px solid var(--gray-200);
}

.btn-ghost:hover { background: var(--gray-light); }

.btn-danger {
  background: var(--danger-bg);
  color: var(--danger);
}

.btn-success {
  background: var(--success-bg);
  color: var(--success);
}

.btn-sm { padding: 6px 14px; font-size: 13px; }
.btn-lg { padding: 14px 28px; font-size: 15px; }
.btn-icon { padding: 10px; min-width: 40px; }
.btn-full { width: 100%; }

/* ===== BADGES ===== */
.badge {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 3px 10px;
  border-radius: 20px;
  font-size: 12px;
  font-weight: 600;
}

.badge-success  { background: var(--success-bg); color: var(--success); }
.badge-warning  { background: var(--warning-bg); color: var(--warning); }
.badge-danger   { background: var(--danger-bg);  color: var(--danger); }
.badge-info     { background: var(--info-bg);    color: var(--info); }
.badge-neutral  { background: var(--gray-100);   color: var(--gray-800); }
.badge-red      { background: var(--red);        color: var(--white); }

/* ===== INPUTS ===== */
.input-group { margin-bottom: 16px; }

.input-label {
  display: block;
  font-size: 13px;
  font-weight: 600;
  color: var(--gray-800);
  margin-bottom: 6px;
}

.input-field {
  width: 100%;
  padding: 10px 14px;
  border: 1.5px solid var(--gray-200);
  border-radius: var(--radius-sm);
  font-size: 14px;
  font-family: var(--font-body);
  color: var(--black);
  background: var(--white);
  transition: var(--transition);
  outline: none;
}

.input-field:focus {
  border-color: var(--red);
  box-shadow: 0 0 0 3px var(--red-glow);
}

.input-field::placeholder { color: var(--gray-400); }

.input-with-icon {
  position: relative;
}

.input-with-icon .input-icon {
  position: absolute;
  left: 13px; top: 50%;
  transform: translateY(-50%);
  font-size: 16px;
  color: var(--gray-400);
}

.input-with-icon .input-field { padding-left: 40px; }

select.input-field { appearance: none; cursor: pointer; }

/* ===== TABLE ===== */
.table-wrap { overflow-x: auto; }

table {
  width: 100%;
  border-collapse: collapse;
}

thead th {
  background: var(--gray-light);
  padding: 10px 16px;
  text-align: left;
  font-size: 12px;
  font-weight: 700;
  color: var(--gray-600);
  letter-spacing: 0.05em;
  text-transform: uppercase;
  border-bottom: 2px solid var(--gray-200);
  white-space: nowrap;
}

tbody td {
  padding: 13px 16px;
  font-size: 14px;
  color: var(--gray-800);
  border-bottom: 1px solid var(--gray-100);
}

tbody tr:last-child td { border-bottom: none; }

tbody tr {
  transition: var(--transition);
  cursor: pointer;
}

tbody tr:hover td { background: rgba(229,57,53,0.03); }

/* ===== MODALS ===== */
.modal-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,0.5);
  backdrop-filter: blur(4px);
  z-index: 900;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 20px;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.2s;
}

.modal-overlay.open,
.modal-overlay.active {
  opacity: 1;
  pointer-events: all;
}

.modal {
  background: var(--white);
  border-radius: var(--radius-xl);
  padding: 28px;
  width: 100%;
  max-width: 520px;
  box-shadow: var(--shadow-lg);
  transform: scale(0.95) translateY(8px);
  transition: transform 0.2s cubic-bezier(0.4, 0, 0.2, 1);
}

.modal-overlay.open .modal,
.modal-overlay.active .modal { transform: scale(1) translateY(0); }

.modal-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 24px;
}

.modal-title {
  font-family: var(--font-display);
  font-size: 18px;
  font-weight: 700;
}

.modal-close {
  width: 32px; height: 32px;
  background: var(--gray-light);
  border: none;
  border-radius: var(--radius-sm);
  cursor: pointer;
  font-size: 16px;
  display: flex; align-items: center; justify-content: center;
  transition: var(--transition);
}

.modal-close:hover { background: var(--danger-bg); color: var(--danger); }

/* ===== HAMBURGER / MOBILE ===== */
.hamburger {
  display: none;
  width: 38px; height: 38px;
  flex-direction: column;
  justify-content: center;
  gap: 5px;
  cursor: pointer;
  background: none;
  border: none;
  padding: 4px;
}

.hamburger span {
  display: block;
  height: 2px;
  background: var(--black);
  border-radius: 2px;
  transition: var(--transition);
}

.sidebar-overlay {
  display: none;
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,0.5);
  z-index: 99;
}

/* ===== SCROLLBAR ===== */
::-webkit-scrollbar { width: 6px; height: 6px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb { background: var(--gray-200); border-radius: 3px; }
::-webkit-scrollbar-thumb:hover { background: var(--gray-400); }

/* ===== UTILITIES ===== */
.text-red    { color: var(--red); }
.text-success { color: var(--success); }
.text-warning { color: var(--warning); }
.text-danger  { color: var(--danger); }
.text-muted   { color: var(--gray-600); }
.text-sm      { font-size: 13px; }
.text-xs      { font-size: 12px; }
.fw-700       { font-weight: 700; }
.fw-600       { font-weight: 600; }
.font-display { font-family: var(--font-display); }

.flex         { display: flex; }
.flex-col     { flex-direction: column; }
.items-center { align-items: center; }
.justify-between { justify-content: space-between; }
.gap-8        { gap: 8px; }
.gap-12       { gap: 12px; }
.gap-16       { gap: 16px; }
.gap-24       { gap: 24px; }

.mt-4  { margin-top: 4px; }
.mt-8  { margin-top: 8px; }
.mt-12 { margin-top: 12px; }
.mt-16 { margin-top: 16px; }
.mt-24 { margin-top: 24px; }

.divider {
  height: 1px;
  background: var(--gray-200);
  margin: 20px 0;
}

/* ===== RESPONSIVE ===== */
@media (max-width: 1024px) {
  :root { --sidebar-w: 240px; }
  .page-body { padding: 20px 24px; }
}

@media (max-width: 768px) {
  .sidebar {
    transform: translateX(-100%);
    z-index: 200;
  }

  .sidebar.open { transform: translateX(0); }

  .sidebar-overlay.open { display: block; }

  .hamburger { display: flex; }

  .main-content { margin-left: 0; }

  .page-body { padding: 16px; }

  .topbar { padding: 0 16px; }
}

/* ===== TOPBAR LOGO ===== */
.topbar-logo {
  width: 36px; height: 36px;
  cursor: pointer;
  border-radius: 8px;
  overflow: hidden;
  flex-shrink: 0;
}

.topbar-logo img {
  width: 100%; height: 100%;
  object-fit: cover;
}

/* ===== PARAMÈTRES MODAL ===== */
.settings-modal .modal {
  max-width: 480px;
}

.settings-section {
  padding: 16px 0;
  border-bottom: 1px solid var(--gray-200);
}

.settings-section:last-of-type {
  border-bottom: none;
}

.settings-label {
  font-size: 14px;
  font-weight: 700;
  color: var(--black);
  margin-bottom: 10px;
}

.settings-field {
  margin-bottom: 10px;
}

.settings-input {
  width: 100%;
  padding: 10px 12px;
  border: 1px solid var(--gray-200);
  border-radius: var(--radius-sm);
  font-size: 14px;
  font-family: var(--font-body);
  background: var(--white);
  color: var(--black);
  outline: none;
  transition: var(--transition);
}

.settings-input:focus {
  border-color: var(--primary-color, var(--red));
  box-shadow: 0 0 0 3px var(--primary-color, var(--red));
}

.color-field {
  display: flex;
  gap: 8px;
  align-items: center;
}

.settings-color {
  width: 48px; height: 40px;
  border: 2px solid var(--gray-200);
  border-radius: var(--radius-sm);
  cursor: pointer;
  padding: 2px;
  background: var(--white);
  flex-shrink: 0;
}

.color-presets {
  display: flex;
  gap: 6px;
  margin-top: 8px;
  flex-wrap: wrap;
}

.color-preset {
  width: 28px; height: 28px;
  border-radius: 50%;
  border: 2px solid var(--gray-200);
  cursor: pointer;
  transition: var(--transition);
  padding: 0;
}

.color-preset:hover {
  transform: scale(1.15);
  border-color: var(--black);
}

.color-preset.active {
  border-color: var(--black);
  box-shadow: 0 0 0 2px var(--white), 0 0 0 4px var(--black);
}

.settings-upload {
  display: inline-block;
  padding: 10px 16px;
  background: var(--gray-light);
  border: 1px dashed var(--gray-400);
  border-radius: var(--radius-sm);
  cursor: pointer;
  font-size: 13px;
  color: var(--gray-800);
  transition: var(--transition);
}

.settings-upload:hover {
  border-color: var(--primary-color, var(--red));
  color: var(--primary-color, var(--red));
}

.modal-footer {
  display: flex;
  justify-content: flex-end;
  gap: 8px;
  padding: 16px;
  border-top: 1px solid var(--gray-200);
  background: var(--gray-light);
  border-radius: 0 0 var(--radius-lg) var(--radius-lg);
}

/* ===== TOAST ===== */
.toast-container {
  position: fixed;
  bottom: 24px; right: 24px;
  z-index: 9999;
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.toast {
  background: var(--black);
  color: var(--white);
  padding: 14px 18px;
  border-radius: var(--radius-md);
  font-size: 14px;
  font-weight: 500;
  display: flex;
  align-items: center;
  gap: 10px;
  box-shadow: var(--shadow-lg);
  animation: slideInToast 0.3s ease, fadeOutToast 0.4s ease 2.8s forwards;
  min-width: 260px;
  max-width: 360px;
}

.toast.success { border-left: 4px solid var(--success); }
.toast.error   { border-left: 4px solid var(--red); }
.toast.info    { border-left: 4px solid var(--info); }

@keyframes slideInToast {
  from { transform: translateX(100%); opacity: 0; }
  to   { transform: translateX(0); opacity: 1; }
}

@keyframes fadeOutToast {
  from { opacity: 1; }
  to   { opacity: 0; pointer-events: none; }
}