/* ========================================================
   Shopily Admin - Back Office (Inspiré de Shopify Polaris)
   Interface d'administration complète et configurable
   ======================================================== */

@import url('https://fonts.googleapis.com/css2?family=Plus+Jakarta+Sans:wght@400;500;600;700;800&family=Outfit:wght@500;600;700&display=swap');

:root {
  --admin-bg: #f6f6f7;
  --admin-sidebar-bg: #1a1a1a;
  --admin-sidebar-text: #e3e3e3;
  --admin-sidebar-hover: #2c2c2c;
  --admin-sidebar-active: #303030;
  --admin-card-bg: #ffffff;
  --admin-border: #e1e3e5;
  --admin-text-main: #202223;
  --admin-text-sub: #6d7175;
  --admin-primary: #008060;       /* Vert Shopify Polaris emblématique */
  --admin-primary-hover: #006e52;
  --admin-indigo: #4f46e5;
  --admin-warning: #ffc453;
  --admin-danger: #d72c0d;
  --admin-radius: 10px;
  --admin-radius-sm: 6px;
  --admin-shadow: 0 1px 3px rgba(0, 0, 0, 0.05), 0 1px 2px rgba(0, 0, 0, 0.1);
  --admin-shadow-md: 0 4px 14px rgba(0, 0, 0, 0.08);
  --transition: all 0.2s cubic-bezier(0.16, 1, 0.3, 1);
}

*, *::before, *::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

body {
  font-family: 'Plus Jakarta Sans', -apple-system, BlinkMacSystemFont, sans-serif;
  background-color: var(--admin-bg);
  color: var(--admin-text-main);
  line-height: 1.5;
  display: flex;
  height: 100vh;
  overflow: hidden;
}

/* ========================================================
   SIDEBAR ADMIN
   ======================================================== */
.admin-sidebar {
  width: 250px;
  background-color: var(--admin-sidebar-bg);
  color: var(--admin-sidebar-text);
  display: flex;
  flex-direction: column;
  flex-shrink: 0;
  user-select: none;
  border-right: 1px solid #2d2d2d;
}

.sidebar-header {
  padding: 20px 20px 16px 20px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  border-bottom: 1px solid #2d2d2d;
}

.sidebar-brand {
  display: flex;
  align-items: center;
  gap: 10px;
  font-weight: 800;
  font-size: 1.15rem;
  color: white;
  text-decoration: none;
}

.sidebar-brand-badge {
  background: var(--admin-primary);
  color: white;
  font-size: 0.65rem;
  padding: 2px 6px;
  border-radius: 4px;
  font-weight: 700;
  text-transform: uppercase;
}

.sidebar-nav {
  padding: 16px 10px;
  flex-grow: 1;
  display: flex;
  flex-direction: column;
  gap: 4px;
  overflow-y: auto;
}

.nav-category-title {
  font-size: 0.72rem;
  font-weight: 700;
  color: #8c9196;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  padding: 10px 12px 4px 12px;
}

.sidebar-item {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 10px 12px;
  border-radius: 8px;
  color: #c9cccf;
  font-size: 0.9rem;
  font-weight: 600;
  cursor: pointer;
  transition: var(--transition);
  text-decoration: none;
}

.sidebar-item:hover {
  background-color: var(--admin-sidebar-hover);
  color: white;
}

.sidebar-item.active {
  background-color: var(--admin-sidebar-active);
  color: white;
  font-weight: 700;
}

.sidebar-icon {
  font-size: 1.15rem;
  width: 22px;
  text-align: center;
}

.sidebar-badge {
  margin-left: auto;
  background: rgba(255, 255, 255, 0.15);
  padding: 2px 8px;
  border-radius: 999px;
  font-size: 0.72rem;
  font-weight: 700;
}

.sidebar-footer {
  padding: 16px;
  border-top: 1px solid #2d2d2d;
  background: #141414;
}

.btn-storefront-link {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  width: 100%;
  padding: 10px;
  border-radius: 6px;
  background: rgba(255, 255, 255, 0.08);
  color: white;
  font-size: 0.85rem;
  font-weight: 600;
  transition: var(--transition);
  text-decoration: none;
}

.btn-storefront-link:hover {
  background: rgba(255, 255, 255, 0.15);
}

/* ========================================================
   CONTENU PRINCIPAL
   ======================================================== */
.admin-main {
  flex-grow: 1;
  display: flex;
  flex-direction: column;
  overflow: hidden;
  background: var(--admin-bg);
}

/* Barre supérieure Admin */
.admin-topbar {
  height: 64px;
  background: white;
  border-bottom: 1px solid var(--admin-border);
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 28px;
  flex-shrink: 0;
}

.topbar-left {
  display: flex;
  align-items: center;
  gap: 16px;
}

.page-title {
  font-size: 1.25rem;
  font-weight: 800;
  color: var(--admin-text-main);
}

.db-status-pill {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 4px 10px;
  border-radius: 999px;
  font-size: 0.75rem;
  font-weight: 700;
  cursor: pointer;
  transition: var(--transition);
}

.db-status-pill.mysql-connected {
  background: #def7ec;
  color: #03543f;
  border: 1px solid #bcf0da;
}

.db-status-pill.fallback-mode {
  background: #fef08a;
  color: #854d0e;
  border: 1px solid #fde047;
}

.topbar-right {
  display: flex;
  align-items: center;
  gap: 16px;
}

/* Zone de contenu scrollable */
.admin-content-area {
  flex-grow: 1;
  overflow-y: auto;
  padding: 28px;
}

.view-section {
  display: none;
}

.view-section.active {
  display: block;
  animation: fadeIn 0.25s ease;
}

@keyframes fadeIn {
  from { opacity: 0; transform: translateY(4px); }
  to { opacity: 1; transform: translateY(0); }
}

/* ========================================================
   CARTES & COMPOSANTS DASHBOARD
   ======================================================== */
.kpi-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 20px;
  margin-bottom: 28px;
}

.kpi-card {
  background: white;
  border-radius: var(--admin-radius);
  border: 1px solid var(--admin-border);
  padding: 20px;
  box-shadow: var(--admin-shadow);
  display: flex;
  flex-direction: column;
}

.kpi-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  color: var(--admin-text-sub);
  font-size: 0.85rem;
  font-weight: 600;
  margin-bottom: 10px;
}

.kpi-value {
  font-size: 1.8rem;
  font-weight: 800;
  color: var(--admin-text-main);
  margin-bottom: 6px;
}

.kpi-trend {
  font-size: 0.8rem;
  font-weight: 600;
  display: inline-flex;
  align-items: center;
  gap: 4px;
}

.kpi-trend.up { color: #008060; }
.kpi-trend.down { color: #d72c0d; }

.admin-card {
  background: white;
  border-radius: var(--admin-radius);
  border: 1px solid var(--admin-border);
  box-shadow: var(--admin-shadow);
  padding: 24px;
  margin-bottom: 28px;
}

.admin-card-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 20px;
}

.admin-card-title {
  font-size: 1.1rem;
  font-weight: 700;
  color: var(--admin-text-main);
}

/* ========================================================
   TABLES DE DONNÉES (PRODUITS, COMMANDES, CATÉGORIES)
   ======================================================== */
.data-table-wrap {
  width: 100%;
  overflow-x: auto;
}

.data-table {
  width: 100%;
  border-collapse: collapse;
  text-align: left;
}

.data-table th {
  padding: 12px 16px;
  font-size: 0.8rem;
  font-weight: 700;
  color: var(--admin-text-sub);
  text-transform: uppercase;
  letter-spacing: 0.04em;
  background: #fafbfb;
  border-bottom: 1px solid var(--admin-border);
}

.data-table td {
  padding: 14px 16px;
  font-size: 0.9rem;
  color: var(--admin-text-main);
  border-bottom: 1px solid var(--admin-border);
  vertical-align: middle;
}

.data-table tr:hover td {
  background: #fbfcfc;
}

.table-img {
  width: 48px;
  height: 48px;
  border-radius: 8px;
  object-fit: cover;
  background: #f1f5f9;
}

.status-badge {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 4px 10px;
  border-radius: 999px;
  font-size: 0.75rem;
  font-weight: 700;
}

.status-badge.active, .status-badge.delivered {
  background: #def7ec;
  color: #03543f;
}

.status-badge.processing, .status-badge.pending {
  background: #fef08a;
  color: #854d0e;
}

.status-badge.shipped {
  background: #e0e7ff;
  color: #3730a3;
}

.status-badge.cancelled {
  background: #fee2e2;
  color: #991b1b;
}

.table-actions {
  display: flex;
  align-items: center;
  gap: 8px;
}

.btn-icon-action {
  width: 32px;
  height: 32px;
  border-radius: 6px;
  display: flex;
  align-items: center;
  justify-content: center;
  border: 1px solid var(--admin-border);
  background: white;
  color: var(--admin-text-sub);
  font-size: 0.9rem;
  cursor: pointer;
  transition: var(--transition);
}

.btn-icon-action:hover {
  background: #f1f2f3;
  color: var(--admin-text-main);
  border-color: #c9cccf;
}

.btn-icon-action.danger:hover {
  background: #fee2e2;
  color: var(--admin-danger);
  border-color: #fca5a5;
}

/* ========================================================
   BOUTONS & FORMULAIRES ADMIN
   ======================================================== */
.btn-admin-primary {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 9px 16px;
  border-radius: var(--admin-radius-sm);
  background-color: var(--admin-primary);
  color: white;
  font-weight: 700;
  font-size: 0.875rem;
  border: none;
  cursor: pointer;
  transition: var(--transition);
  box-shadow: 0 1px 2px rgba(0, 0, 0, 0.1);
}

.btn-admin-primary:hover {
  background-color: var(--admin-primary-hover);
}

.btn-admin-secondary {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 9px 16px;
  border-radius: var(--admin-radius-sm);
  background: white;
  color: var(--admin-text-main);
  border: 1px solid var(--admin-border);
  font-weight: 600;
  font-size: 0.875rem;
  cursor: pointer;
  transition: var(--transition);
}

.btn-admin-secondary:hover {
  background: #f6f6f7;
  border-color: #c9cccf;
}

.form-field {
  margin-bottom: 20px;
}

.form-label {
  display: block;
  font-size: 0.85rem;
  font-weight: 700;
  color: var(--admin-text-main);
  margin-bottom: 6px;
}

.form-control {
  width: 100%;
  padding: 9px 12px;
  border-radius: var(--admin-radius-sm);
  border: 1px solid var(--admin-border);
  font-size: 0.9rem;
  background: white;
  color: var(--admin-text-main);
  outline: none;
  transition: var(--transition);
}

.form-control:focus {
  border-color: var(--admin-primary);
  box-shadow: 0 0 0 3px rgba(0, 128, 96, 0.15);
}

.form-hint {
  font-size: 0.78rem;
  color: var(--admin-text-sub);
  margin-top: 4px;
}

/* ========================================================
   MODULE PERSONNALISATION DU THÈME (SHOPIFY THEME EDITOR)
   ======================================================== */
.theme-editor-grid {
  display: grid;
  grid-template-columns: 1.3fr 1fr;
  gap: 28px;
}

.theme-presets-row {
  display: flex;
  gap: 10px;
  margin-bottom: 24px;
  flex-wrap: wrap;
}

.preset-chip {
  padding: 6px 14px;
  border-radius: 999px;
  font-size: 0.82rem;
  font-weight: 700;
  border: 1px solid var(--admin-border);
  background: white;
  cursor: pointer;
  transition: var(--transition);
}

.preset-chip:hover {
  border-color: var(--admin-primary);
  background: #f6fbf9;
}

.color-picker-row {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
  gap: 16px;
}

.color-input-box {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 8px 12px;
  border: 1px solid var(--admin-border);
  border-radius: var(--admin-radius-sm);
  background: white;
}

.color-swatch-input {
  width: 32px;
  height: 32px;
  border: none;
  border-radius: 6px;
  cursor: pointer;
  background: none;
}

/* Aperçu interactif du thème en temps réel */
.theme-live-preview {
  position: sticky;
  top: 20px;
  background: white;
  border: 1px solid var(--admin-border);
  border-radius: var(--admin-radius);
  box-shadow: var(--admin-shadow-md);
  overflow: hidden;
}

.preview-bar {
  background: #0f172a;
  color: white;
  padding: 10px 16px;
  font-size: 0.8rem;
  font-weight: 700;
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.preview-mockup-body {
  padding: 20px;
  background: #f8fafc;
}

.mockup-hero {
  border-radius: 10px;
  padding: 24px 20px;
  color: white;
  background: #4f46e5;
  margin-bottom: 16px;
  transition: var(--transition);
}

.mockup-hero h4 {
  font-size: 1.15rem;
  margin-bottom: 6px;
}

.mockup-hero p {
  font-size: 0.8rem;
  opacity: 0.9;
  margin-bottom: 14px;
}

.mockup-hero-btn {
  display: inline-block;
  padding: 6px 14px;
  border-radius: 6px;
  background: white;
  color: #1e1b4b;
  font-size: 0.78rem;
  font-weight: 700;
}

/* ========================================================
   MODALES ADMIN
   ======================================================== */
.admin-modal-overlay {
  position: fixed;
  top: 0; left: 0; right: 0; bottom: 0;
  background: rgba(0, 0, 0, 0.5);
  backdrop-filter: blur(4px);
  z-index: 500;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 20px;
  opacity: 0;
  visibility: hidden;
  transition: var(--transition);
}

.admin-modal-overlay.active {
  opacity: 1;
  visibility: visible;
}

.admin-modal-box {
  background: white;
  border-radius: var(--admin-radius);
  max-width: 620px;
  width: 100%;
  max-height: 90vh;
  overflow-y: auto;
  padding: 28px;
  box-shadow: 0 20px 40px rgba(0, 0, 0, 0.2);
  transform: scale(0.96);
  transition: transform 0.2s cubic-bezier(0.16, 1, 0.3, 1);
}

.admin-modal-overlay.active .admin-modal-box {
  transform: scale(1);
}

.modal-header-admin {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 20px;
  padding-bottom: 14px;
  border-bottom: 1px solid var(--admin-border);
}

/* Responsive */
@media (max-width: 960px) {
  .theme-editor-grid { grid-template-columns: 1fr; }
  .theme-live-preview { position: static; }
}

@media (max-width: 768px) {
  body { flex-direction: column; }
  .admin-sidebar { width: 100%; height: auto; }
}

/* ========================================================
   ÉCRAN DE CONNEXION SÉCURISÉE ADMIN (LOGIN OVERLAY)
   ======================================================== */
.admin-login-overlay {
  position: fixed;
  top: 0; left: 0; right: 0; bottom: 0;
  background: radial-gradient(circle at 50% 30%, #1e293b 0%, #0f172a 100%);
  z-index: 10000;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 20px;
  transition: opacity 0.3s ease, visibility 0.3s ease;
}

.admin-login-overlay.hidden {
  opacity: 0;
  visibility: hidden;
  pointer-events: none;
}

.admin-login-card {
  background: white;
  border-radius: 16px;
  padding: 40px 36px;
  max-width: 440px;
  width: 100%;
  box-shadow: 0 25px 60px rgba(0, 0, 0, 0.35);
  animation: modalPop 0.3s cubic-bezier(0.16, 1, 0.3, 1);
}

@keyframes modalPop {
  from { opacity: 0; transform: scale(0.92); }
  to { opacity: 1; transform: scale(1); }
}

.login-brand {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-bottom: 8px;
}

.login-brand h2 {
  font-size: 1.5rem;
  font-weight: 800;
  color: var(--admin-text-main);
}

.login-brand-icon {
  font-size: 2rem;
}

.login-subtitle {
  font-size: 0.9rem;
  color: var(--admin-text-sub);
  margin-bottom: 24px;
}

.login-error-alert {
  background: #fee2e2;
  border: 1px solid #fca5a5;
  color: #b91c1c;
  padding: 10px 14px;
  border-radius: 8px;
  font-size: 0.85rem;
  font-weight: 600;
  margin-bottom: 18px;
}

.login-footer-info {
  margin-top: 24px;
  text-align: center;
  font-size: 0.75rem;
  color: #94a3b8;
  border-top: 1px solid #f1f5f9;
  padding-top: 16px;
}

/* ========================================================
   WEBSITE BUILDER STUDIO - HOMEPAGE CUSTOMIZER
   ======================================================== */
.builder-studio-wrapper {
  display: flex;
  flex-direction: column;
  gap: 20px;
}

.builder-subnav {
  display: flex;
  align-items: center;
  gap: 8px;
  background: white;
  padding: 6px;
  border-radius: var(--admin-radius);
  border: 1px solid var(--admin-border);
  box-shadow: var(--admin-shadow);
  width: fit-content;
}

.builder-tab-btn {
  padding: 8px 18px;
  border-radius: var(--admin-radius-sm);
  font-size: 0.85rem;
  font-weight: 700;
  color: var(--admin-text-sub);
  cursor: pointer;
  transition: var(--transition);
  display: flex;
  align-items: center;
  gap: 8px;
}

.builder-tab-btn:hover {
  color: var(--admin-text-main);
  background: #f1f5f9;
}

.builder-tab-btn.active {
  background: #0f172a;
  color: white;
  box-shadow: 0 2px 6px rgba(15, 23, 42, 0.15);
}

.builder-grid-layout {
  display: grid;
  grid-template-columns: 460px 1fr;
  gap: 24px;
  align-items: flex-start;
}

@media (max-width: 1200px) {
  .builder-grid-layout {
    grid-template-columns: 1fr;
  }
}

.builder-panel {
  background: white;
  border-radius: var(--admin-radius);
  border: 1px solid var(--admin-border);
  box-shadow: var(--admin-shadow);
  display: flex;
  flex-direction: column;
  overflow: hidden;
}

.builder-panel-header {
  padding: 16px 20px;
  border-bottom: 1px solid var(--admin-border);
  display: flex;
  align-items: center;
  justify-content: space-between;
  background: #fafafa;
}

.builder-panel-title {
  font-size: 0.95rem;
  font-weight: 800;
  color: var(--admin-text-main);
  display: flex;
  align-items: center;
  gap: 8px;
}

.builder-toolbar {
  padding: 14px 20px;
  border-bottom: 1px solid var(--admin-border);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  background: white;
}

.builder-sections-list {
  display: flex;
  flex-direction: column;
  gap: 10px;
  padding: 16px 20px;
  max-height: 580px;
  overflow-y: auto;
}

.section-item-card {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 12px 14px;
  border-radius: 8px;
  border: 1px solid #e2e8f0;
  background: white;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.04);
  transition: var(--transition);
  gap: 12px;
}

.section-item-card:hover {
  border-color: #cbd5e1;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.06);
  transform: translateY(-1px);
}

.section-item-card.is-hidden {
  opacity: 0.55;
  background: #f8fafc;
  border-style: dashed;
}

.sec-left-group {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-grow: 1;
  min-width: 0;
}

.sec-order-btns {
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.sec-arrow-btn {
  width: 22px;
  height: 20px;
  background: #f1f5f9;
  border: 1px solid #e2e8f0;
  border-radius: 4px;
  font-size: 0.65rem;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: var(--transition);
  color: #475569;
}

.sec-arrow-btn:hover:not(:disabled) {
  background: #0f172a;
  color: white;
}

.sec-arrow-btn:disabled {
  opacity: 0.3;
  cursor: not-allowed;
}

.sec-info {
  display: flex;
  flex-direction: column;
  gap: 2px;
  min-width: 0;
}

.sec-name {
  font-size: 0.88rem;
  font-weight: 700;
  color: var(--admin-text-main);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.sec-meta-row {
  display: flex;
  align-items: center;
  gap: 6px;
}

.sec-badge {
  font-size: 0.68rem;
  padding: 1px 6px;
  border-radius: 4px;
  font-weight: 700;
  text-transform: uppercase;
  background: #e2e8f0;
  color: #475569;
}

.sec-color-dot {
  width: 12px;
  height: 12px;
  border-radius: 50%;
  border: 1px solid rgba(0,0,0,0.15);
  display: inline-block;
}

.sec-actions-group {
  display: flex;
  align-items: center;
  gap: 6px;
  flex-shrink: 0;
}

.sec-action-icon-btn {
  width: 30px;
  height: 30px;
  border-radius: 6px;
  border: 1px solid #e2e8f0;
  background: #f8fafc;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 0.85rem;
  cursor: pointer;
  transition: var(--transition);
  color: #334155;
}

.sec-action-icon-btn:hover {
  background: white;
  border-color: #94a3b8;
  color: #0f172a;
}

.sec-action-icon-btn.btn-edit {
  background: #eef2ff;
  border-color: #c7d2fe;
  color: #4338ca;
}

.sec-action-icon-btn.btn-edit:hover {
  background: #4338ca;
  color: white;
}

.sec-action-icon-btn.btn-delete:hover {
  background: #fee2e2;
  border-color: #fca5a5;
  color: #b91c1c;
}

/* Studio Live Preview */
.builder-preview-wrapper {
  background: #1e293b;
  border-radius: var(--admin-radius);
  box-shadow: var(--admin-shadow-md);
  overflow: hidden;
  display: flex;
  flex-direction: column;
}

.preview-top-toolbar {
  padding: 10px 18px;
  background: #0f172a;
  border-bottom: 1px solid #334155;
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.device-switcher {
  display: flex;
  align-items: center;
  gap: 4px;
  background: #1e293b;
  padding: 4px;
  border-radius: 6px;
}

.device-btn {
  padding: 4px 10px;
  border-radius: 4px;
  font-size: 0.75rem;
  font-weight: 700;
  color: #94a3b8;
  cursor: pointer;
  transition: var(--transition);
  display: flex;
  align-items: center;
  gap: 6px;
}

.device-btn.active {
  background: #38bdf8;
  color: #0f172a;
}

.preview-canvas-container {
  padding: 24px;
  display: flex;
  justify-content: center;
  background: #0f172a;
  min-height: 640px;
  max-height: 800px;
  overflow-y: auto;
}

.preview-frame {
  width: 100%;
  max-width: 100%;
  transition: max-width 0.3s ease;
  background: white;
  border-radius: 12px;
  overflow: hidden;
  box-shadow: 0 20px 45px rgba(0, 0, 0, 0.4);
}

.preview-frame.device-mobile {
  max-width: 375px;
  border: 10px solid #334155;
  border-radius: 36px;
}

.preview-frame.device-tablet {
  max-width: 768px;
  border: 8px solid #334155;
  border-radius: 24px;
}

/* Modals pour le builder */
.builder-modal-overlay {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: rgba(15, 23, 42, 0.6);
  backdrop-filter: blur(4px);
  z-index: 9999;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 20px;
  opacity: 1;
  transition: opacity 0.2s ease;
}

.builder-modal-overlay.hidden {
  opacity: 0;
  pointer-events: none;
  visibility: hidden;
}

.builder-modal-card {
  background: white;
  border-radius: 16px;
  width: 100%;
  max-width: 680px;
  max-height: 90vh;
  display: flex;
  flex-direction: column;
  box-shadow: 0 25px 60px rgba(0, 0, 0, 0.25);
  animation: modalPop 0.25s cubic-bezier(0.16, 1, 0.3, 1);
  overflow: hidden;
}

.builder-modal-header {
  padding: 20px 24px;
  border-bottom: 1px solid #e2e8f0;
  display: flex;
  align-items: center;
  justify-content: space-between;
  background: #fafafa;
}

.builder-modal-body {
  padding: 24px;
  overflow-y: auto;
  flex-grow: 1;
}

.builder-modal-footer {
  padding: 16px 24px;
  border-top: 1px solid #e2e8f0;
  background: #fafafa;
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 12px;
}

/* Templates grid (Ajout de section) */
.template-picker-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 14px;
}

.template-card {
  border: 1px solid #e2e8f0;
  border-radius: 10px;
  padding: 16px;
  cursor: pointer;
  transition: var(--transition);
  display: flex;
  align-items: flex-start;
  gap: 14px;
  background: white;
}

.template-card:hover {
  border-color: #4f46e5;
  background: #f5f3ff;
  transform: translateY(-2px);
  box-shadow: 0 6px 16px rgba(79, 70, 229, 0.08);
}

.template-icon {
  font-size: 1.8rem;
  background: #f1f5f9;
  width: 46px;
  height: 46px;
  border-radius: 10px;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

.template-title {
  font-weight: 700;
  font-size: 0.92rem;
  color: #0f172a;
  margin-bottom: 4px;
}

.template-desc {
  font-size: 0.78rem;
  color: #64748b;
  line-height: 1.4;
}

/* Preset de couleurs rapides */
.color-presets-row {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
  margin-top: 8px;
}

.color-preset-chip {
  width: 24px;
  height: 24px;
  border-radius: 50%;
  cursor: pointer;
  border: 2px solid white;
  box-shadow: 0 0 0 1px #cbd5e1;
  transition: transform 0.15s ease;
}

.color-preset-chip:hover {
  transform: scale(1.15);
}

.upload-field-row {
  display: flex;
  gap: 8px;
}

/* ========================================================
   MODULE GESTION DES MOYENS DE PAIEMENT
   ======================================================== */
.payments-gateways-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 20px;
}

.payment-gateway-card {
  background: white;
  border-radius: 14px;
  border: 1px solid var(--admin-border);
  box-shadow: 0 2px 10px rgba(0, 0, 0, 0.03);
  overflow: hidden;
  transition: all 0.2s ease;
}

.payment-gateway-card.is-disabled .gateway-body {
  opacity: 0.55;
  pointer-events: none;
}

.gateway-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 20px 24px;
  border-bottom: 1px solid var(--admin-border);
  background: #ffffff;
}

.gateway-title-box {
  display: flex;
  align-items: center;
  gap: 16px;
}

.gateway-icon {
  font-size: 1.8rem;
  width: 46px;
  height: 46px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: #f8fafc;
  border-radius: 12px;
  border: 1px solid #e2e8f0;
}

.gateway-name {
  font-size: 1.05rem;
  font-weight: 800;
  color: #0f172a;
  margin-bottom: 4px;
}

.gateway-badges {
  display: flex;
  gap: 8px;
  align-items: center;
}

.gateway-body {
  padding: 24px;
  display: flex;
  flex-direction: column;
  gap: 16px;
  transition: opacity 0.2s ease;
}

.switch-toggle-label {
  position: relative;
  display: inline-block;
  width: 50px;
  height: 28px;
  cursor: pointer;
}

.switch-toggle-label input {
  opacity: 0;
  width: 0;
  height: 0;
}

.switch-slider {
  position: absolute;
  top: 0; left: 0; right: 0; bottom: 0;
  background-color: #cbd5e1;
  border-radius: 28px;
  transition: 0.25s;
}

.switch-slider:before {
  position: absolute;
  content: "";
  height: 22px;
  width: 22px;
  left: 3px;
  bottom: 3px;
  background-color: white;
  border-radius: 50%;
  transition: 0.25s;
  box-shadow: 0 2px 4px rgba(0, 0, 0, 0.2);
}

.switch-toggle-label input:checked + .switch-slider {
  background-color: #10b981;
}

.switch-toggle-label input:checked + .switch-slider:before {
  transform: translateX(22px);
}

/* Discussion / Messages client dans la commande admin */
.admin-order-messages-box {
  background: #f8fafc;
  border-radius: 10px;
  border: 1px solid #e2e8f0;
  padding: 16px;
  margin-top: 20px;
}

.order-msg-bubble {
  padding: 10px 14px;
  border-radius: 10px;
  margin-bottom: 10px;
  font-size: 0.86rem;
  line-height: 1.45;
  max-width: 85%;
}

.order-msg-customer {
  background: #ffffff;
  border: 1px solid #e2e8f0;
  margin-right: auto;
}

.order-msg-admin {
  background: #e0e7ff;
  color: #1e1b4b;
  border: 1px solid #c7d2fe;
  margin-left: auto;
}

.order-msg-system {
  background: #fef2f2;
  color: #991b1b;
  border: 1px solid #fecaca;
  margin: 8px auto;
  text-align: center;
  max-width: 95%;
  font-size: 0.8rem;
}

.order-msg-meta {
  font-size: 0.72rem;
  color: #64748b;
  margin-bottom: 4px;
  display: flex;
  justify-content: space-between;
  gap: 8px;
}

/* ========================================================
   GALERIE MULTI-IMAGES DU PRODUIT (ADMIN)
   ======================================================== */
.product-upload-dropzone {
  border: 2px dashed #cbd5e1;
  border-radius: 12px;
  padding: 22px 18px;
  text-align: center;
  background: #f8fafc;
  cursor: pointer;
  transition: all 0.25s ease;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 8px;
}

.product-upload-dropzone:hover,
.product-upload-dropzone.dragover {
  border-color: var(--admin-primary, #4f46e5);
  background: #f5f3ff;
  transform: translateY(-1px);
}

.product-upload-dropzone .dropzone-icon {
  font-size: 2.2rem;
  line-height: 1;
}

.product-upload-dropzone .dropzone-text strong {
  font-size: 0.92rem;
  color: var(--admin-text, #1e293b);
  display: block;
}

.product-images-gallery {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(105px, 1fr));
  gap: 12px;
}

.gallery-card-item {
  position: relative;
  aspect-ratio: 1;
  border-radius: 10px;
  border: 2px solid #e2e8f0;
  overflow: hidden;
  background: #ffffff;
  box-shadow: 0 1px 4px rgba(0, 0, 0, 0.05);
  transition: all 0.2s ease;
  group: true;
}

.gallery-card-item:hover {
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.12);
  border-color: #cbd5e1;
}

.gallery-card-item.is-primary {
  border-color: var(--admin-primary, #4f46e5);
  box-shadow: 0 0 0 2px rgba(79, 70, 229, 0.25);
}

.gallery-card-img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

.gallery-badge-cover {
  position: absolute;
  top: 6px;
  left: 6px;
  background: var(--admin-primary, #4f46e5);
  color: #ffffff;
  font-size: 0.65rem;
  font-weight: 700;
  padding: 3px 6px;
  border-radius: 4px;
  box-shadow: 0 2px 6px rgba(0, 0, 0, 0.2);
  letter-spacing: 0.3px;
  pointer-events: none;
  z-index: 2;
}

.gallery-card-actions {
  position: absolute;
  bottom: 0;
  left: 0;
  right: 0;
  background: linear-gradient(to top, rgba(15, 23, 42, 0.85) 0%, rgba(15, 23, 42, 0.4) 70%, transparent 100%);
  padding: 8px 4px 4px;
  display: flex;
  justify-content: center;
  align-items: center;
  gap: 4px;
  opacity: 0;
  transition: opacity 0.2s ease;
  z-index: 3;
}

.gallery-card-item:hover .gallery-card-actions {
  opacity: 1;
}

.gallery-btn-action {
  background: rgba(255, 255, 255, 0.95);
  border: none;
  border-radius: 4px;
  width: 24px;
  height: 24px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: 0.72rem;
  cursor: pointer;
  color: #1e293b;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.15);
  transition: all 0.15s ease;
}

.gallery-btn-action:hover {
  background: #ffffff;
  transform: scale(1.15);
}

.gallery-btn-action.btn-del:hover {
  background: #fee2e2;
  color: #ef4444;
}

.gallery-btn-action.btn-star:hover {
  background: #fef3c7;
  color: #d97706;
}

.gallery-empty-msg {
  grid-column: 1 / -1;
  text-align: center;
  padding: 14px;
  background: #f8fafc;
  border-radius: 8px;
  border: 1px dashed #e2e8f0;
  color: var(--admin-text-sub, #64748b);
  font-size: 0.82rem;
}

/* Bouton "Connexion serveur" (sidebar) */
.btn-server-status {
  width: 100%;
  justify-content: center;
  margin-top: 8px;
  background: #262626;
  color: #e5e7eb;
  border-color: #404040;
  gap: 8px;
}
.btn-server-status:hover { background: #303030; }
.server-status-dot {
  width: 9px;
  height: 9px;
  border-radius: 50%;
  background: #22c55e;
  box-shadow: 0 0 0 3px rgba(34, 197, 94, 0.25), 0 0 8px #22c55e;
  animation: serverPulse 2s ease-in-out infinite;
  flex-shrink: 0;
}
.server-status-dot.offline {
  background: #f59e0b;
  box-shadow: 0 0 0 3px rgba(245, 158, 11, 0.25), 0 0 8px #f59e0b;
}
@keyframes serverPulse {
  0%, 100% { opacity: 1; }
  50% { opacity: 0.55; }
}

/* ========================================================
   Éditeur de texte riche pour la description produit
   ======================================================== */
.rich-editor-wrapper {
  border: 1px solid var(--admin-border, #e2e8f0);
  border-radius: 8px;
  background: #ffffff;
  overflow: hidden;
  transition: border-color 0.15s ease, box-shadow 0.15s ease;
}
.rich-editor-wrapper:focus-within {
  border-color: var(--admin-primary, #4f46e5);
  box-shadow: 0 0 0 3px rgba(79, 70, 229, 0.12);
}
.rich-editor-toolbar {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 4px;
  padding: 6px 10px;
  background: #f8fafc;
  border-bottom: 1px solid var(--admin-border, #e2e8f0);
}
.rich-toolbar-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 32px;
  height: 32px;
  padding: 0 8px;
  background: transparent;
  border: 1px solid transparent;
  border-radius: 6px;
  font-size: 0.88rem;
  font-weight: 700;
  color: #334155;
  cursor: pointer;
  transition: all 0.15s ease;
  user-select: none;
}
.rich-toolbar-btn:hover {
  background: #e2e8f0;
  color: #0f172a;
}
.rich-toolbar-btn.active {
  background: #e0e7ff;
  border-color: #c7d2fe;
  color: #4338ca;
}
.rich-toolbar-divider {
  width: 1px;
  height: 20px;
  background: #cbd5e1;
  margin: 0 4px;
}
.rich-color-picker-wrap {
  position: relative;
  display: inline-flex;
  align-items: center;
}
.rich-color-dropdown {
  position: absolute;
  top: 100%;
  left: 0;
  margin-top: 6px;
  z-index: 1000;
  background: #ffffff;
  border: 1px solid #e2e8f0;
  border-radius: 10px;
  padding: 10px;
  box-shadow: 0 10px 25px -5px rgba(0, 0, 0, 0.15);
  display: none;
  grid-template-columns: repeat(5, 1fr);
  gap: 8px;
  width: 180px;
}
.rich-color-dropdown.active {
  display: grid;
}
.color-dot-btn {
  width: 24px;
  height: 24px;
  border-radius: 50%;
  border: 2px solid #ffffff;
  outline: 1px solid #cbd5e1;
  cursor: pointer;
  padding: 0;
  transition: transform 0.15s ease;
}
.color-dot-btn:hover {
  transform: scale(1.2);
  outline-color: #4f46e5;
}
.custom-color-input-btn {
  grid-column: 1 / -1;
  display: flex;
  align-items: center;
  justify-content: space-between;
  font-size: 0.78rem;
  color: #475569;
  padding-top: 8px;
  border-top: 1px solid #f1f5f9;
}
.custom-color-input-btn input[type="color"] {
  border: none;
  width: 26px;
  height: 26px;
  border-radius: 4px;
  cursor: pointer;
  background: transparent;
  padding: 0;
}
.rich-editor-box {
  min-height: 120px;
  max-height: 320px;
  overflow-y: auto;
  padding: 12px 14px;
  font-size: 0.92rem;
  line-height: 1.6;
  color: #1e293b;
  outline: none;
}
.rich-editor-box:empty:before {
  content: attr(data-placeholder);
  color: #94a3b8;
  pointer-events: none;
}
.rich-editor-box b, .rich-editor-box strong { font-weight: 700; }
.rich-editor-box i, .rich-editor-box em { font-style: italic; }
.rich-editor-box u { text-decoration: underline; }
.rich-editor-raw {
  width: 100%;
  min-height: 120px;
  padding: 12px 14px;
  font-family: monospace;
  font-size: 0.85rem;
  border: none;
  outline: none;
  resize: vertical;
  display: none;
  background: #f8fafc;
}

/* ========================================================
   BARRE DE RECHERCHE ET FILTRAGE DES COMMANDES (MODERNISÉ)
   ======================================================== */
.orders-card-modern {
  border-radius: 12px;
  overflow: hidden;
  box-shadow: 0 4px 20px -2px rgba(15, 23, 42, 0.05), 0 1px 3px rgba(15, 23, 42, 0.03);
  border: 1px solid #e2e8f0;
}

.orders-header-modern {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 20px 24px 16px;
  background: #ffffff;
  border-bottom: 1px solid #f1f5f9;
  flex-wrap: wrap;
  gap: 14px;
}

.orders-title-group {
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.orders-header-pill {
  font-size: 0.75rem;
  font-weight: 700;
  color: #4338ca;
  background: #eef2ff;
  border: 1px solid #c7d2fe;
  padding: 3px 10px;
  border-radius: 999px;
  display: inline-flex;
  align-items: center;
  gap: 4px;
}

.orders-subtitle-text {
  font-size: 0.84rem;
  color: #64748b;
  margin: 0;
}

.orders-header-actions {
  display: flex;
  align-items: center;
  gap: 10px;
}

.btn-modern-action {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  padding: 8px 14px;
  border-radius: 8px;
  border: 1px solid #e2e8f0;
  background: #ffffff;
  color: #334155;
  font-size: 0.84rem;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.18s ease;
  box-shadow: 0 1px 2px rgba(0, 0, 0, 0.03);
}

.btn-modern-action:hover {
  background: #f8fafc;
  border-color: #cbd5e1;
  color: #0f172a;
  transform: translateY(-1px);
}

.btn-export-accounting {
  background: linear-gradient(135deg, #059669 0%, #047857 100%) !important;
  border-color: #047857 !important;
  color: #ffffff !important;
  font-weight: 700 !important;
  box-shadow: 0 2px 6px rgba(5, 150, 105, 0.22) !important;
}

.btn-export-accounting:hover {
  background: linear-gradient(135deg, #047857 0%, #065f46 100%) !important;
  border-color: #065f46 !important;
  color: #ffffff !important;
  transform: translateY(-1px);
  box-shadow: 0 4px 10px rgba(5, 150, 105, 0.35) !important;
}

.btn-export-accounting svg {
  stroke: #ffffff !important;
}

.products-quick-filter-bar {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 14px 24px;
  background: linear-gradient(180deg, #ffffff 0%, #f8fafc 100%);
  border-bottom: 1px solid #e2e8f0;
  flex-wrap: wrap;
}

.orders-filter-bar-modern {
  padding: 18px 24px;
  background: linear-gradient(180deg, #ffffff 0%, #f8fafc 100%);
  border-bottom: 1px solid #e2e8f0;
  display: flex;
  flex-direction: column;
  gap: 14px;
}

.orders-search-row {
  display: flex;
  align-items: center;
  gap: 12px;
  flex-wrap: wrap;
}

.orders-search-hero {
  flex: 1 1 320px;
  min-width: 260px;
}

.orders-search-box-inner {
  position: relative;
  display: flex;
  align-items: center;
  width: 100%;
}

.orders-search-svg-icon {
  position: absolute;
  left: 14px;
  color: #6366f1;
  pointer-events: none;
  display: flex;
  align-items: center;
  transition: transform 0.2s ease, color 0.2s ease;
}

.orders-hero-input {
  width: 100%;
  height: 42px;
  padding: 0 44px 0 44px !important;
  background: #ffffff !important;
  border: 1.5px solid #cbd5e1 !important;
  border-radius: 10px !important;
  font-size: 0.9rem !important;
  font-weight: 500 !important;
  color: #0f172a !important;
  transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1) !important;
  box-shadow: 0 1px 3px rgba(15, 23, 42, 0.04) !important;
  outline: none !important;
}

.orders-hero-input::placeholder {
  color: #94a3b8;
  font-weight: 400;
}

.orders-hero-input:focus {
  border-color: #6366f1 !important;
  box-shadow: 0 0 0 4px rgba(99, 102, 241, 0.14), 0 2px 8px rgba(99, 102, 241, 0.08) !important;
}

.orders-hero-input:focus ~ .orders-search-svg-icon {
  color: #4f46e5;
  transform: scale(1.08);
}

.orders-search-kbd-hint {
  position: absolute;
  right: 12px;
  padding: 2px 7px;
  font-size: 0.72rem;
  font-weight: 700;
  color: #94a3b8;
  background: #f1f5f9;
  border: 1px solid #e2e8f0;
  border-radius: 5px;
  pointer-events: none;
  user-select: none;
  transition: opacity 0.15s ease;
}

.orders-search-clear-svg {
  position: absolute;
  right: 10px;
  width: 24px;
  height: 24px;
  border-radius: 50%;
  border: none;
  background: #e2e8f0;
  color: #475569;
  display: none;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: all 0.18s ease;
}

.orders-search-clear-svg:hover {
  background: #cbd5e1;
  color: #0f172a;
  transform: scale(1.1);
}

.orders-status-dropdown-wrap {
  position: relative;
  display: flex;
  align-items: center;
  min-width: 170px;
}

.orders-control-icon {
  position: absolute;
  left: 12px;
  color: #64748b;
  pointer-events: none;
  display: flex;
  align-items: center;
}

.orders-select-arrow {
  position: absolute;
  right: 12px;
  color: #94a3b8;
  pointer-events: none;
  display: flex;
  align-items: center;
}

.orders-modern-select {
  width: 100%;
  height: 42px;
  padding: 0 32px 0 34px !important;
  background: #ffffff !important;
  border: 1.5px solid #cbd5e1 !important;
  border-radius: 10px !important;
  font-size: 0.86rem !important;
  font-weight: 600 !important;
  color: #1e293b !important;
  appearance: none !important;
  -webkit-appearance: none !important;
  cursor: pointer !important;
  transition: all 0.2s ease !important;
  box-shadow: 0 1px 3px rgba(15, 23, 42, 0.04) !important;
  outline: none !important;
}

.orders-modern-select:focus {
  border-color: #6366f1 !important;
  box-shadow: 0 0 0 3px rgba(99, 102, 241, 0.14) !important;
}

.orders-reset-btn {
  height: 42px;
  padding: 0 15px;
  border-radius: 10px;
  border: 1.5px solid #e2e8f0;
  background: #ffffff;
  color: #475569;
  font-size: 0.84rem;
  font-weight: 600;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  gap: 7px;
  transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
  white-space: nowrap;
  box-shadow: 0 1px 2px rgba(15, 23, 42, 0.03);
}

.orders-reset-btn:hover {
  background: #f8fafc;
  border-color: #cbd5e1;
  color: #0f172a;
  transform: translateY(-1px);
  box-shadow: 0 3px 8px rgba(15, 23, 42, 0.06);
}

.orders-reset-btn svg {
  transition: transform 0.25s ease;
}

.orders-reset-btn:hover svg {
  transform: rotate(-45deg);
}

.orders-date-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  flex-wrap: wrap;
  padding-top: 2px;
}

.orders-preset-pills-bar {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
}

.orders-date-row-label {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: 0.78rem;
  font-weight: 700;
  color: #64748b;
  text-transform: uppercase;
  letter-spacing: 0.03em;
}

.orders-pills-group {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  background: #f1f5f9;
  padding: 3px;
  border-radius: 9px;
  border: 1px solid #e2e8f0;
  flex-wrap: wrap;
}

.orders-pill-btn {
  border: none;
  background: transparent;
  padding: 6px 12px;
  border-radius: 7px;
  font-size: 0.82rem;
  font-weight: 600;
  color: #475569;
  cursor: pointer;
  transition: all 0.18s cubic-bezier(0.4, 0, 0.2, 1);
  user-select: none;
}

.orders-pill-btn:hover {
  color: #0f172a;
  background: rgba(255, 255, 255, 0.8);
}

.orders-pill-btn.active {
  background: #4f46e5;
  color: #ffffff;
  box-shadow: 0 2px 6px rgba(79, 70, 229, 0.3);
  font-weight: 700;
}

.orders-custom-range-card {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  background: #ffffff;
  border: 1.5px solid #cbd5e1;
  border-radius: 10px;
  padding: 3px 10px;
  height: 40px;
  box-shadow: 0 1px 3px rgba(15, 23, 42, 0.04);
  transition: all 0.2s ease;
}

.orders-custom-range-card:focus-within {
  border-color: #6366f1;
  box-shadow: 0 0 0 3px rgba(99, 102, 241, 0.14);
}

.orders-range-input-item {
  display: flex;
  align-items: center;
  gap: 5px;
}

.orders-range-tag {
  font-size: 0.74rem;
  font-weight: 800;
  color: #6366f1;
  text-transform: uppercase;
  letter-spacing: 0.03em;
}

.orders-modern-date-input {
  border: none !important;
  background: transparent !important;
  font-size: 0.84rem !important;
  font-weight: 600 !important;
  color: #1e293b !important;
  padding: 2px !important;
  outline: none !important;
  cursor: pointer !important;
  width: 122px !important;
  box-shadow: none !important;
}

.orders-range-separator {
  color: #94a3b8;
  font-weight: 700;
  font-size: 0.85rem;
  user-select: none;
}

.orders-kpi-ribbon {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 12px;
  padding-top: 10px;
  border-top: 1px dashed #e2e8f0;
}

.orders-kpi-counter-wrap {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font-size: 0.84rem;
  color: #334155;
  font-weight: 500;
}

.orders-kpi-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: #10b981;
  box-shadow: 0 0 0 3px rgba(16, 185, 129, 0.2);
  animation: pulseGreen 2s infinite;
  flex-shrink: 0;
}

.orders-kpi-counter strong {
  color: #0f172a;
  font-weight: 700;
}

.orders-kpi-counter .revenue-accent {
  color: #047857;
  font-weight: 800;
  background: #ecfdf5;
  border: 1px solid #a7f3d0;
  padding: 3px 9px;
  border-radius: 6px;
  margin-left: 6px;
  display: inline-flex;
  align-items: center;
  gap: 4px;
}

.orders-chips-flow {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  align-items: center;
}

.orders-active-chip-pill {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  background: #eef2ff;
  border: 1px solid #c7d2fe;
  color: #3730a3;
  padding: 3px 10px;
  border-radius: 999px;
  font-size: 0.77rem;
  font-weight: 600;
  animation: chipFadeIn 0.2s ease-out;
}

.orders-chip-remove-btn {
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 14px;
  height: 14px;
  border-radius: 50%;
  background: rgba(55, 48, 163, 0.12);
  color: #3730a3;
  transition: all 0.15s ease;
}

.orders-chip-remove-btn:hover {
  background: #ef4444;
  color: #ffffff;
}

@keyframes pulseGreen {
  0% { transform: scale(0.95); box-shadow: 0 0 0 0 rgba(16, 185, 129, 0.4); }
  70% { transform: scale(1); box-shadow: 0 0 0 6px rgba(16, 185, 129, 0); }
  100% { transform: scale(0.95); box-shadow: 0 0 0 0 rgba(16, 185, 129, 0); }
}

@keyframes chipFadeIn {
  from { opacity: 0; transform: translateY(3px) scale(0.96); }
  to { opacity: 1; transform: translateY(0) scale(1); }
}


/* Carousel Builder Image Manager */
.carousel-slides-manager {
  display: flex;
  flex-direction: column;
  gap: 12px;
  margin-top: 10px;
}
.carousel-slides-list {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(140px, 1fr));
  gap: 12px;
}
.carousel-slide-thumb-card {
  position: relative;
  border-radius: 10px;
  overflow: hidden;
  border: 2px solid var(--admin-border, #e2e8f0);
  background: #ffffff;
  aspect-ratio: 16/10;
  display: flex;
  flex-direction: column;
}
.carousel-slide-thumb-card img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}
.carousel-slide-thumb-card .thumb-actions {
  position: absolute;
  bottom: 0;
  left: 0;
  right: 0;
  background: rgba(15, 23, 42, 0.75);
  display: flex;
  align-items: center;
  justify-content: space-around;
  padding: 4px 6px;
  backdrop-filter: blur(4px);
}
.carousel-slide-thumb-card .thumb-btn {
  background: transparent;
  border: none;
  color: white;
  font-size: 0.8rem;
  cursor: pointer;
  padding: 2px 6px;
  border-radius: 4px;
  transition: background 0.15s;
}
.carousel-slide-thumb-card .thumb-btn:hover {
  background: rgba(255, 255, 255, 0.25);
}
.carousel-slide-thumb-card .thumb-btn.delete:hover {
  background: #ef4444;
}
