@import url("https://fonts.googleapis.com/css2?family=DM+Sans:wght@400;450;500;550;600;650;700;750&family=IBM+Plex+Sans+Thai:wght@400;450;500;550;600;650;700&display=swap");
:root {
  --bg: #edf0f7;
  --surface: rgba(255, 255, 255, 0.68);
  --surface-in: rgba(235, 239, 249, 0.64);
  --navy: #263653;
  --navy-2: #5265cc;
  --navy-3: #6477dd;
  --ink: #26334d;
  --ink-soft: #6e7b92;
  --ink-faint: #8591a6;
  --green: #248472;
  --green-bg: #e2f4ed;
  --rust: #9f7634;
  --rust-bg: #fbf1de;
  --red: #c4576d;
  --red-bg: #fbe9ed;
  --sh-d: rgba(134, 151, 185, 0.12);
  --sh-l: rgba(255, 255, 255, 0.8);
  --sh-d-navy: rgba(88, 103, 178, 0.16);
  --sh-l-navy: rgba(255, 255, 255, 0.3);
  --line: rgba(155, 171, 202, 0.18);
  --font: "DM Sans", "IBM Plex Sans Thai", sans-serif;
  --glass-shadow:
    0 8px 36px rgba(79, 96, 143, 0.045), inset 0 1px 0 rgba(255, 255, 255, 0.95);
  color-scheme: light;
}
* {
  box-sizing: border-box;
}
html {
  scroll-behavior: smooth;
  scroll-padding: 24px;
}
body {
  margin: 0;
  min-width: 320px;
  min-height: 100vh;
  color: var(--ink);
  font-family: var(--font);
  font-size: 14px;
  line-height: 1.55;
  background: #edf0f7;
}
body::before {
  content: "";
  position: fixed;
  inset: 0;
  z-index: -1;
  background:
    radial-gradient(
      ellipse at 5% 10%,
      rgba(202, 208, 245, 0.7),
      transparent 46%
    ),
    radial-gradient(
      ellipse at 83% 3%,
      rgba(220, 228, 245, 0.8),
      transparent 50%
    ),
    radial-gradient(
      ellipse at 80% 88%,
      rgba(212, 210, 243, 0.65),
      transparent 48%
    ),
    radial-gradient(
      ellipse at 15% 87%,
      rgba(223, 237, 239, 0.7),
      transparent 44%
    );
  pointer-events: none;
}
button,
input,
select,
textarea {
  font: inherit;
}
button,
a,
input,
select,
summary {
  -webkit-tap-highlight-color: transparent;
}
button {
  cursor: pointer;
}
button:disabled,
input:disabled {
  cursor: not-allowed;
  opacity: 0.5;
}
button:focus-visible,
a:focus-visible,
summary:focus-visible,
[tabindex]:focus-visible {
  outline: 3px solid #8394ec;
  outline-offset: 4px;
}
input:focus-visible,
select:focus-visible,
textarea:focus-visible {
  outline: 2px solid #91a1ef;
  outline-offset: 2px;
}
button {
  color: inherit;
}
a {
  color: inherit;
}
h1,
h2,
h3,
p {
  overflow-wrap: anywhere;
}
h1,
h2,
h3 {
  font-family: var(--font);
  font-weight: 600;
  color: var(--navy);
}
[hidden] {
  display: none !important;
}
.icon {
  width: 20px;
  height: 20px;
  flex-shrink: 0;
  vertical-align: middle;
}
.glass,
.clay,
.panel,
.clay-in {
  background: var(--surface);
  border: 1px solid rgba(255, 255, 255, 0.85);
  box-shadow: var(--glass-shadow);
  backdrop-filter: blur(24px);
  -webkit-backdrop-filter: blur(24px);
  border-radius: 22px;
}
.wrap {
  max-width: 1800px;
  margin: auto;
  padding: 18px;
  display: flex;
  gap: 32px;
  align-items: flex-start;
}
.sidebar {
  position: sticky;
  top: 18px;
  flex: 0 0 236px;
  min-height: calc(100vh - 36px);
  height: calc(100vh - 36px);
  display: flex;
  flex-direction: column;
  padding: 30px 18px 20px;
  background: linear-gradient(
    155deg,
    rgba(255, 255, 255, 0.69),
    rgba(244, 246, 255, 0.36)
  );
  border-radius: 26px;
}
.brand {
  display: flex;
  gap: 11px;
  align-items: center;
  text-decoration: none;
  padding: 0 12px 33px;
}
.brand-mark {
  height: 42px;
  width: 42px;
  display: flex;
  align-items: center;
  justify-content: center;
  position: relative;
  background: linear-gradient(145deg, #7789e7, #5567c3);
  color: #fff;
  border-radius: 14px;
  font-size: 27px;
  font-weight: 750;
  box-shadow:
    0 5px 12px #6374c827,
    inset 0 1px 1px #fff8;
}
.brand-mark > span {
  font-size: 18px;
  position: absolute;
  right: 3px;
  top: -1px;
}
.brand strong {
  font-size: 27px;
  letter-spacing: -1.3px;
  font-weight: 750;
  line-height: 1.1;
}
.brand-dot {
  color: #7688dd;
}
.brand small {
  display: block;
  font-size: 8px;
  letter-spacing: 2px;
  color: var(--ink-soft);
  margin-top: 4px;
}
.workspace-label {
  font-size: 10px;
  color: var(--ink-faint);
  padding: 0 14px;
  margin-bottom: 12px;
  letter-spacing: 0.6px;
}
nav.tabs {
  display: flex;
  flex-direction: column;
  gap: 6px;
}
nav.tabs button {
  width: 100%;
  display: flex;
  align-items: center;
  gap: 12px;
  text-align: left;
  border: 1px solid transparent;
  background: transparent;
  padding: 12px 14px;
  border-radius: 13px;
  font-size: 13px;
  color: #718099;
  font-weight: 500;
  min-height: 46px;
  transition:
    background 0.18s,
    color 0.18s;
}
nav.tabs button .icon {
  width: 18px;
  height: 18px;
}
nav.tabs button:hover {
  background: #ffffff6b;
  color: var(--navy);
}
nav.tabs button.active {
  background: linear-gradient(120deg, #ffffffd6, #ffffff86);
  color: #5368ce;
  border: 1px solid #ffffffdc;
  box-shadow:
    0 4px 12px #657ca911,
    inset 0 1px 0 #fff;
  font-weight: 600;
}
nav.tabs button.active .icon {
  stroke-width: 2;
}
.nav-count {
  margin-left: auto;
  border-radius: 6px;
  padding: 1px 5px;
  background: #e0e6fa;
  font-size: 10px;
}
.sidebar-bottom {
  margin-top: auto;
  padding-top: 32px;
}
.workspace-note {
  padding: 16px 12px 26px;
}
.workspace-note > .icon {
  color: #91a0cc;
  width: 22px;
  height: 22px;
  margin-bottom: 10px;
}
.workspace-note strong {
  display: block;
  font-size: 10px;
  font-weight: 600;
  color: #74809c;
  letter-spacing: -0.1px;
}
.workspace-note p {
  color: #8a94a8;
  font-size: 11px;
  line-height: 1.8;
  margin: 7px 0 0;
}
.store-profile {
  display: flex;
  align-items: center;
  gap: 10px;
  border-top: 1px solid var(--line);
  padding: 20px 5px 0;
}
.avatar {
  width: 36px;
  height: 36px;
  background: linear-gradient(140deg, #e1e6f7, #cdd5ef);
  box-shadow: inset 0 1px 0 #fff;
  border: 1px solid #ffffffb0;
  border-radius: 12px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: 14px;
  color: #6b7abb;
  font-weight: 650;
  flex-shrink: 0;
}
.store-profile strong {
  display: block;
  font-size: 11px;
  font-weight: 650;
}
.store-profile small {
  display: block;
  font-size: 9px;
  color: var(--ink-soft);
  margin-top: 2px;
}
.store-profile .online-dot {
  margin-left: auto;
}
.online-dot {
  display: inline-block;
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: #75ad9b;
  box-shadow: 0 0 0 3px #79b19914;
  flex-shrink: 0;
}
.main-content {
  min-width: 0;
  flex: 1;
  padding: 0 18px 0 0;
}
.topbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 15px;
  height: 64px;
  border-bottom: 1px solid var(--line);
  margin-bottom: 31px;
}
.breadcrumb {
  display: flex;
  gap: 12px;
  font-size: 11px;
  color: #929bad;
  align-items: center;
}
.breadcrumb strong {
  color: #758199;
  font-weight: 500;
}
.breadcrumb > span {
  color: #b5bfd0;
}
.topbar-right {
  display: flex;
  gap: 24px;
  align-items: center;
  color: var(--ink-soft);
  font-size: 10px;
}
.sync-status {
  display: flex;
  gap: 7px;
  align-items: center;
}
.topbar-date {
  display: flex;
  gap: 7px;
  align-items: center;
}
.topbar-date .icon {
  width: 14px;
  height: 14px;
}
.avatar-small {
  width: 29px;
  height: 29px;
  font-size: 11px;
  border-radius: 10px;
}
.page-header {
  display: flex;
  gap: 20px;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 26px;
}
.eyebrow {
  font-size: 9px;
  letter-spacing: 1.8px;
  color: #8895b4;
  margin: 0 0 7px;
  font-weight: 600;
}
h1 {
  margin: 0 0 6px;
  font-size: 30px;
  letter-spacing: -0.9px;
  line-height: 1.4;
  font-weight: 600;
}
.heading-dot {
  color: #7e8fd1;
}
.subline {
  font-size: 12px;
  color: var(--ink-soft);
  margin: 0;
}
.header-actions {
  display: flex;
  align-items: center;
  gap: 10px;
}
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  border: 1px solid transparent;
  border-radius: 12px;
  padding: 11px 17px;
  font-size: 12px;
  font-weight: 550;
  line-height: 1.5;
  min-height: 42px;
  transition:
    transform 0.15s,
    background 0.15s,
    box-shadow 0.15s;
  white-space: normal;
}
.btn .icon {
  width: 16px;
  height: 16px;
}
.btn:hover {
  transform: translateY(-1px);
}
.btn:active {
  transform: translateY(0);
}
.btn-primary,
.btn-gold {
  color: #fff;
  background: linear-gradient(130deg, #7284df, #596dd0);
  border-color: #ffffff45;
  box-shadow:
    0 5px 12px #596dcc22,
    inset 0 1px 0 #ffffff40;
}
.btn-primary:hover,
.btn-gold:hover {
  background: linear-gradient(130deg, #667bdd, #5064c8);
  box-shadow: 0 7px 16px #596dcc30;
}
.btn-ghost {
  color: #6d7b94;
  background: #ffffff73;
  border-color: #fff;
  box-shadow:
    0 2px 6px #7085b106,
    inset 0 1px 0 #fff;
}
.btn-ghost:hover {
  background: #fff;
  color: #5265c1;
}
.btn-sm {
  min-height: 32px;
  padding: 6px 11px;
  font-size: 11px;
  border-radius: 9px;
}
.btn-danger {
  border: 1px solid #e7b7c130;
  background: #f9e9edab;
  color: var(--red);
  padding: 6px 10px;
  border-radius: 9px;
  font-size: 11px;
  min-height: 32px;
}
.btn-danger:hover {
  background: #f7dce4;
}
.text-button {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  background: transparent;
  border: none;
  color: #7d8caa;
  font-size: 11px;
  padding: 7px 0;
}
.text-button .icon {
  width: 15px;
  height: 15px;
}
.text-button:hover {
  color: #5265c1;
}
.stats {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 16px;
  margin-bottom: 22px;
}
.stat {
  padding: 18px 20px;
  position: relative;
  overflow: hidden;
}
.stat-top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 5px;
}
.stat .lbl {
  font-size: 11px;
  color: #738097;
}
.stat-icon {
  width: 29px;
  height: 29px;
  border-radius: 9px;
  display: flex;
  align-items: center;
  justify-content: center;
  color: #8292c3;
  background: #eaf0fd80;
  border: 1px solid #fff7;
}
.stat-icon .icon {
  width: 16px;
  height: 16px;
}
.stat .val {
  font-size: 28px;
  font-weight: 550;
  letter-spacing: -1px;
  color: #354362;
  line-height: 1.3;
  margin: 10px 0 9px;
  font-variant-numeric: tabular-nums;
}
.stat-note {
  font-size: 9px;
  color: #8b97ab;
}
.income-stat .stat-icon {
  color: #7aa898;
  background: #e8f4ee8a;
}
.expense-stat .stat-icon {
  color: #be9b81;
  background: #fbf1e98a;
}
.stat.profit {
  background: linear-gradient(
    128deg,
    rgba(116, 136, 217, 0.8),
    rgba(132, 143, 213, 0.67)
  );
  border-color: #d3dcff;
  box-shadow:
    0 8px 28px #8794d321,
    inset 0 1px 0 #ffffff90;
}
.stat.profit::after {
  content: "";
  position: absolute;
  width: 120px;
  height: 120px;
  border-radius: 50%;
  right: -50px;
  bottom: -74px;
  border: 20px solid #ffffff0a;
  box-shadow: 0 0 0 20px #ffffff06;
}
.stat.profit .lbl,
.stat.profit .val {
  color: #fff;
}
.stat.profit .stat-note {
  color: #f0f2ff;
}
.stat.profit .stat-icon {
  color: #f2f4ff;
  background: #ffffff18;
  border-color: #ffffff27;
}
.dashboard-grid {
  display: grid;
  grid-template-columns: minmax(0, 1.48fr) minmax(300px, 1fr);
  gap: 20px;
  margin-bottom: 22px;
}
.panel {
  padding: 23px;
  border-radius: 22px;
  min-width: 0;
}
.panel + .panel {
  margin-top: 20px;
}
.dashboard-grid > .panel + .panel {
  margin-top: 0;
}
.panel h2 {
  font-size: 16px;
  margin: 0 0 15px;
  font-weight: 600;
  letter-spacing: -0.2px;
}
.section-heading {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  margin-bottom: 10px;
}
.section-heading h2 {
  margin: 0;
  font-size: 15px;
}
.section-heading .eyebrow {
  font-size: 8px;
  margin-bottom: 5px;
  letter-spacing: 1.5px;
}
.chart-legend {
  display: flex;
  align-items: center;
  gap: 15px;
  font-size: 9px;
  color: #8490a5;
  margin: 20px 0 10px;
}
.chart-legend > span {
  display: flex;
  align-items: center;
  gap: 5px;
}
.legend-dot {
  height: 6px;
  width: 6px;
  display: inline-block;
  border-radius: 50%;
}
.legend-dot.blue {
  background: #7888df;
}
.legend-dot.lavender {
  background: #b4a1d1;
}
.period-label {
  margin-left: auto;
  color: #8d98ac;
  font-size: 8px;
}
.cash-chart {
  display: flex;
  gap: 13px;
  margin-top: 14px;
}
.chart-scale {
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  font-size: 9px;
  color: #91a0b4;
  padding: 20px 0 27px;
  min-width: 42px;
  max-width: 76px;
  word-break: break-all;
}
.chart-plot {
  min-width: 0;
  flex: 1;
}
.chart-plot svg {
  display: block;
  width: 100%;
  height: 152px;
  overflow: visible;
}
.chart-months {
  display: flex;
  justify-content: space-between;
  gap: 2px;
  font-size: 8px;
  color: #8e9ab0;
  margin-top: 7px;
}
.chart-data {
  font-size: 10px;
  color: var(--ink-soft);
  margin-top: 10px;
}
.chart-data summary {
  cursor: pointer;
  list-style: none;
  text-align: right;
}
.chart-data table {
  font-size: 10px;
}
.radar-orb {
  height: 33px;
  width: 33px;
  display: flex;
  align-items: center;
  justify-content: center;
  border: 1px solid #ffffffd1;
  border-radius: 11px;
  background: linear-gradient(145deg, #edf0fd, #e0e5f4);
  color: #91a0d2;
}
.radar-orb .icon {
  width: 17px;
  height: 17px;
}
.attention-panel {
  background: linear-gradient(145deg, #ffffffb8, #f8f9ff7a);
}
.attention-row {
  display: flex;
  align-items: center;
  gap: 10px;
  width: 100%;
  background: transparent;
  border: 0;
  border-bottom: 1px solid var(--line);
  padding: 15px 0;
  text-align: left;
}
.attention-icon {
  height: 34px;
  width: 34px;
  border-radius: 10px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: #eef2fd;
  color: #90a0d0;
  flex-shrink: 0;
}
.attention-icon .icon {
  width: 17px;
  height: 17px;
}
.attention-icon.amber {
  background: #f8efe2;
  color: #b8a07b;
}
.attention-icon.violet {
  background: #f0eafa;
  color: #a294c4;
}
.attention-row strong {
  display: block;
  font-size: 11px;
  font-weight: 500;
}
.attention-row small {
  display: block;
  font-size: 8px;
  color: #929db1;
  margin-top: 3px;
}
.attention-row b {
  margin-left: auto;
  font-size: 15px;
  font-weight: 500;
  white-space: nowrap;
}
.attention-row b small {
  text-align: right;
  font-weight: 400;
  font-size: 8px;
}
.attention-row > .icon {
  height: 13px;
  width: 13px;
  color: #a7b1c5;
}
.attention-row:hover strong {
  color: #5269cd;
}
.attention-foot {
  display: flex;
  align-items: center;
  gap: 6px;
  color: #8e9caf;
  font-size: 8px;
  padding-top: 13px;
}
.attention-foot .icon {
  width: 12px;
  height: 12px;
}
.panel-title-action {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 16px;
  margin-bottom: 16px;
}
.panel-title-action h2 {
  margin: 0 0 4px;
}
.hint {
  font-size: 11px;
  color: var(--ink-soft);
  line-height: 1.85;
  margin: -7px 0 17px;
}
.panel-title-action .hint {
  margin: 0;
}
.workspace-tabs,
.filter-tabs {
  display: flex;
  gap: 7px;
  overflow: auto;
  padding: 5px;
  margin: 0 0 20px;
  border: 1px solid #ffffffb0;
  background: #ffffff37;
  border-radius: 14px;
}
.workspace-tabs button,
.filter-tabs button {
  flex-shrink: 0;
  border: 1px solid transparent;
  background: none;
  color: #8793aa;
  font-size: 12px;
  padding: 9px 16px;
  border-radius: 10px;
  white-space: nowrap;
}
.workspace-tabs button.active,
.filter-tabs button.active {
  color: #5e73ce;
  background: #ffffffc9;
  border-color: #fff;
  box-shadow: 0 3px 8px #7787b00b;
}
.workspace-tabs button:hover {
  color: #5066c2;
  background: #ffffff77;
}
.filter-tabs {
  padding: 0;
  border: 0;
  background: none;
  gap: 3px;
  margin-bottom: 14px;
}
.filter-tabs button {
  font-size: 10px;
  padding: 6px 12px;
}
.filter-tabs button.active {
  background: #e8edfb;
  color: #6678c1;
  border-color: #e1e8f9;
}
.inventory-toolbar {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 16px;
  margin: 18px 0;
}
.search-field {
  position: relative;
  min-width: 0;
}
.search-field > .icon {
  position: absolute;
  left: 13px;
  top: 50%;
  transform: translateY(-50%);
  width: 15px;
  height: 15px;
  color: #95a1b7;
  pointer-events: none;
}
.search-field input {
  padding-left: 38px !important;
}
.inventory-toolbar .search-field {
  width: min(330px, 100%);
}
.inventory-count {
  font-size: 10px;
  color: #8a96ac;
  white-space: nowrap;
}
.form-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 16px;
  align-items: end;
}
.field {
  display: flex;
  flex-direction: column;
  gap: 7px;
  min-width: 0;
}
.field label {
  font-size: 11px;
  font-weight: 500;
  color: #718097;
}
.field input,
.field select,
.size-row input,
.pb-size-row input,
.restock-row input,
.restock-row select,
.pending-row-grid input,
.attach-size-select {
  width: 100%;
  min-width: 0;
  background: #f7f9fbc7;
  border: 1px solid #d9e1ef94;
  box-shadow:
    inset 0 1px 3px #8999bc05,
    0 1px 0 #ffffff90;
  border-radius: 11px;
  padding: 11px 12px;
  color: #42516c;
  font-size: 12px;
  min-height: 42px;
  transition:
    background 0.15s,
    border-color 0.15s;
}
.field input::placeholder,
input::placeholder {
  color: #a4adbd;
}
.field input:hover,
.field select:hover {
  border-color: #b9c6e0;
  background: #fff;
}
.field input[type="file"] {
  font-size: 10px;
  padding: 8px;
  max-width: 100%;
}
.field input[type="file"]::file-selector-button {
  background: #e9eef9;
  border: 0;
  border-radius: 7px;
  padding: 5px 8px;
  font: inherit;
  color: #6579be;
  margin-right: 9px;
}
.type-toggle {
  display: flex;
  gap: 4px;
  background: #e8edf675;
  border: 1px solid #dee5f355;
  border-radius: 12px;
  padding: 4px;
  min-width: 0;
}
.type-toggle label {
  flex: 1;
  text-align: center;
  padding: 8px 9px;
  border-radius: 9px;
  font-size: 11px;
  font-weight: 500;
  cursor: pointer;
  position: relative;
  line-height: 1.6;
}
.type-toggle input {
  position: absolute;
  opacity: 0;
  inset: 0;
  width: 100%;
  height: 100%;
  margin: 0;
  cursor: pointer;
}
.type-toggle label:has(input:checked) {
  background: #fffffff0;
  color: #5b71cc;
  box-shadow: 0 2px 5px #637ab00e;
}
.type-toggle label:has(input:focus-visible) {
  outline: 2px solid #90a2ea;
  outline-offset: 1px;
}
.type-toggle label:has(input:disabled) {
  opacity: 0.4;
  cursor: not-allowed;
}
.checkline {
  display: flex;
  align-items: center;
  gap: 8px;
  grid-column: 1/-1;
  font-size: 11px;
  color: #7d8ba1;
}
.checkline label {
  cursor: pointer;
}
.checkline input {
  width: 16px;
  height: 16px;
  accent-color: #788bdb;
  flex-shrink: 0;
}
.size-row,
.pb-size-row {
  display: flex;
  gap: 8px;
  margin-bottom: 9px;
  flex-wrap: wrap;
}
.pb-size-row input {
  flex: 1 1 90px;
}
.pb-size-row .pbRowQty,
.size-row input[name="qtyRow"] {
  max-width: 100px;
  flex: 0 1 90px;
}
.product-block,
.pending-row {
  background: #eaf0f64d;
  border: 1px solid #dee5f080;
  border-radius: 16px;
  padding: 17px;
  min-width: 0;
}
.restock-row {
  display: grid;
  grid-template-columns: minmax(180px, 2fr) 80px 1fr 1fr auto;
  gap: 8px;
  margin-bottom: 9px;
  align-items: center;
}
.restock-heading {
  font-size: 10px;
  color: var(--ink-soft);
}
#restock-rows.lump-mode .restock-row-cost {
  opacity: 0.45;
  pointer-events: none;
}
.pending-row {
  margin-bottom: 10px;
}
.pending-row-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(88px, 1fr));
  gap: 8px;
  align-items: center;
}
#pending-rows.lump-mode .pRowCost {
  display: none;
}
.pending-row-type {
  padding: 2px;
}
.pending-row-type label {
  font-size: 10px;
  padding: 6px;
}
.table-scroll {
  max-width: 100%;
  overflow: auto;
  scrollbar-width: thin;
  border-radius: 12px;
}
table {
  width: 100%;
  border-collapse: collapse;
  margin: 0;
  font-size: 12px;
}
th {
  text-align: left;
  padding: 11px 12px;
  background: #eaf0f53b;
  color: #8c99af;
  font-size: 9px;
  font-weight: 500;
  white-space: nowrap;
  border-bottom: 1px solid var(--line);
}
td {
  padding: 14px 12px;
  border-bottom: 1px solid var(--line);
  font-size: 11px;
  vertical-align: middle;
}
tr:last-child td {
  border-bottom: 0;
}
tbody tr:hover {
  background: #eff3fb50;
}
.num {
  text-align: right !important;
  font-family: var(--font) !important;
  font-variant-numeric: tabular-nums;
  white-space: nowrap;
}
.tag {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  font-size: 9px;
  padding: 4px 8px;
  border-radius: 7px;
  white-space: nowrap;
  font-weight: 500;
}
.tag::before {
  content: "";
  width: 4px;
  height: 4px;
  background: currentColor;
  border-radius: 50%;
}
.tag.new,
.tag.income {
  color: #5a9883;
  background: #e8f4ee;
}
.tag.used {
  color: #b28c5b;
  background: #fbf1e3;
}
.tag.expense {
  color: #c1808c;
  background: #faedf0;
}
.tag.installment {
  background: #edeaf8;
  color: #9380bb;
}
.tag.soldout {
  background: #e9edf4;
  color: #939db0;
}
.thumb {
  width: 42px;
  height: 42px;
  overflow: hidden;
  border-radius: 12px;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  background: linear-gradient(145deg, #e8edf9, #e0e7f4);
  border: 1px solid #ffffffb0;
}
.thumb img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}
.thumb-ph {
  color: #95a4c2;
}
.thumb-ph .icon {
  width: 23px;
  height: 23px;
  stroke-width: 1.3;
}
.thumb-cell {
  display: flex;
  align-items: center;
  justify-content: center;
}
.home-list {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px;
}
.prod-group {
  background: #ffffff5c;
  border: 1px solid #e0e6f080;
  border-radius: 15px;
  padding: 14px;
  min-width: 0;
}
.prod-group-head {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 10px;
}
.prod-group-name {
  font-size: 12px;
  font-weight: 550;
  flex: 1;
  min-width: 0;
}
.prod-group-color {
  display: block;
  font-size: 10px;
  font-weight: 400;
  color: #8e9ab0;
  margin-top: 2px;
}
.prod-group-total {
  color: #8d9cb2;
  font-size: 10px;
  white-space: nowrap;
}
.variant-row {
  display: flex;
  align-items: center;
  gap: 9px;
  padding: 9px 0;
  border-top: 1px solid var(--line);
  font-size: 11px;
}
.variant-info {
  flex: 1;
  min-width: 0;
  overflow-wrap: anywhere;
}
.variant-qty {
  font-size: 12px;
  font-weight: 600;
  min-width: 28px;
  text-align: center;
  font-variant-numeric: tabular-nums;
}
.variant-row.low .variant-qty {
  color: #bd9766;
  background: #fcf0dc;
  border-radius: 6px;
}
.variant-row.out {
  color: #9aa6b9;
}
.variant-row .btn-ghost {
  background: #eff3fa;
  border: 0;
  font-size: 9px;
}
.soldout-section {
  border-top: 1px solid var(--line);
  margin-top: 24px;
  padding-top: 18px;
}
.soldout-title {
  font-size: 11px;
  color: #8b97ad;
  margin: 0 0 14px;
}
.soldout-group {
  opacity: 0.7;
}
.stock-size-item {
  display: grid;
  grid-template-columns: minmax(130px, 1fr) 70px auto auto;
  gap: 8px;
  align-items: center;
  padding: 7px 0;
  border-bottom: 1px solid var(--line);
  font-size: 10px;
}
.stock-size-item:last-child {
  border: 0;
}
.stock-size-list {
  min-width: 340px;
}
.stock-size-item.soldout-item {
  color: #9ca5b6;
}
.stock-section + .stock-section {
  margin-top: 28px;
  padding-top: 22px;
  border-top: 1px solid var(--line);
}
.stock-section h3 {
  display: flex;
  align-items: center;
  gap: 12px;
  margin: 0 0 14px;
  font-size: 14px;
}
.stock-section-count {
  font-size: 11px;
  font-weight: 400;
  color: var(--ink-soft);
}
.variant-row.shipping-row {
  display: grid;
  grid-template-columns: minmax(200px, 1fr) minmax(180px, 320px) 84px;
  gap: 16px;
  padding: 14px 4px;
  align-items: center;
}
.shipping-row .variant-info {
  font-size: 14px;
  color: var(--ink);
  line-height: 1.6;
  overflow-wrap: break-word;
}
.shipping-row .variant-info strong {
  display: block;
  font-weight: 600;
}
.shipping-color {
  display: block;
  margin-top: 3px;
  color: #65748c;
  font-size: 12px;
}
.shipping-row .field label {
  color: #65748c;
  font-size: 12px;
}
.shipping-row .attach-size-select,
.shipping-row .attach-qty {
  width: 100%;
  color: var(--ink);
  font-size: 13px;
}
.shipping-row .attach-qty {
  text-align: center;
}
.alert-banner {
  background: #faf2e492;
  border: 1px solid #eadacb66;
  padding: 12px 15px;
  border-radius: 12px;
  margin-bottom: 13px;
}
.alert-title {
  font-size: 11px;
  color: #a28b62;
  font-weight: 500;
  margin-bottom: 7px;
}
.alert-list {
  display: flex;
  gap: 6px;
  flex-wrap: wrap;
}
.alert-chip {
  font-size: 9px;
  background: #ffffff9c;
  color: #9c8b70;
  padding: 4px 8px;
  border-radius: 6px;
}
.empty {
  text-align: center;
  padding: 44px 20px;
  font-size: 12px;
  color: #8e9bb1;
  line-height: 1.9;
}
.empty::before {
  content: "";
  display: block;
  width: 38px;
  height: 38px;
  border: 1px solid #dce4f3;
  border-radius: 13px;
  background: linear-gradient(135deg, #edf2fc, #e3e9f7);
  box-shadow: inset 0 1px 0 #fff;
  margin: 0 auto 16px;
  transform: rotate(-9deg);
}
.empty .big {
  font-size: 15px;
  font-weight: 500;
  color: #627391;
  margin-bottom: 6px;
}
.empty .btn {
  margin-top: 16px;
}
.sell-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(min(290px, 100%), 1fr));
  gap: 17px;
}
.sell-card {
  border: 1px solid #ffffffdf;
  border-radius: 19px;
  background: linear-gradient(140deg, #ffffffa8, #f6f8fc88);
  padding: 19px;
  box-shadow: 0 5px 20px #6d85b408;
  min-width: 0;
}
.sell-card-top {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 16px;
}
.sell-stock {
  font-size: 10px;
  color: #8c9db3;
}
.sell-name {
  font-size: 14px;
  font-weight: 550;
  margin-bottom: 5px;
}
.sell-price {
  font-size: 19px;
  font-weight: 550;
  color: #5b6fae;
}
.sell-cost-note {
  display: block;
  font-size: 9px;
  color: #8c99ae;
  font-weight: 400;
}
.sell-form,
.sell-picker {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px;
  margin-top: 16px;
}
.sell-form .field label,
.sell-picker .field label {
  font-size: 10px;
}
.sell-form .field input,
.sell-picker select {
  min-height: 38px;
  padding: 8px 10px;
  font-size: 12px;
}
.sell-card .checkline {
  font-size: 10px;
}
.sale-total {
  display: flex;
  justify-content: space-between;
  gap: 8px;
  padding-top: 13px;
  margin-top: 13px;
  border-top: 1px solid var(--line);
  font-size: 10px;
  color: #8391a9;
}
.sale-total b {
  color: #6c80c7;
  font-size: 13px;
  font-weight: 500;
}
.month-row {
  display: grid;
  grid-template-columns: 95px 1fr 125px;
  gap: 15px;
  align-items: center;
  padding: 17px 0;
  border-top: 1px solid var(--line);
}
.month-label {
  font-size: 12px;
  color: #7a8aa3;
}
.bar-wrap {
  height: 7px;
  border-radius: 8px;
  background: #e8edf6;
  overflow: hidden;
  display: flex;
}
.bar-in {
  background: #8ab8a5;
}
.bar-ex {
  background: #dca1b1;
}
.month-sub {
  font-size: 10px;
  color: #98a3b5;
  margin-top: 6px;
}
.month-profit {
  text-align: right;
  font-size: 15px;
  font-variant-numeric: tabular-nums;
}
.pos {
  color: #639e88;
}
.neg {
  color: var(--red);
}
.chart-wrap {
  height: 270px;
  position: relative;
  max-width: 100%;
}
.overdue-row td {
  background: #fae9ec55;
}
.ai-result {
  padding: 22px;
  margin-top: 20px;
  border: 1px solid #dee6f0;
  border-radius: 15px;
  background: #ffffff63;
  line-height: 1.9;
  font-size: 12px;
}
.insights-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 15px;
}
.insight-card {
  padding: 20px;
  background: #ffffff91;
  border: 1px solid #ffffffd9;
  border-radius: 16px;
}
.insight-card h3 {
  font-size: 14px;
  margin: 0 0 10px;
}
.insight-card p,
.insight-card li {
  font-size: 12px;
  line-height: 1.9;
  color: #7b8aa4;
}
.insight-card ul {
  padding-left: 20px;
}
.modal-overlay {
  position: fixed;
  inset: 0;
  background: #293b5e36;
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 1000;
  padding: 20px;
  opacity: 0;
  visibility: hidden;
  pointer-events: none;
  transition: opacity 0.17s;
}
.modal-overlay.show {
  opacity: 1;
  visibility: visible;
  pointer-events: auto;
}
.modal-box {
  width: 100%;
  max-width: 400px;
  background: linear-gradient(130deg, #ffffffee, #f4f7f9eb);
  padding: 28px;
  border: 1px solid #fff;
  border-radius: 24px;
  box-shadow: 0 20px 80px #38497628;
  max-height: 90dvh;
  overflow: auto;
}
.modal-box h2 {
  font-family: var(--font) !important;
  font-size: 20px !important;
}
.modal-message {
  font-size: 14px;
  line-height: 1.8;
  margin: 0 0 24px;
}
.modal-actions {
  display: flex;
  justify-content: flex-end;
  gap: 10px;
}
.detail-box,
.edit-box {
  max-width: 540px;
}
.detail-stats {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px;
}
.detail-stat {
  padding: 13px;
  background: #eaf0f678;
  border: 1px solid #fff;
  border-radius: 13px;
}
.detail-stat .lbl {
  font-size: 10px;
  color: #8a98ad;
}
.detail-stat .val {
  font-size: 18px;
  color: #667aad;
  margin-top: 5px;
}
.loading-screen {
  margin: 12vh auto;
  width: min(450px, 100%);
  padding: 48px;
  text-align: center;
}
.loading-brand {
  position: relative;
  font-size: 50px;
  font-weight: 750;
  line-height: 1;
  color: #788adc;
  margin-bottom: 22px;
}
.loading-brand span {
  font-size: 27px;
  vertical-align: top;
}
.loading-screen h1 {
  font-size: 22px;
}
.loading-screen p {
  font-size: 12px;
  color: #7b8da9;
}
.loading-track {
  height: 3px;
  background: #e6eaf4;
  border-radius: 3px;
  overflow: hidden;
  margin: 25px auto 0;
  width: 130px;
}
.loading-track span {
  display: block;
  width: 40%;
  height: 100%;
  background: #8b9ae1;
  animation: loading 1.5s ease-in-out infinite;
}
.loading {
  padding: 70px;
  text-align: center;
  color: #7b8da9;
}
.toast {
  position: fixed;
  bottom: 26px;
  left: 50%;
  transform: translate(-50%, 15px);
  background: #34476aec;
  border: 1px solid #ffffff66;
  backdrop-filter: blur(20px);
  color: #fff;
  border-radius: 14px;
  padding: 13px 22px;
  box-shadow: 0 8px 30px #32497222;
  font-size: 12px;
  z-index: 2000;
  opacity: 0;
  pointer-events: none;
  transition: 0.2s;
  max-width: calc(100vw - 40px);
}
.toast.visible {
  opacity: 1;
  transform: translate(-50%, 0);
}
footer {
  margin: 27px 0 8px;
  display: flex;
  justify-content: space-between;
  gap: 16px;
  align-items: center;
  color: #9ca6b9;
  font-size: 8px;
  letter-spacing: 0.15px;
}
.footer-dot {
  padding: 0 6px;
  color: #b2bad0;
}
.data-tools {
  position: relative;
}
.data-tools summary {
  list-style: none;
  display: flex;
  gap: 8px;
  align-items: center;
  cursor: pointer;
  font-size: 10px;
  color: #8390a6;
}
.data-tools summary .icon {
  height: 11px;
  width: 11px;
  transform: rotate(90deg);
}
.footer-actions {
  position: absolute;
  bottom: 28px;
  right: 0;
  display: flex;
  flex-direction: column;
  gap: 3px;
  background: #f9fbfff5;
  backdrop-filter: blur(20px);
  padding: 10px;
  border: 1px solid #fff;
  border-radius: 13px;
  box-shadow: 0 8px 36px #53699225;
  min-width: 180px;
  z-index: 2;
}
.footer-actions button {
  display: flex;
  align-items: center;
  gap: 8px;
  border: 0;
  background: transparent;
  padding: 10px;
  font-size: 11px;
  text-align: left;
  border-radius: 8px;
  color: #6f809d;
}
.footer-actions button:hover {
  background: #eaf0fa;
}
.footer-actions .icon {
  height: 14px;
  width: 14px;
}
.footer-actions .danger-text {
  color: #bb7a89;
}
.skip-link {
  position: fixed;
  top: -60px;
  left: 20px;
  z-index: 3000;
  background: #fff;
  padding: 12px;
  border-radius: 8px;
}
.skip-link:focus {
  top: 15px;
}
@keyframes loading {
  0% {
    transform: translateX(-100%);
  }
  100% {
    transform: translateX(360%);
  }
}
@media (min-width: 1600px) {
  .main-content {
    padding-right: 30px;
  }
  .wrap {
    gap: 40px;
  }
  .sidebar {
    flex-basis: 250px;
  }
  .stat .val {
    font-size: 32px;
  }
}
@media (max-width: 1200px) {
  .sidebar {
    flex-basis: 210px;
    padding-left: 12px;
    padding-right: 12px;
  }
  .wrap {
    gap: 22px;
  }
  .main-content {
    padding-right: 4px;
  }
  .brand {
    padding-left: 9px;
  }
  .stat {
    padding: 16px;
  }
  .stat .val {
    font-size: 24px;
  }
  .dashboard-grid {
    grid-template-columns: minmax(0, 1.2fr) minmax(270px, 1fr);
    gap: 16px;
  }
  .panel {
    padding: 20px;
  }
  .header-actions .btn {
    padding: 10px 12px;
  }
  .restock-row {
    grid-template-columns: minmax(160px, 2fr) 65px 1fr 1fr auto;
  }
  .attention-row {
    gap: 8px;
  }
}
@media (max-width: 1000px) {
  .wrap {
    gap: 18px;
    padding: 14px;
  }
  .sidebar {
    flex-basis: 76px;
    padding: 23px 9px;
    height: calc(100vh - 28px);
    min-height: 0;
    top: 14px;
    border-radius: 21px;
  }
  .brand {
    padding: 0 0 32px;
    justify-content: center;
  }
  .brand > span:last-child,
  .workspace-label,
  nav.tabs button > span,
  .sidebar-bottom {
    display: none;
  }
  nav.tabs button {
    justify-content: center;
    padding: 14px 8px;
  }
  nav.tabs button .icon {
    width: 21px;
    height: 21px;
  }
  nav.tabs button {
    position: relative;
  }
  nav.tabs button::after {
    content: attr(aria-label);
  }
  .brand-mark {
    width: 38px;
    height: 38px;
    border-radius: 12px;
  }
  .topbar {
    margin-bottom: 27px;
  }
  .page-header {
    gap: 12px;
  }
  .page-header h1 {
    font-size: 27px;
  }
  .header-actions {
    gap: 6px;
  }
  .stats {
    gap: 12px;
  }
  .dashboard-grid {
    grid-template-columns: minmax(0, 1.3fr) minmax(260px, 1fr);
  }
  .form-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}
@media (max-width: 760px) {
  .wrap {
    display: block;
    padding: 0 18px 85px;
  }
  .sidebar {
    position: fixed;
    inset: auto 10px 10px;
    z-index: 50;
    height: 66px;
    min-height: 0;
    width: auto;
    border-radius: 20px;
    padding: 7px;
    display: block;
    background: #f9fbffde;
    backdrop-filter: blur(28px);
    box-shadow: 0 4px 30px #51668921;
    border-color: #fff;
  }
  .brand {
    display: none;
  }
  nav.tabs {
    display: flex;
    flex-direction: row;
    gap: 0;
    overflow: auto;
    height: 100%;
    scrollbar-width: none;
  }
  nav.tabs button {
    flex: 1;
    min-width: 62px;
    flex-direction: column;
    gap: 3px;
    padding: 5px 6px;
    font-size: 8px;
    min-height: 0;
    border-radius: 13px;
  }
  nav.tabs button > span:not(.nav-count) {
    display: block;
    white-space: nowrap;
    font-size: 8px;
  }
  nav.tabs button .icon {
    width: 18px;
    height: 18px;
  }
  .main-content {
    padding: 0;
  }
  .topbar {
    height: 61px;
    margin-bottom: 23px;
  }
  .topbar-right {
    gap: 12px;
  }
  .topbar-date {
    font-size: 9px;
  }
  .breadcrumb {
    font-size: 10px;
    gap: 7px;
  }
  .avatar-small {
    display: none;
  }
  .sync-status {
    font-size: 9px;
  }
  .page-header {
    align-items: flex-start;
    margin-bottom: 22px;
  }
  .page-header h1 {
    font-size: 26px;
  }
  .eyebrow {
    font-size: 8px;
    letter-spacing: 1.5px;
  }
  .subline {
    font-size: 11px;
  }
  .header-actions {
    flex-wrap: wrap;
    justify-content: flex-end;
    max-width: 145px;
  }
  .header-actions .btn {
    font-size: 10px;
    min-height: 34px;
    padding: 8px 10px;
    border-radius: 10px;
  }
  .header-actions .btn .icon {
    width: 13px;
    height: 13px;
  }
  .header-actions .btn-ghost {
    order: 2;
  }
  .stats {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 12px;
    margin-bottom: 17px;
  }
  .stat {
    padding: 15px 16px;
    border-radius: 18px;
  }
  .stat .val {
    font-size: 25px;
    margin: 9px 0 7px;
  }
  .stat .lbl {
    font-size: 10px;
  }
  .stat-note {
    font-size: 8px;
  }
  .stat-icon {
    width: 25px;
    height: 25px;
  }
  .stat-icon .icon {
    width: 14px;
    height: 14px;
  }
  .dashboard-grid {
    grid-template-columns: 1fr;
    gap: 17px;
    margin-bottom: 17px;
  }
  .panel {
    padding: 19px;
    border-radius: 18px;
  }
  .overview-chart .chart-plot svg {
    height: 175px;
  }
  .attention-panel {
    padding-bottom: 17px;
  }
  .attention-row {
    padding: 12px 0;
  }
  .attention-row strong {
    font-size: 12px;
  }
  .attention-row small {
    font-size: 9px;
  }
  .attention-foot {
    font-size: 9px;
  }
  .attention-icon {
    height: 37px;
    width: 37px;
  }
  .home-list {
    grid-template-columns: 1fr;
  }
  .inventory-toolbar {
    gap: 10px;
  }
  .inventory-count {
    font-size: 9px;
  }
  .prod-group-name {
    font-size: 12px;
  }
  .form-grid {
    gap: 13px;
  }
  .field input,
  .field select,
  .pb-size-row input {
    font-size: 16px;
  }
  .restock-heading {
    display: none;
  }
  .restock-row {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    background: #eaf0f54d;
    padding: 10px;
    border-radius: 12px;
  }
  .restock-row select {
    grid-column: 1/-1;
  }
  .restock-row .remove-restock-row {
    justify-self: end;
  }
  .type-toggle {
    flex-wrap: wrap;
  }
  .type-toggle label {
    min-width: 85px;
    font-size: 10px;
  }
  #mode-toggle {
    max-width: none !important;
  }
  .panel-title-action {
    align-items: flex-start;
    gap: 10px;
  }
  .panel-title-action .btn {
    font-size: 10px;
    padding: 7px 10px;
  }
  .workspace-tabs {
    gap: 2px;
    padding: 4px;
    margin-bottom: 16px;
  }
  .workspace-tabs button {
    font-size: 11px;
    padding: 8px 11px;
  }
  .table-scroll {
    margin-left: -5px;
    margin-right: -5px;
    max-width: calc(100% + 10px);
  }
  td {
    padding: 12px 9px;
  }
  .stock-size-list {
    min-width: 300px;
  }
  .stock-size-item {
    grid-template-columns: minmax(115px, 1fr) 58px auto auto;
    gap: 5px;
  }
  .month-row {
    grid-template-columns: 70px 1fr 85px;
    gap: 9px;
  }
  .month-label {
    font-size: 10px;
  }
  .month-profit {
    font-size: 12px;
  }
  .month-sub {
    font-size: 8px;
  }
  .insights-grid {
    grid-template-columns: 1fr;
  }
  .sell-grid {
    grid-template-columns: 1fr;
  }
  .sell-form .field input,
  .sell-picker select {
    font-size: 16px;
  }
  .sell-card .checkline {
    font-size: 11px;
  }
  .modal-overlay {
    padding: 15px;
  }
  .modal-box {
    padding: 22px;
    max-height: 87dvh;
  }
  .modal-box .field input,
  .modal-box .field select {
    font-size: 16px;
  }
  .variant-row.shipping-row {
    grid-template-columns: minmax(0, 1fr) 84px;
    gap: 12px;
    padding: 16px 2px;
  }
  .shipping-row .variant-info {
    grid-column: 1 / -1;
  }
  .shipping-row .attach-size-select,
  .shipping-row .attach-qty {
    font-size: 16px;
  }
  .toast {
    bottom: 89px;
  }
  footer {
    font-size: 7px;
    gap: 8px;
  }
  .data-tools summary {
    font-size: 9px;
  }
}
@media (max-width: 380px) {
  .wrap {
    padding-left: 12px;
    padding-right: 12px;
  }
  .stat {
    padding: 13px;
  }
  .stat .val {
    font-size: 22px;
  }
  .topbar-date {
    display: none;
  }
  .page-header h1 {
    font-size: 23px;
  }
  .header-actions {
    max-width: 125px;
  }
  .panel {
    padding: 16px;
  }
  .inventory-toolbar {
    flex-wrap: wrap;
  }
  .inventory-count {
    width: 100%;
  }
  .form-grid {
    gap: 9px;
  }
  .type-toggle label {
    padding: 7px 5px;
  }
  .modal-box {
    padding: 18px;
  }
}
@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    animation: none !important;
    transition: none !important;
    scroll-behavior: auto !important;
  }
}
@supports not (
  (backdrop-filter: blur(1px)) or (-webkit-backdrop-filter: blur(1px))
) {
  .glass,
  .clay,
  .panel,
  .sidebar {
    background: #f8faff;
  }
  .stat.profit {
    background: #7a8bd4;
  }
  .modal-box {
    background: #fff;
  }
}
.transaction-filters {
  display: flex;
  gap: 10px;
  margin: 17px 0 12px;
  align-items: center;
  flex-wrap: wrap;
}
.transaction-filters .search-field {
  flex: 1;
  min-width: 180px;
}
.transaction-filters input[type="month"] {
  min-width: 155px;
}
.transaction-filters select {
  min-width: 130px;
}
.inventory-notices {
  margin-top: 15px;
  font-size: 11px;
  color: var(--ink-soft);
}
.inventory-notices summary {
  cursor: pointer;
  margin-bottom: 10px;
}
@media (max-width: 760px) {
  .transaction-filters .search-field {
    flex-basis: 100%;
  }
  .transaction-filters > .field {
    flex: 1;
  }
  .transaction-filters input[type="month"] {
    min-width: 0;
  }
  .transaction-filters select {
    min-width: 0;
  }
  .transaction-filters .btn {
    flex: 0 0 auto;
  }
}
nav.tabs button::after {
  content: none;
}
.stat .lbl {
  font-size: 12px;
}
.stat-note {
  font-size: 10px;
}
.attention-row strong {
  font-size: 12px;
}
.attention-row small,
.attention-row b small {
  font-size: 10px;
}
.attention-foot {
  font-size: 10px;
}
.chart-months,
.chart-scale,
.chart-legend,
.period-label {
  font-size: 10px;
}
.chart-data {
  font-size: 11px;
}
.inventory-count {
  font-size: 11px;
}
.prod-group-name {
  font-size: 13px;
}
.prod-group-color,
.prod-group-total {
  font-size: 11px;
}
.variant-info {
  font-size: 12px;
}
.hint {
  font-size: 12px;
}
.field label {
  font-size: 12px;
}
th {
  font-size: 11px;
}
td {
  font-size: 12px;
}
.filter-tabs button {
  font-size: 11px;
}
.topbar-right {
  font-size: 11px;
}
.breadcrumb {
  font-size: 12px;
}
.sale-total {
  font-size: 11px;
}
.insight-label {
  color: #7a8cae;
  font-size: 11px !important;
  letter-spacing: 0.3px;
}
@media (max-width: 760px) {
  .stat .lbl {
    font-size: 11px;
  }
  .stat-note {
    font-size: 9px;
  }
  .chart-months,
  .chart-scale,
  .chart-legend,
  .period-label {
    font-size: 9px;
  }
  .topbar-right,
  .breadcrumb {
    font-size: 10px;
  }
  .attention-row small {
    font-size: 10px;
  }
  .chart-data {
    font-size: 10px;
  }
}
.installment-stats {
  grid-template-columns: repeat(3, minmax(0, 1fr));
}
@media (max-width: 550px) {
  .installment-stats {
    grid-template-columns: 1fr 1fr;
  }
  .installment-stats > .stat:first-child {
    grid-column: 1/-1;
  }
}

/* Customer pre-orders */
.preorder-stats { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.preorder-intro summary, .preorder-card summary { cursor: pointer; padding: 12px 0; font-weight: 600; }
.preorder-intro form, .preorder-card form { padding: 8px 0; }
.preorder-filters { display: flex; align-items: end; gap: 12px; flex-wrap: wrap; }
.preorder-filters .field:first-child { flex: 1; min-width: 180px; }
.preorder-list { display: grid; gap: 16px; }
.preorder-card { border: 1px solid var(--border, #dce2ef); border-radius: 18px; padding: 20px; background: #ffffff80; min-width: 0; overflow-wrap: anywhere; }
.preorder-card[hidden], .preorder-list [hidden], #preorder-empty[hidden] { display: none !important; }
.preorder-late { border-color: #c79770; }
.preorder-heading { display: flex; justify-content: space-between; gap: 12px; align-items: start; }
.preorder-heading h3 { margin: 4px 0; }
.preorder-heading p { margin: 6px 0; }
.tag.preorder { background: #eeebfa; color: #675b9d; white-space: nowrap; }
.preorder-totals { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 12px; margin: 18px 0; }
.preorder-totals span { font-size: 12px; color: var(--muted, #667085); }
.preorder-totals strong { display: block; color: var(--navy); font-size: 18px; margin-top: 4px; }
.preorder-actions, .preorder-inline { display: flex; gap: 10px; flex-wrap: wrap; align-items: end; margin: 12px 0; }
.preorder-inline .field { flex: 1; max-width: 280px; }
.preorder-cost-check { display: flex; align-items: start; gap: 10px; margin-top: 14px; }
.preorder-cost-check input { width: 18px; height: 18px; flex: 0 0 auto; }
.preorder-note { white-space: pre-wrap; }
.preorder-history { list-style: none; margin: 0; padding: 0; }
.preorder-history li { display: flex; justify-content: space-between; gap: 12px; padding: 8px 0; border-bottom: 1px solid #e0e5ef; }
@media (max-width: 600px) {
  .preorder-stats { grid-template-columns: 1fr; }
  .preorder-heading { flex-direction: column; }
  .preorder-card { padding: 14px; }
  .preorder-totals { gap: 8px; }
  .preorder-totals strong { font-size: 15px; }
  .preorder-filters { align-items: stretch; }
  .preorder-filters .field { width: 100%; }
  .preorder-history li { flex-wrap: wrap; }
}

.task-filters { display: flex; align-items: end; flex-wrap: wrap; gap: 12px; margin: 16px 0; }
.task-filters .field { flex: 1; min-width: 150px; }
.tasks-stats { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.task-list { display: grid; gap: 12px; }
.task-card { display: flex; align-items: center; justify-content: space-between; gap: 16px; padding: 16px; border: 1px solid #dde3ef; border-radius: 16px; overflow-wrap: anywhere; }
.task-card > div { min-width: 0; }
.task-card > button { flex-shrink: 0; }
.task-card h3 { margin: 8px 0; }
.task-card p { margin: 4px 0; }
.task-card[hidden], #task-empty[hidden] { display: none; }
.pending-receive-field { width: 110px; flex: 0 0 110px; }
.pending-receive-field label { font-size: 11px; }
.range-stats { margin-top: 16px; grid-template-columns: repeat(2, minmax(0, 1fr)); }
@media (max-width: 600px) {
  .task-card { align-items: start; flex-direction: column; }
  .tasks-stats, .range-stats { grid-template-columns: 1fr; }
  .task-filters .field { width: 100%; }
  #workspace-pending .variant-row { flex-wrap: wrap; }
  .pending-receive-field { flex: 1 1 100px; }
}
@media (max-width: 600px) {
  #workspace-pending .variant-row {
    display: grid;
    grid-template-columns: 20px 36px minmax(0, 1fr);
    gap: 12px;
    align-items: start !important;
  }
  #workspace-pending .pending-select { grid-column: 1; grid-row: 1; }
  #workspace-pending .thumb { grid-column: 2; grid-row: 1; }
  #workspace-pending .variant-info { grid-column: 3; grid-row: 1; min-width: 0; width: auto; }
  #workspace-pending .pending-receive-field { grid-column: 2 / -1; grid-row: 2; width: auto; }
  #workspace-pending [data-cancel-pending] { grid-column: 3; grid-row: 3; justify-self: end; }
}

.stock-filters { display: flex; align-items: end; gap: 10px; flex-wrap: wrap; margin: 12px 0 20px; }
.stock-filters .field { flex: 1 1 130px; }
#stock-visible-totals { flex-basis: 100%; margin: 0; }
.stock-size-item[hidden] { display: none !important; }
#stocktake-form { margin: 20px 0 32px; }
#workspace-count td { overflow-wrap: anywhere; }
@media (max-width: 600px) {
  .stock-filters .field { min-width: 130px; }
  .workspace-tabs { overflow-x: auto; justify-content: start; }
  .workspace-tabs > button { flex-shrink: 0; }
}
@media (max-width: 600px) {
  #stocktake-form .form-grid { grid-template-columns: minmax(0, 1fr); }
  #stocktake-form .field { min-width: 0; }
}

.restock-choice { min-width: 0; }
.restock-choice select { width: 100%; }
.restock-new-fields, .restock-tools { grid-column: 1 / -1; display: flex; gap: 10px; flex-wrap: wrap; align-items: center; }
.restock-new-fields > input, .restock-new-fields > select { flex: 1 1 130px; min-width: 0; }
.restock-new-fields > .hint { flex-basis: 100%; }
.restock-new-fields[hidden], .restock-choice [hidden] { display: none !important; }
.pending-product-choice { display: flex; gap: 10px; flex-wrap: wrap; margin-bottom: 10px; align-items: center; }
.pending-product-choice select { flex: 1 1 180px; min-width: 0; max-width: 100%; }
@media (max-width: 600px) {
  .restock-choice { grid-column: 1 / -1; }
  .pending-product-choice { flex-direction: column; align-items: stretch; }
  .pending-product-choice select { flex-basis: auto; width: 100%; }
}

/* Product-linked advertising workspace */
.ad-form-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); margin: 16px 0; }
.ad-wide { grid-column: 1 / -1; }
.ad-form-grid input, .ad-form-grid select, .ad-form-grid textarea { width: 100%; min-width: 0; }
.ad-list { display: grid; gap: 20px; }
.ad-card { padding: 22px; border: 1px solid var(--line, #e0e5f3); border-radius: 20px; min-width: 0; background: rgba(255,255,255,.45); }
.ad-card[hidden] { display: none; }
.ad-card-header { display: flex; flex-wrap: wrap; align-items: flex-start; justify-content: space-between; gap: 12px; }
.ad-card-header h3 { margin: 10px 0 6px; overflow-wrap: anywhere; }
.ad-card-header p { margin: 6px 0; }
.ad-card-actions { display: flex; flex-wrap: wrap; gap: 8px; }
.ad-card-actions a { text-decoration: none; }
.ad-metrics { display: grid; grid-template-columns: repeat(5, minmax(0, 1fr)); gap: 12px; margin: 20px 0; }
.ad-metrics > div { padding: 12px; border-radius: 12px; background: #f0f3fb; min-width: 0; }
.ad-metrics dt { color: var(--ink-soft); font-size: 12px; }
.ad-metrics dd { font-size: 17px; font-weight: 700; margin: 7px 0 0; overflow-wrap: anywhere; }
.ad-reserve { padding: 18px; background: #e9f2ed; border-radius: 14px; margin: 16px 0; }
.ad-reserve strong { color: #316d54; font-size: 17px; }
.ad-reserve p { margin: 8px 0 0; }
.ad-warning { background: #fff1df; color: #865110; border-radius: 10px; padding: 12px; }
.ad-card details { padding: 14px 0; border-top: 1px solid #e1e7f1; }
.ad-card summary, #ad-create summary { cursor: pointer; font-weight: 700; }
.ad-ledger { padding: 0; list-style: none; margin: 14px 0 0; }
.ad-ledger li { display: flex; justify-content: space-between; align-items: center; gap: 12px; padding: 12px 0; border-bottom: 1px solid #e1e7f1; }
.ad-ledger li > span { min-width: 0; overflow-wrap: anywhere; }
.ad-ledger small { display: block; color: var(--ink-soft); }
.ad-ledger button { flex-shrink: 0; }
.ad-link-form { display: grid; gap: 12px; }
.ad-edit-form { margin-bottom: 16px; }
.ad-table-scroll { overflow-x: auto; max-width: 100%; margin-top: 12px; }
.ad-table-scroll table { min-width: 620px; }
.ad-note { white-space: pre-wrap; overflow-wrap: anywhere; }
.product-ad-detail { border-top: 1px solid #e1e7f1; padding-top: 12px; margin-top: 18px; }
@media (max-width: 1100px) { .ad-metrics { grid-template-columns: repeat(3, minmax(0,1fr)); } }
@media (max-width: 600px) {
  .ad-form-grid { grid-template-columns: minmax(0,1fr); }
  .ad-card { padding: 14px; }
  .ad-metrics { grid-template-columns: repeat(2,minmax(0,1fr)); gap: 8px; }
  .ad-metrics dd { font-size: 15px; }
  .ad-ledger li { flex-direction: column; align-items: stretch; }
  .ad-card-actions { width: 100%; }
  .ad-summary .stat-value { overflow-wrap: anywhere; }
}
.stock-ad-actions { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 8px; }

/* Theme preference is applied in the head, before the first paint. */
html { background: var(--bg); }
.theme-toggle {
  display: inline-flex; align-items: center; justify-content: center; gap: 7px;
  min-width: 42px; min-height: 42px; padding: 7px 10px; border-radius: 11px;
  border: 1px solid var(--line); background: var(--surface); color: var(--navy);
  font-size: 11px; white-space: nowrap; flex-shrink: 0;
}
.theme-toggle:hover { border-color: var(--navy-3); }
.theme-toggle .icon { width: 17px; height: 17px; }
.theme-sun, [data-theme="light"] .theme-moon { display: none; }
[data-theme="light"] .theme-sun { display: block; }
@media (max-width: 760px) {
  .theme-toggle-label { display: none; }
  .topbar-right { gap: 8px; }
}
:root[data-theme="dark"] {
  color-scheme: dark;
  --bg: #12171f;
  --surface: #1b222d;
  --surface-in: #171e28;
  --navy: #d5dce8;
  --navy-2: #aab8ee;
  --navy-3: #9cace5;
  --ink: #c9d1df;
  --ink-soft: #a2afc2;
  --ink-faint: #94a2b6;
  --green: #81bda8;
  --green-bg: #203930;
  --rust: #d4b587;
  --rust-bg: #383126;
  --red: #df97a4;
  --red-bg: #3b2931;
  --sh-d: #00000028;
  --sh-l: #ffffff03;
  --sh-d-navy: #00000028;
  --sh-l-navy: #ffffff05;
  --line: #354151;
  --border: #354151;
  --muted: #a2afc2;
  --glass-shadow: 0 6px 20px #00000014;
}
[data-theme="dark"] body { background: var(--bg); }
[data-theme="dark"] body::before { background: none; }
[data-theme="dark"] :is(.glass, .clay, .panel, .clay-in, .sidebar, .modal-box, .sell-card, .insight-card, .preorder-card, .ad-card, .task-card, .ai-result, .prod-group, .footer-actions) {
  background: var(--surface); border-color: var(--line); box-shadow: var(--glass-shadow);
}
[data-theme="dark"] .modal-overlay { background: #05080dcc; }
[data-theme="dark"] .modal-box { background: #202936; }
[data-theme="dark"] :is(.product-block, .pending-row, .restock-row, .workspace-tabs, .type-toggle, .detail-stat, .ad-metrics > div, .thumb, .attention-icon, .radar-orb, .avatar, .bar-wrap, .loading-track, .stat-icon, .nav-count) {
  background: var(--surface-in); border-color: var(--line); box-shadow: none;
}
[data-theme="dark"] :is(.tabs button, .workspace-tabs button, .filter-tabs button) { color: var(--ink-soft); }
[data-theme="dark"] :is(.tabs button:hover, .workspace-tabs button:hover, .footer-actions button:hover, tbody tr:hover) { background: #252f3e; color: var(--ink); }
[data-theme="dark"] :is(.tabs button.active, .workspace-tabs button.active, .filter-tabs button.active, .type-toggle label:has(input:checked)) {
  background: #303c55; border-color: #4c5d7c; color: #c3cef3; box-shadow: none;
}
[data-theme="dark"] :is(.btn-primary, .btn-gold, .brand-mark) {
  background: #52659b; border-color: #778bc1; color: #f0f2f7; box-shadow: none;
}
[data-theme="dark"] :is(.btn-primary:hover, .btn-gold:hover) { background: #6073ab; }
[data-theme="dark"] :is(.btn-ghost, .variant-row .btn-ghost, .alert-chip) {
  background: #26303e; border-color: #3f4c60; color: #bbc7df; box-shadow: none;
}
[data-theme="dark"] .btn-ghost:hover { background: #323f52; color: #dae2ef; }
[data-theme="dark"] :is(.btn-danger, .tag.expense, .tag.used, .overdue-row td) { background: var(--red-bg); color: var(--red); border-color: #64434d; }
[data-theme="dark"] .btn-danger:hover { background: #50333e; }
[data-theme="dark"] :is(.tag.income, .tag.new, .ad-reserve, .income-stat .stat-icon) { background: var(--green-bg); color: var(--green); }
[data-theme="dark"] :is(.tag.installment, .variant-row.low .variant-qty, .ad-warning, .attention-icon.amber, .expense-stat .stat-icon) { background: var(--rust-bg); color: var(--rust); }
[data-theme="dark"] :is(.tag.preorder, .attention-icon.violet) { background: #322d46; color: #bdaddd; }
[data-theme="dark"] .tag.soldout { background: #2e3744; color: #b8c2d3; }
[data-theme="dark"] .ad-reserve strong { color: #a1d0bb; }
[data-theme="dark"] .stat.profit { background: #293852; border-color: #425779; box-shadow: none; }
[data-theme="dark"] .stat.profit::after { display: none; }
[data-theme="dark"] :is(.stat .val, .detail-stat .val, .empty .big, .sell-price, .sale-total-value) { color: var(--navy); }
[data-theme="dark"] :is(.stat .lbl, .field label, .stat-note, .breadcrumb, .breadcrumb strong, .breadcrumb span, .workspace-label, .workspace-note strong, .workspace-note p, .eyebrow, .chart-legend, .period-label, .chart-scale, .chart-months, .attention-row small, .attention-foot, .inventory-count, .checkline, .prod-group-color, .prod-group-total, .empty, .sell-stock, .sell-cost-note, .month-label, .month-sub, .detail-stat .lbl, .insight-card p, .insight-card li, .footer-actions button, footer, .data-tools summary, .variant-row.out) {
  color: var(--ink-soft);
}
[data-theme="dark"] :is(.text-button, .brand-dot, .heading-dot, .avatar, .stat-icon, .thumb-ph, .radar-orb, .attention-row > .icon) { color: var(--navy-3); }
[data-theme="dark"] :is(.ad-card details, .ad-ledger li, .product-ad-detail, .task-card) { border-color: var(--line); }
[data-theme="dark"] .pos { color: var(--green); }
[data-theme="dark"] input:not([type="checkbox"]):not([type="radio"]),
[data-theme="dark"] select,
[data-theme="dark"] textarea {
  background: #151c26; color: var(--ink); border: 1px solid #405066; box-shadow: none;
}
[data-theme="dark"] :is(input, textarea)::placeholder { color: #92a0b5; opacity: 1; }
[data-theme="dark"] :is(input, select, textarea):hover { border-color: #61718b; }
[data-theme="dark"] :is(input, select, textarea):focus-visible { outline-color: #a2b3ea; }
[data-theme="dark"] :is(input[type="checkbox"], input[type="radio"]) { accent-color: #91a4df; }
[data-theme="dark"] input::file-selector-button { background: #303d54; color: #c4cfee; }
[data-theme="dark"] select option { background: #1b222d; color: var(--ink); }
[data-theme="dark"] th { background: #161d27; color: #abb8cc; }
[data-theme="dark"] .alert-banner { background: var(--rust-bg); border-color: #5a4b35; }
[data-theme="dark"] .alert-banner[style] { background: #253249 !important; border-color: #425779; }
[data-theme="dark"] .alert-title { color: var(--rust); }
[data-theme="dark"] .attention-row:hover,
[data-theme="dark"] .empty::before { background: #263141; border-color: var(--line); box-shadow: none; }
[data-theme="dark"] .toast { background: #2b394d; color: #dce4f0; border-color: #52647e; }
[data-theme="dark"] .skip-link { background: #303c55; color: #dce4f0; }
[data-theme="dark"] ::selection { background: #43577d; color: #edf1fa; }
[data-theme="dark"] { scrollbar-color: #4c5a70 #171e28; }
.ad-product-picker { min-width: 0; margin: 0; padding: 14px; border: 1px solid var(--line); border-radius: 12px; }
.ad-product-picker legend { color: var(--ink-soft); font-size: 12px; padding: 0 6px; }
.ad-product-picker .hint { margin: 10px 0 0; }
.ad-product-options { display: grid; grid-template-columns: repeat(auto-fit,minmax(min(180px,100%),1fr)); gap: 10px; max-height: 220px; overflow: auto; }
.ad-product-options label { display: flex; align-items: center; gap: 10px; padding: 8px; cursor: pointer; min-width: 0; }
.ad-product-options input[type="checkbox"] { width: 18px; height: 18px; flex-shrink: 0; }
.ad-product-options label:has(input:disabled) { opacity: .5; }
.ad-product-options span { overflow-wrap: anywhere; }
.ad-card-actions button { white-space: normal; overflow-wrap: anywhere; }
.measurement-fields { display: flex; flex: 1 0 100%; grid-column: 1 / -1; gap: 10px; min-width: 0; }
.measurement-fields label { flex: 1 1 0; min-width: 0; display: flex; flex-direction: column; gap: 6px; color: var(--ink-soft); font-size: 11px; }
.measurement-fields input { width: 100%; min-width: 0; }
.measurement-note { display: block; margin-top: 4px; color: var(--ink-soft); }
.measurement-fields input { flex: 0 1 auto; }
.pb-size-row > .measurement-fields { order: 2; }
.size-measurements { display: flex; flex-wrap: wrap; gap: 4px 8px; margin-top: 6px; font-size: 12px; line-height: 1.5; }
.size-measurements > span { display: inline-block; padding: 3px 7px; border: 1px solid var(--line); border-radius: 6px; color: var(--ink); }
.shipment-selection-tools { display: flex; align-items: center; justify-content: space-between; flex-wrap: wrap; gap: 12px; margin: 16px 0; }
.shipment-selection-tools label { display: flex; align-items: center; gap: 8px; }
.shipment-pending-row { display: grid; grid-template-columns: minmax(0,1fr) 120px; align-items: center; gap: 16px; padding: 16px 0; border-bottom: 1px solid var(--line); }
.shipment-pending-row[hidden] { display: none; }
.shipment-item-label { display: flex; align-items: flex-start; gap: 12px; min-width: 0; cursor: pointer; }
.shipment-item-label > span { min-width: 0; overflow-wrap: anywhere; }
.shipment-item-label small { display: block; margin: 6px 0; color: var(--ink-soft); }
.shipment-history-card { border: 1px solid var(--line); border-radius: 12px; padding: 16px; margin-top: 16px; overflow-wrap: anywhere; }
.shipment-history-card ul { padding-left: 20px; }
.shipment-history-card li { margin: 8px 0; }
.shipment-pending-row .field input { max-width: 100%; min-width: 0; }
.shipment-pending-row .field button { white-space: normal; margin-top: 8px; }
#shipment-form .form-grid { margin: 20px 0; }
#shipment-form .form-grid input, #shipment-form textarea { width: 100%; min-width: 0; }
.ad-daily-section { margin-top: 24px; }
@media (max-width: 600px) {
  .shipment-pending-row { grid-template-columns: minmax(0,1fr); gap: 8px; }
  .shipment-pending-row .field { max-width: 150px; margin-left: 25px; }
  .shipment-history-card .section-heading, .ad-daily-section .section-heading { flex-wrap: wrap; gap: 8px; }
}
