/* EasyBill theme. All colours are tokens so the brand can be changed in one place. */

/* Inter is bundled (static/fonts, SIL OFL) so the app needs no internet. */
@font-face {
  font-family: "Inter";
  font-style: normal;
  font-weight: 100 900;
  font-display: swap;
  src: url("../fonts/inter-latin-wght-normal.woff2") format("woff2");
}
:root {
  --bg: #f4f6fb;
  --surface: #ffffff;
  --surface-2: #f8fafc;
  --border: #e6e9f0;
  --border-strong: #d5dae4;
  --text: #0f172a;
  --text-2: #334155;
  --muted: #64748b;
  --primary: #4f46e5;
  --primary-2: #7c3aed;
  --primary-ink: #ffffff;
  --primary-soft: #eef2ff;
  --primary-ring: rgba(79, 70, 229, .22);
  --danger: #dc2626;
  --danger-soft: #fef2f2;
  --warn: #b45309;
  --warn-soft: #fffbeb;
  --ok: #059669;
  --ok-soft: #ecfdf5;
  --info: #0284c7;
  --info-soft: #f0f9ff;
  --radius: 14px;
  --radius-sm: 10px;
  --shadow-sm: 0 1px 2px rgba(15, 23, 42, .05);
  --shadow: 0 1px 3px rgba(15, 23, 42, .06), 0 6px 24px -8px rgba(15, 23, 42, .08);
  --shadow-lg: 0 20px 50px -12px rgba(15, 23, 42, .25);
  --sidebar-w: 248px;
  font-size: 15px;
}

* { box-sizing: border-box; }
[hidden] { display: none !important; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0; background: var(--bg); color: var(--text);
  font-family: "Inter", system-ui, -apple-system, "Segoe UI", Roboto, "Noto Sans", "Noto Sans Malayalam", sans-serif;
  line-height: 1.5; -webkit-font-smoothing: antialiased;
}
a { color: var(--primary); text-decoration: none; }
a:hover { text-decoration: underline; }
h1 { font-size: 1.45rem; font-weight: 700; letter-spacing: -.02em; margin: 0; }
h2 { font-size: 1.02rem; font-weight: 650; letter-spacing: -.01em; margin: 1.75rem 0 .75rem; }
.card > h2:first-child, .card > form > h2:first-child { margin-top: 0; }
code { font-size: .85em; background: var(--surface-2); border: 1px solid var(--border); padding: .05rem .35rem; border-radius: 6px; }
pre { background: var(--surface-2); border: 1px solid var(--border); padding: .75rem; border-radius: var(--radius-sm); overflow-x: auto; }
.muted { color: var(--muted); }
.small { font-size: .85rem; }
.num { text-align: right; font-variant-numeric: tabular-nums; white-space: nowrap; }
.neg { color: var(--danger); }
.pos-amt { color: var(--ok); }
.i { width: 18px; height: 18px; flex: none; fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; vertical-align: -3px; }
.i.lg { width: 22px; height: 22px; }
.i.xl { width: 40px; height: 40px; stroke-width: 1.5; }

/* ------------------------------------------------------------------ layout */
.app { display: grid; grid-template-columns: var(--sidebar-w) 1fr; min-height: 100vh; }
.sidebar {
  background: var(--surface); border-right: 1px solid var(--border); padding: 1.1rem .85rem;
  position: sticky; top: 0; height: 100vh; overflow-y: auto; display: flex; flex-direction: column;
}
.brand { display: flex; align-items: center; gap: .7rem; padding: .2rem .45rem 1.1rem; color: var(--text); }
.brand:hover { text-decoration: none; }
.logo {
  width: 38px; height: 38px; border-radius: 11px; display: grid; place-items: center; flex: none;
  background: linear-gradient(135deg, var(--primary), var(--primary-2)); color: #fff; font-weight: 800; font-size: .95rem;
  box-shadow: 0 6px 16px -6px var(--primary);
}
.brand-name { font-weight: 750; letter-spacing: -.02em; line-height: 1.15; }
.brand-name small { display: block; font-weight: 500; color: var(--muted); font-size: .78rem; letter-spacing: 0; }
.sidebar .cta {
  display: flex; align-items: center; justify-content: center; gap: .5rem; padding: .7rem; border-radius: 12px; margin-bottom: 1rem;
  background: linear-gradient(135deg, var(--primary), var(--primary-2)); color: #fff; font-weight: 650;
  box-shadow: 0 8px 20px -10px var(--primary);
}
.sidebar .cta:hover { text-decoration: none; filter: brightness(1.05); }
.sidebar .cta .kbd { background: rgba(255,255,255,.18); border-color: rgba(255,255,255,.3); color: #fff; }
.nav a {
  display: flex; align-items: center; gap: .7rem; color: var(--text-2); padding: .52rem .65rem; border-radius: 10px;
  font-weight: 500; font-size: .93rem; margin-bottom: 1px;
}
.nav a .i { color: var(--muted); }
.nav a:hover { background: var(--surface-2); text-decoration: none; color: var(--text); }
.nav a.active { background: var(--primary-soft); color: var(--primary); font-weight: 600; }
.nav a.active .i { color: var(--primary); }
.nav .section { font-size: .7rem; font-weight: 650; text-transform: uppercase; letter-spacing: .08em; color: #94a3b8; margin: 1.1rem .65rem .35rem; }
.sidebar-foot { margin-top: auto; padding-top: 1rem; border-top: 1px solid var(--border); display: flex; align-items: center; gap: .6rem; }
.avatar {
  width: 36px; height: 36px; border-radius: 50%; display: grid; place-items: center; flex: none;
  background: var(--primary-soft); color: var(--primary); font-weight: 700; font-size: .8rem;
}
.who { min-width: 0; flex: 1; line-height: 1.2; }
.who b { display: block; font-size: .88rem; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.who span { font-size: .75rem; color: var(--muted); }
.icon-btn {
  display: inline-grid; place-items: center; width: 36px; height: 36px; border-radius: 10px; border: 1px solid transparent;
  background: transparent; color: var(--muted); cursor: pointer;
}
.icon-btn:hover { background: var(--surface-2); color: var(--text); border-color: var(--border); }
.icon-btn.danger:hover { background: var(--danger-soft); color: var(--danger); border-color: #fecaca; }

.main { padding: 1.5rem 2rem 3rem; min-width: 0; max-width: 1480px; width: 100%; }
.topbar { display: flex; justify-content: space-between; align-items: center; gap: 1rem; margin-bottom: 1.4rem; flex-wrap: wrap; }
.topbar .title { display: flex; align-items: center; gap: .75rem; min-width: 0; }
.topbar .subtitle { color: var(--muted); font-size: .85rem; margin-top: .1rem; }
.menu-toggle { display: none; }
.backdrop { display: none; }

@media (max-width: 900px) {
  .app { grid-template-columns: 1fr; }
  .sidebar { position: fixed; inset: 0 auto 0 0; width: min(290px, 85vw); z-index: 40; transform: translateX(-105%); transition: transform .22s ease; box-shadow: var(--shadow-lg); }
  .sidebar.open { transform: none; }
  .sidebar.open + .backdrop { display: block; position: fixed; inset: 0; background: rgba(15, 23, 42, .35); z-index: 30; }
  .menu-toggle { display: inline-grid; border-color: var(--border); background: var(--surface); }
  .main { padding: 1rem 1rem 3rem; }
  h1 { font-size: 1.25rem; }
}

/* -------------------------------------------------------------- components */
.card { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); padding: 1.2rem 1.3rem; box-shadow: var(--shadow-sm); }
.card + .card { margin-top: 1rem; }
.card-head { display: flex; align-items: center; justify-content: space-between; gap: .75rem; margin-bottom: .9rem; }
.card-head h2 { margin: 0; }
.grid { display: grid; gap: 1rem; }
.cards { grid-template-columns: repeat(auto-fill, minmax(215px, 1fr)); }
.two { grid-template-columns: repeat(auto-fit, minmax(340px, 1fr)); align-items: start; }
.stack > * + * { margin-top: 1rem; }

.metric { position: relative; display: flex; flex-direction: column; gap: .15rem; transition: box-shadow .15s, transform .15s; }
.metric:hover { box-shadow: var(--shadow); }
.metric .label { color: var(--muted); font-size: .82rem; font-weight: 550; display: flex; align-items: center; gap: .6rem; }
.metric .value { font-size: 1.6rem; font-weight: 750; letter-spacing: -.02em; font-variant-numeric: tabular-nums; margin-top: .35rem; }
.metric .hint { color: var(--muted); font-size: .78rem; }
.chip-icon { width: 34px; height: 34px; border-radius: 10px; display: grid; place-items: center; background: var(--primary-soft); color: var(--primary); flex: none; }
.chip-icon.ok { background: var(--ok-soft); color: var(--ok); }
.chip-icon.warn { background: var(--warn-soft); color: var(--warn); }
.chip-icon.danger { background: var(--danger-soft); color: var(--danger); }
.chip-icon.info { background: var(--info-soft); color: var(--info); }
.metric.hero { background: linear-gradient(135deg, var(--primary), var(--primary-2)); border: 0; color: #fff; box-shadow: 0 14px 30px -14px var(--primary); }
.metric.hero .label, .metric.hero .hint { color: rgba(255,255,255,.82); }
.metric.hero .chip-icon { background: rgba(255,255,255,.18); color: #fff; }
.metric.hero a { color: #fff; text-decoration: underline; }

.quick { display: grid; grid-template-columns: repeat(auto-fill, minmax(170px, 1fr)); gap: .75rem; margin-bottom: 1.25rem; }
.quick a {
  display: flex; align-items: center; gap: .7rem; padding: .85rem 1rem; background: var(--surface); border: 1px solid var(--border);
  border-radius: 12px; color: var(--text); font-weight: 600; font-size: .9rem; box-shadow: var(--shadow-sm); transition: all .15s;
}
.quick a:hover { text-decoration: none; border-color: var(--primary); box-shadow: 0 0 0 3px var(--primary-ring); }

.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: .45rem; padding: .55rem 1rem; border-radius: 10px;
  border: 1px solid var(--border-strong); background: var(--surface); color: var(--text); cursor: pointer;
  font: inherit; font-weight: 600; font-size: .9rem; line-height: 1.3; white-space: nowrap; box-shadow: var(--shadow-sm);
  transition: background .15s, border-color .15s, box-shadow .15s, transform .05s;
}
.btn:hover { text-decoration: none; background: var(--surface-2); border-color: #c4cad6; }
.btn:active { transform: translateY(1px); }
.btn.primary { background: var(--primary); border-color: var(--primary); color: var(--primary-ink); box-shadow: 0 6px 16px -8px var(--primary); }
.btn.primary:hover { background: #4338ca; border-color: #4338ca; }
.btn.danger { color: var(--danger); border-color: #fecaca; background: var(--surface); }
.btn.danger:hover { background: var(--danger-soft); }
.btn.ghost { border-color: transparent; box-shadow: none; background: transparent; color: var(--text-2); }
.btn.ghost:hover { background: var(--surface-2); }
.btn.lg { padding: .8rem 1.4rem; font-size: 1rem; border-radius: 12px; }
.btn.xl { padding: 1rem 1.4rem; font-size: 1.08rem; border-radius: 14px; width: 100%; }
.btn.small { padding: .35rem .7rem; font-size: .82rem; }
.btn.block { width: 100%; }
.btn:disabled { opacity: .5; cursor: not-allowed; transform: none; }
.actions { display: flex; gap: .5rem; flex-wrap: wrap; align-items: center; }

.table-wrap { overflow-x: auto; background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); box-shadow: var(--shadow-sm); }
table { width: 100%; border-collapse: collapse; }
th, td { padding: .72rem .9rem; border-bottom: 1px solid var(--border); text-align: left; vertical-align: middle; font-size: .9rem; }
th { font-size: .72rem; font-weight: 650; text-transform: uppercase; letter-spacing: .06em; color: var(--muted); background: var(--surface-2); }
tbody tr { transition: background .1s; }
tbody tr:hover { background: #fafbff; }
tbody tr:last-child td { border-bottom: 0; }
tfoot td { font-weight: 700; background: var(--surface-2); border-top: 1px solid var(--border); border-bottom: 0; }
td a { font-weight: 550; }
.card table td, .card table th { padding-left: .4rem; padding-right: .4rem; }
.card table th { background: transparent; }
.empty { text-align: center; padding: 2.5rem 1rem !important; color: var(--muted); }
.empty .i { display: block; margin: 0 auto .6rem; color: #cbd5e1; }

.badge { display: inline-flex; align-items: center; gap: .3rem; padding: .16rem .6rem; border-radius: 999px; font-size: .74rem; font-weight: 650; background: #f1f5f9; color: var(--muted); }
.badge::before { content: ""; width: 6px; height: 6px; border-radius: 50%; background: currentColor; opacity: .8; }
.badge.ok { background: var(--ok-soft); color: var(--ok); }
.badge.danger { background: var(--danger-soft); color: var(--danger); }
.badge.warn { background: var(--warn-soft); color: var(--warn); }
.badge.info { background: var(--primary-soft); color: var(--primary); }

/* ------------------------------------------------------------------- forms */
form p { margin: 0 0 1rem; }
label { display: block; font-weight: 600; font-size: .84rem; color: var(--text-2); margin-bottom: .35rem; }
input, select, textarea {
  font: inherit; font-size: .93rem; padding: .6rem .75rem; border: 1px solid var(--border-strong); border-radius: 10px;
  width: 100%; background: var(--surface); color: var(--text); transition: border-color .15s, box-shadow .15s;
}
input::placeholder, textarea::placeholder { color: #94a3b8; }
input:hover, select:hover, textarea:hover { border-color: #b8c0ce; }
input:focus, select:focus, textarea:focus { outline: none; border-color: var(--primary); box-shadow: 0 0 0 4px var(--primary-ring); }
.btn:focus-visible, a:focus-visible, .icon-btn:focus-visible { outline: none; box-shadow: 0 0 0 4px var(--primary-ring); }
input[type=checkbox] { width: 18px; height: 18px; accent-color: var(--primary); vertical-align: -3px; margin: 0 .35rem 0 0; }
input[type=file] { padding: .5rem; background: var(--surface-2); }
select { appearance: none; padding-right: 2.2rem; cursor: pointer;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%2364748b' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='m6 9 6 6 6-6'/%3E%3C/svg%3E");
  background-repeat: no-repeat; background-position: right .65rem center; background-size: 16px; }
label:has(input[type=checkbox]) { display: flex; align-items: center; font-weight: 550; cursor: pointer; padding-top: .5rem; }
.helptext { display: block; color: var(--muted); font-size: .78rem; margin-top: .3rem; font-weight: 400; }
.errorlist { color: var(--danger); margin: .3rem 0 0; padding: 0; list-style: none; font-size: .82rem; font-weight: 550; }
.form-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(240px, 1fr)); gap: 0 1.1rem; }
.form-narrow { max-width: 820px; }
.form-actions { display: flex; gap: .5rem; flex-wrap: wrap; padding-top: 1rem; margin-top: .25rem; border-top: 1px solid var(--border); }

.filters {
  display: flex; gap: .75rem; flex-wrap: wrap; align-items: end; margin-bottom: 1.1rem; padding: .85rem 1rem;
  background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); box-shadow: var(--shadow-sm);
}
.filters > div { min-width: 140px; }
.filters input, .filters select { padding: .45rem .7rem; font-size: .88rem; }
.filters select { padding-right: 2rem; }
.filters label { font-size: .72rem; color: var(--muted); text-transform: uppercase; letter-spacing: .05em; margin-bottom: .25rem; }
.filters label:has(input[type=checkbox]) { text-transform: none; letter-spacing: 0; font-size: .86rem; color: var(--text-2); padding-bottom: .5rem; }
.filters .period-label { margin-left: auto; color: var(--muted); font-size: .82rem; display: flex; align-items: center; gap: .35rem; padding-bottom: .55rem; }
.custom-range { display: contents; }
.custom-range[hidden] { display: none; }
.tabs { display: flex; gap: .35rem; flex-wrap: wrap; margin-bottom: 1rem; }
.tabs a { padding: .45rem .85rem; border-radius: 999px; font-size: .85rem; font-weight: 600; color: var(--text-2); background: var(--surface); border: 1px solid var(--border); }
.tabs a:hover { text-decoration: none; border-color: var(--border-strong); }
.tabs a.active { background: var(--text); border-color: var(--text); color: #fff; }

.messages { list-style: none; padding: 0; margin: 0 0 1rem; display: grid; gap: .5rem; }
.messages li {
  display: flex; align-items: center; gap: .6rem; padding: .75rem 1rem; border-radius: 12px; font-size: .9rem; font-weight: 550;
  background: var(--info-soft); color: var(--info); border: 1px solid #bae6fd; animation: slide-in .25s ease;
}
.messages li.error { background: var(--danger-soft); color: #b91c1c; border-color: #fecaca; }
.messages li.success { background: var(--ok-soft); color: #047857; border-color: #a7f3d0; }
.messages li a { color: inherit; text-decoration: underline; }
@keyframes slide-in { from { opacity: 0; transform: translateY(-4px); } }
.note { display: flex; gap: .6rem; background: var(--warn-soft); color: var(--warn); border: 1px solid #fde68a; padding: .75rem .9rem; border-radius: 12px; font-size: .86rem; }

.pagination { display: flex; gap: .5rem; align-items: center; justify-content: center; margin-top: 1.1rem; }
.kbd { display: inline-block; font-size: .7rem; font-weight: 600; font-family: ui-monospace, monospace; border: 1px solid var(--border-strong); border-bottom-width: 2px; border-radius: 5px; padding: 0 .35rem; color: var(--muted); background: var(--surface); }
.dl { display: grid; grid-template-columns: auto 1fr; gap: .45rem 1rem; margin: 0; font-size: .9rem; }
.dl dt { color: var(--muted); }
.dl dd { margin: 0; font-weight: 550; }

/* ---------------------------------------------------------------- auth */
.auth-wrap { display: grid; grid-template-columns: 1.05fr 1fr; min-height: 100vh; }
.auth-art {
  position: relative; overflow: hidden; color: #fff; padding: 3rem; display: flex; flex-direction: column; justify-content: space-between;
  background: radial-gradient(1200px 600px at -10% -20%, #818cf8 0%, transparent 60%), radial-gradient(800px 500px at 120% 120%, #a855f7 0%, transparent 55%), linear-gradient(135deg, #312e81, #4c1d95);
}
.auth-art h2 { font-size: 2.2rem; line-height: 1.15; letter-spacing: -.03em; margin: 0 0 1rem; max-width: 460px; }
.auth-art p { color: rgba(255,255,255,.8); max-width: 420px; font-size: 1.02rem; }
.auth-art ul { list-style: none; padding: 0; margin: 2rem 0 0; display: grid; gap: .8rem; }
.auth-art li { display: flex; gap: .7rem; align-items: center; color: rgba(255,255,255,.9); }
.auth-art li .i { background: rgba(255,255,255,.15); border-radius: 8px; padding: 5px; width: 28px; height: 28px; }
.auth-art .brand { color: #fff; padding: 0; }
.auth-art .logo { background: rgba(255,255,255,.18); box-shadow: none; }
.auth-form { display: grid; place-items: center; padding: 2rem 1.25rem; background: var(--surface); }
.auth-form .inner { width: 100%; max-width: 400px; }
.auth-form h1 { font-size: 1.7rem; margin-bottom: .35rem; }
.auth-form .lead { color: var(--muted); margin: 0 0 1.75rem; }
.auth-form input { padding: .75rem .9rem; }
.auth-form .foot { margin-top: 1.5rem; font-size: .88rem; color: var(--muted); text-align: center; }
.pw-field { position: relative; }
.pw-field input { padding-right: 4.2rem; }
.pw-field button { position: absolute; right: .35rem; top: 50%; transform: translateY(-50%); border: 0; background: none; color: var(--primary); font: inherit; font-size: .82rem; font-weight: 650; cursor: pointer; padding: .4rem .55rem; border-radius: 8px; }
@media (max-width: 900px) {
  .auth-wrap { grid-template-columns: 1fr; }
  .auth-art { padding: 1.5rem 1.25rem; }
  .auth-art h2, .auth-art p, .auth-art ul { display: none; }
}

/* ------------------------------------------------------------------- POS */
.pos { display: grid; grid-template-columns: minmax(0, 1fr) 390px; gap: 1.25rem; align-items: start; }
.pos-side { position: sticky; top: 1rem; display: grid; gap: 1rem; }
@media (max-width: 1100px) { .pos { grid-template-columns: 1fr; } .pos-side { position: static; } }

.search-box { position: relative; }
.search-input { position: relative; }
.search-input > .i { position: absolute; left: 1rem; top: 50%; transform: translateY(-50%); color: var(--muted); pointer-events: none; }
.search-input input { padding: .95rem 1rem .95rem 2.9rem; font-size: 1.05rem; border-radius: 12px; border-width: 1.5px; }
.search-input .kbd { position: absolute; right: .85rem; top: 50%; transform: translateY(-50%); }
.results {
  position: absolute; z-index: 20; left: 0; right: 0; background: var(--surface); border: 1px solid var(--border);
  border-radius: 12px; box-shadow: var(--shadow-lg); max-height: 360px; overflow-y: auto; margin-top: 6px; padding: .35rem;
}
.results button {
  display: flex; justify-content: space-between; align-items: center; gap: 1rem; width: 100%; padding: .65rem .75rem; background: none;
  border: 0; border-radius: 8px; text-align: left; font: inherit; font-size: .92rem; cursor: pointer; color: var(--text);
}
.results button:hover, .results button.active { background: var(--primary-soft); }
.results .meta { color: var(--muted); font-size: .8rem; white-space: nowrap; }
.results .price { font-weight: 700; }

.tiles { display: grid; grid-template-columns: repeat(auto-fill, minmax(140px, 1fr)); gap: .6rem; margin-top: 1rem; }
.tile {
  text-align: left; padding: .7rem .8rem; border: 1px solid var(--border); border-radius: 12px; background: var(--surface-2);
  cursor: pointer; font: inherit; color: var(--text); transition: all .12s; display: flex; flex-direction: column; gap: .15rem; min-height: 74px;
}
.tile:hover { border-color: var(--primary); background: var(--primary-soft); }
.tile:active { transform: scale(.98); }
.tile b { font-size: .86rem; font-weight: 600; line-height: 1.25; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.tile span { font-size: .8rem; color: var(--muted); margin-top: auto; display: flex; justify-content: space-between; }
.tile span strong { color: var(--primary); }
.tile.low span em { color: var(--warn); font-style: normal; }

.cart-list { display: grid; }
.cart-row {
  display: grid; grid-template-columns: minmax(0, 1fr) auto 108px 120px 36px; gap: .9rem; align-items: center;
  padding: .85rem .25rem; border-bottom: 1px solid var(--border);
}
.cart-row:last-child { border-bottom: 0; }
.cart-row .name b { display: block; font-weight: 600; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.cart-row .name span { font-size: .8rem; color: var(--muted); }
.cart-row .line-total { text-align: right; font-weight: 700; font-variant-numeric: tabular-nums; font-size: 1rem; }
.cart-row .line-total small { display: block; font-weight: 500; color: var(--muted); font-size: .74rem; }
.cart-row .field label { font-size: .68rem; text-transform: uppercase; letter-spacing: .05em; color: var(--muted); margin-bottom: .15rem; }
.cart-row .field input { padding: .4rem .55rem; text-align: right; font-size: .9rem; }
.stepper { display: inline-flex; align-items: center; border: 1px solid var(--border-strong); border-radius: 10px; overflow: hidden; background: var(--surface); }
.stepper button { width: 34px; height: 36px; border: 0; background: var(--surface-2); cursor: pointer; color: var(--text-2); display: grid; place-items: center; }
.stepper button:hover { background: var(--primary-soft); color: var(--primary); }
.stepper input { width: 58px; border: 0; border-radius: 0; text-align: center; padding: .4rem .2rem; font-weight: 650; box-shadow: none !important; }
.cart-empty { text-align: center; padding: 3rem 1rem; color: var(--muted); }
.cart-empty .i { color: #cbd5e1; display: block; margin: 0 auto .75rem; }
.cart-empty b { display: block; color: var(--text-2); margin-bottom: .2rem; }
@media (max-width: 640px) {
  .cart-row { grid-template-columns: 1fr auto; grid-template-areas: "name total" "qty disc" ; row-gap: .5rem; }
  .cart-row .name { grid-area: name; } .cart-row .line-total { grid-area: total; }
  .cart-row .qtycell { grid-area: qty; } .cart-row .field.disc { grid-area: disc; }
  .cart-row .field.price, .cart-row .remove { display: none; }
}

.customer-chosen { display: flex; align-items: center; gap: .7rem; padding: .55rem .65rem; border: 1px solid var(--border); border-radius: 12px; background: var(--surface-2); }
.customer-chosen b { display: block; font-size: .92rem; }
.customer-chosen span { font-size: .78rem; color: var(--muted); }
.customer-chosen .who { flex: 1; }

.summary { display: grid; gap: .35rem; font-size: .9rem; }
.summary .row { display: flex; justify-content: space-between; align-items: center; color: var(--text-2); }
.summary .row span:last-child { font-variant-numeric: tabular-nums; font-weight: 550; }
.summary .row input { width: 110px; text-align: right; padding: .35rem .55rem; }
.grand-total {
  margin-top: .6rem; padding: 1rem 1.1rem; border-radius: 12px; display: flex; justify-content: space-between; align-items: baseline;
  background: linear-gradient(135deg, var(--primary), var(--primary-2)); color: #fff;
}
.grand-total span { font-size: .85rem; font-weight: 600; opacity: .85; text-transform: uppercase; letter-spacing: .06em; }
.grand-total strong { font-size: 2rem; font-weight: 800; letter-spacing: -.03em; font-variant-numeric: tabular-nums; }

.methods { display: grid; grid-template-columns: repeat(5, 1fr); gap: .4rem; margin-bottom: .75rem; }
.method {
  display: flex; flex-direction: column; align-items: center; gap: .25rem; padding: .55rem .2rem; border: 1.5px solid var(--border);
  border-radius: 10px; background: var(--surface); cursor: pointer; font: inherit; font-size: .75rem; font-weight: 650; color: var(--text-2);
}
.method:hover { border-color: var(--border-strong); background: var(--surface-2); }
.method.on { border-color: var(--primary); background: var(--primary-soft); color: var(--primary); }
.amount-field { display: flex; align-items: center; gap: .5rem; }
.amount-field input { font-size: 1.1rem; font-weight: 700; text-align: right; }
.pay-row { display: grid; grid-template-columns: 1fr 120px 36px; gap: .4rem; margin-top: .5rem; }
.quick-cash { display: flex; flex-wrap: wrap; gap: .35rem; margin-top: .6rem; }
.quick-cash button { flex: 1; min-width: 56px; padding: .4rem .3rem; border: 1px solid var(--border); border-radius: 8px; background: var(--surface-2); font: inherit; font-size: .8rem; font-weight: 650; cursor: pointer; color: var(--text-2); }
.quick-cash button:hover { border-color: var(--primary); color: var(--primary); }
.change-box { margin-top: .6rem; padding: .65rem .8rem; border-radius: 10px; display: flex; justify-content: space-between; font-weight: 700; background: var(--ok-soft); color: #047857; }
.change-box.short { background: var(--danger-soft); color: #b91c1c; }
.pay-summary { display: flex; justify-content: space-between; gap: 1rem; margin-top: .85rem; padding-top: .75rem; border-top: 1px dashed var(--border-strong); font-size: .88rem; }
.pay-summary div span { display: block; color: var(--muted); font-size: .75rem; }
.pay-summary div b { font-variant-numeric: tabular-nums; font-size: 1rem; }
.save-bar { display: grid; gap: .5rem; }
.save-bar .btn.xl small { font-weight: 600; opacity: .85; margin-left: auto; font-variant-numeric: tabular-nums; }
.link-btn { background: none; border: 0; color: var(--primary); font: inherit; font-weight: 600; cursor: pointer; padding: .25rem 0; font-size: .86rem; }
.link-btn:disabled { color: var(--muted); cursor: not-allowed; }

@media print {
  .sidebar, .topbar .actions, .filters, .tabs, .menu-toggle { display: none !important; }
  .app { display: block; }
  .main { padding: 0; }
  .card, .table-wrap { box-shadow: none; }
}

/* fixes: grid children align; sidebar colour runs full height on long pages */
.grid > .card + .card, .grid > * { margin-top: 0; }
@media (min-width: 901px) {
  .app { background: linear-gradient(90deg, var(--surface) 0 calc(var(--sidebar-w) - 1px), var(--border) calc(var(--sidebar-w) - 1px) var(--sidebar-w), transparent var(--sidebar-w)); }
}
@media (max-width: 640px) {
  .search-input .kbd, .topbar .actions .kbd { display: none; }
  .topbar .actions:has(.kbd) { display: none; }
}
.pos-side > * { margin-top: 0 !important; }
.card > input[type=hidden]:first-child + h2 { margin-top: 0; }
