/* =========================================================================
   QuickGlance — design system
   Palette is sampled from the logo: magenta #E4157E → violet #6D28D9
   ========================================================================= */

:root {
  --brand-50:  #fdf2f8;
  --brand-100: #fce7f3;
  --brand-200: #fbcfe8;
  --brand-300: #f9a8d4;
  --brand-400: #f472b6;
  --brand-500: #e4157e;
  --brand-600: #c2136e;
  --brand-700: #9d0f59;
  --violet-500:#8b5cf6;
  --violet-600:#7c3aed;
  --violet-700:#6d28d9;

  --grad-brand: linear-gradient(135deg, #e4157e 0%, #a21caf 55%, #6d28d9 100%);
  --grad-soft:  linear-gradient(135deg, rgba(228,21,126,.10), rgba(109,40,217,.10));
  --grad-sheen: linear-gradient(120deg, rgba(255,255,255,.35), rgba(255,255,255,0) 60%);

  --bg:        #f6f4fb;
  --surface:   #ffffff;
  --surface-2: #fbfaff;
  --border:    #ebe7f4;
  --text:      #1b1524;
  --text-soft: #6b6480;
  --text-dim:  #9a94ad;

  --success: #0f9d6e;
  --success-bg: #e8f8f2;
  --warning: #b7791f;
  --warning-bg: #fdf6e3;
  --danger:  #d92d20;
  --danger-bg: #fdecea;
  --info:    #1570ef;
  --info-bg: #eaf2fe;

  --radius-sm: 8px;
  --radius:    14px;
  --radius-lg: 20px;
  --shadow-xs: 0 1px 2px rgba(27,21,36,.05);
  --shadow-sm: 0 2px 8px rgba(27,21,36,.06);
  --shadow:    0 8px 24px rgba(27,21,36,.08);
  --shadow-lg: 0 20px 48px rgba(27,21,36,.14);

  --sidebar-w: 256px;
  --header-h:  68px;
  --font: "Plus Jakarta Sans", "Inter", -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
}

[data-theme="dark"] {
  --bg:        #12101a;
  --surface:   #1a1724;
  --surface-2: #211d2e;
  --border:    #2d2840;
  --text:      #f3f0fa;
  --text-soft: #a9a2bd;
  --text-dim:  #7d7694;
  --brand-50:  #2a1425;
  --brand-100: #3a1730;
  --success-bg:#10291f;
  --warning-bg:#2b2412;
  --danger-bg: #2e1615;
  --info-bg:   #10203a;
  --shadow-xs: 0 1px 2px rgba(0,0,0,.4);
  --shadow-sm: 0 2px 8px rgba(0,0,0,.4);
  --shadow:    0 8px 24px rgba(0,0,0,.45);
  --shadow-lg: 0 20px 48px rgba(0,0,0,.55);
}

* { box-sizing: border-box; }

html, body { height: 100%; }

body {
  margin: 0;
  font-family: var(--font);
  background: var(--bg);
  color: var(--text);
  font-size: 14.5px;
  line-height: 1.55;
  -webkit-font-smoothing: antialiased;
}

a { color: var(--brand-600); text-decoration: none; }
a:hover { text-decoration: underline; }

h1, h2, h3, h4 { margin: 0 0 .35rem; font-weight: 700; letter-spacing: -.015em; }
h1 { font-size: 1.5rem; }
h2 { font-size: 1.1rem; }
h3 { font-size: .98rem; }
p  { margin: 0 0 .75rem; }

/* ---------- App shell ---------------------------------------------------- */

.layout { display: flex; min-height: 100vh; }

.sidebar {
  width: var(--sidebar-w);
  flex: 0 0 var(--sidebar-w);
  background: var(--surface);
  border-right: 1px solid var(--border);
  display: flex;
  flex-direction: column;
  position: sticky;
  top: 0;
  height: 100vh;
  z-index: 40;
}

.sidebar__brand {
  padding: 18px 18px 14px;
  border-bottom: 1px solid var(--border);
}
.sidebar__brand img { width: 100%; max-width: 190px; height: auto; display: block; }
[data-theme="dark"] .sidebar__brand img { filter: brightness(1.12); }

.sidebar__scope {
  margin: 14px 14px 6px;
  padding: 10px 12px;
  border-radius: var(--radius);
  background: var(--grad-soft);
  border: 1px solid var(--border);
}
.sidebar__scope .label { font-size: .68rem; text-transform: uppercase; letter-spacing: .08em; color: var(--text-dim); font-weight: 700; }
.sidebar__scope .value { font-weight: 700; font-size: .92rem; }

.nav { padding: 8px 12px 16px; overflow-y: auto; flex: 1; }
.nav__section { font-size: .66rem; text-transform: uppercase; letter-spacing: .1em; color: var(--text-dim); font-weight: 800; padding: 14px 10px 6px; }
.nav__link {
  display: flex; align-items: center; gap: 11px;
  padding: 9px 11px; margin-bottom: 2px;
  border-radius: 11px;
  color: var(--text-soft);
  font-weight: 600; font-size: .88rem;
  transition: background .15s ease, color .15s ease, transform .15s ease;
}
.nav__link:hover { background: var(--surface-2); color: var(--text); text-decoration: none; transform: translateX(2px); }
.nav__link.is-active { background: var(--grad-brand); color: #fff; box-shadow: 0 6px 16px rgba(196,25,126,.32); }
.nav__link.is-active .nav__icon { opacity: 1; }
.nav__icon { width: 18px; height: 18px; flex: 0 0 18px; opacity: .75; }
.nav__badge { margin-left: auto; background: var(--danger-bg); color: var(--danger); font-size: .68rem; font-weight: 800; padding: 1px 7px; border-radius: 99px; }
.nav__link.is-active .nav__badge { background: rgba(255,255,255,.25); color: #fff; }

.sidebar__foot { padding: 12px 14px 16px; border-top: 1px solid var(--border); }

.main { flex: 1; min-width: 0; display: flex; flex-direction: column; }

.topbar {
  height: var(--header-h);
  display: flex; align-items: center; gap: 14px;
  padding: 0 24px;
  background: color-mix(in srgb, var(--surface) 88%, transparent);
  backdrop-filter: blur(10px);
  border-bottom: 1px solid var(--border);
  position: sticky; top: 0; z-index: 30;
}
.topbar__title { font-weight: 800; font-size: 1.12rem; letter-spacing: -.02em; }
.topbar__sub { font-size: .76rem; color: var(--text-dim); }
.topbar__spacer { flex: 1; }
.topbar__logo { display: none; height: 30px; }

.content { padding: 24px; flex: 1; }
.content--narrow { max-width: 860px; }

/* ---------- Cards -------------------------------------------------------- */

.card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-xs);
  padding: 20px;
}
.card + .card { margin-top: 18px; }
.card__head { display: flex; align-items: center; gap: 12px; margin-bottom: 16px; }
.card__head h2, .card__head h3 { margin: 0; }
.card__head .spacer { flex: 1; }
.card__sub { color: var(--text-dim); font-size: .8rem; }
.card--flush { padding: 0; overflow: hidden; }
.card--flush .card__head { padding: 18px 20px 0; margin-bottom: 12px; }

.grid { display: grid; gap: 18px; }
.grid--2 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.grid--3 { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.grid--4 { grid-template-columns: repeat(4, minmax(0, 1fr)); }
.grid--sidebar { grid-template-columns: minmax(0, 2fr) minmax(280px, 1fr); }
.grid--pos { grid-template-columns: minmax(0, 1fr) 360px; align-items: start; }

/* ---------- Stat tiles --------------------------------------------------- */

.stat {
  position: relative;
  overflow: hidden;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 18px 18px 16px;
  box-shadow: var(--shadow-xs);
}
.stat::after {
  content: "";
  position: absolute; inset: 0;
  background: var(--grad-sheen);
  opacity: 0; transition: opacity .25s ease;
  pointer-events: none;
}
.stat:hover::after { opacity: .5; }
.stat__label { font-size: .74rem; text-transform: uppercase; letter-spacing: .07em; color: var(--text-dim); font-weight: 800; }
.stat__value { font-size: 1.72rem; font-weight: 800; letter-spacing: -.03em; margin-top: 6px; line-height: 1.15; }
.stat__meta { font-size: .78rem; color: var(--text-soft); margin-top: 4px; }
.stat__icon {
  position: absolute; right: 14px; top: 14px;
  width: 38px; height: 38px; border-radius: 12px;
  display: grid; place-items: center;
  background: var(--grad-soft); color: var(--brand-600);
}
.stat--brand { background: var(--grad-brand); border: none; color: #fff; }
.stat--brand .stat__label, .stat--brand .stat__meta { color: rgba(255,255,255,.82); }
.stat--brand .stat__icon { background: rgba(255,255,255,.18); color: #fff; }

/* ---------- Tables ------------------------------------------------------- */

.table-wrap { overflow-x: auto; -webkit-overflow-scrolling: touch; }
table.table { width: 100%; border-collapse: collapse; font-size: .875rem; }
.table th {
  text-align: left; font-size: .7rem; text-transform: uppercase; letter-spacing: .07em;
  color: var(--text-dim); font-weight: 800;
  padding: 10px 14px; border-bottom: 1px solid var(--border); white-space: nowrap;
  background: var(--surface-2); position: sticky; top: 0; z-index: 1;
}
.table td { padding: 11px 14px; border-bottom: 1px solid var(--border); vertical-align: middle; }
.table tbody tr:last-child td { border-bottom: none; }
.table tbody tr:hover td { background: var(--surface-2); }
.table .num { text-align: right; font-variant-numeric: tabular-nums; white-space: nowrap; }
.table .strong { font-weight: 700; }
.table tfoot td { font-weight: 800; background: var(--surface-2); border-top: 2px solid var(--border); }
.table--compact td, .table--compact th { padding: 8px 10px; }
.empty { padding: 38px 20px; text-align: center; color: var(--text-dim); }
.empty__icon { font-size: 1.8rem; display: block; margin-bottom: 6px; opacity: .6; }

/* ---------- Badges & pills ---------------------------------------------- */

.badge {
  display: inline-flex; align-items: center; gap: 5px;
  font-size: .72rem; font-weight: 800; letter-spacing: .02em;
  padding: 3px 9px; border-radius: 99px;
  background: var(--surface-2); color: var(--text-soft); border: 1px solid var(--border);
}
.badge--success { background: var(--success-bg); color: var(--success); border-color: transparent; }
.badge--warning { background: var(--warning-bg); color: var(--warning); border-color: transparent; }
.badge--danger  { background: var(--danger-bg);  color: var(--danger);  border-color: transparent; }
.badge--info    { background: var(--info-bg);    color: var(--info);    border-color: transparent; }
.badge--brand   { background: var(--brand-50);   color: var(--brand-600); border-color: transparent; }
.badge--dot::before { content: ""; width: 6px; height: 6px; border-radius: 99px; background: currentColor; }

.avatar {
  width: 34px; height: 34px; border-radius: 11px;
  display: grid; place-items: center;
  background: var(--grad-brand); color: #fff;
  font-weight: 800; font-size: .8rem; flex: 0 0 34px;
}
.avatar--sm { width: 26px; height: 26px; border-radius: 8px; font-size: .68rem; flex-basis: 26px; }

/* ---------- Buttons ------------------------------------------------------ */

.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  font-family: var(--font); font-weight: 700; font-size: .86rem;
  padding: 9px 16px; border-radius: 11px; border: 1px solid transparent;
  cursor: pointer; transition: transform .12s ease, box-shadow .2s ease, background .2s ease, opacity .2s;
  text-decoration: none; white-space: nowrap;
}
.btn:hover { text-decoration: none; }
.btn:active { transform: translateY(1px); }
.btn:disabled { opacity: .55; cursor: not-allowed; }
.btn--primary { background: var(--grad-brand); color: #fff; box-shadow: 0 6px 18px rgba(196,25,126,.3); }
.btn--primary:hover { box-shadow: 0 10px 24px rgba(196,25,126,.38); color: #fff; }
.btn--ghost { background: var(--surface); color: var(--text); border-color: var(--border); }
.btn--ghost:hover { background: var(--surface-2); }
.btn--soft { background: var(--brand-50); color: var(--brand-600); }
.btn--danger { background: var(--danger-bg); color: var(--danger); }
.btn--danger:hover { background: var(--danger); color: #fff; }
.btn--sm { padding: 6px 11px; font-size: .78rem; border-radius: 9px; }
.btn--lg { padding: 12px 22px; font-size: .95rem; border-radius: 13px; }
.btn--block { width: 100%; }
.btn--icon { padding: 8px; width: 34px; height: 34px; }

.btn-link { background: none; border: none; padding: 0; color: var(--brand-600); font-weight: 700; cursor: pointer; font-size: .8rem; font-family: var(--font); }
.btn-link:hover { text-decoration: underline; }
.btn-link--danger { color: var(--danger); }

/* ---------- Forms -------------------------------------------------------- */

.field { margin-bottom: 14px; }
.label {
  display: block; font-size: .74rem; font-weight: 800; letter-spacing: .04em;
  text-transform: uppercase; color: var(--text-dim); margin-bottom: 6px;
}
.input, .select, .textarea {
  width: 100%; font-family: var(--font); font-size: .9rem; color: var(--text);
  background: var(--surface);
  border: 1.5px solid var(--border); border-radius: 11px;
  padding: 10px 12px; transition: border-color .15s ease, box-shadow .15s ease;
}
.input:focus, .select:focus, .textarea:focus {
  outline: none; border-color: var(--brand-400);
  box-shadow: 0 0 0 4px rgba(228,21,126,.12);
}
.input:disabled, .select:disabled { background: var(--surface-2); color: var(--text-dim); cursor: not-allowed; }
.textarea { min-height: 84px; resize: vertical; }
.select {
  appearance: none;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='8' viewBox='0 0 12 8'%3E%3Cpath fill='%239a94ad' d='M1 1l5 5 5-5'/%3E%3C/svg%3E");
  background-repeat: no-repeat; background-position: right 12px center; padding-right: 32px;
}
.hint { font-size: .75rem; color: var(--text-dim); margin-top: 5px; }
.field-row { display: grid; gap: 12px; grid-template-columns: repeat(2, minmax(0, 1fr)); }
.field-row--3 { grid-template-columns: repeat(3, minmax(0, 1fr)); }

.switch { display: inline-flex; align-items: center; gap: 10px; cursor: pointer; font-size: .86rem; font-weight: 600; }
.switch input { position: absolute; opacity: 0; width: 0; height: 0; }
.switch__track {
  width: 42px; height: 24px; border-radius: 99px; background: var(--border);
  position: relative; transition: background .2s ease; flex: 0 0 42px;
}
.switch__track::after {
  content: ""; position: absolute; top: 3px; left: 3px;
  width: 18px; height: 18px; border-radius: 99px; background: #fff;
  box-shadow: var(--shadow-xs); transition: transform .2s ease;
}
.switch input:checked + .switch__track { background: var(--grad-brand); }
.switch input:checked + .switch__track::after { transform: translateX(18px); }

.checkbox { display: inline-flex; align-items: center; gap: 8px; font-size: .85rem; cursor: pointer; }
.checkbox input { width: 16px; height: 16px; accent-color: var(--brand-500); }

/* ---------- Toolbar / filters ------------------------------------------- */

.toolbar { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; margin-bottom: 18px; }
.toolbar .spacer { flex: 1; }
.toolbar .input, .toolbar .select { width: auto; min-width: 150px; }

.tabs { display: flex; gap: 4px; background: var(--surface-2); padding: 4px; border-radius: 12px; border: 1px solid var(--border); }
.tabs a { padding: 7px 14px; border-radius: 9px; font-size: .84rem; font-weight: 700; color: var(--text-soft); }
.tabs a:hover { text-decoration: none; color: var(--text); }
.tabs a.is-active { background: var(--surface); color: var(--brand-600); box-shadow: var(--shadow-xs); }

/* ---------- Alerts / toasts --------------------------------------------- */

.alert {
  display: flex; gap: 10px; align-items: flex-start;
  padding: 12px 14px; border-radius: var(--radius); font-size: .86rem;
  margin-bottom: 16px; border: 1px solid transparent;
}
.alert--success { background: var(--success-bg); color: var(--success); }
.alert--error   { background: var(--danger-bg);  color: var(--danger); }
.alert--info    { background: var(--info-bg);    color: var(--info); }
.alert--warning { background: var(--warning-bg); color: var(--warning); }

.toasts { position: fixed; right: 20px; top: 20px; z-index: 200; display: flex; flex-direction: column; gap: 10px; max-width: 380px; }
.toast {
  background: var(--surface); border: 1px solid var(--border); border-left: 4px solid var(--brand-500);
  border-radius: var(--radius); padding: 12px 14px; box-shadow: var(--shadow-lg);
  font-size: .87rem; animation: toast-in .28s cubic-bezier(.2,.9,.3,1.2);
}
.toast--success { border-left-color: var(--success); }
.toast--error   { border-left-color: var(--danger); }
.toast--info    { border-left-color: var(--info); }
@keyframes toast-in { from { opacity: 0; transform: translateX(24px); } to { opacity: 1; transform: none; } }

/* ---------- Modal -------------------------------------------------------- */

.modal-backdrop {
  position: fixed; inset: 0; background: rgba(20,14,28,.5);
  backdrop-filter: blur(3px); z-index: 100;
  display: flex; align-items: center; justify-content: center; padding: 20px;
}
.modal {
  background: var(--surface); border-radius: var(--radius-lg); box-shadow: var(--shadow-lg);
  width: 100%; max-width: 540px; max-height: 90vh; overflow-y: auto;
  animation: modal-in .22s cubic-bezier(.2,.9,.3,1.1);
}
.modal--wide { max-width: 760px; }
.modal__head { padding: 18px 22px; border-bottom: 1px solid var(--border); display: flex; align-items: center; gap: 12px; }
.modal__head .spacer { flex: 1; }
.modal__body { padding: 20px 22px; }
.modal__foot { padding: 14px 22px; border-top: 1px solid var(--border); display: flex; gap: 10px; justify-content: flex-end; background: var(--surface-2); border-radius: 0 0 var(--radius-lg) var(--radius-lg); }
@keyframes modal-in { from { opacity: 0; transform: translateY(12px) scale(.98); } to { opacity: 1; transform: none; } }

/* ---------- Auth screens ------------------------------------------------- */

.auth {
  min-height: 100vh; display: grid; grid-template-columns: 1.05fr .95fr;
}
.auth__aside {
  background: var(--grad-brand); color: #fff;
  padding: 48px; display: flex; flex-direction: column; justify-content: space-between;
  position: relative; overflow: hidden;
}
.auth__aside::before, .auth__aside::after {
  content: ""; position: absolute; border-radius: 50%;
  background: rgba(255,255,255,.12);
}
.auth__aside::before { width: 420px; height: 420px; right: -140px; top: -120px; }
.auth__aside::after  { width: 300px; height: 300px; left: -90px; bottom: -110px; background: rgba(255,255,255,.08); }
.auth__logo { background: #fff; border-radius: var(--radius); padding: 14px 18px; display: inline-block; align-self: flex-start; box-shadow: var(--shadow); position: relative; }
.auth__logo img { height: 46px; display: block; }
.auth__pitch { position: relative; max-width: 440px; }
.auth__pitch h1 { font-size: 2.1rem; line-height: 1.2; }
.auth__pitch p { color: rgba(255,255,255,.88); font-size: 1rem; }
.auth__features { list-style: none; padding: 0; margin: 22px 0 0; display: grid; gap: 10px; }
.auth__features li { display: flex; gap: 10px; align-items: center; font-weight: 600; font-size: .92rem; }
.auth__features .tick { width: 22px; height: 22px; border-radius: 7px; background: rgba(255,255,255,.2); display: grid; place-items: center; flex: 0 0 22px; }
.auth__panel { display: flex; align-items: center; justify-content: center; padding: 40px 28px; background: var(--bg); }
.auth__card { width: 100%; max-width: 400px; }
.auth__card .mobile-logo { display: none; margin: 0 auto 22px; max-width: 220px; }

.otp-input {
  letter-spacing: .6em; font-size: 1.5rem; text-align: center; font-weight: 800;
  padding: 14px 12px; font-variant-numeric: tabular-nums;
}

.qr-box {
  display: grid; place-items: center; padding: 16px; background: #fff;
  border: 1px solid var(--border); border-radius: var(--radius); width: max-content; margin: 0 auto;
}
.secret-key {
  font-family: ui-monospace, SFMono-Regular, Menlo, monospace;
  background: var(--surface-2); border: 1px dashed var(--border); border-radius: 10px;
  padding: 10px 12px; font-size: .95rem; letter-spacing: .06em; text-align: center; word-break: break-all;
}
.recovery-grid {
  display: grid; grid-template-columns: repeat(2, 1fr); gap: 8px;
  font-family: ui-monospace, SFMono-Regular, Menlo, monospace; font-size: .9rem;
}
.recovery-grid span { background: var(--surface-2); border: 1px solid var(--border); border-radius: 8px; padding: 8px 10px; text-align: center; }

/* ---------- POS ---------------------------------------------------------- */

.pos-line {
  border: 1px solid var(--border); border-radius: var(--radius); padding: 14px;
  margin-bottom: 12px; background: var(--surface-2);
  display: grid; gap: 10px; grid-template-columns: 2.2fr 1.3fr .7fr .8fr 1.1fr auto;
  align-items: end;
  animation: line-in .2s ease;
}
@keyframes line-in { from { opacity: 0; transform: translateY(-6px); } to { opacity: 1; transform: none; } }
.pos-line .field { margin: 0; }
.pos-line__remove { color: var(--danger); background: none; border: none; cursor: pointer; padding: 9px; border-radius: 9px; }
.pos-line__remove:hover { background: var(--danger-bg); }
.pos-summary { position: sticky; top: calc(var(--header-h) + 18px); }
.pos-summary__row { display: flex; justify-content: space-between; padding: 6px 0; font-size: .88rem; color: var(--text-soft); }
.pos-summary__row.total { border-top: 1px solid var(--border); margin-top: 8px; padding-top: 12px; font-size: 1.15rem; font-weight: 800; color: var(--text); }
.stock-hint { font-size: .72rem; color: var(--text-dim); }

/* ---------- Charts ------------------------------------------------------- */

.chart-wrap { position: relative; height: 280px; }
.chart-wrap--sm { height: 210px; }

.legend { display: flex; gap: 16px; flex-wrap: wrap; margin-top: 12px; font-size: .8rem; color: var(--text-soft); }
.legend span { display: inline-flex; align-items: center; gap: 6px; }
.legend i { width: 10px; height: 10px; border-radius: 3px; display: inline-block; }

.bar-mini { height: 6px; border-radius: 99px; background: var(--border); overflow: hidden; }
.bar-mini > i { display: block; height: 100%; background: var(--grad-brand); border-radius: 99px; }

/* ---------- Print (tax invoice) ------------------------------------------ */

.invoice-sheet {
  background: #fff; color: #111; max-width: 820px; margin: 24px auto; padding: 34px;
  border: 1px solid #e5e5e5; border-radius: 10px;
}
.invoice-sheet h1 { font-size: 1.3rem; }
.invoice-head { display: flex; justify-content: space-between; gap: 24px; border-bottom: 2px solid #eee; padding-bottom: 18px; margin-bottom: 18px; }
.invoice-head img { height: 52px; }
.invoice-meta { display: grid; grid-template-columns: repeat(2, 1fr); gap: 18px; margin-bottom: 18px; font-size: .86rem; }
.invoice-table { width: 100%; border-collapse: collapse; font-size: .84rem; }
.invoice-table th { background: #faf7fb; text-align: left; padding: 9px; border: 1px solid #ececec; font-size: .72rem; text-transform: uppercase; letter-spacing: .05em; }
.invoice-table td { padding: 9px; border: 1px solid #ececec; }
.invoice-total-row td { font-weight: 800; background: #faf7fb; }
.invoice-foot { margin-top: 20px; display: flex; justify-content: space-between; gap: 20px; font-size: .8rem; color: #555; }
.cancel-stamp {
  border: 3px solid var(--danger); color: var(--danger); font-weight: 900; letter-spacing: .1em;
  padding: 6px 14px; border-radius: 8px; transform: rotate(-8deg); display: inline-block;
}

@media print {
  .no-print, .sidebar, .topbar, .toasts { display: none !important; }
  body { background: #fff; }
  .invoice-sheet { border: none; margin: 0; max-width: none; padding: 0; }
}

/* ---------- Utilities ---------------------------------------------------- */

.flex { display: flex; }
.flex-center { display: flex; align-items: center; }
.gap-6 { gap: 6px; } .gap-10 { gap: 10px; } .gap-16 { gap: 16px; }
.spacer { flex: 1; }
.mt-0 { margin-top: 0; } .mt-8 { margin-top: 8px; } .mt-16 { margin-top: 16px; } .mt-24 { margin-top: 24px; }
.mb-0 { margin-bottom: 0; } .mb-8 { margin-bottom: 8px; } .mb-16 { margin-bottom: 16px; }
.text-soft { color: var(--text-soft); }
.text-dim { color: var(--text-dim); }
.text-sm { font-size: .82rem; }
.text-xs { font-size: .74rem; }
.text-right { text-align: right; }
.text-center { text-align: center; }
.strong { font-weight: 700; }
.num { font-variant-numeric: tabular-nums; }
.pos { color: var(--success); }
.neg { color: var(--danger); }
.nowrap { white-space: nowrap; }
.hide { display: none !important; }

/* ---------- Responsive --------------------------------------------------- */

.sidebar__close, .hamburger { display: none; }

@media (max-width: 1180px) {
  .grid--4 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .grid--pos { grid-template-columns: 1fr; }
  .pos-summary { position: static; }
}

@media (max-width: 980px) {
  .auth { grid-template-columns: 1fr; }
  .auth__aside { display: none; }
  .auth__card .mobile-logo { display: block; }
  .grid--sidebar, .grid--3 { grid-template-columns: 1fr; }
  .pos-line { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}

@media (max-width: 760px) {
  .sidebar {
    position: fixed; left: 0; top: 0; bottom: 0;
    transform: translateX(-100%); transition: transform .25s ease;
    box-shadow: var(--shadow-lg);
  }
  body.nav-open .sidebar { transform: none; }
  body.nav-open::after {
    content: ""; position: fixed; inset: 0; background: rgba(20,14,28,.45); z-index: 35;
  }
  .hamburger { display: inline-flex; }
  .sidebar__close { display: inline-flex; position: absolute; right: 10px; top: 14px; }
  .topbar { padding: 0 14px; }
  .topbar__logo { display: block; }
  .topbar__title { font-size: 1rem; }
  .content { padding: 16px 14px 32px; }
  .grid, .grid--2, .grid--3, .grid--4 { grid-template-columns: 1fr; gap: 14px; }
  .field-row, .field-row--3 { grid-template-columns: 1fr; }
  .card { padding: 16px; border-radius: var(--radius); }
  .stat__value { font-size: 1.45rem; }
  .pos-line { grid-template-columns: 1fr; }
  .toasts { left: 12px; right: 12px; max-width: none; }
  .table th, .table td { padding: 9px 10px; }
  .recovery-grid { grid-template-columns: 1fr; }
}

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