/* Sekar Tirta POS */
:root {
	--st-teal: #0b7f86;
	--st-teal-d: #086a70;
	--st-blue: #2e86b0;
	--st-sea: #0a8a7f;
	--st-sand: #c4a98b;
	--st-sand-l: #f4ede4;
	--st-bg: #f6f4f0;
	--st-card: #ffffff;
	--st-ink: #1f2a2e;
	--st-ink-2: #55636a;
	--st-muted: #8a969b;
	--st-line: #e4e0d9;
	--st-good: #1f8a4c;
	--st-warn: #b7791f;
	--st-bad: #c0392b;
	--st-radius: 12px;
	--st-grad: linear-gradient(90deg, #2e86b0, #0b7f86 55%, #0a8a7f);
}

.stpos-body { margin: 0; background: var(--st-bg); }
#stpos-app, .stpos-login, .stpos-modal { font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif; color: var(--st-ink); font-size: 15px; line-height: 1.45; }
#stpos-app *, .stpos-login *, .stpos-modal * { box-sizing: border-box; }
.stpos-loading { padding: 60px; text-align: center; color: var(--st-muted); }

/* ---------- login ---------- */
.stpos-login { min-height: 100vh; display: flex; align-items: center; justify-content: center; padding: 24px; background: var(--st-bg); }
.stpos-login-card { width: 100%; max-width: 380px; background: #fff; border-radius: 16px; padding: 32px 28px; box-shadow: 0 10px 40px rgba(11, 127, 134, .12); border-top: 5px solid var(--st-teal); }
.stpos-login-logo { display: block; width: 200px; max-width: 70%; margin: 0 auto 12px; }
.stpos-login h1 { font-size: 18px; text-align: center; margin: 0 0 18px; color: var(--st-ink-2); font-weight: 600; }
.stpos-login p { margin: 0 0 14px; }
.stpos-login label { display: block; font-size: 13px; color: var(--st-ink-2); margin-bottom: 4px; }
.stpos-login input[type=text], .stpos-login input[type=password] { width: 100%; padding: 11px 12px; border: 1px solid var(--st-line); border-radius: 10px; font-size: 15px; }
.stpos-login .login-remember label { display: inline; }
.stpos-login input[type=submit] { width: 100%; padding: 12px; background: var(--st-teal); color: #fff; border: 0; border-radius: 10px; font-size: 15px; font-weight: 600; cursor: pointer; }
.stpos-login input[type=submit]:hover { background: var(--st-teal-d); }

/* ---------- layout ---------- */
.st-shell { display: flex; min-height: 100vh; }
.st-side { width: 230px; flex: 0 0 230px; background: #fff; border-right: 1px solid var(--st-line); display: flex; flex-direction: column; position: sticky; top: 0; height: 100vh; }
.st-side-logo { padding: 18px 20px 10px; }
.st-side-logo img { width: 150px; display: block; }
.st-nav { padding: 8px 10px; flex: 1; }
.st-nav button { display: flex; align-items: center; gap: 10px; width: 100%; text-align: left; padding: 10px 12px; margin: 2px 0; border: 0; background: none; border-radius: 10px; font-size: 15px; color: var(--st-ink-2); cursor: pointer; }
.st-nav button:hover { background: var(--st-bg); }
.st-nav button.on { background: var(--st-teal); color: #fff; font-weight: 600; }
.st-nav .st-ic { width: 20px; text-align: center; }
.st-nav-sep { font-size: 11px; text-transform: uppercase; letter-spacing: .08em; color: var(--st-muted); padding: 14px 12px 4px; }
.st-user { padding: 14px 20px; border-top: 1px solid var(--st-line); font-size: 13px; color: var(--st-ink-2); }
.st-user a { color: var(--st-bad); text-decoration: none; }
.st-main { flex: 1; min-width: 0; padding: 24px 28px 80px; }
.st-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-bottom: 18px; flex-wrap: wrap; }
.st-head h2 { margin: 0; font-size: 22px; }
.st-topbar { display: none; }

@media (max-width: 820px) {
	.st-shell { display: block; }
	.st-side { display: none; }
	.st-topbar { display: flex; align-items: center; justify-content: space-between; background: #fff; padding: 10px 14px; border-bottom: 1px solid var(--st-line); position: sticky; top: 0; z-index: 20; }
	.st-topbar img { height: 34px; }
	.st-topbar a { font-size: 13px; color: var(--st-bad); text-decoration: none; }
	.st-tabs { display: flex; overflow-x: auto; gap: 6px; padding: 8px 10px; background: #fff; border-bottom: 1px solid var(--st-line); position: sticky; top: 55px; z-index: 19; }
	.st-tabs button { flex: 0 0 auto; padding: 8px 12px; border-radius: 999px; border: 1px solid var(--st-line); background: #fff; font-size: 14px; color: var(--st-ink-2); }
	.st-tabs button.on { background: var(--st-teal); border-color: var(--st-teal); color: #fff; }
	.st-main { padding: 16px 14px 120px; }
}
@media (min-width: 821px) { .st-tabs { display: none; } }

/* ---------- elements ---------- */
.st-card { background: var(--st-card); border-radius: var(--st-radius); border: 1px solid var(--st-line); padding: 18px; margin-bottom: 18px; }
.st-card h3 { margin: 0 0 12px; font-size: 16px; }
.st-grid2 { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.st-grid3 { display: grid; grid-template-columns: repeat(3, 1fr); gap: 12px; }
@media (max-width: 640px) { .st-grid2, .st-grid3 { grid-template-columns: 1fr; } }
.st-field { margin-bottom: 12px; }
.st-field label { display: block; font-size: 13px; color: var(--st-ink-2); margin-bottom: 4px; font-weight: 500; }
.st-field input, .st-field select, .st-field textarea, .st-input { width: 100%; padding: 10px 12px; border: 1px solid var(--st-line); border-radius: 10px; font-size: 15px; background: #fff; color: var(--st-ink); font-family: inherit; }
.st-field textarea { min-height: 70px; resize: vertical; }
.st-field input:focus, .st-field select:focus, .st-field textarea:focus, .st-input:focus { outline: 2px solid rgba(11, 127, 134, .35); border-color: var(--st-teal); }
.st-check { display: flex; align-items: center; gap: 8px; font-size: 14px; cursor: pointer; }
.st-check input { width: 18px; height: 18px; accent-color: var(--st-teal); }

.st-btn { display: inline-flex; align-items: center; justify-content: center; gap: 6px; padding: 10px 16px; border-radius: 10px; border: 1px solid var(--st-line); background: #fff; color: var(--st-ink); font-size: 14px; font-weight: 600; cursor: pointer; text-decoration: none; white-space: nowrap; font-family: inherit; }
.st-btn:hover { border-color: var(--st-teal); color: var(--st-teal); }
.st-btn.pri { background: var(--st-teal); border-color: var(--st-teal); color: #fff; }
.st-btn.pri:hover { background: var(--st-teal-d); color: #fff; }
.st-btn.sand { background: var(--st-sand); border-color: var(--st-sand); color: #fff; }
.st-btn.danger { color: var(--st-bad); }
.st-btn.danger:hover { border-color: var(--st-bad); background: #fdf1ef; }
.st-btn.sm { padding: 6px 10px; font-size: 13px; border-radius: 8px; }
.st-btn.block { width: 100%; padding: 14px; font-size: 16px; }
.st-btn[disabled] { opacity: .5; cursor: not-allowed; }
.st-row { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; }

.st-table-wrap { overflow-x: auto; }
.st-table { width: 100%; border-collapse: collapse; font-size: 14px; }
.st-table th { text-align: left; font-weight: 600; color: var(--st-ink-2); font-size: 12px; text-transform: uppercase; letter-spacing: .04em; padding: 8px 10px; border-bottom: 1px solid var(--st-line); white-space: nowrap; }
.st-table td { padding: 10px; border-bottom: 1px solid var(--st-line); vertical-align: middle; }
.st-table tr:last-child td { border-bottom: 0; }
.st-table .num { text-align: right; font-variant-numeric: tabular-nums; white-space: nowrap; }
.st-table tr.click { cursor: pointer; }
.st-table tr.click:hover td { background: #faf8f5; }
.st-table tr.inactive td { color: var(--st-muted); }

.st-badge { display: inline-flex; align-items: center; gap: 4px; padding: 2px 8px; border-radius: 999px; font-size: 12px; font-weight: 600; white-space: nowrap; }
.st-badge.good { background: #e6f4ec; color: var(--st-good); }
.st-badge.warn { background: #fbf1e1; color: var(--st-warn); }
.st-badge.bad { background: #fbe9e7; color: var(--st-bad); }
.st-badge.mute { background: #eef0f1; color: var(--st-ink-2); }

.st-empty { padding: 30px; text-align: center; color: var(--st-muted); }
.st-muted { color: var(--st-muted); font-size: 13px; }

/* ---------- sales ---------- */
.st-sale { display: grid; grid-template-columns: 1fr 360px; gap: 18px; align-items: start; }
@media (max-width: 1080px) { .st-sale { grid-template-columns: 1fr; } }
.st-products { display: grid; grid-template-columns: repeat(auto-fill, minmax(210px, 1fr)); gap: 12px; }
.st-prod { background: #fff; border: 1px solid var(--st-line); border-radius: var(--st-radius); padding: 14px; display: flex; flex-direction: column; gap: 6px; transition: border-color .15s, box-shadow .15s; }
.st-prod.sel { border-color: var(--st-teal); box-shadow: 0 0 0 2px rgba(11, 127, 134, .18); }
.st-prod.out { opacity: .55; }
.st-prod-name { font-weight: 700; font-size: 15px; }
.st-prod-var { color: var(--st-ink-2); font-size: 13px; }
.st-prod-price { color: var(--st-teal); font-weight: 700; }
.st-prod-stock { font-size: 12px; }
.st-qty { display: flex; align-items: center; gap: 6px; margin-top: 4px; }
.st-qty button { width: 38px; height: 38px; border-radius: 10px; border: 1px solid var(--st-line); background: #fff; font-size: 20px; line-height: 1; cursor: pointer; color: var(--st-teal); font-weight: 700; }
.st-qty button:hover { border-color: var(--st-teal); }
.st-qty input { width: 56px; height: 38px; text-align: center; border: 1px solid var(--st-line); border-radius: 10px; font-size: 16px; font-weight: 600; }
.st-summary { position: sticky; top: 16px; }
.st-sum-line { display: flex; justify-content: space-between; padding: 4px 0; font-size: 14px; gap: 10px; }
.st-sum-line span:last-child { font-variant-numeric: tabular-nums; white-space: nowrap; }
.st-sum-total { display: flex; justify-content: space-between; padding: 12px 0 4px; margin-top: 6px; border-top: 2px solid var(--st-ink); font-size: 20px; font-weight: 800; }
.st-cart-items { margin: 0 0 8px; padding: 0; list-style: none; font-size: 14px; }
.st-cart-items li { display: flex; justify-content: space-between; gap: 8px; padding: 4px 0; border-bottom: 1px dashed var(--st-line); }

/* ---------- KPIs + chart ---------- */
.st-kpis { display: grid; grid-template-columns: repeat(4, 1fr); gap: 12px; margin-bottom: 18px; }
@media (max-width: 900px) { .st-kpis { grid-template-columns: repeat(2, 1fr); } }
.st-kpi { background: #fff; border: 1px solid var(--st-line); border-radius: var(--st-radius); padding: 14px 16px; }
.st-kpi-label { font-size: 12px; color: var(--st-ink-2); text-transform: uppercase; letter-spacing: .04em; }
.st-kpi-val { font-size: 22px; font-weight: 800; margin-top: 4px; font-variant-numeric: tabular-nums; }
.st-kpi-sub { font-size: 12px; color: var(--st-muted); margin-top: 2px; }
.st-chart { position: relative; }
.st-chart svg { display: block; width: 100%; height: auto; }
.st-chart .grid { stroke: #ece9e3; stroke-width: 1; }
.st-chart .axis-t { fill: var(--st-muted); font-size: 11px; }
.st-chart .bar { fill: var(--st-teal); }
.st-chart .hit { fill: transparent; cursor: default; }
.st-chart .hit:hover + .bar, .st-chart .bar.hl { fill: var(--st-teal-d); }
.st-tip { position: absolute; pointer-events: none; background: var(--st-ink); color: #fff; font-size: 12px; padding: 6px 9px; border-radius: 8px; white-space: nowrap; transform: translate(-50%, -110%); display: none; z-index: 5; }
.st-presets { display: flex; gap: 6px; flex-wrap: wrap; }
.st-presets button.on { background: var(--st-teal); color: #fff; border-color: var(--st-teal); }
.st-bar-mini { height: 6px; background: #ece9e3; border-radius: 3px; overflow: hidden; min-width: 60px; }
.st-bar-mini span { display: block; height: 100%; background: var(--st-teal); border-radius: 3px; }

/* ---------- modal ---------- */
.stpos-modal { position: fixed; inset: 0; background: rgba(20, 30, 34, .55); display: flex; align-items: flex-start; justify-content: center; z-index: 9999; overflow-y: auto; padding: 24px 12px; }
.st-modal-box { background: #fff; border-radius: 16px; width: 100%; max-width: 720px; padding: 20px; position: relative; }
.st-modal-box.sm { max-width: 440px; }
.st-modal-head { display: flex; justify-content: space-between; align-items: center; margin-bottom: 14px; gap: 10px; }
.st-modal-head h3 { margin: 0; font-size: 18px; }
.st-x { border: 0; background: none; font-size: 26px; line-height: 1; cursor: pointer; color: var(--st-muted); }
.st-inv-preview { background: #eceae6; border-radius: 10px; padding: 10px; margin-bottom: 14px; text-align: center; }
.st-inv-preview img { max-width: 100%; box-shadow: 0 2px 12px rgba(0, 0, 0, .12); background: #fff; }
.st-actions { display: flex; gap: 8px; flex-wrap: wrap; }

.st-toast { position: fixed; left: 50%; bottom: 24px; transform: translateX(-50%); background: var(--st-ink); color: #fff; padding: 12px 18px; border-radius: 12px; z-index: 10000; font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Arial, sans-serif; font-size: 14px; box-shadow: 0 8px 24px rgba(0, 0, 0, .2); max-width: 90vw; }
.st-toast.err { background: var(--st-bad); }
.st-toast.ok { background: var(--st-good); }
@media (max-width: 520px) {
	.st-products { grid-template-columns: 1fr 1fr; gap: 8px; }
	.st-prod { padding: 10px; }
	.st-qty button { width: 34px; height: 34px; }
	.st-qty input { width: 44px; height: 34px; }
}

/* v1.1: customer lookup, invoice status row */
.st-ac-wrap { position: relative; }
.st-ac { display: none; position: absolute; left: 0; right: 0; top: 100%; margin-top: 4px; background: #fff; border: 1px solid var(--st-line); border-radius: 10px; box-shadow: 0 8px 24px rgba(0, 0, 0, .12); z-index: 30; overflow: hidden; }
.st-ac button { display: block; width: 100%; text-align: left; border: 0; background: #fff; padding: 9px 12px; cursor: pointer; font-family: inherit; font-size: 14px; border-bottom: 1px solid var(--st-line); }
.st-ac button:last-child { border-bottom: 0; }
.st-ac button:hover { background: var(--st-bg); }
.st-ac button span { display: block; font-size: 12px; color: var(--st-muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.st-inv-status { margin-top: 12px; padding-top: 12px; border-top: 1px solid var(--st-line); align-items: center; }
.st-inv-status .danger { margin-left: auto; }
.st-wa { color: var(--st-sea); font-weight: 600; text-decoration: none; }
.st-wa:hover { text-decoration: underline; }
