:root {
  --bg: #f8f1e6;
  --ink: #19211f;
  --muted: #69736e;
  --line: #ddd8cd;
  --surface: #ffffff;
  --surface-raised: rgba(255, 255, 255, 0.92);
  --surface-soft: #eef1ed;
  --control-bg: #ffffff;
  --sidebar-bg: rgba(255, 255, 255, 0.78);
  --accent: #4f9a78;
  --accent-dark: #2f7358;
  --mint-soft: #dceee4;
  --mint-line: #8bbfa6;
  --warm-paper: #fbf4e8;
  --gold: #d9902d;
  --danger: #b84242;
  --shadow: 0 18px 50px rgba(25, 33, 31, 0.09);
  color-scheme: light;
}

:root[data-theme="dark"] {
  --bg: #101513;
  --ink: #e8efeb;
  --muted: #a2ada7;
  --line: #303a35;
  --surface: #19201d;
  --surface-raised: rgba(25, 32, 29, 0.94);
  --surface-soft: #222b27;
  --control-bg: #202824;
  --sidebar-bg: rgba(20, 27, 24, 0.92);
  --accent: #69b38f;
  --accent-dark: #8bc9a9;
  --mint-soft: #243b31;
  --mint-line: #4f806a;
  --warm-paper: #1d211d;
  --gold: #e1a650;
  --danger: #ee8585;
  --shadow: 0 18px 50px rgba(0, 0, 0, 0.3);
  color-scheme: dark;
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  color: var(--ink);
  background:
    linear-gradient(135deg, rgba(79, 154, 120, 0.08), transparent 36%),
    linear-gradient(315deg, rgba(217, 144, 45, 0.08), transparent 34%),
    var(--bg);
  font-family: "Microsoft YaHei", "PingFang SC", Arial, sans-serif;
  transition:
    color 0.28s ease,
    background-color 0.28s ease;
}

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

button {
  border: 1px solid var(--line);
  background: var(--control-bg);
  color: var(--ink);
  border-radius: 8px;
  padding: 10px 14px;
  cursor: pointer;
  transition:
    transform 0.18s ease,
    border-color 0.18s ease,
    color 0.18s ease,
    background 0.18s ease,
    filter 0.18s ease,
    box-shadow 0.18s ease;
}

button:hover:not(:disabled) {
  border-color: var(--accent);
  color: var(--accent-dark);
  transform: translateY(-1px);
}

button:disabled {
  cursor: not-allowed;
  opacity: 0.45;
}

button:active:not(:disabled) {
  transform: scale(0.97);
}

.primary {
  background: linear-gradient(135deg, #64ae8c, var(--accent));
  border-color: var(--accent);
  color: #fff;
  font-weight: 700;
  box-shadow: 0 10px 22px rgba(79, 154, 120, 0.2);
}

.primary:hover:not(:disabled) {
  background: linear-gradient(135deg, #70bb98, #58a682);
  color: #fff;
  filter: brightness(1.05);
  transform: translateY(-2px);
}

.primary:active:not(:disabled) {
  transform: translateY(0) scale(0.97);
}

.ghost {
  background: transparent;
}

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

.layout-root {
  min-height: 100vh;
  display: grid;
  grid-template-columns: 240px 1fr;
  transition: grid-template-columns 0.2s ease;
}

.layout-root.auth-only {
  grid-template-columns: 1fr;
}

.layout-root.sidebar-collapsed {
  grid-template-columns: 76px 1fr;
}

.sidebar {
  min-height: 100vh;
  padding: 28px 18px;
  background: var(--sidebar-bg);
  border-right: 1px solid var(--line);
  position: sticky;
  top: 0;
  display: flex;
  flex-direction: column;
  gap: 12px;
  overflow: hidden;
  transition: padding 0.2s ease;
}

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

.brand-mark {
  width: 46px;
  height: 46px;
  border-radius: 8px;
  display: grid;
  place-items: center;
  color: #fff;
  font-weight: 800;
  background: linear-gradient(135deg, var(--accent), var(--gold));
}

.brand span,
.topbar p,
.compact-row span,
.notice span,
.item-content p,
.order-card p {
  color: var(--muted);
  font-size: 14px;
}

.brand-text {
  display: grid;
  gap: 3px;
  white-space: nowrap;
}

.sidebar button {
  text-align: left;
  background: transparent;
  border-color: transparent;
  display: flex;
  align-items: center;
  gap: 10px;
  min-height: 44px;
  width: 100%;
}

.sidebar button.active {
  background: var(--mint-soft);
  color: var(--accent-dark);
  border-color: var(--mint-line);
  font-weight: 700;
}

.sidebar-note {
  margin-top: auto;
  padding: 16px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface);
}

.sidebar-note span {
  color: var(--gold);
  font-size: 28px;
  font-weight: 800;
}

.sidebar-toggle {
  margin-bottom: 8px;
}

.nav-code {
  display: none;
  width: 24px;
  height: 24px;
  border-radius: 7px;
  place-items: center;
  color: var(--accent-dark);
  font-weight: 800;
  background: var(--mint-soft);
}

.nav-label {
  white-space: nowrap;
}

.layout-root.sidebar-collapsed .sidebar {
  padding: 24px 10px;
  align-items: center;
}

.layout-root.sidebar-collapsed .brand {
  justify-content: center;
  margin-bottom: 14px;
}

.layout-root.sidebar-collapsed .brand-text,
.layout-root.sidebar-collapsed .nav-label,
.layout-root.sidebar-collapsed .sidebar-note {
  display: none;
}

.layout-root.sidebar-collapsed .sidebar button {
  justify-content: center;
  width: 48px;
  height: 44px;
  padding: 0;
}

.layout-root.sidebar-collapsed .nav-code,
.sidebar-toggle .nav-code {
  display: grid;
}

.app-shell {
  padding: 28px;
}

.auth-only .app-shell {
  min-height: 100vh;
  display: grid;
  place-items: center;
  padding: 24px;
  position: relative;
  overflow: hidden;
  background: var(--warm-paper);
}

.auth-only .app-shell::before {
  content: "";
  position: absolute;
  inset: 0 0 auto;
  height: 15%;
  z-index: 0;
  pointer-events: none;
  background: linear-gradient(
    90deg,
    rgba(210, 236, 222, 0.82),
    rgba(251, 244, 232, 0.56)
  );
  -webkit-mask-image: linear-gradient(to bottom, #000 0%, transparent 100%);
  mask-image: linear-gradient(to bottom, #000 0%, transparent 100%);
}

.auth-only .topbar {
  display: none;
}

.auth-float-bg {
  position: absolute;
  inset: 0;
  z-index: 1;
  pointer-events: none;
  overflow: hidden;
}

.float-item {
  position: absolute;
  display: block;
  width: 116px;
  height: 116px;
  z-index: 1;
  opacity: 0.14;
  background-repeat: no-repeat;
  background-position: center;
  background-size: contain;
  animation: float-soft 10s ease-in-out infinite;
  will-change: transform;
}

.float-book {
  left: 8%;
  top: 14%;
  opacity: 0.13;
  background-image: url("data:image/svg+xml,%3Csvg%20width%3D%22128%22%20height%3D%22128%22%20viewBox%3D%220%200%20128%20128%22%20fill%3D%22none%22%20xmlns%3D%22http%3A//www.w3.org/2000/svg%22%3E%3Cpath%20d%3D%22M30%2026h32c8%200%2012%204%2012%2012v62c0-7-5-11-12-11H30V26Z%22%20stroke%3D%22%238bbfa6%22%20stroke-width%3D%224%22%20stroke-linejoin%3D%22round%22/%3E%3Cpath%20d%3D%22M74%2038c0-8%204-12%2012-12h12v63H86c-7%200-12%204-12%2011V38Z%22%20stroke%3D%22%238bbfa6%22%20stroke-width%3D%224%22%20stroke-linejoin%3D%22round%22/%3E%3Cpath%20d%3D%22M42%2044h19M42%2058h18M86%2044h8%22%20stroke%3D%22%23a7d4bd%22%20stroke-width%3D%224%22%20stroke-linecap%3D%22round%22/%3E%3C/svg%3E");
}

.float-shoe {
  right: 8%;
  top: 13%;
  width: 138px;
  height: 138px;
  animation-delay: -2s;
  opacity: 0.12;
  background-image: url("data:image/svg+xml,%3Csvg%20width%3D%22144%22%20height%3D%22144%22%20viewBox%3D%220%200%20144%20144%22%20fill%3D%22none%22%20xmlns%3D%22http%3A//www.w3.org/2000/svg%22%3E%3Cpath%20d%3D%22M29%2087c17%2010%2037%2013%2064%209%2015-2%2024%202%2029%2010%202%203%201%208-4%209-26%208-61%207-91-2-8-2-9-8-6-15l6-14c2-5%208-5%2012-1%209%209%2022%2015%2038%2018%22%20stroke%3D%22%238bbfa6%22%20stroke-width%3D%224%22%20stroke-linecap%3D%22round%22%20stroke-linejoin%3D%22round%22/%3E%3Cpath%20d%3D%22M65%2076l8-13M81%2079l8-13M98%2081l7-11%22%20stroke%3D%22%23a7d4bd%22%20stroke-width%3D%224%22%20stroke-linecap%3D%22round%22/%3E%3C/svg%3E");
}

.float-bag {
  left: 8%;
  bottom: 10%;
  width: 132px;
  height: 132px;
  animation-delay: -5s;
  opacity: 0.16;
  background-image: url("data:image/svg+xml,%3Csvg%20width%3D%22136%22%20height%3D%22136%22%20viewBox%3D%220%200%20136%20136%22%20fill%3D%22none%22%20xmlns%3D%22http%3A//www.w3.org/2000/svg%22%3E%3Cpath%20d%3D%22M35%2053h66l7%2055H28l7-55Z%22%20stroke%3D%22%23a7d4bd%22%20stroke-width%3D%224%22%20stroke-linejoin%3D%22round%22/%3E%3Cpath%20d%3D%22M53%2053v-7c0-10%207-18%2015-18s15%208%2015%2018v7%22%20stroke%3D%22%238bbfa6%22%20stroke-width%3D%224%22%20stroke-linecap%3D%22round%22/%3E%3Cpath%20d%3D%22M49%2074h38M46%2088h44%22%20stroke%3D%22%238bbfa6%22%20stroke-width%3D%224%22%20stroke-linecap%3D%22round%22/%3E%3C/svg%3E");
}

.float-device {
  right: 10%;
  bottom: 12%;
  width: 112px;
  height: 112px;
  animation-delay: -3.5s;
  opacity: 0.13;
  background-image: url("data:image/svg+xml,%3Csvg%20width%3D%22120%22%20height%3D%22120%22%20viewBox%3D%220%200%20120%20120%22%20fill%3D%22none%22%20xmlns%3D%22http%3A//www.w3.org/2000/svg%22%3E%3Crect%20x%3D%2234%22%20y%3D%2220%22%20width%3D%2252%22%20height%3D%2280%22%20rx%3D%2210%22%20stroke%3D%22%238bbfa6%22%20stroke-width%3D%224%22/%3E%3Cpath%20d%3D%22M51%2087h18M47%2034h26%22%20stroke%3D%22%23a7d4bd%22%20stroke-width%3D%224%22%20stroke-linecap%3D%22round%22/%3E%3Ccircle%20cx%3D%2260%22%20cy%3D%2273%22%20r%3D%2210%22%20stroke%3D%22%238bbfa6%22%20stroke-width%3D%224%22/%3E%3C/svg%3E");
}

.float-book-soft {
  left: 28%;
  top: 7%;
  width: 84px;
  height: 84px;
  z-index: 0;
  opacity: 0.12;
  animation-delay: -7s;
}

.float-bag-soft {
  right: 28%;
  bottom: 6%;
  width: 92px;
  height: 92px;
  z-index: 0;
  opacity: 0.12;
  animation-delay: -4s;
}

.flow-person,
.flow-parcel {
  position: absolute;
  pointer-events: none;
  background-repeat: no-repeat;
  background-position: center;
  background-size: contain;
}

.flow-person {
  width: 104px;
  height: 142px;
  bottom: 18%;
  z-index: 2;
  opacity: 0.15;
  animation: person-breathe 10s ease-in-out infinite;
}

.flow-person-left {
  left: 12%;
  background-image: url("data:image/svg+xml,%3Csvg%20width%3D%22110%22%20height%3D%22148%22%20viewBox%3D%220%200%20110%20148%22%20fill%3D%22none%22%20xmlns%3D%22http%3A//www.w3.org/2000/svg%22%3E%3Ccircle%20cx%3D%2253%22%20cy%3D%2227%22%20r%3D%2216%22%20stroke%3D%22%238bbfa6%22%20stroke-width%3D%224%22/%3E%3Cpath%20d%3D%22M53%2046v42M34%2065c10%207%2028%207%2038%200M43%2088l-12%2034M64%2088l14%2034%22%20stroke%3D%22%238bbfa6%22%20stroke-width%3D%224%22%20stroke-linecap%3D%22round%22/%3E%3Cpath%20d%3D%22M72%2065l18%2010%22%20stroke%3D%22%23a7d4bd%22%20stroke-width%3D%224%22%20stroke-linecap%3D%22round%22/%3E%3Crect%20x%3D%2283%22%20y%3D%2267%22%20width%3D%2218%22%20height%3D%2216%22%20rx%3D%223%22%20stroke%3D%22%23a7d4bd%22%20stroke-width%3D%224%22/%3E%3C/svg%3E");
}

.flow-person-right {
  right: 12%;
  animation-delay: -2.5s;
  transform: scaleX(-1);
  background-image: url("data:image/svg+xml,%3Csvg%20width%3D%22110%22%20height%3D%22148%22%20viewBox%3D%220%200%20110%20148%22%20fill%3D%22none%22%20xmlns%3D%22http%3A//www.w3.org/2000/svg%22%3E%3Ccircle%20cx%3D%2253%22%20cy%3D%2227%22%20r%3D%2216%22%20stroke%3D%22%238bbfa6%22%20stroke-width%3D%224%22/%3E%3Cpath%20d%3D%22M53%2046v42M34%2065c10%207%2028%207%2038%200M43%2088l-12%2034M64%2088l14%2034%22%20stroke%3D%22%238bbfa6%22%20stroke-width%3D%224%22%20stroke-linecap%3D%22round%22/%3E%3Cpath%20d%3D%22M72%2065l18%2010%22%20stroke%3D%22%23a7d4bd%22%20stroke-width%3D%224%22%20stroke-linecap%3D%22round%22/%3E%3Crect%20x%3D%2283%22%20y%3D%2267%22%20width%3D%2218%22%20height%3D%2216%22%20rx%3D%223%22%20stroke%3D%22%23a7d4bd%22%20stroke-width%3D%224%22/%3E%3C/svg%3E");
}

.flow-parcel {
  left: 18%;
  bottom: 28%;
  width: 42px;
  height: 34px;
  z-index: 3;
  opacity: 0.17;
  animation: parcel-transfer 10s ease-in-out infinite;
  background-image: url("data:image/svg+xml,%3Csvg%20width%3D%2250%22%20height%3D%2240%22%20viewBox%3D%220%200%2050%2040%22%20fill%3D%22none%22%20xmlns%3D%22http%3A//www.w3.org/2000/svg%22%3E%3Crect%20x%3D%226%22%20y%3D%229%22%20width%3D%2238%22%20height%3D%2224%22%20rx%3D%224%22%20stroke%3D%22%23a7d4bd%22%20stroke-width%3D%224%22/%3E%3Cpath%20d%3D%22M8%2015h34M25%2010v22%22%20stroke%3D%22%238bbfa6%22%20stroke-width%3D%223%22%20stroke-linecap%3D%22round%22/%3E%3C/svg%3E");
}

.auth-layout {
  position: relative;
  z-index: 2;
}

@keyframes float-soft {
  0%,
  100% {
    transform: translate3d(0, 0, 0) rotate(-1.2deg);
  }

  50% {
    transform: translate3d(6px, -10px, 0) rotate(1.2deg);
  }
}

@keyframes person-breathe {
  0%,
  100% {
    translate: 0 0;
  }

  50% {
    translate: 0 -6px;
  }
}

@keyframes parcel-transfer {
  0% {
    transform: translate3d(0, 0, 0) rotate(-4deg);
    opacity: 0;
  }

  12%,
  82% {
    opacity: 0.16;
  }

  50% {
    transform: translate3d(28vw, -10px, 0) rotate(3deg);
    opacity: 0.18;
  }

  100% {
    transform: translate3d(56vw, 0, 0) rotate(-4deg);
    opacity: 0;
  }
}

@media (prefers-reduced-motion: reduce) {
  .float-item,
  .flow-person,
  .flow-parcel {
    animation: none;
  }
}

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

.topbar h1,
.auth-copy h2,
.panel h2 {
  margin: 0 0 8px;
  line-height: 1.18;
}

.topbar h1 {
  font-size: 30px;
}

.user-actions {
  display: flex;
  align-items: center;
  gap: 10px;
}

.theme-toggle {
  width: 42px;
  height: 42px;
  flex: 0 0 42px;
  padding: 0;
  border-radius: 50%;
  display: grid;
  place-items: center;
  overflow: hidden;
  background: var(--control-bg);
  color: #d9902d;
  box-shadow: 0 6px 16px rgba(25, 33, 31, 0.08);
}

.theme-toggle:hover:not(:disabled) {
  color: #eea735;
  transform: translateY(-2px) rotate(4deg);
}

.theme-toggle.is-dark {
  color: #dcebe4;
}

.theme-toggle.is-dark:hover:not(:disabled) {
  color: #ffffff;
  transform: translateY(-2px) rotate(-4deg);
}

.theme-icon {
  position: relative;
  width: 22px;
  height: 22px;
  display: block;
  transform: rotate(0deg);
  transition: transform 0.65s cubic-bezier(0.2, 0.8, 0.2, 1);
}

.theme-rays {
  position: absolute;
  inset: 0;
  border-radius: 50%;
  background: repeating-conic-gradient(currentColor 0 7deg, transparent 7deg 45deg);
  -webkit-mask: radial-gradient(circle, transparent 0 45%, #000 47% 64%, transparent 66%);
  mask: radial-gradient(circle, transparent 0 45%, #000 47% 64%, transparent 66%);
  opacity: 1;
  transform: scale(1);
  transition:
    opacity 0.32s ease,
    transform 0.5s ease;
}

.theme-orb {
  position: absolute;
  width: 10px;
  height: 10px;
  left: 6px;
  top: 6px;
  border-radius: 50%;
  background: currentColor;
  transform: scale(1);
  transition:
    width 0.5s ease,
    height 0.5s ease,
    left 0.5s ease,
    top 0.5s ease,
    transform 0.5s ease;
}

.theme-orb::after {
  content: "";
  position: absolute;
  inset: -1px;
  border-radius: 50%;
  background: var(--control-bg);
  opacity: 0;
  transform: translate(0, 0) scale(0.65);
  transition:
    opacity 0.24s ease,
    transform 0.5s cubic-bezier(0.2, 0.8, 0.2, 1),
    background-color 0.28s ease;
}

.theme-toggle.is-dark .theme-icon {
  transform: rotate(180deg);
}

.theme-toggle.is-dark .theme-rays {
  opacity: 0;
  transform: scale(0.25) rotate(45deg);
}

.theme-toggle.is-dark .theme-orb {
  width: 16px;
  height: 16px;
  left: 3px;
  top: 3px;
}

.theme-toggle.is-dark .theme-orb::after {
  opacity: 1;
  transform: translate(5px, -4px) scale(0.92);
}

.avatar {
  width: 42px;
  height: 42px;
  border-radius: 50%;
  display: grid;
  place-items: center;
  color: #fff;
  font-weight: 800;
  background: var(--accent);
  background-size: cover;
  background-position: center;
}

.panel,
.item-card,
.modal,
.drawer {
  background: var(--surface-raised);
  border: 1px solid var(--line);
  border-radius: 8px;
  box-shadow: var(--shadow);
}

.auth-layout {
  min-height: 68vh;
  display: grid;
  grid-template-columns: minmax(0, 1fr) 400px;
  align-items: center;
  gap: 42px;
}

.auth-only .auth-layout {
  width: min(440px, 100%);
  min-height: auto;
  grid-template-columns: 1fr;
  justify-items: stretch;
  gap: 16px;
}

.auth-only .auth-copy {
  text-align: center;
}

.brand-logo {
  width: 56px;
  height: 56px;
  margin: 0 auto 14px;
  display: grid;
  place-items: center;
  border-radius: 18px;
  color: var(--accent-dark);
  font-size: 25px;
  font-weight: 800;
  background: linear-gradient(135deg, #e3f4eb, #bee5d3);
  box-shadow: 0 8px 22px rgba(58, 145, 111, 0.16);
}

.auth-only .auth-copy h2 {
  font-size: 32px;
  max-width: none;
  margin-bottom: 9px;
}

.auth-only .auth-copy p {
  max-width: none;
  font-size: 15px;
  line-height: 1.7;
}

.auth-only .demo-box {
  margin-top: 14px;
  text-align: left;
  background: rgba(255, 251, 242, 0.58);
  border-left-color: rgba(79, 154, 120, 0.72);
  border-radius: 12px;
}

.auth-only .auth-panel {
  border-radius: 16px;
  background: rgba(255, 251, 242, 0.5);
  border-color: rgba(221, 216, 205, 0.5);
  box-shadow: 0 22px 46px rgba(80, 63, 39, 0.1);
  backdrop-filter: blur(8px);
  padding: 28px 30px 30px;
}

.auth-only .auth-panel input {
  min-height: 44px;
  background: rgba(255, 253, 248, 0.72);
  border-color: rgba(221, 216, 205, 0.78);
  padding: 13px 14px;
  transition:
    border-color 0.22s ease,
    background 0.22s ease,
    box-shadow 0.22s ease;
}

.auth-only .auth-panel label {
  position: relative;
  align-items: start;
  gap: 7px;
  color: var(--muted);
  font-size: 12px;
  font-weight: 600;
  line-height: 1.2;
  text-align: left;
  letter-spacing: 0;
}

.auth-only .auth-panel label::after {
  content: "";
  position: absolute;
  left: 0;
  right: 0;
  bottom: 0;
  height: 2px;
  border-radius: 999px;
  background: linear-gradient(90deg, var(--accent), rgba(79, 154, 120, 0));
  transform: scaleX(0);
  transform-origin: left;
  transition: transform 0.24s ease;
}

.auth-only .auth-panel label:focus-within::after {
  transform: scaleX(1);
}

.auth-only .auth-panel input:focus {
  background: var(--control-bg);
  border-color: var(--accent);
  box-shadow:
    0 0 0 3px rgba(79, 154, 120, 0.12),
    inset 0 1px 0 rgba(255, 255, 255, 0.62);
}

.auth-only .segmented {
  background: var(--surface-soft);
  border-radius: 14px;
  margin-bottom: 20px;
}

.auth-only .segmented button.active {
  background: var(--mint-soft);
  color: var(--accent-dark);
  box-shadow: 0 8px 18px rgba(79, 154, 120, 0.13);
}

.auth-only .segmented button:not(.active) {
  color: var(--muted);
}

.auth-submit {
  width: 100%;
  min-height: 50px;
  margin-top: 8px;
  border: 0;
  border-radius: 12px;
  font-size: 17px;
}

.login-options {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin: 4px 2px 14px;
  color: var(--muted);
  font-size: 14px;
}

.remember-check {
  display: flex;
  grid-template-columns: none;
  align-items: center;
  gap: 8px;
  margin: 0;
  color: var(--muted);
  font-size: 14px;
  font-weight: 500;
}

.remember-check input[type="checkbox"] {
  flex: 0 0 auto;
  appearance: none;
  display: grid;
  place-items: center;
  width: 16px;
  height: 16px;
  min-height: 16px;
  margin: 0;
  padding: 0;
  border: 1px solid var(--mint-line);
  border-radius: 4px;
  background: var(--control-bg);
  accent-color: var(--accent);
}

.remember-check input[type="checkbox"]:checked {
  background: var(--accent);
  border-color: var(--accent);
}

.remember-check input[type="checkbox"]:checked::before {
  content: "";
  width: 5px;
  height: 9px;
  border: solid #fff;
  border-width: 0 2px 2px 0;
  transform: translateY(-1px) rotate(45deg);
}

.remember-check input[type="checkbox"]:focus {
  box-shadow: 0 0 0 3px rgba(79, 154, 120, 0.14);
}

.remember-check::after {
  display: none;
}

.error-message {
  margin: 2px 0 10px;
  color: #c94d4d;
  font-size: 13px;
  line-height: 1.5;
}

.register-tip,
.auth-trust {
  color: var(--muted);
  text-align: center;
  font-size: 14px;
}

.register-tip {
  margin: 16px 0 0;
}

.link-inline {
  min-height: auto;
  border: 0;
  padding: 0;
  color: var(--accent-dark);
  background: transparent;
  font-weight: 700;
}

.link-inline:hover:not(:disabled) {
  color: var(--accent);
  transform: none;
}

.auth-trust {
  margin: 0;
  font-size: 13px;
}

.auth-copy h2 {
  font-size: 48px;
  max-width: 720px;
}

.auth-copy p {
  max-width: 620px;
  color: var(--muted);
  font-size: 18px;
  line-height: 1.8;
}

.demo-box {
  display: inline-block;
  margin-top: 24px;
  padding: 12px 16px;
  border-left: 4px solid var(--gold);
  background: var(--surface);
}

.auth-panel,
.form-panel,
.panel {
  padding: 22px;
}

.segmented {
  display: grid;
  grid-template-columns: 1fr 1fr;
  background: var(--surface-soft);
  padding: 4px;
  border-radius: 8px;
  margin-bottom: 18px;
}

.segmented button {
  border: 0;
  background: transparent;
}

.segmented button.active {
  background: var(--surface);
  color: var(--accent-dark);
  font-weight: 700;
}

label {
  display: grid;
  gap: 8px;
  color: var(--muted);
  font-size: 14px;
  margin-bottom: 14px;
}

input,
select,
textarea {
  width: 100%;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 11px 12px;
  color: var(--ink);
  background: var(--control-bg);
  outline: none;
}

input:focus,
select:focus,
textarea:focus {
  border-color: var(--accent);
  box-shadow: 0 0 0 3px rgba(31, 122, 92, 0.12);
}

.workspace {
  display: grid;
  gap: 18px;
}

.filters {
  display: grid;
  grid-template-columns: 1.6fr 1fr 0.8fr 0.8fr auto;
  align-items: end;
  gap: 12px;
}

.filters label {
  margin: 0;
}

.settings-grid {
  display: grid;
  gap: 18px;
  max-width: 760px;
}

.switch-row {
  display: flex;
  align-items: flex-start;
  gap: 12px;
  padding: 16px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface-soft);
}

.switch-row input {
  width: 20px;
  height: 20px;
  margin-top: 2px;
  accent-color: var(--accent);
}

.switch-row span {
  display: grid;
  gap: 5px;
}

.switch-row small,
.hint-text {
  color: var(--muted);
  line-height: 1.7;
}

.hint-text {
  margin: -4px 0 0;
}

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

.item-card {
  overflow: hidden;
  cursor: pointer;
  transition: 0.2s ease;
}

.item-card:hover {
  transform: translateY(-3px);
  border-color: var(--mint-line);
}

.item-image,
.detail-image {
  background:
    linear-gradient(135deg, rgba(31, 122, 92, 0.15), rgba(217, 144, 45, 0.16)),
    var(--surface-soft);
  display: grid;
  place-items: center;
  color: var(--accent-dark);
  font-weight: 800;
}

.item-image {
  height: 170px;
}

.item-image img,
.detail-image img,
.image-strip img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.item-content {
  padding: 15px;
}

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

.item-head h3,
.order-card h3 {
  margin: 0;
  font-size: 17px;
}

.item-head strong,
.detail-price,
.order-card strong {
  color: var(--gold);
  font-size: 20px;
}

.meta {
  display: flex;
  flex-wrap: wrap;
  gap: 7px;
}

.meta span,
.status {
  border: 1px solid var(--mint-line);
  color: var(--accent-dark);
  background: var(--mint-soft);
  border-radius: 999px;
  padding: 5px 9px;
  font-size: 12px;
}

.status {
  font-style: normal;
}

.status.status-sale,
.meta span.status-sale {
  color: #16633f;
  background: rgba(36, 143, 89, 0.14);
  border-color: rgba(36, 143, 89, 0.35);
}

.status.status-warning,
.meta span.status-warning {
  color: #8a5a08;
  background: rgba(217, 144, 45, 0.18);
  border-color: rgba(217, 144, 45, 0.38);
}

.status.status-danger,
.meta span.status-danger {
  color: #9d2f2f;
  background: rgba(184, 66, 66, 0.13);
  border-color: rgba(184, 66, 66, 0.32);
}

.stats-grid {
  display: grid;
  grid-template-columns: repeat(5, minmax(0, 1fr));
  gap: 12px;
  margin-bottom: 18px;
}

.stat-card {
  padding: 16px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface);
  box-shadow: var(--shadow-soft);
}

.stat-card span {
  display: block;
  color: var(--muted);
  font-size: 13px;
  margin-bottom: 8px;
}

.stat-card strong {
  font-size: 28px;
  color: var(--accent-dark);
}

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

.pagination {
  justify-content: center;
}

.section-actions {
  display: flex;
  align-items: center;
  gap: 10px;
}

.section-actions select {
  min-width: 130px;
}

.two-column {
  display: grid;
  grid-template-columns: 1.05fr 0.95fr;
  gap: 18px;
  align-items: start;
}

.form-grid,
.order-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
}

.image-strip {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 10px;
  margin: 12px 0;
}

.image-strip img {
  height: 84px;
  border-radius: 8px;
  border: 1px solid var(--line);
}

.editable-images {
  grid-template-columns: repeat(5, minmax(0, 1fr));
}

.image-thumb {
  position: relative;
  min-width: 0;
  display: grid;
  gap: 6px;
}

.cover-badge {
  position: absolute;
  top: 6px;
  left: 6px;
  padding: 3px 7px;
  border-radius: 999px;
  color: #fff;
  background: rgba(25, 33, 31, 0.72);
  font-size: 12px;
  font-weight: 700;
}

.thumb-actions {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 6px;
}

.thumb-actions button {
  min-height: 30px;
  padding: 5px 6px;
  font-size: 12px;
}

.item-note {
  color: var(--muted);
  font-size: 12px;
  line-height: 1.6;
}

.detail-note {
  margin: 10px 0;
}

.compact-list {
  display: grid;
  gap: 10px;
}

.compact-row,
.order-card,
.notice {
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 14px;
  background: var(--surface);
}

.admin-table,
.log-list {
  display: grid;
  gap: 10px;
}

.admin-row {
  display: grid;
  grid-template-columns: 1.5fr 0.7fr 0.7fr 1fr 1.3fr;
  align-items: center;
  gap: 12px;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 12px 14px;
  background: var(--surface);
}

.admin-row.item-admin-row {
  grid-template-columns: 1.7fr 0.8fr 0.6fr 0.7fr 1fr;
}

.table-head {
  color: var(--muted);
  background: var(--surface-soft);
  font-size: 13px;
  font-weight: 700;
  box-shadow: none;
}

.link-button,
.log-entry {
  border: 0;
  padding: 0;
  background: transparent;
  text-align: left;
}

.link-button {
  color: var(--accent-dark);
  font-weight: 700;
}

.log-entry {
  display: grid;
  gap: 7px;
  border: 1px solid var(--line);
  border-left: 4px solid var(--accent);
  border-radius: 8px;
  padding: 14px;
  background: var(--surface);
}

.log-entry span:last-child {
  color: var(--muted);
  font-size: 13px;
}

.compact-row {
  display: flex;
  justify-content: space-between;
  gap: 14px;
  align-items: center;
}

.compact-row div:first-child {
  display: grid;
  gap: 5px;
}

.order-card {
  display: grid;
  gap: 20px;
}

.modal-backdrop,
.drawer-backdrop {
  position: fixed;
  inset: 0;
  background: rgba(25, 33, 31, 0.45);
  z-index: 40;
}

.modal {
  width: min(620px, calc(100vw - 32px));
  max-height: calc(100vh - 32px);
  overflow: auto;
  margin: 16px auto;
  padding: 22px;
  position: relative;
}

.close {
  position: absolute;
  top: 14px;
  right: 14px;
  width: 36px;
  height: 36px;
  padding: 0;
}

.detail-image {
  height: 280px;
  border-radius: 8px;
  overflow: hidden;
  margin-bottom: 18px;
  position: relative;
}

.detail-image.clickable {
  cursor: zoom-in;
}

.view-original {
  position: absolute;
  right: 12px;
  bottom: 12px;
  color: #fff;
  background: rgba(25, 33, 31, 0.72);
  border-color: rgba(255, 255, 255, 0.22);
}

.detail-thumbs {
  display: flex;
  gap: 8px;
  margin: -8px 0 16px;
  overflow-x: auto;
  padding-bottom: 4px;
}

.detail-thumbs button {
  width: 64px;
  height: 54px;
  padding: 2px;
  border-radius: 8px;
  flex: 0 0 auto;
}

.detail-thumbs button.active {
  border-color: var(--accent);
  box-shadow: 0 0 0 2px rgba(31, 122, 92, 0.18);
}

.detail-thumbs img {
  width: 100%;
  height: 100%;
  border-radius: 6px;
  object-fit: cover;
}

.image-viewer-backdrop {
  position: fixed;
  inset: 0;
  z-index: 60;
  display: grid;
  place-items: center;
  padding: 24px;
  background: rgba(0, 0, 0, 0.86);
}

.image-viewer {
  position: relative;
  width: min(1100px, calc(100vw - 48px));
  height: min(760px, calc(100vh - 48px));
  display: grid;
  place-items: center;
}

.image-viewer img {
  max-width: 100%;
  max-height: 100%;
  object-fit: contain;
  border-radius: 8px;
  box-shadow: 0 20px 80px rgba(0, 0, 0, 0.42);
}

.image-viewer-close {
  top: 0;
  right: 0;
  color: #fff;
  background: rgba(255, 255, 255, 0.12);
  border-color: rgba(255, 255, 255, 0.2);
}

.viewer-nav {
  position: absolute;
  top: 50%;
  width: 44px;
  height: 56px;
  padding: 0;
  transform: translateY(-50%);
  color: #fff;
  background: rgba(255, 255, 255, 0.14);
  border-color: rgba(255, 255, 255, 0.2);
  font-size: 34px;
}

.viewer-prev {
  left: 0;
}

.viewer-next {
  right: 0;
}

.viewer-toolbar {
  position: absolute;
  left: 50%;
  bottom: 0;
  display: flex;
  align-items: center;
  gap: 14px;
  transform: translateX(-50%);
  color: #fff;
  padding: 9px 13px;
  border-radius: 999px;
  background: rgba(25, 33, 31, 0.72);
}

.viewer-toolbar a {
  color: #fff;
  font-weight: 700;
}


.detail-price {
  font-weight: 800;
  margin-bottom: 12px;
}

.detail-meta {
  margin: 16px 0;
}

.drawer {
  margin-left: auto;
  width: min(420px, calc(100vw - 24px));
  height: 100vh;
  padding: 22px;
  overflow: auto;
  border-radius: 0;
}

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

.notice.unread {
  border-left: 4px solid var(--gold);
}

.toast {
  position: fixed;
  left: 50%;
  bottom: 24px;
  transform: translateX(-50%);
  padding: 12px 18px;
  background: var(--ink);
  color: #fff;
  border-radius: 8px;
  z-index: 40;
}

:root.theme-wipe-to-dark::before,
:root.theme-wipe-to-light::before {
  content: "";
  position: fixed;
  inset: 0;
  z-index: 9999;
  pointer-events: none;
  background: var(--theme-overlay-color, #101513);
  will-change: clip-path, opacity;
  contain: paint;
}

:root.theme-wipe-to-dark::before {
  animation: theme-wipe-expand 460ms cubic-bezier(0.22, 0.8, 0.24, 1) both;
}

:root.theme-wipe-to-light::before {
  animation: theme-wipe-focus 420ms cubic-bezier(0.55, 0, 0.35, 1) both;
}

@keyframes theme-wipe-expand {
  from {
    clip-path: circle(0 at var(--theme-x) var(--theme-y));
  }

  to {
    clip-path: circle(150vmax at var(--theme-x) var(--theme-y));
  }
}

@keyframes theme-wipe-focus {
  from {
    clip-path: circle(150vmax at var(--theme-x) var(--theme-y));
  }

  to {
    clip-path: circle(0 at var(--theme-x) var(--theme-y));
  }
}

:root[data-theme="dark"] .auth-only .app-shell::before {
  background: linear-gradient(
    to bottom,
    rgba(58, 105, 83, 0.42),
    rgba(16, 21, 19, 0.18)
  );
}

:root[data-theme="dark"] .auth-panel {
  background: rgba(25, 32, 29, 0.78);
  border-color: rgba(79, 128, 106, 0.42);
}

:root[data-theme="dark"] .auth-only .auth-panel input {
  background: rgba(31, 40, 36, 0.92);
  border-color: rgba(79, 128, 106, 0.6);
}

:root[data-theme="dark"] .modal-backdrop,
:root[data-theme="dark"] .drawer-backdrop {
  background: rgba(0, 0, 0, 0.62);
}

:root[data-theme="dark"] .theme-toggle {
  box-shadow: 0 6px 18px rgba(0, 0, 0, 0.28);
}

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

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

  .sidebar {
    min-height: auto;
    position: static;
    flex-direction: row;
    align-items: center;
    overflow-x: auto;
  }

  :root[data-theme="dark"] .layout-root:not(.auth-only) .sidebar {
    background: rgba(20, 27, 24, 0.98);
    border-color: var(--line);
    box-shadow: 0 -12px 34px rgba(0, 0, 0, 0.28);
  }

  .brand {
    margin: 0 14px 0 0;
  }

  .sidebar-note {
    display: none;
  }

  .layout-root.sidebar-collapsed .sidebar {
    padding: 18px;
    align-items: center;
  }

  .layout-root.sidebar-collapsed .brand-text,
  .layout-root.sidebar-collapsed .nav-label {
    display: inline;
  }

  .layout-root.sidebar-collapsed .sidebar button {
    width: auto;
    height: auto;
    padding: 10px 14px;
  }

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

  .filters,
  .auth-layout,
  .two-column {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 680px) {
  .stats-grid,
  .editable-images {
    grid-template-columns: 1fr;
  }

  body {
    background:
      linear-gradient(135deg, rgba(31, 122, 92, 0.06), transparent 44%),
      var(--bg);
  }

  .layout-root:not(.auth-only) {
    display: block;
    padding-bottom: calc(72px + env(safe-area-inset-bottom));
  }

  .layout-root:not(.auth-only) .sidebar,
  .layout-root.sidebar-collapsed:not(.auth-only) .sidebar {
    position: fixed;
    left: 0;
    right: 0;
    bottom: 0;
    top: auto;
    z-index: 30;
    display: grid;
    grid-auto-flow: column;
    grid-auto-columns: minmax(72px, 1fr);
    align-items: stretch;
    gap: 6px;
    min-height: 0;
    padding: 8px 10px calc(8px + env(safe-area-inset-bottom));
    overflow-x: auto;
    border-top: 1px solid var(--line);
    border-right: 0;
    background: rgba(255, 255, 255, 0.96);
    box-shadow: 0 -12px 34px rgba(25, 33, 31, 0.1);
  }

  .layout-root:not(.auth-only) .brand,
  .layout-root:not(.auth-only) .sidebar-toggle,
  .layout-root:not(.auth-only) .sidebar-note {
    display: none;
  }

  .layout-root:not(.auth-only) .sidebar button,
  .layout-root.sidebar-collapsed:not(.auth-only) .sidebar button {
    justify-content: center;
    width: auto;
    height: auto;
    min-height: 52px;
    padding: 6px 8px;
    gap: 4px;
    flex-direction: column;
    text-align: center;
    font-size: 12px;
  }

  .layout-root:not(.auth-only) .nav-code,
  .layout-root.sidebar-collapsed:not(.auth-only) .nav-code {
    display: grid;
    width: 24px;
    height: 24px;
    font-size: 12px;
  }

  .layout-root.sidebar-collapsed:not(.auth-only) .nav-label {
    display: inline;
  }

  .app-shell {
    padding: 14px;
  }

  .topbar,
  .compact-row {
    flex-direction: column;
    align-items: stretch;
  }

  .topbar {
    gap: 12px;
    margin-bottom: 16px;
  }

  .topbar h1 {
    font-size: 24px;
  }

  .topbar p {
    font-size: 13px;
    line-height: 1.5;
  }

  .user-actions,
  .section-title,
  .form-actions,
  .pagination {
    flex-wrap: wrap;
  }

  .user-actions button,
  .form-actions button,
  .pagination button {
    flex: 1 1 auto;
  }

  .user-actions .theme-toggle {
    flex: 0 0 42px;
  }

  .auth-copy h2 {
    font-size: 34px;
  }

  .auth-only .auth-copy h2 {
    font-size: 28px;
  }

  .auth-only .app-shell {
    min-height: 100dvh;
    padding: 16px;
  }

  .auth-only .auth-layout {
    width: 100%;
  }

  .brand-logo {
    width: 50px;
    height: 50px;
    margin-bottom: 12px;
    border-radius: 16px;
    font-size: 22px;
  }

  .auth-only .auth-panel {
    padding: 22px 20px 24px;
    border-radius: 18px;
  }

  .auth-submit {
    min-height: 50px;
  }

  .float-item {
    width: 78px;
    height: 78px;
  }

  .float-shoe,
  .float-bag {
    width: 92px;
    height: 92px;
  }

  .float-device,
  .float-book-soft,
  .float-bag-soft {
    display: none;
  }

  .flow-person {
    width: 70px;
    height: 94px;
    bottom: 10%;
  }

  .flow-person-left {
    left: 5%;
  }

  .flow-person-right {
    right: 5%;
  }

  .flow-parcel {
    left: 16%;
    bottom: 16%;
    width: 32px;
    height: 26px;
  }

  .panel,
  .auth-panel,
  .form-panel {
    padding: 16px;
  }

  button,
  input,
  select,
  textarea {
    min-height: 44px;
  }

  .filters {
    gap: 10px;
  }

  .catalog,
  .form-grid,
  .order-grid,
  .admin-row,
  .admin-row.item-admin-row {
    grid-template-columns: 1fr;
  }

  .catalog {
    gap: 14px;
  }

  .item-image {
    height: 190px;
  }

  .item-content {
    padding: 14px;
  }

  .item-head {
    gap: 10px;
  }

  .item-head strong {
    white-space: nowrap;
  }

  .image-strip {
    grid-template-columns: repeat(2, 1fr);
  }

  .admin-table {
    gap: 12px;
  }

  .admin-row.table-head {
    display: none;
  }

  .admin-row,
  .admin-row.item-admin-row {
    align-items: stretch;
    padding: 14px;
    gap: 9px;
  }

  .row-actions {
    justify-content: stretch;
    flex-wrap: wrap;
    gap: 8px;
  }

  .row-actions button {
    flex: 1 1 118px;
  }

  .log-entry {
    padding: 13px;
  }

  .modal-backdrop,
  .drawer-backdrop {
    background: rgba(25, 33, 31, 0.52);
  }

  .modal {
    width: 100vw;
    max-height: none;
    min-height: 100dvh;
    margin: 0;
    padding: 18px 16px 24px;
    border-radius: 0;
    border-left: 0;
    border-right: 0;
  }

  .close {
    top: 12px;
    right: 12px;
  }

  .detail-image {
    height: 220px;
    margin-top: 42px;
  }

  .drawer {
    width: 100vw;
    padding: 18px 16px calc(18px + env(safe-area-inset-bottom));
  }

  .drawer .section-title {
    align-items: flex-start;
    gap: 12px;
  }

  .drawer-actions {
    width: 100%;
  }

  .drawer-actions button {
    flex: 1 1 118px;
  }

  .toast {
    width: calc(100vw - 28px);
    bottom: calc(84px + env(safe-area-inset-bottom));
    text-align: center;
  }
}

@media (prefers-reduced-motion: reduce) {
  .theme-icon,
  .theme-rays,
  .theme-orb,
  .theme-orb::after {
    animation: none;
    transition: none;
  }
}

