/* =====================================================================
   Ledgerline — "ledger & receipt paper" design system
   ===================================================================== */
:root {
  --paper: #f3eee3;
  --paper-2: #ebe4d4;
  --card: #fffdf8;
  --ink: #1c1a17;
  --ink-2: #4a463e;
  --muted: #8a8475;
  --line: #d9d0bd;
  --line-soft: #e8e1d1;
  /* Motor Haus brand: black + gold. (The --teal* names are kept as the "primary accent" slots.) */
  --teal: #8a6512;
  --teal-2: #a5791a;
  --teal-soft: #f4e8c8;
  --gold: #d4a52a;
  --gold-hi: #ecc964;
  --gold-grad: linear-gradient(180deg, #ecc964 0%, #d4a52a 55%, #b8860b 100%);
  --red: #d9472b;
  --red-soft: #f7ddd5;
  --ochre: #c08a1e;
  --ochre-soft: #f5e7c6;
  --moss: #4f7a3a;
  --moss-soft: #dfe9d3;
  --radius: 14px;
  --shadow: 4px 4px 0 var(--ink);
  --shadow-sm: 2px 2px 0 var(--ink);
  --f-display: "Fraunces", "Georgia", serif;
  --f-body: "Manrope", "Segoe UI", system-ui, sans-serif;
  --f-mono: "JetBrains Mono", "Cascadia Mono", "Consolas", monospace;
}

* { box-sizing: border-box; }
html, body { margin: 0; height: 100%; }
body {
  font-family: var(--f-body);
  font-size: 14px;
  color: var(--ink);
  background-color: var(--paper);
  background-image: radial-gradient(rgba(28, 26, 23, .06) 1px, transparent 1px);
  background-size: 18px 18px;
  -webkit-font-smoothing: antialiased;
}
a { color: var(--teal); }
button, input, select, textarea { font: inherit; color: inherit; }
h1, h2, h3 { font-family: var(--f-display); font-weight: 600; letter-spacing: -.01em; margin: 0; }
.mono, .num { font-family: var(--f-mono); font-feature-settings: "tnum"; }
.num { text-align: right; white-space: nowrap; }
.muted { color: var(--muted); }
.small { font-size: 12px; }
.hidden { display: none !important; }

/* ---------- Shell ---------- */
.shell { display: grid; grid-template-columns: 232px 1fr; min-height: 100vh; }
.sidebar {
  background: var(--ink);
  color: #efe8d8;
  display: flex; flex-direction: column;
  position: sticky; top: 0; height: 100vh;
  padding: 22px 14px 16px;
}
.brand { display: flex; flex-direction: column; align-items: stretch; gap: 8px; padding: 0 0 16px; border-bottom: 1px dashed #4a463e; text-decoration: none; }
.brand-logo { width: 100%; display: block; border-radius: 12px; background: #f6eed7; padding: 6px 10px; box-shadow: 3px 3px 0 var(--gold); }
.brand .brand-sub { text-align: center; color: var(--gold); }
.login-logo img { width: 230px; display: block; border-radius: 14px; background: #f6eed7; padding: 8px 14px; box-shadow: 5px 5px 0 var(--gold); }
.rc-logo { width: 120px; display: block; margin: 0 auto 4px; }
.doc-logo { width: 170px; display: block; margin: 0 auto 6px; }
.brand-mark {
  width: 38px; height: 38px; border-radius: 10px; background: var(--red);
  display: grid; place-items: center; font-family: var(--f-display); font-weight: 700; font-size: 22px; color: #fff;
  box-shadow: 3px 3px 0 #000; transform: rotate(-4deg);
}
.brand-name { font-family: var(--f-display); font-size: 21px; font-weight: 600; line-height: 1; }
.brand-sub { font-family: var(--f-mono); font-size: 10px; color: #9b9483; letter-spacing: .12em; text-transform: uppercase; margin-top: 4px; }

.nav { margin-top: 16px; display: flex; flex-direction: column; gap: 2px; overflow-y: auto; }
.nav-label { font-family: var(--f-mono); font-size: 10px; letter-spacing: .14em; color: #7d7768; text-transform: uppercase; padding: 14px 10px 6px; }
.nav a {
  display: flex; align-items: center; gap: 12px;
  padding: 9px 10px; border-radius: 9px;
  color: #d7cfbd; text-decoration: none; font-weight: 500;
  position: relative; transition: background .15s, color .15s;
}
.nav a .idx { font-family: var(--f-mono); font-size: 10px; color: #6f695b; width: 16px; }
.nav a svg { width: 18px; height: 18px; flex: none; opacity: .85; }
.nav a:hover { background: #2a2722; color: #fff; }
.nav a.active { background: var(--paper); color: var(--ink); font-weight: 700; }
.nav a.active .idx { color: var(--teal); }
.nav a.active::before {
  content: ""; position: absolute; left: -14px; top: 8px; bottom: 8px; width: 5px;
  background: var(--gold); border-radius: 0 4px 4px 0;
}
.nav .badge-dot { margin-left: auto; background: var(--red); color: #fff; font-size: 10px; font-family: var(--f-mono); padding: 1px 6px; border-radius: 10px; }

.sidebar-foot { margin-top: auto; padding-top: 14px; border-top: 1px dashed #4a463e; }
.who { display: flex; align-items: center; gap: 10px; padding: 6px 8px; border-radius: 10px; cursor: pointer; }
.who:hover { background: #2a2722; }
.avatar {
  width: 34px; height: 34px; border-radius: 50%; background: var(--ochre); color: var(--ink);
  display: grid; place-items: center; font-weight: 800; font-size: 13px; flex: none;
}
.who-name { font-weight: 600; font-size: 13px; color: #fff; }
.who-role { font-family: var(--f-mono); font-size: 10px; color: #9b9483; text-transform: uppercase; letter-spacing: .1em; }

.main { min-width: 0; display: flex; flex-direction: column; }
.topbar {
  display: flex; align-items: center; gap: 16px;
  padding: 18px 30px 14px;
}
.topbar h1 { font-size: 30px; }
.topbar .crumb { font-family: var(--f-mono); font-size: 11px; color: var(--muted); text-transform: uppercase; letter-spacing: .12em; }
.topbar .spacer { flex: 1; }
.clock { font-family: var(--f-mono); font-size: 12px; color: var(--ink-2); background: var(--card); border: 1.5px solid var(--ink); border-radius: 30px; padding: 6px 14px; box-shadow: var(--shadow-sm); }
.sync-pill { font-family: var(--f-mono); font-size: 12px; color: var(--ink); background: var(--card); border: 1.5px solid var(--ink); border-radius: 30px; padding: 6px 12px; box-shadow: var(--shadow-sm); cursor: pointer; display: inline-flex; align-items: center; gap: 7px; white-space: nowrap; }
.sync-pill[hidden] { display: none; }
.sync-pill i { width: 9px; height: 9px; border-radius: 50%; background: var(--moss); }
.sync-pill.wait i { background: var(--ochre); }
.sync-pill.off { background: var(--red-soft); }
.sync-pill.off i { background: var(--red); }
.sync-pill.run i { background: var(--gold); animation: syncBlink 0.8s infinite alternate; }
@keyframes syncBlink { to { opacity: 0.25; } }
.sync-row { display: flex; justify-content: space-between; gap: 16px; padding: 8px 0; border-bottom: 1px dashed var(--line); }
.sync-row span { color: var(--muted); }
.sync-row b { text-align: right; }
.sync-row .neg { color: var(--red); }
.msg-ch { display: flex; gap: 18px; flex-wrap: wrap; padding: 6px 0; }
.msg-ch .check, .field .msg-ch .check { font-weight: 700; text-transform: none; letter-spacing: 0; font-size: 14px; color: var(--ink); }
.field .msg-ch .check.muted { color: var(--muted); }
.field .pick-row { text-transform: none; letter-spacing: 0; font-size: 13px; color: var(--ink); font-weight: 400; margin: 0; }
.msg-ch .check.muted { cursor: not-allowed; }
.msg-sec { border-top: 1px dashed var(--line); padding-top: 12px; margin-top: 4px; }
.msg-status { display: flex; gap: 6px; flex-wrap: wrap; justify-content: center; margin: -6px 0 14px; }
.msg-body { max-width: 340px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.wa-list { display: flex; flex-direction: column; max-height: 55vh; overflow: auto; border: 1px solid var(--line); border-radius: 10px; }
.wa-row { display: flex; justify-content: space-between; align-items: center; gap: 10px; padding: 8px 12px; border-bottom: 1px dashed var(--line); }
.wa-row:last-child { border-bottom: 0; }
.wa-row.done { background: var(--moss-soft); }
.pick-list { max-height: 300px; overflow: auto; border: 1.5px solid var(--line); border-radius: 10px; background: var(--card); }
.pick-row { display: grid; grid-template-columns: 22px 1fr auto; gap: 10px; align-items: center; padding: 7px 12px; border-bottom: 1px dashed var(--line-soft); cursor: pointer; text-transform: none; letter-spacing: 0; font-size: 13px; color: var(--ink); font-weight: 400; }
.pick-row:hover { background: var(--teal-soft); }
.pick-row input { width: 16px; height: 16px; accent-color: var(--teal); }
.view { padding: 6px 30px 40px; flex: 1; }
.icon-btn.menu-toggle { display: none; }

/* ---------- Primitives ---------- */
.card {
  background: var(--card);
  border: 1.5px solid var(--ink);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
}
.card-pad { padding: 18px 20px; }
.card-head { display: flex; align-items: center; gap: 10px; padding: 16px 20px 12px; border-bottom: 1px dashed var(--line); }
.card-head h3 { font-size: 18px; }
.card-head .spacer { flex: 1; }

.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  height: 38px; padding: 0 16px; border-radius: 10px;
  border: 1.5px solid var(--ink); background: var(--card); color: var(--ink);
  font-weight: 700; cursor: pointer; white-space: nowrap; text-decoration: none;
  box-shadow: var(--shadow-sm); transition: transform .08s, box-shadow .08s, background .15s;
}
.btn:hover { background: var(--paper-2); }
.btn:active { transform: translate(2px, 2px); box-shadow: 0 0 0 var(--ink); }
.btn:disabled { opacity: .5; cursor: not-allowed; transform: none; }
.btn svg { width: 16px; height: 16px; }
.btn-primary { background: var(--gold-grad); color: var(--ink); }
.btn-primary:hover { background: var(--gold-hi); }
.btn-danger { background: var(--red); color: #fff; }
.btn-danger:hover { background: #c23c22; }
.btn-ink { background: var(--ink); color: var(--paper); }
.btn-ink:hover { background: #33302a; }
.btn-sm { height: 30px; padding: 0 10px; font-size: 12px; border-radius: 8px; }
.btn-ghost { border-color: transparent; box-shadow: none; background: transparent; }
.btn-ghost:hover { background: var(--paper-2); }
.icon-btn {
  width: 30px; height: 30px; border-radius: 8px; border: 1px solid transparent; background: transparent;
  display: inline-grid; place-items: center; cursor: pointer; color: var(--ink-2);
}
.icon-btn:hover { background: var(--paper-2); border-color: var(--line); color: var(--ink); }
.icon-btn.danger:hover { color: var(--red); border-color: var(--red-soft); background: var(--red-soft); }
.icon-btn svg { width: 16px; height: 16px; }

.input, .select, textarea.input {
  height: 38px; width: 100%; padding: 0 12px;
  border: 1.5px solid var(--line); border-radius: 10px; background: #fff;
  outline: none; transition: border-color .15s, box-shadow .15s;
}
textarea.input { height: auto; min-height: 70px; padding: 10px 12px; resize: vertical; }
.input:focus, .select:focus { border-color: var(--ink); box-shadow: 0 0 0 3px var(--teal-soft); }
.input.num { text-align: right; }
.input.invalid { border-color: var(--red); box-shadow: 0 0 0 3px var(--red-soft); }
.select { appearance: none; padding-right: 30px; background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 24 24' fill='none' stroke='%231c1a17' stroke-width='2.5'%3E%3Cpath d='m6 9 6 6 6-6'/%3E%3C/svg%3E"); background-repeat: no-repeat; background-position: right 10px center; }

.field { display: flex; flex-direction: column; gap: 6px; }
.field label { font-size: 11px; font-weight: 700; text-transform: uppercase; letter-spacing: .08em; color: var(--ink-2); }
.field .hint { font-size: 11px; color: var(--muted); }
.grid-form { display: grid; grid-template-columns: repeat(2, 1fr); gap: 14px 16px; }
.grid-form .span-2 { grid-column: span 2; }
.check { display: flex; align-items: center; gap: 10px; cursor: pointer; font-weight: 600; }
.check input { width: 18px; height: 18px; accent-color: var(--teal); }

.toolbar { display: flex; flex-wrap: wrap; gap: 10px; align-items: center; margin-bottom: 18px; }
.toolbar .spacer { flex: 1; }
.search { position: relative; min-width: 260px; }
.search svg { position: absolute; left: 12px; top: 50%; transform: translateY(-50%); width: 16px; height: 16px; color: var(--muted); }
.search .input { padding-left: 36px; }

.seg { display: inline-flex; border: 1.5px solid var(--ink); border-radius: 10px; overflow: hidden; background: var(--card); box-shadow: var(--shadow-sm); }
.seg button { border: 0; background: transparent; padding: 0 14px; height: 35px; cursor: pointer; font-weight: 700; font-size: 12px; border-right: 1.5px solid var(--ink); }
.seg button:last-child { border-right: 0; }
.seg button.on { background: var(--ink); color: var(--paper); }

/* ---------- Tables ---------- */
.table-wrap { overflow-x: auto; }
table.tbl { width: 100%; border-collapse: collapse; }
.tbl th {
  text-align: left; font-family: var(--f-mono); font-size: 10.5px; font-weight: 600; letter-spacing: .1em; text-transform: uppercase;
  color: var(--muted); padding: 12px 14px; border-bottom: 1.5px solid var(--ink); background: var(--paper-2); white-space: nowrap;
}
.tbl th.num { text-align: right; }
.tbl td { padding: 11px 14px; border-bottom: 1px solid var(--line-soft); vertical-align: middle; }
.tbl tbody tr:hover td { background: #faf6ec; }
.tbl tbody tr.clickable { cursor: pointer; }
.tbl tbody tr:last-child td { border-bottom: 0; }
.tbl .actions { text-align: right; white-space: nowrap; }
.tbl .sub { display: block; font-size: 11.5px; color: var(--muted); font-family: var(--f-mono); margin-top: 2px; }
.tbl tfoot td { font-weight: 800; border-top: 1.5px solid var(--ink); padding: 12px 14px; }
.empty { text-align: center; padding: 50px 20px; color: var(--muted); }
.empty .big { font-family: var(--f-display); font-size: 22px; color: var(--ink-2); margin-bottom: 4px; }

/* ---------- Chips & stamps ---------- */
.chip { display: inline-flex; align-items: center; gap: 6px; padding: 3px 10px; border-radius: 20px; font-size: 12px; font-weight: 700; background: var(--paper-2); border: 1px solid var(--line); white-space: nowrap; }
.chip i { width: 8px; height: 8px; border-radius: 50%; display: inline-block; }
.stamp {
  display: inline-block; font-family: var(--f-mono); font-size: 10.5px; font-weight: 700; letter-spacing: .12em; text-transform: uppercase;
  padding: 2px 8px; border: 2px solid currentColor; border-radius: 4px; transform: rotate(-3deg);
}
.stamp.ok { color: var(--moss); }
.stamp.void { color: var(--red); }
.stamp.due { color: var(--ochre); }
.stamp.info { color: var(--teal); }
.stamp.big { font-size: 28px; padding: 4px 16px; border-width: 4px; opacity: .85; }

.mv { font-family: var(--f-mono); font-weight: 700; }
.mv.pos { color: var(--moss); }
.mv.neg { color: var(--red); }

.stockbar { display: flex; align-items: center; gap: 10px; min-width: 140px; }
.stockbar .track { flex: 1; height: 7px; border-radius: 6px; background: var(--paper-2); overflow: hidden; border: 1px solid var(--line); }
.stockbar .fill { height: 100%; background: var(--teal); }
.stockbar.low .fill { background: var(--ochre); }
.stockbar.out .fill { background: var(--red); }
.stockbar .val { font-family: var(--f-mono); font-weight: 700; min-width: 64px; text-align: right; }
.stockbar.low .val { color: var(--ochre); }
.stockbar.out .val { color: var(--red); }

/* ---------- Dashboard ---------- */
.hello { display: flex; align-items: flex-end; gap: 20px; margin-bottom: 22px; flex-wrap: wrap; }
.hello h2 { font-size: 34px; line-height: 1.1; }
.hello h2 em { font-style: italic; color: var(--teal); }
.hello .spacer { flex: 1; }
.kpis { display: grid; grid-template-columns: repeat(auto-fit, minmax(190px, 1fr)); gap: 18px; margin-bottom: 22px; }
.kpi { padding: 16px 18px 18px; position: relative; overflow: hidden; }
.kpi .label { font-family: var(--f-mono); font-size: 10.5px; text-transform: uppercase; letter-spacing: .12em; color: var(--muted); }
.kpi .value { font-family: var(--f-display); font-size: 30px; font-weight: 600; margin-top: 8px; letter-spacing: -.02em; line-height: 1.05; }
.kpi .foot { margin-top: 8px; font-size: 12px; color: var(--ink-2); }
.kpi .tag { position: absolute; right: 14px; top: 14px; width: 30px; height: 30px; border-radius: 8px; display: grid; place-items: center; border: 1.5px solid var(--ink); }
.kpi .tag svg { width: 16px; height: 16px; }
.kpi.teal .tag { background: var(--teal-soft); }
.kpi.red .tag { background: var(--red-soft); }
.kpi.ochre .tag { background: var(--ochre-soft); }
.kpi.moss .tag { background: var(--moss-soft); }
.kpi.feature { background: var(--ink); color: #fff; box-shadow: 4px 4px 0 var(--gold); }
.kpi.feature .value { color: var(--gold-hi); }
.kpi.feature .label { color: #bfae84; }
.kpi.feature .foot { color: #ddd3bd; }
.kpi.feature .tag { background: var(--gold-grad); color: var(--ink); }
.trend-up { color: var(--moss); font-weight: 800; }
.trend-down { color: var(--red); font-weight: 800; }
.kpi.feature .trend-up, .kpi.feature .trend-down { color: #fff; background: rgba(255,255,255,.15); padding: 1px 6px; border-radius: 6px; }

.dash-grid { display: grid; grid-template-columns: 2fr 1fr; gap: 22px; }
.dash-grid > .wide { grid-column: span 2; }
.chart { width: 100%; display: block; }
.chart .bar { fill: var(--ink); transition: fill .15s; }
.chart .bar.today { fill: var(--gold); }
.chart g:hover .bar { fill: var(--teal-2); }
.chart .axis { font-family: var(--f-mono); font-size: 10px; fill: var(--muted); }
.chart .grid { stroke: var(--line); stroke-dasharray: 3 4; }
.chart .vlabel { font-family: var(--f-mono); font-size: 10px; fill: var(--ink); font-weight: 700; }

.rank { list-style: none; margin: 0; padding: 6px 20px 16px; }
.rank li { padding: 10px 0; border-bottom: 1px dashed var(--line); }
.rank li:last-child { border-bottom: 0; }
.rank .row { display: flex; justify-content: space-between; gap: 10px; font-weight: 600; }
.rank .meter { height: 6px; background: var(--paper-2); border-radius: 4px; margin-top: 7px; overflow: hidden; }
.rank .meter span { display: block; height: 100%; background: var(--ink); border-radius: 4px; }
.mini-list { list-style: none; margin: 0; padding: 4px 0 8px; }
.mini-list li { display: flex; align-items: center; gap: 12px; padding: 10px 20px; border-bottom: 1px dashed var(--line); }
.mini-list li:last-child { border-bottom: 0; }
.mini-list .grow { flex: 1; min-width: 0; }
.mini-list .title { font-weight: 700; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.mini-list a.li-link { text-decoration: none; color: inherit; display: contents; }

/* ---------- POS ---------- */
.pos { display: grid; grid-template-columns: 1fr 410px; gap: 22px; align-items: start; }
.pos-catalog { min-width: 0; }
.pos-search { display: flex; gap: 10px; margin-bottom: 14px; }
.pos-search .search { flex: 1; }
.pos-search .input { height: 50px; font-size: 16px; border: 1.5px solid var(--ink); box-shadow: var(--shadow-sm); border-radius: 12px; }
.pos-search .search svg { width: 20px; height: 20px; left: 16px; }
.pos-search .search .input { padding-left: 46px; }
.kbd { font-family: var(--f-mono); font-size: 10.5px; border: 1px solid var(--line); border-bottom-width: 2px; border-radius: 5px; padding: 1px 6px; background: var(--card); color: var(--ink-2); }
.cat-chips { display: flex; gap: 8px; flex-wrap: wrap; margin-bottom: 16px; }
.cat-chip { border: 1.5px solid var(--ink); background: var(--card); border-radius: 30px; padding: 6px 14px; font-weight: 700; font-size: 12.5px; cursor: pointer; display: inline-flex; align-items: center; gap: 7px; }
.cat-chip i { width: 9px; height: 9px; border-radius: 50%; }
.cat-chip.on { background: var(--ink); color: var(--paper); }
.tiles { display: grid; grid-template-columns: repeat(auto-fill, minmax(165px, 1fr)); gap: 14px; }
.tile {
  text-align: left; cursor: pointer; padding: 0; overflow: hidden; display: flex; flex-direction: column;
  background: var(--card); border: 1.5px solid var(--ink); border-radius: 12px; box-shadow: var(--shadow-sm);
  transition: transform .1s, box-shadow .1s; min-height: 128px; position: relative;
}
.tile:hover { transform: translate(-2px, -2px); box-shadow: 4px 4px 0 var(--ink); }
.tile:active { transform: translate(1px, 1px); box-shadow: 0 0 0 var(--ink); }
.tile .strip { height: 6px; background: var(--teal); }
.tile .body { padding: 10px 12px 12px; display: flex; flex-direction: column; flex: 1; gap: 4px; }
.tile .name { font-weight: 700; line-height: 1.25; font-size: 13.5px; }
.tile .sku { font-family: var(--f-mono); font-size: 10.5px; color: var(--muted); }
.tile .bottom { margin-top: auto; display: flex; justify-content: space-between; align-items: flex-end; padding-top: 8px; }
.tile .price { font-family: var(--f-display); font-size: 19px; font-weight: 700; }
.tile .stock { font-family: var(--f-mono); font-size: 10.5px; padding: 2px 6px; border-radius: 5px; background: var(--teal-soft); color: var(--teal); font-weight: 700; }
.tile .stock.low { background: var(--ochre-soft); color: #8a6212; }
.tile .stock.out { background: var(--red-soft); color: var(--red); }
.tile .stock.svc { background: var(--ink); color: var(--paper); letter-spacing: .06em; text-transform: uppercase; }
.tile.disabled { opacity: .55; cursor: not-allowed; }
.tile .incart { position: absolute; top: 12px; right: 10px; background: var(--red); color: #fff; font-family: var(--f-mono); font-size: 11px; font-weight: 700; border-radius: 20px; padding: 1px 8px; border: 1.5px solid var(--ink); }

/* receipt-paper cart */
.receipt {
  background: #fff; border: 1.5px solid var(--ink); border-bottom: 0; border-radius: 14px 14px 0 0;
  position: sticky; top: 16px; box-shadow: 4px 0 0 var(--ink);
  font-family: var(--f-mono); font-size: 12.5px;
  display: flex; flex-direction: column; max-height: calc(100vh - 32px);
}
.receipt::after {
  content: ""; position: absolute; left: -1.5px; right: -1.5px; bottom: -12px; height: 12px;
  background:
    linear-gradient(-45deg, transparent 8px, #fff 0) 0 0 / 16px 12px repeat-x,
    linear-gradient(45deg, transparent 8px, #fff 0) 0 0 / 16px 12px repeat-x;
  filter: drop-shadow(0 1.5px 0 var(--ink)) drop-shadow(4px 0 0 var(--ink));
}
.rc-head { padding: 16px 18px 12px; border-bottom: 1.5px dashed var(--ink); text-align: center; }
.rc-head .shop { font-family: var(--f-display); font-size: 20px; font-weight: 700; }
.rc-head .meta { color: var(--muted); font-size: 11px; margin-top: 2px; }
.rc-cust { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; padding: 12px 16px; border-bottom: 1px dashed var(--line); font-family: var(--f-body); }
.rc-cust .span-2 { grid-column: span 2; }
.rc-cust .input { height: 36px; font-size: 13px; }
.rc-cust #cMobile { font-family: var(--f-mono); font-weight: 700; font-size: 15px; height: 40px; border-color: var(--ink); }
.rc-cust .picker-list { max-height: 260px; }
.rc-cust .picker-list .sub { display: block; font-family: var(--f-mono); font-size: 11px; color: var(--muted); margin-top: 2px; }
.picker-head { font-family: var(--f-mono); font-size: 10px; letter-spacing: .1em; text-transform: uppercase; color: var(--muted); padding: 8px 14px; background: var(--paper-2); border-bottom: 1px solid var(--line); }
.cust-badge { display: flex; align-items: center; gap: 8px; font-size: 12px; color: var(--muted); min-height: 0; }
.cust-badge:empty { display: none; }
.cust-badge svg { width: 14px; height: 14px; flex: none; }
.cust-badge span { flex: 1; }
.cust-badge .icon-btn { width: 24px; height: 24px; }
.cust-badge.reg { color: var(--moss); background: var(--moss-soft); border: 1px solid var(--moss); border-radius: 8px; padding: 4px 6px 4px 10px; }
.cust-badge.new { color: var(--teal); background: var(--teal-soft); border: 1px dashed var(--teal); border-radius: 8px; padding: 6px 10px; }
.rc-lines { flex: 1; overflow-y: auto; padding: 4px 0; min-height: 160px; }
.rc-empty { text-align: center; color: var(--muted); padding: 40px 20px; font-family: var(--f-body); }
.rc-empty .big { font-family: var(--f-display); font-size: 20px; color: var(--ink-2); }
.rc-line { padding: 9px 16px; border-bottom: 1px dotted var(--line); }
.rc-line .l1 { display: flex; justify-content: space-between; gap: 10px; align-items: flex-start; }
.rc-line .nm { font-family: var(--f-body); font-weight: 700; font-size: 13px; cursor: pointer; }
.rc-line .nm:hover { text-decoration: underline dotted; }
.rc-line .l2 { display: flex; align-items: center; justify-content: space-between; margin-top: 6px; color: var(--ink-2); }
.rc-line .disc { color: var(--red); font-size: 11px; }
.qty { display: inline-flex; align-items: center; border: 1.5px solid var(--ink); border-radius: 8px; overflow: hidden; }
.qty button { width: 26px; height: 26px; border: 0; background: var(--paper-2); cursor: pointer; font-weight: 800; }
.qty button:hover { background: var(--ink); color: #fff; }
.qty input { width: 48px; height: 26px; border: 0; text-align: center; font-family: var(--f-mono); font-weight: 700; outline: none; }
.rc-line .edit { display: flex; gap: 8px; align-items: center; margin-top: 8px; font-family: var(--f-body); font-size: 12px; }
.rc-line .edit .input { height: 30px; width: 110px; }
.rc-totals { padding: 10px 16px; border-top: 1.5px dashed var(--ink); }
.rc-totals .r { display: flex; justify-content: space-between; align-items: center; padding: 3px 0; }
.rc-totals .r .input { width: 110px; height: 28px; font-family: var(--f-mono); text-align: right; }
.rc-totals .grand { font-family: var(--f-display); font-size: 30px; font-weight: 700; border-top: 1.5px solid var(--ink); margin-top: 8px; padding-top: 8px; }
.rc-pay { padding: 12px 16px 18px; border-top: 1px dashed var(--line); font-family: var(--f-body); background: #fdfbf6; }
.pay-methods { display: grid; grid-template-columns: repeat(5, 1fr); gap: 6px; margin-bottom: 10px; }
.split-box { margin-bottom: 4px; }
.split-row { display: grid; grid-template-columns: 74px 1fr 26px; gap: 6px; align-items: center; margin-bottom: 6px; }
.split-row select, .split-row .input { height: 34px; font-size: 13px; }
.split-row .amt-in { font-family: var(--f-mono); font-weight: 700; text-align: right; }
.split-row .txn-in { grid-column: 2 / 3; font-family: var(--f-mono); font-size: 12px; height: 30px; }
.split-row .rm { border: 0; background: transparent; color: var(--ink-2); cursor: pointer; font-size: 18px; line-height: 1; }
.split-row .rm:hover { color: var(--red); }
.split-add { border: 1px dashed var(--ink-2); background: transparent; border-radius: 6px; padding: 3px 10px; font-size: 12px; cursor: pointer; margin-bottom: 6px; }
.split-add:hover { background: var(--paper-2); border-style: solid; }.pay-methods button { border: 1.5px solid var(--ink); background: #fff; border-radius: 8px; height: 34px; font-weight: 700; font-size: 12px; cursor: pointer; }
.pay-methods button.on { background: var(--ink); color: var(--paper); }
.tender { display: flex; gap: 8px; align-items: center; }
.tender .input { height: 40px; font-family: var(--f-mono); font-size: 16px; font-weight: 700; text-align: right; }
.quick-cash { display: flex; gap: 6px; flex-wrap: wrap; margin: 8px 0; }
.quick-cash button { border: 1px dashed var(--ink-2); background: transparent; border-radius: 6px; padding: 3px 9px; font-family: var(--f-mono); font-size: 11.5px; cursor: pointer; }
.quick-cash button:hover { background: var(--paper-2); border-style: solid; }
.change-line { display: flex; justify-content: space-between; font-family: var(--f-mono); font-weight: 700; padding: 4px 0 10px; }
.change-line.due { color: var(--red); }
.change-line.chg { color: var(--moss); }
.charge { width: 100%; height: 54px; font-size: 17px; border-radius: 12px; }
.charge .amt { font-family: var(--f-mono); }

/* ---------- Invoice / receipt print ---------- */
.doc { max-width: 430px; margin: 0 auto; background: #fff; padding: 26px 26px 30px; font-family: var(--f-mono); font-size: 12.5px; position: relative; }
.doc .center { text-align: center; }
.doc .shop { font-family: var(--f-display); font-size: 24px; font-weight: 700; }
.doc hr { border: 0; border-top: 1.5px dashed var(--ink); margin: 12px 0; }
.doc table { width: 100%; border-collapse: collapse; }
.doc td { padding: 3px 0; vertical-align: top; }
.doc .tot td { padding: 2px 0; }
.doc .grand td { font-size: 17px; font-weight: 800; padding-top: 6px; }
.doc .void-stamp { position: absolute; top: 46%; left: 50%; transform: translate(-50%, -50%) rotate(-14deg); pointer-events: none; opacity: .75; }
.doc-actions { display: flex; gap: 10px; justify-content: center; margin-bottom: 18px; flex-wrap: wrap; }

/* ---------- Modal ---------- */
.overlay { position: fixed; inset: 0; background: rgba(28, 26, 23, .45); display: grid; place-items: center; z-index: 50; padding: 20px; animation: fade .15s; backdrop-filter: blur(2px); }
.modal { width: min(560px, 100%); max-height: calc(100vh - 40px); display: flex; flex-direction: column; animation: pop .18s ease-out; }
.modal.wide { width: min(820px, 100%); }
.modal-head { display: flex; align-items: center; padding: 18px 22px 14px; border-bottom: 1px dashed var(--line); }
.modal-head h3 { font-size: 21px; flex: 1; }
.modal-body { padding: 18px 22px; overflow-y: auto; }
.modal-foot { display: flex; gap: 10px; justify-content: flex-end; padding: 14px 22px 18px; border-top: 1px dashed var(--line); }
.modal .error { background: var(--red-soft); color: #8f2a16; border: 1px solid var(--red); border-radius: 8px; padding: 9px 12px; margin-bottom: 14px; font-weight: 600; }
@keyframes fade { from { opacity: 0; } }
@keyframes pop { from { transform: translateY(10px) scale(.98); opacity: 0; } }

.success { text-align: center; padding: 10px 0 4px; }
.success .tick { width: 64px; height: 64px; border-radius: 50%; background: var(--moss); color: #fff; display: grid; place-items: center; margin: 0 auto 14px; border: 2px solid var(--ink); box-shadow: var(--shadow-sm); }
.success .tick svg { width: 32px; height: 32px; }
.success .big { font-family: var(--f-display); font-size: 40px; font-weight: 700; }

/* ---------- Excel import ---------- */
.dropzone { display: flex; align-items: center; justify-content: center; gap: 12px; padding: 26px; border: 2px dashed var(--line); border-radius: 12px; background: #fffdf8; cursor: pointer; transition: border-color .15s, background .15s; text-align: center; }
.dropzone:hover, .dropzone.over { border-color: var(--gold); background: var(--teal-soft); }
.dropzone svg { width: 26px; height: 26px; color: var(--teal); flex: none; }
.import-summary { display: flex; gap: 8px; flex-wrap: wrap; align-items: center; margin: 18px 0 8px; }
.import-table { max-height: 320px; overflow-y: auto; border: 1px solid var(--line); border-radius: 10px; }
.import-table .tbl th { position: sticky; top: 0; z-index: 1; }
.stamp.muted { color: var(--muted); }

/* ---------- Billing options & returns ---------- */
.mini-seg { display: inline-flex; margin-left: 6px; border: 1.5px solid var(--ink); border-radius: 6px; overflow: hidden; vertical-align: middle; }
.mini-seg button { border: 0; background: transparent; padding: 0 8px; height: 22px; font-weight: 800; font-size: 12px; cursor: pointer; }
.mini-seg button + button { border-left: 1.5px solid var(--ink); }
.mini-seg button.on { background: var(--ink); color: var(--gold-hi); }
.disc-in { display: inline-flex; align-items: center; gap: 8px; }
.disc-amt { font-family: var(--f-mono); font-size: 12px; color: var(--red); }
.tax-toggle { display: inline-flex; align-items: center; gap: 6px; cursor: pointer; }
.tax-toggle input { width: 16px; height: 16px; accent-color: var(--teal); }
.doc .ret-tag { color: var(--red); font-size: 11px; font-weight: 700; text-transform: uppercase; }
.doc .ret-block { margin: 6px 0; }

/* ---------- Packages & offers ---------- */
.cat-chip svg { width: 14px; height: 14px; }
.cat-chip.pkg { border-color: var(--gold); background: #fff8e4; }
.cat-chip.pkg.on { background: var(--ink); color: var(--gold-hi); }
.pkg-tile { border-color: var(--gold) !important; background: linear-gradient(180deg, #fffaf0, #fff) !important; }
.pkg-tile .strip { background: var(--gold-grad); }
.tile .was { display: block; font-family: var(--f-mono); font-size: 11px; color: var(--muted); }
.save-badge { align-self: flex-start; margin-top: 2px; background: var(--moss); color: #fff; font-family: var(--f-mono); font-size: 10px; font-weight: 700; border-radius: 20px; padding: 1px 7px; }
.rc-line.pkg { background: #fffaf0; border-left: 3px solid var(--gold); }
.pkg-tag { display: inline-flex; align-items: center; gap: 3px; font-family: var(--f-mono); font-size: 9.5px; font-weight: 700; text-transform: uppercase; letter-spacing: .06em; background: var(--ink); color: var(--gold-hi); border-radius: 4px; padding: 1px 5px; margin-right: 6px; vertical-align: 1px; }
.pkg-tag svg { width: 10px; height: 10px; }
.rc-line s { color: var(--muted); font-size: 11px; }
.pkg-parts { list-style: none; margin: 6px 0 0; padding: 0 0 0 10px; border-left: 1px dashed var(--line); font-size: 11px; color: var(--muted); }
.pkg-parts li { display: flex; justify-content: space-between; gap: 8px; padding: 1px 0; }
.rc-totals .r.saved { color: var(--moss); font-weight: 700; }
.pkg-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(320px, 1fr)); gap: 18px; }
.pkg-card { padding: 16px 18px; display: flex; flex-direction: column; gap: 8px; border-top: 5px solid var(--gold); }
.pkg-card.off { opacity: .62; }
.pkg-card h3 { font-size: 19px; margin: 0; }
.pk-top { display: flex; justify-content: space-between; align-items: center; }
.pk-items { list-style: none; margin: 4px 0; padding: 8px 0; border-top: 1px dashed var(--line); border-bottom: 1px dashed var(--line); font-size: 13px; }
.pk-items li { display: flex; justify-content: space-between; gap: 10px; padding: 3px 0; }
.pk-items .chip { font-size: 10px; padding: 0 6px; }
.pk-price { display: flex; justify-content: space-between; align-items: flex-end; gap: 10px; }
.pk-price .big { font-family: var(--f-display); font-size: 26px; font-weight: 700; }
.pk-price s { font-size: 14px; color: var(--muted); font-weight: 500; }
.save-pill { background: var(--moss-soft); color: var(--moss); border: 1.5px solid var(--moss); border-radius: 10px; padding: 4px 10px; font-weight: 800; text-align: center; line-height: 1.2; }
.save-pill small { display: block; font-size: 11px; font-weight: 600; }
.pk-offer { display: flex; align-items: center; gap: 6px; color: var(--ink-2); }
.pk-offer svg { width: 14px; height: 14px; color: var(--teal); }
.pk-actions { display: flex; gap: 8px; align-items: center; margin-top: auto; padding-top: 6px; }
.pk-actions .spacer { flex: 1; }
.pk-add { display: flex; gap: 8px; }
.pk-add .select { flex: 1; }
.pk-summary { display: grid; grid-template-columns: repeat(4, 1fr); gap: 10px; }
.pk-summary > div { border: 1px solid var(--line); border-radius: 10px; padding: 8px 12px; display: flex; flex-direction: column; gap: 2px; }
.pk-summary span { font-family: var(--f-mono); font-size: 10.5px; text-transform: uppercase; letter-spacing: .08em; color: var(--muted); }
.pk-summary b { font-family: var(--f-display); font-size: 19px; }
.pk-summary b.good { color: var(--moss); }
.pk-summary .hl { background: var(--ink); border-color: var(--ink); }
.pk-summary .hl b { color: var(--gold-hi); }
.doc .pkg-head td { padding-top: 8px; font-weight: 800; }
.doc .in-pkg td:first-child { padding-left: 10px; }
.doc .saved-line { margin-top: 10px; padding: 6px; border: 1.5px dashed var(--ink); font-weight: 800; }
@media (max-width: 700px) { .pk-summary { grid-template-columns: repeat(2, 1fr); } }

/* ---------- Toasts ---------- */
.toasts { position: fixed; right: 22px; bottom: 22px; display: flex; flex-direction: column; gap: 10px; z-index: 80; }
.toast { background: var(--ink); color: var(--paper); padding: 12px 16px; border-radius: 10px; box-shadow: 4px 4px 0 var(--red); font-weight: 600; max-width: 380px; animation: pop .2s; }
.toast.ok { box-shadow: 4px 4px 0 var(--gold); }

/* ---------- Picker dropdown ---------- */
.picker { position: relative; }
.picker-list { position: absolute; z-index: 20; left: 0; right: 0; top: calc(100% + 6px); background: #fff; border: 1.5px solid var(--ink); border-radius: 10px; box-shadow: var(--shadow); max-height: 300px; overflow-y: auto; }
.picker-list button { display: flex; width: 100%; justify-content: space-between; gap: 10px; border: 0; background: transparent; padding: 10px 14px; text-align: left; cursor: pointer; border-bottom: 1px dashed var(--line); }
.picker-list button:hover, .picker-list button.hl { background: var(--teal-soft); }

/* ---------- Reports ---------- */
.tabs { display: flex; gap: 6px; margin-bottom: 18px; border-bottom: 1.5px solid var(--ink); }
.tabs button { border: 1.5px solid transparent; border-bottom: 0; background: transparent; padding: 10px 18px; font-weight: 800; cursor: pointer; border-radius: 10px 10px 0 0; margin-bottom: -1.5px; color: var(--muted); }
.tabs button.on { background: var(--card); border-color: var(--ink); color: var(--ink); }
.two-col { display: grid; grid-template-columns: 1fr 1fr; gap: 22px; }
.hbar { display: grid; grid-template-columns: 120px 1fr 110px; gap: 12px; align-items: center; padding: 8px 20px; }
.hbar .t { height: 14px; background: var(--paper-2); border-radius: 4px; overflow: hidden; }
.hbar .t span { display: block; height: 100%; background: var(--teal); }

.cat-cards { display: grid; grid-template-columns: repeat(auto-fill, minmax(230px, 1fr)); gap: 18px; }
.cat-card { padding: 0; overflow: hidden; }
.cat-card .top { height: 70px; position: relative; border-bottom: 1.5px solid var(--ink); }
.cat-card .top .count { position: absolute; right: 14px; bottom: -16px; background: var(--card); border: 1.5px solid var(--ink); border-radius: 30px; padding: 3px 12px; font-family: var(--f-mono); font-weight: 700; font-size: 12px; }
.cat-card .bd { padding: 20px 16px 14px; }
.cat-card h3 { font-size: 20px; }
.swatches { display: flex; gap: 8px; flex-wrap: wrap; }
.swatches label { width: 30px; height: 30px; border-radius: 8px; border: 1.5px solid var(--ink); cursor: pointer; display: block; position: relative; }
.swatches input { position: absolute; opacity: 0; }
.swatches input:checked + span { position: absolute; inset: 4px; border: 2px solid #fff; border-radius: 4px; }

.pager { display: flex; gap: 10px; align-items: center; justify-content: flex-end; padding: 12px 16px; border-top: 1px dashed var(--line); }

/* ---------- Login ---------- */
.login { display: grid; grid-template-columns: 1.1fr 1fr; min-height: 100vh; }
.login-art { background: var(--ink); color: var(--paper); padding: 48px 56px; display: flex; flex-direction: column; position: relative; overflow: hidden; }
.login-art h1 { font-size: clamp(44px, 6vw, 86px); line-height: .95; margin-top: auto; }
.login-art h1 em { color: var(--gold); font-style: italic; }
.login-art p { color: #a9a291; max-width: 420px; font-size: 15px; line-height: 1.6; }
.login-art .paper-roll {
  position: absolute; right: 56px; top: -10px; width: 210px; background: #fff; color: var(--ink);
  font-family: var(--f-mono); font-size: 11px; padding: 22px 18px 28px; transform: rotate(4deg);
  box-shadow: 8px 8px 0 var(--gold); animation: roll 1.1s ease-out;
}
.login-art .paper-roll::after { content: ""; position: absolute; left: 0; right: 0; bottom: -10px; height: 10px; background: linear-gradient(-45deg, transparent 7px, #fff 0) 0 0/14px 10px repeat-x, linear-gradient(45deg, transparent 7px, #fff 0) 0 0/14px 10px repeat-x; }
.paper-roll .r { display: flex; justify-content: space-between; padding: 2px 0; }
.paper-roll hr { border: 0; border-top: 1px dashed #000; margin: 8px 0; }
@keyframes roll { from { transform: translateY(-120%) rotate(4deg); } }
.login-form { display: grid; place-items: center; padding: 40px; }
.login-form .card { width: min(400px, 100%); padding: 32px 30px; }
.login-form h2 { font-size: 30px; margin-bottom: 4px; }
.login-form .stack { display: flex; flex-direction: column; gap: 16px; margin-top: 24px; }
.demo-creds { margin-top: 20px; font-size: 12px; color: var(--muted); border-top: 1px dashed var(--line); padding-top: 14px; }
.demo-creds code { font-family: var(--f-mono); background: var(--paper-2); padding: 1px 6px; border-radius: 4px; color: var(--ink); }

/* ---------- Responsive ---------- */
@media (max-width: 1180px) {
  .pos { grid-template-columns: 1fr 360px; }
  .dash-grid, .two-col { grid-template-columns: 1fr; }
  .dash-grid > .wide { grid-column: auto; }
}
@media (max-width: 900px) {
  .shell { grid-template-columns: 1fr; }
  .sidebar { position: fixed; left: 0; top: 0; z-index: 40; width: 240px; transform: translateX(-100%); transition: transform .2s; }
  .shell.nav-open .sidebar { transform: none; box-shadow: 8px 0 0 rgba(0,0,0,.2); }
  .icon-btn.menu-toggle { display: inline-grid; }
  .topbar, .view { padding-left: 16px; padding-right: 16px; }
  .pos { grid-template-columns: 1fr; }
  .receipt { position: static; max-height: none; }
  .login { grid-template-columns: 1fr; }
  .login-art { min-height: 260px; }
  .login-art .paper-roll { display: none; }
  .grid-form { grid-template-columns: 1fr; }
  .grid-form .span-2 { grid-column: auto; }
}

/* ---------- Print: just the receipt ---------- */
@media print {
  @page { size: 80mm auto; margin: 4mm; }
  body { background: #fff; }
  .sidebar, .topbar, .doc-actions, .toasts, .no-print { display: none !important; }
  .shell { display: block; }
  .view { padding: 0; }
  .card { border: 0; box-shadow: none; }
  .doc { max-width: none; padding: 0; font-size: 11px; }
}

/* ---- coupons */
.cpn-code, .cpn-tag { font-family: var(--f-mono); font-weight: 700; letter-spacing: .06em; border: 1.5px dashed var(--teal); background: var(--teal-soft); color: var(--teal); border-radius: 6px; padding: 1px 7px; font-size: 12px; white-space: nowrap; }
.rc-totals .r.cpn-row > span:first-child { display: inline-flex; align-items: center; gap: 5px; }
.rc-totals .r.cpn-row svg { width: 14px; height: 14px; }
.cpn-in { display: inline-flex; gap: 6px; align-items: center; }
.rc-totals .r .cpn-in .input { width: 110px; text-align: left; text-transform: uppercase; }
.cpn-in .btn-sm { height: 28px; }
.cpn-on { display: inline-flex; gap: 8px; align-items: center; font-family: var(--f-mono); color: var(--moss); font-weight: 700; }
.cpn-on .icon-btn { width: 24px; height: 24px; }
.cpn-warn { font-size: 11.5px; color: var(--red); background: var(--red-soft); border-radius: 6px; padding: 4px 8px; margin: 2px 0 4px; }
.cpn-hints { display: grid; gap: 6px; }
.cpn-hint { display: flex; align-items: center; gap: 8px; border: 1.5px dashed var(--teal); background: var(--teal-soft); border-radius: 10px; padding: 7px 9px; font-size: 12px; }
.cpn-hint > svg { width: 18px; height: 18px; flex: none; color: var(--teal); }
.cpn-hint .grow { flex: 1; min-width: 0; }
.cpn-hint .sub { display: block; color: var(--ink-2); font-size: 11px; margin-top: 2px; }
.cpn-hint .btn-sm { height: 28px; }
.cpn-preview { border: 2px dashed var(--teal); background: var(--teal-soft); border-radius: 12px; padding: 12px 14px; text-align: center; display: grid; gap: 4px; }
.cpn-preview .cpn-big { font-family: var(--f-display); font-size: 26px; font-weight: 800; color: var(--teal); }
.cpn-ticket { border: 2px dashed var(--ink); border-radius: 12px; margin: 12px 0; padding: 12px 10px; text-align: center; }
.cpn-ticket .cpn-kicker { font-family: var(--f-mono); font-size: 10px; letter-spacing: .14em; text-transform: uppercase; }
.cpn-ticket .cpn-big { font-family: var(--f-display); font-size: 30px; font-weight: 800; line-height: 1.15; margin: 4px 0 2px; }
.cpn-ticket .cpn-on { display: block; color: var(--ink); font-weight: 600; font-family: inherit; }
.cpn-ticket .cpn-title { margin: 6px 0 8px; font-style: italic; }
.cpn-codebox { display: inline-flex; flex-direction: column; border: 2px solid var(--ink); border-radius: 8px; padding: 4px 16px; }
.cpn-codebox span { font-size: 9px; letter-spacing: .2em; }
.cpn-codebox b { font-family: var(--f-mono); font-size: 20px; letter-spacing: .12em; }
.tbl .sub .p-brand { color: var(--ink-2); font-weight: 700; }
