:root {
  /* Theme: "Atelier des Souvenirs" — ivory paper + navy ink + terracotta accent */
  --font: 'Lora', Georgia, serif;
  --font-display: 'Playfair Display', Georgia, serif;
  --bg: #faf6ef;
  --bg-dark: #f1e5d0;
  --surface: #ffffff;
  --card-bg: rgba(255, 255, 255, 0.75);
  --border: #e8dfd0;
  --border-light: #f1e5d0;
  --text: #1a2847;
  --text-secondary: #3d4a6b;
  --text-muted: #7a8299;
  --primary: #c26b4a;
  --primary-light: rgba(194, 107, 74, 0.15);
  --primary-hover: #a85a3d;
  --success: #6b8e5a;
  --success-light: rgba(107, 142, 90, 0.16);
  --warning: #d49540;
  --warning-light: rgba(212, 149, 64, 0.18);
  --danger: #c14141;
  --danger-light: rgba(193, 65, 65, 0.12);
  --hover: rgba(194, 107, 74, 0.10);
  --sidebar-w: 260px;
  --topbar-h: 56px;
  --radius: 10px;
  --radius-sm: 6px;
  --shadow-sm: 0 1px 2px rgba(26, 40, 71, 0.06);
  --shadow: 0 1px 3px rgba(26, 40, 71, 0.08);
  --shadow-md: 0 4px 6px -1px rgba(26, 40, 71, 0.10);
  --transition: 0.15s ease;

  /* Gold palette → terracotta/clay tones (main accent on ivory) */
  --gold-50: #fdf5ef; --gold-100: #f9e7d8; --gold-200: #f0cbab;
  --gold-300: #d98866; --gold-400: #c26b4a; --gold-500: #a85a3d;
  --gold-600: #8e4a30; --gold-700: #743a25; --gold-800: #5a2e1d; --gold-900: #401f13;

  /* Royal palette → sage green for "success" accents + ivory for legacy dark-bg roles. 950 is navy ink for text-on-terracotta. */
  --royal-50: #fcfaf5; --royal-100: #f5ecd9; --royal-200: #c9d6be;
  --royal-300: #8fae7f; --royal-400: #6b8e5a; --royal-500: #547048;
  --royal-600: #3d5335;
  --royal-700: #e8dfd0;
  --royal-800: #f1e5d0;
  --royal-900: #faf6ef;
  --royal-950: #1a2847;

  /* Cream palette → navy ink tones for text on ivory */
  --cream-50: #fefdfb;
  --cream-100: #1a2847;
  --cream-200: #2d3a5a;
  --cream-300: #3d4a6b;
  --cream-400: #4d5f85;
  --cream-500: #7a8299;
}

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

body {
  font-family: var(--font);
  background: var(--bg);
  color: var(--text);
  line-height: 1.5;
  min-height: 100vh;
  display: flex;
  -webkit-font-smoothing: antialiased;
}

/* Scrollbar */
::-webkit-scrollbar { width: 8px; height: 8px; }
::-webkit-scrollbar-track { background: var(--royal-900); }
::-webkit-scrollbar-thumb { background: var(--royal-600); border-radius: 4px; }
::-webkit-scrollbar-thumb:hover { background: var(--royal-500); }

/* Section titles */
h1, h2, h3, h4, h5, h6 {
  font-family: var(--font-display);
}

/* Interactive elements transitions */
a, button, input, select, textarea {
  transition: color var(--transition), background var(--transition), border-color var(--transition), box-shadow var(--transition);
}

/* ─── SIDEBAR ─── */
.sidebar {
  width: var(--sidebar-w);
  height: 100vh;
  position: fixed;
  left: 0; top: 0;
  background: var(--surface);
  border-right: 1px solid var(--border);
  display: flex;
  flex-direction: column;
  z-index: 100;
  transition: transform 0.25s ease;
}

.sidebar-brand {
  padding: 1.25rem 1.25rem 1rem;
  display: flex;
  align-items: center;
  gap: 0.75rem;
  border-bottom: 1px solid var(--royal-700);
}

.brand-icon {
  width: 40px; height: 40px;
  background: var(--gold-400);
  color: var(--royal-950);
  border-radius: var(--radius-sm);
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

.brand-name {
  font-size: 1.05rem;
  font-weight: 700;
  color: var(--gold-300);
  display: block;
  line-height: 1.2;
  font-family: var(--font-display);
}

.brand-sub {
  font-size: 0.75rem;
  color: var(--cream-500);
  display: block;
}

.sidebar-nav {
  flex: 1;
  padding: 0.75rem;
  overflow-y: auto;
}

.nav-section { margin-bottom: 1.25rem; }

.nav-section-title {
  display: block;
  font-size: 0.65rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--gold-400);
  padding: 0.5rem 0.75rem 0.35rem;
  font-family: var(--font-display);
}

.nav-item {
  display: flex;
  align-items: center;
  gap: 0.6rem;
  padding: 0.55rem 0.75rem;
  border-radius: var(--radius-sm);
  color: var(--cream-400);
  text-decoration: none;
  font-size: 0.88rem;
  font-weight: 500;
  transition: background var(--transition), color var(--transition);
}

.nav-item:hover { background: var(--royal-700); color: var(--cream-100); }

.nav-item.active {
  background: rgba(176, 141, 87, 0.30);
  color: var(--gold-400);
  box-shadow: inset 0 0 0 1px var(--gold-500);
}

.nav-item svg { flex-shrink: 0; }

.sidebar-footer {
  padding: 1rem 1.25rem;
  border-top: 1px solid var(--royal-700);
}

.server-status {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  font-size: 0.8rem;
  color: var(--text-muted);
}

.status-dot {
  width: 8px; height: 8px;
  border-radius: 50%;
  background: var(--text-muted);
  flex-shrink: 0;
}

.status-dot.online { background: var(--success); box-shadow: 0 0 0 3px rgba(58, 157, 100, .25); }
.status-dot.offline { background: var(--danger); }

/* ─── APP CONTENT ─── */
.app-content {
  margin-left: var(--sidebar-w);
  flex: 1;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}

.topbar {
  height: var(--topbar-h);
  padding: 0 2rem;
  display: flex;
  align-items: center;
  gap: 1rem;
  background: var(--surface);
  border-bottom: 1px solid var(--border);
  position: sticky;
  top: 0;
  z-index: 50;
}

.topbar-title {
  font-size: 0.95rem;
  font-weight: 600;
  font-family: var(--font-display);
  color: var(--cream-200);
}

/* ─── TOPBAR CREDITS ─── */
.topbar-credits {
  margin-left: auto;
  display: flex;
  align-items: center;
  gap: 0.35rem;
  font-size: 0.75rem;
  color: var(--text-muted);
}

.topbar-credits svg {
  color: var(--text-muted);
  flex-shrink: 0;
}

.topbar-credits-text {
  white-space: nowrap;
  font-weight: 500;
}

.topbar-credits-text .credits-count {
  font-weight: 700;
  color: var(--text);
}

.topbar-credits-text .credits-label {
  color: var(--text-muted);
}

.topbar-credits.low svg,
.topbar-credits.low .credits-count {
  color: var(--warning);
}

.topbar-credits.critical svg,
.topbar-credits.critical .credits-count {
  color: var(--danger);
}

.topbar-separator {
  width: 1px;
  height: 20px;
  background: var(--border);
  margin: 0 0.25rem;
  flex-shrink: 0;
}

/* ─── TOPBAR DISK USAGE ─── */
.topbar-disk {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  font-size: 0.78rem;
  color: var(--text-secondary);
  cursor: default;
  flex-shrink: 0;
}

.topbar-disk svg {
  color: var(--text-muted);
  flex-shrink: 0;
}

.topbar-disk-text {
  white-space: nowrap;
  font-weight: 500;
}

.topbar-disk-bar {
  width: 80px;
  height: 6px;
  background: var(--bg-dark);
  border-radius: 99px;
  overflow: hidden;
  flex-shrink: 0;
}

.topbar-disk-fill {
  height: 100%;
  background: var(--success);
  border-radius: 99px;
  transition: width 0.4s ease, background 0.4s ease;
  width: 0;
}

.topbar-disk-fill.warning {
  background: var(--warning);
}

.topbar-disk-fill.danger {
  background: var(--danger);
}

/* ─── TOPBAR IMPORT PROGRESS ─── */
.topbar-import {
  margin-left: auto;
  display: flex;
  flex-direction: column;
  gap: 0.2rem;
  min-width: 260px;
  max-width: 480px;
}

.topbar-import-info {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  font-size: 0.78rem;
  color: var(--text-secondary);
}

.topbar-import-info svg {
  color: var(--primary);
  flex-shrink: 0;
  animation: topbar-dl-pulse 1.5s ease infinite;
}

@keyframes topbar-dl-pulse {
  0%, 100% { opacity: 1; }
  50% { opacity: 0.4; }
}

.topbar-import-name {
  font-weight: 600;
  color: var(--text);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  max-width: 160px;
}

.topbar-import-status {
  color: var(--text-muted);
  white-space: nowrap;
}

.topbar-import-pct {
  font-weight: 700;
  color: var(--primary);
  white-space: nowrap;
  font-variant-numeric: tabular-nums;
}

.topbar-import-detail {
  font-size: 0.7rem;
  color: var(--text-muted);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  min-height: 0.85rem;
  font-variant-numeric: tabular-nums;
}

.topbar-import-bar {
  height: 4px;
  background: var(--bg-dark);
  border-radius: 99px;
  overflow: hidden;
}

.topbar-import-fill {
  height: 100%;
  background: var(--primary);
  border-radius: 99px;
  transition: width 0.4s ease;
  width: 0;
}

.topbar-import.done .topbar-import-fill {
  background: var(--success);
}

.topbar-import.done .topbar-import-info svg {
  color: var(--success);
  animation: none;
}

.topbar-import.error .topbar-import-fill {
  background: var(--danger);
}

.topbar-import.error .topbar-import-info svg {
  color: var(--danger);
  animation: none;
}

.menu-toggle {
  display: none;
  background: none;
  border: none;
  cursor: pointer;
  padding: 0.25rem;
  color: var(--text);
}

.main {
  flex: 1;
  padding: 1.5rem 2rem 3rem;
  max-width: 1400px;
  width: 100%;
}

/* ─── PAGES ─── */
.page { animation: pageIn 0.2s ease; }
.page.hidden { display: none; }

@keyframes pageIn {
  from { opacity: 0; transform: translateY(6px); }
  to { opacity: 1; transform: translateY(0); }
}

.page-header {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 1rem;
  margin-bottom: 1.5rem;
}

.page-title { font-size: 1.5rem; font-weight: 700; margin-bottom: 0.25rem; font-family: var(--font-display); color: var(--cream-100); }
.page-desc { color: var(--cream-400); font-size: 0.9rem; }

.school-detail-header-row {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  flex-wrap: wrap;
}

.school-ref-block {
  display: flex;
  align-items: center;
  gap: 0.4rem;
  flex-shrink: 0;
}

.school-ref-badge {
  display: inline-block;
  font-size: 0.8rem;
  font-weight: 700;
  font-family: 'DM Mono', 'Fira Code', monospace;
  letter-spacing: 0.03em;
  padding: 0.2rem 0.55rem;
  border-radius: 0.35rem;
  cursor: pointer;
  user-select: none;
  transition: background 0.15s, color 0.15s, border-color 0.15s;
  white-space: nowrap;
}

.school-ref-badge.has-ref {
  background: var(--gold-400);
  color: #fff;
  border: 1px solid var(--gold-400);
}

.school-ref-badge.has-ref:hover {
  filter: brightness(1.1);
}

.school-ref-badge.no-ref {
  background: transparent;
  color: var(--text-muted, #94a3b8);
  border: 1px dashed var(--text-muted, #94a3b8);
  font-family: inherit;
  font-weight: 500;
  letter-spacing: 0;
}

.school-ref-badge.no-ref:hover {
  border-color: var(--primary, #6366f1);
  color: var(--primary, #6366f1);
}

.school-ref-input {
  font-size: 0.8rem;
  font-weight: 700;
  font-family: 'DM Mono', 'Fira Code', monospace;
  border: 1px solid var(--primary, #6366f1);
  border-radius: 0.35rem;
  padding: 0.2rem 0.45rem;
  outline: none;
  background: var(--bg, #fff);
  color: var(--text, #1e293b);
  box-shadow: 0 0 0 2px rgba(99,102,241,0.15);
  width: 120px;
}

.school-ref-city {
  font-size: 0.85rem;
  color: var(--text-muted, #94a3b8);
  font-weight: 500;
}

.school-assignee-badge {
  display: inline-block;
  font-size: 0.78rem;
  font-weight: 600;
  padding: 0.2rem 0.55rem;
  border-radius: 0.35rem;
  cursor: pointer;
  user-select: none;
  transition: background 0.15s, color 0.15s, border-color 0.15s;
  white-space: nowrap;
  margin-left: 4px;
}

.school-assignee-badge.has-assignee {
  background: #059669;
  color: #fff;
  border: 1px solid #059669;
}

.school-assignee-badge.has-assignee:hover {
  filter: brightness(1.1);
}

.school-assignee-badge.no-assignee {
  background: transparent;
  color: var(--text-muted, #94a3b8);
  border: 1px dashed var(--text-muted, #94a3b8);
  font-weight: 500;
}

.school-assignee-badge.no-assignee:hover {
  border-color: #059669;
  color: #059669;
}

.school-assignee-input {
  font-size: 0.8rem;
  font-weight: 600;
  border: 1px solid #059669;
  border-radius: 0.35rem;
  padding: 0.2rem 0.45rem;
  outline: none;
  background: var(--bg, #fff);
  color: var(--text, #1e293b);
  box-shadow: 0 0 0 2px rgba(5, 150, 105, 0.15);
  width: 140px;
  margin-left: 4px;
}

.school-list-ref {
  font-size: 0.78rem;
  font-weight: 700;
  font-family: 'DM Mono', 'Fira Code', monospace;
  background: var(--gold-500);
  color: var(--royal-950);
  padding: 0.12rem 0.4rem;
  border-radius: 0.25rem;
  letter-spacing: 0.02em;
  white-space: nowrap;
}

.school-list-ref-empty {
  color: var(--text-muted, #94a3b8);
}

.school-row-ref {
  white-space: nowrap;
}

.school-row-city {
  color: var(--text-muted, #94a3b8);
  font-size: 0.9rem;
}

.school-title-editable {
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.school-title-edit-btn {
  background: none;
  border: none;
  cursor: pointer;
  color: var(--text-muted, #94a3b8);
  padding: 0.2rem;
  border-radius: 0.25rem;
  opacity: 0;
  transition: opacity 0.15s, color 0.15s;
}

.school-title-editable:hover .school-title-edit-btn {
  opacity: 1;
}

.school-title-edit-btn:hover {
  color: var(--primary, #6366f1);
}

.school-title-input {
  font-size: 1.4rem;
  font-weight: 700;
  font-family: inherit;
  border: 1px solid var(--primary, #6366f1);
  border-radius: 0.4rem;
  padding: 0.15rem 0.5rem;
  outline: none;
  background: var(--bg, #fff);
  color: var(--text, #1e293b);
  box-shadow: 0 0 0 2px rgba(99,102,241,0.15);
  min-width: 300px;
}

/* ─── STATS ─── */
.stats-row {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 1rem;
  margin-bottom: 1.5rem;
}

.stat-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 1rem 1.25rem;
  display: flex;
  align-items: center;
  gap: 1rem;
  box-shadow: var(--shadow-sm);
}

.stat-icon {
  width: 42px; height: 42px;
  border-radius: var(--radius-sm);
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

.stat-icon--total { background: rgba(176, 164, 142, 0.12); color: var(--cream-400); }
.stat-icon--running { background: var(--primary-light); color: var(--gold-400); }
.stat-icon--waiting { background: var(--warning-light); color: var(--gold-300); }
.stat-icon--done { background: var(--success-light); color: var(--royal-300); }

.stat-value { display: block; font-size: 1.5rem; font-weight: 700; line-height: 1; }
.stat-label { display: block; font-size: 0.78rem; color: var(--text-muted); margin-top: 0.15rem; }

/* ─── CARDS ─── */
.card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 1.25rem 1.5rem;
  box-shadow: var(--shadow-sm);
  margin-bottom: 1rem;
}

.card-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 1rem;
}

.card-title {
  font-size: 0.95rem;
  font-weight: 600;
  font-family: var(--font-display);
  color: var(--cream-200);
}

/* ─── TABLE ─── */
.table-wrap { overflow-x: auto; }

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

.table th {
  padding: 0.6rem 0.75rem;
  text-align: left;
  font-size: 0.75rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  color: var(--text-muted);
  border-bottom: 1px solid var(--border);
}

.table td {
  padding: 0.75rem;
  border-bottom: 1px solid var(--border-light);
  font-size: 0.88rem;
}

.table tbody tr { transition: background var(--transition); }
.table tbody tr:hover { background: var(--bg); }

/* ─── BADGES ─── */
.badge {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  padding: 0.2rem 0.6rem;
  border-radius: 99px;
  font-size: 0.75rem;
  font-weight: 600;
  white-space: nowrap;
}

.badge::before {
  content: '';
  width: 6px; height: 6px;
  border-radius: 50%;
  flex-shrink: 0;
}

.badge-pending { background: rgba(176, 164, 142, 0.15); color: var(--cream-500); }
.badge-pending::before { background: var(--cream-500); }
.badge-lg[style*="cursor: pointer"]:hover { filter: brightness(1.15); transition: filter 0.15s; }
.badge-running { background: var(--primary-light); color: var(--gold-400); }
.badge-running::before { background: var(--gold-400); animation: pulse 1.5s infinite; }
.badge-waiting { background: var(--warning-light); color: var(--gold-300); }
.badge-waiting::before { background: var(--gold-300); }
.badge-completed { background: var(--success-light); color: var(--royal-300); }
.badge-completed::before { background: var(--royal-300); }
.badge-error { background: var(--danger-light); color: #f87171; }
.badge-error::before { background: #f87171; }
.badge-cancelled { background: rgba(176, 164, 142, 0.1); color: var(--cream-500); }
.badge-cancelled::before { background: var(--cream-500); }

.badge-lg { padding: 0.35rem 0.85rem; font-size: 0.85rem; }

@keyframes pulse { 0%, 100% { opacity: 1; } 50% { opacity: 0.4; } }

/* ─── BUTTONS ─── */
.btn {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  padding: 0.5rem 1rem;
  border: none;
  border-radius: var(--radius-sm);
  font-family: var(--font);
  font-size: 0.85rem;
  font-weight: 600;
  cursor: pointer;
  transition: all var(--transition);
  text-decoration: none;
  white-space: nowrap;
}

.btn-primary { background: var(--gold-500); color: var(--royal-950); font-weight: 700; }
.btn-primary:hover { background: var(--gold-400); box-shadow: var(--shadow); }

.btn-success { background: var(--success); color: white; }
.btn-success:hover { background: var(--royal-400); }

.btn-danger { background: rgba(220, 38, 38, 0.2); color: #f87171; border: 1px solid rgba(220, 38, 38, 0.3); }

.btn-warning {
  background: var(--gold-600);
  color: var(--cream-100);
  margin-bottom: 0.5rem;
}
.btn-warning:hover {
  background: var(--gold-500);
}

.btn-ghost {
  background: transparent;
  color: var(--cream-400);
  border: 1px solid var(--royal-700);
}
.btn-ghost:hover { background: var(--royal-700); color: var(--cream-100); }

.btn-sm { padding: 0.3rem 0.65rem; font-size: 0.78rem; }
.btn-lg { padding: 0.65rem 1.5rem; font-size: 0.95rem; }

.btn-back {
  display: inline-flex;
  align-items: center;
  gap: 0.3rem;
  background: none;
  border: none;
  color: var(--text-muted);
  font-family: var(--font);
  font-size: 0.85rem;
  font-weight: 500;
  cursor: pointer;
  margin-bottom: 0.5rem;
  padding: 0;
}
.btn-back:hover { color: var(--text); }

/* ─── EMPTY STATE ─── */
.empty-state {
  text-align: center;
  padding: 3rem 1rem;
  color: var(--text-muted);
}

.empty-title { font-weight: 600; color: var(--text-secondary); margin: 0.75rem 0 0.25rem; }
.empty-desc { font-size: 0.88rem; max-width: 360px; margin: 0 auto; }

/* ─── PIPELINE STEPS ─── */
.pipeline-steps {
  display: flex;
  justify-content: space-between;
  position: relative;
  margin-bottom: 1.5rem;
  padding: 0 0.5rem;
}

.pipeline-steps::before {
  content: '';
  position: absolute;
  top: 12px;
  left: 24px;
  right: 24px;
  height: 2px;
  background: var(--border);
}

.step {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.5rem;
  position: relative;
  z-index: 1;
}

.step-dot {
  width: 24px; height: 24px;
  border-radius: 50%;
  background: var(--surface);
  border: 2px solid var(--border);
  transition: all 0.3s ease;
}

.step-label {
  font-size: 0.7rem;
  font-weight: 500;
  color: var(--text-muted);
  text-align: center;
  max-width: 80px;
}

.step.done .step-dot { background: var(--success); border-color: var(--success); }
.step.done .step-label { color: var(--success); }

.step.active .step-dot {
  background: var(--gold-400);
  border-color: var(--gold-400);
  box-shadow: 0 0 0 4px rgba(212, 160, 74, .25);
}
.step.active .step-label { color: var(--primary); font-weight: 600; }

.step.waiting .step-dot { border-color: var(--warning); background: var(--warning-light); }
.step.waiting .step-label { color: var(--warning); }

.step.error .step-dot { background: var(--danger); border-color: var(--danger); }
.step.error .step-label { color: var(--danger); }

/* ─── DETAIL GRID ─── */
.detail-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 1rem; }

.detail-status { display: flex; flex-direction: column; gap: 1rem; }

.progress-wrap { display: flex; align-items: center; gap: 0.75rem; }

.progress-bar {
  flex: 1;
  height: 8px;
  background: var(--bg-dark);
  border-radius: 99px;
  overflow: hidden;
}

.progress-fill {
  height: 100%;
  background: var(--primary);
  border-radius: 99px;
  transition: width 0.4s ease;
  width: 0;
}

.progress-text { font-size: 0.85rem; font-weight: 600; color: var(--text-secondary); min-width: 36px; }

.logs {
  background: var(--royal-950);
  color: var(--cream-400);
  border-radius: var(--radius-sm);
  padding: 1rem;
  font-family: 'SF Mono', 'Fira Code', monospace;
  font-size: 0.78rem;
  line-height: 1.6;
  max-height: 320px;
  overflow-y: auto;
  white-space: pre-wrap;
  word-break: break-word;
  border: 1px solid var(--royal-800);
}

/* ─── FORMS ─── */
.form-layout {
  display: grid;
  grid-template-columns: 1fr 340px;
  gap: 1.5rem;
  align-items: start;
}

.form-group { margin-bottom: 1.25rem; }

.form-group label {
  display: block;
  font-size: 0.85rem;
  font-weight: 600;
  color: var(--text);
  margin-bottom: 0.4rem;
}

.input {
  width: 100%;
  padding: 0.55rem 0.85rem;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  font-family: var(--font);
  font-size: 0.9rem;
  color: var(--cream-100);
  background: var(--surface);
  transition: border-color var(--transition), box-shadow var(--transition);
}

.input:focus {
  outline: none;
  border-color: var(--gold-500);
  box-shadow: 0 0 0 3px rgba(176, 141, 87, .2);
}

.input::placeholder { color: rgba(176, 164, 142, 0.4); }

.input-group { display: flex; gap: 0.5rem; }
.input-group .input { flex: 1; }

.field-hint { font-size: 0.8rem; color: var(--text-muted); margin-top: 0.3rem; }

/* File upload */
.file-upload {
  position: relative;
  border: 2px dashed var(--border);
  border-radius: var(--radius);
  padding: 1.5rem;
  text-align: center;
  cursor: pointer;
  transition: border-color var(--transition), background var(--transition);
}

.file-upload:hover { border-color: var(--gold-500); background: rgba(176, 141, 87, 0.08); }
.file-upload.has-file { border-color: var(--success); border-style: solid; background: var(--success-light); }

.file-input {
  position: absolute;
  inset: 0;
  opacity: 0;
  cursor: pointer;
}

.file-upload-content {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.35rem;
  color: var(--text-secondary);
}

.file-upload-content svg { color: var(--text-muted); margin-bottom: 0.25rem; }

.file-upload-text { font-size: 0.9rem; }
.file-upload-text strong { color: var(--primary); }

.file-upload-hint { font-size: 0.78rem; color: var(--text-muted); }

.file-name {
  font-size: 0.85rem;
  font-weight: 600;
  color: var(--success);
  display: none;
}

.file-upload.has-file .file-upload-content { display: none; }
.file-upload.has-file .file-name { display: block; }

/* Template grid */
.template-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
  gap: 0.75rem;
}

.template-check {
  display: flex;
  align-items: center;
  gap: 0.6rem;
  padding: 0.65rem 0.85rem;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  cursor: pointer;
  transition: all var(--transition);
  font-size: 0.88rem;
  font-weight: 500;
}

.template-check:hover { border-color: var(--primary); background: var(--primary-light); }
.template-check.selected { border-color: var(--primary); background: var(--primary-light); color: var(--primary); }

.template-check input { display: none; }

.check-mark {
  width: 18px; height: 18px;
  border: 2px solid var(--border);
  border-radius: 4px;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  transition: all var(--transition);
}

.template-check.selected .check-mark {
  background: var(--primary);
  border-color: var(--primary);
}

.template-check.selected .check-mark::after {
  content: '';
  width: 4px; height: 8px;
  border: solid white;
  border-width: 0 2px 2px 0;
  transform: rotate(45deg);
  margin-bottom: 2px;
}

/* Toggle */
.options-row { display: flex; flex-direction: column; gap: 0.75rem; }

.toggle-label {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  cursor: pointer;
  font-size: 0.88rem;
  font-weight: 500;
  color: var(--text-secondary);
}

.toggle-input { display: none; }

.toggle-switch {
  width: 36px; height: 20px;
  background: var(--border);
  border-radius: 99px;
  position: relative;
  flex-shrink: 0;
  transition: background var(--transition);
}

.toggle-switch::after {
  content: '';
  width: 16px; height: 16px;
  background: white;
  border-radius: 50%;
  position: absolute;
  top: 2px; left: 2px;
  transition: transform var(--transition);
  box-shadow: var(--shadow-sm);
}

.toggle-input:checked + .toggle-switch { background: var(--gold-500); }
.toggle-input:checked + .toggle-switch::after { transform: translateX(16px); }

.form-footer { padding-top: 0.5rem; }

.form-msg {
  font-size: 0.85rem;
  margin-top: 0.75rem;
}

.form-msg.success { color: var(--success); }
.form-msg.error { color: var(--danger); }

/* Form sidebar */
.form-sidebar {}

.info-card { background: var(--bg); border-color: var(--border-light); }
.info-card h4 { font-size: 0.88rem; font-weight: 600; margin-bottom: 0.75rem; }

.info-steps {
  padding-left: 1.25rem;
  font-size: 0.82rem;
  color: var(--text-secondary);
  line-height: 1.7;
}

.info-pipeline { display: flex; flex-direction: column; gap: 0.35rem; }

.info-step {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  font-size: 0.82rem;
  color: var(--text-secondary);
  padding: 0.25rem 0;
}

.info-step::before {
  content: '';
  width: 6px; height: 6px;
  border-radius: 50%;
  background: var(--border);
  flex-shrink: 0;
}

.info-step--pause { color: var(--warning); font-weight: 600; }
.info-step--pause::before { background: var(--warning); }

/* ─── TEMPLATES PAGE ─── */
.templates-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
  gap: 1rem;
}

.template-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 1.25rem;
  box-shadow: var(--shadow-sm);
  transition: box-shadow var(--transition), transform var(--transition);
}

.template-card:hover { box-shadow: var(--shadow-md); transform: translateY(-1px); }

.template-card-icon {
  width: 40px; height: 40px;
  border-radius: var(--radius-sm);
  background: var(--primary-light);
  color: var(--primary);
  display: flex;
  align-items: center;
  justify-content: center;
  margin-bottom: 0.75rem;
}

.template-card h4 { font-size: 0.95rem; font-weight: 600; margin-bottom: 0.25rem; }

.template-card p { font-size: 0.82rem; color: var(--text-muted); }

.template-card code {
  background: var(--bg);
  padding: 0.15rem 0.4rem;
  border-radius: 3px;
  font-size: 0.78rem;
  color: var(--text-secondary);
}

/* ─── TEMPLATE EDITOR ─── */
.tpl-editor {
  margin-top: 1.5rem;
  animation: pageIn 0.2s ease;
}

.tpl-editor-body {
  display: flex;
  gap: 1.5rem;
}

.tpl-editor-form {
  flex: 1;
}

.tpl-bg-upload {
  position: relative;
  border: 2px dashed var(--border);
  border-radius: var(--radius);
  cursor: pointer;
  overflow: hidden;
  transition: border-color var(--transition);
}

.tpl-bg-upload:hover {
  border-color: var(--primary);
}

.tpl-bg-upload.has-image {
  border-style: solid;
  border-color: var(--success);
}

.tpl-bg-preview {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  padding: 2rem;
  color: var(--text-muted);
  font-size: 0.85rem;
  min-height: 120px;
}

.tpl-bg-preview img {
  max-width: 100%;
  max-height: 200px;
  border-radius: var(--radius-sm);
  object-fit: contain;
}

.tpl-editor-actions {
  display: flex;
  gap: 0.75rem;
  margin-top: 1rem;
}

.tpl-card-actions {
  display: flex;
  gap: 0.5rem;
  margin-top: 0.75rem;
}

.template-card .tpl-bg-thumb {
  width: 100%;
  height: 120px;
  object-fit: cover;
  border-radius: var(--radius-sm);
  margin-bottom: 0.75rem;
  background: var(--bg-dark);
}

/* ─── SETTINGS ─── */
.settings-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 1rem;
  align-items: start;
}

.server-info { display: flex; flex-direction: column; gap: 0.5rem; margin-bottom: 1rem; }

.info-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 0.4rem 0;
  border-bottom: 1px solid var(--border-light);
  font-size: 0.85rem;
}

.info-label { color: var(--text-muted); font-weight: 500; }

/* ─── TOASTS ─── */
.toast-container {
  position: fixed;
  bottom: 1.5rem;
  right: 1.5rem;
  z-index: 99999;
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
}

.toast {
  background: var(--surface);
  color: var(--cream-100);
  padding: 0.75rem 1.25rem;
  border-radius: var(--radius-sm);
  font-size: 0.85rem;
  font-weight: 500;
  border: 1px solid var(--border);
  box-shadow: 0 4px 16px rgba(20, 50, 36, 0.15);
  animation: toastIn 0.3s ease;
  max-width: 380px;
  border: 1px solid var(--royal-700);
}

.toast.success { background: var(--success); }
.toast.error { background: var(--danger); }
.toast.warning { background: var(--warning); }

@keyframes toastIn {
  from { opacity: 0; transform: translateY(12px); }
  to { opacity: 1; transform: translateY(0); }
}

/* ─── RESPONSIVE ─── */
@media (max-width: 1024px) {
  .stats-row { grid-template-columns: repeat(2, 1fr); }
  .form-layout { grid-template-columns: 1fr; }
  .form-sidebar { display: none; }
  .detail-grid { grid-template-columns: 1fr; }
  .settings-grid { grid-template-columns: 1fr; }
}

@media (max-width: 768px) {
  .sidebar { transform: translateX(-100%); }
  .sidebar.open { transform: translateX(0); box-shadow: 4px 0 24px rgba(0,0,0,.4); }
  .app-content { margin-left: 0; }
  .menu-toggle { display: block; }
  .main { padding: 1rem; }
  .pipeline-steps { overflow-x: auto; min-width: 500px; }
  .stats-row { grid-template-columns: 1fr 1fr; }
  .school-content-layout { flex-direction: column; }
  .school-main-tabs { overflow-x: auto; }
  .school-sub-nav { overflow-x: auto; flex-wrap: nowrap; }
}

/* ─── LOGIN PAGE ─── */
.login-body {
  background: var(--bg);
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 100vh;
}

.login-wrapper {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 1.5rem;
  width: 100%;
  padding: 1rem;
}

.login-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  box-shadow: 0 8px 32px rgba(20, 50, 36, 0.12);
  padding: 2.5rem 2.25rem 2rem;
  width: 100%;
  max-width: 400px;
  animation: pageIn 0.35s ease;
}

.login-header {
  text-align: center;
  margin-bottom: 2rem;
}

.login-brand-icon {
  width: 56px; height: 56px;
  background: var(--gold-400);
  color: var(--royal-950);
  border-radius: 14px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  margin-bottom: 1rem;
  box-shadow: 0 4px 16px rgba(212, 160, 74, .3);
}

.login-title {
  font-size: 1.5rem;
  font-weight: 700;
  color: var(--gold-300);
  margin-bottom: 0.15rem;
  font-family: var(--font-display);
}

.login-subtitle {
  font-size: 0.85rem;
  color: var(--cream-500);
}

.login-form .form-group { margin-bottom: 1.25rem; }

.login-form .form-group label {
  color: var(--cream-400);
}

.login-btn {
  width: 100%;
  justify-content: center;
  margin-top: 0.5rem;
}

.login-error {
  color: #f87171;
  font-size: 0.85rem;
  font-weight: 500;
  min-height: 1.25rem;
  text-align: center;
}

.login-footer-text {
  font-size: 0.78rem;
  color: var(--cream-500);
}

/* ─── LOGOUT BUTTON (sidebar) ─── */
.logout-btn {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  background: none;
  border: 1px solid var(--royal-700);
  border-radius: var(--radius-sm);
  padding: 0.45rem 0.75rem;
  font-family: var(--font);
  font-size: 0.8rem;
  font-weight: 500;
  color: var(--cream-500);
  cursor: pointer;
  transition: all var(--transition);
  width: 100%;
  margin-top: 0.75rem;
}

.logout-btn:hover {
  color: #f87171;
  border-color: rgba(220, 38, 38, 0.4);
  background: rgba(220, 38, 38, 0.1);
}

/* ─── SCHOOLS LIST (liste ecoles) ─── */
.schools-list-wrap {
  background: var(--card-bg);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  overflow: hidden;
}

.schools-list-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.88rem;
}

.schools-list-table thead th {
  text-align: left;
  padding: 0.75rem 1rem;
  font-size: 0.75rem;
  user-select: none;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  color: var(--text-muted);
  border-bottom: 1px solid var(--border);
  background: var(--bg);
  white-space: nowrap;
}

.schools-list-table thead th:last-child {
  text-align: right;
}

.schools-list-table thead th[data-sort] {
  cursor: pointer;
  position: relative;
  padding-right: 1.5rem;
}

.schools-list-table thead th[data-sort]:hover {
  color: var(--gold-400);
}

.schools-list-table thead th[data-sort]::after {
  content: '⇅';
  position: absolute;
  right: 0.4rem;
  top: 50%;
  transform: translateY(-50%);
  font-size: 0.7rem;
  opacity: 0.3;
}

.schools-list-table thead th.sort-active::after {
  opacity: 0.9;
  color: var(--gold-400);
}

.schools-list-table thead th.sort-asc::after {
  content: '▲';
}

.schools-list-table thead th.sort-desc::after {
  content: '▼';
}

.school-row-assignee {
  font-size: 0.82rem;
  font-weight: 500;
  color: #059669;
}

.school-row {
  cursor: pointer;
  transition: background var(--transition);
}

.school-row:not(:last-child) td {
  border-bottom: 1px solid var(--border);
}

.school-row:hover {
  background: var(--bg);
}

.school-row td {
  padding: 0.7rem 1rem;
  white-space: nowrap;
  color: var(--text-muted);
}

.school-row-name {
  font-weight: 600;
  color: var(--cream-100) !important;
  word-break: break-word;
  white-space: normal !important;
}

.school-row-actions {
  text-align: right !important;
  white-space: nowrap !important;
}

.school-row-actions .btn {
  vertical-align: middle;
}

.school-delete-btn {
  padding: 0.25rem 0.4rem !important;
  line-height: 1;
  opacity: 0.6;
  transition: opacity 0.2s;
}

.school-delete-btn:hover {
  opacity: 1;
}

/* ─── MAIN TABS ─── */
.school-main-tabs {
  display: flex;
  flex-wrap: wrap;
  gap: 0.25rem 0.4rem;
  margin-bottom: 0.75rem;
  border-bottom: 2px solid var(--border);
  padding-bottom: 0;
}

.school-main-tab {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  padding: 0.5rem 0.85rem;
  border: none;
  border-bottom: 3px solid transparent;
  border-radius: 0;
  background: transparent;
  font-family: var(--font);
  font-size: 0.82rem;
  font-weight: 600;
  color: var(--text-muted);
  cursor: pointer;
  transition: all var(--transition);
  margin-bottom: -2px;
  position: relative;
  white-space: nowrap;
}

.school-main-tab:hover {
  color: var(--text);
}

.school-main-tab.active {
  color: var(--gold-400);
  border-bottom-color: var(--gold-400);
}

.school-main-tab.active svg {
  stroke: var(--gold-400);
}

.school-main-tab.supercom-tab.active {
  color: #7c3aed;
  border-bottom-color: #7c3aed;
}

.school-main-tab.arbo-tab.active {
  color: #059669;
  border-bottom-color: #059669;
}

.school-main-tab.supercom-tab.active svg {
  stroke: #7c3aed;
}

.school-main-tab.arbo-tab.active svg {
  stroke: #059669;
}

.school-main-tab.stickers-tab.active {
  color: #d97706;
  border-bottom-color: #d97706;
}

.school-main-tab.stickers-tab.active svg {
  stroke: #d97706;
}

.school-main-tab.reductions-tab.active {
  color: #0891b2;
  border-bottom-color: #0891b2;
}

.school-main-tab.reductions-tab.active svg {
  stroke: #0891b2;
}

.school-main-tab.m01profs-tab.active {
  color: #7c3aed;
  border-bottom-color: #7c3aed;
}

.school-main-tab.m01profs-tab.active svg {
  stroke: #7c3aed;
}

.school-main-tab.pochette-tab.active {
  color: #b45309;
  border-bottom-color: #b45309;
}

.school-main-tab.pochette-tab.active svg {
  stroke: #b45309;
}

.pochette-iframe-wrap {
  width: 100%;
  height: calc(100vh - 260px);
  min-height: 500px;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  overflow: hidden;
  background: #f5f0e6;
}

.pochette-iframe-wrap iframe {
  width: 100%;
  height: 100%;
  border: none;
}

/* Pochette selection UI */
.pochette-select-container {
  padding: 1.5rem;
}

.pochette-select-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 1.25rem;
  flex-wrap: wrap;
  gap: 0.75rem;
}

.pochette-select-header h3 {
  font-size: 1.1rem;
  font-weight: 700;
  color: var(--text);
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.pochette-select-header h3 svg { stroke: #b45309; }

.pochette-badge {
  font-size: 0.75rem;
  font-weight: 600;
  padding: 0.2rem 0.6rem;
  border-radius: 999px;
  background: var(--primary-light);
  color: var(--primary);
}

.pochette-toolbar {
  display: flex;
  align-items: center;
  gap: 1rem;
  flex-wrap: wrap;
}

.pochette-toolbar label {
  display: flex;
  align-items: center;
  gap: 0.4rem;
  font-size: 0.82rem;
  color: var(--text-secondary);
  cursor: pointer;
  user-select: none;
}

.pochette-toolbar label input[type="checkbox"] {
  accent-color: #b45309;
  width: 16px;
  height: 16px;
}

.pochette-launch-btn {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.55rem 1.25rem;
  border: none;
  border-radius: var(--radius-sm);
  background: #b45309;
  color: #fff;
  font-family: var(--font);
  font-size: 0.85rem;
  font-weight: 600;
  cursor: pointer;
  transition: background var(--transition);
}

.pochette-launch-btn:hover { background: #92400e; }
.pochette-launch-btn:disabled { opacity: 0.5; cursor: not-allowed; }

.pochette-launch-btn svg { width: 16px; height: 16px; }

.pochette-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(190px, 1fr));
  gap: 0.85rem;
}

.pochette-card {
  position: relative;
  border-radius: var(--radius);
  overflow: hidden;
  border: 3px solid var(--border);
  cursor: pointer;
  transition: all 0.15s ease;
  background: var(--surface);
}

.pochette-card:hover { border-color: var(--text-muted); box-shadow: var(--shadow-md); }

.pochette-card.selected {
  border-color: #b45309;
  box-shadow: 0 0 0 2px rgba(180, 83, 9, 0.25), var(--shadow-md);
}

.pochette-card img {
  width: 100%;
  aspect-ratio: 3/2;
  object-fit: cover;
  display: block;
}

.pochette-card-footer {
  padding: 0.35rem 0.5rem;
  font-size: 0.72rem;
  color: var(--text-muted);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  background: var(--surface);
}

.pochette-card-number {
  position: absolute;
  top: 8px;
  right: 8px;
  width: 26px;
  height: 26px;
  border-radius: 50%;
  background: #b45309;
  color: #fff;
  font-size: 0.75rem;
  font-weight: 700;
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 2px 6px rgba(0,0,0,.25);
  opacity: 0;
  transform: scale(0.5);
  transition: all 0.15s ease;
}

.pochette-card.selected .pochette-card-number {
  opacity: 1;
  transform: scale(1);
}

.pochette-empty {
  text-align: center;
  padding: 3rem 1.5rem;
  color: var(--text-muted);
}

.pochette-empty svg {
  width: 48px;
  height: 48px;
  stroke: var(--text-muted);
  opacity: 0.4;
  margin-bottom: 0.75rem;
}

.pochette-empty p { margin-bottom: 0.5rem; }

.pochette-skip-btn {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  margin-top: 1rem;
  padding: 0.5rem 1rem;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  background: var(--surface);
  color: var(--text-secondary);
  font-family: var(--font);
  font-size: 0.82rem;
  font-weight: 500;
  cursor: pointer;
  transition: all var(--transition);
}

.pochette-skip-btn:hover { border-color: #b45309; color: #b45309; }

.pochette-validate-bar {
  display: flex;
  justify-content: center;
  padding: 0.75rem 0 0.5rem;
}
.pochette-validate-btn {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.6rem 1.5rem;
  font-size: 0.9rem;
  font-weight: 600;
  border: none;
  border-radius: var(--radius-sm);
  background: #16a34a;
  color: #fff;
  cursor: pointer;
  transition: background 0.15s, opacity 0.15s, transform 0.1s;
}
.pochette-validate-btn:hover { background: #15803d; transform: translateY(-1px); }
.pochette-validate-btn:active { transform: translateY(0); }
.pochette-validate-btn:disabled { opacity: 0.7; cursor: not-allowed; transform: none; }
.pochette-validate-btn.validated { background: #059669; cursor: default; }
.pochette-validate-btn .spin-icon { animation: spin 0.8s linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }

/* Pochette saved view */
.pochette-saved-container {
  display: flex;
  flex-direction: column;
  align-items: center;
  padding: 2rem 1.5rem;
  gap: 1.2rem;
}
.pochette-saved-header {
  display: flex;
  align-items: center;
  gap: 1rem;
  flex-wrap: wrap;
  justify-content: center;
}
.pochette-saved-badge {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  padding: 0.4rem 1rem;
  background: #dcfce7;
  color: #166534;
  border-radius: 999px;
  font-weight: 600;
  font-size: 0.9rem;
}
.pochette-saved-date {
  font-size: 0.8rem;
  color: var(--text-secondary);
}
.pochette-saved-preview {
  max-width: 500px;
  width: 100%;
  border-radius: var(--radius);
  overflow: hidden;
  box-shadow: 0 4px 20px rgba(0,0,0,0.12);
  border: 1px solid var(--border);
}
.pochette-saved-preview img {
  width: 100%;
  height: auto;
  display: block;
}
.pochette-saved-actions {
  display: flex;
  gap: 0.75rem;
  flex-wrap: wrap;
  justify-content: center;
}
.pochette-action-btn {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  padding: 0.5rem 1.2rem;
  font-size: 0.85rem;
  font-weight: 500;
  border-radius: var(--radius-sm);
  cursor: pointer;
  transition: background 0.15s, color 0.15s;
  text-decoration: none;
}
.pochette-dl-btn {
  background: #1e40af;
  color: #fff;
  border: none;
}
.pochette-dl-btn:hover { background: #1e3a8a; }
.pochette-edit-btn {
  background: var(--surface);
  color: var(--text);
  border: 1px solid var(--border);
}
.pochette-edit-btn:hover { border-color: #b45309; color: #b45309; }

/* Pochette assignment UI */
.pochette-assign-container {
  padding: 1.5rem;
  display: flex;
  flex-direction: column;
  gap: 1.2rem;
}
.pochette-assign-header h3 {
  font-size: 1.1rem;
  font-weight: 600;
  margin: 0 0 0.25rem;
}
.pochette-assign-header p {
  font-size: 0.85rem;
  color: var(--text-secondary);
  margin: 0;
}
.pochette-assign-slots {
  display: flex;
  gap: 0.75rem;
  flex-wrap: wrap;
  justify-content: center;
}
.pochette-assign-slot {
  width: 140px;
  border: 2px dashed var(--border);
  border-radius: var(--radius);
  padding: 0.5rem;
  cursor: pointer;
  transition: border-color 0.15s, background 0.15s;
  text-align: center;
}
.pochette-assign-slot:hover { border-color: #d97706; background: #fffbeb; }
.pochette-assign-slot.filled { border-color: #16a34a; border-style: solid; background: #f0fdf4; }
.pochette-assign-slot-label {
  font-size: 0.75rem;
  font-weight: 600;
  color: var(--text-secondary);
  margin-bottom: 0.4rem;
  text-transform: uppercase;
  letter-spacing: 0.03em;
}
.pochette-assign-slot-preview {
  width: 100%;
  aspect-ratio: 2/3;
  background: var(--bg);
  border-radius: 4px;
  overflow: hidden;
  display: flex;
  align-items: center;
  justify-content: center;
}
.pochette-assign-slot-preview img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}
.pochette-assign-slot-empty {
  font-size: 0.75rem;
  color: var(--text-secondary);
  opacity: 0.5;
}
.pochette-assign-photos {
  display: flex;
  gap: 0.6rem;
  flex-wrap: wrap;
  justify-content: center;
  padding: 0.75rem;
  background: var(--bg);
  border-radius: var(--radius);
  border: 1px solid var(--border);
}
.pochette-assign-photo {
  width: 100px;
  cursor: pointer;
  border: 3px solid transparent;
  border-radius: var(--radius-sm);
  overflow: hidden;
  transition: border-color 0.15s, opacity 0.15s, transform 0.1s;
  text-align: center;
}
.pochette-assign-photo img {
  width: 100%;
  aspect-ratio: 2/3;
  object-fit: cover;
  display: block;
}
.pochette-assign-photo-name {
  display: block;
  font-size: 0.65rem;
  color: var(--text-secondary);
  padding: 2px 4px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.pochette-assign-photo:hover { border-color: #d97706; transform: translateY(-2px); }
.pochette-assign-photo.active { border-color: #2563eb; box-shadow: 0 0 0 2px rgba(37,99,235,0.3); }
.pochette-assign-photo.assigned { opacity: 0.4; }
.pochette-assign-photo.assigned.active { opacity: 1; }
.pochette-assign-actions {
  display: flex;
  justify-content: center;
  gap: 0.75rem;
  padding-top: 0.5rem;
}

.main-tab-check {
  display: none;
  font-size: 0.7rem;
  font-weight: 700;
  color: #fff;
  background: #22c55e;
  width: 18px;
  height: 18px;
  border-radius: 50%;
  align-items: center;
  justify-content: center;
  line-height: 1;
  flex-shrink: 0;
  margin-left: 0.15rem;
}

.school-main-tab.tab-done .main-tab-check {
  display: inline-flex;
}

/* ─── SUB-NAVIGATION ─── */
.school-sub-nav {
  display: flex;
  gap: 0.35rem;
  margin-bottom: 1rem;
  flex-wrap: wrap;
}

.sub-nav-btn {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  padding: 0.5rem 1rem;
  border: 1.5px solid var(--royal-700);
  border-radius: 99px;
  background: var(--royal-800);
  font-family: var(--font);
  font-size: 0.82rem;
  font-weight: 600;
  color: var(--cream-400);
  cursor: pointer;
  transition: all var(--transition);
  white-space: nowrap;
}

.sub-nav-btn:hover {
  border-color: var(--gold-500);
  color: var(--gold-400);
  background: rgba(176, 141, 87, 0.1);
}

.sub-nav-btn.active {
  border-color: var(--gold-500);
  background: rgba(176, 141, 87, 0.3);
  color: var(--gold-400);
  box-shadow: inset 0 0 0 1px var(--gold-500);
}

.sub-nav-btn .sub-nav-check {
  display: none;
  font-size: 0.72rem;
  font-weight: 700;
  color: #22c55e;
  background: #dcfce7;
  width: 16px;
  height: 16px;
  border-radius: 50%;
  align-items: center;
  justify-content: center;
  line-height: 1;
  flex-shrink: 0;
}

.sub-nav-btn.done .sub-nav-check {
  display: inline-flex;
}

.sub-nav-btn.active .sub-nav-check {
  color: #fff;
  background: rgba(255,255,255,0.3);
}

.sub-nav-btn.done {
  border-color: var(--primary);
  color: var(--primary);
  background: var(--primary-light);
}

.sub-nav-btn.done.active {
  background: var(--primary);
  color: white;
}

/* ─── SCHOOL ACTION BAR ─── */
.school-action-bar {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  flex-wrap: wrap;
  margin-bottom: 1rem;
  padding: 0.75rem 1rem;
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: var(--radius);
}

.school-action-bar:empty {
  display: none;
}

.school-action-bar .action-label {
  font-size: 0.82rem;
  font-weight: 600;
  color: var(--text-secondary);
  margin-right: 0.25rem;
}

.school-action-bar .action-spacer {
  flex: 1;
}

/* ─── SCHOOL PROGRESS BAR ─── */
.school-progress-bar {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  margin-bottom: 1rem;
  padding: 0.75rem 1rem;
  background: var(--primary-light);
  border: 1px solid var(--primary);
  border-radius: var(--radius);
}

.school-progress-bar .progress-wrap {
  flex: 1;
}

.school-progress-bar .school-progress-msg {
  font-size: 0.82rem;
  color: var(--primary);
  margin: 0;
  white-space: nowrap;
}

/* Legacy view-filter-btn for compatibility */
.view-filter-btn {
  display: none;
}

.view-filter-btn.disabled {
  opacity: 0.4;
  pointer-events: none;
}

/* ─── SCHOOL DETAIL ─── */
.school-content-layout {
  display: flex;
  gap: 1.25rem;
  align-items: flex-start;
}

.school-content-main {
  flex: 1;
  min-width: 0;
}

.school-stats {
  display: none;
}

.school-content-sidebar {
  position: fixed;
  right: 0;
  top: 0;
  width: 360px;
  height: 100vh;
  display: flex;
  flex-direction: column;
  z-index: 50;
  border-radius: 0;
  border-left: 1px solid var(--border);
  margin: 0;
}

.school-content-sidebar .card-header {
  flex-shrink: 0;
}

.school-content-sidebar .card-header .btn {
  font-size: 1.2rem;
  line-height: 1;
  padding: 0.2rem 0.5rem;
  color: var(--text-muted);
}

.school-content-sidebar .card-header .btn:hover {
  color: var(--text);
}

.school-content-sidebar .logs {
  max-height: none;
  flex: 1;
  overflow-y: auto;
  border-radius: 0;
}

/* ─── SCHOOL ACTIONS PANEL (legacy, hidden) ─── */
.school-actions-panel {
  display: none;
}

.sap-section-title {
  font-size: 0.65rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--text-muted);
  padding: 0 0.4rem 0.35rem;
}

.sap-btn {
  display: flex;
  align-items: center;
  gap: 0.45rem;
  width: 100%;
  padding: 0.45rem 0.5rem;
  border: none;
  border-radius: var(--radius-sm);
  background: transparent;
  font-family: var(--font);
  font-size: 0.78rem;
  font-weight: 500;
  color: var(--text-secondary);
  cursor: pointer;
  transition: all var(--transition);
  text-align: left;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.sap-btn:hover {
  background: var(--bg-dark);
  color: var(--text);
}

.sap-btn:disabled {
  opacity: 0.4;
  pointer-events: none;
}

.sap-btn.btn-primary {
  background: var(--primary-light);
  color: var(--primary);
  font-weight: 600;
}

.sap-step {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 18px;
  height: 18px;
  border-radius: 50%;
  background: var(--bg-dark);
  color: var(--text-muted);
  font-size: 0.65rem;
  font-weight: 700;
  flex-shrink: 0;
}

.sap-btn.btn-primary .sap-step {
  background: var(--primary);
  color: white;
}

.sap-indent { padding-left: 1rem; }
.sap-indent-2 { padding-left: 1.5rem; }
.sap-indent-3 { padding-left: 2rem; }

.sap-divider {
  height: 1px;
  background: var(--border);
  margin: 0.5rem 0;
}

.sap-btn-main {
  background: var(--success);
  color: white;
  font-weight: 700;
  font-size: 0.82rem;
  padding: 0.55rem 0.75rem;
  justify-content: center;
}

.sap-btn-main:hover {
  opacity: 0.9;
  background: var(--success);
  color: white;
}

.sap-btn-warn {
  border-left: 3px solid #ef4444;
}

.sap-btn-reset {
  background: transparent;
  color: var(--warning);
  font-size: 0.72rem;
  padding: 0.3rem 0.5rem;
  justify-content: center;
}

.sap-btn-reset:hover {
  background: var(--warning-light);
}

.sap-btn-cancel {
  background: var(--danger);
  color: white;
  font-weight: 600;
  justify-content: center;
  margin-top: 0.35rem;
}

.sap-btn-cancel:hover {
  opacity: 0.9;
  background: var(--danger);
  color: white;
}

.sap-progress {
  padding: 0.5rem 0.25rem;
  border-top: 1px solid var(--border);
  margin-top: 0.25rem;
}

.sap-progress .progress-wrap {
  gap: 0.4rem;
}

.sap-progress .progress-text {
  font-size: 0.72rem;
  min-width: 28px;
}

.sap-status {
  display: flex;
  flex-direction: column;
  gap: 3px;
  margin-top: 0.5rem;
  font-size: 0.72rem;
}

.sap-status:empty {
  display: none;
}

.status-done {
  background: var(--success);
  color: #fff;
  padding: 1px 8px;
  border-radius: 10px;
  font-weight: 500;
  font-size: 0.7rem;
}

.status-pending {
  background: var(--text-muted);
  color: #fff;
  padding: 1px 8px;
  border-radius: 10px;
  font-weight: 500;
  font-size: 0.7rem;
}

.btn-check {
  font-weight: 700;
  font-size: 0.85em;
}

/* hidden — stats replaced by tabs */

.school-progress-msg {
  margin: 0.35rem 0 0;
  font-size: 0.72rem;
  color: var(--text-muted);
  word-break: break-word;
}

.class-section {
  margin-bottom: 1.5rem;
}

.class-header {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  margin-bottom: 0.75rem;
  padding-bottom: 0.5rem;
  border-bottom: 2px solid var(--primary-light);
}

.class-header h3 {
  margin: 0;
  font-size: 1rem;
}

.class-header .class-count {
  font-size: 0.82rem;
  color: var(--text-muted);
}

.students-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(130px, 1fr));
  gap: 0.75rem;
}

/* ─── SCRIPTS VIEW (JPG side by side) ─── */
.students-scripts-list {
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
}

.student-scripts-row {
  display: flex;
  align-items: center;
  gap: 1rem;
  background: var(--card-bg);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 0.6rem 0.75rem;
}

.jpg-select-cb {
  width: 18px;
  height: 18px;
  flex-shrink: 0;
  cursor: pointer;
  accent-color: var(--primary, #6366f1);
}

.student-scripts-label {
  min-width: 110px;
  max-width: 130px;
  flex-shrink: 0;
}

.student-scripts-name {
  display: block;
  font-weight: 600;
  font-size: 0.82rem;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.student-scripts-num {
  display: block;
  font-size: 0.72rem;
  color: var(--text-muted);
}

.student-scripts-imgs {
  display: flex;
  gap: 0.6rem;
  overflow-x: auto;
  flex: 1;
  min-width: 0;
  padding: 0.25rem 0;
}

.student-script-thumb {
  flex-shrink: 0;
  text-align: center;
  cursor: pointer;
  transition: transform 0.15s;
  position: relative;
}

.student-script-thumb:hover {
  transform: scale(1.04);
}

.student-script-thumb img {
  height: 120px;
  width: auto;
  border-radius: var(--radius-sm);
  border: 1px solid var(--border);
  display: block;
}

.student-script-dl-btn {
  position: absolute; top: 4px; right: 4px;
  width: 26px; height: 26px;
  background: rgba(0,0,0,0.6); color: #fff;
  border-radius: 50%; display: flex;
  align-items: center; justify-content: center;
  opacity: 0; transition: opacity 0.15s;
  text-decoration: none;
}
.student-script-thumb:hover .student-script-dl-btn { opacity: 1; }
.student-script-dl-btn:hover { background: var(--primary); }

/* ─── STICKERS VIEW ─── */
.sticker-sheet-wrap {
  margin-top: 0.5rem;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  overflow: hidden;
  transition: box-shadow 0.2s;
}

.sticker-sheet-wrap:hover {
  box-shadow: 0 4px 16px rgba(0,0,0,0.12);
}

.sticker-sheet-img {
  width: 100%;
  display: block;
}

.sticker-sheet-actions {
  padding: 0.5rem;
  display: flex;
  justify-content: flex-end;
}

.reduction-downloads {
  display: flex;
  gap: 0.5rem;
  margin-left: auto;
}

.student-script-tpl-name {
  display: block;
  font-size: 0.65rem;
  color: var(--text-muted);
  margin-top: 0.2rem;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  max-width: 90px;
}

.student-card {
  background: var(--card-bg);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  overflow: hidden;
  text-align: center;
  transition: border-color var(--transition);
}

.student-card:hover {
  border-color: var(--primary);
}

.student-card img {
  width: 100%;
  aspect-ratio: 3/4;
  object-fit: cover;
  display: block;
  background: #f0f0f0;
  transition: opacity 0.15s ease;
}

.student-card img:hover {
  opacity: 0.95;
}

.student-card .student-name {
  padding: 0.35rem 0.25rem;
  font-size: 0.72rem;
  font-weight: 500;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.student-card .student-num {
  font-size: 0.65rem;
  color: var(--text-muted);
}

/* ─── Selection mode (colorized view) ─── */
.mce-select-cb {
  position: absolute;
  top: 6px;
  left: 6px;
  width: 18px;
  height: 18px;
  cursor: pointer;
  z-index: 3;
  accent-color: var(--primary);
}

.student-card.mce-selected {
  border-color: #e8850c;
  box-shadow: 0 0 0 2px rgba(232, 133, 12, 0.4);
}

.class-select-all {
  margin-left: auto;
}

/* ─── Student card image wrapper & context menu ─── */
.student-card-img-wrap {
  position: relative;
}

.student-card-img-wrap > img {
  border-radius: inherit;
}

.student-card-menu-btn {
  position: absolute;
  top: 4px;
  right: 4px;
  width: 28px;
  height: 28px;
  border: none;
  border-radius: 50%;
  background: rgba(0, 0, 0, 0.7);
  color: #fff;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  opacity: 0;
  transition: opacity 0.15s ease, background 0.15s ease, transform 0.1s ease;
  z-index: 2;
  padding: 0;
  backdrop-filter: blur(4px);
  -webkit-backdrop-filter: blur(4px);
}

.student-card:hover .student-card-menu-btn {
  opacity: 1;
}

.student-card-menu-btn:hover {
  background: rgba(0, 0, 0, 0.9);
  transform: scale(1.1);
}

.student-card-context-menu {
  position: fixed;
  background: var(--card-bg, #fff);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  box-shadow: 0 8px 30px rgba(0, 0, 0, 0.28), 0 2px 8px rgba(0, 0, 0, 0.12);
  z-index: 9999;
  min-width: 210px;
  padding: 6px 0;
  animation: cardMenuIn 0.12s ease-out;
}

@keyframes cardMenuIn {
  from { opacity: 0; transform: translateY(-4px) scale(0.97); }
  to { opacity: 1; transform: translateY(0) scale(1); }
}

.student-card-context-item {
  display: flex;
  align-items: center;
  gap: 10px;
  width: 100%;
  padding: 9px 14px;
  border: none;
  background: none;
  color: var(--text);
  font-size: 0.82rem;
  font-weight: 450;
  cursor: pointer;
  text-align: left;
  white-space: nowrap;
  transition: background 0.12s ease;
}

.student-card-context-item:hover {
  background: var(--hover);
}

.student-card-context-item svg {
  flex-shrink: 0;
  opacity: 0.7;
}

.student-card-removebg-btn {
  position: absolute;
  bottom: 4px;
  right: 4px;
  display: flex;
  align-items: center;
  gap: 4px;
  padding: 3px 8px;
  border: none;
  border-radius: var(--radius-sm);
  background: rgba(0, 0, 0, 0.6);
  color: #fff;
  font-size: 0.68rem;
  font-weight: 500;
  cursor: pointer;
  opacity: 0;
  transition: opacity 0.15s ease, background 0.15s ease;
  z-index: 2;
}

.student-card:hover .student-card-removebg-btn {
  opacity: 1;
}

.student-card-removebg-btn:hover {
  background: rgba(49, 130, 206, 0.85);
}

.student-card-removebg-btn.loading {
  opacity: 1;
  background: rgba(49, 130, 206, 0.7);
  pointer-events: none;
}

.student-card-removebg-btn.loading svg {
  animation: removebgSpin 0.8s linear infinite;
}

@keyframes removebgSpin {
  from { transform: rotate(0deg); }
  to { transform: rotate(360deg); }
}

.student-card-removebg-btn svg {
  flex-shrink: 0;
}
.student-card-detour-btn {
  bottom: auto;
  top: 4px;
  right: 4px;
}

.student-card-context-sep {
  height: 1px;
  background: var(--border);
  margin: 3px 0;
}

.student-card-context-item.danger {
  color: var(--danger, #e53e3e);
}

.student-card-context-item.danger svg {
  opacity: 0.8;
}

.student-card-context-item.danger:hover {
  background: rgba(229, 62, 62, 0.08);
}

/* ─── Move class modal ─── */
.move-class-overlay {
  position: fixed;
  inset: 0;
  z-index: 10000;
  background: rgba(0, 0, 0, 0.5);
  display: flex;
  align-items: center;
  justify-content: center;
  animation: moveClassFadeIn 0.15s ease-out;
}

@keyframes moveClassFadeIn {
  from { opacity: 0; }
  to { opacity: 1; }
}

.move-class-modal {
  background: var(--card-bg, #fff);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  box-shadow: 0 16px 48px rgba(0, 0, 0, 0.3);
  width: 340px;
  max-width: 92vw;
  max-height: 80vh;
  display: flex;
  flex-direction: column;
  animation: moveClassSlideIn 0.2s ease-out;
}

@keyframes moveClassSlideIn {
  from { opacity: 0; transform: translateY(-12px) scale(0.96); }
  to { opacity: 1; transform: translateY(0) scale(1); }
}

.move-class-header {
  padding: 18px 20px 14px;
  border-bottom: 1px solid var(--border);
}

.move-class-header h3 {
  margin: 0 0 6px;
  font-size: 1rem;
  font-weight: 600;
}

.move-class-subtitle {
  font-size: 0.82rem;
  color: var(--text-muted);
  line-height: 1.4;
}

.move-class-subtitle small {
  font-size: 0.76rem;
}

.move-class-list {
  overflow-y: auto;
  max-height: 50vh;
  padding: 8px 0;
}

.move-class-option {
  display: block;
  width: 100%;
  padding: 10px 20px;
  border: none;
  background: none;
  color: var(--text);
  font-size: 0.86rem;
  text-align: left;
  cursor: pointer;
  transition: background 0.1s ease;
}

.move-class-option:hover {
  background: var(--hover);
}

.move-class-option:active {
  background: var(--primary);
  color: #fff;
}

.move-class-cancel {
  display: block;
  width: calc(100% - 24px);
  margin: 8px 12px 12px;
  padding: 9px 0;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  background: none;
  color: var(--text-muted);
  font-size: 0.82rem;
  cursor: pointer;
  transition: background 0.1s ease, border-color 0.1s ease;
}

.move-class-cancel:hover {
  background: var(--hover);
  border-color: var(--text-muted);
}

/* ─── Delete confirmation modal ─── */
.delete-confirm-modal {
  display: none;
  position: fixed;
  inset: 0;
  z-index: 1200;
  align-items: center;
  justify-content: center;
}

.delete-confirm-modal.open {
  display: flex;
}

.delete-confirm-backdrop {
  position: absolute;
  inset: 0;
  background: rgba(0, 0, 0, 0.45);
}

.delete-confirm-box {
  position: relative;
  background: var(--card-bg);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 1.5rem;
  max-width: 380px;
  width: 90%;
  text-align: center;
  box-shadow: 0 8px 30px rgba(0, 0, 0, 0.2);
  animation: cardMenuIn 0.15s ease-out;
}

.delete-confirm-icon {
  color: var(--danger, #e53e3e);
  margin-bottom: 0.75rem;
}

.delete-confirm-msg {
  font-size: 0.88rem;
  line-height: 1.5;
  color: var(--text);
  margin: 0 0 1.25rem;
}

.delete-confirm-actions {
  display: flex;
  gap: 0.5rem;
  justify-content: center;
}

/* ───────────────────────────────────────────
   Bug Reports / Signalements
   ─────────────────────────────────────────── */

/* Sidebar "Signaler" button */
.btn-report-bug {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  width: 100%;
  margin-bottom: 0.6rem;
  padding: 0.5rem 0.75rem;
  background: var(--primary-light);
  color: var(--primary);
  border: 1px solid rgba(194, 107, 74, 0.3);
  border-radius: var(--radius-sm);
  font-family: inherit;
  font-size: 0.78rem;
  font-weight: 600;
  cursor: pointer;
  transition: background var(--transition), color var(--transition), box-shadow var(--transition);
}

.btn-report-bug:hover {
  background: var(--primary);
  color: #fff;
  box-shadow: var(--shadow-sm);
}

.btn-report-bug svg { flex-shrink: 0; }

/* Bug submit modal */
.bug-modal {
  display: none;
  position: fixed;
  inset: 0;
  z-index: 1300;
  align-items: center;
  justify-content: center;
}

.bug-modal.open { display: flex; }

.bug-modal-backdrop {
  position: absolute;
  inset: 0;
  background: rgba(26, 40, 71, 0.55);
}

.bug-modal-content {
  position: relative;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  width: 90%;
  max-width: 620px;
  max-height: 92vh;
  display: flex;
  flex-direction: column;
  box-shadow: 0 16px 48px rgba(26, 40, 71, 0.25);
  animation: cardMenuIn 0.15s ease-out;
}

.bug-modal-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 1rem 1.25rem;
  border-bottom: 1px solid var(--border);
}

.bug-modal-header h3 {
  font-size: 1.05rem;
  color: var(--text);
}

.bug-modal-close {
  background: none;
  border: none;
  color: var(--text-muted);
  font-size: 1.4rem;
  line-height: 1;
  cursor: pointer;
  padding: 0 0.25rem;
}
.bug-modal-close:hover { color: var(--text); }

.bug-modal-body {
  padding: 1rem 1.25rem;
  overflow-y: auto;
}

.bug-modal-footer {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  justify-content: flex-end;
  padding: 0.75rem 1.25rem;
  border-top: 1px solid var(--border);
}

.bug-modal-footer .form-msg {
  margin-right: auto;
  font-size: 0.82rem;
  color: var(--text-muted);
}
.bug-modal-footer .form-msg.error { color: var(--danger); }

/* Kind toggle (Bug / Idee) */
.bug-kind-toggle {
  display: flex;
  gap: 0.5rem;
  margin-bottom: 1rem;
}

.bug-kind-btn {
  flex: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.4rem;
  padding: 0.55rem 0.75rem;
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  color: var(--text-secondary);
  font-family: inherit;
  font-size: 0.85rem;
  font-weight: 500;
  cursor: pointer;
  transition: background var(--transition), border-color var(--transition), color var(--transition);
}

.bug-kind-btn:hover {
  border-color: var(--primary);
  color: var(--primary);
}

.bug-kind-btn.active {
  background: var(--primary-light);
  border-color: var(--primary);
  color: var(--primary);
  font-weight: 700;
}

/* Dropzone */
.bug-dropzone {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 0.35rem;
  padding: 1rem;
  border: 1.5px dashed var(--border);
  border-radius: var(--radius-sm);
  background: var(--bg);
  cursor: pointer;
  text-align: center;
  color: var(--text-muted);
  transition: border-color var(--transition), background var(--transition);
}

.bug-dropzone:hover, .bug-dropzone.dragover {
  border-color: var(--primary);
  background: var(--primary-light);
  color: var(--primary);
}

.bug-dropzone-text {
  font-size: 0.85rem;
  margin: 0;
}

.bug-dropzone-text a {
  color: var(--primary);
  font-weight: 600;
  text-decoration: underline;
}

.bug-dropzone-hint {
  font-size: 0.75rem;
  margin: 0;
  opacity: 0.8;
}

.bug-thumbs {
  display: flex;
  gap: 0.5rem;
  flex-wrap: wrap;
  margin-top: 0.6rem;
}

.bug-thumb {
  position: relative;
  width: 80px;
  height: 80px;
  border-radius: var(--radius-sm);
  overflow: hidden;
  border: 1px solid var(--border);
  background: var(--bg);
}

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

.bug-thumb-remove {
  position: absolute;
  top: 2px;
  right: 2px;
  width: 22px;
  height: 22px;
  border-radius: 50%;
  border: none;
  background: rgba(26, 40, 71, 0.85);
  color: #fff;
  font-size: 1rem;
  line-height: 1;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
}

.bug-thumb-remove:hover { background: var(--danger); }

.bug-page-info {
  font-size: 0.75rem;
  color: var(--text-muted);
  margin-top: 0.25rem;
}

/* List page */
.bug-counts {
  display: flex;
}

.bug-count-pill {
  font-size: 0.78rem;
  padding: 0.35rem 0.7rem;
  border-radius: 999px;
  background: var(--surface);
  border: 1px solid var(--border);
  color: var(--text-secondary);
}

.bug-count-pill strong { color: var(--text); }

.bug-count-pill.bug-count-open { border-color: rgba(194, 107, 74, 0.4); color: var(--primary); }
.bug-count-pill.bug-count-in_progress { border-color: rgba(212, 149, 64, 0.4); color: var(--warning); }
.bug-count-pill.bug-count-resolved { border-color: rgba(107, 142, 90, 0.4); color: var(--success); }
.bug-count-pill.bug-count-dismissed { border-color: var(--border); color: var(--text-muted); }

.bug-card {
  padding: 1rem 1.1rem;
  margin-bottom: 0.75rem;
}

.bug-card-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 0.75rem;
  margin-bottom: 0.4rem;
}

.bug-card-title {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  flex-wrap: wrap;
}

.bug-title-text {
  font-family: var(--font-display);
  font-size: 1.05rem;
  font-weight: 700;
  color: var(--text);
}

.bug-card-meta {
  display: flex;
  gap: 0.85rem;
  flex-wrap: wrap;
  font-size: 0.78rem;
  color: var(--text-muted);
  margin-bottom: 0.5rem;
}

.bug-card-desc {
  font-size: 0.88rem;
  color: var(--text-secondary);
  white-space: pre-wrap;
  line-height: 1.55;
  margin-bottom: 0.5rem;
}

.bug-meta-line {
  font-size: 0.78rem;
  color: var(--text-muted);
  margin-bottom: 0.4rem;
}

.bug-meta-line code {
  background: var(--bg-dark);
  padding: 0.1rem 0.35rem;
  border-radius: 4px;
  font-size: 0.75rem;
}

.bug-attachments {
  display: flex;
  gap: 0.5rem;
  flex-wrap: wrap;
  margin: 0.5rem 0;
}

.bug-attachment-thumb {
  width: 100px;
  height: 100px;
  object-fit: cover;
  border-radius: var(--radius-sm);
  border: 1px solid var(--border);
  cursor: zoom-in;
  background: var(--bg);
  transition: transform var(--transition), box-shadow var(--transition);
}

.bug-attachment-thumb:hover {
  transform: scale(1.03);
  box-shadow: var(--shadow-md);
}

.bug-admin-note {
  font-size: 0.85rem;
  background: var(--warning-light);
  border-left: 3px solid var(--warning);
  padding: 0.5rem 0.75rem;
  margin: 0.5rem 0;
  border-radius: 0 var(--radius-sm) var(--radius-sm) 0;
  color: var(--text);
}

.bug-actions {
  display: flex;
  gap: 0.5rem;
  flex-wrap: wrap;
  align-items: center;
  margin-top: 0.75rem;
  padding-top: 0.75rem;
  border-top: 1px dashed var(--border);
}

.bug-actions .input {
  width: auto;
  min-width: 140px;
  font-size: 0.82rem;
  padding: 0.35rem 0.5rem;
}

/* Status & kind badges */
.bug-status, .bug-kind {
  display: inline-block;
  font-size: 0.7rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  padding: 0.2rem 0.55rem;
  border-radius: 999px;
  white-space: nowrap;
}

.bug-status-open { background: rgba(194, 107, 74, 0.18); color: var(--primary); }
.bug-status-in_progress { background: var(--warning-light); color: var(--warning); }
.bug-status-resolved { background: var(--success-light); color: var(--success); }
.bug-status-dismissed { background: var(--bg-dark); color: var(--text-muted); }

.bug-kind-bug { background: rgba(193, 65, 65, 0.12); color: var(--danger); }
.bug-kind-improvement { background: rgba(107, 142, 90, 0.16); color: var(--success); }

/* Image viewer modal */
.bug-image-modal {
  display: none;
  position: fixed;
  inset: 0;
  z-index: 1400;
  align-items: center;
  justify-content: center;
}

.bug-image-modal.open { display: flex; }

.bug-image-backdrop {
  position: absolute;
  inset: 0;
  background: rgba(0, 0, 0, 0.85);
  cursor: zoom-out;
}

.bug-image-modal img {
  position: relative;
  max-width: 92vw;
  max-height: 92vh;
  border-radius: var(--radius);
  box-shadow: 0 16px 48px rgba(0, 0, 0, 0.5);
}

.bug-image-close {
  position: absolute;
  top: 1rem;
  right: 1rem;
  width: 36px;
  height: 36px;
  background: rgba(255, 255, 255, 0.15);
  color: #fff;
  border: none;
  border-radius: 50%;
  font-size: 1.4rem;
  line-height: 1;
  cursor: pointer;
  z-index: 2;
}

.bug-image-close:hover { background: rgba(255, 255, 255, 0.3); }

/* ─── MANUAL COLORIMETRY EDITOR (MCE) ─── */
.mce-modal {
  display: none;
  position: fixed;
  inset: 0;
  z-index: 1100;
}

.mce-modal.open {
  display: flex;
  align-items: center;
  justify-content: center;
}

.mce-backdrop {
  position: absolute;
  inset: 0;
  background: rgba(0, 0, 0, 0.75);
}

.mce-container {
  position: relative;
  background: var(--surface);
  border-radius: var(--radius);
  display: flex;
  flex-direction: column;
  width: 95vw;
  height: 92vh;
  max-width: 1400px;
  overflow: hidden;
  box-shadow: 0 16px 48px rgba(0, 0, 0, 0.3);
}

.mce-header {
  display: flex;
  align-items: center;
  gap: 1rem;
  padding: 0.75rem 1.25rem;
  border-bottom: 1px solid var(--border);
  flex-shrink: 0;
}

.mce-close {
  background: none;
  border: none;
  font-size: 1.5rem;
  cursor: pointer;
  color: var(--text-muted);
  line-height: 1;
  padding: 0 0.25rem;
}

.mce-close:hover { color: var(--text); }

.mce-nav {
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.mce-counter {
  font-size: 0.85rem;
  font-weight: 600;
  color: var(--text-secondary);
  min-width: 60px;
  text-align: center;
}

.mce-subject-name {
  font-size: 0.9rem;
  font-weight: 600;
  color: var(--text);
}

.mce-body {
  display: flex;
  flex: 1;
  min-height: 0;
  overflow: hidden;
}

.mce-images {
  flex: 1;
  display: flex;
  gap: 1rem;
  padding: 1rem;
  min-width: 0;
  overflow: hidden;
}

.mce-img-col {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  min-width: 0;
  position: relative;
}

.mce-img-label {
  display: block;
  font-size: 0.75rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--text-muted);
  margin-bottom: 0.5rem;
}

.mce-img-viewport {
  width: 100%;
  height: calc(92vh - 160px);
  overflow: hidden;
  position: relative;
  border-radius: var(--radius-sm);
  border: 1px solid var(--border);
  background: #f0f0f0;
  cursor: grab;
}

.mce-img-viewport.grabbing {
  cursor: grabbing;
}

.mce-img-viewport img {
  position: absolute;
  top: 0;
  left: 0;
  transform-origin: 0 0;
  user-select: none;
  -webkit-user-select: none;
}

.mce-zoom-bar {
  display: flex;
  align-items: center;
  gap: 0.3rem;
  margin-left: auto;
  font-size: 0.8rem;
  flex-shrink: 0;
}

#mce-zoom-level {
  min-width: 44px;
  text-align: center;
  font-weight: 600;
}

.mce-loading {
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  font-size: 0.8rem;
  color: var(--cream-400);
  background: rgba(13, 31, 23, 0.85);
  padding: 0.35rem 0.75rem;
  border-radius: var(--radius-sm);
  display: none;
  z-index: 2;
}

.mce-controls {
  width: 260px;
  flex-shrink: 0;
  border-left: 1px solid var(--royal-700);
  padding: 1rem;
  overflow-y: auto;
  background: var(--royal-900);
}

.mce-controls h4 {
  font-size: 0.72rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--text-muted);
  margin: 0.75rem 0 0.5rem;
}

.mce-controls h4:first-child {
  margin-top: 0;
}

.mce-slider-group {
  margin-bottom: 0.65rem;
}

.mce-slider-group label {
  display: flex;
  justify-content: space-between;
  font-size: 0.8rem;
  font-weight: 500;
  color: var(--text-secondary);
  margin-bottom: 0.2rem;
}

.mce-num {
  width: 48px;
  padding: 0.1rem 0.25rem;
  border: 1px solid var(--border);
  border-radius: 3px;
  font-family: var(--font);
  font-size: 0.78rem;
  font-weight: 700;
  color: var(--text);
  text-align: center;
  background: var(--surface);
  -moz-appearance: textfield;
}

.mce-num::-webkit-inner-spin-button,
.mce-num::-webkit-outer-spin-button {
  opacity: 1;
  height: 18px;
}

.mce-num:focus {
  outline: none;
  border-color: var(--primary);
  box-shadow: 0 0 0 2px rgba(79, 70, 229, .15);
}

.mce-slider-group input[type="range"] {
  width: 100%;
  height: 6px;
  -webkit-appearance: none;
  appearance: none;
  background: var(--border);
  border-radius: 3px;
  outline: none;
  cursor: pointer;
}

.mce-slider-group input[type="range"]::-webkit-slider-thumb {
  -webkit-appearance: none;
  appearance: none;
  width: 16px;
  height: 16px;
  border-radius: 50%;
  background: var(--gold-500);
  cursor: pointer;
  border: 2px solid var(--royal-950);
  box-shadow: 0 1px 3px rgba(0,0,0,0.3);
}

.mce-slider-group input[type="range"]::-moz-range-thumb {
  width: 16px;
  height: 16px;
  border-radius: 50%;
  background: var(--gold-500);
  cursor: pointer;
  border: 2px solid var(--royal-950);
  box-shadow: 0 1px 3px rgba(0,0,0,0.3);
}

.mce-balance label {
  display: flex;
  align-items: center;
  gap: 0.3rem;
}

.mce-axis-left, .mce-axis-right {
  font-size: 0.7rem;
  font-weight: 500;
  color: var(--text-muted);
  flex: 1;
}

.mce-axis-left { text-align: left; }
.mce-axis-right { text-align: right; }

.mce-balance .mce-num {
  flex: 0 0 auto;
}

.mce-range-cr {
  background: linear-gradient(to right, #00b8b8, #ccc 50%, #e04040) !important;
}

.mce-range-mg {
  background: linear-gradient(to right, #c040c0, #ccc 50%, #40a040) !important;
}

.mce-range-yb {
  background: linear-gradient(to right, #c0c020, #ccc 50%, #4060d0) !important;
}

/* Histogram & levels */
.mce-histogram-wrap {
  margin-bottom: 0.5rem;
}

#mce-histogram {
  width: 100%;
  height: auto;
  aspect-ratio: 256 / 100;
  background: #1a1a1a;
  border: 1px solid var(--border);
  border-radius: 4px;
  display: block;
  cursor: pointer;
}

.mce-levels-nums {
  display: flex;
  justify-content: space-between;
  margin-top: 4px;
}

.mce-levels-nums label {
  font-size: 0.72rem;
  display: flex;
  align-items: center;
  gap: 3px;
}

.mce-num-mid {
  width: 52px;
}

.mce-reset-btn {
  width: 100%;
  margin-top: 0.75rem;
}

.mce-footer {
  display: flex;
  justify-content: flex-end;
  gap: 0.75rem;
  padding: 0.75rem 1.25rem;
  border-top: 1px solid var(--border);
  flex-shrink: 0;
}

@media (max-width: 900px) {
  .mce-body {
    flex-direction: column;
  }
  .mce-controls {
    width: 100%;
    border-left: none;
    border-top: 1px solid var(--border);
    max-height: 200px;
  }
  .mce-images {
    flex-direction: column;
  }
}

/* ─── COMPARE MODAL ─── */
.compare-modal {
  display: none;
  position: fixed;
  inset: 0;
  z-index: 1000;
  align-items: stretch;
  justify-content: stretch;
}

.compare-modal.open {
  display: flex;
}

.compare-backdrop {
  position: absolute;
  inset: 0;
  background: rgba(0, 0, 0, 0.85);
}

.compare-content {
  position: relative;
  background: var(--bg);
  display: flex;
  flex-direction: column;
  width: 100%;
  height: 100%;
  padding: 1rem 1.5rem;
  overflow: hidden;
  z-index: 1;
}

.compare-close {
  position: absolute;
  top: 0.75rem;
  right: 1rem;
  background: rgba(0,0,0,0.4);
  border: none;
  font-size: 1.8rem;
  cursor: pointer;
  color: #fff;
  line-height: 1;
  width: 2.5rem;
  height: 2.5rem;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 10;
  transition: background 0.2s;
}

.compare-close:hover {
  background: rgba(0,0,0,0.7);
}

.compare-header {
  display: flex; align-items: center; gap: 1rem;
  margin-bottom: 0.75rem; flex-shrink: 0;
}
.compare-content h3 {
  margin: 0;
  font-size: 1.1rem;
  flex: 1;
}
.compare-dl-btn { white-space: nowrap; text-decoration: none; }

.compare-images {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 1.5rem;
  flex: 1;
  min-height: 0;
}

.compare-col {
  text-align: center;
  display: flex;
  flex-direction: column;
  min-height: 0;
}

.compare-label {
  display: block;
  font-size: 0.8rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--text-muted);
  margin-bottom: 0.5rem;
  flex-shrink: 0;
}

.compare-col img {
  width: 100%;
  height: 100%;
  object-fit: contain;
  border-radius: var(--radius-sm);
  border: 1px solid var(--border);
  min-height: 0;
}

/* ─── MANUAL REFRAME MODAL ─── */
.reframe-modal { display:none; position:fixed; inset:0; z-index:9500; align-items:center; justify-content:center; }
.reframe-modal.open { display:flex; }
.reframe-backdrop { position:absolute; inset:0; background:rgba(0,0,0,.85); }
.reframe-panel {
  position:relative; z-index:1; background:var(--bg); border-radius:var(--radius);
  display:flex; flex-direction:column; max-width:900px; width:95vw; max-height:92vh; overflow:hidden;
  box-shadow:0 12px 40px rgba(0,0,0,.4);
}
.reframe-header { display:flex; align-items:center; justify-content:space-between; padding:.75rem 1.25rem; border-bottom:1px solid var(--border); }
.reframe-header h3 { margin:0; font-size:1.05rem; }
.reframe-close { background:none; border:none; font-size:1.5rem; cursor:pointer; color:var(--text-muted); line-height:1; padding:0 .25rem; }
.reframe-close:hover { color:var(--text); }
.reframe-body { display:flex; gap:1.25rem; padding:1.25rem; overflow:hidden; flex:1; min-height:0; }

.reframe-viewer-wrap {
  flex:1; display:flex; align-items:center; justify-content:center;
  min-width:0; min-height:0; overflow:hidden; background:#111; border-radius:var(--radius-sm);
  position:relative;
}
.reframe-viewer {
  position:relative; aspect-ratio:2/3; max-height:72vh; width:auto; height:72vh;
  overflow:visible; cursor:grab; user-select:none; z-index:1;
  box-shadow:0 0 0 9999px rgba(0,0,0,.55);
  border:1.5px dashed rgba(255,255,255,.45);
}
.reframe-viewer:active { cursor:grabbing; }
#reframe-img { position:absolute; pointer-events:none; }
.reframe-guide {
  position:absolute; left:0; right:0; top:17%; height:0; border-top:1.5px dashed rgba(255,80,80,.65);
  pointer-events:none; z-index:3;
}
.reframe-guide-label {
  position:absolute; top:17%; right:6px; transform:translateY(-110%);
  font-size:.6rem; color:rgba(255,80,80,.8); font-weight:700; pointer-events:none; z-index:3;
}
.reframe-crop-label {
  position:absolute; bottom:6px; left:50%; transform:translateX(-50%);
  font-size:.55rem; text-transform:uppercase; letter-spacing:.5px;
  color:rgba(255,255,255,.5); pointer-events:none; z-index:3; white-space:nowrap;
}

.reframe-sidebar { width:200px; flex-shrink:0; display:flex; flex-direction:column; gap:1rem; justify-content:space-between; }
.reframe-ctrl label { display:block; font-size:.8rem; font-weight:600; margin-bottom:.35rem; color:var(--text-muted); }
.reframe-slider-row { display:flex; align-items:center; gap:.5rem; }
.reframe-slider-row input[type=range] { flex:1; }
.reframe-slider-row span { font-size:.85rem; font-weight:700; min-width:42px; text-align:right; }
.reframe-info { font-size:.75rem; color:var(--text-muted); line-height:1.5; }
.reframe-actions { display:flex; flex-direction:column; gap:.5rem; }
.reframe-actions .btn { width:100%; justify-content:center; }

@media (max-width:700px) {
  .reframe-body { flex-direction:column; }
  .reframe-sidebar { width:100%; flex-direction:row; flex-wrap:wrap; align-items:center; }
  .reframe-actions { flex-direction:row; }
  .reframe-viewer { height:55vh; max-height:55vh; }
}

/* ─── AUTO-FRAME PREVIEW ─── */
.autoframe-layout {
  display: flex;
  gap: 2rem;
  align-items: flex-start;
}

.autoframe-controls {
  flex: 1;
  min-width: 0;
}

.autoframe-preview {
  flex-shrink: 0;
  padding: 0.75rem;
  background: var(--bg-dark);
  border-radius: var(--radius);
  border: 1px solid var(--border);
  display: flex;
  align-items: center;
  justify-content: center;
}

@media (max-width: 600px) {
  .autoframe-layout {
    flex-direction: column;
    align-items: stretch;
  }
  .autoframe-preview {
    align-self: center;
  }
}

/* ─── CALIBRATION ─── */
.calibration-card {
  max-width: 100%;
}

.calibration-desc code {
  background: var(--bg);
  padding: 0.15rem 0.4rem;
  border-radius: 3px;
  font-size: 0.78rem;
  color: var(--text-secondary);
}

.calibration-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 0.75rem;
  margin-bottom: 0.75rem;
}

.calibration-grid-2 {
  grid-template-columns: repeat(2, 1fr);
}

.calibration-item {
  background: var(--bg);
  border-radius: var(--radius-sm);
  padding: 0.85rem;
  text-align: center;
}

.calibration-label {
  display: block;
  font-size: 0.72rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  color: var(--text-muted);
  margin-bottom: 0.35rem;
}

.calibration-value {
  display: block;
  font-size: 1.25rem;
  font-weight: 700;
  color: var(--text);
}

.calibration-value.positive { color: var(--success); }
.calibration-value.negative { color: var(--danger); }
.calibration-value.neutral { color: var(--text-secondary); }

.calibration-meta {
  display: flex;
  gap: 1.5rem;
  font-size: 0.8rem;
  color: var(--text-muted);
}

.calibration-sub {
  display: block;
  font-size: 0.75rem;
  color: var(--text-muted);
  margin-top: 0.2rem;
}

.calibration-explain {
  font-size: 0.85rem;
  color: var(--text-secondary);
  margin-bottom: 0.75rem;
  padding: 0.6rem 0.85rem;
  background: var(--primary-light);
  border-radius: var(--radius-sm);
  border-left: 3px solid var(--primary);
}

.calibration-no-profile {
  color: var(--text-muted);
  font-size: 0.88rem;
  font-style: italic;
}

@media (max-width: 768px) {
  .calibration-grid { grid-template-columns: repeat(2, 1fr); }
}

/* ─── SCHOOL UPLOAD DROPZONE ─── */
.school-upload-card {
  margin-bottom: 1.25rem;
  padding: 0;
  overflow: hidden;
}

.school-upload-dropzone {
  position: relative;
  border: 2px dashed var(--border);
  border-radius: var(--radius);
  padding: 1.5rem;
  text-align: center;
  cursor: pointer;
  transition: border-color var(--transition), background var(--transition);
}

.school-upload-dropzone:hover {
  border-color: var(--primary);
  background: var(--primary-light);
}

.school-upload-dropzone.dragover {
  border-color: var(--primary);
  background: var(--primary-light);
  border-style: solid;
}

.school-upload-dropzone.uploading {
  pointer-events: none;
  border-style: solid;
  border-color: var(--primary);
  cursor: default;
}

.school-upload-content {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.35rem;
  color: var(--text-secondary);
}

.school-upload-content svg {
  color: var(--text-muted);
  margin-bottom: 0.25rem;
}

.school-upload-text {
  font-size: 0.9rem;
  margin: 0;
}

.school-upload-text strong {
  color: var(--primary);
}

.school-upload-hint {
  font-size: 0.78rem;
  color: var(--text-muted);
  margin: 0;
}

.school-upload-link {
  color: var(--primary);
  text-decoration: underline;
  cursor: pointer;
  font-weight: 500;
}

.school-upload-progress {
  text-align: left;
}

.school-upload-filename {
  font-weight: 600;
  font-size: 0.88rem;
  margin: 0 0 0.5rem;
  color: var(--text);
}

.school-upload-status {
  margin: 0.35rem 0 0;
  font-size: 0.82rem;
  color: var(--text-muted);
}

.school-upload-status.success {
  color: var(--success);
  font-weight: 600;
}

.school-upload-status.error {
  color: var(--danger);
  font-weight: 600;
}

/* ─── TEMPLATE SELECT MODAL ─── */
.tpl-select-modal {
  display: none;
  position: fixed;
  inset: 0;
  z-index: 3000;
  align-items: center;
  justify-content: center;
}
.tpl-select-modal.open { display: flex; }

.tpl-select-backdrop {
  position: absolute;
  inset: 0;
  background: rgba(0,0,0,0.55);
}

.tpl-select-content {
  position: relative;
  background: var(--bg);
  border-radius: 1rem;
  padding: 1.5rem 2rem 1.25rem;
  max-width: 700px;
  width: 92vw;
  max-height: 85vh;
  overflow-y: auto;
  z-index: 1;
  box-shadow: 0 20px 60px rgba(0,0,0,0.4);
}

.tpl-select-content h3 {
  margin: 0 0 0.25rem;
  font-size: 1.15rem;
}

.tpl-select-hint {
  font-size: 0.85rem;
  color: var(--text-muted);
  margin: 0 0 0.75rem;
}

.tpl-select-toolbar {
  display: flex;
  gap: 0.5rem;
  margin-bottom: 0.75rem;
}

.tpl-select-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(140px, 1fr));
  gap: 0.75rem;
  margin-bottom: 1.25rem;
}

.tpl-select-option {
  position: relative;
  border-radius: 0.5rem;
  overflow: hidden;
  cursor: pointer;
  border: 3px solid transparent;
  aspect-ratio: 3 / 4;
  transition: border-color 0.15s, box-shadow 0.15s;
  background: var(--bg-card, #1e1e2e);
}

.tpl-select-option:hover {
  border-color: var(--primary-light, #60a5fa);
  box-shadow: 0 0 0 2px rgba(59,130,246,0.2);
}

.tpl-select-option.selected {
  border-color: var(--primary);
  box-shadow: 0 0 0 3px rgba(59,130,246,0.3);
}

.tpl-select-option.selected::after {
  content: '\2713';
  position: absolute;
  top: 6px;
  right: 8px;
  background: var(--primary);
  color: #fff;
  width: 22px;
  height: 22px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 0.75rem;
  font-weight: 700;
  z-index: 2;
}

.tpl-select-option img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

.tpl-select-option .tpl-select-label {
  position: absolute;
  bottom: 0;
  left: 0;
  right: 0;
  background: rgba(0,0,0,0.6);
  color: #fff;
  font-size: 0.78rem;
  padding: 0.3rem 0.5rem;
  text-align: center;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.tpl-select-option-nopreview {
  display: flex;
  align-items: center;
  justify-content: center;
  flex-direction: column;
  gap: 0.35rem;
  background: var(--bg-card, #1e1e2e);
}

.tpl-select-option-nopreview svg {
  opacity: 0.35;
}

.tpl-select-actions {
  display: flex;
  gap: 0.75rem;
  justify-content: flex-end;
  align-items: center;
}

.tpl-include-original {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  margin-left: 0.5rem;
  font-size: 0.85rem;
  color: var(--text-muted, #6b7280);
  cursor: pointer;
  user-select: none;
}

.tpl-include-original input[type="checkbox"] {
  cursor: pointer;
}

/* ─── INDIV CLASS SELECT ─── */
.indiv-class-option {
  display: flex;
  align-items: center;
  gap: 0.6rem;
  padding: 0.6rem 0.85rem;
  border: 1px solid var(--border, #d1d5db);
  border-radius: 0.5rem;
  cursor: pointer;
  transition: background 0.15s, border-color 0.15s;
  margin-bottom: 0.35rem;
}
.indiv-class-option:hover {
  background: var(--bg-hover, rgba(59,130,246,0.06));
}
.indiv-class-option:has(input:checked) {
  border-color: var(--primary, #3b82f6);
  background: rgba(59,130,246,0.08);
}
.indiv-class-option input[type="radio"] {
  accent-color: var(--primary, #3b82f6);
  margin: 0;
  flex-shrink: 0;
}
.indiv-class-name {
  font-weight: 600;
  font-size: 0.9rem;
  flex: 1;
}
.indiv-class-count {
  font-size: 0.78rem;
  color: var(--text-muted, #6b7280);
  white-space: nowrap;
}

#indiv-class-grid {
  display: flex;
  flex-direction: column;
}

.indiv-new-class-row {
  margin-bottom: 1.25rem;
}

.indiv-class-option-new {
  border-style: dashed !important;
}
.indiv-class-option-new .indiv-class-name {
  color: var(--primary, #3b82f6);
}

.indiv-new-class-input {
  display: block;
  width: 100%;
  margin-top: 0.4rem;
  padding: 0.5rem 0.75rem;
  font-size: 0.9rem;
  border: 1px solid var(--border, #d1d5db);
  border-radius: 0.4rem;
  background: var(--surface, #fff);
  color: var(--text);
  outline: none;
  transition: border-color 0.15s;
}
.indiv-new-class-input:focus {
  border-color: var(--primary, #3b82f6);
}

/* ─── STICKER BACKGROUND MODAL ─── */
.sticker-bg-modal {
  display: none;
  position: fixed;
  inset: 0;
  z-index: 3000;
  align-items: center;
  justify-content: center;
}
.sticker-bg-modal.open { display: flex; }

.sticker-bg-backdrop {
  position: absolute;
  inset: 0;
  background: rgba(0,0,0,0.55);
}

.sticker-bg-content {
  position: relative;
  background: var(--bg);
  border-radius: 1rem;
  padding: 1.5rem 2rem 1.25rem;
  max-width: 640px;
  width: 90vw;
  max-height: 85vh;
  overflow-y: auto;
  box-shadow: 0 12px 40px rgba(0,0,0,0.3);
}

.sticker-bg-content h3 {
  margin: 0 0 0.25rem;
  font-size: 1.15rem;
}

.sticker-bg-hint {
  font-size: 0.85rem;
  color: var(--text-muted);
  margin: 0 0 1rem;
}

.sticker-bg-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(120px, 1fr));
  gap: 0.75rem;
  margin-bottom: 1.25rem;
}

.sticker-bg-option {
  position: relative;
  border-radius: 0.5rem;
  overflow: hidden;
  cursor: pointer;
  border: 3px solid transparent;
  transition: border-color 0.15s, box-shadow 0.15s;
  aspect-ratio: 37.1 / 70;
}

.sticker-bg-option:hover {
  border-color: var(--primary-light, #60a5fa);
  box-shadow: 0 0 0 2px rgba(59,130,246,0.2);
}

.sticker-bg-option.selected {
  border-color: var(--primary);
  box-shadow: 0 0 0 3px rgba(59,130,246,0.3);
}

.sticker-bg-option.selected::after {
  content: '✓';
  position: absolute;
  top: 4px;
  right: 6px;
  background: var(--primary);
  color: #fff;
  border-radius: 50%;
  width: 22px;
  height: 22px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 0.75rem;
  font-weight: 700;
}

.sticker-bg-option img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

.sticker-bg-option .sticker-bg-label {
  position: absolute;
  bottom: 0;
  left: 0;
  right: 0;
  background: rgba(0,0,0,0.55);
  color: #fff;
  font-size: 0.72rem;
  padding: 3px 6px;
  text-align: center;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.sticker-bg-white {
  background: #fff;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-direction: column;
  gap: 0.25rem;
}

.sticker-bg-white svg {
  opacity: 0.4;
}

.sticker-bg-white .sticker-bg-label {
  position: static;
  background: none;
  color: var(--text-muted);
  font-size: 0.78rem;
  padding: 0;
}

.sticker-option-check {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  margin-bottom: 1rem;
  cursor: pointer;
  font-size: 0.9rem;
  color: var(--text);
  user-select: none;
}

.sticker-option-check input[type="checkbox"] {
  width: 18px;
  height: 18px;
  accent-color: var(--primary);
  cursor: pointer;
}

.sticker-bg-actions {
  display: flex;
  gap: 0.75rem;
  justify-content: flex-end;
}

/* ─── SHOOT ANALYSIS ─── */

.view-filter-badge {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 18px;
  height: 18px;
  padding: 0 5px;
  border-radius: 9px;
  font-size: 0.7rem;
  font-weight: 700;
  line-height: 1;
  color: #fff;
  background: #ef4444;
  margin-left: 4px;
}

.sa-container {
  padding: 0;
}

.sa-empty {
  text-align: center;
  padding: 3rem 1rem;
  color: var(--text-muted);
}

.sa-empty svg { opacity: 0.4; margin-bottom: 0.75rem; }
.sa-empty p { margin: 0.25rem 0; }
.sa-empty .sa-empty-title { font-size: 1.1rem; font-weight: 600; color: var(--text); }
.sa-empty .sa-empty-hint { font-size: 0.85rem; }

.sa-stats {
  display: flex;
  gap: 1rem;
  flex-wrap: wrap;
  margin-bottom: 1.25rem;
}

.sa-stat {
  background: var(--card-bg);
  border: 1px solid var(--border);
  border-radius: 0.5rem;
  padding: 0.6rem 1rem;
  font-size: 0.85rem;
}

.sa-stat strong { font-weight: 700; }

.sa-issue-card {
  background: var(--card-bg);
  border: 1px solid var(--border);
  border-radius: 0.75rem;
  padding: 1rem 1.25rem;
  margin-bottom: 1rem;
  border-left: 4px solid #ef4444;
}

.sa-issue-card.resolved {
  border-left-color: #22c55e;
  opacity: 0.7;
}

.sa-issue-header {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  margin-bottom: 0.75rem;
}

.sa-issue-icon {
  width: 32px;
  height: 32px;
  border-radius: 50%;
  background: rgba(239, 68, 68, 0.1);
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

.sa-issue-card.resolved .sa-issue-icon {
  background: rgba(34, 197, 94, 0.1);
}

.sa-issue-title {
  font-weight: 600;
  font-size: 0.95rem;
}

.sa-issue-subtitle {
  font-size: 0.8rem;
  color: var(--text-muted);
}

.sa-issue-photos {
  display: flex;
  gap: 0.75rem;
  flex-wrap: wrap;
  margin-bottom: 0.75rem;
}

.sa-issue-photo {
  text-align: center;
  position: relative;
  cursor: pointer;
}

.sa-issue-photo img {
  width: 150px;
  height: 200px;
  object-fit: cover;
  border-radius: 0.5rem;
  border: 2px solid var(--border);
  cursor: pointer;
  transition: border-color 0.15s;
}

.sa-issue-photo img:hover {
  border-color: var(--primary);
  opacity: 0.85;
}

.sa-issue-photo.selected img {
  border-color: #22c55e;
}

.sa-issue-photo.mismatched img {
  border-color: #ef4444;
}

.sa-issue-photo.found-elsewhere img {
  border-color: #22c55e;
}

.sa-issue-photo.blur-current img {
  border-color: #f59e0b;
}

.sa-issue-photo.blur-suggested img {
  border-color: #22c55e;
}

.sa-issue-photo-badge.blur-warn {
  background: #f59e0b;
}

.sa-blur-card {
  border-left: 3px solid #f59e0b;
}

.sa-viewer-caption {
  display: block;
  font-size: 0.8rem;
  color: var(--text-muted);
  margin-top: 0.35rem;
  flex-shrink: 0;
}

.sa-viewer-nav-header {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.75rem;
  margin-bottom: 0.35rem;
  flex-shrink: 0;
}

.sa-viewer-nav-btn {
  background: rgba(255,255,255,0.1);
  border: 1px solid var(--border);
  color: var(--text);
  width: 32px;
  height: 32px;
  border-radius: var(--radius-sm);
  font-size: 1.25rem;
  line-height: 1;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: background 0.15s;
}

.sa-viewer-nav-btn:hover:not(:disabled) {
  background: rgba(255,255,255,0.2);
}

.sa-viewer-nav-btn:disabled {
  opacity: 0.3;
  cursor: default;
}

.sa-viewer-counter {
  font-size: 0.8rem;
  font-weight: 600;
  color: var(--text-muted);
  min-width: 3rem;
  text-align: center;
}

.sa-viewer-swap-btn {
  margin-top: 0.75rem;
  flex-shrink: 0;
}

.sa-found-elsewhere {
  display: block;
  font-size: 0.65rem;
  color: #22c55e;
  margin-top: 0.2rem;
  max-width: 150px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.sa-found-elsewhere svg {
  vertical-align: middle;
}

.sa-issue-photo-label {
  display: block;
  font-size: 0.72rem;
  color: var(--text-muted);
  margin-top: 0.25rem;
  max-width: 150px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.sa-issue-photo-badge {
  position: absolute;
  top: 4px;
  right: 4px;
  font-size: 0.65rem;
  font-weight: 700;
  padding: 2px 6px;
  border-radius: 4px;
  color: #fff;
}

.sa-issue-photo-badge.ok { background: #22c55e; }
.sa-issue-photo-badge.warn { background: #ef4444; }

/* Restore button overlay on mismatched photos */
.sa-restore-btn {
  position: absolute;
  bottom: 28px;
  left: 50%;
  transform: translateX(-50%);
  background: rgba(239, 68, 68, 0.92);
  color: #fff;
  border: none;
  border-radius: 6px;
  padding: 5px 12px;
  font-size: 0.75rem;
  font-weight: 600;
  cursor: pointer;
  display: flex;
  align-items: center;
  gap: 4px;
  white-space: nowrap;
  opacity: 0;
  transition: opacity 0.15s, background 0.15s;
  z-index: 2;
}
.sa-issue-photo.mismatched:hover .sa-restore-btn {
  opacity: 1;
}
.sa-restore-btn:hover {
  background: rgba(220, 38, 38, 1);
}

/* Class picker overlay / modal */
.sa-class-picker-overlay {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: rgba(0,0,0,0.45);
  z-index: 9999;
  display: flex;
  align-items: center;
  justify-content: center;
  animation: fadeIn 0.12s ease;
}
.sa-class-picker {
  background: var(--bg-primary, #fff);
  border-radius: 12px;
  box-shadow: 0 8px 32px rgba(0,0,0,0.25);
  width: 380px;
  max-width: 92vw;
  max-height: 70vh;
  display: flex;
  flex-direction: column;
  overflow: hidden;
  animation: slideUp 0.15s ease;
}
@keyframes slideUp {
  from { transform: translateY(20px); opacity: 0.5; }
  to { transform: translateY(0); opacity: 1; }
}
.sa-class-picker-header {
  padding: 16px 20px 12px;
  border-bottom: 1px solid var(--border, #e5e7eb);
  display: flex;
  flex-direction: column;
  gap: 4px;
}
.sa-class-picker-filename {
  font-size: 0.82rem;
  color: var(--text-muted, #6b7280);
}
.sa-class-picker-list {
  overflow-y: auto;
  flex: 1;
  padding: 6px 0;
}
.sa-class-picker-item {
  display: block;
  width: 100%;
  text-align: left;
  padding: 10px 20px;
  border: none;
  background: none;
  font-size: 0.9rem;
  cursor: pointer;
  color: var(--text-primary, #111);
  transition: background 0.1s;
}
.sa-class-picker-item:hover {
  background: var(--bg-secondary, #f3f4f6);
}
.sa-class-picker-item.suggested {
  font-weight: 600;
}
.sa-class-picker-cancel {
  margin: 8px 20px 12px;
  align-self: flex-end;
}

.sa-issue-actions {
  display: flex;
  gap: 0.5rem;
  align-items: center;
}

.sa-issue-resolved {
  display: flex;
  align-items: center;
  gap: 0.4rem;
  font-size: 0.85rem;
  color: #22c55e;
  font-weight: 600;
}

.sa-issue-found-elsewhere {
  display: flex;
  align-items: center;
  gap: 0.4rem;
  font-size: 0.82rem;
  color: #22c55e;
  font-weight: 500;
}

.sa-no-issues {
  text-align: center;
  padding: 2rem;
  color: #22c55e;
}

.sa-no-issues svg { margin-bottom: 0.5rem; }
.sa-no-issues p { margin: 0.25rem 0; font-size: 0.95rem; }

/* ─── Slot card (one per slot, export + variants) ─── */
.sa-slot-card .sa-issue-photos {
  gap: 1rem;
  padding: 0.25rem 0 0.5rem;
}

/* Export officiel visual emphasis */
.sa-issue-photo.is-export img {
  border: 3px solid #22c55e;
  box-shadow: 0 0 0 2px rgba(34, 197, 94, 0.15);
}

/* Badges — full-width pill above the image label */
.sa-badge-export,
.sa-badge-overwrite,
.sa-badge-variant {
  position: absolute;
  top: 6px;
  left: 6px;
  right: 6px;
  width: auto;
  text-align: center;
  padding: 4px 6px;
  font-size: 0.68rem;
  letter-spacing: 0.02em;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 3px;
  border-radius: 4px;
}
.sa-badge-export {
  background: #22c55e;
  color: #fff;
}
.sa-badge-overwrite {
  background: #ef4444;
  color: #fff;
  box-shadow: 0 2px 6px rgba(239, 68, 68, 0.35);
}
.sa-badge-variant {
  background: rgba(148, 163, 184, 0.75);
  color: #fff;
  font-weight: 500;
}

/* Non-mismatched variants are muted */
.sa-issue-photo:not(.is-export):not(.mismatched) img {
  opacity: 0.75;
  border-color: var(--border);
}
.sa-issue-photo:not(.is-export):not(.mismatched):hover img {
  opacity: 1;
}

/* Mismatched — stronger red border */
.sa-issue-photo.mismatched img {
  border: 3px solid #ef4444;
  box-shadow: 0 0 0 2px rgba(239, 68, 68, 0.12);
}

/* Confidence chip under a photo */
.sa-conf-chip {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  margin-top: 0.3rem;
  padding: 3px 8px;
  font-size: 0.7rem;
  font-weight: 500;
  border-radius: 999px;
  border: 1px solid transparent;
  line-height: 1.2;
}
.sa-conf-chip svg { flex-shrink: 0; }
.sa-conf-chip strong { font-weight: 700; }

.sa-conf-high {
  background: rgba(220, 38, 38, 0.15);
  color: #dc2626;
  border-color: rgba(220, 38, 38, 0.35);
}
.sa-conf-medium {
  background: rgba(239, 68, 68, 0.12);
  color: #ef4444;
  border-color: rgba(239, 68, 68, 0.3);
}
.sa-conf-low {
  background: rgba(245, 158, 11, 0.12);
  color: #f59e0b;
  border-color: rgba(245, 158, 11, 0.3);
}
.sa-conf-dhash {
  background: rgba(148, 163, 184, 0.15);
  color: var(--text-muted);
  border-color: rgba(148, 163, 184, 0.3);
  font-style: italic;
}

/* Comparison viewer — confidence row + restored tag */
.sa-viewer-conf-row {
  display: flex;
  gap: 0.75rem;
  align-items: center;
  justify-content: center;
  margin-top: 0.5rem;
  flex-wrap: wrap;
  flex-shrink: 0;
}
.sa-viewer-found-elsewhere {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  font-size: 0.78rem;
  color: #22c55e;
  font-weight: 500;
}

/* ─── SWITCH VIEWER MODAL ─── */
.switch-viewer-content {
  max-width: 900px;
  width: 90vw;
}
.switch-viewer-header {
  margin-bottom: 1rem;
}
.switch-viewer-header h3 {
  margin: 0 0 0.25rem 0;
}
.switch-viewer-hint {
  margin: 0;
  font-size: 0.85rem;
  color: var(--text-muted);
}
.switch-viewer-current {
  text-align: center;
  margin-bottom: 1.25rem;
}
.switch-viewer-current-label {
  font-size: 0.8rem;
  font-weight: 600;
  color: var(--text-muted);
  margin-bottom: 0.5rem;
  text-transform: uppercase;
  letter-spacing: 0.05em;
}
.switch-viewer-current img {
  max-height: 280px;
  max-width: 100%;
  object-fit: contain;
  border-radius: var(--radius);
  border: 2px solid var(--primary);
  box-shadow: 0 0 0 3px rgba(99,102,241,0.15);
}
.switch-viewer-alts-label {
  font-size: 0.8rem;
  font-weight: 600;
  color: var(--text-muted);
  margin-bottom: 0.5rem;
  text-transform: uppercase;
  letter-spacing: 0.05em;
}
.switch-viewer-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(160px, 1fr));
  gap: 0.75rem;
  max-height: 45vh;
  overflow-y: auto;
  padding: 0.25rem;
}
.switch-alt-card {
  position: relative;
  border-radius: var(--radius);
  border: 2px solid var(--border);
  overflow: hidden;
  cursor: pointer;
  transition: border-color 0.15s, box-shadow 0.15s, transform 0.15s;
  background: var(--bg-secondary);
}
.switch-alt-card:hover {
  border-color: var(--primary);
  box-shadow: 0 2px 8px rgba(0,0,0,0.15);
  transform: translateY(-1px);
}
.switch-alt-card.current {
  border-color: var(--primary);
  box-shadow: 0 0 0 3px rgba(99,102,241,0.15);
}
.switch-alt-card.switching {
  opacity: 0.6;
  pointer-events: none;
}
.switch-alt-card img {
  width: 100%;
  aspect-ratio: 3/4;
  object-fit: cover;
  display: block;
}
.switch-alt-card-info {
  padding: 0.35rem 0.5rem;
  font-size: 0.75rem;
  color: var(--text-muted);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.switch-alt-badge {
  position: absolute;
  top: 6px;
  right: 6px;
  font-size: 0.65rem;
  font-weight: 700;
  padding: 2px 6px;
  border-radius: 4px;
  color: #fff;
  background: var(--primary);
}
.switch-alt-badge.current {
  background: #22c55e;
}
.switch-viewer-loading,
.switch-viewer-empty {
  text-align: center;
  padding: 2rem;
  color: var(--text-muted);
  font-size: 0.9rem;
}
.switch-viewer-loading .spinner {
  display: inline-block;
  width: 18px;
  height: 18px;
  border: 2px solid var(--border);
  border-top-color: var(--primary);
  border-radius: 50%;
  animation: spin 0.6s linear infinite;
  vertical-align: middle;
  margin-right: 0.5rem;
}

/* ─── UTILS ─── */
.hint { font-size: 0.82rem; color: var(--text-muted); }
code { font-family: 'SF Mono', 'Fira Code', monospace; font-size: 0.85em; }

/* ═════════════════════════════════════════════ */
/*  SUPERCOM Module                              */
/* ═════════════════════════════════════════════ */

/* Sidebar SUPERCOM nav item */
.nav-item-supercom {
  color: var(--gold-300) !important;
  font-weight: 600;
}
.nav-item-supercom:hover,
.nav-item-supercom.active {
  background: rgba(212, 160, 74, 0.12) !important;
  color: var(--gold-400) !important;
}
.nav-item-supercom.active {
  border-left-color: var(--gold-400) !important;
}
.nav-item-supercom svg {
  stroke: var(--gold-400);
}

.supercom-btn {
  background: linear-gradient(135deg, var(--gold-500) 0%, var(--gold-600) 100%) !important;
  color: var(--royal-950) !important;
  border: none !important;
  font-weight: 700 !important;
  letter-spacing: 0.02em;
}
.supercom-btn:hover {
  background: linear-gradient(135deg, var(--gold-400) 0%, var(--gold-500) 100%) !important;
}
.supercom-btn.active {
  box-shadow: 0 0 0 3px rgba(176, 141, 87, 0.35);
}
.supercom-btn svg { stroke: var(--royal-950) !important; }

.sc-container {
  display: flex;
  flex-direction: column;
  gap: 1.25rem;
  --text: #1e293b;
  --text-secondary: #475569;
  --text-muted: #6b7280;
  --surface: #ffffff;
  --bg: #f8fafc;
  --bg-muted: #f1f5f9;
  --bg-dark: #e5e7eb;
  --border: #e2e8f0;
  --border-light: #e5e7eb;
  color: #1e293b;
}
.sc-container .card {
  background: #ffffff;
  border-color: #e2e8f0;
}
.sc-container .card-title {
  color: #1e293b;
}
.sc-container input[type="number"],
.sc-container input[type="text"],
.sc-container select,
.sc-container textarea {
  background: #ffffff;
  color: #1e293b;
  border-color: #d1d5db;
}
.sc-container .input {
  background: #ffffff;
  color: #1e293b;
  border-color: #d1d5db;
}
.sc-container .btn {
  color: #1e293b;
}
.sc-container .btn-primary {
  background: #1a56db;
  color: #ffffff;
}
.sc-container .btn-ghost {
  color: #475569;
}
.sc-container .sc-product-row {
  border-bottom-color: #e5e7eb;
}
.sc-container .sc-product-row:hover {
  background: #f8fafc;
}

.sc-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0.75rem 0;
}

.sc-header-title {
  display: flex;
  align-items: center;
  gap: 0.75rem;
}

.sc-header-title svg { stroke: #7c3aed; }

.sc-header-title h3 {
  font-size: 1.25rem;
  font-weight: 700;
  color: #7c3aed;
  margin: 0;
}

.sc-header-title p {
  font-size: 0.8rem;
  color: var(--text-muted);
  margin: 0;
}

.sc-sub-tabs {
  display: flex;
  gap: 0;
  background: var(--bg-card, #fff);
  border-radius: 8px;
  margin-bottom: 0.75rem;
  overflow: hidden;
  border: 1px solid var(--border-color, #e5e7eb);
}
.sc-sub-tab {
  flex: 1;
  padding: 0.75rem 1rem;
  font-size: 0.95rem;
  font-weight: 600;
  border: none;
  background: transparent;
  color: var(--text-muted, #6b7280);
  cursor: pointer;
  transition: all 0.2s;
  border-bottom: 3px solid transparent;
}
.sc-sub-tab:hover { background: var(--bg-hover, #f3f4f6); }
.sc-sub-tab.active {
  color: #7c3aed;
  border-bottom-color: #7c3aed;
  background: var(--bg-card, #fff);
}
.sc-tab-content { animation: scFadeIn 0.25s ease; }
@keyframes scFadeIn { from { opacity: 0; transform: translateY(4px); } to { opacity: 1; transform: translateY(0); } }

.sc-prod-tabs {
  display: flex;
  gap: 0;
  border-bottom: 2px solid var(--border-color, #e5e7eb);
  margin: 0 1rem;
}
.sc-prod-tab {
  padding: 0.6rem 1rem;
  font-size: 0.85rem;
  font-weight: 600;
  border: none;
  background: transparent;
  color: var(--text-muted, #6b7280);
  cursor: pointer;
  border-bottom: 2px solid transparent;
  margin-bottom: -2px;
  transition: all 0.15s;
  display: flex;
  align-items: center;
  gap: 0.4rem;
}
.sc-prod-tab:hover { color: #7c3aed; }
.sc-prod-tab.active {
  color: #7c3aed;
  border-bottom-color: #7c3aed;
}
.sc-prod-tab-badge {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: 0.65rem;
  width: 18px;
  height: 18px;
  border-radius: 50%;
  font-weight: 700;
  line-height: 1;
}
.sc-prod-tab-ok {
  background: #dcfce7;
  color: #16a34a;
}
.sc-prod-tab-warn {
  background: #fef3c7;
  color: #d97706;
  animation: scPulse 1.5s ease-in-out infinite;
}
@keyframes scPulse { 0%,100% { opacity: 1; } 50% { opacity: 0.5; } }
.sc-prod-panel { padding: 0.25rem 0; }

.sc-section { margin-bottom: 0.5rem; }

.sc-empty {
  padding: 1.5rem;
  text-align: center;
  color: var(--text-muted);
  font-size: 0.85rem;
}

/* Products list */

.sc-products-list {
  display: flex;
  flex-direction: column;
}

.sc-drag-handle {
  cursor: grab;
  color: var(--text-muted);
  font-size: 16px;
  line-height: 1;
  padding: 4px 2px;
  user-select: none;
  opacity: 0.4;
  transition: opacity 0.15s, color 0.15s;
}
.sc-product-row:hover .sc-drag-handle {
  opacity: 1;
  color: var(--primary);
}
.sc-drag-handle:active {
  cursor: grabbing;
}
.sc-product-row.sc-dragging {
  opacity: 0.3;
  background: var(--bg-muted);
}
.sc-drag-placeholder {
  height: 3px;
  background: var(--primary);
  border-radius: 2px;
  margin: 0;
  transition: none;
}

.sc-scripts-warning {
  background: #fffbeb;
  border: 1px solid #f59e0b;
  border-radius: 6px;
  padding: 0.75rem 1rem;
  margin-bottom: 0.75rem;
  font-size: 0.85rem;
  color: #92400e;
}
.sc-scripts-warning ul { margin: 0.25rem 0 0 1.25rem; padding: 0; }
.sc-scripts-warning li { margin-bottom: 0.15rem; }

.sc-product-row {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  padding: 0.6rem 0.75rem;
  border-bottom: 1px solid var(--border-light);
  transition: background var(--transition);
}

.sc-product-row:hover { background: var(--bg); }

.sc-product-row.assigned {
  background: #f5f3ff;
  color: #1e293b;
}

.sc-product-row.inactive {
  opacity: 0.5;
}

.sc-product-check {
  flex-shrink: 0;
}

.sc-product-check input[type="checkbox"] {
  width: 18px;
  height: 18px;
  accent-color: #7c3aed;
  cursor: pointer;
}

.sc-product-info {
  flex: 1;
  min-width: 0;
  display: flex;
  flex-direction: column;
  gap: 0.1rem;
}

.sc-product-name {
  font-weight: 600;
  font-size: 0.9rem;
  color: var(--text);
}

.sc-product-desc {
  font-size: 0.78rem;
  color: var(--text-muted);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.sc-product-price {
  font-weight: 700;
  font-size: 0.9rem;
  color: #16a34a;
  min-width: 60px;
  text-align: right;
}
.sc-product-price-edit {
  display: flex;
  align-items: center;
  gap: 0.25rem;
  min-width: 120px;
}
.sc-price-input {
  font-size: 0.85rem;
  font-weight: 600;
  padding: 0.25rem 0.4rem;
  border-radius: 5px;
}
.sc-price-input.overridden {
  background: #fef3c7;
  border-color: #f59e0b;
  color: #92400e;
}
.sc-price-unit {
  font-weight: 600;
  font-size: 0.85rem;
  color: var(--text-secondary);
}
.btn-xs {
  padding: 0.1rem 0.3rem;
  font-size: 0.75rem;
  line-height: 1.2;
}

.sc-product-cat {
  font-size: 0.75rem;
  color: var(--text-muted);
  background: var(--bg-dark);
  padding: 2px 8px;
  border-radius: 4px;
  min-width: 50px;
  text-align: center;
}

.sc-product-actions {
  display: flex;
  gap: 0.25rem;
  flex-shrink: 0;
}

.sc-assign-wrap {
  display: flex;
  align-items: center;
  gap: 1rem;
  padding: 0.75rem;
  border-top: 1px solid var(--border);
}

.sc-assign-count {
  font-size: 0.82rem;
  color: var(--text-muted);
}

/* Generation grid */

.sc-gen-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 1rem;
  padding: 1rem;
}

.sc-gen-card {
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  padding: 1.25rem;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: var(--bg);
  gap: 0.5rem;
}

.sc-gen-card h4 {
  font-size: 0.9rem;
  font-weight: 700;
  margin: 0;
}

.sc-gen-card p {
  font-size: 0.78rem;
  color: var(--text-muted);
  margin: 0;
}

.sc-gen-icon { margin-bottom: 0.25rem; }

.sc-dl-btn {
  margin-top: 0.25rem;
}

.sc-bctype-grid {
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
}
.sc-bctype-option {
  display: flex;
  align-items: flex-start;
  gap: 0.75rem;
  padding: 0.75rem 1rem;
  border: 2px solid var(--border);
  border-radius: 8px;
  cursor: pointer;
  transition: border-color 0.2s, background 0.2s;
}
.sc-bctype-option:hover {
  border-color: var(--primary);
}
.sc-bctype-option.selected {
  border-color: var(--primary);
  background: rgba(26,86,219,0.04);
}
.sc-bctype-option input[type="radio"] {
  margin-top: 0.2rem;
}
.sc-bctype-content {
  display: flex;
  flex-direction: column;
  gap: 0.15rem;
}
.sc-bctype-content strong {
  font-size: 0.88rem;
}
.sc-bctype-content span {
  font-size: 0.78rem;
  color: var(--text-muted);
}
.sc-type-badge {
  display: inline-block;
  font-size: 0.65rem;
  font-weight: 700;
  padding: 0.1rem 0.4rem;
  border-radius: 4px;
  margin-left: 0.4rem;
  vertical-align: middle;
}
.sc-type-badge.sc-type-classNormal {
  background: #dbeafe;
  color: #1e40af;
}
.sc-type-badge.sc-type-classFun {
  background: #fce7f3;
  color: #9d174d;
}
.sc-type-badge.sc-type-fratrie {
  background: #fef3c7;
  color: #92400e;
}
.sc-type-badge.sc-type-pochette {
  background: #e0e7ff;
  color: #3730a3;
}
.sc-bg-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(150px, 1fr));
  gap: 1rem;
}
.sc-bg-card {
  border: 2px solid var(--border);
  border-radius: 10px;
  padding: 0.5rem;
  cursor: pointer;
  transition: border-color 0.2s, box-shadow 0.2s;
  position: relative;
  text-align: center;
}
.sc-bg-card:hover {
  border-color: var(--primary);
  box-shadow: 0 0 0 2px rgba(26,86,219,0.15);
}
.sc-bg-card.selected {
  border-color: var(--primary);
  box-shadow: 0 0 0 3px rgba(26,86,219,0.2);
  background: rgba(26,86,219,0.04);
}
.sc-bg-thumb {
  width: 100%;
  aspect-ratio: 3/4;
  overflow: hidden;
  border-radius: 6px;
  background: var(--bg-secondary);
}
.sc-bg-thumb img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}
.sc-bg-name {
  font-size: 0.82rem;
  font-weight: 600;
  margin-top: 0.4rem;
  color: #1e293b;
}
.sc-bg-badge {
  font-size: 0.68rem;
  font-weight: 700;
  color: #fff;
  background: var(--primary);
  border-radius: 4px;
  padding: 0.15rem 0.5rem;
  display: inline-block;
  margin-top: 0.3rem;
}

/* Orders table */

.sc-order-class {
  margin-bottom: 1.5rem;
}

.sc-order-class-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0.5rem 0;
  border-bottom: 2px solid #7c3aed;
  margin-bottom: 0.5rem;
}

.sc-order-class-header h4 {
  font-size: 1rem;
  font-weight: 700;
  color: #7c3aed;
  margin: 0;
}

.sc-order-class-header span {
  font-size: 0.82rem;
  color: var(--text-muted);
}

.sc-order-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.82rem;
}

.sc-order-table thead {
  background: rgba(176, 141, 87, 0.08);
}

.sc-order-table th {
  padding: 0.5rem 0.4rem;
  text-align: center;
  font-weight: 600;
  font-size: 0.75rem;
  color: var(--gold-400);
  border-bottom: 1px solid var(--border);
  white-space: nowrap;
}

.sc-order-table th:first-child,
.sc-order-table th:nth-child(2) {
  text-align: left;
}

.sc-order-table th small {
  display: block;
  font-weight: 400;
  color: var(--text-muted);
}

.sc-order-table-diagonal thead tr { height: 130px; }
.sc-order-table-diagonal .sc-order-th-fixed {
  vertical-align: bottom;
  padding-bottom: 0.5rem;
}
.sc-order-table-diagonal .sc-order-prod-col {
  position: relative;
  vertical-align: bottom;
  padding: 0;
  width: 45px;
  min-width: 45px;
}
.sc-order-th-rotate {
  position: absolute;
  bottom: 8px;
  left: 50%;
  transform-origin: bottom left;
  transform: rotate(-55deg);
  white-space: nowrap;
}
.sc-order-th-rotate span {
  display: block;
  font-size: 0.72rem;
  font-weight: 600;
  color: #7c3aed;
  line-height: 1.2;
  text-align: left;
}

.sc-order-table td {
  padding: 0.35rem 0.4rem;
  border-bottom: 1px solid var(--border-light);
}

.sc-order-table tbody tr:hover {
  background: #faf9ff;
}

.sc-order-num {
  font-size: 0.75rem;
  color: var(--text-muted);
  width: 40px;
}

.sc-order-name {
  font-weight: 500;
  min-width: 120px;
  max-width: 180px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.sc-order-input-cell {
  text-align: center;
  width: 60px;
}

.sc-order-input {
  width: 44px;
  padding: 3px 4px;
  text-align: center;
  border: 1px solid var(--border);
  border-radius: 4px;
  font-size: 0.82rem;
  font-family: var(--font);
  background: var(--surface);
  transition: border-color var(--transition);
}

.sc-order-input:focus {
  outline: none;
  border-color: #7c3aed;
  box-shadow: 0 0 0 2px rgba(124,58,237,0.15);
}

.sc-order-total {
  font-weight: 700;
  text-align: right;
  color: #16a34a;
  min-width: 70px;
  white-space: nowrap;
}

.sc-order-prod-col {
  max-width: 90px;
}

/* SUPERCOM Recap Financier */
.sc-recap-stats {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
  gap: 1rem;
  padding: 1.5rem;
}
.sc-recap-stat-box {
  background: var(--bg-hover, #f9fafb);
  border-radius: 10px;
  padding: 1.25rem;
  text-align: center;
  border: 1px solid var(--border-light, #e5e7eb);
}
.sc-recap-stat-box.sc-recap-ca {
  background: linear-gradient(135deg, #f0fdf4 0%, #dcfce7 100%);
  border-color: #86efac;
}
.sc-recap-stat-value {
  font-size: 1.75rem;
  font-weight: 800;
  color: var(--text, #1e293b);
  line-height: 1.2;
}
.sc-recap-ca .sc-recap-stat-value {
  color: #16a34a;
}
.sc-recap-stat-label {
  font-size: 0.8rem;
  color: var(--text-muted, #6b7280);
  margin-top: 0.3rem;
  font-weight: 500;
}
.sc-recap-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.85rem;
  margin: 0;
}
.sc-recap-table thead {
  background: #f5f3ff;
}
.sc-recap-table th {
  padding: 0.6rem 0.75rem;
  font-weight: 600;
  font-size: 0.78rem;
  color: #7c3aed;
  border-bottom: 2px solid var(--border, #e5e7eb);
  text-align: left;
}
.sc-recap-table td {
  padding: 0.5rem 0.75rem;
  border-bottom: 1px solid var(--border-light, #f1f5f9);
}
.sc-recap-table tbody tr:hover {
  background: #faf9ff;
}
.sc-recap-table tfoot td {
  border-top: 2px solid var(--border, #e5e7eb);
  padding-top: 0.65rem;
  font-size: 0.9rem;
}
.sc-recap-table-sm {
  font-size: 0.8rem;
  margin-top: 0.5rem;
}
.sc-recap-table-sm th {
  padding: 0.4rem 0.5rem;
  font-size: 0.72rem;
}
.sc-recap-table-sm td {
  padding: 0.35rem 0.5rem;
}
.sc-recap-class {
  padding: 1rem 1.25rem;
  border-bottom: 1px solid var(--border-light, #f1f5f9);
}
.sc-recap-class:last-child {
  border-bottom: none;
}
.sc-recap-class-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 0.4rem;
}
.sc-recap-class-name {
  font-weight: 700;
  font-size: 0.95rem;
  color: var(--text, #1e293b);
}
.sc-recap-class-ca {
  font-weight: 800;
  font-size: 1.05rem;
  color: #16a34a;
}
.sc-recap-class-bar-wrap {
  height: 6px;
  background: var(--border-light, #e5e7eb);
  border-radius: 3px;
  overflow: hidden;
  margin-bottom: 0.35rem;
}
.sc-recap-class-bar {
  height: 100%;
  background: linear-gradient(90deg, #7c3aed, #a78bfa);
  border-radius: 3px;
  transition: width 0.4s ease;
}
.sc-recap-class-meta {
  display: flex;
  gap: 1.25rem;
  font-size: 0.75rem;
  color: var(--text-muted, #6b7280);
}

.sc-recap-print-btn {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  background: #7c3aed;
  color: #fff;
  border: none;
  border-radius: 6px;
  padding: 0.45rem 1rem;
  font-weight: 600;
  font-size: 0.82rem;
  cursor: pointer;
  transition: background 0.2s;
}
.sc-recap-print-btn:hover {
  background: #6d28d9;
}
.sc-recap-grand .card-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
}

/* SUPERCOM modal */

.sc-modal {
  display: none;
  position: fixed;
  inset: 0;
  z-index: 1100;
  align-items: center;
  justify-content: center;
}

.sc-modal.open {
  display: flex;
}

.sc-modal-backdrop {
  position: absolute;
  inset: 0;
  background: rgba(0,0,0,0.5);
}

.sc-modal-content {
  position: relative;
  background: var(--surface);
  border-radius: var(--radius);
  box-shadow: var(--shadow-md);
  width: 90%;
  max-width: 480px;
  max-height: 90vh;
  overflow-y: auto;
}

.sc-modal-sm { max-width: 420px; }

.sc-modal-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 1rem 1.25rem;
  border-bottom: 1px solid var(--border);
}

.sc-modal-header h3 {
  font-size: 1rem;
  font-weight: 700;
  margin: 0;
}

.sc-modal-body {
  padding: 1.25rem;
}

.sc-modal-footer {
  display: flex;
  justify-content: flex-end;
  gap: 0.5rem;
  padding: 0.75rem 1.25rem;
  border-top: 1px solid var(--border);
}

/* ╔══════════════════════════════════════════════╗ */
/* ║  Module Gestion des Groupes                  ║ */
/* ╚══════════════════════════════════════════════╝ */

.gp-container {
  padding: 0;
}

.gp-header {
  display: flex;
  gap: 0.75rem;
  align-items: center;
  flex-wrap: wrap;
  margin-bottom: 1.25rem;
}

.gp-header svg.spin {
  animation: spin 0.8s linear infinite;
}

.gp-stats {
  display: flex;
  gap: 1.5rem;
  flex-wrap: wrap;
  padding: 0.75rem 1rem;
  background: var(--bg-subtle, #f8f9fa);
  border-radius: 8px;
  margin-bottom: 1rem;
  font-size: 0.85rem;
  color: var(--text-muted);
}

.gp-stat strong {
  color: var(--text);
  font-weight: 700;
}

.gp-warnings {
  background: #fef3c7;
  color: #92400e;
  padding: 0.75rem 1rem;
  border-radius: 8px;
  font-size: 0.8rem;
  max-height: 200px;
  overflow-y: auto;
  line-height: 1.6;
  margin-bottom: 1rem;
}

.gp-empty {
  text-align: center;
  padding: 3rem 2rem;
  color: var(--text-muted);
}

.gp-empty svg { margin-bottom: 1rem; opacity: 0.4; }
.gp-empty-title { font-size: 1.1rem; font-weight: 600; margin: 0.5rem 0 0.25rem; }
.gp-empty-hint { font-size: 0.85rem; }

/* Photos non assignées */
.gp-unassigned-section {
  margin-top: 2rem;
  padding: 1.25rem;
  background: var(--bg-card, #fff);
  border: 1px dashed var(--border);
  border-radius: 10px;
}
.gp-unassigned-title {
  font-size: 1rem;
  font-weight: 600;
  margin: 0 0 0.35rem;
  color: var(--text);
}
.gp-unassigned-hint {
  font-size: 0.8rem;
  color: var(--text-muted);
  margin: 0 0 1rem;
}
.gp-unassigned-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(150px, 1fr));
  gap: 10px;
}
.gp-unassigned-thumb {
  position: relative;
  border-radius: 6px;
  overflow: hidden;
  border: 1px solid var(--border);
  background: #000;
}
.gp-unassigned-thumb img {
  display: block;
  width: 100%;
  aspect-ratio: 3/2;
  object-fit: cover;
}
.gp-unassigned-label {
  display: block;
  font-size: 0.7rem;
  padding: 3px 6px;
  color: var(--text-muted);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  background: var(--bg-card, #fff);
}
.gp-unassigned-thumb[draggable="true"] { cursor: grab; }
.gp-unassigned-thumb[draggable="true"]:active { cursor: grabbing; }
.gp-unassigned-thumb.gp-dragging { opacity: 0.4; }

/* Drop target feedback */
.gp-seq-card.gp-drop-candidate {
  border-style: dashed;
}
.gp-seq-card.gp-drop-hover {
  border-color: #6366f1 !important;
  background: rgba(99, 102, 241, 0.08) !important;
  box-shadow: 0 0 0 3px rgba(99, 102, 241, 0.2);
}

.gp-seq-card {
  background: var(--bg-card, #fff);
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 1rem 1.25rem;
  margin-bottom: 1rem;
  transition: border-color 0.2s;
}

.gp-seq-card.gp-badge-done { border-left: 3px solid #22c55e; }
.gp-seq-card.gp-badge-warn { border-left: 3px solid #f59e0b; }
.gp-seq-card.gp-badge-error { border-left: 3px solid #ef4444; }
.gp-seq-card.gp-badge-ok { border-left: 3px solid #3b82f6; }

.gp-seq-card.gp-seq-complete {
  border: 2px solid #22c55e;
  background: #f0fdf4;
}

.gp-seq-header {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 1rem;
  margin-bottom: 0.75rem;
  flex-wrap: wrap;
}

.gp-seq-delete-btn {
  color: var(--text-muted, #94a3b8);
  opacity: 0;
  transition: opacity 0.15s, color 0.15s;
  flex-shrink: 0;
  padding: 0.25rem;
}
.gp-seq-card:hover .gp-seq-delete-btn {
  opacity: 1;
}
.gp-seq-delete-btn:hover {
  color: var(--danger, #ef4444) !important;
}

.gp-seq-title {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  flex-wrap: wrap;
}

.gp-seq-title h4 {
  margin: 0;
  font-size: 1rem;
  font-weight: 700;
  max-width: 400px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.gp-seq-meta {
  display: flex;
  gap: 1rem;
  font-size: 0.8rem;
  color: var(--text-muted);
  flex-shrink: 0;
}

.gp-seq-meta .gp-ocr-snippet {
  max-width: 250px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  font-family: monospace;
  font-size: 0.72rem;
  opacity: 0.7;
}

.gp-badge {
  display: inline-block;
  padding: 0.15rem 0.5rem;
  border-radius: 4px;
  font-size: 0.72rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.03em;
}

.gp-badge-pending { background: #e5e7eb; color: #6b7280; }
.gp-badge-ok { background: #dbeafe; color: #2563eb; }
.gp-badge-warn { background: #fef3c7; color: #d97706; }
.gp-badge-done { background: #dcfce7; color: #16a34a; }
.gp-badge-error { background: #fecaca; color: #dc2626; }

.gp-match-score {
  font-size: 0.75rem;
  color: var(--text-muted);
  background: var(--bg-subtle, #f3f4f6);
  padding: 0.1rem 0.4rem;
  border-radius: 3px;
}

.gp-seq-warnings {
  display: flex;
  flex-wrap: wrap;
  gap: 0.4rem;
  margin-bottom: 0.75rem;
}

.gp-warn-item {
  font-size: 0.75rem;
  color: #b45309;
  background: #fef3c7;
  padding: 0.15rem 0.5rem;
  border-radius: 4px;
}

.gp-seq-photos {
  display: flex;
  gap: 0.5rem;
  flex-wrap: wrap;
  margin-bottom: 0.75rem;
}

.gp-photo-thumb {
  position: relative;
  width: 120px;
  border-radius: 6px;
  overflow: hidden;
  border: 2px solid transparent;
  cursor: pointer;
  transition: border-color 0.2s, transform 0.15s;
}

.gp-photo-thumb:hover {
  transform: scale(1.03);
  border-color: var(--border-hover, #94a3b8);
}

.gp-photo-thumb img {
  width: 100%;
  height: 80px;
  object-fit: cover;
  display: block;
}

.gp-photo-thumb.gp-slate { border-color: #8b5cf6; opacity: 0.7; }
.gp-photo-thumb.gp-slate:hover { opacity: 1; }
.gp-photo-thumb.gp-selected-normal { border-color: #22c55e; box-shadow: 0 0 0 2px rgba(34,197,94,0.3); }
.gp-photo-thumb.gp-selected-grimace { border-color: #22c55e; box-shadow: 0 0 0 2px rgba(34,197,94,0.3); }
.gp-photo-thumb.gp-grimace { border-color: #fbbf24; }

.gp-photo-badge {
  position: absolute;
  top: 2px;
  left: 2px;
  padding: 0.1rem 0.35rem;
  font-size: 0.62rem;
  font-weight: 700;
  border-radius: 3px;
  text-transform: uppercase;
}

.gp-badge-slate { background: #8b5cf6; color: #fff; }
.gp-badge-best { background: #22c55e; color: #fff; }
.gp-badge-grimace-sel { background: #22c55e; color: #fff; }
.gp-badge-grimace { background: #f59e0b; color: #fff; }
.gp-badge-grimace-light { background: #fef3c7; color: #b45309; }

.gp-badge-done-tag { background: #22c55e; color: #fff; }
.gp-badge-todo-tag { background: #ef4444; color: #fff; }

/* Tags de statut dans le header de la carte */
.gp-status-tag {
  display: inline-block;
  padding: 0.1rem 0.45rem;
  font-size: 0.68rem;
  font-weight: 700;
  border-radius: 4px;
  text-transform: uppercase;
  letter-spacing: 0.02em;
  margin-left: 0.35rem;
  vertical-align: middle;
}
.gp-tag-ok { background: #dcfce7; color: #15803d; border: 1px solid #86efac; }
.gp-tag-todo { background: #fee2e2; color: #dc2626; border: 1px solid #fca5a5; }

/* Menu déroulant classe sélectionnée */
.gp-class-select.gp-class-selected {
  background: #eff6ff;
  border-color: #3b82f6;
  color: #1d4ed8;
  font-weight: 600;
}

.gp-photo-score {
  position: absolute;
  top: 2px;
  right: 2px;
  padding: 0.1rem 0.3rem;
  font-size: 0.65rem;
  font-weight: 700;
  background: rgba(0,0,0,0.6);
  color: #fff;
  border-radius: 3px;
}

.gp-photo-label {
  display: block;
  padding: 0.15rem 0.25rem;
  font-size: 0.62rem;
  color: var(--text-muted);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  text-align: center;
  background: var(--bg-subtle, #f8f9fa);
}

.gp-crops {
  display: flex;
  gap: 1rem;
  flex-wrap: wrap;
  margin-bottom: 0.75rem;
}

.gp-crop-preview {
  flex: 1;
  min-width: 200px;
  max-width: 400px;
}

.gp-crop-preview img {
  width: 100%;
  border-radius: 6px;
  border: 1px solid var(--border);
}

.gp-crop-label {
  display: block;
  font-size: 0.75rem;
  font-weight: 600;
  color: var(--text-muted);
  margin-bottom: 0.25rem;
}

/* ── Layout deux colonnes (séquences + visionneuse) ── */

.gp-split {
  display: block;
}

.gp-left {
  min-width: 0;
}

/* ── Modal visionneuse plein écran ── */

.gp-modal-backdrop {
  position: fixed;
  inset: 0;
  z-index: 9000;
  background: rgba(0, 0, 0, 0.7);
  display: flex;
  align-items: center;
  justify-content: center;
  animation: gpFadeIn 0.15s ease;
}

@keyframes gpFadeIn {
  from { opacity: 0; }
  to { opacity: 1; }
}

.gp-modal {
  position: relative;
  background: #fff;
  border-radius: 14px;
  max-width: 1400px;
  width: 96vw;
  max-height: 96vh;
  overflow-y: auto;
  box-shadow: 0 20px 60px rgba(0,0,0,0.4);
  display: flex;
  flex-direction: column;
}

.gp-modal-close {
  position: absolute;
  top: 12px;
  right: 12px;
  width: 36px;
  height: 36px;
  border-radius: 50%;
  border: none;
  background: rgba(0,0,0,0.06);
  color: #6b7280;
  font-size: 1.3rem;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 2;
  transition: background 0.15s, color 0.15s;
}

.gp-modal-close:hover {
  background: rgba(0,0,0,0.12);
  color: #111;
}

.gp-modal-body {
  padding: 1.5rem 2rem;
}

.gp-modal-header-row {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  margin-bottom: 0.25rem;
}

.gp-modal-header-row .gp-modal-title {
  flex: 1;
  margin: 0;
}

.gp-modal-nav-btn {
  flex-shrink: 0;
  font-size: 1.1rem;
  padding: 0.25rem 0.75rem;
  border-radius: 6px;
  background: var(--bg-dark, #ebedf0);
  border: 1px solid var(--border, #e2e5ea);
  cursor: pointer;
  line-height: 1;
  transition: background 0.15s;
}

.gp-modal-nav-btn:hover {
  background: var(--primary-light, #eef2ff);
  border-color: var(--primary, #4f46e5);
  color: var(--primary, #4f46e5);
}

.gp-modal-title {
  font-size: 1rem;
  font-weight: 700;
  margin: 0 0 0.25rem;
}

.gp-modal-meta {
  font-size: 0.82rem;
  color: var(--text-muted, #6b7280);
  margin: 0 0 1rem;
}

.gp-modal-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.75rem;
  align-items: center;
}

.gp-modal-actions label {
  font-size: 0.82rem;
  font-weight: 600;
  color: var(--text-muted, #6b7280);
}

.gp-modal-actions .gp-class-select {
  font-size: 0.88rem;
  padding: 0.4rem 0.6rem;
  min-width: 200px;
}

.gp-modal-actions .btn {
  font-size: 0.85rem;
  padding: 0.45rem 1rem;
}

.gp-modal-photo-display {
  margin: 1rem 0;
  text-align: center;
}

.gp-modal-photo-display img {
  max-width: 100%;
  max-height: 65vh;
  border-radius: 0.5rem;
  box-shadow: 0 2px 12px rgba(0, 0, 0, 0.1);
}

.gp-modal-divider {
  border: none;
  border-top: 1px solid #e5e7eb;
  margin: 1rem 0;
}

/* ── Outil de remplacement de visage (Face Swap) ── */

.gp-fswap-section {
  margin-top: 0.25rem;
}

.gp-btn-fswap {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  background: #eff6ff;
  color: #2563eb;
  border: 1px solid #bfdbfe;
  font-weight: 600;
  font-size: 0.82rem;
}

.gp-btn-fswap:hover {
  background: #dbeafe;
}

.gp-fswap-content {
  margin-top: 0.5rem;
}

.gp-fswap-loading {
  font-size: 0.82rem;
  color: var(--text-secondary, #6b7280);
  font-style: italic;
  margin: 0.25rem 0;
}

.gp-fswap-empty {
  font-size: 0.82rem;
  color: #dc2626;
  margin: 0.25rem 0;
}

.gp-fswap-hint {
  font-size: 0.82rem;
  color: var(--text-secondary, #6b7280);
  margin: 0.25rem 0 0.5rem;
}

.gp-fswap-split {
  display: flex;
  gap: 1rem;
  align-items: flex-start;
}

.gp-fswap-img-container {
  position: relative;
  flex: 1;
  min-width: 0;
  border-radius: 8px;
  overflow: hidden;
  background: #000;
}

.gp-fswap-img-container img {
  display: block;
  width: 100%;
  height: auto;
  user-select: none;
  -webkit-user-drag: none;
}

.gp-fswap-candidates-panel {
  flex: 0 0 160px;
  max-height: 60vh;
  overflow-y: auto;
  padding: 0.5rem;
  background: var(--bg, #f5f6f8);
  border-radius: 8px;
  border: 1px solid var(--border, #e2e5ea);
}

.gp-fswap-panel-hint {
  font-size: 0.78rem;
  color: var(--text-muted, #9098a3);
  text-align: center;
  padding: 2rem 0.5rem;
}

.gp-fswap-panel-title {
  font-size: 0.78rem;
  font-weight: 700;
  color: var(--text, #1a1d23);
  margin: 0 0 0.5rem;
}

.gp-fswap-ref-label {
  font-size: 0.7rem;
  font-weight: 600;
  color: var(--text-muted, #9098a3);
  text-transform: uppercase;
  letter-spacing: 0.03em;
  margin: 0.5rem 0 0.25rem;
}

.gp-fswap-face-crop {
  width: 110px;
  overflow: hidden;
  border-radius: 6px;
  position: relative;
}

.gp-fswap-face-crop img {
  position: absolute;
  top: 0;
  left: 0;
  max-width: none;
}

.gp-fswap-face-thumb.gp-fswap-face-current {
  border: 2px solid var(--text-muted, #9098a3);
  border-radius: 8px;
  overflow: hidden;
  opacity: 0.7;
}

.gp-fswap-face-option {
  cursor: pointer;
  border: 2px solid transparent;
  border-radius: 8px;
  overflow: hidden;
  margin-bottom: 0.5rem;
  transition: border-color 0.15s, box-shadow 0.15s;
}

.gp-fswap-face-option:hover {
  border-color: #3b82f6;
  box-shadow: 0 2px 8px rgba(59, 130, 246, 0.2);
}

.gp-fswap-face-option-active {
  border-color: #22c55e;
  box-shadow: 0 0 0 3px rgba(34, 197, 94, 0.3);
}

.gp-fswap-face-info {
  display: flex;
  flex-direction: column;
  padding: 0.2rem 0.4rem;
  background: #fff;
}

.gp-fswap-face-score {
  font-size: 0.65rem;
  color: var(--text-secondary, #6b7280);
}

.gp-fswap-face-match {
  font-size: 0.65rem;
  color: #2563eb;
  font-weight: 600;
}

/* Face overlays on the image */
.gp-face-overlay {
  position: absolute;
  border: 2px solid rgba(37, 99, 235, 0.8);
  border-radius: 40%;
  cursor: pointer;
  z-index: 15;
  pointer-events: auto;
  background: rgba(37, 99, 235, 0.12);
  transition: border-color 0.15s, box-shadow 0.15s, background 0.15s;
}

.gp-face-overlay:hover {
  border-color: #2563eb;
  box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.4);
  background: rgba(37, 99, 235, 0.2);
}

.gp-face-overlay-selected {
  border-color: #22c55e;
  box-shadow: 0 0 0 3px rgba(34, 197, 94, 0.5);
  background: rgba(34, 197, 94, 0.15);
}

/* Legacy candidates grid (kept for compare view) */
.gp-fswap-candidates {
  display: flex;
  gap: 0.75rem;
  flex-wrap: wrap;
  margin-bottom: 0.75rem;
}

.gp-fswap-candidate {
  flex: 0 0 auto;
  width: 180px;
  border: 2px solid var(--border, #d1d5db);
  border-radius: 8px;
  overflow: hidden;
  cursor: pointer;
  transition: border-color 0.15s, box-shadow 0.15s;
  background: var(--bg-card, #fff);
}

.gp-fswap-candidate:hover {
  border-color: #3b82f6;
  box-shadow: 0 2px 8px rgba(59, 130, 246, 0.15);
}

.gp-fswap-candidate-active {
  border-color: #22c55e;
  box-shadow: 0 0 0 3px rgba(34, 197, 94, 0.3);
}

.gp-fswap-candidate-img-wrap {
  position: relative;
  height: 120px;
  overflow: hidden;
  background: #000;
}

.gp-fswap-candidate-img-wrap img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.gp-fswap-candidate-info {
  padding: 0.4rem 0.5rem;
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.gp-fswap-candidate-name {
  font-size: 0.7rem;
  font-weight: 600;
  color: var(--text-primary);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.gp-fswap-candidate-score {
  font-size: 0.65rem;
  color: var(--text-secondary, #6b7280);
}

.gp-fswap-candidate-dist {
  font-size: 0.65rem;
  color: #2563eb;
  font-weight: 600;
}

/* Before/after comparison */
.gp-fswap-compare {
  display: flex;
  gap: 1rem;
  margin: 0.5rem 0;
}

.gp-fswap-compare-item {
  flex: 1;
  text-align: center;
}

.gp-fswap-compare-item p {
  font-size: 0.78rem;
  font-weight: 700;
  margin: 0 0 0.25rem;
  text-transform: uppercase;
  color: var(--text-secondary);
}

.gp-fswap-compare-item img {
  width: 100%;
  border-radius: 6px;
  border: 1px solid var(--border);
}

.gp-fswap-validate-btns {
  display: flex;
  gap: 0.5rem;
  margin-top: 0.5rem;
}

.gp-fswap-validate-btns .btn {
  font-size: 0.82rem;
  padding: 0.4rem 1rem;
}

.gp-fswap-actions {
  margin-top: 0.5rem;
}

/* ── Outil de recadrage manuel ── */

.gp-crop-tool {
  margin-top: 0.75rem;
  border-top: 1px solid var(--border-subtle, #e5e7eb);
  padding-top: 0.75rem;
}

.gp-crop-tool-title {
  font-size: 0.78rem;
  font-weight: 600;
  margin: 0 0 0.5rem;
  color: var(--text);
}

.gp-crop-canvas-wrap {
  position: relative;
  overflow: hidden;
  border-radius: 6px;
  border: 1px solid var(--border);
  cursor: move;
  user-select: none;
  -webkit-user-select: none;
  background: #000;
}

.gp-crop-canvas-wrap img {
  width: 100%;
  display: block;
  pointer-events: none;
}

.gp-crop-overlay {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  pointer-events: none;
}

.gp-crop-dim {
  position: absolute;
  background: rgba(0, 0, 0, 0.45);
}

.gp-crop-rect {
  position: absolute;
  border: 2px solid #fff;
  box-shadow: 0 0 0 1px rgba(0,0,0,0.3), inset 0 0 0 1px rgba(255,255,255,0.2);
  pointer-events: auto;
  cursor: move;
}

.gp-crop-rect::after {
  content: '';
  position: absolute;
  top: 33.33%;
  left: 33.33%;
  width: 33.33%;
  height: 33.33%;
  border: 1px solid rgba(255,255,255,0.3);
  border-top: none;
  border-left: none;
  pointer-events: none;
}

.gp-crop-btns {
  display: flex;
  gap: 0.5rem;
  margin-top: 0.5rem;
  align-items: center;
  flex-wrap: wrap;
}

.gp-crop-btns .btn {
  font-size: 0.78rem;
  padding: 0.35rem 0.5rem;
}

.gp-crop-btns .gp-crop-size-btn,
.gp-crop-btns .btn:last-child {
  flex: 1;
}

.gp-crop-size-btn {
  background: var(--surface-2, #f3f4f6);
  border: 1px solid var(--border, #d1d5db);
  font-weight: 600;
}

.gp-crop-rot-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 2rem;
  height: 2rem;
  padding: 0 !important;
  flex: 0 0 auto !important;
  background: var(--surface-2, #f3f4f6);
  border: 1px solid var(--border, #d1d5db);
}

.gp-crop-rot-value {
  font-size: 0.78rem;
  font-weight: 600;
  min-width: 3rem;
  text-align: center;
  color: var(--text-secondary);
}

.gp-crop-btns-sep {
  width: 1px;
  height: 1.5rem;
  background: var(--border);
  margin: 0 0.25rem;
}

/* Poignées de redimensionnement aux 4 coins */
.gp-crop-handle {
  position: absolute;
  width: 14px;
  height: 14px;
  background: #fff;
  border: 2px solid var(--primary, #2563eb);
  border-radius: 2px;
  z-index: 10;
  pointer-events: auto;
}

.gp-crop-handle-tl { top: -7px; left: -7px; cursor: nwse-resize; }
.gp-crop-handle-tr { top: -7px; right: -7px; cursor: nesw-resize; }
.gp-crop-handle-bl { bottom: -7px; left: -7px; cursor: nesw-resize; }
.gp-crop-handle-br { bottom: -7px; right: -7px; cursor: nwse-resize; }

/* Zone bandeau en bas du rectangle de crop */
.gp-crop-banner {
  position: absolute;
  bottom: 0;
  left: 0;
  right: 0;
  background: repeating-linear-gradient(
    -45deg,
    rgba(37, 99, 235, 0.15),
    rgba(37, 99, 235, 0.15) 4px,
    rgba(37, 99, 235, 0.05) 4px,
    rgba(37, 99, 235, 0.05) 8px
  );
  border-top: 1px dashed rgba(37, 99, 235, 0.6);
  display: flex;
  align-items: center;
  justify-content: center;
  pointer-events: none;
  overflow: hidden;
}

.gp-crop-banner span {
  font-size: 0.65rem;
  font-weight: 600;
  color: rgba(37, 99, 235, 0.8);
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

/* ── Checkbox de sélection sur les photos ── */

.gp-check-wrap {
  position: absolute;
  top: 4px;
  left: 4px;
  z-index: 5;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  width: 22px;
  height: 22px;
  background: rgba(255,255,255,0.85);
  border-radius: 4px;
  box-shadow: 0 1px 3px rgba(0,0,0,0.15);
  opacity: 0;
  transition: opacity 0.15s;
}

.gp-photo-thumb:hover .gp-check-wrap,
.gp-check-wrap:has(.gp-photo-check:checked) {
  opacity: 1;
}

.gp-photo-check {
  width: 15px;
  height: 15px;
  cursor: pointer;
  accent-color: var(--primary, #6c5ce7);
}

.gp-thumb-selected {
  outline: 3px solid var(--primary, #6c5ce7);
  outline-offset: -3px;
  border-radius: 6px;
}

/* ── Drag & drop ── */

.gp-dragging {
  opacity: 0.4;
}

.gp-drop-target {
  outline: 3px dashed var(--primary, #6c5ce7) !important;
  outline-offset: -3px;
  background: rgba(108, 92, 231, 0.04) !important;
}

/* ── Barre d'actions de sélection ── */

.gp-action-bar {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  padding: 0.6rem 0.85rem;
  margin-top: 0.5rem;
  background: var(--primary, #6c5ce7);
  border-radius: 8px;
  color: #fff;
  font-size: 0.82rem;
  animation: gpSlideIn 0.15s ease;
}

@keyframes gpSlideIn {
  from { opacity: 0; transform: translateY(-6px); }
  to { opacity: 1; transform: translateY(0); }
}

.gp-action-bar-count {
  font-weight: 600;
  white-space: nowrap;
}

.gp-move-select {
  font-size: 0.8rem;
  padding: 0.3rem 0.5rem;
  border-radius: 6px;
  border: 1px solid rgba(255,255,255,0.3);
  background: rgba(255,255,255,0.15);
  color: #fff;
  min-width: 160px;
}

.gp-move-select option {
  color: #333;
  background: #fff;
}

.gp-action-bar-clear {
  background: rgba(255,255,255,0.2) !important;
  color: #fff !important;
  border: none !important;
  font-size: 0.78rem !important;
}

.gp-action-bar-clear:hover {
  background: rgba(255,255,255,0.35) !important;
}

.gp-action-bar-delete {
  background: #ef4444 !important;
  color: #fff !important;
  border: none !important;
  font-size: 0.78rem !important;
  display: flex;
  align-items: center;
  gap: 4px;
}

.gp-action-bar-delete:hover {
  background: #dc2626 !important;
}

.gp-btn-adults {
  background: #8b5cf6;
  color: #fff;
  border: none;
  font-weight: 600;
  font-size: 0.78rem;
}

.gp-btn-adults:hover {
  background: #7c3aed;
}

.gp-btn-adults:disabled {
  background: #c4b5fd;
  cursor: default;
}

.gp-btn-generale {
  background: #0891b2;
  color: #fff;
  border: none;
  font-weight: 600;
  font-size: 0.78rem;
}

.gp-btn-generale:hover {
  background: #0e7490;
}

.gp-btn-generale:disabled {
  background: #67e8f9;
  cursor: default;
}

.gp-btn-custom-class {
  background: #f0f2f5;
  color: #374151;
  border: 1px solid var(--border, #e2e8f0);
  font-size: 0.78rem;
}

.gp-btn-custom-class:hover {
  background: #e2e8f0;
}

/* ── Incrustation button & module ── */

.gp-btn-incrustation {
  background: #0ea5e9;
  color: #fff;
  border: none;
  font-weight: 600;
  font-size: 0.78rem;
  display: inline-flex;
  align-items: center;
  gap: 5px;
}

.gp-btn-incrustation:hover {
  background: #0284c7;
}

.gp-incrust-hint {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  font-size: 0.75rem;
  color: #0ea5e9;
  background: #e0f2fe;
  padding: 3px 8px;
  border-radius: 4px;
  cursor: pointer;
  transition: background 0.15s;
}

.gp-incrust-hint:hover {
  background: #bae6fd;
}

.gp-incrust-add-zone {
  border: 2px dashed var(--border, #e2e8f0);
  border-radius: 10px;
  padding: 0.85rem 1.25rem;
  margin-bottom: 1.25rem;
  transition: border-color 0.15s, background 0.15s;
}

.gp-incrust-add-active {
  border-color: #0ea5e9;
  background: #f0f9ff;
}

.gp-incrust-add-row {
  display: flex;
  align-items: center;
  gap: 0.75rem;
}

.gp-incrust-add-hint {
  font-size: 0.8rem;
  color: var(--text-muted, #9ca3af);
}

.gp-incrust-header {
  margin-bottom: 1.5rem;
}

.gp-incrust-title {
  font-size: 1.1rem;
  font-weight: 700;
  color: var(--text, #1f2937);
  margin: 0 0 0.35rem 0;
}

.gp-incrust-desc {
  font-size: 0.85rem;
  color: var(--text-muted, #9ca3af);
  margin: 0;
}

.gp-incrust-card {
  background: var(--card-bg, #fff);
  border: 1px solid var(--border, #e2e8f0);
  border-radius: 10px;
  padding: 1rem 1.25rem;
  margin-bottom: 1rem;
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
}

.gp-incrust-status-done {
  border-color: #86efac;
  background: #f0fdf4;
}

.gp-incrust-status-ready {
  border-color: #93c5fd;
  background: #eff6ff;
}

.gp-incrust-card-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.gp-incrust-card-info {
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.gp-incrust-hint-badge {
  font-size: 0.72rem;
  background: #e0f2fe;
  color: #0369a1;
  padding: 2px 6px;
  border-radius: 3px;
  font-weight: 500;
}

.gp-incrust-date {
  font-size: 0.72rem;
  color: var(--text-muted, #9ca3af);
}

.gp-tag-ready {
  background: #dbeafe;
  color: #1d4ed8;
}

.gp-incrust-label {
  display: block;
  font-size: 0.78rem;
  font-weight: 600;
  color: var(--text-secondary, #6b7280);
  margin-bottom: 0.35rem;
}

.gp-incrust-thumbs {
  display: flex;
  gap: 0.5rem;
  flex-wrap: wrap;
}

.gp-incrust-photos-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
  gap: 0.75rem;
}

.gp-incrust-photo-card {
  background: var(--bg-secondary, #f8fafc);
  border: 2px solid var(--border, #e2e8f0);
  border-radius: 10px;
  overflow: hidden;
  transition: border-color 0.15s, box-shadow 0.15s;
}

.gp-incrust-photo-card:hover {
  border-color: #93c5fd;
}

.gp-incrust-photo-selected {
  border-color: #0ea5e9;
  box-shadow: 0 0 0 3px rgba(14, 165, 233, 0.25);
}

.gp-incrust-photo-img {
  width: 100%;
  aspect-ratio: 4 / 3;
  object-fit: cover;
  cursor: zoom-in;
  display: block;
}

.gp-incrust-photo-actions {
  padding: 0.5rem 0.65rem;
  display: flex;
  flex-direction: column;
  gap: 0.35rem;
}

.gp-incrust-photo-name {
  font-size: 0.7rem;
  color: var(--text-muted, #9ca3af);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.gp-incrust-photo-btns {
  display: flex;
  gap: 0.5rem;
  align-items: center;
  flex-wrap: wrap;
}

.gp-btn-select-photo {
  background: #0ea5e9;
  color: #fff;
  border: none;
  font-weight: 600;
  font-size: 0.75rem;
}

.gp-btn-select-photo:hover {
  background: #0284c7;
}

.gp-incrust-selected-badge {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  font-size: 0.75rem;
  font-weight: 600;
  color: #16a34a;
  background: #dcfce7;
  padding: 3px 8px;
  border-radius: 4px;
}

/* Incrustation viewer (lightbox) */

.gp-incrust-viewer-backdrop {
  position: fixed;
  inset: 0;
  z-index: 10000;
  background: rgba(0, 0, 0, 0.85);
  display: flex;
  align-items: center;
  justify-content: center;
}

.gp-incrust-viewer {
  position: relative;
  max-width: 92vw;
  max-height: 92vh;
  display: flex;
  flex-direction: column;
  align-items: center;
}

.gp-incrust-viewer-img {
  max-width: 90vw;
  max-height: 82vh;
  object-fit: contain;
  border-radius: 6px;
  box-shadow: 0 8px 40px rgba(0, 0, 0, 0.5);
}

.gp-incrust-viewer-close {
  position: absolute;
  top: -12px;
  right: -12px;
  width: 36px;
  height: 36px;
  border-radius: 50%;
  background: #1f2937;
  color: #fff;
  border: 2px solid #374151;
  font-size: 1.3rem;
  line-height: 1;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 2;
}

.gp-incrust-viewer-close:hover {
  background: #ef4444;
  border-color: #ef4444;
}

.gp-incrust-viewer-info {
  display: flex;
  gap: 1rem;
  align-items: center;
  margin-top: 0.75rem;
  color: rgba(255, 255, 255, 0.8);
  font-size: 0.82rem;
}

.gp-incrust-viewer-counter {
  color: rgba(255, 255, 255, 0.5);
  font-size: 0.75rem;
}

.gp-incrust-viewer-nav {
  position: absolute;
  top: 50%;
  transform: translateY(-50%);
  width: 44px;
  height: 44px;
  border-radius: 50%;
  background: rgba(31, 41, 55, 0.8);
  color: #fff;
  border: 1px solid rgba(255, 255, 255, 0.15);
  font-size: 1.6rem;
  line-height: 1;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
}

.gp-incrust-viewer-nav:hover {
  background: rgba(14, 165, 233, 0.8);
}

.gp-incrust-viewer-prev {
  left: -56px;
}

.gp-incrust-viewer-next {
  right: -56px;
}

.gp-incrust-class-select {
  max-width: 300px;
  font-size: 0.82rem;
}

.gp-incrust-target-name {
  font-weight: 600;
  color: var(--text, #1f2937);
  font-size: 0.9rem;
}

.gp-incrust-dl-row {
  display: flex;
  gap: 0.75rem;
  flex-wrap: wrap;
}

.gp-btn-dl {
  background: #f0f9ff;
  color: #0369a1;
  border: 1px solid #bae6fd;
  display: inline-flex;
  align-items: center;
  gap: 5px;
  font-size: 0.82rem;
  font-weight: 500;
  text-decoration: none;
}

.gp-btn-dl:hover {
  background: #e0f2fe;
  color: #075985;
}

.gp-incrust-upload-row {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  flex-wrap: wrap;
}

.gp-incrust-file-input {
  font-size: 0.82rem;
}

.gp-btn-upload-incrust {
  background: #16a34a;
  color: #fff;
  border: none;
  font-weight: 600;
  font-size: 0.82rem;
}

.gp-btn-upload-incrust:hover {
  background: #15803d;
}

.gp-btn-upload-incrust:disabled {
  background: #86efac;
  cursor: not-allowed;
}

.gp-incrust-drop-hint {
  margin-top: 0.5rem;
  padding: 0.75rem;
  border: 2px dashed var(--border, #e2e8f0);
  border-radius: 8px;
  text-align: center;
  font-size: 0.8rem;
  color: var(--text-muted, #9ca3af);
  transition: border-color 0.15s, background 0.15s;
}

.gp-incrust-drop-active {
  border-color: #0ea5e9;
  background: #f0f9ff;
  color: #0369a1;
}

.gp-incrust-done {
  text-align: center;
  padding: 0.5rem 0;
}

.gp-incrust-done-badge {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  background: #dcfce7;
  color: #16a34a;
  padding: 6px 14px;
  border-radius: 6px;
  font-size: 0.85rem;
  font-weight: 600;
  margin-bottom: 0.75rem;
}

.gp-incrust-done-preview {
  max-width: 300px;
  border-radius: 8px;
  border: 1px solid var(--border, #e2e8f0);
  margin-bottom: 0.5rem;
}

.gp-incrust-done-info {
  font-size: 0.82rem;
  color: var(--text-secondary, #6b7280);
  margin: 0.25rem 0;
}

.gp-incrust-done-hint {
  font-size: 0.75rem;
  color: var(--text-muted, #9ca3af);
  margin: 0.25rem 0 0 0;
}

.gp-incrust-slate {
  background: #fffbeb;
  border: 1px solid #fde68a;
  border-radius: 8px;
  padding: 0.75rem;
}

.gp-incrust-slate-img {
  max-width: 400px;
  max-height: 260px;
  border-radius: 6px;
  border: 2px solid #fbbf24;
  margin-top: 0.5rem;
  object-fit: contain;
  cursor: zoom-in;
}

.gp-incrust-ocr {
  display: inline-block;
  margin-left: 0.75rem;
  font-size: 0.82rem;
  color: #92400e;
  background: #fef3c7;
  padding: 2px 8px;
  border-radius: 4px;
}

.gp-incrust-ocr-match {
  display: inline-block;
  margin-left: 0.5rem;
  font-size: 0.82rem;
  color: #065f46;
  background: #d1fae5;
  padding: 2px 8px;
  border-radius: 4px;
}

.sub-nav-badge {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 18px;
  height: 18px;
  padding: 0 4px;
  border-radius: 9px;
  background: #ef4444;
  color: #fff;
  font-size: 0.65rem;
  font-weight: 700;
  margin-left: 4px;
}

.gp-btn-unslate {
  background: #fef3c7;
  color: #92400e;
  border: 1px solid #fbbf24;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: 0.78rem;
}

.gp-btn-unslate:hover {
  background: #fde68a;
  color: #78350f;
}

.gp-modal-move-row {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  flex-wrap: wrap;
}

.gp-modal-move-label {
  font-size: 0.85rem;
  font-weight: 500;
  color: var(--text-secondary, #6b7280);
  white-space: nowrap;
}

.gp-incrust-header-btns {
  display: flex;
  align-items: center;
  gap: 6px;
}

.gp-btn-restore-bruts {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  background: #eff6ff;
  color: #2563eb;
  border: 1px solid #93c5fd;
  font-size: 0.76rem;
  font-weight: 500;
  padding: 4px 10px;
  border-radius: 6px;
  cursor: pointer;
  transition: background 0.12s ease, border-color 0.12s ease;
  white-space: nowrap;
}

.gp-btn-restore-bruts:hover {
  background: #dbeafe;
  border-color: #60a5fa;
  color: #1d4ed8;
}

.gp-btn-delete {
  background: #fee2e2;
  color: #dc2626;
  border: 1px solid #fca5a5;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: 0.82rem;
  margin-top: 0.25rem;
}

.gp-btn-delete:hover {
  background: #fecaca;
  color: #b91c1c;
}

.gp-btn-selected-ok {
  background: #16a34a !important;
  color: #fff !important;
  border-color: #15803d !important;
  cursor: default;
}

.gp-seq-actions {
  display: flex;
  gap: 0.75rem;
  align-items: center;
  flex-wrap: wrap;
  padding-top: 0.5rem;
  border-top: 1px solid var(--border-subtle, #e5e7eb);
}

.gp-class-select {
  max-width: 240px;
  font-size: 0.82rem;
  padding: 0.3rem 0.5rem;
}

.gp-validated {
  display: inline-flex;
  align-items: center;
  gap: 0.3rem;
  color: #16a34a;
  font-weight: 600;
  font-size: 0.85rem;
}

/* ── Dropzone GR Brut ── */

.gp-dropzone {
  border: 2px dashed var(--border, #d1d5db);
  border-radius: 10px;
  padding: 2rem;
  text-align: center;
  transition: border-color 0.2s, background 0.2s;
  cursor: default;
  margin-bottom: 1rem;
  position: relative;
}

.gp-dropzone.gp-dropzone-compact {
  padding: 0.65rem 1rem;
}

.gp-dropzone.gp-dragover {
  border-color: var(--primary, #3b82f6);
  background: rgba(59, 130, 246, 0.06);
}

.gp-dropzone-content {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.4rem;
}

.gp-dropzone-content.gp-dropzone-row {
  flex-direction: row;
  justify-content: center;
  flex-wrap: wrap;
  gap: 0.5rem;
}

.gp-dropzone-text {
  font-size: 0.95rem;
  color: var(--text-muted);
  margin: 0;
}

.gp-dropzone-hint {
  font-size: 0.82rem;
  color: var(--text-muted);
  margin: 0;
}

.gp-dropzone-info {
  font-size: 0.85rem;
  font-weight: 600;
  color: var(--text);
}

.gp-dropzone-link {
  color: var(--primary, #3b82f6);
  text-decoration: none;
  font-weight: 500;
  font-size: 0.82rem;
  cursor: pointer;
}

.gp-dropzone-link:hover {
  text-decoration: underline;
}

.gp-dropzone-sep {
  color: var(--border, #d1d5db);
  font-size: 0.75rem;
}

.gp-dropzone-progress {
  text-align: center;
}

.gp-dropzone-filename {
  font-weight: 600;
  font-size: 0.9rem;
  margin: 0 0 0.5rem;
}

.gp-dropzone-status {
  font-size: 0.82rem;
  color: var(--text-muted);
  margin: 0.5rem 0 0;
}

.gp-dropzone-status.gp-status-ok {
  color: #16a34a;
  font-weight: 600;
}

.gp-dropzone-status.gp-status-error {
  color: #ef4444;
  font-weight: 600;
}

/* ═══════════════════════════════════════════════ */
/*  ARBO – Arborescence de livraison               */
/* ═══════════════════════════════════════════════ */

.arbo-container {
  padding: 0;
}

.arbo-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  margin-bottom: 1.25rem;
  flex-wrap: wrap;
}

.arbo-stats {
  display: flex;
  gap: 1.5rem;
  flex-wrap: wrap;
}

.arbo-stat {
  font-size: 0.88rem;
  color: var(--text-muted);
}

.arbo-stat strong {
  color: var(--text);
  font-weight: 700;
}

.arbo-empty {
  text-align: center;
  padding: 3rem 1rem;
  color: var(--text-muted);
}

.arbo-empty-title {
  font-size: 1.05rem;
  font-weight: 600;
  margin: 0.75rem 0 0.25rem;
  color: var(--text);
}

.arbo-empty-hint {
  font-size: 0.85rem;
  max-width: 400px;
  margin: 0 auto;
}

.arbo-folder {
  background: var(--card-bg);
  border: 1px solid var(--border);
  border-radius: 0.75rem;
  margin-bottom: 0.75rem;
  overflow: hidden;
}

.arbo-folder-header {
  display: flex;
  align-items: center;
  gap: 0.65rem;
  padding: 0.85rem 1rem;
  background: var(--bg-alt, #f8f9fb);
  border-bottom: 1px solid var(--border);
  transition: background 0.15s;
  user-select: none;
}

.arbo-folder-header:hover {
  background: var(--hover-bg, #f0f1f5);
}

.arbo-folder-header.collapsed {
  border-bottom: none;
}

.arbo-folder-icon {
  display: flex;
  align-items: center;
  color: #059669;
}

.arbo-folder-icon svg {
  stroke: #059669;
  fill: rgba(5, 150, 105, 0.08);
}

.arbo-folder-name {
  font-size: 0.95rem;
  font-weight: 600;
  margin: 0;
  flex: 1;
}

.arbo-folder-count {
  font-size: 0.8rem;
  color: var(--text-muted);
  white-space: nowrap;
}

.arbo-folder-content {
  padding: 0.75rem 1rem 1rem;
  overflow: hidden;
  max-height: 5000px;
  transition: max-height 0.3s ease, padding 0.3s ease, opacity 0.2s ease;
  opacity: 1;
}

.arbo-folder-content.collapsed {
  max-height: 0;
  padding-top: 0;
  padding-bottom: 0;
  opacity: 0;
}

.arbo-subsection-title {
  display: flex;
  align-items: center;
  gap: 0.4rem;
  font-size: 0.82rem;
  font-weight: 600;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.03em;
  margin: 0.75rem 0 0.5rem;
  padding-bottom: 0.35rem;
  border-bottom: 1px solid var(--border);
}

.arbo-subsection-title:first-child {
  margin-top: 0;
}

.arbo-photo-grid {
  display: grid;
  gap: 0.75rem;
}

.arbo-group-grid {
  grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
}

.arbo-photo-card {
  border-radius: 0.5rem;
  overflow: hidden;
  border: 1px solid var(--border);
  background: var(--card-bg);
}

.arbo-photo-card img {
  width: 100%;
  display: block;
  object-fit: cover;
  aspect-ratio: 4/3;
}

.arbo-group-card img {
  aspect-ratio: 4/3;
}

.arbo-photo-name {
  font-size: 0.78rem;
  color: var(--text-muted);
  padding: 0.35rem 0.5rem;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.arbo-students-list {
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
}

.arbo-student-row {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  padding: 0.4rem 0;
  border-bottom: 1px solid var(--border);
}

.arbo-student-row:last-child {
  border-bottom: none;
}

.arbo-student-label {
  min-width: 140px;
  flex-shrink: 0;
}

.arbo-student-name {
  font-size: 0.88rem;
  font-weight: 500;
  display: block;
}

.arbo-student-num {
  font-size: 0.75rem;
  color: var(--text-muted);
}

.arbo-student-imgs {
  display: flex;
  gap: 0.5rem;
  overflow-x: auto;
  flex: 1;
}

.arbo-student-thumb {
  flex-shrink: 0;
  width: 80px;
  text-align: center;
}

.arbo-student-thumb img {
  width: 80px;
  height: 107px;
  object-fit: cover;
  border-radius: 0.35rem;
  border: 1px solid var(--border);
  display: block;
}

.arbo-thumb-suffix {
  font-size: 0.68rem;
  color: var(--text-muted);
  display: block;
  margin-top: 0.15rem;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.arbo-photo-type {
  font-size: 0.72rem;
  color: var(--text-muted);
  margin-left: 0.3rem;
  font-style: italic;
}

.arbo-folder-empty {
  font-size: 0.85rem;
  color: var(--text-muted);
  padding: 1rem 0;
  text-align: center;
  font-style: italic;
}

@media (max-width: 768px) {
  .arbo-header {
    flex-direction: column;
    align-items: flex-start;
  }
  .arbo-student-label {
    min-width: 100px;
  }
  .arbo-student-thumb {
    width: 60px;
  }
  .arbo-student-thumb img {
    width: 60px;
    height: 80px;
  }
}

/* ═══════════════════════════════════════════════
   Face Retouch Module
   ═══════════════════════════════════════════════ */

.gp-retouch-wrap {
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
}

.gp-retouch-header h4 {
  margin: 0 0 0.25rem;
  font-size: 1rem;
  font-weight: 600;
}

.gp-retouch-header p {
  margin: 0;
  font-size: 0.8rem;
  color: var(--text-muted);
}

.gp-retouch-canvas-outer {
  position: relative;
}

.gp-retouch-canvas-wrap {
  position: relative;
  background: #111;
  border-radius: 0.5rem;
  overflow: hidden;
  cursor: default;
}

.gp-retouch-canvas-zoomable {
  overflow: auto;
  max-height: 70vh;
}

.gp-retouch-zoom-container {
  position: relative;
  min-width: 100%;
}

.gp-retouch-zoom-indicator {
  position: absolute;
  bottom: 0.75rem;
  left: 50%;
  transform: translateX(-50%);
  background: rgba(0, 0, 0, 0.75);
  color: #fff;
  font-size: 0.75rem;
  font-weight: 600;
  padding: 0.25rem 0.7rem;
  border-radius: 1rem;
  pointer-events: none;
  opacity: 0;
  transition: opacity 0.3s ease;
  z-index: 20;
  min-height: 300px;
}

.gp-retouch-target {
  display: block;
  width: 100%;
  height: auto;
  user-select: none;
  -webkit-user-drag: none;
  pointer-events: none;
}

.gp-retouch-face-overlay {
  position: absolute;
  cursor: grab;
  overflow: hidden;
  z-index: 10;
  transition: opacity 0.1s;
  border: 2px dashed rgba(34, 197, 94, 0.7);
  border-radius: 50%;
}

.gp-retouch-face-overlay img {
  display: block;
  user-select: none;
  -webkit-user-drag: none;
  pointer-events: none;
  max-width: none;
}

.gp-retouch-controls {
  display: flex;
  flex-wrap: wrap;
  gap: 1rem;
  align-items: center;
  padding: 0.5rem 0;
}

.gp-retouch-control {
  display: flex;
  align-items: center;
  gap: 0.4rem;
  font-size: 0.8rem;
}

.gp-retouch-control label {
  font-weight: 500;
  min-width: 60px;
  white-space: nowrap;
}

.gp-retouch-control input[type="range"] {
  width: 100px;
  accent-color: #2563eb;
}

.gp-retouch-val {
  font-size: 0.75rem;
  color: var(--text-muted);
  min-width: 35px;
  text-align: right;
}

.gp-retouch-buttons {
  display: flex;
  gap: 0.5rem;
  margin-left: auto;
}

.gp-retouch-status {
  min-height: 1rem;
}

/* HD pop-in overlay */
.gp-hd-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.9);
  z-index: 10000;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: zoom-out;
}

.gp-hd-content {
  position: relative;
  max-width: 96vw;
  max-height: 96vh;
}

.gp-hd-content img {
  max-width: 96vw;
  max-height: 96vh;
  object-fit: contain;
  border-radius: 0.5rem;
  cursor: default;
}

.gp-hd-close {
  position: absolute;
  top: -12px;
  right: -12px;
  width: 36px;
  height: 36px;
  border-radius: 50%;
  border: none;
  background: #fff;
  color: #111;
  font-size: 1.3rem;
  font-weight: 700;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 2px 8px rgba(0,0,0,0.3);
  z-index: 10001;
}

/* ═══════════════════════════════════════════════
   Groupes — Onglet Colorimétrie (Grid + MCE)
   ═══════════════════════════════════════════════ */

.gp-color-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(240px, 1fr));
  gap: 0.75rem;
  margin-top: 0.75rem;
}

.gp-color-card {
  position: relative;
  background: var(--card-bg);
  border: 2px solid var(--border);
  border-radius: var(--radius-sm);
  overflow: hidden;
  cursor: pointer;
  transition: border-color 0.15s ease, box-shadow 0.15s ease, transform 0.15s ease;
}

.gp-color-card:hover {
  border-color: var(--primary);
  box-shadow: 0 4px 16px rgba(0, 0, 0, 0.12);
  transform: translateY(-2px);
}

.gp-color-card img {
  width: 100%;
  aspect-ratio: 3/2;
  object-fit: cover;
  display: block;
  background: #f0f0f0;
}

.gp-color-card-info {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 0.4rem 0.6rem;
  gap: 0.5rem;
}

.gp-color-card-name {
  font-size: 0.8rem;
  font-weight: 600;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  flex: 1;
}

.gp-color-card-type {
  font-size: 0.72rem;
  color: var(--text-muted);
  flex-shrink: 0;
}

.gp-mce-back {
  display: inline-flex;
  align-items: center;
  gap: 0.25rem;
  font-weight: 500;
}

.gp-mce-nav-sep {
  width: 1px;
  height: 1.2rem;
  background: var(--border);
  margin: 0 0.25rem;
}

@media (min-width: 1400px) {
  .gp-color-grid {
    grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
  }
}

@media (max-width: 768px) {
  .gp-color-grid {
    grid-template-columns: repeat(auto-fill, minmax(160px, 1fr));
    gap: 0.4rem;
  }
}

.gp-mce-editor {
  background: var(--card-bg, #fff);
  border-radius: 0.75rem;
  border: 1px solid var(--border, #e2e8f0);
  overflow: hidden;
  width: calc(100vw - var(--sidebar-w) - 4rem);
}

.gp-mce-nav {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.75rem 1rem;
  border-bottom: 1px solid var(--border, #e2e8f0);
  background: var(--surface, #f8fafc);
}

.gp-mce-counter {
  font-weight: 600;
  font-size: 0.9rem;
  min-width: 60px;
  text-align: center;
}

.gp-mce-photo-name {
  margin-left: auto;
  font-size: 0.85rem;
  color: var(--text-muted, #64748b);
  font-weight: 500;
}

.gp-mce-body {
  display: flex;
  gap: 0;
  min-height: 0;
  height: calc(85vh - 160px);
}

.gp-mce-images {
  flex: 1;
  display: flex;
  gap: 0;
  min-width: 0;
  min-height: 0;
  overflow: hidden;
}

.gp-mce-img-col {
  flex: 1;
  display: flex;
  flex-direction: column;
  min-width: 0;
  min-height: 0;
  border-right: 1px solid var(--border, #e2e8f0);
}

.gp-mce-img-col:last-child {
  border-right: none;
}

.gp-mce-img-label {
  display: block;
  text-align: center;
  font-size: 0.75rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--text-muted, #64748b);
  padding: 0.35rem 0;
  border-bottom: 1px solid var(--border, #e2e8f0);
}

.gp-mce-img-viewport {
  flex: 1;
  position: relative;
  overflow: hidden;
  background: #111;
  cursor: grab;
  height: 100%;
}

.gp-mce-img-viewport.grabbing {
  cursor: grabbing;
}

.gp-mce-img-viewport img {
  position: absolute;
  transform-origin: 0 0;
  max-width: none;
  user-select: none;
  -webkit-user-drag: none;
}

.gp-mce-loading {
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  color: rgba(255,255,255,0.6);
  font-size: 0.85rem;
  pointer-events: none;
}

.gp-mce-controls {
  width: 280px;
  flex-shrink: 0;
  padding: 1rem;
  overflow-y: auto;
  border-left: 1px solid var(--border, #e2e8f0);
}

.gp-mce-controls h4 {
  margin: 0.75rem 0 0.35rem;
  font-size: 0.8rem;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  color: var(--text-muted, #64748b);
}

.gp-mce-controls h4:first-child {
  margin-top: 0;
}

.gp-mce-histogram-wrap {
  margin: 0.5rem 0;
}

.gp-mce-histogram-wrap canvas {
  display: block;
  width: 100%;
  border-radius: 4px;
  cursor: pointer;
}

.gp-mce-footer {
  display: flex;
  flex-wrap: wrap;
  gap: 0.75rem;
  padding: 0.75rem 1rem;
  border-top: 1px solid var(--border, #e2e8f0);
  background: var(--surface, #f8fafc);
  justify-content: flex-end;
  align-items: center;
}

.gp-mce-progress {
  width: 100%;
  order: 1;
}

.gp-mce-progress .progress-wrap {
  gap: 0.5rem;
}

.gp-mce-progress .progress-bar {
  flex: 1;
  height: 6px;
  background: var(--bg-dark, #e2e8f0);
  border-radius: 99px;
  overflow: hidden;
}

.gp-mce-progress .progress-fill {
  height: 100%;
  background: var(--primary, #6366f1);
  border-radius: 99px;
  transition: width 0.3s ease;
}

.gp-mce-progress-msg {
  display: block;
  font-size: 0.75rem;
  color: var(--text-muted, #94a3b8);
  margin-top: 0.25rem;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

/* ═══════════════════════════════════════════════
   Groupes — Onglet Bandeau
   ═══════════════════════════════════════════════ */

.gp-bandeau-editor {
  background: var(--card-bg, #fff);
  border-radius: 0.75rem;
  border: 1px solid var(--border, #e2e8f0);
  overflow: hidden;
  width: calc(100vw - var(--sidebar-w) - 4rem);
}

.gp-bandeau-body {
  display: flex;
  gap: 0;
  height: calc(80vh - 160px);
  min-height: 400px;
}

.gp-bandeau-preview-col {
  flex: 1;
  display: flex;
  flex-direction: column;
  min-width: 0;
  min-height: 0;
}

.gp-bandeau-preview-viewport {
  flex: 1;
  position: relative;
  overflow: hidden;
  background: #111;
  display: flex;
  align-items: center;
  justify-content: center;
}

.gp-bn-preview-img {
  max-width: 100%;
  max-height: 100%;
  object-fit: contain;
}

.gp-bn-loading {
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  color: #fff;
  font-size: 0.9rem;
  background: rgba(0,0,0,0.4);
}

.gp-bandeau-controls {
  width: 320px;
  flex-shrink: 0;
  padding: 1rem 1.25rem;
  overflow-y: auto;
  border-left: 1px solid var(--border, #e2e8f0);
}

.gp-bandeau-controls h4 {
  margin: 0 0 0.75rem;
  font-size: 0.95rem;
  font-weight: 600;
}

.gp-bn-row-2col {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 0.75rem;
}

.gp-bn-field {
  margin-bottom: 0.75rem;
}

.gp-bn-field label {
  display: block;
  font-size: 0.82rem;
  font-weight: 500;
  color: var(--text-muted, #64748b);
  margin-bottom: 0.25rem;
}

.gp-bn-input {
  width: 100%;
  padding: 0.45rem 0.6rem;
  border: 1px solid var(--border, #e2e8f0);
  border-radius: 0.4rem;
  font-size: 0.88rem;
  font-family: inherit;
  background: var(--bg, #fff);
  color: var(--text, #1e293b);
}

.gp-bn-input:focus {
  outline: none;
  border-color: var(--primary, #6366f1);
  box-shadow: 0 0 0 2px rgba(99,102,241,0.15);
}

.gp-bn-color-row {
  display: flex;
  align-items: center;
  gap: 0.6rem;
}

.gp-bn-color-row input[type="color"] {
  width: 40px;
  height: 32px;
  border: 1px solid var(--border, #e2e8f0);
  border-radius: 0.4rem;
  cursor: pointer;
  padding: 2px;
}

.gp-bn-color-hex,
.gp-bn-text-color-hex {
  font-size: 0.82rem;
  color: var(--text-muted, #64748b);
  font-family: monospace;
}

.gp-bn-text-preview {
  padding: 0.5rem 0.75rem;
  background: var(--bg, #f1f5f9);
  border-radius: 0.4rem;
  font-size: 0.82rem;
  font-weight: 500;
  color: var(--text, #1e293b);
  word-break: break-word;
  min-height: 1.5rem;
}

.gp-bn-font-upload-row {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  flex-wrap: wrap;
}

.gp-bn-font-browse {
  display: inline-flex;
  align-items: center;
  gap: 0.3rem;
  font-size: 0.8rem;
}

.gp-bn-font-status {
  font-size: 0.78rem;
  color: var(--text-muted, #64748b);
}

.gp-bandeau-footer {
  display: flex;
  gap: 0.75rem;
  padding: 0.75rem 1rem;
  border-top: 1px solid var(--border, #e2e8f0);
  background: var(--surface, #f8fafc);
  justify-content: flex-end;
}

/* ═══════════════════════════════════════════════
   Groupes — Onglet Groupes OK
   ═══════════════════════════════════════════════ */

.gp-ok-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
  gap: 1.25rem;
  margin-top: 1rem;
}

.gp-ok-card {
  background: var(--card-bg, #fff);
  border: 1px solid var(--border, #e2e8f0);
  border-radius: 0.75rem;
  overflow: hidden;
  transition: box-shadow 0.15s ease;
}

.gp-ok-card:hover {
  box-shadow: 0 4px 12px rgba(0,0,0,0.08);
}

.gp-ok-img-wrap {
  width: 100%;
  background: #f1f5f9;
}

.gp-ok-img-wrap img {
  width: 100%;
  display: block;
}

.gp-ok-info {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.6rem 0.75rem;
  font-size: 0.85rem;
}

.gp-ok-info strong {
  flex: 1;
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.gp-ok-type {
  font-size: 0.7rem;
  font-weight: 600;
  text-transform: uppercase;
  padding: 0.15rem 0.4rem;
  border-radius: 4px;
  background: #e0f2fe;
  color: #0369a1;
}

.gp-ok-type-grimace {
  background: #fef3c7;
  color: #92400e;
}

/* ── Visionneuse Groupes OK ── */

.gp-ok-viewer-backdrop {
  position: fixed;
  inset: 0;
  z-index: 9999;
  background: rgba(0,0,0,0.92);
  display: flex;
  align-items: center;
  justify-content: center;
  animation: fadeIn 0.15s ease;
}

.gp-ok-viewer-close {
  position: absolute;
  top: 1rem;
  right: 1.25rem;
  background: none;
  border: none;
  color: #fff;
  font-size: 2rem;
  cursor: pointer;
  z-index: 10;
  line-height: 1;
  opacity: 0.7;
  transition: opacity 0.15s;
}
.gp-ok-viewer-close:hover { opacity: 1; }

.gp-ok-viewer-nav {
  position: absolute;
  top: 50%;
  transform: translateY(-50%);
  background: rgba(255,255,255,0.1);
  border: none;
  color: #fff;
  cursor: pointer;
  padding: 1rem 0.6rem;
  border-radius: 0.5rem;
  z-index: 10;
  opacity: 0.6;
  transition: opacity 0.15s, background 0.15s;
}
.gp-ok-viewer-nav:hover {
  opacity: 1;
  background: rgba(255,255,255,0.2);
}
.gp-ok-viewer-nav-left { left: 1rem; }
.gp-ok-viewer-nav-right { right: 1rem; }

.gp-ok-viewer-img-wrap {
  max-width: 92vw;
  max-height: 82vh;
  display: flex;
  align-items: center;
  justify-content: center;
}

.gp-ok-viewer-img {
  max-width: 100%;
  max-height: 82vh;
  object-fit: contain;
  border-radius: 0.25rem;
  box-shadow: 0 8px 32px rgba(0,0,0,0.5);
}

.gp-ok-viewer-bottom {
  position: absolute;
  bottom: 0;
  left: 0;
  right: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 1.5rem;
  padding: 0.75rem 2rem;
  background: linear-gradient(transparent, rgba(0,0,0,0.6));
  color: #fff;
  font-size: 0.88rem;
}

.gp-ok-viewer-counter {
  font-weight: 600;
  font-size: 0.82rem;
  opacity: 0.8;
}

.gp-ok-viewer-label {
  font-weight: 500;
}

.gp-ok-viewer-dl {
  color: #fff !important;
  border-color: rgba(255,255,255,0.3) !important;
}
.gp-ok-viewer-dl:hover {
  background: rgba(255,255,255,0.15) !important;
}

/* ═══════════════════════════════════════════════
   Groupes — Onglet Recadrage batch
   ═══════════════════════════════════════════════ */

.gp-batch-crop-counter {
  font-size: 0.85rem;
  font-weight: 600;
  color: var(--text-muted, #64748b);
  margin-left: auto;
  margin-right: 0.75rem;
}

.gp-batch-crop-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(420px, 1fr));
  gap: 1.25rem;
  margin-top: 1rem;
}

.gp-batch-crop-card {
  background: var(--card-bg, #fff);
  border: 2px solid var(--border, #e2e8f0);
  border-radius: 0.75rem;
  overflow: hidden;
  cursor: pointer;
  transition: border-color 0.15s ease, box-shadow 0.15s ease;
}

.gp-batch-crop-card:hover {
  border-color: var(--primary, #2563eb);
  box-shadow: 0 4px 12px rgba(37, 99, 235, 0.12);
}

.gp-batch-crop-card.gp-batch-crop-ok {
  border-color: #22c55e;
}

.gp-batch-crop-card.gp-batch-crop-modified {
  border-color: #f59e0b;
}

.gp-batch-crop-card.gp-batch-crop-todo {
  border-color: #ef4444;
}

.gp-batch-crop-img {
  position: relative;
  width: 100%;
  aspect-ratio: 4/3;
  overflow: hidden;
  background: #f1f5f9;
}

.gp-batch-crop-img.gp-batch-crop-img-full {
  aspect-ratio: auto;
}

.gp-batch-crop-img img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.gp-batch-crop-img-full img {
  width: 100%;
  height: auto;
  object-fit: contain;
  display: block;
}

.gp-batch-crop-preview-overlay {
  position: absolute;
  box-shadow: 0 0 0 9999px rgba(0, 0, 0, 0.45);
  border: 2px solid rgba(255, 255, 255, 0.85);
  pointer-events: none;
  z-index: 1;
}

.gp-batch-crop-preview-banner {
  position: absolute;
  bottom: 0;
  left: 0;
  width: 100%;
  background: rgba(255, 255, 255, 0.55);
  border-top: 1px dashed rgba(255, 255, 255, 0.8);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 0.55rem;
  color: rgba(255, 255, 255, 0.9);
  text-transform: uppercase;
  letter-spacing: 0.05em;
  font-weight: 600;
}

.gp-batch-crop-badge {
  position: absolute;
  top: 0.4rem;
  right: 0.4rem;
  font-size: 0.65rem;
  font-weight: 700;
  text-transform: uppercase;
  padding: 0.15rem 0.45rem;
  border-radius: 4px;
  letter-spacing: 0.03em;
}

.gp-batch-badge-ok {
  background: #dcfce7;
  color: #15803d;
}

.gp-batch-badge-todo {
  background: #fee2e2;
  color: #b91c1c;
}

.gp-batch-crop-card.gp-batch-crop-modified .gp-batch-crop-badge {
  background: #fef3c7;
  color: #92400e;
}

.gp-batch-crop-info {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.5rem 0.75rem;
  font-size: 0.85rem;
}

.gp-batch-crop-info strong {
  flex: 1;
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.gp-batch-crop-type {
  font-size: 0.7rem;
  font-weight: 600;
  text-transform: uppercase;
  padding: 0.1rem 0.35rem;
  border-radius: 4px;
  background: #e0f2fe;
  color: #0369a1;
  flex-shrink: 0;
}

/* Batch crop editor */
.gp-batch-crop-editor {
  margin-top: 1rem;
}

.gp-batch-crop-nav {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.5rem 0;
  margin-bottom: 0.5rem;
}

.gp-batch-crop-nav-counter {
  font-weight: 600;
  font-size: 0.9rem;
  min-width: 50px;
  text-align: center;
}

.gp-batch-crop-nav-label {
  margin-left: auto;
  font-size: 0.85rem;
  color: var(--text-muted, #64748b);
  font-weight: 500;
}

.gp-batch-crop-canvas {
  max-height: 70vh;
}

/* ==========================================================================
   SCRIPTS PAGE
   ========================================================================== */

.scripts-separator {
  border: none;
  border-top: 1px solid var(--border);
  margin: 2rem 0 1rem;
}
.scripts-section-title {
  font-size: 1.15rem;
  font-weight: 600;
  color: var(--text);
  margin-bottom: 1rem;
}

.scripts-actions-bar {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  margin-bottom: 1.25rem;
  flex-wrap: wrap;
}

.scripts-progress-bar {
  margin-bottom: 1.25rem;
  display: flex;
  align-items: center;
  gap: 1rem;
}
.scripts-progress-bar .progress {
  flex: 1;
  height: 8px;
  background: var(--bg-dark);
  border-radius: 4px;
  overflow: hidden;
}
.scripts-progress-bar .progress-fill {
  height: 100%;
  background: var(--primary);
  border-radius: 4px;
  transition: width 0.3s ease;
  width: 0%;
}
.scripts-progress-text {
  font-size: 0.85rem;
  color: var(--text-secondary);
  white-space: nowrap;
}

/* -- Folders grid -- */
.scripts-folders-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
  gap: 1rem;
}
.scripts-folder-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 1rem;
  box-shadow: var(--shadow-sm);
}
.scripts-folder-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 0.25rem;
}
.scripts-folder-header h4 {
  font-size: 1rem;
  font-weight: 700;
  color: var(--primary);
}
.scripts-folder-count {
  font-size: 0.8rem;
  color: var(--text-muted);
  background: var(--primary-light);
  padding: 2px 8px;
  border-radius: 10px;
}
.scripts-folder-name {
  font-size: 0.8rem;
  color: var(--text-secondary);
  margin-bottom: 0.75rem;
}

.scripts-folder-drop {
  border: 2px dashed var(--border);
  border-radius: var(--radius-sm);
  padding: 1rem;
  text-align: center;
  color: var(--text-muted);
  cursor: pointer;
  transition: border-color var(--transition), background var(--transition);
  position: relative;
}
.scripts-folder-drop:hover,
.scripts-folder-drop.drag-over {
  border-color: var(--primary);
  background: var(--primary-light);
}
.scripts-folder-drop svg {
  display: block;
  margin: 0 auto 0.5rem;
}
.scripts-folder-drop span {
  font-size: 0.8rem;
}
.scripts-folder-drop .file-input {
  position: absolute;
  inset: 0;
  opacity: 0;
  cursor: pointer;
}

.scripts-folder-photos {
  margin-top: 0.5rem;
  max-height: 200px;
  overflow-y: auto;
}
.scripts-photo-row {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.25rem 0;
  border-bottom: 1px solid var(--border-light);
}
.scripts-photo-thumb {
  width: 32px;
  height: 32px;
  object-fit: cover;
  border-radius: 4px;
}
.scripts-photo-name {
  flex: 1;
  font-size: 0.8rem;
  color: var(--text);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.scripts-photo-del {
  color: var(--danger) !important;
  font-size: 1.1rem;
  padding: 0 4px;
}

/* -- Results grid -- */
.scripts-results-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
  gap: 1rem;
}
.scripts-result-card {
  position: relative;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  overflow: hidden;
  transition: box-shadow var(--transition), transform var(--transition);
  box-shadow: var(--shadow-sm);
}
.scripts-result-card:hover {
  box-shadow: var(--shadow-md);
  transform: translateY(-2px);
}
.scripts-result-card img {
  width: 100%;
  height: 220px;
  object-fit: cover;
  display: block;
  cursor: pointer;
}
.scripts-result-info {
  padding: 0.5rem 0.75rem 0.5rem 0.75rem;
  cursor: pointer;
}
.scripts-result-name {
  font-size: 0.8rem;
  font-weight: 600;
  color: var(--text);
  display: block;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.scripts-result-size {
  font-size: 0.75rem;
  color: var(--text-muted);
}
.scripts-result-dl {
  position: absolute;
  bottom: 0.5rem;
  right: 0.5rem;
  display: flex;
  align-items: center;
  justify-content: center;
  width: 30px;
  height: 30px;
  border-radius: 50%;
  background: var(--primary);
  color: #fff;
  text-decoration: none;
  box-shadow: var(--shadow-sm);
  transition: background var(--transition), transform var(--transition);
}
.scripts-result-dl:hover {
  background: var(--primary-hover);
  transform: scale(1.1);
}
.scripts-result-dl svg {
  stroke: #fff;
}

/* -- Preview panel -- */
.scripts-preview-panel {
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,0.85);
  z-index: 999;
  display: flex;
  align-items: center;
  justify-content: center;
}
.scripts-preview-panel img {
  max-width: 90vw;
  max-height: 90vh;
  border-radius: var(--radius);
}
.scripts-preview-close {
  position: absolute;
  top: 1.5rem;
  right: 1.5rem;
  background: rgba(255,255,255,0.2);
  border: none;
  color: white;
  font-size: 2rem;
  width: 48px;
  height: 48px;
  border-radius: 50%;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
}
.scripts-preview-close:hover {
  background: rgba(255,255,255,0.35);
}

/* ==========================================================================
   SCRIPT SETTINGS PAGE
   ========================================================================== */

.page-header-actions {
  display: flex;
  gap: 0.5rem;
  align-items: center;
}

.stpl-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(340px, 1fr));
  gap: 1rem;
  margin-bottom: 1rem;
}
.stpl-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 1rem;
  display: flex;
  gap: 1rem;
  box-shadow: var(--shadow-sm);
  transition: opacity var(--transition);
}
.stpl-card.stpl-disabled {
  opacity: 0.5;
}
.stpl-card-thumb {
  width: 80px;
  height: 110px;
  border-radius: var(--radius-sm);
  overflow: hidden;
  background: var(--bg-dark);
  flex-shrink: 0;
}
.stpl-card-thumb img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}
.stpl-card-info {
  flex: 1;
  display: flex;
  flex-direction: column;
  gap: 0.15rem;
}
.stpl-card-info h4 {
  font-size: 0.95rem;
  font-weight: 700;
}
.stpl-card-suffix {
  font-size: 0.8rem;
  color: var(--primary);
  font-weight: 600;
  font-family: 'Courier New', monospace;
}
.stpl-card-mode,
.stpl-card-slots {
  font-size: 0.78rem;
  color: var(--text-muted);
}
.stpl-card-actions {
  display: flex;
  flex-direction: column;
  gap: 0.35rem;
  align-items: flex-end;
  flex-shrink: 0;
}

/* -- Template editor -- */
.stpl-editor {
  margin-top: 1.5rem;
}
.stpl-editor-body {
  padding: 1.25rem;
}
.stpl-form-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 1rem;
}

.stpl-ref-upload {
  position: relative;
  border: 2px dashed var(--border);
  border-radius: var(--radius-sm);
  padding: 1rem;
  text-align: center;
  cursor: pointer;
  transition: border-color var(--transition);
  min-height: 80px;
  display: flex;
  align-items: center;
  justify-content: center;
}
.stpl-ref-upload:hover {
  border-color: var(--primary);
}
.stpl-ref-upload .file-input {
  position: absolute;
  inset: 0;
  opacity: 0;
  cursor: pointer;
}
.stpl-ref-preview {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.5rem;
  color: var(--text-muted);
  font-size: 0.85rem;
}
.stpl-ref-preview img {
  max-width: 100%;
  max-height: 200px;
  border-radius: var(--radius-sm);
}

.toggle-label {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  cursor: pointer;
  font-size: 0.9rem;
}
.toggle-label input[type="checkbox"] {
  width: 18px;
  height: 18px;
  accent-color: var(--primary);
}

.stpl-zones-section {
  margin-top: 1rem;
}
.stpl-zones-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 0.5rem;
}
.stpl-zones-header label {
  font-weight: 600;
}
.stpl-zones-actions {
  display: flex;
  gap: 0.5rem;
  align-items: center;
}
.stpl-canvas-hint {
  font-size: 0.8rem;
  color: var(--text-muted);
  margin-bottom: 0.5rem;
}

.stpl-canvas-wrap {
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  overflow: hidden;
  margin-bottom: 0.75rem;
  background: #f0f0f0;
}
.stpl-canvas-wrap canvas {
  cursor: crosshair;
  display: block;
}
.stpl-canvas-wrap canvas {
  display: block;
  width: 100%;
  cursor: crosshair;
}

.stpl-zones-list {
  display: flex;
  flex-direction: column;
  gap: 0.25rem;
  max-height: 200px;
  overflow-y: auto;
}
.stpl-zone-row {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.35rem 0.5rem;
  background: var(--bg);
  border-radius: var(--radius-sm);
  cursor: pointer;
  transition: background var(--transition);
}
.stpl-zone-row:hover,
.stpl-zone-row.selected {
  background: var(--primary-light);
}
.stpl-zone-num {
  font-weight: 700;
  color: var(--primary);
  width: 24px;
}
.stpl-zone-pos {
  font-size: 0.75rem;
  color: var(--text-muted);
  font-family: 'Courier New', monospace;
  min-width: 90px;
}
.stpl-zone-dims {
  flex: 1;
  font-size: 0.8rem;
  color: var(--text-secondary);
  font-family: 'Courier New', monospace;
}
.stpl-zone-rotate {
  font-size: 0.75rem !important;
}

.stpl-editor-actions {
  display: flex;
  gap: 0.75rem;
  margin-top: 1.25rem;
}

/* -- Calendar generator -- */
.stpl-calendar {
  margin-top: 1.5rem;
}
.stpl-calendar-body {
  padding: 1.25rem;
}
.stpl-calendar-preview {
  margin: 1rem 0;
  text-align: center;
}
.stpl-calendar-preview img {
  max-width: 100%;
  max-height: 500px;
  border-radius: var(--radius);
  box-shadow: var(--shadow-md);
}

/* Danger button */
.btn-danger {
  background: var(--danger);
  color: white;
  border: none;
}
.btn-danger:hover {
  background: #b91c1c;
}

/* ── Class Name Verification ── */
.cnv-wrapper {
  max-width: 960px;
  margin: 0 auto;
}
.cnv-header {
  margin-bottom: 1.5rem;
}
.cnv-header h3 {
  font-size: 1.25rem;
  font-weight: 600;
  margin: 0 0 0.25rem;
}
.cnv-subtitle {
  color: var(--text-secondary);
  font-size: 0.9rem;
  margin: 0;
}
.cnv-loading, .cnv-error, .cnv-empty {
  text-align: center;
  padding: 3rem 1rem;
  color: var(--text-secondary);
  font-size: 1rem;
}
.cnv-error {
  color: var(--danger);
}
.cnv-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.9rem;
}
.cnv-table thead th {
  text-align: left;
  padding: 0.5rem 0.75rem;
  border-bottom: 2px solid var(--border);
  color: var(--text-secondary);
  font-weight: 600;
  font-size: 0.8rem;
  text-transform: uppercase;
  letter-spacing: 0.03em;
}
.cnv-row {
  transition: background 0.15s;
}
.cnv-row:hover {
  background: var(--bg-hover, rgba(0,0,0,0.02));
}
.cnv-row td {
  padding: 0.6rem 0.75rem;
  border-bottom: 1px solid var(--border);
  vertical-align: middle;
}
.cnv-row-changed {
  background: rgba(34, 197, 94, 0.06);
}
.cnv-row-changed:hover {
  background: rgba(34, 197, 94, 0.1);
}
.cnv-col-status {
  width: 36px;
  text-align: center;
}
.cnv-col-original code {
  background: rgba(255,255,255,0.1);
  color: var(--text, #e2e8f0);
  padding: 0.2em 0.5em;
  border-radius: 4px;
  font-size: 0.85rem;
  font-family: 'Courier New', monospace;
  color: var(--text-primary);
}
.cnv-col-arrow {
  width: 30px;
  text-align: center;
  color: var(--text-muted);
}
.cnv-col-corrected {
  min-width: 200px;
}
.cnv-input {
  width: 100%;
  padding: 0.4rem 0.6rem;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  font-size: 0.9rem;
  background: var(--bg);
  color: var(--text-primary);
  transition: border-color 0.15s, box-shadow 0.15s;
}
.cnv-input:focus {
  outline: none;
  border-color: var(--primary);
  box-shadow: 0 0 0 3px rgba(59, 130, 246, 0.15);
}
.cnv-row-changed .cnv-input {
  border-color: #22c55e;
  background: rgba(34, 197, 94, 0.04);
}
.cnv-col-students, .cnv-col-age {
  white-space: nowrap;
  text-align: center;
  color: var(--text-secondary);
  font-size: 0.85rem;
}
.cnv-col-actions {
  width: 130px;
}
.cnv-actions-group {
  display: flex;
  flex-direction: column;
  gap: 0.25rem;
  align-items: flex-start;
}
.cnv-btn-reset {
  font-size: 0.8rem !important;
  padding: 0.2rem 0.5rem !important;
  color: var(--text-muted) !important;
}
.cnv-btn-reset:hover {
  color: var(--danger) !important;
}
.cnv-btn-dict {
  font-size: 0.75rem !important;
  padding: 0.2rem 0.5rem !important;
  color: var(--primary) !important;
  display: inline-flex;
  align-items: center;
  gap: 0.25rem;
  white-space: nowrap;
}
.cnv-btn-dict:hover {
  background: rgba(59, 130, 246, 0.08) !important;
}
.cnv-btn-dict-saved {
  color: #22c55e !important;
  cursor: default !important;
}
.cnv-btn-dict-saved:hover {
  background: none !important;
}
.cnv-btn-delete {
  font-size: 0.75rem !important;
  padding: 0.25rem !important;
  color: var(--text-muted) !important;
  opacity: 0.5;
  transition: opacity 0.15s, color 0.15s;
}
.cnv-btn-delete:hover {
  opacity: 1;
  color: var(--danger) !important;
  background: rgba(239, 68, 68, 0.08) !important;
}
.cnv-count-zero {
  color: var(--danger) !important;
  font-weight: 600;
}
.cnv-actions {
  display: flex;
  justify-content: flex-end;
  align-items: center;
  gap: 1rem;
  margin-top: 1.5rem;
  padding-top: 1rem;
  border-top: 1px solid var(--border);
}
.cnv-btn-apply {
  min-width: 200px;
}
.cnv-btn-apply:disabled {
  opacity: 0.5;
  cursor: not-allowed;
}

/* ═══════════════════════════════════════
   Visual Template Editor
   ═══════════════════════════════════════ */
.ve-modal {
  position: fixed; inset: 0; z-index: 9999;
  background: var(--bg-main, #0f1117);
  display: flex; flex-direction: column;
  font-family: 'DM Sans', system-ui, sans-serif;
}
.ve-topbar {
  display: flex; align-items: center; gap: 1rem;
  padding: 0.5rem 1rem; background: var(--bg-sidebar, #161923);
  border-bottom: 1px solid var(--border, #2a2d3a);
  flex-shrink: 0; min-height: 48px;
}
.ve-back-btn {
  display: flex; align-items: center; gap: 0.4rem;
  background: none; border: none; color: var(--text-muted, #888); cursor: pointer;
  font-size: 0.85rem; padding: 0.4rem 0.6rem; border-radius: 6px;
}
.ve-back-btn:hover { background: rgba(255,255,255,0.06); color: #fff; }
.ve-topbar-center { display: flex; gap: 0.5rem; flex: 1; justify-content: center; }
.ve-name-input, .ve-suffix-input {
  background: rgba(255,255,255,0.06); border: 1px solid transparent;
  color: #fff; padding: 0.35rem 0.7rem; border-radius: 6px; font-size: 0.9rem;
  text-align: center; outline: none;
}
.ve-name-input { width: 240px; font-weight: 600; }
.ve-suffix-input { width: 120px; font-size: 0.8rem; color: var(--text-muted); }
.ve-name-input:focus, .ve-suffix-input:focus { border-color: var(--primary, #6366f1); }
.ve-topbar-actions { display: flex; gap: 0.5rem; }

.ve-body { display: flex; flex: 1; overflow: hidden; }

/* Left toolbar */
.ve-toolbar {
  width: 72px; background: var(--bg-sidebar, #161923);
  border-right: 1px solid var(--border, #2a2d3a);
  display: flex; flex-direction: column; align-items: center;
  padding: 0.75rem 0; gap: 0.25rem; flex-shrink: 0;
}
.ve-tool-btn {
  display: flex; flex-direction: column; align-items: center; gap: 0.2rem;
  background: none; border: none; color: var(--text-muted, #888);
  cursor: pointer; padding: 0.5rem; border-radius: 8px;
  font-size: 0.65rem; width: 60px; transition: all 0.15s;
}
.ve-tool-btn:hover { background: rgba(255,255,255,0.08); color: #fff; }
.ve-tool-btn.active { background: var(--primary, #6366f1); color: #fff; }
.ve-tool-sep { border: none; border-top: 1px solid var(--border, #2a2d3a); width: 40px; margin: 0.4rem 0; }

/* Canvas area */
.ve-canvas-wrap {
  flex: 1; display: flex; align-items: center; justify-content: center;
  overflow: auto; padding: 1.5rem; background: #0a0b0f;
}
.ve-canvas-outer {
  display: grid;
  grid-template-columns: 20px 1fr;
  grid-template-rows: 20px 1fr;
  flex-shrink: 0;
}
.ve-ruler-corner {
  background: #1a1c25; border-right: 1px solid #2a2d3a; border-bottom: 1px solid #2a2d3a;
}
.ve-ruler {
  background: #1a1c25; display: block;
}
.ve-ruler-h {
  grid-column: 2; grid-row: 1;
  border-bottom: 1px solid #2a2d3a;
}
.ve-ruler-v {
  grid-column: 1; grid-row: 2;
  border-right: 1px solid #2a2d3a;
}
.ve-canvas {
  position: relative; background: #1a1a2e;
  box-shadow: 0 8px 40px rgba(0,0,0,0.5);
  overflow: hidden;
  grid-column: 2; grid-row: 2;
}
/* Alignment guides */
.ve-guide {
  position: absolute; z-index: 20; pointer-events: none;
}
.ve-guide-h {
  left: 0; right: 0; height: 1px;
  border-top: 1px dashed #f43f5e;
}
.ve-guide-v {
  top: 0; bottom: 0; width: 1px;
  border-left: 1px dashed #f43f5e;
}
.ve-guide-center-h {
  left: 0; right: 0; height: 1px;
  border-top: 1px dashed #22d3ee;
}
.ve-guide-center-v {
  top: 0; bottom: 0; width: 1px;
  border-left: 1px dashed #22d3ee;
}
.ve-canvas-bg {
  position: absolute; inset: 0; width: 100%; height: 100%;
  object-fit: cover; pointer-events: none;
}
.ve-canvas-subject {
  position: absolute; bottom: 0; left: 50%; transform: translateX(-50%);
  height: 92%; width: auto;
  pointer-events: none; z-index: 2;
}
.ve-elements-layer-back {
  position: absolute; inset: 0; z-index: 1; pointer-events: none;
}
.ve-elements-layer {
  position: absolute; inset: 0; z-index: 3; pointer-events: none;
}
.ve-render-overlay {
  position: absolute; inset: 0; z-index: 10;
  background: #000; display: flex; flex-direction: column;
  align-items: center; justify-content: center;
}
.ve-render-overlay img { width: 100%; height: 100%; object-fit: contain; }
.ve-render-overlay button { position: absolute; bottom: 12px; }

/* Draggable text element */
.ve-text-el {
  position: absolute; cursor: move; user-select: none;
  white-space: pre-wrap; line-height: 1.2;
  border: 2px solid transparent; border-radius: 3px;
  padding: 2px 4px; transition: border-color 0.1s;
  pointer-events: auto;
}
.ve-text-el:hover { border-color: rgba(99,102,241,0.5); }
.ve-text-el.ve-selected { border-color: #6366f1; }

/* Resize handles */
.ve-resize-handle {
  position: absolute; width: 10px; height: 10px;
  background: #6366f1; border: 1.5px solid #fff; border-radius: 2px;
  z-index: 10; pointer-events: auto;
}
.ve-resize-ml { left: -6px; top: 50%; transform: translateY(-50%); cursor: ew-resize; }
.ve-resize-mr { right: -6px; top: 50%; transform: translateY(-50%); cursor: ew-resize; }
.ve-resize-tl { left: -6px; top: -6px; cursor: nwse-resize; }
.ve-resize-tr { right: -6px; top: -6px; cursor: nesw-resize; }
.ve-resize-bl { left: -6px; bottom: -6px; cursor: nesw-resize; }
.ve-resize-br { right: -6px; bottom: -6px; cursor: nwse-resize; }

/* Overlay elements */
.ve-overlay-el {
  position: absolute;
  cursor: move;
  user-select: none;
  border: 1px dashed transparent;
  transition: border-color 0.15s;
  pointer-events: auto;
}
.ve-overlay-el:hover { border-color: rgba(99, 102, 241, 0.5); }
.ve-overlay-el.ve-selected { border-color: #6366f1; }

/* Overlay resize handles */
.ve-ov-resize-handle {
  position: absolute; width: 10px; height: 10px;
  background: #f59e0b; border: 1.5px solid #fff; border-radius: 2px;
  z-index: 10; pointer-events: auto;
}
.ve-ov-resize-tl { left: -6px; top: -6px; cursor: nwse-resize; }
.ve-ov-resize-tr { right: -6px; top: -6px; cursor: nesw-resize; }
.ve-ov-resize-bl { left: -6px; bottom: -6px; cursor: nesw-resize; }
.ve-ov-resize-br { right: -6px; bottom: -6px; cursor: nwse-resize; }

/* Bandeau grid crop button */
.gp-bn-crop-btn {
  position: absolute; top: 6px; right: 6px; z-index: 2;
  font-size: 0.7rem; padding: 2px 8px;
  background: rgba(0,0,0,0.7); color: #fff;
  border-radius: 4px; opacity: 0;
  transition: opacity 0.15s;
  display: flex; align-items: center; gap: 3px;
}
.gp-color-card:hover .gp-bn-crop-btn { opacity: 1; }
.gp-bn-crop-btn:hover { background: rgba(99,102,241,0.9); }

.ve-text-el.ve-behind { opacity: 0.7; }
.ve-text-el.ve-behind::after {
  content: '↓'; position: absolute; top: -14px; right: -2px;
  font-size: 10px; color: #f59e0b; background: rgba(0,0,0,0.6);
  border-radius: 3px; padding: 0 3px; line-height: 14px;
}

/* Barcode element */
.ve-barcode-el {
  position: absolute; cursor: move; user-select: none;
  border: 2px solid transparent; border-radius: 2px;
  pointer-events: auto; overflow: hidden;
}
.ve-barcode-el svg { display: block; width: 100%; height: 100%; }
.ve-barcode-el:hover { border-color: rgba(99,102,241,0.5); }
.ve-barcode-el.ve-selected { border-color: #6366f1; }

/* Right panel */
.ve-panel {
  width: 280px; background: var(--bg-sidebar, #161923);
  border-left: 1px solid var(--border, #2a2d3a);
  overflow-y: auto; padding: 1rem; flex-shrink: 0;
}
.ve-panel-empty {
  color: var(--text-muted, #888); font-size: 0.85rem;
  text-align: center; padding: 2rem 0.5rem;
}
.ve-panel-section h4 {
  margin: 0 0 0.75rem; font-size: 0.9rem; color: #fff; font-weight: 600;
}
.ve-field { margin-bottom: 0.6rem; }
.ve-field label {
  display: block; font-size: 0.75rem; color: var(--text-muted, #888);
  margin-bottom: 0.2rem; font-weight: 500;
}
.ve-field label span { float: right; color: #fff; font-weight: 600; }
.ve-field .input, .ve-field select, .ve-field textarea {
  font-size: 0.8rem; padding: 0.3rem 0.5rem;
  background: rgba(255,255,255,0.06); border: 1px solid var(--border, #2a2d3a);
  color: #fff; border-radius: 4px; width: 100%;
}
.ve-field select option {
  background: #1e2130; color: #fff;
}
.ve-font-install-overlay {
  position: fixed; inset: 0; z-index: 100001;
  background: rgba(0,0,0,0.6); display: flex; align-items: center; justify-content: center;
}
.ve-font-install-modal {
  background: #1e2130; border: 1px solid var(--border, #2a2d3a);
  border-radius: 12px; padding: 1.5rem; width: 380px; max-width: 90vw;
  color: #fff; box-shadow: 0 20px 60px rgba(0,0,0,0.5);
}
.ve-font-install-modal h3 {
  margin: 0 0 1rem; font-size: 1.1rem; font-weight: 700;
}
.ve-font-install-tabs {
  display: flex; gap: 0.25rem; margin-bottom: 1rem;
  border-bottom: 2px solid rgba(255,255,255,0.08); padding-bottom: 0;
}
.ve-font-tab {
  flex: 1; padding: 0.5rem 0; border: none; background: transparent;
  color: var(--text-muted, #888); font-weight: 600; font-size: 0.85rem;
  cursor: pointer; border-bottom: 2px solid transparent; margin-bottom: -2px;
  font-family: var(--font);
}
.ve-font-tab.active {
  color: var(--primary); border-bottom-color: var(--primary);
}
.ve-font-tab:hover { color: #fff; }
.ve-font-install-modal .input {
  font-size: 0.85rem; padding: 0.45rem 0.65rem;
  background: rgba(255,255,255,0.06); border: 1px solid var(--border, #2a2d3a);
  color: #fff; border-radius: 6px; width: 100%; box-sizing: border-box;
}
.ve-font-install-modal input[type="file"] {
  font-size: 0.82rem; color: var(--text-muted);
}
.ve-font-install-modal input[type="file"]::file-selector-button {
  background: var(--primary); color: #fff; border: none; border-radius: 4px;
  padding: 0.35rem 0.75rem; font-size: 0.8rem; font-weight: 600; cursor: pointer;
  margin-right: 0.5rem;
}
.ve-field textarea { resize: vertical; }
.ve-field input[type="range"] { width: 100%; }
.ve-field-row { display: flex; gap: 0.5rem; }
.ve-field-row .ve-field { flex: 1; }

.ve-align-btns { display: flex; gap: 2px; }
.ve-align-btn {
  flex: 1; background: rgba(255,255,255,0.06); border: 1px solid var(--border);
  color: var(--text-muted); cursor: pointer; padding: 0.25rem; border-radius: 4px;
  font-size: 0.7rem;
}
.ve-align-btn.active { background: var(--primary, #6366f1); color: #fff; border-color: var(--primary); }

@media (max-height: 700px) {
  .ve-canvas-wrap { padding: 0.5rem; }
}
@media (max-width: 900px) {
  .ve-panel { width: 220px; }
  .ve-toolbar { width: 56px; }
}

/* ── M01 PROFS ── */

.m01-profs-header {
  margin-bottom: 1rem;
}

.m01-profs-info {
  display: flex;
  align-items: center;
  gap: 1rem;
  padding: 0.75rem 1rem;
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: 8px;
}

.m01-profs-count {
  font-weight: 600;
  color: var(--text-primary);
}

.m01-results-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
  gap: 1rem;
  padding: 0.5rem 0;
}

.m01-result-card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: 8px;
  overflow: hidden;
  transition: transform 0.15s ease, box-shadow 0.15s ease;
}

.m01-result-card:hover {
  transform: translateY(-2px);
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
}

.m01-result-card img {
  width: 100%;
  display: block;
  aspect-ratio: 210 / 284;
  object-fit: cover;
}

.m01-result-name {
  display: block;
  padding: 0.4rem 0.6rem;
  font-size: 0.78rem;
  color: var(--text-muted);
  text-align: center;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.m01-results-section .class-header {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 0.5rem;
}

/* ── Poster Tab ── */

.poster-header {
  padding: 1rem 0;
}

.poster-info {
  display: flex;
  flex-direction: column;
  gap: 0.25rem;
}

.poster-count {
  font-size: 1rem;
  font-weight: 600;
}

.poster-hint {
  font-size: 0.85rem;
  color: var(--text-muted);
}

.poster-results-section .class-header {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 0.5rem;
}

.poster-results-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
  gap: 1rem;
  padding: 1rem 0;
}

.poster-result-card {
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: 0.5rem;
  overflow: hidden;
  transition: transform 0.15s, box-shadow 0.15s;
}

.poster-result-card:hover {
  transform: translateY(-2px);
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
}

.poster-result-card img {
  width: 100%;
  display: block;
  aspect-ratio: 841 / 594;
  object-fit: cover;
}

.poster-result-name {
  display: block;
  padding: 0.4rem 0.6rem 0.2rem;
  font-size: 0.78rem;
  color: var(--text-muted);
  text-align: center;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.poster-result-size {
  display: block;
  padding: 0 0.6rem 0.4rem;
  font-size: 0.72rem;
  color: var(--text-muted);
  text-align: center;
  opacity: 0.7;
}

/* Poster config modal styles */
.poster-config-section {
  margin-bottom: 1rem;
}

.poster-config-label {
  display: block;
  font-size: 0.85rem;
  font-weight: 600;
  margin-bottom: 0.35rem;
  color: var(--text);
}

.poster-config-input {
  width: 100%;
  padding: 0.5rem 0.75rem;
  border: 1px solid var(--border);
  border-radius: 0.4rem;
  background: var(--bg);
  color: var(--text);
  font-size: 0.9rem;
  box-sizing: border-box;
}

.poster-config-input:focus {
  outline: none;
  border-color: var(--primary);
  box-shadow: 0 0 0 2px rgba(59,130,246,0.2);
}

.poster-config-select {
  width: 100%;
  padding: 0.5rem 0.75rem;
  border: 1px solid var(--border);
  border-radius: 0.4rem;
  background: var(--bg);
  color: var(--text);
  font-size: 0.9rem;
  cursor: pointer;
  box-sizing: border-box;
}

.poster-config-select:focus {
  outline: none;
  border-color: var(--primary);
}

.poster-config-color {
  width: 48px;
  height: 36px;
  padding: 2px;
  border: 1px solid var(--border);
  border-radius: 0.4rem;
  background: var(--bg);
  cursor: pointer;
}

.poster-config-row {
  display: flex;
  gap: 1rem;
  align-items: flex-start;
}

.poster-tab.active {
  border-color: var(--primary);
  color: var(--primary);
}

.poster-bg-upload-btn {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  border: 2px dashed var(--border);
  background: var(--bg-elevated, var(--bg));
  cursor: pointer;
  transition: border-color 0.15s, background 0.15s;
}

.poster-bg-upload-btn:hover {
  border-color: var(--primary);
  background: rgba(59,130,246,0.06);
}

.poster-bg-upload-btn svg {
  opacity: 0.5;
  margin-bottom: 0.25rem;
}

.poster-bg-delete-btn {
  position: absolute;
  top: 4px;
  left: 4px;
  width: 22px;
  height: 22px;
  border-radius: 50%;
  border: none;
  background: rgba(220,38,38,0.85);
  color: #fff;
  font-size: 14px;
  line-height: 22px;
  text-align: center;
  cursor: pointer;
  padding: 0;
  display: none;
  z-index: 2;
}

.sticker-bg-option:hover .poster-bg-delete-btn {
  display: block;
}

.poster-bg-delete-btn:hover {
  background: rgba(220,38,38,1);
}

.poster-config-checkbox {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  cursor: pointer;
  font-size: 0.9rem;
  padding: 0.5rem 0;
  user-select: none;
}

.poster-config-checkbox input[type="checkbox"] {
  width: 18px;
  height: 18px;
  cursor: pointer;
  accent-color: var(--primary);
  flex-shrink: 0;
}

/* ─── SEND TO SERVER BUTTON ─── */

.btn-send-server {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  padding: 0.4rem 0.9rem;
  font-size: 0.82rem;
  font-weight: 600;
  border: 1.5px solid var(--primary);
  border-radius: var(--radius);
  background: transparent;
  color: var(--primary);
  cursor: pointer;
  transition: all 0.2s ease;
  white-space: nowrap;
}

.btn-send-server:hover:not(:disabled) {
  background: var(--primary);
  color: white;
  box-shadow: var(--shadow);
}

.btn-send-server:disabled {
  opacity: 0.5;
  cursor: not-allowed;
}

.btn-send-server.btn-sending {
  border-color: var(--success);
  color: var(--success);
  animation: pulse 1.2s infinite;
}

.btn-send-server.btn-sending:hover {
  background: transparent;
  color: var(--success);
}

.btn-send-server svg {
  flex-shrink: 0;
}

/* ── AI Color + Bokeh sections ── */

.gp-ai-section h4,
.gp-bokeh-section h4 {
  font-size: 0.9rem;
  margin: 0 0 8px 0;
  color: var(--text);
}

.gp-ai-section .btn,
.gp-bokeh-section .btn {
  font-size: 0.8rem;
  padding: 5px 10px;
}

.gp-ai-batch-btn {
  transition: opacity 0.15s;
}

.gp-ai-batch-btn:hover:not(:disabled) {
  opacity: 0.9;
}

.gp-ai-batch-btn:disabled,
.gp-ai-apply-one:disabled,
.gp-bokeh-apply:disabled,
.gp-bokeh-preview:disabled,
.gp-ai-analyze:disabled {
  opacity: 0.6;
  cursor: wait;
}

.gp-ai-diag {
  line-height: 1.6;
}

.gp-ai-diag strong {
  color: var(--text);
}

.gp-bokeh-section .mce-slider-group {
  margin-bottom: 4px;
}
