/* ================================================================
   Temple des Anges — Design System v3.0
   Site Public Blanc/Bleu | Admin Light & Dark Mode
   ================================================================ */

@import url('https://fonts.googleapis.com/css2?family=Inter:wght@300;400;500;600;700;800;900&display=swap');

/* ================================================================
   VARIABLES GLOBALES
   ================================================================ */
:root {
  --blue:       #0057B8;
  --blue-hover: #004A9E;
  --blue-light: #3A9AE8;
  --blue-pale:  #EBF4FF;
  --blue-dark:  #003580;
  --gold:       #C9A84C;
  --font:       'Inter', 'Segoe UI', system-ui, sans-serif;
  --ease:       all 0.22s cubic-bezier(0.4, 0, 0.2, 1);
}

/* ================================================================
   ADMIN — VARIABLES LIGHT (défaut)
   ================================================================ */
:root {
  --adm-bg:          #F0F4FB;
  --adm-sidebar:     #FFFFFF;
  --adm-topbar:      #FFFFFF;
  --adm-card:        #FFFFFF;
  --adm-card-hover:  #F7FAFF;
  --adm-border:      #E4ECF7;
  --adm-text:        #1A2B4A;
  --adm-text-2:      #637392;
  --adm-muted:       #94A3B8;
  --adm-active-bg:   #EBF4FF;
  --adm-active-text: #0057B8;
  --adm-input-bg:    #F8FAFD;
  --adm-shadow:      0 1px 3px rgba(0,60,130,0.07), 0 4px 16px rgba(0,60,130,0.04);
  --adm-icon-bg:     #EBF4FF;
}

/* ================================================================
   ADMIN — DARK MODE
   ================================================================ */
[data-theme="dark"] {
  --adm-bg:          #0A1020;
  --adm-sidebar:     #0D1525;
  --adm-topbar:      #0D1525;
  --adm-card:        #131E35;
  --adm-card-hover:  #1A2640;
  --adm-border:      #1E2E4A;
  --adm-text:        #E8F0FF;
  --adm-text-2:      #8DA4C8;
  --adm-muted:       #5A7099;
  --adm-active-bg:   rgba(0, 87, 184, 0.2);
  --adm-active-text: #6BAFF5;
  --adm-input-bg:    #0F1A2E;
  --adm-shadow:      0 1px 3px rgba(0,0,0,0.4), 0 4px 16px rgba(0,0,0,0.2);
  --adm-icon-bg:     rgba(0, 87, 184, 0.15);
}

/* ================================================================
   BASE
   ================================================================ */
*, *::before, *::after { box-sizing: border-box; }
body { font-family: var(--font); margin: 0; -webkit-font-smoothing: antialiased; }

/* ================================================================
   SITE PUBLIC — Navbar
   ================================================================ */
.navbar-site {
  background: #fff;
  box-shadow: 0 1px 0 rgba(0,60,130,0.08), 0 2px 12px rgba(0,60,130,0.04);
  position: sticky; top: 0; z-index: 1000;
  padding: 0;
}
.navbar-site .nav-inner {
  display: flex; align-items: center;
  height: 72px; gap: 1rem;
}
.navbar-site .brand {
  display: flex; align-items: center; gap: 0.5rem;
  text-decoration: none; flex-shrink: 0;
}
.navbar-site .brand img { height: 52px; width: auto; }
.navbar-site .brand-name {
  font-size: 0.82rem; font-weight: 700;
  color: var(--blue); line-height: 1.2;
  display: flex; flex-direction: column;
}
.navbar-site .nav-links {
  display: flex; align-items: center; gap: 0.25rem;
  margin: 0 auto;
}
.navbar-site .nav-links a {
  text-decoration: none; color: #3D5A80;
  font-size: 0.9rem; font-weight: 500;
  padding: 0.5rem 0.9rem; border-radius: 7px;
  transition: var(--ease); position: relative;
}
.navbar-site .nav-links a:hover { color: var(--blue); background: var(--blue-pale); }
.navbar-site .nav-links a.active {
  color: var(--blue); font-weight: 700;
}
.navbar-site .nav-links a.active::after {
  content: ''; position: absolute;
  bottom: -4px; left: 50%; transform: translateX(-50%);
  width: 24px; height: 2.5px;
  background: var(--blue); border-radius: 2px;
}
.navbar-site .nav-actions {
  display: flex; align-items: center; gap: 0.5rem; flex-shrink: 0;
}
.navbar-site .nav-icon-btn {
  width: 40px; height: 40px; border-radius: 10px;
  display: flex; align-items: center; justify-content: center;
  color: #3D5A80; text-decoration: none;
  border: 1px solid #E8EFF8; background: #fff;
  transition: var(--ease); position: relative; font-size: 1rem;
}
.navbar-site .nav-icon-btn:hover { background: var(--blue-pale); border-color: var(--blue); color: var(--blue); }
.navbar-site .cart-badge {
  position: absolute; top: -4px; right: -4px;
  width: 18px; height: 18px; border-radius: 50%;
  background: var(--blue); color: #fff;
  font-size: 0.65rem; font-weight: 700;
  display: flex; align-items: center; justify-content: center;
  border: 2px solid #fff;
}

/* ================================================================
   SITE PUBLIC — Hero Section
   ================================================================ */
.hero-vitrine {
  background: linear-gradient(135deg, #EBF4FF 0%, #C8DFF8 30%, #A8CCEE 60%, #DAEEFF 100%);
  min-height: 88vh;
  display: flex; align-items: center;
  overflow: hidden; position: relative;
}
.hero-vitrine::before {
  content: ''; position: absolute;
  top: -200px; right: -200px;
  width: 700px; height: 700px;
  background: radial-gradient(circle, rgba(0,87,184,0.08) 0%, transparent 70%);
  border-radius: 50%; pointer-events: none;
}
.hero-eyebrow {
  display: inline-flex; align-items: center; gap: 0.4rem;
  color: var(--gold); font-size: 0.8rem; font-weight: 700;
  text-transform: uppercase; letter-spacing: 1.5px;
  margin-bottom: 1rem;
}
.hero-eyebrow::before, .hero-eyebrow::after {
  content: '★'; font-size: 0.7rem;
}
.hero-h1 {
  font-size: clamp(2.4rem, 5vw, 3.8rem);
  font-weight: 900; color: #0A1A35;
  line-height: 1.1; letter-spacing: -1px;
  margin-bottom: 1.25rem;
}
.hero-desc {
  font-size: 1rem; color: #3D5A80;
  line-height: 1.75; max-width: 420px;
  margin-bottom: 2rem;
}
.btn-hero-blue {
  background: var(--blue); color: #fff;
  border: 2px solid var(--blue);
  border-radius: 10px; font-weight: 700;
  font-size: 0.95rem; padding: 0.8rem 1.8rem;
  display: inline-flex; align-items: center; gap: 0.5rem;
  text-decoration: none; transition: var(--ease);
}
.btn-hero-blue:hover {
  background: var(--blue-hover); border-color: var(--blue-hover);
  color: #fff; transform: translateY(-2px);
  box-shadow: 0 8px 24px rgba(0,87,184,0.3);
}
.btn-hero-outline {
  background: transparent; color: var(--blue);
  border: 2px solid #BDD5F5;
  border-radius: 10px; font-weight: 600;
  font-size: 0.95rem; padding: 0.8rem 1.8rem;
  display: inline-flex; align-items: center; gap: 0.5rem;
  text-decoration: none; transition: var(--ease);
}
.btn-hero-outline:hover {
  background: var(--blue-pale); border-color: var(--blue); color: var(--blue);
}
.hero-img-wrap {
  position: relative; text-align: center;
}
.hero-img-wrap img {
  max-height: 85vh; max-width: 100%;
  object-fit: contain;
  filter: drop-shadow(0 20px 60px rgba(0,87,184,0.2));
  animation: floatHero 5s ease-in-out infinite;
}
@keyframes floatHero {
  0%, 100% { transform: translateY(0); }
  50% { transform: translateY(-14px); }
}

/* ================================================================
   SITE PUBLIC — Section titres
   ================================================================ */
.section-eyebrow {
  display: flex; align-items: center; justify-content: center;
  gap: 0.5rem; margin-bottom: 0.5rem;
  color: var(--gold); font-size: 0.78rem;
  font-weight: 700; text-transform: uppercase; letter-spacing: 1.5px;
}
.section-eyebrow::before, .section-eyebrow::after {
  content: ''; flex: 1; max-width: 40px;
  height: 1px; background: var(--gold); opacity: 0.5;
}
.section-h2 {
  font-size: clamp(1.5rem, 3vw, 2rem);
  font-weight: 800; color: #0A1A35;
  text-align: center; margin-bottom: 2.5rem;
}

/* ================================================================
   SITE PUBLIC — Cartes produits
   ================================================================ */
.product-card {
  background: #fff; border: 1px solid #E8EFF8;
  border-radius: 14px; overflow: hidden;
  transition: var(--ease);
  box-shadow: 0 2px 8px rgba(0,60,130,0.04);
}
.product-card:hover {
  transform: translateY(-6px);
  box-shadow: 0 16px 40px rgba(0,87,184,0.13);
  border-color: rgba(0,87,184,0.15);
}
.product-card .img-wrap { overflow: hidden; }
.product-card .img-wrap img {
  width: 100%; height: 220px; object-fit: cover;
  transition: transform 0.45s ease;
}
.product-card:hover .img-wrap img { transform: scale(1.06); }
.product-card .card-body { padding: 1rem 1.1rem 0.5rem; }
.product-cat { font-size: 0.72rem; color: var(--blue); font-weight: 600; text-transform: uppercase; letter-spacing: 0.5px; }
.product-name { font-weight: 700; font-size: 0.95rem; color: #0A1A35; margin: 0.2rem 0 0.4rem; }
.product-desc { font-size: 0.8rem; color: #637392; line-height: 1.5; }
.product-price { font-size: 0.78rem; color: #637392; margin-top: 0.5rem; }
.product-price strong { color: var(--blue); font-size: 1.05rem; }
.product-card .card-footer { padding: 0.75rem 1.1rem; border-top: 1px solid #EEF3FA; background: transparent; }
.btn-voir {
  display: block; text-align: center; text-decoration: none;
  background: var(--blue); color: #fff;
  border-radius: 8px; font-weight: 600; font-size: 0.88rem;
  padding: 0.55rem; transition: var(--ease);
}
.btn-voir:hover { background: var(--blue-hover); color: #fff; }

/* ================================================================
   SITE PUBLIC — Features strip
   ================================================================ */
.feature-card {
  background: #fff; border: 1px solid #E8EFF8;
  border-radius: 14px; padding: 1.5rem 1.25rem;
  display: flex; align-items: flex-start; gap: 1rem;
  transition: var(--ease);
}
.feature-card:hover { box-shadow: 0 8px 24px rgba(0,87,184,0.08); transform: translateY(-3px); }
.feature-icon {
  width: 52px; height: 52px; border-radius: 12px;
  background: var(--blue-pale); display: flex;
  align-items: center; justify-content: center;
  font-size: 1.4rem; flex-shrink: 0;
  color: var(--blue);
}

/* ================================================================
   SITE PUBLIC — Mission section
   ================================================================ */
.mission-section {
  background: linear-gradient(135deg, #0A1A35 0%, #0D2150 60%, #0E295F 100%);
  position: relative; overflow: hidden;
}
.mission-section::before {
  content: ''; position: absolute; inset: 0;
  background: url("data:image/svg+xml,%3Csvg width='60' height='60' viewBox='0 0 60 60' xmlns='http://www.w3.org/2000/svg'%3E%3Cg fill='%23ffffff' fill-opacity='0.02'%3E%3Ccircle cx='30' cy='30' r='2'/%3E%3C/g%3E%3C/svg%3E");
}
.mission-stat {
  display: flex; align-items: center; gap: 0.75rem;
  padding: 0.85rem 1rem;
  background: rgba(255,255,255,0.05);
  border: 1px solid rgba(255,255,255,0.08);
  border-radius: 10px; margin-bottom: 0.75rem;
}
.mission-stat-val { font-size: 1.4rem; font-weight: 900; color: #fff; }
.mission-stat-lbl { font-size: 0.82rem; color: rgba(255,255,255,0.65); }

/* ================================================================
   SITE PUBLIC — Testimonials
   ================================================================ */
.testimonial-card {
  background: #fff; border: 1px solid #E8EFF8;
  border-radius: 14px; padding: 1.5rem;
  position: relative;
}
.testimonial-card::before {
  content: '\201C';
  position: absolute; top: 0.75rem; left: 1.25rem;
  font-size: 3rem; color: var(--blue-pale);
  font-family: Georgia, serif; line-height: 1;
}
.testimonial-stars { color: #F59E0B; font-size: 0.85rem; }
.testimonial-text { font-size: 0.88rem; color: #4B6080; line-height: 1.7; margin: 0.5rem 0; }
.testimonial-author { font-weight: 700; color: #0A1A35; font-size: 0.9rem; }
.testimonial-city { font-size: 0.78rem; color: #94A3B8; }

/* ================================================================
   SITE PUBLIC — Newsletter & Footer
   ================================================================ */
.newsletter-strip {
  background: linear-gradient(90deg, var(--blue) 0%, var(--blue-light) 100%);
  padding: 3rem 0;
}
.newsletter-input {
  background: #fff; border: none; border-radius: 10px 0 0 10px;
  padding: 0.85rem 1.25rem; font-size: 0.9rem;
  width: 100%; outline: none; color: #0A1A35;
}
.newsletter-btn {
  background: #0A1A35; color: #fff;
  border: none; border-radius: 0 10px 10px 0;
  padding: 0 1.5rem; font-weight: 700; font-size: 0.9rem;
  cursor: pointer; white-space: nowrap; transition: var(--ease);
}
.newsletter-btn:hover { background: #000; }
.site-footer { background: #06101F; color: rgba(255,255,255,0.65); }
.footer-link { color: rgba(255,255,255,0.55); text-decoration: none; font-size: 0.87rem; display: block; margin-bottom: 0.5rem; transition: var(--ease); }
.footer-link:hover { color: #fff; }
.footer-social-btn {
  width: 34px; height: 34px; border-radius: 8px;
  background: rgba(255,255,255,0.08); border: 1px solid rgba(255,255,255,0.1);
  display: inline-flex; align-items: center; justify-content: center;
  color: rgba(255,255,255,0.6); text-decoration: none; font-size: 0.9rem;
  transition: var(--ease);
}
.footer-social-btn:hover { background: var(--blue); color: #fff; border-color: var(--blue); }

/* ================================================================
   SITE PUBLIC — Badges & Boutons généraux
   ================================================================ */
.btn-tda {
  background: var(--blue); color: #fff; border: 2px solid var(--blue);
  border-radius: 9px; font-weight: 600; font-size: 0.9rem;
  padding: 0.55rem 1.2rem; text-decoration: none;
  display: inline-flex; align-items: center; gap: 0.4rem;
  transition: var(--ease); cursor: pointer;
}
.btn-tda:hover { background: var(--blue-hover); border-color: var(--blue-hover); color: #fff; transform: translateY(-1px); }
.btn-tda-outline {
  background: transparent; color: var(--blue); border: 2px solid var(--blue);
  border-radius: 9px; font-weight: 600; font-size: 0.9rem;
  padding: 0.55rem 1.2rem; text-decoration: none;
  display: inline-flex; align-items: center; gap: 0.4rem;
  transition: var(--ease);
}
.btn-tda-outline:hover { background: var(--blue); color: #fff; }
.badge-disponible { background: #DCFCE7; color: #166534; font-weight: 600; }
.badge-rupture, .badge-en-attente + .badge-rupture { background: #FEE2E2; color: #991B1B; font-weight: 600; }
.badge-en-attente { background: #FEF9C3; color: #854D0E; font-weight: 600; }
.badge-livree, .badge-confirmee, .badge-ok { background: #DCFCE7; color: #166534; font-weight: 600; }
.badge-bas { background: #FEF9C3; color: #854D0E; font-weight: 600; }

/* ================================================================
   AUTH — Login / Register
   ================================================================ */
.auth-wrap { min-height: 100vh; display: flex; }
.auth-left {
  flex: 0 0 45%;
  background: linear-gradient(150deg, #003580 0%, #0057B8 55%, #3A9AE8 100%);
  display: flex; flex-direction: column;
  align-items: center; justify-content: center;
  padding: 3rem 2.5rem; position: relative; overflow: hidden;
}
.auth-left::before {
  content: ''; position: absolute;
  width: 500px; height: 500px;
  background: radial-gradient(circle, rgba(255,255,255,0.1) 0%, transparent 65%);
  border-radius: 50%; top: -150px; right: -150px;
}
.auth-left::after {
  content: ''; position: absolute;
  width: 350px; height: 350px;
  background: radial-gradient(circle, rgba(255,255,255,0.07) 0%, transparent 65%);
  border-radius: 50%; bottom: -100px; left: -100px;
}
.auth-right {
  flex: 1; display: flex; align-items: center;
  justify-content: center; background: #F8FAFD; padding: 2rem;
}
.auth-box {
  width: 100%; max-width: 440px;
  background: #fff; border-radius: 20px;
  padding: 2.5rem 2rem;
  box-shadow: 0 4px 40px rgba(0,60,130,0.08);
}
.auth-field-label {
  display: block; font-size: 0.78rem; font-weight: 700;
  color: #637392; text-transform: uppercase; letter-spacing: 0.5px;
  margin-bottom: 0.4rem;
}
.auth-input-wrap { position: relative; }
.auth-input-wrap .ai-icon {
  position: absolute; left: 0.9rem; top: 50%;
  transform: translateY(-50%); color: #94A3B8;
  font-size: 0.95rem; pointer-events: none;
}
.auth-input {
  width: 100%; background: #F8FAFD; border: 1.5px solid #E4ECF7;
  border-radius: 10px; padding: 0.75rem 1rem 0.75rem 2.75rem;
  font-size: 0.9rem; outline: none; color: #0A1A35;
  transition: var(--ease);
}
.auth-input:focus { border-color: var(--blue); background: #fff; box-shadow: 0 0 0 3px rgba(0,87,184,0.1); }
.btn-auth {
  width: 100%; background: var(--blue); color: #fff; border: none;
  border-radius: 10px; padding: 0.85rem; font-size: 0.95rem;
  font-weight: 700; cursor: pointer; transition: var(--ease);
}
.btn-auth:hover { background: var(--blue-hover); transform: translateY(-1px); box-shadow: 0 8px 24px rgba(0,87,184,0.3); }

/* ================================================================
   ADMIN LAYOUT
   ================================================================ */
body.admin-body {
  background: var(--adm-bg);
  color: var(--adm-text);
  min-height: 100vh;
}

/* --- Topbar --- */
.adm-topbar {
  background: var(--adm-topbar);
  border-bottom: 1px solid var(--adm-border);
  height: 64px;
  display: flex; align-items: center;
  padding: 0 1.5rem; gap: 1.25rem;
  position: sticky; top: 0; z-index: 200;
  box-shadow: var(--adm-shadow);
}
.adm-brand {
  display: flex; align-items: center; gap: 0.6rem;
  text-decoration: none; min-width: 200px;
}
.adm-brand img { height: 40px; width: auto; }
.adm-brand-fallback {
  width: 40px; height: 40px;
  background: linear-gradient(135deg, var(--blue), var(--blue-light));
  border-radius: 10px; display: none;
  align-items: center; justify-content: center;
  font-weight: 900; font-size: 0.8rem; color: #fff;
}
.adm-brand-text { font-weight: 800; font-size: 0.88rem; color: var(--adm-text); line-height: 1.1; }
.adm-brand-sub { font-size: 0.68rem; color: var(--adm-muted); }
.adm-search {
  flex: 1; max-width: 380px; position: relative;
}
.adm-search input {
  width: 100%; background: var(--adm-input-bg);
  border: 1px solid var(--adm-border);
  color: var(--adm-text); border-radius: 10px;
  padding: 0.5rem 1rem 0.5rem 2.5rem;
  font-size: 0.87rem; outline: none; transition: var(--ease);
}
.adm-search input::placeholder { color: var(--adm-muted); }
.adm-search input:focus { border-color: var(--blue); box-shadow: 0 0 0 3px rgba(0,87,184,0.12); }
.adm-search .si { position: absolute; left: 0.8rem; top: 50%; transform: translateY(-50%); color: var(--adm-muted); font-size: 0.88rem; }
.adm-topbar-right { margin-left: auto; display: flex; align-items: center; gap: 0.6rem; }
.adm-icon-btn {
  width: 38px; height: 38px; border-radius: 10px;
  background: var(--adm-input-bg); border: 1px solid var(--adm-border);
  color: var(--adm-text-2); display: flex; align-items: center;
  justify-content: center; cursor: pointer; transition: var(--ease);
  font-size: 1rem; text-decoration: none; position: relative;
}
.adm-icon-btn:hover { background: var(--adm-active-bg); border-color: var(--blue); color: var(--adm-active-text); }
.adm-icon-btn .notif-dot {
  position: absolute; top: -2px; right: -2px;
  width: 8px; height: 8px; border-radius: 50%;
  background: #EF4444; border: 2px solid var(--adm-topbar);
}
.adm-avatar {
  width: 38px; height: 38px; border-radius: 50%;
  background: linear-gradient(135deg, var(--blue), var(--blue-light));
  display: flex; align-items: center; justify-content: center;
  font-weight: 800; font-size: 0.85rem; color: #fff;
  cursor: pointer;
}
.btn-adm-primary {
  background: var(--blue); color: #fff; border: none;
  border-radius: 9px; padding: 0.5rem 1.1rem;
  font-size: 0.87rem; font-weight: 700; cursor: pointer;
  display: inline-flex; align-items: center; gap: 0.4rem;
  transition: var(--ease); text-decoration: none;
}
.btn-adm-primary:hover { background: var(--blue-hover); color: #fff; transform: translateY(-1px); box-shadow: 0 6px 20px rgba(0,87,184,0.3); }

/* --- Layout body --- */
.adm-layout { display: flex; min-height: calc(100vh - 64px); }

/* --- Sidebar --- */
.adm-sidebar {
  width: 220px; flex-shrink: 0;
  background: var(--adm-sidebar);
  border-right: 1px solid var(--adm-border);
  display: flex; flex-direction: column;
  padding: 0.75rem 0 1rem;
  overflow-y: auto; min-height: calc(100vh - 64px);
  position: sticky; top: 64px; align-self: flex-start;
  max-height: calc(100vh - 64px);
}
.adm-sidebar-user {
  padding: 0.75rem 1rem 1rem;
  border-bottom: 1px solid var(--adm-border);
  margin-bottom: 0.5rem;
}
.adm-sidebar-user .user-name { font-weight: 700; font-size: 0.88rem; color: var(--adm-text); }
.adm-sidebar-user .user-role { font-size: 0.72rem; color: var(--adm-muted); }
.adm-sidebar-user .user-avatar {
  width: 36px; height: 36px; border-radius: 50%;
  background: linear-gradient(135deg, var(--blue), var(--blue-light));
  display: flex; align-items: center; justify-content: center;
  font-weight: 800; font-size: 0.78rem; color: #fff;
}
.sidebar-section-label {
  font-size: 0.67rem; font-weight: 700; text-transform: uppercase;
  letter-spacing: 1.2px; color: var(--adm-muted);
  padding: 0.8rem 1rem 0.35rem;
}
.sidebar-nav-link {
  display: flex; align-items: center; gap: 0.65rem;
  padding: 0.55rem 1rem; margin: 1px 0.6rem;
  border-radius: 9px; color: var(--adm-text-2);
  text-decoration: none; font-size: 0.87rem; font-weight: 500;
  transition: var(--ease);
}
.sidebar-nav-link i { font-size: 1rem; width: 18px; flex-shrink: 0; }
.sidebar-nav-link:hover { background: var(--adm-active-bg); color: var(--adm-active-text); }
.sidebar-nav-link.active {
  background: var(--adm-active-bg); color: var(--adm-active-text); font-weight: 600;
}
.sidebar-nav-link .badge-count {
  margin-left: auto; background: var(--blue); color: #fff;
  font-size: 0.65rem; padding: 0.1rem 0.45rem;
  border-radius: 100px; font-weight: 700;
}
.adm-sidebar-help {
  margin: auto 0.75rem 0;
  background: var(--adm-active-bg);
  border: 1px solid var(--adm-border);
  border-radius: 12px; padding: 1rem;
}
.adm-sidebar-help img { height: 48px; margin-bottom: 0.5rem; }
.adm-sidebar-help .help-title { font-size: 0.82rem; font-weight: 700; color: var(--adm-text); }
.adm-sidebar-help .help-text { font-size: 0.75rem; color: var(--adm-muted); margin: 0.2rem 0 0.75rem; }
.btn-help {
  display: block; text-align: center; font-size: 0.78rem; font-weight: 600;
  color: var(--adm-active-text); text-decoration: none;
  border: 1px solid var(--adm-border); border-radius: 7px; padding: 0.4rem;
  background: var(--adm-card); transition: var(--ease);
}
.btn-help:hover { border-color: var(--blue); color: var(--blue); }

/* --- Main content --- */
.adm-main {
  flex: 1; padding: 1.75rem; overflow-x: hidden;
  background: var(--adm-bg);
}

/* --- Page header --- */
.adm-page-title { font-size: 1.5rem; font-weight: 800; color: var(--adm-text); }
.adm-page-sub { font-size: 0.85rem; color: var(--adm-text-2); margin-top: 0.2rem; }

/* --- Cards --- */
.adm-card {
  background: var(--adm-card); border: 1px solid var(--adm-border);
  border-radius: 14px; box-shadow: var(--adm-shadow);
  overflow: hidden;
}
.adm-card-head {
  padding: 1rem 1.25rem; border-bottom: 1px solid var(--adm-border);
  display: flex; align-items: center; justify-content: space-between;
}
.adm-card-title { font-size: 0.9rem; font-weight: 700; color: var(--adm-text); }
.adm-card-body { padding: 1.25rem; }

/* --- KPI cards --- */
.kpi-card {
  background: var(--adm-card); border: 1px solid var(--adm-border);
  border-radius: 14px; padding: 1.25rem 1.25rem 1rem;
  box-shadow: var(--adm-shadow); transition: var(--ease);
  display: flex; flex-direction: column;
}
.kpi-card:hover { transform: translateY(-2px); box-shadow: 0 8px 24px rgba(0,60,130,0.1); }
.kpi-icon-wrap {
  width: 44px; height: 44px; border-radius: 11px;
  background: var(--adm-icon-bg); display: flex;
  align-items: center; justify-content: center;
  font-size: 1.2rem; flex-shrink: 0;
  color: var(--blue); margin-bottom: 0.75rem;
}
.kpi-icon-wrap.warn { background: rgba(245,158,11,0.1); color: #D97706; }
.kpi-icon-wrap.danger { background: rgba(239,68,68,0.1); color: #DC2626; }
.kpi-icon-wrap.success { background: rgba(16,185,129,0.1); color: #059669; }
.kpi-icon-wrap.purple { background: rgba(139,92,246,0.1); color: #7C3AED; }
.kpi-label { font-size: 0.75rem; color: var(--adm-muted); font-weight: 500; text-transform: uppercase; letter-spacing: 0.5px; }
.kpi-value { font-size: 1.8rem; font-weight: 900; color: var(--adm-text); line-height: 1.1; margin: 0.25rem 0 0.1rem; }
.kpi-trend { font-size: 0.75rem; color: var(--adm-muted); }
.kpi-trend.up { color: #059669; }
.kpi-trend.down { color: #DC2626; }
.kpi-sparkline {
  margin-top: 0.75rem; width: 100%; height: 36px;
  display: block;
}
.kpi-sparkline polyline {
  fill: none; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round;
  vector-effect: non-scaling-stroke;
}

/* --- Tables admin --- */
.adm-table { width: 100%; border-collapse: collapse; font-size: 0.87rem; }
.adm-table thead th {
  background: transparent; color: var(--adm-muted);
  font-size: 0.7rem; font-weight: 700; text-transform: uppercase;
  letter-spacing: 0.7px; padding: 0.6rem 0.9rem;
  border-bottom: 1px solid var(--adm-border);
}
.adm-table tbody td {
  padding: 0.85rem 0.9rem; border-bottom: 1px solid var(--adm-border);
  color: var(--adm-text); vertical-align: middle;
}
.adm-table tbody tr:last-child td { border-bottom: none; }
.adm-table tbody tr:hover td { background: var(--adm-card-hover); }

/* --- Mouvement badge +/- --- */
.mv-plus { color: #059669; font-weight: 700; }
.mv-minus { color: #DC2626; font-weight: 700; }

/* --- Alerte item --- */
.alerte-item {
  display: flex; align-items: center; gap: 0.75rem;
  padding: 0.75rem; border-bottom: 1px solid var(--adm-border);
}
.alerte-item:last-child { border-bottom: none; }
.alerte-product-img {
  width: 40px; height: 40px; border-radius: 8px;
  background: var(--adm-icon-bg); display: flex;
  align-items: center; justify-content: center;
  flex-shrink: 0; overflow: hidden;
}
.alerte-product-img img { width: 100%; height: 100%; object-fit: cover; border-radius: 8px; }
.alerte-info { flex: 1; }
.alerte-name { font-weight: 600; font-size: 0.87rem; color: var(--adm-text); }
.alerte-stock { font-size: 0.75rem; color: #DC2626; }
.btn-commander {
  background: transparent; border: 1px solid var(--adm-border);
  border-radius: 7px; padding: 0.35rem 0.8rem;
  font-size: 0.78rem; font-weight: 600; color: var(--adm-text-2);
  cursor: pointer; transition: var(--ease); white-space: nowrap;
  text-decoration: none;
}
.btn-commander:hover { border-color: var(--blue); color: var(--blue); background: var(--adm-active-bg); }

/* --- Overrides Bootstrap for admin --- */
.admin-body .form-control, .admin-body .form-select {
  background: var(--adm-input-bg); border: 1px solid var(--adm-border);
  color: var(--adm-text); border-radius: 9px;
}
.admin-body .form-control:focus, .admin-body .form-select:focus {
  background: var(--adm-input-bg); border-color: var(--blue);
  box-shadow: 0 0 0 3px rgba(0,87,184,0.12); color: var(--adm-text);
}
.admin-body .form-label { color: var(--adm-text-2); font-size: 0.82rem; font-weight: 600; }
.admin-body .card { background: var(--adm-card); border: 1px solid var(--adm-border); border-radius: 14px; }
.admin-body .card-header { background: var(--adm-card); border-bottom: 1px solid var(--adm-border); color: var(--adm-text); }
.admin-body .table { color: var(--adm-text); }
.admin-body .table thead th { color: var(--adm-muted); border-color: var(--adm-border); font-size: 0.72rem; font-weight: 700; text-transform: uppercase; letter-spacing: 0.6px; }
.admin-body .table td { border-color: var(--adm-border); }
.admin-body .table-hover tbody tr:hover td { background: var(--adm-card-hover); }
.admin-body .text-muted { color: var(--adm-muted) !important; }
.admin-body .alert-success { background: rgba(16,185,129,0.1); border-color: rgba(16,185,129,0.25); color: #065F46; }
.admin-body .alert-danger { background: rgba(239,68,68,0.1); border-color: rgba(239,68,68,0.25); color: #991B1B; }
.admin-body .alert-info { background: var(--adm-active-bg); border-color: rgba(0,87,184,0.2); color: var(--adm-active-text); }
.admin-body .alert-warning { background: rgba(245,158,11,0.1); border-color: rgba(245,158,11,0.25); color: #92400E; }
.admin-body .breadcrumb-item a { color: var(--adm-active-text); }
.admin-body .breadcrumb-item.active, .admin-body .breadcrumb-item + .breadcrumb-item::before { color: var(--adm-muted); }
.admin-body select option { background: var(--adm-card); color: var(--adm-text); }
.admin-body .btn-primary { background: var(--blue); border-color: var(--blue); }
.admin-body .btn-primary:hover { background: var(--blue-hover); border-color: var(--blue-hover); }
.admin-body .btn-outline-secondary { border-color: var(--adm-border); color: var(--adm-text-2); }
.admin-body .btn-outline-secondary:hover { background: var(--adm-active-bg); color: var(--adm-active-text); border-color: var(--blue); }
.admin-body .btn-outline-danger { border-color: rgba(239,68,68,0.3); color: #DC2626; }
.admin-body .btn-outline-danger:hover { background: rgba(239,68,68,0.1); border-color: #DC2626; }

/* --- POS --- */
.pos-product-btn {
  background: var(--adm-card); border: 1px solid var(--adm-border);
  border-radius: 12px; cursor: pointer; transition: var(--ease); padding: 0.9rem;
}
.pos-product-btn:hover { border-color: var(--blue); background: var(--adm-active-bg); }

/* --- Scrollbars --- */
.adm-sidebar::-webkit-scrollbar { width: 3px; }
.adm-sidebar::-webkit-scrollbar-thumb { background: var(--adm-border); border-radius: 2px; }
::-webkit-scrollbar { width: 6px; height: 6px; }
::-webkit-scrollbar-thumb { background: #CBD5E1; border-radius: 3px; }

/* --- HTMX --- */
.htmx-indicator { opacity: 0; transition: opacity 200ms; }
.htmx-request .htmx-indicator, .htmx-request.htmx-indicator { opacity: 1; }

/* --- adm-card-header alias (used in commerce/stock dashboards) --- */
.adm-card-header {
  padding: 1rem 1.25rem;
  border-bottom: 1px solid var(--adm-border);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem;
}
.adm-card-sub { font-size: 0.75rem; color: var(--adm-muted); margin-top: 0.1rem; }

/* --- KPI icon (square colored icon inside kpi-card) --- */
.kpi-icon {
  width: 44px; height: 44px; border-radius: 12px;
  display: flex; align-items: center; justify-content: center;
  font-size: 1.2rem; flex-shrink: 0;
}

/* --- KPI badge (trend chip top-right of kpi-card) --- */
.kpi-badge {
  display: inline-flex;
  align-items: center;
  gap: 0.2rem;
  padding: 0.2rem 0.5rem;
  border-radius: 50px;
  font-size: 0.7rem;
  font-weight: 700;
  background: rgba(0,87,184,0.1);
  color: var(--adm-active-text);
}
.kpi-badge-up { background: rgba(34,197,94,0.12); color: #16A34A; }
.kpi-badge-down { background: rgba(239,68,68,0.1); color: #DC2626; }

/* --- Status badges (in tables) --- */
.status-badge {
  display: inline-flex; align-items: center; gap: 0.25rem;
  padding: 0.22rem 0.6rem; border-radius: 50px;
  font-size: 0.73rem; font-weight: 600; white-space: nowrap;
}
.status-ok      { background: rgba(34,197,94,0.1);  color: #16A34A; }
.status-pending { background: rgba(245,158,11,0.12); color: #D97706; }
.status-low     { background: rgba(239,68,68,0.1);   color: #DC2626; }

/* --- Notif dot (topbar bell) --- */
.notif-dot {
  position: absolute; top: 6px; right: 6px;
  width: 8px; height: 8px; border-radius: 50%;
  background: #EF4444;
  border: 2px solid var(--adm-topbar);
}

/* --- Badge count (sidebar) --- */
.badge-count {
  display: inline-flex; align-items: center; justify-content: center;
  background: #EF4444; color: #fff;
  font-size: 0.65rem; font-weight: 800;
  min-width: 18px; height: 18px; border-radius: 9px;
  padding: 0 4px; margin-left: auto;
}

/* ================================================================
   ADMIN v4 — NOUVEAU LAYOUT (selon maquette finale)
   ================================================================ */

/* Variables enrichies (light + dark) */
:root {
  --adm-shell-bg:   #F4F7FB;
  --adm-side-bg:    #FFFFFF;
  --adm-side-border:#EAF0F8;
  --adm-deco:       0 12px 40px rgba(0, 60, 130, 0.06);
  --kpi-blue-bg:    #E8F1FF;
  --kpi-blue-fg:    #2563EB;
  --kpi-cyan-bg:    #DCF2FB;
  --kpi-cyan-fg:    #0891B2;
  --kpi-amber-bg:   #FEF3C7;
  --kpi-amber-fg:   #D97706;
  --kpi-red-bg:     #FEE2E2;
  --kpi-red-fg:     #DC2626;
  --kpi-purple-bg:  #EDE9FE;
  --kpi-purple-fg:  #7C3AED;
  --kpi-green-bg:   #D1FAE5;
  --kpi-green-fg:   #059669;
}
[data-theme="dark"] {
  --adm-shell-bg:   #0A1020;
  --adm-side-bg:    #0E1830;
  --adm-side-border:#19264A;
  --adm-deco:       0 12px 40px rgba(0,0,0,0.4);
  --kpi-blue-bg:    rgba(37,99,235,0.18);
  --kpi-blue-fg:    #60A5FA;
  --kpi-cyan-bg:    rgba(8,145,178,0.18);
  --kpi-cyan-fg:    #22D3EE;
  --kpi-amber-bg:   rgba(217,119,6,0.18);
  --kpi-amber-fg:   #FBBF24;
  --kpi-red-bg:     rgba(220,38,38,0.18);
  --kpi-red-fg:     #F87171;
  --kpi-purple-bg:  rgba(124,58,237,0.18);
  --kpi-purple-fg:  #A78BFA;
  --kpi-green-bg:   rgba(5,150,105,0.18);
  --kpi-green-fg:   #34D399;
}

.admin-body {
  background: var(--adm-shell-bg);
  color: var(--adm-text);
  font-family: 'Inter', system-ui, sans-serif;
  margin: 0;
  min-height: 100vh;
}

/* ===== Shell layout ===== */
.adm-shell {
  display: grid;
  grid-template-columns: 260px 1fr;
  min-height: 100vh;
}
@media (max-width: 991px) {
  .adm-shell { grid-template-columns: 1fr; }
}

/* ===== SIDEBAR ===== */
.adm-sidebar {
  background: var(--adm-side-bg);
  border-right: 1px solid var(--adm-side-border);
  padding: 1rem 0.85rem 0.85rem;
  display: flex;
  flex-direction: column;
  gap: 0.4rem;
  position: sticky;
  top: 0;
  height: 100vh;
  overflow-y: auto;
  overflow-x: hidden;
  /* reset old layout overrides */
  width: auto;
  flex-shrink: 0;
  min-height: 0;
  max-height: none;
}
.adm-sidebar::-webkit-scrollbar { width: 4px; }
.adm-sidebar::-webkit-scrollbar-thumb { background: var(--adm-side-border); border-radius: 2px; }
@media (max-width: 991px) {
  .adm-sidebar { position: fixed; top: 0; left: 0; width: 260px; z-index: 1050; transform: translateX(-100%); transition: transform 0.25s; box-shadow: 0 0 30px rgba(0,0,0,0.15); }
  .adm-sidebar.open { transform: translateX(0); }
}

/* Logo card top */
.adm-logo-card {
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 0.7rem;
  border-radius: 14px;
  background: linear-gradient(135deg, rgba(0,87,184,0.04), rgba(0,87,184,0.01));
  border: 1px solid var(--adm-side-border);
  flex-shrink: 0;
}
[data-theme="dark"] .adm-logo-card {
  background: linear-gradient(135deg, rgba(0,87,184,0.18), rgba(0,87,184,0.05));
}
.adm-logo-card img { height: 64px; width: auto; max-width: 100%; }
.adm-logo-fallback {
  width: 64px; height: 64px;
  border-radius: 14px;
  background: linear-gradient(135deg, #0057B8, #1976D2);
  align-items: center; justify-content: center;
  color: #fff; font-size: 1.8rem;
}

/* Profile bloc */
.adm-side-profile,
.adm-side-profile-top {
  display: flex;
  align-items: center;
  gap: 0.7rem;
  padding: 0.6rem;
  border-radius: 12px;
  border: 1px solid var(--adm-side-border);
  background: rgba(255,255,255,0.5);
}
[data-theme="dark"] .adm-side-profile,
[data-theme="dark"] .adm-side-profile-top {
  background: rgba(255,255,255,0.03);
}
.adm-side-profile { margin-top: 0.4rem; flex-shrink: 0; }
.adm-side-profile-top { margin-bottom: 0.5rem; flex-shrink: 0; }
.ssp-avatar {
  width: 38px; height: 38px;
  border-radius: 50%;
  background: linear-gradient(135deg, #D4A147, #92400E);
  color: #fff; font-weight: 800; font-size: 0.78rem;
  display: flex; align-items: center; justify-content: center;
  flex-shrink: 0;
}
.ssp-info { flex: 1; min-width: 0; }
.ssp-name { font-weight: 700; font-size: 0.85rem; color: var(--adm-text); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.ssp-role { font-size: 0.72rem; color: var(--adm-muted); }
.ssp-caret-btn {
  background: transparent; border: none; color: var(--adm-muted);
  padding: 0.2rem 0.4rem; cursor: pointer; border-radius: 6px;
}
.ssp-caret-btn:hover { background: var(--adm-active-bg); color: var(--adm-active-text); }

/* NAV */
.adm-nav {
  display: flex;
  flex-direction: column;
  gap: 2px;
  padding: 0.25rem 0;
}
.adm-nav-item {
  display: flex;
  align-items: center;
  gap: 0.65rem;
  padding: 0.45rem 0.75rem;
  border-radius: 10px;
  color: var(--adm-text-2);
  text-decoration: none;
  font-size: 0.83rem;
  font-weight: 500;
  transition: all 0.18s;
  position: relative;
  flex-shrink: 0;
}
.adm-nav-item i { font-size: 0.95rem; width: 18px; flex-shrink: 0; }
.adm-nav-item:hover {
  background: var(--adm-active-bg);
  color: var(--adm-active-text);
}
.adm-nav-item.active {
  background: #0057B8;
  color: #fff;
  font-weight: 600;
  box-shadow: 0 4px 14px rgba(0,87,184,0.25);
}
[data-theme="dark"] .adm-nav-item.active { background: #1E40AF; }
.adm-nav-badge {
  margin-left: auto;
  background: #EF4444; color: #fff;
  font-size: 0.65rem; font-weight: 800;
  padding: 0.1rem 0.45rem; border-radius: 50px;
  min-width: 20px; text-align: center;
}
.adm-nav-item.active .adm-nav-badge { background: #fff; color: #0057B8; }

/* Help card */
.adm-help-card {
  margin-top: 0.4rem;
  padding: 0.85rem 0.9rem;
  text-align: center;
  border-radius: 12px;
  background: linear-gradient(180deg, rgba(0,87,184,0.06), rgba(0,87,184,0.02));
  border: 1px solid var(--adm-side-border);
  flex-shrink: 0;
}
[data-theme="dark"] .adm-help-card {
  background: linear-gradient(180deg, rgba(0,87,184,0.18), rgba(0,87,184,0.04));
}
.adm-help-img {
  width: 44px; height: 44px;
  margin: 0 auto 0.4rem;
  display: flex; align-items: center; justify-content: center;
}
.adm-help-img img { max-width: 100%; max-height: 100%; object-fit: contain; }
.adm-help-title { font-weight: 700; font-size: 0.82rem; color: var(--adm-text); margin-bottom: 0.1rem; }
.adm-help-text { font-size: 0.72rem; color: var(--adm-muted); margin-bottom: 0.55rem; line-height: 1.35; }
.adm-help-btn {
  display: inline-block; padding: 0.35rem 0.9rem;
  border-radius: 8px;
  background: rgba(255,255,255,0.7);
  border: 1px solid rgba(0,87,184,0.18);
  color: var(--adm-active-text);
  font-size: 0.75rem; font-weight: 600;
  text-decoration: none; transition: all 0.22s;
}
[data-theme="dark"] .adm-help-btn { background: rgba(255,255,255,0.04); border-color: rgba(255,255,255,0.1); }
.adm-help-btn:hover { background: var(--blue); color: #fff; border-color: var(--blue); }

/* ===== CONTENT ===== */
.adm-content {
  display: flex;
  flex-direction: column;
  min-width: 0;
}

/* TOPBAR */
.adm-topbar {
  display: grid;
  grid-template-columns: minmax(280px, 1fr) minmax(320px, 460px) auto;
  align-items: center;
  gap: 1.25rem;
  padding: 1.4rem 2rem 1rem;
  background: var(--adm-shell-bg);
  border-bottom: 1px solid transparent;
  position: relative;
  overflow: hidden;
  /* reset old topbar overrides */
  height: auto;
  top: auto;
  z-index: 1;
  box-shadow: none;
}
@media (max-width: 1399px) {
  .adm-topbar { grid-template-columns: 1fr minmax(280px, 360px) auto; padding: 1.2rem 1.5rem 0.85rem; gap: 1rem; }
}
@media (max-width: 991px) {
  .adm-topbar { grid-template-columns: auto 1fr auto; padding: 1rem 1rem 0.75rem; }
  .adm-topbar-search { display: none; }
}

.adm-topbar-title { min-width: 0; }
.adm-topbar-title h1 {
  font-family: 'Playfair Display', Georgia, serif;
  font-size: clamp(1.4rem, 2vw, 1.85rem);
  font-weight: 700;
  color: var(--adm-text);
  margin: 0;
  letter-spacing: -0.5px;
  line-height: 1.15;
}
.adm-topbar-title h1 .wave { display: inline-block; animation: wave 1.6s ease-in-out infinite; transform-origin: 70% 70%; }
.adm-topbar-title h1 .title-spark { color: #D4A147; font-size: 0.9em; margin-left: 0.25rem; display: inline-block; animation: spark-pulse 2.4s ease-in-out infinite; }
@keyframes spark-pulse { 0%,100% { opacity: 0.6; transform: scale(1); } 50% { opacity: 1; transform: scale(1.15); } }
@keyframes wave {
  0%, 100% { transform: rotate(0); }
  20% { transform: rotate(-12deg); }
  40% { transform: rotate(15deg); }
  60% { transform: rotate(-8deg); }
}
.adm-topbar-title p {
  margin: 0.15rem 0 0;
  font-size: 0.88rem;
  color: var(--adm-muted);
}

.adm-topbar-search {
  position: relative;
  display: flex;
  align-items: center;
  background: var(--adm-card);
  border: 1px solid var(--adm-border);
  border-radius: 50px;
  padding: 0.35rem 0.4rem 0.35rem 1.1rem;
  box-shadow: var(--adm-shadow);
  min-width: 0;
  width: 100%;
}
.adm-topbar-search > i {
  color: var(--adm-muted);
  font-size: 0.95rem;
  margin-right: 0.6rem;
}
.adm-topbar-search input {
  flex: 1; background: transparent; border: none; outline: none;
  color: var(--adm-text); font-size: 0.88rem;
  padding: 0.35rem 0.2rem;
  min-width: 0;
  width: 100%;
}
.adm-topbar-search input::placeholder { color: var(--adm-muted); }
.adm-topbar-search .search-go {
  width: 32px; height: 32px;
  border-radius: 50%;
  background: var(--adm-active-bg);
  color: var(--adm-active-text);
  border: none; display: flex;
  align-items: center; justify-content: center;
  cursor: pointer; font-size: 0.85rem;
  transition: all 0.22s;
}
.adm-topbar-search .search-go:hover { background: #0057B8; color: #fff; }

.adm-topbar-actions {
  display: flex; align-items: center; gap: 0.55rem;
  position: relative; z-index: 2;
}
.adm-topbar-actions .adm-icon-btn {
  width: 42px; height: 42px;
  border-radius: 50%;
  background: var(--adm-card);
  border: 1px solid var(--adm-border);
  color: var(--adm-text-2);
  display: flex; align-items: center; justify-content: center;
  cursor: pointer; transition: all 0.22s;
  box-shadow: var(--adm-shadow);
  position: relative;
}
.adm-topbar-actions .adm-icon-btn:hover { color: var(--adm-active-text); border-color: var(--adm-active-text); }
.notif-badge {
  position: absolute; top: -3px; right: -3px;
  background: #EF4444; color: #fff;
  font-size: 0.62rem; font-weight: 800;
  min-width: 18px; height: 18px; padding: 0 4px;
  border-radius: 50%; display: flex;
  align-items: center; justify-content: center;
  border: 2px solid var(--adm-shell-bg);
}
.adm-topbar-actions .btn-adm-primary {
  border-radius: 50px;
  padding: 0.7rem 1.4rem;
  font-size: 0.85rem;
  font-weight: 600;
  white-space: nowrap;
}

/* Decoration top right */
.adm-topbar-deco {
  position: absolute;
  top: -10px;
  right: -20px;
  width: 240px;
  height: 180px;
  pointer-events: none;
  opacity: 0.14;
  z-index: 0;
}
[data-theme="dark"] .adm-topbar-deco { opacity: 0.45; }
.adm-topbar-deco img { width: 100%; height: 100%; object-fit: cover; object-position: center; }

/* MAIN */
.adm-main {
  padding: 1rem 2rem 2.5rem;
  flex: 1;
  background: var(--adm-shell-bg);
}

/* ===== KPI cards v4 ===== */
.kpi-card-v4 {
  background: var(--adm-card);
  border: 1px solid var(--adm-border);
  border-radius: 16px;
  padding: 1.4rem 1.3rem 1rem;
  box-shadow: var(--adm-shadow);
  transition: all 0.25s;
  position: relative;
  overflow: hidden;
}
.kpi-card-v4:hover { transform: translateY(-3px); box-shadow: 0 12px 30px rgba(0,60,130,0.1); }
.kpi-v4-icon {
  width: 50px; height: 50px;
  border-radius: 14px;
  display: flex; align-items: center; justify-content: center;
  font-size: 1.4rem;
  margin-bottom: 1rem;
}
.kpi-v4-icon.blue   { background: var(--kpi-blue-bg); color: var(--kpi-blue-fg); }
.kpi-v4-icon.cyan   { background: var(--kpi-cyan-bg); color: var(--kpi-cyan-fg); }
.kpi-v4-icon.amber  { background: var(--kpi-amber-bg); color: var(--kpi-amber-fg); }
.kpi-v4-icon.red    { background: var(--kpi-red-bg); color: var(--kpi-red-fg); }
.kpi-v4-icon.purple { background: var(--kpi-purple-bg); color: var(--kpi-purple-fg); }
.kpi-v4-icon.green  { background: var(--kpi-green-bg); color: var(--kpi-green-fg); }

.kpi-v4-label {
  font-size: 0.78rem;
  color: var(--adm-muted);
  font-weight: 500;
  margin-bottom: 0.3rem;
}
.kpi-v4-value {
  font-family: 'Inter', system-ui, sans-serif;
  font-size: 1.55rem;
  font-weight: 800;
  color: var(--adm-text);
  line-height: 1.1;
  display: flex; align-items: baseline; gap: 0.35rem;
}
.kpi-v4-value .unit { font-size: 0.75rem; font-weight: 600; color: var(--adm-muted); letter-spacing: 0.5px; }
.kpi-v4-trend {
  font-size: 0.78rem;
  margin-top: 0.4rem;
  display: flex; align-items: center; gap: 0.3rem;
}
.kpi-v4-trend.up { color: var(--kpi-green-fg); font-weight: 600; }
.kpi-v4-trend.down { color: var(--kpi-red-fg); font-weight: 600; }
.kpi-v4-trend.neutral { color: var(--adm-muted); }
.kpi-v4-trend .vs { color: var(--adm-muted); font-weight: 400; margin-left: 0.2rem; }
.kpi-v4-spark {
  margin-top: 0.85rem;
  width: 100%; height: 36px;
  display: block;
}
.kpi-v4-spark polyline {
  fill: none; stroke-width: 2;
  stroke-linecap: round; stroke-linejoin: round;
  vector-effect: non-scaling-stroke;
}

/* ===== Widget cards (rows 2 & 3) ===== */
.adm-widget {
  background: var(--adm-card);
  border: 1px solid var(--adm-border);
  border-radius: 16px;
  box-shadow: var(--adm-shadow);
  overflow: hidden;
  display: flex;
  flex-direction: column;
}
.adm-widget-head {
  display: flex; align-items: center; justify-content: space-between;
  padding: 1.1rem 1.25rem 0.5rem;
}
.adm-widget-title {
  font-size: 1.02rem;
  font-weight: 700;
  color: var(--adm-text);
}
.adm-widget-link {
  font-size: 0.82rem;
  color: var(--adm-active-text);
  text-decoration: none;
  font-weight: 600;
}
.adm-widget-link:hover { text-decoration: underline; }
.adm-widget-body { padding: 0.75rem 1.25rem 1.25rem; flex: 1; }

/* Donut center text */
.donut-wrap {
  position: relative;
  width: 200px;
  height: 200px;
  margin: 0.5rem auto 1.25rem;
}
.donut-center {
  position: absolute; top: 50%; left: 50%;
  transform: translate(-50%, -50%);
  text-align: center;
  pointer-events: none;
}
.donut-center-val {
  font-size: 1.7rem; font-weight: 800; color: var(--adm-text); line-height: 1;
}
.donut-center-lbl {
  font-size: 0.76rem; color: var(--adm-muted); font-weight: 500; margin-top: 0.2rem;
}

/* Legend rows */
.legend-row {
  display: flex; align-items: center; justify-content: space-between;
  padding: 0.4rem 0;
  font-size: 0.85rem;
}
.legend-row-left { display: flex; align-items: center; gap: 0.55rem; color: var(--adm-text-2); }
.legend-dot {
  width: 11px; height: 11px; border-radius: 3px; flex-shrink: 0;
}
.legend-row-right { font-weight: 700; color: var(--adm-text); font-size: 0.83rem; }
.legend-row-right .pct { font-size: 0.72rem; color: var(--adm-muted); font-weight: 500; margin-left: 0.25rem; }

/* Info banner inside widget */
.widget-info-banner {
  background: var(--adm-active-bg);
  border: 1px solid rgba(0,87,184,0.15);
  border-radius: 10px;
  padding: 0.7rem 0.85rem;
  display: flex;
  gap: 0.6rem;
  align-items: flex-start;
  font-size: 0.8rem;
  color: var(--adm-active-text);
  margin-top: 1rem;
}
[data-theme="dark"] .widget-info-banner { background: rgba(0,87,184,0.18); border-color: rgba(0,87,184,0.3); }
.widget-info-banner i { font-size: 1rem; flex-shrink: 0; margin-top: 1px; }

/* Movement / Alert / Top row item */
.row-item {
  display: flex;
  align-items: center;
  gap: 0.85rem;
  padding: 0.7rem 0;
  border-bottom: 1px solid var(--adm-border);
}
.row-item:last-child { border-bottom: none; }
.row-img {
  width: 42px; height: 42px;
  border-radius: 10px;
  background: var(--adm-active-bg);
  flex-shrink: 0;
  display: flex; align-items: center; justify-content: center;
  overflow: hidden;
  font-size: 1.1rem;
  color: var(--adm-active-text);
}
.row-img img { width: 100%; height: 100%; object-fit: cover; }
.row-info { flex: 1; min-width: 0; }
.row-name { font-weight: 600; font-size: 0.88rem; color: var(--adm-text); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.row-sub { font-size: 0.74rem; color: var(--adm-muted); }
.row-meta { text-align: right; flex-shrink: 0; }
.row-change { font-weight: 700; font-size: 0.92rem; }
.row-change.plus { color: var(--kpi-green-fg); }
.row-change.minus { color: var(--kpi-red-fg); }
.row-date { font-size: 0.74rem; color: var(--adm-muted); margin-top: 0.15rem; }

/* "Commander" outlined button (for alerts) */
.btn-cmd {
  background: transparent;
  border: 1.5px solid var(--adm-active-text);
  color: var(--adm-active-text);
  padding: 0.4rem 1rem;
  border-radius: 8px;
  font-size: 0.78rem;
  font-weight: 600;
  text-decoration: none;
  transition: all 0.22s;
  white-space: nowrap;
  display: inline-flex; align-items: center; gap: 0.3rem;
}
.btn-cmd:hover { background: var(--adm-active-text); color: #fff; }

/* Top produits table */
.top-table { width: 100%; }
.top-table th {
  text-align: left; font-size: 0.72rem; font-weight: 600;
  color: var(--adm-muted); padding: 0.5rem 0.6rem;
  text-transform: none; letter-spacing: 0; border-bottom: 1px solid var(--adm-border);
}
.top-table td {
  padding: 0.7rem 0.6rem;
  border-bottom: 1px solid var(--adm-border);
  font-size: 0.85rem;
  color: var(--adm-text);
  vertical-align: middle;
}
.top-table td:last-child { font-weight: 700; }
.top-table tr:last-child td { border-bottom: none; }

.top-product-cell {
  display: flex; align-items: center; gap: 0.6rem;
}
.top-product-img {
  width: 36px; height: 36px;
  border-radius: 8px;
  background: var(--adm-active-bg);
  display: flex; align-items: center; justify-content: center;
  flex-shrink: 0; overflow: hidden;
  color: var(--adm-active-text);
}
.top-product-img img { width: 100%; height: 100%; object-fit: cover; }

/* Stock value variation bar */
.value-variation {
  display: flex; align-items: center; gap: 0.85rem;
  padding: 1rem 1.25rem;
  background: var(--adm-active-bg);
  border-top: 1px solid var(--adm-border);
}
[data-theme="dark"] .value-variation { background: rgba(0,87,184,0.1); }
.value-variation-icon {
  width: 38px; height: 38px;
  border-radius: 10px;
  background: var(--adm-card);
  display: flex; align-items: center; justify-content: center;
  color: var(--adm-active-text); flex-shrink: 0;
}
.value-variation-info { flex: 1; }
.value-variation-lbl { font-size: 0.74rem; color: var(--adm-muted); font-weight: 500; }
.value-variation-val { font-size: 1.1rem; font-weight: 800; color: var(--adm-text); }
.value-variation-val .unit { font-size: 0.72rem; font-weight: 500; color: var(--adm-muted); margin-left: 0.2rem; }
.value-variation-pct {
  background: var(--kpi-green-bg);
  color: var(--kpi-green-fg);
  font-size: 0.78rem; font-weight: 700;
  padding: 0.3rem 0.7rem;
  border-radius: 50px;
}

/* --- Responsive --- */
@media (max-width: 991.98px) {
  .auth-left { display: none; }
  .auth-right { background: #fff; }
  .navbar-site .nav-links { display: none; }
}

/* ============================================================
   PETITES TOUCHES — animations subtiles
   ============================================================ */

/* Fade-in léger au chargement de la page (toutes les pages) */
@keyframes pageFadeIn {
  from { opacity: 0; transform: translateY(6px); }
  to   { opacity: 1; transform: none; }
}
main, .adm-main {
  animation: pageFadeIn 0.4s ease both;
}

/* Compteurs animés — style de base */
[data-count] {
  display: inline-block;
  font-variant-numeric: tabular-nums;
}

/* Hero — petites particules dorées flottantes (décoratif) */
.tda-hero { position: relative; overflow: hidden; }
.tda-hero::before,
.tda-hero::after {
  content: "";
  position: absolute;
  border-radius: 50%;
  background: radial-gradient(circle, rgba(212,161,71,0.45) 0%, rgba(212,161,71,0) 70%);
  pointer-events: none;
  animation: heroFloat 9s ease-in-out infinite;
  z-index: 1;
}
.tda-hero::before {
  width: 180px; height: 180px;
  top: 12%; left: 8%;
  animation-delay: 0s;
}
.tda-hero::after {
  width: 130px; height: 130px;
  bottom: 18%; right: 10%;
  animation-delay: -4.5s;
}
@keyframes heroFloat {
  0%, 100% { transform: translate(0, 0) scale(1); opacity: 0.55; }
  50%      { transform: translate(20px, -30px) scale(1.1); opacity: 0.85; }
}
.tda-hero > * { position: relative; z-index: 2; }

/* Particules supplémentaires (étoiles scintillantes) */
.tda-hero .hero-spark {
  position: absolute;
  width: 4px; height: 4px;
  background: #F5C842;
  border-radius: 50%;
  box-shadow: 0 0 10px #F5C842, 0 0 18px rgba(245,200,66,0.6);
  pointer-events: none;
  animation: sparkTwinkle 3.5s ease-in-out infinite;
  z-index: 1;
}
@keyframes sparkTwinkle {
  0%, 100% { opacity: 0; transform: scale(0.6); }
  50%      { opacity: 1; transform: scale(1.2); }
}

/* Effet hover subtil sur les cartes admin (KPI, widgets) */
.kpi-card, .adm-widget {
  transition: transform 0.25s ease, box-shadow 0.25s ease;
}
.kpi-card:hover {
  transform: translateY(-3px);
  box-shadow: 0 8px 24px rgba(0,87,184,0.12);
}

/* Lien nav qui s'illumine au hover (navbar publique) */
.nav-links a {
  position: relative;
  transition: color 0.2s;
}
.nav-links a::after {
  content: "";
  position: absolute;
  left: 0; right: 0; bottom: -4px;
  height: 2px;
  background: linear-gradient(90deg, #D4A147, #0057B8);
  transform: scaleX(0);
  transform-origin: left;
  transition: transform 0.28s ease;
}
.nav-links a:hover::after,
.nav-links a.active::after { transform: scaleX(1); }

/* Boutons : léger « rebond » au clic */
.btn-tda:active,
.btn-hero-blue:active,
.p-card-btn:active,
.filter-apply-btn:active,
.btn-cmd:active,
.btn-adm-primary:active { transform: scale(0.97); transition: transform 0.08s; }


/* ============================================================
   DARK MODE — overrides Bootstrap
   Couvre les classes standards (.card, .table, .form-control...)
   utilisées dans les pages historique des ventes, listes,
   formulaires, etc. (commerce + stock)
   ============================================================ */
[data-theme="dark"] .card,
[data-theme="dark"] .card-body,
[data-theme="dark"] .card-header,
[data-theme="dark"] .card-footer {
  background-color: var(--adm-card) !important;
  border-color: var(--adm-border) !important;
  color: var(--adm-text);
}

[data-theme="dark"] .card-header {
  background-color: var(--adm-card-hover) !important;
}

/* Tables */
[data-theme="dark"] .table {
  --bs-table-bg: var(--adm-card);
  --bs-table-color: var(--adm-text);
  --bs-table-border-color: var(--adm-border);
  --bs-table-striped-bg: rgba(255,255,255,0.02);
  --bs-table-striped-color: var(--adm-text);
  --bs-table-hover-bg: var(--adm-card-hover);
  --bs-table-hover-color: var(--adm-text);
  color: var(--adm-text);
  background-color: var(--adm-card);
  border-color: var(--adm-border);
}
[data-theme="dark"] .table > :not(caption) > * > * {
  background-color: var(--adm-card);
  color: var(--adm-text);
  border-bottom-color: var(--adm-border);
}
[data-theme="dark"] .table thead th {
  background-color: var(--adm-card-hover) !important;
  color: var(--adm-text-2);
  border-bottom: 1px solid var(--adm-border);
  font-weight: 700;
}
[data-theme="dark"] .table-hover > tbody > tr:hover > * {
  background-color: var(--adm-card-hover) !important;
  color: var(--adm-text) !important;
}

/* Formulaires (input, select, textarea) */
[data-theme="dark"] .form-control,
[data-theme="dark"] .form-select,
[data-theme="dark"] textarea.form-control,
[data-theme="dark"] input.form-control {
  background-color: var(--adm-input-bg) !important;
  border-color: var(--adm-border) !important;
  color: var(--adm-text) !important;
}
[data-theme="dark"] .form-control::placeholder,
[data-theme="dark"] .form-select::placeholder {
  color: var(--adm-muted) !important;
  opacity: 1;
}
[data-theme="dark"] .form-control:focus,
[data-theme="dark"] .form-select:focus {
  background-color: var(--adm-input-bg) !important;
  border-color: var(--adm-active-text) !important;
  color: var(--adm-text) !important;
  box-shadow: 0 0 0 0.2rem rgba(0,87,184,0.18) !important;
}
[data-theme="dark"] .form-select option {
  background-color: var(--adm-card);
  color: var(--adm-text);
}
[data-theme="dark"] .form-label {
  color: var(--adm-text-2);
}

/* Texte muted */
[data-theme="dark"] .text-muted,
[data-theme="dark"] small.text-muted {
  color: var(--adm-muted) !important;
}

/* Boutons outline (Détail) — visibilité en dark */
[data-theme="dark"] .btn-outline-secondary,
[data-theme="dark"] .btn-outline-primary {
  color: var(--adm-text);
  border-color: var(--adm-border);
}
[data-theme="dark"] .btn-tda-outline {
  color: var(--adm-active-text) !important;
  border-color: var(--adm-active-text) !important;
  background-color: transparent !important;
}
[data-theme="dark"] .btn-tda-outline:hover {
  background-color: var(--adm-active-text) !important;
  color: #fff !important;
}

/* Badges Bootstrap classiques (bg-info, bg-secondary, etc.) */
[data-theme="dark"] .badge.bg-secondary {
  background-color: #475569 !important;
}
[data-theme="dark"] .badge.bg-info {
  background-color: #0EA5E9 !important;
  color: #fff !important;
}
[data-theme="dark"] .badge.bg-light {
  background-color: #334155 !important;
  color: var(--adm-text) !important;
}

/* Liens dans les cards */
[data-theme="dark"] .card a:not(.btn) {
  color: var(--adm-active-text);
}

/* Modals Bootstrap */
[data-theme="dark"] .modal-content {
  background-color: var(--adm-card);
  color: var(--adm-text);
  border-color: var(--adm-border);
}
[data-theme="dark"] .modal-header,
[data-theme="dark"] .modal-footer {
  border-color: var(--adm-border);
}
[data-theme="dark"] .modal-header .btn-close {
  filter: invert(1) grayscale(100%) brightness(200%);
}

/* Dropdowns Bootstrap */
[data-theme="dark"] .dropdown-menu {
  background-color: var(--adm-card);
  border-color: var(--adm-border);
}
[data-theme="dark"] .dropdown-item {
  color: var(--adm-text);
}
[data-theme="dark"] .dropdown-item:hover,
[data-theme="dark"] .dropdown-item:focus {
  background-color: var(--adm-card-hover);
  color: var(--adm-text);
}
[data-theme="dark"] .dropdown-divider {
  border-color: var(--adm-border);
}

/* Breadcrumbs */
[data-theme="dark"] .breadcrumb {
  background-color: transparent;
}
[data-theme="dark"] .breadcrumb-item,
[data-theme="dark"] .breadcrumb-item.active {
  color: var(--adm-text-2);
}
[data-theme="dark"] .breadcrumb-item a {
  color: var(--adm-active-text);
}
[data-theme="dark"] .breadcrumb-item + .breadcrumb-item::before {
  color: var(--adm-muted);
}

/* Alertes (messages Django) */
[data-theme="dark"] .alert-success {
  background-color: rgba(16,185,129,0.15);
  color: #6EE7B7;
  border-color: rgba(16,185,129,0.3);
}
[data-theme="dark"] .alert-danger,
[data-theme="dark"] .alert-error {
  background-color: rgba(239,68,68,0.15);
  color: #FCA5A5;
  border-color: rgba(239,68,68,0.3);
}
[data-theme="dark"] .alert-warning {
  background-color: rgba(245,158,11,0.15);
  color: #FCD34D;
  border-color: rgba(245,158,11,0.3);
}
[data-theme="dark"] .alert-info {
  background-color: rgba(14,165,233,0.15);
  color: #7DD3FC;
  border-color: rgba(14,165,233,0.3);
}

/* HR */
[data-theme="dark"] hr { border-top-color: var(--adm-border); }

/* Pagination */
[data-theme="dark"] .pagination .page-link {
  background-color: var(--adm-card);
  border-color: var(--adm-border);
  color: var(--adm-text);
}
[data-theme="dark"] .pagination .page-link:hover {
  background-color: var(--adm-card-hover);
  color: var(--adm-active-text);
}
[data-theme="dark"] .pagination .page-item.active .page-link {
  background-color: var(--adm-active-text);
  border-color: var(--adm-active-text);
  color: #fff;
}
[data-theme="dark"] .pagination .page-item.disabled .page-link {
  background-color: var(--adm-card);
  color: var(--adm-muted);
}

/* Titres bleus codés en dur (#0057B8) — lisibles en dark */
[data-theme="dark"] h1[style*="0057B8"],
[data-theme="dark"] h2[style*="0057B8"],
[data-theme="dark"] h3[style*="0057B8"],
[data-theme="dark"] h4[style*="0057B8"] {
  color: var(--adm-active-text) !important;
}

/* Listes avec fond clair codé en dur */
[data-theme="dark"] .bg-light,
[data-theme="dark"] [style*="background:#f8f9fa"],
[data-theme="dark"] [style*="background-color:#f8f9fa"] {
  background-color: var(--adm-card-hover) !important;
  color: var(--adm-text) !important;
}

/* Inputs date / time / number (calendrier coloré) */
[data-theme="dark"] input[type="date"],
[data-theme="dark"] input[type="time"],
[data-theme="dark"] input[type="number"] {
  color-scheme: dark;
}

