/* ════════════════════════════════════════
   ABL28 Admin — style.css
   ════════════════════════════════════════ */

html, body { height: 100%; }

.screen { display: none; min-height: 100vh; }
.screen.active { display: flex; }

/* ── LOGIN ── */
#screenLogin {
  align-items: center; justify-content: center;
  flex-direction: column;
}
.login-box {
  background: var(--card-bg); border: 1px solid var(--border); border-radius: 12px;
  padding: clamp(44px,6vw,64px) clamp(36px,5vw,56px);
  width: min(460px, 92vw);
  display: flex; flex-direction: column; gap: 28px;
  animation: fadeUp 0.5s ease forwards;
}
.login-brand {
  font-family: var(--font-serif);
  font-size: 32px; letter-spacing: -0.02em;
}
.login-brand span { color: var(--red); }
.login-title { font-family: var(--font-serif); font-size: 22px; font-weight: 400; }
.login-sub   { font-size: 11px; color: var(--muted); letter-spacing: 0.1em; margin-top: 4px; }

.field-group { display: flex; flex-direction: column; gap: 6px; }
.field-label { font-size: 10px; letter-spacing: 0.2em; text-transform: uppercase; color: var(--muted); }
.field-input {
  width: 100%; padding: 10px 14px;
  border: 1px solid var(--border); border-radius: 6px;
  background: var(--bg); font-family: var(--font-mono); font-size: 13px; color: var(--text);
  outline: none; transition: border-color 0.2s;
}
.field-input:focus { border-color: var(--text); }
.field-input.err   { border-color: var(--red); }
.login-error { font-size: 11px; color: var(--red); display: none; letter-spacing: 0.05em; }
.btn-primary {
  width: 100%; padding: 12px; border-radius: 6px;
  background: var(--text); color: var(--bg); border: none; cursor: pointer;
  font-family: var(--font-mono); font-size: 12px; letter-spacing: 0.1em;
  transition: opacity 0.2s;
}
.btn-primary:hover { opacity: 0.82; }
.back-link {
  font-size: 10px; color: var(--muted); letter-spacing: 0.1em;
  cursor: pointer; text-align: center; text-decoration: none; transition: color 0.2s;
}
.back-link:hover { color: var(--text); }

/* ── DASHBOARD ── */
#screenDash { flex-direction: column; min-height: 100vh; }

.dash-header {
  display: flex; align-items: center; justify-content: space-between;
  padding: 14px clamp(16px,3vw,40px);
  background: var(--card-bg); border-bottom: 1px solid var(--border);
  position: sticky; top: 0; z-index: 100;
}
.dash-title {
  font-family: var(--font-serif); font-size: 20px; font-weight: 400; letter-spacing: -0.01em;
}
.dash-title span { color: var(--muted); font-family: var(--font-mono); font-size: 13px; letter-spacing: 0.05em; margin-left: 8px; }
.dash-actions { display: flex; gap: 10px; }

.btn-sm {
  padding: 7px 16px; border-radius: 5px;
  font-family: var(--font-mono); font-size: 10px; letter-spacing: 0.1em;
  cursor: pointer; border: 1px solid var(--border);
  background: var(--bg); color: var(--text); transition: all 0.2s;
}
.btn-sm:hover { border-color: var(--text); }
.btn-sm.danger { color: var(--red); border-color: rgba(225,6,0,0.3); }
.btn-sm.danger:hover { background: rgba(225,6,0,0.06); border-color: var(--red); }
.btn-sm.accent { background: var(--text); color: var(--bg); border-color: var(--text); }
.btn-sm.accent:hover { opacity: 0.82; }

.dash-body {
  flex: 1; padding: clamp(20px,3vw,40px);
  display: grid; grid-template-columns: 1fr 380px; gap: 24px;
  max-width: 1200px; width: 100%; margin: 0 auto;
}
@media (max-width: 900px) { .dash-body { grid-template-columns: 1fr; } }

.section-title {
  font-size: 10px; letter-spacing: 0.25em; text-transform: uppercase; color: var(--muted);
  margin-bottom: 14px; display: flex; align-items: center; justify-content: space-between;
}

/* Liste projets */
.projects-list { display: flex; flex-direction: column; gap: 10px; }
.project-item {
  background: var(--card-bg); border: 1px solid var(--border); border-radius: 8px;
  padding: 14px 16px; display: flex; align-items: center; gap: 14px;
  cursor: grab; transition: box-shadow 0.2s;
  animation: fadeUp 0.4s ease forwards; opacity: 0;
}
.project-item:active { cursor: grabbing; }
.project-item:hover  { box-shadow: 0 4px 16px rgba(0,0,0,0.07); }
.project-item.hidden-item { opacity: 0.4 !important; }
.drag-handle { color: var(--muted); font-size: 14px; cursor: grab; user-select: none; flex-shrink: 0; }
.pi-icon  { font-size: 22px; flex-shrink: 0; }
.pi-info  { flex: 1; min-width: 0; }
.pi-title { font-weight: 700; font-size: 13px; letter-spacing: 0.02em; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.pi-desc  { font-size: 10px; color: var(--muted); margin-top: 2px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.pi-tag   { font-size: 9px; letter-spacing: 0.15em; text-transform: uppercase; padding: 3px 9px; border-radius: 3px; background: var(--bg2); color: var(--muted); flex-shrink: 0; }
.pi-actions { display: flex; gap: 8px; flex-shrink: 0; }
.pi-btn {
  padding: 5px 10px; border-radius: 4px; border: 1px solid var(--border);
  background: none; cursor: pointer; font-family: var(--font-mono);
  font-size: 9px; letter-spacing: 0.1em; transition: all 0.15s; color: var(--text);
}
.pi-btn:hover { border-color: var(--text); }
.pi-btn.toggle-btn { color: var(--muted); }
.pi-btn.toggle-btn.is-hidden { color: var(--red); border-color: rgba(225,6,0,0.3); }

/* Formulaire */
.form-panel {
  background: var(--card-bg); border: 1px solid var(--border); border-radius: 10px;
  padding: 24px; display: flex; flex-direction: column; gap: 16px;
  height: fit-content; position: sticky; top: 80px;
}
.form-group { display: flex; flex-direction: column; gap: 6px; }
.form-label { font-size: 10px; letter-spacing: 0.2em; text-transform: uppercase; color: var(--muted); }
.form-input, .form-textarea, .form-select {
  width: 100%; padding: 9px 12px;
  border: 1px solid var(--border); border-radius: 5px;
  background: var(--bg); font-family: var(--font-mono); font-size: 12px; color: var(--text);
  outline: none; transition: border-color 0.2s; resize: vertical;
}
.form-input:focus, .form-textarea:focus, .form-select:focus { border-color: var(--text); }
.form-textarea     { min-height: 70px; }
.html-textarea     { min-height: 120px; font-size: 11px; }
.form-row          { display: flex; gap: 10px; }
.form-row .form-group { flex: 1; }
.form-divider      { height: 1px; background: var(--border); margin: 4px 0; }

/* ── TABS ── */
.dash-tabs { display:flex; gap:4px; }
.tab-btn { padding:6px 16px; border-radius:4px; font-family:var(--font-mono); font-size:10px; letter-spacing:0.1em; cursor:pointer; border:1px solid var(--border); background:none; color:var(--muted); transition:all 0.18s; }
.tab-btn:hover { border-color:var(--text); color:var(--text); }
.tab-btn.active { background:var(--text); color:var(--bg); border-color:var(--text); }
.tab-panel { display:none; }
.tab-panel.active { display:block; }

/* ── SYNC STATUS ── */
.sync-status { font-size:9px; color:var(--muted); letter-spacing:0.1em; margin-left:8px; }

/* ── APERÇU CARTE LIVE ── */
.card-preview-wrap {
  margin-bottom: 18px;
}
.cp-label {
  font-size: 9px; letter-spacing: 0.25em; text-transform: uppercase;
  color: var(--muted); margin-bottom: 10px;
}
.card-preview {
  background: var(--card-bg); border: 1px solid var(--border);
  border-radius: 8px; padding: 20px;
  display: flex; flex-direction: column;
  min-height: 160px; position: relative; overflow: hidden;
  transition: border-color 0.2s;
}
/* Barre couleur top selon style */
.card-preview::before {
  content: ''; position: absolute; top: 0; left: 0; right: 0; height: 2px;
  background: var(--border); transition: background 0.2s;
}
.card-preview.cls-raceline::before    { background: var(--red); }
.card-preview.cls-space-card::before  { background: #1a3a5c; }
.card-preview.cls-projects-card::before { background: #2d5a27; }

.cp-num   { font-size: 9px; color: var(--muted); letter-spacing: 0.2em; margin-bottom: 10px; }
.cp-icon  { font-size: 28px; margin-bottom: 8px; line-height: 1; min-height: 34px; }
.cp-title { font-family: var(--font-serif, "Georgia", serif); font-size: 18px; font-weight: 400; letter-spacing: -0.02em; margin-bottom: 6px; line-height: 1.2; color: var(--text); min-height: 22px; }
.cp-desc  { font-size: 10px; color: var(--muted); line-height: 1.6; flex: 1; margin-bottom: 12px; min-height: 14px; }
.cp-footer { display: flex; align-items: center; justify-content: space-between; border-top: 1px solid var(--border); padding-top: 10px; margin-top: auto; }
.cp-tag   { font-size: 8px; letter-spacing: 0.2em; text-transform: uppercase; padding: 3px 8px; border-radius: 3px; background: var(--text); color: #fff; }
.card-preview.cls-raceline .cp-tag { background: var(--red); }
.cp-arrow { font-size: 14px; color: var(--muted); }
.text-center { text-align: center; }

/* Form layout amélioré */
.form-row { display: flex; gap: 10px; flex-wrap: wrap; }
.form-row .form-group { flex: 1; min-width: 80px; }

/* ════════════════════════════════════════
   WIZARD ADMIN PROJETS
   ════════════════════════════════════════ */

/* Grille des projets */
.proj-grid-admin {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(200px, 220px));
  gap: 16px;
  padding: clamp(16px,2.5vw,32px);
  align-content: flex-start;
}

/* Carte + Nouveau */
.proj-add-card {
  width: 100%; height: 160px; border-radius: 14px;
  border: 1px dashed var(--border); background: var(--bg2);
  display: flex; flex-direction: column; align-items: center; justify-content: center;
  gap: 10px; cursor: pointer; transition: border-color 0.2s, background 0.2s;
}
.proj-add-card:hover { border-color: var(--red); background: rgba(225,6,0,0.03); }
.pac-plus { font-size: 28px; color: var(--border); transition: color 0.2s; }
.proj-add-card:hover .pac-plus { color: var(--red); }
.pac-label { font-size: 11px; color: var(--muted); letter-spacing: 0.1em; }

/* Carte projet existant */
.proj-admin-card {
  width: 100%; min-height: 160px; border-radius: 14px;
  border: 1px solid var(--border); background: var(--card-bg);
  padding: 16px; display: flex; flex-direction: column; gap: 6px;
  position: relative; cursor: pointer; transition: border-color 0.2s;
}
.proj-admin-card:hover { border-color: var(--text); }
.pac-actions { position: absolute; top: 10px; right: 10px; display: flex; gap: 4px; }
.pac-edit, .pac-del {
  background: none; border: none; cursor: pointer; font-size: 13px;
  color: var(--muted); padding: 2px 4px; border-radius: 3px; transition: color 0.15s;
}
.pac-edit:hover { color: var(--text); }
.pac-del:hover { color: var(--red); }
.pac-proj-title { font-family: var(--font-serif); font-size: 16px; font-weight: 400; }
.pac-proj-desc { font-size: 10px; color: var(--muted); line-height: 1.5; flex: 1; }
.pac-proj-meta { 
  font-size: 9px; color: var(--muted); letter-spacing: 0.1em;
  display: flex; gap: 6px; flex-wrap: wrap; margin-top: 4px;
}
.pac-meta-type, .pac-meta-status, .pac-meta-cat {
  padding: 2px 7px; border-radius: 3px;
  border: 1px solid var(--border);
  font-size: 8px; letter-spacing: 0.1em;
}
.pac-meta-type   { color: var(--muted); }
.pac-meta-status { color: var(--muted); }
.pac-meta-cat    { color: var(--muted); }

/* ── WIZARD OVERLAY ── */
.wizard-overlay {
  position: fixed; inset: 0; z-index: 500;
  background: rgba(26,25,23,0.6);
  display: none; align-items: center; justify-content: center;
  backdrop-filter: blur(2px);
}
.wizard-overlay.open { display: flex; }

.wizard-panel {
  background: var(--card-bg); border-radius: 16px;
  width: min(1100px, 95vw); max-height: 92vh;
  overflow: hidden; display: flex; flex-direction: column;
  box-shadow: 0 24px 80px rgba(0,0,0,0.2);
}

/* Header wizard */
.wizard-header {
  padding: clamp(24px,3vh,40px) clamp(24px,3vw,48px) 0;
  flex-shrink: 0;
}
.wiz-title {
  font-family: var(--font-serif); font-size: clamp(36px,5vw,72px);
  font-weight: 400; letter-spacing: -0.03em; color: rgba(255,255,255,0.15);
  line-height: 1; margin-bottom: 4px;
}
.wizard-panel { background: #1e1e1e; color: #eee; }
.wiz-sub { font-size: 11px; letter-spacing: 0.2em; color: rgba(255,255,255,0.35); text-transform: uppercase; }

/* Body wizard */
.wizard-body {
  flex: 1; overflow-y: auto; padding: clamp(16px,2.5vh,28px) clamp(20px,3vw,40px);
  display: grid; grid-template-columns: 1fr 1fr; gap: 24px;
}
.wizard-body-labels, .wizard-body-specs {
  grid-template-columns: 1fr; display: flex; flex-direction: column; gap: 12px;
}
.wizard-left, .wizard-right { display: flex; flex-direction: column; gap: 0; }

/* Inputs */
.w-label { font-size: 9px; letter-spacing: 0.2em; text-transform: uppercase; color: rgba(255,255,255,0.3); margin-bottom: 6px; }
.w-input {
  background: rgba(255,255,255,0.06); border: 1px solid rgba(255,255,255,0.1);
  border-radius: 6px; padding: 10px 12px; color: #fff; font-family: var(--font-mono);
  font-size: 12px; width: 100%; outline: none; transition: border-color 0.18s;
}
.w-input:focus { border-color: rgba(225,6,0,0.5); }
.w-input.w-big { font-size: 18px; padding: 12px; }
.w-textarea {
  background: rgba(255,255,255,0.06); border: 1px solid rgba(255,255,255,0.1);
  border-radius: 6px; padding: 10px 12px; color: #fff; font-family: var(--font-mono);
  font-size: 12px; width: 100%; min-height: 90px; resize: vertical; outline: none;
  transition: border-color 0.18s; line-height: 1.6;
}
.w-textarea:focus { border-color: rgba(225,6,0,0.5); }
.w-select {
  background: rgba(255,255,255,0.06); border: 1px solid rgba(255,255,255,0.1);
  border-radius: 6px; padding: 8px 10px; color: #fff; font-family: var(--font-mono);
  font-size: 11px; outline: none;
}

/* Zone visuelle */
.w-visual-zone { background: rgba(255,255,255,0.04); border: 1px solid rgba(255,255,255,0.08); border-radius: 10px; padding: 16px; display: flex; flex-direction: column; gap: 10px; flex: 1; }
.wvz-hint { display: flex; flex-direction: column; align-items: center; gap: 6px; padding: 12px 0; color: rgba(255,255,255,0.2); font-size: 11px; letter-spacing: 0.1em; }
.wvz-icon { font-size: 28px; opacity: 0.3; }
.wvz-sub { font-size: 9px; opacity: 0.6; }
.wvz-types { display: flex; flex-direction: column; gap: 4px; font-size: 10px; color: rgba(255,255,255,0.25); letter-spacing: 0.05em; }

/* Labels row */
.w-label-row { display: flex; flex-direction: column; gap: 8px; padding: 12px 0; border-bottom: 1px solid rgba(255,255,255,0.06); }
.w-label-row:last-child { border-bottom: none; }

/* Groupe boutons */
.w-btn-group { display: flex; flex-wrap: wrap; gap: 6px; }
.wbg-btn {
  background: rgba(255,255,255,0.06); border: 1px solid rgba(255,255,255,0.1);
  border-radius: 5px; padding: 6px 14px; color: rgba(255,255,255,0.5);
  font-family: var(--font-mono); font-size: 10px; letter-spacing: 0.1em;
  cursor: pointer; transition: all 0.15s;
}
.wbg-btn:hover { border-color: rgba(255,255,255,0.25); color: #fff; }
.wbg-btn.active { background: #E10600; border-color: #E10600; color: #fff; }

/* Tags catégorie */
.w-tags-wrap { display: flex; flex-wrap: wrap; gap: 6px; align-items: center; }
.w-cat-tag {
  background: rgba(255,255,255,0.06); border: 1px solid rgba(255,255,255,0.1);
  border-radius: 5px; padding: 5px 12px; color: rgba(255,255,255,0.5);
  font-family: var(--font-mono); font-size: 10px; letter-spacing: 0.1em;
  cursor: pointer; transition: all 0.15s;
}
.w-cat-tag.active { background: rgba(225,6,0,0.2); border-color: #E10600; color: #fff; }
.w-add-cat {
  background: none; border: 1px dashed rgba(255,255,255,0.15);
  border-radius: 5px; padding: 5px 12px; color: rgba(255,255,255,0.25);
  font-family: var(--font-mono); font-size: 10px; cursor: pointer; transition: all 0.15s;
}
.w-add-cat:hover { border-color: rgba(255,255,255,0.4); color: #fff; }

/* Liens */
.w-link-row { display: flex; gap: 8px; margin-bottom: 8px; align-items: center; }
.w-add-link { background: none; border: none; color: rgba(255,255,255,0.3); font-size: 11px; cursor: pointer; padding: 0; transition: color 0.15s; font-family: var(--font-mono); }
.w-add-link:hover { color: rgba(255,255,255,0.7); }

/* Specs grid */
.w-specs-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }

/* Carousel + embed settings */
.w-carousel-settings, .w-embed-settings { display: flex; gap: 16px; align-items: center; flex-wrap: wrap; margin-top: 8px; }
.w-check-row { display: flex; align-items: center; gap: 6px; font-size: 11px; color: rgba(255,255,255,0.5); cursor: pointer; }
.w-check-row input { accent-color: #E10600; }

/* Footer wizard */
.wizard-footer {
  display: flex; align-items: center; justify-content: space-between;
  padding: clamp(14px,2vh,22px) clamp(20px,3vw,40px);
  border-top: 1px solid rgba(255,255,255,0.06);
  flex-shrink: 0; background: var(--card-bg);
}
.wiz-steps { display: flex; gap: 6px; }
.ws { width: 24px; height: 3px; border-radius: 2px; background: rgba(255,255,255,0.15); transition: background 0.2s; }
.ws.active { background: #E10600; }

.wiz-btn-next, .wiz-btn-save {
  background: rgba(255,255,255,0.9); color: #1a1917; border: none; border-radius: 8px;
  padding: 12px 28px; font-family: var(--font-mono); font-size: 12px;
  letter-spacing: 0.1em; cursor: pointer; transition: background 0.18s;
  display: flex; align-items: center; gap: 8px;
}
.wiz-btn-next:hover, .wiz-btn-save:hover { background: #fff; }
.wiz-btn-save { background: #E10600; color: #fff; }
.wiz-btn-save:hover { background: #c50500; }
.wiz-btn-back {
  background: none; border: 1px solid rgba(255,255,255,0.15); border-radius: 8px;
  padding: 12px 20px; color: rgba(255,255,255,0.4); font-family: var(--font-mono);
  font-size: 12px; letter-spacing: 0.1em; cursor: pointer; transition: all 0.18s;
}
.wiz-btn-back:hover { border-color: rgba(255,255,255,0.4); color: rgba(255,255,255,0.8); }

/* ── Sélecteur N° ── */
.num-selector {
  display: flex;
  flex-wrap: wrap;
  gap: 4px;
  max-height: 90px;
  overflow-y: auto;
}
.num-btn {
  width: 34px; height: 28px;
  font-family: var(--mono); font-size: 10px; letter-spacing: .05em;
  border: 1px solid var(--border); border-radius: 4px;
  background: none; color: var(--text); cursor: pointer;
  transition: all .12s;
  flex-shrink: 0;
}
.num-btn:hover:not(:disabled) { border-color: var(--text); }
.num-btn.active { background: var(--text); color: var(--bg); border-color: var(--text); }
.num-btn.taken { opacity: 0.25; cursor: not-allowed; background: var(--bg2); }

/* ── Card preview styles selon classe ── */
.card-preview.raceline    { border-left: 3px solid #E10600; }
.card-preview.space-card  { border-left: 3px solid #2d6af7; }
.card-preview.projects-card { border-left: 3px solid #2db87c; }

/* ── Cartes projets système (builtins) ── */
.pac-builtin { opacity: 0.75; border-style: dashed !important; }
.pac-builtin-badge {
  font-size: 8px; letter-spacing: .15em; color: var(--muted);
  border: 1px solid var(--border); border-radius: 3px;
  padding: 2px 7px; font-family: var(--mono);
}
.pac-view {
  font-size: 10px; color: var(--muted); text-decoration: none;
  border: 1px solid var(--border); border-radius: 3px; padding: 3px 9px;
  transition: color .15s, border-color .15s;
}
.pac-view:hover { color: var(--text); border-color: var(--text); }
.pac-proj-icon { font-size: 22px; margin-bottom: 6px; }

/* ── Footer fixe admin ── */
.admin-footer {
  position: fixed; bottom: 0; left: 0; right: 0;
  background: var(--card-bg); border-top: 1px solid var(--border);
  padding: 10px clamp(16px,3vw,40px);
  display: flex; align-items: center; justify-content: space-between;
  font-size: 10px; color: var(--muted); letter-spacing: 0.08em;
  z-index: 50;
}
.admin-footer a { color: var(--muted); text-decoration: none; transition: color .15s; }
.admin-footer a:hover { color: var(--text); }
/* Padding bas pour ne pas être caché par le footer fixe */
#panelProjects { padding-bottom: 60px; }

/* ── Wizard step scrollable ── */
.wizard-step { display: flex; flex-direction: column; height: 100%; }
