/* ============================================================
   PRESTIGE EVENT LOCATION — App de gestion
   Charte : Bleu Nuit #1A1E2E · Or Prestige #B8972D
   Titres : Georgia / Cormorant Garamond · Corps : Montserrat
   ============================================================ */

:root {
  /* Brand */
  --navy: #1A1E2E;
  --navy-2: #232838;
  --navy-3: #2C3242;
  --navy-line: #353b4d;
  --gold: #B8972D;
  --gold-deep: #9A7E20;
  --gold-soft: #E7DBB4;
  --gold-tint: #F6F1E2;

  /* Neutrals (warm) */
  --bg: #F4F2EC;
  --surface: #FFFFFF;
  --surface-2: #FBFAF6;
  --ink: #1A1E2E;
  --ink-2: #4A4F5E;
  --ink-3: #868B98;
  --border: #E6E2D7;
  --border-2: #EFEDE5;

  /* Status (muted, professional) */
  --st-draft-fg:#6E727E; --st-draft-bg:#EEEFF1;
  --st-pending-fg:#9A6B12; --st-pending-bg:#F8EFD9;
  --st-confirmed-fg:#2F6B4F; --st-confirmed-bg:#E6F0E9;
  --st-progress-fg:#2C4C7C; --st-progress-bg:#E7EDF6;
  --st-closed-fg:#6E727E; --st-closed-bg:#EDEEF0;
  --st-danger-fg:#A33A2D; --st-danger-bg:#F6E8E5;

  /* Type */
  --serif: Georgia, 'Cormorant Garamond', 'Times New Roman', serif;
  --sans: 'Montserrat', 'Calibri', system-ui, sans-serif;

  /* Geometry */
  --r-sm: 6px;
  --r: 10px;
  --r-lg: 14px;
  --sidebar-w: 248px;
  --header-h: 72px;
  --shadow-sm: 0 1px 2px rgba(26,30,46,.05), 0 1px 3px rgba(26,30,46,.04);
  --shadow: 0 2px 8px rgba(26,30,46,.06), 0 8px 24px rgba(26,30,46,.05);
  --shadow-lg: 0 12px 40px rgba(26,30,46,.14);
}

* { box-sizing: border-box; margin: 0; padding: 0; }
html, body { height: 100%; }
body {
  font-family: var(--sans);
  background: var(--bg);
  color: var(--ink);
  -webkit-font-smoothing: antialiased;
  font-size: 15px;
  line-height: 1.5;
}
h1,h2,h3,h4 { font-family: var(--serif); font-weight: 600; letter-spacing: .2px; }
button { font-family: inherit; cursor: pointer; }
img { display: block; }
::selection { background: var(--gold-soft); }

/* ============================================================ APP LAYOUT */
.app { display: grid; grid-template-columns: var(--sidebar-w) 1fr; min-height: 100vh; }

/* ---------- Sidebar ---------- */
.sidebar {
  background: var(--navy);
  color: #C9CCD6;
  display: flex; flex-direction: column;
  position: sticky; top: 0; height: 100vh;
  border-right: 1px solid var(--navy-line);
}
.sidebar__brand {
  padding: 26px 24px 22px;
  border-bottom: 1px solid var(--navy-line);
}
.sidebar__brand img { width: 150px; height: auto; }
.sidebar__brand .tag {
  margin-top: 14px; font-size: 10px; letter-spacing: .22em; text-transform: uppercase;
  color: var(--gold); font-weight: 600;
}
.nav { padding: 16px 14px; display: flex; flex-direction: column; gap: 2px; flex: 1; overflow-y: auto; }
.nav__label { font-size: 10.5px; letter-spacing: .18em; text-transform: uppercase; color: #5E6377; padding: 16px 12px 8px; font-weight: 600; }
.nav__item {
  display: flex; align-items: center; gap: 13px;
  padding: 11px 12px; border-radius: var(--r-sm);
  color: #C2C6D2; font-size: 14px; font-weight: 500;
  background: none; border: none; width: 100%; text-align: left;
  transition: background .15s, color .15s;
}
.nav__item svg { width: 19px; height: 19px; flex: none; stroke-width: 1.7; }
.nav__item:hover { background: var(--navy-2); color: #fff; }
.nav__item.is-active { background: var(--navy-3); color: #fff; }
.nav__item.is-active svg { color: var(--gold); }
.nav__item .badge {
  margin-left: auto; background: var(--gold); color: var(--navy);
  font-size: 11px; font-weight: 700; border-radius: 20px; padding: 1px 8px; min-width: 20px; text-align: center;
}
.sidebar__user {
  padding: 14px 18px; border-top: 1px solid var(--navy-line);
  display: flex; align-items: center; gap: 11px;
}
.avatar {
  width: 38px; height: 38px; border-radius: 50%; flex: none;
  background: linear-gradient(135deg, var(--gold), var(--gold-deep));
  color: var(--navy); font-weight: 700; font-size: 14px;
  display: grid; place-items: center; font-family: var(--sans);
}
.sidebar__user .nm { font-size: 13.5px; color: #fff; font-weight: 600; }
.sidebar__user .rl { font-size: 11.5px; color: #7E8398; }
.sidebar__user .logout { width: 34px; height: 34px; border-radius: 8px; display: grid; place-items: center; color: #7E8398; flex: none; }
.sidebar__user .logout:hover { background: var(--navy-2); color: var(--gold); }
.sidebar__user .logout svg { width: 18px; height: 18px; }

/* ---------- Main ---------- */
.main { display: flex; flex-direction: column; min-width: 0; }
.header {
  height: var(--header-h); flex: none;
  background: rgba(255,255,255,.86); backdrop-filter: blur(8px);
  border-bottom: 1px solid var(--border);
  display: flex; align-items: center; gap: 20px;
  padding: 0 32px; position: sticky; top: 0; z-index: 20;
}
.header__title { display: flex; flex-direction: column; margin-right: auto; }
.header__title .eyebrow { font-size: 11px; letter-spacing: .16em; text-transform: uppercase; color: var(--gold-deep); font-weight: 600; font-family: var(--sans); }
.header__title h1 { font-size: 22px; color: var(--ink); }
.search {
  margin-left: auto; position: relative; width: 320px;
}
.search input {
  width: 100%; height: 42px; border: 1px solid var(--border);
  border-radius: var(--r); padding: 0 14px 0 42px; font-size: 14px;
  background: var(--surface-2); color: var(--ink); font-family: var(--sans);
}
.search input:focus { outline: none; border-color: var(--gold); background: #fff; }
.search svg { position: absolute; left: 13px; top: 11px; width: 20px; height: 20px; color: var(--ink-3); }
.header__btn {
  width: 42px; height: 42px; border-radius: var(--r); border: 1px solid var(--border);
  background: var(--surface-2); display: grid; place-items: center; color: var(--ink-2); position: relative;
}
.header__btn:hover { border-color: var(--gold); color: var(--navy); }
.header__btn svg { width: 20px; height: 20px; }
.header__btn .dot { position: absolute; top: 9px; right: 10px; width: 8px; height: 8px; border-radius: 50%; background: var(--gold); border: 2px solid #fff; }

.content { padding: 32px; flex: 1; }
.view { display: none; animation: fade .35s ease; }
.view.is-active { display: block; }
@keyframes fade { from { opacity: 0; transform: translateY(8px); } to { opacity: 1; transform: none; } }

/* ============================================================ PRIMITIVES */
.card {
  background: var(--surface); border: 1px solid var(--border);
  border-radius: var(--r-lg); box-shadow: var(--shadow-sm);
}
.section-head { display: flex; align-items: baseline; justify-content: space-between; margin-bottom: 16px; }
.section-head h2 { font-size: 19px; color: var(--ink); }
.section-head .sub { font-size: 13px; color: var(--ink-3); }
.link { color: var(--gold-deep); font-size: 13px; font-weight: 600; text-decoration: none; background: none; border: none; }
.link:hover { text-decoration: underline; }

.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  height: 42px; padding: 0 18px; border-radius: var(--r); font-size: 14px; font-weight: 600;
  border: 1px solid transparent; background: var(--navy); color: #fff; white-space: nowrap;
  transition: filter .15s, background .15s, border-color .15s;
}
.btn svg { width: 18px; height: 18px; }
.btn:hover { filter: brightness(1.12); }
.btn--gold { background: var(--gold); color: var(--navy); }
.btn--gold:hover { background: var(--gold-deep); color: #fff; filter: none; }
.btn--ghost { background: var(--surface-2); color: var(--ink); border-color: var(--border); }
.btn--ghost:hover { border-color: var(--gold); filter: none; }
.btn--sm { height: 34px; padding: 0 13px; font-size: 13px; }

.chip {
  display: inline-flex; align-items: center; gap: 6px; height: 34px; padding: 0 15px;
  border-radius: 30px; border: 1px solid var(--border); background: var(--surface);
  font-size: 13px; font-weight: 500; color: var(--ink-2); white-space: nowrap;
}
.chip:hover { border-color: var(--gold); }
.chip.is-active { background: var(--navy); color: #fff; border-color: var(--navy); }
.chip .ct { font-size: 11px; opacity: .7; }

/* Status pill */
.pill {
  display: inline-flex; align-items: center; gap: 7px;
  padding: 4px 11px; border-radius: 30px; font-size: 12px; font-weight: 600; white-space: nowrap;
}
.pill::before { content: ""; width: 7px; height: 7px; border-radius: 50%; background: currentColor; flex: none; }
.pill--draft    { color: var(--st-draft-fg);    background: var(--st-draft-bg); }
.pill--pending  { color: var(--st-pending-fg);  background: var(--st-pending-bg); }
.pill--confirmed{ color: var(--st-confirmed-fg);background: var(--st-confirmed-bg); }
.pill--progress { color: var(--st-progress-fg); background: var(--st-progress-bg); }
.pill--closed   { color: var(--st-closed-fg);   background: var(--st-closed-bg); }
.pill--danger   { color: var(--st-danger-fg);   background: var(--st-danger-bg); }

/* ============================================================ DASHBOARD */
.kpis { display: grid; grid-template-columns: repeat(4, 1fr); gap: 20px; margin-bottom: 24px; }
.kpis--3 { grid-template-columns: repeat(3, 1fr); }
/* Bloc à trois panneaux du tableau de bord (Actions / Top produits / Alertes) */
.dash-trio { display: grid; grid-template-columns: 1fr 1fr 1fr; gap: 20px; align-items: start; }
.kpi { padding: 22px 22px 20px; position: relative; overflow: hidden; }
.kpi__top { display: flex; align-items: center; justify-content: space-between; margin-bottom: 14px; }
.kpi__icon { width: 42px; height: 42px; border-radius: 11px; display: grid; place-items: center; background: var(--gold-tint); color: var(--gold-deep); }
.kpi__icon svg { width: 22px; height: 22px; stroke-width: 1.8; }
.kpi__icon--navy { background: #EDEFF3; color: var(--navy); }
.kpi__label { font-size: 12.5px; color: var(--ink-3); font-weight: 600; letter-spacing: .02em; text-transform: uppercase; }
.kpi__value { font-family: var(--serif); font-size: 32px; font-weight: 700; color: var(--ink); line-height: 1.1; margin-top: 4px; }
.kpi__value .cur { font-size: 16px; color: var(--ink-3); font-weight: 600; font-family: var(--sans); margin-left: 4px; }
.kpi__delta { display: inline-flex; align-items: center; gap: 5px; font-size: 12.5px; font-weight: 600; margin-top: 12px; }
.kpi__delta svg { width: 15px; height: 15px; }
.kpi__delta.up { color: #2F6B4F; }
.kpi__delta.down { color: #A33A2D; }
.kpi__delta .muted { color: var(--ink-3); font-weight: 500; }

.dash-grid { display: grid; grid-template-columns: 1.55fr 1fr; gap: 20px; align-items: start; }
.panel { padding: 22px; }
.panel__head { display: flex; align-items: center; justify-content: space-between; margin-bottom: 18px; }
.panel__head h3 { font-size: 17px; }

/* Mini line chart */
.chart { width: 100%; height: 180px; }

/* Actions list */
.actions { display: flex; flex-direction: column; }
.action-row { display: flex; align-items: center; gap: 14px; padding: 13px 0; border-bottom: 1px solid var(--border-2); }
.action-row:last-child { border-bottom: none; }
.action-row__icn { width: 36px; height: 36px; border-radius: 9px; display: grid; place-items: center; flex: none; }
.action-row__icn svg { width: 18px; height: 18px; }
.ai-pickup { background: var(--st-progress-bg); color: var(--st-progress-fg); }
.ai-return { background: var(--st-confirmed-bg); color: var(--st-confirmed-fg); }
.ai-pay { background: var(--st-pending-bg); color: var(--st-pending-fg); }
.action-row__body { min-width: 0; flex: 1; }
.action-row__body .t { font-size: 14px; font-weight: 600; color: var(--ink); }
.action-row__body .s { font-size: 12.5px; color: var(--ink-3); }
.action-row__time { font-size: 13px; font-weight: 600; color: var(--ink-2); }

/* Top products */
.top-prod { display: flex; flex-direction: column; gap: 14px; }
.top-prod__row { display: grid; grid-template-columns: 22px 1fr auto; align-items: center; gap: 12px; }
.top-prod__rank { font-family: var(--serif); font-size: 15px; color: var(--gold-deep); font-weight: 700; }
.top-prod__bar { height: 8px; border-radius: 6px; background: var(--border-2); overflow: hidden; }
.top-prod__bar span { display: block; height: 100%; background: linear-gradient(90deg, var(--gold), var(--gold-deep)); border-radius: 6px; }
.top-prod__name { font-size: 13.5px; font-weight: 600; margin-bottom: 5px; }
.top-prod__val { font-size: 13px; color: var(--ink-3); font-weight: 600; }

/* Alerts */
.alerts { display: flex; flex-direction: column; gap: 10px; }
.alert {
  display: flex; align-items: center; gap: 13px; padding: 13px 15px;
  border-radius: var(--r); border: 1px solid var(--border); background: var(--surface-2);
  border-left: 3px solid var(--ink-3);
}
.alert svg { width: 19px; height: 19px; flex: none; }
.alert.crit { border-left-color: var(--st-danger-fg); background: var(--st-danger-bg); }
.alert.crit svg { color: var(--st-danger-fg); }
.alert.warn { border-left-color: var(--st-pending-fg); background: var(--st-pending-bg); }
.alert.warn svg { color: var(--st-pending-fg); }
.alert__body { flex: 1; min-width: 0; }
.alert__body .t { font-size: 13.5px; font-weight: 600; color: var(--ink); }
.alert__body .s { font-size: 12px; color: var(--ink-2); }

/* ============================================================ DÉTAIL RÉSERVATION */
.detail-head { padding: 24px 26px; margin-bottom: 22px; }
.detail-head__main { display: flex; align-items: center; justify-content: space-between; gap: 16px; padding-bottom: 20px; border-bottom: 1px solid var(--border-2); }
.detail-head__ref h2 { color: var(--ink); }
.detail-meta { display: grid; grid-template-columns: repeat(4, 1fr); gap: 18px 28px; padding-top: 20px; }
.detail-meta__item { display: flex; flex-direction: column; gap: 3px; }
.detail-meta__item .k { font-size: 11.5px; letter-spacing: .04em; text-transform: uppercase; color: var(--ink-3); font-weight: 600; }
.detail-meta__item .v { font-size: 15px; font-weight: 600; color: var(--ink); }
.detail-meta__item .v em { font-style: normal; color: var(--gold-deep); font-weight: 600; font-size: 13px; }

.detail-tabs { display: flex; gap: 4px; border-bottom: 1px solid var(--border); margin-bottom: 22px; }
.detail-tab { border: none; background: none; padding: 13px 18px; font-size: 14px; font-weight: 600; color: var(--ink-3); position: relative; }
.detail-tab:hover { color: var(--ink); }
.detail-tab.is-active { color: var(--navy); }
.detail-tab.is-active::after { content: ""; position: absolute; left: 12px; right: 12px; bottom: -1px; height: 2.5px; background: var(--gold); border-radius: 3px; }
.detail-pane { display: none; }
.detail-pane.is-active { display: block; animation: fade .25s ease; }

.dual { display: grid; grid-template-columns: 1.6fr 1fr; gap: 20px; align-items: start; }
.recap { padding: 22px; }
.recap h3 { font-size: 16px; margin-bottom: 16px; }
.recap__row { display: flex; justify-content: space-between; font-size: 14px; padding: 7px 0; color: var(--ink-2); }
.recap__row.total { font-family: var(--serif); font-size: 19px; font-weight: 700; color: var(--navy); border-top: 1px solid var(--border); padding-top: 13px; margin-top: 6px; }
.recap__row.due { font-weight: 700; color: var(--st-pending-fg); border-top: 1px solid var(--border-2); padding-top: 11px; }

.doc-grid { display: grid; grid-template-columns: repeat(2, 1fr); gap: 16px; }
.doc-card { display: flex; align-items: center; gap: 14px; padding: 18px 20px; background: var(--surface); border: 1px solid var(--border); border-radius: var(--r-lg); box-shadow: var(--shadow-sm); }
.doc-card__icn { width: 46px; height: 46px; border-radius: 11px; display: grid; place-items: center; flex: none; }
.doc-card__icn svg { width: 24px; height: 24px; }
.doc-card__icn.pdf { background: var(--st-danger-bg); color: var(--st-danger-fg); }
.doc-card__icn.img { background: var(--st-progress-bg); color: var(--st-progress-fg); }
.doc-card__b { flex: 1; min-width: 0; }
.doc-card__b .t { font-size: 14.5px; font-weight: 600; }
.doc-card__b .s { font-size: 12.5px; color: var(--ink-3); }

.timeline { padding: 16px 0 16px 6px; }
.tl { display: flex; gap: 16px; padding: 0 0 22px; position: relative; }
.tl:last-child { padding-bottom: 8px; }
.tl::before { content: ""; position: absolute; left: 5px; top: 16px; bottom: -2px; width: 2px; background: var(--border); }
.tl:last-child::before { display: none; }
.tl__dot { width: 12px; height: 12px; border-radius: 50%; background: var(--gold); border: 2px solid var(--gold-soft); flex: none; margin-top: 3px; z-index: 1; }
.tl__b .t { font-size: 14.5px; font-weight: 600; color: var(--ink); }
.tl__b .s { font-size: 13px; color: var(--ink-3); }

.note { background: var(--surface-2); border: 1px solid var(--border-2); border-radius: var(--r); padding: 16px 18px; margin-bottom: 16px; }
.note__head { font-size: 12.5px; font-weight: 700; color: var(--gold-deep); margin-bottom: 6px; }
.note p { font-size: 14px; color: var(--ink-2); }
.note-input { width: 100%; min-height: 90px; border: 1px solid var(--border); border-radius: var(--r); padding: 13px 15px; font-family: var(--sans); font-size: 14px; resize: vertical; color: var(--ink); }
.note-input:focus { outline: none; border-color: var(--gold); }

.detail-actions { display: flex; gap: 10px; margin-top: 24px; flex-wrap: wrap; }

@media (max-width: 1180px) {
  .detail-meta { grid-template-columns: repeat(2, 1fr); }
  .dual { grid-template-columns: 1fr; }
  .doc-grid { grid-template-columns: 1fr; }
}

/* ============================================================ TABLE */
.toolbar { display: flex; align-items: center; gap: 10px; margin-bottom: 18px; flex-wrap: wrap; }
.toolbar .search { margin-left: 0; width: 280px; }
.toolbar .spacer { margin-left: auto; }
.seg { display: inline-flex; background: var(--surface); border: 1px solid var(--border); border-radius: var(--r); padding: 3px; gap: 2px; }
.seg button { border: none; background: none; padding: 7px 13px; border-radius: 7px; font-size: 13px; font-weight: 600; color: var(--ink-2); }
.seg button.is-active { background: var(--navy); color: #fff; }

/* Sous-onglets (Réservations / En attente / Restitution) */
.subtabs { display: flex; gap: 4px; margin-bottom: 18px; border-bottom: 1px solid var(--border); flex-wrap: wrap; }
.subtab {
  border: none; background: none; cursor: pointer; padding: 10px 16px; margin-bottom: -1px;
  font-family: var(--sans); font-size: 14px; font-weight: 600; color: var(--ink-3);
  border-bottom: 2px solid transparent; display: inline-flex; align-items: center; gap: 7px; transition: color .15s;
}
.subtab:hover { color: var(--ink); }
.subtab.is-active { color: var(--navy); border-bottom-color: var(--gold); }
.subtab .ct {
  font-size: 11.5px; font-weight: 700; min-width: 20px; text-align: center; padding: 1px 7px; border-radius: 20px;
  background: var(--surface-2); color: var(--ink-3); border: 1px solid var(--border-2);
}
.subtab.is-active .ct { background: var(--gold-tint); color: var(--gold-deep); border-color: var(--gold-soft); }

/* Champs de la toolbar (filtre statut + plage de dates) */
.resa-filters { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.field-select, .field-date {
  height: 34px; border: 1px solid var(--border); border-radius: 8px; padding: 0 10px;
  font-family: var(--sans); font-size: 13px; color: var(--ink); background: #fff; cursor: pointer;
}
.field-select:focus, .field-date:focus { outline: none; border-color: var(--gold); }

/* Le tableau peut défiler horizontalement sur petit écran au lieu d'être écrasé ;
   l'en-tête et le pied de carte restent à la largeur visible. */
.table-wrap { overflow-x: auto; overflow-y: hidden; -webkit-overflow-scrolling: touch; }
table.tbl { width: 100%; min-width: 660px; border-collapse: collapse; font-size: 14px; }
.tbl thead th {
  text-align: left; font-family: var(--sans); font-size: 11.5px; letter-spacing: .06em; text-transform: uppercase;
  color: var(--ink-3); font-weight: 700; padding: 14px 18px; border-bottom: 1px solid var(--border); background: var(--surface-2);
}
.tbl tbody td { padding: 15px 18px; border-bottom: 1px solid var(--border-2); vertical-align: middle; }
.tbl tbody tr:last-child td { border-bottom: none; }
.tbl tbody tr { transition: background .12s; cursor: pointer; }
.tbl tbody tr:hover { background: var(--surface-2); }
.tbl .ref { font-weight: 700; color: var(--navy); font-family: var(--sans); }
.tbl .cust { font-weight: 600; }
.tbl .cust .seg-tag { font-size: 11px; color: var(--ink-3); font-weight: 500; }
.tbl .amt { font-weight: 700; font-variant-numeric: tabular-nums; }
.tbl .muted { color: var(--ink-3); font-size: 13px; }
.t-right { text-align: right; }
.row-actions { display: flex; gap: 6px; justify-content: flex-end; }
.icon-btn { width: 32px; height: 32px; border-radius: 8px; border: 1px solid var(--border); background: #fff; display: grid; place-items: center; color: var(--ink-2); }
.icon-btn:hover { border-color: var(--gold); color: var(--navy); }
.icon-btn svg { width: 16px; height: 16px; }
.seg-dot { display:inline-block; width:8px;height:8px;border-radius:50%;background:var(--gold);margin-right:6px; vertical-align: middle;}

.table-foot { display: flex; align-items: center; justify-content: space-between; padding: 14px 18px; border-top: 1px solid var(--border); font-size: 13px; color: var(--ink-3); }
.pager { display: flex; gap: 4px; }
.pager button { min-width: 32px; height: 32px; border-radius: 7px; border: 1px solid var(--border); background: #fff; font-size: 13px; font-weight: 600; color: var(--ink-2); }
.pager button.is-active { background: var(--navy); color: #fff; border-color: var(--navy); }

/* ============================================================ CATALOGUE */
.cat-layout { display: block; }
.cat-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 22px; }
.prod {
  background: var(--surface); border: 1px solid var(--border); border-radius: var(--r-lg);
  overflow: hidden; box-shadow: var(--shadow-sm); transition: box-shadow .18s, transform .18s; display: flex; flex-direction: column;
}
.prod:hover { box-shadow: var(--shadow); transform: translateY(-3px); }
.prod__img { aspect-ratio: 1 / 1; position: relative; background: var(--navy); overflow: hidden; }
.prod__img img { width: 100%; height: 100%; object-fit: cover; display: block; }
.prod__ph {
  position: absolute; inset: 0;
  background:
    repeating-linear-gradient(45deg, rgba(26,30,46,.045) 0 8px, transparent 8px 16px),
    var(--surface-2);
  display: grid; place-items: center;
}
.prod__ph span { font-family: 'Courier New', monospace; font-size: 11px; color: var(--ink-3); letter-spacing: .04em; text-align: center; padding: 0 12px; }
.prod__cat { position: absolute; top: 12px; left: 12px; background: rgba(255,255,255,.92); color: var(--navy); font-size: 11px; font-weight: 600; padding: 4px 10px; border-radius: 20px; }
.prod__avail { position: absolute; top: 12px; right: 12px; font-size: 11px; font-weight: 600; padding: 4px 9px; border-radius: 20px; display: inline-flex; align-items: center; gap: 5px; }
.prod__avail::before { content:""; width:6px;height:6px;border-radius:50%;background:currentColor; }
.av-ok { background: var(--st-confirmed-bg); color: var(--st-confirmed-fg); }
.av-low { background: var(--st-pending-bg); color: var(--st-pending-fg); }
.av-out { background: var(--st-danger-bg); color: var(--st-danger-fg); }
.prod__body { padding: 16px 16px 18px; display: flex; flex-direction: column; flex: 1; }
.prod__name { font-family: var(--serif); font-size: 16.5px; font-weight: 600; color: var(--ink); line-height: 1.25; }
.prod__desc { font-size: 12.5px; color: var(--ink-3); margin-top: 5px; flex: 1; }
.prod__foot { display: flex; align-items: flex-end; justify-content: space-between; margin-top: 16px; }
.prod__price { font-family: var(--serif); font-size: 20px; font-weight: 700; color: var(--navy); }
.prod__price .unit { font-size: 12px; color: var(--ink-3); font-weight: 600; font-family: var(--sans); display: block; margin-top: 1px; }
.prod__add { width: 42px; height: 42px; border-radius: var(--r); background: var(--navy); color: #fff; border: none; display: grid; place-items: center; transition: background .15s; }
.prod__add:hover { background: var(--gold); color: var(--navy); }
.prod__add svg { width: 20px; height: 20px; }

/* ============================================================ POS */
.pos-modes { display: flex; gap: 12px; margin-bottom: 22px; }
.pos-mode {
  flex: 1; display: flex; align-items: center; gap: 15px; padding: 18px 20px;
  border-radius: var(--r-lg); border: 1.5px solid var(--border); background: var(--surface); text-align: left;
  transition: border-color .15s, background .15s;
}
.pos-mode__icn { width: 48px; height: 48px; border-radius: 12px; background: var(--gold-tint); color: var(--gold-deep); display: grid; place-items: center; flex: none; }
.pos-mode__icn svg { width: 25px; height: 25px; stroke-width: 1.7; }
.pos-mode .t { font-family: var(--serif); font-size: 17px; font-weight: 600; color: var(--ink); }
.pos-mode .s { font-size: 12.5px; color: var(--ink-3); }
.pos-mode.is-active { border-color: var(--navy); background: var(--navy); }
.pos-mode.is-active .t { color: #fff; }
.pos-mode.is-active .s { color: #9DA2B3; }
.pos-mode.is-active .pos-mode__icn { background: var(--gold); color: var(--navy); }

.pos-layout { display: grid; grid-template-columns: 1fr 400px; gap: 22px; align-items: start; }
.pos-left { display: flex; flex-direction: column; gap: 18px; }

/* POS catalog buttons */
.pos-cats { display: flex; gap: 8px; flex-wrap: wrap; margin-bottom: 4px; }
.pos-prod-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 12px; }
.pos-prod {
  border: 1px solid var(--border); border-radius: var(--r); background: var(--surface);
  padding: 14px; text-align: left; transition: border-color .12s, box-shadow .12s; min-height: 92px;
  display: flex; flex-direction: column; justify-content: space-between;
}
.pos-prod:hover { border-color: var(--gold); box-shadow: var(--shadow-sm); }
.pos-prod .nm { font-size: 13.5px; font-weight: 600; color: var(--ink); line-height: 1.3; }
.pos-prod .pr { font-family: var(--serif); font-size: 16px; font-weight: 700; color: var(--navy); margin-top: 10px; }

/* POS search results */
.pos-result { display: flex; align-items: center; gap: 14px; padding: 14px 16px; border: 1px solid var(--border); border-radius: var(--r); background: var(--surface); margin-bottom: 10px; transition: border-color .12s; }
.pos-result:hover { border-color: var(--gold); }
.pos-result.is-sel { border-color: var(--navy); background: var(--surface-2); }
.pos-result .av { width: 42px; height: 42px; border-radius: 50%; display: grid; place-items: center; background: var(--navy); color: #fff; font-weight: 700; flex: none; font-size: 14px; }
.pos-result__body { flex: 1; min-width: 0; }
.pos-result__body .nm { font-weight: 600; font-size: 14.5px; }
.pos-result__body .sub { font-size: 12.5px; color: var(--ink-3); }
.pos-result__amt { text-align: right; }
.pos-result__amt .lbl { font-size: 11px; color: var(--ink-3); text-transform: uppercase; letter-spacing: .04em; }
.pos-result__amt .v { font-weight: 700; font-size: 15px; color: var(--st-pending-fg); font-variant-numeric: tabular-nums; }

/* POS ticket */
.ticket { position: sticky; top: calc(var(--header-h) + 22px); padding: 0; overflow: hidden; }
.ticket__head { background: var(--navy); color: #fff; padding: 18px 20px; }
.ticket__head .lbl { font-size: 11px; letter-spacing: .16em; text-transform: uppercase; color: var(--gold); font-weight: 600; }
.ticket__head .ref { font-family: var(--serif); font-size: 20px; font-weight: 600; margin-top: 3px; }
.ticket__head .cust { font-size: 13px; color: #B7BCCB; margin-top: 2px; }
.ticket__lines { padding: 8px 20px; max-height: 260px; overflow-y: auto; }
.tline { display: flex; align-items: center; gap: 10px; padding: 11px 0; border-bottom: 1px solid var(--border-2); }
.tline:last-child { border-bottom: none; }
.tline .qty { font-weight: 700; color: var(--gold-deep); font-size: 13px; min-width: 30px; }
.tline .nm { flex: 1; font-size: 13.5px; font-weight: 500; }
.tline .lt { font-weight: 600; font-variant-numeric: tabular-nums; font-size: 13.5px; }
.ticket__empty { padding: 50px 20px; text-align: center; color: var(--ink-3); }
.ticket__empty svg { width: 44px; height: 44px; margin: 0 auto 12px; color: var(--border); }
.ticket__empty .t { font-size: 14px; font-weight: 600; color: var(--ink-2); }
.ticket__empty .s { font-size: 12.5px; margin-top: 4px; }
.ticket__totals { padding: 14px 20px; border-top: 1px solid var(--border); background: var(--surface-2); }
.trow { display: flex; justify-content: space-between; font-size: 13.5px; padding: 4px 0; color: var(--ink-2); }
.trow.grand { font-family: var(--serif); font-size: 20px; font-weight: 700; color: var(--navy); padding-top: 12px; margin-top: 6px; border-top: 1px solid var(--border); }
.trow.due { color: var(--st-pending-fg); font-weight: 700; }
.ticket__pay { padding: 18px 20px; border-top: 1px solid var(--border); }
.pay-field { margin-bottom: 14px; }
.pay-field label { font-size: 12px; font-weight: 600; color: var(--ink-2); text-transform: uppercase; letter-spacing: .04em; display: block; margin-bottom: 7px; }
.pay-input { width: 100%; height: 48px; border: 1px solid var(--border); border-radius: var(--r); padding: 0 14px; font-size: 18px; font-family: var(--serif); font-weight: 700; color: var(--navy); text-align: right; }
.pay-input:focus { outline: none; border-color: var(--gold); }
.pay-methods { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; }
.pay-method { height: 46px; border: 1.5px solid var(--border); border-radius: var(--r); background: #fff; font-size: 13px; font-weight: 600; color: var(--ink-2); display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 1px; }
.pay-method .mini { font-size: 10px; color: var(--ink-3); font-weight: 500; }
.pay-method.is-active { border-color: var(--navy); background: var(--navy); color: #fff; }
.pay-method.is-active .mini { color: #9DA2B3; }

/* Return/caution mode panel */
.return-line { display: grid; grid-template-columns: 1fr repeat(3, 64px); gap: 10px; align-items: center; padding: 12px 0; border-bottom: 1px solid var(--border-2); }
.return-line .nm { font-size: 13.5px; font-weight: 600; }
.return-line .nm small { display: block; font-weight: 500; color: var(--ink-3); }
.return-line input { width: 100%; height: 38px; border: 1px solid var(--border); border-radius: 8px; text-align: center; font-weight: 600; font-size: 14px; color: var(--ink); }
.return-line input:focus { outline: none; border-color: var(--gold); }
.return-head { display: grid; grid-template-columns: 1fr repeat(3, 64px); gap: 10px; font-size: 11px; text-transform: uppercase; letter-spacing: .04em; color: var(--ink-3); font-weight: 700; padding-bottom: 8px; }
.return-head span { text-align: center; }
.return-head span:first-child { text-align: left; }

.pos-pane { display: none; }
.pos-pane.is-active { display: block; }

/* helpers */
.muted { color: var(--ink-3); }
.tnum { font-variant-numeric: tabular-nums; }
.fcfa { font-family: var(--sans); }

/* Responsive */
@media (max-width: 1180px) {
  .kpis { grid-template-columns: repeat(2, 1fr); }
  .cat-grid { grid-template-columns: repeat(3, 1fr); }
  .dash-grid { grid-template-columns: 1fr; }
  .dash-trio { grid-template-columns: 1fr; }
  .pos-layout { grid-template-columns: 1fr; }
  .ticket { position: static; }
}
@media (max-width: 920px) {
  :root { --sidebar-w: 0px; }
  .header { padding: 0 16px; gap: 12px; }
  .header__title h1 { font-size: 19px; }
  .toolbar .search { width: 100%; }
  /* La sidebar devient un tiroir fixe qui glisse depuis la gauche */
  .sidebar {
    position: fixed; left: 0; top: 0; bottom: 0; z-index: 220;
    width: 268px; height: 100vh;
    transform: translateX(-105%);
    transition: transform .25s ease;
    box-shadow: var(--shadow-lg);
  }
  .sidebar.is-open { transform: none; }
  .app { grid-template-columns: 1fr; }
  .cat-grid { grid-template-columns: repeat(2, 1fr); }
  .pos-prod-grid { grid-template-columns: repeat(2, 1fr); }
  .search { width: 200px; }
  .content { padding: 20px 16px; }
}
@media (max-width: 560px) {
  .kpis { grid-template-columns: 1fr; }
  .cat-grid { grid-template-columns: 1fr; }
  .pos-modes { flex-direction: column; }
}

/* ============================================================ PANNEAU PARAMÈTRES */
.set-overlay {
  position: fixed; inset: 0; z-index: 320;
  background: rgba(26,30,46,.5); backdrop-filter: blur(3px);
  opacity: 0; pointer-events: none; transition: opacity .2s;
}
.set-overlay.is-on { opacity: 1; pointer-events: auto; }
.set-panel {
  position: fixed; top: 0; right: 0; bottom: 0; z-index: 330;
  width: 520px; max-width: 94vw; background: var(--bg);
  display: flex; flex-direction: column;
  transform: translateX(105%); transition: transform .26s ease;
  box-shadow: var(--shadow-lg);
}
.set-panel.is-open { transform: none; }
.set-head {
  background: var(--navy); color: #fff; padding: 20px 24px;
  display: flex; align-items: center; justify-content: space-between; flex: none;
}
.set-head h2 { font-family: var(--serif); font-size: 21px; font-weight: 600; }
.set-head .x {
  width: 36px; height: 36px; border-radius: 9px; border: 1px solid rgba(255,255,255,.2);
  background: transparent; color: #fff; display: grid; place-items: center; cursor: pointer;
}
.set-head .x svg { width: 18px; height: 18px; }
.set-head .x:hover { border-color: var(--gold); }
.set-tabs { display: flex; gap: 4px; padding: 12px 18px 0; background: var(--surface); border-bottom: 1px solid var(--border-2); flex: none; }
.set-tabs button {
  border: none; background: none; padding: 11px 14px; font-family: var(--sans); font-size: 13.5px; font-weight: 600;
  color: var(--ink-3); cursor: pointer; border-bottom: 2px solid transparent; margin-bottom: -1px;
}
.set-tabs button.is-active { color: var(--navy); border-bottom-color: var(--gold); }
.set-body { padding: 22px 24px; overflow-y: auto; flex: 1; }
.set-sec { display: none; }
.set-sec.is-active { display: block; animation: fade .3s ease; }
.set-card { background: var(--surface); border: 1px solid var(--border-2); border-radius: var(--r-lg); padding: 18px 20px; margin-bottom: 16px; }
.set-card h3 { font-size: 15px; font-family: var(--sans); font-weight: 700; color: var(--ink); margin-bottom: 4px; }
.set-card .sub { font-size: 12.5px; color: var(--ink-3); margin-bottom: 14px; }
.set-field { margin-bottom: 13px; }
.set-field label { display: block; font-size: 12px; font-weight: 600; color: var(--ink-3); margin-bottom: 5px; }
.set-field input, .set-field select, .set-field textarea {
  width: 100%; height: 44px; border: 1px solid var(--border); border-radius: var(--r);
  padding: 0 14px; font-size: 14px; font-family: var(--sans); background: #fff; color: var(--ink);
}
.set-field textarea { height: auto; min-height: 76px; padding: 12px 14px; resize: vertical; line-height: 1.5; }
.set-field input:focus, .set-field select:focus, .set-field textarea:focus { outline: none; border-color: var(--gold); box-shadow: 0 0 0 3px rgba(184,151,45,.12); }
.set-grid2 { display: grid; grid-template-columns: 1fr 1fr; gap: 13px; }
.set-info-row { display: flex; justify-content: space-between; padding: 9px 0; border-bottom: 1px dashed var(--border-2); font-size: 13.5px; }
.set-info-row .k { color: var(--ink-3); }
.set-info-row .v { color: var(--ink); font-weight: 600; }
.set-msg { font-size: 13px; font-weight: 600; padding: 9px 12px; border-radius: var(--r); margin-top: 4px; display: none; }
.set-msg.err { color: var(--st-danger-fg); background: var(--st-danger-bg); }
.set-msg.ok { color: var(--st-confirmed-fg); background: var(--st-confirmed-bg); }
@media (max-width: 560px) { .set-grid2 { grid-template-columns: 1fr; } }

/* ============================================================ RAPPORTS */
@media (max-width: 980px) {
  .rpt-duo { grid-template-columns: 1fr !important; }
}
/* Impression du rapport : on ne garde que le contenu de la vue active */
@media print {
  body { background: #fff; }
  .sidebar, .sidebar-overlay, .header, .rpt-controls, .rpt-noprint { display: none !important; }
  .app { display: block; }
  .content { padding: 0; max-width: none; }
  .view { display: none; }
  .view.is-active { display: block; }
  .card { box-shadow: none; border: 1px solid #E3E0D5; break-inside: avoid; }
  .rpt-sec { break-inside: avoid; }
}

/* ============================================================ TIROIR MOBILE (console) */
.sidebar-overlay {
  position: fixed; inset: 0; z-index: 210;
  background: rgba(26,30,46,.45); backdrop-filter: blur(2px);
  opacity: 0; pointer-events: none; transition: opacity .2s;
}
.sidebar-overlay.is-on { opacity: 1; pointer-events: auto; }
.burger {
  display: none; width: 40px; height: 40px; flex: none;
  border-radius: 10px; border: 1px solid var(--border); background: #fff; color: var(--ink-2);
  place-items: center;
}
.burger svg { width: 20px; height: 20px; }
.burger:hover { border-color: var(--gold); color: var(--navy); }
@media (max-width: 920px) { .burger { display: grid; } }

/* ============ Catalogue admin : gestion produits & catégories ============ */
.toolbar .chips { display: flex; gap: 8px; flex-wrap: wrap; }
.tbl--cat .thumb { width: 46px; height: 46px; border-radius: 9px; object-fit: cover; background: var(--surface-2); border: 1px solid var(--border-2); display: block; }
.tbl--cat .thumb--empty { display: grid; place-items: center; color: var(--ink-3); }
.tbl--cat .thumb--empty svg { width: 20px; height: 20px; }
.tbl--cat .pname { font-weight: 600; color: var(--ink); }
.tbl--cat .pname small { display: block; font-weight: 500; color: var(--ink-3); font-size: 12px; max-width: 260px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.row-actions { display: flex; gap: 6px; justify-content: flex-end; }
.icon-btn { width: 34px; height: 34px; border-radius: 8px; border: 1px solid var(--border); background: #fff; color: var(--ink-2); display: grid; place-items: center; cursor: pointer; transition: border-color .12s, color .12s, background .12s; }
.icon-btn svg { width: 17px; height: 17px; }
.icon-btn:hover { border-color: var(--gold); color: var(--navy); }
.icon-btn--danger:hover { border-color: var(--st-danger-fg); color: var(--st-danger-fg); background: var(--st-danger-bg); }
.pill-mini { font-size: 11.5px; font-weight: 700; padding: 3px 10px; border-radius: 20px; white-space: nowrap; }
.pill-on { background: var(--st-confirmed-bg); color: var(--st-confirmed-fg); }
.pill-off { background: var(--st-closed-bg); color: var(--st-closed-fg); }

/* Modale générique (réutilisable) */
.modal-ov { position: fixed; inset: 0; z-index: 120; background: rgba(26,30,46,.55); backdrop-filter: blur(4px); display: grid; place-items: center; padding: 22px; overflow: auto; }
.modal { background: var(--surface); border-radius: var(--r-lg); width: 100%; max-width: 560px; box-shadow: var(--shadow-lg); overflow: hidden; max-height: calc(100vh - 44px); display: flex; flex-direction: column; }
.modal__head { display: flex; align-items: center; justify-content: space-between; padding: 17px 22px; border-bottom: 1px solid var(--border); flex: none; }
.modal__head h3 { font-family: var(--serif); font-size: 19px; font-weight: 600; color: var(--ink); }
.modal__x { background: none; border: none; font-size: 25px; line-height: 1; color: var(--ink-3); cursor: pointer; }
.modal__body { padding: 20px 22px; overflow-y: auto; }
.modal__foot { padding: 15px 22px; border-top: 1px solid var(--border); display: flex; justify-content: flex-end; gap: 10px; background: var(--surface-2); flex: none; }
.frm-row { margin-bottom: 15px; }
.frm-row.two { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; }
.frm-row label, .frm-lbl { display: block; font-size: 13px; font-weight: 600; color: var(--ink-2); margin-bottom: 6px; }
.frm-ctl { width: 100%; height: 44px; border: 1px solid var(--border); border-radius: var(--r); padding: 0 13px; font-size: 14px; font-family: var(--sans); background: #fff; color: var(--ink); }
textarea.frm-ctl { height: auto; min-height: 76px; padding: 11px 13px; resize: vertical; line-height: 1.5; }
.frm-ctl:focus { outline: none; border-color: var(--gold); }
.frm-hint { font-size: 12px; color: var(--ink-3); margin-top: 5px; }
.img-drop { display: flex; align-items: center; gap: 14px; }
.img-drop img { width: 78px; height: 78px; border-radius: 11px; object-fit: cover; border: 1px solid var(--border-2); background: var(--surface-2); flex: none; }
.switch-row { display: flex; align-items: flex-start; gap: 11px; padding: 13px 15px; border: 1px solid var(--border); border-radius: var(--r); }
.switch-row input { width: 19px; height: 19px; accent-color: var(--gold); margin-top: 1px; flex: none; }
.switch-row .t { display: block; font-size: 14px; font-weight: 600; color: var(--ink); }
.switch-row .s { display: block; font-size: 12.5px; color: var(--ink-3); margin-top: 2px; }

/* Gestion des catégories */
.cat-mng { display: flex; flex-direction: column; gap: 9px; }
.cat-mng__item { display: flex; align-items: center; gap: 10px; padding: 8px 10px 8px 13px; border: 1px solid var(--border); border-radius: var(--r); }
.cat-mng__item input { flex: 1; min-width: 0; border: none; background: none; font-size: 14px; font-weight: 600; color: var(--ink); }
.cat-mng__item input:focus { outline: none; }
.cat-mng__count { font-size: 12px; color: var(--ink-3); white-space: nowrap; }
.cat-mng__add { display: flex; gap: 10px; margin-top: 4px; }
.cat-mng__add input { flex: 1; }
