/* ScreenPush -Custom Stylesheet */
:root {
  --bg-primary: #12132a;
  --bg-secondary: #1a1b35;
  --bg-card: #1e2040;
  --bg-card-hover: #252752;
  --bg-sidebar: #0e0f22;
  --bg-modal: #1e2040;
  --bg-input: #2a2c50;
  --border: #2e3060;
  --border-input: #4a4c80;
  --text-primary: #ffffff;
  --text-secondary: #a0a3c4;
  --text-muted: #6b6e9a;
  --accent: #6b6ef9;
  --accent-hover: #5558e8;
  --accent-light: rgba(107, 110, 249, 0.15);
  --green: #22c55e;
  --red: #ef4444;
  --yellow: #f59e0b;
  --sidebar-width: 220px;
}

* { box-sizing: border-box; margin: 0; padding: 0; }

body {
  font-family: 'Inter', -apple-system, BlinkMacSystemFont, sans-serif;
  background: var(--bg-primary);
  color: var(--text-primary);
  min-height: 100vh;
  font-size: 14px;
}

/* ── Layout ── */
.app-layout { display: flex; min-height: 100vh; }

.sidebar {
  width: var(--sidebar-width);
  background: var(--bg-sidebar);
  border-right: 1px solid var(--border);
  display: flex;
  flex-direction: column;
  position: fixed;
  top: 0; left: 0; bottom: 0;
  z-index: 100;
  transition: width 0.25s ease;
  overflow: hidden; /* prevents content overflow during collapse */
}

.sidebar.collapsed { width: 60px; }
.sidebar.collapsed .sidebar-logo-full { display: none !important; }
.sidebar.collapsed .sidebar-logo-short { display: inline-block !important; }
.sidebar-logo-short { display: none; }
.sidebar-toggle { transition: transform 0.25s ease; flex-shrink: 0; }
.sidebar.collapsed .nav-label,
.sidebar.collapsed .sidebar-section-title,
.sidebar.collapsed .org-name { display: none; }

.sidebar-header {
  padding: 16px;
  border-bottom: 1px solid var(--border);
  display: flex;
  align-items: center;
  justify-content: space-between;
  min-height: 64px;
}

.sidebar-logo {
  font-size: 18px;
  font-weight: 700;
  color: var(--text-primary);
  letter-spacing: 0.5px;
}

.sidebar-toggle {
  background: none;
  border: none;
  color: var(--text-secondary);
  cursor: pointer;
  padding: 4px;
  border-radius: 4px;
  transition: color 0.2s;
}
.sidebar-toggle:hover { color: var(--text-primary); }

.sidebar-section-title {
  font-size: 10px;
  text-transform: uppercase;
  letter-spacing: 1.5px;
  color: var(--text-muted);
  padding: 12px 16px 6px;
  font-weight: 600;
}

.sidebar-nav { flex: 1; overflow-y: auto; padding: 8px 0; }

.nav-item {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 16px;
  color: var(--text-secondary);
  text-decoration: none;
  border-radius: 0;
  transition: all 0.15s;
  cursor: pointer;
  white-space: nowrap;
}
.nav-item:hover { background: var(--accent-light); color: var(--text-primary); }
.nav-item.active { background: var(--accent-light); color: var(--accent); border-right: 3px solid var(--accent); }
.nav-item svg { flex-shrink: 0; width: 18px; height: 18px; }
.nav-label { font-size: 14px; font-weight: 500; }

.main-content {
  margin-left: var(--sidebar-width);
  flex: 1;
  display: flex;
  flex-direction: column;
  min-height: 100vh;
  transition: margin-left 0.2s;
}
.main-content.sidebar-collapsed { margin-left: 60px; }

/* ── Topbar ── */
.topbar {
  height: 64px;
  background: var(--bg-secondary);
  border-bottom: 1px solid var(--border);
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 24px;
  position: sticky;
  top: 0;
  z-index: 50;
}

.topbar-left { display: flex; align-items: center; gap: 16px; }
.topbar-right { display: flex; align-items: center; gap: 12px; }

.org-selector {
  background: var(--bg-card);
  border: 1px solid var(--border);
  color: var(--text-primary);
  padding: 8px 14px;
  border-radius: 8px;
  font-size: 14px;
  cursor: pointer;
  min-width: 200px;
  appearance: none;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 24 24' fill='none' stroke='%23a0a3c4' stroke-width='2'%3E%3Cpath d='M6 9l6 6 6-6'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 12px center;
  padding-right: 32px;
}

.topbar-icon-btn {
  width: 36px; height: 36px;
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: 8px;
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--text-secondary);
  cursor: pointer;
  transition: all 0.15s;
  text-decoration: none;
}
.topbar-icon-btn:hover { background: var(--accent-light); color: var(--accent); border-color: var(--accent); }

.avatar {
  width: 36px; height: 36px;
  background: var(--accent);
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 14px;
  font-weight: 600;
  color: white;
  cursor: pointer;
}

/* ── Page Content ── */
.page-content { padding: 24px; flex: 1; }

.page-title {
  font-size: 22px;
  font-weight: 700;
  color: var(--text-primary);
  margin-bottom: 20px;
}

/* ── Buttons ── */
.btn {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 8px 18px;
  border-radius: 8px;
  font-size: 13px;
  font-weight: 600;
  letter-spacing: 0.5px;
  text-transform: uppercase;
  cursor: pointer;
  border: none;
  transition: all 0.15s;
  text-decoration: none;
  white-space: nowrap;
}
.btn-primary { background: var(--accent); color: white; }
.btn-primary:hover { background: var(--accent-hover); }
.btn-secondary { background: transparent; color: var(--text-secondary); border: 1px solid var(--border); }
.btn-secondary:hover { background: var(--bg-card); color: var(--text-primary); }
.btn-danger { background: transparent; color: var(--red); border: 1px solid var(--red); }
.btn-danger:hover { background: var(--red); color: white; }
.btn-sm { padding: 5px 12px; font-size: 11px; }
.btn-icon { width: 32px; height: 32px; padding: 0; justify-content: center; }

/* ── Cards ── */
.card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: 12px;
  overflow: hidden;
}

/* ── Catalog Grid ── */
.catalog-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(160px, 1fr));
  gap: 16px;
  margin-top: 16px;
}

.catalog-card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: 12px;
  overflow: hidden;
  cursor: pointer;
  transition: all 0.2s;
  position: relative;
  aspect-ratio: 1;
}
.catalog-card:hover { border-color: var(--accent); transform: translateY(-2px); box-shadow: 0 8px 24px rgba(107,110,249,0.15); }

.catalog-card-img {
  width: 100%; height: 100%;
  object-fit: cover;
  display: block;
}

.catalog-card-placeholder {
  width: 100%; height: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 13px;
  font-weight: 700;
  text-align: center;
  padding: 12px;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  color: white;
}

/* Icône « lecture » sur la miniature d'un produit vidéo */
.catalog-card-play {
  position: absolute;
  top: 50%; left: 50%;
  transform: translate(-50%, -50%);
  width: 48px; height: 48px;
  border-radius: 50%;
  background: rgba(0,0,0,0.55);
  border: 2px solid rgba(255,255,255,0.85);
  color: #fff;
  display: flex;
  align-items: center;
  justify-content: center;
  padding-left: 3px;
  box-shadow: 0 2px 10px rgba(0,0,0,0.3);
  pointer-events: none;
}

.catalog-card-overlay {
  position: absolute;
  bottom: 0; left: 0; right: 0;
  background: linear-gradient(transparent, rgba(0,0,0,0.85));
  padding: 24px 10px 10px;
  display: flex;
  justify-content: space-between;
  align-items: flex-end;
}

.catalog-card-label {
  font-size: 11px;
  font-weight: 600;
  color: white;
  text-shadow: 0 1px 3px rgba(0,0,0,0.5);
  line-height: 1.3;
}

.catalog-card-type {
  font-size: 10px;
  color: rgba(255,255,255,0.7);
}

.catalog-card-actions {
  position: absolute;
  top: 8px; right: 8px;
  opacity: 0;
  transition: opacity 0.2s;
}
.catalog-card:hover .catalog-card-actions { opacity: 1; }

.catalog-card-menu {
  background: var(--bg-modal);
  border: 1px solid var(--border);
  border-radius: 8px;
  box-shadow: 0 4px 20px rgba(0,0,0,0.4);
  padding: 4px;
  min-width: 160px;
  position: absolute;
  right: 0; top: 28px;
  z-index: 200;
}

.catalog-card-menu-item {
  padding: 8px 12px;
  font-size: 13px;
  cursor: pointer;
  border-radius: 6px;
  color: var(--text-secondary);
  display: flex;
  align-items: center;
  gap: 8px;
  transition: all 0.15s;
}
.catalog-card-menu-item:hover { background: var(--accent-light); color: var(--text-primary); }
.catalog-card-menu-item.danger { color: var(--red); }
.catalog-card-menu-item.danger:hover { background: rgba(239,68,68,0.1); }

/* ── Tabs ── */
.tabs {
  display: flex;
  gap: 0;
  border-bottom: 1px solid var(--border);
  margin-bottom: 20px;
}

.tab {
  padding: 10px 20px;
  font-size: 13px;
  font-weight: 600;
  letter-spacing: 0.5px;
  text-transform: uppercase;
  color: var(--text-muted);
  cursor: pointer;
  border-bottom: 2px solid transparent;
  transition: all 0.15s;
  text-decoration: none;
  display: flex;
  align-items: center;
  gap: 6px;
}
.tab:hover { color: var(--text-primary); }
.tab.active { color: var(--accent); border-bottom-color: var(--accent); }

/* ── Sub Tabs (Catalogue / Archives) ── */
.sub-tabs {
  display: flex;
  gap: 8px;
  margin-bottom: 16px;
}

.sub-tab {
  padding: 6px 16px;
  font-size: 13px;
  font-weight: 500;
  color: var(--text-secondary);
  cursor: pointer;
  border-radius: 6px;
  transition: all 0.15s;
  text-decoration: none;
  border: 1px solid transparent;
}
.sub-tab:hover { background: var(--bg-card); }
.sub-tab.active { background: var(--accent-light); color: var(--accent); border-color: var(--accent); }

/* ── Modal ── */
.modal-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,0.7);
  z-index: 1000;
  display: flex;
  align-items: center;
  justify-content: center;
  backdrop-filter: blur(2px);
  padding: 20px;
}

.modal {
  background: var(--bg-modal);
  border: 1px solid var(--border);
  border-radius: 16px;
  padding: 28px;
  width: 100%;
  max-width: 600px;
  max-height: 90vh;
  overflow-y: auto;
  position: relative;
}

.modal-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  margin-bottom: 24px;
}

.modal-title { font-size: 20px; font-weight: 700; }
.modal-subtitle { font-size: 12px; color: var(--text-muted); margin-top: 4px; }

.modal-close {
  background: none;
  border: none;
  color: var(--text-muted);
  cursor: pointer;
  padding: 4px;
  font-size: 20px;
  line-height: 1;
  transition: color 0.15s;
}
.modal-close:hover { color: var(--text-primary); }

.modal-footer {
  display: flex;
  justify-content: flex-end;
  gap: 12px;
  margin-top: 24px;
}

/* ── Forms ── */
.form-group { margin-bottom: 16px; }

.form-label {
  display: block;
  font-size: 12px;
  font-weight: 500;
  color: var(--text-muted);
  margin-bottom: 6px;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.form-input, .form-select, .form-textarea {
  width: 100%;
  background: var(--bg-input);
  border: 1px solid var(--border-input);
  border-radius: 8px;
  color: var(--text-primary);
  padding: 10px 14px;
  font-size: 14px;
  font-family: inherit;
  transition: border-color 0.15s;
  outline: none;
}
.form-input:focus, .form-select:focus, .form-textarea:focus {
  border-color: var(--accent);
  box-shadow: 0 0 0 2px var(--accent-light);
}
.form-input::placeholder { color: var(--text-muted); }
/* Listes déroulantes : petite flèche ▾ (même que le sélecteur de compte) */
.form-select, .form-input-floating select {
  appearance: none;
  cursor: pointer;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 24 24' fill='none' stroke='%23a0a3c4' stroke-width='2'%3E%3Cpath d='M6 9l6 6 6-6'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 12px center;
  padding-right: 34px;
}
.form-textarea { resize: vertical; min-height: 80px; }

.form-input-floating {
  position: relative;
  margin-bottom: 16px;
}
.form-input-floating input,
.form-input-floating select,
.form-input-floating textarea {
  width: 100%;
  background: var(--bg-input);
  border: 1px solid var(--accent);
  border-radius: 8px;
  color: var(--text-primary);
  padding: 12px 14px 8px;
  font-size: 14px;
  outline: none;
}
/* (après la règle ci-dessus, qui remet le fond à zéro) : flèche ▾ des listes */
.form-input-floating select {
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 24 24' fill='none' stroke='%23a0a3c4' stroke-width='2'%3E%3Cpath d='M6 9l6 6 6-6'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 12px center;
  padding-right: 34px;
}
.form-input-floating label {
  position: absolute;
  top: -8px; left: 12px;
  background: var(--bg-input);
  padding: 0 4px;
  font-size: 11px;
  color: var(--accent);
  font-weight: 500;
}

/* Checkbox */
.form-check {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 8px 0;
  cursor: pointer;
  user-select: none;
}
.form-check input[type=checkbox] {
  width: 18px; height: 18px;
  flex-shrink: 0; /* garde sa taille à côté d'un long texte */
  accent-color: var(--accent);
  cursor: pointer;
}
.form-check-label { font-size: 14px; color: var(--text-primary); }

/* File Upload Drop Zone */
.upload-zone {
  background: var(--accent);
  border-radius: 8px;
  padding: 18px;
  text-align: center;
  cursor: pointer;
  font-size: 13px;
  font-weight: 700;
  letter-spacing: 1px;
  text-transform: uppercase;
  color: white;
  transition: background 0.15s;
  margin-bottom: 12px;
}
.upload-zone:hover { background: var(--accent-hover); }
.upload-zone input { display: none; }
.upload-zone-preview {
  margin-top: 8px;
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 8px 12px;
  background: var(--bg-input);
  border-radius: 6px;
  font-size: 13px;
  color: var(--text-secondary);
}

/* ── Table ── */
.table-wrapper { overflow-x: auto; }

table {
  width: 100%;
  border-collapse: collapse;
}

th {
  text-align: left;
  padding: 10px 16px;
  font-size: 11px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 1px;
  color: var(--text-muted);
  border-bottom: 1px solid var(--border);
}

td {
  padding: 12px 16px;
  border-bottom: 1px solid var(--border);
  color: var(--text-secondary);
  font-size: 13px;
  vertical-align: middle;
}
tr:last-child td { border-bottom: none; }
tr:hover td { background: rgba(255,255,255,0.02); }

/* ── Badge / Status ── */
.badge {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 3px 10px;
  border-radius: 20px;
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 0.3px;
}
.badge-success { background: rgba(34,197,94,0.15); color: var(--green); }
.badge-danger { background: rgba(239,68,68,0.15); color: var(--red); }
.badge-warning { background: rgba(245,158,11,0.15); color: var(--yellow); }
.badge-info { background: var(--accent-light); color: var(--accent); }
.badge-dot::before { content: ''; width: 6px; height: 6px; border-radius: 50%; background: currentColor; display: inline-block; }

/* ── Screen Card ── */
.screen-card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: 12px;
  overflow: hidden;
  width: 250px;
  transition: border-color 0.2s;
}
.screen-card:hover { border-color: var(--accent); }

.screen-card-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 12px 16px;
  font-weight: 600;
  font-size: 14px;
}

.screen-card-preview {
  background: #0a0a1a;
  height: 140px;
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
}
.screen-card-preview img { width: 100%; height: 100%; object-fit: cover; }
.screen-card-preview-placeholder {
  color: var(--text-muted);
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 8px;
  font-size: 12px;
}

.screen-card-info { padding: 12px 16px; font-size: 12px; }
.screen-info-row { display: flex; justify-content: space-between; margin-bottom: 2px; }
.screen-info-label { color: var(--text-muted); }
.screen-info-value { color: var(--accent); font-weight: 600; }
.screen-info-value.online { color: var(--green); }
.screen-info-value.offline { color: var(--red); }

.screen-card-actions {
  display: flex;
  justify-content: center;
  gap: 6px;
  padding: 10px 16px;
  border-top: 1px solid var(--border);
}

.screen-action-btn {
  width: 32px; height: 32px;
  background: var(--bg-input);
  border: 1px solid var(--border);
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  color: var(--text-secondary);
  transition: all 0.15s;
  font-size: 14px;
}
.screen-action-btn:hover { background: var(--accent-light); color: var(--accent); border-color: var(--accent); }

/* ── Logs ── */
.logs-terminal {
  background: #0a0a1a;
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 16px;
  font-family: monospace;
  font-size: 12px;
  max-height: 400px;
  overflow-y: auto;
  color: #a0f0a0;
}
.log-line { margin-bottom: 2px; }
.log-error { color: #ff6b6b; }
.log-warning { color: #ffd93d; }
.log-info { color: #a0f0a0; }

/* ── Stats ── */
.stat-card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 20px;
  text-align: center;
}
.stat-value { font-size: 32px; font-weight: 700; color: var(--accent); margin-bottom: 4px; }
.stat-label { font-size: 12px; color: var(--text-muted); text-transform: uppercase; letter-spacing: 1px; }

/* ── Pagination ── */
.pagination {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-top: 20px;
  font-size: 13px;
  color: var(--text-muted);
}
.page-btn {
  padding: 6px 12px;
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: 6px;
  color: var(--text-secondary);
  cursor: pointer;
  transition: all 0.15s;
}
.page-btn:hover, .page-btn.active { background: var(--accent); color: white; border-color: var(--accent); }

/* ── Library Grid ── */
.library-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(140px, 1fr));
  gap: 12px;
  margin-top: 16px;
}
.library-item {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: 10px;
  overflow: hidden;
  cursor: pointer;
  transition: all 0.2s;
  position: relative;
}
.library-item:hover { border-color: var(--accent); }
.library-item-preview {
  height: 100px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: #0a0a1a;
  overflow: hidden;
}
.library-item-preview img, .library-item-preview video { width: 100%; height: 100%; object-fit: cover; }
.library-item-info { padding: 8px; }
.library-item-name { font-size: 11px; color: var(--text-secondary); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.library-item-size { font-size: 10px; color: var(--text-muted); margin-top: 2px; }

/* ── Alert ── */
.alert {
  padding: 12px 16px;
  border-radius: 8px;
  margin-bottom: 16px;
  font-size: 13px;
  /* texte normal : en flex, un <strong> au milieu d'une phrase devenait
     une colonne à part (mots en colonnes) */
  display: block;
  line-height: 1.5;
}
.alert-success { background: rgba(34,197,94,0.1); border: 1px solid rgba(34,197,94,0.3); color: var(--green); }
.alert-error { background: rgba(239,68,68,0.1); border: 1px solid rgba(239,68,68,0.3); color: var(--red); }
.alert-info { background: var(--accent-light); border: 1px solid rgba(107,110,249,0.3); color: var(--accent); }

/* ── Color swatch cards (catalog) ── */
.cat-colors {
  --c1: #6b6ef9; --c2: #22c55e; --c3: #ef4444;
  --c4: #f59e0b; --c5: #06b6d4; --c6: #8b5cf6;
  --c7: #ec4899; --c8: #f97316; --c9: #14b8a6;
}
.color-0 { background: linear-gradient(135deg, #6b6ef9, #8b5cf6); }
.color-1 { background: linear-gradient(135deg, #22c55e, #06b6d4); }
.color-2 { background: linear-gradient(135deg, #ef4444, #f97316); }
.color-3 { background: linear-gradient(135deg, #f59e0b, #f97316); }
.color-4 { background: linear-gradient(135deg, #06b6d4, #6b6ef9); }
.color-5 { background: linear-gradient(135deg, #8b5cf6, #ec4899); }
.color-6 { background: linear-gradient(135deg, #ec4899, #ef4444); }
.color-7 { background: linear-gradient(135deg, #14b8a6, #22c55e); }
.color-8 { background: linear-gradient(135deg, #f97316, #f59e0b); }

/* ── Login ── */
.login-page {
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  background: var(--bg-primary);
  position: relative;
  overflow: hidden;
}
.login-bg-orb {
  position: absolute;
  border-radius: 50%;
  filter: blur(80px);
  opacity: 0.15;
}
.login-card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: 20px;
  padding: 40px;
  width: 100%;
  max-width: 420px;
  position: relative;
  z-index: 1;
}
.login-logo {
  text-align: center;
  margin-bottom: 32px;
}
.login-logo-text {
  font-size: 28px;
  font-weight: 800;
  letter-spacing: 2px;
  color: white;
}
.login-logo-sub {
  font-size: 12px;
  color: var(--text-muted);
  margin-top: 4px;
}

/* ── Dropdown Menu ── */
.dropdown { position: relative; }
.dropdown-menu {
  position: absolute;
  right: 0; top: calc(100% + 8px);
  background: var(--bg-modal);
  border: 1px solid var(--border);
  border-radius: 10px;
  min-width: 200px;
  box-shadow: 0 8px 32px rgba(0,0,0,0.4);
  z-index: 500;
  padding: 4px;
  overflow: hidden;
}
.dropdown-item {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 14px;
  color: var(--text-secondary);
  cursor: pointer;
  border-radius: 8px;
  transition: all 0.15s;
  text-decoration: none;
  font-size: 14px;
}
.dropdown-item:hover { background: var(--accent-light); color: var(--text-primary); }
.dropdown-item.danger { color: var(--red); }
.dropdown-item.danger:hover { background: rgba(239,68,68,0.1); }
.dropdown-divider { height: 1px; background: var(--border); margin: 4px 0; }
.dropdown-header { padding: 8px 14px; font-size: 12px; color: var(--text-muted); font-weight: 600; }

/* ── Drag Handle ── */
.drag-handle { cursor: grab; color: var(--text-muted); }
.drag-handle:active { cursor: grabbing; }

/* ── Toast ── */
.toast-container { position: fixed; bottom: 24px; right: 24px; z-index: 9999; display: flex; flex-direction: column; gap: 8px; }
.toast {
  background: var(--bg-modal);
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 12px 18px;
  font-size: 13px;
  color: var(--text-primary);
  display: flex;
  align-items: center;
  gap: 10px;
  box-shadow: 0 4px 20px rgba(0,0,0,0.3);
  animation: slideIn 0.2s ease;
  min-width: 250px;
}
.toast.success { border-left: 3px solid var(--green); }
.toast.error { border-left: 3px solid var(--red); }
@keyframes slideIn { from { transform: translateX(100%); opacity: 0; } to { transform: translateX(0); opacity: 1; } }

/* ── Utilities ── */
.flex { display: flex; }
.items-center { align-items: center; }
.justify-between { justify-content: space-between; }
.gap-2 { gap: 8px; }
.gap-3 { gap: 12px; }
.gap-4 { gap: 16px; }
.mb-4 { margin-bottom: 16px; }
.mb-6 { margin-bottom: 24px; }
.mt-4 { margin-top: 16px; }
.text-muted { color: var(--text-muted); }
.text-accent { color: var(--accent); }
.text-sm { font-size: 12px; }
.text-xs { font-size: 11px; }
.font-bold { font-weight: 700; }
.w-full { width: 100%; }
.grid { display: grid; }
.grid-3 { grid-template-columns: repeat(3, 1fr); gap: 16px; }
.grid-4 { grid-template-columns: repeat(4, 1fr); gap: 16px; }
.hidden { display: none; }

/* Scrollbar */
::-webkit-scrollbar { width: 6px; height: 6px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb { background: var(--border); border-radius: 3px; }
::-webkit-scrollbar-thumb:hover { background: var(--text-muted); }

/* ── Media Picker Modal ─────────────────────────────────────── */
.mp-tabs {
  display: flex;
  border-bottom: 1px solid var(--border);
  padding: 0 20px;
  background: var(--bg-card);
}
.mp-tab {
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 11px 16px;
  background: none;
  border: none;
  border-bottom: 2px solid transparent;
  color: var(--text-secondary);
  font-size: 13px;
  font-weight: 500;
  cursor: pointer;
  transition: color 0.15s, border-color 0.15s;
  margin-bottom: -1px;
  white-space: nowrap;
}
.mp-tab:hover { color: var(--text-primary); }
.mp-tab-active { color: var(--accent); border-bottom-color: var(--accent); }
.mp-lib-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(110px, 1fr));
  gap: 10px;
  max-height: 420px;
  overflow-y: auto;
  padding-right: 4px;
}
.mp-lib-item {
  border: 2px solid var(--border);
  border-radius: 8px;
  overflow: hidden;
  cursor: pointer;
  background: var(--bg-input);
  transition: border-color 0.15s, transform 0.1s, box-shadow 0.15s;
}
.mp-lib-item:hover {
  border-color: var(--accent);
  transform: translateY(-2px);
  box-shadow: 0 4px 16px rgba(107,110,249,0.2);
}
.mp-lib-item-thumb {
  width: 100%;
  aspect-ratio: 4/3;
  overflow: hidden;
  display: flex;
  align-items: center;
  justify-content: center;
  background: var(--bg-primary);
}
.mp-lib-item-thumb img, .mp-lib-item-thumb video {
  width: 100%; height: 100%; object-fit: cover;
}
.mp-lib-item-play {
  position: absolute; inset: 0; margin: auto; width: 26px; height: 26px; border-radius: 50%;
  display: flex; align-items: center; justify-content: center;
  background: rgba(0,0,0,.6); color: #fff; font-size: 10px; pointer-events: none;
}
.mp-lib-item-icon { font-size: 30px; }
.mp-lib-item-name {
  padding: 5px 7px;
  font-size: 10px;
  color: var(--text-secondary);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.mp-lib-msg {
  grid-column: 1 / -1;
  text-align: center;
  padding: 40px;
  color: var(--text-muted);
  font-size: 13px;
}
.mp-trigger { cursor: pointer !important; }
/* Sélection multiple (MediaPicker.open({ multiple: true })) */
.mp-lib-item-thumb { position: relative; }
.mp-lib-item.mp-picked { border-color: var(--accent); box-shadow: 0 0 0 2px var(--accent); }
.mp-pick-badge {
  position: absolute; top: 5px; right: 5px; width: 24px; height: 24px; border-radius: 50%;
  border: 2px solid #fff; background: rgba(0,0,0,.35); color: #fff; font-size: 12px; font-weight: 700;
  display: flex; align-items: center; justify-content: center;
}
.mp-picked .mp-pick-badge { background: var(--accent); }
.mp-multi-bar {
  display: flex; align-items: center; gap: 8px; flex-wrap: wrap;
  margin-top: 14px; padding-top: 12px; border-top: 1px solid var(--border);
}
.mp-multi-count { flex: 1; font-size: 13px; color: var(--text-secondary); }

/* Responsive */
@media (max-width: 768px) {
  /* (menu latéral : voir le bloc « Téléphone et petite tablette » en fin de fichier) */
  .catalog-grid { grid-template-columns: repeat(auto-fill, minmax(130px, 1fr)); }
  .grid-3, .grid-4 { grid-template-columns: 1fr; }
}

/* ── Catalogue : mode « Réorganiser » ─────────────────────── */
.reorder-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  flex-wrap: wrap;
  padding: 14px 18px;
  margin-bottom: 16px;
  border: 1px solid var(--accent);
  border-radius: 12px;
  background: rgba(107, 110, 249, 0.12);
  position: sticky;
  top: 8px;
  z-index: 20;
}
.reorder-bar-text { display: flex; flex-direction: column; gap: 4px; font-size: 13px; }
.reorder-bar-text strong { font-size: 14px; }
.reorder-bar-text span { color: var(--text-secondary); }
.reorder-bar-actions { display: flex; gap: 8px; }

.reordering .catalog-card {
  cursor: grab;
  outline: 2px dashed rgba(107, 110, 249, 0.6);
  outline-offset: -2px;
}
.reordering .catalog-card:hover { transform: none; }
/* En mode réorganisation, seuls la carte et ses boutons réagissent :
   pas d'ouverture de la catégorie, pas de menu ⋮ */
.reordering .catalog-card > *:not(.reorder-ui) { pointer-events: none; }
.reordering .catalog-card .catalog-card-actions { display: none; }
.reordering .catalog-card.reorder-dragging { opacity: 0.35; }

.reorder-ui {
  position: absolute;
  top: 8px; left: 8px; right: 8px;
  display: flex;
  align-items: center;
  gap: 6px;
  z-index: 3;
}
.reorder-num {
  min-width: 26px; height: 26px;
  padding: 0 6px;
  border-radius: 13px;
  background: var(--accent);
  color: #fff;
  font-size: 13px;
  font-weight: 700;
  display: flex; align-items: center; justify-content: center;
  box-shadow: 0 2px 6px rgba(0,0,0,0.3);
}
.reorder-handle {
  color: #fff;
  font-size: 18px;
  line-height: 1;
  text-shadow: 0 1px 4px rgba(0,0,0,0.6);
}
.reorder-arrows { margin-left: auto; display: flex; gap: 4px; }
.reorder-arrows button {
  width: 26px; height: 26px;
  border: none;
  border-radius: 6px;
  background: rgba(0,0,0,0.6);
  color: #fff;
  font-size: 11px;
  cursor: pointer;
}
.reorder-arrows button:hover { background: var(--accent); }
.reorder-bar .btn:disabled { opacity: 0.45; cursor: not-allowed; }

/* ── Fenêtre de confirmation (confirmDelete) ─────────────── */
.confirm-overlay { z-index: 2000; }
.confirm-modal { max-width: 460px; }
.confirm-modal .modal-header { margin-bottom: 12px; }
.confirm-message { color: var(--text-secondary); font-size: 14px; line-height: 1.5; }
.confirm-details {
  margin-top: 14px;
  padding: 12px 14px;
  border-radius: 10px;
  background: var(--bg-input);
  font-size: 13px;
  line-height: 1.6;
}
.confirm-details ul { margin: 6px 0 0 18px; }
.btn-danger-solid { background: var(--red); color: #fff; border: 1px solid var(--red); }
.btn-danger-solid:hover { filter: brightness(1.1); }

/* Carte dont le menu ⋮ est ouvert : le menu peut dépasser du cadre */
.catalog-card.menu-open { overflow: visible; z-index: 50; }
.catalog-card.menu-open > .catalog-card-img,
.catalog-card.menu-open > .catalog-card-placeholder { border-radius: 11px; }
.catalog-card.menu-open > .catalog-card-overlay { border-radius: 0 0 11px 11px; }
.catalog-card.menu-open .catalog-card-actions { opacity: 1; }

/* ── Onglet Archives ───────────────────────────────────────── */
.archive-filters { display: flex; flex-wrap: wrap; gap: 8px; margin-bottom: 16px; }
.archive-filter {
  display: inline-flex; align-items: center; gap: 6px;
  padding: 6px 12px;
  border: 1px solid var(--border);
  border-radius: 999px;
  font-size: 13px;
  color: var(--text-secondary);
  text-decoration: none;
  transition: all 0.15s;
}
.archive-filter:hover { border-color: var(--accent); color: var(--text-primary); }
.archive-filter.active { background: var(--accent); border-color: var(--accent); color: #fff; }
.archive-filter-count {
  min-width: 20px; padding: 0 6px;
  border-radius: 10px;
  background: rgba(255,255,255,0.12);
  font-size: 11px; font-weight: 700; text-align: center;
}
.archive-thumb { width: 50px; height: 35px; object-fit: cover; border-radius: 4px; display: block; }
.archive-thumb-icon { background: var(--bg-input); display: flex; align-items: center; justify-content: center; font-size: 18px; }
.archive-soon { color: var(--red); font-weight: 600; }

/* ── Tableaux de bord (accueil, administration) ── */
.kpi-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(190px, 1fr)); gap: 14px; margin-bottom: 20px; }
.kpi { background: var(--bg-card); border: 1px solid var(--border); border-radius: 12px; padding: 16px 18px; display: block; text-decoration: none; color: inherit; transition: border-color .15s; }
a.kpi:hover { border-color: var(--accent); }
.kpi-label { font-size: 11px; color: var(--text-muted); text-transform: uppercase; letter-spacing: 1px; font-weight: 600; }
.kpi-value { font-size: 28px; font-weight: 800; color: var(--text-primary); margin: 6px 0 2px; line-height: 1.1; }
.kpi-sub { font-size: 12px; color: var(--text-secondary); }
.kpi-sub .up { color: var(--green); font-weight: 600; }
.kpi-sub .down { color: var(--red); font-weight: 600; }
.kpi.is-danger { border-color: rgba(239,68,68,.45); }
.kpi.is-warning { border-color: rgba(245,158,11,.45); }

.dash-cols { display: grid; grid-template-columns: 2fr 1fr; gap: 16px; margin-bottom: 16px; }
.dash-cols-even { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; margin-bottom: 16px; }
.panel { background: var(--bg-card); border: 1px solid var(--border); border-radius: 12px; overflow: hidden; }
.panel-head { display: flex; align-items: center; justify-content: space-between; gap: 8px; padding: 14px 16px; border-bottom: 1px solid var(--border); font-size: 14px; font-weight: 600; }
.panel-head a { font-size: 12px; font-weight: 500; color: var(--accent); text-decoration: none; }
.panel-body { padding: 14px 16px; }
.panel-empty { padding: 28px 16px; text-align: center; color: var(--text-muted); font-size: 13px; }

.list-row { display: flex; align-items: center; gap: 10px; padding: 9px 16px; border-bottom: 1px solid var(--border); font-size: 13px; color: var(--text-secondary); }
.list-row:last-child { border-bottom: none; }
.list-row .grow { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; }
.list-row strong { color: var(--text-primary); font-weight: 600; }
a.list-row { text-decoration: none; }
a.list-row:hover { background: var(--bg-card-hover); }
.alert-row.danger { border-left: 3px solid var(--red); }
.alert-row.warning { border-left: 3px solid var(--yellow); }

.status-dot { width: 9px; height: 9px; border-radius: 50%; display: inline-block; flex-shrink: 0; background: var(--text-muted); }
.status-dot.online { background: var(--green); box-shadow: 0 0 0 3px rgba(34,197,94,.18); }
.status-dot.offline { background: var(--red); }
.status-dot.never { background: var(--text-muted); }
.status-dot.warn { background: var(--yellow); }

.meter { height: 6px; border-radius: 3px; background: var(--bg-input); overflow: hidden; min-width: 60px; }
.meter > span { display: block; height: 100%; background: var(--green); border-radius: 3px; }
.meter.mid > span { background: var(--yellow); }
.meter.low > span { background: var(--red); }

.filter-bar { display: flex; gap: 10px; flex-wrap: wrap; align-items: center; margin-bottom: 16px; }
.filter-bar .form-input, .filter-bar .form-select { width: auto; min-width: 170px; }
.page-head { display: flex; align-items: flex-start; justify-content: space-between; gap: 12px; flex-wrap: wrap; margin-bottom: 20px; }
.page-head .page-title { margin-bottom: 4px; }
.page-sub { color: var(--text-muted); font-size: 13px; }
.muted-small { font-size: 11px; color: var(--text-muted); }
.nowrap { white-space: nowrap; }
.chart-box { position: relative; height: 220px; }
.info-grid { display: grid; grid-template-columns: 140px 1fr; gap: 8px 12px; font-size: 13px; }
.info-grid dt { color: var(--text-muted); }
.info-grid dd { color: var(--text-primary); margin: 0; word-break: break-word; }

@media (max-width: 1100px) {
  .dash-cols, .dash-cols-even { grid-template-columns: 1fr; }
}

/* ── Œil « afficher le mot de passe » (ajouté par app.js) ── */
.pw-wrap { position: relative; display: block; }
.pw-wrap > input { padding-right: 42px; width: 100%; }
.pw-toggle {
  position: absolute; top: 50%; right: 8px; transform: translateY(-50%);
  width: 30px; height: 30px; border: 0; background: none; padding: 0;
  display: flex; align-items: center; justify-content: center;
  color: var(--text-muted); cursor: pointer; border-radius: 6px;
}
.pw-toggle:hover { color: var(--text-primary); background: var(--bg-card-hover); }
.pw-toggle:focus-visible { outline: 2px solid var(--accent, #6366f1); }

/* ══════════════════════════════════════════════════════════════
   Téléphone et petite tablette (2026-10-11)
   Menu latéral escamotable (bouton ☰), barre du haut compacte, colonnes
   empilées, fenêtres pleine largeur. Les grilles / rangées écrites en style
   « en ligne » dans les vues sont aussi remises en une colonne.
   ══════════════════════════════════════════════════════════════ */
.mobile-menu-btn { display: none; }
.sidebar-backdrop { display: none; }
.table-wrapper { -webkit-overflow-scrolling: touch; }

@media (max-width: 900px) {
  .sidebar, .sidebar.collapsed {
    width: 270px; max-width: 85vw;
    transform: translateX(-105%);
    transition: transform .25s ease;
    z-index: 1100;
  }
  .sidebar.mobile-open { transform: none; box-shadow: 8px 0 40px rgba(0,0,0,.5); }
  /* Dans le menu mobile : toujours les libellés */
  .sidebar.collapsed .nav-label, .sidebar.collapsed .sidebar-section-title { display: revert; }
  .sidebar.collapsed .sidebar-logo-full { display: inline !important; }
  .sidebar.collapsed .sidebar-logo-short { display: none !important; }
  .sidebar-nav { flex: 0 0 auto; }
  .sidebar { overflow-y: auto; }
  .sidebar-backdrop.show { display: block; position: fixed; inset: 0; background: rgba(0,0,0,.55); z-index: 1090; }
  body.nav-open { overflow: hidden; }
  .main-content, .main-content.sidebar-collapsed { margin-left: 0; min-width: 0; width: 100%; }

  .mobile-menu-btn {
    display: flex; align-items: center; justify-content: center; flex-shrink: 0;
    width: 40px; height: 40px; border-radius: 10px; border: 1px solid var(--border);
    background: var(--bg-card); color: var(--text-primary); cursor: pointer;
  }
  .topbar { padding: 0 12px; height: 58px; gap: 8px; }
  .topbar-left { gap: 8px; min-width: 0; flex: 1; }
  .topbar-right { gap: 8px; flex-shrink: 0; }
  .org-selector { min-width: 0; max-width: 100%; flex: 1 1 auto; width: auto; }
  .topbar-username { display: none !important; }
  .topbar-back { margin-left: 0 !important; flex-shrink: 0; }

  .page-content { padding: 16px 12px 32px; min-width: 0; }
  .grid-2, .grid-3, .grid-4 { grid-template-columns: 1fr; }
}

@media (max-width: 640px) {
  .topbar-back-label { display: none; }
  .page-title { font-size: 20px; }
  .card { min-width: 0; }

  /* Fenêtres : presque plein écran, boutons qui passent à la ligne */
  .modal-overlay { padding: 8px; align-items: flex-start; overflow-y: auto; }
  .modal { padding: 18px 14px; max-height: none; border-radius: 12px; margin: auto 0; }
  .modal-header { margin-bottom: 14px; }
  .modal-title { font-size: 17px; }
  .modal-footer { flex-wrap: wrap; }
  .modal-footer .btn { flex: 1 1 auto; }

  /* Grilles et rangées écrites dans les vues : une colonne, retour à la ligne */
  [style*="grid-template-columns"]:not(.keep-cols):not([style*="auto-fill"]):not([style*="auto-fit"]) { grid-template-columns: 1fr !important; }
  /* Vignettes (catalogues, catégories, produits…) : 2 par ligne */
  .catalog-grid { grid-template-columns: repeat(2, minmax(0, 1fr)) !important; gap: 10px !important; }
  [style*="auto-fill"][style*="grid-template-columns"] { grid-template-columns: repeat(auto-fill, minmax(140px, 1fr)) !important; gap: 10px !important; }
  [style*="display:flex"]:not(.keep-row), [style*="display: flex"]:not(.keep-row) { flex-wrap: wrap; }
  [style*="width:180px"], [style*="width:200px"], [style*="width:220px"], [style*="width:240px"],
  [style*="width:260px"], [style*="width:280px"], [style*="width:300px"] { max-width: 100%; }
  /* Chiffres clés : 2 par ligne */
  .kpi-grid { grid-template-columns: 1fr 1fr; gap: 10px; }
  .kpi { padding: 12px; }
  .kpi-value { font-size: 22px; }
  .info-grid { grid-template-columns: 1fr; gap: 2px 0; }
  .info-grid dd { margin-bottom: 8px; }

  .tabs { overflow-x: auto; flex-wrap: nowrap; -webkit-overflow-scrolling: touch; }
  .tabs .tab { white-space: nowrap; }
  th, td { padding: 9px 10px; }
  .toast-container { left: 12px; right: 12px; bottom: 12px; }
  .dropdown-menu { max-width: calc(100vw - 24px); }
}

/* Formule du compte (Essentiel / Pro / Sur devis) : jauges écrans, utilisateurs, stockage */
.plan-gauges { display: grid; grid-template-columns: repeat(auto-fit, minmax(200px, 1fr)); gap: 16px 24px; }
.plan-gauge-head { display: flex; justify-content: space-between; gap: 8px; font-size: 13px; margin-bottom: 6px; color: var(--text-secondary); }
.plan-gauge-head strong { color: var(--text-primary); font-weight: 700; }
.plan-gauge-head .text-muted { font-weight: 500; }
.plan-gauge-track { height: 8px; border-radius: 99px; background: var(--border); overflow: hidden; }
.plan-gauge-fill { height: 100%; border-radius: 99px; background: var(--accent); }
.plan-gauge.is-high .plan-gauge-fill { background: var(--yellow); }
.plan-gauge.is-full .plan-gauge-fill { background: var(--red); }
.plan-banner { display: flex; align-items: center; justify-content: space-between; gap: 12px; flex-wrap: wrap; padding: 12px 16px; margin-bottom: 20px; border: 1px solid var(--accent); border-radius: 12px; background: rgba(107,110,249,0.08); font-size: 14px; }
.plan-banner a { color: var(--accent); font-weight: 600; text-decoration: none; white-space: nowrap; }

/* Espace client (/compte) */
.account-tabs { overflow-x: auto; }
.account-tabs .tab { white-space: nowrap; }
.account-filters { display: flex; gap: 10px; flex-wrap: wrap; align-items: center; }
.account-filters .form-input, .account-filters .form-select { width: auto; }
.account-filters .form-input[type=search] { flex: 1 1 220px; }
.account-filters .form-select { flex: 0 1 220px; }
.account-filters label { display: flex; align-items: center; gap: 6px; }
.account-form-row { display: flex; gap: 12px; flex-wrap: wrap; }
.account-form-row .form-group { min-width: 140px; margin-bottom: 0; }

/* Cloche de notifications (barre du haut) */
.notif-bell { position: relative; margin-right: 8px; }
.notif-bell .topbar-icon-btn { position: relative; }
.notif-count { position: absolute; top: -6px; right: -6px; min-width: 18px; height: 18px; padding: 0 5px; border-radius: 99px; background: var(--red); color: #fff; font-size: 11px; font-weight: 700; line-height: 18px; text-align: center; }
.notif-menu { width: 360px; max-width: calc(100vw - 24px); max-height: 70vh; overflow-y: auto; padding: 0; }
.notif-head { display: flex; justify-content: space-between; align-items: center; gap: 8px; padding: 12px 14px; border-bottom: 1px solid var(--border); font-size: 14px; }
.notif-head a { color: var(--accent); font-size: 12px; text-decoration: none; }
.notif-empty { padding: 24px 14px; text-align: center; color: var(--text-muted); font-size: 13px; }
.notif-item { display: flex; gap: 10px; padding: 10px 14px; border-bottom: 1px solid var(--border); color: var(--text-secondary); text-decoration: none; font-size: 13px; line-height: 1.4; }
.notif-item:hover { background: var(--accent-light); }
.notif-item.is-unread { background: rgba(107,110,249,0.08); color: var(--text-primary); }
.notif-item { border-left: 3px solid transparent; }
.notif-item.is-danger { border-left-color: var(--red); }
.notif-item.is-warning { border-left-color: var(--yellow); }
.notif-icon { flex: 0 0 auto; font-size: 16px; }
.notif-body { display: flex; flex-direction: column; gap: 2px; }
.notif-date { font-size: 11px; color: var(--text-muted); }

/* Espace client : choix de l'abonnement */
.sub-choices { display: grid; grid-template-columns: repeat(auto-fit, minmax(240px, 1fr)); gap: 10px; }
.sub-choice { display: flex; gap: 10px; align-items: flex-start; padding: 12px 14px; border: 1px solid var(--border); border-radius: 10px; cursor: pointer; line-height: 1.5; }
.sub-choice:has(input:checked) { border-color: var(--accent); background: rgba(107,110,249,0.08); }
.sub-choice input { margin-top: 4px; }
.sub-total { font-size: 15px; }
.sub-total strong { font-size: 20px; color: var(--text-primary); }

/* ═══════════════════════════════════════════════════════════════════
   CHARTE GRAPHIQUE SCREENPUSH v1.0 (octobre 2026) — appliquée le 23/10/2026
   Couleurs : Indigo Push #6B6EF9, Nuit #14152B, Indigo clair #8C8FFF,
   Lavande #C9CAFD, Brume #F4F4FB, Blanc. Titres : Sora 600/700.
   Textes et boutons : DM Sans 400/500/700. Boutons en pilule (999 px),
   cartes arrondies à 12 px. Back-office en version sombre « Nuit ».
   ═══════════════════════════════════════════════════════════════════ */
:root {
  --sp-indigo: #6B6EF9;
  --sp-nuit: #14152B;
  --sp-indigo-clair: #8C8FFF;
  --sp-lavande: #C9CAFD;
  --sp-brume: #F4F4FB;
  --font-titres: 'Sora', system-ui, sans-serif;
  --font-texte: 'DM Sans', system-ui, sans-serif;
  --bg-primary: #14152B;
  --bg-secondary: #1A1B36;
  --bg-card: #1D1E3D;
  --bg-card-hover: #25274D;
  --bg-sidebar: #0F1024;
  --bg-modal: #1D1E3D;
  --bg-input: #25274D;
  --border: #2C2E58;
  --border-input: #464990;
  --text-secondary: #B3B5DA;
  --text-muted: #7D80B3;
  --accent: #6B6EF9;
  --accent-hover: #5B5EF0;
  --accent-light: rgba(107, 110, 249, 0.16);
}
body, button, input, select, textarea { font-family: var(--font-texte); }
.page-title, .modal-title, .panel-head, .kpi-value, .section-title, .login-logo-sub,
h1, h2, h3 { font-family: var(--font-titres); letter-spacing: -0.01em; }
.btn { border-radius: 999px; font-weight: 700; }
.btn-icon { border-radius: 999px; }
.card, .panel, .kpi, .modal { border-radius: 12px; }
/* Liens sur fond sombre : Indigo clair (charte) */
a { color: var(--sp-indigo-clair); }
.sidebar-header .sidebar-logo { display: inline-flex; align-items: center; text-decoration: none; }
.sidebar-header .sidebar-logo img { display: block; }
.login-logo-text img { display: block; margin: 0 auto; max-width: 100%; height: 44px; width: auto; }

/* ── Réglages d'une application (public/js/apps-form.js) : éditeur de scénario, programmation ── */
.af-row { margin-bottom: 10px; }
.af-row .form-label { margin-bottom: 4px; }
.af-check { display: flex; gap: 8px; align-items: center; font-size: 13px; cursor: pointer; }
.af-help { font-size: 12px; color: var(--text-muted); line-height: 1.45; margin-top: 4px; }
.af-zones { display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 4px 10px; max-height: 190px; overflow: auto; padding: 8px; background: var(--bg-input); border-radius: 8px; }
.af-zones label { font-size: 12px; display: flex; gap: 6px; align-items: center; cursor: pointer; }
.af-city-res { display: flex; flex-direction: column; gap: 4px; margin-top: 6px; }
.af-city-res button { text-align: left; background: var(--bg-input); border: 1px solid var(--border); color: var(--text-primary); border-radius: 8px; padding: 6px 10px; cursor: pointer; font-size: 12px; }
.af-colors { display: flex; gap: 10px; flex-wrap: wrap; align-items: center; font-size: 12px; }
.af-colors label { display: flex; gap: 5px; align-items: center; cursor: pointer; }
.af-error { font-size: 12px; color: #f59e0b; margin-top: 6px; line-height: 1.4; }

/* ── Recherche intelligente de la barre du haut (public/js/search.js) ── */
.topbar-search { position: relative; flex: 1 1 auto; max-width: 520px; margin: 0 20px; display: flex; align-items: center; }
.sp-search-icon { position: absolute; left: 12px; color: var(--text-muted); pointer-events: none; }
.sp-search-input {
  width: 100%; height: 38px; padding: 0 64px 0 36px;
  background: var(--bg-card); border: 1px solid var(--border); border-radius: 10px;
  color: var(--text-primary); font-size: 14px; outline: none; transition: border-color .15s, box-shadow .15s;
}
.sp-search-input::placeholder { color: var(--text-muted); }
.sp-search-input:focus { border-color: var(--accent); box-shadow: 0 0 0 3px var(--accent-light); }
.sp-search-kbd {
  position: absolute; right: 10px; padding: 2px 6px; border: 1px solid var(--border); border-radius: 5px;
  font: 11px/1.4 inherit; color: var(--text-muted); background: var(--bg-secondary); pointer-events: none;
}
.sp-search-input:focus ~ .sp-search-kbd { display: none; }
.sp-search-btn { display: none; }
.sp-search-results {
  position: absolute; top: calc(100% + 6px); left: 0; right: 0; z-index: 200;
  max-height: min(70vh, 520px); overflow-y: auto; padding: 6px;
  background: var(--bg-modal); border: 1px solid var(--border); border-radius: 12px; box-shadow: 0 16px 40px rgba(0,0,0,.45);
}
.sp-search-results[hidden] { display: none; }
.sp-sr-group { padding: 8px 10px 4px; font-size: 11px; font-weight: 700; letter-spacing: .06em; text-transform: uppercase; color: var(--text-muted); }
.sp-sr-item { display: flex; align-items: center; gap: 10px; padding: 8px 10px; border-radius: 8px; color: var(--text-primary); text-decoration: none; cursor: pointer; }
.sp-sr-item.active, .sp-sr-item:hover { background: var(--accent-light); }
.sp-sr-item.active .sp-sr-icon { color: var(--accent); }
.sp-sr-icon { width: 22px; flex: none; text-align: center; color: var(--text-muted); font-size: 15px; }
.sp-sr-text { display: flex; flex-direction: column; min-width: 0; }
.sp-sr-label { font-size: 14px; font-weight: 600; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.sp-sr-hint { font-size: 12px; color: var(--text-secondary); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.sp-sr-empty { padding: 14px 12px; font-size: 13px; color: var(--text-secondary); line-height: 1.5; }
.sp-sr-empty a { color: var(--accent); }
/* Élément mis en évidence à l'arrivée (?trouver=…) */
.sp-spot { outline: 3px solid var(--accent) !important; outline-offset: 4px; border-radius: 8px; animation: spSpotPulse 1.4s ease-in-out infinite; }
@keyframes spSpotPulse { 0%, 100% { outline-color: var(--accent); } 50% { outline-color: transparent; } }
.sp-tip { position: absolute; z-index: 902; max-width: 300px; padding: 12px 14px; border-radius: 10px; background: var(--accent); color: #fff; font-size: 13px; line-height: 1.45; box-shadow: 0 8px 24px rgba(0,0,0,.4); }
.sp-tip::before { content: ''; position: absolute; top: -7px; left: 24px; border: 7px solid transparent; border-top: 0; border-bottom-color: var(--accent); }
.sp-tip button { display: block; margin: 8px 0 0 auto; background: rgba(255,255,255,.2); border: none; color: #fff; border-radius: 6px; padding: 4px 10px; font-size: 12px; cursor: pointer; }
@media (max-width: 1100px) {
  .topbar-search { margin: 0 12px; }
  .sp-search-kbd { display: none; }
}
/* Téléphone : une loupe ; touchée, le champ s'ouvre par-dessus toute la barre */
@media (max-width: 768px) {
  .topbar-search { flex: 0 0 auto; margin: 0; position: static; }
  .sp-search-btn { display: flex; }
  .sp-search-icon, .sp-search-input, .sp-search-kbd { display: none; }
  .topbar-search.open { position: absolute; left: 8px; right: 8px; top: 50%; transform: translateY(-50%); z-index: 60; }
  .topbar-search.open .sp-search-btn { display: none; }
  .topbar-search.open .sp-search-icon, .topbar-search.open .sp-search-input { display: block; }
  .topbar-search.open .sp-search-input { box-shadow: 0 6px 20px rgba(0,0,0,.5); }
}
.sp-sr-item.sp-sr-locked { cursor: default; opacity: .75; }
.sp-sr-item.sp-sr-locked .sp-sr-hint { white-space: normal; }

/* ══════════════════════════════════════════════════════════════════
   PAGE DE CONNEXION (02/11/2026, sur le modèle de MenuPush) : carte en
   deux parties — panneau ScreenPush Indigo à gauche, formulaire blanc à
   droite. Sur téléphone, le panneau passe au-dessus (accroche + inscription).
   Classes auth-* utilisées seulement par views/auth/login.php.
   ══════════════════════════════════════════════════════════════════ */
.auth-page {
  min-height: 100vh; display: flex; align-items: center; justify-content: center;
  padding: 40px 20px;
  background:
    radial-gradient(900px 600px at 0% 0%, rgba(107,110,249,.28), transparent 60%),
    radial-gradient(800px 600px at 100% 100%, rgba(140,143,255,.22), transparent 60%),
    #14152B;
}
.auth-card {
  width: 100%; max-width: 980px; min-height: 600px;
  display: grid; grid-template-columns: 5fr 7fr;
  background: #fff; border-radius: 24px; overflow: hidden;
  box-shadow: 0 30px 80px rgba(0,0,0,.45);
}
.auth-brand {
  position: relative; overflow: hidden; color: #fff;
  padding: 44px 36px; display: flex; flex-direction: column;
  background: linear-gradient(150deg, #6B6EF9 0%, #4F52E0 55%, #3B3DB8 100%);
}
.auth-brand::before, .auth-brand::after {
  content: ""; position: absolute; border-radius: 50%; background: rgba(255,255,255,.10); pointer-events: none;
}
.auth-brand::before { width: 300px; height: 300px; top: -110px; right: -120px; }
.auth-brand::after { width: 220px; height: 220px; bottom: -110px; left: -90px; }
.auth-brand > * { position: relative; z-index: 1; }
.auth-brand-logo { display: block; align-self: flex-start; height: 40px; width: auto; max-width: 100%; }
.auth-brand-tagline {
  font-family: 'Sora', sans-serif; font-weight: 700; font-size: 22px; line-height: 1.35;
  margin: 28px 0 26px; letter-spacing: -.01em;
}
.auth-brand-points { list-style: none; margin: 0; padding: 0; }
.auth-brand-points li {
  position: relative; padding-left: 34px; margin-bottom: 16px; font-size: 15px; line-height: 1.5; color: #EEF0FF;
}
.auth-brand-points li::before {
  content: ""; position: absolute; left: 0; top: 1px; width: 22px; height: 22px; border-radius: 50%;
  background: rgba(255,255,255,.22) url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='white' stroke-width='3' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpolyline points='20 6 9 17 4 12'/%3E%3C/svg%3E") center / 12px no-repeat;
}
.auth-brand-aside { margin-top: auto; padding-top: 28px; }
.auth-brand-aside p { margin: 0 0 10px; font-size: 14px; color: #E2E3FF; }
.auth-brand-btn {
  display: inline-block; padding: 10px 20px; border-radius: 999px; background: #fff; color: #4F52E0;
  font-weight: 700; font-size: 14px; text-decoration: none; transition: transform .15s, box-shadow .15s;
}
.auth-brand-btn:hover { transform: translateY(-1px); box-shadow: 0 6px 18px rgba(20,21,43,.25); }

.auth-main { display: flex; flex-direction: column; padding: 56px 72px 32px; color: #14152B; }
.auth-form { width: 100%; max-width: 420px; margin: auto 0; }
.auth-title { font-family: 'Sora', sans-serif; font-size: 28px; font-weight: 700; margin: 0 0 8px; color: #14152B; letter-spacing: -.01em; }
.auth-intro { margin: 0 0 28px; font-size: 15px; line-height: 1.5; color: #5C5E7A; }
.auth-field { margin-bottom: 18px; }
.auth-label { display: block; margin-bottom: 7px; font-size: 14px; font-weight: 700; color: #14152B; }
.auth-input {
  width: 100%; height: 48px; padding: 0 14px; border-radius: 12px; font: inherit; font-size: 15px;
  color: #14152B; background: #fff; border: 1px solid #D9DAEE; transition: border-color .15s, box-shadow .15s;
}
.auth-input::placeholder { color: #9A9CB5; }
.auth-input:focus { outline: none; border-color: #6B6EF9; box-shadow: 0 0 0 4px rgba(107,110,249,.18); }
.auth-main .pw-toggle { color: #5C5E7A; }
.auth-main .pw-toggle:hover { color: #14152B; background: #F4F4FB; }
.auth-forgot { text-align: right; margin: -6px 0 20px; font-size: 14px; }
.auth-forgot a, .auth-back a, .auth-footer a { color: #4F52E0; font-weight: 700; text-decoration: none; }
.auth-forgot a:hover, .auth-back a:hover, .auth-footer a:hover { text-decoration: underline; }
.auth-submit {
  display: block; width: 100%; height: 50px; border: 0; border-radius: 999px; cursor: pointer;
  font: inherit; font-size: 15px; font-weight: 700; color: #fff; text-align: center; line-height: 50px; text-decoration: none;
  background: linear-gradient(135deg, #6B6EF9, #4F52E0); box-shadow: 0 10px 24px rgba(107,110,249,.35);
  transition: transform .15s, box-shadow .15s;
}
.auth-submit:hover { transform: translateY(-1px); box-shadow: 0 14px 28px rgba(107,110,249,.45); }
.auth-back { margin: 18px 0 0; text-align: center; font-size: 14px; }
.auth-account { margin: -12px 0 20px; font-size: 14px; color: #5C5E7A; }
.auth-account strong { color: #14152B; }
.auth-alert { margin-bottom: 18px; padding: 12px 14px; border-radius: 12px; font-size: 14px; line-height: 1.45; }
.auth-alert-error { background: #FDECEC; color: #A3262A; border: 1px solid #F5C2C3; }
.auth-alert-success { background: #ECFAF1; color: #1B7A43; border: 1px solid #BFE9CF; }
.auth-footer { margin-top: 36px; padding-top: 18px; border-top: 1px solid #E3E4F3; font-size: 13px; color: #5C5E7A; max-width: 420px; }
.auth-footer p { margin: 0 0 6px; }
.auth-legal span { color: #9A9CB5; }
/* Choix de la langue + mention « traduit par IA » (helpers/i18n.php) */
.auth-lang { margin-top: 10px !important; }
.auth-lang strong { color: #14152B; }
.auth-ai-notice { font-size: 12px; color: #9A9CB5; font-style: italic; }
.lang-menu a { color: var(--accent); }
.lang-menu strong { color: inherit; }
/* Inscription (views/auth/signup.php) */
.auth-row { display: flex; gap: 14px; }
.auth-row .auth-field { flex: 1; min-width: 0; }
.auth-hp { position: absolute; left: -9999px; width: 1px; height: 1px; overflow: hidden; }
.auth-check { display: flex; gap: 10px; align-items: flex-start; margin: 2px 0 20px; font-size: 13px; line-height: 1.5; color: #5C5E7A; cursor: pointer; }
.auth-check input { margin-top: 3px; width: 16px; height: 16px; accent-color: #6B6EF9; flex-shrink: 0; }
.auth-text { margin: 0 0 14px; font-size: 15px; line-height: 1.6; color: #5C5E7A; }
.auth-text strong { color: #14152B; }
.auth-sent-icon { font-size: 44px; margin: 0 0 10px; }
.auth-submit + .auth-submit { margin-top: 12px; }
.auth-submit-ghost { background: #fff; color: #4F52E0; border: 1.5px solid #C9CAFD; box-shadow: none; line-height: 47px; }
.auth-submit-ghost:hover { box-shadow: 0 6px 16px rgba(107,110,249,.18); }
.auth-alert a { color: inherit; font-weight: 700; }
/* Continuer avec Google (views/auth/google_button.php, 16/11/2026) */
.auth-google {
  display: flex; align-items: center; justify-content: center; gap: 10px; width: 100%; height: 50px; box-sizing: border-box;
  border: 1.5px solid #DADCE0; border-radius: 999px; background: #fff; color: #14152B;
  font-size: 15px; font-weight: 600; text-decoration: none; transition: background .15s, border-color .15s;
}
.auth-google:hover { background: #F7F8FC; border-color: #C4C7D0; }
.auth-google:focus-visible { outline: 2px solid #6B6EF9; outline-offset: 2px; }
.auth-sep { display: flex; align-items: center; gap: 12px; margin: 18px 0; font-size: 13px; color: #9A9CB5; }
.auth-sep::before, .auth-sep::after { content: ""; flex: 1; height: 1px; background: #E3E4F3; }

@media (max-width: 820px) {
  .auth-page { padding: 0; align-items: stretch; }
  .auth-card { grid-template-columns: 1fr; border-radius: 0; min-height: 100vh; box-shadow: none; }
  .auth-brand { padding: 28px 24px 30px; }
  .auth-brand-logo { height: 34px; }
  .auth-brand-tagline { font-size: 19px; margin: 18px 0 18px; }
  .auth-brand-points { display: none; }
  .auth-brand-aside { margin-top: 0; padding-top: 0; }
  .auth-main { padding: 36px 24px 28px; }
  .auth-title { font-size: 25px; }
  .auth-row { flex-direction: column; gap: 0; }
}

/* ══════════════════════════════════════════════════════════════════
   BACK-OFFICE (bo.screenpush.fr, views/bo/) — 02/11/2026
   ══════════════════════════════════════════════════════════════════ */
.bo-access-btn { text-decoration: none; white-space: nowrap; }
@media (max-width: 900px) { .bo-access-label { display: none; } }
.bo-badge { margin: 0 16px 6px; padding: 6px 10px; border-radius: 999px; text-align: center; font-size: 11px; font-weight: 700; letter-spacing: .12em; color: #fff; background: linear-gradient(135deg, #6B6EF9, #4F52E0); }
.bo-user { font-size: 13px; color: var(--text-secondary); }
.bo-muted { color: var(--text-muted); font-size: 12.5px; }
.bo-cards { display: grid; grid-template-columns: repeat(auto-fill, minmax(190px, 1fr)); gap: 14px; margin-bottom: 22px; }
.bo-card { display: flex; flex-direction: column; gap: 6px; padding: 18px; border-radius: 14px; background: var(--bg-card); border: 1px solid var(--border); text-decoration: none; transition: border-color .15s, transform .15s; }
.bo-card:hover { border-color: var(--accent); transform: translateY(-1px); }
.bo-card-value { font-family: 'Sora', sans-serif; font-size: 26px; font-weight: 700; color: var(--text-primary); }
.bo-card-label { font-size: 13px; color: var(--text-secondary); }
.bo-grid2 { display: grid; grid-template-columns: 1fr 1fr; gap: 20px; }
@media (max-width: 1000px) { .bo-grid2 { grid-template-columns: 1fr; } }
.bo-panel { padding: 20px; border-radius: 14px; background: var(--bg-card); border: 1px solid var(--border); }
.bo-panel-danger { border-color: rgba(239,68,68,.45); }
.bo-h2 { font-family: 'Sora', sans-serif; font-size: 16px; font-weight: 700; margin: 0 0 12px; color: var(--text-primary); }
.bo-line { padding: 7px 0; border-bottom: 1px solid var(--border); font-size: 13px; color: var(--text-secondary); }
.bo-line:last-child { border-bottom: 0; }
.bo-actions { display: flex; gap: 6px; flex-wrap: wrap; align-items: center; }
.bo-actions form { display: inline; margin: 0; }
.bo-inline { margin: 0; }
.bo-select { min-width: 160px; padding: 4px 8px; font-size: 12.5px; }
.bo-scroll { max-width: 100%; }
.bo-table td { white-space: nowrap; max-width: 320px; overflow: hidden; text-overflow: ellipsis; font-size: 12.5px; }
.bo-table th a { color: inherit; text-decoration: none; white-space: nowrap; }
.bo-row-link { cursor: pointer; }
.bo-row-link:hover td { background: var(--bg-card-hover); }
.bo-null { color: var(--text-muted); font-style: italic; font-size: 11px; }
.bo-pager { display: flex; gap: 12px; align-items: center; justify-content: center; margin-top: 16px; color: var(--text-secondary); font-size: 13px; }
.bo-chips { display: flex; flex-wrap: wrap; gap: 8px; }
.bo-chip { padding: 5px 12px; border-radius: 999px; background: var(--bg-input); color: var(--text-primary); text-decoration: none; font-size: 12.5px; }
.bo-chip span { color: var(--text-muted); margin-left: 4px; }
.bo-chip:hover { background: var(--accent-light); color: var(--accent); }
.bo-form { max-width: 820px; }
.bo-field { margin-bottom: 14px; }
.bo-locked { padding: 9px 12px; border-radius: 8px; background: var(--bg-secondary); color: var(--text-muted); font-size: 13px; word-break: break-all; }
.bo-null-check { display: inline-flex; gap: 6px; align-items: center; margin-top: 6px; font-size: 12.5px; color: var(--text-secondary); }
.bo-link-btn { border: 0; background: none; padding: 0; font: inherit; font-weight: 700; color: #4F52E0; cursor: pointer; }
.bo-link-btn:hover { text-decoration: underline; }
.bo-code-input { text-align: center; font-size: 26px !important; letter-spacing: 10px; font-weight: 700; }
@media (max-width: 768px) {
  .bo .bo-user, .bo .topbar-left strong, .bo .topbar-right a[target="_blank"] { display: none; }
}
/* Back-office : E-mails et notifications */
.bo-switch { display: inline-flex; align-items: center; gap: 8px; padding: 4px 10px 4px 4px; border-radius: 999px; border: 1px solid var(--border); background: var(--bg-input); color: var(--text-muted); font: inherit; font-size: 12px; font-weight: 600; cursor: pointer; }
.bo-switch span { width: 28px; height: 16px; border-radius: 999px; background: var(--border); position: relative; transition: background .15s; }
.bo-switch span::after { content: ""; position: absolute; top: 2px; left: 2px; width: 12px; height: 12px; border-radius: 50%; background: #fff; transition: left .15s; }
.bo-switch.on { color: var(--green); border-color: rgba(34,197,94,.4); }
.bo-switch.on span { background: var(--green); }
.bo-switch.on span::after { left: 14px; }
.bo-switch:disabled { opacity: .5; cursor: not-allowed; }
.bo-alerts td { vertical-align: top; }
.bo-details summary { list-style: none; cursor: pointer; display: inline-flex; }
.bo-details summary::-webkit-details-marker { display: none; }
.bo-details[open] { min-width: min(520px, 80vw); }
.bo-alert-form { display: flex; flex-direction: column; gap: 6px; margin: 10px 0; }
.bo-alert-form .form-label { margin: 6px 0 0; }
.bo-help { font-size: 13px; color: var(--text-secondary); line-height: 1.6; }
.bo-help code, .bo-alerts code { background: var(--bg-input); padding: 1px 6px; border-radius: 5px; }
/* Back-office : recherche globale et fiches */
.bo-topsearch { flex: 1; max-width: 460px; }
.bo-topsearch .form-input { width: 100%; height: 38px; }
.bo-search-big { min-width: min(520px, 100%) !important; font-size: 15px; }
.bo-result { display: flex; flex-direction: column; gap: 2px; padding: 9px 10px; border-radius: 8px; text-decoration: none; color: var(--text-primary); border-bottom: 1px solid var(--border); }
.bo-result:hover { background: var(--bg-card-hover); }
.bo-result span { font-size: 12.5px; color: var(--text-muted); }
.bo-anchors { display: flex; flex-wrap: wrap; gap: 6px; margin: 0 0 18px; position: sticky; top: 64px; z-index: 5; padding: 8px 0; background: var(--bg-primary); }
.bo-anchors a { padding: 5px 12px; border-radius: 999px; background: var(--bg-card); border: 1px solid var(--border); color: var(--text-secondary); text-decoration: none; font-size: 12.5px; }
.bo-anchors a:hover { color: var(--accent); border-color: var(--accent); }
.bo-dl { display: grid; grid-template-columns: 150px 1fr; gap: 8px 12px; margin: 0; font-size: 13.5px; }
.bo-dl dt { color: var(--text-muted); }
.bo-dl dd { margin: 0; color: var(--text-primary); }
.bo-bar { height: 5px; border-radius: 99px; background: var(--bg-input); margin-top: 4px; overflow: hidden; max-width: 260px; }
.bo-bar span { display: block; height: 100%; background: var(--accent); }
.bo-focus td { background: var(--accent-light); }
.bo-intervention td { background: rgba(245,158,11,.06); }
.bo-over { color: var(--red); font-weight: 700; }
@media (max-width: 900px) { .bo-topsearch { max-width: none; } .bo-dl { grid-template-columns: 1fr; gap: 2px; } .bo-dl dd { margin-bottom: 8px; } }
.bo-alert-actions { white-space: nowrap; }
.bo-alert-actions .bo-details { display: inline-block; vertical-align: top; white-space: normal; }
.bo-original { margin: 10px 0; display: flex; flex-direction: column; gap: 6px; font-size: 13px; max-width: 640px; }
.bo-original-frame { width: min(640px, 80vw); height: 320px; border: 1px solid var(--border); border-radius: 8px; background: #fff; }
/* Back-office : Ventes */
.bo-period .form-select { min-width: 200px; }
.bo-period input[type=date] { width: auto; min-width: 0; display: inline-block; }
.bo-card-accent { border-color: rgba(107,110,249,.55); background: linear-gradient(160deg, rgba(107,110,249,.16), var(--bg-card) 60%); }
.bo-card-loss { border-color: rgba(239,68,68,.45); }
.bo-card .up { color: var(--green); font-weight: 700; }
.bo-card .down { color: var(--red); font-weight: 700; }
.bo-chart { position: relative; height: 240px; }
.bo-chart-title { font-size: 11px; font-weight: 700; letter-spacing: .1em; color: var(--text-muted); margin: 6px 0; }
.bo-h3 { font-size: 13px; font-weight: 700; margin: 16px 0 6px; color: var(--text-secondary); text-transform: uppercase; letter-spacing: .06em; }
/* Emailings : champs de largeur raisonnable (une liste déroulante pleine largeur sur grand écran
   ouvrait une fenêtre de choix rétrécie par le navigateur, au texte coupé à gauche) */
.bo-alert-form .form-select, .bo-alert-form .form-input:not(textarea) { max-width: 640px; }
.bo-alert-form textarea.form-input { max-width: 900px; }

/* ── Fenêtre plein écran avant paiement (views/account/billing_modal.php) ── */
.req { color: var(--red, #e5484d); font-weight: 700; margin-left: 2px; }
.modal-overlay.modal-full { padding: 0; align-items: stretch; backdrop-filter: none; }
.modal-full .modal { max-width: none; max-height: none; height: 100%; border-radius: 0; border: none; padding: 32px 20px; overflow-y: auto; }
.modal-full .billing-step { max-width: 720px; margin: 0 auto; }
.billing-steps { display: flex; gap: 8px; align-items: center; font-size: 12px; font-weight: 600; text-transform: uppercase; letter-spacing: .5px; color: var(--text-muted); margin-bottom: 8px; }
.billing-steps .on { color: var(--accent); }
@media (max-width: 640px) {
  .modal-overlay.modal-full { padding: 0; }
  .modal-full .modal { border-radius: 0; padding: 20px 16px; min-height: 100%; }
}

/* ── Choix de la langue : drapeaux FR / EN dans la barre du haut (Lang::flagsHtml) ── */
.lang-flags { display: flex; align-items: center; gap: 2px; flex: none; margin-right: 12px; padding: 3px; border: 1px solid var(--border); border-radius: 10px; background: var(--bg-card); }
.lang-flag { display: flex; align-items: center; gap: 5px; padding: 4px 7px; border-radius: 7px; color: var(--text-muted); text-decoration: none; font-size: 11px; font-weight: 700; letter-spacing: .04em; opacity: .55; transition: opacity .15s, background .15s; }
.lang-flag svg { display: block; border-radius: 2px; box-shadow: 0 0 0 1px rgba(255,255,255,.15); }
.lang-flag:hover { opacity: 1; background: var(--accent-light); color: var(--text-primary); }
.lang-flag.active { opacity: 1; background: var(--accent-light); color: var(--text-primary); }
/* Téléphone : drapeaux seuls, sans « FR / EN » */
@media (max-width: 768px) {
  .lang-flags { margin: 0 4px; }
  .lang-flag { padding: 4px 5px; }
  .lang-flag span { display: none; }
}
/* La barre répartit l'espace (space-between) : recherche + drapeaux restent collés et centrés ensemble */
.topbar-search { margin-left: auto; margin-right: 8px; }
.lang-flags { margin-right: auto; }
@media (max-width: 768px) { .topbar-search { margin-right: 0; } }
/* Back-office : drapeaux juste après la recherche globale */
.bo .lang-flags { margin-left: 12px; }

/* Codes promo (23/11/2026) : point turquoise « remise en cours », formulaire du back-office */
.promo-dot { width: 9px; height: 9px; border-radius: 50%; display: inline-block; flex-shrink: 0; vertical-align: middle; background: #14C8D2; box-shadow: 0 0 0 3px rgba(20,200,210,.22), 0 0 8px rgba(20,200,210,.75); }
.badge-promo { background: rgba(20,200,210,.16); color: #0E9AA3; }
.promo-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(230px, 1fr)); gap: 0 16px; }
.promo-choices { display: grid; grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); gap: 10px; }
.promo-choice { display: flex; gap: 10px; align-items: flex-start; padding: 12px; border-radius: 10px; border: 1px solid var(--border); background: var(--bg-input); cursor: pointer; font-size: 13.5px; }
.promo-choice:has(input:checked) { border-color: #14C8D2; box-shadow: 0 0 0 1px #14C8D2 inset; }
.promo-guard { margin-top: 8px; padding: 10px 12px; border-radius: 8px; font-size: 12.5px; line-height: 1.5; background: rgba(245,158,11,.12); color: var(--text-secondary); }
.promo-guard-over { background: rgba(239,68,68,.14); color: var(--red); font-weight: 600; }
.promo-code-input { text-transform: uppercase; font-family: monospace; letter-spacing: .06em; max-width: 220px; }
.promo-client { display: flex; gap: 8px; align-items: flex-end; flex-wrap: wrap; }
.promo-client .form-input { max-width: 200px; text-transform: uppercase; }
.promo-client-msg { font-size: 13px; margin-top: 4px; }

/* Back-office : menu de gauche qui défile + familles repliables (23/11/2026) */
body.bo .sidebar { overflow-y: auto; }
.bo-nav-toggle { display: flex; align-items: center; justify-content: space-between; width: 100%; border: 0; background: none; cursor: pointer; font-family: inherit; text-align: left; }
.bo-nav-toggle:hover { color: var(--text-primary); }
.bo-nav-chevron { flex-shrink: 0; transition: transform .2s ease; }
.bo-nav-toggle[aria-expanded="false"] .bo-nav-chevron { transform: rotate(-90deg); }
.sidebar-nav[hidden] { display: none; }
