:root {
  --ink: #17211d;
  --ink-2: #43524b;
  --ink-3: #77847d;
  --line: #e4eae6;
  --line-strong: #d5ded8;
  --canvas: #f4f7f5;
  --card: #ffffff;
  --green-950: #0b241b;
  --green-900: #0d2e23;
  --green-800: #124132;
  --green-700: #17634a;
  --green-600: #1d7f5e;
  --green-500: #2a9972;
  --green-100: #e7f4ed;
  --green-50: #f2f9f5;
  --amber-100: #fff4dd;
  --amber-600: #b8740b;
  --blue-100: #e8f1ff;
  --blue-600: #2c67c9;
  --violet-100: #f0ecff;
  --violet-600: #6750c7;
  --red-100: #ffeceb;
  --red-600: #c7443a;
  --shadow-sm: 0 1px 2px rgba(16, 37, 27, 0.04), 0 6px 18px rgba(16, 37, 27, 0.03);
  --shadow-md: 0 16px 48px rgba(10, 31, 22, 0.12);
  --sidebar-w: 244px;
  --radius: 16px;
  --radius-sm: 10px;
  --font: "Inter", "HarmonyOS Sans SC", "PingFang SC", "Microsoft YaHei", "Noto Sans SC", sans-serif;
}

* {
  box-sizing: border-box;
}

[hidden] {
  display: none !important;
}

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

body {
  margin: 0;
  min-height: 100vh;
  color: var(--ink);
  background: var(--canvas);
  font-family: var(--font);
  font-size: 14px;
  line-height: 1.55;
  -webkit-font-smoothing: antialiased;
}

body.modal-open {
  overflow: hidden;
}

button,
input,
select,
textarea {
  font-family: inherit;
  font-size: inherit;
}

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

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

h1, h2, h3, h4, p {
  margin: 0;
}

button {
  cursor: pointer;
}

.icon {
  flex: none;
  vertical-align: middle;
}

::selection {
  background: #bfe5d3;
}

/* ---------- boot ---------- */
.boot-screen {
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 24px;
}

.boot-brand,
.brand {
  display: flex;
  align-items: center;
  gap: 12px;
}

.brand-mark {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 40px;
  height: 40px;
  border-radius: 12px;
  color: #effaf4;
  background: linear-gradient(145deg, #2daa7d, #166749);
  font-size: 18px;
  font-weight: 700;
  letter-spacing: -1px;
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.25);
}

.boot-brand strong,
.brand strong {
  display: block;
  font-size: 16px;
  letter-spacing: 0.02em;
}

.boot-brand span,
.brand span {
  display: block;
  margin-top: 1px;
  font-size: 9px;
  letter-spacing: 0.18em;
  opacity: 0.55;
}

/* ---------- login ---------- */
.login-page {
  min-height: 100vh;
  display: grid;
  grid-template-columns: minmax(0, 1.18fr) minmax(460px, 0.82fr);
  background: #fbfcfb;
}

.login-story {
  position: relative;
  overflow: hidden;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  min-height: 100vh;
  padding: 46px 58px 44px;
  color: #effaf4;
  background:
    radial-gradient(1000px 520px at 90% 108%, rgba(52, 160, 119, 0.3), transparent 66%),
    radial-gradient(640px 460px at -8% -12%, rgba(83, 165, 129, 0.26), transparent 64%),
    linear-gradient(142deg, #0a2119 0%, #0c2b20 48%, #0b3526 100%);
}

.login-story::before,
.login-story::after {
  content: "";
  position: absolute;
  border: 1px solid rgba(176, 230, 205, 0.12);
  border-radius: 50%;
  pointer-events: none;
}

.login-story::before {
  width: 540px;
  height: 540px;
  right: -190px;
  bottom: -190px;
}

.login-story::after {
  width: 380px;
  height: 380px;
  right: -80px;
  bottom: -100px;
}

.story-brand {
  position: relative;
  z-index: 1;
}

.story-brand .brand-mark {
  width: 44px;
  height: 44px;
  border-radius: 13px;
}

.story-content {
  position: relative;
  z-index: 1;
  max-width: 640px;
  margin: 52px 0;
}

.eyebrow {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  color: #9fd8bd;
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 0.2em;
  text-transform: uppercase;
}

.eyebrow::before {
  content: "";
  width: 24px;
  height: 1px;
  background: currentColor;
  opacity: 0.65;
}

.story-content h1 {
  margin-top: 20px;
  max-width: 600px;
  font-size: clamp(38px, 4.5vw, 62px);
  font-weight: 650;
  line-height: 1.13;
  letter-spacing: -0.045em;
}

.story-content h1 em {
  color: #79cda6;
  font-style: normal;
}

.story-content > p {
  max-width: 480px;
  margin-top: 22px;
  color: rgba(226, 243, 235, 0.62);
  font-size: 14px;
  line-height: 1.9;
}

.story-metrics {
  position: relative;
  z-index: 1;
  display: flex;
  gap: 40px;
  padding-top: 26px;
  border-top: 1px solid rgba(201, 237, 220, 0.12);
}

.story-metrics div {
  display: grid;
  gap: 2px;
}

.story-metrics strong {
  font-size: 22px;
  font-weight: 600;
  letter-spacing: -0.02em;
}

.story-metrics span {
  color: rgba(210, 238, 224, 0.48);
  font-size: 11px;
  letter-spacing: 0.08em;
}

.story-float {
  position: absolute;
  right: 9%;
  top: 24%;
  z-index: 1;
  width: 210px;
  padding: 16px;
  border: 1px solid rgba(207, 241, 224, 0.15);
  border-radius: 16px;
  background: rgba(255, 255, 255, 0.055);
  backdrop-filter: blur(10px);
  transform: rotate(3deg);
  box-shadow: 0 30px 70px rgba(0, 0, 0, 0.18);
}

.story-float small {
  color: rgba(211, 238, 225, 0.55);
  font-size: 10px;
  letter-spacing: 0.08em;
}

.story-float strong {
  display: block;
  margin-top: 5px;
  font-size: 20px;
  font-weight: 600;
}

.story-float .float-line {
  height: 44px;
  margin-top: 14px;
  border-radius: 8px;
  background: linear-gradient(90deg, rgba(72, 179, 132, 0.22), transparent);
  position: relative;
}

.story-float .float-line::after {
  content: "";
  position: absolute;
  inset: 12px 10px auto;
  height: 2px;
  background: linear-gradient(90deg, #4bc793, transparent);
  transform: skewY(-9deg);
}

.login-panel {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 40px;
  background:
    radial-gradient(600px 400px at 110% -10%, #eff7f2, transparent 70%),
    #fbfcfb;
}

.login-card {
  width: min(100%, 400px);
}

.login-mobile-brand {
  display: none;
  margin-bottom: 32px;
}

.login-card h2 {
  font-size: 28px;
  font-weight: 650;
  letter-spacing: -0.035em;
}

.login-card .login-sub {
  margin-top: 8px;
  color: var(--ink-3);
  font-size: 13px;
}

.login-form {
  display: grid;
  gap: 18px;
  margin-top: 34px;
}

.login-card .btn {
  height: 48px;
  margin-top: 4px;
}

.login-hint {
  display: flex;
  gap: 9px;
  align-items: flex-start;
  margin-top: 22px;
  padding: 12px 14px;
  border: 1px solid #e2ece6;
  border-radius: 10px;
  background: #f6faf7;
  color: #66756d;
  font-size: 12px;
  line-height: 1.7;
}

.login-hint .icon {
  margin-top: 1px;
  color: var(--green-600);
}

.login-foot {
  margin-top: 46px;
  color: #9aa69f;
  font-size: 11px;
  letter-spacing: 0.04em;
}

.login-error {
  display: none;
  align-items: flex-start;
  gap: 8px;
  padding: 10px 12px;
  border: 1px solid #f3d3cf;
  border-radius: 9px;
  background: #fff6f5;
  color: var(--red-600);
  font-size: 12px;
}

.login-error.show {
  display: flex;
}

/* ---------- forms ---------- */
.field {
  display: grid;
  gap: 6px;
}

.field > label,
.field-label {
  color: #35443d;
  font-size: 12px;
  font-weight: 600;
}

.field .required {
  color: #c95346;
}

.input,
.select,
.textarea {
  width: 100%;
  min-height: 42px;
  padding: 9px 12px;
  color: var(--ink);
  border: 1px solid var(--line-strong);
  border-radius: 9px;
  outline: none;
  background: #fff;
  transition: border-color 0.18s, box-shadow 0.18s, background 0.18s;
}

.textarea {
  min-height: 88px;
  resize: vertical;
  line-height: 1.6;
}

.input::placeholder,
.textarea::placeholder {
  color: #aab4ae;
}

.input:hover,
.select:hover,
.textarea:hover {
  border-color: #c3d1c9;
}

.input:focus,
.select:focus,
.textarea:focus {
  border-color: var(--green-500);
  box-shadow: 0 0 0 3px rgba(42, 153, 114, 0.1);
}

.select {
  appearance: none;
  padding-right: 34px;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='8' viewBox='0 0 12 8'%3E%3Cpath d='m1 1 5 5 5-5' fill='none' stroke='%2377847d' stroke-width='1.6' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 12px center;
}

.input[type="date"],
.input[type="datetime-local"] {
  min-width: 0;
}

.input-icon {
  position: relative;
}

.input-icon .icon {
  position: absolute;
  left: 12px;
  top: 50%;
  color: #94a19a;
  transform: translateY(-50%);
  pointer-events: none;
}

.input-icon .input {
  padding-left: 36px;
}

.input-icon .password-toggle {
  left: auto;
  right: 8px;
  width: 30px;
  height: 30px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border: 0;
  border-radius: 7px;
  color: #87958d;
  background: transparent;
  pointer-events: auto;
}

.field-hint {
  color: #8a9790;
  font-size: 11px;
  line-height: 1.55;
}

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

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

.form-grid .span-2 {
  grid-column: span 2;
}

.form-grid .span-3 {
  grid-column: span 3;
}

.form-section {
  margin-top: 22px;
  padding-top: 20px;
  border-top: 1px solid var(--line);
}

.form-section:first-child {
  margin-top: 0;
  padding-top: 0;
  border-top: 0;
}

.form-section-title {
  margin-bottom: 14px;
  color: #47584f;
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.11em;
  text-transform: uppercase;
}

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

.check-option {
  display: flex;
  align-items: center;
  gap: 9px;
  padding: 10px 11px;
  border: 1px solid var(--line);
  border-radius: 8px;
  color: #4a5b52;
  background: #fbfcfb;
  font-size: 12px;
  cursor: pointer;
  transition: 0.16s;
}

.check-option:hover {
  border-color: #bed7c9;
  background: #f7fbf8;
}

.check-option input {
  width: 15px;
  height: 15px;
  accent-color: var(--green-600);
}

.check-option.checked {
  border-color: #a8d4bd;
  background: var(--green-50);
  color: var(--green-800);
}

/* ---------- buttons ---------- */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 7px;
  min-height: 40px;
  padding: 9px 16px;
  border: 1px solid transparent;
  border-radius: 9px;
  font-size: 13px;
  font-weight: 600;
  line-height: 1.2;
  white-space: nowrap;
  transition: background 0.18s, border-color 0.18s, color 0.18s, transform 0.1s, box-shadow 0.18s;
}

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

.btn:focus-visible {
  outline: 3px solid rgba(42, 153, 114, 0.24);
  outline-offset: 1px;
}

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

.btn-primary {
  color: #fff;
  background: var(--green-700);
  box-shadow: 0 2px 8px rgba(18, 89, 64, 0.16);
}

.btn-primary:hover {
  background: var(--green-800);
}

.btn-dark {
  color: #f2faf6;
  background: var(--green-900);
}

.btn-dark:hover {
  background: #081d15;
}

.btn-ghost {
  color: #44554c;
  border-color: var(--line-strong);
  background: #fff;
}

.btn-ghost:hover {
  border-color: #bfcec5;
  background: #f9fbfa;
}

.btn-soft {
  color: var(--green-800);
  border-color: #d3e8dc;
  background: var(--green-50);
}

.btn-soft:hover {
  background: #eaf6ef;
}

.btn-danger {
  color: #fff;
  background: #c64b3f;
}

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

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

.btn-danger-ghost:hover {
  background: #fff7f6;
}

.btn-sm {
  min-height: 32px;
  padding: 6px 10px;
  border-radius: 7px;
  font-size: 12px;
}

.btn-lg {
  min-height: 47px;
  padding: 12px 22px;
}

.btn-block {
  width: 100%;
}

.icon-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 36px;
  height: 36px;
  padding: 0;
  border: 1px solid transparent;
  border-radius: 8px;
  color: #697970;
  background: transparent;
  transition: 0.16s;
}

.icon-btn:hover {
  color: var(--ink);
  background: #f1f5f2;
}

.link-btn {
  padding: 0;
  border: 0;
  color: var(--green-700);
  background: none;
  font-size: 12px;
  font-weight: 600;
}

.link-btn:hover {
  color: var(--green-900);
  text-decoration: underline;
  text-underline-offset: 3px;
}

.link-btn.danger {
  color: #b44a3f;
}

/* ---------- badges ---------- */
.badge {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 4px 9px;
  border-radius: 999px;
  font-size: 11px;
  font-weight: 600;
  line-height: 1.35;
  white-space: nowrap;
}

.badge i {
  width: 5px;
  height: 5px;
  border-radius: 50%;
  background: currentColor;
}

.badge-green {
  color: #18724f;
  background: #e7f5ed;
}

.badge-amber {
  color: #9b640a;
  background: var(--amber-100);
}

.badge-blue {
  color: #2c67c9;
  background: var(--blue-100);
}

.badge-violet {
  color: #6750c7;
  background: var(--violet-100);
}

.badge-gray {
  color: #68756e;
  background: #eef2ef;
}

.badge-red {
  color: var(--red-600);
  background: var(--red-100);
}

.source-tag {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  color: #68776f;
  font-size: 11px;
}

.source-tag.scan {
  color: var(--green-700);
}

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

.sidebar {
  position: fixed;
  inset: 0 auto 0 0;
  z-index: 40;
  width: var(--sidebar-w);
  display: flex;
  flex-direction: column;
  padding: 24px 16px 16px;
  color: #dcebe3;
  background:
    radial-gradient(420px 300px at 0% 105%, rgba(46, 137, 101, 0.2), transparent 70%),
    linear-gradient(180deg, #0b241b 0%, #0c2a20 60%, #0a2018 100%);
  overflow-y: auto;
}

.sidebar .brand {
  padding: 0 8px 23px;
  border-bottom: 1px solid rgba(212, 239, 225, 0.09);
}

.sidebar .brand strong {
  color: #f3faf6;
  font-size: 15px;
}

.sidebar .brand span {
  color: #a9caba;
}

.sidebar .brand-mark {
  width: 37px;
  height: 37px;
  border-radius: 11px;
  font-size: 16px;
}

.nav {
  display: flex;
  flex-direction: column;
  gap: 5px;
  padding-top: 18px;
}

.nav-group {
  margin-top: 19px;
}

.nav-group:first-child {
  margin-top: 0;
}

.nav-label {
  padding: 0 10px 6px;
  color: rgba(188, 218, 203, 0.43);
  font-size: 9px;
  font-weight: 600;
  letter-spacing: 0.15em;
}

.nav-link {
  position: relative;
  display: flex;
  align-items: center;
  gap: 11px;
  min-height: 40px;
  padding: 0 11px;
  border-radius: 9px;
  color: rgba(220, 237, 228, 0.7);
  font-size: 13px;
  transition: 0.16s;
}

.nav-link .icon {
  color: rgba(183, 216, 200, 0.6);
  transition: 0.16s;
}

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

.nav-link:hover .icon {
  color: #b3e0c8;
}

.nav-link.active {
  color: #f4fbf7;
  background: rgba(96, 181, 143, 0.14);
}

.nav-link.active::before {
  content: "";
  position: absolute;
  left: -16px;
  width: 3px;
  height: 19px;
  border-radius: 0 4px 4px 0;
  background: #5cc393;
}

.nav-link.active .icon {
  color: #79d1a7;
}

.nav-badge {
  margin-left: auto;
  padding: 1px 6px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.09);
  color: #b8d7c7;
  font-size: 9px;
}

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

.scan-entry {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 12px 12px;
  margin-bottom: 14px;
  border: 1px solid rgba(140, 208, 175, 0.14);
  border-radius: 11px;
  background: linear-gradient(135deg, rgba(84, 175, 134, 0.13), rgba(255, 255, 255, 0.025));
  color: #d9f0e4;
  font-size: 12px;
  transition: 0.16s;
}

.scan-entry:hover {
  border-color: rgba(140, 208, 175, 0.28);
  background: rgba(84, 175, 134, 0.18);
}

.scan-entry .scan-entry-icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 30px;
  height: 30px;
  border-radius: 8px;
  color: #8fe1b9;
  background: rgba(0, 0, 0, 0.16);
}

.scan-entry small {
  display: block;
  margin-top: 1px;
  color: rgba(206, 232, 219, 0.45);
  font-size: 9px;
}

.sidebar-user {
  display: flex;
  align-items: center;
  gap: 9px;
  padding: 11px 9px 2px;
  border-top: 1px solid rgba(212, 239, 225, 0.09);
}

.avatar {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 32px;
  height: 32px;
  flex: none;
  border-radius: 9px;
  color: #e9f8ef;
  background: linear-gradient(145deg, #2d9a73, #145a40);
  font-size: 12px;
  font-weight: 700;
}

.avatar.lg {
  width: 52px;
  height: 52px;
  border-radius: 14px;
  font-size: 18px;
}

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

.sidebar-user strong {
  display: block;
  overflow: hidden;
  color: #e9f5ee;
  font-size: 12px;
  font-weight: 500;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.sidebar-user small {
  display: block;
  color: rgba(196, 224, 209, 0.45);
  font-size: 9px;
}

.sidebar-user .icon-btn {
  width: 29px;
  height: 29px;
  color: rgba(215, 236, 225, 0.55);
}

.sidebar-user .icon-btn:hover {
  color: #fff;
  background: rgba(255, 255, 255, 0.07);
}

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

.topbar {
  position: sticky;
  top: 0;
  z-index: 30;
  display: flex;
  align-items: center;
  gap: 16px;
  height: 82px;
  padding: 0 32px;
  border-bottom: 1px solid rgba(222, 231, 225, 0.8);
  background: rgba(250, 252, 250, 0.86);
  backdrop-filter: blur(14px);
}

.menu-toggle {
  display: none;
}

.topbar-title {
  display: grid;
  gap: 1px;
}

.topbar-title .eyebrow-text {
  color: #91a098;
  font-size: 9px;
  font-weight: 600;
  letter-spacing: 0.16em;
  text-transform: uppercase;
}

.topbar-title h1 {
  font-size: 21px;
  font-weight: 650;
  letter-spacing: -0.035em;
}

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

.top-date {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  padding: 7px 11px;
  border: 1px solid var(--line);
  border-radius: 8px;
  color: #748279;
  background: rgba(255, 255, 255, 0.72);
  font-size: 11px;
}

.user-menu {
  position: relative;
}

.user-chip {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 4px 7px 4px 4px;
  border: 1px solid var(--line);
  border-radius: 10px;
  color: #405047;
  background: #fff;
  transition: 0.16s;
}

.user-chip:hover {
  border-color: #c5d5cb;
  background: #fcfdfc;
}

.user-chip .user-name {
  max-width: 110px;
  overflow: hidden;
  font-size: 12px;
  font-weight: 600;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.user-chip .icon {
  color: #8b9890;
}

.dropdown-menu {
  position: absolute;
  right: 0;
  top: calc(100% + 7px);
  z-index: 35;
  width: 196px;
  padding: 5px;
  border: 1px solid var(--line);
  border-radius: 11px;
  background: #fff;
  box-shadow: var(--shadow-md);
  opacity: 0;
  visibility: hidden;
  transform: translateY(-4px);
  transition: 0.16s;
}

.user-menu.open .dropdown-menu {
  opacity: 1;
  visibility: visible;
  transform: translateY(0);
}

.dropdown-user {
  padding: 9px 10px 11px;
  border-bottom: 1px solid var(--line);
  margin-bottom: 4px;
}

.dropdown-user strong {
  display: block;
  font-size: 12px;
}

.dropdown-user small {
  display: block;
  margin-top: 1px;
  color: #8b9890;
  font-size: 10px;
}

.dropdown-item {
  display: flex;
  align-items: center;
  gap: 9px;
  width: 100%;
  min-height: 35px;
  padding: 7px 9px;
  border: 0;
  border-radius: 7px;
  color: #4a5a51;
  background: none;
  font-size: 12px;
  text-align: left;
}

.dropdown-item:hover {
  background: #f4f8f5;
}

.dropdown-item.danger {
  color: #b94b40;
}

.dropdown-item.danger:hover {
  background: #fff5f4;
}

.sidebar-scrim {
  display: none;
}

.page {
  max-width: 1560px;
  margin: 0 auto;
  padding: 26px 32px 48px;
}

/* ---------- page / panels ---------- */
.page-toolbar {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 20px;
  margin-bottom: 20px;
}

.page-toolbar h2 {
  font-size: 18px;
  font-weight: 650;
  letter-spacing: -0.025em;
}

.page-toolbar p {
  margin-top: 4px;
  color: #849188;
  font-size: 12px;
}

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

.panel {
  overflow: hidden;
  border: 1px solid rgba(222, 231, 225, 0.9);
  border-radius: var(--radius);
  background: var(--card);
  box-shadow: var(--shadow-sm);
}

.panel + .panel {
  margin-top: 18px;
}

.panel-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding: 17px 20px;
  border-bottom: 1px solid var(--line);
}

.panel-head h3 {
  font-size: 14px;
  font-weight: 650;
  letter-spacing: -0.01em;
}

.panel-head p {
  margin-top: 2px;
  color: #8b9890;
  font-size: 11px;
}

.panel-body {
  padding: 20px;
}

.panel-tools {
  display: flex;
  align-items: center;
  gap: 8px;
}

/* ---------- welcome / stats ---------- */
.welcome-card {
  position: relative;
  overflow: hidden;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
  min-height: 150px;
  padding: 28px 32px;
  margin-bottom: 20px;
  border-radius: 18px;
  color: #ecf9f2;
  background:
    radial-gradient(540px 280px at 92% 25%, rgba(94, 200, 152, 0.22), transparent 64%),
    radial-gradient(280px 180px at 76% 132%, rgba(84, 171, 132, 0.18), transparent 70%),
    linear-gradient(118deg, #0d2e23 0%, #124a36 100%);
  box-shadow: 0 8px 28px rgba(13, 46, 35, 0.13);
}

.welcome-card::after {
  content: "";
  position: absolute;
  right: -38px;
  bottom: -84px;
  width: 260px;
  height: 260px;
  border: 1px solid rgba(166, 230, 199, 0.1);
  border-radius: 50%;
}

.welcome-card .welcome-copy {
  position: relative;
  z-index: 1;
}

.welcome-card .welcome-kicker {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  color: #8ed8b4;
  font-size: 10px;
  font-weight: 600;
  letter-spacing: 0.12em;
}

.welcome-card h2 {
  margin-top: 9px;
  font-size: 26px;
  font-weight: 600;
  letter-spacing: -0.035em;
}

.welcome-card p {
  margin-top: 6px;
  color: rgba(220, 242, 230, 0.55);
  font-size: 12px;
}

.welcome-side {
  position: relative;
  z-index: 1;
  display: flex;
  align-items: center;
  gap: 30px;
}

.welcome-money {
  padding-right: 30px;
  border-right: 1px solid rgba(204, 238, 220, 0.13);
}

.welcome-money span {
  display: block;
  color: rgba(206, 233, 219, 0.52);
  font-size: 10px;
  letter-spacing: 0.06em;
}

.welcome-money strong {
  display: block;
  margin-top: 4px;
  color: #f3fbf7;
  font-size: 25px;
  font-weight: 600;
  letter-spacing: -0.025em;
}

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

.welcome-actions .btn {
  min-height: 35px;
  color: #eaf8f1;
  border-color: rgba(218, 241, 229, 0.2);
  background: rgba(255, 255, 255, 0.08);
  font-size: 11px;
}

.welcome-actions .btn:hover {
  background: rgba(255, 255, 255, 0.14);
}

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

.stat-card {
  position: relative;
  overflow: hidden;
  padding: 18px 19px;
  border: 1px solid rgba(222, 231, 225, 0.9);
  border-radius: 14px;
  background: #fff;
  box-shadow: var(--shadow-sm);
}

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

.stat-label {
  color: #75837b;
  font-size: 11px;
  font-weight: 500;
}

.stat-icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 32px;
  height: 32px;
  border-radius: 9px;
  color: var(--green-700);
  background: var(--green-50);
}

.stat-card.amber .stat-icon {
  color: #a66d0b;
  background: #fff7e7;
}

.stat-card.blue .stat-icon {
  color: #2c67c9;
  background: #edf4ff;
}

.stat-card.violet .stat-icon {
  color: #6750c7;
  background: #f5f1ff;
}

.stat-value {
  margin-top: 11px;
  font-size: 27px;
  font-weight: 650;
  letter-spacing: -0.045em;
  line-height: 1.1;
}

.stat-value small {
  margin-left: 3px;
  color: #8b9890;
  font-size: 11px;
  font-weight: 500;
  letter-spacing: 0;
}

.stat-foot {
  display: flex;
  align-items: center;
  gap: 5px;
  margin-top: 8px;
  color: #97a39c;
  font-size: 10px;
}

.stat-foot .up {
  color: var(--green-600);
  font-weight: 600;
}

.dashboard-grid {
  display: grid;
  grid-template-columns: minmax(0, 1.65fr) minmax(280px, 0.75fr);
  gap: 18px;
  align-items: start;
}

.quick-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 9px;
}

.quick-action {
  display: flex;
  flex-direction: column;
  gap: 10px;
  padding: 13px;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: #fbfcfb;
  transition: 0.16s;
}

.quick-action:hover {
  border-color: #bcd9c8;
  background: var(--green-50);
  transform: translateY(-1px);
}

.quick-action .quick-icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 31px;
  height: 31px;
  border-radius: 8px;
  color: var(--green-700);
  background: #eaf5ef;
}

.quick-action strong {
  color: #3e4f46;
  font-size: 12px;
  font-weight: 600;
}

.quick-action small {
  color: #929e97;
  font-size: 10px;
}

/* ---------- filter / table ---------- */
.filter-bar {
  display: flex;
  flex-wrap: wrap;
  align-items: flex-end;
  gap: 10px;
  padding: 14px 16px;
  border: 1px solid rgba(222, 231, 225, 0.9);
  border-radius: 13px;
  background: #fff;
  box-shadow: var(--shadow-sm);
  margin-bottom: 14px;
}

.search-box {
  position: relative;
  min-width: 220px;
  flex: 1 1 240px;
  max-width: 340px;
}

.search-box .icon {
  position: absolute;
  left: 11px;
  top: 50%;
  color: #96a29b;
  transform: translateY(-50%);
  pointer-events: none;
}

.search-box .input {
  min-height: 38px;
  padding-left: 34px;
  background: #fbfcfb;
}

.filter-field {
  display: grid;
  gap: 4px;
  min-width: 140px;
}

.filter-field label {
  color: #8c9891;
  font-size: 10px;
  font-weight: 500;
}

.filter-field .select,
.filter-field .input {
  min-height: 38px;
  padding-top: 7px;
  padding-bottom: 7px;
  font-size: 12px;
  background-color: #fbfcfb;
}

.filter-actions {
  display: flex;
  gap: 7px;
  margin-left: auto;
}

.table-wrap {
  overflow-x: auto;
  scrollbar-width: thin;
}

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

.data-table th {
  padding: 10px 14px;
  color: #89958e;
  background: #fafcfa;
  font-size: 10px;
  font-weight: 600;
  letter-spacing: 0.04em;
  white-space: nowrap;
}

.data-table td {
  padding: 13px 14px;
  border-top: 1px solid #edf1ee;
  color: #435149;
  font-size: 12px;
  vertical-align: middle;
}

.data-table tbody tr {
  transition: background 0.12s;
}

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

.data-table th:first-child,
.data-table td:first-child {
  padding-left: 20px;
}

.data-table th:last-child,
.data-table td:last-child {
  padding-right: 20px;
}

.data-table .check-col {
  width: 38px;
}

.data-table input[type="checkbox"] {
  width: 15px;
  height: 15px;
  accent-color: var(--green-600);
  cursor: pointer;
}

.cell-main {
  display: block;
  color: #2d3c34;
  font-weight: 600;
}

.cell-sub {
  display: block;
  margin-top: 2px;
  color: #8e9a93;
  font-size: 10px;
}

.cell-mono {
  font-family: "SFMono-Regular", Consolas, "Liberation Mono", monospace;
  font-size: 11px;
  letter-spacing: -0.01em;
}

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

.product-cell .meta {
  min-width: 0;
}

.thumb {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex: none;
  width: 40px;
  height: 40px;
  overflow: hidden;
  border: 1px solid #e8eeea;
  border-radius: 9px;
  object-fit: cover;
  background: #f5f8f6;
}

.thumb-sm {
  width: 32px;
  height: 32px;
  border-radius: 8px;
}

.thumb-lg {
  width: 64px;
  height: 64px;
  border-radius: 12px;
}

.thumb-placeholder {
  color: #6a8b7a;
  background:
    linear-gradient(135deg, rgba(228, 242, 234, 0.9), rgba(242, 248, 244, 0.9));
  font-size: 14px;
  font-weight: 700;
}

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

.row-actions .link-btn {
  font-size: 11px;
}

.table-empty {
  padding: 42px 20px;
}

.table-footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  padding: 13px 18px;
  border-top: 1px solid var(--line);
}

.page-info {
  color: #8d9992;
  font-size: 11px;
}

.pagination {
  display: flex;
  align-items: center;
  gap: 5px;
}

.page-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 30px;
  height: 30px;
  padding: 0 8px;
  border: 1px solid var(--line);
  border-radius: 7px;
  color: #66766d;
  background: #fff;
  font-size: 11px;
}

.page-btn:hover:not(:disabled) {
  border-color: #c6d7cc;
  background: #f7faf8;
}

.page-btn.active {
  border-color: var(--green-700);
  color: #fff;
  background: var(--green-700);
}

.page-btn:disabled {
  opacity: 0.45;
  cursor: not-allowed;
}

/* ---------- empty / loading ---------- */
.empty-state {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 46px 20px;
  text-align: center;
}

.empty-icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 55px;
  height: 55px;
  margin-bottom: 13px;
  border-radius: 16px;
  color: #7fa38f;
  background: #f0f6f2;
}

.empty-state strong {
  color: #56675d;
  font-size: 13px;
}

.empty-state p {
  max-width: 280px;
  margin-top: 4px;
  color: #97a29b;
  font-size: 11px;
}

.loading-state {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 9px;
  padding: 56px 20px;
  color: #8b9890;
  font-size: 12px;
}

.spinner {
  display: inline-block;
  width: 18px;
  height: 18px;
  border: 2px solid rgba(38, 112, 82, 0.16);
  border-top-color: var(--green-600);
  border-radius: 50%;
  animation: spin 0.7s linear infinite;
}

.spinner-sm {
  width: 13px;
  height: 13px;
  border-width: 1.6px;
}

@keyframes spin {
  to { transform: rotate(360deg); }
}

/* ---------- modal / toast ---------- */
.modal-backdrop {
  position: fixed;
  inset: 0;
  z-index: 100;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 24px;
  background: rgba(8, 25, 18, 0.4);
  backdrop-filter: blur(3px);
  opacity: 0;
  transition: opacity 0.18s;
}

.modal-backdrop.show {
  opacity: 1;
}

.modal {
  display: flex;
  flex-direction: column;
  width: min(100%, 720px);
  max-height: calc(100vh - 48px);
  border: 1px solid rgba(218, 229, 222, 0.9);
  border-radius: 17px;
  background: #fff;
  box-shadow: 0 30px 90px rgba(5, 23, 15, 0.25);
  transform: translateY(8px) scale(0.99);
  transition: transform 0.18s;
}

.modal-backdrop.show .modal {
  transform: translateY(0) scale(1);
}

.modal-sm { width: min(100%, 430px); }
.modal-lg { width: min(100%, 920px); }
.modal-xl { width: min(100%, 1080px); }

.modal-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 16px;
  padding: 20px 22px 16px;
  border-bottom: 1px solid var(--line);
}

.modal-head h3 {
  font-size: 16px;
  font-weight: 650;
  letter-spacing: -0.02em;
}

.modal-head p {
  margin-top: 3px;
  color: #8d9992;
  font-size: 11px;
}

.modal-body {
  overflow-y: auto;
  padding: 20px 22px;
}

.modal-foot {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 8px;
  padding: 14px 22px;
  border-top: 1px solid var(--line);
  background: #fcfdfc;
  border-radius: 0 0 17px 17px;
}

.confirm-body {
  display: flex;
  align-items: flex-start;
  gap: 13px;
  padding: 3px 0 5px;
}

.confirm-icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 38px;
  height: 38px;
  flex: none;
  border-radius: 10px;
  color: var(--green-700);
  background: var(--green-50);
}

.confirm-icon.danger {
  color: var(--red-600);
  background: var(--red-100);
}

.confirm-body p {
  padding-top: 7px;
  color: #4c5d53;
  font-size: 13px;
  line-height: 1.7;
}

.toast-root {
  position: fixed;
  right: 22px;
  bottom: 22px;
  z-index: 120;
  display: flex;
  flex-direction: column;
  gap: 8px;
  pointer-events: none;
}

.toast {
  display: flex;
  align-items: center;
  gap: 9px;
  min-width: 210px;
  max-width: 380px;
  padding: 11px 14px;
  border: 1px solid #dce9e1;
  border-radius: 10px;
  color: #365146;
  background: #fff;
  box-shadow: 0 12px 34px rgba(8, 31, 20, 0.15);
  font-size: 12px;
  opacity: 0;
  transform: translateY(8px);
  transition: 0.2s;
}

.toast.show {
  opacity: 1;
  transform: translateY(0);
}

.toast-icon {
  display: inline-flex;
  color: var(--green-600);
}

.toast-error {
  border-color: #f0d7d3;
  color: #8d3d35;
}

.toast-error .toast-icon {
  color: var(--red-600);
}

.toast-info .toast-icon {
  color: #2c67c9;
}

/* ---------- form upload / image ---------- */
.upload-row {
  display: flex;
  align-items: center;
  gap: 14px;
}

.upload-preview {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 84px;
  height: 84px;
  flex: none;
  overflow: hidden;
  border: 1px dashed #cbdad0;
  border-radius: 11px;
  color: #96a79d;
  background: #f8fbf9;
  font-size: 10px;
  text-align: center;
  cursor: pointer;
  transition: 0.16s;
}

.upload-preview:hover {
  border-color: var(--green-500);
  background: var(--green-50);
}

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

.upload-preview.has-image {
  border-style: solid;
}

.upload-copy small {
  display: block;
  margin-top: 3px;
  color: #99a59e;
  font-size: 10px;
}

/* ---------- order detail ---------- */
.detail-hero {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 18px;
  padding: 18px 20px;
  margin-bottom: 18px;
  border: 1px solid #e2ece6;
  border-radius: 12px;
  background: linear-gradient(135deg, #f4faf6, #fbfdfb);
}

.detail-hero h4 {
  font-size: 17px;
  font-weight: 650;
  letter-spacing: -0.02em;
}

.detail-hero p {
  margin-top: 4px;
  color: #8c9991;
  font-size: 11px;
}

.detail-hero .amount {
  text-align: right;
}

.detail-hero .amount span {
  display: block;
  color: #8c9991;
  font-size: 10px;
}

.detail-hero .amount strong {
  display: block;
  margin-top: 2px;
  color: var(--green-800);
  font-size: 22px;
  font-weight: 650;
}

.detail-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 0;
  border-top: 1px solid var(--line);
}

.detail-item {
  padding: 11px 0;
  border-bottom: 1px solid var(--line);
}

.detail-item:nth-child(odd) {
  padding-right: 18px;
}

.detail-item span {
  display: block;
  color: #96a19a;
  font-size: 10px;
}

.detail-item strong {
  display: block;
  margin-top: 2px;
  color: #3b4c43;
  font-size: 12px;
  font-weight: 500;
  word-break: break-word;
}

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

.detail-section h4 {
  margin-bottom: 10px;
  color: #3e4f46;
  font-size: 12px;
  font-weight: 650;
}

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

.timeline-step {
  position: relative;
  padding-top: 22px;
  color: #a3aea7;
  font-size: 10px;
  text-align: center;
}

.timeline-step::before {
  content: "";
  position: absolute;
  top: 7px;
  left: 50%;
  width: 8px;
  height: 8px;
  border: 2px solid #dbe5de;
  border-radius: 50%;
  background: #fff;
  transform: translateX(-50%);
}

.timeline-step::after {
  content: "";
  position: absolute;
  top: 10px;
  left: calc(50% + 9px);
  width: calc(100% - 18px);
  height: 1px;
  background: #e5ece7;
}

.timeline-step:last-child::after {
  display: none;
}

.timeline-step.done {
  color: var(--green-700);
  font-weight: 600;
}

.timeline-step.done::before {
  border-color: var(--green-600);
  background: var(--green-600);
}

.timeline-step.done::after {
  background: #b9ddca;
}

.screenshot {
  width: 100%;
  max-height: 300px;
  border: 1px solid var(--line);
  border-radius: 10px;
  object-fit: contain;
  background: #f8faf9;
}

/* ---------- outbound ---------- */
.stock-pick-list {
  max-height: 300px;
  overflow-y: auto;
  border: 1px solid var(--line);
  border-radius: 10px;
}

.stock-pick {
  display: flex;
  align-items: center;
  gap: 11px;
  padding: 10px 12px;
  border-bottom: 1px solid #eef2ef;
}

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

.stock-pick:hover {
  background: #fbfdfb;
}

.stock-pick .product-cell {
  flex: 1;
  min-width: 0;
}

.stock-pick .qty-input {
  width: 74px;
  min-height: 32px;
  padding: 4px 7px;
  text-align: center;
}

.stock-pick.disabled {
  opacity: 0.55;
}

.total-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 12px 14px;
  margin-top: 12px;
  border: 1px dashed #cfe0d6;
  border-radius: 9px;
  color: #617269;
  background: #f8fbf9;
  font-size: 12px;
}

.total-bar strong {
  color: var(--green-800);
  font-size: 20px;
  font-weight: 650;
}

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

.items-table th,
.items-table td {
  padding: 9px 10px;
  border-bottom: 1px solid var(--line);
  font-size: 11px;
  text-align: left;
}

.items-table th {
  color: #89958e;
  font-weight: 600;
  background: #fafcfa;
}

/* ---------- settings ---------- */
.settings-grid {
  display: grid;
  grid-template-columns: minmax(0, 1.2fr) minmax(280px, 0.8fr);
  gap: 18px;
  align-items: start;
}

.formula-card {
  padding: 18px;
  border: 1px solid #e2ece6;
  border-radius: 12px;
  background: linear-gradient(135deg, #f6fbf8, #fbfdfb);
}

.formula-card h4 {
  font-size: 12px;
  font-weight: 650;
}

.formula {
  margin-top: 10px;
  padding: 12px;
  border-radius: 8px;
  color: #315145;
  background: #fff;
  border: 1px solid #e7efea;
  font-family: "SFMono-Regular", Consolas, monospace;
  font-size: 11px;
  line-height: 1.8;
}

.formula-card ul {
  margin: 12px 0 0;
  padding-left: 17px;
  color: #7f8e85;
  font-size: 11px;
  line-height: 1.9;
}

.profile-strip {
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 16px;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: #fbfcfb;
}

.profile-strip .meta {
  flex: 1;
}

.profile-strip strong {
  display: block;
  font-size: 14px;
}

.profile-strip small {
  display: block;
  color: #8c9991;
  font-size: 11px;
}

/* ---------- permissions ---------- */
.permission-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 4px;
  max-width: 340px;
}

.permission-tag {
  padding: 2px 7px;
  border-radius: 5px;
  color: #5e7066;
  background: #f1f5f2;
  font-size: 9px;
  white-space: nowrap;
}

.role-tag {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 3px 8px;
  border-radius: 6px;
  color: #1e6248;
  background: #e9f5ef;
  font-size: 10px;
  font-weight: 600;
}

.role-tag.admin {
  color: #64746b;
  background: #f1f4f2;
}

/* ---------- responsive ---------- */
@media (max-width: 1180px) {
  .story-float {
    display: none;
  }

  .dashboard-grid {
    grid-template-columns: minmax(0, 1.5fr) minmax(260px, 0.8fr);
  }

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

@media (max-width: 980px) {
  .login-page {
    grid-template-columns: 1fr;
  }

  .login-story {
    display: none;
  }

  .login-panel {
    min-height: 100vh;
    padding: 28px 22px;
  }

  .login-mobile-brand {
    display: flex;
  }

  .sidebar {
    transform: translateX(-100%);
    transition: transform 0.22s ease;
    box-shadow: 20px 0 50px rgba(6, 24, 16, 0.18);
  }

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

  .sidebar-scrim {
    position: fixed;
    inset: 0;
    z-index: 35;
    display: block;
    background: rgba(8, 24, 17, 0.35);
    opacity: 0;
    visibility: hidden;
    transition: 0.2s;
  }

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

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

  .menu-toggle {
    display: inline-flex;
  }

  .topbar {
    padding: 0 20px;
  }

  .page {
    padding: 20px 20px 40px;
  }

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

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

@media (max-width: 720px) {
  .topbar {
    height: 70px;
    padding: 0 14px;
  }

  .topbar-title h1 {
    font-size: 17px;
  }

  .top-date {
    display: none;
  }

  .user-chip .user-name {
    display: none;
  }

  .page {
    padding: 15px 14px 34px;
  }

  .welcome-card {
    flex-direction: column;
    align-items: flex-start;
    padding: 22px;
    min-height: auto;
  }

  .welcome-side {
    width: 100%;
    justify-content: space-between;
    gap: 14px;
  }

  .welcome-money {
    padding-right: 14px;
  }

  .welcome-actions .btn span.btn-text {
    display: none;
  }

  .stat-grid {
    grid-template-columns: 1fr 1fr;
    gap: 9px;
  }

  .stat-card {
    padding: 14px;
  }

  .stat-value {
    font-size: 22px;
  }

  .filter-bar {
    padding: 11px;
  }

  .search-box {
    max-width: none;
    flex-basis: 100%;
  }

  .filter-field {
    flex: 1 1 128px;
    min-width: 0;
  }

  .filter-actions {
    width: 100%;
    margin-left: 0;
  }

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

  .page-toolbar {
    flex-direction: column;
    gap: 10px;
  }

  .toolbar-actions {
    width: 100%;
  }

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

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

  .form-grid .span-2,
  .form-grid .span-3 {
    grid-column: span 1;
  }

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

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

  .modal {
    max-height: calc(100vh - 20px);
    border-radius: 16px;
  }

  .modal-head {
    padding: 17px 17px 13px;
  }

  .modal-body {
    padding: 16px 17px;
  }

  .modal-foot {
    padding: 12px 17px;
  }

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

  .toast {
    max-width: none;
  }

  .detail-hero {
    flex-direction: column;
    gap: 10px;
  }

  .detail-hero .amount {
    text-align: left;
  }

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

  .detail-item:nth-child(odd) {
    padding-right: 0;
  }

  .timeline {
    grid-template-columns: repeat(4, 1fr);
    font-size: 9px;
  }

  .table-footer {
    flex-direction: column;
    align-items: flex-start;
  }

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

  .panel-head {
    padding: 14px 15px;
  }

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

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

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

/* ---------- camera / scanning ---------- */
.camera-shell {
  position: relative;
  display: flex;
  align-items: center;
  justify-content: center;
  width: 100%;
  aspect-ratio: 16 / 10;
  max-height: 320px;
  overflow: hidden;
  border-radius: 14px;
  background:
    radial-gradient(400px 200px at 50% 20%, rgba(64, 128, 100, 0.18), transparent 65%),
    #0a1b14;
}

.camera-video {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  background: #07130e;
}

.camera-placeholder {
  position: relative;
  z-index: 2;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 5px;
  color: rgba(218, 240, 228, 0.8);
  text-align: center;
}

.camera-placeholder span {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 58px;
  height: 58px;
  margin-bottom: 4px;
  border: 1px solid rgba(170, 224, 197, 0.18);
  border-radius: 16px;
  color: #86d2ad;
  background: rgba(255, 255, 255, 0.045);
}

.camera-placeholder strong {
  font-size: 12px;
  font-weight: 600;
}

.camera-placeholder small {
  color: rgba(188, 219, 203, 0.45);
  font-size: 10px;
}

.scan-frame {
  position: absolute;
  inset: 11% 12%;
  z-index: 3;
  border: 1.5px solid rgba(129, 222, 178, 0.7);
  border-radius: 10px;
  box-shadow: 0 0 0 999px rgba(5, 17, 12, 0.17);
  pointer-events: none;
}

.scan-frame::before,
.scan-frame::after {
  content: "";
  position: absolute;
  width: 22px;
  height: 22px;
  border-color: #8fe5ba;
  border-style: solid;
}

.scan-frame::before {
  left: -2px;
  top: -2px;
  border-width: 3px 0 0 3px;
  border-radius: 7px 0 0;
}

.scan-frame::after {
  right: -2px;
  bottom: -2px;
  border-width: 0 3px 3px 0;
  border-radius: 0 0 7px;
}

.scan-line {
  display: none;
  position: absolute;
  left: 13%;
  right: 13%;
  z-index: 4;
  height: 2px;
  background: linear-gradient(90deg, transparent, #71e3ac, transparent);
  box-shadow: 0 0 12px rgba(113, 227, 172, 0.8);
  animation: scan-move 2.4s ease-in-out infinite;
  pointer-events: none;
}

.camera-shell.scanning .scan-line {
  display: block;
}

@keyframes scan-move {
  0%, 100% { top: 18%; opacity: 0.3; }
  50% { top: 80%; opacity: 1; }
}

.scan-divider {
  position: relative;
  margin: 15px 0;
  text-align: center;
}

.scan-divider::before {
  content: "";
  position: absolute;
  top: 50%;
  left: 0;
  right: 0;
  height: 1px;
  background: var(--line);
}

.scan-divider span {
  position: relative;
  padding: 0 10px;
  color: #98a49d;
  background: #fff;
  font-size: 10px;
}

.scan-result {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  padding: 11px 12px;
  margin-top: 12px;
  border-radius: 9px;
  font-size: 11px;
}

.scan-result > .icon {
  margin-top: 1px;
}

.scan-result strong {
  display: block;
  font-size: 12px;
}

.scan-result span {
  display: block;
  margin-top: 1px;
  opacity: 0.72;
}

.scan-result.pending {
  color: #346b91;
  background: #eff7fc;
}

.scan-result.success {
  color: #176c4b;
  background: #edf8f2;
}

.scan-result.error {
  color: #a84137;
  background: #fff3f1;
}

.scan-product {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 12px;
  border: 1px solid #dcebe2;
  border-radius: 11px;
  background: #f8fbf9;
}

.scan-product strong {
  display: block;
  color: #2e4438;
  font-size: 13px;
}

.scan-product span {
  display: block;
  margin-top: 2px;
  color: #73847a;
  font-size: 11px;
}

.scan-product small {
  display: block;
  margin-top: 3px;
  color: #93a098;
  font-size: 10px;
}

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

.inline-form .input {
  flex: 1;
  min-height: 40px;
}

.stock-pick {
  cursor: default;
}

.page-enter {
  animation: page-in 0.28s ease both;
}

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

/* 工作台财务汇总 */
.finance-panel {
  margin-top: 16px;
}

.finance-grid {
  display: grid;
  grid-template-columns: repeat(6, minmax(0, 1fr));
  gap: 10px;
  padding: 0 18px 18px;
}

.finance-card {
  position: relative;
  overflow: hidden;
  padding: 14px 13px;
  border: 1px solid #e4ebe6;
  border-radius: 12px;
  background: linear-gradient(160deg, #fbfdfb, #f5f9f6);
}

.finance-card::after {
  position: absolute;
  top: -24px;
  right: -20px;
  width: 70px;
  height: 70px;
  border-radius: 50%;
  background: rgba(47, 143, 91, 0.07);
  content: "";
}

.finance-card span {
  display: block;
  color: #7d8a82;
  font-size: 10px;
  line-height: 1.4;
}

.finance-card strong {
  display: block;
  margin: 6px 0 4px;
  color: #1d3a2a;
  font-size: 19px;
  font-weight: 650;
  letter-spacing: -0.03em;
  white-space: nowrap;
}

.finance-card small {
  display: block;
  color: #9aa69e;
  font-size: 9px;
  line-height: 1.45;
}

.finance-card.amber {
  border-color: #f0e1c4;
  background: linear-gradient(160deg, #fffdf7, #fbf5e8);
}

.finance-card.amber strong {
  color: #a46b13;
}

.finance-card.violet {
  border-color: #e6e0f2;
  background: linear-gradient(160deg, #fcfbff, #f6f2fc);
}

.finance-card.violet strong {
  color: #6b4ea8;
}

.finance-card.green {
  border-color: #cfe8d8;
  background: linear-gradient(160deg, #f9fdfb, #edf8f1);
}

.finance-card.green strong {
  color: #23784a;
}

@media (max-width: 1280px) {
  .finance-grid { grid-template-columns: repeat(3, minmax(0, 1fr)); }
}

@media (max-width: 720px) {
  .finance-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); padding: 0 12px 14px; }
  .finance-card strong { font-size: 17px; }
}

/* 集梦回收后台品牌 */
.brand-logo-admin {
  display: block;
  width: 154px;
  height: 42px;
  object-fit: contain;
  opacity: 0.98;
}

.story-brand .brand-logo-admin {
  width: 176px;
  height: 48px;
}

/* 系统设置分页 */
.settings-tabbar {
  display: flex;
  gap: 8px;
  padding: 5px;
  margin-bottom: 16px;
  border: 1px solid #e2ebe4;
  border-radius: 12px;
  background: #f7faf8;
}

.settings-tab {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 9px 16px;
  border: 0;
  border-radius: 9px;
  color: #6f7e75;
  background: transparent;
  font-size: 12px;
  font-weight: 500;
  transition: background .16s ease, color .16s ease, box-shadow .16s ease;
}

.settings-tab:hover {
  color: #2b4a38;
  background: #eef6f0;
}

.settings-tab.active {
  color: #1f5f3d;
  background: #fff;
  box-shadow: 0 2px 8px rgba(20, 60, 38, .08);
}

.settings-pane {
  display: none;
}

.settings-pane.active {
  display: block;
}

@media (max-width: 720px) {
  .settings-tabbar { overflow-x: auto; }
  .settings-tab { flex: 0 0 auto; }
}

/* 图片放大预览 */
.image-preview {
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 220px;
  padding: 8px;
  border-radius: 12px;
  background: #f7faf8;
}

.image-preview img {
  max-width: 100%;
  max-height: 68vh;
  border-radius: 8px;
  object-fit: contain;
}

.product-cell .thumb,
.order-product-thumb {
  cursor: zoom-in;
}

/* 后台整体字体放大一号 + 订单用户列表布局 */
body {
  font-size: 15px;
}

.nav-link {
  font-size: 14px;
}

.page-toolbar p,
.panel-head p {
  font-size: 12px;
}

.data-table th {
  font-size: 11px;
}

.data-table td {
  font-size: 13px;
}

.cell-sub {
  font-size: 11px;
}

.btn,
.input,
.select,
.textarea {
  font-size: 13px;
}

:root {
  --sidebar-w: 214px;
}

.orders-layout {
  display: grid;
  grid-template-columns: 176px minmax(0, 1fr);
  gap: 12px;
  align-items: start;
}

.order-user-list {
  position: sticky;
  top: 16px;
  overflow: hidden;
  border: 1px solid #e3eae5;
  border-radius: 14px;
  background: #fff;
  box-shadow: 0 4px 16px rgba(17, 49, 32, 0.035);
}

.order-user-list-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 13px 12px;
  border-bottom: 1px solid #edf1ee;
  background: #fafcfa;
}

.order-user-list-head strong {
  font-size: 12px;
}

.order-user-list-head span {
  color: #8b9890;
  font-size: 10px;
}

.order-user-options {
  max-height: calc(100vh - 210px);
  overflow-y: auto;
  padding: 6px;
}

.order-user-option {
  display: flex;
  align-items: center;
  gap: 8px;
  width: 100%;
  padding: 8px;
  border: 0;
  border-radius: 9px;
  text-align: left;
  background: transparent;
}

.order-user-option:hover {
  background: #f4f9f6;
}

.order-user-option.active {
  background: #eaf6ef;
}

.order-user-avatar {
  display: grid;
  place-items: center;
  width: 30px;
  height: 30px;
  flex: 0 0 30px;
  border-radius: 50%;
  color: #2c7650;
  background: #ecf7f0;
  font-size: 11px;
  font-weight: 600;
}

.order-user-meta {
  min-width: 0;
}

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

.order-user-meta strong {
  color: #33473b;
  font-size: 11px;
}

.order-user-meta small {
  margin-top: 1px;
  color: #93a097;
  font-size: 9px;
}

.orders-main {
  min-width: 0;
}

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

.order-summary-card {
  position: relative;
  padding: 12px 13px;
  border: 1px solid #e3eae5;
  border-radius: 12px;
  text-align: left;
  background: #fff;
}

.order-summary-card:hover {
  border-color: #bcd9c8;
}

.order-summary-card span {
  display: block;
  color: #7f8d84;
  font-size: 10px;
}

.order-summary-card strong {
  display: inline-block;
  margin-top: 5px;
  color: #203d2c;
  font-size: 24px;
  font-weight: 650;
  letter-spacing: -0.04em;
}

.order-summary-card small {
  margin-left: 3px;
  color: #93a097;
  font-size: 10px;
}

.order-summary-card.amber strong { color: #a46b13; }
.order-summary-card.blue strong { color: #2c67c9; }
.order-summary-card.violet strong { color: #6750c7; }
.order-summary-card.green strong { color: #23784a; }

@media (max-width: 1100px) {
  .orders-layout { grid-template-columns: 160px minmax(0, 1fr); }
  .order-summary-grid { grid-template-columns: repeat(3, minmax(0, 1fr)); }
}

@media (max-width: 760px) {
  .orders-layout { grid-template-columns: 1fr; }
  .order-user-list { position: static; }
  .order-user-options { max-height: 190px; }
  .order-summary-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}

/* 订单页紧凑头部 */
.topbar {
  height: 64px;
  padding: 0 24px;
}

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

.topbar-title .eyebrow-text {
  font-size: 8px;
}

.page {
  padding-top: 18px;
  padding-bottom: 36px;
}

.order-actions-row {
  display: flex;
  justify-content: flex-end;
  margin-bottom: 8px;
}

.order-actions-row .toolbar-actions {
  gap: 7px;
}

.order-actions-row .btn {
  min-height: 32px;
  padding: 0 12px;
}

.order-summary-grid {
  margin-bottom: 9px;
}

.order-summary-card {
  padding: 9px 12px;
}

.order-summary-card strong {
  margin-top: 2px;
  font-size: 21px;
}

#order-filter {
  margin-bottom: 9px;
}

/* 所有后台页面统一为紧凑操作栏，标题只保留顶部栏一份 */
.page-toolbar {
  justify-content: flex-end;
  align-items: center;
  min-height: 34px;
  margin-bottom: 10px;
}

.page-toolbar > div:first-child {
  display: none;
}

.page-toolbar:not(:has(.toolbar-actions)) {
  display: none;
}

.page-toolbar .toolbar-actions {
  gap: 7px;
}

.page-toolbar .btn {
  min-height: 34px;
  padding: 0 13px;
}

.coupon-edit-row {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 7px;
  align-items: center;
  margin-top: 7px;
}

@media (max-width: 760px) {
  .coupon-edit-row { grid-template-columns: 1fr; }
}
