/* B — editorial sharp: square corners, no shadows, hairline rules.
   Appearance is controlled by data-appearance (system/light/dark) and the
   accent by data-accent (teal/ink) on <html>. */
:root {
  color-scheme: light dark;
  --bg: light-dark(#f2f3f1, #101614);
  --card: light-dark(#ffffff, #182220);
  --text: light-dark(#101816, #e9efec);
  --muted: light-dark(#5b6863, #9aa8a3);
  --line: light-dark(#cbd3cf, #2b3835);
  --accent: light-dark(#0b5c55, #2dd4bf);
  --accent-strong: light-dark(#08443f, #5eead4);
  --accent-soft: light-dark(#e4eeeb, #12302c);
  --on-accent: light-dark(#ffffff, #06201c);
  --danger: light-dark(#b42318, #fda29b);
  --danger-soft: light-dark(#fdeceb, #3b1d1b);
  --warn: light-dark(#a15c07, #fdb022);
  --warn-soft: light-dark(#fdf3e2, #3a2a12);
  --ok: light-dark(#067647, #6ce9a6);
  --ok-soft: light-dark(#e8f6ee, #12301f);
  --radius: 0px;
  --shadow: none;
}

html[data-accent="ink"] {
  --accent: light-dark(#1f3a5f, #7fb0e8);
  --accent-strong: light-dark(#162c49, #a9c9f2);
  --accent-soft: light-dark(#e6ecf3, #16263a);
  --on-accent: light-dark(#ffffff, #06201c);
}

html[data-appearance="light"] { color-scheme: light; }
html[data-appearance="dark"] { color-scheme: dark; }

* { box-sizing: border-box; }

[hidden] { display: none !important; }

.opt { font-weight: 400; color: var(--muted); }

html, body { margin: 0; padding: 0; }

body {
  background: var(--bg);
  color: var(--text);
  font: 15px/1.5 -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
  -webkit-font-smoothing: antialiased;
  -webkit-tap-highlight-color: transparent;
  min-height: 100vh;
  min-height: 100dvh;
  overflow-x: hidden;
}

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

h1, h2, h3 { letter-spacing: -0.01em; margin: 0; }
h1 { font-size: 24px; line-height: 1.25; }
h2 { font-size: 16px; }
p { margin: 0; }

.muted { color: var(--muted); }
.small { font-size: 13px; }
.mono { font-variant-numeric: tabular-nums; }
.right { text-align: right; }

/* ------------------------------- top bar ------------------------------- */

.topbar {
  position: sticky;
  top: 0;
  z-index: 20;
  background: var(--card);
  border-bottom: 1px solid var(--line);
}

.topbar-inner {
  max-width: 1180px;
  margin: 0 auto;
  padding: 10px 20px;
  display: flex;
  align-items: center;
  gap: 22px;
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: 9px;
  font-weight: 700;
  color: var(--text);
  white-space: nowrap;
}
.brand:hover { text-decoration: none; }

.brand-mark {
  display: inline-grid;
  place-items: center;
  width: 30px;
  height: 30px;
  border-radius: 0;
  background: var(--accent);
  color: var(--on-accent);
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 0.02em;
}
.brand-mark.big { width: 46px; height: 46px; border-radius: 0; font-size: 16px; }

.nav {
  display: flex;
  gap: 4px;
  overflow-x: auto;
  scrollbar-width: none;
  flex: 1;
}
.nav::-webkit-scrollbar { display: none; }

.nav-link {
  padding: 7px 11px;
  border-radius: 0;
  color: var(--muted);
  font-weight: 500;
  font-size: 14px;
  white-space: nowrap;
}
.nav-link:hover { background: var(--accent-soft); color: var(--accent-strong); text-decoration: none; }
.nav-link.is-active { background: var(--accent-soft); color: var(--accent-strong); }

.account { display: flex; align-items: center; gap: 10px; }
.who { color: var(--muted); font-size: 13px; }

/* ------------------------------- layout -------------------------------- */

.container {
  max-width: 1180px;
  margin: 0 auto;
  padding: 26px 20px 70px;
}

.page-head {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 16px;
  flex-wrap: wrap;
  margin-bottom: 20px;
}
.page-head .muted { margin-top: 5px; font-size: 14px; }
.page-actions { display: flex; gap: 8px; }

.split {
  display: grid;
  grid-template-columns: 340px minmax(0, 1fr);
  gap: 18px;
  align-items: start;
}

.stack { display: grid; gap: 16px; min-width: 0; }

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

/* -------------------------------- cards -------------------------------- */

.card {
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: 0;
  box-shadow: none;
  padding: 16px;
  min-width: 0;
}

.card-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 12px;
  padding-bottom: 10px;
  border-bottom: 1px solid var(--line);
}

.form-card h2 { margin-bottom: 14px; }
.form-hint { margin-top: 12px; }

.edit-card { max-width: 560px; }

.form-actions { display: flex; gap: 8px; margin-top: 4px; }

.check {
  display: flex;
  align-items: center;
  gap: 9px;
  font-weight: 600;
}
.check input[type="checkbox"] {
  width: 18px;
  height: 18px;
  min-height: 0;
  padding: 0;
  flex: 0 0 auto;
  accent-color: var(--accent);
}

.row-actions {
  display: flex;
  gap: 6px;
  justify-content: flex-end;
  flex-wrap: wrap;
}

.is-void td { opacity: 0.6; }
.is-void .item-name { text-decoration: line-through; }
.section-gap { margin-bottom: 18px; }

.error-card { max-width: 560px; margin: 60px auto; }
.error-text { margin: 10px 0 18px; }

.empty {
  color: var(--muted);
  font-size: 14px;
  padding: 22px 4px;
  text-align: center;
}

/* -------------------------------- forms -------------------------------- */

form { margin: 0; }

label {
  display: grid;
  gap: 6px;
  font-size: 13px;
  font-weight: 600;
  margin-bottom: 12px;
}

input, select, textarea {
  width: 100%;
  font: inherit;
  font-weight: 400;
  color: var(--text);
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: 0;
  padding: 9px 11px;
  outline: none;
  transition: border-color 0.15s, box-shadow 0.15s;
}

input:focus, select:focus, textarea:focus {
  border-color: var(--accent);
  box-shadow: 0 0 0 3px var(--accent-soft);
}

textarea { resize: vertical; min-height: 54px; }

.field-row { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }

.sale-items { margin-bottom: 4px; }

.sale-items-head,
.sale-item-row {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 84px 40px;
  gap: 8px;
  align-items: center;
}

.sale-items-head {
  margin-bottom: 5px;
  font-size: 10.5px;
  font-weight: 600;
  letter-spacing: 0.05em;
  text-transform: uppercase;
  color: var(--muted);
}

.sale-item-row { margin-bottom: 8px; }
.sale-item-row select,
.sale-item-row input { min-height: 42px; padding: 8px 10px; }
.sale-item-row input[name="qty"] {
  text-align: center;
  font-variant-numeric: tabular-nums;
}

.icon-btn {
  display: grid;
  place-items: center;
  width: 40px;
  height: 42px;
  padding: 0;
  font: inherit;
  font-size: 20px;
  line-height: 1;
  color: var(--muted);
  background: transparent;
  border: 1px solid var(--line);
  border-radius: 0;
  cursor: pointer;
}
.icon-btn:hover {
  color: var(--danger);
  background: var(--danger-soft);
  border-color: color-mix(in srgb, var(--danger) 25%, transparent);
}

#add-item { margin: 2px 0 12px; }

.filters {
  display: flex;
  flex-wrap: wrap;
  align-items: flex-end;
  gap: 10px;
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: 0;
  padding: 12px 14px;
}
.filters label { margin: 0; min-width: 120px; flex: 1; }
.filters .btn { margin-bottom: 0; }

.preview {
  display: flex;
  justify-content: space-between;
  align-items: center;
  background: var(--accent-soft);
  border-radius: 0;
  padding: 10px 12px;
  margin: 2px 0 14px;
  font-size: 13px;
}
.preview strong { font-size: 17px; color: var(--accent-strong); font-variant-numeric: tabular-nums; }
.preview .unit { color: var(--muted); }

/* -------------------------------- buttons ------------------------------ */

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  font: inherit;
  font-size: 14px;
  font-weight: 600;
  line-height: 1;
  padding: 10px 14px;
  border-radius: 0;
  border: 1px solid transparent;
  background: var(--accent-soft);
  color: var(--accent-strong);
  cursor: pointer;
  white-space: nowrap;
  text-decoration: none;
  transition: background 0.15s, transform 0.05s;
}
.btn:hover { text-decoration: none; background: color-mix(in srgb, var(--accent-soft) 70%, var(--accent) 12%); }
.btn:active { transform: translateY(1px); }
.btn:disabled { opacity: 0.6; cursor: progress; }

.btn-primary { background: var(--accent); color: var(--on-accent); }
.btn-primary:hover { background: var(--accent-strong); color: var(--on-accent); }

.btn-ghost { background: transparent; border-color: var(--line); color: var(--text); }
.btn-ghost:hover { background: var(--accent-soft); }

.btn-sm { padding: 7px 10px; font-size: 13px; }
.btn-block { width: 100%; }

.btn-danger { background: var(--danger-soft); color: var(--danger); }

/* -------------------------------- tables ------------------------------- */

.table-wrap { overflow-x: auto; margin: 0 -16px -16px; }

table { width: 100%; border-collapse: collapse; font-size: 14px; }
th, td { padding: 10px 12px; text-align: left; border-top: 1px solid var(--line); vertical-align: middle; }
th { font-size: 12px; text-transform: uppercase; letter-spacing: 0.04em; color: var(--muted); font-weight: 600; border-top: 0; }
tbody tr:hover { background: color-mix(in srgb, var(--accent-soft) 45%, transparent); }
td.num, th.num { text-align: right; font-variant-numeric: tabular-nums; }
td.actions { text-align: right; white-space: nowrap; }

/* ------------------------------- badges -------------------------------- */

.badge {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 4px 8px;
  border-radius: 0;
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  white-space: nowrap;
}
.badge.amount {
  text-transform: none;
  letter-spacing: 0;
  font-size: 12px;
  font-weight: 600;
}
.badge.ok { background: var(--ok-soft); color: var(--ok); }
.badge.warn { background: var(--warn-soft); color: var(--warn); }
.badge.neutral { background: var(--accent-soft); color: var(--accent-strong); }
a.badge:hover { text-decoration: none; filter: brightness(0.96); }

/* -------------------------------- stats -------------------------------- */

.stats {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 14px;
  margin-bottom: 18px;
}
@media (max-width: 900px) { .stats { grid-template-columns: repeat(2, minmax(0, 1fr)); } }

.stat {
  background: var(--card);
  border: 1px solid var(--line);
  border-top: 3px solid var(--accent);
  border-radius: 0;
  box-shadow: none;
  padding: 13px 15px 15px;
  display: grid;
  gap: 3px;
}
.stat-today { border-top-color: var(--accent); }
.stat-month { border-top-color: light-dark(#067647, #6ce9a6); }
.stat-outstanding { border-top-color: light-dark(#a15c07, #fdb022); }
.stat-invoices { border-top-color: light-dark(#5b3fa0, #c4b5fd); }

.stat-label { font-size: 12px; text-transform: uppercase; letter-spacing: 0.05em; color: var(--muted); font-weight: 600; }
.stat-value { font-size: 24px; font-weight: 700; font-variant-numeric: tabular-nums; letter-spacing: -0.02em; }
.stat-note { font-size: 12.5px; color: var(--muted); }

/* -------------------------------- flash -------------------------------- */

.flash-slot { margin-bottom: 16px; }
.flash-slot:empty { display: none; }

.flash {
  padding: 10px 14px;
  border-radius: 0;
  font-size: 14px;
  font-weight: 500;
  border: 1px solid transparent;
  transition: opacity 0.25s ease, transform 0.25s ease;
}
.flash.is-hiding { opacity: 0; transform: translateY(-6px); }
.flash.ok { background: var(--ok-soft); color: var(--ok); border-color: color-mix(in srgb, var(--ok) 22%, transparent); }
.flash.err { background: var(--danger-soft); color: var(--danger); border-color: color-mix(in srgb, var(--danger) 22%, transparent); }

/* ------------------------------- invoice ------------------------------- */

.invoice-grid {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 300px;
  gap: 18px;
  align-items: start;
}
@media (max-width: 900px) { .invoice-grid { grid-template-columns: 1fr; } }

.invoice-total {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  gap: 12px;
  padding: 14px 12px 0;
  font-weight: 600;
}
.invoice-total strong { font-size: 22px; font-variant-numeric: tabular-nums; }

.invoice-status { display: grid; gap: 10px; justify-items: start; }
.invoice-status form { width: 100%; margin-top: 4px; }
.invoice-status label { margin-top: 6px; }

.back { display: inline-block; font-size: 13px; margin-bottom: 8px; }

.title-row {
  display: flex;
  align-items: center;
  gap: 10px;
}
.back-btn {
  display: inline-grid;
  place-items: center;
  width: 34px;
  height: 34px;
  flex: 0 0 auto;
  color: var(--text);
  border: 1px solid var(--line);
  border-radius: 0;
}
.back-btn:hover {
  background: var(--accent-soft);
  color: var(--accent-strong);
  text-decoration: none;
}
.back-btn svg { width: 18px; height: 18px; }

.invoice-preview {
  border: 1px solid var(--line);
  border-radius: 0;
  padding: 12px 14px;
  margin-bottom: 12px;
  min-height: 46px;
  font-size: 14px;
}
.preview-line { font-size: 15px; }
.preview-line strong { font-variant-numeric: tabular-nums; }

.invoice-form { max-width: 620px; }

/* -------------------------------- login -------------------------------- */

.login-wrap {
  min-height: 100vh;
  display: grid;
  place-items: center;
  padding: 24px 16px;
}
.login-card {
  width: 100%;
  max-width: 380px;
  padding: 28px 26px;
  display: grid;
  gap: 4px;
}
.login-card .brand-mark { margin-bottom: 12px; }
.login-card h1 { font-size: 22px; }
.login-card p { margin: 4px 0 18px; font-size: 13px; }
.login-card form { margin-top: 4px; }
.login-card .flash-slot { margin-bottom: 12px; }

/* ------------------------------- settings ------------------------------ */

.icon-link {
  display: inline-grid;
  place-items: center;
  width: 34px;
  height: 34px;
  color: var(--muted);
  border: 1px solid transparent;
  border-radius: 0;
}
.icon-link:hover {
  color: var(--accent-strong);
  background: var(--accent-soft);
  text-decoration: none;
}
.icon-link svg { width: 19px; height: 19px; }

.settings-form { display: grid; gap: 16px; max-width: 780px; }

.choice-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 10px;
}
.choice-grid.two { grid-template-columns: repeat(2, minmax(0, 1fr)); }

.choice {
  position: relative;
  display: grid;
  gap: 6px;
  padding: 14px;
  border: 1px solid var(--line);
  background: var(--card);
  cursor: pointer;
  font-weight: 600;
}
.choice:has(input:checked) {
  border-color: var(--accent);
  box-shadow: inset 0 0 0 1px var(--accent);
}
.choice:focus-within {
  outline: 2px solid var(--accent);
  outline-offset: 2px;
}
.choice input {
  position: absolute;
  opacity: 0;
  pointer-events: none;
}
.choice-title { font-size: 14px; }
.choice .muted { font-weight: 400; }

.appearance-dot {
  width: 24px;
  height: 24px;
  display: inline-block;
  border: 1px solid var(--line);
}
.appearance-dot.light { background: #ffffff; }
.appearance-dot.dark { background: #182220; }
.appearance-dot.system {
  background: linear-gradient(90deg, #ffffff 50%, #182220 50%);
}

.swatch {
  width: 24px;
  height: 24px;
  display: inline-block;
  border: 1px solid var(--line);
}
.swatch.teal { background: #0b5c55; }
.swatch.ink { background: #1f3a5f; }

/* ------------------------------ item list ------------------------------ */

.product-list {
  margin-top: 14px;
  background: var(--card);
  border-top: 1px solid var(--line);
  border-bottom: 1px solid var(--line);
}

.product-head {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 92px 78px 132px;
  gap: 12px;
  padding: 10px 14px;
  border-bottom: 1px solid var(--line);
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--muted);
}

.product-row {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 92px 78px 132px;
  gap: 12px;
  align-items: center;
  padding: 13px 14px;
  border-bottom: 1px solid var(--line);
}
.product-row:last-child { border-bottom: 0; }

.product-row .name { font-weight: 600; font-size: 14px; }
.product-row .price { text-align: right; font-variant-numeric: tabular-nums; font-size: 14px; }
.product-row .status { justify-self: start; }
.product-row .actions { display: flex; gap: 6px; justify-content: flex-end; }
.product-row .actions form { margin: 0; }

/* ------------------------------ bottom nav ----------------------------- */

.bottom-nav { display: none; }

/* ------------------------------- mobile -------------------------------- */

@media (max-width: 800px) {
  .topbar-inner {
    padding: calc(8px + env(safe-area-inset-top)) 12px 8px;
    gap: 10px;
  }
  .brand { gap: 8px; }
  .brand-name {
    max-width: 52vw;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
  }
  .nav { display: none; }
  .who { display: none; }
  .account { margin-left: auto; }
  .account .btn { min-height: 38px; }

  .container {
    padding: 16px 12px calc(96px + env(safe-area-inset-bottom));
  }

  .bottom-nav {
    position: fixed;
    left: 0;
    right: 0;
    bottom: 0;
    z-index: 30;
    display: grid;
    grid-template-columns: repeat(5, minmax(0, 1fr));
    gap: 2px;
    padding: 6px 6px calc(6px + env(safe-area-inset-bottom));
    background: var(--card);
    border-top: 1px solid var(--line);
  }
  .bottom-link {
    display: grid;
    justify-items: center;
    gap: 2px;
    padding: 5px 2px 3px;
    border-radius: 0;
    color: var(--muted);
    font-size: 10.5px;
    font-weight: 600;
    letter-spacing: 0.01em;
    text-decoration: none;
  }
  .bottom-link svg { width: 22px; height: 22px; }
  .bottom-link:hover { text-decoration: none; }
  .bottom-link.is-active { color: var(--accent-strong); background: var(--accent-soft); }
  body.keyboard-open .bottom-nav { display: none; }

  .page-head {
    flex-direction: column;
    align-items: stretch;
    gap: 12px;
    margin-bottom: 14px;
  }
  .page-head h1 { font-size: 21px; }
  .page-head .muted { font-size: 13px; }
  .page-actions { width: 100%; }
  .page-actions .btn { flex: 1; min-height: 44px; }

  .card { padding: 14px; border-radius: 0; }
  .card-head { margin-bottom: 10px; }
  .split { gap: 14px; }

  .choice-grid { grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 6px; }
  .choice-grid.two { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .choice { padding: 10px; gap: 4px; }
  .choice .muted { font-size: 11px; line-height: 1.3; }

  .product-head { display: none; }
  .product-row {
    grid-template-columns: minmax(0, 1fr) auto;
    gap: 7px 10px;
    padding: 12px 14px;
  }
  .product-row .name { grid-column: 1; }
  .product-row .price { grid-column: 2; }
  .product-row .status { grid-column: 1; }
  .product-row .actions { grid-column: 2; justify-content: flex-end; }
  .product-row .actions .btn { padding: 5px 8px; min-height: 32px; font-size: 12px; }

  .stats { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; }
  .stat { padding: 12px 13px; }
  .stat-label { font-size: 10.5px; }
  .stat-value { font-size: clamp(18px, 5.4vw, 23px); overflow-wrap: anywhere; }
  .stat-note { font-size: 11.5px; }

  /* Toast instead of a banner the user has already scrolled past. */
  .flash-slot:not(:empty) {
    position: fixed;
    top: calc(64px + env(safe-area-inset-top));
    left: 12px;
    right: 12px;
    z-index: 40;
    margin: 0;
    animation: toast-in 0.2s ease-out;
  }
  /* Inside the app, sit above the bottom tab bar instead of over the heading. */
  body.has-nav .flash-slot:not(:empty) {
    top: auto;
    bottom: calc(78px + env(safe-area-inset-bottom));
  }
  .flash {
    font-size: 13px;
    padding: 10px 13px;
    box-shadow: var(--shadow);
  }

  .filters {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 8px;
    padding: 12px;
  }
  .filters label { min-width: 0; }
  .filters .btn { min-height: 42px; }

  .field-row { grid-template-columns: 1fr; gap: 0; }
  .field-row.dates { grid-template-columns: 1fr 1fr; gap: 10px; }

  .sale-items-head,
  .sale-item-row { grid-template-columns: minmax(0, 1fr) 64px 38px; gap: 6px; }
  .icon-btn { width: 38px; height: 44px; }

  input, select, textarea {
    font-size: 16px; /* stops iOS Safari from zooming on focus */
    min-height: 44px;
    padding: 10px 12px;
  }
  textarea { min-height: 64px; }
  .btn { min-height: 44px; }
  .btn-sm { min-height: 40px; }
  .form-actions .btn { flex: 1; }

  .invoice-form .btn-primary { width: 100%; }
  .invoice-grid { gap: 14px; }
  .invoice-total { padding: 12px 14px 14px; }
  .invoice-total strong { font-size: 20px; }
  .invoice-status { justify-items: stretch; }
  .invoice-status .badge { justify-self: start; }
  .invoice-form { max-width: none; }

  .login-wrap { padding: 20px 14px; min-height: 100dvh; }
  .login-card { padding: 24px 20px; }

  /* Mobile lists: divider rows, no field labels, 14px side padding. */
  .table-wrap { margin: 0; overflow: visible; }
  table.responsive { display: block; }
  table.responsive thead { display: none; }
  table.responsive tbody { display: block; }
  table.responsive tr {
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto;
    column-gap: 10px;
    row-gap: 3px;
    align-items: baseline;
    padding: 12px 14px;
    margin: 0;
    border: 0;
    border-bottom: 1px solid var(--line);
    border-radius: 0;
    background: transparent;
  }
  table.responsive tr:last-child { border-bottom: 0; }
  table.responsive tr:hover { background: transparent; }
  table.responsive td {
    display: block;
    padding: 0;
    border: 0;
    text-align: left;
    font-size: 13.5px;
    overflow-wrap: anywhere;
  }
  table.responsive td::before { display: none; }
  table.responsive td.num { text-align: left; }
  table.responsive td.actions {
    grid-column: 1 / -1;
    display: flex;
    justify-content: flex-end;
    padding-top: 6px;
  }
  table.responsive td.actions .btn { min-height: 38px; }
  table.responsive td:empty { display: none; }
  table.responsive .cell { display: grid; gap: 2px; justify-items: start; text-align: left; }
  table.responsive .cell .muted { font-size: 12.5px; }

  .list-panel { padding: 0; }
  .list-panel .card-head { padding: 12px 14px; margin-bottom: 0; }
  .list-panel .table-wrap { margin: 0; }

  /* Sales */
  table.sales-list tr { grid-template-columns: minmax(0, 1fr) auto auto; }
  table.sales-list td:nth-child(3) { grid-column: 1 / 3; grid-row: 1; font-size: 15px; font-weight: 600; }
  table.sales-list td:nth-child(6) { grid-column: 3; grid-row: 1; text-align: right; font-weight: 600; }
  table.sales-list td:nth-child(2) { grid-column: 1 / 3; grid-row: 2; color: var(--muted); }
  table.sales-list td:nth-child(7) { grid-column: 3; grid-row: 2; justify-self: end; }
  table.sales-list td:nth-child(1) { grid-column: 1; grid-row: 3; color: var(--muted); font-size: 12.5px; }
  table.sales-list td:nth-child(4) { grid-column: 2; grid-row: 3; text-align: right; color: var(--muted); font-size: 12.5px; }
  table.sales-list td:nth-child(4)::after { content: " ×"; }
  table.sales-list td:nth-child(5) { grid-column: 3; grid-row: 3; text-align: right; color: var(--muted); font-size: 12.5px; }

  /* Customers */
  table.customers-list tr { grid-template-columns: minmax(0, 1fr) auto; }
  table.customers-list td:nth-child(1) { grid-column: 1; grid-row: 1; font-size: 15px; font-weight: 600; }
  table.customers-list td:nth-child(5) { grid-column: 2; grid-row: 1; text-align: right; font-weight: 600; }
  table.customers-list td:nth-child(2) { grid-column: 1; grid-row: 2; color: var(--muted); font-size: 12.5px; }
  table.customers-list td:nth-child(6) { grid-column: 2; grid-row: 2; justify-self: end; }
  table.customers-list td:nth-child(3) { grid-column: 1; grid-row: 3; color: var(--muted); font-size: 12.5px; }
  table.customers-list td:nth-child(3)::after { content: " sales"; }
  table.customers-list td:nth-child(4) { grid-column: 2; grid-row: 3; text-align: right; color: var(--muted); font-size: 12.5px; }
  table.customers-list td:nth-child(4)::after { content: " items"; }
  table.customers-list td:nth-child(7) { grid-column: 1 / -1; grid-row: 4; }

  /* Invoices */
  table.invoices-list tr { grid-template-columns: minmax(0, 1fr) auto; }
  table.invoices-list td:nth-child(1) { grid-column: 1; grid-row: 1; font-size: 15px; font-weight: 600; }
  table.invoices-list td:nth-child(4) { grid-column: 2; grid-row: 1; text-align: right; font-weight: 600; }
  table.invoices-list td:nth-child(2) { grid-column: 1; grid-row: 2; color: var(--muted); }
  table.invoices-list td:nth-child(5) { grid-column: 2; grid-row: 2; justify-self: end; }
  table.invoices-list td:nth-child(3) { grid-column: 1; grid-row: 3; color: var(--muted); font-size: 12.5px; }
  table.invoices-list td:nth-child(6) { grid-column: 2; grid-row: 3; text-align: right; color: var(--muted); font-size: 12.5px; }

  /* Invoice lines */
  table.invoice-lines tr { grid-template-columns: minmax(0, 1fr) auto auto; }
  table.invoice-lines td:nth-child(2) { grid-column: 1 / 3; grid-row: 1; font-size: 15px; font-weight: 600; }
  table.invoice-lines td:nth-child(5) { grid-column: 3; grid-row: 1; text-align: right; font-weight: 600; }
  table.invoice-lines td:nth-child(1) { grid-column: 1; grid-row: 2; color: var(--muted); font-size: 12.5px; }
  table.invoice-lines td:nth-child(3) { grid-column: 2; grid-row: 2; text-align: right; color: var(--muted); font-size: 12.5px; }
  table.invoice-lines td:nth-child(3)::after { content: " ×"; }
  table.invoice-lines td:nth-child(4) { grid-column: 3; grid-row: 2; text-align: right; color: var(--muted); font-size: 12.5px; }
  table.invoice-lines td:nth-child(6) { grid-column: 1 / -1; grid-row: 3; }

  /* Dashboard recent sales */
  table.recent-list tr { grid-template-columns: minmax(0, 1fr) auto; }
  table.recent-list td:nth-child(3) { grid-column: 1; grid-row: 1; font-size: 15px; font-weight: 600; }
  table.recent-list td:nth-child(5) { grid-column: 2; grid-row: 1; text-align: right; font-weight: 600; }
  table.recent-list td:nth-child(2) { grid-column: 1; grid-row: 2; color: var(--muted); }
  table.recent-list td:nth-child(6) { grid-column: 2; grid-row: 2; justify-self: end; }
  table.recent-list td:nth-child(1) { grid-column: 1; grid-row: 3; color: var(--muted); font-size: 12.5px; }
  table.recent-list td:nth-child(4) { grid-column: 2; grid-row: 3; text-align: right; color: var(--muted); font-size: 12.5px; }
  table.recent-list td:nth-child(4)::after { content: " ×"; }
}

@media (max-width: 480px) {
  .stat-value { font-size: 19px; }
}

@keyframes toast-in {
  from { opacity: 0; transform: translateY(6px); }
  to { opacity: 1; transform: translateY(0); }
}

/* -------------------------------- print -------------------------------- */

@media print {
  body { background: #fff; color: #000; }
  .topbar, .bottom-nav, .page-actions, .btn, .flash-slot, .back { display: none !important; }
  .container { max-width: none; padding: 0; }
  .card { border: 0; box-shadow: none; padding: 0; }
  .invoice-grid { grid-template-columns: 1fr; }
  .table-wrap { margin: 0; }
  a { color: #000; }
}
