/* Atelier BS · administration */

:root {
  --ivory: #f3eee6;
  --paper: #fbf9f5;
  --ink: #1d1a17;
  --ink-soft: #5d554c;
  --muted: #8a8177;
  --line: rgba(29, 26, 23, 0.12);
  --rose: #b98272;
  --rose-soft: #ecd9d1;
  --danger: #9b3b2e;
  --serif: "Cormorant", "Times New Roman", serif;
  --sans: "Jost", "Helvetica Neue", Arial, sans-serif;
  --ease: cubic-bezier(0.22, 0.61, 0.36, 1);
}

* { box-sizing: border-box; }
body { margin: 0; background: var(--ivory); color: var(--ink); font: 300 15px/1.55 var(--sans); -webkit-font-smoothing: antialiased; }
h1, h2, h3, p, ol { margin: 0; }
button, input, textarea { font: inherit; color: inherit; }
button { cursor: pointer; background: none; border: 0; padding: 0; }
[hidden] { display: none !important; }
:focus-visible { outline: 1px solid var(--rose); outline-offset: 3px; }

.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  padding: 12px 22px; background: var(--ink); color: var(--ivory);
  font: 400 11px/1 var(--sans); letter-spacing: 0.2em; text-transform: uppercase;
  transition: background 0.3s var(--ease);
}
.btn:hover { background: var(--rose); }
.btn-ghost { background: transparent; color: var(--ink); box-shadow: inset 0 0 0 1px var(--line); }
.btn-ghost:hover { background: var(--paper); box-shadow: inset 0 0 0 1px var(--ink); }
.btn-file { cursor: pointer; }
.link { font: 400 11px/1 var(--sans); letter-spacing: 0.18em; text-transform: uppercase; color: var(--ink-soft); text-decoration: none; }
.link:hover { color: var(--ink); }

/* Connexion */
.login { min-height: 100vh; display: grid; place-items: center; padding: 24px; }
.login-card { width: min(380px, 100%); display: grid; gap: 14px; text-align: center; }
.login-card img { width: 220px; height: auto; margin: 0 auto 12px; }
.login-card h1 { font: 300 30px/1.1 var(--serif); margin-bottom: 12px; }
.login-card label { text-align: left; font-size: 13px; color: var(--ink-soft); }
.login-card input { padding: 12px 14px; border: 1px solid var(--line); background: var(--paper); font-size: 16px; }
.login-error { min-height: 20px; color: var(--danger); font-size: 14px; }

/* Structure */
.top {
  position: sticky; top: 0; z-index: 5;
  display: flex; align-items: center; gap: 32px;
  padding: 14px clamp(16px, 4vw, 48px);
  background: rgba(243, 238, 230, 0.92); backdrop-filter: blur(10px);
  border-bottom: 1px solid var(--line);
}
.top-logo { height: 34px; width: auto; }
.tabs { display: flex; gap: 6px; flex-wrap: wrap; }
.tabs button { padding: 9px 14px; font: 400 12px/1 var(--sans); letter-spacing: 0.14em; text-transform: uppercase; color: var(--ink-soft); }
.tabs button[aria-selected="true"] { color: var(--ink); box-shadow: inset 0 -1px 0 var(--rose); }
.top-actions { margin-left: auto; display: flex; gap: 22px; }

.panel { max-width: 1180px; margin: 0 auto; padding: 40px clamp(16px, 4vw, 48px) 140px; }
.panel-head { display: flex; align-items: center; justify-content: space-between; gap: 16px; flex-wrap: wrap; margin-bottom: 24px; }
.panel-head h2 { font: 300 40px/1 var(--serif); }
.hint, .note { color: var(--muted); font-size: 14px; max-width: 70ch; margin-bottom: 24px; }
.note { margin: 28px 0 0; }

/* Audience */
.range { display: flex; box-shadow: inset 0 0 0 1px var(--line); }
.range button { padding: 9px 14px; font-size: 13px; color: var(--ink-soft); }
.range button[aria-pressed="true"] { background: var(--ink); color: var(--ivory); }
.tiles { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 16px; margin-bottom: 16px; }
.tile { background: var(--paper); padding: 22px 24px; display: grid; gap: 6px; }
.tile-label { font: 400 11px/1 var(--sans); letter-spacing: 0.18em; text-transform: uppercase; color: var(--ink-soft); display: flex; align-items: center; gap: 8px; }
.tile strong { font: 300 52px/1 var(--serif); font-variant-numeric: tabular-nums; }
.tile small { color: var(--muted); font-size: 13px; }
.pulse { width: 8px; height: 8px; border-radius: 50%; background: var(--rose); animation: pulse 2s infinite; }
@keyframes pulse { 0% { box-shadow: 0 0 0 0 rgba(185, 130, 114, 0.6); } 100% { box-shadow: 0 0 0 10px rgba(185, 130, 114, 0); } }

.chart-card { position: relative; margin: 0 0 16px; background: var(--paper); padding: 22px 24px 16px; }
.chart-card figcaption { font: 400 11px/1 var(--sans); letter-spacing: 0.18em; text-transform: uppercase; color: var(--ink-soft); margin-bottom: 18px; }
.chart svg { display: block; width: 100%; height: 220px; overflow: visible; }
.chart .bar { fill: var(--rose); }
.chart .bar-hit { fill: transparent; }
.chart .bar-hit:hover + .bar, .chart .is-hover { fill: #9e6a5b; }
.chart .grid { stroke: var(--line); stroke-width: 1; }
.chart .axis { fill: var(--muted); font: 400 11px var(--sans); }
.chart-tip {
  position: absolute; pointer-events: none; transform: translate(-50%, -100%);
  background: var(--ink); color: var(--ivory); padding: 8px 10px; font-size: 12px; white-space: nowrap;
}
.lists { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 16px; }
.list-card { background: var(--paper); padding: 20px 24px; }
.list-card h3 { font: 400 11px/1 var(--sans); letter-spacing: 0.18em; text-transform: uppercase; color: var(--ink-soft); margin-bottom: 14px; }
.list-card ol { list-style: none; padding: 0; display: grid; gap: 10px; }
.list-card li { display: grid; grid-template-columns: 1fr auto; gap: 4px 12px; font-size: 14px; }
.list-card li span:last-child { color: var(--ink-soft); font-variant-numeric: tabular-nums; }
.list-card li i { grid-column: 1 / -1; height: 4px; background: var(--rose-soft); border-radius: 0 2px 2px 0; }
.list-card li i b { display: block; height: 100%; background: var(--rose); border-radius: 0 2px 2px 0; }
.list-card .empty { color: var(--muted); }

/* Cartes */
.card { background: var(--paper); padding: 22px 24px; margin-bottom: 16px; display: grid; gap: 14px; }
.card-head { display: flex; align-items: center; gap: 12px; }
.title-input { flex: 1; border: 0; border-bottom: 1px solid var(--line); background: transparent; font: 300 28px/1.2 var(--serif); padding: 4px 0; }
.card-tools { display: flex; gap: 4px; }
.icon { width: 32px; height: 32px; display: inline-grid; place-items: center; color: var(--ink-soft); cursor: pointer; font-size: 16px; }
.icon:hover { background: var(--ivory); color: var(--ink); }
.icon.danger:hover { color: var(--danger); }
.field { display: grid; gap: 6px; font-size: 13px; color: var(--ink-soft); }
.field input, .field textarea, .form-grid input, .client input {
  padding: 10px 12px; border: 1px solid var(--line); background: #fff; color: var(--ink); font-size: 16px; resize: vertical;
}
details summary { cursor: pointer; font-size: 13px; color: var(--ink-soft); margin-bottom: 10px; }
details .field { margin-bottom: 10px; }

.photos { display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 10px; min-height: 110px; padding: 10px; border: 1px dashed var(--line); transition: background 0.3s; }
.photos.is-over { background: var(--rose-soft); }
.photo { position: relative; aspect-ratio: 3 / 2; background: var(--ivory); overflow: hidden; }
.photo img { width: 100%; height: 100%; object-fit: cover; display: block; }
.photo.is-main::after { content: "Principale"; position: absolute; left: 6px; top: 6px; background: var(--ink); color: var(--ivory); font-size: 10px; letter-spacing: 0.14em; text-transform: uppercase; padding: 4px 6px; }
.photo-tools { position: absolute; right: 4px; bottom: 4px; display: flex; gap: 2px; opacity: 0; transition: opacity 0.2s; }
.photo:hover .photo-tools, .photo:focus-within .photo-tools { opacity: 1; }
.photo-tools button { width: 28px; height: 28px; background: rgba(29, 26, 23, 0.8); color: var(--ivory); font-size: 13px; }
.photo-tools button:hover { background: var(--ink); }
.photo.is-loading { display: grid; place-items: center; color: var(--muted); font-size: 12px; }

.clients { display: grid; grid-template-columns: repeat(auto-fill, minmax(240px, 1fr)); gap: 16px; }
.client { margin: 0; }
.client-logo { height: 110px; display: grid; place-items: center; background: #16130f; padding: 18px; }
.client-logo img { max-width: 100%; max-height: 64px; filter: brightness(0) invert(0.93); }

.form-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 18px; max-width: 820px; }
.form-grid label { display: grid; gap: 6px; font-size: 13px; color: var(--ink-soft); }
.form-grid .wide { grid-column: 1 / -1; }

.savebar {
  position: fixed; left: 50%; bottom: 20px; transform: translateX(-50%); z-index: 10;
  display: flex; align-items: center; gap: 12px; padding: 10px 10px 10px 20px;
  background: var(--paper); box-shadow: 0 10px 40px rgba(29, 26, 23, 0.18);
}
.savebar span { font-size: 14px; color: var(--ink-soft); margin-right: 8px; }
.toast {
  position: fixed; left: 50%; bottom: 84px; transform: translate(-50%, 10px); z-index: 11;
  background: var(--ink); color: var(--ivory); padding: 10px 16px; font-size: 14px;
  opacity: 0; pointer-events: none; transition: opacity 0.3s, transform 0.3s;
}
.toast.is-on { opacity: 1; transform: translate(-50%, 0); }
.toast.is-error { background: var(--danger); }

@media (max-width: 820px) {
  .top { flex-wrap: wrap; gap: 12px; }
  .top-actions { margin-left: 0; }
  .tiles, .lists, .form-grid { grid-template-columns: 1fr; }
}

/* Changement de mot de passe */
.password { width: min(420px, calc(100% - 32px)); border: 0; padding: 32px; background: var(--paper); color: var(--ink); }
.password::backdrop { background: rgba(22, 19, 15, 0.55); }
.password form { display: grid; gap: 14px; }
.password h2 { font: 300 30px/1.1 var(--serif); margin-bottom: 6px; }
.password label { display: grid; gap: 6px; font-size: 13px; color: var(--ink-soft); }
.password input { padding: 11px 12px; border: 1px solid var(--line); background: #fff; font-size: 16px; }
.password .hint { margin: 0; font-size: 13px; }
.dialog-actions { display: flex; justify-content: flex-end; gap: 10px; margin-top: 6px; }
