/* =========================================================
   Vertex Craft ERP — mobile app UI
   Markup rule: h1–h6, p, ul, li, span stay classless; a wrapping div carries the class.
   ========================================================= */
:root {
  --green: #14432F;
  --green-2: #1E6B43;
  --green-soft: #E3F1E8;
  --green-tint: #E8F0EA;
  --gold: #C8963E;
  --gold-soft: #F6EBD3;
  --gold-ink: #7A5714;
  --cream: #F6F3EA;
  --cream-2: #ECE6D8;
  --line: #E6E0D2;
  --line-2: #DCD4C2;
  --track: #EEE8DA;
  --ink: #1B2420;
  --muted: #5C675F;
  --muted-2: #6B756E;
  --red: #A4372B;
  --red-soft: #F8E1DD;
  --amber: #8A5A0E;
  --amber-soft: #FBEFD9;
  --blue: #2A5592;
  --blue-soft: #E3ECF7;
  --white: #FFFFFF;
  --radius: 18px;
  --tabbar: 76px;
  font-family: 'Inter', 'Hind Siliguri', system-ui, -apple-system, 'Segoe UI', Roboto, sans-serif;
}

*, *::before, *::after { box-sizing: border-box; }
html, body { margin: 0; }
body { background: #E4DDCB; color: var(--ink); -webkit-font-smoothing: antialiased; }
a { color: inherit; text-decoration: none; }
button { font: inherit; color: inherit; cursor: pointer; }
input, select, textarea { font: inherit; color: inherit; }
h1, h2, h3, p { margin: 0; }
svg { flex-shrink: 0; }
.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
:focus-visible { outline: 3px solid var(--gold); outline-offset: 2px; border-radius: 6px; }

/* ---------- app shell ---------- */
.app { max-width: 430px; height: 100vh; height: 100dvh; margin: 0 auto; background: var(--cream); display: flex; flex-direction: column; position: relative; overflow: hidden; }
.app-body { flex: 1; min-height: 0; overflow-y: auto; -webkit-overflow-scrolling: touch; padding-bottom: 16px; }
.app.no-tabbar .app-body { padding-bottom: 0; }
@media (min-width: 480px) {
  body { padding: 24px 0; }
  .app { height: calc(100vh - 48px); max-height: 900px; border-radius: 32px; box-shadow: 0 30px 80px rgba(20, 67, 47, .22); }
}

/* ---------- bottom tab bar ---------- */
.tabbar { flex-shrink: 0; min-height: var(--tabbar); background: var(--white); border-top: 1px solid var(--line); display: grid; grid-template-columns: repeat(5, minmax(0, 1fr)); padding: 6px 6px calc(10px + env(safe-area-inset-bottom)); z-index: 20; }
.tab { display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 3px; font-size: 11.5px; font-weight: 600; color: var(--muted-2); }
.tab.is-active { color: var(--green); }
.tab.is-active .tab-ic { background: var(--green-tint); }
.tab-ic { width: 44px; height: 28px; border-radius: 14px; display: flex; align-items: center; justify-content: center; }

/* ---------- common pieces ---------- */
.page-head { padding: 20px 16px 12px; display: flex; flex-direction: column; gap: 14px; }
.head-row { display: flex; align-items: center; justify-content: space-between; gap: 12px; }
.title h1 { font-size: 24px; font-weight: 700; letter-spacing: -.01em; }
.subtitle p { font-size: 13px; color: var(--muted); }
.bar-head { display: flex; align-items: center; gap: 10px; padding: 14px 12px; }
.bar-head .title h1 { font-size: 19px; }
.icon-btn { width: 44px; height: 44px; border-radius: 14px; border: 1px solid var(--line-2); background: var(--white); display: flex; align-items: center; justify-content: center; color: var(--green); }
.icon-btn.plain { border: 0; color: var(--ink); }
.btn { height: 52px; border-radius: 14px; border: 1.5px solid var(--green); background: var(--green); color: var(--white); font-size: 15px; font-weight: 600; display: inline-flex; align-items: center; justify-content: center; gap: 8px; padding: 0 18px; }
.btn.line { background: var(--white); color: var(--green); }
.btn.ghost { background: transparent; color: var(--green); }
.btn.sm { height: 40px; border-radius: 12px; font-size: 13.5px; padding: 0 14px; }
.btn.block { width: 100%; }
.card { background: var(--white); border-radius: var(--radius); padding: 16px; }
.card-title h2 { font-size: 15px; font-weight: 700; }
.section-title { padding: 22px 16px 0; display: flex; justify-content: space-between; align-items: center; }
.section-title h2 { font-size: 16px; font-weight: 700; }
.count-pill { font-size: 12.5px; color: var(--red); font-weight: 600; }
.track { height: 8px; border-radius: 5px; background: var(--track); overflow: hidden; }
.track.thin { height: 6px; }
.fill { height: 100%; border-radius: inherit; background: var(--green-2); }
.fill.gold { background: var(--gold); }
.fill.red { background: var(--red); }
.badge { padding: 4px 10px; border-radius: 20px; font-size: 12px; font-weight: 600; white-space: nowrap; }
.badge.prod { background: var(--blue-soft); color: var(--blue); }
.badge.lc { background: var(--amber-soft); color: var(--amber); }
.badge.due { background: var(--red-soft); color: var(--red); }
.badge.done { background: var(--green-soft); color: var(--green-2); }
.chev { color: #8A948C; font-size: 18px; }
.list { display: flex; flex-direction: column; gap: 12px; padding: 4px 16px 16px; }
.muted p, .muted { color: var(--muted); }
.stat-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 8px; }
.stat { background: var(--white); border-radius: 14px; padding: 10px 12px; }
.stat-l p { font-size: 12px; color: var(--muted); }
.stat-v p { font-size: 18px; font-weight: 700; }
.search { height: 48px; border-radius: 14px; background: var(--white); border: 1px solid var(--line); display: flex; align-items: center; gap: 10px; padding: 0 14px; }
.search input { flex: 1; border: 0; outline: 0; background: transparent; font-size: 15px; min-width: 0; }
.chips { display: flex; gap: 8px; overflow-x: auto; scrollbar-width: none; }
.chip { flex-shrink: 0; height: 38px; padding: 0 16px; border-radius: 20px; border: 1.5px solid var(--line-2); background: var(--white); font-size: 14px; font-weight: 600; }
.chip.is-active { border-color: var(--green); background: var(--green); color: var(--white); }
.segmented { display: grid; grid-auto-flow: column; grid-auto-columns: minmax(0, 1fr); background: var(--cream-2); border-radius: 14px; padding: 4px; }
.seg { height: 40px; border: 0; border-radius: 11px; background: transparent; font-size: 14px; font-weight: 600; color: #4E5A52; }
.seg.is-active { background: var(--white); color: var(--green); box-shadow: 0 1px 3px rgba(0, 0, 0, .08); }
[hidden] { display: none !important; }
.bottom-actions { position: sticky; bottom: 0; display: flex; gap: 10px; padding: 10px 16px; background: var(--cream); }
.app.no-tabbar .bottom-actions { background: var(--white); border-top: 1px solid var(--line); padding-bottom: 20px; }
.bottom-actions .btn { flex: 1; }
.toast { position: fixed; left: 50%; bottom: 110px; transform: translate(-50%, 20px); background: var(--ink); color: var(--white); padding: 12px 18px; border-radius: 12px; font-size: 14px; opacity: 0; pointer-events: none; transition: .25s; z-index: 50; max-width: 360px; text-align: center; }
.toast.show { opacity: 1; transform: translate(-50%, 0); }

/* ---------- login ---------- */
.login { background: var(--green); color: var(--cream); }
.login-top { padding: 64px 28px 36px; display: flex; flex-direction: column; gap: 14px; }
.brand-mark { width: 64px; height: 64px; border-radius: 20px; background: var(--gold); display: flex; align-items: center; justify-content: center; }
.login-title h1 { font-size: 30px; font-weight: 700; line-height: 1.2; }
.login-tag p { font-size: 15px; color: #C9D6CD; }
.login-form { flex: 1; background: var(--cream); color: var(--ink); border-radius: 28px 28px 0 0; padding: 28px 24px 24px; display: flex; flex-direction: column; gap: 18px; }
.login-form .head-row h2 { font-size: 21px; font-weight: 700; }
.lang { display: flex; border: 1px solid var(--line-2); border-radius: 20px; padding: 3px; }
.lang button { border: 0; border-radius: 16px; padding: 4px 12px; background: transparent; font-size: 13px; }
.lang button.is-active { background: var(--green); color: var(--white); }
.field label { display: block; font-size: 14px; font-weight: 600; margin-bottom: 6px; }
.field input { width: 100%; height: 52px; border-radius: 14px; border: 1.5px solid var(--line-2); background: var(--white); padding: 0 16px; font-size: 16px; }
.field input:focus { border-color: var(--green); outline: none; }
.row-between { display: flex; justify-content: space-between; align-items: center; font-size: 14px; }
.check { display: flex; align-items: center; gap: 8px; }
.check input { width: 20px; height: 20px; accent-color: var(--green); }
.link { color: var(--green); font-weight: 600; }
.offline-note { margin-top: auto; background: var(--white); border-radius: 16px; padding: 14px 16px; display: flex; gap: 12px; align-items: flex-start; }
.offline-note p { font-size: 13.5px; color: #4E5A52; }

/* ---------- dashboard ---------- */
.hero { background: var(--green); color: var(--cream); padding: 20px 20px 92px; border-radius: 0 0 28px 28px; }
.hero-row { display: flex; align-items: center; gap: 12px; }
.avatar { width: 44px; height: 44px; border-radius: 22px; background: var(--gold); color: var(--green); display: flex; align-items: center; justify-content: center; font-weight: 700; font-size: 16px; }
.avatar.lg { width: 48px; height: 48px; border-radius: 24px; font-size: 17px; }
.greet { flex: 1; }
.greet-hi p { font-size: 13px; color: #C9D6CD; }
.greet-name h1 { font-size: 19px; font-weight: 700; line-height: 1.25; }
.hero .icon-btn { background: transparent; border-color: rgba(246, 243, 234, .25); color: var(--cream); position: relative; }
.dot { position: absolute; top: 9px; right: 10px; width: 9px; height: 9px; border-radius: 5px; background: #E9A23B; }
.hero-pills { margin-top: 18px; display: flex; gap: 8px; flex-wrap: wrap; }
.hero-pill { padding: 6px 12px; border-radius: 20px; background: rgba(246, 243, 234, .14); font-size: 13px; }
.sales { margin: -72px 16px 0; background: var(--white); border-radius: 22px; padding: 20px; box-shadow: 0 10px 30px rgba(20, 67, 47, .12); }
.sales-l p { font-size: 12.5px; color: var(--muted); }
.sales-v p { font-size: 30px; font-weight: 700; color: var(--green); line-height: 1.2; letter-spacing: -.02em; }
.trend { padding: 4px 10px; border-radius: 20px; background: var(--green-soft); color: var(--green-2); font-size: 13px; font-weight: 600; }
.sales .track { margin-top: 14px; height: 10px; }
.sales-foot { display: flex; justify-content: space-between; margin-top: 8px; font-size: 12px; color: var(--muted); }
.kpis { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px; padding: 16px; }
.kpi { background: var(--white); border-radius: var(--radius); padding: 16px; display: flex; flex-direction: column; gap: 4px; }
.kpi-l p { font-size: 12.5px; color: var(--muted); }
.kpi-v p { font-size: 22px; font-weight: 700; line-height: 1.2; letter-spacing: -.01em; }
.kpi-v.red p { color: var(--red); }
.kpi-s p { font-size: 12px; color: var(--muted); }
.quick { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 8px; padding: 0 16px; }
.qa { display: flex; flex-direction: column; align-items: center; gap: 6px; font-size: 12.5px; font-weight: 500; text-align: center; }
.qa-ic { width: 54px; height: 54px; border-radius: 18px; background: var(--white); color: var(--green); display: flex; align-items: center; justify-content: center; }
.qa-ic.solid { background: var(--green); color: var(--cream); }
.alerts { margin: 10px 16px 0; padding: 4px 16px; }
.alert { display: flex; gap: 12px; align-items: center; padding: 12px 0; border-bottom: 1px solid var(--track); }
.alert:last-child { border-bottom: 0; }
.sev { width: 10px; height: 10px; border-radius: 5px; background: #C0392B; flex-shrink: 0; }
.sev.warn { background: #D9932A; }
.alert-body { flex: 1; }
.alert-t p { font-size: 14px; font-weight: 600; }
.alert-d p { font-size: 12.5px; color: var(--muted); }
.areas { margin: 10px 16px 24px; display: flex; flex-direction: column; gap: 14px; }
.area-row { display: flex; justify-content: space-between; font-size: 13.5px; margin-bottom: 6px; }
.area-row b { font-weight: 600; }

/* ---------- orders ---------- */
.order { background: var(--white); border-radius: var(--radius); padding: 16px; display: flex; flex-direction: column; gap: 10px; }
.order-top { display: flex; justify-content: space-between; align-items: flex-start; gap: 10px; }
.order-main { flex: 1; min-width: 0; }
.o-no p { font-size: 12.5px; color: var(--muted); }
.o-cust h3 { font-size: 16px; font-weight: 700; line-height: 1.3; }
.o-item p { font-size: 13px; color: #4E5A52; }
.order-foot { display: flex; justify-content: space-between; align-items: center; gap: 10px; }
.o-pay p { font-size: 12px; color: var(--muted); }
.o-amt p { font-size: 16px; font-weight: 700; }
.list-meta { display: flex; justify-content: space-between; font-size: 13px; color: var(--muted); }
.empty { text-align: center; padding: 30px 10px; color: var(--muted); font-size: 14px; }

/* ---------- order detail ---------- */
.buyer { background: var(--green); color: var(--cream); border-radius: 20px; padding: 18px; }
.buyer-l p { font-size: 13px; color: #C9D6CD; }
.buyer-n h2 { font-size: 19px; font-weight: 700; }
.buyer-m p { font-size: 14px; color: #DDE6E0; margin-top: 2px; }
.buyer-stats { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 8px; margin-top: 14px; }
.buyer-stat { background: rgba(246, 243, 234, .12); border-radius: 12px; padding: 8px 10px; }
.buyer-stat .bs-l p { font-size: 11.5px; color: #C9D6CD; }
.buyer-stat .bs-v p { font-size: 15px; font-weight: 700; }
.stepper { display: grid; grid-template-columns: repeat(6, minmax(0, 1fr)); gap: 4px; margin-top: 14px; align-items: start; }
.st { display: flex; flex-direction: column; align-items: center; gap: 6px; }
.st-dot { width: 28px; height: 28px; border-radius: 14px; display: flex; align-items: center; justify-content: center; font-size: 13px; border: 2px solid var(--line-2); color: var(--muted-2); }
.st.done .st-dot { background: var(--green-2); border-color: var(--green-2); color: var(--white); }
.st.now .st-dot { background: var(--gold); border-color: var(--gold); color: var(--green); font-weight: 700; }
.st-l p { font-size: 11px; text-align: center; line-height: 1.25; color: var(--muted); }
.st.done .st-l p, .st.now .st-l p { color: var(--ink); }
.st.now .st-l p { font-weight: 700; }
.note-box { margin-top: 14px; background: var(--cream); border-radius: 12px; padding: 10px 12px; font-size: 13.5px; }
.product-row { display: flex; gap: 12px; margin-top: 12px; align-items: center; }
.thumb { width: 56px; height: 56px; border-radius: 12px; background: #EFE6D2; display: flex; align-items: center; justify-content: center; color: #8A6A2B; }
.pr-n p { font-size: 15px; font-weight: 600; }
.pr-m p { font-size: 13px; color: var(--muted); }
.kv { display: flex; justify-content: space-between; gap: 12px; font-size: 14px; padding: 6px 0; }
.kv.total { border-top: 1px solid var(--track); margin-top: 4px; padding-top: 10px; font-weight: 600; }
.ok { color: var(--green-2); font-weight: 600; }
.due-t { color: var(--red); font-weight: 700; }
.docs { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 12px; }
.doc { padding: 7px 12px; border-radius: 10px; background: var(--cream); color: #4E5A52; font-size: 13px; }
.doc.ready { background: var(--green-soft); color: var(--green-2); font-weight: 600; }
.detail-body { display: flex; flex-direction: column; gap: 12px; padding: 0 16px 16px; }

/* ---------- production ---------- */
.job { background: var(--white); border-radius: var(--radius); padding: 16px; display: flex; flex-direction: column; gap: 10px; }
.job-top { display: flex; justify-content: space-between; gap: 10px; }
.j-no p { font-size: 12.5px; color: var(--muted); }
.j-name h3 { font-size: 16px; font-weight: 700; line-height: 1.3; }
.j-pct { font-size: 18px; font-weight: 700; color: var(--green); }
.steps { display: grid; grid-template-columns: repeat(5, minmax(0, 1fr)); gap: 4px; }
.step { display: flex; flex-direction: column; gap: 4px; font-size: 11px; text-align: center; color: var(--muted-2); }
.step::before { content: ""; height: 6px; border-radius: 4px; background: var(--line); }
.step.done { color: var(--ink); }
.step.done::before { background: var(--green-2); }
.step.now { color: var(--ink); font-weight: 700; }
.step.now::before { background: var(--gold); }
.job-foot { display: flex; justify-content: space-between; align-items: center; gap: 10px; }
.j-meta p { font-size: 12.5px; color: var(--muted); }
.list-label { font-size: 14px; font-weight: 700; }

/* ---------- stock ---------- */
.low-alert { display: flex; gap: 12px; align-items: center; background: var(--red-soft); border-radius: 14px; padding: 12px 14px; }
.low-alert p { flex: 1; font-size: 13.5px; color: #7E2A21; font-weight: 600; }
.item { background: var(--white); border-radius: 16px; padding: 14px 16px; display: flex; flex-direction: column; gap: 8px; }
.item-top { display: flex; justify-content: space-between; gap: 10px; }
.s-name h3 { font-size: 15px; font-weight: 700; line-height: 1.3; }
.s-meta p { font-size: 12.5px; color: var(--muted); }
.s-qty p { font-size: 16px; font-weight: 700; text-align: right; }
.s-qty.low p { color: var(--red); }
.s-min p { font-size: 12.5px; color: var(--muted); text-align: right; }

/* ---------- attendance ---------- */
.att-stats { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 8px; padding: 0 16px; }
.att-stat { background: var(--white); border-radius: 14px; padding: 10px; text-align: center; }
.att-stat.ok-bg { background: var(--green-soft); color: var(--green-2); }
.att-stat.bad-bg { background: var(--red-soft); color: var(--red); }
.as-v p { font-size: 20px; font-weight: 700; }
.as-l p { font-size: 12.5px; }
.att-stat:not(.ok-bg):not(.bad-bg) .as-l p { color: var(--muted); }
.worker { background: var(--white); border-radius: 16px; padding: 12px 14px; display: flex; flex-direction: column; gap: 10px; }
.w-top { display: flex; align-items: center; gap: 12px; }
.w-av { width: 40px; height: 40px; border-radius: 20px; background: #EFE6D2; color: #6F5420; display: flex; align-items: center; justify-content: center; font-weight: 700; }
.w-info { flex: 1; min-width: 0; }
.w-name h3 { font-size: 15px; font-weight: 700; line-height: 1.3; }
.w-meta p { font-size: 12.5px; color: var(--muted); }
.status { height: 36px; padding: 0 12px; border-radius: 18px; border: 0; font-size: 13px; font-weight: 600; background: var(--green-soft); color: var(--green-2); }
.worker.is-absent .status { background: var(--red-soft); color: var(--red); }
.worker.is-absent .pieces { display: none; }
.pieces { display: flex; align-items: center; justify-content: space-between; background: var(--cream); border-radius: 12px; padding: 6px 6px 6px 12px; font-size: 13.5px; }
.rate { color: var(--muted); }
.stepper-num { display: flex; align-items: center; gap: 6px; }
.stepper-num button { width: 36px; height: 36px; border-radius: 10px; border: 1px solid var(--line-2); background: var(--white); font-size: 18px; }
.stepper-num button.plus { border: 0; background: var(--green); color: var(--white); }
.stepper-num output { min-width: 44px; text-align: center; font-weight: 700; font-size: 16px; }
.payroll { background: var(--green); color: var(--cream); border-radius: 18px; padding: 16px; }
.pay-l p { font-size: 13px; color: #C9D6CD; }
.pay-v p { font-size: 24px; font-weight: 700; }
.pay-d p { font-size: 13px; color: #DDE6E0; margin-top: 4px; }
.pay-due p { font-size: 13px; color: #E9C98C; margin-top: 8px; }

/* ---------- more ---------- */
.more-body { padding: 20px 16px 20px; display: flex; flex-direction: column; gap: 18px; }
.profile { display: flex; align-items: center; gap: 12px; background: var(--white); border-radius: var(--radius); padding: 14px; }
.profile-n h1 { font-size: 17px; font-weight: 700; }
.profile-r p { font-size: 13px; color: var(--muted); }
.synced { display: flex; align-items: center; gap: 6px; font-size: 12.5px; color: var(--green-2); }
.synced::before { content: ""; width: 8px; height: 8px; border-radius: 4px; background: var(--green-2); }
.grp-title h2 { font-size: 12.5px; font-weight: 700; color: var(--muted); letter-spacing: .06em; text-transform: uppercase; margin-bottom: -8px; }
.tiles { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 10px; }
.tile { background: var(--white); border-radius: 16px; padding: 14px 8px; display: flex; flex-direction: column; align-items: center; gap: 8px; text-align: center; font-size: 13px; font-weight: 600; min-height: 92px; line-height: 1.25; }
.tile-ic { width: 44px; height: 44px; border-radius: 14px; background: var(--green-tint); color: var(--green); display: flex; align-items: center; justify-content: center; }
.tile-ic.gold { background: var(--gold-soft); color: var(--gold-ink); }
.menu-list { padding: 4px 16px; }
.menu-item { display: flex; justify-content: space-between; padding: 14px 0; border-bottom: 1px solid var(--track); font-size: 15px; }
.menu-item:last-child { border-bottom: 0; }
.menu-item.danger { color: var(--red); }

/* =========================================================
   Laravel app additions: forms, flash messages, errors
   ========================================================= */
.flash { margin: 12px 16px 0; padding: 12px 14px; border-radius: 14px; background: var(--green-soft); color: var(--green-2); font-size: 14px; font-weight: 600; }
.flash.error { background: var(--red-soft); color: var(--red); }
.form { display: flex; flex-direction: column; gap: 16px; padding: 0 16px 16px; }
.field select, .field textarea { width: 100%; min-height: 52px; border-radius: 14px; border: 1.5px solid var(--line-2); background: var(--white); padding: 12px 16px; font-size: 16px; }
.field textarea { min-height: 90px; resize: vertical; }
.field select:focus, .field textarea:focus { border-color: var(--green); outline: none; }
.field .hint { font-size: 12.5px; color: var(--muted); margin-top: 6px; }
.field-error { font-size: 13px; color: var(--red); margin-top: 6px; font-weight: 500; }
.field.has-error input, .field.has-error select { border-color: var(--red); }
.grid-2 { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px; }
.item-row { background: var(--white); border-radius: 16px; padding: 14px; display: flex; flex-direction: column; gap: 10px; }
.item-row .field input, .item-row .field select { height: 46px; min-height: 46px; font-size: 15px; }
.item-row-head { display: flex; justify-content: space-between; align-items: center; font-size: 13px; font-weight: 700; color: var(--muted); }
.link-btn { border: 0; background: none; color: var(--red); font-size: 13px; font-weight: 600; padding: 6px; }
.summary-box { background: var(--green); color: var(--cream); border-radius: 16px; padding: 14px 16px; display: flex; justify-content: space-between; align-items: center; font-weight: 600; }
.radio-pills { display: grid; grid-auto-flow: column; grid-auto-columns: minmax(0, 1fr); gap: 8px; }
.radio-pills label { position: relative; }
.radio-pills input { position: absolute; opacity: 0; }
.radio-pills .pill-face { height: 46px; border-radius: 12px; border: 1.5px solid var(--line-2); background: var(--white); display: flex; align-items: center; justify-content: center; font-size: 14px; font-weight: 600; cursor: pointer; }
.radio-pills input:checked + .pill-face { border-color: var(--green); background: var(--green); color: var(--white); }
.radio-pills input:focus-visible + .pill-face { outline: 3px solid var(--gold); outline-offset: 2px; }
.status-form { display: flex; gap: 8px; margin-top: 12px; }
.status-form select { flex: 1; height: 44px; border-radius: 12px; border: 1.5px solid var(--line-2); background: var(--white); padding: 0 12px; }
.doc-btn { border: 0; cursor: pointer; }
.history { display: flex; flex-direction: column; }
.history-row { display: flex; justify-content: space-between; gap: 10px; padding: 10px 0; border-bottom: 1px solid var(--track); font-size: 13.5px; }
.history-row:last-child { border-bottom: 0; }
.date-row { display: flex; gap: 8px; align-items: center; padding: 0 16px 12px; }
.date-row input, .date-row select { height: 42px; border-radius: 12px; border: 1.5px solid var(--line-2); background: var(--white); padding: 0 10px; font-size: 14px; flex: 1; min-width: 0; }
.order a.order-link { position: absolute; inset: 0; }
.tile.soon { opacity: .55; }
.err-page { padding: 60px 24px; text-align: center; display: flex; flex-direction: column; gap: 14px; align-items: center; }

/* ---------- master data lists ---------- */
.row-item { background: var(--white); border-radius: 16px; padding: 14px 16px; display: flex; align-items: center; gap: 12px; }
.row-item.inactive { opacity: .6; }
.row-main { flex: 1; min-width: 0; }
.row-t h3 { font-size: 15px; font-weight: 700; line-height: 1.3; }
.row-m p { font-size: 12.5px; color: var(--muted); }
.row-side { text-align: right; font-size: 13px; color: var(--muted); }
.row-side b { display: block; color: var(--ink); font-size: 14.5px; }
.tag { display: inline-block; padding: 2px 8px; border-radius: 10px; font-size: 11.5px; font-weight: 600; background: var(--cream-2); color: #4E5A52; }
.tag.green { background: var(--green-soft); color: var(--green-2); }
.tag.gold { background: var(--gold-soft); color: var(--gold-ink); }
.pager { display: flex; align-items: center; justify-content: space-between; gap: 10px; grid-column: 1 / -1; padding-top: 4px; }
.pager-info { font-size: 13px; color: var(--muted); }
.form-actions { display: flex; gap: 10px; }
.form-actions .btn { flex: 1; }
.form-section h2 { font-size: 13px; font-weight: 700; color: var(--muted); letter-spacing: .06em; text-transform: uppercase; }
.danger-zone { padding: 0 16px 24px; }
.btn.danger { background: var(--white); border-color: var(--red); color: var(--red); }
.head-actions { display: flex; gap: 8px; }

/* =========================================================
   Computer layout: sidebar + wide content (900px and up).
   Phones keep the app look with the bottom tab bar.
   ========================================================= */
.sidebar { display: none; }
@media (min-width: 900px) {
  body:has(.app.has-sidebar) { padding: 0; background: var(--cream); }
  .app.has-sidebar { max-width: none; height: 100vh; max-height: none; border-radius: 0; box-shadow: none; display: grid; grid-template-columns: 248px minmax(0, 1fr); grid-template-rows: minmax(0, 1fr); }
  .app.has-sidebar > .app-body { grid-column: 2; grid-row: 1; padding-inline: max(24px, calc((100% - 1140px) / 2)); padding-top: 8px; padding-bottom: 32px; }
  .app.has-sidebar > .tabbar { display: none; }
  .sidebar { grid-column: 1; grid-row: 1; display: flex; flex-direction: column; gap: 18px; background: var(--green); color: var(--cream); padding: 20px 14px; overflow-y: auto; }
  .side-brand { display: flex; align-items: center; gap: 10px; padding: 4px 8px 8px; }
  .brand-mark.sm { width: 40px; height: 40px; border-radius: 12px; }
  .side-name { font-weight: 700; font-size: 15px; line-height: 1.2; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
  .side-sub { font-size: 12px; color: #C9D6CD; }
  .side-nav { display: flex; flex-direction: column; gap: 2px; flex: 1; }
  .side-link { display: flex; align-items: center; gap: 12px; padding: 10px 12px; border-radius: 12px; font-size: 14.5px; font-weight: 500; color: #DDE6E0; }
  .side-link:hover { background: rgba(246, 243, 234, .08); color: var(--cream); }
  .side-link.is-active { background: var(--cream); color: var(--green); font-weight: 600; }
  .side-user { display: flex; align-items: center; gap: 10px; padding: 12px 8px 0; border-top: 1px solid rgba(246, 243, 234, .16); }
  .side-out { width: 40px; height: 40px; border-radius: 12px; border: 1px solid rgba(246, 243, 234, .25); background: transparent; color: var(--cream); display: flex; align-items: center; justify-content: center; }
  .side-out:hover { background: rgba(246, 243, 234, .1); }

  /* wider content */
  .has-sidebar .page-head, .has-sidebar .bar-head { padding-left: 0; padding-right: 0; }
  .has-sidebar .page-head { padding-top: 24px; }
  .has-sidebar .bar-head { padding-top: 22px; }
  .has-sidebar .title h1 { font-size: 26px; }
  .has-sidebar .list, .has-sidebar .detail-body, .has-sidebar .form, .has-sidebar .kpis, .has-sidebar .quick, .has-sidebar .att-stats, .has-sidebar .stat-grid, .has-sidebar .date-row, .has-sidebar .more-body { padding-left: 0; padding-right: 0; }
  .has-sidebar .flash { margin-left: 0; margin-right: 0; }
  .has-sidebar .list { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); align-items: start; gap: 14px; }
  .has-sidebar .list > .list-meta, .has-sidebar .list > .list-label, .has-sidebar .list > .empty, .has-sidebar .list > .payroll, .has-sidebar .list > .pager { grid-column: 1 / -1; }
  .has-sidebar .hero { border-radius: 24px; margin-top: 20px; padding: 26px 28px 96px; }
  .has-sidebar .sales { margin-left: 24px; margin-right: 24px; }
  .has-sidebar .kpis { grid-template-columns: repeat(4, minmax(0, 1fr)); }
  .has-sidebar .quick { grid-template-columns: repeat(4, 110px); }
  .has-sidebar .section-title { padding-left: 0; padding-right: 0; }
  .has-sidebar .alerts, .has-sidebar .areas { margin-left: 0; margin-right: 0; }
  .has-sidebar .detail-body { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); align-items: start; }
  .has-sidebar .detail-body > .buyer { grid-column: 1 / -1; }
  .has-sidebar .form { max-width: 720px; }
  .has-sidebar .bottom-actions { padding-left: 0; padding-right: 0; border-top: 1px solid var(--line); margin-top: 8px; }
  .has-sidebar .bottom-actions .btn { max-width: 340px; }
  .has-sidebar .app-body > div[style*="padding:0 16px"], .has-sidebar .app-body > div[style*="padding: 0 16px"], .has-sidebar .danger-zone { padding-left: 0 !important; padding-right: 0 !important; max-width: 720px; }
  .has-sidebar .tiles { grid-template-columns: repeat(6, minmax(0, 1fr)); }
  .has-sidebar .segmented { max-width: 520px; }
  .has-sidebar .search { max-width: 520px; }
  .has-sidebar .stat-grid, .has-sidebar .att-stats { max-width: 720px; }
}
@media (min-width: 1280px) {
  .has-sidebar .list.three, .has-sidebar .list:has(> .row-item) { grid-template-columns: repeat(3, minmax(0, 1fr)); }
}
.install-card { display: flex; align-items: center; gap: 12px; }
