/* ============================================================
   Admin CSS — Plateforme Menu Digital
   Thème : La Cachette (bordeaux / doré / crème)
   Mobile-first → sidebar collapse en dessous de 768px
   ============================================================ */

:root {
  --a-sidebar-bg:          #230B14;
  --a-sidebar-bg-hover:    rgba(214,173,124,.08);
  --a-sidebar-text:        #D6AD7C;
  --a-sidebar-hover:       rgba(214,173,124,.1);
  --a-sidebar-active:      rgba(214,173,124,.13);
  --a-sidebar-border:      rgba(214,173,124,.14);
  --a-sidebar-w:           248px;

  --a-top-bg:              #2E0D1A;
  --a-top-text:            #F5F0E8;
  --a-top-h:               56px;

  --a-body-bg:             #F4F0EA;
  --a-card-bg:             #FFFFFF;
  --a-border:              #E2D9CE;

  --a-accent:              #D6AD7C;
  --a-accent-dark:         #B8956A;
  --a-primary:             #570A26;
  --a-primary-hover:       #3A0618;
  --a-danger:              #963C32;
  --a-danger-hover:        #7A2E26;
  --a-success:             #2D7D46;
  --a-warning:             #B07A20;

  --a-text:                #1A1010;
  --a-text-muted:          #8A7A7A;
  --a-text-light:          #BEB0A8;

  --a-radius:              8px;
  --a-radius-sm:           5px;
  --a-shadow:              0 1px 3px rgba(0,0,0,.08);
  --a-shadow-md:           0 4px 20px rgba(0,0,0,.15);

  --font: system-ui,-apple-system,'Segoe UI',sans-serif;
}

/* ---- Reset minimal ---- */
*, *::before, *::after { box-sizing: border-box; }
body { margin: 0; }
a { color: inherit; }
button { cursor: pointer; }
img, svg { display: block; }
[hidden] { display: none !important; }

/* ============================================================
   LOGIN
   ============================================================ */
.login-body {
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  background: var(--a-body-bg);
  font-family: var(--font);
  font-size: 14px;
  color: var(--a-text);
}
.login-wrap {
  width: 100%;
  max-width: 400px;
  padding: 24px 16px;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 16px;
}
.login-card {
  background: var(--a-card-bg);
  border-radius: var(--a-radius);
  box-shadow: var(--a-shadow-md);
  padding: 36px 32px;
  width: 100%;
}
.login-brand {
  text-align: center;
  margin-bottom: 28px;
}
.login-brand__mark {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 52px; height: 52px;
  background: var(--a-primary);
  color: var(--a-accent);
  border-radius: 12px;
  font-size: 24px;
  font-weight: 700;
  font-family: var(--font);
  margin-bottom: 10px;
}
.login-brand__name {
  margin: 0;
  font-size: 18px;
  font-weight: 600;
  color: var(--a-primary);
}
.login-brand__sub {
  margin: 2px 0 0;
  font-size: 13px;
  color: var(--a-text-muted);
}
.login-footer {
  font-size: 12px;
  color: var(--a-text-light);
  text-align: center;
}

/* ============================================================
   LAYOUT ADMIN
   ============================================================ */
.admin-body {
  display: flex;
  min-height: 100vh;
  font-family: var(--font);
  font-size: 14px;
  color: var(--a-text);
  background: var(--a-body-bg);
}

/* --- Sidebar --- */
.sidebar {
  position: fixed;
  top: 0; left: 0; bottom: 0;
  width: var(--a-sidebar-w);
  background:
    radial-gradient(ellipse 200px 180px at 105% 5%, rgba(214,173,124,.045) 0%, transparent 65%),
    url('../img/sidebar-pattern.svg'),
    var(--a-sidebar-bg);
  background-size: auto, 200px 200px, auto;
  background-repeat: no-repeat, repeat, no-repeat;
  display: flex;
  flex-direction: column;
  overflow-y: auto;
  overflow-x: hidden;
  z-index: 200;
  transform: translateX(0);
  transition: transform .22s ease;
  border-right: 1px solid rgba(214,173,124,.07);
}

/* ---- Brand ---- */
.sidebar__brand {
  display: flex;
  align-items: center;
  gap: 11px;
  padding: 0 18px;
  height: var(--a-top-h);
  flex-shrink: 0;
  border-bottom: 1px solid var(--a-sidebar-border);
  position: relative;
}
.sidebar__logo {
  flex-shrink: 0;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 34px; height: 34px;
  background: var(--a-accent);
  color: var(--a-primary);
  border-radius: 9px;
  font-weight: 800;
  font-size: 15px;
  letter-spacing: -.02em;
  box-shadow: 0 2px 8px rgba(214,173,124,.25);
}
.sidebar__title {
  display: block;
  font-size: 12.5px;
  font-weight: 600;
  color: var(--a-sidebar-text);
  letter-spacing: .01em;
  line-height: 1.3;
}
.sidebar__role {
  display: block;
  font-size: 10.5px;
  color: rgba(214,173,124,.45);
  letter-spacing: .03em;
  line-height: 1.3;
}

/* ---- Nav ---- */
.sidebar__nav {
  padding: 10px 10px;
  flex: 1;
}
.nav-section {
  display: block;
  padding: 16px 10px 5px;
  font-size: 10px;
  font-weight: 700;
  letter-spacing: .1em;
  color: rgba(214,173,124,.32);
  text-transform: uppercase;
  pointer-events: none;
  user-select: none;
}
.nav-section:first-child { padding-top: 6px; }
.nav-link {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 8px 10px;
  border-radius: var(--a-radius-sm);
  color: rgba(245,240,232,.65);
  text-decoration: none;
  font-size: 13px;
  line-height: 1;
  transition: background .15s, color .15s, box-shadow .15s;
  margin: 1px 0;
}
.nav-link:hover {
  background: var(--a-sidebar-hover);
  color: rgba(245,240,232,.95);
}
.nav-link--active {
  background: var(--a-sidebar-active) !important;
  color: var(--a-accent) !important;
  font-weight: 500;
  box-shadow: inset 2px 0 0 var(--a-accent);
}
.nav-icon { width: 15px; height: 15px; flex-shrink: 0; opacity: .6; transition: opacity .15s; }
.nav-link:hover .nav-icon { opacity: .9; }
.nav-link--active .nav-icon { opacity: 1; }
.nav-divider { height: 1px; background: var(--a-sidebar-border); margin: 10px 0; }

/* ---- Sidebar footer (user) ---- */
.sidebar__footer {
  flex-shrink: 0;
  padding: 8px 10px 12px;
  border-top: 1px solid var(--a-sidebar-border);
}
.sidebar__user {
  display: flex;
  align-items: center;
  gap: 9px;
  padding: 8px 8px;
  border-radius: var(--a-radius-sm);
  transition: background .15s;
}
.sidebar__user-avatar {
  flex-shrink: 0;
  width: 30px; height: 30px;
  border-radius: 7px;
  background: rgba(214,173,124,.15);
  color: var(--a-accent);
  display: flex; align-items: center; justify-content: center;
  font-size: 11px;
  font-weight: 700;
  letter-spacing: .03em;
  border: 1px solid rgba(214,173,124,.2);
}
.sidebar__user-info { flex: 1; min-width: 0; }
.sidebar__user-name {
  display: block;
  font-size: 12px;
  font-weight: 500;
  color: rgba(245,240,232,.85);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  line-height: 1.3;
}
.sidebar__user-role-badge {
  display: block;
  font-size: 10.5px;
  color: rgba(214,173,124,.45);
  line-height: 1.3;
}
.sidebar__logout-btn {
  flex-shrink: 0;
  background: none;
  border: none;
  padding: 5px;
  border-radius: 4px;
  color: rgba(214,173,124,.35);
  transition: color .15s, background .15s;
  display: flex; align-items: center; justify-content: center;
}
.sidebar__logout-btn:hover { color: var(--a-accent); background: rgba(214,173,124,.1); }

/* --- Main wrap --- */
.admin-wrap {
  margin-left: var(--a-sidebar-w);
  flex: 1;
  display: flex;
  flex-direction: column;
  min-height: 100vh;
  min-width: 0;
  background: var(--a-body-bg);
}

/* --- Topbar --- */
.topbar {
  position: sticky;
  top: 0;
  height: var(--a-top-h);
  background: var(--a-top-bg);
  display: flex;
  align-items: center;
  padding: 0 22px;
  gap: 14px;
  z-index: 100;
  flex-shrink: 0;
  border-bottom: 1px solid rgba(214,173,124,.15);
}
.topbar__burger {
  display: none;
  flex-direction: column;
  justify-content: center;
  gap: 5px;
  width: 34px; height: 34px;
  background: none;
  border: none;
  padding: 5px;
  border-radius: var(--a-radius-sm);
  flex-shrink: 0;
  transition: background .15s;
}
.topbar__burger:hover { background: rgba(255,255,255,.1); }
.topbar__burger span {
  display: block;
  height: 1.5px;
  background: rgba(245,240,232,.75);
  border-radius: 2px;
  transition: .2s;
}
.topbar__site-form {
  display: flex;
  align-items: center;
  gap: 10px;
}
.topbar__site-label {
  color: rgba(214,173,124,.5);
  font-size: 11px;
  font-weight: 700;
  letter-spacing: .07em;
  text-transform: uppercase;
  white-space: nowrap;
}
.topbar__site-select {
  appearance: none;
  -webkit-appearance: none;
  background-color: rgba(255,255,255,.07);
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 12 8'%3E%3Cpath d='M1 1l5 5 5-5' stroke='%23D6AD7C' stroke-width='1.5' fill='none' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 10px center;
  background-size: 11px 7px;
  border: 1px solid rgba(214,173,124,.25);
  color: var(--a-top-text);
  border-radius: var(--a-radius-sm);
  padding: 5px 30px 5px 10px;
  font-size: 13px;
  font-family: var(--font);
  max-width: 200px;
  transition: border-color .15s, background-color .15s;
  cursor: pointer;
}
.topbar__site-select:focus { outline: none; border-color: var(--a-accent); background-color: rgba(255,255,255,.1); }
.topbar__site-select option { background: #2E0D1A; color: #F5F0E8; }
.topbar__actions { margin-left: auto; display: flex; align-items: center; gap: 8px; }
.topbar__user { display: flex; align-items: center; gap: 8px; }
.topbar__username { color: rgba(245,240,232,.8); font-size: 13px; white-space: nowrap; }
.logout-form { margin: 0; }

/* --- Page content --- */
.page-content { padding: 24px; flex: 1; }
.page-header { margin-bottom: 20px; }
.page-title { margin: 0; font-size: 20px; font-weight: 600; color: var(--a-primary); }

/* ============================================================
   COMPONENTS
   ============================================================ */

/* Cards */
.card {
  background: var(--a-card-bg);
  border-radius: var(--a-radius);
  border: 1px solid var(--a-border);
  box-shadow: var(--a-shadow);
  margin-bottom: 20px;
}
.card__header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 14px 18px;
  border-bottom: 1px solid var(--a-border);
}
.card__title { margin: 0; font-size: 14px; font-weight: 600; color: var(--a-text); }
.card__body { padding: 18px; }
.card__body--flush { padding: 0; overflow-x: auto; -webkit-overflow-scrolling: touch; }
.card__footer {
  display: flex;
  gap: 8px;
  padding: 12px 18px;
  border-top: 1px solid var(--a-border);
}

/* Stats grid */
.stats-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(160px, 1fr));
  gap: 12px;
  margin-bottom: 20px;
}
.stat-card {
  background: var(--a-card-bg);
  border-radius: var(--a-radius);
  border: 1px solid var(--a-border);
  padding: 16px 18px;
  display: flex;
  flex-direction: column;
}
.stat-card--accent { border-color: var(--a-accent); }
.stat-card__value { font-size: 28px; font-weight: 700; color: var(--a-primary); line-height: 1; }
.stat-card__label { font-size: 12px; color: var(--a-text-muted); margin-top: 4px; }
.stat-card__sub { font-size: 11px; color: var(--a-text-light); margin-top: 2px; }

/* Dashboard row */
.dashboard-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 16px;
}
@media (max-width: 700px) { .dashboard-row { grid-template-columns: 1fr; } }

/* Info list */
.info-list { margin: 0; padding: 0; list-style: none; display: flex; flex-direction: column; gap: 8px; }
.info-list__item { display: flex; gap: 8px; font-size: 13px; }
.info-list__item dt { color: var(--a-text-muted); flex-shrink: 0; width: 130px; }
.info-list__item dd { margin: 0; font-weight: 500; }

/* Quick links */
.quick-links { display: flex; flex-wrap: wrap; gap: 8px; }
.quick-link {
  padding: 6px 12px;
  background: var(--a-body-bg);
  border: 1px solid var(--a-border);
  border-radius: 20px;
  font-size: 13px;
  text-decoration: none;
  color: var(--a-primary);
  transition: background .15s;
}
.quick-link:hover { background: var(--a-accent); color: #fff; border-color: var(--a-accent); }

/* Empty state */
.empty-state {
  padding: 48px 24px;
  text-align: center;
  color: var(--a-text-muted);
  font-size: 14px;
}
.empty-state a { color: var(--a-primary); }

/* Toolbar */
.toolbar {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 16px;
  flex-wrap: wrap;
}
.toolbar--multi { justify-content: space-between; }
.toolbar__filter { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.toolbar__hint { color: var(--a-text-muted); font-size: 13px; margin: 0; }

/* Tables */
.table {
  width: 100%;
  border-collapse: collapse;
  font-size: 13.5px;
}
.table thead th {
  background: var(--a-body-bg);
  padding: 9px 12px;
  text-align: left;
  font-weight: 600;
  font-size: 12px;
  text-transform: uppercase;
  letter-spacing: .04em;
  color: var(--a-text-muted);
  border-bottom: 1px solid var(--a-border);
  white-space: nowrap;
}
.table tbody tr { border-bottom: 1px solid var(--a-border); }
.table tbody tr:last-child { border-bottom: none; }
.table tbody tr:hover { background: #faf7f4; }
.table tbody td { padding: 9px 12px; vertical-align: middle; }
.th--drag { width: 32px; padding: 0 !important; }
.th--actions { width: 1%; white-space: nowrap; text-align: right; }
.td--actions { white-space: nowrap; text-align: right; }
.td--drag { width: 32px; text-align: center; }
.td--muted { color: var(--a-text-muted); }
.td--price { font-variant-numeric: tabular-nums; white-space: nowrap; }
.table-hint { font-size: 12px; color: var(--a-text-light); padding: 8px 12px; }

/* Drag handle */
.drag-handle {
  display: inline-block;
  cursor: grab;
  color: var(--a-text-light);
  font-size: 16px;
  line-height: 1;
  user-select: none;
  padding: 4px 6px;
  border-radius: 4px;
}
.drag-handle:active { cursor: grabbing; }
.sortable-row.is-dragging { opacity: .45; }
.sortable-row.drag-over { outline: 2px dashed var(--a-accent); }
.thumb { border-radius: 4px; object-fit: cover; background: var(--a-body-bg); }

/* Badges */
.badge {
  display: inline-flex;
  align-items: center;
  padding: 2px 8px;
  border-radius: 10px;
  font-size: 11.5px;
  font-weight: 600;
  border: none;
}
.badge--success { background: #D4EDDA; color: #1A5C2F; }
.badge--danger  { background: #FBDDDA; color: #7A2E26; }
.badge--warning { background: #FFF0CD; color: #7A5A10; }
.badge--muted   { background: #EDE8E3; color: var(--a-text-muted); }
.badge--info    { background: #D6E8FB; color: #1C4E80; }
.badge--toggle  { cursor: pointer; transition: background .15s; }

/* Toggle button */
.toggle-btn {
  padding: 3px 10px;
  border-radius: 10px;
  font-size: 12px;
  font-weight: 600;
  border: 1px solid transparent;
  transition: .15s;
}
.toggle-btn--on  { background: #D4EDDA; color: #1A5C2F; border-color: #A8D5B5; }
.toggle-btn--off { background: #EDE8E3; color: var(--a-text-muted); border-color: #D8D0C8; }
.toggle-btn:hover { filter: brightness(.95); }

/* Buttons */
.btn {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 8px 16px;
  border-radius: var(--a-radius-sm);
  font-size: 13.5px;
  font-weight: 500;
  border: 1px solid transparent;
  text-decoration: none;
  transition: background .15s, color .15s, border-color .15s;
  white-space: nowrap;
  line-height: 1.4;
}
.btn:disabled { opacity: .55; cursor: not-allowed; }
.btn--primary { background: var(--a-primary); color: #F5F0E8; border-color: var(--a-primary); }
.btn--primary:hover:not(:disabled) { background: var(--a-primary-hover); border-color: var(--a-primary-hover); }
.btn--ghost  { background: transparent; color: var(--a-text); border-color: var(--a-border); }
.btn--ghost:hover:not(:disabled) { background: var(--a-body-bg); }
.btn--danger { background: transparent; color: var(--a-danger); border-color: var(--a-danger); }
.btn--danger:hover:not(:disabled) { background: var(--a-danger); color: #fff; }
.btn--sm { padding: 4px 10px; font-size: 12.5px; }
.btn--full { width: 100%; justify-content: center; }

/* In the topbar, ghost buttons get lighter style */
.topbar .btn--ghost {
  color: rgba(245,240,232,.85);
  border-color: rgba(245,240,232,.3);
}
.topbar .btn--ghost:hover { background: rgba(255,255,255,.12); color: var(--a-top-text); }

/* Forms */
.form-group { display: flex; flex-direction: column; gap: 6px; }
.form-group--full { grid-column: 1 / -1; }
.form-check-group { justify-content: flex-end; }
.form-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; }
/* Space between consecutive form elements when stacked (modal bodies, etc.) */
.form-group + .form-group,
.form-group + .form-grid,
.form-grid + .form-group { margin-top: 14px; }
.form-grid .form-group + .form-group { margin-top: 0; }
.form-label { font-size: 13px; font-weight: 600; color: var(--a-text); }
.form-hint { font-size: 12px; color: var(--a-text-muted); font-weight: 400; }
.form-input {
  padding: 8px 10px;
  border: 1px solid var(--a-border);
  border-radius: var(--a-radius-sm);
  font-size: 13.5px;
  font-family: var(--font);
  color: var(--a-text);
  background: #fff;
  transition: border-color .15s, box-shadow .15s;
  width: 100%;
}
.form-input:focus { outline: none; border-color: var(--a-accent); box-shadow: 0 0 0 2px rgba(214,173,124,.25); }
select.form-input {
  appearance: none;
  -webkit-appearance: none;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 12 8'%3E%3Cpath d='M1 1l5 5 5-5' stroke='%238A7A7A' stroke-width='1.5' fill='none' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 10px center;
  background-size: 12px 8px;
  padding-right: 32px;
  cursor: pointer;
}
.form-input--inline { width: auto; }
.form-textarea { resize: vertical; min-height: 72px; }
.form-check { display: flex; align-items: center; gap: 8px; font-size: 13px; cursor: pointer; }
.form-check input[type="checkbox"] { width: 15px; height: 15px; accent-color: var(--a-primary); }
.checkbox-grid { display: flex; flex-wrap: wrap; gap: 8px; }
.input-suffix { display: flex; align-items: stretch; }
.input-suffix .form-input { border-radius: var(--a-radius-sm) 0 0 var(--a-radius-sm); border-right: none; flex: 1; }
.input-suffix__text {
  padding: 0 10px;
  border: 1px solid var(--a-border);
  border-left: none;
  border-radius: 0 var(--a-radius-sm) var(--a-radius-sm) 0;
  background: var(--a-body-bg);
  color: var(--a-text-muted);
  font-size: 13px;
  display: flex;
  align-items: center;
}
.required { color: var(--a-danger); }
.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0,0,0,0); }

/* Alerts */
.alert {
  display: flex;
  align-items: flex-start;
  gap: 8px;
  padding: 10px 12px;
  border-radius: var(--a-radius-sm);
  font-size: 13px;
  margin-bottom: 16px;
}
.alert--error { background: #FBDDDA; color: #7A2E26; }
.alert--success { background: #D4EDDA; color: #1A5C2F; }

/* Modals */
.modal { display: none; position: fixed; inset: 0; z-index: 500; }
.modal:not([hidden]) { display: flex; align-items: center; justify-content: center; }
.modal__backdrop {
  position: absolute; inset: 0;
  background: rgba(58,6,24,.55);
  animation: fadeIn .2s ease;
}
.modal__panel {
  position: relative;
  background: var(--a-card-bg);
  border-radius: var(--a-radius);
  box-shadow: var(--a-shadow-md);
  width: 100%;
  max-width: 640px;
  max-height: 90vh;
  overflow-y: auto;
  animation: slideUp .2s ease;
  margin: 16px;
}
.modal__panel--sm { max-width: 440px; }
.modal__header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 16px 20px;
  border-bottom: 1px solid var(--a-border);
}
.modal__title { margin: 0; font-size: 16px; font-weight: 600; }
.modal__close { background: none; border: none; font-size: 22px; color: var(--a-text-muted); line-height: 1; padding: 2px 6px; border-radius: 4px; }
.modal__close:hover { background: var(--a-body-bg); color: var(--a-text); }
.modal__body { padding: 24px; }
.modal__footer { display: flex; justify-content: flex-end; gap: 8px; padding: 16px 24px; border-top: 1px solid var(--a-border); }

/* Confirm dialog */
.modal__panel--confirm {
  max-width: 400px;
  padding: 28px 28px 22px;
  text-align: center;
}
.modal__panel--confirm .modal__footer {
  border-top: none;
  justify-content: center;
  padding: 0;
  margin-top: 22px;
  gap: 10px;
}
.modal__panel--confirm.is-danger {
  border-top: 3px solid var(--a-danger);
  border-radius: 0 0 var(--a-radius) var(--a-radius);
}
.modal__confirm-icon {
  width: 52px; height: 52px; border-radius: 50%;
  display: flex; align-items: center; justify-content: center;
  margin: 0 auto 16px;
  background: rgba(192,57,43,.12);
  color: var(--a-danger);
}
.modal__confirm-icon--warn {
  background: rgba(214,173,52,.12);
  color: #C69C2A;
}
.modal__panel--confirm .modal__title {
  font-size: 16px; font-weight: 700; margin: 0 0 10px;
}
.modal__confirm-msg {
  color: var(--a-text-muted); font-size: 14px; line-height: 1.6; margin: 0;
}
.modal__confirm-ok {
  background: var(--a-danger); color: #fff; border-color: var(--a-danger);
}
.modal__confirm-ok:hover:not(:disabled) {
  background: #a93226; border-color: #a93226; color: #fff;
}
.modal__confirm-ok--warn {
  background: #C69C2A; color: #fff; border-color: #C69C2A;
}
.modal__confirm-ok--warn:hover:not(:disabled) {
  background: #a8831f; border-color: #a8831f; color: #fff;
}

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

/* Toasts */
.toast-container {
  position: fixed;
  bottom: 24px;
  right: 24px;
  z-index: 9000;
  display: flex;
  flex-direction: column;
  gap: 8px;
  pointer-events: none;
}
.toast {
  padding: 10px 16px;
  border-radius: var(--a-radius);
  font-size: 13.5px;
  font-weight: 500;
  box-shadow: var(--a-shadow-md);
  pointer-events: auto;
  animation: toastIn .2s ease, toastOut .3s ease 2.7s forwards;
  max-width: 340px;
}
.toast--success { background: #1A5C2F; color: #fff; }
.toast--error   { background: var(--a-danger); color: #fff; }
.toast--info    { background: var(--a-primary); color: var(--a-accent); }
@keyframes toastIn  { from { opacity: 0; transform: translateY(8px); } }
@keyframes toastOut { to   { opacity: 0; transform: translateY(8px); } }

/* Image picker */
.image-picker { border: 1px solid var(--a-border); border-radius: var(--a-radius-sm); overflow: hidden; }
.image-picker__clear {
  display: flex;
  padding: 6px 10px;
  font-size: 12px;
  color: var(--a-danger);
  background: none;
  border: none;
  border-bottom: 1px solid var(--a-border);
  width: 100%;
  text-align: left;
}
.image-picker__grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(70px, 1fr));
  gap: 4px;
  padding: 8px;
  max-height: 220px;
  overflow-y: auto;
}
.image-picker__thumb {
  aspect-ratio: 1;
  border: 2px solid transparent;
  border-radius: 4px;
  overflow: hidden;
  cursor: pointer;
  padding: 0;
  background: var(--a-body-bg);
  transition: border-color .15s;
  display: flex; align-items: center; justify-content: center;
}
.image-picker__thumb img { width: 100%; height: 100%; object-fit: cover; }
.image-picker__thumb--none { font-size: 11px; color: var(--a-text-muted); }
.image-picker__thumb--selected { border-color: var(--a-accent); }
.image-picker__thumb:hover { border-color: var(--a-accent-dark); }
.hidden { display: none !important; }

/* ============================================================
   DASHBOARD ENHANCEMENTS
   ============================================================ */

/* Topbar shadow */
.topbar { box-shadow: 0 2px 12px rgba(20,4,10,.35); }

/* Stat cards : barre d'accent en haut + support icône */
.stat-card { position: relative; overflow: hidden; }
.stat-card::before {
  content: '';
  position: absolute;
  top: 0; left: 0; right: 0;
  height: 3px;
  background: var(--a-border);
  border-radius: var(--a-radius) var(--a-radius) 0 0;
}
.stat-card--primary::before { background: var(--a-primary); }
.stat-card--accent::before  { background: var(--a-accent); }
.stat-card--danger::before  { background: var(--a-danger); }
.stat-card--success::before { background: var(--a-success); }

.stat-card__icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 36px; height: 36px;
  border-radius: 8px;
  margin-bottom: 10px;
  flex-shrink: 0;
}
.stat-card--primary .stat-card__icon { background: rgba(87,10,38,.09); color: var(--a-primary); }
.stat-card--accent  .stat-card__icon { background: rgba(214,173,124,.18); color: #9a6f38; }
.stat-card--danger  .stat-card__icon { background: rgba(150,60,50,.1);  color: var(--a-danger); }
.stat-card--success .stat-card__icon { background: rgba(45,125,70,.1);  color: var(--a-success); }

/* Override de l'ancien stat-card--accent qui mettait juste une bordure */
.stat-card.stat-card--danger { border-color: var(--a-border); }
.stat-card.stat-card--danger.stat-card--active { border-color: var(--a-danger); }

/* Bannière site courant */
.dash-banner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  border-radius: var(--a-radius);
  padding: 18px 22px;
  margin-bottom: 20px;
  overflow: hidden;
  position: relative;
}
.dash-banner::after {
  content: '';
  position: absolute;
  right: -30px; top: -30px;
  width: 120px; height: 120px;
  border-radius: 50%;
  background: rgba(255,255,255,.05);
  pointer-events: none;
}
.dash-banner__info   { display: flex; flex-direction: column; gap: 3px; }
.dash-banner__name   { font-size: 17px; font-weight: 700; margin: 0; letter-spacing: .02em; }
.dash-banner__meta   { font-size: 12px; margin: 0; opacity: .55; letter-spacing: .02em; }
.dash-banner__actions { display: flex; gap: 8px; flex-shrink: 0; flex-wrap: wrap; }

/* Boutons internes à la bannière */
.dash-banner .btn-ghost-banner {
  background: rgba(255,255,255,.12);
  border: 1px solid rgba(255,255,255,.2);
  border-radius: var(--a-radius-sm);
  padding: 6px 14px;
  font-size: 12px;
  font-weight: 500;
  cursor: pointer;
  transition: background .14s;
  text-decoration: none;
  display: inline-flex;
  align-items: center;
  gap: 5px;
}
.dash-banner .btn-ghost-banner:hover { background: rgba(255,255,255,.2); }

/* Quick nav (grille d'accès rapide avec icônes) */
.quick-nav {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 6px;
}
.quick-nav__item {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 9px 11px;
  background: var(--a-body-bg);
  border: 1px solid var(--a-border);
  border-radius: var(--a-radius);
  text-decoration: none;
  color: var(--a-text);
  font-size: 13px;
  font-weight: 500;
  transition: background .14s, color .14s, border-color .14s, box-shadow .14s;
  white-space: nowrap;
  overflow: hidden;
}
.quick-nav__item:hover {
  background: var(--a-primary);
  color: var(--a-accent);
  border-color: var(--a-primary);
  box-shadow: 0 2px 8px rgba(87,10,38,.2);
}
.quick-nav__icon { opacity: .5; flex-shrink: 0; transition: opacity .14s; }
.quick-nav__item:hover .quick-nav__icon { opacity: 1; }

/* Pastille de couleur de site dans la table groupe */
.site-dot {
  display: inline-block;
  width: 9px; height: 9px;
  border-radius: 50%;
  vertical-align: middle;
  margin-right: 7px;
  flex-shrink: 0;
  border: 1px solid rgba(0,0,0,.12);
  box-shadow: 0 0 0 2px rgba(255,255,255,.6);
}

/* ============================================================
   CUSTOM DATETIME PICKER
   ============================================================ */
.dtp-wrap { position: relative; display: block; }

.dtp-btn {
  display: flex;
  align-items: center;
  gap: 8px;
  cursor: pointer;
  text-align: left;
  width: 100%;
  font-size: 13px;
  color: var(--a-text);
  background: var(--a-input-bg, #fff);
  user-select: none;
}
.dtp-btn:focus-visible { outline: 2px solid var(--a-accent); outline-offset: 1px; }
.dtp-icon { opacity: .55; flex-shrink: 0; }
.dtp-ph { color: var(--a-text-muted); font-size: 13px; }

.dtp-drop {
  background: #fff;
  border: 1px solid var(--a-border);
  border-radius: var(--a-radius);
  box-shadow: 0 8px 28px rgba(20,4,10,.14);
  overflow: hidden;
  font-size: 13px;
}

.dtp-nav {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 10px 12px 8px;
  border-bottom: 1px solid var(--a-border);
  background: var(--a-sidebar-bg, #f9f5f0);
}
.dtp-nav-btn {
  background: none;
  border: none;
  cursor: pointer;
  font-size: 20px;
  line-height: 1;
  padding: 2px 8px;
  color: var(--a-text);
  border-radius: 4px;
  transition: background .15s;
}
.dtp-nav-btn:hover { background: var(--a-border); }
.dtp-title { font-weight: 600; font-size: 13px; }

.dtp-grid {
  display: grid;
  grid-template-columns: repeat(7, 1fr);
  gap: 2px;
  padding: 8px 10px 6px;
}
.dtp-cell {
  display: flex;
  align-items: center;
  justify-content: center;
  height: 30px;
  font-size: 12px;
  border-radius: 4px;
}
.dtp-hd { color: var(--a-text-muted); font-weight: 600; font-size: 11px; }
.dtp-day {
  background: none;
  border: none;
  cursor: pointer;
  color: var(--a-text);
  border-radius: 4px;
  transition: background .12s, color .12s;
}
.dtp-day:hover { background: var(--a-border); }
.dtp-today { font-weight: 700; color: var(--a-accent); }
.dtp-active { background: var(--a-accent) !important; color: #fff !important; font-weight: 600; }

.dtp-time {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 8px 12px;
  border-top: 1px solid var(--a-border);
  border-bottom: 1px solid var(--a-border);
  background: var(--a-body-bg);
}
.dtp-colon { font-weight: 700; color: var(--a-text-muted); }
.dtp-sel {
  appearance: none;
  -webkit-appearance: none;
  flex: 1;
  padding: 5px 26px 5px 6px;
  border: 1px solid var(--a-border);
  border-radius: 4px;
  background-color: #fff;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 12 8'%3E%3Cpath d='M1 1l5 5 5-5' stroke='%238A7A7A' stroke-width='1.5' fill='none' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 7px center;
  background-size: 10px 7px;
  font-size: 13px;
  color: var(--a-text);
  cursor: pointer;
  outline: none;
}
.dtp-sel:focus { border-color: var(--a-accent); }

.dtp-foot {
  display: flex;
  justify-content: flex-end;
  gap: 8px;
  padding: 10px 12px;
}

/* ============================================================
   PAGE HEADER — header card commun à toutes les pages admin
   ============================================================ */
.page-header {
  display: flex;
  align-items: flex-start;
  gap: 16px;
  padding: 18px;
}
.page-header__icon {
  flex-shrink: 0;
  width: 40px;
  height: 40px;
  background: rgba(87,10,38,.08);
  border-radius: 10px;
  display: flex;
  align-items: center;
  justify-content: center;
}
.page-header__body {
  flex: 1;
  min-width: 0;
}
.page-header__title {
  margin: 0 0 4px;
  font-size: 15px;
  font-weight: 600;
  color: var(--a-text);
}
.page-header__desc {
  margin: 0;
  font-size: 13px;
  color: var(--a-text-muted);
  line-height: 1.6;
}
.page-header__action {
  flex-shrink: 0;
  align-self: flex-start;
}
/* bouton direct enfant du page-header (sans wrapper) */
.page-header > .btn,
.page-header > label.btn {
  flex-shrink: 0;
  white-space: nowrap;
  align-self: flex-start;
}

/* ============================================================
   RESPONSIVE — sidebar collapse on mobile
   ============================================================ */
/* ---- Tablet (iPad portrait 768-1023px) ---- */
@media (min-width: 768px) and (max-width: 1023px) {
  .page-content { padding: 16px; }
  .stats-grid   { grid-template-columns: repeat(2, 1fr); }
}

@media (max-width: 767px) {
  .sidebar { transform: translateX(-100%); }
  .sidebar.is-open { transform: translateX(0); box-shadow: 4px 0 24px rgba(20,4,10,.5); }
  .admin-wrap { margin-left: 0; }
  .topbar__burger { display: flex; }
  .topbar__site-select { max-width: 130px; }
  .form-grid { grid-template-columns: 1fr; }
  .page-content { padding: 16px; }
  .stats-grid { grid-template-columns: repeat(2, 1fr); }
  .table { font-size: 12px; }
  .table thead th, .table tbody td { padding: 7px 8px; }
  /* page headers : bouton passe sous le texte */
  .page-header { flex-wrap: wrap; }
  .page-header__action,
  .page-header > .btn,
  .page-header > label.btn { width: 100%; }
  .page-header__action .btn,
  .page-header__action label.btn,
  .page-header > .btn,
  .page-header > label.btn { width: 100%; justify-content: center; }
  /* tables avec actions : scroll horizontal */
  .table-wrap { overflow-x: auto; -webkit-overflow-scrolling: touch; }
  .card__body--flush .table-wrap { margin: 0; }
  /* modal : padding réduit sur petits écrans */
  .modal__body { padding: 16px; }
  .modal__footer { padding: 12px 16px; }
  .modal__header { padding: 14px 16px; }
  /* modal sites : layout sur mobile — simulateur caché via #siteSimulator media query */
}
@media (max-width: 480px) {
  .stats-grid { grid-template-columns: 1fr 1fr; }
  .modal__panel { margin: 8px; }
  .modal__body { padding: 14px; }
  .page-content { padding: 10px; }
  .page-header__icon { display: none; }
}

/* ============================================================
   ONBOARDING TOUR
   ============================================================ */
.tour-overlay {
  position: fixed;
  inset: 0;
  width: 100%;
  height: 100%;
  z-index: 9000;
  pointer-events: none;
  opacity: 0;
  transition: opacity 0.3s ease;
}
.tour-overlay.is-active { opacity: 1; pointer-events: all; }

.tour-spotlight {
  position: fixed;
  z-index: 9001;
  border-radius: 8px;
  pointer-events: none;
  box-shadow: 0 0 0 3px var(--a-accent), 0 0 0 7px rgba(214,173,124,.22), 0 0 24px 4px rgba(214,173,124,.15);
  opacity: 0;
  transition: all 0.25s cubic-bezier(.4,0,.2,1);
}
.tour-spotlight.is-active { opacity: 1; }

.tour-tooltip {
  position: fixed;
  z-index: 9002;
  background: var(--a-card-bg);
  border-radius: 12px;
  padding: 20px 22px 18px;
  width: 304px;
  box-shadow: 0 12px 40px rgba(0,0,0,.3), 0 2px 8px rgba(0,0,0,.12);
  border-top: 3px solid var(--a-accent);
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.22s ease, transform 0.22s ease;
  transform: translateY(8px);
}
.tour-tooltip.is-active { opacity: 1; pointer-events: all; transform: translateY(0); }

.tour-tooltip__progress {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 14px;
}
.tour-tooltip__dots { display: flex; gap: 5px; align-items: center; }
.tour-dot {
  width: 6px; height: 6px;
  border-radius: 50%;
  background: var(--a-border);
  transition: background 0.2s, transform 0.2s;
  flex-shrink: 0;
}
.tour-dot.is-active { background: var(--a-accent); transform: scale(1.35); }
.tour-tooltip__counter {
  font-size: 11px;
  font-weight: 600;
  color: var(--a-text-muted);
  font-variant-numeric: tabular-nums;
  letter-spacing: .03em;
}
.tour-tooltip__title {
  font-size: 15px;
  font-weight: 700;
  color: var(--a-primary);
  margin: 0 0 7px;
  line-height: 1.3;
}
.tour-tooltip__body {
  font-size: 13px;
  color: var(--a-text);
  line-height: 1.65;
  margin: 0 0 18px;
}
.tour-tooltip__footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
}
.tour-tooltip__nav { display: flex; gap: 6px; }

.tour-btn {
  border: none;
  cursor: pointer;
  border-radius: 6px;
  font-size: 12.5px;
  font-weight: 500;
  padding: 7px 14px;
  transition: background 0.15s, color 0.15s, transform 0.1s;
  line-height: 1;
  font-family: inherit;
}
.tour-btn:active { transform: scale(0.96); }
.tour-btn--skip {
  background: transparent;
  color: var(--a-text-muted);
  padding-left: 0; padding-right: 0;
}
.tour-btn--skip:hover { color: var(--a-text); }
.tour-btn--prev {
  background: var(--a-body-bg);
  color: var(--a-text);
  border: 1px solid var(--a-border);
  padding: 7px 11px;
}
.tour-btn--prev:hover { background: var(--a-border); }
.tour-btn--next { background: var(--a-primary); color: #fff; }
.tour-btn--next:hover { background: var(--a-primary-hover); }
.tour-btn--finish {
  background: var(--a-accent);
  color: var(--a-primary);
  font-weight: 700;
}
.tour-btn--finish:hover { background: var(--a-accent-dark); }

.tour-arrow {
  position: absolute;
  width: 0; height: 0;
  border: 9px solid transparent;
  pointer-events: none;
}
.tour-arrow--up    { border-bottom-color: var(--a-card-bg); top: -18px; }
.tour-arrow--down  { border-top-color: var(--a-card-bg); bottom: -18px; }
.tour-arrow--left  { border-right-color: var(--a-card-bg); left: -18px; }
.tour-arrow--right { border-left-color: var(--a-card-bg); right: -18px; }

.tour-help-btn {
  width: 28px; height: 28px;
  border-radius: 50%;
  border: 1.5px solid rgba(214,173,124,.4);
  background: rgba(214,173,124,.1);
  color: var(--a-accent);
  font-size: 13px;
  font-weight: 700;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: background 0.15s, border-color 0.15s, color 0.15s;
  flex-shrink: 0;
  font-family: inherit;
  line-height: 1;
}
@media (max-width: 767px) {
  .tour-help-btn { display: none; }
}
.tour-help-btn:hover {
  background: var(--a-accent);
  color: var(--a-primary);
  border-color: var(--a-accent);
}

/* ------------------------------------------------------------------ */
/* Page transition — barre de progression + fondu d'entrée            */
/* ------------------------------------------------------------------ */

#page-loader {
  position: fixed;
  top: 0; left: 0;
  width: 0;
  height: 3px;
  background: #d6ad7c;
  box-shadow: 0 0 10px rgba(214,173,124,.55), 0 0 3px rgba(214,173,124,.4);
  border-radius: 0 2px 2px 0;
  z-index: 99998;          /* under offline-banner (9999) */
  pointer-events: none;
  opacity: 1;
  transition: width .38s cubic-bezier(.4,0,.2,1), opacity .3s ease;
}
#page-loader.pld-fill { width: 80%; }
#page-loader.pld-done { width: 100%; opacity: 0; }

@media (prefers-reduced-motion: no-preference) {
  .page-content {
    animation: adminPageIn .28s ease-out both;
  }
  @keyframes adminPageIn {
    from { opacity: 0; transform: translateY(9px); }
    to   { opacity: 1; transform: translateY(0);   }
  }
}

/* ---- Offline banner ---- */
#offline-banner {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  z-index: 9999;
  background: #c62828;
  color: #fff;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 9px 16px;
  font-size: 13px;
  font-weight: 600;
  letter-spacing: 0.01em;
  text-align: center;
  box-shadow: 0 2px 8px rgba(0,0,0,.3);
}
#offline-banner svg { flex-shrink: 0; }
