/* =====================================================================
   CRM Les Foodelles — feuille de style principale
   Palette et composants extraits fidèlement de la maquette de design.
   ===================================================================== */

:root{
  --bg:#f7f4ef; --header:#fbf9f5; --card:#ffffff; --ink:#2b2422; --muted:#8a827a;
  --line:#ebe4da; --line2:#e7e0d6; --line3:#f0ece5; --line4:#f2eee7;
  --accent:#c8365a; --accent-dark:#b32d50; --sidebar:#241f1d; --sidebar-ink:#efe9e2;
  --faint:#faf7f2; --panel:#312a27;
}

*{ box-sizing:border-box; }
html,body{ margin:0; padding:0; }
body{
  font-family:'Manrope', system-ui, -apple-system, Segoe UI, Roboto, sans-serif;
  -webkit-font-smoothing:antialiased; color:var(--ink); background:var(--bg);
}
a{ color:var(--accent); text-decoration:none; }
a:hover{ color:#a82848; }
.serif{ font-family:'Instrument Serif', Georgia, serif; }
.mono{ font-family:'SFMono-Regular', ui-monospace, Menlo, Consolas, monospace; }

::-webkit-scrollbar{ width:10px; height:10px; }
::-webkit-scrollbar-thumb{ background:#d8d0c6; border-radius:20px; border:3px solid transparent; background-clip:content-box; }
::-webkit-scrollbar-track{ background:transparent; }

/* ---- Ossature ------------------------------------------------------ */
.app{ display:flex; height:100vh; width:100%; overflow:hidden; }
.sidebar{ width:244px; flex:none; background:var(--sidebar); color:var(--sidebar-ink);
  display:flex; flex-direction:column; padding:22px 16px; }
.main{ flex:1; display:flex; flex-direction:column; min-width:0; }
.topbar{ flex:none; display:flex; align-items:center; gap:16px; padding:18px 30px;
  background:var(--header); border-bottom:1px solid var(--line); }
.content{ flex:1; overflow-y:auto; padding:28px 30px 40px; }

/* ---- Sidebar ------------------------------------------------------- */
.brand{ display:flex; align-items:center; gap:11px; padding:6px 8px 22px; }
.brand img{ width:42px; height:42px; border-radius:50%; flex:none; object-fit:cover; }
.brand-mono{ width:42px; height:42px; border-radius:50%; flex:none; display:inline-flex; align-items:center;
  justify-content:center; color:#fff; font-weight:800; font-size:16px; }
.brand-name{ font-family:'Instrument Serif',serif; font-size:22px; line-height:1; }
.brand-sub{ font-size:11px; letter-spacing:.12em; text-transform:uppercase; color:#a29a90; }
.side-cobrand{ text-align:center; font-size:11px; color:#7c746b; padding:12px 0 2px; letter-spacing:.03em; }
.side-cobrand b{ color:#a29a90; }
.impersonate-bar{ flex:none; display:flex; align-items:center; justify-content:space-between; gap:12px;
  background:#241f1d; color:#efe9e2; padding:9px 30px; font-size:13px; }
.impersonate-bar button{ background:#c8365a; color:#fff; border:none; border-radius:9px; padding:6px 13px;
  font-size:12.5px; font-weight:700; font-family:inherit; cursor:pointer; }
.side-label{ font-size:10.5px; letter-spacing:.14em; text-transform:uppercase; color:#7c746b; padding:8px 10px 6px; }
.side-nav{ display:flex; flex-direction:column; gap:3px; }
.nav-item{ display:flex; align-items:center; gap:12px; padding:10px 12px; border-radius:11px;
  font-size:14px; font-weight:600; border:none; cursor:pointer; width:100%; text-align:left;
  font-family:inherit; background:transparent; color:#c9bfb5; text-decoration:none; }
.nav-item:hover{ background:var(--panel); color:var(--sidebar-ink); }
.nav-item.active{ background:var(--accent); color:#fff; }
.nav-item.disabled{ color:#8a827a; cursor:default; }
.nav-item.disabled:hover{ background:transparent; color:#8a827a; }
.nav-badge{ margin-left:auto; background:var(--accent); color:#fff; font-size:11px; font-weight:700; padding:1px 8px; border-radius:20px; }
.nav-item.active .nav-badge{ background:#fff; color:var(--accent); }
.side-user{ margin-top:auto; display:flex; align-items:center; gap:11px; padding:11px 10px; background:var(--panel); border-radius:14px; }
.side-user .av{ width:36px; height:36px; border-radius:50%; color:#fff; display:flex; align-items:center; justify-content:center; font-weight:700; font-size:14px; }
.side-user .nm{ font-size:13.5px; font-weight:700; white-space:nowrap; }
.side-user .rl{ font-size:11.5px; color:#a29a90; }

/* ---- Header -------------------------------------------------------- */
.page-title{ font-family:'Instrument Serif',serif; font-size:27px; line-height:1; }
.page-sub{ font-size:13px; color:var(--muted); margin-top:3px; }
.searchbox{ display:flex; align-items:center; gap:9px; background:#fff; border:1px solid var(--line2);
  border-radius:11px; padding:9px 14px; color:var(--muted); font-size:13.5px; }
.searchbox input{ border:none; outline:none; background:transparent; font-family:inherit; font-size:13.5px; color:var(--ink); width:100%; }
.chip-month{ display:flex; align-items:center; gap:8px; background:#fff; border:1px solid var(--line2);
  border-radius:11px; padding:9px 14px; font-size:13.5px; font-weight:600; }

/* ---- Cartes -------------------------------------------------------- */
.card{ background:var(--card); border:1px solid var(--line); border-radius:18px; }
.card.pad{ padding:22px; }
.card-title{ font-weight:700; font-size:15px; }
.card-sub{ font-size:12.5px; color:var(--muted); margin-top:2px; }
.dark-card{ background:var(--sidebar); color:var(--sidebar-ink); border-radius:18px; }

/* ---- Boutons ------------------------------------------------------- */
.btn{ display:inline-flex; align-items:center; gap:8px; border-radius:11px; padding:10px 16px;
  font-size:13.5px; font-weight:700; cursor:pointer; font-family:inherit; border:1px solid transparent; }
.btn-primary{ background:var(--accent); color:#fff; border:none; box-shadow:0 6px 16px -6px rgba(200,54,90,.6); }
.btn-primary:hover{ background:var(--accent-dark); color:#fff; }
.btn-ghost{ background:#fff; border:1px solid var(--line2); color:var(--ink); }
.btn-ghost:hover{ background:var(--faint); }
.btn-sm{ padding:8px 15px; font-size:13px; border-radius:11px; }
.btn[disabled]{ cursor:not-allowed; opacity:.7; }

/* ---- Champs -------------------------------------------------------- */
.field{ width:100%; box-sizing:border-box; font-family:inherit; font-size:14px; color:var(--ink);
  border:1px solid var(--line2); border-radius:11px; padding:11px 13px; background:#fff; outline:none; }
.field:focus{ border-color:var(--accent); }
textarea.field{ resize:vertical; line-height:1.45; }
.field-label{ font-size:11px; letter-spacing:.06em; text-transform:uppercase; color:var(--muted); font-weight:700; margin-bottom:7px; }

/* ---- Tables -------------------------------------------------------- */
.thead{ background:var(--faint); border-bottom:1px solid var(--line); font-size:11px;
  letter-spacing:.06em; text-transform:uppercase; color:var(--muted); font-weight:700; }
.row-link{ cursor:pointer; }
.row-link:hover{ background:var(--faint); }

/* ---- Divers -------------------------------------------------------- */
.flash-wrap{ position:fixed; top:16px; right:16px; z-index:50; display:flex; flex-direction:column; gap:8px; }
.flash{ padding:12px 16px; border-radius:12px; font-size:13.5px; font-weight:600; box-shadow:0 8px 24px -8px rgba(0,0,0,.25); }
.flash.success{ background:#4fb07a; color:#fff; }
.flash.error{ background:#c8365a; color:#fff; }
.flash.info{ background:#241f1d; color:#efe9e2; }

.filter-pill{ padding:8px 15px; border-radius:11px; font-size:13px; font-weight:600; cursor:pointer;
  background:#fff; border:1px solid var(--line2); color:#4a423d; text-decoration:none; display:inline-block; }
.filter-pill.active{ background:var(--sidebar); color:#fff; border-color:var(--sidebar); }

.tab-switch{ display:flex; gap:4px; background:var(--line3); border:1px solid var(--line2); border-radius:13px; padding:4px; width:fit-content; }
.tab-btn{ border:none; border-radius:10px; padding:9px 18px; font-size:13.5px; font-weight:700; font-family:inherit; cursor:pointer; background:transparent; color:var(--muted); text-decoration:none; }
.tab-btn.active{ background:#fff; color:var(--ink); box-shadow:0 1px 3px rgba(0,0,0,.08); }

/* modale simple */
.modal-overlay{ position:fixed; inset:0; background:rgba(30,25,22,.45); display:flex; align-items:flex-start; justify-content:center; padding:60px 20px; z-index:60; overflow-y:auto; }
.modal{ background:#fff; border-radius:18px; width:100%; max-width:560px; padding:26px; box-shadow:0 30px 60px -20px rgba(0,0,0,.4); }
.modal h3{ margin:0 0 4px; font-family:'Instrument Serif',serif; font-weight:400; font-size:24px; }

/* login */
.auth-wrap{ min-height:100vh; display:flex; align-items:center; justify-content:center; background:var(--bg); padding:24px; }
.auth-card{ background:#fff; border:1px solid var(--line); border-radius:22px; padding:34px; width:100%; max-width:400px; box-shadow:0 30px 60px -30px rgba(0,0,0,.25); }
