/* ══════════════════════════════════════════════════════════════
   Compose KDS — Feuille de style
   Auteur : Sohan
   Design inspiré Deliverect, optimisé iPad 8 (10.2")
   Charte : corail #E15C50 · vert #5DA362 · bleu #6B9EE2 · orange #E8A738
   ══════════════════════════════════════════════════════════════ */

/* ── Variables globales ── */
:root {
  --bg: #F7F5F2; --white: #fff;
  --ink: #1D1D1F; --ink2: #48484A; --ink3: #636366;
  --muted: #8E8E93; --subtle: #C7C7CC;
  --border: #E5E5EA; --hover: #EFEDE9;
  --corail: #E15C50; --vert: #5DA362; --bleu: #6B9EE2; --orange: #E8A738;
  --corail-bg: rgba(225,92,80,.07); --vert-bg: rgba(93,163,98,.07);
  --bleu-bg: rgba(107,158,226,.07); --orange-bg: rgba(232,167,56,.07);
  --r: 16px; --r-sm: 10px;
  --sh: 0 1px 2px rgba(0,0,0,.03), 0 4px 12px rgba(0,0,0,.04);
  --sh-lg: 0 2px 4px rgba(0,0,0,.04), 0 8px 24px rgba(0,0,0,.06);
}

/* ── Reset ── */
* { box-sizing: border-box; margin: 0; padding: 0; }
html { background: var(--bg); }
body {
  background: var(--bg); color: var(--ink);
  font-family: "DM Sans", system-ui, -apple-system, sans-serif;
  min-height: 100dvh;
  -webkit-user-select: none; user-select: none;
  overscroll-behavior: none;
  -webkit-font-smoothing: antialiased;
  -webkit-tap-highlight-color: transparent;
}

/* ══════════════════════════════════
   Sélection du site (écran d'accueil)
   ══════════════════════════════════ */
.site-overlay {
  position: fixed; inset: 0; z-index: 200;
  background: var(--bg); display: flex; align-items: center;
  justify-content: center; flex-direction: column;
  gap: 28px; padding: 24px; animation: entree .35s ease-out;
}
@keyframes entree { from { opacity: 0; transform: scale(.98); } to { opacity: 1; transform: none; } }

.so-logo { font-family: "Poiret One", serif; font-size: 42px; letter-spacing: .4em; text-transform: uppercase; }
.so-sub { font: 400 14px "DM Sans"; color: var(--muted); margin-top: -16px; }
.so-list { display: flex; gap: 16px; flex-wrap: wrap; justify-content: center; max-width: 800px; }
.so-card {
  background: var(--white); border: 2px solid var(--border); border-radius: 20px;
  padding: 32px; cursor: pointer; min-width: 200px; text-align: center;
  transition: all .2s; box-shadow: var(--sh);
}
.so-card:active { transform: scale(.97); }
.so-card:hover { border-color: var(--corail); box-shadow: var(--sh-lg); }
.so-card .sc-name { font: 700 17px "DM Sans"; margin-bottom: 6px; }
.so-card .sc-id { font: 400 11px "DM Sans"; color: var(--muted); }
.so-card.add { border-style: dashed; border-color: var(--subtle); }
.so-card.add:hover { border-color: var(--bleu); }
.so-card.add .sc-name { font-weight: 300; font-size: 32px; color: var(--muted); }

/* Formulaire création site */
.so-form { background: var(--white); border-radius: 20px; padding: 32px; box-shadow: var(--sh-lg); max-width: 460px; width: 100%; }
.so-form h3 { font: 400 24px "Poiret One", serif; letter-spacing: .15em; margin-bottom: 24px; text-align: center; }
.so-form .sf-row { margin-bottom: 16px; }
.so-form label { font: 700 10px "DM Sans"; color: var(--muted); text-transform: uppercase; letter-spacing: .12em; display: block; margin-bottom: 6px; }
.so-form input { width: 100%; padding: 14px 16px; border: 1.5px solid var(--border); border-radius: 12px; font: 400 14px "DM Sans"; background: var(--bg); outline: none; min-height: 48px; color: var(--ink); }
.so-form input:focus { border-color: var(--bleu); box-shadow: 0 0 0 3px rgba(107,158,226,.12); }
.so-form .sf-btns { display: flex; gap: 10px; justify-content: flex-end; margin-top: 24px; }

/* ══════════════════════════════════
   Barre hors ligne et toasts
   ══════════════════════════════════ */
.offbar {
  position: fixed; top: 0; left: 0; right: 0; z-index: 100;
  background: var(--corail); color: #fff; text-align: center;
  padding: 12px; font: 600 11px/1 "DM Sans"; text-transform: uppercase; letter-spacing: .1em;
  transform: translateY(-100%); transition: transform .3s;
}
.offbar.on { transform: none; }

.toasts {
  position: fixed; bottom: 24px; left: 50%; transform: translateX(-50%); z-index: 90;
  display: flex; flex-direction: column-reverse; gap: 8px; align-items: center;
  pointer-events: none; padding-bottom: env(safe-area-inset-bottom, 0);
}
.toast {
  background: var(--ink); color: #fff; padding: 14px 22px; border-radius: 14px;
  font: 500 13px/1.3 "DM Sans"; box-shadow: var(--sh-lg); pointer-events: auto;
  animation: montee .25s; display: flex; gap: 12px; align-items: center; max-width: 380px;
}
.toast button { background: rgba(255,255,255,.15); border: none; color: #fff; padding: 8px 14px; border-radius: 8px; cursor: pointer; font: 600 11px "DM Sans"; min-height: 36px; }
.toast.out { animation: descente .2s forwards; }
@keyframes montee { from { opacity: 0; transform: translateY(12px); } to { opacity: 1; transform: none; } }
@keyframes descente { to { opacity: 0; transform: translateY(12px); } }

/* ══════════════════════════════════
   Modale ingrédients
   ══════════════════════════════════ */
.modal-bg {
  position: fixed; inset: 0; z-index: 60;
  background: rgba(29,29,31,.4); backdrop-filter: blur(12px); -webkit-backdrop-filter: blur(12px);
  display: flex; align-items: center; justify-content: center;
  animation: entree .2s;
}
.modal-box {
  background: var(--white); border-radius: 20px; box-shadow: var(--sh-lg);
  max-width: 500px; width: 92%; max-height: 80vh; display: flex; flex-direction: column;
}
.modal-head {
  display: flex; justify-content: space-between; align-items: center;
  padding: 18px 22px; border-bottom: 1px solid var(--border);
}
.modal-title { font: 700 16px "DM Sans"; }
.modal-close { font: 600 12px "DM Sans"; color: var(--bleu); background: none; border: none; cursor: pointer; min-height: auto; padding: 8px 14px; }
.modal-body { padding: 16px 22px; overflow-y: auto; -webkit-overflow-scrolling: touch; }
.modal-body .m-item { padding: 8px 0; border-bottom: 1px dashed var(--border); font: 500 14px "DM Sans"; display: flex; justify-content: space-between; }
.modal-body .m-item:last-child { border-bottom: none; }
.modal-body .m-item .m-qty { color: var(--corail); font-weight: 800; margin-right: 8px; }
.modal-body .m-sub { padding: 4px 0 4px 28px; font: 400 13px "DM Sans"; color: var(--ink3); }
.modal-body .m-sep { height: 1px; background: var(--border); margin: 10px 0; }
.modal-body .m-total { font: 700 16px "DM Sans"; text-align: right; padding: 10px 0 0; }

/* ══════════════════════════════════
   PIN
   ══════════════════════════════════ */
.pin-overlay {
  position: fixed; inset: 0; z-index: 80;
  background: rgba(29,29,31,.4); backdrop-filter: blur(12px); -webkit-backdrop-filter: blur(12px);
  display: flex; align-items: center; justify-content: center; animation: entree .2s;
}
.pin-box { background: var(--white); border-radius: 24px; padding: 40px; text-align: center; box-shadow: var(--sh-lg); max-width: 300px; width: 90%; }
.pin-box h3 { font: 400 22px "Poiret One", serif; letter-spacing: .15em; margin-bottom: 24px; }
.pin-box input { width: 160px; text-align: center; font: 600 28px "DM Sans"; letter-spacing: .4em; padding: 14px; border: 2px solid var(--border); border-radius: 14px; outline: none; background: var(--bg); color: var(--ink); min-height: 56px; }
.pin-box input:focus { border-color: var(--bleu); }
.pin-err { color: var(--corail); font: 500 12px "DM Sans"; margin-top: 10px; min-height: 18px; }

/* ══════════════════════════════════
   Header (3 colonnes)
   ══════════════════════════════════ */
header {
  padding: 0 16px; height: 56px;
  display: grid; grid-template-columns: 1fr auto 1fr; align-items: center;
  position: sticky; top: 0; z-index: 20;
  background: rgba(247,245,242,.88); backdrop-filter: blur(24px); -webkit-backdrop-filter: blur(24px);
  border-bottom: 1px solid var(--border);
}
.hdr-l { display: flex; align-items: center; }
.hdr-c { display: flex; justify-content: center; }
.hdr-r { display: flex; align-items: center; gap: 8px; justify-content: flex-end; }
.hdr-stats { display: flex; gap: 20px; align-items: center; }
.hs { text-align: center; }
.hs-v { font: 800 17px "DM Sans"; line-height: 1; }
.hs-l { font: 500 8px "DM Sans"; color: var(--muted); text-transform: uppercase; letter-spacing: .12em; margin-top: 2px; }

.logo-mark {
  background: var(--ink); padding: 5px 14px;
  font-family: "Poiret One", serif; font-size: 13px; letter-spacing: .35em;
  color: var(--white); text-transform: uppercase; cursor: pointer; border-radius: 4px; position: relative;
}
.clock { font: 700 18px/1 "DM Sans"; font-variant-numeric: tabular-nums; color: var(--ink2); }

/* Pastilles d'état */
.dot { width: 8px; height: 8px; border-radius: 50%; flex-shrink: 0; }
.d0 { background: var(--subtle); }
.d1 { background: var(--vert); box-shadow: 0 0 6px rgba(93,163,98,.5); }
.de { background: var(--corail); }

.chip {
  display: inline-flex; align-items: center; gap: 5px;
  padding: 6px 10px; background: var(--white);
  border: 1px solid var(--border); border-radius: 99px;
  font: 600 9px/1 "DM Sans"; text-transform: uppercase; letter-spacing: .06em;
  cursor: pointer; min-height: 36px; color: var(--ink3);
}
.chip:active { background: var(--hover); }

/* Dropdown changement de site */
.site-switch {
  position: absolute; top: 100%; left: 0; margin-top: 4px;
  background: var(--white); border: 1px solid var(--border); border-radius: 14px;
  box-shadow: var(--sh-lg); min-width: 240px; overflow: hidden; z-index: 30; animation: entree .12s;
}
.site-switch .sw-item {
  padding: 14px 18px; font: 500 13px "DM Sans"; cursor: pointer;
  border-bottom: 1px solid var(--border); display: flex; align-items: center;
  gap: 8px; color: var(--ink); min-height: 48px;
}
.site-switch .sw-item:last-child { border-bottom: none; }
.site-switch .sw-item:active { background: var(--hover); }
.site-switch .sw-item.active { background: var(--corail-bg); font-weight: 700; color: var(--corail); }
.site-switch .sw-item.manage { color: var(--bleu); font-weight: 600; }

/* ══════════════════════════════════
   Onglets
   ══════════════════════════════════ */
.tabs {
  display: flex; gap: 0; padding: 0 20px; background: var(--white);
  border-bottom: 1px solid var(--border);
  position: sticky; top: 56px; z-index: 15;
  overflow-x: auto; -webkit-overflow-scrolling: touch;
}
.tab {
  padding: 16px 22px; font: 700 12px/1 "DM Sans"; text-transform: uppercase; letter-spacing: .1em;
  color: var(--muted); cursor: pointer; border: none; border-bottom: 3px solid transparent;
  background: none; font-family: inherit;
  display: flex; align-items: center; gap: 8px; min-height: 54px; white-space: nowrap; flex-shrink: 0;
}
.tab.on { color: var(--ink); }
.tab[data-t="active"].on { border-bottom-color: var(--corail); }
.tab[data-t="history"].on { border-bottom-color: var(--ink3); }
.tab[data-t="ing"].on { border-bottom-color: var(--bleu); }
.tab[data-t="stats"].on { border-bottom-color: var(--orange); }
.tab[data-t="set"].on { border-bottom-color: var(--ink); }
.bdg { background: var(--bg); color: var(--ink3); font: 700 11px "DM Sans"; padding: 4px 10px; border-radius: 99px; min-width: 22px; text-align: center; }
.tab.on .bdg { color: #fff; }
.tab[data-t="active"].on .bdg { background: var(--corail); }

/* ══════════════════════════════════
   Contenu principal
   ══════════════════════════════════ */
main { padding: 16px 20px 100px; max-width: 1500px; margin: 0 auto; }
.pnl { display: none; }
.pnl.vis { display: block; }

/* Boutons globaux */
button {
  font: 700 13px/1 "DM Sans"; text-transform: uppercase; letter-spacing: .06em;
  border: none; border-radius: var(--r-sm); background: var(--bg); color: var(--ink);
  padding: 14px 20px; cursor: pointer; min-height: 48px; transition: transform .08s;
}
button:active:not(:disabled) { transform: scale(.96); }
button:disabled { opacity: .3; cursor: not-allowed; }
.b-pri { background: var(--corail); color: #fff; }
.b-sm { padding: 10px 14px; font-size: 11px; min-height: 40px; }
.b-ghost { background: transparent; border: 1.5px solid var(--border); color: var(--ink3); }

/* Recherche */
.search-bar { display: flex; gap: 10px; margin-bottom: 16px; align-items: center; }
.search-input { flex: 1; max-width: 380px; padding: 12px 18px; border: 1.5px solid var(--border); border-radius: 12px; font: 400 16px "DM Sans"; background: var(--white); outline: none; min-height: 48px; color: var(--ink); }
.search-input:focus { border-color: var(--bleu); box-shadow: 0 0 0 3px rgba(107,158,226,.1); }
.vpills { display: flex; background: var(--white); border: 1.5px solid var(--border); border-radius: var(--r-sm); overflow: hidden; }
.vpill { padding: 12px 18px; font: 600 11px/1 "DM Sans"; text-transform: uppercase; letter-spacing: .08em; cursor: pointer; border: none; background: transparent; color: var(--muted); min-height: 44px; }
.vpill.on { background: var(--ink); color: var(--white); }

/* ══════════════════════════════════
   Grille de cartes commandes
   ══════════════════════════════════ */
.grid { display: grid; gap: 14px; grid-template-columns: repeat(auto-fill, minmax(340px, 1fr)); }
.grid.rush { grid-template-columns: 1fr; gap: 6px; }
.empty { grid-column: 1/-1; padding: 100px 20px; text-align: center; }
.empty .big { font: 400 28px "Poiret One", serif; color: var(--subtle); letter-spacing: .12em; margin-bottom: 6px; }
.empty .sub { font: 400 14px "DM Sans"; color: var(--muted); }

/* ══════════════════════════════════
   Carte commande — style Deliverect
   ══════════════════════════════════ */
.card {
  background: var(--white); border-radius: var(--r); overflow: hidden;
  display: flex; flex-direction: column; box-shadow: var(--sh);
  border: 1px solid var(--border); position: relative;
}

/* Barre de statut colorée en haut */
.card::before { content: ""; position: absolute; top: 0; left: 0; right: 0; height: 4px; }
.card.new::before { background: var(--corail); }
.card.completed::before { background: var(--subtle); }

/* Épinglée */
.card.pinned { box-shadow: 0 0 0 2px var(--orange), var(--sh); order: -1 !important; }
.card.pinned::after {
  content: ""; position: absolute; top: 10px; right: 12px;
  width: 16px; height: 16px; opacity: .4; background: var(--orange);
  -webkit-mask: url("data:image/svg+xml,%3Csvg viewBox='0 0 24 24' xmlns='http://www.w3.org/2000/svg'%3E%3Cpath d='M16 12V4h1V2H7v2h1v8l-2 2v2h5v6l1 1 1-1v-6h5v-2z'/%3E%3C/svg%3E") center/contain no-repeat;
  mask: url("data:image/svg+xml,%3Csvg viewBox='0 0 24 24' xmlns='http://www.w3.org/2000/svg'%3E%3Cpath d='M16 12V4h1V2H7v2h1v8l-2 2v2h5v6l1 1 1-1v-6h5v-2z'/%3E%3C/svg%3E") center/contain no-repeat;
}

/* En retard — animation pulsation */
.card.late { animation: pulsation 2.5s ease-in-out infinite; }
@keyframes pulsation {
  0%, 100% { box-shadow: var(--sh); }
  50% { box-shadow: 0 0 0 2px var(--corail), 0 0 20px rgba(225,92,80,.12); }
}

/* Barre de progression */
.card .prog { height: 3px; background: var(--border); }
.card .prog .bar { height: 100%; transition: width 1s ease-out; border-radius: 0 2px 2px 0; }
.bar-ok { background: var(--vert); } .bar-w { background: var(--orange); } .bar-l { background: var(--corail); }

/* En-tête carte : numéro + type */
.c-head { padding: 16px 18px 0; display: flex; justify-content: space-between; align-items: flex-start; gap: 8px; }
.c-num { font: 800 15px "DM Sans"; color: var(--corail); }
.card.completed .c-num { color: var(--muted); }
.c-type { font: 600 10px "DM Sans"; text-transform: uppercase; letter-spacing: .1em; padding: 5px 12px; border-radius: 6px; background: var(--bg); color: var(--ink3); }
.c-type.cc { background: var(--bleu-bg); color: var(--bleu); }
.c-type.liv { background: var(--orange-bg); color: var(--orange); }
.c-type.sp { background: var(--vert-bg); color: var(--vert); }

/* Nom du client = HÉROS */
.c-client { padding: 4px 18px 2px; font: 800 24px/1.2 "DM Sans"; color: var(--ink); }
.c-couv { font: 700 11px/1 "DM Sans"; margin-left: 8px; padding: 5px 12px; border-radius: 6px; display: inline-block; vertical-align: middle; }
.c-couv.oui { background: var(--vert-bg); color: var(--vert); }
.c-couv.non { background: var(--bg); color: var(--muted); }

/* Méta : heure, téléphone, retrait */
.c-meta { padding: 6px 18px 14px; font: 500 12px "DM Sans"; color: var(--muted); display: flex; gap: 12px; align-items: center; flex-wrap: wrap; }

/* Badge de retrait (GROS) */
.c-pk { padding: 10px 16px; background: var(--bg); border-radius: 10px; font: 800 16px "DM Sans"; color: var(--muted); display: inline-flex; align-items: center; gap: 6px; margin-left: auto; }
.c-pk.soon { background: var(--orange-bg); color: var(--orange); }
.c-pk.late { background: var(--corail-bg); color: var(--corail); font-size: 17px; }

/* Corps carte : produits (limité, avec "voir plus") */
.c-bd { padding: 0 18px 10px; flex: 1; max-height: 160px; overflow: hidden; position: relative; }
.c-bd .itm { display: flex; justify-content: space-between; align-items: baseline; padding: 6px 0; border-bottom: 1px dashed var(--border); font: 600 14px/1.4 "DM Sans"; color: var(--ink); }
.c-bd .itm:last-child { border-bottom: none; }
.c-bd .itm .qty { color: var(--corail); font-weight: 800; margin-right: 8px; min-width: 24px; font-size: 15px; }
.c-bd .itm .pr { font: 400 13px "DM Sans"; color: var(--muted); white-space: nowrap; margin-left: 8px; }
.c-bd .opt { padding: 3px 0 3px 28px; font: 400 12px/1.5 "DM Sans"; color: var(--ink3); }
.c-bd .sep-boisson { border-top: 1px solid var(--border); margin-top: 6px; padding-top: 6px; }

/* Bouton "voir plus" (ouvre la modale) */
.c-more { padding: 6px 18px; text-align: center; cursor: pointer; }
.c-more span { font: 600 12px "DM Sans"; color: var(--bleu); }
.c-more:active span { opacity: .6; }

/* Total */
.c-total { padding: 8px 18px; font: 700 15px "DM Sans"; text-align: right; border-top: 1px solid var(--border); }

/* Boutons d'action */
.c-acts { display: flex; border-top: 1px solid var(--border); }
.c-acts button { flex: 1; border-radius: 0; min-height: 60px; font: 700 13px "DM Sans"; letter-spacing: .06em; text-transform: uppercase; border-right: 1px solid var(--border); }
.c-acts button:last-child { border-right: none; }
.c-acts .act-default { background: var(--white); color: var(--ink3); }
.c-acts .act-default:active { background: var(--hover); }
.c-acts .act-done { background: var(--vert) !important; color: #fff !important; font-size: 15px; font-weight: 800; letter-spacing: .1em; }
.c-acts .act-done:active { background: #4E9057 !important; }
.c-acts .act-recall { background: var(--bleu) !important; color: #fff !important; font-weight: 800; font-size: 14px; }
.c-acts .act-recall:active { background: #5A8DD1 !important; }
.c-acts .act-pin { max-width: 54px; flex: 0 0 54px; background: var(--white); color: var(--muted); font-size: 16px; padding: 0; letter-spacing: 0; }
.c-acts .act-pin:active { background: var(--hover); }

/* ── Mode Rush ── */
.grid.rush .card { flex-direction: row; align-items: center; border-radius: var(--r-sm); }
.grid.rush .card::before { top: 0; left: 0; right: unset; bottom: 0; width: 4px; height: auto; }
.grid.rush .c-head { padding: 8px 12px 0; flex: 0 0 auto; }
.grid.rush .c-head .c-type { display: none; }
.grid.rush .c-client { padding: 4px 14px; flex: 0 0 160px; font-size: 16px; }
.grid.rush .c-meta { padding: 2px 10px 4px; flex: 0 0 auto; }
.grid.rush .c-meta .c-pk { font-size: 12px; padding: 4px 8px; }
.grid.rush .c-bd { padding: 4px 10px; max-height: 50px; flex: 1; }
.grid.rush .c-acts { flex: 0 0 auto; flex-direction: column; border-top: none; border-left: 1px solid var(--border); }
.grid.rush .c-acts button { min-height: 44px; padding: 8px 14px; border-right: none; border-bottom: 1px solid var(--border); }
.grid.rush .c-acts .act-pin { max-width: 44px; flex: 0 0 44px; }
.grid.rush .c-total, .grid.rush .prog, .grid.rush .c-couv, .grid.rush .c-more { display: none; }

/* ══════════════════════════════════
   Ingrédients (iframe)
   ══════════════════════════════════ */
.iframe-bar { display: flex; align-items: center; gap: 10px; padding: 8px 0 12px; flex-wrap: wrap; }
.iframe-info { font: 500 12px "DM Sans"; color: var(--vert); flex: 1; }
.dood-iframe { width: 100%; height: calc(100dvh - 160px); border: 1px solid var(--border); border-radius: var(--r); background: var(--white); box-shadow: var(--sh); }

/* ══════════════════════════════════
   Stats et graphiques
   ══════════════════════════════════ */
.stats-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 12px; margin-bottom: 20px; }
.stat-card { background: var(--white); border: 1px solid var(--border); border-radius: var(--r); padding: 18px 16px; box-shadow: var(--sh); text-align: center; }
.stat-card .sv { font: 800 32px "DM Sans"; color: var(--ink); }
.stat-card .sl { font: 600 10px "DM Sans"; color: var(--muted); text-transform: uppercase; letter-spacing: .12em; margin-top: 6px; }
.chart-box { background: var(--white); border: 1px solid var(--border); border-radius: var(--r); padding: 20px; box-shadow: var(--sh); margin-bottom: 14px; }
.chart-title { font: 700 11px "DM Sans"; text-transform: uppercase; letter-spacing: .12em; color: var(--ink2); margin-bottom: 16px; }
.hour-chart { display: flex; gap: 3px; align-items: flex-end; height: 100px; padding-bottom: 22px; }
.hb-w { flex: 1; display: flex; flex-direction: column; align-items: center; height: 100%; justify-content: flex-end; }
.hb { width: 100%; border-radius: 4px 4px 0 0; min-height: 2px; transition: height .5s ease-out; position: relative; cursor: pointer; }
.hb:hover { filter: brightness(1.1); }
.hb .hb-v { position: absolute; top: -15px; left: 50%; transform: translateX(-50%); font: 800 9px "DM Sans"; color: var(--ink); opacity: 0; }
.hb:hover .hb-v { opacity: 1; }
.hb-l { font: 600 9px "DM Sans"; color: var(--muted); margin-top: 5px; }
.top-list { display: flex; flex-direction: column; gap: 10px; }
.top-item { display: flex; align-items: center; gap: 12px; }
.top-rank { font: 800 11px "DM Sans"; color: var(--subtle); width: 18px; text-align: right; }
.top-info { flex: 1; min-width: 0; }
.top-name { font: 600 12px "DM Sans"; color: var(--ink); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.top-bg { height: 5px; background: var(--border); border-radius: 3px; margin-top: 4px; overflow: hidden; }
.top-fg { height: 100%; background: var(--orange); border-radius: 3px; transition: width .5s ease-out; }
.top-cnt { font: 800 11px "DM Sans"; color: var(--muted); }

/* ══════════════════════════════════
   Réglages
   ══════════════════════════════════ */
.s-group { background: var(--white); border: 1px solid var(--border); border-radius: var(--r); margin-bottom: 14px; overflow: hidden; box-shadow: var(--sh); }
.s-group h3 { font: 400 16px "Poiret One", serif; letter-spacing: .15em; text-transform: uppercase; padding: 18px 20px 14px; border-bottom: 1px solid var(--border); }
.s-row { padding: 14px 20px; display: flex; gap: 14px; flex-wrap: wrap; align-items: flex-start; border-bottom: 1px solid var(--border); }
.s-row:last-child { border-bottom: none; }
.s-field { flex: 1; min-width: 160px; }
.s-field label { font: 700 10px "DM Sans"; color: var(--muted); text-transform: uppercase; letter-spacing: .12em; display: block; margin-bottom: 6px; }
.s-field input, .s-field select { width: 100%; background: var(--bg); border: 1.5px solid var(--border); color: var(--ink); font: 400 14px "DM Sans"; padding: 12px 14px; outline: none; border-radius: var(--r-sm); min-height: 48px; }
.s-field input:focus { border-color: var(--bleu); box-shadow: 0 0 0 3px rgba(107,158,226,.1); }
.s-field .help { font: 400 10px/1.5 "DM Sans"; color: var(--muted); margin-top: 4px; }
.s-url { background: var(--bg); border-radius: var(--r-sm); padding: 12px; font: 400 11px "DM Sans"; word-break: break-all; display: flex; justify-content: space-between; align-items: center; gap: 12px; margin-top: 6px; }
.s-url a { color: var(--bleu); text-decoration: none; font-weight: 600; }
.ring-row { display: flex; gap: 8px; align-items: center; }
.ring-row select { flex: 1; }
.ring-test { min-height: 40px !important; padding: 10px 16px !important; }
.s-btns { display: flex; gap: 12px; justify-content: flex-end; padding-top: 8px; flex-wrap: wrap; }
.s-btns .b-ghost { padding: 14px 28px; border-radius: 14px; }
.s-btns .b-pri { padding: 16px 48px; font-size: 14px; border-radius: 14px; }

/* ══════════════════════════════════
   Responsive — iPad 8 (10.2" - 810x1080)
   ══════════════════════════════════ */
@media (max-width: 1024px) {
  .grid { grid-template-columns: repeat(auto-fill, minmax(320px, 1fr)); gap: 14px; }
  header { padding: 0 12px; height: 54px; }
  main { padding: 14px 14px 90px; }
  .tabs { padding: 0 14px; }
  .c-client { font-size: 22px; }
  .c-acts button { min-height: 58px; font-size: 14px; }
  .c-bd .itm { font-size: 15px; padding: 7px 0; }
  .c-bd .opt { font-size: 13px; }
  .c-num { font-size: 16px; }
  .c-pk { font-size: 17px; padding: 10px 16px; }
  .c-meta { font-size: 13px; }
  .stats-grid { grid-template-columns: repeat(3, 1fr); gap: 10px; }
  .search-input { font-size: 16px; }
}

@media (max-width: 600px) {
  .stats-grid { grid-template-columns: repeat(2, 1fr); }
  .grid { grid-template-columns: 1fr; }
}
