/* Additions for the live app: status colours for the real order statuses, login page, and the partner app full-screen layout. */
.st-picked_up, .st-at_store { background: var(--purple-50); color: var(--purple-700); }
.st-in_process { background: var(--orange-50); color: var(--orange-600); }
.st-out_for_delivery { background: var(--blue-100); color: var(--blue-700); }
.st-closed { background: var(--green-50); color: var(--green-700); }
.skeleton { height: 14px; border-radius: 8px; background: linear-gradient(90deg, #ECE8DE 25%, #F4F1EA 50%, #ECE8DE 75%); background-size: 200% 100%; animation: sk 1.2s infinite; }
@keyframes sk { to { background-position: -200% 0; } }
.err-box { max-width: 460px; margin: 60px auto; text-align: center; }
.login { min-height: 100vh; display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); }
.login-art { position: relative; background: var(--blue); color: #fff; display: flex; flex-direction: column; justify-content: flex-end; padding: 48px; overflow: hidden; }
.login-art img.bg { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; opacity: .38; }
.login-art > * { position: relative; }
.login-art h2 { font-size: clamp(30px, 3.4vw, 46px); letter-spacing: -0.03em; line-height: 1.08; max-width: 420px; }
.login-art p { margin-top: 14px; color: rgba(255,255,255,.85); max-width: 380px; }
.login-form-wrap { display: grid; place-items: center; padding: 32px 24px; background: var(--cream); }
.login-card { width: 100%; max-width: 380px; }
.login-card .logo { height: 46px; width: auto; margin-bottom: 36px; }
.login-card h1 { font-size: 28px; letter-spacing: -0.03em; }
.login-card .sub { color: var(--slate); margin: 8px 0 26px; }
@media (max-width: 820px) { .login { grid-template-columns: 1fr; } .login-art { display: none; } }
/* Partner app: fill the phone, or a centred column on desktop (no device frame). */
body.mobile-app { background: #E9E4D8; }
body.mobile-app .stage { display: block; padding: 0; min-height: 100dvh; }
body.mobile-app .device { width: 100%; max-width: 480px; height: 100dvh; margin: 0 auto; border-radius: 0; padding: 0; box-shadow: 0 0 0 1px rgba(0,0,0,.06); background: transparent; }
body.mobile-app .screen { border-radius: 0; }
body.mobile-app .statusbar { display: none; }
.offline-bar { background: var(--ink); color: #fff; text-align: center; font-size: 12.5px; padding: 6px; }
.inline-link { color: var(--blue); font-weight: 600; cursor: pointer; }

/* ---------- Partner app on a laptop or desktop: sidebar + wider content. The phone layout above is unchanged. ---------- */
.tabbar .side-brand, .tabbar .side-user { display: none; }
@media (min-width: 900px) {
  body.mobile-app { background: var(--cream); }
  body.mobile-app .device { max-width: none; box-shadow: none; }
  body.mobile-app .screen { display: grid; grid-template-columns: 240px minmax(0, 1fr); grid-template-rows: auto minmax(0, 1fr) auto; }
  #tabHost { grid-column: 1; grid-row: 1 / 4; min-height: 0; }
  .offline-bar { grid-column: 2; grid-row: 1; }
  .app-body { grid-column: 2; grid-row: 2; }
  #foot { grid-column: 2; grid-row: 3; }
  .tabbar { display: flex; flex-direction: column; height: 100%; background: var(--ink); border-top: 0; padding: 22px 14px; gap: 4px; }
  .tabbar .side-brand { display: flex; flex-direction: column; gap: 6px; padding: 2px 10px 24px; }
  .tabbar .side-brand img { height: 34px; width: auto; align-self: flex-start; }
  .tabbar .side-brand span { font-size: 11px; font-weight: 700; letter-spacing: .08em; text-transform: uppercase; color: #8FA2C6; }
  .tabbar a { flex-direction: row; justify-content: flex-start; gap: 12px; padding: 11px 12px; font-size: 14px; color: #B7C2DA; }
  .tabbar a:hover { background: rgba(255,255,255,.06); color: #fff; }
  .tabbar a.is-on { background: rgba(255,255,255,.12); color: #fff; }
  .tabbar a .ic { width: 20px; height: 20px; }
  .tabbar .side-user { display: flex; flex-direction: column; gap: 2px; margin-top: auto; padding: 14px 10px 0; border-top: 1px solid rgba(255,255,255,.12); color: #fff; }
  .tabbar .side-user b { font-size: 13.5px; } .tabbar .side-user span { font-size: 12px; color: #8FA2C6; }
  .tabbar .side-user button { display: inline-flex; align-items: center; gap: 8px; margin-top: 10px; padding: 8px 0; background: none; border: 0; color: #B7C2DA; font-weight: 600; font-size: 13px; }
  .tabbar .side-user button:hover { color: #fff; }
  .app-body > div { max-width: 1080px; margin: 0 auto; padding-bottom: 32px; }
  .m-head { padding: 28px 18px 14px; } .m-head h1 { font-size: 26px; }
  .p-head { margin-top: 20px; border-radius: 22px; padding: 18px 22px 20px; } .p-head b { font-size: 20px; }
  .app-pad { padding: 8px 18px 24px; }
  .app-pad .m-section > .mt-8, .app-pad .m-section > div:not(.row):not(.m-card):not(.m-list) { display: grid; grid-template-columns: repeat(auto-fill, minmax(330px, 1fr)); gap: 12px; align-items: start; }
  .app-pad .m-section > .mt-8 .job { margin-bottom: 0; }
  .req-card { margin-bottom: 12px; }
  .app-pad.cols { column-count: 2; column-gap: 20px; }
  .app-pad.cols > * { break-inside: avoid; }
  .app-pad.cols .m-card + .m-card, .app-pad.cols .m-section { margin-top: 12px; }
  .stage-rail { flex-wrap: wrap; }
  .m-foot { justify-content: center; padding: 14px 18px; } .m-foot .btn { max-width: 440px; }
  /* sheets become centred dialogs */
  .m-sheet { left: 50%; right: auto; bottom: auto; top: 50%; width: min(520px, 92%); max-height: 86%; border-radius: 22px; transform: translate(-50%, -46%); opacity: 0; transition: transform .25s var(--ease), opacity .2s; }
  .m-sheet.on { transform: translate(-50%, -50%); opacity: 1; }
  .m-sheet .grab { display: none; }
  .m-toast { bottom: 24px; }
}

/* ---------- Invoice ---------- */
.invoice-page { background: #EFEBE1; }
.invoice-wrap { max-width: 820px; margin: 0 auto; padding: 24px 16px 60px; }
.invoice-doc { background: #fff; border: 1px solid var(--line); border-radius: 18px; padding: clamp(18px, 4vw, 40px); position: relative; }
.inv-head { display: flex; justify-content: space-between; gap: 20px; flex-wrap: wrap; padding-bottom: 22px; border-bottom: 2px solid var(--ink); }
.inv-brand { display: flex; gap: 14px; align-items: flex-start; }
.inv-brand img { height: 46px; width: auto; }
.inv-brand b { font-family: var(--font-head); font-size: 16px; display: block; }
.inv-brand div div { font-size: 12.5px; color: var(--slate); margin-top: 2px; max-width: 300px; }
.inv-title { text-align: right; } .inv-title h2 { font-size: 24px; letter-spacing: -0.02em; margin-bottom: 4px; }
.inv-meta { display: grid; grid-template-columns: 1fr 1fr; gap: 20px; padding: 20px 0; }
.inv-meta span { display: block; margin-bottom: 4px; } .inv-meta b { font-size: 15px; }
.inv-lines td, .inv-lines th { padding: 10px 8px; }
.inv-totals { margin-left: auto; width: min(320px, 100%); padding-top: 14px; }
.inv-totals > div { display: flex; justify-content: space-between; padding: 6px 0; font-size: 14px; }
.inv-totals .grand { border-top: 1.5px solid var(--ink); margin-top: 6px; padding-top: 10px; font-family: var(--font-head); font-size: 17px; font-weight: 700; }
.inv-totals .due { color: var(--red-700); }
.inv-foot { margin-top: 26px; padding-top: 16px; border-top: 1px dashed #D9D3C7; display: grid; gap: 6px; font-size: 13.5px; }
.invoice-doc.void::after { content: "VOID"; position: absolute; inset: 40% 0 auto; text-align: center; font: 700 90px var(--font-head); color: rgba(185,28,28,.12); transform: rotate(-12deg); pointer-events: none; }
.inv-actions { display: flex; justify-content: center; gap: 10px; margin-top: 18px; }
.bill-grid { display: grid; grid-template-columns: minmax(0, 1fr) 300px; gap: 16px; align-items: start; }
@media (max-width: 980px) { .bill-grid { grid-template-columns: 1fr; } .inv-meta { grid-template-columns: 1fr; } .inv-title { text-align: left; } }
.line-row { display: grid; grid-template-columns: minmax(0, 2fr) 70px 64px 90px 32px; gap: 8px; align-items: center; margin-bottom: 8px; }
@media print {
  body * { visibility: hidden !important; }
  .invoice-doc, .invoice-doc * { visibility: visible !important; }
  .invoice-doc { position: absolute; left: 0; top: 0; width: 100%; border: 0; border-radius: 0; padding: 0; }
  .no-print { display: none !important; }
}

/* ---------- Partner dashboard ---------- */
.pd-kpis { display: grid; grid-template-columns: repeat(2, 1fr); gap: 10px; }
.pd-kpis .m-card { margin: 0; padding: 14px; }
.pd-kpi b { display: block; font-family: var(--font-head); font-size: 22px; margin-top: 6px; letter-spacing: -0.02em; }
.pd-kpi.is-alert { border-color: #F3C6C6; } .pd-kpi.is-alert b { color: var(--red-700); }
.pd-grid { display: grid; gap: 12px; }
.pd-grid .m-card { margin: 0; }
@media (min-width: 900px) { .pd-kpis { grid-template-columns: repeat(4, 1fr); } .pd-grid { grid-template-columns: 3fr 2fr; } }
