/* =========================================================
   家电生意 · 门店经营台
   Local demo dashboard
   ========================================================= */

:root {
  --bg: #f3f6f4;
  --surface: #ffffff;
  --surface-2: #f7faf8;
  --surface-3: #eef4f1;
  --ink: #13231f;
  --ink-soft: #30463f;
  --muted: #6c7f78;
  --muted-2: #94a49e;
  --line: #e4ebe7;
  --line-strong: #d4dfda;
  --primary: #0f766e;
  --primary-dark: #0b5e57;
  --primary-soft: #e5f4f0;
  --accent: #d68a21;
  --accent-soft: #fbf1df;
  --danger: #bc423b;
  --danger-soft: #fbeceb;
  --success: #167a3e;
  --success-soft: #e8f6ed;
  --blue: #376c9c;
  --blue-soft: #eaf2fa;
  --violet: #7357a6;
  --violet-soft: #f0ebfa;
  --sidebar: #0a1f1b;
  --sidebar-2: #0e2a25;
  --sidebar-muted: #8ea8a1;
  --shadow-card: 0 1px 2px rgba(16, 40, 33, .025), 0 18px 42px -34px rgba(12, 48, 38, .22);
  --shadow-float: 0 24px 70px -30px rgba(7, 35, 27, .38);
  --radius: 18px;
  --radius-lg: 22px;
  --ease: cubic-bezier(.2, .7, .2, 1);
  --sidebar-w: 256px;
}

*,
*::before,
*::after {
  box-sizing: border-box;
}

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

body {
  margin: 0;
  min-width: 320px;
  background:
    radial-gradient(circle at 88% -10%, rgba(190, 224, 207, .34), transparent 34rem),
    var(--bg);
  color: var(--ink);
  font-family: "Inter", "PingFang SC", "Hiragino Sans GB", "Microsoft YaHei", "Noto Sans SC", system-ui, -apple-system, sans-serif;
  font-size: 14px;
  line-height: 1.55;
  -webkit-font-smoothing: antialiased;
  font-variant-numeric: tabular-nums;
}

body.modal-open {
  overflow: hidden;
}

::selection {
  background: rgba(15, 118, 110, .2);
}

button,
input,
select {
  font: inherit;
}

button {
  color: inherit;
}

button,
a {
  -webkit-tap-highlight-color: transparent;
}

a {
  color: inherit;
  text-decoration: none;
}

svg {
  display: block;
}

[hidden] {
  display: none !important;
}

.svg-sprite {
  position: absolute;
  width: 0;
  height: 0;
  overflow: hidden;
}

.icon {
  width: 18px;
  height: 18px;
  flex: none;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.8;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.icon-sm {
  width: 16px;
  height: 16px;
}

.icon-xs {
  width: 13px;
  height: 13px;
}

.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

:focus-visible {
  outline: 2px solid rgba(15, 118, 110, .52);
  outline-offset: 2px;
}

/* =========================================================
   Shell / sidebar
   ========================================================= */

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

.sidebar {
  position: fixed;
  inset: 0 auto 0 0;
  width: var(--sidebar-w);
  z-index: 60;
  display: flex;
  flex-direction: column;
  padding: 24px 16px 18px;
  overflow-y: auto;
  color: #f3faf7;
  background:
    radial-gradient(circle at 12% 0%, rgba(28, 126, 109, .34), transparent 18rem),
    linear-gradient(182deg, #0d2722 0%, #071713 100%);
  border-right: 1px solid rgba(255, 255, 255, .035);
}

.sidebar::after {
  content: "";
  position: absolute;
  right: -60px;
  bottom: 160px;
  width: 200px;
  height: 200px;
  border: 1px solid rgba(255, 255, 255, .04);
  border-radius: 50%;
  pointer-events: none;
}

.sidebar-top,
.sidebar-bottom {
  position: relative;
  z-index: 1;
}

.sidebar-bottom {
  margin-top: auto;
  padding-top: 28px;
}

.brand {
  display: flex;
  gap: 12px;
  align-items: center;
  padding: 6px 10px 27px;
}

.brand-mark {
  display: grid;
  place-items: center;
  width: 42px;
  height: 42px;
  flex: none;
  color: #fff;
  background: linear-gradient(145deg, #1aa18f 0%, #0e6d64 100%);
  border: 1px solid rgba(255, 255, 255, .15);
  border-radius: 13px;
  box-shadow: 0 10px 22px -12px rgba(20, 169, 146, .8);
}

.brand-mark svg {
  width: 26px;
  height: 26px;
}

.brand-copy {
  display: flex;
  flex-direction: column;
  line-height: 1.28;
}

.brand-copy strong {
  font-size: 16.5px;
  letter-spacing: .02em;
  color: #fff;
}

.brand-copy small {
  margin-top: 2px;
  color: var(--sidebar-muted);
  font-size: 11px;
  letter-spacing: .12em;
}

.sidebar-close {
  display: none;
  position: absolute;
  top: 20px;
  right: 13px;
  z-index: 2;
  place-items: center;
  width: 32px;
  height: 32px;
  padding: 0;
  border: 1px solid rgba(255, 255, 255, .1);
  border-radius: 9px;
  color: #a9c1ba;
  background: rgba(255, 255, 255, .055);
  cursor: pointer;
}

.sidebar-close:hover {
  color: #fff;
  background: rgba(255, 255, 255, .1);
}

.nav-list {
  display: flex;
  flex-direction: column;
  gap: 5px;
  padding: 2px 0;
}

.nav-item {
  position: relative;
  display: flex;
  align-items: center;
  gap: 12px;
  min-height: 46px;
  padding: 0 13px;
  border-radius: 12px;
  color: #a8beb7;
  font-size: 13.5px;
  font-weight: 500;
  transition: background .2s var(--ease), color .2s var(--ease), transform .2s var(--ease);
}

.nav-item .icon {
  width: 19px;
  height: 19px;
  color: #7e9991;
  transition: color .2s var(--ease);
}

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

.nav-item.is-active {
  color: #fff;
  background: linear-gradient(100deg, rgba(35, 148, 130, .31), rgba(255, 255, 255, .065));
  box-shadow: inset 0 0 0 1px rgba(149, 230, 212, .12);
}

.nav-item.is-active .icon {
  color: #7ed8c9;
}

.nav-indicator {
  width: 5px;
  height: 5px;
  margin-left: auto;
  border-radius: 99px;
  background: transparent;
  box-shadow: none;
  transition: background .2s var(--ease), box-shadow .2s var(--ease);
}

.nav-item.is-active .nav-indicator {
  background: #75d6c5;
  box-shadow: 0 0 0 4px rgba(117, 214, 197, .1);
}

.side-note {
  padding: 15px 14px 13px;
  border: 1px solid rgba(217, 245, 236, .1);
  border-radius: 16px;
  background: rgba(255, 255, 255, .045);
}

.side-note-head {
  display: flex;
  align-items: center;
  gap: 7px;
  color: #e8f6f1;
  font-size: 12.5px;
}

.side-note-head strong {
  font-weight: 600;
}

.demo-dot {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: #5dcbb8;
  box-shadow: 0 0 0 4px rgba(93, 203, 184, .12);
}

.mini-tag {
  margin-left: auto;
  padding: 1px 7px;
  border: 1px solid rgba(255, 255, 255, .11);
  border-radius: 99px;
  color: #9cb7af;
  font-size: 9.5px;
  letter-spacing: .08em;
}

.side-note p {
  margin: 9px 0 11px;
  color: #849d96;
  font-size: 11.5px;
  line-height: 1.75;
}

.side-reset {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 0;
  border: 0;
  color: #b8d9d0;
  background: transparent;
  font-size: 11.5px;
  cursor: pointer;
  transition: color .2s var(--ease);
}

.side-reset:hover {
  color: #fff;
}

.side-profile {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-top: 15px;
  padding: 8px 7px 0;
}

.avatar {
  display: grid;
  place-items: center;
  width: 35px;
  height: 35px;
  flex: none;
  border: 1px solid rgba(255, 255, 255, .1);
  border-radius: 50%;
  color: #d7f1e9;
  background: rgba(255, 255, 255, .08);
  font-size: 12px;
  font-weight: 600;
}

.profile-copy {
  display: flex;
  flex-direction: column;
  min-width: 0;
  line-height: 1.35;
}

.profile-copy strong {
  color: #dceee8;
  font-size: 12.5px;
  font-weight: 500;
}

.profile-copy small {
  color: #718a83;
  font-size: 10.5px;
}

.online-dot {
  width: 7px;
  height: 7px;
  margin-left: auto;
  border-radius: 50%;
  background: #65d4a3;
}

.sidebar-scrim {
  position: fixed;
  inset: 0;
  z-index: 55;
  background: rgba(7, 24, 19, .45);
  backdrop-filter: blur(3px);
  opacity: 0;
  visibility: hidden;
  transition: opacity .25s var(--ease), visibility .25s var(--ease);
}

.main-column {
  min-height: 100vh;
  margin-left: var(--sidebar-w);
}

/* =========================================================
   Topbar
   ========================================================= */

.topbar {
  position: sticky;
  top: 0;
  z-index: 35;
  display: flex;
  align-items: center;
  gap: 18px;
  min-height: 86px;
  padding: 14px 34px;
  border-bottom: 1px solid rgba(210, 224, 217, .7);
  background: rgba(243, 246, 244, .84);
  backdrop-filter: blur(18px) saturate(130%);
}

.menu-toggle {
  display: none;
}

.topbar .menu-toggle {
  display: none;
}

.topbar-heading {
  display: flex;
  flex-direction: column;
  min-width: 0;
  line-height: 1.25;
}

.eyebrow {
  color: var(--muted-2);
  font-size: 9.5px;
  font-weight: 600;
  letter-spacing: .16em;
  text-transform: uppercase;
}

.topbar-heading h1 {
  margin: 4px 0 0;
  color: var(--ink);
  font-size: 20px;
  font-weight: 650;
  letter-spacing: -.02em;
}

.topbar-actions {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-left: auto;
}

.date-pill {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  min-height: 38px;
  padding: 0 12px;
  border: 1px solid var(--line);
  border-radius: 11px;
  color: var(--muted);
  background: rgba(255, 255, 255, .7);
  font-size: 11.5px;
  white-space: nowrap;
}

.date-pill .icon {
  color: var(--primary);
}

/* =========================================================
   Buttons / tags / inputs
   ========================================================= */

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 7px;
  min-height: 41px;
  padding: 0 15px;
  border: 1px solid transparent;
  border-radius: 11px;
  font-size: 12.5px;
  font-weight: 550;
  line-height: 1;
  white-space: nowrap;
  cursor: pointer;
  transition: background .2s var(--ease), border-color .2s var(--ease), color .2s var(--ease), transform .2s var(--ease), box-shadow .2s var(--ease);
}

.btn:active {
  transform: translateY(1px);
}

.btn-primary {
  color: #fff;
  background: var(--primary);
  border-color: var(--primary);
  box-shadow: 0 9px 18px -13px rgba(15, 118, 110, .72);
}

.btn-primary:hover {
  background: var(--primary-dark);
  border-color: var(--primary-dark);
}

.btn-secondary {
  color: var(--ink-soft);
  background: var(--surface);
  border-color: var(--line-strong);
}

.btn-secondary:hover {
  color: var(--primary-dark);
  border-color: #a8c7be;
  background: #fbfdfc;
}

.btn-ghost {
  color: var(--muted);
  background: transparent;
  border-color: transparent;
}

.btn-ghost:hover {
  background: var(--surface-3);
  color: var(--ink);
}

.btn-danger {
  color: #fff;
  background: var(--danger);
  border-color: var(--danger);
}

.btn-danger:hover {
  background: #a7352f;
}

.btn-compact {
  min-height: 38px;
  padding: 0 13px;
  font-size: 12px;
}

.btn-block {
  width: 100%;
  min-height: 44px;
}

.btn[disabled] {
  opacity: .52;
  cursor: not-allowed;
  pointer-events: none;
}

.icon-btn {
  display: inline-grid;
  place-items: center;
  width: 38px;
  height: 38px;
  padding: 0;
  border: 1px solid var(--line);
  border-radius: 10px;
  color: var(--muted);
  background: rgba(255, 255, 255, .8);
  cursor: pointer;
  transition: color .2s var(--ease), background .2s var(--ease), border-color .2s var(--ease);
}

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

.text-link {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  color: var(--primary);
  font-size: 11.5px;
  font-weight: 550;
  white-space: nowrap;
  transition: color .2s var(--ease), gap .2s var(--ease);
}

.text-link:hover {
  color: var(--primary-dark);
  gap: 6px;
}

.tag {
  display: inline-flex;
  align-items: center;
  min-height: 21px;
  padding: 1px 8px;
  border: 1px solid transparent;
  border-radius: 99px;
  font-size: 10px;
  font-weight: 550;
  letter-spacing: .02em;
  white-space: nowrap;
}

.tag-demo {
  color: #7b541c;
  background: var(--accent-soft);
  border-color: #f4dfbc;
}

.tag-soft {
  color: var(--muted);
  background: var(--surface-2);
  border-color: var(--line);
}

.tag-success {
  color: var(--success);
  background: var(--success-soft);
  border-color: #d3eedd;
}

.eyebrow-row {
  display: flex;
  align-items: center;
  gap: 9px;
  margin-bottom: 8px;
}

/* =========================================================
   Page content
   ========================================================= */

.main-content {
  width: 100%;
  max-width: 1580px;
  margin: 0 auto;
  padding: 30px 34px 70px;
}

.view {
  animation: viewIn .3s var(--ease) both;
}

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

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

.view-heading h2 {
  margin: 0;
  color: var(--ink);
  font-size: 29px;
  font-weight: 650;
  line-height: 1.2;
  letter-spacing: -.035em;
}

.view-heading p {
  max-width: 660px;
  margin: 8px 0 0;
  color: var(--muted);
  font-size: 12.5px;
}

.view-actions {
  display: flex;
  align-items: center;
  gap: 9px;
  flex-wrap: wrap;
}

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

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

.card-head h3 {
  margin: 0;
  color: var(--ink);
  font-size: 15.5px;
  font-weight: 600;
  letter-spacing: -.015em;
}

.card-head p {
  margin: 4px 0 0;
  color: var(--muted-2);
  font-size: 11.5px;
}

.card-kicker {
  padding-top: 1px;
  color: var(--muted-2);
  font-size: 9px;
  font-weight: 600;
  letter-spacing: .13em;
}

/* =========================================================
   Metrics
   ========================================================= */

.metric-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 15px;
  margin-bottom: 20px;
}

.metric-card {
  position: relative;
  min-width: 0;
  padding: 18px 19px 16px;
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--surface);
  box-shadow: var(--shadow-card);
  transition: transform .22s var(--ease), border-color .22s var(--ease), box-shadow .22s var(--ease);
}

.metric-card::after {
  content: "";
  position: absolute;
  right: -25px;
  bottom: -38px;
  width: 110px;
  height: 110px;
  border: 1px solid rgba(15, 118, 110, .055);
  border-radius: 50%;
  pointer-events: none;
}

.metric-card:hover {
  transform: translateY(-2px);
  border-color: var(--line-strong);
  box-shadow: 0 18px 45px -32px rgba(10, 57, 44, .28);
}

.metric-top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  margin-bottom: 14px;
}

.metric-label {
  color: var(--muted);
  font-size: 11.5px;
  font-weight: 500;
}

.metric-icon {
  display: grid;
  place-items: center;
  width: 34px;
  height: 34px;
  border-radius: 11px;
  color: var(--primary);
  background: var(--primary-soft);
}

.metric-icon .icon {
  width: 17px;
  height: 17px;
}

.metric-card[data-tone="amber"] .metric-icon {
  color: var(--accent);
  background: var(--accent-soft);
}

.metric-card[data-tone="blue"] .metric-icon {
  color: var(--blue);
  background: var(--blue-soft);
}

.metric-card[data-tone="violet"] .metric-icon {
  color: var(--violet);
  background: var(--violet-soft);
}

.metric-value {
  color: var(--ink);
  font-size: clamp(23px, 2vw, 29px);
  font-weight: 680;
  line-height: 1.16;
  letter-spacing: -.045em;
  white-space: nowrap;
}

.metric-foot {
  display: flex;
  align-items: center;
  gap: 7px;
  flex-wrap: wrap;
  min-height: 20px;
  margin-top: 9px;
  color: var(--muted-2);
  font-size: 10.5px;
}

.trend-chip {
  display: inline-flex;
  align-items: center;
  gap: 2px;
  padding: 1px 6px;
  border-radius: 99px;
  font-size: 9.5px;
  font-weight: 600;
}

.trend-chip.up {
  color: var(--success);
  background: var(--success-soft);
}

.trend-chip.down {
  color: var(--danger);
  background: var(--danger-soft);
}

.trend-chip.flat {
  color: var(--muted);
  background: var(--surface-3);
}

/* =========================================================
   Dashboard grid
   ========================================================= */

.dashboard-grid {
  display: grid;
  grid-template-columns: repeat(12, minmax(0, 1fr));
  gap: 20px;
}

.span-4 { grid-column: span 4; }
.span-5 { grid-column: span 5; }
.span-7 { grid-column: span 7; }
.span-8 { grid-column: span 8; }
.span-12 { grid-column: span 12; }

.chart-card {
  padding-bottom: 16px;
}

.chart-wrap {
  position: relative;
  min-height: 254px;
  padding-top: 2px;
}

.trend-summary {
  display: flex;
  align-items: stretch;
  margin: 6px 2px 0;
  padding-top: 13px;
  border-top: 1px solid var(--line);
}

.trend-summary-item {
  flex: 1;
  min-width: 0;
  padding: 0 13px;
  border-right: 1px solid var(--line);
}

.trend-summary-item:first-child {
  padding-left: 0;
}

.trend-summary-item:last-child {
  padding-right: 0;
  border-right: 0;
}

.trend-summary-item span {
  display: block;
  overflow: hidden;
  color: var(--muted-2);
  font-size: 9.5px;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.trend-summary-item strong {
  display: block;
  margin-top: 3px;
  color: var(--ink-soft);
  font-size: 15px;
  font-weight: 600;
  letter-spacing: -.025em;
  white-space: nowrap;
}

.chart-wrap-lg {
  min-height: 310px;
}

.chart-svg {
  display: block;
  width: 100%;
  height: auto;
  overflow: visible;
}

.chart-svg text {
  font-family: inherit;
}

.chart-svg .grid-line {
  stroke: #edf2ef;
  stroke-width: 1;
  stroke-dasharray: 3 5;
}

.chart-svg .axis-line {
  stroke: #e3eae6;
  stroke-width: 1;
}

.chart-svg .axis-label {
  fill: #91a39c;
  font-size: 10px;
  font-weight: 500;
}

.chart-svg .x-label {
  fill: #8a9c95;
  font-size: 10px;
  font-weight: 500;
}

.chart-svg .chart-line {
  fill: none;
  stroke-width: 2.4;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.chart-svg .chart-area {
  opacity: .85;
}

.chart-svg .chart-dot {
  fill: #fff;
  stroke-width: 2.2;
  pointer-events: none;
  transition: r .15s var(--ease), filter .15s var(--ease);
}

.chart-svg .chart-dot-hit {
  fill: transparent;
  cursor: crosshair;
}

.chart-svg .chart-bar {
  cursor: crosshair;
  transition: opacity .16s var(--ease), filter .16s var(--ease);
  animation: barRise .48s var(--ease) both;
  transform-box: fill-box;
  transform-origin: center bottom;
}

.chart-svg .chart-bar:hover {
  opacity: .84;
  filter: brightness(1.03);
}

.chart-svg .chart-bar.is-highlight {
  fill: var(--accent);
}

.chart-svg .chart-bar-label {
  fill: #8b9e96;
  font-size: 9px;
  font-weight: 500;
}

.chart-svg .today-marker {
  fill: var(--primary);
}

@keyframes barRise {
  from { transform: scaleY(.08); opacity: 0; }
  to { transform: scaleY(1); opacity: 1; }
}

.chart-tooltip {
  position: fixed;
  z-index: 300;
  max-width: 240px;
  padding: 7px 10px;
  border: 1px solid rgba(255, 255, 255, .08);
  border-radius: 8px;
  color: #f2fbf8;
  background: #0d2822;
  box-shadow: 0 12px 32px -18px rgba(0, 20, 15, .7);
  font-size: 11px;
  line-height: 1.45;
  pointer-events: none;
  white-space: nowrap;
}

.chart-empty {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  min-height: 220px;
  gap: 8px;
  color: var(--muted-2);
  text-align: center;
}

.chart-empty .empty-icon {
  display: grid;
  place-items: center;
  width: 42px;
  height: 42px;
  border-radius: 13px;
  color: var(--primary);
  background: var(--primary-soft);
}

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

.chart-empty span {
  font-size: 11px;
}

/* Donut */

.donut-layout {
  display: flex;
  flex-direction: column;
  gap: 17px;
  min-height: 248px;
}

.donut-chart-wrap {
  position: relative;
  width: 174px;
  height: 174px;
  margin: 2px auto 0;
}

.donut-chart {
  position: absolute;
  inset: 0;
  border-radius: 50%;
  transform: rotate(-90deg);
}

.donut-chart::after {
  content: "";
  position: absolute;
  inset: 26px;
  border-radius: 50%;
  background: var(--surface);
  box-shadow: inset 0 0 0 1px rgba(224, 235, 229, .7);
}

.donut-center {
  position: absolute;
  inset: 26px;
  z-index: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  border-radius: 50%;
  text-align: center;
}

.donut-center span {
  color: var(--muted-2);
  font-size: 9.5px;
}

.donut-center strong {
  margin-top: 3px;
  color: var(--ink);
  font-size: 18px;
  font-weight: 660;
  letter-spacing: -.04em;
}

.donut-legend {
  display: flex;
  flex-direction: column;
  gap: 7px;
  width: 100%;
}

.legend-row {
  display: grid;
  grid-template-columns: 8px minmax(0, 1fr) auto;
  align-items: center;
  gap: 8px;
  min-height: 22px;
  color: var(--muted);
  font-size: 10.5px;
}

.legend-dot {
  width: 7px;
  height: 7px;
  border-radius: 50%;
}

.legend-name {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.legend-value {
  color: var(--ink-soft);
  font-size: 10.5px;
  font-weight: 550;
}

/* Low stock */

.stock-list {
  display: flex;
  flex-direction: column;
}

.stock-item {
  display: flex;
  align-items: center;
  gap: 11px;
  padding: 12px 0;
  border-bottom: 1px dashed var(--line);
}

.stock-item:first-child {
  padding-top: 3px;
}

.stock-item:last-child {
  border-bottom: 0;
  padding-bottom: 0;
}

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

.stock-copy strong {
  display: block;
  overflow: hidden;
  color: var(--ink-soft);
  font-size: 11.5px;
  font-weight: 550;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.stock-copy span {
  display: block;
  margin-top: 2px;
  color: var(--muted-2);
  font-size: 10px;
}

.stock-badge {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 3px 7px;
  border-radius: 7px;
  color: var(--danger);
  background: var(--danger-soft);
  font-size: 9.5px;
  font-weight: 600;
  white-space: nowrap;
}

.stock-badge.is-warning {
  color: #9a651c;
  background: var(--accent-soft);
}

.stock-restock {
  padding: 4px 7px;
  border: 1px solid var(--line);
  border-radius: 7px;
  color: var(--muted);
  background: #fff;
  font-size: 9.5px;
  cursor: pointer;
  transition: border-color .2s var(--ease), color .2s var(--ease);
}

.stock-restock:hover {
  color: var(--primary);
  border-color: #b1d1c8;
}

/* =========================================================
   Product thumb / tables
   ========================================================= */

.product-avatar,
.mini-avatar {
  display: grid;
  place-items: center;
  flex: none;
  width: 36px;
  height: 36px;
  border-radius: 10px;
  font-size: 11px;
  font-weight: 650;
  letter-spacing: .01em;
}

.product-avatar {
  width: 37px;
  height: 37px;
}

.mini-avatar {
  width: 32px;
  height: 32px;
  border-radius: 9px;
  font-size: 10.5px;
}

.table-wrap {
  width: 100%;
  overflow-x: auto;
  border-radius: 12px;
}

.data-table {
  width: 100%;
  border-collapse: collapse;
  text-align: left;
}

.data-table th {
  padding: 10px 12px;
  border-top: 1px solid var(--line);
  border-bottom: 1px solid var(--line);
  color: var(--muted-2);
  background: #fafcfb;
  font-size: 9.5px;
  font-weight: 600;
  letter-spacing: .045em;
  white-space: nowrap;
}

.data-table th:first-child {
  border-left: 1px solid var(--line);
  border-radius: 10px 0 0 10px;
  padding-left: 14px;
}

.data-table th:last-child {
  border-right: 1px solid var(--line);
  border-radius: 0 10px 10px 0;
  padding-right: 14px;
}

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

.data-table td:first-child {
  padding-left: 14px;
}

.data-table td:last-child {
  padding-right: 14px;
}

.data-table tbody tr {
  transition: background .15s var(--ease);
}

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

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

.cell-product {
  display: flex;
  align-items: center;
  gap: 10px;
  min-width: 175px;
}

.cell-main {
  display: block;
  max-width: 290px;
  overflow: hidden;
  color: var(--ink-soft);
  font-size: 11.8px;
  font-weight: 550;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.cell-sub {
  display: block;
  margin-top: 2px;
  color: var(--muted-2);
  font-size: 9.8px;
  white-space: nowrap;
}

.num {
  font-variant-numeric: tabular-nums;
  white-space: nowrap;
}

.money {
  color: var(--ink);
  font-weight: 550;
}

.profit {
  color: var(--success);
  font-weight: 600;
}

.loss {
  color: var(--danger);
}

.muted-cell {
  color: var(--muted-2);
}

.stock-state {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  min-height: 21px;
  padding: 1px 7px;
  border-radius: 99px;
  font-size: 9.5px;
  font-weight: 550;
  white-space: nowrap;
}

.stock-state.in-stock {
  color: var(--success);
  background: var(--success-soft);
}

.stock-state.low {
  color: #9a651c;
  background: var(--accent-soft);
}

.stock-state.out {
  color: var(--danger);
  background: var(--danger-soft);
}

.stock-state .dot {
  width: 4px;
  height: 4px;
  border-radius: 50%;
  background: currentColor;
}

.table-actions {
  display: flex;
  align-items: center;
  gap: 4px;
  white-space: nowrap;
}

.link-btn {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  min-height: 27px;
  padding: 0 6px;
  border: 0;
  border-radius: 6px;
  color: var(--muted);
  background: transparent;
  font-size: 10.5px;
  cursor: pointer;
  transition: color .2s var(--ease), background .2s var(--ease);
}

.link-btn:hover {
  color: var(--primary);
  background: var(--primary-soft);
}

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

.link-btn .icon {
  width: 13px;
  height: 13px;
}

/* =========================================================
   Product page
   ========================================================= */

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

.mini-stat {
  padding: 15px 17px;
  border: 1px solid var(--line);
  border-radius: 15px;
  background: rgba(255, 255, 255, .72);
}

.mini-stat span {
  display: block;
  color: var(--muted);
  font-size: 10.5px;
}

.mini-stat strong {
  display: block;
  margin-top: 3px;
  color: var(--ink);
  font-size: 21px;
  font-weight: 650;
  line-height: 1.25;
  letter-spacing: -.04em;
}

.mini-stat small {
  color: var(--muted-2);
  font-size: 9.5px;
}

.table-card {
  padding: 20px 22px 14px;
}

.toolbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  flex-wrap: wrap;
  margin-bottom: 14px;
}

.toolbar-tight {
  margin-top: 2px;
}

.toolbar-right {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-left: auto;
}

.search-field {
  position: relative;
  display: flex;
  align-items: center;
  width: min(330px, 100%);
}

.search-field .icon {
  position: absolute;
  left: 12px;
  z-index: 1;
  width: 16px;
  height: 16px;
  color: var(--muted-2);
  pointer-events: none;
}

.search-field input {
  width: 100%;
  height: 39px;
  padding: 0 12px 0 36px;
  border: 1px solid var(--line);
  border-radius: 10px;
  color: var(--ink);
  background: var(--surface-2);
  font-size: 12px;
  outline: none;
  transition: border-color .2s var(--ease), background .2s var(--ease), box-shadow .2s var(--ease);
}

.search-field input::placeholder {
  color: #9caaa5;
}

.search-field input:focus {
  border-color: #a6ccc1;
  background: #fff;
  box-shadow: 0 0 0 3px rgba(15, 118, 110, .075);
}

.compact-select,
.select-control {
  position: relative;
  display: flex;
  align-items: center;
}

.compact-select select {
  height: 39px;
  padding: 0 32px 0 12px;
  border: 1px solid var(--line);
  border-radius: 10px;
  color: var(--muted);
  background: var(--surface-2);
  font-size: 11.5px;
  outline: none;
  cursor: pointer;
  appearance: none;
  transition: border-color .2s var(--ease), background .2s var(--ease);
}

.compact-select select:focus {
  border-color: #a6ccc1;
  background: #fff;
}

.compact-select .icon {
  position: absolute;
  right: 10px;
  color: var(--muted-2);
  pointer-events: none;
}

.result-count {
  color: var(--muted-2);
  font-size: 10.5px;
  white-space: nowrap;
}

.pager {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 8px;
  min-height: 34px;
  padding-top: 13px;
}

.pager-info {
  color: var(--muted-2);
  font-size: 10.5px;
}

.pager-btn {
  display: inline-grid;
  place-items: center;
  width: 29px;
  height: 29px;
  border: 1px solid var(--line);
  border-radius: 8px;
  color: var(--muted);
  background: #fff;
  cursor: pointer;
  transition: color .2s var(--ease), border-color .2s var(--ease);
}

.pager-btn:hover:not(:disabled) {
  color: var(--primary);
  border-color: #b9d7ce;
}

.pager-btn:disabled {
  opacity: .4;
  cursor: not-allowed;
}

/* =========================================================
   Sales
   ========================================================= */

.sales-layout {
  display: grid;
  grid-template-columns: minmax(320px, 378px) minmax(0, 1fr);
  gap: 20px;
  align-items: start;
}

.sale-entry-card {
  position: sticky;
  top: 106px;
  padding: 21px 21px 18px;
}

.sale-entry-card .card-head {
  margin-bottom: 19px;
}

.field {
  min-width: 0;
  margin-bottom: 15px;
}

.field > label {
  display: block;
  margin-bottom: 7px;
  color: var(--ink-soft);
  font-size: 11.5px;
  font-weight: 550;
}

.field input,
.field select {
  width: 100%;
  height: 43px;
  padding: 0 12px;
  border: 1px solid var(--line);
  border-radius: 10px;
  color: var(--ink);
  background: var(--surface-2);
  font-size: 12px;
  outline: none;
  transition: border-color .2s var(--ease), background .2s var(--ease), box-shadow .2s var(--ease);
}

.field select {
  padding-right: 34px;
  appearance: none;
  cursor: pointer;
}

.field input:focus,
.field select:focus {
  border-color: #a6ccc1;
  background: #fff;
  box-shadow: 0 0 0 3px rgba(15, 118, 110, .075);
}

.field input[type="date"]::-webkit-calendar-picker-indicator,
.field input[type="month"]::-webkit-calendar-picker-indicator {
  opacity: 0;
  position: absolute;
  inset: 0;
  width: auto;
  height: auto;
  cursor: pointer;
}

.select-control .icon {
  position: absolute;
  right: 11px;
  color: var(--muted-2);
  pointer-events: none;
}

.field-hint {
  min-height: 16px;
  margin-top: 6px;
  color: var(--muted-2);
  font-size: 10px;
}

.form-row {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 11px;
}

.stepper {
  display: grid;
  grid-template-columns: 38px minmax(0, 1fr) 38px;
  align-items: stretch;
  height: 43px;
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: var(--surface-2);
}

.stepper:focus-within {
  border-color: #a6ccc1;
  background: #fff;
  box-shadow: 0 0 0 3px rgba(15, 118, 110, .075);
}

.stepper-btn {
  display: grid;
  place-items: center;
  padding: 0;
  border: 0;
  color: var(--muted);
  background: transparent;
  cursor: pointer;
}

.stepper-btn:hover {
  color: var(--primary);
  background: var(--primary-soft);
}

.stepper input {
  height: 100%;
  padding: 0;
  border: 0;
  border-radius: 0;
  background: transparent;
  text-align: center;
  font-weight: 600;
  appearance: textfield;
  box-shadow: none !important;
}

.stepper input::-webkit-inner-spin-button,
.stepper input::-webkit-outer-spin-button {
  margin: 0;
  appearance: none;
}

.money-field {
  display: flex;
  align-items: center;
  height: 43px;
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: var(--surface-2);
  transition: border-color .2s var(--ease), background .2s var(--ease), box-shadow .2s var(--ease);
}

.money-field:focus-within {
  border-color: #a6ccc1;
  background: #fff;
  box-shadow: 0 0 0 3px rgba(15, 118, 110, .075);
}

.money-field > span {
  padding-left: 12px;
  color: var(--muted-2);
  font-size: 12px;
}

.money-field input {
  height: 100%;
  border: 0;
  background: transparent;
  box-shadow: none !important;
  padding-left: 5px;
  font-weight: 550;
}

.date-field {
  position: relative;
  display: flex;
  align-items: center;
}

.date-field input {
  padding-right: 36px;
}

.date-field > .icon {
  position: absolute;
  right: 12px;
  color: var(--muted-2);
  pointer-events: none;
}

.sale-preview {
  display: flex;
  align-items: stretch;
  gap: 14px;
  margin: 2px 0 14px;
  padding: 13px 14px;
  border: 1px solid #dcebe5;
  border-radius: 12px;
  background: linear-gradient(135deg, #f1f8f5, #fbfcfb);
}

.sale-preview-item {
  display: flex;
  flex: 1;
  flex-direction: column;
  gap: 3px;
  min-width: 0;
}

.sale-preview-item span {
  color: var(--muted);
  font-size: 9.5px;
}

.sale-preview-item strong {
  color: var(--ink);
  font-size: 19px;
  font-weight: 650;
  line-height: 1.2;
  letter-spacing: -.035em;
}

.sale-preview-item strong.profit-text {
  color: var(--success);
}

.sale-preview-divider {
  width: 1px;
  background: #dcebe5;
}

.form-error {
  margin: 0 0 12px;
  padding: 9px 11px;
  border: 1px solid #f1d4d1;
  border-radius: 9px;
  color: var(--danger);
  background: var(--danger-soft);
  font-size: 10.5px;
  line-height: 1.5;
}

.sale-note {
  margin: 11px 0 0;
  color: var(--muted-2);
  font-size: 10px;
  line-height: 1.6;
  text-align: center;
}

.sales-history-card {
  min-height: 500px;
}

.sales-history-card .card-head {
  margin-bottom: 15px;
}

/* =========================================================
   Reports
   ========================================================= */

.report-toolbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  flex-wrap: wrap;
  margin-bottom: 20px;
  padding: 13px 16px;
  border-radius: 16px;
}

.segmented {
  display: inline-flex;
  align-items: center;
  gap: 3px;
  padding: 3px;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: var(--surface-2);
}

.segmented button {
  min-height: 32px;
  padding: 0 14px;
  border: 0;
  border-radius: 8px;
  color: var(--muted);
  background: transparent;
  font-size: 11.5px;
  font-weight: 500;
  cursor: pointer;
  transition: color .2s var(--ease), background .2s var(--ease), box-shadow .2s var(--ease);
}

.segmented button:hover {
  color: var(--ink-soft);
}

.segmented button.is-active {
  color: var(--ink);
  background: #fff;
  box-shadow: 0 2px 6px rgba(18, 52, 41, .07), inset 0 0 0 1px rgba(215, 228, 221, .7);
}

.segmented-sm {
  padding: 3px;
}

.segmented-sm button {
  min-height: 27px;
  padding: 0 10px;
  font-size: 10.5px;
}

.report-controls {
  display: flex;
  align-items: flex-end;
  gap: 11px;
  flex-wrap: wrap;
}

.control-field {
  display: flex;
  align-items: center;
  gap: 8px;
  color: var(--muted-2);
  font-size: 10px;
  white-space: nowrap;
}

.control-field > input,
.control-field .compact-select select {
  height: 37px;
  min-width: 136px;
  padding: 0 11px;
  border: 1px solid var(--line);
  border-radius: 9px;
  color: var(--ink-soft);
  background: var(--surface-2);
  font-size: 11.5px;
  outline: none;
}

.control-field > input:focus {
  border-color: #a6ccc1;
  background: #fff;
}

.control-field > input[type="month"] {
  position: relative;
}

.report-metrics {
  margin-bottom: 20px;
}

.report-chart-card {
  margin-bottom: 20px;
}

.report-chart-card .card-head {
  margin-bottom: 10px;
}

.report-table-card {
  margin-bottom: 0;
}

/* =========================================================
   Empty state
   ========================================================= */

.empty-state {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  min-height: 230px;
  padding: 28px 20px;
  color: var(--muted-2);
  text-align: center;
}

.empty-state.compact {
  min-height: 160px;
  padding: 20px 12px;
}

.empty-icon {
  display: grid;
  place-items: center;
  width: 44px;
  height: 44px;
  margin-bottom: 10px;
  border: 1px solid #dcebe5;
  border-radius: 14px;
  color: var(--primary);
  background: var(--primary-soft);
}

.empty-icon .icon {
  width: 20px;
  height: 20px;
}

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

.empty-state p {
  max-width: 280px;
  margin: 5px 0 13px;
  font-size: 10.5px;
  line-height: 1.7;
}

.empty-state .btn {
  min-height: 35px;
  font-size: 11px;
}

/* =========================================================
   Modal
   ========================================================= */

.modal-backdrop {
  position: fixed;
  inset: 0;
  z-index: 150;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 22px;
  background: rgba(7, 25, 19, .43);
  backdrop-filter: blur(5px);
  animation: backdropIn .2s var(--ease) both;
}

.modal-backdrop.is-closing {
  animation: backdropOut .18s var(--ease) both;
}

.modal {
  width: min(620px, 100%);
  max-height: calc(100vh - 44px);
  overflow-y: auto;
  border: 1px solid rgba(255, 255, 255, .65);
  border-radius: 22px;
  background: var(--surface);
  box-shadow: var(--shadow-float);
  animation: modalIn .25s var(--ease) both;
}

.modal.modal-sm {
  width: min(420px, 100%);
}

.modal-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 16px;
  padding: 24px 25px 0;
}

.modal-head h2 {
  margin: 0;
  color: var(--ink);
  font-size: 21px;
  font-weight: 650;
  letter-spacing: -.035em;
}

.modal-head p {
  margin: 5px 0 0;
  color: var(--muted);
  font-size: 11.5px;
}

.modal-close {
  display: grid;
  place-items: center;
  width: 32px;
  height: 32px;
  flex: none;
  padding: 0;
  border: 1px solid var(--line);
  border-radius: 9px;
  color: var(--muted);
  background: var(--surface-2);
  cursor: pointer;
  transition: color .2s var(--ease), border-color .2s var(--ease), background .2s var(--ease);
}

.modal-close:hover {
  color: var(--ink);
  border-color: var(--line-strong);
  background: #fff;
}

.modal-body {
  padding: 21px 25px 24px;
}

.modal-form-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 0 14px;
}

.modal-form-grid .field.full {
  grid-column: 1 / -1;
}

.field-error {
  min-height: 15px;
  margin-top: 5px;
  color: var(--danger);
  font-size: 10px;
}

.field.has-error input,
.field.has-error select {
  border-color: #e3b7b3;
  background: #fffafa;
}

.margin-preview {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  margin: 2px 0 17px;
  padding: 12px 14px;
  border: 1px solid #e2eee9;
  border-radius: 11px;
  background: var(--surface-2);
}

.margin-preview span {
  color: var(--muted);
  font-size: 10.5px;
}

.margin-preview strong {
  color: var(--success);
  font-size: 17px;
  font-weight: 650;
  letter-spacing: -.03em;
}

.margin-preview small {
  margin-left: 7px;
  color: var(--muted-2);
  font-size: 9.5px;
}

.margin-preview.is-negative strong {
  color: var(--danger);
}

.modal-actions {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 9px;
  flex-wrap: wrap;
  margin-top: 6px;
}

.confirm-content {
  display: flex;
  gap: 14px;
  align-items: flex-start;
  padding: 7px 0 2px;
}

.confirm-icon {
  display: grid;
  place-items: center;
  width: 42px;
  height: 42px;
  flex: none;
  border-radius: 13px;
  color: var(--danger);
  background: var(--danger-soft);
}

.confirm-icon.neutral {
  color: var(--primary);
  background: var(--primary-soft);
}

.confirm-icon .icon {
  width: 20px;
  height: 20px;
}

.confirm-copy strong {
  display: block;
  color: var(--ink);
  font-size: 12.5px;
  font-weight: 600;
}

.confirm-copy p {
  margin: 5px 0 0;
  color: var(--muted);
  font-size: 11px;
  line-height: 1.7;
}

.confirm-actions {
  display: flex;
  justify-content: flex-end;
  gap: 9px;
  margin-top: 22px;
}

@keyframes backdropIn {
  from { opacity: 0; }
  to { opacity: 1; }
}

@keyframes backdropOut {
  from { opacity: 1; }
  to { opacity: 0; }
}

@keyframes modalIn {
  from { opacity: 0; transform: translateY(14px) scale(.985); }
  to { opacity: 1; transform: translateY(0) scale(1); }
}

/* =========================================================
   Toasts
   ========================================================= */

.toast-stack {
  position: fixed;
  right: 24px;
  bottom: 24px;
  z-index: 300;
  display: flex;
  flex-direction: column;
  gap: 9px;
  width: min(350px, calc(100vw - 32px));
  pointer-events: none;
}

.toast {
  display: flex;
  align-items: flex-start;
  gap: 9px;
  padding: 11px 13px;
  border: 1px solid rgba(255, 255, 255, .08);
  border-radius: 12px;
  color: #eefaf6;
  background: #0e2821;
  box-shadow: 0 18px 42px -24px rgba(0, 25, 17, .7);
  font-size: 11.5px;
  line-height: 1.55;
  animation: toastIn .28s var(--ease) both;
  pointer-events: auto;
}

.toast.is-leaving {
  animation: toastOut .2s var(--ease) both;
}

.toast-icon {
  display: grid;
  place-items: center;
  width: 20px;
  height: 20px;
  flex: none;
  margin-top: 1px;
  border-radius: 50%;
  color: #fff;
  background: #1c9b79;
}

.toast.error .toast-icon {
  background: #c14e47;
}

.toast-icon .icon {
  width: 13px;
  height: 13px;
}

@keyframes toastIn {
  from { opacity: 0; transform: translateY(9px) scale(.98); }
  to { opacity: 1; transform: translateY(0) scale(1); }
}

@keyframes toastOut {
  to { opacity: 0; transform: translateY(6px) scale(.98); }
}

/* =========================================================
   Responsive
   ========================================================= */

@media (max-width: 1260px) {
  :root {
    --sidebar-w: 238px;
  }

  .main-content,
  .topbar {
    padding-left: 27px;
    padding-right: 27px;
  }

  .view-heading h2 {
    font-size: 27px;
  }

  .metric-value {
    font-size: 25px;
  }

  .card {
    padding: 20px;
  }
}

@media (max-width: 1080px) {
  .sidebar {
    transform: translateX(-102%);
    transition: transform .28s var(--ease);
    box-shadow: 24px 0 70px -40px rgba(0, 20, 14, .6);
  }

  body.sidebar-open .sidebar {
    transform: translateX(0);
  }

  body.sidebar-open .sidebar-scrim {
    opacity: 1;
    visibility: visible;
  }

  .main-column {
    margin-left: 0;
  }

  .menu-toggle {
    display: none;
  }

  .topbar .menu-toggle {
    display: inline-grid;
    flex: none;
  }

  .sidebar-close {
    display: grid;
  }

  .topbar {
    gap: 13px;
  }

  .topbar-heading {
    flex: 1;
  }

  .topbar-actions {
    flex: none;
  }

  .main-content {
    padding-top: 25px;
  }

  .sales-layout {
    grid-template-columns: minmax(300px, 350px) minmax(0, 1fr);
  }

  .sale-entry-card {
    top: 100px;
  }
}

@media (max-width: 900px) {
  .metric-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .metric-card {
    padding: 16px 17px 14px;
  }

  .dashboard-grid {
    gap: 16px;
  }

  .span-4,
  .span-5,
  .span-7,
  .span-8 {
    grid-column: span 12;
  }

  .sales-layout {
    grid-template-columns: 1fr;
  }

  .sale-entry-card {
    position: static;
  }

  .sales-history-card {
    min-height: 0;
  }

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

  .view-heading {
    align-items: flex-start;
    flex-direction: column;
    gap: 15px;
  }

  .view-actions {
    width: 100%;
  }

  .view-actions .btn {
    flex: 1;
  }
}

@media (max-width: 700px) {
  .topbar {
    min-height: 74px;
    padding: 12px 17px;
  }

  .topbar .date-pill {
    display: none;
  }

  .topbar-heading h1 {
    font-size: 18px;
  }

  .topbar-heading .eyebrow {
    font-size: 8.5px;
  }

  .topbar-actions .btn {
    min-height: 36px;
    padding: 0 11px;
    font-size: 11px;
  }

  .main-content {
    padding: 21px 16px 52px;
  }

  .view-heading h2 {
    font-size: 24px;
  }

  .view-heading p {
    font-size: 11.5px;
    line-height: 1.7;
  }

  .card {
    padding: 17px;
    border-radius: 17px;
  }

  .chart-card {
    padding-bottom: 10px;
  }

  .card-head {
    gap: 10px;
    margin-bottom: 15px;
  }

  .card-head h3 {
    font-size: 14.5px;
  }

  .metric-grid {
    gap: 10px;
    margin-bottom: 15px;
  }

  .metric-card {
    padding: 14px 14px 13px;
    border-radius: 15px;
  }

  .metric-top {
    margin-bottom: 11px;
  }

  .metric-label {
    font-size: 10.5px;
  }

  .metric-icon {
    width: 29px;
    height: 29px;
    border-radius: 9px;
  }

  .metric-icon .icon {
    width: 15px;
    height: 15px;
  }

  .metric-value {
    font-size: 21px;
  }

  .metric-foot {
    margin-top: 7px;
    font-size: 9.5px;
    line-height: 1.5;
  }

  .dashboard-grid {
    gap: 12px;
  }

  .chart-wrap {
    min-height: 210px;
  }

  .trend-summary {
    margin-top: 2px;
    padding-top: 11px;
  }

  .trend-summary-item {
    padding: 0 8px;
  }

  .trend-summary-item span {
    font-size: 8.5px;
  }

  .trend-summary-item strong {
    font-size: 13px;
  }

  .donut-layout {
    min-height: 0;
  }

  .donut-chart-wrap {
    width: 160px;
    height: 160px;
  }

  .donut-chart::after,
  .donut-center {
    inset: 24px;
  }

  .stock-item {
    padding: 10px 0;
  }

  .table-card {
    padding: 16px 16px 11px;
  }

  .toolbar {
    gap: 9px;
  }

  .search-field {
    width: 100%;
  }

  .toolbar-right {
    width: 100%;
    margin-left: 0;
    justify-content: space-between;
  }

  .mini-stat-grid {
    gap: 9px;
    margin-bottom: 14px;
  }

  .mini-stat {
    padding: 12px 13px;
  }

  .mini-stat strong {
    font-size: 18px;
  }

  .report-toolbar {
    align-items: stretch;
    gap: 12px;
  }

  .report-controls {
    justify-content: space-between;
  }

  .control-field {
    flex: 1;
  }

  .control-field > input,
  .control-field .compact-select,
  .control-field .compact-select select {
    width: 100%;
  }

  .report-controls .btn {
    width: 100%;
  }

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

  .modal {
    width: 100%;
    max-height: calc(100vh - 16px);
    border-radius: 20px 20px 0 0;
    animation-name: modalMobileIn;
  }

  .modal.modal-sm {
    width: 100%;
  }

  .modal-head {
    padding: 20px 18px 0;
  }

  .modal-body {
    padding: 17px 18px 24px;
  }

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

  .modal-form-grid .field.full {
    grid-column: auto;
  }

  .toast-stack {
    right: 16px;
    bottom: 16px;
  }

  .data-table {
    min-width: 680px;
  }

  .data-table.recent-table {
    min-width: 610px;
  }

  .sales-history-card .data-table {
    min-width: 650px;
  }

  .report-table {
    min-width: 760px;
  }

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

  .form-row .field {
    margin-bottom: 14px;
  }

  @keyframes modalMobileIn {
    from { opacity: 0; transform: translateY(30px); }
    to { opacity: 1; transform: translateY(0); }
  }
}

@media (max-width: 460px) {
  .topbar-actions .btn {
    font-size: 0;
    width: 37px;
    padding: 0;
  }

  .topbar-actions .btn .icon {
    width: 17px;
    height: 17px;
  }

  .metric-value {
    font-size: 19px;
  }

  .metric-icon {
    width: 26px;
    height: 26px;
  }

  .metric-card .metric-foot {
    min-height: 0;
  }

  .view-heading h2 {
    font-size: 23px;
  }

  .segmented button {
    padding: 0 11px;
  }

  .report-controls {
    gap: 8px;
  }

  .control-field {
    gap: 5px;
  }

  .control-field > span {
    display: none;
  }

  .sale-preview {
    gap: 9px;
    padding: 11px;
  }

  .sale-preview-item strong {
    font-size: 17px;
  }

  .modal-head h2 {
    font-size: 19px;
  }
}

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