/* ═══════════════════════════════════════════════════
   GRIFT — @font-face
═══════════════════════════════════════════════════ */
@font-face { font-family: 'Grift'; src: url('fonts/grift-thin.otf') format('opentype'), url('fonts/grift-thin.ttf') format('truetype'); font-weight: 100; font-style: normal; font-display: swap; }
@font-face { font-family: 'Grift'; src: url('fonts/grift-extralight.otf') format('opentype'), url('fonts/grift-extralight.ttf') format('truetype'); font-weight: 200; font-style: normal; font-display: swap; }
@font-face { font-family: 'Grift'; src: url('fonts/grift-light.otf') format('opentype'), url('fonts/grift-light.ttf') format('truetype'); font-weight: 300; font-style: normal; font-display: swap; }
@font-face { font-family: 'Grift'; src: url('fonts/grift-lightitalic.otf') format('opentype'), url('fonts/grift-lightitalic.ttf') format('truetype'); font-weight: 300; font-style: italic; font-display: swap; }
@font-face { font-family: 'Grift'; src: url('fonts/grift-regular.otf') format('opentype'), url('fonts/grift-regular.ttf') format('truetype'); font-weight: 400; font-style: normal; font-display: swap; }
@font-face { font-family: 'Grift'; src: url('fonts/grift-medium.otf') format('opentype'), url('fonts/grift-medium.ttf') format('truetype'); font-weight: 500; font-style: normal; font-display: swap; }
@font-face { font-family: 'Grift'; src: url('fonts/grift-semibold.otf') format('opentype'), url('fonts/grift-semibold.ttf') format('truetype'); font-weight: 600; font-style: normal; font-display: swap; }
@font-face { font-family: 'Grift'; src: url('fonts/grift-bold.otf') format('opentype'), url('fonts/grift-bold.ttf') format('truetype'); font-weight: 700; font-style: normal; font-display: swap; }
@font-face { font-family: 'Grift'; src: url('fonts/grift-extrabold.otf') format('opentype'), url('fonts/grift-extrabold.ttf') format('truetype'); font-weight: 800; font-style: normal; font-display: swap; }
@font-face { font-family: 'Grift'; src: url('fonts/grift-black.otf') format('opentype'), url('fonts/grift-black.ttf') format('truetype'); font-weight: 900; font-style: normal; font-display: swap; }

/* ═══════════════════════════════════════════════════
   ADMIN.CSS — Backoffice Hervé Thouément
═══════════════════════════════════════════════════ */

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

:root {
  --bg:       #0e0e0e;
  --bg2:      #161616;
  --bg3:      #1e1e1e;
  --bg4:      #252525;
  --border:   rgba(255,255,255,.07);
  --border2:  rgba(255,255,255,.13);
  --white:    #f0f0ee;
  --dim:      rgba(240,240,238,.45);
  --accent:   #d4c5a9;
  --green:    #4ade80;
  --red:      #f87171;
  --orange:   #fb923c;
  --font:     'Grift', sans-serif;
  --fontc:    'Grift', sans-serif;
  --radius:   6px;
}

html, body { height: 100%; }
body { background: var(--bg); color: var(--white); font-family: var(--font); font-size: 14px; font-weight: 300; overflow: hidden; }
a { text-decoration: none; color: inherit; }

/* ══ TOPBAR ══ */
.a-topbar {
  height: 52px;
  background: var(--bg2);
  border-bottom: 1px solid var(--border);
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 24px;
  flex-shrink: 0;
  position: fixed; top: 0; left: 0; right: 0; z-index: 200;
}
.a-topbar-left { display: flex; align-items: center; gap: 10px; }
.a-topbar-icon { font-size: 16px; color: var(--accent); }
.a-topbar-title { font-family: var(--fontc); font-size: 13px; font-weight: 500; letter-spacing: .06em; text-transform: uppercase; }
.a-topbar-sep { color: var(--border2); }
.a-topbar-sub { font-size: 12px; color: var(--dim); letter-spacing: .06em; }
.a-topbar-right { display: flex; align-items: center; gap: 12px; }
.a-save-status { font-size: 11px; color: var(--green); letter-spacing: .05em; }

/* ══ LAYOUT ══ */
.a-layout {
  display: grid;
  grid-template-columns: 280px 1fr;
  height: calc(100vh - 52px);
  margin-top: 52px;
}

/* ═ SIDEBAR ═ */
.a-sidebar {
  background: var(--bg2);
  border-right: 1px solid var(--border);
  display: flex;
  flex-direction: column;
  overflow: hidden;
}
.a-sidebar-head {
  padding: 20px 18px 16px;
  border-bottom: 1px solid var(--border);
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-shrink: 0;
}
.a-section-label {
  font-family: var(--fontc);
  font-size: 9px;
  letter-spacing: .08em;
  text-transform: uppercase;
  color: var(--dim);
}
.a-projects-list {
  list-style: none;
  overflow-y: auto;
  flex: 1;
  padding: 8px 0;
}
.a-projects-list::-webkit-scrollbar { width: 4px; }
.a-projects-list::-webkit-scrollbar-track { background: transparent; }
.a-projects-list::-webkit-scrollbar-thumb { background: var(--border2); border-radius: 2px; }

/* ── Item projet sidebar ── */
.a-project-item {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 10px 18px;
  cursor: pointer;
  border-left: 2px solid transparent;
  transition: background .2s, border-color .2s;
  user-select: none;
}
.a-project-item:hover { background: var(--bg3); }
.a-project-item.is-active { background: var(--bg3); border-left-color: var(--accent); }
.a-project-item.dragging { opacity: .4; }
.a-project-item.drag-over { background: var(--bg4); border-left-color: var(--accent); }

.a-project-item-thumb {
  width: 44px; height: 30px;
  background: var(--bg4) center/cover no-repeat;
  border-radius: 3px;
  flex-shrink: 0;
}
.a-project-item-info { flex: 1; min-width: 0; }
.a-project-item-num {
  font-family: var(--fontc); font-size: 9px; letter-spacing: .06em;
  color: var(--dim); display: block;
}
.a-project-item-title {
  font-family: var(--fontc); font-size: 12px; font-weight: 500;
  letter-spacing: .04em; text-transform: uppercase;
  color: var(--white); display: block;
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.a-project-item-type {
  font-size: 10px; color: var(--dim); display: block;
}
.a-project-item-drag {
  color: var(--border2); font-size: 14px; cursor: grab;
  padding: 2px 0 2px 4px;
}
.a-project-item-drag:active { cursor: grabbing; }

/* ═ PANEL ═ */
.a-panel {
  overflow-y: auto;
  background: var(--bg);
}
.a-panel::-webkit-scrollbar { width: 6px; }
.a-panel::-webkit-scrollbar-track { background: transparent; }
.a-panel::-webkit-scrollbar-thumb { background: var(--border2); border-radius: 3px; }

/* ── Empty state ── */
.a-empty-state {
  height: 100%;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 20px;
  color: var(--dim);
  text-align: center;
  line-height: 1.7;
  font-size: 13px;
}
.a-empty-icon { font-size: 36px; opacity: .2; }

/* ══ FORM ══ */
.a-form {
  display: flex;
  flex-direction: column;
  min-height: 100%;
}

/* ── Topbar form ── */
.a-form-topbar {
  position: sticky; top: 0; z-index: 100;
  background: var(--bg2);
  border-bottom: 1px solid var(--border);
  padding: 12px 32px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  flex-shrink: 0;
}
.a-form-topbar-left { display: flex; align-items: center; gap: 14px; }
.a-form-title-display {
  font-family: var(--fontc); font-size: 14px; font-weight: 500;
  letter-spacing: .04em; text-transform: uppercase;
}
.a-unsaved-badge {
  font-size: 11px; color: var(--orange); letter-spacing: .04em;
}
.a-form-topbar-right { display: flex; gap: 10px; align-items: center; }

/* ── Sections ── */
.a-section {
  padding: 36px 32px;
  border-bottom: 1px solid var(--border);
}
.a-section--minor { padding: 24px 32px; }
.a-section-title {
  font-family: var(--fontc); font-size: 12px; font-weight: 500;
  letter-spacing: .07em; text-transform: uppercase;
  color: var(--white);
  margin-bottom: 24px;
  display: flex; align-items: center; gap: 10px;
}
.a-section-hint {
  font-weight: 300; color: var(--dim); font-size: 10px; letter-spacing: .1em;
}

/* ── Grilles ── */
.a-grid { display: grid; gap: 16px; margin-bottom: 16px; }
.a-grid--4 { grid-template-columns: repeat(4, 1fr); }
.a-grid--3 { grid-template-columns: repeat(3, 1fr); }
@media (max-width: 1000px) {
  .a-grid--4 { grid-template-columns: repeat(2, 1fr); }
  .a-grid--3 { grid-template-columns: repeat(2, 1fr); }
}

/* ── Champs ── */
.a-field { display: flex; flex-direction: column; gap: 6px; margin-bottom: 16px; }
.a-field:last-child { margin-bottom: 0; }
.a-field--grow { flex: 1; }
.a-field label {
  font-family: var(--fontc); font-size: 10px; letter-spacing: .07em;
  text-transform: uppercase; color: var(--dim);
}
.a-label-hint { text-transform: none; letter-spacing: 0; }
.a-field-hint { font-size: 11px; color: var(--dim); margin-top: 4px; line-height: 1.5; }

input[type="text"],
input[type="url"],
textarea,
select {
  background: var(--bg3);
  border: 1px solid var(--border2);
  border-radius: var(--radius);
  color: var(--white);
  font-family: var(--font);
  font-size: 13px;
  font-weight: 300;
  padding: 10px 14px;
  transition: border-color .2s, background .2s;
  outline: none;
  resize: vertical;
  width: 100%;
}
input:focus, textarea:focus, select:focus {
  border-color: var(--accent);
  background: var(--bg4);
}
input::placeholder, textarea::placeholder { color: rgba(240,240,238,.2); }
.a-input--readonly {
  background: var(--bg2) !important;
  color: var(--dim) !important;
  cursor: default;
  font-family: monospace;
  font-size: 12px;
}

/* ── Radio ── */
.a-radio-group { display: flex; gap: 6px; flex-wrap: wrap; }
.a-radio {
  display: flex; align-items: center; gap: 7px;
  font-size: 13px; color: var(--white);
  background: var(--bg3); border: 1px solid var(--border2);
  border-radius: var(--radius); padding: 8px 14px;
  cursor: pointer; transition: border-color .2s, background .2s;
}
.a-radio:hover { border-color: var(--border2); background: var(--bg4); }
.a-radio input[type="radio"] {
  width: auto; padding: 0; background: none; border: none;
  accent-color: var(--accent);
}
.a-radio--sm { padding: 5px 10px; font-size: 11px; }

/* ── Media row ── */
.a-media-row { display: flex; gap: 16px; align-items: flex-start; }
.a-thumb-preview, .a-hero-preview {
  background: var(--bg3);
  border: 1px dashed var(--border2);
  border-radius: var(--radius);
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--dim);
  font-size: 11px;
  letter-spacing: .1em;
  overflow: hidden;
  background-size: cover;
  background-position: center;
}
.a-thumb-preview {
  width: 120px;
  height: 80px;
  flex-shrink: 0;
  position: relative;
}
.a-hero-preview {
  width: 100%;
  aspect-ratio: 21/9;
  margin-top: 12px;
  position: relative;
}
.a-hero-preview iframe,
.a-thumb-preview iframe {
  position: absolute; inset: 0;
  width: 100%; height: 100%;
  border: none;
}

/* ══ GALERIE ══ */
.a-gallery-list { display: flex; flex-direction: column; gap: 8px; margin-bottom: 16px; }

.a-gallery-item {
  display: flex;
  align-items: center;
  gap: 12px;
  background: var(--bg3);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 12px 14px;
  transition: border-color .2s;
}
.a-gallery-item:hover { border-color: var(--border2); }
.a-gallery-item.dragging { opacity: .4; }

.a-gallery-item-handle {
  color: var(--border2); font-size: 14px; cursor: grab; flex-shrink: 0; padding: 0 4px;
}
.a-gallery-item-handle:active { cursor: grabbing; }

.a-gallery-item-thumb {
  width: 72px; height: 48px;
  background: var(--bg4) center/cover no-repeat;
  border-radius: 3px;
  flex-shrink: 0;
  position: relative;
  overflow: hidden;
  display: flex; align-items: flex-end; justify-content: flex-start;
}

.a-video-badge {
  font-size: 9px; background: rgba(0,0,0,.7); padding: 2px 5px;
  letter-spacing: .05em; color: #fff;
}

.a-gallery-item-fields { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 8px; }
.a-gallery-type-group, .a-gallery-layout-group { display: flex; gap: 6px; flex-wrap: wrap; }
.a-gallery-url { margin: 0; }

.a-gallery-item-actions { display: flex; flex-direction: column; gap: 4px; flex-shrink: 0; }
.a-icon-btn {
  width: 28px; height: 28px;
  background: var(--bg4); border: 1px solid var(--border);
  border-radius: 4px; color: var(--dim);
  font-size: 13px; cursor: pointer;
  display: flex; align-items: center; justify-content: center;
  transition: color .2s, border-color .2s, background .2s;
}
.a-icon-btn:hover { color: var(--white); border-color: var(--border2); background: var(--bg3); }
.a-icon-btn--danger:hover { color: var(--red); border-color: var(--red); }

.a-btn-add-item {
  display: flex; align-items: center; gap: 10px;
  width: 100%; padding: 12px 16px;
  background: transparent; border: 1px dashed var(--border2);
  border-radius: var(--radius);
  color: var(--dim); font-family: var(--fontc); font-size: 11px;
  letter-spacing: .06em; text-transform: uppercase;
  cursor: pointer; transition: color .2s, border-color .2s, background .2s;
}
.a-btn-add-item:hover {
  color: var(--white); border-color: var(--accent); background: rgba(212,197,169,.05);
}

/* ══ BOUTONS ══ */
.a-btn {
  display: inline-flex; align-items: center; justify-content: center;
  gap: 6px; padding: 8px 18px;
  font-family: var(--fontc); font-size: 11px;
  font-weight: 500; letter-spacing: .06em; text-transform: uppercase;
  border-radius: var(--radius); cursor: pointer;
  transition: background .2s, color .2s, border-color .2s, opacity .2s;
  border: 1px solid transparent;
  white-space: nowrap;
}
.a-btn--primary {
  background: var(--accent); color: #0e0e0e; border-color: var(--accent);
}
.a-btn--primary:hover { background: #e8d9c0; }
.a-btn--ghost {
  background: transparent; color: var(--dim); border-color: var(--border2);
}
.a-btn--ghost:hover { color: var(--white); border-color: rgba(240,240,238,.3); }
.a-btn--danger {
  background: transparent; color: var(--red); border-color: rgba(248,113,113,.25);
}
.a-btn--danger:hover { background: rgba(248,113,113,.1); }

/* ══ MODAL ══ */
.a-modal-overlay {
  position: fixed; inset: 0; z-index: 1000;
  background: rgba(0,0,0,.7); backdrop-filter: blur(4px);
  display: flex; align-items: center; justify-content: center;
}
.a-modal {
  background: var(--bg2); border: 1px solid var(--border2);
  border-radius: 10px; padding: 36px 40px; max-width: 400px; width: 90%;
}
.a-modal-title {
  font-family: var(--fontc); font-size: 16px; font-weight: 500;
  letter-spacing: .04em; text-transform: uppercase; margin-bottom: 14px;
}
.a-modal-text { color: var(--dim); font-size: 13px; line-height: 1.7; margin-bottom: 28px; }
.a-modal-actions { display: flex; gap: 10px; justify-content: flex-end; }

/* ══ TOAST ══ */
.a-toast {
  position: fixed; bottom: 28px; right: 28px; z-index: 2000;
  background: var(--bg3); border: 1px solid var(--border2);
  border-radius: var(--radius);
  padding: 12px 22px;
  font-family: var(--fontc); font-size: 12px; letter-spacing: .05em; text-transform: uppercase;
  color: var(--white);
  transform: translateY(20px); opacity: 0;
  transition: transform .35s ease, opacity .35s ease;
  pointer-events: none;
}
.a-toast--visible { transform: translateY(0); opacity: 1; }
.a-toast--success { border-left: 3px solid var(--green); }
.a-toast--warn    { border-left: 3px solid var(--orange); }
.a-toast--error   { border-left: 3px solid var(--red); }

/* ══ TOPBAR USER ══ */
.a-topbar-user {
  font-family: var(--fontc);
  font-size: 10px;
  letter-spacing: .05em;
  text-transform: uppercase;
  color: var(--accent);
  background: rgba(212,197,169,.08);
  border: 1px solid rgba(212,197,169,.2);
  border-radius: 4px;
  padding: 4px 10px;
}

/* ══ SIDEBAR FOOTER ══ */
.a-sidebar-footer {
  padding: 10px 12px;
  border-top: 1px solid var(--border);
  flex-shrink: 0;
  display: flex;
  flex-direction: column;
  gap: 6px;
}
.a-sidebar-settings-btn {
  display: flex;
  align-items: center;
  gap: 8px;
  width: 100%;
  padding: 9px 12px;
  background: transparent;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  color: var(--dim);
  font-family: var(--fontc);
  font-size: 10px;
  letter-spacing: .05em;
  text-transform: uppercase;
  cursor: pointer;
  transition: color .2s, border-color .2s, background .2s;
}
.a-sidebar-settings-btn:hover {
  color: var(--white);
  border-color: var(--border2);
  background: var(--bg3);
}
.a-sidebar-settings-btn.is-active {
  color: var(--accent);
  border-color: var(--accent);
  background: rgba(212,197,169,.06);
}

/* ══ PANNEAUX (réglages + utilisateurs) ══ */
.a-settings-panel {
  display: flex;
  flex-direction: column;
  min-height: 100%;
}

/* ══ GRILLES COMPLÉMENTAIRES ══ */
.a-grid--2 { grid-template-columns: repeat(2, 1fr); }
@media (max-width: 800px) {
  .a-grid--2 { grid-template-columns: 1fr; }
}

/* ══ SOUS-TITRE DE SECTION ══ */
.a-subsection-title {
  font-family: var(--fontc);
  font-size: 10px;
  font-weight: 500;
  letter-spacing: .06em;
  text-transform: uppercase;
  color: var(--dim);
  margin: 24px 0 16px;
  padding-top: 20px;
  border-top: 1px solid var(--border);
}

/* ══ PETITS BOUTONS ══ */
.a-btn--sm {
  padding: 6px 12px;
  font-size: 10px;
  letter-spacing: .14em;
}

/* ══ MODAL AVEC FORMULAIRE ══ */
.a-modal--form {
  max-width: 440px;
}
.a-modal-body {
  display: flex;
  flex-direction: column;
  gap: 14px;
  margin: 20px 0;
}
.a-modal-error {
  font-size: 12px;
  color: var(--red);
  min-height: 16px;
  line-height: 1.5;
}

/* ══ LISTE UTILISATEURS ══ */
.a-users-list {
  display: flex;
  flex-direction: column;
  gap: 8px;
}
.a-users-empty {
  font-size: 13px;
  color: var(--dim);
  padding: 20px 0;
}
.a-user-row {
  display: flex;
  align-items: center;
  gap: 14px;
  background: var(--bg3);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 14px 16px;
  transition: border-color .2s;
}
.a-user-row:hover { border-color: var(--border2); }

.a-user-avatar {
  width: 38px; height: 38px;
  background: rgba(212,197,169,.12);
  border: 1px solid rgba(212,197,169,.2);
  border-radius: 50%;
  display: flex; align-items: center; justify-content: center;
  font-family: var(--fontc); font-size: 12px; font-weight: 500;
  letter-spacing: .03em; color: var(--accent);
  flex-shrink: 0;
}
.a-user-info {
  flex: 1; min-width: 0;
  display: flex; flex-direction: column; gap: 4px;
}
.a-user-name {
  font-family: var(--fontc); font-size: 13px; font-weight: 500;
  letter-spacing: .03em; color: var(--white);
}
.a-user-me {
  font-weight: 300; font-size: 11px; color: var(--accent);
  letter-spacing: .04em;
}
.a-user-meta {
  display: flex; align-items: center; gap: 10px;
}
.a-user-role {
  font-family: var(--fontc); font-size: 9px; letter-spacing: .06em;
  text-transform: uppercase; color: var(--accent);
  background: rgba(212,197,169,.1); border: 1px solid rgba(212,197,169,.18);
  border-radius: 3px; padding: 2px 7px;
}
.a-user-date {
  font-size: 11px; color: var(--dim);
}
.a-user-actions {
  display: flex; gap: 8px; flex-shrink: 0;
}
.a-user-actions button[disabled] {
  opacity: .25; cursor: not-allowed;
}

/* ═══════════════════════════════════════════════════
   UPLOAD
═══════════════════════════════════════════════════ */
.a-upload-row {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-top: 8px;
}
.a-btn-upload {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 6px 12px;
  background: transparent;
  border: 1px solid var(--border2);
  border-radius: var(--r);
  color: var(--text-dim);
  font-family: var(--font);
  font-size: 11px;
  font-weight: 500;
  letter-spacing: .06em;
  text-transform: uppercase;
  cursor: pointer;
  transition: border-color .2s, color .2s, background .2s;
  white-space: nowrap;
}
.a-btn-upload:hover {
  border-color: var(--accent);
  color: var(--accent);
  background: rgba(212,197,169,.05);
}
.a-btn-upload svg {
  flex-shrink: 0;
}
.a-upload-status {
  font-size: 11px;
  letter-spacing: .04em;
}
.a-upload-status--loading { color: var(--text-dim); }
.a-upload-status--ok      { color: #6fcf97; }
.a-upload-status--err     { color: #eb5757; }
