/* ==========================================================================
   DIKISHA — Design system du frontend web
   ==========================================================================
   Feuille de style unique, partagee par tous les templates (chargee depuis
   base.html). Construite sur des variables CSS (custom properties) pour
   garder une identite visuelle coherente et facile a ajuster.
   ========================================================================== */

:root {
  /* --- Palette principale ------------------------------------------------ */
  --dikisha-primary: #4f46e5;
  --dikisha-primary-dark: #4338ca;
  --dikisha-primary-light: #eef2ff;
  --dikisha-accent: #06b6d4;

  /* --- Semantique ---------------------------------------------------------- */
  --dikisha-success: #10b981;
  --dikisha-success-light: #ecfdf5;
  --dikisha-warning: #f59e0b;
  --dikisha-warning-light: #fffbeb;
  --dikisha-danger: #ef4444;
  --dikisha-danger-light: #fef2f2;
  --dikisha-info: #3b82f6;

  /* --- Neutres (echelle slate) --------------------------------------------- */
  --dikisha-ink: #0f172a;
  --dikisha-body: #334155;
  --dikisha-muted: #64748b;
  --dikisha-border: #e2e8f0;
  --dikisha-surface: #ffffff;
  --dikisha-bg: #f6f7fb;

  /* --- Forme ---------------------------------------------------------------- */
  --dikisha-radius-sm: 8px;
  --dikisha-radius: 14px;
  --dikisha-radius-lg: 20px;
  --dikisha-shadow-sm: 0 1px 2px rgba(15, 23, 42, 0.06);
  --dikisha-shadow: 0 4px 16px rgba(15, 23, 42, 0.06), 0 1px 3px rgba(15, 23, 42, 0.08);
  --dikisha-shadow-lg: 0 20px 40px rgba(15, 23, 42, 0.12);
}

/* --- Base ------------------------------------------------------------------ */
body {
  font-family: "Inter", -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  background-color: var(--dikisha-bg);
  color: var(--dikisha-body);
}

h1, h2, h3, h4, h5, h6 { color: var(--dikisha-ink); font-weight: 700; letter-spacing: -0.01em; }

a { color: var(--dikisha-primary); text-decoration: none; }
a:hover { color: var(--dikisha-primary-dark); }

/* ==========================================================================
   Barre laterale (sidebar)
   ========================================================================== */
.dikisha-shell { min-height: 100vh; }

.dikisha-sidebar {
  width: 264px;
  min-width: 264px;
  min-height: 100vh;
  background: var(--dikisha-surface);
  border-right: 1px solid var(--dikisha-border);
  padding: 20px 16px;
  position: sticky;
  top: 0;
  flex-shrink: 0;
  overflow: hidden;
  transition: width .2s ease, min-width .2s ease, padding .2s ease, opacity .15s ease;
}

/* Repli du menu lateral (demande explicite : "prevoir la possibilite de
   cacher le menu lateral gauche pour avoir un ecran large") - la sidebar
   reste dans le DOM (evite de re-render le menu au clic) mais sa largeur
   est ramenee a 0 (plus fiable en flexbox qu'un margin-left negatif, qui
   ne libere pas toujours l'espace reserve par le conteneur flex) ; l'etat
   est persiste en localStorage (voir base.html). */
.dikisha-shell.dikisha-sidebar-collapsed .dikisha-sidebar {
  width: 0;
  min-width: 0;
  padding-left: 0;
  padding-right: 0;
  border-right: none;
  opacity: 0;
  pointer-events: none;
}

.dikisha-icon-btn {
  border: none;
  background: var(--dikisha-bg);
  color: var(--dikisha-muted);
  border-radius: 10px;
  width: 38px;
  height: 38px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: 16px;
  flex-shrink: 0;
  transition: background-color .15s ease, color .15s ease;
}
.dikisha-icon-btn:hover { background: var(--dikisha-primary-light); color: var(--dikisha-primary-dark); }
.dikisha-icon-btn.active { background: var(--dikisha-primary-light); color: var(--dikisha-primary-dark); }
.dikisha-icon-btn i { font-size: 16px; }

/* Petit indice visuel (fleche retournee) quand le menu est replie, pour que
   le bouton continue a se comprendre comme un "toggle" dans les deux etats. */
.dikisha-shell.dikisha-sidebar-collapsed #sidebarToggleBtn {
  background: var(--dikisha-primary-light);
  color: var(--dikisha-primary-dark);
}
.dikisha-shell.dikisha-sidebar-collapsed #sidebarToggleBtn i { transform: scaleX(-1); }

/* Cloche de notifications (demande explicite : "integrer un systeme de
   notification") - badge de compteur non lus + liste deroulante. */
.dikisha-notif-wrap { position: relative; }
.dikisha-notif-badge {
  position: absolute;
  top: -3px;
  right: -3px;
  min-width: 16px;
  height: 16px;
  padding: 0 4px;
  border-radius: 999px;
  background: var(--dikisha-danger);
  color: #fff;
  font-size: 10px;
  font-weight: 700;
  line-height: 16px;
  text-align: center;
}
.dikisha-notif-dropdown { width: 360px; max-width: 90vw; padding: 0; }
.dikisha-notif-dropdown-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 12px 16px;
  border-bottom: 1px solid var(--dikisha-border);
}
.dikisha-notif-list { max-height: 380px; overflow-y: auto; }
.dikisha-notif-item {
  display: block;
  width: 100%;
  text-align: left;
  padding: 12px 16px;
  border: none;
  border-bottom: 1px solid var(--dikisha-border);
  background: none;
  text-decoration: none;
  color: inherit;
}
.dikisha-notif-item:last-child { border-bottom: none; }
.dikisha-notif-item:hover { background: var(--dikisha-bg); }
.dikisha-notif-item.unread { background: var(--dikisha-primary-light); }
.dikisha-notif-title { font-weight: 600; font-size: 13.5px; color: var(--dikisha-ink); }
.dikisha-notif-body { font-size: 12.5px; color: var(--dikisha-muted); margin-top: 2px; }
.dikisha-notif-time { font-size: 11px; color: var(--dikisha-muted); margin-top: 4px; }

.dikisha-brand {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 4px 8px 24px;
}

.dikisha-brand-mark {
  width: 36px;
  height: 36px;
  border-radius: 10px;
  background: linear-gradient(135deg, var(--dikisha-primary), var(--dikisha-accent));
  display: flex;
  align-items: center;
  justify-content: center;
  color: #fff;
  font-weight: 800;
  font-size: 15px;
}

.dikisha-brand-text { font-weight: 800; font-size: 18px; color: var(--dikisha-ink); letter-spacing: -0.02em; }
.dikisha-brand-sub { font-size: 11px; color: var(--dikisha-muted); margin-top: -2px; }

.dikisha-nav-link {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 10px 12px;
  border-radius: var(--dikisha-radius-sm);
  color: var(--dikisha-body);
  font-weight: 500;
  font-size: 14px;
  transition: background-color .15s ease, color .15s ease;
}

.dikisha-nav-link i { font-size: 17px; width: 20px; text-align: center; color: var(--dikisha-muted); }

.dikisha-nav-link:hover { background: var(--dikisha-primary-light); color: var(--dikisha-primary-dark); }
.dikisha-nav-link:hover i { color: var(--dikisha-primary-dark); }

.dikisha-nav-link.active {
  background: var(--dikisha-primary);
  color: #fff;
  box-shadow: var(--dikisha-shadow-sm);
}
.dikisha-nav-link.active i { color: #fff; }

/* ==========================================================================
   Barre superieure (topbar)
   ========================================================================== */
.dikisha-topbar {
  background: var(--dikisha-surface);
  border-bottom: 1px solid var(--dikisha-border);
  padding: 12px 24px;
  display: flex;
  align-items: center;
  gap: 16px;
}

.dikisha-store-switcher .btn {
  border-radius: 999px;
  border: 1px solid var(--dikisha-border);
  background: var(--dikisha-bg);
  font-size: 13px;
  font-weight: 600;
  color: var(--dikisha-ink);
  padding: 6px 14px;
}

.dikisha-avatar {
  width: 36px;
  height: 36px;
  border-radius: 50%;
  background: var(--dikisha-primary-light);
  color: var(--dikisha-primary-dark);
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 700;
  font-size: 13px;
}

.dikisha-role-badge {
  font-size: 11px;
  font-weight: 600;
  padding: 2px 10px;
  border-radius: 999px;
  background: var(--dikisha-primary-light);
  color: var(--dikisha-primary-dark);
}

/* Pied de la sidebar : version de la plateforme + lien "A propos" (demande
   explicite : "il faut definir la version, ajouter aussi about"). */
.dikisha-sidebar-footer {
  border-top: 1px solid var(--dikisha-border);
  padding-top: 10px;
  font-size: 11px;
}
.dikisha-sidebar-footer a:hover { color: var(--dikisha-primary) !important; }

/* ==========================================================================
   Cartes et KPI
   ========================================================================== */
.dikisha-card {
  background: var(--dikisha-surface);
  border: 1px solid var(--dikisha-border);
  border-radius: var(--dikisha-radius);
  box-shadow: var(--dikisha-shadow-sm);
}

.dikisha-card-body { padding: 22px; }

.kpi-card {
  border: 1px solid var(--dikisha-border);
  border-radius: var(--dikisha-radius);
  background: var(--dikisha-surface);
  box-shadow: var(--dikisha-shadow-sm);
  transition: transform .15s ease, box-shadow .15s ease;
}
.kpi-card:hover { transform: translateY(-2px); box-shadow: var(--dikisha-shadow); }

/* Cartes/indicateurs cliquables menant vers un ecran de detail (demande
   explicite : "le tableau de bord... n'est pas interactif"). Le curseur
   "pointer" est le seul signal necessaire : la carte est deja englobee dans
   un <a>, qui herite du survol/transform de .kpi-card ci-dessus. */
.kpi-card-clickable,
a:hover .kpi-card-clickable { cursor: pointer; }
.dikisha-card.kpi-card-clickable { transition: transform .15s ease, box-shadow .15s ease; }
.dikisha-card.kpi-card-clickable:hover { transform: translateY(-2px); box-shadow: var(--dikisha-shadow); }

.kpi-icon {
  width: 42px;
  height: 42px;
  border-radius: 12px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 19px;
  flex-shrink: 0;
}
.kpi-icon.bg-primary-soft { background: var(--dikisha-primary-light); color: var(--dikisha-primary); }
.kpi-icon.bg-success-soft { background: var(--dikisha-success-light); color: var(--dikisha-success); }
.kpi-icon.bg-warning-soft { background: var(--dikisha-warning-light); color: var(--dikisha-warning); }
.kpi-icon.bg-danger-soft { background: var(--dikisha-danger-light); color: var(--dikisha-danger); }
.kpi-icon.bg-info-soft { background: #eff6ff; color: var(--dikisha-info); }
.kpi-icon.bg-muted-soft { background: #f1f5f9; color: var(--dikisha-muted); }

.kpi-value { font-size: 26px; font-weight: 800; color: var(--dikisha-ink); letter-spacing: -0.02em; }
.kpi-label { font-size: 12.5px; color: var(--dikisha-muted); font-weight: 600; text-transform: uppercase; letter-spacing: .04em; }

/* ==========================================================================
   Badges de statut
   ========================================================================== */
.badge-soft { border-radius: 999px; padding: 4px 12px; font-weight: 600; font-size: 11.5px; }
.badge-status-ACTIVE, .badge-soft-success { background: var(--dikisha-success-light); color: var(--dikisha-success); }
.badge-status-SUSPENDED, .badge-soft-warning { background: var(--dikisha-warning-light); color: #b45309; }
.badge-status-ARCHIVED, .badge-soft-muted { background: #f1f5f9; color: var(--dikisha-muted); }
.badge-soft-danger { background: var(--dikisha-danger-light); color: var(--dikisha-danger); }
.badge-soft-info { background: #eff6ff; color: var(--dikisha-info); }

/* ==========================================================================
   Vue chronologique (journal d'audit - demande explicite : "vue chronologique")
   ========================================================================== */
.dikisha-timeline { position: relative; padding-left: 6px; }
.dikisha-timeline-item { position: relative; display: flex; gap: 14px; padding: 10px 0 10px 0; }
.dikisha-timeline-item:not(:last-child) { border-bottom: 1px solid var(--dikisha-border); }
.dikisha-timeline-icon {
  flex-shrink: 0;
  width: 34px;
  height: 34px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 15px;
}
.dikisha-timeline-body { flex: 1 1 auto; min-width: 0; }

/* ==========================================================================
   Tableaux
   ========================================================================== */
.dikisha-table thead th {
  font-size: 11.5px;
  text-transform: uppercase;
  letter-spacing: .04em;
  color: var(--dikisha-muted);
  font-weight: 700;
  border-bottom: 1px solid var(--dikisha-border);
  padding: 12px 16px;
}
.dikisha-table tbody td { padding: 14px 16px; vertical-align: middle; border-bottom: 1px solid var(--dikisha-border); font-size: 14px; }
.dikisha-table tbody tr:last-child td { border-bottom: none; }
.dikisha-table tbody tr:hover { background: var(--dikisha-bg); }

/* ==========================================================================
   Boutons
   ========================================================================== */
.btn-dikisha-primary {
  background: var(--dikisha-primary);
  border: none;
  color: #fff;
  font-weight: 600;
  border-radius: var(--dikisha-radius-sm);
  padding: 10px 18px;
  box-shadow: var(--dikisha-shadow-sm);
}
.btn-dikisha-primary:hover { background: var(--dikisha-primary-dark); color: #fff; }

/* ==========================================================================
   Formulaires
   ========================================================================== */
.dikisha-input, input[type="text"].form-control, input[type="email"].form-control,
input[type="password"].form-control, input[type="number"].form-control,
input[type="search"].form-control, textarea.form-control, select.form-select {
  border-radius: var(--dikisha-radius-sm);
  border: 1px solid var(--dikisha-border);
  padding: 10px 14px;
  font-size: 14px;
}
.form-control:focus, .form-select:focus {
  border-color: var(--dikisha-primary);
  box-shadow: 0 0 0 3px var(--dikisha-primary-light);
}

/* ==========================================================================
   Ecran de connexion
   ========================================================================== */
.dikisha-auth-shell { min-height: 100vh; display: flex; }

.dikisha-auth-panel {
  position: relative;
  flex: 1.1;
  color: #fff;
  padding: 56px;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  overflow: hidden;
  /* Photo (demande explicite : "image reelle des entrepreneurs qui se
     rejouissent") en fond PLEIN CADRE du panneau gauche (pas une vignette
     inseree au milieu) - superposee de degrades sombres (haut -> bas, plus
     le degrade radial de marque d'origine conserve par-dessus) pour que le
     texte blanc reste parfaitement lisible quel que soit le contenu de la
     photo. L'ordre ci-dessous compte : le PREMIER calque liste est celui du
     DESSUS (les degrades), le DERNIER est celui du DESSOUS (la photo) -
     `background-color` sert de repli uni si jamais la photo ne charge pas
     (connexion coupee, CDN indisponible...). */
  background-color: var(--dikisha-ink);
  background-image:
    linear-gradient(180deg, rgba(15, 23, 42, .55) 0%, rgba(15, 23, 42, .55) 45%, rgba(15, 23, 42, .93) 100%),
    radial-gradient(circle at top left, rgba(67, 55, 202, .55), rgba(15, 23, 42, .15) 70%),
    url("https://images.unsplash.com/photo-1758691737584-a8f17fb34475?q=80&w=1400&auto=format&fit=crop");
  background-size: cover, cover, cover;
  background-position: center, top left, center;
  background-repeat: no-repeat, no-repeat, no-repeat;
}

.dikisha-auth-form { flex: 1; display: flex; align-items: center; justify-content: center; padding: 40px; background: var(--dikisha-surface); }
.dikisha-auth-card { width: 100%; max-width: 410px; position: relative; padding: 30px; border: 1px solid var(--dikisha-border); border-radius: 18px; background: var(--dikisha-surface); box-shadow: var(--dikisha-shadow); }
.dikisha-auth-theme { position: absolute; top: 20px; right: 20px; }

.dikisha-auth-feature { display: flex; gap: 12px; align-items: flex-start; margin-bottom: 18px; }
.dikisha-auth-feature i { font-size: 20px; color: var(--dikisha-accent); margin-top: 2px; }
.dikisha-auth-feature-text { font-size: 13.5px; opacity: .85; }

@media (max-width: 991.98px) {
  .dikisha-auth-form { min-height: 100vh; padding: 24px; background: var(--dikisha-bg); }
}
@media (max-width: 575.98px) {
  .dikisha-auth-form { padding: 14px; }
  .dikisha-auth-card { padding: 24px 20px; }
  .dikisha-auth-theme { top: 14px; right: 14px; }
}

/* ==========================================================================
   Ecran POS (kiosque)
   ========================================================================== */
.pos-shell { min-height: 100vh; background: var(--dikisha-bg); }

.pos-topbar {
  background: var(--dikisha-ink);
  color: #fff;
  padding: 14px 24px;
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.pos-panel { background: var(--dikisha-surface); border-radius: var(--dikisha-radius); box-shadow: var(--dikisha-shadow-sm); border: 1px solid var(--dikisha-border); }

.pos-product-result {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 12px 14px;
  border-bottom: 1px solid var(--dikisha-border);
  cursor: pointer;
  transition: background-color .1s ease;
}
.pos-product-result:hover { background: var(--dikisha-primary-light); }
.pos-product-result:last-child { border-bottom: none; }

.pos-cart-line { display: flex; align-items: center; gap: 10px; padding: 10px 4px; border-bottom: 1px dashed var(--dikisha-border); }
.pos-qty-btn {
  width: 30px; height: 30px; border-radius: 8px; border: 1px solid var(--dikisha-border);
  background: var(--dikisha-bg); display: flex; align-items: center; justify-content: center;
}

.pos-total-bar { font-size: 28px; font-weight: 800; color: var(--dikisha-ink); }

.pos-pay-btn {
  background: linear-gradient(135deg, var(--dikisha-success), #059669);
  border: none; color: #fff; font-weight: 700; font-size: 16px;
  border-radius: var(--dikisha-radius); padding: 16px; box-shadow: var(--dikisha-shadow);
}
.pos-pay-btn:hover { filter: brightness(1.05); color: #fff; }

/* ==========================================================================
   Etats vides
   ========================================================================== */
.dikisha-empty-state { text-align: center; padding: 56px 24px; color: var(--dikisha-muted); }
.dikisha-empty-state i { font-size: 40px; color: var(--dikisha-border); margin-bottom: 12px; display: block; }

/* Miniature produit dans les listes (demande explicite : "ajouter l'affichage
   des icone des produits dans la liste"). */
.dikisha-thumb {
  width: 40px;
  height: 40px;
  border-radius: 8px;
  object-fit: cover;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  background: var(--dikisha-bg);
  border: 1px solid var(--dikisha-border);
  color: var(--dikisha-muted);
  font-size: 16px;
}
.dikisha-thumb-placeholder { flex-shrink: 0; }

/* ==========================================================================
   Divers
   ========================================================================== */
.dikisha-scrollbox { max-height: 260px; overflow-y: auto; }
.dikisha-connectivity-online { color: var(--dikisha-success); font-weight: 600; }
.dikisha-connectivity-offline { color: var(--dikisha-warning); font-weight: 600; }

/* ===========================================================================
   DIKISHA Horizon - themes et structure applicative
   ========================================================================== */
:root,
:root[data-theme="light"] {
  --dikisha-primary: #315cec;
  --dikisha-primary-dark: #2448c7;
  --dikisha-primary-light: #eaf0ff;
  --dikisha-accent: #1ca884;
  --dikisha-success: #138a69;
  --dikisha-success-light: #e8f7f1;
  --dikisha-warning: #bd7612;
  --dikisha-warning-light: #fff4dc;
  --dikisha-danger: #c24343;
  --dikisha-danger-light: #fff0f0;
  --dikisha-info: #3976d9;
  --dikisha-ink: #172235;
  --dikisha-body: #4a5869;
  --dikisha-muted: #718095;
  --dikisha-border: #e6e1d8;
  --dikisha-surface: #ffffff;
  --dikisha-surface-soft: #f9f7f2;
  --dikisha-bg: #f5f2eb;
  --dikisha-sidebar: #11233e;
  --dikisha-sidebar-soft: #193453;
  --dikisha-sidebar-text: #cbd5e2;
  --dikisha-sidebar-muted: #8192a8;
  --dikisha-shadow-sm: 0 1px 2px rgba(29, 35, 48, .05);
  --dikisha-shadow: 0 12px 32px rgba(29, 35, 48, .08);
  --dikisha-shadow-lg: 0 24px 54px rgba(29, 35, 48, .14);
}

:root[data-theme="dark"] {
  --dikisha-primary: #7795ff;
  --dikisha-primary-dark: #9bb0ff;
  --dikisha-primary-light: #23375f;
  --dikisha-accent: #52c9a6;
  --dikisha-success: #52c9a6;
  --dikisha-success-light: #173e37;
  --dikisha-warning: #f0b858;
  --dikisha-warning-light: #493719;
  --dikisha-danger: #ff8888;
  --dikisha-danger-light: #4a252b;
  --dikisha-info: #86b4ff;
  --dikisha-ink: #eef3f8;
  --dikisha-body: #b9c5d2;
  --dikisha-muted: #91a1b4;
  --dikisha-border: #314052;
  --dikisha-surface: #182231;
  --dikisha-surface-soft: #202c3b;
  --dikisha-bg: #101722;
  --dikisha-sidebar: #0b1526;
  --dikisha-sidebar-soft: #142846;
  --dikisha-sidebar-text: #cbd5e2;
  --dikisha-sidebar-muted: #8192a8;
  --dikisha-shadow-sm: 0 1px 2px rgba(0, 0, 0, .18);
  --dikisha-shadow: 0 12px 32px rgba(0, 0, 0, .24);
  --dikisha-shadow-lg: 0 24px 54px rgba(0, 0, 0, .34);
}

html { background: var(--dikisha-bg); }
body { transition: background-color .18s ease, color .18s ease; }

.dikisha-sidebar {
  width: 248px;
  min-width: 248px;
  height: 100vh;
  background: var(--dikisha-sidebar);
  border-right: 0;
  padding: 20px 14px 14px;
}

.dikisha-brand { padding: 0 8px 22px; }
.dikisha-brand-mark { background: linear-gradient(135deg, #4b74ff, #21b991); }
.dikisha-brand-text { color: #fff; letter-spacing: .08em; font-size: 16px; }
.dikisha-brand-sub { color: #aebcd0; margin-top: 1px; }

.dikisha-nav {
  display: flex;
  flex-direction: column;
  gap: 16px;
  min-height: 0;
  overflow-y: auto;
  scrollbar-width: thin;
  scrollbar-color: var(--dikisha-sidebar-soft) transparent;
  padding-right: 2px;
}
.dikisha-nav-group { display: flex; flex-direction: column; gap: 3px; }
.dikisha-nav-group-title {
  padding: 0 10px 6px;
  color: var(--dikisha-sidebar-muted);
  font-size: 10.5px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: .09em;
}
.dikisha-nav-link {
  gap: 11px;
  padding: 9px 10px;
  color: var(--dikisha-sidebar-text);
  font-size: 13.5px;
  border-radius: 9px;
}
.dikisha-nav-link i { color: #9eafc3; }
.dikisha-nav-link:hover { background: var(--dikisha-sidebar-soft); color: #fff; }
.dikisha-nav-link:hover i { color: #fff; }
.dikisha-nav-link.active { background: #fff; color: #17304e; box-shadow: none; }
.dikisha-nav-link.active i { color: var(--dikisha-primary); }

.dikisha-sidebar-status {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-top: 14px;
  padding: 11px;
  border-radius: 11px;
  background: var(--dikisha-sidebar-soft);
  color: #8fe4c8;
}
.dikisha-sidebar-status > i { font-size: 18px; }
.dikisha-sidebar-status strong,
.dikisha-sidebar-status span { display: block; }
.dikisha-sidebar-status strong { color: #fff; font-size: 11.5px; }
.dikisha-sidebar-status span { color: #aebcd0; font-size: 10.5px; margin-top: 1px; }
.dikisha-sidebar-footer { border-color: rgba(255,255,255,.1); color: #8192a8 !important; }
.dikisha-sidebar-footer a { color: #aebcd0 !important; }
.dikisha-mobile-nav { --bs-offcanvas-width: min(86vw, 310px); color: var(--dikisha-sidebar-text); background: var(--dikisha-sidebar); border: 0; }
.dikisha-mobile-nav .offcanvas-header { border-bottom: 1px solid rgba(255,255,255,.1); }
.dikisha-mobile-nav .offcanvas-body { padding: 16px 14px; }
.dikisha-mobile-nav .dikisha-nav { overflow: visible; }

.dikisha-shell.dikisha-sidebar-collapsed .dikisha-sidebar {
  width: 76px;
  min-width: 76px;
  padding-left: 12px;
  padding-right: 12px;
  opacity: 1;
  pointer-events: auto;
}
.dikisha-shell.dikisha-sidebar-collapsed .dikisha-brand { justify-content: center; padding-inline: 0; }
.dikisha-shell.dikisha-sidebar-collapsed .dikisha-brand > div:last-child,
.dikisha-shell.dikisha-sidebar-collapsed .dikisha-nav-group-title,
.dikisha-shell.dikisha-sidebar-collapsed .dikisha-nav-link span,
.dikisha-shell.dikisha-sidebar-collapsed .dikisha-sidebar-status div,
.dikisha-shell.dikisha-sidebar-collapsed .dikisha-sidebar-footer { display: none; }
.dikisha-shell.dikisha-sidebar-collapsed .dikisha-nav-link { justify-content: center; padding-inline: 8px; }
.dikisha-shell.dikisha-sidebar-collapsed .dikisha-sidebar-status { justify-content: center; padding-inline: 8px; }

.dikisha-topbar {
  min-height: 68px;
  padding: 12px 26px;
  position: sticky;
  top: 0;
  z-index: 1020;
}
.dikisha-main-content { max-width: 1600px; width: 100%; margin-inline: auto; }
.dikisha-icon-btn { background: var(--dikisha-surface-soft); border: 1px solid var(--dikisha-border); }
.dikisha-store-switcher .btn { border-radius: 10px; background: var(--dikisha-surface-soft); padding: 8px 12px; }
.dikisha-theme-menu { min-width: 190px; }
.dikisha-theme-option { display: flex; align-items: center; gap: 10px; }
.dikisha-theme-option .theme-check { opacity: 0; }
.dikisha-theme-option.active .theme-check { opacity: 1; }

.dikisha-card, .kpi-card { box-shadow: none; }
.dikisha-card { border-radius: 14px; }
.kpi-card { border-radius: 14px; }
.kpi-card:hover { transform: translateY(-1px); box-shadow: var(--dikisha-shadow); }
.kpi-card .card-body { padding: 17px; }
.kpi-card .kpi-value { font-size: clamp(20px, 1.8vw, 25px); }
.dikisha-subnav { display: inline-flex; padding: 4px; border: 1px solid var(--dikisha-border); border-radius: 11px; background: var(--dikisha-surface-soft); }
.dikisha-subnav .nav-link { color: var(--dikisha-muted); border-radius: 8px; font-size: 13px; font-weight: 600; }
.dikisha-subnav .nav-link:hover { color: var(--dikisha-ink); }
.dikisha-subnav .nav-link.active { color: var(--dikisha-ink); background: var(--dikisha-surface); box-shadow: var(--dikisha-shadow-sm); }

/* Integration Bootstrap au theme sombre. */
:root[data-theme="dark"] .text-body { color: var(--dikisha-ink) !important; }
:root[data-theme="dark"] .text-muted { color: var(--dikisha-muted) !important; }
:root[data-theme="dark"] .bg-white { background-color: var(--dikisha-surface) !important; }
:root[data-theme="dark"] .bg-light { background-color: var(--dikisha-surface-soft) !important; }
:root[data-theme="dark"] .border,
:root[data-theme="dark"] .border-top,
:root[data-theme="dark"] .border-bottom { border-color: var(--dikisha-border) !important; }
:root[data-theme="dark"] .dropdown-menu,
:root[data-theme="dark"] .modal-content {
  --bs-dropdown-bg: var(--dikisha-surface);
  --bs-dropdown-color: var(--dikisha-body);
  --bs-dropdown-link-color: var(--dikisha-body);
  --bs-dropdown-link-hover-color: var(--dikisha-ink);
  --bs-dropdown-link-hover-bg: var(--dikisha-surface-soft);
  --bs-dropdown-link-active-color: var(--dikisha-ink);
  --bs-dropdown-link-active-bg: var(--dikisha-primary-light);
  background-color: var(--dikisha-surface);
  color: var(--dikisha-body);
  border-color: var(--dikisha-border);
}
:root[data-theme="dark"] .table {
  --bs-table-color: var(--dikisha-body);
  --bs-table-bg: transparent;
  --bs-table-border-color: var(--dikisha-border);
  --bs-table-hover-color: var(--dikisha-ink);
  --bs-table-hover-bg: var(--dikisha-surface-soft);
}
:root[data-theme="dark"] .form-control,
:root[data-theme="dark"] .form-select {
  background-color: var(--dikisha-surface-soft);
  color: var(--dikisha-ink);
  border-color: var(--dikisha-border);
}
:root[data-theme="dark"] .form-control::placeholder { color: var(--dikisha-muted); }
:root[data-theme="dark"] .btn-outline-secondary { color: var(--dikisha-body); border-color: var(--dikisha-border); }
:root[data-theme="dark"] .btn-outline-secondary:hover { background: var(--dikisha-surface-soft); color: var(--dikisha-ink); }
:root[data-theme="dark"] code { color: #e8a8d1; }
:root[data-theme="dark"] .btn-close { filter: invert(1) grayscale(100%) brightness(180%); }

@media (max-width: 767.98px) {
  .dikisha-topbar { padding: 10px 14px; gap: 8px; }
  .dikisha-main-content { padding: 18px 14px !important; }
}

/* Tableau de bord Horizon -------------------------------------------------- */
.horizon-page-header {
  display: flex;
  justify-content: space-between;
  align-items: flex-end;
  gap: 22px;
  margin-bottom: 22px;
}
.horizon-page-header h1 { font-size: clamp(25px, 2.4vw, 34px); margin: 4px 0 5px; letter-spacing: -.035em; }
.horizon-page-header p { color: var(--dikisha-muted); margin: 0; }
.horizon-eyebrow { color: var(--dikisha-primary); font-size: 11px; font-weight: 700; text-transform: uppercase; letter-spacing: .09em; }
.horizon-period-picker { display: inline-flex; padding: 3px; background: var(--dikisha-surface-soft); border: 1px solid var(--dikisha-border); border-radius: 10px; white-space: nowrap; }
.horizon-period-picker a { color: var(--dikisha-muted); padding: 7px 11px; border-radius: 7px; font-size: 12.5px; font-weight: 600; }
.horizon-period-picker a:hover { color: var(--dikisha-ink); }
.horizon-period-picker a.active { color: var(--dikisha-ink); background: var(--dikisha-surface); box-shadow: var(--dikisha-shadow-sm); }

.horizon-kpi-grid { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 14px; margin-bottom: 16px; }
.horizon-kpi { background: var(--dikisha-surface); border: 1px solid var(--dikisha-border); border-radius: 14px; padding: 17px; min-width: 0; }
.horizon-kpi-head { display: flex; justify-content: space-between; align-items: center; gap: 8px; color: var(--dikisha-muted); font-size: 13px; font-weight: 600; }
.horizon-kpi-icon { width: 34px; height: 34px; display: inline-flex; justify-content: center; align-items: center; border-radius: 9px; font-size: 16px; }
.horizon-kpi-icon.primary { background: var(--dikisha-primary-light); color: var(--dikisha-primary); }
.horizon-kpi-icon.success { background: var(--dikisha-success-light); color: var(--dikisha-success); }
.horizon-kpi-icon.warning { background: var(--dikisha-warning-light); color: var(--dikisha-warning); }
.horizon-kpi-value { margin-top: 14px; color: var(--dikisha-ink); font-size: clamp(19px, 1.8vw, 25px); font-weight: 800; letter-spacing: -.025em; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.horizon-kpi-context { margin-top: 4px; color: var(--dikisha-muted); font-size: 12px; }

.horizon-dashboard-grid { display: grid; grid-template-columns: minmax(0, 1.7fr) minmax(280px, .8fr); gap: 16px; }
.horizon-bottom-grid { display: grid; grid-template-columns: minmax(0, 1.3fr) minmax(280px, .7fr); gap: 16px; margin-top: 16px; }
.horizon-panel-heading { display: flex; align-items: flex-start; justify-content: space-between; gap: 14px; margin-bottom: 15px; }
.horizon-panel-heading h2 { margin: 0; font-size: 16px; }
.horizon-panel-heading p { margin: 3px 0 0; color: var(--dikisha-muted); font-size: 12.5px; }
.horizon-link { font-size: 12.5px; font-weight: 600; white-space: nowrap; }
.horizon-chart-wrap { position: relative; height: 280px; }
.horizon-chart-wrap.compact { height: 255px; }

.horizon-alert-list { display: flex; flex-direction: column; gap: 9px; }
.horizon-alert-row { display: grid; grid-template-columns: auto minmax(0, 1fr) auto; align-items: center; gap: 10px; padding: 11px; border-radius: 10px; background: var(--dikisha-surface-soft); color: var(--dikisha-body); }
.horizon-alert-row:hover { color: var(--dikisha-ink); background: var(--dikisha-primary-light); }
.horizon-alert-icon { width: 34px; height: 34px; display: inline-flex; align-items: center; justify-content: center; border-radius: 9px; background: var(--dikisha-warning-light); color: var(--dikisha-warning); }
.horizon-alert-row.critical .horizon-alert-icon { background: var(--dikisha-danger-light); color: var(--dikisha-danger); }
.horizon-alert-row strong, .horizon-alert-row small { display: block; }
.horizon-alert-row strong { color: var(--dikisha-ink); font-size: 12.5px; }
.horizon-alert-row small { color: var(--dikisha-muted); margin-top: 2px; }
.horizon-all-clear { display: flex; align-items: center; gap: 11px; color: var(--dikisha-success); background: var(--dikisha-success-light); padding: 14px; border-radius: 10px; }
.horizon-all-clear > i { font-size: 22px; }
.horizon-all-clear strong, .horizon-all-clear span { display: block; }
.horizon-all-clear strong { color: var(--dikisha-ink); font-size: 13px; }
.horizon-all-clear span { color: var(--dikisha-body); font-size: 12px; margin-top: 2px; }

.horizon-store-list form:not(:last-child) { border-bottom: 1px solid var(--dikisha-border); }
.horizon-store-row { width: 100%; display: grid; grid-template-columns: auto minmax(0, 1fr) auto auto auto; gap: 12px; align-items: center; border: 0; background: transparent; color: var(--dikisha-body); padding: 11px 4px; text-align: left; border-radius: 8px; }
.horizon-store-row:hover { background: var(--dikisha-surface-soft); }
.horizon-store-avatar { width: 36px; height: 36px; display: inline-flex; align-items: center; justify-content: center; border-radius: 10px; background: var(--dikisha-primary-light); color: var(--dikisha-primary); }
.horizon-store-name strong, .horizon-store-name small, .horizon-store-revenue strong, .horizon-store-revenue small { display: block; }
.horizon-store-name strong { color: var(--dikisha-ink); font-size: 13px; }
.horizon-store-name small { color: var(--dikisha-muted); margin-top: 2px; }
.horizon-store-revenue { text-align: right; }
.horizon-store-revenue strong { color: var(--dikisha-ink); font-size: 13px; font-variant-numeric: tabular-nums; }
.horizon-store-revenue small { color: var(--dikisha-muted); }

@media (max-width: 1199.98px) {
  .horizon-kpi-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .horizon-dashboard-grid, .horizon-bottom-grid { grid-template-columns: 1fr; }
}
@media (max-width: 767.98px) {
  .horizon-page-header { align-items: flex-start; flex-direction: column; }
  .horizon-page-header > div:last-child, .horizon-period-picker { width: 100%; }
  .horizon-period-picker a { flex: 1; text-align: center; }
  .horizon-kpi-grid { grid-template-columns: 1fr; }
  .horizon-store-row { grid-template-columns: auto minmax(0, 1fr) auto; }
  .horizon-store-revenue { display: none; }
  .horizon-store-row .badge-soft { display: none; }
  .horizon-panel-heading { align-items: flex-start; }
  .horizon-link { white-space: normal; text-align: right; }
}

/* Listes, filtres et formulaires Horizon ---------------------------------- */
.horizon-list-header {
  display: flex;
  justify-content: space-between;
  align-items: flex-end;
  gap: 18px;
  margin-bottom: 20px;
}
.horizon-list-header h1 { font-size: clamp(24px, 2.1vw, 30px); margin-bottom: 4px !important; letter-spacing: -.03em; }
.dikisha-main-content > .d-flex.justify-content-between.align-items-center.mb-4,
.dikisha-main-content > .d-flex.justify-content-between.align-items-end.mb-4 {
  padding-bottom: 2px;
}
.dikisha-main-content > .d-flex.justify-content-between h1.h3,
.dikisha-main-content > h1.h3 {
  font-size: clamp(24px, 2.1vw, 30px);
  letter-spacing: -.03em;
}
.dikisha-main-content > h1.h3 + p.text-muted { margin-bottom: 20px !important; }
.horizon-list-actions { display: flex; align-items: center; justify-content: flex-end; gap: 8px; flex-wrap: wrap; }
.horizon-search { display: flex; align-items: center; gap: 8px; position: relative; }
.horizon-search > i { position: absolute; left: 13px; color: var(--dikisha-muted); z-index: 1; }
.horizon-search .form-control { min-width: 280px; padding-left: 38px; }

.horizon-filter-bar { padding: 18px; }
.horizon-filter-bar .form-label,
.horizon-form-shell .form-label {
  color: var(--dikisha-muted) !important;
  font-size: 10.5px !important;
  letter-spacing: .07em;
  margin-bottom: 6px;
}
.horizon-filter-actions { display: flex; align-items: center; gap: 8px; margin-top: 14px; padding-top: 14px; border-top: 1px solid var(--dikisha-border); }

.horizon-table-card { overflow: hidden; }
.horizon-table-card .table-responsive { scrollbar-color: var(--dikisha-border) transparent; }
.horizon-table-card .dikisha-table thead { background: var(--dikisha-surface-soft); }
.horizon-table-card .dikisha-table thead th { white-space: nowrap; border-top: 0; }
.horizon-table-card .dikisha-table tbody tr { transition: background-color .12s ease; }
.horizon-primary-cell strong { color: var(--dikisha-ink); }
.horizon-initial-avatar { width: 32px; height: 32px; display: inline-flex; align-items: center; justify-content: center; margin-right: 9px; border-radius: 9px; color: var(--dikisha-primary); background: var(--dikisha-primary-light); font-size: 12px; font-weight: 700; vertical-align: middle; }
.dikisha-table .btn-sm { width: 32px; height: 32px; display: inline-flex; align-items: center; justify-content: center; padding: 0; border-radius: 8px; }
.dikisha-table td.text-end { white-space: nowrap; }

.horizon-form-header { max-width: 980px; margin: 0 auto 20px; }
.horizon-form-header h1 { font-size: clamp(24px, 2.2vw, 31px); margin: 10px 0 4px; letter-spacing: -.03em; }
.horizon-form-header p { color: var(--dikisha-muted); margin: 0; }
.horizon-back-link { display: inline-flex; align-items: center; gap: 6px; font-size: 12.5px; font-weight: 600; }
.horizon-form-shell { max-width: 980px; margin-inline: auto; padding: 26px; }
.horizon-form-shell .row { --bs-gutter-x: 22px; }
.horizon-form-shell .form-text { color: var(--dikisha-muted); line-height: 1.4; }
.horizon-form-actions { display: flex; justify-content: flex-end; align-items: center; gap: 8px; margin: 8px -26px -26px; padding: 16px 26px; border-top: 1px solid var(--dikisha-border); background: var(--dikisha-surface-soft); border-radius: 0 0 14px 14px; }

.form-control, .form-select {
  min-height: 42px;
  background-color: var(--dikisha-surface);
  color: var(--dikisha-ink);
  transition: border-color .15s ease, box-shadow .15s ease, background-color .15s ease;
}
textarea.form-control { min-height: 110px; }
.form-check-input { background-color: var(--dikisha-surface); border-color: var(--dikisha-border); }
.form-check-input:checked { background-color: var(--dikisha-primary); border-color: var(--dikisha-primary); }
.btn { border-radius: 9px; font-weight: 600; }
.btn-outline-secondary { border-color: var(--dikisha-border); color: var(--dikisha-body); }
.btn-outline-secondary:hover { background: var(--dikisha-surface-soft); border-color: var(--dikisha-muted); color: var(--dikisha-ink); }
.pagination { gap: 4px; }
.page-link { color: var(--dikisha-body); background: var(--dikisha-surface); border-color: var(--dikisha-border); border-radius: 8px !important; }
.page-link:hover { color: var(--dikisha-primary); background: var(--dikisha-primary-light); border-color: var(--dikisha-primary-light); }
.disabled > .page-link { color: var(--dikisha-muted); background: var(--dikisha-surface-soft); border-color: var(--dikisha-border); }

:root[data-theme="dark"] .alert-info { color: #b9d8ff; background: #193450; }
:root[data-theme="dark"] .alert-warning { color: #f2d49b; background: #493719; border-color: #624b22 !important; }
:root[data-theme="dark"] .alert-danger { color: #ffc1c1; background: #4a252b; }
:root[data-theme="dark"] .form-text { color: var(--dikisha-muted); }
:root[data-theme="dark"] .page-link { color: var(--dikisha-body); background: var(--dikisha-surface); border-color: var(--dikisha-border); }
:root[data-theme="dark"] .disabled > .page-link { color: var(--dikisha-muted); background: var(--dikisha-surface-soft); }

@media (max-width: 767.98px) {
  .horizon-list-header { flex-direction: column; align-items: stretch; }
  .horizon-list-actions { justify-content: flex-start; }
  .horizon-search { width: 100%; }
  .horizon-search .form-control { min-width: 0; flex: 1; }
  .horizon-filter-actions { justify-content: flex-end; }
  .horizon-form-shell { padding: 20px 16px; }
  .horizon-form-actions { margin: 8px -16px -20px; padding: 14px 16px; }
}

/* Point de vente Horizon --------------------------------------------------- */
.pos-shell .dikisha-main-content { max-width: 1500px; }
.pos-topbar { background: var(--dikisha-sidebar); min-height: 68px; padding: 12px 24px; }
.pos-workspace-header { display: flex; align-items: flex-end; justify-content: space-between; gap: 18px; margin-bottom: 18px; }
.pos-workspace-header h1 { font-size: clamp(25px, 2.3vw, 32px); margin: 4px 0; letter-spacing: -.035em; }
.pos-workspace-header p { color: var(--dikisha-muted); margin: 0; }
.pos-online-status { display: inline-flex; align-items: center; gap: 7px; padding: 7px 11px; border-radius: 999px; color: var(--dikisha-success); background: var(--dikisha-success-light); font-size: 12px; font-weight: 700; }
.pos-online-status > span { width: 7px; height: 7px; border-radius: 50%; background: var(--dikisha-success); box-shadow: 0 0 0 4px color-mix(in srgb, var(--dikisha-success) 14%, transparent); }
.pos-panel { overflow: hidden; border-radius: 14px; box-shadow: none; }
.pos-search-panel { padding: 18px; border-color: color-mix(in srgb, var(--dikisha-primary) 30%, var(--dikisha-border)); }
.pos-search-panel > .form-label, .pos-checkout > .form-label, #payment-reference-wrap > .form-label { color: var(--dikisha-muted); font-size: 10.5px; font-weight: 700; letter-spacing: .07em; }
.pos-search-input .input-group-text { color: var(--dikisha-primary); background: var(--dikisha-surface-soft); border-color: var(--dikisha-border); }
.pos-search-input .form-control { background: var(--dikisha-surface-soft); border-color: var(--dikisha-border); font-size: 17px; }
.pos-search-help { display: flex; justify-content: space-between; gap: 12px; margin-top: 10px; color: var(--dikisha-muted); font-size: 11.5px; }
.pos-search-help kbd { background: var(--dikisha-sidebar); color: #fff; border-radius: 5px; padding: 2px 6px; }
.pos-product-result { margin-top: 5px; border: 1px solid var(--dikisha-border); border-radius: 9px; background: var(--dikisha-surface); }
.pos-product-result:last-child { border-bottom: 1px solid var(--dikisha-border); }
.pos-section-heading { display: flex; align-items: center; justify-content: space-between; gap: 12px; }
.pos-section-heading h2, .pos-cart-header h2 { font-size: 15px; margin: 0; }
.pos-section-heading p { color: var(--dikisha-muted); font-size: 11.5px; margin: 3px 0 0; }
.pos-section-heading > i { width: 32px; height: 32px; display: inline-flex; align-items: center; justify-content: center; border-radius: 9px; color: var(--dikisha-primary); background: var(--dikisha-primary-light); }
.pos-customer-search { position: relative; margin-top: 12px; }
.pos-customer-search > i { position: absolute; left: 13px; top: 50%; transform: translateY(-50%); color: var(--dikisha-muted); z-index: 1; }
.pos-customer-search .form-control { padding-left: 38px; }
.pos-selected-customer { display: none; align-items: center; gap: 9px; margin-top: 10px; padding: 9px 11px; color: var(--dikisha-success); background: var(--dikisha-success-light); border-radius: 9px; }
.pos-selected-customer:not(:empty) { display: flex; }
.pos-selected-customer span, .pos-selected-customer strong, .pos-selected-customer small { display: block; }
.pos-selected-customer strong { color: var(--dikisha-ink); font-size: 12.5px; }
.pos-selected-customer small { color: var(--dikisha-body); }
.pos-cart-panel { position: sticky; top: 84px; }
.pos-cart-header { display: flex; align-items: center; justify-content: space-between; gap: 10px; padding: 16px 17px; border-bottom: 1px solid var(--dikisha-border); background: var(--dikisha-surface-soft); }
.pos-cart-header h2 + span { display: block; color: var(--dikisha-muted); font-size: 11.5px; margin-top: 2px; }
.pos-cart-content { padding: 4px 17px; min-height: 150px; max-height: 310px; overflow-y: auto; }
.pos-cart-line { padding: 12px 0; }
.pos-qty-btn { flex: 0 0 32px; color: var(--dikisha-ink); background: var(--dikisha-surface-soft); }
.pos-line-quantity { width: 24px; text-align: center; color: var(--dikisha-ink); font-weight: 700; }
.pos-line-total { width: 76px; text-align: right; color: var(--dikisha-ink); font-weight: 700; font-variant-numeric: tabular-nums; }
.pos-checkout { padding: 17px; border-top: 1px solid var(--dikisha-border); background: var(--dikisha-surface); }
.pos-total-row { display: flex; align-items: center; justify-content: space-between; gap: 14px; padding-bottom: 14px; margin-bottom: 14px; border-bottom: 1px solid var(--dikisha-border); }
.pos-total-row > span { color: var(--dikisha-muted); font-size: 12.5px; font-weight: 700; text-transform: uppercase; letter-spacing: .05em; }
.pos-total-bar { font-size: clamp(23px, 2.3vw, 30px); }
.pos-pay-btn { min-height: 54px; border-radius: 11px; box-shadow: none; transition: transform .12s ease, filter .12s ease; }
.pos-pay-btn:hover { transform: translateY(-1px); }

:root[data-theme="dark"] .pos-search-input .input-group-text,
:root[data-theme="dark"] .input-group-text { background: var(--dikisha-surface-soft); color: var(--dikisha-body); border-color: var(--dikisha-border); }

@media (max-width: 1199.98px) {
  .pos-cart-panel { position: static; }
}
@media (max-width: 767.98px) {
  .pos-topbar { padding: 10px 14px; }
  .pos-topbar .text-white-50 { display: none; }
  .pos-workspace-header { align-items: flex-start; flex-direction: column; }
  .pos-search-help { flex-direction: column; gap: 5px; }
  .pos-cart-header { align-items: flex-start; flex-direction: column; }
  .pos-cart-content { max-height: none; }
  .pos-cart-line { flex-wrap: wrap; }
  .pos-line-total { margin-left: auto; }
}
