/* Star Life Venture Sdn Bhd · Store System — colours and type follow the AutoCount Cloud screens the office already uses */
:root {
  --sv-primary: #21A84A;
  --sv-primary-hover: #198038;
  --sv-primary-dark: #177534;
  --sv-tint: #E4F5E9;
  --sv-tint-2: #D9F1E1;
  --sv-text: #4C4F4D;
  --sv-heading: #2F3431;
  --sv-muted: #767E78;
  --sv-bg: #F5F5F5;
  --sv-card: #FFFFFF;
  --sv-line: #E2E6E3;
  --sv-warn: #A87208;
  --sv-warn-tint: #FBF1DC;
  --sv-danger: #C9372C;
  --sv-danger-tint: #FBE7E5;

  --bs-primary: var(--sv-primary);
  --bs-primary-rgb: 33, 168, 74;
  --bs-link-color: var(--sv-primary-dark);
  --bs-link-color-rgb: 23, 117, 52;
  --bs-link-hover-color: var(--sv-primary-hover);
  --bs-body-font-family: "Roboto", system-ui, -apple-system, "Segoe UI", Arial, sans-serif;
  --bs-body-font-size: 0.9rem;
  --bs-body-color: var(--sv-text);
  --bs-body-bg: var(--sv-bg);
  --bs-border-color: var(--sv-line);
  --bs-border-radius: 4px;
  --bs-danger: var(--sv-danger);
  --bs-warning: var(--sv-warn);
}
body { background: var(--sv-bg); color: var(--sv-text); }
h1, h2, h3, h4, h5 { color: var(--sv-heading); text-wrap: balance; }
.num { font-variant-numeric: tabular-nums; text-align: right; white-space: nowrap; }
.text-muted, .form-text { color: var(--sv-muted) !important; }
a { text-decoration: none; }

.btn { border-radius: 4px; font-weight: 500; }
.btn-primary { --bs-btn-bg: var(--sv-primary); --bs-btn-border-color: var(--sv-primary-dark); --bs-btn-hover-bg: var(--sv-primary-hover); --bs-btn-hover-border-color: var(--sv-primary-dark); --bs-btn-active-bg: var(--sv-primary-dark); --bs-btn-active-border-color: var(--sv-primary-dark); --bs-btn-disabled-bg: var(--sv-primary); --bs-btn-disabled-border-color: var(--sv-primary-dark); }
.btn-outline-primary { --bs-btn-color: var(--sv-primary-dark); --bs-btn-border-color: var(--sv-primary); --bs-btn-hover-bg: var(--sv-primary); --bs-btn-hover-border-color: var(--sv-primary-dark); --bs-btn-active-bg: var(--sv-primary-dark); }
.btn-outline-danger { --bs-btn-color: var(--sv-danger); --bs-btn-border-color: #E3A7A1; --bs-btn-hover-bg: var(--sv-danger); --bs-btn-hover-border-color: var(--sv-danger); }
.form-control:focus, .form-select:focus { border-color: var(--sv-primary); box-shadow: 0 0 0 2px rgba(33, 168, 74, .25); }
.form-check-input:checked { background-color: var(--sv-primary); border-color: var(--sv-primary-dark); }
:focus-visible { outline: 2px solid var(--sv-primary-dark); outline-offset: 2px; }
.page-link { color: var(--sv-primary-dark); }
.active > .page-link, .page-link.active { background-color: var(--sv-primary); border-color: var(--sv-primary-dark); }

/* status pills */
.pill { display: inline-flex; align-items: center; gap: 4px; font-size: .75rem; font-weight: 500; padding: 2px 9px; border-radius: 999px; white-space: nowrap; }
.pill-ok { background: var(--sv-tint); color: var(--sv-primary-dark); }
.pill-warn { background: var(--sv-warn-tint); color: var(--sv-warn); }
.pill-danger { background: var(--sv-danger-tint); color: var(--sv-danger); }
.pill-neutral { background: #EEF0EF; color: var(--sv-muted); }

/* ---------------- Office (desktop) ---------------- */
.of-navbar { background: var(--sv-primary); color: #fff; height: 52px; padding: 0 16px; display: flex; align-items: center; justify-content: space-between; gap: 12px; position: sticky; top: 0; z-index: 1030; }
.of-navbar .brand { color: #fff; font-weight: 700; font-size: 1rem; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; min-width: 0; }
.of-navbar > div:first-child { min-width: 0; }
.of-navbar .brand span { font-weight: 400; color: var(--sv-tint-2); }
.of-navbar .right { display: flex; align-items: center; gap: 14px; color: var(--sv-tint-2); font-size: .85rem; }
.of-navbar .right .who { color: #fff; font-weight: 500; }
.of-navbar .btn-nav { color: #fff; border: 1px solid rgba(255,255,255,.35); background: transparent; padding: 3px 10px; font-size: .8rem; border-radius: 4px; }
.of-navbar .btn-nav:hover { background: rgba(255,255,255,.12); }
.of-navbar .menu-toggle { display: none; color: #fff; background: transparent; border: 0; font-size: 1.4rem; line-height: 1; padding: 4px 8px; }
.of-shell { display: grid; grid-template-columns: 220px minmax(0, 1fr); min-height: calc(100vh - 52px); }
.of-side { background: var(--sv-card); border-right: 1px solid var(--sv-line); padding: 10px 0; }
.of-side a { display: flex; justify-content: space-between; align-items: center; padding: 9px 18px; color: var(--sv-text); border-left: 3px solid transparent; }
.of-side a:hover { background: #F7FAF8; }
.of-side a.active { background: var(--sv-tint); color: var(--sv-primary-dark); font-weight: 500; border-left-color: var(--sv-primary); }
.of-side .group { font-size: .7rem; letter-spacing: .08em; text-transform: uppercase; color: var(--sv-muted); padding: 14px 18px 6px; }
.of-side .badge-count { font-size: .72rem; font-weight: 500; min-width: 22px; text-align: center; padding: 1px 7px; border-radius: 999px; background: var(--sv-warn-tint); color: var(--sv-warn); }
.of-main { padding: 20px 22px 40px; min-width: 0; }
.of-head { display: flex; justify-content: space-between; align-items: baseline; gap: 12px; flex-wrap: wrap; margin-bottom: 16px; }
.of-head h1 { font-size: 1.3rem; font-weight: 500; margin: 0; }
.panel { background: var(--sv-card); border: 1px solid var(--sv-line); border-radius: 4px; min-width: 0; }
.panel-head { padding: 11px 16px; border-bottom: 1px solid var(--sv-line); display: flex; justify-content: space-between; align-items: center; gap: 10px; flex-wrap: wrap; }
.panel-head h2 { font-size: .98rem; font-weight: 500; margin: 0; }
.panel-body { padding: 12px 16px; }
.panel-foot { padding: 9px 16px; border-top: 1px solid var(--sv-line); font-size: .8rem; color: var(--sv-muted); display: flex; justify-content: space-between; align-items: center; gap: 8px; flex-wrap: wrap; }
.strip { display: flex; gap: 10px; flex-wrap: wrap; margin-bottom: 16px; }
.strip a, .strip div { background: var(--sv-card); border: 1px solid var(--sv-line); border-radius: 4px; padding: 10px 14px; display: flex; align-items: center; gap: 10px; color: var(--sv-text); }
.strip b { font-size: 1.3rem; font-weight: 700; font-variant-numeric: tabular-nums; color: var(--sv-heading); }
.strip .warn { border-left: 3px solid var(--sv-warn); }
.strip .danger { border-left: 3px solid var(--sv-danger); }
.strip .ok { border-left: 3px solid var(--sv-primary); }
.table { --bs-table-bg: transparent; margin: 0; font-size: .87rem; }
.table > thead th { font-size: .76rem; font-weight: 500; color: var(--sv-muted); background: #FAFBFA; white-space: nowrap; border-bottom-width: 1px; }
.table > tbody td { vertical-align: middle; }
.table-hover > tbody > tr:hover > * { --bs-table-bg-state: #F5FAF6; }
tr.row-link { cursor: pointer; }
.code { color: var(--sv-muted); font-size: .82rem; white-space: nowrap; }
.neg { color: var(--sv-danger); font-weight: 500; }
.up { color: var(--sv-primary-dark); }
.filters { display: flex; gap: 8px; flex-wrap: wrap; align-items: end; }
.filters .form-control, .filters .form-select { width: auto; min-width: 140px; }
.alert { border-radius: 4px; }
.alert-success { background: var(--sv-tint); border-color: var(--sv-tint-2); color: var(--sv-primary-dark); }

@media (max-width: 900px) {
  .of-navbar .menu-toggle { display: inline-block; }
  .of-navbar .right .sync { display: none; }
  .of-navbar .brand span { display: none; }
  .of-shell { grid-template-columns: minmax(0, 1fr); }
  .of-side { display: none; position: fixed; top: 52px; left: 0; bottom: 0; width: 240px; z-index: 1020; overflow-y: auto; box-shadow: 2px 0 12px rgba(0,0,0,.08); }
  .of-side.open { display: block; }
  .of-main { padding: 16px 16px 40px; }
}

/* ---------------- Store (phone) ---------------- */
.st-bar { background: var(--sv-primary); color: #fff; padding: 12px 16px; padding-top: calc(12px + env(safe-area-inset-top, 0px)); display: flex; align-items: center; justify-content: space-between; gap: 10px; position: sticky; top: 0; z-index: 1030; }
.st-bar .title { font-weight: 700; font-size: 1.05rem; color: #fff; display: flex; align-items: center; gap: 6px; }
.st-bar .title a { color: #fff; font-size: 1.5rem; line-height: 1; padding: 0 6px 0 0; }
.st-bar .sub { font-size: .78rem; color: var(--sv-tint-2); }
.st-bar .btn-nav { color: #fff; border: 1px solid rgba(255,255,255,.35); background: transparent; padding: 4px 10px; font-size: .8rem; border-radius: 4px; }
.st-main { max-width: 560px; margin: 0 auto; padding: 14px 16px 90px; display: flex; flex-direction: column; gap: 12px; }
.big-btn { display: flex; align-items: center; gap: 14px; padding: 16px; border-radius: 6px; min-height: 78px; border: 1px solid var(--sv-primary-dark); background: var(--sv-primary); color: #fff; }
.big-btn:hover { background: var(--sv-primary-hover); color: #fff; }
.big-btn.alt { background: var(--sv-card); color: var(--sv-primary-dark); border-color: var(--sv-primary); }
.big-btn.alt:hover { background: var(--sv-tint); }
.big-btn .t { display: block; font-size: 1.1rem; font-weight: 700; }
.big-btn .s { font-size: .82rem; opacity: .9; }
.row-btn { display: flex; justify-content: space-between; align-items: center; min-height: 50px; padding: 0 14px; background: var(--sv-card); border: 1px solid var(--sv-line); border-radius: 6px; font-weight: 500; color: var(--sv-text); }
.row-btn:hover { background: #F7FAF8; color: var(--sv-text); }
.row-btn small { color: var(--sv-muted); font-weight: 400; }
.sec-title { font-size: .74rem; font-weight: 500; letter-spacing: .06em; text-transform: uppercase; color: var(--sv-muted); margin: 6px 0 -4px; }
.list { background: var(--sv-card); border: 1px solid var(--sv-line); border-radius: 6px; }
.list > .it { display: flex; flex-direction: column; gap: 3px; padding: 10px 12px; border-top: 1px solid var(--sv-line); color: var(--sv-text); }
.list > .it:first-child { border-top: 0; }
.list > a.it:hover { background: #F7FAF8; }
.it .top { display: flex; justify-content: space-between; gap: 8px; font-size: .78rem; color: var(--sv-muted); }
.it .main { font-weight: 500; color: var(--sv-heading); }
.field-label { font-size: .78rem; font-weight: 500; color: var(--sv-muted); margin-bottom: 4px; display: block; }
.st-main .form-control, .st-main .form-select { min-height: 46px; font-size: 1rem; }
.locked { background: var(--sv-tint); border: 1px solid var(--sv-tint-2); color: var(--sv-primary-dark); font-weight: 500; border-radius: 4px; min-height: 46px; padding: 10px 12px; display: flex; align-items: center; }
.item-card { background: var(--sv-card); border: 1px solid var(--sv-line); border-radius: 6px; padding: 10px 12px; display: flex; flex-direction: column; gap: 8px; }
.item-card.danger { border-color: #EDB9B4; }
.item-card.warn { border-color: #EBCF94; }
.item-card .name { display: flex; justify-content: space-between; gap: 8px; }
.item-card .name b { font-weight: 500; color: var(--sv-heading); }
.stepper { display: flex; align-items: center; justify-content: space-between; gap: 8px; }
.stepper .ctl { display: flex; align-items: center; border: 1px solid var(--sv-line); border-radius: 4px; overflow: hidden; background: var(--sv-card); }
.stepper .ctl button { width: 48px; height: 46px; border: 0; background: var(--sv-bg); color: var(--sv-primary-dark); font-size: 1.3rem; }
.stepper .ctl input { width: 76px; height: 46px; border: 0; text-align: center; font-size: 1.05rem; font-variant-numeric: tabular-nums; }
.stepper .bal { font-size: .82rem; color: var(--sv-muted); font-variant-numeric: tabular-nums; }
.stepper .bal.neg { color: var(--sv-danger); font-weight: 500; }
.note-box { font-size: .82rem; padding: 8px 10px; border-radius: 4px; }
.note-box.danger { background: var(--sv-danger-tint); color: var(--sv-danger); }
.note-box.warn { background: var(--sv-warn-tint); color: var(--sv-warn); }
.results { background: var(--sv-card); border: 1px solid var(--sv-line); border-radius: 6px; max-height: 300px; overflow-y: auto; }
.results button { display: flex; justify-content: space-between; gap: 10px; width: 100%; text-align: left; border: 0; border-top: 1px solid var(--sv-line); background: transparent; padding: 11px 12px; min-height: 48px; color: var(--sv-text); }
.results button:first-child { border-top: 0; }
.results button:hover { background: var(--sv-tint); }
.submit-bar { position: fixed; left: 0; right: 0; bottom: 0; background: var(--sv-card); border-top: 1px solid var(--sv-line); padding: 10px 16px; padding-bottom: calc(10px + env(safe-area-inset-bottom, 0px)); z-index: 1020; }
.submit-bar .btn { width: 100%; min-height: 50px; font-size: 1rem; font-weight: 700; max-width: 528px; display: block; margin: 0 auto; }
.upload { border: 1.5px dashed #B9C3BC; border-radius: 6px; min-height: 64px; display: flex; align-items: center; justify-content: center; gap: 8px; color: var(--sv-primary-dark); font-weight: 500; background: var(--sv-card); cursor: pointer; padding: 10px; text-align: center; }
.upload input { position: absolute; width: 1px; height: 1px; opacity: 0; }
.upload img { max-height: 160px; max-width: 100%; border-radius: 4px; }

/* ---------------- Sign-in ---------------- */
.auth-wrap { min-height: 100vh; display: grid; place-items: center; padding: 24px 16px; background: var(--sv-bg); }
.auth-card { width: 100%; max-width: 400px; background: var(--sv-card); border: 1px solid var(--sv-line); border-radius: 6px; overflow: hidden; }
.auth-top { background: var(--sv-primary); color: #fff; padding: 20px 24px; }
.auth-top .co { font-weight: 700; font-size: 1.1rem; }
.auth-top .app { color: var(--sv-tint-2); font-size: .88rem; }
.auth-body { padding: 22px 24px 24px; display: flex; flex-direction: column; gap: 14px; }
.auth-body .form-control { min-height: 46px; }
.auth-body .btn { min-height: 46px; }
.auth-foot { font-size: .8rem; color: var(--sv-muted); text-align: center; }

/* ---------------- User guide ---------------- */
.guide-body { background: var(--sv-bg); }
.guide-shell { display: grid; grid-template-columns: 260px minmax(0, 1fr); gap: 0; max-width: 1280px; margin: 0 auto; }
.guide-toc { position: sticky; top: 52px; align-self: start; max-height: calc(100vh - 52px); overflow-y: auto; padding: 20px 12px 20px 16px; border-right: 1px solid var(--sv-line); background: var(--sv-card); }
.guide-toc summary { font-weight: 700; color: var(--sv-heading); cursor: pointer; margin-bottom: 8px; list-style: none; }
.guide-toc summary::-webkit-details-marker { display: none; }
.guide-toc summary::before { content: '▸ '; color: var(--sv-primary-dark); }
.guide-toc details[open] summary::before { content: '▾ '; }
.guide-toc ol { list-style: none; padding-left: 0; margin: 0; font-size: .88rem; }
.guide-toc ol ol { padding-left: 14px; margin: 2px 0 6px; font-size: .84rem; }
.guide-toc a { display: block; padding: 4px 8px; border-radius: 4px; color: var(--sv-text); }
.guide-toc a:hover { background: var(--sv-tint); color: var(--sv-primary-dark); }
.guide-main { padding: 28px 32px 60px; min-width: 0; max-width: 980px; }
.guide-hero { border-bottom: 1px solid var(--sv-line); padding-bottom: 18px; margin-bottom: 8px; }
.guide-hero h1 { font-size: 1.7rem; font-weight: 700; margin: 0 0 8px; }
.guide-hero p { max-width: 68ch; margin: 0 0 6px; }
.guide-note { font-size: .85rem; color: var(--sv-muted); }
.g-sec { padding-top: 28px; scroll-margin-top: 64px; }
.g-sec h2 { font-size: 1.35rem; font-weight: 700; margin: 0 0 12px; padding-bottom: 6px; border-bottom: 2px solid var(--sv-primary); display: inline-block; }
.g-sub { margin-top: 26px; scroll-margin-top: 64px; }
.g-sec h3 { font-size: 1.08rem; font-weight: 500; margin: 18px 0 8px; }
.g-sub > h3:first-child, .g-split h3:first-child { margin-top: 0; }
.g-sec p, .g-sec li { max-width: 72ch; line-height: 1.6; }
.g-split { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 24px; align-items: start; }
.g-phones { display: flex; gap: 14px; flex-wrap: wrap; justify-content: flex-start; }
.g-phones figure { width: 250px; max-width: 100%; margin: 0; }
.g-phones img { width: 100%; height: auto; border-radius: 16px; border: 6px solid #2C302E; background: #2C302E; display: block; }
.g-wide { margin: 14px 0; max-width: 100%; }
.g-wide img { width: 100%; height: auto; border: 1px solid var(--sv-line); border-radius: 6px; display: block; }
figcaption { font-size: .8rem; color: var(--sv-muted); margin-top: 6px; }
.g-steps { padding-left: 1.3rem; }
.g-steps li { margin-bottom: 6px; padding-left: 4px; }
.g-steps li::marker { color: var(--sv-primary-dark); font-weight: 700; }
.g-cards { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px; margin: 12px 0; }
.g-card { background: var(--sv-card); border: 1px solid var(--sv-line); border-top: 3px solid var(--sv-primary); border-radius: 4px; padding: 12px 16px; }
.g-card h3 { margin: 0 0 6px; font-size: 1rem; }
.g-card p { margin: 0; }
.g-callout { background: var(--sv-card); border: 1px solid var(--sv-line); border-left: 4px solid var(--sv-muted); border-radius: 4px; padding: 10px 14px; margin: 12px 0; max-width: 78ch; }
.g-callout.ok { border-left-color: var(--sv-primary); background: var(--sv-tint); }
.g-callout.warn { border-left-color: var(--sv-warn); background: var(--sv-warn-tint); }
.g-callout.danger { border-left-color: var(--sv-danger); background: var(--sv-danger-tint); }
.g-tag { display: inline-block; font-size: .75rem; font-weight: 500; padding: 1px 8px; border-radius: 999px; }
.g-tag.warn { background: var(--sv-warn-tint); color: var(--sv-warn); }
.g-tag.danger { background: var(--sv-danger-tint); color: var(--sv-danger); }
.g-table { background: var(--sv-card); border: 1px solid var(--sv-line); margin: 10px 0 14px; }
.g-table td { vertical-align: top; }
.g-faq { background: var(--sv-card); border: 1px solid var(--sv-line); border-radius: 4px; padding: 10px 14px; margin-bottom: 8px; max-width: 78ch; }
.g-faq summary { font-weight: 500; color: var(--sv-heading); cursor: pointer; min-height: 32px; display: flex; align-items: center; }
.g-faq p { margin: 8px 0 2px; }
.guide-foot { margin-top: 40px; padding-top: 14px; border-top: 1px solid var(--sv-line); font-size: .8rem; color: var(--sv-muted); }
.guide-main code { color: var(--sv-primary-dark); background: var(--sv-tint); padding: 1px 5px; border-radius: 3px; }
@media (max-width: 900px) {
  .guide-shell { grid-template-columns: minmax(0, 1fr); }
  .guide-toc { position: static; max-height: none; border-right: 0; border-bottom: 1px solid var(--sv-line); padding: 12px 16px; }
  .guide-main { padding: 18px 16px 48px; }
  .g-split { grid-template-columns: minmax(0, 1fr); }
  .g-cards { grid-template-columns: minmax(0, 1fr); }
  .g-phones figure { width: calc(50% - 7px); }
}
@media print { .guide-toc, .of-navbar { display: none; } .guide-shell { display: block; } }

@media (prefers-reduced-motion: reduce) { * { transition: none !important; animation: none !important; } }
