/* Meat&Mart admin — brand palette from the app (theme.js) */
:root {
  --deep: #1E3932;
  --deep-2: #2C4A40;
  --green: #6FAE44;
  --green-dark: #4C8A2E;
  --lime: #C6E381;
  --lime-bar: #B9E05F;
  --cream: #FAF7EE;
  --ink: #1B2620;
  --body: #6B776F;
  --muted: #98A29A;
  --faint: #AEB4AC;
  --line: rgba(30, 57, 50, .09);
  --line-2: rgba(30, 57, 50, .14);
  --card: #FFFFFF;
  --danger: #A03446;
  --danger-bg: #F6E1E4;
  --amber: #D08A28;
  --radius: 16px;
  --font: 'Plus Jakarta Sans', 'Noto Sans Malayalam', system-ui, -apple-system, 'Segoe UI', sans-serif;
}

* { margin: 0; padding: 0; box-sizing: border-box; }
[hidden] { display: none !important; }
html, body { height: 100%; }
body {
  font-family: var(--font);
  background: var(--cream);
  color: var(--ink);
  font-size: 14px;
  -webkit-font-smoothing: antialiased;
}
button { font-family: var(--font); cursor: pointer; border: 0; background: none; color: inherit; }
input, select, textarea {
  font-family: var(--font); font-size: 13.5px; color: var(--ink);
  background: #fff; border: 1.5px solid var(--line-2); border-radius: 12px;
  padding: 10px 12px; outline: none; width: 100%;
}
input:focus, select:focus, textarea:focus { border-color: var(--green); box-shadow: 0 0 0 3px rgba(111, 174, 68, .15); }
textarea { resize: vertical; min-height: 74px; line-height: 1.5; }
label { display: block; font-size: 11.5px; font-weight: 800; letter-spacing: .04em; text-transform: uppercase; color: var(--body); margin-bottom: 14px; }
label input, label select, label textarea { margin-top: 6px; font-weight: 600; }
::placeholder { color: var(--faint); }
h1, h2, h3 { letter-spacing: -0.02em; }

/* ── login ─────────────────────────────────────────────────────────── */
.login-wrap {
  min-height: 100vh; display: flex; align-items: center; justify-content: center;
  background:
    radial-gradient(1200px 600px at 85% -10%, rgba(198, 227, 129, .16), transparent 60%),
    radial-gradient(900px 500px at -10% 110%, rgba(111, 174, 68, .12), transparent 55%),
    var(--deep);
  padding: 24px;
}
.login-card {
  width: 380px; max-width: 100%; background: var(--cream); border-radius: 26px;
  padding: 34px 30px 30px; box-shadow: 0 40px 80px -30px rgba(0, 0, 0, .55);
}
.login-logo { display: block; width: 172px; height: auto; margin: 0 0 6px -6px; }
.login-sub { color: var(--body); font-weight: 600; font-size: 13px; margin: 4px 0 22px; }
.login-error {
  background: var(--danger-bg); color: var(--danger); font-weight: 700; font-size: 12.5px;
  border-radius: 10px; padding: 9px 12px; margin-bottom: 14px;
}

/* ── buttons ───────────────────────────────────────────────────────── */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 7px;
  border-radius: 12px; padding: 10px 16px; font-size: 13.5px; font-weight: 800;
  transition: transform .06s ease, opacity .15s, box-shadow .15s; white-space: nowrap;
}
.btn:active { transform: scale(.97); }
.btn-primary { background: var(--deep); color: #fff; }
.btn-primary:hover { box-shadow: 0 8px 18px -8px rgba(30, 57, 50, .55); }
.btn-lime { background: var(--lime-bar); color: var(--deep); }
.btn-ghost { background: #fff; border: 1.5px solid var(--line-2); color: var(--ink); }
.btn-danger { background: var(--danger-bg); color: var(--danger); }
.btn-block { width: 100%; }
.btn-sm { padding: 6px 11px; font-size: 12px; border-radius: 10px; }
.btn[disabled] { opacity: .45; cursor: not-allowed; }

/* ── shell ─────────────────────────────────────────────────────────── */
#app { display: flex; min-height: 100vh; }
.sidebar {
  width: 232px; flex: 0 0 232px; background: var(--deep); color: #fff;
  display: flex; flex-direction: column; position: sticky; top: 0; height: 100vh; padding: 20px 14px;
}
.side-logo { padding: 4px 8px 20px; }
.side-logo-mark { display: block; width: 132px; height: auto; margin-left: -4px; }
.side-logo-sub { font-size: 10.5px; font-weight: 600; color: #8FA898; margin-top: 4px; padding-left: 2px; }
nav { flex: 1; display: flex; flex-direction: column; gap: 3px; overflow-y: auto; }
.nav-item {
  display: flex; align-items: center; gap: 11px; padding: 10px 12px; border-radius: 12px;
  color: #B9C7BD; font-weight: 700; font-size: 13.5px; text-decoration: none; transition: background .12s, color .12s;
}
.nav-item svg { width: 17px; height: 17px; flex: 0 0 17px; }
.nav-item:hover { background: rgba(255, 255, 255, .06); color: #fff; }
.nav-item.active { background: var(--lime); color: var(--deep); }
.nav-item .badge {
  margin-left: auto; background: #F09A3E; color: #fff; font-size: 10.5px; font-weight: 800;
  border-radius: 999px; padding: 1px 7px;
}
.nav-item.active .badge { background: var(--deep); color: var(--lime); }
.side-foot { padding-top: 12px; border-top: 1px solid rgba(255, 255, 255, .1); display: flex; flex-direction: column; gap: 8px; }
.store-pill {
  display: flex; align-items: center; gap: 8px; padding: 9px 12px; border-radius: 12px;
  background: var(--deep-2); font-weight: 700; font-size: 12.5px; cursor: pointer; user-select: none;
}
.store-pill .dot { width: 8px; height: 8px; border-radius: 4px; background: var(--lime-bar); box-shadow: 0 0 8px var(--lime-bar); }
.store-pill.closed .dot { background: #E86A5E; box-shadow: 0 0 8px #E86A5E; }
.store-pill.closed { color: #F4C4BE; }
.side-logout { color: #8FA898; font-weight: 700; font-size: 12.5px; text-align: left; padding: 6px 12px; border-radius: 10px; }
.side-logout:hover { color: #fff; background: rgba(255, 255, 255, .06); }

.main { flex: 1; min-width: 0; padding: 26px 30px 60px; }
.topbar { display: flex; align-items: flex-start; justify-content: space-between; margin-bottom: 22px; }
.topbar h2 { font-size: 22px; font-weight: 800; }
.page-sub { color: var(--muted); font-weight: 600; font-size: 12.5px; margin-top: 3px; }
.topbar-right { display: flex; align-items: center; gap: 14px; }
.live-dot { color: var(--green); font-size: 11px; font-weight: 800; letter-spacing: .02em; }
.admin-chip {
  width: 36px; height: 36px; border-radius: 12px; background: var(--deep); color: var(--lime);
  display: flex; align-items: center; justify-content: center; font-weight: 800; font-size: 14px;
}

/* ── cards / grids ─────────────────────────────────────────────────── */
.card { background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); padding: 18px; }
.card h3 { font-size: 13px; font-weight: 800; margin-bottom: 14px; }
.grid { display: grid; gap: 14px; }
.stats-grid { grid-template-columns: repeat(auto-fit, minmax(170px, 1fr)); margin-bottom: 14px; }
.stat { position: relative; overflow: hidden; }
.stat .k { font-size: 11px; font-weight: 800; letter-spacing: .05em; text-transform: uppercase; color: var(--muted); }
.stat .v { font-size: 26px; font-weight: 800; margin-top: 6px; letter-spacing: -.02em; }
.stat .s { font-size: 11.5px; font-weight: 700; color: var(--body); margin-top: 3px; }
.stat.accent { background: var(--deep); border-color: var(--deep); color: #fff; }
.stat.accent .k { color: #8FA898; }
.stat.accent .s { color: var(--lime); }
.two-col { grid-template-columns: 1.6fr 1fr; align-items: start; }
@media (max-width: 1100px) { .two-col { grid-template-columns: 1fr; } }

/* ── tables ────────────────────────────────────────────────────────── */
.tbl { width: 100%; border-collapse: collapse; }
.tbl th {
  text-align: left; font-size: 10.5px; font-weight: 800; text-transform: uppercase; letter-spacing: .06em;
  color: var(--muted); padding: 8px 10px; border-bottom: 1px solid var(--line);
}
.tbl td { padding: 11px 10px; border-bottom: 1px solid var(--line); font-weight: 600; vertical-align: middle; }
.tbl tr:last-child td { border-bottom: 0; }
.tbl tbody tr { transition: background .1s; }
.tbl tbody tr:hover { background: rgba(30, 57, 50, .025); }
.tbl .r { text-align: right; }
.rowlink { cursor: pointer; }
.tsub { display: block; font-size: 11.5px; color: var(--muted); font-weight: 600; margin-top: 1px; }
.gdot { display: inline-block; width: 9px; height: 9px; border-radius: 5px; margin-right: 8px; vertical-align: 1px; }

/* pills */
.pill { display: inline-flex; align-items: center; gap: 6px; border-radius: 999px; padding: 4px 11px; font-size: 11.5px; font-weight: 800; white-space: nowrap; }
.pill-Confirmed { background: #E8F4D9; color: #3E7D24; }
.pill-Preparing { background: #E3F0F4; color: #2E7C8C; }
.pill-Out { background: #FBEADF; color: #C56A33; }
.pill-Delivered { background: #EEF0F2; color: #5A665E; }
.pill-Cancelled { background: var(--danger-bg); color: var(--danger); }
.tag-chip { background: #F3E9D2; color: #8A6D1F; border-radius: 8px; font-size: 10.5px; font-weight: 800; padding: 2px 8px; }

/* toggle — inline-block so it renders inside table cells too (inline spans collapse) */
.tgl {
  display: inline-block; vertical-align: middle; cursor: pointer;
  position: relative; width: 38px; height: 22px; border-radius: 12px;
  background: #D8DCD4; border: 1px solid rgba(30, 57, 50, .12);
  transition: background .15s; flex: 0 0 38px;
}
.tgl::after {
  content: ""; position: absolute; top: 3px; left: 3px; width: 16px; height: 16px; border-radius: 8px;
  background: #fff; transition: left .15s; box-shadow: 0 1px 3px rgba(0, 0, 0, .25);
}
.tgl.on { background: var(--green); }
.tgl.on::after { left: 19px; }

/* stepper */
.stepper { display: inline-flex; align-items: center; gap: 8px; background: #fff; border: 1.5px solid var(--line-2); border-radius: 10px; padding: 3px 5px; }
.stepper button { width: 22px; height: 22px; border-radius: 7px; font-weight: 800; font-size: 14px; color: var(--deep); }
.stepper button:hover { background: var(--cream); }
.stepper .n { min-width: 26px; text-align: center; font-weight: 800; font-size: 13px; }
.stock-low .n { color: var(--amber); }
.stock-out .n { color: var(--danger); }

/* "not available" flag + per-row edit/delete provision (Products table) */
.sold-chip { background: var(--danger-bg); color: var(--danger); border-radius: 8px; font-size: 10.5px; font-weight: 800; padding: 2px 8px; }
.row-soldout .stepper { border-color: rgba(160, 52, 70, .35); }
.row-actions { display: inline-flex; align-items: center; gap: 6px; justify-content: flex-end; }
.icon-btn {
  display: inline-flex; align-items: center; justify-content: center;
  width: 30px; height: 30px; border-radius: 9px; color: var(--body);
  border: 1.5px solid var(--line-2); background: #fff; transition: background .12s, color .12s, border-color .12s;
}
.icon-btn svg { width: 15px; height: 15px; }
.icon-btn:hover { background: var(--cream); color: var(--deep); }
.icon-btn-danger:hover { background: var(--danger-bg); color: var(--danger); border-color: rgba(160, 52, 70, .3); }

/* filter tabs */
.tabs { display: flex; gap: 7px; flex-wrap: wrap; margin-bottom: 14px; }
.tab {
  border-radius: 999px; padding: 7px 14px; font-weight: 800; font-size: 12.5px;
  background: #fff; border: 1.5px solid var(--line-2); color: var(--body);
}
.tab.active { background: var(--deep); border-color: var(--deep); color: #fff; }
.tab .n { opacity: .65; margin-left: 4px; font-size: 11px; }

.toolbar { display: flex; gap: 10px; align-items: center; margin-bottom: 14px; flex-wrap: wrap; }
.toolbar .grow { flex: 1; }
.search { position: relative; width: 260px; max-width: 100%; }
.search input { padding-left: 34px; border-radius: 999px; }
.search svg { position: absolute; left: 12px; top: 50%; transform: translateY(-50%); width: 15px; height: 15px; stroke: var(--muted); }

/* ── dashboard chart ───────────────────────────────────────────────── */
.chart-wrap { display: flex; flex-direction: column; gap: 4px; }
.bars { display: flex; align-items: flex-end; gap: 12px; height: 150px; padding-top: 10px; }
.bar-col { flex: 1; display: flex; flex-direction: column; align-items: center; gap: 7px; height: 100%; justify-content: flex-end; }
.bar { width: 100%; max-width: 44px; border-radius: 9px 9px 4px 4px; background: linear-gradient(180deg, var(--lime-bar), var(--green)); min-height: 4px; position: relative; transition: height .4s ease; }
.bar .tip {
  position: absolute; top: -22px; left: 50%; transform: translateX(-50%); font-size: 10.5px; font-weight: 800;
  color: var(--deep); white-space: nowrap; opacity: 0; transition: opacity .12s;
}
.bar-col:hover .tip { opacity: 1; }
.bar-x { font-size: 10.5px; font-weight: 800; color: var(--muted); }
.feed { display: flex; flex-direction: column; }
.feed-item { display: flex; gap: 11px; padding: 9px 0; border-bottom: 1px solid var(--line); align-items: flex-start; }
.feed-item:last-child { border-bottom: 0; }
.feed-ic { width: 28px; height: 28px; flex: 0 0 28px; border-radius: 10px; display: flex; align-items: center; justify-content: center; }
.feed-ic svg { width: 14px; height: 14px; }
.feed-msg { font-weight: 600; font-size: 12.5px; line-height: 1.45; }
.feed-time { font-size: 11px; color: var(--muted); font-weight: 600; margin-top: 1px; }
.pager { display: flex; align-items: center; justify-content: space-between; gap: 10px; padding-top: 12px; margin-top: 4px; border-top: 1px solid var(--line); }
.pager .muted { font-size: 12px; font-weight: 600; }
.pager button[disabled] { opacity: .45; cursor: default; }
.k-order { background: #E8F4D9; color: #3E7D24; }
.k-otp { background: #E3F0F4; color: #2E7C8C; }
.k-stock { background: #FBEADF; color: #C56A33; }
.k-admin { background: #EEE9DB; color: #8A6D1F; }
.k-task { background: #EEF0F2; color: #5A665E; }

/* ── banner preview (mirrors the app card) ─────────────────────────── */
.banner-prev { border-radius: 18px; padding: 17px 18px; display: flex; justify-content: space-between; align-items: center; min-height: 108px; }
.banner-prev .bk { font-size: 10.5px; font-weight: 800; letter-spacing: .07em; text-transform: uppercase; }
.banner-prev .bt { font-size: 17px; font-weight: 800; margin-top: 5px; letter-spacing: -.01em; }
.banner-prev .bs { font-size: 11.5px; font-weight: 600; margin-top: 4px; }
.banner-badge { width: 46px; height: 46px; border-radius: 15px; display: flex; align-items: center; justify-content: center; }
.banner-badge svg { width: 24px; height: 24px; }
.color-row { display: grid; grid-template-columns: repeat(3, 1fr); gap: 10px; }
.color-field { display: flex; align-items: center; gap: 8px; border: 1.5px solid var(--line-2); background: #fff; border-radius: 12px; padding: 6px 8px; }
.color-field input[type="color"] { width: 28px; height: 28px; padding: 0; border: 0; border-radius: 8px; background: none; flex: 0 0 28px; cursor: pointer; }
.color-field .cf-k { font-size: 10px; font-weight: 800; text-transform: uppercase; color: var(--muted); display: block; }
.color-field .cf-v { font-size: 11.5px; font-weight: 700; }

/* ── slots grid ────────────────────────────────────────────────────── */
.slot-grid { display: grid; gap: 8px; }
.slot-grid .hd { font-size: 11px; font-weight: 800; color: var(--muted); text-transform: uppercase; letter-spacing: .05em; align-self: center; }
.slot-cell {
  border-radius: 12px; padding: 9px 11px; font-weight: 800; font-size: 12px; cursor: pointer;
  border: 1.5px solid var(--line); background: #fff; transition: transform .06s;
  display: flex; flex-direction: column; gap: 2px;
}
.slot-cell:active { transform: scale(.97); }
.slot-cell .cap { font-size: 10.5px; font-weight: 700; color: var(--muted); }
.av-open { background: #F0F7E6; border-color: #CFE3B4; color: var(--green-dark); }
.av-few { background: #FBEFC9; border-color: #EBD79A; color: #8A6D1F; }
.av-full { background: var(--danger-bg); border-color: #E8C3C9; color: var(--danger); }
.av-closed { background: #EDEBE2; border-color: #DAD6C6; color: var(--muted); }
.slot-cell .ov { font-size: 9.5px; font-weight: 800; text-transform: uppercase; letter-spacing: .05em; opacity: .75; }

/* ── drawer ────────────────────────────────────────────────────────── */
.drawer-scrim, .modal-scrim {
  position: fixed; inset: 0; background: rgba(20, 32, 27, .45); z-index: 50; backdrop-filter: blur(2px);
}
.drawer {
  position: fixed; top: 0; right: 0; bottom: 0; width: 430px; max-width: 94vw; z-index: 51;
  background: var(--cream); box-shadow: -30px 0 70px -30px rgba(0, 0, 0, .5);
  padding: 24px; overflow-y: auto; animation: slideIn .22s ease;
}
@keyframes slideIn { from { transform: translateX(40px); opacity: 0; } to { transform: none; opacity: 1; } }
.drawer-head { display: flex; align-items: center; justify-content: space-between; margin-bottom: 20px; }
.drawer-head h3 { font-size: 17px; font-weight: 800; }
.drawer-x { width: 32px; height: 32px; border-radius: 12px; background: #fff; border: 1.5px solid var(--line-2); font-size: 15px; font-weight: 800; }
.drawer-actions { display: flex; gap: 10px; margin-top: 22px; }
.drawer-actions .btn { flex: 1; }
.form-row { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.form-row-3 { display: grid; grid-template-columns: 1fr 1fr 1fr; gap: 12px; }

/* product photo (table thumb + drawer picker) */
.prod-cell { display: flex; align-items: center; gap: 11px; }
.row-thumb {
  flex: 0 0 34px; width: 34px; height: 34px; border-radius: 10px; overflow: hidden;
  background: #F3E9D2; border: 1px solid var(--line);
  display: inline-flex; align-items: center; justify-content: center;
}
.row-thumb img { width: 100%; height: 100%; object-fit: cover; }
.row-thumb .gdot { margin: 0; }
.img-field { display: flex; align-items: center; gap: 12px; margin-top: 6px; }
.img-thumb {
  flex: 0 0 64px; width: 64px; height: 64px; border-radius: 14px; overflow: hidden;
  background: #F3E9D2; border: 1.5px solid var(--line-2); color: var(--muted);
  display: inline-flex; align-items: center; justify-content: center;
}
.img-thumb svg { width: 22px; height: 22px; }
.img-thumb img { width: 100%; height: 100%; object-fit: cover; }
.img-btns { display: flex; gap: 8px; flex-wrap: wrap; }

/* order packing photos (drawer) */
.op-head { display: flex; align-items: flex-start; justify-content: space-between; gap: 10px; margin-bottom: 4px; }
.op-head b { font-size: 13px; font-weight: 800; }
.op-count {
  flex: 0 0 auto; min-width: 22px; height: 22px; padding: 0 7px; border-radius: 999px;
  background: var(--green); color: #fff; font-size: 11.5px; font-weight: 800;
  display: inline-flex; align-items: center; justify-content: center;
}
.op-count:empty { display: none; }
.opic-grid { display: flex; flex-direction: column; gap: 10px; margin: 12px 0 2px; }
.opic { display: flex; align-items: center; gap: 10px; }
.opic-thumb {
  flex: 0 0 52px; width: 52px; height: 52px; border-radius: 12px; overflow: hidden;
  background: #F3E9D2; border: 1.5px solid var(--line-2);
}
.opic-thumb img { width: 100%; height: 100%; object-fit: cover; display: block; }
.opic-cap { flex: 1 1 auto; min-width: 0; margin: 0; font-weight: 600; }
.opic-x {
  flex: 0 0 32px; width: 32px; height: 32px; border-radius: 10px; cursor: pointer;
  background: #fff; border: 1.5px solid var(--line-2); color: var(--muted); font-weight: 800;
}
.opic-x:hover { background: var(--danger-bg); border-color: #E8C3C9; color: var(--danger); }
.opic-empty { color: var(--muted); font-size: 12.5px; font-weight: 600; margin: 12px 0 2px; }
/* per-line product photos: an indented block hanging off its order line */
.op-hint {
  background: #F4F8EE; border: 1px solid var(--line); border-radius: 12px;
  padding: 9px 12px; margin-bottom: 14px; font-size: 12px; font-weight: 600; color: var(--body);
}
.oi-photos {
  margin: 2px 0 12px; padding-left: 12px; border-left: 2px solid var(--line-2);
}
.oi-photos.need { border-left-color: var(--amber); }  /* product still owes a photo */
.oi-photos .opic-grid { margin: 2px 0; }
.oi-photos .opic-thumb { flex: 0 0 44px; width: 44px; height: 44px; border-radius: 10px; }
.oi-photos .opic-x { flex: 0 0 28px; width: 28px; height: 28px; }
/* amber "required" call-to-action on a product with no photo yet */
.btn-need { background: #FBF0DC; border: 1.5px solid #E7C77E; color: var(--amber); }
.btn-need:hover { background: #F8E8C8; }

/* recipe editor: item rows, product search hits, video preview */
.ritem {
  display: flex; align-items: center; gap: 10px; padding: 9px 0;
  border-bottom: 1px solid var(--line);
}
.ritem:last-child { border-bottom: 0; }
.ritem-name { flex: 1; min-width: 0; font-weight: 700; font-size: 13px; }
.ritem-unit { font-size: 11.5px; font-weight: 700; color: var(--muted); min-width: 52px; }
.ritem .btn-danger { padding: 5px 9px; }
.rhits { max-height: 230px; overflow-y: auto; margin-top: 8px; }
.rhit {
  display: flex; align-items: center; gap: 8px; padding: 9px 11px; cursor: pointer;
  border: 1.5px solid var(--line-2); border-radius: 12px; background: #fff;
  font-size: 13px; font-weight: 700; margin-bottom: 7px;
}
.rhit:hover { border-color: var(--green); background: #F7FBF2; }
.rhit .tsub { display: inline; margin-left: 2px; font-weight: 600; }
.rhit .right { margin-left: auto; color: var(--green-dark); font-size: 12px; font-weight: 800; }
.rhit.muted { cursor: default; color: var(--muted); font-weight: 600; }
.rhit.muted:hover { border-color: var(--line-2); background: #fff; }
/* nutrition rows: nutrient · amount · unit · remove */
.nutri-row { display: flex; align-items: center; gap: 9px; margin-bottom: 9px; }
.nutri-row select, .nutri-row input { flex: 1; min-width: 0; }
.nutri-row .nutri-unit {
  flex: 0 0 46px; font-size: 12px; font-weight: 800; color: var(--muted);
}
.nutri-row .btn-danger { padding: 6px 10px; flex: 0 0 auto; }

.rvideo { margin-top: 12px; }
.rvideo video { width: 100%; max-height: 190px; border-radius: 14px; background: #000; display: block; }
.rvideo-empty {
  height: 84px; border-radius: 14px; border: 1.5px dashed var(--line-2); background: #fff;
  display: flex; align-items: center; justify-content: center;
  color: var(--muted); font-size: 12.5px; font-weight: 700;
}
.chips { display: flex; flex-wrap: wrap; gap: 7px; }
.chip {
  border-radius: 999px; border: 1.5px solid var(--line-2); background: #fff;
  padding: 6px 12px; font-size: 12px; font-weight: 700; cursor: pointer; user-select: none;
}
.chip.on { background: var(--deep); border-color: var(--deep); color: #fff; }
.chip .q { opacity: .7; font-size: 10.5px; margin-left: 3px; }

/* order detail steps */
.steps { display: flex; gap: 6px; margin: 14px 0 18px; }
.step { flex: 1; height: 5px; border-radius: 3px; background: #E4E1D5; }
.step.on { background: var(--green); }
.oline { display: flex; justify-content: space-between; gap: 10px; padding: 8px 0; border-bottom: 1px dashed var(--line-2); font-weight: 600; font-size: 13px; }
.oline:last-child { border-bottom: 0; }
/* per-line edit row (trim qty / remove an out-of-stock item while picking) */
.oline-edit { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; padding: 0 0 10px; }
.oline-edit .tsub { display: inline; }
.stepper-sm { padding: 2px 4px; gap: 6px; }
.stepper-sm button { width: 20px; height: 20px; font-size: 13px; }
.stepper-sm .n { min-width: 20px; font-size: 12.5px; }
.status-btns { display: flex; flex-wrap: wrap; gap: 7px; margin-top: 14px; }

/* ── modal / toasts ────────────────────────────────────────────────── */
.modal-scrim { display: flex; align-items: center; justify-content: center; z-index: 60; }
.modal { background: var(--cream); border-radius: 20px; padding: 24px; width: 360px; max-width: 92vw; box-shadow: 0 40px 80px -30px rgba(0, 0, 0, .55); }
.modal h3 { font-size: 16px; font-weight: 800; margin-bottom: 8px; }
.modal p { color: var(--body); font-weight: 600; font-size: 13px; line-height: 1.5; margin-bottom: 18px; }
.modal .row { display: flex; gap: 10px; }
.modal .row .btn { flex: 1; }

/* dispatch modal (picking board): photograph every item, then send out */
.modal-wide { width: 480px; }
.dispatch-list { max-height: 54vh; overflow-y: auto; margin: 2px -6px 0; padding: 0 6px; }
.di-row { display: flex; align-items: center; gap: 12px; padding: 10px 0; border-bottom: 1px solid var(--line); }
.di-row:last-child { border-bottom: 0; }
.di-thumb {
  flex: 0 0 32px; width: 32px; height: 32px; border-radius: 9px; background: #F3E9D2;
  display: inline-flex; align-items: center; justify-content: center;
}
.di-thumb .gdot { margin: 0; }
.di-info { flex: 1 1 auto; min-width: 0; }
.di-info b { font-size: 13px; font-weight: 800; display: block; }
.di-row.done .di-info b::after { content: ' ✓'; color: var(--green-dark); }
.di-right { flex: 0 0 auto; display: flex; align-items: center; gap: 8px; }
.di-shot {
  flex: 0 0 40px; width: 40px; height: 40px; border-radius: 9px; overflow: hidden;
  border: 1.5px solid var(--green);
}
.di-shot img { width: 100%; height: 100%; object-fit: cover; display: block; }
.di-queue { font-size: 11px; font-weight: 800; color: var(--green-dark); background: #EEF5E3; border-radius: 999px; padding: 2px 9px; vertical-align: 2px; }
/* who each parcel goes to: order number, customer name, phone — current + queued in a slot run */
.di-orders { display: flex; flex-direction: column; gap: 6px; margin-bottom: 12px; }
.di-order {
  display: flex; align-items: center; gap: 10px;
  background: #fff; border: 1.5px solid var(--line-2); border-radius: 12px; padding: 8px 12px;
}
.di-order.current { border-color: var(--green); background: #F6FAEC; }
.di-order-num {
  flex: 0 0 auto; font-size: 11px; font-weight: 800; letter-spacing: .02em;
  background: var(--deep); color: var(--lime); border-radius: 8px; padding: 3px 8px;
}
.di-order:not(.current) .di-order-num { background: #EFEBDD; color: var(--body); }
.di-order-who { flex: 1 1 auto; min-width: 0; }
.di-order-who b { display: block; font-size: 13px; font-weight: 800; }
.di-order-who .tsub a { color: inherit; text-decoration: none; font-weight: 700; }
.di-order-right { flex: 0 0 auto; text-align: right; }
.di-order-tag {
  display: block; font-size: 10px; font-weight: 800; letter-spacing: .05em;
  text-transform: uppercase; color: var(--green-dark); margin-top: 1px;
}
.di-order:not(.current) .di-order-tag { color: var(--muted); }
.di-rider {
  display: flex; align-items: center; gap: 10px; margin-top: 14px;
  background: #fff; border: 1.5px solid var(--line-2); border-radius: 12px; padding: 9px 12px;
}
.di-rider-k { font-size: 12.5px; font-weight: 800; white-space: nowrap; }
.di-rider select { flex: 1; width: auto; padding: 8px 10px; }

/* staff roles (Staff page + chips shown next to names) */
.role-chip {
  display: inline-block; font-size: 10px; font-weight: 800; letter-spacing: .05em;
  text-transform: uppercase; border-radius: 999px; padding: 2.5px 8px; margin-left: 6px; vertical-align: 1px;
}
.role-admin { background: var(--deep); color: var(--lime); }
.role-picker { background: #FBEFC9; color: #8A6A16; }
.role-delivery { background: #E7F1DA; color: var(--green-dark); }

/* rider "My deliveries" cards */
.rider-card.done { opacity: .55; }
.rider-card .oline:last-of-type { border-bottom: 0; }

/* rider trips: one block per slot, stops route-ordered nearest-first */
.trip { margin-bottom: 22px; }
.trip-head {
  display: flex; align-items: center; justify-content: space-between; gap: 12px;
  background: var(--deep); color: #fff; border-radius: 14px; padding: 12px 16px; margin-bottom: 12px;
}
.trip-head b { font-size: 14px; }
.trip-head .tsub { display: block; color: #B9C7BD; margin-top: 2px; }
.stop-no {
  flex: 0 0 26px; width: 26px; height: 26px; border-radius: 999px; background: var(--lime);
  color: var(--deep); font-weight: 800; font-size: 13px;
  display: inline-flex; align-items: center; justify-content: center;
}
.toasts { position: fixed; bottom: 22px; left: 50%; transform: translateX(-50%); z-index: 70; display: flex; flex-direction: column; gap: 8px; align-items: center; }
.toast {
  background: var(--deep); color: #fff; border-radius: 14px; padding: 11px 18px; font-weight: 700; font-size: 13px;
  box-shadow: 0 18px 40px -12px rgba(0, 0, 0, .5); display: flex; gap: 9px; align-items: center;
  animation: toastIn .2s ease;
}
.toast .tick { color: var(--lime); font-weight: 800; }
.toast.err { background: #7C2D3B; }
@keyframes toastIn { from { transform: translateY(14px); opacity: 0; } to { transform: none; opacity: 1; } }

.empty { text-align: center; color: var(--muted); font-weight: 700; padding: 40px 0; }
.mt0 { margin-top: 0; } .mt14 { margin-top: 14px; } .mb14 { margin-bottom: 14px; }
.muted { color: var(--muted); font-weight: 600; }
.right { margin-left: auto; }
.flex { display: flex; align-items: center; gap: 10px; }
.money { font-variant-numeric: tabular-nums; }

@media (max-width: 860px) {
  #app { flex-direction: column; }
  .sidebar { width: 100%; flex-direction: row; height: auto; position: static; align-items: center; overflow-x: auto; }
  nav { flex-direction: row; }
  .side-foot { border: 0; padding: 0; flex-direction: row; margin-left: auto; }
  .main { padding: 18px 16px 50px; }
}

/* ── slot picking board ─────────────────────────────────────────────────── */
.slot-group { margin-bottom: 14px; padding: 15px 18px; }
.slot-group.slot-empty { opacity: .6; }
.slot-head { display: flex; align-items: center; gap: 9px; flex-wrap: wrap; margin-bottom: 8px; }
.slot-head h3 { margin-bottom: 0; font-size: 14.5px; }
.slot-meta { color: var(--muted); font-weight: 700; font-size: 12px; }
.slot-actions { margin-left: auto; display: flex; gap: 8px; flex-wrap: wrap; }

/* ── support chat console ────────────────────────────────────────────────── */
.sup-wrap { display: flex; gap: 14px; height: calc(100vh - 232px); min-height: 480px; }

/* conversation list */
.sup-list { width: 320px; flex: 0 0 320px; background: var(--card); border: 1px solid var(--line);
  border-radius: var(--radius); overflow-y: auto; padding: 6px; }
.sup-item { display: flex; align-items: center; gap: 11px; padding: 10px 11px; border-radius: 12px; cursor: pointer; }
.sup-item:hover { background: rgba(30, 57, 50, .04); }
.sup-item.active { background: #EDF6E1; }
.sup-ava { width: 38px; height: 38px; flex: none; border-radius: 19px; background: var(--deep); color: var(--lime);
  font-weight: 800; font-size: 14.5px; display: flex; align-items: center; justify-content: center; }
.sup-ava.lg { width: 44px; height: 44px; font-size: 16px; }
.sup-item-main { flex: 1; min-width: 0; }
.sup-item-top { display: flex; align-items: baseline; justify-content: space-between; gap: 8px; }
.sup-item-top b { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.sup-time { font-size: 11px; color: var(--muted); font-weight: 700; flex: none; }
.sup-item-sub { display: flex; align-items: center; justify-content: space-between; gap: 8px; margin-top: 2px; }
.sup-preview { color: var(--muted); font-size: 12px; font-weight: 600; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.sup-dot { flex: none; min-width: 19px; height: 19px; border-radius: 10px; background: #EB5A67; color: #fff;
  font-size: 10.5px; font-weight: 800; display: flex; align-items: center; justify-content: center; padding: 0 5px; }
.sup-resolved { flex: none; font-size: 9.5px; font-weight: 800; letter-spacing: .04em; text-transform: uppercase; color: var(--muted); }

/* conversation pane */
.sup-main { flex: 1; min-width: 0; display: flex; flex-direction: column; background: var(--card);
  border: 1px solid var(--line); border-radius: var(--radius); overflow: hidden; }
.sup-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 13px 16px; border-bottom: 1px solid var(--line); }
.sup-head-who { display: flex; align-items: center; gap: 11px; min-width: 0; }
.sup-head-name { font-weight: 800; font-size: 14.5px; display: flex; align-items: center; gap: 7px; }
.sup-head-sub { color: var(--muted); font-weight: 600; font-size: 12px; margin-top: 2px; }
.sup-head-actions { display: flex; gap: 8px; flex-wrap: wrap; flex: none; }
.sup-head-actions .btn { display: inline-flex; align-items: center; gap: 5px; }
.sup-head-actions .btn svg { width: 15px; height: 15px; }

.sup-msgs { flex: 1; overflow-y: auto; padding: 16px 18px; display: flex; flex-direction: column; background: #FAF9F3; }
.sup-row { display: flex; margin-top: 8px; }
.sup-row.me { justify-content: flex-end; }
.sup-row.them { justify-content: flex-start; }
.sup-bubble { max-width: 66%; padding: 9px 13px; border-radius: 16px; font-size: 13.5px; line-height: 1.42; }
.sup-row.them .sup-bubble { background: #fff; border: 1px solid var(--line); border-bottom-left-radius: 5px; color: var(--ink);
  box-shadow: 0 8px 18px -16px rgba(30, 57, 50, .5); }
.sup-row.me .sup-bubble { background: var(--deep); color: #fff; border-bottom-right-radius: 5px; }
.sup-text { white-space: pre-wrap; word-break: break-word; }
.sup-img { display: block; max-width: 240px; width: 100%; border-radius: 10px; margin-bottom: 4px; }
.sup-btime { display: block; font-size: 10px; margin-top: 4px; }
.sup-row.them .sup-btime { color: var(--muted); }
.sup-row.me .sup-btime { color: rgba(255, 255, 255, .7); }
.sup-sys { align-self: center; text-align: center; color: var(--muted); font-size: 11.5px; font-weight: 600;
  line-height: 1.5; margin: 12px auto; max-width: 78%; }

.sup-compose { display: flex; align-items: flex-end; gap: 8px; padding: 12px 14px; border-top: 1px solid var(--line); background: #fff; }
.sup-compose textarea { flex: 1; resize: none; min-height: 42px; max-height: 130px; border-radius: 14px; padding: 11px 14px;
  font-family: var(--font); font-size: 13.5px; line-height: 1.4; }
.sup-attach { width: 42px; height: 42px; flex: none; border-radius: 21px; border: 1.5px solid var(--line-2); background: #fff;
  color: var(--green-dark); font-size: 21px; font-weight: 700; line-height: 1; cursor: pointer;
  display: flex; align-items: center; justify-content: center; }
.sup-attach:hover { border-color: var(--green); }
.sup-send { flex: none; height: 42px; align-self: flex-end; }

.sup-empty { flex: 1; display: flex; flex-direction: column; align-items: center; justify-content: center; text-align: center; padding: 30px; color: var(--muted); }
.sup-empty svg { width: 42px; height: 42px; color: var(--muted); opacity: .5; margin-bottom: 12px; }
.sup-empty h3 { margin: 0 0 4px; font-size: 15px; color: var(--ink); }
.sup-empty p { font-size: 12.5px; max-width: 260px; }

@keyframes rowFlash { 0% { background: var(--lime); } 100% { background: transparent; } }
.row-flash td { animation: rowFlash 1.9s ease-out; }

@media (max-width: 860px) {
  .sup-wrap { flex-direction: column; height: auto; }
  .sup-list { width: 100%; flex: none; max-height: 300px; }
  .sup-main { min-height: 440px; }
  .sup-bubble { max-width: 82%; }
}
