/* ==========================================================================
   O'dell Tech Shopping - interface design system
   --------------------------------------------------------------------------
   One stylesheet, one vocabulary. Components are defined once here and reused
   by every template; pages should not invent their own styles.

   Contents
     1  Design tokens          9  Forms & filters
     2  Reset & base          10  Alerts & toasts
     3  App shell             11  Pagination & empty states
     4  Sidebar               12  Dropdowns, modals & tabs
     5  Topbar & page head    13  POS terminal
     6  Buttons               14  Login
     7  Cards & stats         15  Invoice & charts
     8  Tables & badges       16  Responsive & print
   ========================================================================== */

/* -------------------------------------------------------- 1 design tokens */
:root {
  /* Brand. Amber is the action colour; navy carries the chrome. */
  --brand:          #f56a1c;
  --brand-dark:     #dd560c;
  --brand-soft:     #fff3ea;
  --brand-ring:     rgba(245, 106, 28, .18);

  --navy:           #0f2137;
  --navy-soft:      #17304c;
  --navy-line:      rgba(255, 255, 255, .09);

  /* Semantic - used only to communicate meaning, never for decoration. */
  --success:        #15a05a;
  --success-soft:   #e5f7ed;
  --warning:        #c2760b;
  --warning-soft:   #fdf3e0;
  --danger:         #dc2b2b;
  --danger-dark:    #b91c1c;
  --danger-soft:    #fdecec;
  --info:           #2563eb;
  --info-soft:      #e8f0fe;

  /* Neutrals */
  --bg:             #f4f6fa;
  --surface:        #ffffff;
  --surface-alt:    #f9fafc;
  --border:         #e6eaf1;
  --border-strong:  #d5dbe6;
  --text:           #16202e;
  --text-muted:     #64748b;
  --text-soft:      #94a3b8;

  /* Geometry */
  --radius-sm:      6px;
  --radius:         10px;
  --radius-lg:      14px;
  --radius-pill:    999px;

  --shadow-xs:      0 1px 2px rgba(15, 33, 55, .06);
  --shadow-sm:      0 1px 3px rgba(15, 33, 55, .07), 0 1px 2px rgba(15, 33, 55, .04);
  --shadow-md:      0 4px 14px rgba(15, 33, 55, .08);
  --shadow-lg:      0 18px 40px rgba(15, 33, 55, .16);

  /* Spacing scale (4px base) */
  --sp-1: 4px;  --sp-2: 8px;  --sp-3: 12px; --sp-4: 16px;
  --sp-5: 20px; --sp-6: 24px; --sp-8: 32px; --sp-10: 40px;

  --sidebar-w: 258px;
  --topbar-h:  64px;

  --font: "Segoe UI", -apple-system, BlinkMacSystemFont, Roboto, Helvetica, Arial,
          "Noto Sans", sans-serif;
}

/* --------------------------------------------------------- 2 reset & base */
*, *::before, *::after { box-sizing: border-box; }

html { -webkit-text-size-adjust: 100%; }

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

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

h1, h2, h3, h4 { margin: 0; font-weight: 600; letter-spacing: -.011em; color: var(--text); }

img { max-width: 100%; }

svg { flex: none; }

.icon {
  width: 18px; height: 18px;
  fill: none; stroke: currentColor;
  stroke-width: 1.9; stroke-linecap: round; stroke-linejoin: round;
}
.icon--sm { width: 15px; height: 15px; }
.icon--lg { width: 22px; height: 22px; }

/* Utility set - deliberately small, so pages reuse components not utilities. */
.muted   { color: var(--text-muted); }
.soft    { color: var(--text-soft); }
.small   { font-size: 12.5px; }
.nowrap  { white-space: nowrap; }
.num     { text-align: right; font-variant-numeric: tabular-nums; }
.strong  { font-weight: 600; }
.stack   { display: flex; flex-direction: column; gap: var(--sp-6); }
.row     { display: flex; align-items: center; gap: var(--sp-3); }
.spacer  { flex: 1; }
.grid-2  { display: grid; grid-template-columns: repeat(auto-fit, minmax(330px, 1fr)); gap: var(--sp-6); }
.grid-3  { display: grid; grid-template-columns: repeat(auto-fit, minmax(255px, 1fr)); gap: var(--sp-6); }
.sr-only {
  position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px;
  overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; border: 0;
}

/* ------------------------------------------------------------ 3 app shell */
.app { display: flex; min-height: 100vh; }

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

.content { padding: var(--sp-6) var(--sp-8) var(--sp-10); }

.scrim {
  position: fixed; inset: 0; z-index: 40;
  background: rgba(15, 33, 55, .45);
  opacity: 0; pointer-events: none; transition: opacity .18s ease;
}
.scrim.is-open { opacity: 1; pointer-events: auto; }

/* -------------------------------------------------------------- 4 sidebar */
.sidebar {
  width: var(--sidebar-w);
  flex: 0 0 var(--sidebar-w);
  background: var(--navy);
  color: #cbd5e1;
  display: flex;
  flex-direction: column;
  position: sticky;
  top: 0;
  height: 100vh;
  z-index: 50;
}

.sidebar__brand {
  display: flex;
  align-items: center;
  gap: 10px;
  height: var(--topbar-h);
  flex: none;
  padding: 0 var(--sp-5);
  border-bottom: 1px solid var(--navy-line);
  color: #fff;
  font-size: 15px;
  font-weight: 700;
  letter-spacing: -.02em;
  line-height: 1.15;
}
.sidebar__brand-link {
  display: flex; align-items: center; gap: 10px; min-width: 0;
  color: #fff; flex: 1;
}
.sidebar__brand-link:hover { text-decoration: none; color: #fff; }
.sidebar__mark {
  width: 32px; height: 32px; flex: none;
  border-radius: 9px;
  background: var(--brand);
  color: #fff;
  display: grid; place-items: center;
  font-size: 13px; font-weight: 700;
  box-shadow: 0 2px 8px rgba(245, 106, 28, .45);
}
.sidebar__brand-text { min-width: 0; overflow: hidden; }
.sidebar__brand-text b {
  display: block; font-weight: 700;
  overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
}
.sidebar__brand-text span {
  display: block;
  font-size: 10px;
  font-weight: 500;
  letter-spacing: .08em;
  text-transform: uppercase;
  color: #7f93ad;
}

.sidebar__nav {
  flex: 1;
  overflow-y: auto;
  padding: var(--sp-4) var(--sp-3) var(--sp-5);
  scrollbar-width: thin;
}
.sidebar__nav::-webkit-scrollbar { width: 6px; }
.sidebar__nav::-webkit-scrollbar-thumb { background: #2b415c; border-radius: 3px; }

.nav-group__label {
  padding: var(--sp-4) var(--sp-3) var(--sp-2);
  font-size: 10px;
  font-weight: 700;
  letter-spacing: .1em;
  text-transform: uppercase;
  color: #6b809b;
}
.nav-group:first-child .nav-group__label { padding-top: var(--sp-1); }

.nav-link {
  display: flex;
  align-items: center;
  gap: 11px;
  padding: 9px var(--sp-3);
  margin-bottom: 2px;
  border-radius: var(--radius-sm);
  color: #c3cfdd;
  font-size: 13.5px;
  font-weight: 500;
  position: relative;
}
.nav-link:hover { background: var(--navy-soft); color: #fff; text-decoration: none; }
.nav-link .icon { width: 17px; height: 17px; opacity: .82; }
.nav-link.is-active {
  background: var(--brand);
  color: #fff;
  font-weight: 600;
  box-shadow: 0 2px 10px rgba(245, 106, 28, .35);
}
.nav-link.is-active .icon { opacity: 1; }
.nav-link__badge {
  margin-left: auto;
  background: var(--danger);
  color: #fff;
  font-size: 10.5px;
  font-weight: 700;
  border-radius: var(--radius-pill);
  padding: 1px 7px;
}
.nav-link.is-active .nav-link__badge { background: rgba(0, 0, 0, .22); }
.nav-link__caret { margin-left: auto; transition: transform .18s ease; opacity: .7; }
.nav-link.is-open .nav-link__caret { transform: rotate(90deg); }

.nav-sub {
  display: flex;
  flex-direction: column;
  gap: 1px;
  margin: 2px 0 var(--sp-2) 26px;
  padding-left: 11px;
  border-left: 1px solid var(--navy-line);
}
.nav-link--sub {
  padding: 7px 10px;
  font-size: 13px;
  font-weight: 500;
  color: #9fb0c4;
  border-radius: var(--radius-sm);
}
.nav-link--sub:hover { background: var(--navy-soft); color: #fff; }
.nav-link--sub.is-active { background: var(--navy-soft); color: #fff; font-weight: 600; }
.nav-link--sub.is-active::before {
  content: ""; position: absolute; left: -12px; top: 50%;
  width: 3px; height: 15px; margin-top: -7px;
  background: var(--brand); border-radius: 2px;
}

.sidebar__foot {
  flex: none;
  padding: var(--sp-3) var(--sp-4);
  border-top: 1px solid var(--navy-line);
  font-size: 11.5px;
  color: #6b809b;
}

.sidebar__close {
  display: none;
  margin-left: auto;
  background: none; border: 0; color: #9fb0c4; cursor: pointer; padding: 4px;
}

/* --------------------------------------------------- 5 topbar & page head */
.topbar {
  height: var(--topbar-h);
  flex: none;
  display: flex;
  align-items: center;
  gap: var(--sp-3);
  padding: 0 var(--sp-8);
  background: var(--surface);
  border-bottom: 1px solid var(--border);
  position: sticky;
  top: 0;
  z-index: 30;
}

.icon-btn {
  width: 36px; height: 36px;
  display: grid; place-items: center;
  border: 1px solid transparent;
  border-radius: var(--radius-sm);
  background: transparent;
  color: var(--text-muted);
  cursor: pointer;
  padding: 0;
}
.icon-btn:hover { background: var(--surface-alt); color: var(--text); border-color: var(--border); text-decoration: none; }
.icon-btn--ghost { border-color: var(--border); background: var(--surface); }

.topbar__toggle { display: none; }

.topbar__search { position: relative; flex: 1; max-width: 340px; }
.topbar__search .icon {
  position: absolute; left: 11px; top: 50%; margin-top: -9px;
  color: var(--text-soft); pointer-events: none;
}
.topbar__search input {
  width: 100%;
  height: 38px;
  padding: 0 var(--sp-3) 0 36px;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  background: var(--surface-alt);
  font: inherit;
  font-size: 13.5px;
  color: var(--text);
}
.topbar__search input:focus {
  outline: none;
  background: var(--surface);
  border-color: var(--brand);
  box-shadow: 0 0 0 3px var(--brand-ring);
}

.user-chip {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 5px 9px 5px 6px;
  border: 1px solid var(--border);
  border-radius: var(--radius-pill);
  background: var(--surface);
  color: var(--text);
  cursor: pointer;
  font: inherit;
  text-align: left;
}
.user-chip:hover { background: var(--surface-alt); text-decoration: none; color: var(--text); }
.user-chip__avatar {
  width: 30px; height: 30px; flex: none;
  border-radius: 50%;
  background: var(--navy);
  color: #fff;
  display: grid; place-items: center;
  font-size: 12px; font-weight: 700;
}
.user-chip__text { min-width: 0; }
.user-chip__name { font-size: 13px; font-weight: 600; line-height: 1.2; }
.user-chip__role { font-size: 11px; color: var(--text-muted); line-height: 1.2; }

.page-head {
  display: flex;
  align-items: flex-end;
  flex-wrap: wrap;
  gap: var(--sp-4);
  margin-bottom: var(--sp-6);
}
.page-head__text { min-width: 0; flex: 1; }
.topbar__title { font-size: 21px; font-weight: 700; letter-spacing: -.02em; }
.page-head__sub { color: var(--text-muted); font-size: 13px; margin-top: 2px; }
.page-head__actions { display: flex; flex-wrap: wrap; gap: var(--sp-2); align-items: center; }

.crumbs {
  display: flex; align-items: center; flex-wrap: wrap; gap: 6px;
  font-size: 12px; color: var(--text-soft); margin-bottom: 5px;
}
.crumbs a { color: var(--text-muted); }
.crumbs .icon { width: 13px; height: 13px; }

/* -------------------------------------------------------------- 6 buttons */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 7px;
  height: 38px;
  padding: 0 var(--sp-4);
  border: 1px solid transparent;
  border-radius: var(--radius-sm);
  background: var(--brand);
  color: #fff;
  font: inherit;
  font-size: 13.5px;
  font-weight: 600;
  cursor: pointer;
  white-space: nowrap;
  transition: background .14s ease, border-color .14s ease, color .14s ease;
}
.btn:hover { background: var(--brand-dark); color: #fff; text-decoration: none; }
.btn:focus-visible { outline: 2px solid var(--brand); outline-offset: 2px; }
.btn:disabled, .btn[aria-disabled="true"] { opacity: .5; cursor: not-allowed; }
.btn .icon { width: 16px; height: 16px; }

.btn--ghost { background: var(--surface); border-color: var(--border-strong); color: var(--text); }
.btn--ghost:hover { background: var(--surface-alt); border-color: var(--text-soft); color: var(--text); }

.btn--secondary { background: var(--navy); }
.btn--secondary:hover { background: var(--navy-soft); }

.btn--success { background: var(--success); }
.btn--success:hover { background: #118049; }

.btn--danger { background: var(--danger); }
.btn--danger:hover { background: var(--danger-dark); }

.btn--info { background: var(--info); }
.btn--info:hover { background: #1d4ed8; }

.btn--sm { height: 31px; padding: 0 11px; font-size: 12.5px; gap: 5px; }
.btn--sm .icon { width: 14px; height: 14px; }
.btn--lg { height: 46px; padding: 0 var(--sp-6); font-size: 15px; }
.btn--block { width: 100%; }
.btn--icon { width: 31px; padding: 0; }

/* Compact square action buttons used in table rows. */
.act {
  display: inline-grid; place-items: center;
  width: 30px; height: 30px;
  border-radius: var(--radius-sm);
  border: 1px solid var(--border);
  background: var(--surface);
  color: var(--text-muted);
  cursor: pointer;
  padding: 0;
}
.act:hover { text-decoration: none; }
.act--view:hover   { border-color: var(--info);    color: var(--info);    background: var(--info-soft); }
.act--edit:hover   { border-color: var(--brand);   color: var(--brand);   background: var(--brand-soft); }
.act--ok:hover     { border-color: var(--success); color: var(--success); background: var(--success-soft); }
.act--danger:hover { border-color: var(--danger);  color: var(--danger);  background: var(--danger-soft); }
.act-group { display: inline-flex; gap: 6px; justify-content: flex-end; }
.act-group form { display: inline; }

/* -------------------------------------------------------- 7 cards & stats */
.card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  box-shadow: var(--shadow-xs);
}
.card__head {
  display: flex;
  align-items: center;
  gap: var(--sp-3);
  padding: var(--sp-4) var(--sp-5);
  border-bottom: 1px solid var(--border);
}
.card__head h2 { font-size: 15px; font-weight: 600; }
.card__head .muted { font-size: 12.5px; }
.card__body { padding: var(--sp-5); }
.card__body--flush { padding: 0; }
.card__foot {
  padding: var(--sp-3) var(--sp-5);
  border-top: 1px solid var(--border);
  background: var(--surface-alt);
  border-radius: 0 0 var(--radius) var(--radius);
}

.stat-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(212px, 1fr));
  gap: var(--sp-4);
  margin-bottom: var(--sp-6);
}

.stat {
  display: flex;
  align-items: center;
  gap: var(--sp-4);
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  box-shadow: var(--shadow-xs);
  padding: var(--sp-4) var(--sp-5);
  position: relative;
  overflow: hidden;
}
.stat::before {
  content: ""; position: absolute; left: 0; top: 0; bottom: 0; width: 3px;
  background: var(--brand);
}
.stat--success::before { background: var(--success); }
.stat--warning::before { background: var(--warning); }
.stat--danger::before  { background: var(--danger); }
.stat--info::before    { background: var(--info); }
.stat--neutral::before { background: var(--border-strong); }

.stat__icon {
  width: 42px; height: 42px; flex: none;
  border-radius: var(--radius);
  display: grid; place-items: center;
  background: var(--brand-soft);
  color: var(--brand);
}
.stat--success .stat__icon { background: var(--success-soft); color: var(--success); }
.stat--warning .stat__icon { background: var(--warning-soft); color: var(--warning); }
.stat--danger  .stat__icon { background: var(--danger-soft);  color: var(--danger); }
.stat--info    .stat__icon { background: var(--info-soft);    color: var(--info); }
.stat--neutral .stat__icon { background: var(--surface-alt);  color: var(--text-muted); }

.stat__text { min-width: 0; }
.stat__label {
  color: var(--text-muted);
  font-size: 12px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: .045em;
}
.stat__value {
  font-size: 22px;
  font-weight: 700;
  letter-spacing: -.025em;
  line-height: 1.25;
  margin-top: 2px;
  font-variant-numeric: tabular-nums;
}
.stat__value--sm { font-size: 17px; }
.stat__meta { font-size: 12px; color: var(--text-soft); margin-top: 1px; }

/* Tiles authored without an icon (several report pages) still read as one
   column: label above value above meta, rather than three flex siblings. */
.stat { flex-wrap: wrap; }
.stat > .stat__label,
.stat > .stat__value,
.stat > .stat__meta { flex: 1 0 100%; }

/* Value tone modifiers, for a figure that is itself a warning or a caution. */
.stat__value--plain { color: var(--text); }
.stat__value--warn  { color: var(--warning); }
.stat__value--danger { color: var(--danger); }
.stat__value--success { color: var(--success); }

.section-title { font-size: 15px; font-weight: 600; margin-bottom: var(--sp-3); }

/* ------------------------------------------------------ 8 tables & badges */
.table-wrap { overflow-x: auto; -webkit-overflow-scrolling: touch; }

table.data { width: 100%; border-collapse: collapse; font-size: 13.5px; }
table.data th {
  text-align: left;
  background: var(--surface-alt);
  color: var(--text-muted);
  font-weight: 600;
  font-size: 12px;
  text-transform: uppercase;
  letter-spacing: .045em;
  padding: 11px var(--sp-5);
  border-bottom: 1px solid var(--border);
  white-space: nowrap;
}
table.data td {
  padding: 12px var(--sp-5);
  border-bottom: 1px solid var(--border);
  vertical-align: middle;
}
table.data tbody tr:last-child td { border-bottom: 0; }
table.data tbody tr:hover { background: var(--surface-alt); }
table.data tfoot td {
  background: var(--surface-alt);
  font-weight: 700;
  border-top: 2px solid var(--border-strong);
  border-bottom: 0;
}
table.data--tight td, table.data--tight th { padding-top: 9px; padding-bottom: 9px; }

/* Wide tables that turn into a stack of cards on a narrow screen.

   Each cell carries data-label="..." and prints it as its own heading, so the
   row stays readable without a horizontal scrollbar. Applied where a table has
   more columns than a phone can honestly show. */
@media (max-width: 760px) {
  table.data--stack thead { display: none; }
  table.data--stack, table.data--stack tbody,
  table.data--stack tr, table.data--stack td { display: block; width: 100%; }
  table.data--stack tr {
    border: 1px solid var(--border);
    border-radius: var(--radius);
    margin-bottom: var(--sp-3);
    padding: var(--sp-2) 0;
    background: var(--surface);
  }
  table.data--stack tr:hover { background: var(--surface); }
  table.data--stack td {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: var(--sp-4);
    text-align: left;
    padding: 7px var(--sp-4);
    border-bottom: 0;
  }
  table.data--stack td::before {
    content: attr(data-label);
    flex: none;
    font-size: 11px;
    font-weight: 700;
    letter-spacing: .045em;
    text-transform: uppercase;
    color: var(--text-muted);
  }
  table.data--stack td:empty { display: none; }
  table.data--stack td.num { text-align: right; }
  table.data--stack .act-group { justify-content: flex-end; }
  /* A cell holding only a colspan'd empty state should not be laid out as a row. */
  table.data--stack td[colspan] { display: block; }
  table.data--stack td[colspan]::before { content: none; }
}

/* Key/value table used in the report summary panels. */
table.kv { width: 100%; border-collapse: collapse; font-size: 13.5px; }
table.kv th {
  text-align: left; font-weight: 500; color: var(--text-muted);
  padding: 9px var(--sp-5); border-bottom: 1px solid var(--border);
}
table.kv td {
  text-align: right; font-variant-numeric: tabular-nums;
  padding: 9px var(--sp-5); border-bottom: 1px solid var(--border);
}
table.kv tr:last-child th, table.kv tr:last-child td { border-bottom: 0; }

.badge {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 3px 10px;
  border-radius: var(--radius-pill);
  font-size: 11.5px;
  font-weight: 600;
  background: #eef1f6;
  color: #52627a;
  white-space: nowrap;
  line-height: 1.5;
}
.badge--success { background: var(--success-soft); color: #0f7a45; }
.badge--warn    { background: var(--warning-soft); color: #a15f06; }
.badge--danger  { background: var(--danger-soft);  color: var(--danger-dark); }
.badge--info    { background: var(--info-soft);    color: #1d4ed8; }
.badge--brand   { background: var(--brand-soft);   color: var(--brand-dark); }
.badge__dot { width: 6px; height: 6px; border-radius: 50%; background: currentColor; }

/* Cell that pairs a thumbnail with its name. */
.media-cell { display: flex; align-items: center; gap: 10px; min-width: 0; }
.media-cell__text { min-width: 0; }
.media-cell__title { font-weight: 600; color: var(--text); }
a.media-cell__title:hover { color: var(--brand); text-decoration: none; }
.media-cell__sub { font-size: 12px; color: var(--text-muted); }

.avatar {
  width: 34px; height: 34px; flex: none;
  border-radius: 50%;
  background: var(--navy);
  color: #fff;
  display: grid; place-items: center;
  font-size: 12px; font-weight: 700;
}
.avatar--brand { background: var(--brand-soft); color: var(--brand-dark); }

/* Slim progress meter used in performance tables. */
.meter { height: 6px; border-radius: 3px; background: #eef1f6; overflow: hidden; min-width: 66px; }
.meter__fill { height: 100%; border-radius: 3px; background: var(--brand); }
.meter__fill--success { background: var(--success); }
.meter__fill--info { background: var(--info); }

/* ------------------------------------------------------ 9 forms & filters */
.form-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
  gap: var(--sp-4) var(--sp-5);
}
.field { display: flex; flex-direction: column; gap: 6px; min-width: 0; }
.field--wide { grid-column: 1 / -1; }
.field > label { font-weight: 600; font-size: 12.5px; color: var(--text); }
.field .helptext { color: var(--text-muted); font-size: 12px; }
.field .errorlist {
  margin: 0; padding: 0; list-style: none;
  color: var(--danger-dark); font-size: 12px; font-weight: 500;
}

.input, .select, textarea,
input[type="text"], input[type="number"], input[type="date"], input[type="tel"],
input[type="password"], input[type="email"], input[type="search"], input[type="url"],
input[type="file"], select {
  width: 100%;
  height: 38px;
  padding: 0 var(--sp-3);
  border: 1px solid var(--border-strong);
  border-radius: var(--radius-sm);
  font: inherit;
  font-size: 13.5px;
  color: var(--text);
  background: var(--surface);
}
select, .select {
  appearance: none;
  -webkit-appearance: none;
  background-image: url("data:image/svg+xml;charset=utf-8,%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%3Cpolyline points='6 9 12 15 18 9'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 10px center;
  background-size: 15px;
  padding-right: 32px;
}
textarea { height: auto; min-height: 84px; padding: 9px var(--sp-3); resize: vertical; }
input[type="file"] { padding: 7px var(--sp-3); height: auto; }

.input:focus, .select:focus, textarea:focus, input:focus, select:focus {
  outline: none;
  border-color: var(--brand);
  box-shadow: 0 0 0 3px var(--brand-ring);
}
.input:disabled, .select:disabled, input:disabled, select:disabled, textarea:disabled {
  background: var(--surface-alt); color: var(--text-muted); cursor: not-allowed;
}
::placeholder { color: var(--text-soft); }

.check { display: flex; align-items: center; gap: 9px; }
.check input[type="checkbox"] {
  width: 16px; height: 16px; flex: none; accent-color: var(--brand); cursor: pointer;
}
.check label { font-weight: 500; font-size: 13.5px; margin: 0; cursor: pointer; }

/* Input with a leading icon (search boxes, customer number). */
.input-icon { position: relative; }
.input-icon > .icon {
  position: absolute; left: 11px; top: 50%; margin-top: -9px;
  color: var(--text-soft); pointer-events: none;
}
.input-icon input { padding-left: 36px; }

.form-actions {
  display: flex;
  flex-wrap: wrap;
  gap: var(--sp-3);
  align-items: center;
  margin-top: var(--sp-6);
  padding-top: var(--sp-5);
  border-top: 1px solid var(--border);
}

/* Filter bar above a table. */
.filters {
  display: flex;
  flex-wrap: wrap;
  gap: var(--sp-3);
  align-items: flex-end;
  padding: var(--sp-4) var(--sp-5);
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  box-shadow: var(--shadow-xs);
  margin-bottom: var(--sp-5);
}
.filters .field { min-width: 155px; }
.filters__grow { flex: 1; min-width: 225px; }
.filters__actions { display: flex; gap: var(--sp-2); margin-left: auto; }

/* ----------------------------------------------------- 10 alerts & toasts */
.alert {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  padding: 11px var(--sp-4);
  border-radius: var(--radius-sm);
  border: 1px solid var(--border);
  background: var(--surface);
  font-size: 13.5px;
}
.alert .icon { flex: none; margin-top: 1px; }
.alert--success { background: var(--success-soft); border-color: #b9e7cd; color: #0f6b3d; }
.alert--error   { background: var(--danger-soft);  border-color: #f6c9c9; color: #991b1b; }
.alert--warning { background: var(--warning-soft); border-color: #f2ddb4; color: #8a5206; }
.alert--info    { background: var(--info-soft);    border-color: #c6dafc; color: #1e40af; }
.alert--debug   { background: var(--surface-alt); }
.alert a { color: inherit; text-decoration: underline; font-weight: 600; }

.toasts {
  position: fixed;
  top: calc(var(--topbar-h) + 12px);
  right: var(--sp-6);
  z-index: 200;
  display: flex;
  flex-direction: column;
  gap: 10px;
  width: min(370px, calc(100vw - 32px));
  pointer-events: none;
}
.toast {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  padding: 12px var(--sp-4);
  border-radius: var(--radius);
  background: var(--surface);
  border: 1px solid var(--border);
  border-left: 3px solid var(--info);
  box-shadow: var(--shadow-lg);
  font-size: 13.5px;
  pointer-events: auto;
  animation: toast-in .22s ease;
}
.toast--success { border-left-color: var(--success); }
.toast--success .toast__icon { color: var(--success); }
.toast--error   { border-left-color: var(--danger); }
.toast--error .toast__icon { color: var(--danger); }
.toast--warning { border-left-color: var(--warning); }
.toast--warning .toast__icon { color: var(--warning); }
.toast__icon { color: var(--info); flex: none; margin-top: 1px; }
.toast__body { flex: 1; min-width: 0; }
.toast__close {
  background: none; border: 0; cursor: pointer; color: var(--text-soft);
  padding: 0; margin: -2px -4px 0 0; flex: none;
}
.toast__close:hover { color: var(--text); }
.toast.is-leaving { animation: toast-out .2s ease forwards; }

@keyframes toast-in  { from { opacity: 0; transform: translateX(18px); } }
@keyframes toast-out { to   { opacity: 0; transform: translateX(18px); } }

/* -------------------------------------------- 11 pagination & empty states */
.pagination {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: var(--sp-3);
  padding: var(--sp-3) var(--sp-5);
  border-top: 1px solid var(--border);
  font-size: 12.5px;
  color: var(--text-muted);
}
.pagination__pages { display: flex; gap: 4px; margin-left: auto; align-items: center; }
.page-link {
  min-width: 31px; height: 31px;
  display: inline-grid; place-items: center;
  padding: 0 8px;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  background: var(--surface);
  color: var(--text);
  font-size: 12.5px;
  font-weight: 500;
}
.page-link:hover { background: var(--surface-alt); text-decoration: none; border-color: var(--text-soft); }
.page-link.is-active { background: var(--brand); border-color: var(--brand); color: #fff; font-weight: 700; }
.page-link.is-disabled { opacity: .45; pointer-events: none; }
.page-gap { padding: 0 3px; color: var(--text-soft); }

.empty { padding: var(--sp-10) var(--sp-6); text-align: center; color: var(--text-muted); }
.empty__icon {
  width: 52px; height: 52px; margin: 0 auto var(--sp-3);
  border-radius: 50%;
  background: var(--surface-alt);
  color: var(--text-soft);
  display: grid; place-items: center;
}
.empty strong { display: block; color: var(--text); font-size: 15px; margin-bottom: 4px; }
.empty__actions { margin-top: var(--sp-4); display: flex; gap: var(--sp-2); justify-content: center; }

.skeleton {
  background: linear-gradient(90deg, #eef1f6 25%, #f7f9fc 50%, #eef1f6 75%);
  background-size: 200% 100%;
  animation: shimmer 1.2s infinite linear;
  border-radius: var(--radius-sm);
  height: 14px;
}
@keyframes shimmer { to { background-position: -200% 0; } }

.is-busy { pointer-events: none; opacity: .6; }
.spinner {
  width: 15px; height: 15px;
  border: 2px solid currentColor;
  border-right-color: transparent;
  border-radius: 50%;
  display: inline-block;
  animation: spin .6s linear infinite;
}
@keyframes spin { to { transform: rotate(360deg); } }

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

/* -------------------------------------------- 12 dropdowns, modals & tabs */
.dropdown { position: relative; }
.dropdown__menu {
  position: absolute;
  right: 0;
  top: calc(100% + 7px);
  min-width: 208px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  box-shadow: var(--shadow-lg);
  padding: 5px;
  z-index: 100;
}
.dropdown__header { padding: 9px 11px 10px; border-bottom: 1px solid var(--border); margin-bottom: 5px; }
.dropdown__name { font-weight: 600; font-size: 13.5px; }
.dropdown__meta { font-size: 12px; color: var(--text-muted); }
.dropdown__item {
  display: flex;
  align-items: center;
  gap: 9px;
  width: 100%;
  padding: 8px 11px;
  border: 0;
  border-radius: var(--radius-sm);
  background: none;
  color: var(--text);
  font: inherit;
  font-size: 13.5px;
  text-align: left;
  cursor: pointer;
}
.dropdown__item:hover { background: var(--surface-alt); text-decoration: none; color: var(--text); }
.dropdown__item .icon { color: var(--text-muted); }
.dropdown__item--danger { color: var(--danger-dark); }
.dropdown__item--danger .icon { color: var(--danger); }
.dropdown__item--danger:hover { background: var(--danger-soft); color: var(--danger-dark); }
.dropdown__sep { height: 1px; background: var(--border); margin: 5px 0; }

.modal {
  position: fixed; inset: 0; z-index: 150;
  display: grid; place-items: center;
  padding: var(--sp-5);
  background: rgba(15, 33, 55, .5);
}
.modal__dialog {
  width: min(480px, 100%);
  background: var(--surface);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-lg);
  overflow: hidden;
  animation: modal-in .18s ease;
}
@keyframes modal-in { from { opacity: 0; transform: translateY(10px); } }
.modal__head {
  display: flex; align-items: center; gap: var(--sp-3);
  padding: var(--sp-4) var(--sp-5);
  border-bottom: 1px solid var(--border);
}
.modal__head h2 { font-size: 15px; }
.modal__body { padding: var(--sp-5); font-size: 13.5px; color: var(--text-muted); }
.modal__body strong { color: var(--text); }
.modal__foot {
  display: flex; justify-content: flex-end; gap: var(--sp-2);
  padding: var(--sp-4) var(--sp-5);
  background: var(--surface-alt);
  border-top: 1px solid var(--border);
}
.modal__icon {
  width: 38px; height: 38px; flex: none; border-radius: 50%;
  display: grid; place-items: center;
  background: var(--danger-soft); color: var(--danger);
}

/* Segmented tab strip (reports, detail pages). */
.tabs, .report-tabs {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-bottom: var(--sp-5);
  padding: 5px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  box-shadow: var(--shadow-xs);
}
.report-tab, .tab {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  padding: 8px 13px;
  border-radius: var(--radius-sm);
  color: var(--text-muted);
  font-size: 13px;
  font-weight: 500;
  white-space: nowrap;
  border: 0;
  background: none;
  cursor: pointer;
  font-family: inherit;
}
.report-tab:hover, .tab:hover { background: var(--surface-alt); color: var(--text); text-decoration: none; }
.report-tab.is-active, .tab.is-active {
  background: var(--brand); color: #fff; font-weight: 600;
  box-shadow: 0 2px 8px rgba(245, 106, 28, .28);
}
.report-tab .icon, .tab .icon { width: 15px; height: 15px; }

/* Bulk-selection bar on the product list. */
.bulk-col { width: 38px; text-align: center; }
.bulk-col input[type="checkbox"] { width: 15px; height: 15px; accent-color: var(--brand); cursor: pointer; }

.bulk-bar {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: var(--sp-3);
  margin-bottom: var(--sp-4);
  padding: 11px var(--sp-4);
  background: var(--brand-soft);
  border: 1px solid #f8d5bd;
  border-radius: var(--radius);
}
.bulk-bar__count { font-weight: 600; color: var(--brand-dark); font-size: 13.5px; }

/* ------------------------------------------------------- 13 POS terminal */
.pos {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 410px;
  gap: var(--sp-5);
  align-items: start;
}

/* --- viewport-locked till -------------------------------------------------
   On the sales screen the page is sized to the window, not to its content, so
   the cashier never scrolls the document to reach the total or the checkout
   button. Only two things scroll: the search results, and the cart's items. */
.pos-page { overflow: hidden; }
.pos-page .app__main { height: 100vh; min-height: 0; }
.pos-page .content {
  flex: 1;
  min-height: 0;
  display: flex;
  flex-direction: column;
  padding-bottom: var(--sp-5);
  overflow: hidden;
}
.pos-page .page-head { flex: none; margin-bottom: var(--sp-4); }
.pos-page .pos { flex: 1; min-height: 0; }

/* Left pane: search box fixed, results scroll. */
.pos__pane {
  display: flex;
  flex-direction: column;
  gap: var(--sp-3);
  min-height: 0;
  height: 100%;
}
.pos-search { flex: none; }
.pos__results {
  flex: 1;
  min-height: 0;
  display: flex;
  flex-direction: column;
  overflow: hidden;
}
.pos__results .card__head { flex: none; }
.pos__results-scroll { flex: 1; min-height: 0; overflow-y: auto; }

/* Right pane: head and checkout pinned, items scroll between them. */
.cart {
  display: flex;
  flex-direction: column;
  height: 100%;
  min-height: 0;
  overflow: hidden;
}
.cart__head { flex: none; }
.cart__lines {
  flex: 1 1 auto;
  min-height: 96px;
  overflow-y: auto;
  border-bottom: 1px solid var(--border);
}
/* The summary yields before the item list does, and scrolls itself on a short
   window, so the pinned footer below is never pushed off screen. */
.cart__summary {
  flex: 0 1 auto;
  min-height: 0;
  overflow-y: auto;
  padding: var(--sp-4) var(--sp-5);
  display: flex;
  flex-direction: column;
  gap: var(--sp-3);
}
.cart__cta {
  flex: none;
  padding: var(--sp-3) var(--sp-5) var(--sp-4);
  border-top: 1px solid var(--border);
  background: var(--surface-alt);
  border-radius: 0 0 var(--radius) var(--radius);
}
.cart__cta .totals__row--grand {
  margin: 0 0 var(--sp-3);
  padding-top: 0;
  border-top: 0;
}
.cart__pay { gap: 7px; }

.pos-search__box { position: relative; }
.pos-search__box .icon--search {
  position: absolute; left: var(--sp-4); top: 50%; margin-top: -11px;
  color: var(--text-soft); pointer-events: none;
}
#product-search {
  height: 52px;
  padding-left: 48px;
  padding-right: 96px;
  font-size: 15px;
  border-radius: var(--radius);
  border-color: var(--border);
  box-shadow: var(--shadow-sm);
}
.pos-search__hint {
  position: absolute; right: var(--sp-4); top: 50%; margin-top: -11px;
  font-size: 11px; color: var(--text-soft);
  border: 1px solid var(--border); border-radius: 4px; padding: 1px 6px;
  background: var(--surface-alt);
}
.pos-search__status { min-height: 18px; margin-top: 7px; font-size: 12.5px; }

/* Search results: a list, never a browsable catalogue grid. */
.result-list { display: flex; flex-direction: column; }
.result {
  display: flex;
  align-items: center;
  gap: var(--sp-3);
  width: 100%;
  padding: 10px var(--sp-5);
  border: 0;
  border-bottom: 1px solid var(--border);
  background: var(--surface);
  font: inherit;
  text-align: left;
  cursor: pointer;
}
.result:last-child { border-bottom: 0; }
.result:hover:not(:disabled), .result.is-cursor { background: var(--brand-soft); }
.result:disabled { opacity: .55; cursor: not-allowed; }
.result__media {
  width: 40px; height: 40px; flex: none;
  border-radius: var(--radius-sm);
  border: 1px solid var(--border);
  background: var(--surface-alt);
  object-fit: contain;
  display: grid; place-items: center;
  color: var(--text-soft); font-size: 12px; font-weight: 700;
}
.result__text { flex: 1; min-width: 0; }
.result__name { font-weight: 600; font-size: 13.5px; }
.result__meta { font-size: 12px; color: var(--text-muted); }
.result__price { text-align: right; flex: none; }
.result__price b { font-size: 14px; font-weight: 700; }
.result__price s { color: var(--text-soft); font-weight: 400; font-size: 12px; }

/* Cart */

.cart-line {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px var(--sp-5);
  border-bottom: 1px solid var(--border);
}
.cart-line:last-child { border-bottom: 0; }
.cart-line__thumb {
  width: 34px; height: 34px; flex: none;
  border-radius: var(--radius-sm); border: 1px solid var(--border);
  background: var(--surface-alt); object-fit: contain;
  display: grid; place-items: center; color: var(--text-soft);
  font-size: 11px; font-weight: 700;
}
.cart-line__text { flex: 1; min-width: 0; }
.cart-line__name {
  font-weight: 600; font-size: 13px; line-height: 1.35;
  overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
}

/* SKU, unit price and any discount, on one compact line so more of the cart
   fits on screen at once. */
.cart-line__meta {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 6px;
  font-size: 11.5px;
  color: var(--text-muted);
  line-height: 1.5;
}
.cart-line__meta s { color: var(--text-soft); }
.cart-line__sku {
  font-size: 10.5px;
  font-weight: 700;
  letter-spacing: .03em;
  color: var(--text-muted);
  background: var(--surface-alt);
  border: 1px solid var(--border);
  border-radius: 4px;
  padding: 0 5px;
}
.cart-line__off { color: var(--success); font-weight: 600; }

.cart__empty {
  padding: var(--sp-8) var(--sp-5);
  text-align: center;
  color: var(--text-muted);
  font-size: 12.5px;
}
.cart__empty-icon {
  width: 44px; height: 44px;
  margin: 0 auto var(--sp-3);
  display: grid; place-items: center;
  border-radius: 50%;
  background: var(--surface-alt);
  color: var(--text-soft);
}
.cart__empty strong {
  display: block; color: var(--text); font-size: 14px; margin-bottom: 3px;
}
.cart-line__side { display: flex; flex-direction: column; align-items: flex-end; gap: 5px; flex: none; }
.cart-line__total { font-weight: 700; font-size: 13px; font-variant-numeric: tabular-nums; }

.qty {
  display: inline-flex; align-items: center;
  border: 1px solid var(--border-strong);
  border-radius: var(--radius-sm);
  overflow: hidden;
  background: var(--surface);
}
.qty__btn {
  width: 26px; height: 26px;
  display: grid; place-items: center;
  border: 0; background: var(--surface-alt);
  color: var(--text); cursor: pointer; padding: 0;
}
.qty__btn:hover { background: var(--border); }
.qty__btn:disabled { opacity: .4; cursor: not-allowed; }
.qty__input {
  width: 38px; height: 26px; padding: 0;
  border: 0; border-left: 1px solid var(--border); border-right: 1px solid var(--border);
  border-radius: 0;
  text-align: center; font: inherit; font-size: 12.5px; font-weight: 600;
  -moz-appearance: textfield;
}
.qty__input::-webkit-outer-spin-button,
.qty__input::-webkit-inner-spin-button { -webkit-appearance: none; margin: 0; }
.qty__input:focus { outline: none; box-shadow: inset 0 0 0 2px var(--brand-ring); }

.cart-line__remove {
  width: 24px; height: 24px; flex: none;
  display: grid; place-items: center;
  padding: 0;
  border: 1px solid transparent;
  border-radius: var(--radius-sm);
  background: none;
  color: var(--text-soft);
  cursor: pointer;
}
.cart-line__remove:hover {
  color: var(--danger);
  background: var(--danger-soft);
  border-color: #f6c9c9;
}

.totals { display: flex; flex-direction: column; gap: 8px; }
.totals__row { display: flex; justify-content: space-between; gap: var(--sp-3); font-size: 13.5px; }
.totals__row span:last-child { font-variant-numeric: tabular-nums; font-weight: 600; }
.totals__row--muted { color: var(--text-muted); }
.totals__row--muted span:last-child { font-weight: 500; }
.totals__row--discount span:last-child { color: var(--success); }
.totals__row--grand {
  margin-top: 5px; padding-top: 10px;
  border-top: 1px dashed var(--border-strong);
  font-size: 16px; font-weight: 700;
}
.totals__row--grand span:last-child { font-size: 19px; color: var(--brand-dark); }

.pay-methods { display: grid; grid-template-columns: repeat(4, 1fr); gap: 7px; }
.pay-method {
  display: flex; flex-direction: column; align-items: center; gap: 3px;
  padding: 8px 3px;
  border: 1px solid var(--border-strong);
  border-radius: var(--radius-sm);
  background: var(--surface);
  font: inherit; font-size: 11.5px; font-weight: 500;
  color: var(--text-muted);
  cursor: pointer;
}
.pay-method .icon { width: 16px; height: 16px; }
.pay-method:hover { border-color: var(--brand); color: var(--text); }
.pay-method.is-active {
  border-color: var(--brand); background: var(--brand-soft);
  color: var(--brand-dark); font-weight: 700;
}

.customer-status { min-height: 20px; margin-top: 5px; }

/* --------------------------------------------------------------- 14 login */
.login {
  min-height: 100vh;
  display: grid;
  grid-template-columns: 1fr 1fr;
  background: var(--surface);
}
.login__aside {
  background: var(--navy);
  color: #cbd5e1;
  padding: var(--sp-10) 56px;
  display: flex;
  flex-direction: column;
  justify-content: center;
  position: relative;
  overflow: hidden;
}
.login__aside::after {
  content: "";
  position: absolute; right: -130px; bottom: -130px;
  width: 380px; height: 380px; border-radius: 50%;
  background: radial-gradient(circle, rgba(245, 106, 28, .28), transparent 68%);
}
.login__aside > * { position: relative; z-index: 1; }
.login__aside-brand {
  display: flex; align-items: center; gap: 12px;
  color: #fff; font-size: 18px; font-weight: 700; margin-bottom: var(--sp-8);
}
.login__aside h2 {
  color: #fff; font-size: 28px; line-height: 1.25;
  letter-spacing: -.025em; margin-bottom: var(--sp-4);
}
.login__aside p { color: #93a5bb; font-size: 14.5px; max-width: 40ch; margin: 0; }
.login__points { list-style: none; padding: 0; margin: var(--sp-8) 0 0; display: grid; gap: 13px; }
.login__points li { display: flex; align-items: center; gap: 11px; font-size: 13.5px; }
.login__points .icon { color: var(--brand); }

.login__panel { display: grid; place-items: center; padding: var(--sp-8) var(--sp-6); background: var(--bg); }
.login__card { width: 100%; max-width: 396px; }
.login__mark {
  width: 46px; height: 46px; border-radius: 13px;
  background: var(--brand); color: #fff;
  display: grid; place-items: center;
  font-size: 17px; font-weight: 700;
  margin-bottom: var(--sp-5);
  box-shadow: 0 6px 18px rgba(245, 106, 28, .35);
}
.login__card h1 { font-size: 23px; letter-spacing: -.025em; }
.login__card > p { color: var(--text-muted); margin: 5px 0 var(--sp-6); font-size: 13.5px; }
.login__card .field { margin-bottom: var(--sp-4); }
.login__card .btn { margin-top: var(--sp-2); }
.login__foot {
  margin-top: var(--sp-6); padding-top: var(--sp-4);
  border-top: 1px solid var(--border);
  font-size: 12px; color: var(--text-muted); text-align: center;
}

.pw-field { position: relative; }
.pw-field input { padding-right: 42px; }
.pw-toggle {
  position: absolute; right: 5px; top: 50%; margin-top: -15px;
  width: 30px; height: 30px;
  display: grid; place-items: center;
  border: 0; background: none; color: var(--text-soft); cursor: pointer; padding: 0;
}
.pw-toggle:hover { color: var(--text); }

/* --------------------------------------------------- 15 invoice & charts */
.invoice-page { max-width: 800px; margin: 0 auto; }
.invoice { padding: var(--sp-10); }
.invoice__head {
  display: flex; justify-content: space-between; gap: var(--sp-6);
  flex-wrap: wrap; padding-bottom: var(--sp-5);
  border-bottom: 2px solid var(--text);
}
.invoice__business { font-size: 21px; font-weight: 700; }
.invoice__meta { text-align: right; font-size: 13px; color: var(--text-muted); }
.invoice__meta strong { color: var(--text); }
.invoice__parties {
  display: grid; grid-template-columns: repeat(auto-fit, minmax(190px, 1fr));
  gap: var(--sp-5); padding: var(--sp-5) 0; font-size: 13.5px;
}
.invoice__parties dt { color: var(--text-muted); font-size: 12px; }
.invoice__parties dd { margin: 2px 0 0; font-weight: 600; }
.invoice__totals { margin-left: auto; width: min(320px, 100%); margin-top: var(--sp-5); }
.invoice__footer {
  margin-top: var(--sp-8); padding-top: var(--sp-4);
  border-top: 1px dashed var(--border-strong);
  text-align: center; color: var(--text-muted); font-size: 13px;
}

.chart-scroll { overflow-x: auto; }
.chart { width: 100%; min-width: 520px; height: auto; display: block; }
.chart--donut { min-width: 0; width: auto; }
.chart__grid { stroke: var(--border); stroke-width: 1; }
.chart__axis { stroke: var(--border-strong); stroke-width: 1; }
.chart__axis-label { fill: var(--text-soft); font-size: 11px; }
.chart__label { fill: var(--text-muted); font-size: 11.5px; }
.chart__bar { transition: opacity .12s ease; }
.chart__bar:hover { opacity: .78; }
.chart__line { fill: none; stroke-width: 2.5; stroke-linecap: round; stroke-linejoin: round; }
.chart__area { opacity: .12; }
.chart__dot { stroke: #fff; stroke-width: 2; }
.chart__slice { transition: opacity .12s ease; }
.chart__slice:hover { opacity: .82; }
.chart__hole-value { font-size: 20px; font-weight: 700; fill: var(--text); }
.chart__hole-label { font-size: 10.5px; fill: var(--text-muted); }

.chart-legend { display: flex; flex-wrap: wrap; gap: 13px; font-size: 12.5px; color: var(--text-muted); }
.chart-legend__item { display: inline-flex; align-items: center; gap: 6px; }
.chart-legend__swatch { width: 10px; height: 10px; border-radius: 3px; display: inline-block; }

.legend-list { display: flex; flex-direction: column; gap: 11px; min-width: 160px; flex: 1; }
.legend-list__row { display: flex; align-items: center; gap: 9px; font-size: 13px; }
.legend-list__swatch { width: 10px; height: 10px; border-radius: 3px; flex: none; }
.legend-list__label { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.legend-list__value { font-weight: 600; font-variant-numeric: tabular-nums; }

.donut-wrap { display: flex; align-items: center; gap: var(--sp-6); flex-wrap: wrap; }

/* Product thumbnails reused across listings. */
.product-thumb, .product-thumb--empty {
  width: 34px; height: 34px; flex: 0 0 34px;
  border-radius: var(--radius-sm);
  border: 1px solid var(--border);
  background: var(--surface-alt);
  object-fit: contain;
}
.product-thumb--empty {
  display: inline-grid; place-items: center;
  color: var(--text-soft); font-size: 11.5px; font-weight: 700;
}
.product-hero {
  width: 100%; max-width: 190px; aspect-ratio: 1 / 1; object-fit: contain;
  border: 1px solid var(--border); border-radius: var(--radius);
  background: var(--surface-alt); padding: 8px;
}

/* The 403 / 404 / 500 pages, which stand alone outside the app shell. */
.error-page {
  min-height: 100vh;
  display: grid; place-items: center;
  padding: var(--sp-6);
  text-align: center;
}
.error-page__code {
  font-size: 68px; font-weight: 700; line-height: 1;
  color: var(--brand); letter-spacing: -.04em;
}
.error-page h1 { font-size: 23px; margin: var(--sp-3) 0 var(--sp-2); }
.error-page p { color: var(--text-muted); margin: 0 0 var(--sp-6); }

/* -------------------------------------------------- 16 responsive & print */
@media (max-width: 1280px) {
  .pos { grid-template-columns: minmax(0, 1fr) 350px; }
}

@media (max-width: 1080px) {
  /* Give the page back to the document: a locked viewport on a small screen
     hides content instead of saving a scroll. The total and the checkout
     button follow the cashier down the page instead. */
  .pos { grid-template-columns: 1fr; }
  .pos-page, .pos-page .app__main { overflow: visible; height: auto; }
  .pos-page .content { overflow: visible; display: block; padding-bottom: 96px; }
  .pos-page .pos { min-height: 0; }
  .pos__pane, .pos__results, .cart { height: auto; overflow: visible; }
  .pos__results-scroll { max-height: 60vh; }
  .cart { margin-top: var(--sp-5); }
  .cart__lines { max-height: 46vh; min-height: 0; }
  .cart__summary { overflow: visible; }

  .cart__cta {
    position: sticky;
    bottom: 0;
    z-index: 20;
    background: var(--surface);
    border-top: 1px solid var(--border-strong);
    box-shadow: 0 -6px 18px rgba(15, 33, 55, .1);
    margin: 0 -1px -1px;
    border-radius: 0 0 var(--radius) var(--radius);
  }
}

@media (max-width: 992px) {
  .login { grid-template-columns: 1fr; }
  .login__aside { display: none; }
}

@media (max-width: 900px) {
  .sidebar {
    position: fixed;
    left: 0; top: 0; bottom: 0;
    transform: translateX(-100%);
    transition: transform .22s ease;
    box-shadow: var(--shadow-lg);
  }
  .sidebar.is-open { transform: none; }
  .sidebar__close { display: block; }
  .topbar__toggle { display: grid; }
  .topbar, .content { padding-left: var(--sp-4); padding-right: var(--sp-4); }
  .topbar__search { max-width: none; }
  .user-chip__text { display: none; }
  .toasts { right: var(--sp-4); left: var(--sp-4); width: auto; }
  .page-head { align-items: stretch; }
  .page-head__actions { width: 100%; }
  .page-head__actions .btn { flex: 1; }
  .filters__actions { margin-left: 0; width: 100%; }
  .filters__actions .btn { flex: 1; }
  .invoice { padding: var(--sp-5); }
}

@media (max-width: 620px) {
  .content { padding-top: var(--sp-5); }
  .stat-grid { grid-template-columns: 1fr 1fr; gap: var(--sp-3); }
  .stat { padding: var(--sp-3) var(--sp-4); gap: var(--sp-3); }
  .stat__icon { width: 34px; height: 34px; }
  .stat__value { font-size: 17px; }
  .stat__label { font-size: 10.5px; }
  .filters .field, .filters__grow { min-width: 100%; }
  table.data th, table.data td { padding-left: var(--sp-4); padding-right: var(--sp-4); }
  .pagination { justify-content: center; }
  .pagination__pages { margin-left: 0; }
  .pay-methods { grid-template-columns: repeat(2, 1fr); }
  .topbar__search { display: none; }
}

@media (max-width: 420px) {
  .stat-grid { grid-template-columns: 1fr; }
}

@media print {
  .sidebar, .topbar, .no-print, .toasts, .page-head__actions, .filters,
  .pagination, .tabs, .report-tabs, .scrim { display: none !important; }
  body { background: #fff; }
  .app { display: block; }
  .content { padding: 0; }
  .card { border: 0; box-shadow: none; }
  .invoice { padding: 0; }
  table.data th { background: #fff; }
}
