:root {
  --ink: #17231f;
  --muted: #697871;
  --faint: #93a19b;
  --line: #e4e9e6;
  --surface: #ffffff;
  --canvas: #f6f8f6;
  --primary: #123f35;
  --primary-2: #195346;
  --primary-soft: #e9f2ef;
  --lime: #dbe956;
  --lime-soft: #f4f7cf;
  --amber: #e89a35;
  --amber-soft: #fff2df;
  --red: #c8504e;
  --red-soft: #fdebea;
  --blue: #3f70c6;
  --blue-soft: #eaf0fb;
  --shadow-sm: 0 1px 2px rgba(22, 36, 31, .05), 0 5px 18px rgba(22, 36, 31, .035);
  --shadow-lg: 0 24px 70px rgba(18, 47, 39, .18);
  --radius: 15px;
  --radius-sm: 10px;
  font-family: Inter, Aptos, "Segoe UI", system-ui, -apple-system, sans-serif;
  color: var(--ink);
  background: var(--canvas);
  font-synthesis: none;
}

* { box-sizing: border-box; }
html, body { margin: 0; min-height: 100%; }
body { background: var(--canvas); line-height: 1.45; }
button, input, select, textarea { font: inherit; }
button { color: inherit; }
a { color: inherit; }
svg { width: 20px; height: 20px; stroke: currentColor; fill: none; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }
.hidden { display: none !important; }
.muted { color: var(--muted); }
.faint { color: var(--faint); }
.text-right { text-align: right; }
.text-center { text-align: center; }
.no-wrap { white-space: nowrap; }

/* Login */
.login-screen { min-height: 100vh; display: grid; grid-template-columns: minmax(420px, 1.05fr) minmax(500px, .95fr); background: #f9faf8; }
.login-story { position: relative; min-height: 100vh; overflow: hidden; color: white; background: radial-gradient(circle at 17% 78%, rgba(219,233,86,.13), transparent 24%), radial-gradient(circle at 82% 18%, rgba(90,143,128,.35), transparent 25%), linear-gradient(145deg, #0d3029, #123d33 46%, #09271f); padding: 54px clamp(48px, 6vw, 98px); display: flex; flex-direction: column; }
.login-story::before, .login-story::after { content: ""; position: absolute; border: 1px solid rgba(255,255,255,.075); border-radius: 50%; width: 460px; height: 460px; right: -180px; top: 14%; }
.login-story::after { width: 270px; height: 270px; right: -70px; top: 27%; }
.login-brand, .mobile-login-brand, .sidebar-brand { display: flex; align-items: center; gap: 12px; font-weight: 730; letter-spacing: -.02em; font-size: 20px; }
.brand-mark { display: grid; place-items: center; width: 40px; height: 40px; color: #173b31; border-radius: 12px; background: var(--lime); box-shadow: inset 0 0 0 1px rgba(255,255,255,.35); flex: none; }
.brand-mark svg { width: 27px; height: 27px; stroke-width: 2.2; }
.story-copy { position: relative; z-index: 1; max-width: 650px; margin: auto 0 44px; }
.eyebrow { display: inline-flex; align-items: center; gap: 8px; color: var(--primary-2); font-size: 12px; font-weight: 760; text-transform: uppercase; letter-spacing: .12em; }
.eyebrow.light { color: var(--lime); }
.story-copy h1 { margin: 19px 0 22px; max-width: 620px; font-size: clamp(45px, 5vw, 72px); line-height: 1.03; letter-spacing: -.055em; font-weight: 690; }
.story-copy p { max-width: 550px; margin: 0; color: rgba(255,255,255,.7); font-size: 18px; line-height: 1.7; }
.story-stats { position: relative; z-index: 1; display: flex; gap: 0; border-top: 1px solid rgba(255,255,255,.14); padding-top: 25px; }
.story-stats div { display: flex; flex-direction: column; min-width: 150px; padding-right: 38px; margin-right: 38px; border-right: 1px solid rgba(255,255,255,.12); }
.story-stats div:last-child { border-right: 0; }
.story-stats strong { color: var(--lime); font-size: 22px; }
.story-stats span { color: rgba(255,255,255,.57); font-size: 12px; margin-top: 3px; }
.road-art { position: absolute; inset: auto -12% 14% auto; width: 68%; height: 44%; opacity: .12; transform: rotate(-12deg); }
.road-art span { position: absolute; border: 2px solid white; border-radius: 50%; width: 100%; height: 100%; }
.road-art span:nth-child(2) { transform: scale(.76); }
.road-art span:nth-child(3) { transform: scale(.52); }
.login-panel { display: grid; place-items: center; padding: 48px; }
.login-card { width: min(430px, 100%); }
.mobile-login-brand { display: none; color: var(--primary); margin-bottom: 48px; }
.login-card h2 { margin: 10px 0 8px; font-size: 33px; line-height: 1.2; letter-spacing: -.035em; }
.login-card > p { margin: 0 0 34px; }
.field { display: flex; flex-direction: column; gap: 8px; margin: 0 0 18px; color: #34433d; font-size: 13px; font-weight: 650; }
.input-wrap { position: relative; display: flex; align-items: center; }
.input-wrap > i { position: absolute; left: 14px; display: flex; color: var(--faint); pointer-events: none; }
.input-wrap input { padding-left: 44px; padding-right: 44px; width: 100%; }
input, select, textarea { min-height: 44px; width: 100%; border: 1px solid #dbe2de; border-radius: 10px; background: white; color: var(--ink); padding: 10px 12px; outline: none; transition: border .16s, box-shadow .16s; }
textarea { min-height: 84px; resize: vertical; }
input:focus, select:focus, textarea:focus { border-color: #6d9a8e; box-shadow: 0 0 0 3px rgba(35, 98, 80, .1); }
input::placeholder, textarea::placeholder { color: #abb5b1; }
.password-toggle { position: absolute; right: 7px; width: 34px !important; height: 34px !important; }
.form-error { min-height: 22px; color: var(--red); font-size: 13px; margin-top: -7px; }
.button { min-height: 42px; border: 0; border-radius: 10px; display: inline-flex; align-items: center; justify-content: center; gap: 8px; padding: 9px 16px; font-size: 13px; font-weight: 700; cursor: pointer; transition: transform .12s, background .15s, box-shadow .15s; white-space: nowrap; }
.button:hover { transform: translateY(-1px); }
.button:active { transform: translateY(0); }
.button:disabled { opacity: .55; cursor: not-allowed; transform: none; }
.button.primary { background: var(--primary); color: white; box-shadow: 0 6px 16px rgba(18,63,53,.15); }
.button.primary:hover { background: var(--primary-2); }
.button.accent { background: var(--lime); color: #20352f; }
.button.secondary { border: 1px solid var(--line); background: white; color: #304039; }
.button.secondary:hover { background: #f8faf9; }
.button.danger { background: var(--red-soft); color: #a33f3c; }
.button.ghost { background: transparent; color: var(--muted); }
.button.small { min-height: 34px; padding: 6px 11px; font-size: 12px; }
.button.wide { width: 100%; }
.login-submit { height: 48px; margin-top: 5px; }
.demo-note { display: flex; gap: 12px; border: 1px solid #dbe9e4; background: #eff5f2; border-radius: 12px; padding: 14px; margin-top: 24px; color: var(--primary); }
.demo-note > i { display: flex; padding-top: 1px; }
.demo-note div { display: flex; flex-direction: column; gap: 4px; }
.demo-note strong { font-size: 12px; }
.demo-note span { color: #657770; font-size: 11px; line-height: 1.6; }
.copyright { text-align: center; color: #9aa6a1 !important; font-size: 11px; margin-top: 32px !important; }

/* Shell */
.app { min-height: 100vh; }
.sidebar { position: fixed; inset: 0 auto 0 0; z-index: 30; width: 248px; background: #10372f; color: white; padding: 26px 18px 20px; display: flex; flex-direction: column; }
.sidebar-brand { padding: 0 10px 26px; }
.sidebar-brand > div:last-child { display: flex; flex-direction: column; }
.sidebar-brand strong { font-size: 18px; }
.sidebar-brand small { font-size: 10px; color: rgba(255,255,255,.45); font-weight: 500; margin-top: -1px; }
.main-nav { display: flex; flex-direction: column; gap: 3px; }
.nav-group-label { margin: 17px 12px 8px; color: rgba(255,255,255,.35); font-size: 9px; font-weight: 750; letter-spacing: .13em; text-transform: uppercase; }
.nav-item { width: 100%; height: 43px; border: 0; border-radius: 9px; background: transparent; color: rgba(255,255,255,.65); display: flex; align-items: center; gap: 12px; padding: 0 13px; font-size: 13px; font-weight: 580; cursor: pointer; text-align: left; }
.nav-item i { display: flex; }
.nav-item svg { width: 18px; height: 18px; }
.nav-item:hover { background: rgba(255,255,255,.055); color: white; }
.nav-item.active { background: rgba(219,233,86,.14); color: var(--lime); }
.nav-item .nav-badge { margin-left: auto; min-width: 20px; height: 20px; border-radius: 10px; display: grid; place-items: center; padding: 0 6px; background: var(--lime); color: #17392f; font-size: 10px; font-weight: 800; }
.sidebar-help { margin-top: auto; display: flex; flex-direction: column; align-items: flex-start; background: rgba(255,255,255,.055); border: 1px solid rgba(255,255,255,.07); border-radius: 13px; padding: 15px; }
.sidebar-help .help-icon { display: grid; place-items: center; width: 30px; height: 30px; border-radius: 9px; background: rgba(219,233,86,.14); color: var(--lime); margin-bottom: 10px; }
.sidebar-help strong { font-size: 11px; }
.sidebar-help span { font-size: 10px; color: rgba(255,255,255,.45); margin: 2px 0 8px; }
.sidebar-help a { color: var(--lime); font-size: 10px; text-decoration: none; }
.sidebar-user { margin-top: 14px; padding-top: 14px; border-top: 1px solid rgba(255,255,255,.09); display: flex; align-items: center; gap: 10px; }
.avatar { width: 35px; height: 35px; border-radius: 10px; display: grid; place-items: center; background: #e7d2ad; color: #594c38; font-weight: 800; font-size: 12px; flex: none; }
.sidebar-user .user-copy { min-width: 0; display: flex; flex: 1; flex-direction: column; }
.sidebar-user button.user-copy { border: 0; background: transparent; color: white; padding: 0; text-align: left; cursor: pointer; }
.sidebar-user button.user-copy:hover strong { color: var(--lime); }
.sidebar-user strong { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-size: 11px; }
.sidebar-user span { color: rgba(255,255,255,.43); font-size: 9px; text-transform: capitalize; }
.icon-btn { width: 40px; height: 40px; border-radius: 10px; border: 1px solid var(--line); background: white; display: inline-grid; place-items: center; cursor: pointer; color: var(--muted); padding: 0; }
.icon-btn:hover { background: #f5f8f6; color: var(--primary); }
.icon-btn > i { display: flex; }
.icon-btn svg { width: 18px; height: 18px; }
.sidebar-user .icon-btn { width: 30px; height: 30px; background: transparent; border-color: transparent; color: rgba(255,255,255,.45); }
.sidebar-user .icon-btn:hover { color: white; background: rgba(255,255,255,.06); }
.workspace { min-height: 100vh; margin-left: 248px; }
.topbar { height: 80px; position: sticky; top: 0; z-index: 20; display: flex; align-items: center; justify-content: space-between; padding: 0 30px; border-bottom: 1px solid var(--line); background: rgba(255,255,255,.92); backdrop-filter: blur(12px); }
.topbar-left { display: flex; align-items: center; gap: 12px; }
.topbar h1 { margin: 0; font-size: 19px; letter-spacing: -.025em; }
.topbar p { margin: 2px 0 0; color: var(--muted); font-size: 10px; }
.topbar-actions { display: flex; gap: 9px; align-items: center; }
.branch-switch { height: 37px; display: flex; align-items: center; gap: 7px; border: 1px solid var(--line); border-radius: 9px; padding: 0 8px; background: var(--surface); color: var(--muted); }
.branch-switch > i svg { width: 14px; height: 14px; }
.branch-switch select { border: 0; background: transparent; color: var(--ink); font-size: 9px; font-weight: 700; max-width: 190px; outline: 0; }
.global-search { width: 250px; height: 40px; display: flex; align-items: center; gap: 8px; border: 1px solid var(--line); border-radius: 10px; background: #fafbfa; color: #8b9892; padding: 0 10px; font-size: 11px; cursor: pointer; }
.global-search i { display: flex; }
.global-search svg { width: 16px; }
.global-search span { flex: 1; text-align: left; }
kbd { border: 1px solid #dce2df; background: white; border-radius: 5px; color: #8f9b96; font-size: 8px; padding: 2px 5px; box-shadow: 0 1px 0 #dfe5e2; }
.notification { position: relative; }
.alert-dot { display: none; position: absolute; top: 6px; right: 7px; width: 6px; height: 6px; border-radius: 50%; background: var(--red); box-shadow: 0 0 0 2px white; }
.alert-dot.visible { display: block; }
.mobile-menu { display: none; }
.sidebar-overlay { display: none; }
.page-content { max-width: 1600px; margin: auto; padding: 25px 30px 42px; outline: 0; }

/* Shared content */
.page-head { display: flex; align-items: center; justify-content: space-between; gap: 20px; margin-bottom: 18px; }
.page-head h2 { margin: 0; font-size: 20px; letter-spacing: -.025em; }
.page-head p { margin: 3px 0 0; color: var(--muted); font-size: 11px; }
.head-actions { display: flex; gap: 9px; align-items: center; flex-wrap: wrap; }
.card { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); box-shadow: var(--shadow-sm); }
.card-header { min-height: 58px; display: flex; align-items: center; justify-content: space-between; gap: 16px; padding: 15px 18px; border-bottom: 1px solid #edf0ee; }
.card-header h3 { margin: 0; font-size: 13px; letter-spacing: -.01em; }
.card-header p { margin: 2px 0 0; color: var(--muted); font-size: 10px; }
.card-body { padding: 18px; }
.link-button { border: 0; background: transparent; color: var(--primary-2); font-size: 11px; font-weight: 700; cursor: pointer; padding: 4px; }
.metrics-grid { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 14px; margin-bottom: 16px; }
.metric-card { min-height: 128px; padding: 17px; position: relative; overflow: hidden; }
.metric-top { display: flex; align-items: flex-start; justify-content: space-between; }
.metric-icon { width: 37px; height: 37px; border-radius: 10px; display: grid; place-items: center; background: var(--primary-soft); color: var(--primary); }
.metric-icon.amber { background: var(--amber-soft); color: #bb7016; }
.metric-icon.blue { background: var(--blue-soft); color: var(--blue); }
.metric-icon.lime { background: var(--lime-soft); color: #657117; }
.metric-icon svg { width: 18px; height: 18px; }
.trend { padding: 3px 7px; border-radius: 12px; background: var(--primary-soft); color: var(--primary-2); font-size: 9px; font-weight: 750; }
.metric-card h3 { font-size: 23px; letter-spacing: -.035em; margin: 15px 0 2px; line-height: 1; }
.metric-card p { color: var(--muted); font-size: 10px; margin: 0; }
.dashboard-grid { display: grid; grid-template-columns: minmax(0, 1.65fr) minmax(300px, .75fr); gap: 16px; margin-bottom: 16px; }
.chart-card { min-height: 300px; }
.chart-summary { display: flex; gap: 20px; }
.chart-summary div { display: flex; flex-direction: column; }
.chart-summary strong { font-size: 12px; }
.chart-summary span { color: var(--muted); font-size: 9px; }
.bar-chart { height: 206px; display: flex; align-items: stretch; gap: 10px; padding: 10px 4px 0; position: relative; }
.bar-chart::before, .bar-chart::after { content: ""; position: absolute; left: 0; right: 0; border-top: 1px dashed #edf0ee; }
.bar-chart::before { top: 35%; }
.bar-chart::after { top: 68%; }
.bar-col { flex: 1; display: flex; flex-direction: column; align-items: center; justify-content: flex-end; gap: 7px; z-index: 1; min-width: 24px; }
.bar { width: min(32px, 58%); min-height: 4px; border-radius: 6px 6px 2px 2px; background: linear-gradient(#1a5849, #123f35); position: relative; transition: height .35s ease; }
.bar:hover { background: var(--lime); }
.bar:hover::before { content: attr(data-value); position: absolute; bottom: calc(100% + 7px); left: 50%; transform: translateX(-50%); background: #152b25; color: white; font-size: 9px; white-space: nowrap; border-radius: 6px; padding: 4px 6px; }
.bar-col label { color: var(--muted); font-size: 9px; }
.stock-list { padding: 5px 17px 12px; }
.stock-alert-row { display: grid; grid-template-columns: 34px minmax(0, 1fr) auto; gap: 10px; align-items: center; padding: 10px 0; border-bottom: 1px solid #f0f2f1; }
.stock-alert-row:last-child { border-bottom: 0; }
.part-thumb { width: 34px; height: 34px; display: grid; place-items: center; border-radius: 9px; background: #f0f3f1; color: #6f7f78; }
.part-thumb svg { width: 17px; }
.stock-alert-row strong { display: block; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-size: 10px; }
.stock-alert-row span { color: var(--muted); font-size: 9px; }
.stock-count { color: var(--red); font-size: 10px; font-weight: 800; }
.quick-actions { display: grid; grid-template-columns: repeat(4, 1fr); gap: 10px; padding: 14px 18px 18px; }
.quick-action { display: flex; align-items: center; gap: 10px; min-height: 52px; border: 1px solid var(--line); border-radius: 11px; background: white; padding: 9px 11px; cursor: pointer; text-align: left; }
.quick-action:hover { border-color: #b6cdc5; background: #fbfcfb; }
.quick-action i { width: 31px; height: 31px; display: grid; place-items: center; border-radius: 8px; background: var(--primary-soft); color: var(--primary); flex: none; }
.quick-action svg { width: 15px; }
.quick-action strong { display: block; font-size: 10px; }
.quick-action span { color: var(--muted); font-size: 8px; }

/* Tables and filters */
.toolbar { display: flex; justify-content: space-between; gap: 12px; margin-bottom: 14px; }
.toolbar-left, .toolbar-right { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; }
.search-box { position: relative; width: 270px; }
.search-box i { position: absolute; left: 12px; top: 50%; transform: translateY(-50%); display: flex; color: var(--faint); }
.search-box svg { width: 16px; }
.search-box input { height: 40px; min-height: 40px; padding-left: 37px; font-size: 11px; background: white; }
.filter-select { width: auto; min-width: 140px; height: 40px; min-height: 40px; padding: 0 32px 0 11px; font-size: 11px; }
.segmented { display: inline-flex; border: 1px solid var(--line); background: white; border-radius: 10px; padding: 3px; }
.segmented button { min-height: 31px; border: 0; border-radius: 7px; padding: 0 12px; background: transparent; color: var(--muted); font-size: 10px; font-weight: 650; cursor: pointer; }
.segmented button.active { background: var(--primary); color: white; }
.table-wrap { width: 100%; overflow-x: auto; }
.data-table { width: 100%; border-collapse: collapse; font-size: 11px; }
.data-table th { height: 42px; padding: 0 14px; border-bottom: 1px solid var(--line); background: #fafbfa; color: #7c8983; font-size: 9px; font-weight: 750; letter-spacing: .035em; text-align: left; text-transform: uppercase; white-space: nowrap; }
.data-table td { height: 58px; padding: 8px 14px; border-bottom: 1px solid #eef1ef; vertical-align: middle; }
.data-table tbody tr { transition: background .1s; }
.data-table tbody tr:hover { background: #fbfcfb; }
.data-table tbody tr:last-child td { border-bottom: 0; }
.primary-cell { display: flex; align-items: center; gap: 10px; min-width: 180px; }
.primary-cell .part-thumb { width: 35px; height: 35px; }
.primary-cell strong { display: block; max-width: 220px; overflow: hidden; white-space: nowrap; text-overflow: ellipsis; font-size: 10px; }
.primary-cell span { display: block; color: var(--muted); font-size: 9px; margin-top: 2px; }
.sku { color: var(--muted); font-family: ui-monospace, SFMono-Regular, Consolas, monospace; font-size: 10px; }
.money { white-space: nowrap; font-weight: 720; font-variant-numeric: tabular-nums; }
.stock-level { display: flex; align-items: center; gap: 8px; white-space: nowrap; }
.stock-level strong { min-width: 21px; font-size: 11px; }
.stock-track { width: 44px; height: 4px; border-radius: 5px; background: #e9eeeb; overflow: hidden; }
.stock-track span { display: block; height: 100%; border-radius: inherit; background: var(--primary-2); }
.stock-level.low strong { color: var(--red); }
.stock-level.low .stock-track span { background: var(--red); }
.badge { display: inline-flex; align-items: center; gap: 5px; border-radius: 20px; padding: 4px 8px; font-size: 9px; font-weight: 730; white-space: nowrap; text-transform: capitalize; }
.badge::before { content: ""; width: 5px; height: 5px; border-radius: 50%; background: currentColor; }
.badge.paid, .badge.in-stock, .badge.active, .badge.in { background: var(--primary-soft); color: #24715d; }
.badge.partial, .badge.low, .badge.pending { background: var(--amber-soft); color: #ad6818; }
.badge.credit, .badge.out-of-stock, .badge.out { background: var(--red-soft); color: #b64845; }
.badge.neutral { background: #eff2f0; color: #6b7973; }
.row-actions { display: flex; justify-content: flex-end; gap: 3px; }
.row-actions .icon-btn { width: 31px; height: 31px; border-color: transparent; background: transparent; }
.row-actions .icon-btn:hover { background: #edf3f0; }
.table-footer { min-height: 45px; padding: 10px 14px; border-top: 1px solid var(--line); display: flex; justify-content: space-between; align-items: center; color: var(--muted); font-size: 9px; }
.empty-state { padding: 65px 20px; text-align: center; color: var(--muted); }
.empty-icon { margin: 0 auto 12px; width: 44px; height: 44px; display: grid; place-items: center; border-radius: 13px; background: var(--primary-soft); color: var(--primary); }
.empty-state h3 { margin: 0 0 5px; color: var(--ink); font-size: 13px; }
.empty-state p { margin: 0; font-size: 10px; }

/* POS */
.pos-layout { display: grid; grid-template-columns: minmax(0, 1.45fr) 365px; gap: 16px; align-items: start; }
.pos-products { min-width: 0; }
.category-chips { display: flex; gap: 7px; margin: 12px 0 15px; overflow-x: auto; padding-bottom: 3px; scrollbar-width: thin; }
.chip { min-height: 32px; border: 1px solid var(--line); background: white; border-radius: 18px; padding: 5px 12px; color: var(--muted); font-size: 10px; font-weight: 650; white-space: nowrap; cursor: pointer; }
.chip.active { border-color: var(--primary); background: var(--primary); color: white; }
.product-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 10px; }
.product-tile { min-height: 150px; position: relative; border: 1px solid var(--line); border-radius: 13px; background: white; padding: 13px; cursor: pointer; text-align: left; transition: transform .14s, border .14s, box-shadow .14s; overflow: hidden; }
.product-tile:hover { transform: translateY(-2px); border-color: #b9cdc6; box-shadow: var(--shadow-sm); }
.product-tile:disabled { cursor: not-allowed; opacity: .55; transform: none; }
.tile-top { display: flex; justify-content: space-between; align-items: flex-start; }
.tile-icon { width: 38px; height: 38px; border-radius: 10px; display: grid; place-items: center; background: #f1f4f2; color: #60716a; }
.tile-icon svg { width: 18px; }
.tile-stock { border-radius: 10px; background: var(--primary-soft); color: var(--primary-2); padding: 3px 7px; font-size: 8px; font-weight: 750; }
.tile-stock.low { background: var(--red-soft); color: var(--red); }
.product-tile h3 { margin: 14px 0 3px; max-width: 95%; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-size: 11px; }
.product-tile p { margin: 0 0 8px; color: var(--muted); font-size: 8px; overflow: hidden; white-space: nowrap; text-overflow: ellipsis; }
.tile-price { font-size: 13px; font-weight: 800; }
.pos-cart { position: sticky; top: 98px; overflow: hidden; }
.cart-title { display: flex; align-items: center; gap: 8px; }
.cart-count { display: grid; place-items: center; min-width: 19px; height: 19px; border-radius: 10px; background: var(--lime); color: #2f3e28; font-size: 8px; }
.cart-customer { padding: 12px 15px; border-bottom: 1px solid var(--line); }
.cart-customer label { display: block; color: var(--muted); font-size: 9px; margin-bottom: 5px; }
.cart-customer select { height: 38px; min-height: 38px; font-size: 10px; }
.cart-lines { max-height: 306px; overflow: auto; padding: 4px 14px; }
.cart-empty { padding: 45px 20px; text-align: center; color: var(--muted); }
.cart-empty i { width: 42px; height: 42px; display: grid; place-items: center; border-radius: 50%; background: #f2f4f3; margin: auto; }
.cart-empty h4 { color: var(--ink); font-size: 11px; margin: 10px 0 3px; }
.cart-empty p { font-size: 9px; margin: 0; }
.cart-line { padding: 11px 0; border-bottom: 1px solid #eff2f0; }
.cart-line-head { display: flex; justify-content: space-between; align-items: flex-start; gap: 10px; }
.cart-line-head strong { font-size: 10px; line-height: 1.35; }
.cart-line-head .icon-btn { width: 25px; height: 25px; border: 0; color: #9aa6a1; }
.cart-line-meta { color: var(--muted); font-size: 8px; margin-top: 2px; }
.cart-line-foot { display: flex; justify-content: space-between; align-items: center; margin-top: 9px; }
.qty-control { display: flex; align-items: center; border: 1px solid var(--line); border-radius: 8px; overflow: hidden; }
.qty-control button { width: 25px; height: 25px; border: 0; background: #f7f9f8; cursor: pointer; }
.qty-control span { width: 27px; text-align: center; font-size: 9px; font-weight: 750; }
.cart-summary { padding: 13px 15px; border-top: 1px solid var(--line); background: #fafbfa; }
.summary-row { display: flex; align-items: center; justify-content: space-between; margin-bottom: 8px; color: var(--muted); font-size: 10px; }
.summary-row input { width: 90px; min-height: 30px; height: 30px; padding: 4px 8px; text-align: right; font-size: 10px; }
.summary-row.total { padding-top: 9px; margin-top: 9px; border-top: 1px dashed #dce2df; color: var(--ink); font-size: 13px; font-weight: 800; }
.cart-checkout { padding: 0 15px 15px; background: #fafbfa; }
.cart-checkout .button { height: 45px; }

/* Forms, modal, payments */
.modal-backdrop { position: fixed; inset: 0; z-index: 100; display: grid; place-items: center; background: rgba(9, 29, 24, .56); backdrop-filter: blur(3px); padding: 20px; animation: fade-in .15s ease; }
.modal { width: min(600px, 100%); max-height: min(840px, calc(100vh - 30px)); background: white; border-radius: 17px; box-shadow: var(--shadow-lg); overflow: hidden; display: flex; flex-direction: column; animation: modal-in .18s ease; }
.modal.large { width: min(820px, 100%); }
.modal.xlarge { width: min(1040px, 100%); }
.modal-head { min-height: 67px; padding: 16px 20px; display: flex; justify-content: space-between; align-items: center; border-bottom: 1px solid var(--line); }
.modal-head h2 { margin: 0; font-size: 16px; letter-spacing: -.02em; }
.modal-head p { margin: 2px 0 0; color: var(--muted); font-size: 9px; }
.modal-head .icon-btn { width: 33px; height: 33px; border: 0; }
.modal-body { padding: 19px 20px; overflow-y: auto; }
.modal-foot { min-height: 65px; padding: 12px 20px; display: flex; align-items: center; justify-content: flex-end; gap: 8px; border-top: 1px solid var(--line); background: #fbfcfb; }
.form-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 14px; }
.form-grid.three { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.form-field { display: flex; flex-direction: column; gap: 6px; min-width: 0; }
.form-field.full { grid-column: 1 / -1; }
.form-field label { color: #435149; font-size: 10px; font-weight: 700; }
.form-field label em { color: var(--red); font-style: normal; }
.form-field small { color: var(--muted); font-size: 8px; }
.form-field input, .form-field select, .form-field textarea { font-size: 11px; }
.check-field { min-height: 43px; display: flex; align-items: center; gap: 9px; border: 1px solid var(--line); border-radius: 10px; padding: 8px 11px; }
.check-field input { width: 15px; height: 15px; min-height: 0; }
.check-field span { font-size: 10px; }
.form-section { margin: 3px 0 14px; padding-bottom: 7px; border-bottom: 1px solid var(--line); font-size: 11px; }
.line-builder { border: 1px solid var(--line); border-radius: 11px; overflow: hidden; }
.line-builder-head, .line-builder-row { display: grid; grid-template-columns: minmax(180px, 1fr) 85px 115px 90px 32px; gap: 8px; align-items: center; padding: 8px; }
.line-builder-head { background: #f7f9f8; color: var(--muted); font-size: 8px; font-weight: 700; text-transform: uppercase; }
.line-builder-row { border-top: 1px solid var(--line); }
.line-builder-row input, .line-builder-row select { min-height: 36px; height: 36px; font-size: 10px; }
.line-builder-row .line-total { text-align: right; font-size: 10px; font-weight: 700; }
.line-builder-row .icon-btn { width: 30px; height: 30px; border: 0; color: var(--red); }
.builder-foot { display: flex; justify-content: space-between; align-items: center; margin-top: 10px; }
.builder-total { text-align: right; }
.builder-total span { display: block; color: var(--muted); font-size: 9px; }
.builder-total strong { font-size: 16px; }
.payment-options { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; margin-bottom: 16px; }
.payment-option { min-height: 60px; border: 1px solid var(--line); border-radius: 10px; background: white; display: flex; align-items: center; gap: 9px; padding: 9px; cursor: pointer; text-align: left; }
.payment-option i { width: 29px; height: 29px; display: grid; place-items: center; border-radius: 8px; background: #f1f4f2; color: var(--primary); }
.payment-option strong { display: block; font-size: 9px; }
.payment-option span { display: block; color: var(--muted); font-size: 7px; }
.payment-option.active { border-color: var(--primary); background: var(--primary-soft); box-shadow: inset 0 0 0 1px var(--primary); }
.payment-entry { display: grid; grid-template-columns: 1fr 1fr 36px; gap: 8px; margin-bottom: 8px; align-items: center; }
.payment-entry input, .payment-entry select { min-height: 39px; height: 39px; font-size: 10px; }
.payment-entry .icon-btn { width: 34px; height: 34px; border: 0; color: var(--red); }
.checkout-total { display: flex; justify-content: space-between; align-items: center; border-radius: 12px; background: var(--primary); color: white; padding: 16px 18px; margin-bottom: 16px; }
.checkout-total span { color: rgba(255,255,255,.65); font-size: 10px; }
.checkout-total strong { font-size: 22px; }
.checkout-balance { display: grid; grid-template-columns: repeat(3, 1fr); gap: 9px; margin-top: 14px; }
.checkout-balance div { border-radius: 9px; background: #f5f7f6; padding: 10px; }
.checkout-balance span { display: block; color: var(--muted); font-size: 8px; }
.checkout-balance strong { font-size: 11px; }
.checkout-balance .due strong { color: var(--red); }

/* People, reports, details */
.people-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 12px; }
.person-card { padding: 16px; }
.person-top { display: flex; align-items: center; gap: 10px; margin-bottom: 13px; }
.person-top .avatar { width: 39px; height: 39px; background: var(--primary-soft); color: var(--primary); }
.person-top strong { display: block; font-size: 11px; }
.person-top span { color: var(--muted); font-size: 9px; }
.person-info { display: grid; gap: 7px; border-top: 1px solid #edf0ee; padding-top: 11px; }
.person-info div { display: flex; align-items: center; gap: 7px; color: var(--muted); font-size: 9px; min-width: 0; }
.person-info svg { width: 13px; height: 13px; flex: none; }
.person-info span { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.person-balance { display: flex; justify-content: space-between; align-items: center; margin-top: 12px; padding-top: 10px; border-top: 1px solid #edf0ee; font-size: 9px; color: var(--muted); }
.person-balance strong { color: var(--ink); font-size: 11px; }
.report-filter { display: flex; align-items: flex-end; gap: 9px; }
.report-filter .form-field { width: 145px; }
.report-filter input { min-height: 39px; height: 39px; }
.report-grid { display: grid; grid-template-columns: 1.25fr .75fr; gap: 16px; margin-top: 16px; }
.operations-grid { grid-template-columns: 1fr 1fr; }
.operations-grid .card { min-width: 0; }
.compact-input { width: 86px; min-height: 34px; padding: 6px 9px; }
.stock-count-table { max-height: 52vh; }
.rank-list { padding: 6px 17px 13px; }
.rank-row { display: grid; grid-template-columns: 25px minmax(0, 1fr) auto; gap: 10px; align-items: center; padding: 11px 0; border-bottom: 1px solid #eef1ef; }
.rank-row:last-child { border-bottom: 0; }
.rank-number { width: 22px; height: 22px; border-radius: 7px; display: grid; place-items: center; background: #f0f3f1; color: var(--muted); font-size: 8px; font-weight: 800; }
.rank-row strong { display: block; font-size: 10px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.rank-row span { color: var(--muted); font-size: 8px; }
.rank-row > strong { font-size: 10px; }
.donut-wrap { display: flex; align-items: center; justify-content: center; gap: 27px; min-height: 210px; }
.donut { width: 130px; height: 130px; border-radius: 50%; position: relative; display: grid; place-items: center; background: conic-gradient(var(--primary) 0 45%, var(--lime) 45% 67%, var(--amber) 67% 82%, #6b92d8 82% 94%, #d7ddda 94%); }
.donut::after { content: ""; position: absolute; width: 78px; height: 78px; border-radius: 50%; background: white; }
.donut-center { z-index: 1; text-align: center; }
.donut-center strong { display: block; font-size: 13px; }
.donut-center span { color: var(--muted); font-size: 8px; }
.legend { display: grid; gap: 8px; }
.legend-row { display: grid; grid-template-columns: 7px minmax(80px, 1fr) auto; gap: 7px; align-items: center; font-size: 8px; }
.legend-row i { width: 7px; height: 7px; border-radius: 50%; }
.legend-row span { color: var(--muted); }
.detail-meta { display: grid; grid-template-columns: repeat(4, 1fr); gap: 10px; margin-bottom: 17px; }
.detail-meta div { border-radius: 10px; background: #f6f8f7; padding: 10px; }
.detail-meta span { display: block; color: var(--muted); font-size: 8px; }
.detail-meta strong { display: block; margin-top: 3px; font-size: 10px; }
.document-total { width: min(310px, 100%); margin: 14px 0 0 auto; }
.document-total .summary-row { font-size: 10px; }
.document-total .summary-row.total { font-size: 14px; }
.balance-callout { display: flex; align-items: center; justify-content: space-between; gap: 15px; margin-top: 16px; padding: 13px 15px; border-radius: 11px; background: var(--amber-soft); color: #985c14; }
.balance-callout strong { display: block; font-size: 11px; }
.balance-callout span { font-size: 9px; }
.settings-layout { display: grid; grid-template-columns: 210px minmax(0, 1fr); gap: 16px; }
.settings-nav { padding: 8px; height: fit-content; }
.settings-nav button { width: 100%; height: 40px; display: flex; align-items: center; gap: 9px; border: 0; border-radius: 8px; background: transparent; color: var(--muted); padding: 0 10px; font-size: 10px; cursor: pointer; }
.settings-nav button.active { background: var(--primary-soft); color: var(--primary); font-weight: 700; }
.gateway-card { display: flex; justify-content: space-between; align-items: center; gap: 20px; border: 1px solid var(--line); border-radius: 11px; padding: 14px; }
.gateway-brand { display: flex; align-items: center; gap: 11px; }
.gateway-logo { width: 39px; height: 39px; border-radius: 9px; display: grid; place-items: center; background: #7e3ff2; color: white; font-size: 10px; font-weight: 800; }
.gateway-brand strong { display: block; font-size: 10px; }
.gateway-brand span { color: var(--muted); font-size: 8px; }
.team-card { margin-top: 16px; }
.team-card .avatar { background: var(--primary-soft); color: var(--primary); }
.security-callout { display: flex; align-items: center; gap: 12px; border: 1px solid #dbe9e4; border-radius: 11px; background: var(--primary-soft); padding: 13px; margin-bottom: 17px; color: var(--primary); }
.security-callout > i { width: 34px; height: 34px; display: grid; place-items: center; border-radius: 9px; background: white; flex: none; }
.security-callout strong, .security-callout span { display: block; }
.security-callout strong { font-size: 10px; }
.security-callout span { color: var(--muted); font-size: 8px; margin-top: 2px; }
.password-strength { height: 5px; overflow: hidden; border-radius: 5px; background: #e6ebe8; }
.password-strength span { display: block; width: 0; height: 100%; border-radius: inherit; background: linear-gradient(90deg, var(--amber), var(--lime), var(--primary-2)); transition: width .2s; }
.admin-confirm { margin-top: 5px; border-radius: 11px; background: #f7f9f8; padding: 12px; }
.storage-status { display: flex; align-items: center; gap: 13px; }
.storage-status > i { width: 40px; height: 40px; display: grid; place-items: center; border-radius: 10px; background: var(--primary-soft); color: var(--primary); }
.storage-status > div { flex: 1; }
.storage-status strong, .storage-status span { display: block; }
.storage-status strong { font-size: 11px; }
.storage-status span { color: var(--muted); font-size: 9px; margin-top: 2px; }
.storage-status code { border-radius: 7px; background: #f1f4f2; padding: 5px 8px; color: var(--muted); font-size: 9px; }
.backup-status { display: flex; align-items: center; justify-content: space-between; gap: 18px; margin-top: 14px; padding-top: 13px; border-top: 1px solid var(--line); }
.backup-status strong, .backup-status span { display: block; }
.backup-status strong { font-size: 10px; }
.backup-status span { color: var(--muted); font-size: 8px; margin-top: 2px; }
.readiness-summary { padding: 6px 9px; border-radius: 999px; font-size: 9px; font-weight: 800; }
.readiness-summary.ready { background: var(--primary-soft); color: var(--primary-2); }
.readiness-summary.pending { background: var(--amber-soft); color: #945b16; }
.readiness-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; padding: 15px 18px 18px; }
.readiness-item { display: flex; gap: 10px; align-items: flex-start; border: 1px solid var(--line); border-radius: 10px; padding: 11px; }
.readiness-item > i { width: 25px; height: 25px; border-radius: 7px; display: grid; place-items: center; flex: none; }
.readiness-item > i svg { width: 14px; height: 14px; }
.readiness-item.passed > i { background: var(--primary-soft); color: var(--primary-2); }
.readiness-item.missing > i { background: var(--amber-soft); color: #945b16; }
.readiness-item strong, .readiness-item span { display: block; }
.readiness-item strong { font-size: 9px; }
.readiness-item span { color: var(--muted); font-size: 8px; line-height: 1.45; margin-top: 2px; }
.branch-settings { padding: 14px 18px; border-bottom: 1px solid var(--line); }
.branch-settings .form-field { max-width: 520px; }
.inline-setting { display: flex; align-items: center; gap: 9px; }
.inline-setting select { flex: 1; }

/* Command, toast, loading */
.command-backdrop { position: fixed; inset: 0; z-index: 120; display: flex; justify-content: center; align-items: flex-start; padding-top: 13vh; background: rgba(8,26,21,.5); backdrop-filter: blur(3px); }
.command { width: min(620px, calc(100% - 30px)); border-radius: 15px; background: white; box-shadow: var(--shadow-lg); overflow: hidden; }
.command-input { height: 61px; display: flex; align-items: center; gap: 11px; padding: 0 17px; border-bottom: 1px solid var(--line); }
.command-input input { border: 0; box-shadow: none; min-height: 50px; padding: 0; font-size: 13px; }
.command-results { max-height: 390px; overflow: auto; padding: 7px; }
.command-label { padding: 8px 10px 5px; color: var(--muted); font-size: 8px; font-weight: 750; text-transform: uppercase; letter-spacing: .08em; }
.command-row { width: 100%; display: grid; grid-template-columns: 34px minmax(0, 1fr) auto; gap: 10px; align-items: center; min-height: 51px; border: 0; border-radius: 9px; background: white; padding: 7px 10px; text-align: left; cursor: pointer; }
.command-row:hover { background: #f2f6f4; }
.command-row i { width: 31px; height: 31px; display: grid; place-items: center; border-radius: 8px; background: var(--primary-soft); color: var(--primary); }
.command-row strong { display: block; font-size: 10px; }
.command-row span { color: var(--muted); font-size: 8px; }
.command-row > em { color: var(--muted); font-size: 9px; font-style: normal; }
.toast-root { position: fixed; z-index: 200; right: 20px; bottom: 20px; display: flex; flex-direction: column; gap: 8px; pointer-events: none; }
.toast { width: min(355px, calc(100vw - 40px)); display: grid; grid-template-columns: 32px minmax(0, 1fr) 25px; align-items: center; gap: 10px; border: 1px solid var(--line); border-radius: 12px; background: white; box-shadow: 0 12px 35px rgba(13,41,33,.16); padding: 11px; animation: toast-in .25s ease; pointer-events: auto; }
.toast > i { width: 31px; height: 31px; display: grid; place-items: center; border-radius: 9px; background: var(--primary-soft); color: var(--primary); }
.toast.error > i { background: var(--red-soft); color: var(--red); }
.toast strong { display: block; font-size: 10px; }
.toast span { display: block; color: var(--muted); font-size: 8px; margin-top: 1px; }
.toast button { border: 0; background: transparent; color: var(--faint); cursor: pointer; }
.skeleton { position: relative; overflow: hidden; background: #e9eeeb; border-radius: 8px; }
.skeleton::after { content: ""; position: absolute; inset: 0; transform: translateX(-100%); background: linear-gradient(90deg, transparent, rgba(255,255,255,.7), transparent); animation: shimmer 1.25s infinite; }
.page-loading { display: grid; grid-template-columns: repeat(4, 1fr); gap: 14px; }
.page-loading div { height: 128px; }

/* Receipt */
.receipt { color: #131b18; background: white; }
.receipt-brand { text-align: center; border-bottom: 1px dashed #bac3bf; padding-bottom: 14px; margin-bottom: 14px; }
.receipt-brand h2 { margin: 0; font-size: 18px; }
.receipt-brand p { margin: 3px 0; color: #5f6c66; font-size: 9px; }
.receipt-heading { display: flex; align-items: flex-end; justify-content: space-between; margin-bottom: 14px; }
.receipt-heading h3 { margin: 0; font-size: 16px; }
.receipt-heading span { font-size: 9px; color: #5f6c66; }
.receipt table { width: 100%; border-collapse: collapse; font-size: 9px; }
.receipt th, .receipt td { padding: 7px 5px; border-bottom: 1px solid #e3e7e5; text-align: left; }
.receipt th:last-child, .receipt td:last-child { text-align: right; }
.receipt-footer { margin-top: 18px; text-align: center; color: #65716c; font-size: 9px; }
.receipt-payments { margin-top: 15px; padding-top: 10px; border-top: 1px dashed #bac3bf; font-size: 9px; }
.receipt-payments > strong { display: block; margin-bottom: 5px; }
.receipt-payments > div { display: flex; justify-content: space-between; align-items: flex-start; gap: 12px; padding: 3px 0; color: #5f6c66; }
.receipt-payments > div span { line-height: 1.35; }
.receipt-payments > div b { color: #131b18; white-space: nowrap; }

@keyframes fade-in { from { opacity: 0; } }
@keyframes modal-in { from { opacity: 0; transform: translateY(10px) scale(.985); } }
@keyframes toast-in { from { opacity: 0; transform: translateX(15px); } }
@keyframes shimmer { 100% { transform: translateX(100%); } }

@media (max-width: 1180px) {
  .metrics-grid { grid-template-columns: repeat(2, 1fr); }
  .product-grid { grid-template-columns: repeat(2, 1fr); }
  .people-grid { grid-template-columns: repeat(2, 1fr); }
  .quick-actions { grid-template-columns: repeat(2, 1fr); }
}

@media (max-width: 900px) {
  .login-screen { grid-template-columns: 1fr; }
  .login-story { display: none; }
  .login-panel { min-height: 100vh; }
  .mobile-login-brand { display: flex; }
  .sidebar { transform: translateX(-100%); transition: transform .2s ease; box-shadow: 14px 0 40px rgba(8,27,22,.18); }
  .sidebar.open { transform: translateX(0); }
  .sidebar-overlay { position: fixed; z-index: 29; inset: 0; border: 0; background: rgba(8,26,21,.45); }
  .sidebar-overlay.visible { display: block; }
  .workspace { margin-left: 0; }
  .mobile-menu { display: inline-grid; }
  .dashboard-grid, .report-grid, .readiness-grid { grid-template-columns: 1fr; }
  .pos-layout { grid-template-columns: 1fr; }
  .pos-cart { position: static; }
  .settings-layout { grid-template-columns: 1fr; }
  .settings-nav { display: flex; overflow-x: auto; }
  .settings-nav button { width: auto; white-space: nowrap; }
}

@media (max-width: 680px) {
  .login-panel { padding: 30px 22px; }
  .topbar { height: 70px; padding: 0 15px; }
  .topbar p, .global-search, .topbar-actions .notification { display: none; }
  .topbar h1 { font-size: 16px; }
  .topbar-actions .button { padding: 8px 10px; }
  .topbar-actions .button span { display: none; }
  .branch-switch { max-width: 145px; }
  .branch-switch select { max-width: 105px; }
  .page-content { padding: 17px 14px 35px; }
  .page-head { align-items: flex-start; flex-direction: column; }
  .head-actions { width: 100%; }
  .head-actions .button { flex: 1; }
  .metrics-grid { grid-template-columns: 1fr 1fr; gap: 9px; }
  .metric-card { min-height: 115px; padding: 14px; }
  .metric-card h3 { font-size: 18px; }
  .metric-icon { width: 33px; height: 33px; }
  .toolbar { flex-direction: column; }
  .toolbar-left, .toolbar-right, .search-box { width: 100%; }
  .toolbar-left .filter-select { flex: 1; min-width: 0; }
  .product-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .product-tile { min-height: 142px; }
  .people-grid { grid-template-columns: 1fr; }
  .form-grid, .form-grid.three { grid-template-columns: 1fr; }
  .form-field.full { grid-column: auto; }
  .modal-backdrop { padding: 0; align-items: end; }
  .modal, .modal.large, .modal.xlarge { width: 100%; max-height: 94vh; border-radius: 18px 18px 0 0; }
  .line-builder { border: 0; overflow: visible; }
  .line-builder-head { display: none; }
  .line-builder-row { grid-template-columns: 1fr 1fr 31px; border: 1px solid var(--line); border-radius: 10px; margin-bottom: 8px; }
  .line-builder-row select { grid-column: 1 / -1; }
  .line-builder-row .line-total { text-align: left; }
  .payment-options { grid-template-columns: repeat(2, 1fr); }
  .detail-meta { grid-template-columns: repeat(2, 1fr); }
  .report-filter { flex-wrap: wrap; width: 100%; }
  .report-filter .form-field { flex: 1; min-width: 130px; }
  .report-filter .button { width: 100%; }
  .donut-wrap { flex-direction: column; }
  .page-loading { grid-template-columns: 1fr 1fr; }
}

@media (max-width: 420px) {
  .metrics-grid { grid-template-columns: 1fr; }
  .product-grid { grid-template-columns: 1fr 1fr; gap: 7px; }
  .quick-actions { grid-template-columns: 1fr; }
  .payment-entry { grid-template-columns: 1fr 1fr 30px; }
}

@media print {
  body > *:not(#print-root) { display: none !important; }
  #print-root { display: block !important; }
  #print-root .receipt { width: 80mm; margin: 0 auto; padding: 4mm; }
  @page { size: 80mm auto; margin: 0; }
}
