:root {
  --ink: #26312d;
  --ink-soft: #66716c;
  --paper: #f3f1ea;
  --surface: #fffefa;
  --forest: #244a3e;
  --forest-deep: #20332d;
  --forest-soft: #e6eee9;
  --clay: #a85c3a;
  --clay-soft: #f6e9e2;
  --gold: #b39452;
  --gold-soft: #f4eddd;
  --red: #a5453d;
  --red-soft: #f8e8e5;
  --line: #ded9d0;
  --line-soft: #ebe7df;
  --shadow: 0 12px 30px rgba(40, 48, 44, 0.055);
  --radius: 8px;
}

* {
  box-sizing: border-box;
}

[hidden] {
  display: none !important;
}

html {
  min-width: 320px;
  background: var(--paper);
}

body {
  margin: 0;
  min-height: 100vh;
  color: var(--ink);
  background: var(--paper);
  font-family: "Microsoft YaHei", "PingFang SC", "Noto Sans SC", sans-serif;
  font-size: 14px;
  line-height: 1.55;
  -webkit-font-smoothing: antialiased;
}

button,
input,
select,
textarea {
  font: inherit;
}

button {
  color: inherit;
}

button,
select {
  cursor: pointer;
}

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

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

h1,
h2,
h3,
p {
  margin-top: 0;
}

h1 {
  margin-bottom: 0;
  font-family: "STSong", "SimSun", serif;
  font-size: 26px;
  font-weight: 600;
  letter-spacing: 0.02em;
}

h2 {
  margin-bottom: 0;
  font-size: 18px;
  font-weight: 600;
}

h3 {
  margin-bottom: 0;
  font-size: 15px;
}

.section-kicker {
  margin: 0 0 4px;
  color: #8b948f;
  font-size: 9px;
  font-weight: 700;
  letter-spacing: 0.16em;
}

.eyebrow {
  margin: 0 0 2px;
  color: var(--ink-soft);
  font-size: 10px;
  letter-spacing: 0.1em;
}

.btn {
  display: inline-flex;
  min-height: 38px;
  align-items: center;
  justify-content: center;
  gap: 7px;
  padding: 8px 15px;
  border: 1px solid transparent;
  border-radius: 5px;
  font-size: 12px;
  font-weight: 500;
  white-space: nowrap;
  transition: background 150ms ease, border-color 150ms ease, transform 150ms ease;
}

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

.btn:active {
  transform: translateY(0);
}

.btn svg {
  width: 15px;
  height: 15px;
}

.btn-primary {
  color: #fff;
  background: var(--forest);
  box-shadow: 0 4px 12px rgba(36, 74, 62, 0.14);
}

.btn-primary:hover {
  background: #1d3c32;
}

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

.btn-secondary:hover {
  border-color: #b8b1a6;
}

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

.btn-block {
  width: 100%;
}

.text-btn {
  padding: 2px;
  border: 0;
  color: var(--forest);
  background: transparent;
  font-size: 10px;
}

.text-btn:hover {
  text-decoration: underline;
}

.icon-btn {
  display: grid;
  width: 36px;
  height: 36px;
  padding: 0;
  place-items: center;
  border: 1px solid var(--line);
  border-radius: 5px;
  background: var(--surface);
}

.icon-btn:hover {
  border-color: #b8b1a6;
}

/* Login */
.auth-screen {
  display: grid;
  min-height: 100vh;
  grid-template-columns: minmax(460px, 1.08fr) minmax(420px, 0.92fr);
  background: #f7f4ed;
}

.auth-brand-panel {
  position: relative;
  display: flex;
  min-height: 100vh;
  overflow: hidden;
  flex-direction: column;
  padding: 42px clamp(36px, 5vw, 76px) 34px;
  color: #f3f0e8;
  background: var(--forest-deep);
}

.auth-brand-lockup {
  position: relative;
  z-index: 2;
  display: flex;
  align-items: center;
  gap: 12px;
}

.seal {
  display: grid;
  width: 40px;
  height: 40px;
  place-items: center;
  border: 1px solid rgba(241, 231, 207, 0.6);
  border-radius: 50%;
  color: #e2c887;
  font-family: "STSong", "SimSun", serif;
  font-size: 20px;
}

.auth-brand-lockup strong {
  display: block;
  font-family: "STSong", "SimSun", serif;
  font-size: 18px;
  font-weight: 600;
  letter-spacing: 0.11em;
}

.auth-brand-lockup span {
  display: block;
  margin-top: 1px;
  color: rgba(255, 255, 255, 0.45);
  font-size: 8px;
  letter-spacing: 0.22em;
}

.auth-message {
  position: relative;
  z-index: 2;
  margin-top: clamp(90px, 15vh, 170px);
}

.auth-kicker {
  margin-bottom: 22px;
  color: rgba(242, 229, 201, 0.52);
  font-size: 9px;
  font-weight: 600;
  letter-spacing: 0.2em;
}

.auth-message h1 {
  max-width: 610px;
  font-family: "STSong", "SimSun", serif;
  font-size: clamp(38px, 4.4vw, 66px);
  font-weight: 400;
  line-height: 1.25;
  letter-spacing: 0.035em;
}

.auth-message > p:last-child {
  max-width: 430px;
  margin-top: 26px;
  margin-bottom: 0;
  color: rgba(255, 255, 255, 0.55);
  font-size: 12px;
  line-height: 1.8;
}

.auth-composition {
  position: absolute;
  right: 0;
  bottom: 0;
  width: 61%;
  height: 58%;
  opacity: 0.9;
}

.auth-sun {
  position: absolute;
  right: 11%;
  top: 4%;
  width: min(15vw, 190px);
  height: min(15vw, 190px);
  border: 1px solid rgba(228, 203, 144, 0.28);
  border-radius: 50%;
}

.auth-sun::before,
.auth-sun::after {
  position: absolute;
  border: 1px solid rgba(228, 203, 144, 0.12);
  border-radius: 50%;
  content: "";
}

.auth-sun::before {
  inset: 18%;
}

.auth-sun::after {
  inset: 34%;
}

.auth-mountain {
  position: absolute;
  right: -12%;
  bottom: -8%;
  width: 108%;
  height: 75%;
  clip-path: polygon(0 100%, 19% 62%, 33% 76%, 50% 37%, 62% 58%, 78% 28%, 100% 66%, 100% 100%);
  background: #294139;
}

.mountain-two {
  right: -17%;
  bottom: -13%;
  width: 105%;
  transform: scale(0.87);
  background: #314c43;
}

.auth-grid-lines {
  position: absolute;
  inset: 16% 0 0 18%;
  opacity: 0.18;
  background-image:
    linear-gradient(to right, rgba(255, 255, 255, 0.12) 1px, transparent 1px),
    linear-gradient(to bottom, rgba(255, 255, 255, 0.12) 1px, transparent 1px);
  background-size: 54px 54px;
  mask-image: linear-gradient(to right, transparent, #000);
}

.auth-composition > span {
  position: absolute;
  right: 5%;
  top: 10%;
  color: rgba(255, 255, 255, 0.3);
  font-family: "Georgia", serif;
  font-size: 10px;
  letter-spacing: 0.16em;
}

.auth-copyright {
  position: relative;
  z-index: 2;
  margin: auto 0 0;
  color: rgba(255, 255, 255, 0.26);
  font-size: 8px;
  letter-spacing: 0.18em;
}

.auth-form-panel {
  display: grid;
  min-height: 100vh;
  place-items: center;
  padding: 45px clamp(28px, 6vw, 92px);
  background:
    linear-gradient(90deg, rgba(36, 74, 62, 0.035) 1px, transparent 1px),
    #f7f4ed;
  background-size: 78px 100%;
}

.login-card {
  width: min(100%, 390px);
  padding: 42px 38px 34px;
  border: 1px solid #e2ddd4;
  border-radius: 8px;
  background: rgba(255, 254, 250, 0.92);
  box-shadow: 0 22px 65px rgba(44, 51, 47, 0.08);
}

.login-heading {
  margin-bottom: 30px;
}

.login-heading h2 {
  margin-bottom: 8px;
  font-family: "STSong", "SimSun", serif;
  font-size: 29px;
  font-weight: 600;
}

.login-heading > p:last-child {
  margin-bottom: 0;
  color: var(--ink-soft);
  font-size: 11px;
  line-height: 1.7;
}

.login-card > .field {
  margin-bottom: 16px;
}

.login-submit {
  min-height: 44px;
  margin-top: 7px;
  justify-content: space-between;
  padding: 0 16px;
}

.login-submit svg {
  width: 17px;
  height: 17px;
}

.form-error {
  min-height: 18px;
  margin: 0 0 5px;
  color: var(--red);
  font-size: 10px;
}

.demo-account {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-top: 24px;
  padding: 10px 12px;
  border: 1px dashed #d8d1c6;
  border-radius: 5px;
  color: var(--ink-soft);
  background: #faf8f2;
  font-size: 9px;
}

.demo-account code {
  color: var(--forest);
  font-family: "Consolas", monospace;
  font-size: 10px;
}

.demo-account i {
  color: #aaa49b;
  font-style: normal;
}

.login-footnote {
  margin: 20px 0 0;
  color: #969c98;
  font-size: 9px;
  line-height: 1.7;
  text-align: center;
}

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

.sidebar {
  position: fixed;
  inset: 0 auto 0 0;
  z-index: 30;
  display: flex;
  width: 232px;
  flex-direction: column;
  padding: 28px 16px 18px;
  color: #f4f1e9;
  background: var(--forest-deep);
}

.brand {
  display: flex;
  align-items: center;
  gap: 11px;
  padding: 0 8px 29px;
}

.brand-mark {
  display: grid;
  width: 36px;
  height: 36px;
  flex: 0 0 auto;
  place-items: center;
  border: 1px solid rgba(255, 255, 255, 0.32);
  border-radius: 50%;
  color: #e3ca8b;
  font-family: "STSong", "SimSun", serif;
  font-size: 19px;
}

.brand strong {
  display: block;
  font-family: "STSong", "SimSun", serif;
  font-size: 17px;
  font-weight: 600;
  letter-spacing: 0.08em;
}

.brand span {
  display: block;
  margin-top: 1px;
  color: rgba(255, 255, 255, 0.4);
  font-size: 9px;
  letter-spacing: 0.08em;
}

.main-nav {
  display: flex;
  flex: 1;
  flex-direction: column;
  gap: 5px;
}

.nav-item {
  position: relative;
  display: flex;
  width: 100%;
  min-height: 42px;
  align-items: center;
  gap: 11px;
  padding: 0 12px;
  border: 0;
  border-radius: 5px;
  color: rgba(255, 255, 255, 0.58);
  background: transparent;
  font-size: 12px;
  text-align: left;
  transition: color 150ms, background 150ms;
}

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

.nav-item.is-active {
  color: #fff;
  background: rgba(255, 255, 255, 0.105);
}

.nav-item.is-active::before {
  position: absolute;
  left: 0;
  width: 2px;
  height: 19px;
  border-radius: 0 2px 2px 0;
  background: #ddbd79;
  content: "";
}

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

.nav-count {
  min-width: 21px;
  margin-left: auto;
  padding: 1px 6px;
  border-radius: 9px;
  color: rgba(255, 255, 255, 0.58);
  background: rgba(255, 255, 255, 0.075);
  font-size: 9px;
  text-align: center;
}

.nav-divider {
  height: 1px;
  margin: 12px 8px;
  background: rgba(255, 255, 255, 0.08);
}

.sidebar-footer {
  margin-top: 20px;
}

.current-user {
  display: flex;
  width: 100%;
  align-items: center;
  gap: 9px;
  padding: 10px 8px;
  border: 0;
  border-top: 1px solid rgba(255, 255, 255, 0.08);
  color: inherit;
  background: transparent;
  text-align: left;
}

.user-avatar {
  display: grid;
  width: 31px;
  height: 31px;
  flex: 0 0 auto;
  place-items: center;
  border-radius: 50%;
  color: #314e44;
  background: #e7d5a9;
  font-size: 12px;
  font-weight: 600;
}

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

.user-copy strong {
  display: block;
  overflow: hidden;
  color: rgba(255, 255, 255, 0.82);
  font-size: 11px;
  font-weight: 500;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.user-copy small {
  display: block;
  color: rgba(255, 255, 255, 0.35);
  font-size: 9px;
}

.current-user > svg {
  width: 14px;
  height: 14px;
  color: rgba(255, 255, 255, 0.32);
}

.sidebar-store {
  margin: 5px 8px 0;
  overflow: hidden;
  color: rgba(255, 255, 255, 0.3);
  font-size: 9px;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.main-content {
  min-height: 100vh;
  margin-left: 232px;
}

.topbar {
  position: sticky;
  top: 0;
  z-index: 20;
  display: flex;
  min-height: 82px;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
  padding: 12px 34px;
  border-bottom: 1px solid var(--line);
  background: rgba(243, 241, 234, 0.96);
  backdrop-filter: blur(10px);
}

.topbar-title {
  display: flex;
  align-items: center;
  gap: 11px;
}

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

.store-switcher {
  display: flex;
  align-items: center;
  gap: 8px;
  padding-left: 11px;
  border: 1px solid var(--line);
  border-radius: 5px;
  background: var(--surface);
}

.store-switcher > span {
  color: #8e9692;
  font-size: 9px;
  white-space: nowrap;
}

.store-switcher select {
  min-width: 142px;
  height: 36px;
  padding: 0 27px 0 3px;
  border: 0;
  outline: none;
  color: var(--ink);
  background: transparent;
  font-size: 11px;
}

.store-badge {
  display: none;
  padding: 5px 9px;
  border-radius: 3px;
  color: var(--forest);
  background: var(--forest-soft);
  font-size: 9px;
}

.today-label {
  margin-right: 3px;
  color: var(--ink-soft);
  font-size: 10px;
  white-space: nowrap;
}

.menu-btn {
  display: none;
}

.content-frame {
  width: 100%;
  max-width: 1480px;
  margin: 0 auto;
  padding: 30px 34px 46px;
}

.view {
  display: none;
  animation: reveal 180ms ease both;
}

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

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

.store-intro,
.page-heading {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 20px;
  margin-bottom: 22px;
}

.store-intro h2,
.page-heading h2 {
  margin-bottom: 4px;
  font-family: "STSong", "SimSun", serif;
  font-size: 28px;
  font-weight: 600;
}

.store-intro > div > p:last-child,
.page-heading > div > p:last-child {
  margin-bottom: 0;
  color: var(--ink-soft);
  font-size: 11px;
}

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

.sync-state i {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: #71987f;
  box-shadow: 0 0 0 3px rgba(113, 152, 127, 0.12);
}

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

.kpi-card {
  position: relative;
  min-height: 134px;
  overflow: hidden;
  padding: 19px 20px;
  border: 1px solid var(--line-soft);
  border-radius: var(--radius);
  background: var(--surface);
  box-shadow: var(--shadow);
}

.kpi-card::after {
  position: absolute;
  right: -33px;
  bottom: -45px;
  width: 115px;
  height: 115px;
  border: 1px solid rgba(36, 74, 62, 0.07);
  border-radius: 50%;
  content: "";
}

.kpi-card > strong {
  display: block;
  margin: 18px 0 5px;
  font-family: "Georgia", "STSong", serif;
  font-size: 29px;
  font-weight: 500;
  line-height: 1;
}

.kpi-card p {
  margin-bottom: 0;
  color: #919894;
  font-size: 10px;
}

.kpi-label {
  color: var(--ink-soft);
  font-size: 10px;
}

.kpi-main {
  color: #f6f3ea;
  border-color: var(--forest);
  background: var(--forest);
}

.kpi-main::after {
  border-color: rgba(255, 255, 255, 0.1);
}

.kpi-main .kpi-label,
.kpi-main p {
  color: rgba(255, 255, 255, 0.55);
}

.kpi-main > svg {
  position: absolute;
  right: 18px;
  top: 17px;
  width: 20px;
  height: 20px;
  color: #e2c887;
  opacity: 0.8;
}

.dashboard-grid {
  display: grid;
  grid-template-columns: minmax(0, 1.55fr) minmax(300px, 0.75fr);
  gap: 13px;
  margin-top: 13px;
}

.dashboard-bottom {
  display: grid;
  grid-template-columns: minmax(0, 1.22fr) minmax(350px, 0.78fr);
  gap: 13px;
  margin-top: 13px;
}

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

.panel-heading {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding: 19px 21px 14px;
}

.panel-heading h2 {
  font-size: 15px;
}

.panel-heading.compact {
  padding: 16px 0 10px;
}

.legend {
  display: flex;
  gap: 13px;
  color: var(--ink-soft);
  font-size: 9px;
}

.legend span {
  display: inline-flex;
  align-items: center;
  gap: 5px;
}

.legend-dot {
  display: inline-block;
  width: 7px;
  height: 7px;
  border-radius: 2px;
}

.legend-dot.inbound {
  background: #d0b472;
}

.legend-dot.outbound {
  background: var(--forest);
}

.chart-wrap {
  display: flex;
  height: 197px;
  gap: 12px;
  padding: 8px 21px 20px;
}

.chart-y-axis {
  display: flex;
  width: 28px;
  flex-direction: column;
  justify-content: space-between;
  padding-bottom: 22px;
  color: #9ba29e;
  font-size: 8px;
  text-align: right;
}

.bar-chart {
  display: grid;
  flex: 1;
  grid-template-columns: repeat(7, 1fr);
  gap: 12px;
  border-bottom: 1px solid var(--line);
  background-image: linear-gradient(to bottom, var(--line-soft) 1px, transparent 1px);
  background-size: 100% 33.333%;
}

.bar-day {
  display: flex;
  height: 100%;
  min-width: 0;
  align-items: center;
  justify-content: flex-end;
  flex-direction: column;
  gap: 7px;
}

.bar-pair {
  display: flex;
  width: 100%;
  height: calc(100% - 20px);
  align-items: flex-end;
  justify-content: center;
  gap: 3px;
}

.bar {
  display: block;
  width: min(11px, 36%);
  min-height: 1px;
  border-radius: 2px 2px 0 0;
  background: var(--forest);
}

.bar.inbound {
  background: #d0b472;
}

.bar-day > span {
  height: 14px;
  color: #939a96;
  font-size: 8px;
}

.alert-list {
  display: flex;
  height: 219px;
  flex-direction: column;
  gap: 8px;
  overflow-y: auto;
  padding: 0 20px 20px;
}

.alert-item {
  display: flex;
  min-height: 55px;
  align-items: center;
  gap: 9px;
  padding: 9px 10px;
  border: 1px solid #efe0d9;
  border-radius: 5px;
  background: #fcf8f5;
}

.alert-icon {
  display: grid;
  width: 29px;
  height: 29px;
  flex: 0 0 auto;
  place-items: center;
  border-radius: 4px;
  color: var(--clay);
  background: var(--clay-soft);
}

.alert-icon svg {
  width: 14px;
  height: 14px;
}

.alert-item > div {
  min-width: 0;
  flex: 1;
}

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

.alert-item small {
  display: block;
  color: var(--ink-soft);
  font-size: 8px;
}

.restock-btn {
  flex: 0 0 auto;
  padding: 4px 7px;
  border: 1px solid #e3cbc1;
  border-radius: 3px;
  color: var(--clay);
  background: transparent;
  font-size: 8px;
}

.empty-inline {
  padding: 34px 12px;
  color: #989f9b;
  font-size: 10px;
  text-align: center;
}

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

table {
  width: 100%;
  border-collapse: collapse;
}

th,
td {
  padding: 12px 21px;
  border-top: 1px solid var(--line-soft);
  text-align: left;
  vertical-align: middle;
}

th {
  color: #939a96;
  font-size: 9px;
  font-weight: 500;
  white-space: nowrap;
}

td {
  font-size: 10px;
}

tbody tr:hover {
  background: #fcfaf5;
}

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

.product-avatar {
  display: grid;
  width: 31px;
  height: 31px;
  flex: 0 0 auto;
  place-items: center;
  border-radius: 4px;
  color: var(--forest);
  background: var(--forest-soft);
  font-family: "STSong", "SimSun", serif;
  font-size: 14px;
}

.product-avatar.has-image {
  overflow: hidden;
  padding: 0;
  background: #eee9df;
}

.product-avatar.has-image img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.product-cell strong {
  display: block;
  max-width: 220px;
  overflow: hidden;
  font-size: 10px;
  font-weight: 500;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.product-cell small {
  display: block;
  color: #929a96;
  font-size: 8px;
}

.stock-value {
  font-family: "Georgia", "STSong", serif;
  font-size: 14px;
  font-weight: 600;
}

.stock-value.low {
  color: var(--clay);
}

.stock-value.empty {
  color: var(--red);
}

.status {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 2px 7px;
  border-radius: 9px;
  color: var(--forest);
  background: var(--forest-soft);
  font-size: 8px;
  white-space: nowrap;
}

.status::before {
  width: 4px;
  height: 4px;
  border-radius: 50%;
  background: currentColor;
  content: "";
}

.status.low {
  color: var(--clay);
  background: var(--clay-soft);
}

.status.empty {
  color: var(--red);
  background: var(--red-soft);
}

.timeline {
  display: flex;
  flex-direction: column;
  padding: 0 21px 17px;
}

.timeline-item {
  display: grid;
  grid-template-columns: 30px minmax(0, 1fr) auto;
  align-items: center;
  gap: 9px;
  padding: 9px 0;
  border-bottom: 1px solid var(--line-soft);
}

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

.timeline-icon {
  display: grid;
  width: 28px;
  height: 28px;
  place-items: center;
  border-radius: 50%;
}

.timeline-icon.in {
  color: var(--forest);
  background: var(--forest-soft);
}

.timeline-icon.out {
  color: var(--clay);
  background: var(--clay-soft);
}

.timeline-icon.adjust {
  color: var(--gold);
  background: var(--gold-soft);
}

.timeline-icon svg {
  width: 13px;
  height: 13px;
}

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

.timeline-item small {
  display: block;
  color: #959c98;
  font-size: 8px;
}

.timeline-qty {
  font-family: "Georgia", serif;
  font-size: 12px;
  font-weight: 600;
}

.timeline-qty.in {
  color: var(--forest);
}

.timeline-qty.out {
  color: var(--clay);
}

.timeline-qty.adjust {
  color: var(--gold);
}

/* Products */
.toolbar {
  display: flex;
  align-items: center;
  gap: 9px;
  padding: 16px 20px;
}

.heading-actions {
  display: flex;
  align-items: center;
  gap: 8px;
}

.search-field {
  display: flex;
  min-width: 230px;
  flex: 1;
  align-items: center;
  gap: 8px;
  padding: 0 11px;
  border: 1px solid var(--line);
  border-radius: 5px;
  background: #fff;
  transition: border-color 150ms, box-shadow 150ms;
}

.search-field:focus-within {
  border-color: #89a79c;
  box-shadow: 0 0 0 3px rgba(36, 74, 62, 0.07);
}

.search-field svg {
  width: 14px;
  height: 14px;
  flex: 0 0 auto;
  color: #969d99;
}

.search-field input {
  width: 100%;
  height: 36px;
  border: 0;
  outline: none;
  color: var(--ink);
  background: transparent;
  font-size: 10px;
}

select {
  height: 38px;
  padding: 0 29px 0 11px;
  border: 1px solid var(--line);
  border-radius: 5px;
  color: var(--ink);
  background-color: #fff;
  font-size: 10px;
}

.product-table td {
  padding-top: 14px;
  padding-bottom: 14px;
}

.category-add-form {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: end;
  gap: 9px;
  margin-bottom: 8px;
}

.category-add-form .btn {
  height: 40px;
}

.category-list {
  display: flex;
  max-height: 340px;
  flex-direction: column;
  margin-top: 15px;
  overflow-y: auto;
  border-top: 1px solid var(--line-soft);
}

.category-row {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto auto;
  align-items: center;
  gap: 10px;
  min-height: 53px;
  padding: 8px 2px;
  border-bottom: 1px solid var(--line-soft);
}

.category-name {
  display: flex;
  min-width: 0;
  align-items: center;
  gap: 8px;
}

.category-name strong {
  overflow: hidden;
  font-size: 11px;
  font-weight: 500;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.category-name span {
  flex: 0 0 auto;
  padding: 2px 6px;
  border-radius: 8px;
  color: var(--ink-soft);
  background: #f0ede6;
  font-size: 8px;
}

.category-edit-input {
  width: 100%;
  height: 34px;
  padding: 0 9px;
  border: 1px solid #88a79c;
  border-radius: 4px;
  outline: none;
  background: #fff;
  box-shadow: 0 0 0 3px rgba(36, 74, 62, 0.07);
  font-size: 10px;
}

.category-actions {
  display: flex;
  gap: 4px;
}

.category-actions .row-action {
  width: 27px;
  height: 27px;
}

.category-empty {
  padding: 35px 12px;
  color: var(--ink-soft);
  font-size: 10px;
  text-align: center;
}

.row-actions {
  display: flex;
  gap: 5px;
}

.row-action {
  display: inline-grid;
  width: 28px;
  height: 28px;
  padding: 0;
  place-items: center;
  border: 1px solid var(--line);
  border-radius: 4px;
  color: var(--ink-soft);
  background: #fff;
}

.row-action:hover {
  color: var(--forest);
  border-color: #b7c9c2;
}

.row-action.danger:hover {
  color: var(--red);
  border-color: #dcb6b1;
}

.row-action svg {
  width: 12px;
  height: 12px;
}

.empty-state {
  display: none;
  padding: 56px 20px;
  color: var(--ink-soft);
  text-align: center;
}

.empty-state.is-visible {
  display: block;
}

.empty-state svg {
  width: 26px;
  height: 26px;
  margin-bottom: 8px;
  color: #a4aaa6;
}

.empty-state strong {
  display: block;
  margin-bottom: 3px;
  color: var(--ink);
  font-size: 12px;
  font-weight: 500;
}

.empty-state span {
  font-size: 10px;
}

/* Inventory */
.segmented-control {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 3px;
  max-width: 620px;
  margin-bottom: 14px;
  padding: 4px;
  border: 1px solid var(--line);
  border-radius: 6px;
  background: #eae7df;
}

.segment {
  display: flex;
  min-height: 36px;
  align-items: center;
  justify-content: center;
  gap: 6px;
  border: 0;
  border-radius: 4px;
  color: var(--ink-soft);
  background: transparent;
  font-size: 10px;
  transition: 150ms;
}

.segment svg {
  width: 13px;
  height: 13px;
}

.segment.is-active {
  color: var(--forest);
  background: var(--surface);
  box-shadow: 0 2px 7px rgba(32, 51, 45, 0.08);
}

.segment:disabled {
  cursor: not-allowed;
  opacity: 0.35;
}

.operation-layout {
  display: grid;
  grid-template-columns: minmax(0, 1.35fr) minmax(340px, 0.65fr);
  gap: 14px;
  align-items: start;
}

.product-picker {
  min-height: 515px;
}

.picker-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 20px 21px 13px;
}

.picker-head h2 {
  font-size: 16px;
}

.picker-head > span {
  color: var(--ink-soft);
  font-size: 9px;
}

.picker-filters {
  display: flex;
  gap: 8px;
  padding: 0 21px 14px;
}

.picker-filters .search-field {
  min-width: 170px;
}

.operation-product-grid {
  display: grid;
  max-height: 413px;
  grid-template-columns: repeat(auto-fill, minmax(148px, 1fr));
  gap: 9px;
  overflow-y: auto;
  padding: 0 21px 21px;
}

.operation-product {
  position: relative;
  display: flex;
  min-height: 105px;
  align-items: flex-start;
  flex-direction: column;
  padding: 12px;
  border: 1px solid var(--line);
  border-radius: 5px;
  color: var(--ink);
  background: #faf8f3;
  text-align: left;
  transition: 150ms ease;
}

.operation-product-thumb {
  position: relative;
  display: grid;
  width: 100%;
  height: 65px;
  margin-bottom: 8px;
  overflow: hidden;
  place-items: center;
  border-radius: 4px;
  color: #7e8b85;
  background: #ebe8df;
  font-family: "STSong", "SimSun", serif;
  font-size: 23px;
}

.operation-product-thumb i {
  font-style: normal;
}

.operation-product-thumb img {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.operation-product:hover {
  border-color: #aebbb5;
  background: #fff;
  transform: translateY(-1px);
}

.operation-product.is-selected {
  border-color: var(--forest);
  background: #f2f7f4;
  box-shadow: inset 0 0 0 1px var(--forest);
}

.operation-product.is-selected::after {
  position: absolute;
  top: 10px;
  right: 10px;
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: var(--forest);
  content: "";
}

.operation-product-category {
  margin-bottom: 10px;
  color: #8c948f;
  font-size: 8px;
}

.operation-product strong {
  width: 100%;
  overflow: hidden;
  font-size: 10px;
  font-weight: 500;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.operation-product-meta {
  display: flex;
  width: 100%;
  align-items: flex-end;
  justify-content: space-between;
  gap: 6px;
  margin-top: auto;
  padding-top: 9px;
}

.operation-product-meta b {
  color: var(--forest);
  font-family: "Georgia", serif;
  font-size: 12px;
  font-weight: 500;
}

.operation-product-meta span {
  color: var(--ink-soft);
  font-size: 8px;
}

.operation-empty {
  padding: 70px 20px;
}

.operation-form-panel {
  padding: 20px;
}

.operation-heading {
  display: flex;
  align-items: center;
  gap: 11px;
  margin-bottom: 16px;
  padding-bottom: 15px;
  border-bottom: 1px solid var(--line-soft);
}

.operation-heading h2 {
  font-size: 16px;
}

.operation-heading p:last-child {
  margin: 2px 0 0;
  color: var(--ink-soft);
  font-size: 9px;
}

.operation-symbol {
  display: grid;
  width: 38px;
  height: 38px;
  flex: 0 0 auto;
  place-items: center;
  border-radius: 50%;
  color: var(--forest);
  background: var(--forest-soft);
}

.operation-symbol.out {
  color: var(--clay);
  background: var(--clay-soft);
}

.operation-symbol.adjust {
  color: var(--gold);
  background: var(--gold-soft);
}

.selected-product {
  min-height: 74px;
  margin-bottom: 14px;
  padding: 12px;
  border: 1px dashed #d6d0c6;
  border-radius: 5px;
  background: #faf8f3;
}

.selected-product-empty {
  display: flex;
  min-height: 48px;
  align-items: center;
  justify-content: center;
  flex-direction: column;
  color: #969d99;
}

.selected-product-empty span {
  font-size: 10px;
}

.selected-product-empty small {
  font-size: 8px;
}

.selected-product-info {
  display: flex;
  align-items: center;
  gap: 10px;
}

.selected-product-info .product-avatar {
  width: 38px;
  height: 38px;
}

.selected-product-info > div:nth-child(2) {
  min-width: 0;
  flex: 1;
}

.selected-product-info strong {
  display: block;
  overflow: hidden;
  font-size: 11px;
  font-weight: 500;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.selected-product-info small {
  color: var(--ink-soft);
  font-size: 8px;
}

.selected-product-stock {
  text-align: right;
}

.selected-product-stock span {
  display: block;
  color: var(--ink-soft);
  font-size: 8px;
}

.selected-product-stock strong {
  font-family: "Georgia", serif;
  font-size: 18px;
  font-weight: 500;
}

.operation-form {
  display: flex;
  flex-direction: column;
  gap: 13px;
}

.outbound-reason-section {
  display: flex;
  flex-direction: column;
  gap: 7px;
}

.field-label-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
}

.field-label {
  color: #58615d;
  font-size: 10px;
  font-weight: 500;
}

.reason-options {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 6px;
}

.reason-option {
  position: relative;
  display: flex;
  min-height: 59px;
  align-items: center;
  padding: 8px 9px;
  border: 1px solid var(--line);
  border-radius: 5px;
  background: #fbfaf6;
  transition: border-color 150ms, background 150ms;
}

.reason-option:has(input:checked) {
  border-color: var(--forest);
  background: var(--forest-soft);
  box-shadow: inset 0 0 0 1px var(--forest);
}

.reason-option input {
  position: absolute;
  width: 1px;
  height: 1px;
  opacity: 0;
}

.reason-option span {
  min-width: 0;
}

.reason-option strong {
  display: block;
  color: var(--ink);
  font-size: 9px;
  font-weight: 500;
}

.reason-option small {
  display: block;
  margin-top: 2px;
  color: #8d9591;
  font-size: 7px;
  line-height: 1.45;
}

.rank-number {
  display: inline-grid;
  width: 23px;
  height: 23px;
  place-items: center;
  border-radius: 50%;
  color: var(--ink-soft);
  background: #f0ede6;
  font-family: "Georgia", serif;
  font-size: 10px;
}

.rank-number.top {
  color: #fff;
  background: var(--forest);
}

.hot-sales {
  color: var(--forest);
  font-family: "Georgia", serif;
  font-size: 13px;
  font-weight: 600;
}

.field {
  display: flex;
  min-width: 0;
  flex-direction: column;
  gap: 6px;
}

.field > span {
  color: #58615d;
  font-size: 10px;
  font-weight: 500;
}

.field b {
  color: var(--clay);
}

.field input,
.field select,
.field textarea {
  width: 100%;
  border: 1px solid var(--line);
  border-radius: 5px;
  outline: none;
  color: var(--ink);
  background: #fff;
  font-size: 11px;
  transition: border-color 150ms, box-shadow 150ms;
}

.field input,
.field select {
  height: 40px;
  padding: 0 11px;
}

.field textarea {
  min-height: 70px;
  padding: 9px 11px;
  resize: vertical;
}

.field input:focus,
.field select:focus,
.field textarea:focus {
  border-color: #88a79c;
  box-shadow: 0 0 0 3px rgba(36, 74, 62, 0.07);
}

.field small {
  color: #969d99;
  font-size: 8px;
  line-height: 1.6;
}

.product-image-field {
  display: flex;
  flex-direction: column;
  gap: 7px;
}

.product-image-field > span {
  color: #58615d;
  font-size: 10px;
  font-weight: 500;
}

.image-uploader {
  display: flex;
  align-items: center;
  gap: 12px;
}

.image-preview {
  display: grid;
  width: 92px;
  height: 92px;
  flex: 0 0 auto;
  overflow: hidden;
  place-items: center;
  border: 1px dashed #d2ccc1;
  border-radius: 6px;
  color: #99a09c;
  background: #faf8f3;
}

.image-preview img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.image-preview svg {
  width: 20px;
  height: 20px;
  margin-bottom: -14px;
}

.image-preview small {
  font-size: 8px;
}

.image-upload-controls {
  display: flex;
  align-items: flex-start;
  flex-direction: column;
  gap: 7px;
}

.image-upload-controls .btn {
  min-height: 32px;
  padding: 5px 10px;
  font-size: 9px;
}

.image-upload-controls > small {
  max-width: 330px;
  color: #929995;
  font-size: 8px;
  line-height: 1.6;
}

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

.calibration-preview {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 6px;
  padding: 10px;
  border: 1px solid var(--line-soft);
  border-radius: 5px;
  background: #faf8f3;
}

.calibration-preview > div {
  padding: 3px 5px;
  border-right: 1px solid var(--line-soft);
}

.calibration-preview > div:last-child {
  border-right: 0;
}

.calibration-preview span {
  display: block;
  color: var(--ink-soft);
  font-size: 8px;
}

.calibration-preview strong {
  font-family: "Georgia", serif;
  font-size: 16px;
  font-weight: 500;
}

.today-operations {
  margin-top: 20px;
  border-top: 1px solid var(--line-soft);
}

.count-badge {
  padding: 2px 7px;
  border-radius: 9px;
  color: var(--forest);
  background: var(--forest-soft);
  font-size: 8px;
}

.mini-ledger {
  display: flex;
  max-height: 175px;
  flex-direction: column;
  overflow-y: auto;
}

.mini-ledger-item {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 3px 8px;
  padding: 9px 0;
  border-top: 1px solid var(--line-soft);
}

.mini-ledger-item strong {
  overflow: hidden;
  font-size: 9px;
  font-weight: 500;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.mini-ledger-item .time {
  color: #989f9b;
  font-size: 8px;
}

.mini-ledger-item span:not(.time) {
  color: var(--ink-soft);
  font-size: 8px;
}

.mini-ledger-item .delta {
  color: var(--forest);
  font-family: "Georgia", serif;
  font-size: 11px;
  text-align: right;
}

.mini-ledger-item .delta.negative {
  color: var(--clay);
}

/* Ledger */
.ledger-type {
  display: inline-flex;
  padding: 2px 7px;
  border-radius: 3px;
  font-size: 8px;
  white-space: nowrap;
}

.ledger-type.in {
  color: var(--forest);
  background: var(--forest-soft);
}

.ledger-type.out {
  color: var(--clay);
  background: var(--clay-soft);
}

.ledger-type.adjust {
  color: var(--gold);
  background: var(--gold-soft);
}

.qty-in {
  color: var(--forest);
  font-weight: 600;
}

.qty-out {
  color: var(--clay);
  font-weight: 600;
}

.qty-adjust {
  color: var(--gold);
  font-weight: 600;
}

.stock-change {
  color: var(--ink-soft);
  font-family: "Georgia", serif;
  white-space: nowrap;
}

.note-cell {
  max-width: 240px;
  overflow: hidden;
  color: var(--ink-soft);
  text-overflow: ellipsis;
  white-space: nowrap;
}

/* Admin */
.owner-account-card {
  display: flex;
  align-items: center;
  gap: 15px;
  margin-bottom: 13px;
  padding: 18px 20px;
  border: 1px solid #d6ddd8;
  border-radius: var(--radius);
  background: var(--forest-soft);
}

.owner-seal {
  display: grid;
  width: 42px;
  height: 42px;
  flex: 0 0 auto;
  place-items: center;
  border-radius: 50%;
  color: #e8d098;
  background: var(--forest);
}

.owner-account-card > div:nth-child(2) {
  min-width: 0;
  flex: 1;
}

.owner-account-card h3 {
  font-size: 14px;
}

.owner-account-card h3 span {
  margin-left: 7px;
  color: var(--ink-soft);
  font-size: 10px;
  font-weight: 400;
}

.owner-account-card p:last-child {
  margin: 2px 0 0;
  color: var(--ink-soft);
  font-size: 9px;
}

.owner-actions {
  display: flex;
  align-items: center;
  gap: 7px;
}

.admin-summary {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 1px;
  margin-bottom: 13px;
  overflow: hidden;
  border: 1px solid var(--line-soft);
  border-radius: var(--radius);
  background: var(--line-soft);
}

.admin-summary > div {
  padding: 15px 18px;
  background: var(--surface);
}

.admin-summary span {
  display: block;
  color: var(--ink-soft);
  font-size: 9px;
}

.admin-summary strong {
  font-family: "Georgia", serif;
  font-size: 22px;
  font-weight: 500;
}

.store-card-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 10px;
  padding: 0 20px 20px;
}

.store-card {
  display: flex;
  min-height: 160px;
  flex-direction: column;
  padding: 15px;
  border: 1px solid var(--line);
  border-radius: 6px;
  background: #fbfaf6;
}

.store-card-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 8px;
}

.store-card-head > span {
  color: #8d9591;
  font-size: 8px;
}

.store-card h3 {
  margin: 11px 0 2px;
  font-size: 13px;
}

.store-card > p {
  margin: 0 0 12px;
  overflow: hidden;
  color: var(--ink-soft);
  font-size: 8px;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.store-card-meta {
  display: flex;
  gap: 14px;
  margin-top: auto;
  padding-top: 12px;
  border-top: 1px solid var(--line-soft);
}

.store-card-meta span {
  color: var(--ink-soft);
  font-size: 8px;
}

.store-card-meta strong {
  display: block;
  color: var(--ink);
  font-family: "Georgia", serif;
  font-size: 16px;
  font-weight: 500;
}

.store-card-actions {
  display: flex;
  gap: 5px;
  margin-top: 11px;
}

.store-card-actions .btn {
  min-height: 30px;
  flex: 1;
  padding: 4px 8px;
  font-size: 8px;
}

.store-card-actions .icon-btn {
  width: 30px;
  height: 30px;
}

.store-card-actions .icon-btn svg {
  width: 12px;
  height: 12px;
}

.accounts-panel {
  margin-top: 13px;
}

.muted-label {
  color: #939a96;
  font-size: 8px;
}

.permission-tags {
  display: flex;
  max-width: 330px;
  flex-wrap: wrap;
  gap: 3px;
}

.permission-tag {
  padding: 2px 5px;
  border-radius: 2px;
  color: var(--forest);
  background: var(--forest-soft);
  font-size: 7px;
}

.account-status {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  color: var(--forest);
  font-size: 8px;
}

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

.account-status.off {
  color: #8d9591;
}

/* Modal */
.modal {
  width: min(570px, calc(100vw - 28px));
  max-height: calc(100vh - 34px);
  padding: 0;
  border: 0;
  border-radius: 9px;
  background: var(--surface);
  box-shadow: 0 24px 80px rgba(24, 32, 29, 0.24);
}

.modal-wide {
  width: min(690px, calc(100vw - 28px));
}

.modal::backdrop {
  background: rgba(26, 34, 31, 0.48);
  backdrop-filter: blur(2px);
}

.modal-card {
  padding: 24px;
}

.modal-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  margin-bottom: 20px;
}

.modal-head h2 {
  font-family: "STSong", "SimSun", serif;
  font-size: 23px;
}

#productForm {
  display: flex;
  flex-direction: column;
  gap: 13px;
}

#storeForm {
  display: flex;
  flex-direction: column;
  gap: 18px;
}

.form-section {
  display: flex;
  flex-direction: column;
  gap: 12px;
  padding: 15px;
  border: 1px solid var(--line-soft);
  border-radius: 6px;
  background: #fbfaf6;
}

.form-section > h3,
.form-section-title h3 {
  font-size: 12px;
}

.form-section-title {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
}

.form-section-title span {
  color: var(--ink-soft);
  font-size: 8px;
}

.permission-fieldset {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 8px;
  margin: 0;
  padding: 0;
  border: 0;
}

.permission-fieldset legend {
  margin-bottom: 6px;
  color: #58615d;
  font-size: 10px;
  font-weight: 500;
}

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

input[type="checkbox"] {
  width: 13px;
  height: 13px;
  accent-color: var(--forest);
}

.switch-row {
  display: flex;
  gap: 20px;
}

.switch-field {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  color: var(--ink-soft);
  font-size: 9px;
}

.switch-field input {
  position: absolute;
  width: 1px;
  height: 1px;
  opacity: 0;
}

.switch-control {
  position: relative;
  width: 30px;
  height: 17px;
  border-radius: 9px;
  background: #d2d1cb;
  transition: 150ms;
}

.switch-control::after {
  position: absolute;
  top: 2px;
  left: 2px;
  width: 13px;
  height: 13px;
  border-radius: 50%;
  background: #fff;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.15);
  content: "";
  transition: 150ms;
}

.switch-field input:checked + .switch-control {
  background: var(--forest);
}

.switch-field input:checked + .switch-control::after {
  transform: translateX(13px);
}

.modal-actions {
  display: flex;
  justify-content: flex-end;
  gap: 8px;
  margin-top: 4px;
  padding-top: 16px;
  border-top: 1px solid var(--line-soft);
}

.form-hint {
  margin: -3px 0 0;
  color: #8f9692;
  font-size: 9px;
}

.confirm-modal {
  width: min(390px, calc(100vw - 28px));
  text-align: center;
}

.confirm-icon {
  display: grid;
  width: 43px;
  height: 43px;
  margin: 0 auto 13px;
  place-items: center;
  border-radius: 50%;
  color: var(--red);
  background: var(--red-soft);
}

.confirm-modal h2 {
  font-size: 18px;
}

.confirm-modal p {
  margin: 7px auto 0;
  color: var(--ink-soft);
  font-size: 10px;
  line-height: 1.7;
}

.confirm-modal .modal-actions {
  justify-content: center;
}

.toast-region {
  position: fixed;
  right: 22px;
  bottom: 22px;
  z-index: 100;
  display: flex;
  max-width: 340px;
  flex-direction: column;
  gap: 7px;
}

.toast {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 10px 13px;
  border: 1px solid #c7d8d0;
  border-radius: 5px;
  color: #284d42;
  background: #f2f8f5;
  box-shadow: 0 10px 25px rgba(35, 49, 44, 0.13);
  font-size: 10px;
  animation: toast-in 200ms ease both;
}

.toast.error {
  border-color: #e4c1bc;
  color: #82372f;
  background: #fdf3f1;
}

.toast svg {
  width: 14px;
  height: 14px;
}

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

.scrim {
  display: none;
}

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

  .dashboard-grid,
  .dashboard-bottom {
    grid-template-columns: 1fr;
  }

  .alert-list {
    height: auto;
    max-height: 220px;
  }

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

@media (max-width: 1020px) {
  .auth-screen {
    grid-template-columns: minmax(380px, 0.9fr) minmax(390px, 1.1fr);
  }

  .auth-message h1 {
    font-size: 43px;
  }

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

  .product-picker {
    min-height: 0;
  }

  .operation-product-grid {
    max-height: 350px;
  }

  .topbar .today-label {
    display: none;
  }
}

@media (max-width: 900px) {
  .sidebar {
    transform: translateX(-100%);
    transition: transform 210ms ease;
  }

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

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

  .menu-btn {
    display: grid;
  }

  .scrim.is-visible {
    position: fixed;
    inset: 0;
    z-index: 25;
    display: block;
    background: rgba(22, 29, 27, 0.38);
  }

  .content-frame {
    padding-right: 22px;
    padding-left: 22px;
  }

  .topbar {
    padding-right: 22px;
    padding-left: 22px;
  }
}

@media (max-width: 760px) {
  .auth-screen {
    display: block;
  }

  .auth-brand-panel {
    min-height: 270px;
    padding: 26px 24px 25px;
  }

  .auth-message {
    margin-top: 45px;
  }

  .auth-message h1 {
    font-size: 35px;
  }

  .auth-message > p:last-child,
  .auth-copyright,
  .auth-composition {
    display: none;
  }

  .auth-form-panel {
    min-height: calc(100vh - 270px);
    padding: 24px 18px 36px;
    background: #f7f4ed;
  }

  .login-card {
    padding: 29px 23px 25px;
  }

  .topbar {
    min-height: 77px;
    flex-wrap: wrap;
  }

  .topbar-actions {
    width: 100%;
  }

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

  .store-switcher {
    flex: 1;
  }

  .store-switcher select {
    min-width: 0;
    width: 100%;
  }

  .store-badge {
    display: inline-flex;
  }

  .topbar-actions #exportButton {
    display: none;
  }

  .content-frame {
    padding: 22px 15px 34px;
  }

  .store-intro,
  .page-heading {
    align-items: flex-start;
    flex-direction: column;
    gap: 12px;
  }

  .page-heading .btn {
    width: 100%;
  }

  .heading-actions {
    width: 100%;
    flex-direction: column-reverse;
  }

  .store-intro h2,
  .page-heading h2 {
    font-size: 25px;
  }

  .kpi-grid {
    grid-template-columns: 1fr 1fr;
  }

  .kpi-card {
    min-height: 123px;
    padding: 16px;
  }

  .kpi-card > strong {
    font-size: 24px;
  }

  .dashboard-bottom {
    grid-template-columns: 1fr;
  }

  .legend {
    display: none;
  }

  .toolbar,
  .picker-filters {
    align-items: stretch;
    flex-direction: column;
  }

  .search-field {
    min-width: 0;
  }

  .toolbar select,
  .picker-filters select {
    width: 100%;
  }

  .field-row {
    grid-template-columns: 1fr;
  }

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

  .category-add-form .btn {
    width: 100%;
  }

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

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

  .store-card-grid,
  .admin-summary {
    grid-template-columns: 1fr;
  }

  .owner-account-card {
    align-items: flex-start;
    flex-wrap: wrap;
  }

  .owner-account-card .btn {
    width: 100%;
  }

  .owner-actions {
    width: 100%;
    flex-direction: column;
  }

  .store-card-grid {
    padding-right: 14px;
    padding-left: 14px;
  }

  .modal-card {
    padding: 19px;
  }

  .modal-actions {
    flex-direction: column-reverse;
  }

  .modal-actions .btn {
    width: 100%;
  }

  .toast-region {
    right: 13px;
    bottom: 13px;
    left: 13px;
    max-width: none;
  }
}

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

  .segmented-control {
    grid-template-columns: 1fr;
  }

  .auth-brand-panel {
    min-height: 235px;
  }

  .auth-message {
    margin-top: 32px;
  }

  .auth-message h1 {
    font-size: 30px;
  }

  .login-card {
    width: 100%;
  }

  .form-shell {
    padding: 0;
  }
}

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