/* =====================================================================
   NicaSan Shop — sistem tampilan
   Tema terang dengan rel gelap. Semua nama kelas dipertahankan sama
   seperti sebelumnya supaya JavaScript dan rangkaian uji tidak perlu diubah.
   ===================================================================== */

:root {
  /* --- permukaan & latar --- */
  --bg: #f2f5f3;
  --bg-deep: #e8edea;
  --surface: #ffffff;
  --surface-2: #f7faf8;
  --surface-3: #eef3f0;
  --border: #e3eae6;
  --border-strong: #cfd9d4;

  /* --- teks --- */
  --text: #12201b;
  --text-2: #4f5f58;
  --text-3: #85938c;

  /* --- merek --- */
  --primary: #0f6e56;
  --primary-600: #0d5f4a;
  --primary-700: #0a4c3c;
  --primary-900: #07352a;
  --primary-soft: #e0f2ec;
  --primary-ring: rgba(15, 110, 86, .18);

  /* --- rel samping --- */
  --rail-1: #0b3d30;
  --rail-2: #07352a;
  --rail-line: rgba(255, 255, 255, .10);
  --rail-text: rgba(255, 255, 255, .74);
  --rail-text-strong: #ffffff;

  /* --- aksen status --- */
  --blue: #185fa5;
  --blue-soft: #e6f1fb;
  --amber: #9a6212;
  --amber-soft: #fdf3e2;
  --red: #a32d2d;
  --red-soft: #fceceb;
  --violet: #534ab7;
  --violet-soft: #eeedfe;

  /* --- bentuk & bayangan --- */
  --radius: 12px;
  --radius-lg: 16px;
  --radius-xl: 22px;
  --shadow-xs: 0 1px 2px rgba(9, 32, 25, .05);
  --shadow: 0 1px 2px rgba(9, 32, 25, .05), 0 8px 24px -12px rgba(9, 32, 25, .18);
  --shadow-lg: 0 24px 60px -20px rgba(9, 32, 25, .35);

  --mono: ui-monospace, SFMono-Regular, "SF Mono", Menlo, Consolas, monospace;
  --sidebar-w: 244px;
}

* { box-sizing: border-box; }

html, body { height: 100%; }

body {
  margin: 0;
  background:
    radial-gradient(900px 420px at 12% -8%, #e6f2ec 0%, rgba(230, 242, 236, 0) 62%),
    var(--bg);
  background-attachment: fixed;
  color: var(--text);
  font: 14px/1.55 -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}

h1, h2, h3, h4 { margin: 0; font-weight: 650; letter-spacing: -.015em; }
h1 { font-size: 21px; }
h2 { font-size: 19px; }
h3 { font-size: 15px; }
h4 { font-size: 13px; }
p { margin: 0 0 8px; }
a { color: var(--primary); }
code {
  font-family: var(--mono); font-size: 12px; background: var(--surface-3);
  padding: 2px 6px; border-radius: 6px; color: var(--text-2);
}
.muted { color: var(--text-3); font-size: 12.5px; }
.mono { font-family: var(--mono); }
.right { text-align: right; }
.center { text-align: center; }
.nowrap { white-space: nowrap; }
[hidden] { display: none !important; }

/* ------------------------------------------------------------- boot */
.boot {
  position: absolute; inset: 0; display: grid; place-content: center;
  justify-items: center; gap: 14px; text-align: center; color: var(--text-3);
}
.boot-logo {
  padding: 13px 22px; border-radius: var(--radius-xl);
  background: linear-gradient(140deg, var(--primary) 0%, var(--primary-900) 100%);
  box-shadow: 0 18px 40px -18px rgba(7, 53, 42, .7);
  animation: boot-pulse 1.8s ease-in-out infinite;
}
.boot-mark {
  font-size: 24px; font-weight: 700; letter-spacing: -.04em; color: #fff;
}
@keyframes boot-pulse {
  0%, 100% { transform: translateY(0); opacity: 1; }
  50% { transform: translateY(-4px); opacity: .82; }
}

/* ------------------------------------------------------------- login */
.login {
  position: relative; min-height: 100vh; display: grid; place-items: center;
  padding: 24px; overflow: hidden;
}
.login-glow {
  position: absolute; inset: -20% -10% auto -10%; height: 70%;
  background:
    radial-gradient(520px 320px at 22% 30%, rgba(15, 110, 86, .22) 0%, rgba(15, 110, 86, 0) 70%),
    radial-gradient(420px 300px at 82% 12%, rgba(154, 98, 18, .14) 0%, rgba(154, 98, 18, 0) 70%);
  pointer-events: none;
}
.login-card {
  position: relative; width: 100%; max-width: 412px;
  background: var(--surface); border: 1px solid var(--border);
  border-radius: var(--radius-xl); padding: 0 28px 26px;
  box-shadow: var(--shadow-lg); overflow: hidden;
}
.login-art {
  margin: 0 -28px 22px; padding: 13px 28px;
  display: flex; align-items: center; gap: 9px;
  background: linear-gradient(120deg, var(--primary-900) 0%, var(--primary) 100%);
  color: rgba(255, 255, 255, .92); font-size: 12px; letter-spacing: .01em;
}
.login-art .ico { width: 15px; height: 15px; opacity: .9; }
.login-brand { display: flex; gap: 13px; align-items: center; margin-bottom: 22px; }
.login-brand h1 { font-size: 18px; }
.login-brand p { margin: 3px 0 0; }
.login-logo {
  width: 46px; height: 46px; border-radius: 14px;
  background: linear-gradient(140deg, var(--primary) 0%, var(--primary-900) 100%);
  color: #fff; display: grid; place-items: center; font-weight: 700;
  font-size: 21px; flex: none; box-shadow: 0 10px 24px -12px rgba(7, 53, 42, .8);
}
.login-hint {
  margin: 18px 0 0; padding-top: 14px; border-top: 1px dashed var(--border);
  font-size: 11.5px; color: var(--text-3); line-height: 1.7;
}

/* ------------------------------------------------------------- kerangka */
.app { display: grid; grid-template-columns: var(--sidebar-w) minmax(0, 1fr); min-height: 100vh; }

.sidebar {
  position: sticky; top: 0; height: 100vh;
  background: linear-gradient(180deg, var(--rail-1) 0%, var(--rail-2) 100%);
  display: flex; flex-direction: column; color: var(--rail-text);
}
.sidebar-head { padding: 18px 16px 14px; display: flex; align-items: center; justify-content: space-between; }
.brand { display: flex; gap: 11px; align-items: center; min-width: 0; }
.brand-logo {
  width: 38px; height: 38px; border-radius: 12px; flex: none;
  background: rgba(255, 255, 255, .12);
  border: 1px solid rgba(255, 255, 255, .18);
  color: #fff; display: grid; place-items: center; font-weight: 700; font-size: 16px;
}
.brand-text { display: flex; flex-direction: column; min-width: 0; }
.brand-text strong {
  font-size: 14px; color: var(--rail-text-strong); letter-spacing: -.01em;
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.brand-text span { font-size: 11.5px; color: rgba(255, 255, 255, .55); }

.nav { flex: 1; overflow-y: auto; padding: 4px 12px 16px; }
.nav-group {
  margin: 16px 0 6px; padding: 0 10px; font-size: 10px; font-weight: 700;
  letter-spacing: .1em; text-transform: uppercase; color: rgba(255, 255, 255, .42);
}
.nav-group:first-child { margin-top: 4px; }
.nav-item {
  position: relative; display: flex; align-items: center; gap: 11px; width: 100%;
  padding: 9px 11px; margin-bottom: 2px; border: 0; border-radius: 10px;
  background: transparent; color: var(--rail-text); font: inherit; font-size: 13.5px;
  cursor: pointer; text-align: left; transition: background .14s, color .14s;
}
.nav-item:hover { background: rgba(255, 255, 255, .07); color: #fff; }
.nav-item.active {
  background: rgba(255, 255, 255, .13); color: #fff; font-weight: 600;
  box-shadow: inset 0 0 0 1px rgba(255, 255, 255, .10);
}
.nav-item.active::before {
  content: ""; position: absolute; left: 0; top: 9px; bottom: 9px;
  width: 3px; border-radius: 0 3px 3px 0; background: #6fd3ae;
}
.nav-item .badge { margin-left: auto; }
.ico { width: 17px; height: 17px; fill: currentColor; flex: none; }

.sidebar-foot { padding: 14px; border-top: 1px solid var(--rail-line); display: grid; gap: 9px; }
.shift-chip {
  font-size: 11.5px; color: rgba(255, 255, 255, .78);
  background: rgba(255, 255, 255, .07); border: 1px solid var(--rail-line);
  border-radius: 10px; padding: 8px 10px; line-height: 1.5;
}
.shift-chip.open {
  background: rgba(111, 211, 174, .16); border-color: rgba(111, 211, 174, .38); color: #d8f5e9;
}
.sidebar .btn-ghost { color: rgba(255, 255, 255, .8); }
.sidebar .btn-ghost:hover { background: rgba(255, 255, 255, .09); color: #fff; }

.main { display: flex; flex-direction: column; min-width: 0; }
.topbar {
  position: sticky; top: 0; z-index: 20; display: flex; align-items: center; gap: 12px;
  padding: 14px 22px; background: rgba(242, 245, 243, .86);
  backdrop-filter: blur(10px); border-bottom: 1px solid var(--border);
}
.topbar-title { min-width: 0; flex: 1; }
.topbar-title h2 { font-size: 18px; }
.topbar-title p { margin: 2px 0 0; }
.topbar-actions { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; justify-content: flex-end; }
.view { padding: 20px 22px 64px; flex: 1; outline: none; }
.scrim { position: fixed; inset: 0; background: rgba(7, 32, 25, .48); z-index: 40; backdrop-filter: blur(2px); }

/* ------------------------------------------------------------- tombol */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 7px;
  padding: 8px 14px; border-radius: 10px; border: 1px solid var(--border-strong);
  background: var(--surface); color: var(--text); font: inherit; font-size: 13.5px;
  font-weight: 550; cursor: pointer; white-space: nowrap;
  box-shadow: var(--shadow-xs); transition: background .14s, border-color .14s, transform .1s, box-shadow .14s;
}
.btn:hover { background: var(--surface-2); border-color: var(--text-3); box-shadow: var(--shadow); }
.btn:active { transform: translateY(1px); }
.btn:focus-visible { outline: 3px solid var(--primary-ring); outline-offset: 1px; }
.btn:disabled { opacity: .5; cursor: not-allowed; box-shadow: none; transform: none; }
.btn-primary {
  background: linear-gradient(150deg, var(--primary) 0%, var(--primary-700) 100%);
  border-color: var(--primary-700); color: #fff;
  box-shadow: 0 6px 16px -8px rgba(7, 53, 42, .8);
}
.btn-primary:hover {
  background: linear-gradient(150deg, var(--primary-600) 0%, var(--primary-900) 100%);
  border-color: var(--primary-900);
  box-shadow: 0 10px 22px -10px rgba(7, 53, 42, .9);
}
.btn-danger { background: var(--red); border-color: var(--red); color: #fff; }
.btn-danger:hover { background: #8c2626; border-color: #8c2626; }
.btn-ghost { background: transparent; border-color: transparent; color: var(--text-2); box-shadow: none; }
.btn-ghost:hover { background: var(--surface-3); color: var(--text); box-shadow: none; }
.btn-sm { padding: 5px 10px; font-size: 12.5px; border-radius: 8px; }
.btn-lg { padding: 12px 20px; font-size: 15px; border-radius: 12px; }
.btn-block { width: 100%; }
.icon-btn {
  width: 34px; height: 34px; border-radius: 10px; border: 1px solid transparent;
  background: transparent; color: var(--text-2); display: grid; place-items: center;
  cursor: pointer; flex: none; transition: background .14s, color .14s;
}
.icon-btn:hover { background: var(--surface-3); color: var(--text); }
.btn-row { display: flex; gap: 8px; flex-wrap: wrap; }

/* ------------------------------------------------------------- formulir */
.field { display: block; margin-bottom: 13px; }
.field > span, .field > label {
  display: block; font-size: 12.5px; font-weight: 600; color: var(--text-2); margin-bottom: 6px;
}
.field .hint { font-size: 11.5px; color: var(--text-3); margin-top: 5px; }
input[type=text], input[type=password], input[type=number], input[type=date], input[type=search],
input[type=datetime-local], select, textarea {
  width: 100%; padding: 9px 11px; border: 1px solid var(--border-strong); border-radius: 10px;
  background: var(--surface); color: var(--text); font: inherit; font-size: 13.5px;
  transition: border-color .14s, box-shadow .14s;
}
input:hover, select:hover, textarea:hover { border-color: var(--text-3); }
input:focus, select:focus, textarea:focus {
  outline: none; border-color: var(--primary); box-shadow: 0 0 0 3px var(--primary-ring);
}
input[readonly] { background: var(--surface-3); color: var(--text-2); }
textarea { resize: vertical; min-height: 64px; }
.form-error {
  color: var(--red); font-size: 12.5px; margin: 4px 0 10px;
  background: var(--red-soft); border-radius: 8px; padding: 7px 10px;
}
.notice {
  border-left: 3px solid var(--primary); background: var(--primary-soft);
  border-radius: 10px; padding: 11px 13px; font-size: 13px; line-height: 1.6;
}
.notice.warn { border-left-color: var(--amber); background: var(--amber-soft); }
.notice p { margin: 0 0 5px; }
.notice p:last-child { margin-bottom: 0; }
.notice .muted { font-size: 12.5px; }
.form-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(190px, 1fr)); gap: 0 14px; }
.form-actions { display: flex; gap: 8px; justify-content: flex-end; margin-top: 18px; flex-wrap: wrap; }
.check { display: flex; align-items: center; gap: 9px; font-size: 13.5px; margin-bottom: 11px; cursor: pointer; }
.check input { width: 16px; height: 16px; accent-color: var(--primary); }

/* ------------------------------------------------------------- kartu */
.card {
  background: var(--surface); border: 1px solid var(--border);
  border-radius: var(--radius-lg); padding: 18px; margin-bottom: 14px;
  box-shadow: var(--shadow);
}
.card-head {
  display: flex; align-items: center; justify-content: space-between;
  gap: 10px; margin-bottom: 14px; flex-wrap: wrap;
}
.card-head h3 { font-size: 14.5px; }
.card-head .sub { font-size: 12px; color: var(--text-3); margin: 2px 0 0; }
.grid { display: grid; gap: 14px; }
.grid-2 { grid-template-columns: repeat(auto-fit, minmax(320px, 1fr)); }
.grid-3 { grid-template-columns: repeat(auto-fit, minmax(230px, 1fr)); }
.grid-4 { grid-template-columns: repeat(auto-fit, minmax(178px, 1fr)); }
.split { display: grid; grid-template-columns: minmax(0, 1fr) 344px; gap: 14px; align-items: start; }
.stack { display: grid; gap: 10px; }
.row-between { display: flex; align-items: center; justify-content: space-between; gap: 10px; flex-wrap: wrap; }
.toolbar { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; margin-bottom: 14px; }
.toolbar .grow { flex: 1; min-width: 150px; }

/* ------------------------------------------------------------- statistik */
.stat {
  position: relative; overflow: hidden;
  background: var(--surface); border: 1px solid var(--border);
  border-radius: var(--radius-lg); padding: 15px 17px 15px 19px;
  box-shadow: var(--shadow);
}
.stat::before {
  content: ""; position: absolute; left: 0; top: 0; bottom: 0; width: 3px;
  background: var(--border-strong);
}
.stat .label {
  font-size: 11px; color: var(--text-3); text-transform: uppercase;
  letter-spacing: .07em; font-weight: 700;
}
.stat .value { font-size: 23px; font-weight: 680; margin-top: 4px; letter-spacing: -.025em; }
.stat .foot { font-size: 11.5px; color: var(--text-3); margin-top: 4px; }
.stat.accent { background: linear-gradient(150deg, var(--primary-soft) 0%, #f4fbf8 100%); border-color: #c6e6da; }
.stat.accent::before { background: var(--primary); }
.stat.accent .value { color: var(--primary-700); }
.stat.warn { background: linear-gradient(150deg, var(--amber-soft) 0%, #fffaf1 100%); border-color: #f0dcb6; }
.stat.warn::before { background: var(--amber); }
.stat.danger { background: linear-gradient(150deg, var(--red-soft) 0%, #fff6f5 100%); border-color: #f0cfcd; }
.stat.danger::before { background: var(--red); }

/* ------------------------------------------------------------- tabel */
.table-wrap {
  overflow-x: auto; border: 1px solid var(--border); border-radius: var(--radius);
  background: var(--surface); box-shadow: var(--shadow-xs);
}
table { width: 100%; border-collapse: collapse; font-size: 13px; }
thead th {
  text-align: left; padding: 10px 13px; background: var(--surface-2); color: var(--text-2);
  font-size: 11px; font-weight: 700; text-transform: uppercase; letter-spacing: .06em;
  border-bottom: 1px solid var(--border); white-space: nowrap;
  position: sticky; top: 0; z-index: 1;
}
tbody td { padding: 10px 13px; border-bottom: 1px solid var(--border); vertical-align: middle; }
tbody tr:last-child td { border-bottom: 0; }
tbody tr { transition: background .12s; }
tbody tr:hover { background: var(--surface-2); }
tbody tr.clickable { cursor: pointer; }
tbody tr.clickable:hover { background: var(--primary-soft); }
tfoot td {
  padding: 10px 13px; font-weight: 650; background: var(--surface-2);
  border-top: 1px solid var(--border);
}
.table-empty { padding: 34px; text-align: center; color: var(--text-3); font-size: 13px; }
.num { text-align: right; font-variant-numeric: tabular-nums; white-space: nowrap; }

/* ------------------------------------------------------------- lencana */
.badge {
  display: inline-flex; align-items: center; gap: 4px; padding: 3px 9px;
  border-radius: 999px; font-size: 11px; font-weight: 650;
  background: var(--surface-3); color: var(--text-2); white-space: nowrap;
}
.badge.ok { background: var(--primary-soft); color: var(--primary-700); }
.badge.info { background: var(--blue-soft); color: #0c447c; }
.badge.warn { background: var(--amber-soft); color: var(--amber); }
.badge.danger { background: var(--red-soft); color: var(--red); }
.badge.violet { background: var(--violet-soft); color: var(--violet); }

/* ------------------------------------------------------------- tab */
.tabs {
  display: flex; gap: 3px; border-bottom: 1px solid var(--border);
  margin-bottom: 16px; overflow-x: auto;
}
.tab {
  padding: 9px 14px; border: 0; background: transparent; color: var(--text-2);
  font: inherit; font-size: 13.5px; cursor: pointer; border-bottom: 2px solid transparent;
  white-space: nowrap; transition: color .14s, border-color .14s;
}
.tab:hover { color: var(--text); }
.tab.active { color: var(--primary); border-bottom-color: var(--primary); font-weight: 650; }

/* ------------------------------------------------------------- modal */
.modal-back {
  position: fixed; inset: 0; background: rgba(7, 32, 25, .5); backdrop-filter: blur(3px);
  display: grid; place-items: center; padding: 20px; z-index: 100; overflow-y: auto;
}
.modal {
  background: var(--surface); border-radius: var(--radius-lg); width: 100%; max-width: 528px;
  box-shadow: var(--shadow-lg); max-height: calc(100vh - 40px); display: flex; flex-direction: column;
  animation: modal-in .18s cubic-bezier(.2, .9, .3, 1.1);
}
.modal.wide { max-width: 868px; }
.modal.xwide { max-width: 1088px; }
.modal-head {
  padding: 16px 20px; border-bottom: 1px solid var(--border);
  display: flex; align-items: center; justify-content: space-between; gap: 10px;
}
.modal-head h3 { font-size: 15.5px; }
.modal-body { padding: 20px; overflow-y: auto; }
.modal-foot {
  padding: 14px 20px; border-top: 1px solid var(--border);
  display: flex; gap: 8px; justify-content: flex-end; flex-wrap: wrap;
  background: var(--surface-2); border-radius: 0 0 var(--radius-lg) var(--radius-lg);
}
@keyframes modal-in { from { opacity: 0; transform: translateY(10px) scale(.985); } to { opacity: 1; transform: none; } }

/* ------------------------------------------------------------- toast */
.toast-root {
  position: fixed; right: 16px; bottom: 16px; z-index: 200;
  display: grid; gap: 9px; max-width: 344px;
}
.toast {
  background: var(--surface); border: 1px solid var(--border); border-left: 3px solid var(--primary);
  border-radius: 12px; padding: 12px 14px; box-shadow: var(--shadow-lg); font-size: 13px;
  animation: toast-in .2s cubic-bezier(.2, .9, .3, 1.1);
}
.toast.error { border-left-color: var(--red); }
.toast.warn { border-left-color: var(--amber); }
@keyframes toast-in { from { opacity: 0; transform: translateY(8px) scale(.98); } to { opacity: 1; transform: none; } }

/* ------------------------------------------------------------- kasir */
.pos { display: grid; grid-template-columns: minmax(0, 1fr) 384px; gap: 14px; align-items: start; }
.scan-box { display: flex; gap: 8px; margin-bottom: 14px; }
.scan-box input { font-size: 15px; padding: 12px 13px; }
.scan-box input:focus { box-shadow: 0 0 0 4px var(--primary-ring); }
.product-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(148px, 1fr)); gap: 10px; }
.product-card {
  text-align: left; background: var(--surface); border: 1px solid var(--border);
  border-radius: 12px; padding: 11px; cursor: pointer; font: inherit; display: grid;
  grid-template-columns: auto 1fr; gap: 4px 10px; align-items: center;
  box-shadow: var(--shadow-xs); transition: border-color .14s, transform .12s, box-shadow .14s, background .14s;
}
.product-card:hover {
  border-color: var(--primary); background: var(--primary-soft);
  transform: translateY(-2px); box-shadow: var(--shadow);
}
.product-card > img,
.product-card > div:first-child { grid-row: 1 / 4; }
.product-card .pname { font-size: 13px; font-weight: 550; line-height: 1.35; grid-column: 2; }
.product-card .pprice { font-size: 13.5px; font-weight: 680; color: var(--primary-700); letter-spacing: -.01em; grid-column: 2; }
.product-card .pstock { font-size: 11px; color: var(--text-3); grid-column: 2; }
.product-card .pstock.low { color: var(--red); font-weight: 650; }

.cart {
  background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius-lg);
  display: flex; flex-direction: column; position: sticky; top: 78px;
  max-height: calc(100vh - 100px); box-shadow: var(--shadow); overflow: hidden;
}
.cart-head {
  padding: 13px 15px; border-bottom: 1px solid var(--border);
  display: flex; justify-content: space-between; align-items: center; background: var(--surface-2);
}
.cart-lines { overflow-y: auto; flex: 1; min-height: 90px; }
.cart-line {
  display: grid; grid-template-columns: auto minmax(0, 1fr) auto; gap: 8px;
  padding: 10px 15px; border-bottom: 1px solid var(--border); align-items: center;
}
.cart-line .cname { font-size: 13px; font-weight: 550; }
.cart-line .cmeta { font-size: 11.5px; color: var(--text-3); }
.cart-line .cright { text-align: right; display: grid; gap: 5px; justify-items: end; }
.qty-box {
  display: flex; align-items: center; gap: 0; border: 1px solid var(--border-strong);
  border-radius: 9px; overflow: hidden; background: var(--surface);
}
.qty-box button {
  width: 28px; height: 28px; border: 0; background: var(--surface-2);
  cursor: pointer; font-size: 15px; color: var(--text-2); transition: background .12s;
}
.qty-box button:hover { background: var(--primary-soft); color: var(--primary-700); }
.qty-box input {
  width: 50px; height: 28px; border: 0; border-left: 1px solid var(--border);
  border-right: 1px solid var(--border); text-align: center; padding: 0;
  font-size: 13px; border-radius: 0; box-shadow: none;
}
.cart-foot { padding: 14px 15px; border-top: 1px solid var(--border); display: grid; gap: 8px; background: var(--surface-2); }
.sum-row { display: flex; justify-content: space-between; font-size: 13px; }
.sum-row.total {
  font-size: 20px; font-weight: 720; padding-top: 9px;
  border-top: 1px dashed var(--border-strong); letter-spacing: -.02em;
}
.sum-row .k { color: var(--text-2); }
.pay-row { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
.change-line { font-size: 13px; color: var(--primary-700); font-weight: 650; }

/* ------------------------------------------------------------- struk cetak */
.receipt { width: 58mm; font-family: var(--mono); font-size: 11px; line-height: 1.45; color: #000; }
.receipt h4 { text-align: center; font-size: 12px; margin: 0 0 3px; font-family: inherit; }
.receipt .r-center { text-align: center; }
.receipt .r-sep { border-top: 1px dashed #000; margin: 5px 0; }
.receipt .r-row { display: flex; justify-content: space-between; gap: 6px; }
.receipt .r-item { margin-bottom: 3px; }
.print-area { display: none; }

@media print {
  @page { size: 58mm auto; margin: 2mm; }
  body { background: #fff; }
  #app-shell, #login-screen, #modal-root, #toast-root, #boot, .modal-back { display: none !important; }
  .print-area { display: block !important; }
}

/* ------------------------------------------------------------- grafik sederhana */
.bars { display: grid; gap: 8px; }
.bar-row { display: grid; grid-template-columns: 92px minmax(0, 1fr) 92px; gap: 9px; align-items: center; font-size: 12.5px; }
.bar-track { height: 16px; background: var(--surface-3); border-radius: 6px; overflow: hidden; }
.bar-fill { height: 100%; background: linear-gradient(90deg, var(--primary) 0%, #2c9d7c 100%); border-radius: 6px; }
.bar-fill.alt { background: linear-gradient(90deg, var(--blue) 0%, #378add 100%); }
.spark { display: flex; align-items: flex-end; gap: 3px; height: 128px; padding-top: 6px; }
.spark .col { flex: 1; display: flex; flex-direction: column; justify-content: flex-end; gap: 2px; min-width: 6px; }
.spark .bar { background: linear-gradient(180deg, #2c9d7c 0%, var(--primary) 100%); border-radius: 4px 4px 0 0; min-height: 2px; }
.spark .bar.exp { background: linear-gradient(180deg, #f0997b 0%, #d85a30 100%); }
.spark-axis { display: flex; justify-content: space-between; font-size: 11px; color: var(--text-3); margin-top: 4px; }
.legend { display: flex; gap: 14px; font-size: 11.5px; color: var(--text-2); flex-wrap: wrap; }
.legend i { display: inline-block; width: 9px; height: 9px; border-radius: 3px; margin-right: 5px; }

/* ------------------------------------------------------------- daftar kunci-nilai */
.kv { display: grid; grid-template-columns: auto 1fr; gap: 7px 14px; font-size: 13px; }
.kv dt { color: var(--text-3); }
.kv dd { margin: 0; text-align: right; font-variant-numeric: tabular-nums; }

/* ------------------------------------------------------------- gerak */
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: .01ms !important; transition-duration: .01ms !important; }
}

/* ------------------------------------------------------------- responsif */
.only-mobile { display: none; }

@media (max-width: 1100px) {
  .split { grid-template-columns: minmax(0, 1fr); }
  .pos { grid-template-columns: minmax(0, 1fr); }
  .cart { position: static; max-height: none; }
}

@media (max-width: 860px) {
  .app { grid-template-columns: minmax(0, 1fr); }
  .only-mobile { display: grid; }
  .sidebar {
    position: fixed; z-index: 50; width: 264px; transform: translateX(-100%);
    transition: transform .2s cubic-bezier(.2, .9, .3, 1); box-shadow: var(--shadow-lg);
  }
  .sidebar.open { transform: none; }
  .view { padding: 16px 14px 74px; }
  .topbar { padding: 11px 14px; }
  .product-grid { grid-template-columns: repeat(auto-fill, minmax(132px, 1fr)); }
  .bar-row { grid-template-columns: 74px minmax(0, 1fr) 78px; }
  .login-card { padding: 0 20px 22px; }
  .login-art { margin: 0 -20px 20px; padding: 12px 20px; }
}

/* ------------------------------------------------------------ foto barang */
.product-image-preview {
  display: flex; flex-direction: column; align-items: flex-start; gap: 6px;
}
.product-image-preview img {
  border: 1px solid var(--border); background: var(--surface);
}
