/* Admin « Eventi » — complète assets/css/style.css */

.admin { background: var(--bg); min-height: 100vh; }
.admin-main { padding-top: clamp(24px, 5vw, 56px); padding-bottom: 96px; max-width: 880px; }
.admin-actions { display: flex; gap: 8px; }
.btn-sm { padding: 10px 16px; font-size: 14px; }
.btn-block { width: 100%; justify-content: center; }
.btn[disabled] { opacity: .55; pointer-events: none; }
.muted { color: var(--muted); }
.link { background: none; border: 0; padding: 0; font: inherit; color: var(--accent); text-decoration: underline; text-underline-offset: 3px; cursor: pointer; }

.panel { background: var(--surface); border-radius: var(--radius); padding: clamp(24px, 5vw, 48px); }
.panel h1 { font-size: clamp(34px, 6vw, 52px); margin: 14px 0 28px; }
.login { max-width: 460px; margin: 6vh auto 0; }

.admin-head { display: flex; flex-wrap: wrap; gap: 16px; align-items: flex-end; justify-content: space-between; margin-bottom: 20px; }
.admin-head h1 { font-size: clamp(40px, 7vw, 64px); }
.admin-head .label { margin-bottom: 14px; }
.admin .label::after { display: none; }

/* Jauge d'espace */
.usage { display: grid; gap: 8px; font-size: 13px; color: var(--muted); margin-bottom: 28px; }
.usage-bar { height: 6px; border-radius: 99px; background: var(--surface-2); overflow: hidden; }
.usage-bar i { display: block; height: 100%; border-radius: 99px; background: var(--accent); transition: width .6s var(--ease); }
.usage.alto .usage-bar i { background: var(--accent); }

/* Liste des événements */
.admin-list { display: grid; gap: 12px; }
.item {
  display: grid; grid-template-columns: 72px 1fr auto; gap: 16px; align-items: center;
  background: var(--surface); border-radius: 22px; padding: 14px;
}
.item-thumb { width: 72px; height: 72px; border-radius: 16px; object-fit: cover; background: var(--accent-soft); display: grid; place-items: center; color: var(--accent); font: 400 26px/1 var(--display); }
.item h3 { font-size: 22px; margin-bottom: 6px; line-height: 1.15; }
.item-meta { display: flex; flex-wrap: wrap; gap: 6px 10px; align-items: center; font-size: 13px; color: var(--muted); }
.chip { font: 500 11px/1 var(--sans); padding: 6px 9px; border-radius: 99px; background: #e3e6d2; color: var(--olive); }
.chip.bozza { background: var(--surface-2); color: var(--muted); }
.chip.passato { background: var(--accent-soft); color: #9a4f2e; }
.item-btns { display: flex; gap: 6px; }
.icon-btn {
  width: 44px; height: 44px; border-radius: 50%;
  border: 1px solid var(--line); background: var(--surface);
  display: grid; place-items: center; cursor: pointer;
  font-size: 22px; line-height: 1; color: var(--ink);
}
.icon-btn:hover { background: var(--bg); }
.icon-btn svg { width: 18px; height: 18px; }
.icon-btn.danger:hover { background: var(--accent-soft); border-color: var(--accent-soft); color: #9a4f2e; }
.empty { text-align: center; padding: 56px 24px; border: 1px dashed var(--line); border-radius: var(--radius); color: var(--muted); }
.empty h3 { font-size: 26px; color: var(--ink); margin-bottom: 8px; }
.undo-row { text-align: center; margin-top: 28px; font-size: 14px; }
@media (max-width: 560px) {
  .item { grid-template-columns: 56px 1fr; }
  .item-thumb { width: 56px; height: 56px; }
  .item-btns { grid-column: 1 / -1; justify-content: flex-end; }
}

/* Formulaire */
.field { display: grid; gap: 8px; margin-bottom: 18px; }
.field > span { font-size: 14px; font-weight: 500; }
.field small { font-weight: 400; color: var(--muted); }
.field input, .field textarea {
  width: 100%; font: 400 16px/1.4 var(--sans); color: var(--ink);
  padding: 14px 16px; border-radius: 14px;
  border: 1px solid var(--line); background: #fff;
  transition: border-color .2s, box-shadow .2s;
}
.field textarea { resize: vertical; min-height: 120px; }
.field input:focus, .field textarea:focus { outline: none; border-color: var(--accent); box-shadow: 0 0 0 4px rgba(155, 44, 31, .12); }
.field-row { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
@media (max-width: 480px) { .field-row { grid-template-columns: 1fr; } }
.form-error { color: #9a4f2e; font-size: 14px; min-height: 1.2em; margin: 0 0 12px; }

.switch { display: flex; align-items: center; gap: 12px; cursor: pointer; margin: 6px 0 18px; font-weight: 500; }
.switch input { position: absolute; opacity: 0; }
.switch-ui { width: 48px; height: 28px; border-radius: 99px; background: var(--line); position: relative; transition: background .2s; flex: none; }
.switch-ui::after { content: ""; position: absolute; top: 3px; left: 3px; width: 22px; height: 22px; border-radius: 50%; background: #fff; transition: transform .25s var(--ease); box-shadow: 0 1px 3px rgba(0, 0, 0, .2); }
.switch input:checked + .switch-ui { background: var(--accent); }
.switch input:checked + .switch-ui::after { transform: translateX(20px); }
.switch input:focus-visible + .switch-ui { outline: 2px solid var(--accent); outline-offset: 3px; }

/* Photos */
.photo-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(96px, 1fr)); gap: 10px; }
.photo { position: relative; aspect-ratio: 1; border-radius: 14px; overflow: hidden; background: var(--accent-soft); }
.photo img { width: 100%; height: 100%; object-fit: cover; }
.photo .icon-btn { position: absolute; top: 6px; right: 6px; width: 30px; height: 30px; font-size: 18px; background: rgba(251, 250, 246, .92); border: 0; }
.photo.nuova::after { content: "Nuova"; position: absolute; left: 6px; bottom: 6px; font: 500 10px/1 var(--sans); padding: 5px 7px; border-radius: 99px; background: var(--accent); color: #fff; }
.photo-add {
  aspect-ratio: 1; border-radius: 14px; border: 1.5px dashed var(--ochre);
  background: rgba(200, 150, 62, .1); color: var(--accent);
  display: grid; place-items: center; align-content: center; gap: 6px;
  font: 500 13px/1.2 var(--sans); cursor: pointer; text-align: center; padding: 8px;
}
.photo-add svg { width: 24px; height: 24px; }
.photo-add:hover { background: rgba(200, 150, 62, .2); }

/* Fenêtre d'édition */
.editor {
  width: min(640px, 100vw); max-height: 100dvh; margin: auto;
  border: 0; border-radius: var(--radius); padding: 0; background: var(--surface); color: var(--ink);
  box-shadow: 0 40px 80px -30px rgba(31, 36, 33, .5);
}
.editor::backdrop { background: rgba(31, 36, 33, .45); backdrop-filter: blur(4px); }
.editor form { padding: clamp(20px, 4vw, 36px); }
.editor-head { display: flex; justify-content: space-between; align-items: center; margin-bottom: 22px; }
.editor-head h2 { font-size: 32px; }
.editor-foot { display: flex; justify-content: flex-end; gap: 10px; position: sticky; bottom: 0; background: var(--surface); padding-top: 12px; }
@media (max-width: 640px) {
  .editor { width: 100vw; max-width: 100vw; height: 100dvh; max-height: 100dvh; border-radius: 0; margin: 0; }
  .editor-foot .btn { flex: 1; justify-content: center; }
}

/* Message temporaire */
.toast {
  position: fixed; left: 50%; bottom: 24px; z-index: 200;
  transform: translate(-50%, 20px); opacity: 0; pointer-events: none;
  background: var(--ink); color: var(--bg);
  padding: 14px 20px; border-radius: 99px; font-size: 14px;
  transition: opacity .25s, transform .25s var(--ease);
  max-width: calc(100vw - 32px);
}
.toast.show { opacity: 1; transform: translate(-50%, 0); }
.toast.errore { background: #9a4f2e; }
