/*
 * Take Your Pass — back-office
 * Feuille de style unique : jetons de marque, gabarit, composants.
 * Mêmes jetons que le site vitrine (BRAND.md du projet takeyourpass-site).
 */

@font-face {
  font-family: "Inter";
  font-style: normal;
  font-display: swap;
  font-weight: 100 900;
  src: url("../fonts/inter-latin-wght-normal.woff2") format("woff2-variations");
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}
@font-face {
  font-family: "Inter";
  font-style: normal;
  font-display: swap;
  font-weight: 100 900;
  src: url("../fonts/inter-latin-ext-wght-normal.woff2") format("woff2-variations");
  unicode-range: U+0100-02BA, U+02BD-02C5, U+02C7-02CC, U+02CE-02D7, U+02DD-02FF, U+0304, U+0308, U+0329, U+1D00-1DBF, U+1E00-1E9F, U+1EF2-1EFF, U+2020, U+20A0-20AB, U+20AD-20C0, U+2113, U+2C60-2C7F, U+A720-A7FF;
}

:root {
  --brand-50: #eef3ff;
  --brand-100: #dce6ff;
  --brand-200: #b9ccff;
  --brand-300: #8aa8ff;
  --brand-400: #577cf7;
  --brand-500: #2f55e6;
  --brand-600: #1a3fcc;
  --brand-700: #0033a0;
  --brand-800: #0a2a7a;
  --brand-900: #0b1f57;
  --brand-950: #07143a;
  --accent: #16c79a;
  --accent-soft: #e3f8f1;

  --slate-50: #f8fafc;
  --slate-100: #f1f5f9;
  --slate-200: #e2e8f0;
  --slate-300: #cbd5e1;
  --slate-400: #94a3b8;
  --slate-500: #64748b;
  --slate-600: #475569;
  --slate-700: #334155;
  --slate-800: #1e293b;
  --slate-900: #0f172a;

  --success: #059669;
  --success-soft: #ecfdf5;
  --warning: #b45309;
  --warning-soft: #fffbeb;
  --danger: #dc2626;
  --danger-soft: #fef2f2;
  --info: var(--brand-600);
  --info-soft: var(--brand-50);

  --bg: var(--slate-50);
  --surface: #ffffff;
  --border: var(--slate-200);
  --text: var(--slate-900);
  --muted: var(--slate-500);

  --radius-sm: 8px;
  --radius: 12px;
  --radius-lg: 16px;
  --shadow-sm: 0 1px 2px rgba(15, 23, 42, 0.06);
  --shadow: 0 1px 3px rgba(15, 23, 42, 0.08), 0 1px 2px rgba(15, 23, 42, 0.04);
  --shadow-lg: 0 20px 40px -12px rgba(15, 23, 42, 0.25);
  --focus: 0 0 0 3px rgba(47, 85, 230, 0.35);

  --sidebar-width: 264px;
  --topbar-height: 64px;
}

/* --- Base ------------------------------------------------------------------ */

*, *::before, *::after { box-sizing: border-box; }

html { -webkit-text-size-adjust: 100%; }

body {
  margin: 0;
  font-family: "Inter", system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  font-size: 14px;
  line-height: 1.5;
  color: var(--text);
  background: var(--bg);
  -webkit-font-smoothing: antialiased;
  font-feature-settings: "cv11", "ss01";
}

h1, h2, h3, h4 { margin: 0; line-height: 1.25; font-weight: 650; letter-spacing: -0.01em; color: var(--slate-900); }
h1 { font-size: 24px; letter-spacing: -0.02em; }
h2 { font-size: 18px; }
h3 { font-size: 15px; }
p { margin: 0 0 12px; }
a { color: var(--brand-600); text-decoration: none; }
a:hover { color: var(--brand-700); text-decoration: underline; }
img, svg { vertical-align: middle; }
svg.icon { width: 18px; height: 18px; flex-shrink: 0; }
hr { border: 0; border-top: 1px solid var(--border); margin: 20px 0; }
small, .small { font-size: 12px; }
code { font-family: ui-monospace, SFMono-Regular, Menlo, monospace; font-size: 12px; background: var(--slate-100); padding: 1px 5px; border-radius: 4px; }

:focus-visible { outline: none; box-shadow: var(--focus); border-radius: 6px; }

.sr-only { position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip: rect(0, 0, 0, 0); border: 0; }

/* --- Gabarit ---------------------------------------------------------------- */

.app { display: flex; min-height: 100vh; }

.sidebar {
  position: fixed;
  inset: 0 auto 0 0;
  width: var(--sidebar-width);
  background: var(--brand-950);
  color: var(--brand-100);
  display: flex;
  flex-direction: column;
  z-index: 40;
  transition: transform 0.2s ease;
}
.sidebar-brand { display: flex; align-items: center; gap: 10px; height: var(--topbar-height); padding: 0 20px; border-bottom: 1px solid rgba(255, 255, 255, 0.08); }
.sidebar-brand img { height: 32px; }
.sidebar-scroll { flex: 1; overflow-y: auto; padding: 12px 12px 24px; }
.sidebar-org {
  margin: 4px 4px 12px;
  padding: 12px;
  border-radius: var(--radius);
  background: rgba(255, 255, 255, 0.06);
  border: 1px solid rgba(255, 255, 255, 0.08);
}
.sidebar-org-name { font-weight: 600; color: #fff; font-size: 14px; }
.sidebar-org-meta { font-size: 12px; color: var(--brand-200); margin-top: 2px; display: flex; gap: 6px; align-items: center; flex-wrap: wrap; }
.sidebar-org-switch { margin-top: 8px; }
.sidebar-org-switch select { width: 100%; background: rgba(255, 255, 255, 0.08); color: #fff; border: 1px solid rgba(255, 255, 255, 0.15); border-radius: 6px; padding: 5px 8px; font: inherit; font-size: 12px; }
.sidebar-org-switch option { color: var(--text); }

.nav-section { margin-top: 16px; }
.nav-section-title { padding: 0 12px 6px; font-size: 11px; font-weight: 600; letter-spacing: 0.06em; text-transform: uppercase; color: var(--brand-300); }
.nav-event-name { padding: 0 12px 8px; font-size: 13px; font-weight: 600; color: #fff; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.nav-link {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 8px 12px;
  border-radius: var(--radius-sm);
  color: var(--brand-100);
  font-weight: 500;
  font-size: 14px;
}
.nav-link svg { width: 18px; height: 18px; flex-shrink: 0; opacity: 0.85; }
.nav-link:hover { background: rgba(255, 255, 255, 0.07); color: #fff; text-decoration: none; }
.nav-link.active { background: var(--brand-700); color: #fff; box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.08); }
.nav-link.active svg { opacity: 1; }

.main { flex: 1; min-width: 0; margin-left: var(--sidebar-width); display: flex; flex-direction: column; }

.topbar {
  position: sticky;
  top: 0;
  z-index: 30;
  height: var(--topbar-height);
  display: flex;
  align-items: center;
  gap: 16px;
  padding: 0 28px;
  background: rgba(255, 255, 255, 0.85);
  backdrop-filter: saturate(180%) blur(8px);
  border-bottom: 1px solid var(--border);
}
.topbar-title { font-weight: 600; color: var(--slate-700); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.topbar-spacer { flex: 1; }
.topbar-toggle { display: none; }

.content { padding: 28px; width: 100%; max-width: 1320px; margin: 0 auto; }
.content-narrow { max-width: 880px; }

.sidebar-backdrop { display: none; }

@media (max-width: 1024px) {
  .sidebar { transform: translateX(-100%); box-shadow: var(--shadow-lg); }
  .sidebar.open { transform: translateX(0); }
  .sidebar-backdrop.open { display: block; position: fixed; inset: 0; background: rgba(15, 23, 42, 0.45); z-index: 35; }
  .main { margin-left: 0; }
  .topbar { padding: 0 16px; }
  .topbar-toggle { display: inline-flex; }
  .content { padding: 20px 16px; }
}

/* --- Menu utilisateur (details/summary) ------------------------------------- */

.menu { position: relative; }
.menu > summary { list-style: none; cursor: pointer; }
.menu > summary::-webkit-details-marker { display: none; }
.menu-panel {
  position: absolute;
  right: 0;
  top: calc(100% + 8px);
  min-width: 220px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  box-shadow: var(--shadow-lg);
  padding: 6px;
  z-index: 50;
}
.menu-item { display: flex; width: 100%; align-items: center; gap: 8px; padding: 8px 10px; border-radius: 6px; color: var(--slate-700); background: none; border: 0; font: inherit; cursor: pointer; text-align: left; }
.menu-item:hover { background: var(--slate-100); color: var(--slate-900); text-decoration: none; }
.menu-item svg { width: 16px; height: 16px; color: var(--slate-500); }
.menu-header { padding: 8px 10px; border-bottom: 1px solid var(--border); margin-bottom: 4px; }
.menu-header strong { display: block; }
.menu-header span { font-size: 12px; color: var(--muted); }

.avatar {
  width: 34px;
  height: 34px;
  border-radius: 999px;
  background: var(--brand-100);
  color: var(--brand-800);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-weight: 600;
  font-size: 13px;
  flex-shrink: 0;
  overflow: hidden;
}
.avatar img { width: 100%; height: 100%; object-fit: cover; }

/* --- En-tête de page ---------------------------------------------------------- */

.page-header { display: flex; align-items: flex-end; justify-content: space-between; gap: 16px; flex-wrap: wrap; margin-bottom: 24px; }
.page-header-text { min-width: 0; }
.page-eyebrow { font-size: 12px; font-weight: 600; color: var(--brand-600); text-transform: uppercase; letter-spacing: 0.06em; margin-bottom: 4px; }
.page-subtitle { color: var(--muted); margin: 4px 0 0; }
.page-actions { display: flex; gap: 8px; flex-wrap: wrap; align-items: center; }
.back-link { display: inline-flex; align-items: center; gap: 6px; color: var(--muted); font-size: 13px; margin-bottom: 8px; }
.back-link svg { width: 16px; height: 16px; }

/* --- Cartes ------------------------------------------------------------------- */

.card { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); box-shadow: var(--shadow-sm); }
.card + .card { margin-top: 20px; }
.grid > .card + .card { margin-top: 0; }
.card-header { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 16px 20px; border-bottom: 1px solid var(--border); flex-wrap: wrap; }
.card-title { font-size: 15px; font-weight: 600; margin: 0; }
.card-subtitle { color: var(--muted); font-size: 13px; margin: 2px 0 0; }
.card-body { padding: 20px; }
.card-footer { padding: 14px 20px; border-top: 1px solid var(--border); background: var(--slate-50); border-radius: 0 0 var(--radius) var(--radius); display: flex; gap: 8px; justify-content: flex-end; flex-wrap: wrap; }
.card-flush .card-body { padding: 0; }

.grid { display: grid; gap: 20px; }
.grid-2 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.grid-3 { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.grid-4 { grid-template-columns: repeat(4, minmax(0, 1fr)); }
.grid-cards { grid-template-columns: repeat(auto-fill, minmax(280px, 1fr)); }
@media (max-width: 1100px) { .grid-4 { grid-template-columns: repeat(2, minmax(0, 1fr)); } .grid-3 { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
@media (max-width: 720px) { .grid-2, .grid-3, .grid-4 { grid-template-columns: minmax(0, 1fr); } }

.stack > * + * { margin-top: 20px; }

/* Indicateurs */
.stat { padding: 18px 20px; }
.stat-label { display: flex; align-items: center; gap: 8px; color: var(--muted); font-size: 13px; font-weight: 500; }
.stat-label svg { width: 16px; height: 16px; }
.stat-value { font-size: 28px; font-weight: 700; letter-spacing: -0.02em; margin-top: 6px; color: var(--slate-900); }
.stat-hint { font-size: 12px; color: var(--muted); margin-top: 2px; }
.stat-icon { width: 36px; height: 36px; border-radius: 10px; display: inline-flex; align-items: center; justify-content: center; background: var(--brand-50); color: var(--brand-700); }
.stat-icon svg { width: 18px; height: 18px; }

.progress { height: 8px; background: var(--slate-100); border-radius: 999px; overflow: hidden; }
.progress > span { display: block; height: 100%; background: var(--brand-500); border-radius: 999px; }
.progress.is-warning > span { background: #f59e0b; }
.progress.is-danger > span { background: var(--danger); }

/* --- Boutons ------------------------------------------------------------------ */

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  height: 38px;
  padding: 0 14px;
  border-radius: var(--radius-sm);
  border: 1px solid transparent;
  font: inherit;
  font-weight: 550;
  font-size: 14px;
  line-height: 1;
  cursor: pointer;
  white-space: nowrap;
  text-decoration: none;
  transition: background 0.15s ease, border-color 0.15s ease, color 0.15s ease, box-shadow 0.15s ease;
}
.btn svg { width: 16px; height: 16px; }
.btn:hover { text-decoration: none; }
.btn:disabled, .btn.disabled { opacity: 0.55; pointer-events: none; }
.btn-primary { background: var(--brand-700); color: #fff; box-shadow: var(--shadow-sm); }
.btn-primary:hover { background: var(--brand-800); color: #fff; }
.btn-secondary { background: var(--surface); color: var(--slate-700); border-color: var(--border); box-shadow: var(--shadow-sm); }
.btn-secondary:hover { background: var(--slate-50); color: var(--slate-900); border-color: var(--slate-300); }
.btn-ghost { background: transparent; color: var(--slate-600); }
.btn-ghost:hover { background: var(--slate-100); color: var(--slate-900); }
.btn-danger { background: var(--danger); color: #fff; }
.btn-danger:hover { background: #b91c1c; color: #fff; }
.btn-danger-ghost { background: transparent; color: var(--danger); }
.btn-danger-ghost:hover { background: var(--danger-soft); color: #b91c1c; }
.btn-success { background: var(--success); color: #fff; }
.btn-success:hover { background: #047857; color: #fff; }
.btn-sm { height: 32px; padding: 0 10px; font-size: 13px; }
.btn-lg { height: 46px; padding: 0 20px; font-size: 15px; }
.btn-icon { width: 38px; padding: 0; }
.btn-icon.btn-sm { width: 32px; }
.btn-block { width: 100%; }
.btn-group { display: inline-flex; gap: 6px; flex-wrap: wrap; align-items: center; }
form.inline { display: inline; margin: 0; }

/* --- Formulaires -------------------------------------------------------------- */

.form-grid { display: grid; gap: 16px 20px; grid-template-columns: repeat(2, minmax(0, 1fr)); }
.form-grid .span-2 { grid-column: 1 / -1; }
@media (max-width: 720px) { .form-grid { grid-template-columns: minmax(0, 1fr); } }

.field { display: flex; flex-direction: column; gap: 6px; min-width: 0; }
.label { font-size: 13px; font-weight: 550; color: var(--slate-700); }
.label .optional { color: var(--muted); font-weight: 400; }
.help { font-size: 12px; color: var(--muted); }
.field-error { font-size: 12px; color: var(--danger); }

.input, .select, .textarea {
  width: 100%;
  min-height: 40px;
  padding: 8px 12px;
  border: 1px solid var(--slate-300);
  border-radius: var(--radius-sm);
  background: var(--surface);
  color: var(--text);
  font: inherit;
  font-size: 14px;
  transition: border-color 0.15s ease, box-shadow 0.15s ease;
}
.textarea { min-height: 110px; resize: vertical; }
.input:hover, .select:hover, .textarea:hover { border-color: var(--slate-400); }
.input:focus, .select:focus, .textarea:focus { outline: none; border-color: var(--brand-500); box-shadow: var(--focus); }
.input[readonly], .input:disabled { background: var(--slate-50); color: var(--slate-600); }
.select { appearance: none; padding-right: 36px; background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='16' height='16' fill='none' stroke='%2364748b' stroke-width='2' stroke-linecap='round' stroke-linejoin='round' viewBox='0 0 24 24'%3E%3Cpath d='m6 9 6 6 6-6'/%3E%3C/svg%3E"); background-repeat: no-repeat; background-position: right 10px center; }
input[type="file"].input { padding: 7px 10px; }
input[type="color"].input { padding: 4px; height: 40px; }

.check { display: flex; align-items: flex-start; gap: 10px; cursor: pointer; font-size: 14px; }
.check input { width: 18px; height: 18px; margin: 1px 0 0; accent-color: var(--brand-600); flex-shrink: 0; }
.check-hint { display: block; color: var(--muted); font-size: 12px; }

/* Interrupteur */
.switch { position: relative; display: inline-flex; align-items: center; gap: 10px; cursor: pointer; }
.switch input { position: absolute; opacity: 0; width: 0; height: 0; }
.switch-track { width: 38px; height: 22px; border-radius: 999px; background: var(--slate-300); position: relative; transition: background 0.15s ease; flex-shrink: 0; }
.switch-track::after { content: ""; position: absolute; top: 3px; left: 3px; width: 16px; height: 16px; border-radius: 999px; background: #fff; box-shadow: var(--shadow-sm); transition: transform 0.15s ease; }
.switch input:checked + .switch-track { background: var(--brand-600); }
.switch input:checked + .switch-track::after { transform: translateX(16px); }
.switch input:focus-visible + .switch-track { box-shadow: var(--focus); }

/* Barre de filtres */
.toolbar { display: flex; gap: 10px; flex-wrap: wrap; align-items: center; }
.toolbar .input, .toolbar .select { width: auto; min-width: 180px; }
.search { position: relative; }
.search svg { position: absolute; left: 11px; top: 50%; transform: translateY(-50%); width: 16px; height: 16px; color: var(--slate-400); pointer-events: none; }
.search .input { padding-left: 34px; }
@media (max-width: 720px) { .toolbar > * { flex: 1 1 100%; } .toolbar .input, .toolbar .select { width: 100%; } }

/* --- Tableaux ----------------------------------------------------------------- */

.table-wrap { overflow-x: auto; position: relative; }
.table { width: 100%; border-collapse: collapse; font-size: 14px; }
.table th {
  text-align: left;
  font-size: 12px;
  font-weight: 600;
  color: var(--muted);
  text-transform: uppercase;
  letter-spacing: 0.04em;
  padding: 10px 16px;
  background: var(--slate-50);
  border-bottom: 1px solid var(--border);
  white-space: nowrap;
}
.table th a { color: inherit; display: inline-flex; align-items: center; gap: 4px; }
.table td { padding: 12px 16px; border-bottom: 1px solid var(--slate-100); vertical-align: middle; }
.table tbody tr:last-child td { border-bottom: 0; }
.table tbody tr:hover td { background: var(--slate-50); }
.table .actions { text-align: right; white-space: nowrap; }
.table .num { text-align: right; font-variant-numeric: tabular-nums; }
.cell-main { font-weight: 550; color: var(--slate-900); }
.cell-sub { font-size: 12px; color: var(--muted); }
.person { display: flex; align-items: center; gap: 10px; }

/* --- Badges et alertes ------------------------------------------------------------ */

.badge { display: inline-flex; align-items: center; gap: 4px; height: 22px; padding: 0 8px; border-radius: 999px; font-size: 12px; font-weight: 550; background: var(--slate-100); color: var(--slate-700); white-space: nowrap; }
.badge-brand { background: var(--brand-50); color: var(--brand-700); }
.badge-success { background: var(--success-soft); color: var(--success); }
.badge-warning { background: var(--warning-soft); color: var(--warning); }
.badge-danger { background: var(--danger-soft); color: var(--danger); }
.badge-accent { background: var(--accent-soft); color: #0b8a6a; }
.badge-dark { background: rgba(255, 255, 255, 0.12); color: #fff; }
.dot { width: 8px; height: 8px; border-radius: 999px; background: currentColor; display: inline-block; }

.alert { display: flex; gap: 12px; align-items: flex-start; padding: 12px 16px; border-radius: var(--radius); border: 1px solid; font-size: 14px; margin-bottom: 20px; }
.alert svg { width: 18px; height: 18px; flex-shrink: 0; margin-top: 1px; }
.alert-body { flex: 1; }
.alert-success { background: var(--success-soft); border-color: #a7f3d0; color: #065f46; }
.alert-error { background: var(--danger-soft); border-color: #fecaca; color: #991b1b; }
.alert-warning { background: var(--warning-soft); border-color: #fde68a; color: #92400e; }
.alert-info { background: var(--info-soft); border-color: var(--brand-200); color: var(--brand-800); }
.alert a { color: inherit; font-weight: 600; text-decoration: underline; }
.alert-close { background: none; border: 0; color: inherit; opacity: 0.6; cursor: pointer; padding: 0; }
.alert-close:hover { opacity: 1; }

/* --- États vides ---------------------------------------------------------------- */

.empty { text-align: center; padding: 48px 20px; color: var(--muted); }
.empty-icon { width: 48px; height: 48px; margin: 0 auto 14px; border-radius: 14px; background: var(--brand-50); color: var(--brand-600); display: flex; align-items: center; justify-content: center; }
.empty-icon svg { width: 22px; height: 22px; }
.empty h3 { color: var(--slate-900); margin-bottom: 6px; }
.empty .btn { margin-top: 14px; }

/* --- Liste descriptive -------------------------------------------------------------- */

.dl { display: grid; grid-template-columns: 160px 1fr; gap: 10px 16px; margin: 0; }
.dl dt { color: var(--muted); font-size: 13px; }
.dl dd { margin: 0; font-weight: 500; }
@media (max-width: 720px) { .dl { grid-template-columns: 1fr; gap: 2px; } .dl dd { margin-bottom: 8px; } }

.list { list-style: none; margin: 0; padding: 0; }
.list-item { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 12px 20px; border-bottom: 1px solid var(--slate-100); }
.list-item:last-child { border-bottom: 0; }

/* --- Cartes d'événement --------------------------------------------------------------- */

.event-card { display: flex; flex-direction: column; background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); box-shadow: var(--shadow-sm); transition: box-shadow 0.15s ease, border-color 0.15s ease, transform 0.15s ease; overflow: hidden; }
.event-card:hover { box-shadow: var(--shadow); border-color: var(--brand-200); transform: translateY(-1px); }
.event-card-top { height: 6px; background: linear-gradient(90deg, var(--brand-700), var(--brand-400)); }
.event-card-body { padding: 18px 20px; flex: 1; }
.event-card-title { font-size: 16px; font-weight: 650; margin: 0 0 8px; color: var(--slate-900); }
.event-card-meta { display: flex; flex-direction: column; gap: 6px; color: var(--muted); font-size: 13px; }
.event-card-meta span { display: inline-flex; align-items: center; gap: 6px; }
.event-card-meta svg { width: 15px; height: 15px; }
.event-card-footer { display: flex; gap: 6px; padding: 12px 20px; border-top: 1px solid var(--slate-100); align-items: center; flex-wrap: wrap; }
.event-card-footer .btn-primary { margin-right: auto; }

/* --- Onglets ---------------------------------------------------------------------- */

.tabs { display: flex; gap: 4px; border-bottom: 1px solid var(--border); margin-bottom: 20px; overflow-x: auto; }
.tab { padding: 10px 14px; color: var(--muted); font-weight: 550; border-bottom: 2px solid transparent; margin-bottom: -1px; white-space: nowrap; background: none; border-top: 0; border-left: 0; border-right: 0; font: inherit; cursor: pointer; }
.tab:hover { color: var(--slate-900); text-decoration: none; }
.tab.active { color: var(--brand-700); border-bottom-color: var(--brand-700); }

/* --- Fenêtres modales ------------------------------------------------------------------ */

.modal { display: none; position: fixed; inset: 0; z-index: 100; background: rgba(15, 23, 42, 0.5); padding: 24px 16px; overflow-y: auto; }
.modal.open { display: flex; align-items: flex-start; justify-content: center; }
.modal-dialog { width: 100%; max-width: 520px; margin-top: 8vh; background: var(--surface); border-radius: var(--radius-lg); box-shadow: var(--shadow-lg); }
.modal-lg .modal-dialog { max-width: 760px; }
.modal-header { display: flex; align-items: center; justify-content: space-between; padding: 18px 22px; border-bottom: 1px solid var(--border); }
.modal-title { font-size: 16px; font-weight: 650; margin: 0; }
.modal-body { padding: 22px; }
.modal-footer { display: flex; justify-content: flex-end; gap: 8px; padding: 14px 22px; border-top: 1px solid var(--border); background: var(--slate-50); border-radius: 0 0 var(--radius-lg) var(--radius-lg); }
body.modal-open { overflow: hidden; }

/* --- Pagination ----------------------------------------------------------------------- */

.pagination { display: flex; align-items: center; justify-content: space-between; gap: 12px; flex-wrap: wrap; padding: 14px 4px 0; }
.pagination-info { color: var(--muted); font-size: 13px; }
.pagination-links { display: flex; gap: 4px; flex-wrap: wrap; }
.page-link { min-width: 34px; height: 34px; padding: 0 10px; display: inline-flex; align-items: center; justify-content: center; border-radius: var(--radius-sm); border: 1px solid var(--border); background: var(--surface); color: var(--slate-700); font-weight: 500; }
.page-link:hover { background: var(--slate-50); text-decoration: none; }
.page-link.active { background: var(--brand-700); border-color: var(--brand-700); color: #fff; }
.page-link.disabled { color: var(--slate-300); pointer-events: none; }

/* --- Pages d'authentification -------------------------------------------------------------- */

.auth { min-height: 100vh; display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); background: var(--surface); }
.auth-aside { background: radial-gradient(1200px 600px at -10% -10%, var(--brand-600), transparent 60%), linear-gradient(160deg, var(--brand-800), var(--brand-950)); color: var(--brand-100); padding: 48px; display: flex; flex-direction: column; justify-content: space-between; position: relative; overflow: hidden; }
.auth-aside h2 { color: #fff; font-size: 30px; letter-spacing: -0.02em; max-width: 420px; }
.auth-aside p { max-width: 420px; color: var(--brand-200); font-size: 15px; }
.auth-points { list-style: none; padding: 0; margin: 24px 0 0; display: grid; gap: 12px; }
.auth-points li { display: flex; gap: 10px; align-items: flex-start; }
.auth-points svg { width: 18px; height: 18px; color: var(--accent); margin-top: 2px; flex-shrink: 0; }
.auth-main { display: flex; align-items: center; justify-content: center; padding: 40px 24px; }
.auth-card { width: 100%; max-width: 420px; }
.auth-card h1 { font-size: 26px; margin-bottom: 6px; }
.auth-card .lead { color: var(--muted); margin-bottom: 24px; }
.auth-card form > * + * { margin-top: 16px; }
.auth-links { display: flex; justify-content: space-between; gap: 12px; flex-wrap: wrap; font-size: 13px; }
.auth-footer { margin-top: 28px; font-size: 13px; color: var(--muted); text-align: center; }
.auth-logo-mobile { display: none; margin-bottom: 28px; }
@media (max-width: 900px) {
  .auth { grid-template-columns: 1fr; }
  .auth-aside { display: none; }
  .auth-logo-mobile { display: block; }
}

/* Page publique simple (confirmation, activation) */
.public { min-height: 100vh; display: flex; align-items: center; justify-content: center; padding: 24px 16px; background: var(--bg); }
.public-card { width: 100%; max-width: 560px; }
.public-logo { display: flex; justify-content: center; margin-bottom: 20px; }
.public-logo span { background: var(--brand-700); border-radius: 12px; padding: 6px 10px; }

/* --- Divers ------------------------------------------------------------------------------ */

.muted { color: var(--muted); }
.text-right { text-align: right; }
.text-center { text-align: center; }
.nowrap { white-space: nowrap; }
.truncate { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.flex { display: flex; }
.items-center { align-items: center; }
.justify-between { justify-content: space-between; }
.wrap { flex-wrap: wrap; }
.gap-1 { gap: 4px; } .gap-2 { gap: 8px; } .gap-3 { gap: 12px; } .gap-4 { gap: 16px; }
.mt-0 { margin-top: 0; } .mt-1 { margin-top: 4px; } .mt-2 { margin-top: 8px; } .mt-3 { margin-top: 12px; } .mt-4 { margin-top: 16px; } .mt-6 { margin-top: 24px; }
.mb-0 { margin-bottom: 0; } .mb-2 { margin-bottom: 8px; } .mb-4 { margin-bottom: 16px; } .mb-6 { margin-bottom: 24px; }
.w-full { width: 100%; }
.hidden { display: none !important; }
.chart-box { position: relative; height: 300px; }
.qr-frame { border-radius: var(--radius); overflow: hidden; background: var(--slate-900); aspect-ratio: 1 / 1; max-width: 420px; margin: 0 auto; }
.rich-content img { max-width: 100%; height: auto; border-radius: var(--radius-sm); }
.color-swatch { width: 18px; height: 18px; border-radius: 6px; border: 1px solid var(--border); display: inline-block; }

/* TinyMCE : bordure harmonisée */
.tox.tox-tinymce { border-radius: var(--radius-sm) !important; border-color: var(--slate-300) !important; }

@media print {
  .sidebar, .topbar { display: none; }
  .main { margin: 0; }
}
