/* ============================================================
   DIALLO FATI — assets/css/custom.css
   Thème bordeaux #6b0f1a + gris #2d2d2d / #4a4a4a / #f5f0f0
   Netcrafter © 2025
   ============================================================ */

/* ── Variables ─────────────────────────────────────────────── */
:root {
  --bordeaux:        #6b0f1a;
  --bordeaux-dark:   #4e0b12;
  --bordeaux-light:  #8b1a28;
  --bordeaux-pale:   #f9f0f1;
  --bordeaux-muted:  #f0c8cc;

  --gray-900:  #1a1a1a;
  --gray-800:  #2d2d2d;
  --gray-700:  #3d3d3d;
  --gray-600:  #4a4a4a;
  --gray-500:  #6b6b6b;
  --gray-400:  #888;
  --gray-300:  #b0b0b0;
  --gray-200:  #d8d8d8;
  --gray-100:  #f0eded;
  --gray-50:   #f8f5f5;

  --white: #ffffff;

  --font-main: 'Segoe UI', 'Helvetica Neue', Arial, sans-serif;
  --radius-sm:  4px;
  --radius-md:  8px;
  --radius-lg:  12px;
  --radius-xl:  20px;
  --shadow-sm:  0 1px 4px rgba(0,0,0,.08);
  --shadow-md:  0 4px 16px rgba(0,0,0,.10);
  --shadow-lg:  0 8px 32px rgba(0,0,0,.14);
  --transition: .2s ease;
}

/* ── Reset léger ────────────────────────────────────────────── */
*, *::before, *::after { box-sizing: border-box; }
body {
  margin: 0;
  font-family: var(--font-main);
  font-size: 15px;
  color: var(--gray-800);
  background: var(--gray-100);
  line-height: 1.6;
}
a { color: var(--bordeaux); text-decoration: none; transition: color var(--transition); }
a:hover { color: var(--bordeaux-light); }
img { max-width: 100%; display: block; }

/* ── Typographie ────────────────────────────────────────────── */
h1, h2, h3, h4 { margin: 0 0 .5em; font-weight: 700; color: var(--gray-800); line-height: 1.25; }
h1 { font-size: 2rem; }
h2 { font-size: 1.5rem; }
h3 { font-size: 1.2rem; }
h4 { font-size: 1rem; }
p  { margin: 0 0 1em; }
small, .text-sm   { font-size: 12px; }
.text-muted       { color: var(--gray-500); }
.text-bordeaux    { color: var(--bordeaux); }
.text-white       { color: var(--white); }
.fw-bold          { font-weight: 700; }
.text-center      { text-align: center; }
.text-right       { text-align: right; }

/* ── Layout ─────────────────────────────────────────────────── */
.container     { max-width: 1200px; margin: 0 auto; padding: 0 20px; }
.container-sm  { max-width: 520px;  margin: 0 auto; padding: 0 20px; }
.container-md  { max-width: 820px;  margin: 0 auto; padding: 0 20px; }

.row   { display: flex; flex-wrap: wrap; gap: 20px; }
.col   { flex: 1 1 0%; }
.col-4 { flex: 0 0 calc(33.333% - 14px); }
.col-6 { flex: 0 0 calc(50% - 10px); }
.col-8 { flex: 0 0 calc(66.666% - 7px); }

/* ── Navbar ─────────────────────────────────────────────────── */
.navbar {
  background: var(--gray-800);
  padding: 0 20px;
  position: sticky; top: 0; z-index: 100;
  box-shadow: 0 2px 8px rgba(0,0,0,.3);
}
.navbar-inner {
  max-width: 1200px; margin: 0 auto;
  display: flex; align-items: center; gap: 20px;
  height: 60px;
}
.navbar-brand {
  color: var(--white) !important;
  font-size: 1.3rem; font-weight: 800;
  letter-spacing: 1px;
  border-left: 3px solid var(--bordeaux);
  padding-left: 12px;
  flex-shrink: 0;
}
.navbar-nav {
  display: flex; align-items: center; gap: 4px;
  list-style: none; margin: 0; padding: 0; flex: 1;
}
.navbar-nav a {
  color: var(--gray-300);
  padding: 6px 12px; border-radius: var(--radius-sm);
  font-size: 14px; transition: all var(--transition);
}
.navbar-nav a:hover,
.navbar-nav a.active {
  color: var(--white); background: rgba(255,255,255,.08);
}
.navbar-nav a.active { color: var(--bordeaux-muted); }
.navbar-actions { display: flex; align-items: center; gap: 10px; }

/* ── Sidebar (admin/vendeur) ────────────────────────────────── */
.sidebar {
  width: 240px; flex-shrink: 0;
  background: var(--gray-800);
  min-height: 100vh;
  padding: 24px 0;
}
.sidebar-brand {
  padding: 0 20px 24px;
  border-bottom: 1px solid rgba(255,255,255,.08);
  margin-bottom: 12px;
}
.sidebar-brand h2 {
  color: var(--white); font-size: 1rem;
  margin: 0; letter-spacing: 1px; text-transform: uppercase;
}
.sidebar-brand span { color: var(--bordeaux-muted); font-size: 11px; }
.sidebar-nav { list-style: none; margin: 0; padding: 0; }
.sidebar-nav li a {
  display: flex; align-items: center; gap: 10px;
  padding: 10px 20px; color: var(--gray-300);
  font-size: 14px; transition: all var(--transition);
  border-left: 3px solid transparent;
}
.sidebar-nav li a:hover { color: var(--white); background: rgba(255,255,255,.06); }
.sidebar-nav li a.active {
  color: var(--white);
  background: rgba(107,15,26,.35);
  border-left-color: var(--bordeaux);
}
.sidebar-divider {
  height: 1px; background: rgba(255,255,255,.08);
  margin: 12px 20px;
}
.sidebar-section {
  padding: 8px 20px 4px;
  font-size: 10px; font-weight: 700;
  text-transform: uppercase; letter-spacing: 1.5px;
  color: var(--gray-500);
}

/* Layout avec sidebar */
.app-layout  { display: flex; min-height: 100vh; }
.app-content { flex: 1; padding: 32px; overflow-x: hidden; }

/* ── Cards ──────────────────────────────────────────────────── */
.card {
  background: var(--white);
  border-radius: var(--radius-md);
  box-shadow: var(--shadow-sm);
  padding: 24px;
}
.card-header {
  display: flex; align-items: center; justify-content: space-between;
  margin-bottom: 20px;
  padding-bottom: 16px;
  border-bottom: 1px solid var(--gray-100);
}
.card-title { font-size: 1rem; font-weight: 700; color: var(--gray-800); margin: 0; }

/* Stat cards dashboard */
.stat-card {
  background: var(--white);
  border-radius: var(--radius-md);
  padding: 20px 24px;
  box-shadow: var(--shadow-sm);
  border-left: 4px solid var(--bordeaux);
}
.stat-card .stat-label { font-size: 11px; color: var(--gray-500); text-transform: uppercase; letter-spacing: 0.8px; }
.stat-card .stat-value { font-size: 1.8rem; font-weight: 800; color: var(--gray-800); margin: 4px 0; }
.stat-card .stat-sub   { font-size: 12px; color: var(--gray-400); }

/* ── Boutons ─────────────────────────────────────────────────── */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 6px;
  padding: 9px 20px; border-radius: var(--radius-sm);
  font-size: 14px; font-weight: 600; cursor: pointer;
  border: none; transition: all var(--transition);
  text-decoration: none; line-height: 1;
}
.btn:disabled { opacity: .55; cursor: not-allowed; }
.btn-bordeaux {
  background: var(--bordeaux); color: var(--white);
}
.btn-bordeaux:hover { background: var(--bordeaux-dark); color: var(--white); }

.btn-outline {
  background: transparent; color: var(--bordeaux);
  border: 1.5px solid var(--bordeaux);
}
.btn-outline:hover { background: var(--bordeaux-pale); }

.btn-dark {
  background: var(--gray-800); color: var(--white);
}
.btn-dark:hover { background: var(--gray-700); color: var(--white); }

.btn-danger {
  background: #c0392b; color: var(--white);
}
.btn-danger:hover { background: #a93226; color: var(--white); }

.btn-sm { padding: 6px 14px; font-size: 12px; }
.btn-lg { padding: 12px 28px; font-size: 16px; }
.btn-block { display: flex; width: 100%; }

/* ── Formulaires ────────────────────────────────────────────── */
.form-group { margin-bottom: 18px; }
.form-label {
  display: block; margin-bottom: 6px;
  font-size: 13px; font-weight: 600; color: var(--gray-700);
}
.form-control {
  display: block; width: 100%;
  padding: 10px 14px;
  border: 1.5px solid var(--gray-200);
  border-radius: var(--radius-sm);
  font-size: 14px; color: var(--gray-800);
  background: var(--white);
  transition: border-color var(--transition), box-shadow var(--transition);
  outline: none;
  font-family: var(--font-main);
}
.form-control:focus {
  border-color: var(--bordeaux);
  box-shadow: 0 0 0 3px rgba(107,15,26,.12);
}
.form-control.is-invalid { border-color: #c0392b; }
.form-error  { font-size: 12px; color: #c0392b; margin-top: 4px; }
textarea.form-control { resize: vertical; min-height: 100px; }
select.form-control { appearance: none; cursor: pointer; }

/* ── Tableaux ────────────────────────────────────────────────── */
.table-wrapper { overflow-x: auto; border-radius: var(--radius-md); }
table.df-table {
  width: 100%; border-collapse: collapse;
  font-size: 14px;
}
table.df-table thead tr { background: var(--gray-800); }
table.df-table thead th {
  padding: 11px 14px; text-align: left;
  color: var(--white); font-size: 11px;
  text-transform: uppercase; letter-spacing: 0.7px; font-weight: 600;
}
table.df-table thead th:first-child { border-radius: var(--radius-sm) 0 0 0; }
table.df-table thead th:last-child  { border-radius: 0 var(--radius-sm) 0 0; }
table.df-table tbody tr {
  border-bottom: 1px solid var(--gray-100);
  transition: background var(--transition);
}
table.df-table tbody tr:hover { background: var(--bordeaux-pale); }
table.df-table tbody td { padding: 11px 14px; color: var(--gray-700); }

/* ── Badges / Pills ──────────────────────────────────────────── */
.badge {
  display: inline-flex; align-items: center;
  padding: 3px 10px; border-radius: 20px;
  font-size: 11px; font-weight: 700; letter-spacing: 0.4px;
  text-transform: uppercase;
}
.badge-pending     { background: #fff3cd; color: #856404; }
.badge-paid        { background: #d4edda; color: #155724; }
.badge-processing  { background: #cce5ff; color: #004085; }
.badge-completed   { background: #d1ecf1; color: #0c5460; }
.badge-cancelled   { background: #f8d7da; color: #721c24; }
.badge-bordeaux    { background: var(--bordeaux); color: var(--white); }
.badge-gray        { background: var(--gray-200); color: var(--gray-700); }

/* ── Alertes ─────────────────────────────────────────────────── */
.alert {
  padding: 12px 16px; border-radius: var(--radius-sm);
  font-size: 14px; margin-bottom: 16px;
  border-left: 4px solid transparent;
}
.alert-success { background: #d4edda; color: #155724; border-left-color: #28a745; }
.alert-danger  { background: #f8d7da; color: #721c24; border-left-color: #dc3545; }
.alert-info    { background: #cce5ff; color: #004085; border-left-color: #007bff; }
.alert-warning { background: #fff3cd; color: #856404; border-left-color: #ffc107; }

/* ── Produit card (boutique) ─────────────────────────────────── */
.product-card {
  background: var(--white); border-radius: var(--radius-md);
  overflow: hidden; box-shadow: var(--shadow-sm);
  transition: transform var(--transition), box-shadow var(--transition);
}
.product-card:hover { transform: translateY(-3px); box-shadow: var(--shadow-md); }
.product-card img {
  width: 100%; height: 200px; object-fit: cover;
  background: var(--gray-100);
}
.product-card-body { padding: 16px; }
.product-card-name { font-weight: 700; color: var(--gray-800); margin-bottom: 4px; font-size: 15px; }
.product-card-price {
  color: var(--bordeaux); font-weight: 800;
  font-size: 1.1rem; margin-bottom: 12px;
}
.product-card-vendor { font-size: 12px; color: var(--gray-400); margin-bottom: 12px; }

/* ── Notification bell ───────────────────────────────────────── */
.notif-bell { position: relative; cursor: pointer; }
.notif-bell .badge-count {
  position: absolute; top: -6px; right: -6px;
  background: var(--bordeaux); color: var(--white);
  font-size: 10px; font-weight: 700;
  width: 18px; height: 18px;
  border-radius: 50%; display: flex; align-items: center; justify-content: center;
}

/* ── Page login / auth ───────────────────────────────────────── */
.auth-page {
  min-height: 100vh; display: flex; align-items: center; justify-content: center;
  background: linear-gradient(135deg, var(--gray-900) 0%, var(--gray-700) 100%);
  padding: 20px;
}
.auth-card {
  background: var(--white); border-radius: var(--radius-lg);
  padding: 40px; width: 100%; max-width: 420px;
  box-shadow: var(--shadow-lg);
}
.auth-logo {
  text-align: center; margin-bottom: 28px;
}
.auth-logo h1 {
  color: var(--bordeaux); font-size: 1.8rem;
  letter-spacing: 2px; margin: 0;
}
.auth-logo p { color: var(--gray-500); font-size: 13px; margin: 4px 0 0; }
.auth-divider {
  height: 1px; background: var(--gray-100);
  margin: 24px 0;
}

/* ── Divers ──────────────────────────────────────────────────── */
.mt-0 { margin-top: 0; }    .mb-0 { margin-bottom: 0; }
.mt-1 { margin-top: 8px; }  .mb-1 { margin-bottom: 8px; }
.mt-2 { margin-top: 16px; } .mb-2 { margin-bottom: 16px; }
.mt-3 { margin-top: 24px; } .mb-3 { margin-bottom: 24px; }
.mt-4 { margin-top: 32px; } .mb-4 { margin-bottom: 32px; }
.gap-1 { gap: 8px; }  .gap-2 { gap: 16px; }
.d-flex  { display: flex; }
.align-center { align-items: center; }
.justify-between { justify-content: space-between; }
.flex-wrap { flex-wrap: wrap; }
.w-100 { width: 100%; }

/* Hamburger caché sur desktop */
#sidebar-toggle,
.mobile-hamburger { display: none; }

/* ── Responsive ──────────────────────────────────────────────── */
@media (max-width: 768px) {
  /* Sidebar : slide depuis la gauche au lieu de display:none */
  .sidebar {
    position: fixed !important;
    left: -260px !important;
    top: 0;
    height: 100vh;
    z-index: 500;
    transition: left .28s cubic-bezier(.4,0,.2,1);
    box-shadow: none;
    overflow-y: auto;
  }
  .sidebar.sidebar-open {
    left: 0 !important;
    box-shadow: 6px 0 24px rgba(0,0,0,.45);
  }

  /* Overlay sombre derrière la sidebar */
  .sidebar-overlay {
    display: none;
    position: fixed;
    inset: 0;
    background: rgba(0,0,0,.5);
    z-index: 499;
    cursor: pointer;
  }
  .sidebar-overlay.active { display: block; }

  /* Bouton hamburger flottant (injecté par app.js pour les pages vendeur) */
  .mobile-hamburger {
    position: fixed;
    top: 12px;
    left: 12px;
    z-index: 501;
    width: 42px;
    height: 42px;
    border-radius: 10px;
    background: var(--gray-800);
    border: none;
    color: var(--gray-200);
    font-size: 20px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 2px 8px rgba(0,0,0,.3);
  }
  .mobile-hamburger.has-topbar { display: none; }

  /* Hamburger dans le topbar admin */
  #sidebar-toggle { display: flex !important; }

  .app-content { padding: 16px; }
  .col-4, .col-6, .col-8 { flex: 0 0 100%; }
  .navbar-nav { display: none; }
  h1 { font-size: 1.5rem; }
  .stat-card .stat-value { font-size: 1.4rem; }
  /* Décaler le contenu quand pas de topbar pour le hamburger flottant */
  .app-layout:not(:has(.topbar)) .app-content {
    padding-top: 64px;
  }
}