:root {
  --ink: #172420;
  --ink-soft: #596761;
  --ink-faint: #87928d;
  --paper: #f5f3ec;
  --surface: #fffdf8;
  --surface-muted: #f0eee7;
  --line: #e2dfd5;
  --line-strong: #d4d0c4;
  --forest: #133a33;
  --forest-2: #1c4a42;
  --mint: #dff2e9;
  --mint-strong: #b8e1d1;
  --orange: #df6b42;
  --orange-soft: #f9e5dc;
  --gold: #f2c66d;
  --red: #bd493e;
  --red-soft: #f7e5e1;
  --blue: #4f7fa8;
  --shadow: 0 12px 35px rgba(28, 43, 37, 0.06);
  --radius-lg: 20px;
  --radius-md: 14px;
  --radius-sm: 10px;
  --sidebar-width: 236px;
  --display-font: "Iowan Old Style", "Palatino Linotype", Palatino, Georgia, "Noto Serif SC",
    serif;
  --body-font: "Avenir Next", "PingFang SC", "Microsoft YaHei", "Noto Sans SC", sans-serif;
}

* {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
}

body {
  margin: 0;
  min-width: 320px;
  background:
    radial-gradient(circle at 88% 2%, rgba(242, 198, 109, 0.15), transparent 24rem),
    var(--paper);
  color: var(--ink);
  font-family: var(--body-font);
  font-size: 14px;
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
}

button,
input,
select {
  font: inherit;
}

button,
select {
  cursor: pointer;
}

button {
  color: inherit;
}

a {
  color: inherit;
}

svg {
  display: block;
}

::selection {
  background: var(--mint-strong);
}

:focus-visible {
  outline: 3px solid rgba(223, 107, 66, 0.35);
  outline-offset: 2px;
}

.app-shell {
  min-height: 100vh;
}

.sidebar {
  position: fixed;
  inset: 0 auto 0 0;
  z-index: 20;
  display: flex;
  width: var(--sidebar-width);
  flex-direction: column;
  padding: 28px 18px 22px;
  overflow-y: auto;
  background:
    radial-gradient(circle at 25% 0, rgba(255, 255, 255, 0.08), transparent 15rem),
    var(--forest);
  color: #f8f5eb;
}

.brand {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 0 8px;
  text-decoration: none;
}

.brand-mark {
  display: grid;
  width: 43px;
  height: 43px;
  flex: 0 0 43px;
  place-items: center;
  border: 1px solid rgba(255, 255, 255, 0.16);
  border-radius: 13px;
  background: rgba(255, 255, 255, 0.08);
}

.brand-mark svg {
  width: 30px;
  fill: none;
  stroke: var(--gold);
  stroke-linecap: round;
  stroke-linejoin: round;
  stroke-width: 2.4;
}

.brand strong {
  display: block;
  font-family: var(--display-font);
  font-size: 23px;
  font-weight: 600;
  letter-spacing: 0.12em;
  line-height: 1.15;
}

.brand small {
  display: block;
  margin-top: 2px;
  color: rgba(248, 245, 235, 0.55);
  font-size: 10px;
  letter-spacing: 0.12em;
}

.main-nav {
  display: grid;
  gap: 5px;
  margin-top: 42px;
}

.nav-item {
  position: relative;
  display: flex;
  width: 100%;
  align-items: center;
  gap: 12px;
  padding: 11px 13px;
  border: 0;
  border-radius: 11px;
  background: transparent;
  color: rgba(248, 245, 235, 0.67);
  text-align: left;
  transition:
    background 160ms ease,
    color 160ms ease,
    transform 160ms ease;
}

.nav-item:hover {
  background: rgba(255, 255, 255, 0.06);
  color: #fffdf7;
}

.nav-item.is-active {
  background: rgba(242, 198, 109, 0.14);
  color: #fff8e9;
}

.nav-item.is-active::before {
  position: absolute;
  left: 0;
  width: 3px;
  height: 24px;
  border-radius: 0 4px 4px 0;
  background: var(--gold);
  content: "";
}

.nav-item svg {
  width: 18px;
  height: 18px;
  fill: none;
  stroke: currentColor;
  stroke-linecap: round;
  stroke-linejoin: round;
  stroke-width: 1.7;
}

.nav-item svg path:first-child:not(:last-child) {
  fill: none;
}

.nav-item span {
  font-size: 13px;
  font-weight: 600;
  letter-spacing: 0.02em;
}

.sidebar-note {
  margin-top: auto;
  padding: 15px;
  border: 1px solid rgba(255, 255, 255, 0.09);
  border-radius: 14px;
  background: rgba(255, 255, 255, 0.035);
}

.note-pill {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  color: var(--gold);
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 0.1em;
}

.note-pill::before {
  width: 5px;
  height: 5px;
  border-radius: 50%;
  background: currentColor;
  content: "";
}

.sidebar-note p {
  margin: 8px 0 0;
  color: rgba(248, 245, 235, 0.5);
  font-size: 11px;
  line-height: 1.65;
}

.user-session {
  display: flex;
  align-items: center;
  gap: 9px;
  margin-top: 10px;
  padding: 10px;
  border: 1px solid rgba(255, 255, 255, 0.09);
  border-radius: 12px;
  background: rgba(255, 255, 255, 0.04);
}

.user-avatar {
  display: grid;
  width: 30px;
  height: 30px;
  flex: 0 0 30px;
  place-items: center;
  border-radius: 9px;
  background: var(--gold);
  color: var(--forest);
  font-family: var(--display-font);
  font-size: 13px;
  font-weight: 700;
}

.user-session-copy {
  min-width: 0;
  flex: 1;
}

.user-session-copy strong,
.user-session-copy small {
  display: block;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.user-session-copy strong {
  color: #fffdf7;
  font-size: 10px;
}

.user-session-copy small {
  color: rgba(255, 253, 247, 0.45);
  font-size: 8px;
}

.user-logout {
  padding: 2px 0;
  border: 0;
  background: transparent;
  color: rgba(255, 253, 247, 0.55);
  font-size: 9px;
  text-decoration: underline;
  text-underline-offset: 2px;
}

.user-session .user-logout + .user-logout {
  margin-left: -4px;
}

.auth-gate {
  position: fixed;
  inset: 0;
  z-index: 90;
  display: grid;
  place-items: center;
  padding: 24px;
  background:
    radial-gradient(circle at 18% 12%, rgba(242, 198, 109, 0.16), transparent 22rem),
    radial-gradient(circle at 82% 82%, rgba(90, 160, 131, 0.17), transparent 24rem),
    #102c27;
}

.auth-card {
  width: min(430px, 100%);
  padding: 28px;
  border: 1px solid rgba(255, 255, 255, 0.09);
  border-radius: 22px;
  background: var(--surface);
  box-shadow: 0 35px 100px rgba(3, 16, 13, 0.42);
}

.auth-brand {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-bottom: 25px;
}

.auth-brand .brand-mark {
  border-color: var(--line);
  background: var(--forest);
}

.auth-brand strong {
  display: block;
  font-family: var(--display-font);
  font-size: 23px;
  letter-spacing: 0.1em;
  line-height: 1.1;
}

.auth-brand small {
  display: block;
  margin-top: 2px;
  color: var(--ink-faint);
  font-size: 9px;
  letter-spacing: 0.1em;
}

.auth-panel-heading {
  margin-bottom: 19px;
}

.auth-panel-heading h1 {
  margin: 5px 0 5px;
  font-family: var(--display-font);
  font-size: 29px;
  font-weight: 600;
  letter-spacing: -0.03em;
}

.auth-panel-heading p {
  margin: 0;
  color: var(--ink-soft);
  font-size: 11px;
  line-height: 1.7;
}

.auth-form {
  display: grid;
  gap: 11px;
}

.auth-form .field {
  margin-bottom: 0;
}

.auth-submit {
  min-height: 42px;
  margin-top: 4px;
}

.auth-error {
  padding: 9px 11px;
  border: 1px solid #e7c5bf;
  border-radius: 9px;
  background: var(--red-soft);
  color: var(--red);
  font-size: 10px;
}

.auth-security-note {
  margin: 18px 0 0;
  padding-top: 14px;
  border-top: 1px solid var(--line);
  color: var(--ink-faint);
  font-size: 8px;
  line-height: 1.7;
}

.auth-switch {
  width: 100%;
  margin-top: 3px;
  padding: 8px;
  border: 0;
  background: transparent;
  color: var(--ink-soft);
  font-size: 10px;
  text-decoration: underline;
  text-underline-offset: 3px;
}

.auth-entry-actions {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px;
  margin-top: 4px;
}

.auth-entry-actions .auth-switch {
  grid-column: 1 / -1;
}

.auth-entry-actions .button {
  min-height: 38px;
  padding-inline: 8px;
  font-size: 10px;
}

.auth-invite-note {
  padding: 10px 12px;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: var(--paper);
  color: var(--ink-soft);
  font-size: 10px;
  line-height: 1.65;
}

.verification-code-row {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 8px;
}

.verification-code-row .button {
  min-width: 92px;
  padding-inline: 10px;
  white-space: nowrap;
}

.invite-result {
  display: grid;
  gap: 12px;
}

.invite-link-row {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 8px;
}

.invite-link-row input {
  width: 100%;
  min-width: 0;
  padding: 10px 12px;
  border: 1px solid var(--line);
  border-radius: 9px;
  background: var(--paper);
  font-size: 10px;
}

body.auth-locked .app-shell {
  filter: blur(7px);
  pointer-events: none;
  user-select: none;
}

.main {
  min-height: 100vh;
  margin-left: var(--sidebar-width);
  padding: 0 34px 54px;
}

.topbar {
  position: sticky;
  top: 0;
  z-index: 15;
  display: flex;
  min-height: 96px;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
  padding: 17px 0;
  background: rgba(245, 243, 236, 0.88);
  backdrop-filter: blur(18px);
}

.page-heading h1 {
  margin: 3px 0 0;
  font-family: var(--display-font);
  font-size: 30px;
  font-weight: 600;
  letter-spacing: -0.02em;
  line-height: 1.2;
}

.eyebrow {
  margin: 0;
  color: var(--ink-faint);
  font-size: 9px;
  font-weight: 800;
  letter-spacing: 0.18em;
  line-height: 1.4;
}

.topbar-actions {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 9px;
}

.range-controls {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 5px;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: rgba(255, 253, 248, 0.8);
}

.range-controls select {
  min-width: 85px;
  padding: 7px 23px 7px 9px;
  border: 0;
  border-right: 1px solid var(--line);
  border-radius: 8px 0 0 8px;
  background-color: transparent;
  color: var(--ink);
  font-size: 12px;
  font-weight: 600;
}

.date-fields {
  display: flex;
  align-items: center;
  gap: 7px;
}

.date-fields input {
  width: 118px;
  padding: 5px 3px;
  border: 0;
  background: transparent;
  color: var(--ink-soft);
  font-size: 11px;
}

.date-fields span {
  color: var(--ink-faint);
  font-size: 10px;
}

.button {
  display: inline-flex;
  min-height: 38px;
  align-items: center;
  justify-content: center;
  gap: 7px;
  padding: 8px 14px;
  border: 1px solid transparent;
  border-radius: 10px;
  font-size: 12px;
  font-weight: 700;
  text-decoration: none;
  transition:
    transform 150ms ease,
    background 150ms ease,
    border-color 150ms ease,
    box-shadow 150ms ease;
}

.button:hover {
  transform: translateY(-1px);
}

.button:disabled {
  cursor: wait;
  opacity: 0.55;
  transform: none;
}

.button svg {
  width: 16px;
  height: 16px;
  fill: none;
  stroke: currentColor;
  stroke-linecap: round;
  stroke-linejoin: round;
  stroke-width: 1.9;
}

.button-primary {
  border-color: var(--forest);
  background: var(--forest);
  box-shadow: 0 8px 20px rgba(19, 58, 51, 0.16);
  color: #fffdf7;
}

.button-primary:hover {
  background: var(--forest-2);
}

.button-ghost {
  border-color: var(--line);
  background: rgba(255, 253, 248, 0.72);
  color: var(--ink-soft);
}

.button-ghost:hover {
  border-color: var(--line-strong);
  background: var(--surface);
  color: var(--ink);
}

.button-danger {
  border-color: var(--red-soft);
  background: var(--red-soft);
  color: var(--red);
}

.button-wide {
  width: 100%;
}

.text-button {
  padding: 0;
  border: 0;
  background: transparent;
  color: var(--forest);
  font-size: 11px;
  font-weight: 700;
  text-decoration: underline;
  text-underline-offset: 3px;
}

.mobile-range {
  display: none;
}

.view {
  display: none;
  padding-top: 14px;
  animation: view-in 260ms ease both;
}

.view.is-active {
  display: block;
}

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

.section-intro {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 24px;
  margin-bottom: 20px;
}

.section-intro h2 {
  margin: 5px 0 3px;
  font-family: var(--display-font);
  font-size: 24px;
  font-weight: 600;
  letter-spacing: -0.015em;
}

.section-intro p:not(.eyebrow) {
  max-width: 660px;
  margin: 0;
  color: var(--ink-soft);
  font-size: 12px;
}

.inline-actions {
  display: flex;
  gap: 8px;
}

.dashboard-intro {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 24px;
  margin: 6px 0 18px;
}

.dashboard-intro h2 {
  max-width: 710px;
  margin: 4px 0 5px;
  font-family: var(--display-font);
  font-size: clamp(25px, 2.8vw, 36px);
  font-weight: 500;
  letter-spacing: -0.035em;
  line-height: 1.22;
}

.dashboard-intro p {
  margin: 0;
  color: var(--ink-soft);
  font-size: 12px;
}

.period-stamp {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 8px 11px;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: rgba(255, 253, 248, 0.64);
  color: var(--ink-soft);
  font-size: 10px;
  white-space: nowrap;
}

.period-stamp::before {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: #4f9b77;
  box-shadow: 0 0 0 4px rgba(79, 155, 119, 0.12);
  content: "";
}

.insight-strip {
  display: flex;
  align-items: center;
  gap: 14px;
  margin-bottom: 17px;
  padding: 13px 16px;
  border: 1px solid #dcd9cd;
  border-radius: var(--radius-md);
  background:
    linear-gradient(90deg, rgba(223, 242, 233, 0.7), transparent 70%),
    var(--surface);
}

.insight-mark {
  display: grid;
  width: 32px;
  height: 32px;
  flex: 0 0 32px;
  place-items: center;
  border-radius: 50%;
  background: var(--forest);
  color: var(--gold);
  font-family: var(--display-font);
  font-size: 16px;
}

.insight-strip p {
  margin: 0;
  color: var(--ink-soft);
  font-size: 12px;
}

.insight-strip strong {
  color: var(--ink);
}

.kpi-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 12px;
  margin-bottom: 14px;
}

.kpi-card {
  position: relative;
  min-height: 135px;
  overflow: hidden;
  padding: 17px 17px 15px;
  border: 1px solid var(--line);
  border-radius: var(--radius-md);
  background: var(--surface);
  box-shadow: 0 5px 16px rgba(37, 45, 40, 0.025);
}

.kpi-card.is-dark {
  border-color: var(--forest);
  background: var(--forest);
  color: #fffdf7;
}

.kpi-card.is-dark::after {
  position: absolute;
  right: -35px;
  bottom: -50px;
  width: 140px;
  height: 140px;
  border: 1px solid rgba(255, 255, 255, 0.09);
  border-radius: 50%;
  content: "";
}

.kpi-label {
  display: flex;
  align-items: center;
  gap: 7px;
  color: var(--ink-faint);
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 0.07em;
}

.is-dark .kpi-label {
  color: rgba(255, 253, 247, 0.57);
}

.kpi-label-dot {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: var(--orange);
}

.kpi-value {
  margin-top: 12px;
  overflow: hidden;
  font-family: var(--display-font);
  font-size: clamp(23px, 2.4vw, 31px);
  font-variant-numeric: tabular-nums;
  font-weight: 600;
  letter-spacing: -0.035em;
  line-height: 1.1;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.kpi-value.is-negative {
  color: var(--red);
}

.is-dark .kpi-value.is-negative {
  color: #ffb6a2;
}

.kpi-foot {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  margin-top: 10px;
  color: var(--ink-faint);
  font-size: 10px;
}

.is-dark .kpi-foot {
  color: rgba(255, 253, 247, 0.48);
}

.kpi-chip {
  display: inline-flex;
  align-items: center;
  padding: 2px 7px;
  border-radius: 999px;
  background: var(--surface-muted);
  color: var(--ink-soft);
  font-size: 9px;
  font-weight: 700;
}

.is-dark .kpi-chip {
  background: rgba(255, 255, 255, 0.1);
  color: #fff5dc;
}

.kpi-chip.is-positive {
  background: var(--mint);
  color: #29624e;
}

.kpi-chip.is-negative {
  background: var(--red-soft);
  color: var(--red);
}

.dashboard-grid {
  display: grid;
  grid-template-columns: minmax(0, 1.65fr) minmax(290px, 0.85fr);
  align-items: start;
  gap: 14px;
}

.inventory-operation-grid > * {
  min-width: 0;
}

.inventory-operation-grid .table-scroll {
  max-width: 100%;
}

.panel {
  min-width: 0;
  padding: 20px;
  border: 1px solid var(--line);
  border-radius: var(--radius-lg);
  background: var(--surface);
  box-shadow: var(--shadow);
}

.panel-heading {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 14px;
  margin-bottom: 16px;
}

.panel-heading h3 {
  margin: 3px 0 0;
  font-family: var(--display-font);
  font-size: 19px;
  font-weight: 600;
  letter-spacing: -0.015em;
}

.panel-subtext {
  margin: 4px 0 0;
  color: var(--ink-faint);
  font-size: 10px;
}

.panel-stack {
  display: grid;
  gap: 14px;
}

.chart-wrap {
  width: 100%;
  overflow-x: auto;
  scrollbar-width: thin;
}

.chart-wrap svg {
  width: 100%;
  min-width: 520px;
  height: 230px;
}

.chart-legend {
  display: flex;
  flex-wrap: wrap;
  gap: 14px;
  margin-top: 2px;
  color: var(--ink-faint);
  font-size: 10px;
}

.legend-item {
  display: inline-flex;
  align-items: center;
  gap: 6px;
}

.legend-swatch {
  width: 8px;
  height: 8px;
  border-radius: 2px;
}

.legend-swatch.is-income {
  background: var(--forest);
}

.legend-swatch.is-expense {
  background: var(--orange);
}

.breakdown-list {
  display: grid;
  gap: 12px;
  margin-top: 4px;
}

.breakdown-row {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 5px 12px;
}

.breakdown-label {
  display: flex;
  min-width: 0;
  align-items: center;
  gap: 7px;
  color: var(--ink-soft);
  font-size: 11px;
}

.breakdown-label span:last-child {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.breakdown-amount {
  color: var(--ink);
  font-family: var(--display-font);
  font-size: 13px;
  font-variant-numeric: tabular-nums;
  font-weight: 600;
}

.progress-track {
  grid-column: 1 / -1;
  height: 5px;
  overflow: hidden;
  border-radius: 999px;
  background: #ece9e1;
}

.progress-fill {
  height: 100%;
  min-width: 2px;
  border-radius: inherit;
  background: var(--forest);
}

.breakdown-row.is-negative .breakdown-amount {
  color: var(--red);
}

.breakdown-total {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  margin-top: 17px;
  padding-top: 14px;
  border-top: 1px dashed var(--line-strong);
  font-size: 11px;
  color: var(--ink-soft);
}

.breakdown-total strong {
  color: var(--ink);
  font-family: var(--display-font);
  font-size: 20px;
  font-variant-numeric: tabular-nums;
}

.full-span {
  grid-column: 1 / -1;
}

.platform-list {
  display: grid;
  gap: 2px;
}

.platform-row {
  display: grid;
  grid-template-columns: minmax(140px, 1.2fr) repeat(3, minmax(80px, 0.72fr));
  align-items: center;
  gap: 12px;
  padding: 12px 4px;
  border-bottom: 1px solid #ece9e1;
}

.platform-row:last-child {
  border-bottom: 0;
}

.platform-shop {
  display: flex;
  min-width: 0;
  align-items: center;
  gap: 10px;
}

.platform-avatar {
  display: grid;
  width: 32px;
  height: 32px;
  flex: 0 0 32px;
  place-items: center;
  border-radius: 10px;
  color: #fff;
  font-size: 10px;
  font-weight: 800;
}

.platform-shop strong {
  display: block;
  overflow: hidden;
  font-size: 11px;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.platform-shop small {
  display: block;
  color: var(--ink-faint);
  font-size: 9px;
}

.platform-stat {
  text-align: right;
}

.platform-stat span {
  display: block;
  color: var(--ink-faint);
  font-size: 9px;
}

.platform-stat strong {
  display: block;
  margin-top: 2px;
  font-family: var(--display-font);
  font-size: 13px;
  font-variant-numeric: tabular-nums;
}

.platform-stat strong.is-negative {
  color: var(--red);
}

.platform-header {
  padding-bottom: 7px;
  color: var(--ink-faint);
  font-size: 9px;
  letter-spacing: 0.05em;
  text-transform: uppercase;
}

.recent-list {
  display: grid;
}

.recent-order {
  width: 100%;
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 4px 12px;
  padding: 12px 0;
  border: 0;
  border-bottom: 1px solid #ece9e1;
  background: transparent;
  text-align: left;
}

.recent-order:last-child {
  border-bottom: 0;
}

.recent-order-main {
  display: flex;
  min-width: 0;
  align-items: center;
  gap: 10px;
}

.recent-order-icon {
  display: grid;
  width: 29px;
  height: 29px;
  flex: 0 0 29px;
  place-items: center;
  border-radius: 9px;
  background: var(--surface-muted);
  color: var(--ink-soft);
  font-size: 10px;
  font-weight: 800;
}

.recent-order strong {
  display: block;
  overflow: hidden;
  font-size: 10px;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.recent-order small {
  display: block;
  color: var(--ink-faint);
  font-size: 9px;
}

.recent-order-amount {
  align-self: center;
  font-family: var(--display-font);
  font-size: 13px;
  font-variant-numeric: tabular-nums;
  font-weight: 600;
  text-align: right;
}

.top-items {
  display: grid;
  gap: 10px;
}

.top-item {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr) auto;
  align-items: center;
  gap: 9px;
}

.top-item-rank {
  display: grid;
  width: 22px;
  height: 22px;
  place-items: center;
  border-radius: 7px;
  background: var(--surface-muted);
  color: var(--ink-soft);
  font-family: var(--display-font);
  font-size: 10px;
  font-weight: 700;
}

.top-item-name {
  overflow: hidden;
  color: var(--ink-soft);
  font-size: 10px;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.top-item-amount {
  font-family: var(--display-font);
  font-size: 12px;
  font-variant-numeric: tabular-nums;
  font-weight: 600;
}

.tax-mini {
  display: grid;
  gap: 11px;
}

.tax-mini-hero {
  padding: 15px;
  border-radius: var(--radius-md);
  background:
    linear-gradient(135deg, rgba(242, 198, 109, 0.18), transparent 65%),
    var(--forest);
  color: #fffdf7;
}

.tax-mini-hero span {
  color: rgba(255, 253, 247, 0.55);
  font-size: 9px;
  letter-spacing: 0.08em;
}

.tax-mini-hero strong {
  display: block;
  margin-top: 5px;
  font-family: var(--display-font);
  font-size: 28px;
  font-variant-numeric: tabular-nums;
  font-weight: 500;
}

.tax-mini-hero small {
  display: block;
  margin-top: 3px;
  color: rgba(255, 253, 247, 0.52);
  font-size: 9px;
}

.tax-mini-lines {
  display: grid;
  gap: 7px;
}

.tax-mini-line {
  display: flex;
  justify-content: space-between;
  color: var(--ink-soft);
  font-size: 10px;
}

.tax-mini-line strong {
  color: var(--ink);
  font-family: var(--display-font);
  font-size: 11px;
  font-variant-numeric: tabular-nums;
}

.tax-mini-link {
  display: flex;
  width: 100%;
  align-items: center;
  justify-content: space-between;
  padding-top: 10px;
  border: 0;
  border-top: 1px solid var(--line);
  background: transparent;
  color: var(--forest);
  font-size: 10px;
  font-weight: 700;
  text-align: left;
}

.toolbar {
  display: flex;
  align-items: center;
  gap: 9px;
  margin-bottom: 12px;
}

.search-box {
  display: flex;
  width: min(340px, 100%);
  align-items: center;
  gap: 8px;
  padding: 0 11px;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: var(--surface);
}

.search-box svg {
  width: 15px;
  height: 15px;
  flex: 0 0 15px;
  fill: none;
  stroke: var(--ink-faint);
  stroke-width: 1.8;
}

.search-box input {
  width: 100%;
  height: 38px;
  border: 0;
  outline: 0;
  background: transparent;
  color: var(--ink);
  font-size: 11px;
}

.toolbar select {
  max-width: 100%;
  height: 40px;
  padding: 0 30px 0 11px;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: var(--surface);
  color: var(--ink-soft);
  font-size: 11px;
}

.toolbar-meta {
  min-width: 0;
  margin-left: auto;
  color: var(--ink-faint);
  font-size: 10px;
  overflow-wrap: anywhere;
}

.bulk-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 10px;
  padding: 10px 13px;
  border: 1px solid #c9dfd4;
  border-radius: 11px;
  background: var(--mint);
  color: var(--ink-soft);
  font-size: 10px;
}

.bulk-bar strong {
  color: var(--forest);
  font-family: var(--display-font);
  font-size: 15px;
}

.checkbox-column {
  width: 34px;
  text-align: center !important;
}

.checkbox-column input,
.order-select-checkbox {
  width: 14px;
  height: 14px;
  accent-color: var(--forest);
}

.table-card {
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: var(--radius-lg);
  background: var(--surface);
  box-shadow: var(--shadow);
}

.table-scroll {
  overflow-x: auto;
}

.data-table {
  width: 100%;
  border-collapse: collapse;
  white-space: nowrap;
}

.data-table th {
  padding: 12px 14px;
  border-bottom: 1px solid var(--line);
  background: #f8f6f0;
  color: var(--ink-faint);
  font-size: 9px;
  font-weight: 800;
  letter-spacing: 0.06em;
  text-align: left;
}

.data-table td {
  padding: 13px 14px;
  border-bottom: 1px solid #ece9e1;
  color: var(--ink-soft);
  font-size: 11px;
  vertical-align: middle;
}

.data-table tbody tr {
  cursor: pointer;
  transition: background 130ms ease;
}

.data-table tbody tr:hover {
  background: #fbfaf5;
}

.data-table tbody tr:last-child td {
  border-bottom: 0;
}

.data-table .align-right {
  text-align: right;
}

.table-primary {
  display: block;
  color: var(--ink);
  font-size: 11px;
  font-weight: 650;
}

.table-secondary {
  display: block;
  margin-top: 2px;
  color: var(--ink-faint);
  font-size: 9px;
}

.money-cell {
  font-family: var(--display-font);
  font-size: 12px;
  font-variant-numeric: tabular-nums;
  font-weight: 600;
}

.money-cell.is-positive {
  color: #2e6c54;
}

.money-cell.is-negative {
  color: var(--red);
}

.platform-label {
  display: inline-flex;
  align-items: center;
  gap: 6px;
}

.platform-label::before {
  width: 7px;
  height: 7px;
  border-radius: 2px;
  background: var(--platform-color, var(--forest));
  content: "";
}

.pagination {
  display: flex;
  min-height: 48px;
  align-items: center;
  justify-content: flex-end;
  gap: 8px;
  padding: 9px 14px;
  border-top: 1px solid var(--line);
  background: #fbfaf5;
}

.pagination span {
  margin-right: 4px;
  color: var(--ink-faint);
  font-size: 10px;
}

.pagination button {
  min-width: 28px;
  height: 28px;
  padding: 0 8px;
  border: 1px solid var(--line);
  border-radius: 7px;
  background: var(--surface);
  color: var(--ink-soft);
  font-size: 10px;
}

.pagination button.is-active {
  border-color: var(--forest);
  background: var(--forest);
  color: white;
}

.pagination button:disabled {
  cursor: default;
  opacity: 0.35;
}

.expense-summary-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 12px;
  margin-bottom: 13px;
}

.product-summary-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 12px;
  margin-bottom: 13px;
}

#accountingSummaryGrid {
  grid-template-columns: repeat(5, minmax(0, 1fr));
}

@media (max-width: 1100px) {
  #accountingSummaryGrid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

.expense-summary-card {
  padding: 16px 17px;
  border: 1px solid var(--line);
  border-radius: var(--radius-md);
  background: var(--surface);
}

.expense-summary-card span {
  color: var(--ink-faint);
  font-size: 9px;
  font-weight: 700;
  letter-spacing: 0.06em;
}

.expense-summary-card strong {
  display: block;
  margin-top: 7px;
  font-family: var(--display-font);
  font-size: 24px;
  font-variant-numeric: tabular-nums;
  font-weight: 600;
}

.expense-summary-card small {
  display: block;
  margin-top: 3px;
  color: var(--ink-faint);
  font-size: 9px;
}

.product-code {
  display: inline-flex;
  align-items: center;
  padding: 2px 6px;
  border: 1px solid #e4e0d5;
  border-radius: 6px;
  background: #f6f3eb;
  color: #52605a;
  font-family: "SFMono-Regular", Consolas, "Liberation Mono", monospace;
  font-size: 9px;
  letter-spacing: 0.015em;
}

.combo-cell {
  display: block;
  max-width: 230px;
  overflow: hidden;
  color: var(--ink-soft);
  font-size: 10px;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.combo-cell.is-empty {
  color: var(--ink-faint);
}

.table-action {
  padding: 3px 8px;
  border: 1px solid var(--line);
  border-radius: 7px;
  background: transparent;
  color: var(--forest);
  font-size: 9px;
  font-weight: 700;
}

.table-action:hover {
  border-color: #9eb5aa;
  background: var(--mint);
}

.check-filter {
  display: inline-flex;
  height: 40px;
  align-items: center;
  gap: 7px;
  padding: 0 11px;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: var(--surface);
  color: var(--ink-soft);
  font-size: 10px;
  white-space: nowrap;
}

.check-filter input {
  width: 14px;
  height: 14px;
  accent-color: var(--forest);
}

.inventory-movement-panel {
  margin-top: 14px;
}

.compact-table th {
  padding-top: 9px;
  padding-bottom: 9px;
}

.compact-table td {
  padding-top: 10px;
  padding-bottom: 10px;
}

.compact-table tbody tr {
  cursor: default;
}

.movement-type {
  display: inline-flex;
  align-items: center;
  padding: 2px 7px;
  border-radius: 999px;
  background: var(--surface-muted);
  color: var(--ink-soft);
  font-size: 9px;
  white-space: nowrap;
}

.movement-type.is-in {
  background: var(--mint);
  color: #2b6751;
}

.movement-type.is-out {
  background: var(--orange-soft);
  color: #9b4528;
}

.movement-qty {
  font-family: var(--display-font);
  font-size: 12px;
  font-variant-numeric: tabular-nums;
  font-weight: 600;
}

.movement-qty.is-in {
  color: #2e6c54;
}

.movement-qty.is-out {
  color: var(--red);
}

.purchase-layout {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 280px;
  align-items: start;
  gap: 14px;
}

.supplier-panel {
  padding: 16px;
}

.supplier-list {
  display: grid;
  gap: 8px;
}

.supplier-item {
  display: flex;
  align-items: flex-start;
  gap: 9px;
  padding: 10px;
  border: 1px solid #ece9e1;
  border-radius: 10px;
  background: #fbfaf5;
}

.supplier-avatar {
  display: grid;
  width: 28px;
  height: 28px;
  flex: 0 0 28px;
  place-items: center;
  border-radius: 9px;
  background: var(--mint);
  color: var(--forest);
  font-family: var(--display-font);
  font-size: 12px;
  font-weight: 700;
}

.supplier-item strong {
  display: block;
  overflow: hidden;
  font-size: 10px;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.supplier-item small {
  display: block;
  margin-top: 2px;
  color: var(--ink-faint);
  font-size: 9px;
  line-height: 1.5;
}

.purchase-line-head,
.purchase-line-row {
  display: grid;
  grid-template-columns: minmax(180px, 2fr) minmax(70px, 0.65fr) minmax(90px, 0.8fr) 30px;
  align-items: center;
  gap: 7px;
}

.voucher-line-head,
.voucher-line-row {
  display: grid;
  grid-template-columns: minmax(180px, 1.6fr) minmax(150px, 1.4fr) minmax(90px, 0.8fr) minmax(90px, 0.8fr) 30px;
  align-items: center;
  gap: 7px;
  margin-bottom: 7px;
}

.voucher-line-head {
  color: var(--ink-faint);
  font-size: 8px;
  font-weight: 700;
}

.voucher-line-row select,
.voucher-line-row input {
  width: 100%;
  height: 37px;
  padding: 0 9px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fffefb;
  color: var(--ink);
  font-size: 10px;
}

.purchase-line-head {
  margin: 2px 0 6px;
  color: var(--ink-faint);
  font-size: 8px;
  font-weight: 700;
  letter-spacing: 0.03em;
}

.purchase-lines {
  display: grid;
  gap: 7px;
  margin-bottom: 9px;
}

.batch-receipt-fields {
  display: grid;
  grid-template-columns: minmax(90px, 1.3fr) minmax(98px, 1fr) minmax(98px, 1fr);
  gap: 6px;
  margin-top: 7px;
}

.location-stock-table td {
  overflow-wrap: anywhere;
}

.inventory-movement-panel {
  min-width: 0;
}

.batch-receipt-fields input {
  width: 100%;
  height: 33px;
  min-width: 0;
  padding: 0 8px;
  border: 1px solid var(--line);
  border-radius: 7px;
  background: #fffefb;
  color: var(--ink);
  font-size: 9px;
}

.serial-receipt-fields {
  margin-top: 7px;
}

.serial-receipt-fields textarea {
  width: 100%;
  min-height: 52px;
  padding: 8px;
  resize: vertical;
  border: 1px solid var(--line);
  border-radius: 7px;
  background: #fffefb;
  color: var(--ink);
  font: inherit;
  font-size: 9px;
  line-height: 1.55;
}

.serial-return-list {
  display: grid;
  gap: 6px;
  max-height: 230px;
  overflow-y: auto;
}

.purchase-scan-panel {
  display: grid;
  gap: 9px;
  margin: 4px 0 12px;
  padding: 12px;
  border: 1px solid #d5e4da;
  border-radius: 11px;
  background:
    linear-gradient(135deg, rgba(44, 106, 84, 0.06), transparent 58%),
    #fbfcf8;
}

.purchase-scan-copy {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 12px;
}

.purchase-scan-copy strong {
  color: var(--forest);
  font-size: 10px;
}

.purchase-scan-copy span {
  color: var(--ink-faint);
  font-size: 8px;
}

.purchase-scan-controls {
  display: grid;
  grid-template-columns: minmax(180px, 1.7fr) 78px auto auto;
  align-items: center;
  gap: 7px;
}

.purchase-scan-controls input[type="text"],
.purchase-scan-controls input[type="number"] {
  width: 100%;
  height: 37px;
  padding: 0 10px;
  border: 1px solid #cfdbd1;
  border-radius: 8px;
  background: #fffefb;
  color: var(--ink);
  font-size: 10px;
}

.purchase-scan-controls input[type="text"]:focus,
.purchase-scan-controls input[type="number"]:focus {
  border-color: var(--forest);
  outline: 2px solid rgba(35, 91, 70, 0.12);
}

.purchase-scan-controls .button {
  height: 37px;
  white-space: nowrap;
}

.purchase-scan-feedback {
  min-height: 14px;
  margin: 0;
  color: #416653;
  font-size: 8px;
  line-height: 1.55;
}

.purchase-scan-feedback.is-error {
  color: var(--red);
  font-weight: 700;
}

.purchase-line-row select,
.purchase-line-row input {
  width: 100%;
  height: 37px;
  padding: 0 9px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fffefb;
  color: var(--ink);
  font-size: 10px;
}

.remove-line-button {
  display: grid;
  width: 29px;
  height: 29px;
  place-items: center;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: transparent;
  color: var(--ink-faint);
  font-size: 15px;
}

.remove-line-button:hover {
  border-color: #e7c5bf;
  background: var(--red-soft);
  color: var(--red);
}

.purchase-total-preview {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 12px;
  margin: 5px 0 14px;
  padding: 10px 12px;
  border-radius: 9px;
  background: var(--surface-muted);
  color: var(--ink-soft);
  font-size: 10px;
}

.purchase-total-preview strong {
  color: var(--ink);
  font-family: var(--display-font);
  font-size: 18px;
  font-variant-numeric: tabular-nums;
}

.bundle-editor {
  display: grid;
  gap: 7px;
  margin-bottom: 8px;
}

.bundle-item-row {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 80px 30px;
  align-items: center;
  gap: 7px;
}

.bundle-item-row select,
.bundle-item-row input {
  width: 100%;
  height: 37px;
  padding: 0 9px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fffefb;
  color: var(--ink);
  font-size: 10px;
}

.team-role-panel {
  margin-top: 14px;
}

.role-choice-list {
  display: grid;
  gap: 7px;
  margin-bottom: 13px;
}

.role-choice {
  display: flex;
  align-items: flex-start;
  gap: 9px;
  padding: 9px 10px;
  border: 1px solid var(--line);
  border-radius: 9px;
  background: #fbfaf5;
  cursor: pointer;
}

.role-choice input {
  width: 14px;
  height: 14px;
  margin-top: 2px;
  accent-color: var(--forest);
}

.role-choice > input[type="checkbox"],
.permission-option > input[type="checkbox"] {
  width: 14px;
  min-width: 14px;
  height: 14px;
  flex: 0 0 14px;
  margin: 1px 0 0;
  padding: 0;
  border: 0;
  background: transparent;
  box-shadow: none;
  accent-color: var(--forest);
}

.role-choice > span {
  min-width: 0;
  flex: 1;
}

.role-choice strong {
  display: block;
  font-size: 10px;
}

.role-choice small {
  display: block;
  margin-top: 1px;
  color: var(--ink-faint);
  font-size: 8px;
}

.permission-groups {
  display: grid;
  gap: 10px;
  max-height: 330px;
  margin-bottom: 13px;
  padding-right: 4px;
  overflow-y: auto;
}

.permission-group {
  padding: 10px;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: #fbfaf5;
}

.permission-group > strong {
  display: block;
  margin-bottom: 7px;
  color: var(--ink-soft);
  font-size: 9px;
  letter-spacing: 0.04em;
}

.permission-options {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 6px;
}

.permission-option {
  display: flex;
  align-items: center;
  gap: 6px;
  color: var(--ink-soft);
  font-size: 9px;
}

.permission-option input {
  width: 13px;
  height: 13px;
  accent-color: var(--forest);
}

.audit-action-code {
  display: inline-flex;
  padding: 2px 6px;
  border-radius: 6px;
  background: var(--surface-muted);
  color: var(--ink-soft);
  font-family: "SFMono-Regular", Consolas, "Liberation Mono", monospace;
  font-size: 8px;
}

.provider-grid {
  display: grid;
  grid-template-columns: repeat(5, minmax(0, 1fr));
  gap: 10px;
  margin-bottom: 14px;
}

.provider-card {
  padding: 14px;
  border: 1px solid var(--line);
  border-radius: var(--radius-md);
  background: var(--surface);
}

.provider-top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
}

.provider-logo {
  display: grid;
  width: 29px;
  height: 29px;
  place-items: center;
  border-radius: 9px;
  background: color-mix(in srgb, var(--provider-color) 13%, white);
  color: var(--provider-color);
  font-size: 10px;
  font-weight: 900;
}

.provider-card strong {
  display: block;
  margin-top: 11px;
  font-size: 11px;
}

.provider-card small {
  display: block;
  margin-top: 2px;
  color: var(--ink-faint);
  font-size: 9px;
  line-height: 1.5;
}

.status-pill {
  display: inline-flex;
  align-items: center;
  padding: 3px 7px;
  border-radius: 999px;
  background: var(--mint);
  color: #2a6651;
  font-size: 8px;
  font-weight: 800;
  letter-spacing: 0.04em;
  white-space: nowrap;
}

.status-pill.is-warning {
  background: #fbf0d8;
  color: #8a6521;
}

.status-pill.is-muted {
  background: var(--surface-muted);
  color: var(--ink-faint);
}

.status-pill.is-error {
  background: var(--red-soft);
  color: var(--red);
}

.import-layout {
  display: grid;
  grid-template-columns: minmax(0, 1.2fr) minmax(300px, 0.8fr);
  gap: 14px;
}

.status-dot {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  color: var(--ink-faint);
  font-size: 9px;
}

.status-dot::before {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: #4f9b77;
  content: "";
}

.form-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 11px;
}

.form-grid-2 {
  margin-top: 3px;
}

.field {
  display: grid;
  gap: 6px;
  margin-bottom: 12px;
}

.field > span {
  color: var(--ink-soft);
  font-size: 10px;
  font-weight: 700;
}

.field input,
.field select,
.field textarea {
  width: 100%;
  height: 40px;
  padding: 0 11px;
  border: 1px solid var(--line);
  border-radius: 9px;
  outline: 0;
  background: #fffefb;
  color: var(--ink);
  font-size: 11px;
  transition:
    border-color 150ms ease,
    box-shadow 150ms ease;
}

.field input:focus,
.field select:focus,
.field textarea:focus {
  border-color: #7fae9b;
  box-shadow: 0 0 0 3px rgba(127, 174, 155, 0.14);
}

.field input::placeholder,
.field textarea::placeholder {
  color: #a7aea9;
}

.field textarea {
  min-height: 78px;
  padding-top: 10px;
  padding-bottom: 10px;
  resize: vertical;
  line-height: 1.55;
}

.dropzone {
  position: relative;
  display: grid;
  min-height: 175px;
  place-items: center;
  align-content: center;
  gap: 5px;
  margin: 3px 0 12px;
  padding: 20px;
  border: 1px dashed #b9c4bd;
  border-radius: var(--radius-md);
  background:
    repeating-linear-gradient(
      -45deg,
      transparent,
      transparent 9px,
      rgba(19, 58, 51, 0.018) 9px,
      rgba(19, 58, 51, 0.018) 18px
    ),
    #fbfaf5;
  text-align: center;
  transition:
    border-color 160ms ease,
    background 160ms ease;
}

.dropzone:hover,
.dropzone.is-dragging {
  border-color: var(--forest);
  background: var(--mint);
}

.dropzone input {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  cursor: pointer;
  opacity: 0;
}

.dropzone-icon {
  display: grid;
  width: 38px;
  height: 38px;
  place-items: center;
  margin-bottom: 4px;
  border-radius: 50%;
  background: var(--mint);
  color: var(--forest);
}

.dropzone-icon svg {
  width: 19px;
  fill: none;
  stroke: currentColor;
  stroke-linecap: round;
  stroke-linejoin: round;
  stroke-width: 1.7;
}

.dropzone strong {
  font-size: 11px;
}

.dropzone small {
  color: var(--ink-faint);
  font-size: 9px;
}

.dropzone.has-file {
  border-style: solid;
  border-color: #7fae9b;
  background: #f4faf7;
}

.import-guidance {
  display: grid;
  gap: 2px;
  margin-bottom: 14px;
  padding: 10px 12px;
  border-left: 3px solid var(--gold);
  border-radius: 0 8px 8px 0;
  background: #fbf7eb;
  color: var(--ink-faint);
  font-size: 9px;
  line-height: 1.6;
}

.import-guidance strong {
  color: var(--ink-soft);
}

.import-result {
  margin-top: 14px;
  padding: 13px;
  border: 1px solid var(--line);
  border-radius: var(--radius-md);
  background: #fbfaf5;
}

.import-result.is-error {
  border-color: #e7c5bf;
  background: var(--red-soft);
}

.import-result h4 {
  margin: 0 0 8px;
  font-size: 11px;
}

.result-metrics {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 6px;
}

.result-metrics div {
  padding: 7px;
  border-radius: 8px;
  background: var(--surface);
  text-align: center;
}

.result-metrics span {
  display: block;
  color: var(--ink-faint);
  font-size: 8px;
}

.result-metrics strong {
  display: block;
  margin-top: 2px;
  font-family: var(--display-font);
  font-size: 16px;
  font-variant-numeric: tabular-nums;
}

.batch-list {
  display: grid;
  gap: 9px;
}

.batch-item {
  padding: 11px 12px;
  border: 1px solid #ece9e1;
  border-radius: 10px;
  background: #fbfaf5;
}

.batch-item-top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
}

.batch-item strong {
  overflow: hidden;
  font-size: 10px;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.batch-item small {
  display: block;
  margin-top: 3px;
  color: var(--ink-faint);
  font-size: 9px;
}

.tax-layout {
  display: grid;
  grid-template-columns: minmax(320px, 0.82fr) minmax(0, 1.18fr);
  gap: 14px;
}

.form-callout {
  margin: 3px 0 14px;
  padding: 10px 12px;
  border: 1px solid #ead8b3;
  border-radius: 9px;
  background: #fdf8ed;
  color: #7d682f;
  font-size: 9px;
  line-height: 1.65;
}

.period-chip {
  padding: 4px 8px;
  border-radius: 999px;
  background: var(--surface-muted);
  color: var(--ink-faint);
  font-size: 9px;
}

.tax-hero {
  padding: 20px;
  border-radius: var(--radius-md);
  background:
    radial-gradient(circle at 90% 15%, rgba(242, 198, 109, 0.22), transparent 10rem),
    var(--forest);
  color: #fffdf7;
}

.tax-hero > span {
  color: rgba(255, 253, 247, 0.55);
  font-size: 9px;
  letter-spacing: 0.08em;
}

.tax-hero strong {
  display: block;
  margin: 7px 0 2px;
  font-family: var(--display-font);
  font-size: clamp(33px, 5vw, 50px);
  font-variant-numeric: tabular-nums;
  font-weight: 500;
  letter-spacing: -0.04em;
  line-height: 1;
}

.tax-hero small {
  color: rgba(255, 253, 247, 0.5);
  font-size: 9px;
}

.tax-breakdown {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px;
  margin-top: 12px;
}

.tax-line-card {
  padding: 13px;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: #fbfaf5;
}

.tax-line-card span {
  color: var(--ink-faint);
  font-size: 9px;
}

.tax-line-card strong {
  display: block;
  margin-top: 3px;
  font-family: var(--display-font);
  font-size: 19px;
  font-variant-numeric: tabular-nums;
  font-weight: 600;
}

.tax-flow {
  display: grid;
  gap: 10px;
  margin-top: 14px;
}

.tax-flow-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  padding-bottom: 9px;
  border-bottom: 1px dashed var(--line);
  color: var(--ink-soft);
  font-size: 10px;
}

.tax-flow-row:last-child {
  border-bottom: 0;
}

.tax-flow-row strong {
  color: var(--ink);
  font-family: var(--display-font);
  font-size: 13px;
  font-variant-numeric: tabular-nums;
}

.tax-flow-row.is-total {
  margin-top: 2px;
  padding: 11px 12px;
  border: 0;
  border-radius: 9px;
  background: var(--mint);
  color: #255c48;
}

.tax-flow-row.is-total strong {
  color: #173f31;
  font-size: 17px;
}

.tax-note {
  margin-top: 13px;
  padding: 11px 12px;
  border-radius: 9px;
  background: var(--surface-muted);
  color: var(--ink-faint);
  font-size: 9px;
  line-height: 1.65;
}

.empty-state {
  display: grid;
  min-height: 230px;
  place-items: center;
  align-content: center;
  gap: 6px;
  padding: 30px;
  color: var(--ink-faint);
  text-align: center;
}

.empty-state-mark {
  display: grid;
  width: 48px;
  height: 48px;
  place-items: center;
  margin-bottom: 4px;
  border-radius: 15px;
  background: var(--surface-muted);
  color: var(--ink-soft);
  font-family: var(--display-font);
  font-size: 22px;
}

.empty-state strong {
  color: var(--ink-soft);
  font-size: 12px;
}

.empty-state p {
  max-width: 340px;
  margin: 0;
  font-size: 10px;
}

.skeleton-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 12px;
  margin: 20px 0 14px;
}

.skeleton-card,
.skeleton-panel {
  border-radius: var(--radius-md);
  background: linear-gradient(90deg, #ebe8df 25%, #f4f1e9 50%, #ebe8df 75%);
  background-size: 200% 100%;
  animation: shimmer 1.5s infinite linear;
}

.skeleton-card {
  height: 135px;
}

.skeleton-panel {
  height: 370px;
}

.skeleton-title {
  width: 300px;
  height: 42px;
  margin-top: 12px;
  border-radius: 9px;
  background: linear-gradient(90deg, #ebe8df 25%, #f4f1e9 50%, #ebe8df 75%);
  background-size: 200% 100%;
  animation: shimmer 1.5s infinite linear;
}

@keyframes shimmer {
  to {
    background-position: -200% 0;
  }
}

.modal-root {
  position: fixed;
  inset: 0;
  z-index: 60;
  display: grid;
  place-items: center;
  padding: 20px;
  background: rgba(10, 28, 24, 0.52);
  backdrop-filter: blur(6px);
}

.modal {
  width: min(520px, 100%);
  max-height: calc(100vh - 40px);
  overflow-y: auto;
  padding: 22px;
  border-radius: 19px;
  background: var(--surface);
  box-shadow: 0 30px 80px rgba(8, 25, 21, 0.24);
  animation: modal-in 180ms ease both;
}

.modal.is-wide {
  width: min(720px, 100%);
}

@keyframes modal-in {
  from {
    opacity: 0;
    transform: scale(0.98) translateY(8px);
  }
  to {
    opacity: 1;
    transform: scale(1) translateY(0);
  }
}

.modal-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 18px;
}

.modal-header h3 {
  margin: 3px 0 0;
  font-family: var(--display-font);
  font-size: 23px;
  font-weight: 600;
}

.modal-close {
  display: grid;
  width: 30px;
  height: 30px;
  flex: 0 0 30px;
  place-items: center;
  border: 1px solid var(--line);
  border-radius: 50%;
  background: transparent;
  color: var(--ink-faint);
  font-size: 17px;
  line-height: 1;
}

.modal-actions {
  display: flex;
  justify-content: flex-end;
  gap: 8px;
  margin-top: 17px;
}

.detail-hero {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 8px;
  margin-bottom: 14px;
}

.detail-hero > div {
  padding: 11px;
  border-radius: 10px;
  background: var(--surface-muted);
}

.detail-hero span {
  display: block;
  color: var(--ink-faint);
  font-size: 8px;
}

.detail-hero strong {
  display: block;
  margin-top: 2px;
  font-family: var(--display-font);
  font-size: 16px;
  font-variant-numeric: tabular-nums;
}

.detail-section {
  margin-top: 13px;
}

.detail-section h4 {
  margin: 0 0 7px;
  color: var(--ink-faint);
  font-size: 9px;
  font-weight: 800;
  letter-spacing: 0.07em;
}

.detail-list {
  display: grid;
  gap: 0;
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: 10px;
}

.detail-line {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding: 8px 11px;
  border-bottom: 1px solid #ece9e1;
  font-size: 10px;
}

.detail-line:last-child {
  border-bottom: 0;
}

.detail-line span {
  color: var(--ink-soft);
}

.detail-line strong {
  font-family: var(--display-font);
  font-size: 12px;
  font-variant-numeric: tabular-nums;
}

.detail-line.is-total {
  background: var(--surface-muted);
}

.detail-meta {
  margin-top: 12px;
  color: var(--ink-faint);
  font-size: 9px;
  line-height: 1.7;
}

.toast-root {
  position: fixed;
  right: 24px;
  bottom: 24px;
  z-index: 100;
  display: grid;
  gap: 8px;
  pointer-events: none;
}

.toast {
  min-width: 220px;
  max-width: 360px;
  padding: 12px 14px;
  border-radius: 11px;
  background: var(--ink);
  box-shadow: 0 16px 40px rgba(10, 28, 24, 0.2);
  color: #fffdf7;
  font-size: 11px;
  animation: toast-in 200ms ease both;
}

.toast.is-error {
  background: var(--red);
}

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

[hidden] {
  display: none !important;
}

@media (max-width: 1180px) {
  .topbar {
    align-items: flex-start;
    flex-direction: column;
    padding: 18px 0;
  }

  .topbar-actions {
    width: 100%;
    justify-content: flex-start;
    flex-wrap: wrap;
  }

  .kpi-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .provider-grid {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }
}

@media (max-width: 940px) {
  :root {
    --sidebar-width: 204px;
  }

  .main {
    padding-inline: 22px;
  }

  .dashboard-grid,
  .import-layout,
  .tax-layout,
  .purchase-layout {
    grid-template-columns: 1fr;
  }

  .topbar-export {
    display: none;
  }
}

@media (max-width: 720px) {
  :root {
    --sidebar-width: 0px;
  }

  html,
  body {
    max-width: 100%;
    overflow-x: hidden;
  }

  .sidebar {
    position: static;
    width: 100%;
    height: auto;
    padding: 14px 16px 11px;
    overflow: visible;
  }

  .brand-mark {
    width: 36px;
    height: 36px;
    flex-basis: 36px;
  }

  .brand-mark svg {
    width: 25px;
  }

  .brand strong {
    font-size: 19px;
  }

  .brand small,
  .sidebar-note {
    display: none;
  }

  .main-nav {
    display: flex;
    gap: 4px;
    margin: 12px -2px 0;
    overflow-x: auto;
    scrollbar-width: none;
  }

  .main-nav::-webkit-scrollbar {
    display: none;
  }

  .nav-item {
    width: auto;
    min-width: max-content;
    gap: 6px;
    padding: 8px 10px;
  }

  .nav-item.is-active::before {
    display: none;
  }

  .nav-item svg {
    width: 15px;
    height: 15px;
  }

  .main {
    margin-left: 0;
    padding: 0 14px 36px;
  }

  .topbar {
    position: static;
    min-height: 0;
    padding: 13px 0 9px;
    background: transparent;
    backdrop-filter: none;
  }

  .page-heading h1 {
    font-size: 24px;
  }

  .topbar-actions {
    display: block;
  }

  .range-controls {
    display: none;
  }

  .topbar-actions .button-primary {
    min-height: 34px;
    padding: 6px 10px;
  }

  .mobile-range {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 10px;
    padding: 7px 10px;
    border: 1px solid var(--line);
    border-radius: 9px;
    background: rgba(255, 253, 248, 0.7);
    color: var(--ink-faint);
    font-size: 10px;
  }

  .view {
    padding-top: 4px;
  }

  .dashboard-intro,
  .section-intro {
    align-items: flex-start;
    flex-direction: column;
    gap: 10px;
    margin-bottom: 14px;
  }

  .dashboard-intro h2 {
    font-size: 27px;
  }

  .period-stamp {
    display: none;
  }

  .kpi-grid {
    gap: 8px;
  }

  .kpi-card {
    min-height: 136px;
    padding: 14px;
  }

  .kpi-value {
    font-size: 23px;
  }

  .kpi-foot {
    align-items: flex-start;
    flex-direction: column;
    gap: 6px;
  }

  .panel {
    padding: 15px;
    border-radius: 15px;
  }

  .platform-row {
    grid-template-columns: minmax(120px, 1fr) repeat(2, minmax(60px, 0.7fr));
  }

  .platform-row .platform-stat:nth-of-type(3) {
    display: none;
  }

  .toolbar {
    flex-wrap: wrap;
  }

  .search-box {
    width: 100%;
  }

  .toolbar-meta {
    margin-left: 0;
  }

  .provider-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .expense-summary-grid {
    grid-template-columns: 1fr;
  }

  .product-summary-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .form-grid {
    grid-template-columns: 1fr;
    gap: 0;
  }

  .purchase-line-head {
    display: none;
  }

  .purchase-line-row {
    grid-template-columns: minmax(0, 1fr) 67px 31px;
  }

  .purchase-scan-copy {
    display: grid;
    gap: 2px;
  }

  .purchase-scan-controls {
    grid-template-columns: minmax(0, 1fr) 67px;
  }

  .purchase-scan-controls .button {
    width: 100%;
  }

  .batch-receipt-fields {
    grid-template-columns: 1fr;
  }

  .batch-receipt-table,
  .batch-receipt-table tbody {
    display: block;
    min-width: 0;
  }

  .batch-receipt-table thead {
    display: none;
  }

  .batch-receipt-table tr {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 9px 12px;
    padding: 12px 10px;
    border-bottom: 1px solid var(--line);
  }

  .batch-receipt-table td {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 8px;
    width: auto;
    padding: 0;
    border: 0;
  }

  .batch-receipt-table td:first-child {
    display: block;
    grid-column: 1 / -1;
  }

  .batch-receipt-table td[data-label]::before {
    color: var(--ink-faint);
    content: attr(data-label);
    font-size: 8px;
    font-weight: 700;
  }

  .purchase-line-row select {
    grid-column: 1 / -1;
  }

  .purchase-line-row .line-total {
    display: none;
  }

  .tax-breakdown {
    grid-template-columns: 1fr;
  }

  .modal-root {
    align-items: end;
    padding: 0;
  }

  .modal {
    width: 100%;
    max-height: 92vh;
    border-radius: 20px 20px 0 0;
  }

  .detail-hero {
    grid-template-columns: 1fr 1fr;
  }

  .toast-root {
    right: 12px;
    bottom: 12px;
    left: 12px;
  }

  .toast {
    min-width: 0;
    max-width: none;
  }

  .auth-gate {
    padding: 14px;
  }

  .auth-card {
    padding: 22px;
    border-radius: 18px;
  }

  .permission-options {
    grid-template-columns: 1fr;
  }
}

@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    scroll-behavior: auto !important;
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
  }
}
