:root {
  color-scheme: dark;
  --bg: #0d1117;
  --panel: #151b23;
  --line: rgba(255, 255, 255, 0.08);
  --muted: rgba(255, 255, 255, 0.64);
  --text: #f3f6fb;
  --accent: #ff9b47;
  --accent-2: #ff6f2c;
  --danger: #ff6b6b;
  --radius: 22px;
  --shadow: 0 24px 60px rgba(0, 0, 0, 0.28);
  font-family: "PingFang SC", "Microsoft YaHei", sans-serif;
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  background:
    radial-gradient(circle at top right, rgba(255, 155, 71, 0.18), transparent 28%),
    linear-gradient(180deg, #0d1117 0%, #090c11 100%);
  color: var(--text);
}

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

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

.login-shell {
  min-height: 100vh;
  display: grid;
  place-items: center;
  padding: 32px;
}

.login-card {
  width: min(480px, 100%);
  padding: 36px;
  border-radius: 30px;
  background: linear-gradient(180deg, rgba(21, 27, 35, 0.98) 0%, rgba(16, 20, 27, 0.98) 100%);
  box-shadow: var(--shadow);
  border: 1px solid var(--line);
}

.login-card__eyebrow,
.brand__eyebrow {
  font-size: 12px;
  letter-spacing: 0.18em;
  color: rgba(255, 255, 255, 0.46);
}

.login-card__title {
  margin: 14px 0 0;
  font-size: 34px;
  line-height: 1.2;
}

.login-card__desc,
.login-card__hint,
.brand__desc,
.topbar__desc,
.panel__sub,
.sidebar-note {
  color: var(--muted);
  line-height: 1.7;
}

.login-card__desc {
  margin: 14px 0 0;
}

.login-form {
  display: grid;
  gap: 14px;
  margin-top: 22px;
}

.app-shell {
  min-height: 100vh;
  display: grid;
  grid-template-columns: 280px 1fr;
}

.sidebar {
  padding: 28px 22px;
  border-right: 1px solid var(--line);
  background: rgba(10, 13, 18, 0.86);
  backdrop-filter: blur(18px);
}

.brand__name {
  margin-top: 10px;
  font-size: 28px;
  font-weight: 800;
}

.sidebar-nav {
  display: grid;
  gap: 10px;
  margin-top: 28px;
}

.sidebar-nav__item {
  width: 100%;
  height: 48px;
  border: 1px solid transparent;
  border-radius: 16px;
  background: transparent;
  color: rgba(255, 255, 255, 0.72);
  text-align: left;
  padding: 0 16px;
  cursor: pointer;
}

.sidebar-nav__item.is-active {
  background: rgba(255, 155, 71, 0.14);
  border-color: rgba(255, 155, 71, 0.22);
  color: #fff3e9;
}

.sidebar-note {
  margin-top: 24px;
  padding: 16px;
  border-radius: 18px;
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid var(--line);
  font-size: 14px;
}

.main {
  padding: 28px;
}

.topbar,
.toolbar,
.panel__title-row,
.form-actions,
.topbar__actions,
.toolbar__group {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.topbar {
  margin-bottom: 20px;
}

.topbar__title {
  font-size: 34px;
  font-weight: 800;
}

.stats-grid,
.panel-grid {
  display: grid;
  gap: 18px;
}

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

.panel-grid--dashboard {
  grid-template-columns: 1.4fr 1fr 1fr;
  margin-top: 18px;
}

.panel-grid--products {
  grid-template-columns: 1.45fr 1fr;
  margin-top: 18px;
}

.panel {
  padding: 22px;
  border-radius: var(--radius);
  background: linear-gradient(180deg, rgba(21, 27, 35, 0.98) 0%, rgba(17, 22, 29, 0.98) 100%);
  border: 1px solid var(--line);
  box-shadow: var(--shadow);
}

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

.stat-card {
  padding: 20px;
  border-radius: 20px;
  background: linear-gradient(180deg, rgba(29, 36, 46, 0.96) 0%, rgba(20, 25, 32, 0.96) 100%);
  border: 1px solid rgba(255, 255, 255, 0.06);
}

.stat-card__label {
  color: var(--muted);
  font-size: 14px;
}

.stat-card__value {
  margin-top: 12px;
  font-size: 34px;
  font-weight: 800;
}

.stat-card__note {
  margin-top: 8px;
  color: rgba(255, 255, 255, 0.46);
  font-size: 13px;
}

.panel__title {
  margin: 0;
  font-size: 22px;
}

.panel__sub {
  margin: 8px 0 0;
  font-size: 14px;
}

.trend-chart {
  display: grid;
  grid-template-columns: repeat(7, minmax(0, 1fr));
  gap: 14px;
  align-items: end;
  min-height: 280px;
  margin-top: 20px;
}

.trend-bar {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 10px;
}

.trend-bar__value {
  color: rgba(255, 255, 255, 0.68);
  font-size: 13px;
}

.trend-bar__shape {
  width: 100%;
  min-height: 14px;
  border-radius: 18px 18px 8px 8px;
  background: linear-gradient(180deg, var(--accent) 0%, var(--accent-2) 100%);
  box-shadow: 0 14px 28px rgba(255, 111, 44, 0.2);
}

.trend-bar__label {
  color: rgba(255, 255, 255, 0.52);
  font-size: 13px;
}

.mini-list {
  display: grid;
  gap: 12px;
  margin-top: 18px;
}

.mini-row {
  padding: 14px 16px;
  border-radius: 16px;
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid var(--line);
}

.mini-row__title {
  font-weight: 700;
}

.mini-row__sub {
  margin-top: 6px;
  color: var(--muted);
  font-size: 14px;
}

.field,
.form-grid {
  display: grid;
  gap: 10px;
}

.field span {
  font-size: 14px;
  color: rgba(255, 255, 255, 0.7);
}

.form-grid {
  grid-template-columns: repeat(2, minmax(0, 1fr));
  margin-top: 18px;
}

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

.input {
  width: 100%;
  min-height: 46px;
  padding: 0 14px;
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: 14px;
  background: rgba(255, 255, 255, 0.04);
  color: var(--text);
}

.input--textarea {
  min-height: 110px;
  padding: 12px 14px;
  resize: vertical;
}

.button {
  min-height: 44px;
  padding: 0 18px;
  border: 1px solid transparent;
  border-radius: 14px;
  cursor: pointer;
  color: var(--text);
  background: rgba(255, 255, 255, 0.06);
}

.button--primary {
  background: linear-gradient(135deg, var(--accent) 0%, var(--accent-2) 100%);
  color: #fff;
}

.button--ghost {
  border-color: rgba(255, 255, 255, 0.1);
}

.button--danger {
  background: rgba(255, 107, 107, 0.12);
  border-color: rgba(255, 107, 107, 0.22);
  color: #ffd9d9;
}

.table-wrap {
  overflow-x: auto;
  margin-top: 18px;
}

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

.table th,
.table td {
  padding: 14px 12px;
  border-bottom: 1px solid var(--line);
  vertical-align: top;
  text-align: left;
  font-size: 14px;
}

.table th {
  color: rgba(255, 255, 255, 0.54);
  font-weight: 600;
}

.table td {
  color: rgba(255, 255, 255, 0.86);
}

.badge {
  display: inline-flex;
  align-items: center;
  min-height: 28px;
  padding: 0 10px;
  border-radius: 999px;
  font-size: 12px;
  font-weight: 700;
}

.badge--online,
.badge--active,
.badge--low {
  background: rgba(34, 197, 94, 0.12);
  color: #8ef0a8;
}

.badge--review,
.badge--medium {
  background: rgba(245, 158, 11, 0.12);
  color: #ffd17c;
}

.badge--draft,
.badge--offline,
.badge--frozen,
.badge--high {
  background: rgba(255, 107, 107, 0.12);
  color: #ffb2b2;
}

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

.row-action {
  min-height: 32px;
  padding: 0 10px;
  border-radius: 12px;
  border: 1px solid rgba(255, 255, 255, 0.08);
  background: rgba(255, 255, 255, 0.04);
  color: rgba(255, 255, 255, 0.86);
  cursor: pointer;
}

.message {
  margin-top: 16px;
  min-height: 20px;
  color: #ffd59d;
}

@media (max-width: 1180px) {
  .app-shell {
    grid-template-columns: 1fr;
  }

  .sidebar {
    border-right: 0;
    border-bottom: 1px solid var(--line);
  }

  .stats-grid,
  .panel-grid--dashboard,
  .panel-grid--products {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 720px) {
  .main,
  .sidebar,
  .login-card {
    padding: 18px;
  }

  .topbar,
  .toolbar,
  .topbar__actions,
  .toolbar__group,
  .form-actions {
    flex-direction: column;
    align-items: stretch;
  }

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