:root {
  --green: #0c6b3c;
  --green-dark: #084e2c;
  --blue: #0c6b3c;
  --blue-dark: #084e2c;
  --bg: #f3efe6;
  --card: #fffdf9;
  --ink: #1c1915;
  --muted: #6d655c;
  --line: #e4dcd0;
  --ok: #0c6b3c;
  --warn: #8a5a16;
  --danger: #9d3b32;
  --soft: #e7f3eb;
  --shadow: none;
  --radius: 20px;
  --nav: 74px;
  --safe-b: env(safe-area-inset-bottom, 0px);
}

* { box-sizing: border-box; }
html, body { margin: 0; height: 100%; }
body {
  font-family: "Segoe UI", system-ui, -apple-system, sans-serif;
  color: var(--ink);
  background: #e6e0d4;
}
button, input, textarea, select { font: inherit; color: inherit; }
button { cursor: pointer; }
img { max-width: 100%; }

.phone {
  width: min(440px, 100%);
  min-height: 100%;
  margin: 0 auto;
  background: var(--bg);
  position: relative;
  display: flex;
  flex-direction: column;
}
@media (min-width: 560px) {
  body { padding: 22px 0; }
  .phone {
    min-height: calc(100vh - 44px);
    border-radius: 28px;
    overflow: hidden;
    box-shadow: 0 18px 50px rgba(40, 32, 18, 0.16);
  }
}

.top {
  background: var(--green);
  color: white;
  text-align: center;
  padding: 12px 16px 11px;
  flex: none;
}
.top-title {
  font-weight: 700;
  letter-spacing: 0.22em;
  font-size: 13px;
}

.view {
  flex: 1;
  padding: 16px 14px calc(var(--nav) + var(--safe-b) + 18px);
}
.view.solo { padding-bottom: 28px; }

.hello {
  margin: 2px 2px 12px;
}
.hello h1 {
  margin: 0;
  font-size: 26px;
  letter-spacing: -0.03em;
}
.hello p {
  margin: 4px 0 0;
  color: var(--muted);
  font-size: 14px;
}

.summary { display: none; }

.hours {
  display: flex;
  gap: 4px;
  overflow-x: auto;
  margin: 0 0 14px;
  padding: 4px;
  background: #e9e2d6;
  border-radius: 16px;
  scrollbar-width: none;
}
.hours::-webkit-scrollbar { display: none; }
.hour {
  flex: 1;
  border: 0;
  background: transparent;
  border-radius: 12px;
  padding: 8px 6px 7px;
  font-weight: 700;
  color: var(--ink);
  box-shadow: none;
  white-space: nowrap;
  text-align: center;
}
.hour b { font-size: 15px; font-weight: 800; }
.hour small {
  display: block;
  font-weight: 600;
  color: var(--muted);
  font-size: 11px;
}
.hour.on {
  background: var(--green);
  color: white;
}
.hour.on small { color: rgba(255,255,255,.88); }
.hour .dot {
  display: inline-block;
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: #c9842a;
  margin-right: 4px;
}
.hour.on .dot { background: #ffe08a; }
.hour.done .dot { background: #8fd9ae; }

.card {
  background: var(--card);
  border-radius: var(--radius);
  border: 1px solid var(--line);
  box-shadow: none;
  padding: 14px;
  margin-bottom: 12px;
}
.product {
  display: grid;
  grid-template-columns: 72px 1fr;
  gap: 12px;
  align-items: center;
}
.thumb {
  width: 72px;
  height: 72px;
  border-radius: 16px;
  background: #f6f1e8;
  object-fit: contain;
  border: 1px solid var(--line);
}
.thumb.ph {
  display: grid;
  place-items: center;
  color: var(--muted);
  font-weight: 800;
  font-size: 20px;
}
.pname { font-weight: 750; font-weight: 700; font-size: 16px; line-height: 1.2; }
.pdesc { color: var(--muted); font-size: 12.5px; margin-top: 3px; line-height: 1.35; }
.meta { margin-top: 8px; display: flex; gap: 8px; flex-wrap: wrap; align-items: center; }
.pill {
  background: var(--soft);
  color: var(--green-dark);
  border-radius: 999px;
  padding: 4px 8px;
  font-size: 12px;
  font-weight: 700;
}
.count-label {
  margin: 16px 0 8px;
  text-align: center;
  font-size: 12px;
  font-weight: 800;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--muted);
}
.stepper { display: flex; align-items: center; justify-content: center; gap: 8px; }
.stepper button, .icon-btn {
  width: 56px;
  height: 56px;
  border-radius: 16px;
  border: 0;
  background: var(--soft);
  font-size: 28px;
  font-weight: 700;
  color: var(--green-dark);
}
.stepper input {
  width: 108px;
  height: 56px;
  text-align: center;
  border: 0;
  border-radius: 16px;
  font-weight: 800;
  font-size: 32px;
  background: #f6f1e8;
}
.stepper input::placeholder { color: #c4bbae; }
.sortir {
  margin-top: 14px;
  border-radius: 16px;
  padding: 14px 16px;
  font-weight: 800;
  font-size: 16px;
  display: flex;
  justify-content: space-between;
  align-items: center;
}
.sortir span:last-child { font-size: 28px; letter-spacing: -0.03em; }
.sortir.go { background: var(--green); color: white; }
.sortir.ok { background: var(--soft); color: var(--green-dark); }
.sortir.wait { background: #f8efdf; color: var(--warn); }
.saved { font-size: 12px; font-weight: 650; font-weight: 600; }

.section-title {
  margin: 8px 2px 10px;
  font-size: 13px;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--muted);
  font-weight: 800;
}

.row-btn, .primary, .ghost, .danger {
  border: 0;
  border-radius: 14px;
  font-weight: 750;
  font-weight: 700;
}
.primary {
  background: var(--green);
  color: white;
  width: 100%;
  min-height: 52px;
  padding: 14px 16px;
  font-size: 16px;
  box-shadow: none;
}
.ghost {
  background: white;
  color: var(--ink);
  padding: 12px 14px;
  border: 1px solid var(--line);
  box-shadow: none;
}
.danger { background: #fbeceb; color: var(--danger); padding: 8px 10px; }
.unlink {
  border: 0;
  background: transparent;
  color: var(--danger);
  font-weight: 700;
  font-size: 13px;
  padding: 4px 0 0;
}
.row-btn {
  width: 100%;
  background: white;
  text-align: left;
  padding: 14px;
  border-radius: 16px;
  border: 1px solid var(--line);
  box-shadow: none;
  margin-bottom: 8px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 10px;
}
.chev { color: #9aa8ba; font-size: 20px; }

.field { margin-bottom: 12px; }
.field span { display: block; font-size: 13px; font-weight: 700; margin-bottom: 6px; }
.field input, .field textarea, .field select, .search input {
  width: 100%;
  border: 1px solid var(--line);
  background: white;
  border-radius: 14px;
  padding: 12px 14px;
  outline: none;
}
.field textarea { min-height: 90px; resize: vertical; }
.field input:focus, .field textarea:focus, .search input:focus {
  border-color: var(--green);
  box-shadow: 0 0 0 3px rgba(12, 107, 60, 0.16);
}

.search { margin-bottom: 12px; }
.store-select { margin: 0 0 12px; }

.hour-block { margin-bottom: 16px; }
.hour-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin: 4px 2px 8px;
}
.hour-head strong { font-size: 18px; }
.add-link {
  border: 0;
  background: transparent;
  color: var(--blue);
  font-weight: 750;
  font-weight: 700;
  padding: 6px;
}

.sheet-back {
  position: fixed;
  inset: 0;
  background: rgba(15, 27, 45, 0.45);
  z-index: 20;
  display: flex;
  align-items: flex-end;
  justify-content: center;
}
.sheet {
  width: min(440px, 100%);
  background: var(--bg);
  border-radius: 22px 22px 0 0;
  max-height: min(86vh, 720px);
  overflow: auto;
  padding: 12px 14px calc(16px + var(--safe-b));
}
.sheet h2 { margin: 6px 4px 12px; font-size: 20px; }
.grab {
  width: 42px;
  height: 5px;
  border-radius: 99px;
  background: #c9d4e2;
  margin: 4px auto 8px;
}
.grid-hours {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 8px;
}
.grid-hours button {
  border: 0;
  background: white;
  border-radius: 14px;
  padding: 14px 0;
  font-weight: 800;
  border: 1px solid var(--line);
  box-shadow: none;
  min-height: 52px;
}
.grid-hours button:disabled { opacity: 0.35; }

.pick {
  display: grid;
  grid-template-columns: 52px 1fr auto;
  gap: 10px;
  align-items: center;
}
.pick img, .pick .thumb { width: 52px; height: 52px; }
.mini { font-size: 12px; color: var(--muted); }

.user-card { padding: 14px; }
.user-card h3 { margin: 0 0 2px; font-size: 16px; }
.user-card .mail { color: var(--muted); font-size: 12.5px; margin-bottom: 10px; word-break: break-all; }
.checks { display: flex; flex-wrap: wrap; gap: 6px; margin: 8px 0 10px; }
.check {
  display: flex;
  gap: 6px;
  align-items: center;
  background: #f6f1e8;
  border-radius: 999px;
  padding: 6px 10px;
  font-size: 13px;
}
.actions { display: flex; gap: 8px; }
.actions .primary, .actions .ghost { width: auto; flex: 1; }

.empty {
  text-align: center;
  color: var(--muted);
  padding: 28px 12px;
}
.empty strong { display: block; color: var(--ink); font-size: 18px; margin-bottom: 6px; }

.tabbar {
  position: sticky;
  bottom: 0;
  margin-top: auto;
  background: var(--card);
  border-top: 1px solid var(--line);
  display: flex;
  padding: 6px 6px calc(6px + var(--safe-b));
  z-index: 5;
}
.phone { min-height: 100vh; }
.tabbar button {
  flex: 1;
  border: 0;
  background: transparent;
  color: #8b98ab;
  font-size: 11px;
  font-weight: 700;
  padding: 6px 2px 4px;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 3px;
}
.tabbar button svg { width: 22px; height: 22px; }
.tabbar button.on { color: var(--green); }

.tabs {
  display: flex;
  gap: 8px;
  margin-bottom: 12px;
}
.tabs button {
  flex: 1;
  border: 0;
  background: white;
  border-radius: 12px;
  padding: 10px;
  font-weight: 750;
  font-weight: 700;
  border: 1px solid var(--line);
  box-shadow: none;
}
.tabs button.on { background: var(--green); color: white; }

.login {
  min-height: calc(100vh - 90px);
  display: flex;
  flex-direction: column;
  justify-content: center;
  text-align: center;
  padding: 12px;
}
.login h1 { margin: 0 0 8px; font-size: 28px; }
.login p { color: var(--muted); line-height: 1.45; }
.login a { color: var(--blue); font-weight: 750; font-weight: 700; }

.badge {
  font-size: 11px;
  font-weight: 800;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  border-radius: 999px;
  padding: 3px 8px;
}
.badge.admin { background: var(--soft); color: var(--green-dark); }
.badge.cdf { background: #f3eee4; color: var(--ink); }
.badge.magasin { background: #f8efdf; color: var(--warn); }
.badge.pending { background: #fbeceb; color: var(--danger); }

.toast {
  position: fixed;
  left: 50%;
  bottom: 92px;
  transform: translateX(-50%);
  background: var(--ink);
  color: white;
  padding: 10px 14px;
  border-radius: 999px;
  font-size: 14px;
  font-weight: 700;
  z-index: 30;
  width: max-content;
  max-width: 90vw;
}

.lead { margin: 0 2px 14px; color: var(--muted); font-size: 14px; line-height: 1.4; }
.back {
  border: 0; background: transparent; color: var(--blue); font-weight: 700;
  padding: 0 2px 8px; font-size: 15px;
}
.back::before { content: "‹ "; }
.menu {
  width: 100%;
  display: flex; align-items: center; gap: 12px;
  background: white; border: 1px solid var(--line); border-radius: 18px;
  box-shadow: none; padding: 12px 14px; margin-bottom: 8px;
  min-height: 64px;
  text-align: left;
}
.menu.static { cursor: default; }
.menu-ico {
  width: 46px; height: 46px; border-radius: 14px; flex: none;
  display: grid; place-items: center;
  background: var(--soft); color: var(--green-dark); font-weight: 800;
}
.menu-ico svg { width: 22px; height: 22px; }
.menu .thumb { width: 46px; height: 46px; border-radius: 12px; }
.menu-text { display: flex; flex-direction: column; gap: 2px; min-width: 0; flex: 1; }
.menu-text strong { font-size: 16px; }
.menu-text small { color: var(--muted); font-size: 13px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.menu .chev { color: #9aa8ba; font-size: 26px; line-height: 1; }
.card.line { display: block; }
.line-head { display: flex; align-items: center; gap: 12px; }
.line-body { flex: 1; min-width: 0; }
.card.line .stepper { margin-top: 12px; }
.icon-x { width: 36px; height: 36px; border-radius: 12px; flex: none; }
.add-row { display: flex; gap: 8px; margin-bottom: 10px; }
.add-row input {
  flex: 1; border: 1px solid var(--line); background: white; border-radius: 14px;
  padding: 14px;
}
.primary.slim, .ghost.slim { width: auto; padding: 12px 14px; box-shadow: none; }
.ghost.full { width: 100%; margin-top: 8px; }
.choices { display: flex; gap: 8px; margin-bottom: 8px; }
.choice {
  flex: 1; border: 1px solid var(--line); background: white; border-radius: 12px;
  padding: 14px 8px; font-weight: 700; min-height: 48px;
}
.choice.on { background: var(--green); color: white; }
.line-check {
  display: flex; gap: 10px; align-items: center;
  background: white; border: 1px solid var(--line); border-radius: 14px; padding: 14px; margin-bottom: 8px;
  min-height: 52px;
}
.preview { display: flex; justify-content: center; margin-bottom: 8px; }
.preview .thumb { width: 96px; height: 96px; }
.suivi-line {
  display: flex;
  justify-content: space-between;
  gap: 8px;
  padding: 8px 0;
  border-top: 1px solid var(--line);
  font-size: 14px;
}
.suivi-line:first-child { border-top: 0; }
.muted { color: var(--muted); }
.off { opacity: 0.55; }
