:root {
  --bg: #edf3f8;
  --panel: rgba(255, 255, 255, 0.9);
  --panel-solid: #ffffff;
  --panel-soft: #f4f9fb;
  --text: #112032;
  --muted: #66768b;
  --line: #d7e5ed;
  --primary: #0f9f8f;
  --primary-dark: #08786c;
  --accent: #ff9f43;
  --cyan: #0ea5c6;
  --danger: #b42318;
  --warning: #946200;
  --shadow: 0 18px 44px rgba(16, 32, 52, 0.12);
  --glow: 0 0 0 1px rgba(15, 159, 143, 0.14), 0 18px 48px rgba(15, 159, 143, 0.1);
  font-family: "Microsoft YaHei", "PingFang SC", "Segoe UI", Arial, sans-serif;
}

* {
  box-sizing: border-box;
}

html,
body {
  height: 100%;
}

body {
  margin: 0;
  background:
    linear-gradient(135deg, rgba(14, 165, 198, 0.13), rgba(255, 159, 67, 0.08)),
    repeating-linear-gradient(0deg, rgba(15, 159, 143, 0.045) 0 1px, transparent 1px 32px),
    repeating-linear-gradient(90deg, rgba(14, 165, 198, 0.045) 0 1px, transparent 1px 32px),
    var(--bg);
  color: var(--text);
}

button,
input,
select {
  font: inherit;
}

button {
  cursor: pointer;
}

.hidden {
  display: none !important;
}

.role-hidden {
  display: none !important;
}

.login-screen {
  min-height: 100vh;
  display: grid;
  place-items: center;
  padding: 32px;
  background:
    repeating-linear-gradient(90deg, rgba(45, 212, 191, 0.07) 0 1px, transparent 1px 84px),
    repeating-linear-gradient(0deg, rgba(255, 178, 74, 0.06) 0 1px, transparent 1px 72px),
    linear-gradient(118deg, #06111e 0%, #0b2632 42%, #102d36 58%, #eaf5f2 58%, #f7fbfd 100%);
  position: relative;
  overflow: hidden;
}

.login-screen::before {
  content: "";
  position: absolute;
  inset: -20%;
  background:
    linear-gradient(118deg, transparent 0 36%, rgba(54, 234, 224, 0.16) 36.2%, transparent 36.6%),
    linear-gradient(118deg, transparent 0 52%, rgba(255, 178, 74, 0.13) 52.2%, transparent 52.6%),
    linear-gradient(118deg, transparent 0 67%, rgba(255, 255, 255, 0.11) 67.1%, transparent 67.4%);
  animation: lightSweep 8s linear infinite;
  pointer-events: none;
}

.login-screen::after {
  content: "";
  position: absolute;
  inset: 0;
  background:
    repeating-linear-gradient(0deg, rgba(255, 255, 255, 0.045) 0 1px, transparent 1px 4px),
    linear-gradient(90deg, rgba(6, 17, 30, 0.58), transparent 45%, rgba(247, 251, 253, 0.36));
  mix-blend-mode: screen;
  opacity: 0.42;
  pointer-events: none;
}

.login-grid,
.login-scan {
  position: absolute;
  inset: 0;
  pointer-events: none;
}

.login-grid {
  background:
    linear-gradient(rgba(125, 245, 234, 0.1) 1px, transparent 1px),
    linear-gradient(90deg, rgba(125, 245, 234, 0.1) 1px, transparent 1px);
  background-size: 42px 42px;
  mask-image: linear-gradient(90deg, #000 0%, #000 46%, transparent 72%);
  animation: gridDrift 18s linear infinite;
  opacity: 0.72;
}

.login-scan {
  background: linear-gradient(180deg, transparent 0%, rgba(85, 255, 238, 0.18) 48%, transparent 54%);
  transform: translateY(-100%);
  animation: scanDrop 5.8s ease-in-out infinite;
  opacity: 0.72;
}

.login-stage {
  position: relative;
  z-index: 2;
  width: min(1040px, 100%);
  display: grid;
  grid-template-columns: minmax(0, 1.1fr) minmax(360px, 430px);
  align-items: center;
  gap: 24px;
}

.login-visual {
  min-height: 430px;
  display: grid;
  align-items: center;
}

.visual-frame {
  position: relative;
  min-height: 380px;
  border: 1px solid rgba(116, 255, 235, 0.24);
  border-radius: 8px;
  overflow: hidden;
  background:
    linear-gradient(90deg, rgba(255, 178, 74, 0.08), transparent 26%),
    linear-gradient(135deg, rgba(17, 52, 70, 0.86), rgba(4, 16, 28, 0.66)),
    repeating-linear-gradient(135deg, rgba(255, 255, 255, 0.06) 0 1px, transparent 1px 18px);
  box-shadow: 0 28px 80px rgba(3, 18, 31, 0.36), inset 0 0 0 1px rgba(255, 255, 255, 0.08);
}

.visual-frame::before,
.visual-frame::after {
  content: "";
  position: absolute;
  inset: 18px;
  border: 1px solid rgba(112, 239, 225, 0.18);
  border-radius: 6px;
  pointer-events: none;
}

.visual-frame::after {
  inset: auto 22px 22px 22px;
  height: 34%;
  border-color: rgba(255, 178, 74, 0.2);
  transform: skewX(-12deg);
}

.visual-head {
  position: absolute;
  inset: 22px 22px auto 22px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  color: rgba(222, 255, 251, 0.84);
  font-size: 12px;
  font-weight: 800;
  letter-spacing: 0;
}

.visual-head i {
  width: 86px;
  height: 8px;
  border-radius: 99px;
  background:
    linear-gradient(90deg, var(--accent) 0 22%, transparent 22% 31%, var(--cyan) 31% 68%, transparent 68% 76%, #81f5e9 76%);
  box-shadow: 0 0 20px rgba(45, 212, 191, 0.38);
  animation: statusPulse 2.4s ease-in-out infinite;
}

.data-matrix {
  position: absolute;
  inset: 72px 38px 118px 38px;
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  grid-auto-rows: minmax(58px, 1fr);
  gap: 12px;
  perspective: 600px;
}

.data-matrix span {
  position: relative;
  overflow: hidden;
  border: 1px solid rgba(116, 255, 235, 0.2);
  border-radius: 6px;
  background:
    linear-gradient(180deg, rgba(87, 255, 238, 0.16), rgba(87, 255, 238, 0.035)),
    repeating-linear-gradient(90deg, rgba(255, 255, 255, 0.1) 0 2px, transparent 2px 14px);
  transform: rotateX(9deg);
  animation: tileRise 4.8s ease-in-out infinite;
}

.data-matrix span:nth-child(2n) {
  animation-delay: -1.1s;
  background:
    linear-gradient(180deg, rgba(255, 178, 74, 0.18), rgba(255, 178, 74, 0.04)),
    repeating-linear-gradient(90deg, rgba(255, 255, 255, 0.1) 0 2px, transparent 2px 14px);
}

.data-matrix span:nth-child(3n) {
  animation-delay: -2.2s;
}

.data-matrix span::after {
  content: "";
  position: absolute;
  inset: 0;
  background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.28), transparent);
  transform: translateX(-120%);
  animation: dataSweep 3.8s ease-in-out infinite;
}

.signal-bars {
  position: absolute;
  left: 42px;
  right: 42px;
  bottom: 42px;
  display: grid;
  grid-template-columns: repeat(5, 1fr);
  align-items: end;
  gap: 12px;
  height: 74px;
}

.signal-bars span {
  position: relative;
  height: var(--level);
  min-height: 18px;
  border-radius: 5px 5px 0 0;
  background: linear-gradient(180deg, rgba(255, 178, 74, 0.92), rgba(45, 212, 191, 0.72));
  box-shadow: 0 0 26px rgba(45, 212, 191, 0.28);
  animation: barSignal 3.2s ease-in-out infinite;
}

.signal-bars span:nth-child(2) {
  animation-delay: -0.45s;
}

.signal-bars span:nth-child(3) {
  animation-delay: -0.9s;
}

.signal-bars span:nth-child(4) {
  animation-delay: -1.35s;
}

.signal-bars span:nth-child(5) {
  animation-delay: -1.8s;
}

.circuit-board span {
  position: absolute;
  height: 1px;
  background: linear-gradient(90deg, transparent, rgba(126, 255, 241, 0.72), transparent);
  transform-origin: left center;
  animation: circuitFlow 4.2s linear infinite;
}

.circuit-board span:nth-child(1) {
  width: 44%;
  left: 13%;
  top: 34%;
}

.circuit-board span:nth-child(2) {
  width: 35%;
  right: 12%;
  top: 51%;
  transform: rotate(90deg);
  animation-delay: -1.4s;
}

.circuit-board span:nth-child(3) {
  width: 52%;
  left: 28%;
  bottom: 31%;
  animation-delay: -2.8s;
}

.login-panel {
  width: min(430px, 100%);
  justify-self: end;
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.92), rgba(242, 250, 251, 0.86)),
    linear-gradient(135deg, rgba(14, 165, 198, 0.18), rgba(255, 159, 67, 0.1));
  border: 1px solid rgba(255, 255, 255, 0.76);
  border-radius: 8px;
  box-shadow: 0 30px 90px rgba(5, 20, 36, 0.28), 0 0 0 1px rgba(14, 165, 198, 0.1);
  padding: 34px;
  backdrop-filter: blur(22px);
  position: relative;
  overflow: hidden;
  animation: panelFloat 6s ease-in-out infinite;
}

.login-panel::before {
  content: "";
  position: absolute;
  inset: 0 0 auto 0;
  height: 3px;
  background: linear-gradient(90deg, var(--primary), #57f7ee, var(--accent), var(--cyan));
  background-size: 220% 100%;
  border-radius: 8px 8px 0 0;
  animation: borderTrace 3.6s linear infinite;
}

.login-panel::after {
  content: "";
  position: absolute;
  inset: 1px;
  border-radius: 7px;
  border: 1px solid rgba(14, 165, 198, 0.12);
  pointer-events: none;
}

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

.brand-mark {
  width: 54px;
  height: 54px;
  display: grid;
  place-items: center;
  border-radius: 8px;
  background:
    linear-gradient(135deg, var(--primary), var(--cyan)),
    repeating-linear-gradient(45deg, rgba(255, 255, 255, 0.18) 0 1px, transparent 1px 8px);
  color: white;
  font-size: 24px;
  font-weight: 800;
  flex: 0 0 auto;
  box-shadow: 0 12px 28px rgba(15, 159, 143, 0.28), 0 0 32px rgba(14, 165, 198, 0.16);
}

.brand-mark.small {
  width: 40px;
  height: 40px;
  font-size: 18px;
}

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

h1 {
  font-size: 24px;
}

h2 {
  font-size: 24px;
}

h3 {
  font-size: 18px;
}

.brand-block p,
.topbar p,
.login-hint,
.section-head span {
  color: var(--muted);
}

.stack {
  display: grid;
  gap: 16px;
}

.remember-row {
  display: flex;
  align-items: center;
  gap: 9px;
  min-height: 28px;
}

.remember-row input {
  width: 18px;
  height: 18px;
  accent-color: var(--primary);
}

.remember-row span {
  color: #d7f8fb;
  font-size: 13px;
  font-weight: 800;
}

.login-remember-row span {
  color: #284152;
}

label {
  display: grid;
  gap: 7px;
  min-width: 0;
}

label span {
  color: #3a4656;
  font-size: 13px;
  font-weight: 600;
}

input,
select {
  width: 100%;
  height: 40px;
  border: 1px solid #cbdce6;
  border-radius: 6px;
  background: rgba(255, 255, 255, 0.92);
  color: var(--text);
  padding: 0 10px;
  outline: none;
  transition: border-color 0.16s ease, box-shadow 0.16s ease, background 0.16s ease;
}

input:focus,
select:focus {
  border-color: var(--primary);
  background: #fff;
  box-shadow: 0 0 0 3px rgba(15, 159, 143, 0.14), 0 0 20px rgba(14, 165, 198, 0.08);
}

input[readonly] {
  background: #eaf6f5;
  color: #1c5c55;
}

.primary-button,
.secondary-button,
.ghost-button,
.danger-button,
.small-button {
  min-height: 38px;
  border: 1px solid transparent;
  border-radius: 6px;
  padding: 0 14px;
  font-weight: 700;
  white-space: nowrap;
}

.primary-button {
  color: #fff;
  background: linear-gradient(135deg, var(--primary), var(--cyan));
  box-shadow: 0 10px 22px rgba(15, 159, 143, 0.24);
}

.primary-button:hover {
  background: linear-gradient(135deg, var(--primary-dark), #087f9a);
}

.secondary-button {
  color: var(--primary);
  border-color: #a7d5d1;
  background: linear-gradient(180deg, #f2fbfa, #e9f6fa);
}

.ghost-button {
  color: #e7f4f0;
  border-color: rgba(255, 255, 255, 0.22);
  background: transparent;
}

.ghost-light-button {
  min-height: 38px;
  border: 1px solid #cfe4ec;
  border-radius: 6px;
  padding: 0 14px;
  color: #27485a;
  background: rgba(255, 255, 255, 0.72);
  font-weight: 700;
  white-space: nowrap;
}

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

.small-button {
  min-height: 30px;
  padding: 0 9px;
  color: #1f4050;
  background: #eff7fa;
  border-color: #cfe4ec;
}

.small-button.danger {
  color: var(--danger);
  border-color: #f0b8b2;
  background: #fff5f4;
}

.small-button.success {
  color: #08786c;
  border-color: #9ddad3;
  background: #eafaf7;
}

.small-button.warn {
  color: #8a5d00;
  border-color: #e8c56f;
  background: #fff7df;
}

.link-button {
  border: 0;
  background: transparent;
  color: var(--primary-dark);
  font-weight: 800;
  padding: 0;
  text-decoration: underline;
  text-underline-offset: 3px;
}

.login-hint {
  font-size: 13px;
  line-height: 1.6;
}

.login-panel .brand-block,
.login-panel .stack {
  position: relative;
  z-index: 1;
}

.login-panel label span {
  color: #284152;
}

.login-panel input {
  height: 44px;
  border-color: rgba(14, 165, 198, 0.24);
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.96), rgba(239, 249, 250, 0.92)),
    repeating-linear-gradient(90deg, rgba(14, 165, 198, 0.06) 0 1px, transparent 1px 18px);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.86);
}

.login-panel input:focus {
  border-color: rgba(15, 159, 143, 0.72);
  box-shadow: 0 0 0 3px rgba(15, 159, 143, 0.15), 0 0 28px rgba(14, 165, 198, 0.18);
}

.login-panel .remember-row input {
  width: 18px;
  height: 18px;
  border-radius: 4px;
  background: #fff;
  box-shadow: none;
}

.login-panel .primary-button {
  position: relative;
  min-height: 44px;
  overflow: hidden;
  background: linear-gradient(135deg, #08786c, #0ea5c6 54%, #ff9f43);
  background-size: 180% 100%;
  box-shadow: 0 14px 30px rgba(15, 159, 143, 0.28), 0 0 34px rgba(14, 165, 198, 0.18);
  transition: transform 0.16s ease, box-shadow 0.16s ease;
  animation: buttonCharge 4s ease-in-out infinite;
}

.login-panel .primary-button::after {
  content: "";
  position: absolute;
  inset: 0;
  background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.34), transparent);
  transform: translateX(-120%);
  animation: buttonFlash 3.4s ease-in-out infinite;
}

.login-panel .primary-button:hover {
  transform: translateY(-1px);
  box-shadow: 0 18px 36px rgba(15, 159, 143, 0.34), 0 0 42px rgba(14, 165, 198, 0.22);
}

@keyframes lightSweep {
  0% {
    transform: translateX(-18%) translateY(0);
  }

  100% {
    transform: translateX(18%) translateY(4%);
  }
}

@keyframes gridDrift {
  0% {
    background-position: 0 0, 0 0;
  }

  100% {
    background-position: 84px 42px, 84px 42px;
  }
}

@keyframes scanDrop {
  0%,
  18% {
    transform: translateY(-100%);
  }

  52% {
    transform: translateY(100%);
  }

  100% {
    transform: translateY(100%);
  }
}

@keyframes panelFloat {
  0%,
  100% {
    transform: translateY(0);
  }

  50% {
    transform: translateY(-8px);
  }
}

@keyframes borderTrace {
  0% {
    background-position: 0% 0;
  }

  100% {
    background-position: 220% 0;
  }
}

@keyframes statusPulse {
  0%,
  100% {
    opacity: 0.72;
    transform: scaleX(0.9);
  }

  50% {
    opacity: 1;
    transform: scaleX(1);
  }
}

@keyframes tileRise {
  0%,
  100% {
    opacity: 0.68;
    transform: rotateX(9deg) translateY(0);
  }

  50% {
    opacity: 1;
    transform: rotateX(9deg) translateY(-6px);
  }
}

@keyframes dataSweep {
  0%,
  30% {
    transform: translateX(-120%);
  }

  70%,
  100% {
    transform: translateX(120%);
  }
}

@keyframes barSignal {
  0%,
  100% {
    filter: brightness(0.88);
    transform: scaleY(0.86);
  }

  50% {
    filter: brightness(1.18);
    transform: scaleY(1);
  }
}

@keyframes circuitFlow {
  0% {
    opacity: 0;
    background-position: -160px 0;
  }

  32%,
  68% {
    opacity: 0.92;
  }

  100% {
    opacity: 0;
    background-position: 160px 0;
  }
}

@keyframes buttonCharge {
  0%,
  100% {
    background-position: 0% 0;
  }

  50% {
    background-position: 100% 0;
  }
}

@keyframes buttonFlash {
  0%,
  45% {
    transform: translateX(-120%);
  }

  80%,
  100% {
    transform: translateX(120%);
  }
}

.app-shell {
  min-height: 100vh;
  display: grid;
  grid-template-columns: 248px minmax(0, 1fr);
}

.sidebar {
  background:
    linear-gradient(180deg, rgba(7, 18, 31, 0.98), rgba(10, 34, 48, 0.98)),
    linear-gradient(90deg, rgba(15, 159, 143, 0.28), transparent);
  color: #fff;
  display: flex;
  flex-direction: column;
  padding: 18px;
  border-right: 1px solid rgba(108, 221, 220, 0.18);
  box-shadow: 14px 0 44px rgba(7, 24, 39, 0.16);
}

.sidebar-brand {
  display: flex;
  align-items: center;
  gap: 12px;
  padding-bottom: 18px;
  border-bottom: 1px solid rgba(132, 225, 221, 0.18);
}

.sidebar-brand strong,
.sidebar-brand span,
.sidebar-footer span {
  display: block;
}

.sidebar-brand span {
  color: #9dc7d3;
  font-size: 13px;
  margin-top: 3px;
}

.nav-list {
  display: grid;
  gap: 8px;
  margin: 20px 0;
}

.nav-item {
  height: 44px;
  border: 0;
  border-radius: 6px;
  padding: 0 14px;
  text-align: left;
  color: #d7e9f0;
  background: transparent;
  position: relative;
  transition: background 0.16s ease, color 0.16s ease, transform 0.16s ease;
}

.nav-item:hover,
.nav-item.active {
  color: #fff;
  background: linear-gradient(90deg, rgba(15, 159, 143, 0.22), rgba(14, 165, 198, 0.12));
}

.nav-item.active::before {
  content: "";
  position: absolute;
  left: 0;
  top: 9px;
  bottom: 9px;
  width: 3px;
  border-radius: 3px;
  background: var(--accent);
  box-shadow: 0 0 14px rgba(255, 159, 67, 0.7);
}

.sidebar-footer {
  margin-top: auto;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  padding-top: 16px;
  border-top: 1px solid rgba(132, 225, 221, 0.18);
}

.workspace {
  min-width: 0;
  padding: 24px;
}

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

.panel {
  background: var(--panel);
  border: 1px solid rgba(199, 220, 230, 0.85);
  border-radius: 8px;
  box-shadow: var(--shadow);
  padding: 18px;
  min-width: 0;
  backdrop-filter: blur(12px);
  position: relative;
}

.panel::before {
  content: "";
  position: absolute;
  inset: 0 0 auto 0;
  height: 2px;
  background: linear-gradient(90deg, rgba(15, 159, 143, 0.65), rgba(14, 165, 198, 0.2), transparent);
  border-radius: 8px 8px 0 0;
  pointer-events: none;
}

.view-section {
  display: grid;
  gap: 18px;
}

.dashboard-hero {
  display: grid;
  grid-template-columns: minmax(260px, 1fr) minmax(360px, 0.95fr);
  gap: 18px;
  align-items: center;
  overflow: hidden;
  background:
    linear-gradient(118deg, rgba(5, 20, 33, 0.94), rgba(11, 56, 67, 0.9)),
    repeating-linear-gradient(90deg, rgba(125, 245, 234, 0.1) 0 1px, transparent 1px 36px);
  color: #eafefe;
}

.dashboard-hero::before {
  background: linear-gradient(90deg, var(--accent), rgba(45, 212, 191, 0.75), transparent);
}

.dashboard-hero .eyebrow {
  display: inline-flex;
  margin-bottom: 8px;
  color: #8df7ec;
  font-size: 12px;
  font-weight: 800;
}

.dashboard-hero h3 {
  margin: 0;
  font-size: 28px;
}

.dashboard-hero p {
  margin: 8px 0 0;
  color: #a9cbd5;
}

.dashboard-hero-metrics,
.dashboard-stat-grid {
  display: grid;
  gap: 12px;
}

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

.dashboard-hero-metrics div,
.dashboard-stat-grid div,
.dashboard-status-item {
  border: 1px solid rgba(177, 218, 228, 0.78);
  border-radius: 8px;
  padding: 13px;
  background: linear-gradient(180deg, rgba(249, 253, 253, 0.92), rgba(233, 247, 249, 0.82));
}

.dashboard-hero-metrics div {
  border-color: rgba(128, 245, 235, 0.24);
  background: rgba(255, 255, 255, 0.08);
}

.dashboard-hero-metrics span,
.dashboard-stat-grid span,
.dashboard-status-item span {
  display: block;
  color: var(--muted);
  font-size: 12px;
  margin-bottom: 5px;
}

.dashboard-hero-metrics span {
  color: #a9d8df;
}

.dashboard-hero-metrics strong,
.dashboard-stat-grid strong,
.dashboard-status-item strong {
  display: block;
  font-size: 22px;
}

.dashboard-money-stat small {
  display: block;
  margin-top: 6px;
  color: var(--muted);
  font-size: 11px;
  line-height: 1.45;
}

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

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

.dashboard-card {
  display: grid;
  gap: 14px;
  align-content: start;
}

.dashboard-card h3 {
  margin: 0;
  font-size: 17px;
}

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

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

.dashboard-status-list,
.dashboard-list {
  display: grid;
  gap: 10px;
}

.dashboard-status-item {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  align-items: center;
}

.dashboard-status-item.clickable {
  cursor: pointer;
  transition: transform 0.16s ease, border-color 0.16s ease, background 0.16s ease;
}

.dashboard-status-item.clickable:hover,
.dashboard-status-item.clickable:focus-visible {
  border-color: rgba(12, 128, 141, 0.42);
  background: rgba(255, 255, 255, 0.88);
  transform: translateY(-1px);
  outline: none;
}

.dashboard-status-item strong.ok {
  color: var(--primary-dark);
}

.dashboard-status-item strong.warn {
  color: var(--warning);
}

.dashboard-status-item strong.danger {
  color: var(--danger);
}

.dashboard-list-row {
  display: grid;
  grid-template-columns: 30px minmax(0, 1fr) auto;
  gap: 10px;
  align-items: center;
  padding: 10px;
  border: 1px solid rgba(205, 226, 235, 0.86);
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.72);
}

.dashboard-list-row strong,
.dashboard-list-row small,
.dashboard-list-row em {
  display: block;
}

.dashboard-list-row strong {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.dashboard-list-row small {
  color: var(--muted);
  font-size: 12px;
  margin-top: 4px;
}

.dashboard-list-row em {
  color: #173f4a;
  font-style: normal;
  font-weight: 800;
  white-space: nowrap;
}

.rank-index {
  width: 28px;
  height: 28px;
  display: grid;
  place-items: center;
  border-radius: 6px;
  color: #fff;
  background: linear-gradient(135deg, var(--primary), var(--cyan));
  font-weight: 900;
  font-size: 12px;
}

.rank-index.warn {
  background: linear-gradient(135deg, var(--accent), #e56f22);
}

.dashboard-empty {
  padding: 18px;
  border: 1px dashed #bfd5df;
  border-radius: 8px;
  color: var(--muted);
  background: #fff;
  text-align: center;
}

.dashboard-table {
  min-width: 980px;
}

.module-switch {
  display: flex;
  gap: 8px;
  align-items: center;
  flex-wrap: wrap;
  padding: 4px;
  border: 1px solid rgba(177, 211, 224, 0.86);
  border-radius: 8px;
  background: linear-gradient(180deg, rgba(255, 255, 255, 0.82), rgba(234, 246, 248, 0.76));
  box-shadow: 0 10px 28px rgba(16, 32, 52, 0.08);
  width: fit-content;
  max-width: 100%;
}

.module-switch-button {
  min-height: 36px;
  border: 1px solid transparent;
  border-radius: 6px;
  padding: 0 16px;
  color: #315267;
  background: transparent;
  font-weight: 800;
  white-space: nowrap;
}

.module-switch-button:hover,
.module-switch-button.active {
  color: #fff;
  border-color: rgba(15, 159, 143, 0.38);
  background: linear-gradient(135deg, var(--primary), var(--cyan));
  box-shadow: 0 8px 18px rgba(15, 159, 143, 0.18);
}

.module-panel {
  min-width: 0;
}

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

.form-grid.compact {
  grid-template-columns: repeat(2, minmax(150px, 1fr));
  align-content: start;
  gap: 18px;
}

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

.field-help {
  display: block;
  margin-top: 6px;
  color: var(--muted);
  font-size: 12px;
  line-height: 1.45;
}

input:disabled,
select:disabled,
textarea:disabled {
  color: #728395;
  background: linear-gradient(180deg, rgba(236, 244, 248, 0.96), rgba(226, 238, 244, 0.92));
  border-color: #c6d8e1;
  cursor: not-allowed;
  opacity: 1;
}

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

.sale-items-panel {
  display: grid;
  gap: 12px;
  border: 1px solid #cfe4ec;
  border-radius: 8px;
  padding: 14px;
  background: linear-gradient(180deg, rgba(244, 250, 252, 0.96), rgba(232, 246, 247, 0.82));
}

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

.sale-item-row {
  display: grid;
  grid-template-columns: minmax(220px, 1.6fr) minmax(92px, 0.55fr) minmax(120px, 0.7fr) minmax(120px, 0.7fr) minmax(150px, 0.9fr) auto;
  gap: 10px;
  align-items: end;
  padding: 12px;
  border: 1px solid rgba(184, 211, 223, 0.95);
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.82);
}

.sale-product-picker {
  position: relative;
  min-width: 0;
}

.sale-product-dropdown {
  position: absolute;
  z-index: 40;
  top: calc(100% + 4px);
  left: 0;
  right: 0;
  max-height: 260px;
  overflow: auto;
  border: 1px solid #bfd7e2;
  border-radius: 8px;
  background: #fff;
  box-shadow: 0 14px 32px rgba(7, 24, 39, 0.18);
}

.sale-product-option {
  display: grid;
  gap: 3px;
  width: 100%;
  padding: 9px 10px;
  border: 0;
  border-bottom: 1px solid rgba(207, 228, 236, 0.72);
  color: #2f4250;
  background: #fff;
  text-align: left;
  cursor: pointer;
}

.sale-product-option:last-child {
  border-bottom: 0;
}

.sale-product-option:hover,
.sale-product-option:focus,
.sale-product-option.selected {
  background: #edf7fa;
  outline: none;
}

.sale-product-option strong {
  font-size: 13px;
  line-height: 1.35;
}

.sale-product-option small {
  color: #607585;
  font-size: 12px;
  line-height: 1.35;
}

.sale-product-empty {
  padding: 11px 10px;
  color: #728395;
  font-size: 13px;
}

.sale-item-meta {
  display: grid;
  gap: 5px;
  min-height: 40px;
  align-content: center;
  color: #52697b;
  font-size: 12px;
}

.sale-item-meta span {
  color: #3a4656;
  font-weight: 700;
}

.sale-item-meta code,
.product-summary code {
  word-break: break-all;
}

.match-card {
  min-height: 48px;
  display: grid;
  gap: 4px;
  align-content: center;
  border-radius: 6px;
  padding: 11px 12px;
  font-size: 13px;
  line-height: 1.5;
}

.match-card strong,
.match-card span {
  display: block;
}

.muted-card {
  color: #5d7183;
  background: linear-gradient(180deg, #f6fafd, #eef5f8);
  border: 1px dashed #bfd5df;
}

.success-card {
  color: #174c47;
  background: linear-gradient(180deg, #edfbf8, #e4f7f6);
  border: 1px solid #a7dcd6;
  box-shadow: 0 10px 24px rgba(15, 159, 143, 0.09);
}

.warning-card {
  color: #72510e;
  background: linear-gradient(180deg, #fff8e7, #fff1d2);
  border: 1px solid #f2d08b;
}

.toolbar {
  display: grid;
  grid-template-columns: repeat(3, minmax(160px, 220px)) minmax(180px, 1fr);
  gap: 16px;
  align-items: end;
  margin-bottom: 18px;
}

.records-toolbar {
  grid-template-columns: minmax(170px, 220px) minmax(170px, 220px) minmax(220px, 1fr) auto;
  padding: 14px;
  border: 1px solid rgba(197, 223, 232, 0.9);
  border-radius: 8px;
  background: linear-gradient(180deg, rgba(248, 253, 253, 0.92), rgba(235, 247, 249, 0.78));
}

.toolbar.tight {
  grid-template-columns: minmax(220px, 1fr) auto;
}

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

.stat-row {
  display: grid;
  grid-template-columns: repeat(4, minmax(120px, 1fr));
  gap: 12px;
  margin-bottom: 16px;
}

.records-stat-row {
  gap: 14px;
  margin-bottom: 18px;
}

.stat-row div {
  background: linear-gradient(180deg, rgba(244, 249, 251, 0.96), rgba(232, 246, 247, 0.92));
  border: 1px solid #cce3e8;
  border-radius: 6px;
  padding: 14px;
}

.stat-row span,
.stat-row strong {
  display: block;
}

.stat-row span {
  color: var(--muted);
  font-size: 12px;
  margin-bottom: 4px;
}

.stat-row strong {
  font-size: 20px;
}

.table-wrap {
  width: 100%;
  overflow-x: auto;
}

.muted-small {
  margin-top: 5px;
  color: var(--muted);
  font-size: 12px;
  line-height: 1.45;
}

.inventory-detail-card {
  display: grid;
  gap: 12px;
  margin-top: 14px;
  padding: 14px;
  border: 1px solid #cfe4ec;
  border-radius: 8px;
  background: #f7fcfd;
}

.empty-detail {
  padding: 18px;
  border: 1px dashed #bed5df;
  border-radius: 8px;
  color: var(--muted);
  background: #fff;
  text-align: center;
}

table {
  width: 100%;
  min-width: 920px;
  border-collapse: collapse;
  font-size: 14px;
}

th,
td {
  border-bottom: 1px solid var(--line);
  padding: 10px 9px;
  text-align: left;
  vertical-align: middle;
}

th {
  color: #22394b;
  background: linear-gradient(180deg, #f4f9fb, #eaf3f7);
  font-weight: 800;
  position: sticky;
  top: 0;
  z-index: 1;
}

td {
  color: #283447;
}

tbody tr:hover {
  background: #f2fbfb;
}

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

.action-stack {
  display: grid;
  gap: 6px;
}

.product-summary {
  display: grid;
  gap: 3px;
  min-width: 150px;
}

.verify-progress {
  display: grid;
  gap: 4px;
  justify-items: start;
  min-width: 86px;
}

.verify-progress small {
  color: var(--muted);
  font-size: 12px;
  line-height: 1.25;
}

.amount-cell {
  display: grid;
  gap: 3px;
  min-width: 92px;
}

.amount-cell strong {
  font-weight: 800;
  color: #18384b;
}

.amount-cell.pending strong {
  color: #6b7b8d;
}

.amount-cell small {
  color: var(--muted);
  font-size: 12px;
  line-height: 1.25;
}

.outbound-product-list {
  display: grid;
  gap: 8px;
  margin-top: 6px;
}

.outbound-product-line {
  display: grid;
  gap: 3px;
  padding: 8px 10px;
  border: 1px solid rgba(176, 211, 224, 0.92);
  border-radius: 6px;
  background: rgba(255, 255, 255, 0.56);
}

.split-layout {
  display: grid;
  grid-template-columns: minmax(340px, 0.82fr) minmax(520px, 1.18fr);
  gap: 18px;
  align-items: start;
}

.mobile-layout {
  display: grid;
  grid-template-columns: minmax(320px, 0.78fr) minmax(520px, 1.22fr);
  gap: 18px;
  align-items: start;
}

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

.printer-subtitle {
  margin-top: 4px;
  padding-top: 14px;
  border-top: 1px solid var(--line);
}

.ticket-preview-head {
  margin: 16px 0 10px;
}

.receipt-preview {
  display: grid;
  justify-content: center;
  padding: 18px;
  border: 1px solid #c8dfe8;
  border-radius: 8px;
  background:
    radial-gradient(circle at 12% 16%, rgba(15, 159, 143, 0.14), transparent 26%),
    linear-gradient(135deg, rgba(7, 24, 39, 0.94), rgba(13, 47, 61, 0.92));
  overflow-x: auto;
}

.label-preview {
  display: grid;
  justify-items: center;
  gap: 10px;
  padding: 18px;
  border: 1px solid #c8dfe8;
  border-radius: 8px;
  background: linear-gradient(135deg, rgba(7, 24, 39, 0.94), rgba(13, 47, 61, 0.92));
  overflow-x: auto;
}

.label-paper {
  display: grid;
  align-content: start;
  justify-items: center;
  gap: calc(8px + var(--label-gap, 0px));
  padding: 10px;
  background: #fffdf7;
  color: #111827;
  border-radius: 3px;
  box-shadow: 0 16px 30px rgba(0, 0, 0, 0.22);
  font-family: "Microsoft YaHei", "SimSun", monospace;
}

.label-product {
  max-width: 100%;
  text-align: center;
  word-break: break-all;
}

.label-product.label-size-normal {
  font-size: 14px;
}

.label-product.label-size-large {
  font-size: 18px;
}

.label-product.label-size-xlarge {
  font-size: 22px;
}

.label-product.label-bold {
  font-weight: 900;
}

.label-code {
  max-width: 100%;
  color: #111827;
  font-size: 11px;
  text-align: center;
  word-break: break-all;
}

.label-qr .receipt-qr {
  margin: 0;
}

.label-qr .qr-grid {
  width: var(--qr-preview, 56px);
  height: var(--qr-preview, 56px);
}

.label-qr code {
  display: none;
}

.label-command-preview {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 6px;
}

.label-command-preview code {
  padding: 3px 6px;
  border-radius: 6px;
  background: rgba(255, 255, 255, 0.12);
  color: #d9f4f0;
  font-size: 12px;
}

.receipt-paper {
  width: min(100%, 292px);
  min-height: 360px;
  padding: 18px 16px 22px;
  background:
    linear-gradient(180deg, #fff, #fbf7ed);
  color: #141414;
  border-radius: 3px;
  box-shadow: 0 18px 34px rgba(0, 0, 0, 0.24);
  font-family: "Microsoft YaHei", "SimSun", monospace;
}

.receipt-title {
  font-weight: 900;
  letter-spacing: 0;
  margin-bottom: 8px;
}

.receipt-title.align-left {
  text-align: left;
}

.receipt-title.align-center {
  text-align: center;
}

.receipt-title.align-right {
  text-align: right;
}

.receipt-title.title-normal {
  font-size: 16px;
}

.receipt-title.title-large {
  font-size: 20px;
}

.receipt-title.title-xlarge {
  font-size: 24px;
}

.receipt-body {
  display: grid;
  gap: 4px;
  line-height: 1.45;
  margin: 8px 0;
  word-break: break-all;
}

.receipt-body.body-normal {
  font-size: 13px;
}

.receipt-body.body-large {
  font-size: 15px;
}

.receipt-body.body-bold {
  font-weight: 800;
}

.receipt-separator {
  color: #222;
  font-size: 13px;
  line-height: 1.2;
  margin: 8px 0;
  overflow: hidden;
  white-space: nowrap;
}

.receipt-qr {
  display: grid;
  justify-items: center;
  gap: 7px;
  margin: 12px 0 14px;
}

.qr-grid {
  display: grid;
  grid-template-columns: repeat(21, 5px);
  grid-template-rows: repeat(21, 5px);
  gap: 1px;
  padding: 8px;
  background: #fff;
  border: 1px solid #151515;
}

.qr-grid span {
  width: 5px;
  height: 5px;
  background: #fff;
}

.qr-grid span.dark {
  background: #111;
}

.receipt-qr code {
  display: block;
  max-width: 240px;
  color: #111;
  font-size: 11px;
  letter-spacing: 0;
  line-height: 1.35;
  text-align: center;
  word-break: break-all;
}

.receipt-footer {
  margin-top: 8px;
  text-align: center;
  font-size: 12px;
  line-height: 1.5;
  color: #222;
}

.overlay-modal {
  position: fixed;
  inset: 0;
  z-index: 80;
  display: grid;
  place-items: center;
  padding: 24px;
}

.overlay-backdrop {
  position: absolute;
  inset: 0;
  background: rgba(6, 17, 30, 0.62);
  backdrop-filter: blur(4px);
}

.overlay-panel {
  position: relative;
  z-index: 1;
  width: min(100%, 560px);
  display: grid;
  gap: 16px;
  padding: 20px;
  border: 1px solid rgba(201, 224, 232, 0.96);
  border-radius: 10px;
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.98), rgba(244, 250, 251, 0.97));
  box-shadow: 0 24px 50px rgba(12, 28, 42, 0.28);
}

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

.overlay-head h3,
.overlay-head p {
  margin: 0;
}

.overlay-head p {
  margin-top: 6px;
  color: var(--muted);
  font-size: 13px;
  line-height: 1.5;
  word-break: break-all;
}

.overlay-body {
  display: grid;
}

.overlay-actions {
  display: flex;
  justify-content: flex-end;
  gap: 10px;
}

.ticket-qr-viewer {
  display: grid;
  place-items: center;
  padding: 18px;
  border: 1px solid #d4e6ec;
  border-radius: 8px;
  background:
    radial-gradient(circle at 12% 16%, rgba(15, 159, 143, 0.12), transparent 24%),
    linear-gradient(135deg, rgba(7, 24, 39, 0.95), rgba(12, 43, 57, 0.92));
}

.ticket-qr-viewer img {
  display: block;
  width: min(100%, 320px);
  height: auto;
  padding: 12px;
  background: #fff;
  border-radius: 8px;
  box-shadow: 0 14px 30px rgba(0, 0, 0, 0.24);
}

.scanner-video {
  width: 100%;
  aspect-ratio: 4 / 3;
  min-height: 220px;
  border: 1px solid #b8d3df;
  border-radius: 8px;
  background:
    linear-gradient(135deg, rgba(14, 165, 198, 0.14), rgba(15, 159, 143, 0.08)),
    repeating-linear-gradient(0deg, rgba(11, 38, 50, 0.07) 0 1px, transparent 1px 28px),
    #071827;
  object-fit: cover;
}

.manual-scan {
  display: grid;
  gap: 12px;
}

.section-head {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 12px;
}

.tabs {
  display: flex;
  gap: 8px;
  border-bottom: 1px solid var(--line);
}

.tab-button {
  height: 40px;
  border: 1px solid var(--line);
  border-bottom: 0;
  border-radius: 6px 6px 0 0;
  padding: 0 18px;
  background: #f3f6f8;
  color: #405066;
  font-weight: 800;
}

.tab-button.active {
  color: #fff;
  background: var(--primary);
  border-color: var(--primary);
}

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

.checkbox-label {
  display: flex;
  align-items: center;
  gap: 8px;
  min-height: 38px;
}

.checkbox-label input {
  width: 16px;
  height: 16px;
}

.checkbox-label span {
  font-size: 14px;
}

.badge {
  display: inline-flex;
  align-items: center;
  min-height: 24px;
  padding: 0 8px;
  border-radius: 999px;
  background: #edf5f3;
  color: var(--primary);
  font-size: 12px;
  font-weight: 800;
}

.badge.warn {
  background: #fff4d7;
  color: var(--warning);
}

.badge.pending {
  background: #fff4d7;
  color: var(--warning);
}

.badge.approved {
  background: #e7f9f5;
  color: var(--primary-dark);
}

.badge.rejected {
  background: #fff0ef;
  color: var(--danger);
}

.badge.muted {
  background: #edf2f5;
  color: var(--muted);
}

.toast {
  position: fixed;
  right: 22px;
  bottom: 22px;
  max-width: min(420px, calc(100vw - 44px));
  background: #172033;
  color: white;
  border-radius: 8px;
  padding: 12px 14px;
  box-shadow: var(--shadow);
  z-index: 20;
  line-height: 1.5;
}

@media (max-width: 1080px) {
  .login-stage {
    grid-template-columns: 1fr;
    width: min(520px, 100%);
  }

  .login-visual {
    min-height: 220px;
  }

  .visual-frame {
    min-height: 220px;
  }

  .data-matrix {
    inset: 58px 28px 86px 28px;
    grid-auto-rows: minmax(38px, 1fr);
  }

  .signal-bars {
    left: 30px;
    right: 30px;
    bottom: 26px;
    height: 46px;
  }

  .login-panel {
    justify-self: center;
  }

  .app-shell {
    grid-template-columns: 1fr;
  }

  .sidebar {
    position: sticky;
    top: 0;
    z-index: 10;
    display: grid;
    grid-template-columns: auto 1fr auto;
    align-items: center;
    gap: 12px;
    padding: 12px;
  }

  .sidebar-brand {
    padding: 0;
    border: 0;
  }

  .nav-list {
    grid-auto-flow: column;
    grid-auto-columns: max-content;
    overflow-x: auto;
    margin: 0;
  }

  .sidebar-footer {
    margin: 0;
    padding: 0;
    border: 0;
  }

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

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

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

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

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

  .toolbar {
    grid-template-columns: repeat(2, minmax(160px, 1fr));
  }

  .toolbar-actions {
    justify-content: flex-start;
  }
}

@media (max-width: 720px) {
  .login-screen {
    padding: 18px;
    background:
      repeating-linear-gradient(90deg, rgba(45, 212, 191, 0.07) 0 1px, transparent 1px 72px),
      repeating-linear-gradient(0deg, rgba(255, 178, 74, 0.06) 0 1px, transparent 1px 64px),
      linear-gradient(145deg, #06111e 0%, #0b2632 48%, #eff8f7 48%, #f8fbfd 100%);
  }

  .login-stage {
    width: 100%;
  }

  .login-visual {
    display: none;
  }

  .workspace {
    padding: 14px;
  }

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

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

  .sidebar-footer {
    justify-content: flex-start;
  }

  .form-grid,
  .form-grid.compact,
  .toolbar,
  .toolbar.tight,
  .stat-row,
  .dashboard-hero-metrics,
  .dashboard-stat-grid,
  .dashboard-stat-grid.compact {
    grid-template-columns: 1fr;
  }

  .form-actions,
  .toolbar-actions {
    flex-wrap: wrap;
  }

  .login-panel {
    padding: 24px;
  }

  .scanner-video {
    min-height: 260px;
  }
}

@media (prefers-reduced-motion: reduce) {
  .login-screen::before,
  .login-grid,
  .login-scan,
  .login-panel,
  .login-panel::before,
  .visual-head i,
  .data-matrix span,
  .data-matrix span::after,
  .signal-bars span,
  .circuit-board span,
  .login-panel .primary-button,
  .login-panel .primary-button::after {
    animation: none !important;
  }

  .login-scan {
    display: none;
  }
}
