/* =========================================================================
   admin.css — Outil Agenda (sous-module /agenda/)
   Palette alignée sur tokens.css du projet global (crème + ink + halle).
   ========================================================================= */

:root{
  --cream:#FBF9F2; --bone:#E5E4DD; --ink:#1E1E1E; --mauve:#84746F;
  --border:#DDD8CC; --border-soft:#ECE7DC; --text:#1E1E1E; --text-2:#4F4A45;
  --h610:#FFD23F; --h610-strong:#E5B62B; --hv:#FF6B1A; --hv-strong:#D9530A;
  --accent:var(--hv); --accent-strong:var(--hv-strong);
  --radius:14px; --shadow:0 10px 30px -16px rgba(0,0,0,.25);
}
html[data-halle="h610"]{ --accent:var(--h610-strong); --accent-strong:#C99A1F; }

*{ box-sizing:border-box; }
/* L'attribut HTML `hidden` doit TOUJOURS l'emporter (sinon .boot/.modal-backdrop
   en display:grid restent visibles → modale ouverte au chargement). */
[hidden]{ display:none !important; }
body{
  margin:0; background:var(--cream); color:var(--text);
  font-family:"Segoe UI",system-ui,-apple-system,sans-serif; font-size:15px;
}
.boot{ display:grid; place-items:center; height:100vh; color:var(--mauve); font-size:14px; }

/* ---------- Top bar ---------- */
.topbar{
  display:flex; align-items:center; gap:20px; padding:12px 22px;
  background:#fff; border-bottom:1px solid var(--border); position:sticky; top:0; z-index:20;
}
.brand{ display:flex; align-items:center; gap:9px; font-size:16px; }
.logo-dot{ width:12px; height:12px; border-radius:50%; background:var(--accent); }
.halle-switch{ display:flex; gap:6px; margin-left:8px; background:var(--cream);
  border:1px solid var(--border); border-radius:999px; padding:4px; }
.hs-btn{ border:none; background:transparent; padding:7px 16px; border-radius:999px;
  cursor:pointer; font-weight:600; color:var(--text-2); font-size:13.5px; }
.hs-btn.is-active{ background:var(--accent); color:#fff; }
html[data-halle="h610"] .hs-btn.is-active{ color:var(--ink); }
.user-box{ margin-left:auto; display:flex; align-items:center; gap:14px; font-size:13px; color:var(--text-2); }
.link-out{ color:var(--mauve); text-decoration:none; }
.link-out:hover{ text-decoration:underline; }

/* ---------- Tabs ---------- */
.tabs{ display:flex; gap:4px; padding:0 22px; background:#fff; border-bottom:1px solid var(--border); }
.tab{ border:none; background:transparent; padding:13px 18px; cursor:pointer;
  font-weight:600; color:var(--text-2); border-bottom:3px solid transparent; font-size:14px; }
.tab.is-active{ color:var(--text); border-bottom-color:var(--accent); }

/* ---------- Content / panels ---------- */
.content{ max-width:1080px; margin:0 auto; padding:24px 22px 60px; }
.panel{ display:none; }
.panel.is-active{ display:block; animation:fade .2s ease; }
@keyframes fade{ from{ opacity:0; transform:translateY(4px);} to{ opacity:1; transform:none;} }
.panel-head{ display:flex; align-items:center; gap:16px; margin-bottom:18px; flex-wrap:wrap; }
.panel-head h2{ font-size:20px; margin:0; }
.month-filter{ display:flex; align-items:center; gap:7px; font-size:13px; font-weight:600; color:var(--text-2); }
.month-filter input{ border:1px solid var(--border); border-radius:10px; padding:7px 10px; font:inherit; font-size:13.5px; background:#fff; color:var(--text); }
.month-filter input:focus{ outline:none; border-color:var(--accent); }
.head-actions{ margin-left:auto; display:flex; gap:8px; flex-wrap:wrap; }

/* ---------- Buttons ---------- */
.btn{ border:1px solid var(--border); background:#fff; color:var(--text);
  padding:9px 16px; border-radius:999px; cursor:pointer; font-weight:600; font-size:13.5px; }
.btn:hover{ border-color:var(--border-soft); background:var(--cream); }
.btn.primary{ background:var(--ink); color:#fff; border-color:var(--ink); }
.btn.primary:hover{ background:#2E2E2E; }
.btn.ghost{ background:transparent; }
.btn.danger{ color:#b3261e; border-color:#f0c9c5; }

/* ---------- Import zone ---------- */
.import-zone{ background:#fff; border:1px dashed var(--border-strong,#B8B2A4);
  border-radius:var(--radius); padding:16px; margin-bottom:18px; }
.import-grid{ display:flex; align-items:center; gap:14px; margin-bottom:10px; flex-wrap:wrap; }
.drop{ display:inline-block; background:var(--cream); border:1px solid var(--border);
  border-radius:10px; padding:10px 16px; cursor:pointer; font-weight:600; font-size:13.5px; }
.or{ color:var(--mauve); font-size:13px; }
#csvPaste{ width:100%; font-family:ui-monospace,Menlo,monospace; font-size:12.5px;
  border:1px solid var(--border); border-radius:10px; padding:10px; resize:vertical; }
.import-foot{ display:flex; align-items:center; justify-content:space-between; gap:14px; margin-top:10px; flex-wrap:wrap; }
.import-foot small{ color:var(--mauve); }

/* ---------- Table ---------- */
.table-wrap{ background:#fff; border:1px solid var(--border); border-radius:var(--radius); overflow:hidden; }
table.grid{ width:100%; border-collapse:collapse; font-size:13.5px; }
table.grid th{ text-align:left; padding:11px 14px; background:var(--cream);
  color:var(--text-2); font-weight:700; border-bottom:1px solid var(--border); white-space:nowrap; }
table.grid td{ padding:11px 14px; border-bottom:1px solid var(--border-soft); vertical-align:middle; }
table.grid tr:last-child td{ border-bottom:none; }
table.grid tr:hover td{ background:#fcfbf6; }
.cell-date{ font-weight:700; white-space:nowrap; }
.cell-nom{ font-weight:600; }
.swatch{ display:inline-block; width:12px; height:12px; border-radius:50%; vertical-align:middle; margin-right:5px; }
.pill-mini{ font-size:11px; color:var(--text-2); background:var(--cream);
  border:1px solid var(--border); border-radius:999px; padding:2px 8px; }
.row-actions{ display:flex; gap:6px; justify-content:flex-end; }
.icon-btn{ border:1px solid var(--border); background:#fff; border-radius:8px;
  width:30px; height:30px; cursor:pointer; font-size:14px; line-height:1; }
.icon-btn:hover{ background:var(--cream); }
.icon-btn.del:hover{ border-color:#f0c9c5; color:#b3261e; }
.empty-state{ padding:40px; text-align:center; color:var(--mauve); }

/* ---------- Forms ---------- */
.form-card{ background:#fff; border:1px solid var(--border); border-radius:var(--radius); padding:22px; }
.form-card label, .modal-body label{ display:block; font-size:13px; font-weight:600;
  color:var(--text-2); margin-bottom:14px; }
.form-card input, .form-card textarea, .modal-body input, .modal-body select, .modal-body textarea{
  display:block; width:100%; margin-top:5px; padding:9px 11px; font-size:14px;
  border:1px solid var(--border); border-radius:10px; background:#fff; color:var(--text);
  font-family:inherit; }
.form-card input:focus, .modal-body input:focus, .modal-body select:focus, .modal-body textarea:focus,
.form-card textarea:focus{ outline:none; border-color:var(--accent); }
.form-row{ display:flex; gap:14px; flex-wrap:wrap; }
.form-row > label{ flex:1; min-width:160px; }
fieldset{ border:1px solid var(--border-soft); border-radius:12px; padding:14px 16px 2px; margin:0 0 14px; }
legend{ font-size:12px; font-weight:700; color:var(--mauve); text-transform:uppercase; letter-spacing:.05em; padding:0 6px; }
label.check{ display:flex; align-items:center; gap:8px; font-weight:600; }
label.check input{ width:auto; margin:0; }

/* ---------- Cards (outils) ---------- */
.cards{ display:grid; grid-template-columns:repeat(auto-fit,minmax(280px,1fr)); gap:16px; }
.tool-card{ display:block; background:#fff; border:1px solid var(--border); border-radius:var(--radius);
  padding:22px; text-decoration:none; color:inherit; transition:.15s; }
.tool-card:hover{ border-color:var(--accent); box-shadow:var(--shadow); }
.tool-card h3{ margin:0 0 8px; font-size:17px; }
.tool-card p{ margin:0 0 14px; color:var(--text-2); font-size:13.5px; line-height:1.5; }
.chip{ display:inline-block; background:var(--cream); border:1px solid var(--border);
  border-radius:999px; padding:6px 14px; font-size:12.5px; font-weight:600; color:var(--accent-strong); }

/* ---------- Modal ---------- */
.modal-backdrop{ position:fixed; inset:0; background:rgba(20,18,15,.45);
  display:grid; place-items:center; z-index:50; padding:18px; }
.modal{ background:#fff; border-radius:18px; width:min(560px,100%); max-height:92vh;
  overflow:auto; box-shadow:0 30px 80px -30px rgba(0,0,0,.5); }
.modal-head{ display:flex; align-items:center; justify-content:space-between;
  padding:18px 22px; border-bottom:1px solid var(--border-soft); position:sticky; top:0; background:#fff; }
.modal-head h3{ margin:0; font-size:18px; }
.modal-close{ border:none; background:transparent; font-size:26px; line-height:1; cursor:pointer; color:var(--mauve); }
.modal-body{ padding:20px 22px; }
.modal-foot{ display:flex; justify-content:flex-end; gap:10px; margin-top:8px; }

/* ---------- Toast ---------- */
.toast{ position:fixed; bottom:24px; left:50%; transform:translateX(-50%);
  background:var(--ink); color:#fff; padding:12px 20px; border-radius:999px; font-size:13.5px;
  box-shadow:var(--shadow); z-index:60; }
.toast.err{ background:#b3261e; }

@media (max-width:640px){
  .halle-switch{ order:3; width:100%; margin:8px 0 0; justify-content:center; }
  .topbar{ flex-wrap:wrap; }
  table.grid .hide-sm{ display:none; }
}
