/* Espace gérant : poste de pilotage sombre, sidebar fixe, densité tableau.
   Même système de tokens que le site client (styles.css). */

.admin { background: #0f1113; color: var(--silver); }

.ad { display: grid; grid-template-columns: 248px minmax(0, 1fr); min-height: 100vh; }

/* ---------- sidebar ---------- */
.side {
  position: sticky; top: 0; height: 100vh;
  display: flex; flex-direction: column; gap: 2rem;
  padding: 1.5rem 1rem;
  background: linear-gradient(180deg, #16191c, #101215);
  border-right: 1px solid var(--line);
}
.side__brand { display: flex; align-items: center; gap: .7rem; padding-inline: .35rem; }
.side__crest { height: 34px; width: auto; display: block; flex: none; }
.side__brand .brand__mark { width: 32px; height: 32px; }
.side__brand .brand__mark svg { width: 19px; height: 19px; }
.side__brand .brand__name { font-size: .8rem; letter-spacing: .18em; }
.side__brand .brand__city { font-size: .62rem; }

.side__nav { display: flex; flex-direction: column; gap: .2rem; }
.side__link {
  display: block; width: 100%; text-align: start; cursor: pointer;
  background: none; border: 0; border-inline-start: 1px solid transparent; border-radius: 0;
  padding: .72rem .9rem;
  font-family: var(--font-display); font-size: .84rem; font-weight: 400; letter-spacing: .02em;
  color: var(--muted);
  text-decoration: none;
  transition: color .2s var(--ease), background .2s var(--ease), border-color .2s var(--ease);
}
.side__link:hover { color: var(--warm); background: rgba(241, 240, 236, .04); }
.side__link[aria-selected="true"] {
  color: var(--warm); background: var(--gold-soft); border-inline-start-color: var(--gold);
}
.side__foot { margin-top: auto; display: flex; flex-direction: column; gap: .1rem; border-top: 1px solid var(--line); padding-top: 1rem; }
.side__link--quiet { font-family: var(--font-body); font-size: .76rem; color: var(--muted); }
.side__link--quiet:hover { color: var(--gold); background: none; }

/* ---------- zone principale ---------- */
.main { min-width: 0; padding: 0 clamp(1.1rem, 3.4vw, 2.6rem) 4rem; }
.main__bar {
  position: sticky; top: 0; z-index: 8;
  display: flex; align-items: center; justify-content: space-between; gap: 1rem;
  margin-inline: calc(-1 * clamp(1.1rem, 3.4vw, 2.6rem));
  padding: 1.1rem clamp(1.1rem, 3.4vw, 2.6rem);
  background: rgba(15, 17, 19, .86); backdrop-filter: blur(14px);
  border-bottom: 1px solid var(--line);
}
.main__bar h1 { font-size: 1.15rem; font-weight: 400; letter-spacing: .01em; }

/* ---------- connexion ---------- */
.login { display: grid; place-items: center; min-height: 62vh; }
.login__form { width: min(390px, 100%); display: grid; gap: .9rem; }
.login__form h2 { font-size: clamp(1.6rem, 4vw, 2.1rem); }
.login__hint { color: var(--muted); font-size: .9rem; }
.login__form .field { margin-top: .6rem; }

/* ---------- panneaux ---------- */
.panel { display: grid; gap: 1.3rem; padding-top: 1.5rem; }
.panel__bar { display: flex; gap: .9rem; align-items: end; flex-wrap: wrap; }
.panel__bar--actions { align-items: center; }
.panel__hint { color: var(--muted); font-size: .87rem; }
.panel__count { margin-inline-start: auto; font-size: .74rem; letter-spacing: .12em; text-transform: uppercase; color: var(--muted); }
.notice {
  border: 1px solid rgba(192, 98, 90, .4); border-radius: var(--radius);
  background: rgba(192, 98, 90, .09); color: #e2a49e;
  padding: .7rem .9rem; font-size: .87rem;
}

/* ---------- cartes de chiffres ---------- */
.cards {
  list-style: none; margin: 0; padding: 0;
  display: grid; grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
  gap: 1px; background: var(--line); border: 1px solid var(--line);
}
.cards li {
  background: var(--graphite); padding: 1.35rem 1.4rem;
  transition: background .25s var(--ease);
}
.cards li:hover { background: var(--surface); }
.cards b {
  display: block; font-family: var(--font-display); font-size: 2.15rem; font-weight: 300; line-height: 1;
  color: var(--warm); font-variant-numeric: lining-nums tabular-nums;
}
.cards span {
  display: block; margin-top: .6rem; font-size: .66rem; color: var(--muted);
  letter-spacing: .16em; text-transform: uppercase; line-height: 1.5;
}
.cards li[data-accent="alert"] b { color: var(--gold); }
.cards li[data-accent="gold"] b { color: var(--gold); }

/* ---------- graphique ---------- */
.chartbox { background: var(--graphite); border: 1px solid var(--line); border-radius: var(--radius-lg); padding: 1.4rem; }
.chartbox__head { display: flex; align-items: baseline; justify-content: space-between; gap: 1rem; flex-wrap: wrap; margin-bottom: 1.2rem; }
.chartbox__head h2 { font-size: .95rem; font-weight: 600; letter-spacing: .1em; text-transform: uppercase; }
.chartbox__meta { font-size: .68rem; letter-spacing: .16em; text-transform: uppercase; color: var(--muted); }
#chartBox svg { width: 100%; height: auto; display: block; }
.chart-bar { fill: rgba(183, 187, 194, .28); transition: fill .25s var(--ease); }
.chart-bar--on { fill: var(--gold); }
.chart-label { fill: var(--muted); font-size: 10px; letter-spacing: .08em; text-transform: uppercase; }
.chart-value { fill: var(--warm); font-size: 11px; font-family: var(--font-display); }
.chart-empty { color: var(--muted); font-size: .88rem; }

/* ---------- tableau stock ---------- */
.table-wrap { background: var(--graphite); border: 1px solid var(--line); border-radius: var(--radius-lg); overflow: auto; }
.table { width: 100%; border-collapse: collapse; font-size: .89rem; }
.table th, .table td { padding: .9rem 1rem; text-align: start; border-bottom: 1px solid var(--line); vertical-align: middle; }
.table thead th {
  position: sticky; top: 0; z-index: 1;
  font-family: var(--font-body); font-size: .64rem; text-transform: uppercase; letter-spacing: .16em;
  color: var(--muted); background: var(--surface); font-weight: 600; white-space: nowrap;
  border-bottom: 1px solid var(--line-strong);
}
.table tbody tr:last-child td { border-bottom: 0; }
.table tbody tr:hover { background: rgba(241, 240, 236, .035); }
.ta-e { text-align: end; }
.cell-vehicle strong { display: block; font-family: var(--font-display); font-size: 1.02rem; color: var(--warm); font-weight: 400; }
.cell-vehicle span { color: var(--muted); font-size: .8rem; }
.featured-tag {
  font-style: normal; font-family: var(--font-body); font-size: .62rem; letter-spacing: .12em;
  text-transform: uppercase; color: var(--gold); margin-inline-start: .5rem; white-space: nowrap;
}
.table tbody tr[data-featured] { box-shadow: inset 2px 0 0 var(--gold); }
.cell-tech { color: var(--silver); font-size: .82rem; white-space: nowrap; }
.cell-price { font-family: var(--font-display); font-size: 1rem; color: var(--warm); white-space: nowrap; font-variant-numeric: tabular-nums; }
.row-actions { display: flex; gap: .95rem; justify-content: flex-end; flex-wrap: wrap; }
.row-actions .btn {
  padding: 0; font-size: .68rem; letter-spacing: .12em; text-transform: uppercase;
  background: none; border: 0; border-radius: 0; color: var(--muted); text-decoration: underline;
  text-underline-offset: 4px; text-decoration-thickness: 1px;
}
.row-actions .btn:hover { color: var(--gold); background: none; }
.row-actions .btn[data-danger]:hover { color: var(--bad); }
.pill {
  display: inline-flex; align-items: center; gap: .4rem;
  font-size: .62rem; font-weight: 600; letter-spacing: .16em; text-transform: uppercase;
  padding: .3rem .6rem; border-radius: var(--radius); border: 1px solid var(--line-strong);
  color: var(--silver); background: rgba(241, 240, 236, .04);
}
.pill--published { color: var(--good); border-color: rgba(91, 154, 118, .45); }
.pill--hidden { color: var(--muted); }
.pill--sold { color: var(--gold); border-color: rgba(184, 155, 98, .5); background: var(--gold-soft); }
.swatch { display: inline-block; width: 8px; height: 8px; border-radius: 50%; margin-inline-end: .5rem; vertical-align: baseline; border: 1px solid var(--line-strong); }

/* ---------- rendez-vous ---------- */
.appts { display: grid; gap: 1px; background: var(--line); border: 1px solid var(--line); border-radius: var(--radius-lg); overflow: hidden; }
.appt {
  background: var(--graphite); padding: 1.2rem 1.3rem;
  display: grid; gap: .9rem; grid-template-columns: minmax(0, 1fr) auto;
}
.appt__main { display: grid; gap: .3rem; min-width: 0; }
.appt h3 { font-family: var(--font-display); font-size: 1.02rem; font-weight: 400; color: var(--warm); }
.appt__meta { color: var(--muted); font-size: .84rem; }
.appt__note { font-size: .85rem; color: var(--silver); border-inline-start: 1px solid var(--gold); padding-inline-start: .8rem; margin-top: .3rem; }
.appt__side { display: grid; gap: .6rem; align-content: start; justify-items: end; }
.appt__actions { display: flex; gap: .5rem; }
.appt__actions .btn { padding: .3rem .7rem; font-size: .68rem; letter-spacing: .12em; text-transform: uppercase; border-radius: var(--radius); }
.appt__actions .btn:hover { color: var(--gold); background: rgba(241, 240, 236, .06); }
.appt__links { display: flex; gap: 1rem; flex-wrap: wrap; justify-content: flex-end; }
.appt__links a, .appt__links button {
  font: inherit; font-size: .68rem; letter-spacing: .12em; text-transform: uppercase;
  color: var(--muted); text-decoration: underline; text-underline-offset: 4px;
  background: none; border: 0; padding: 0; cursor: pointer;
}
.appt__links a:hover, .appt__links button:hover { color: var(--bad); }
.appt__links a:hover { color: var(--gold); }
.appt select {
  padding: .42rem .6rem; font-size: .82rem; color: var(--warm);
  background: rgba(241, 240, 236, .05); border: 1px solid var(--line-strong); border-radius: var(--radius);
}
.appt select option { background: var(--graphite); }
.appt[data-status="new"] { background: var(--surface); }
.appt[data-status="sold"] .appt__main h3::after { content: " ★"; color: var(--gold); }

/* ---------- formulaires ---------- */
.form-grid {
  display: grid; gap: 1.15rem; grid-template-columns: repeat(auto-fit, minmax(215px, 1fr));
  background: var(--graphite); border: 1px solid var(--line); border-radius: var(--radius-lg);
  padding: clamp(1.2rem, 3vw, 1.8rem);
}
.form-grid .field--full, .form-actions--full, .choice--full { grid-column: 1 / -1; }
.sheet .form-grid { border: 0; padding: 0; padding-inline-end: 2.5rem; background: none; }
.form-actions { display: flex; gap: 1rem; flex-wrap: wrap; align-items: center; }
.sheet__title { font-size: clamp(1.4rem, 3vw, 1.8rem); grid-column: 1 / -1; }
.stack { display: grid; gap: .5rem; }
.hours-edit { display: grid; gap: .1rem; border-block: 1px solid var(--line); }
.hours-row {
  display: grid; gap: .8rem; align-items: center;
  grid-template-columns: minmax(88px, 1fr) repeat(2, minmax(96px, auto)) auto;
  padding: .5rem 0; border-bottom: 1px solid var(--line);
}
.hours-row:last-child { border-bottom: 0; }
.hours-row input[type="time"] { padding: .42rem .55rem; }
.hours-row .choice { height: 32px; }
.badge-row { display: grid; gap: .5rem; grid-template-columns: repeat(2, 1fr); }
.choice--full { justify-content: start; width: fit-content; }
.sheet .error { grid-column: 1 / -1; }
.logo-preview { display: flex; align-items: center; gap: .8rem; margin: 0; }
.logo-preview img {
  width: 52px; height: 52px; object-fit: contain;
  background: var(--surface); border: 1px solid var(--line); padding: .3rem;
}

/* ---------- notification basse ---------- */
.toast {
  position: fixed; inset-inline: 0; bottom: 1.2rem; margin-inline: auto; width: fit-content;
  max-width: min(520px, calc(100vw - 2rem));
  background: var(--warm); color: var(--black); border-radius: var(--radius);
  padding: .75rem 1.3rem; font-size: .85rem; font-weight: 500; box-shadow: var(--shadow); z-index: 30;
}
.toast[data-kind="error"] { background: var(--bad); color: #fff; }

/* ---------- adaptatif ---------- */
@media (max-width: 900px) {
  .ad { grid-template-columns: minmax(0, 1fr); }
  .side {
    position: static; height: auto; flex-direction: row; align-items: center;
    gap: 1rem; flex-wrap: wrap; border-right: 0; border-bottom: 1px solid var(--line);
  }
  .side__nav { flex-direction: row; flex-wrap: wrap; gap: .2rem; }
  .side__link { padding: .5rem .7rem; font-size: .78rem; }
  .side__foot { margin-top: 0; margin-inline-start: auto; flex-direction: row; border-top: 0; padding-top: 0; }
}
@media (max-width: 720px) {
  .cards { grid-template-columns: 1fr 1fr; }
  .table thead { display: none; }
  .table, .table tbody, .table tr, .table td { display: block; width: 100%; }
  .table tr { border-bottom: 1px solid var(--line-strong); padding: .9rem 1rem; }
  .table td { border: 0; padding: .2rem 0; }
  .row-actions { justify-content: flex-start; }
  .appt { grid-template-columns: minmax(0, 1fr); }
  .appt__side { justify-items: start; }
  .appt__links { justify-content: flex-start; }
  .hours-row { grid-template-columns: 1fr 1fr; }
}
