:root {
  --bg: #0E1014; --s1: #161A21; --s2: #1B2029; --s3: #222833; --line: #262C36; --line2: #2C3340;
  --tx: #E8EAED; --tx-hi: #F2F3F5; --mut: #9AA3AF; --mut2: #6F7885;
  --acc: #FF6B3D; --acc-hi: #FF8A5C; --acc-bg: #2A1A14; --acc-line: #5C2E1C;
  --ok: #7EE2A8; --ok-bg: #15211B; --ok-line: #24543A;
  --warn: #F5C451; --warn-bg: #211D14; --warn-line: #5A4A1E;
  --bad: #F87171; --bad-bg: #2A1616; --bad-line: #5C2626;
  --blue: #6CB6FF; --blue-bg: #14202C; --blue-line: #224866;
  --violet: #B79CFF;
  --r: 14px; --font: Inter, 'Segoe UI', system-ui, sans-serif; --disp: 'Space Grotesk', 'Segoe UI', system-ui, sans-serif;
}
* { box-sizing: border-box; }
html, body { margin: 0; background: var(--bg); color: var(--tx); font: 14px/1.45 var(--font); }
body { min-height: 100vh; }
button, input, select, textarea { font: inherit; color: inherit; }
a { color: var(--acc-hi); }
h2, h3 { font-family: var(--disp); margin: 0; }
[hidden] { display: none !important; }
::-webkit-scrollbar { width: 10px; height: 10px; } ::-webkit-scrollbar-thumb { background: #2C3340; border-radius: 8px; border: 2px solid var(--bg); }

.app { max-width: 1680px; margin: 0 auto; padding: 18px 24px 32px; display: flex; flex-direction: column; gap: 18px; }
.top { display: flex; align-items: center; gap: 14px; flex-wrap: wrap; }
.brand { display: flex; align-items: center; gap: 12px; }
.brand img { border-radius: 10px; }
.brand-name { font: 700 22px var(--disp); letter-spacing: .14em; color: var(--tx-hi); }
.brand-sub { font-size: 12px; color: var(--mut); }
.grow { flex: 1 1 auto; }
.clock { color: var(--mut); font-size: 13px; }
.seg { display: flex; gap: 4px; padding: 4px; background: var(--s1); border: 1px solid var(--line); border-radius: 12px; }
.seg button { border: 0; background: transparent; color: #AEB6C2; font-weight: 600; padding: 10px 22px; border-radius: 8px; cursor: pointer; min-height: 40px; }
.seg button.on { background: var(--acc); color: #0E1014; }
.seg.small button { padding: 6px 12px; min-height: 32px; font-size: 13px; }

.chip { font-size: 12px; padding: 4px 10px; border-radius: 999px; background: #1F242D; color: #AEB6C2; border: 1px solid var(--line2); white-space: nowrap; }
.chip.ok { color: var(--ok); border-color: var(--ok-line); background: var(--ok-bg); }
.chip.warn { color: var(--warn); border-color: var(--warn-line); background: var(--warn-bg); }
.chip.bad { color: var(--bad); border-color: var(--bad-line); background: var(--bad-bg); }
.chip.acc { color: #0E1014; background: var(--acc); border-color: var(--acc); }
.chip.blue { color: var(--blue); border-color: var(--blue-line); background: var(--blue-bg); }
button.chip { cursor: pointer; }

.btn { border: 1px solid var(--line2); background: var(--s2); color: var(--tx); border-radius: 10px; padding: 0 16px; min-height: 40px; cursor: pointer; font-weight: 600; white-space: nowrap; }
.btn:hover { border-color: #3A4352; }
.btn.acc { background: var(--acc); border-color: var(--acc); color: #0E1014; }
.btn.acc:hover { background: var(--acc-hi); }
.btn.ghost { background: transparent; }
.btn.sm { min-height: 32px; padding: 0 12px; font-size: 13px; border-radius: 8px; }
.btn:disabled { opacity: .5; cursor: default; }
.icon-btn { width: 32px; height: 32px; border-radius: 8px; border: 1px solid var(--line2); background: transparent; color: #AEB6C2; cursor: pointer; display: inline-flex; align-items: center; justify-content: center; font-size: 16px; flex: none; }
.icon-btn:hover { color: var(--tx-hi); border-color: #3A4352; }
.icon-btn.big { width: 44px; height: 44px; border-radius: 10px; }
.bell-wrap, .add-wrap { position: relative; }
.badge { position: absolute; top: -6px; right: -6px; min-width: 20px; height: 20px; padding: 0 5px; border-radius: 10px; background: var(--acc); color: #0E1014; font-size: 12px; font-weight: 700; display: flex; align-items: center; justify-content: center; }
.pop { position: absolute; right: 0; top: calc(100% + 8px); z-index: 30; width: min(420px, 90vw); max-height: 70vh; overflow: auto; background: var(--s1); border: 1px solid var(--line2); border-radius: 12px; box-shadow: 0 20px 50px rgba(0,0,0,.5); padding: 8px; }
.pop .row { display: flex; gap: 10px; align-items: flex-start; padding: 10px; border-radius: 8px; }
.pop .row:hover { background: var(--s2); }
.pop .empty { padding: 16px; color: var(--mut); }
.pop .pop-head { display: flex; justify-content: space-between; align-items: center; padding: 6px 10px 10px; }

.banner { display: flex; align-items: center; gap: 14px; flex-wrap: wrap; padding: 12px 16px; border-radius: 12px; background: var(--acc-bg); border: 1px solid var(--acc-line); }
.banner .dot { width: 10px; height: 10px; border-radius: 5px; background: var(--acc); flex: none; animation: pulse 2s infinite; }
.banner strong { color: #FFD2BF; }
.banner span { color: #E7B9A6; }
@keyframes pulse { 0%,100% { box-shadow: 0 0 0 0 rgba(255,107,61,.5); } 50% { box-shadow: 0 0 0 6px rgba(255,107,61,0); } }

.grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 18px; align-items: start; grid-auto-flow: row dense; }
@media (max-width: 1200px) { .grid { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
@media (max-width: 760px) { .grid { grid-template-columns: minmax(0, 1fr); } .card { grid-column: span 1 !important; } .app { padding: 14px 16px; } }
.card { background: var(--s1); border: 1px solid var(--line); border-radius: var(--r); padding: 18px; display: flex; flex-direction: column; gap: 14px; min-width: 0; }
.card.s2 { grid-column: span 2; } .card.s3 { grid-column: 1 / -1; }
@media (max-width: 1200px) { .card.s2, .card.s3 { grid-column: 1 / -1; } }
.card.dragging { opacity: .4; } .card.drop-before { box-shadow: -4px 0 0 0 var(--acc); } .card.drop-after { box-shadow: 4px 0 0 0 var(--acc); }
.card.flash { animation: flash 1.2s; } @keyframes flash { 0% { border-color: var(--acc); } 100% { border-color: var(--line); } }
.ch { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.ch h2 { font-size: 18px; font-weight: 600; color: var(--tx-hi); }
.grip { color: #5B6472; cursor: grab; user-select: none; letter-spacing: -2px; padding: 4px 2px; }
.ch .acts { margin-left: auto; display: flex; gap: 6px; }
.body { display: flex; flex-direction: column; gap: 14px; min-width: 0; }
.muted { color: var(--mut); } .small { font-size: 12px; } .hi { color: var(--tx-hi); }
.lbl { font-size: 12px; color: var(--mut); text-transform: uppercase; letter-spacing: .06em; }
.kpis { display: grid; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); gap: 10px; }
.kpi { padding: 14px; border-radius: 10px; background: var(--s2); display: flex; flex-direction: column; gap: 4px; min-width: 0; }
.kpi .v { font: 600 23px var(--disp); color: var(--tx-hi); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.kpi .s { font-size: 12px; color: var(--mut); }
.pos { color: var(--ok) !important; } .neg { color: var(--bad) !important; } .wrn { color: var(--warn) !important; }
.cols { display: flex; flex-wrap: wrap; gap: 20px; } .cols > * { flex: 1 1 260px; min-width: 0; }
.list { display: flex; flex-direction: column; }
.li { display: flex; gap: 10px; align-items: center; padding: 9px 0; border-bottom: 1px solid #20262F; min-width: 0; }
.li:last-child { border-bottom: 0; }
.li .grow { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.li .amt { font-weight: 600; white-space: nowrap; }
.li .d { width: 46px; color: var(--mut); font-size: 12px; flex: none; }
.bar { height: 6px; border-radius: 3px; background: var(--line); overflow: hidden; } .bar > i { display: block; height: 100%; border-radius: 3px; background: var(--acc); }
.bar.ok > i { background: var(--ok); } .bar.bad > i { background: var(--bad); } .bar.warn > i { background: var(--warn); }
.env { display: flex; flex-direction: column; gap: 6px; } .env .t { display: flex; justify-content: space-between; gap: 8px; }
.empty-state { padding: 18px; border: 1px dashed var(--line2); border-radius: 10px; color: var(--mut); display: flex; flex-direction: column; gap: 10px; align-items: flex-start; }
.err { color: var(--bad); font-size: 13px; }
.foot { text-align: center; font-size: 12px; color: var(--mut2); }
.tabs { display: flex; gap: 6px; flex-wrap: wrap; }
.tabs button { border: 1px solid var(--line2); background: transparent; color: #AEB6C2; border-radius: 999px; padding: 5px 12px; cursor: pointer; font-size: 13px; min-height: 32px; }
.tabs button.on { background: var(--acc); color: #0E1014; border-color: var(--acc); font-weight: 600; }
.tabs button .n { opacity: .8; margin-left: 4px; }

/* mails */
.mail { display: flex; gap: 12px; padding: 10px 6px; border-bottom: 1px solid #20262F; border-radius: 8px; cursor: pointer; }
.mail:hover { background: var(--s2); }
.mail .pd { width: 8px; height: 8px; margin-top: 7px; border-radius: 4px; flex: none; background: #5B6472; }
.mail .pd.p3 { background: var(--acc); } .mail .pd.p2 { background: var(--warn); }
.mail .mm { flex: 1 1 auto; min-width: 0; display: flex; flex-direction: column; gap: 2px; }
.mail .mt { display: flex; justify-content: space-between; gap: 8px; } .mail .mt strong { color: var(--tx-hi); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.mail .subj { color: #C9CED6; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.mail.read .subj, .mail.read strong { font-weight: 400; color: var(--mut); }
.mail .meta { font-size: 12px; color: var(--mut); display: flex; gap: 8px; flex-wrap: wrap; align-items: center; }
.ai { font-size: 11px; padding: 1px 6px; border-radius: 6px; background: #241C33; color: var(--violet); border: 1px solid #3B2F57; }
.scroll { max-height: 520px; overflow: auto; padding-right: 4px; }

/* planning */
.days { display: grid; grid-template-columns: repeat(7, minmax(0, 1fr)); gap: 8px; }
.day { padding: 10px; border-radius: 10px; border: 1px solid var(--line2); background: var(--s2); display: flex; flex-direction: column; gap: 4px; min-height: 86px; cursor: pointer; text-align: left; color: inherit; position: relative; }
.day:hover { border-color: #3A4352; }
.day .dn { font-size: 12px; color: var(--mut); } .day .code { font-weight: 700; font-family: var(--disp); font-size: 15px; } .day .h { font-size: 12px; color: #C9CED6; }
.day.today { outline: 2px solid var(--acc); outline-offset: 1px; }
.day.past { opacity: .55; }
.day.m .code { color: #FFB08F; } .day.m { background: #24191A; border-color: #4A2A20; }
.day.s .code { color: var(--blue); } .day.s { background: var(--blue-bg); border-color: var(--blue-line); }
.day.rp .code { color: var(--ok); } .day.rp { background: var(--ok-bg); border-color: var(--ok-line); }
.day.d .code { color: var(--warn); } .day.d { background: var(--warn-bg); border-color: var(--warn-line); }
.day.c .code { color: var(--violet); } .day.c { background: #1E1A2B; border-color: #3B2F57; }
.day.f .code { color: #E39BE0; }
.day .star { position: absolute; top: 6px; right: 8px; color: var(--violet); font-size: 12px; }
.day .man { position: absolute; bottom: 6px; right: 8px; width: 6px; height: 6px; border-radius: 3px; background: var(--acc); }
.month { display: grid; grid-template-columns: repeat(7, minmax(0, 1fr)); gap: 4px; }
.month .wd { font-size: 11px; color: var(--mut); text-align: center; padding: 4px 0; text-transform: uppercase; }
.month .day { min-height: 54px; padding: 6px; } .month .day .code { font-size: 13px; }
.next { padding: 14px 16px; border-radius: 10px; background: var(--s2); display: flex; gap: 14px; flex-wrap: wrap; align-items: center; }
.next .big { font: 600 19px var(--disp); color: var(--tx-hi); }
.legend { display: flex; gap: 12px; flex-wrap: wrap; font-size: 12px; color: var(--mut); }
.codepick { display: flex; gap: 6px; flex-wrap: wrap; }

/* popote */
.week { display: flex; flex-direction: column; }
/* grille des repas : chaque ligne a la même hauteur, chaque case la même structure */
.card { container-type: inline-size; }
.wrow { --n: 2; display: grid; grid-template-columns: 96px repeat(var(--n), minmax(0, 1fr)); column-gap: 10px; align-items: start; padding: 8px 6px; border-bottom: 1px solid #20262F; }
.wrow.whead { padding-top: 0; padding-bottom: 6px; position: sticky; top: 0; background: var(--s1); z-index: 1; }
.wrow .dd { display: flex; flex-direction: column; justify-content: center; gap: 3px; height: 38px; min-width: 0; }
.wrow .dd .hi { white-space: nowrap; }
.wrow .dd .chip { align-self: flex-start; padding: 0 8px; font-size: 11px; line-height: 16px; }
.pcell { display: flex; flex-direction: column; gap: 3px; min-width: 0; }
.pcell select { height: 38px; min-height: 38px; font-size: 13px; padding: 0 8px; text-overflow: ellipsis; }
.pcell .hint { font-size: 11px; line-height: 14px; height: 14px; color: var(--mut); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.pcell .slotname { display: none; }
@container (max-width: 760px) {
  .wrow { grid-template-columns: 70px repeat(var(--n), minmax(0, 1fr)); column-gap: 6px; }
  .pcell .hint { display: none; }
  .pcell select { font-size: 12px; padding: 0 4px; }
}
@container (max-width: 420px) {
  .wrow { grid-template-columns: 64px minmax(0, 1fr); row-gap: 6px; }
  .wrow.whead { display: none; }
  .wrow .dd { grid-row: span var(--n); height: auto; justify-content: flex-start; }
  .pcell { flex-direction: row; align-items: center; gap: 6px; }
  .pcell .slotname { display: block; width: 40px; flex: none; font-size: 11px; color: var(--mut); }
}
select, input[type=text], input[type=number], input[type=date], input[type=password], input[type=email], textarea { background: var(--s2); border: 1px solid var(--line2); border-radius: 8px; padding: 8px 10px; min-height: 38px; width: 100%; min-width: 0; }
select:focus, input:focus, textarea:focus, button:focus-visible { outline: 2px solid var(--acc); outline-offset: 1px; }
textarea { min-height: 90px; resize: vertical; }
.rayon { margin-top: 6px; }
.check { display: flex; gap: 10px; align-items: center; padding: 6px 0; cursor: pointer; }
.check input { width: 18px; height: 18px; accent-color: var(--acc); flex: none; }
.check.done span { text-decoration: line-through; color: var(--mut); }
.inline { display: flex; gap: 8px; flex-wrap: wrap; align-items: center; } .inline > input, .inline > select { flex: 1 1 160px; width: auto; }

/* mémo */
.memo { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 12px; }
@media (max-width: 900px) { .memo { grid-template-columns: minmax(0, 1fr); } }
.mcol { background: var(--s2); border-radius: 10px; padding: 12px; display: flex; flex-direction: column; gap: 8px; min-width: 0; }
.mcol .mh { display: flex; justify-content: space-between; align-items: center; }
.note { display: flex; gap: 10px; align-items: flex-start; padding: 10px; border-radius: 8px; background: var(--s1); border: 1px solid var(--line); }
.note.late { border-color: var(--bad-line); } .note.soon { border-color: var(--warn-line); }
.note input[type=checkbox] { width: 18px; height: 18px; margin-top: 2px; accent-color: var(--acc); flex: none; }
.note .nb { flex: 1 1 auto; min-width: 0; display: flex; flex-direction: column; gap: 4px; cursor: pointer; }
.note .nt { color: var(--tx); } .note.done .nt { text-decoration: line-through; color: var(--mut); }
.note .nn { font-size: 12px; color: var(--mut); display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.note .nm { display: flex; gap: 6px; flex-wrap: wrap; align-items: center; font-size: 12px; }

/* shopify */
.spark { display: flex; align-items: flex-end; gap: 3px; height: 70px; }
.spark i { flex: 1 1 0; background: #3A2A24; border-radius: 3px 3px 0 0; min-height: 2px; }
.spark i.on { background: var(--acc); } .spark i.today { background: var(--acc-hi); }

/* modal & toasts */
dialog { background: var(--s1); color: var(--tx); border: 1px solid var(--line2); border-radius: 16px; padding: 0; width: min(760px, 94vw); max-height: 88vh; }
dialog::backdrop { background: rgba(5,6,8,.7); }
.modal-inner { display: flex; flex-direction: column; max-height: 88vh; }
.modal-head { display: flex; justify-content: space-between; align-items: center; padding: 18px 20px; border-bottom: 1px solid var(--line); }
.modal-head h2 { font-size: 19px; }
.modal-body { padding: 18px 20px; overflow: auto; display: flex; flex-direction: column; gap: 14px; }
.modal-foot { padding: 14px 20px; border-top: 1px solid var(--line); display: flex; justify-content: flex-end; gap: 10px; flex-wrap: wrap; }
.field { display: flex; flex-direction: column; gap: 6px; } .field label { font-size: 13px; color: #C9CED6; font-weight: 500; }
.field .help { font-size: 12px; color: var(--mut); }
.fgrid { display: grid; grid-template-columns: repeat(auto-fit, minmax(200px, 1fr)); gap: 12px; }
fieldset { border: 1px solid var(--line); border-radius: 12px; padding: 14px; display: flex; flex-direction: column; gap: 12px; margin: 0; }
legend { font: 600 15px var(--disp); padding: 0 6px; color: var(--tx-hi); }
.switch { display: flex; gap: 10px; align-items: center; cursor: pointer; } .switch input { width: 18px; height: 18px; accent-color: var(--acc); }
.toasts { position: fixed; right: 20px; bottom: 20px; display: flex; flex-direction: column; gap: 8px; z-index: 50; }
.toast { background: var(--s3); border: 1px solid var(--line2); border-left: 0; border-radius: 10px; padding: 12px 16px; box-shadow: 0 10px 30px rgba(0,0,0,.4); max-width: 380px; animation: tin .2s; }
.toast.err { border-color: var(--bad-line); color: #FFC9C9; }
@keyframes tin { from { transform: translateY(8px); opacity: 0; } }
.spin { display: inline-block; width: 14px; height: 14px; border: 2px solid var(--line2); border-top-color: var(--acc); border-radius: 50%; animation: sp 0.8s linear infinite; vertical-align: -2px; }
@keyframes sp { to { transform: rotate(360deg); } }
.skeleton { height: 120px; border-radius: 10px; background: linear-gradient(90deg, var(--s2), var(--s3), var(--s2)); background-size: 200% 100%; animation: sk 1.4s infinite; }
@keyframes sk { to { background-position: -200% 0; } }
/* ajustements */
.ch { flex-wrap: nowrap; }
.ch h2 { white-space: nowrap; }
.chips { display: flex; gap: 6px; flex-wrap: wrap; min-width: 0; flex: 0 1 auto; }
.mcol { max-height: 720px; overflow: auto; }
.li .small { white-space: nowrap; }
@media (max-width: 520px) { .chips { display: none; } .days { grid-template-columns: repeat(4, minmax(0, 1fr)); } .seg button { padding: 8px 14px; } }
.shoplist { columns: 300px; column-gap: 28px; } .shoplist .rayon { break-inside: avoid; margin: 0 0 12px; }
