:root {
  --bg: #f6f8fb;
  --surface: #ffffff;
  --surface-soft: #eef3f8;
  --ink: #17202a;
  --muted: #667085;
  --line: #dce4ee;
  --primary: #1f7a6f;
  --primary-dark: #155e56;
  --accent: #3f6fb6;
  --warning: #d99020;
  --danger: #c94b4b;
  --success: #229e62;
  --shadow: 0 18px 50px rgba(27, 43, 65, 0.12);
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  min-height: 100vh;
  background: var(--bg);
  color: var(--ink);
  font-family:
    Inter, "Microsoft YaHei", "PingFang SC", "Segoe UI", Arial, sans-serif;
}

button,
input {
  font: inherit;
}

button {
  cursor: pointer;
}

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

.sidebar {
  display: flex;
  flex-direction: column;
  gap: 28px;
  padding: 24px 18px;
  background: #15252f;
  color: #f8fbff;
}

.brand,
.profile-chip,
.nav-item,
.sidebar-note,
.entry-item,
.activity-item,
.status-row {
  display: flex;
  align-items: center;
}

.brand {
  gap: 12px;
}

.brand-mark {
  display: grid;
  place-items: center;
  width: 42px;
  height: 42px;
  border-radius: 8px;
  background: var(--primary);
  color: #fff;
  font-weight: 900;
}

.brand strong,
.brand span {
  display: block;
}

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

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

.nav-group {
  display: grid;
  gap: 6px;
}

.nav-group-toggle {
  justify-content: flex-start;
}

.nav-chevron {
  margin-left: auto;
  font-style: normal;
  transition: transform 0.2s ease;
}

.nav-group.open .nav-chevron {
  transform: rotate(180deg);
}

.nav-sublist {
  display: none;
  gap: 6px;
  padding-left: 16px;
}

.nav-group.open .nav-sublist {
  display: grid;
}

.nav-subitem {
  min-height: 40px;
  padding-left: 10px;
  font-size: 14px;
}

.nav-item {
  gap: 12px;
  width: 100%;
  flex: 0 0 auto;
  min-height: 46px;
  border: 0;
  border-radius: 8px;
  padding: 0 12px;
  background: transparent;
  color: #c8d3de;
  text-align: left;
}

.nav-item b {
  white-space: nowrap;
}

.nav-item span {
  display: grid;
  place-items: center;
  width: 26px;
  height: 26px;
}

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

.sidebar-note {
  gap: 8px;
  margin-top: auto;
  border: 1px solid rgba(255, 255, 255, 0.12);
  border-radius: 8px;
  padding: 12px;
  color: #c8d3de;
  font-size: 13px;
}

.sidebar-note p {
  margin: 0;
}

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

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

.eyebrow {
  margin: 0 0 5px;
  color: var(--primary);
  font-size: 12px;
  font-weight: 800;
  letter-spacing: 0;
}

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

h1 {
  margin-bottom: 0;
  font-size: 28px;
}

h2 {
  margin-bottom: 0;
  font-size: 20px;
}

.profile-chip {
  gap: 10px;
  min-width: 252px;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 10px 12px;
  background: var(--surface);
}

.avatar {
  display: grid;
  place-items: center;
  width: 38px;
  height: 38px;
  border-radius: 8px;
  background: #e4f3ef;
  color: var(--primary-dark);
  font-weight: 800;
}

.profile-chip strong,
.profile-chip span {
  display: block;
}

.profile-chip span {
  margin-top: 2px;
  color: var(--muted);
  font-size: 12px;
}

.view {
  display: none;
}

.view.active {
  display: block;
}

.auth-layout,
.scan-layout,
.redeem-layout,
.content-grid {
  display: grid;
  grid-template-columns: minmax(0, 1.1fr) minmax(320px, 0.9fr);
  gap: 20px;
}

.auth-panel,
.qr-login,
.panel,
.metric-card {
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface);
  box-shadow: var(--shadow);
}

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

.section-title {
  margin-bottom: 22px;
}

.section-title.compact {
  margin-bottom: 16px;
}

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

label {
  display: grid;
  gap: 7px;
  color: var(--muted);
  font-size: 13px;
  font-weight: 700;
}

input {
  width: 100%;
  min-height: 46px;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 0 13px;
  background: #fbfdff;
  color: var(--ink);
  outline: none;
}

select {
  width: 100%;
  min-height: 46px;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 0 13px;
  background: #fbfdff;
  color: var(--ink);
  outline: none;
}

input:focus {
  border-color: var(--primary);
  box-shadow: 0 0 0 3px rgba(31, 122, 111, 0.12);
}

.captcha-row {
  display: grid;
  grid-template-columns: 1fr 130px;
  gap: 12px;
  align-items: end;
}

.captcha-code {
  min-height: 46px;
  border: 1px dashed var(--primary);
  border-radius: 8px;
  background: #e9f6f3;
  color: var(--primary-dark);
  font-weight: 900;
}

.primary-action,
.secondary-action,
.ghost-action,
.danger-action {
  min-height: 42px;
  border-radius: 8px;
  padding: 0 16px;
  font-weight: 800;
}

.primary-action {
  border: 0;
  background: var(--primary);
  color: #fff;
}

.primary-action:hover {
  background: var(--primary-dark);
}

.secondary-action,
.ghost-action {
  border: 1px solid var(--line);
  background: #fff;
  color: var(--ink);
}

.danger-action {
  border: 1px solid rgba(201, 75, 75, 0.25);
  background: #fff5f5;
  color: var(--danger);
}

.inline-alert,
.muted {
  color: var(--muted);
}

.inline-alert {
  margin: 0;
  font-size: 13px;
}

.qr-login {
  display: grid;
  align-content: start;
  gap: 14px;
}

.qr-card {
  position: relative;
  display: grid;
  place-items: center;
  width: min(100%, 260px);
  aspect-ratio: 1;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
}

.qr-card.large {
  width: min(100%, 320px);
}

.qr-grid {
  width: 78%;
  aspect-ratio: 1;
  background:
    linear-gradient(90deg, #1f2d3a 12px, transparent 12px) 0 0 / 32px 32px,
    linear-gradient(#1f2d3a 12px, transparent 12px) 0 0 / 32px 32px,
    linear-gradient(90deg, transparent 18px, #1f2d3a 18px 24px, transparent 24px) 0 0 / 42px 42px,
    #fff;
  border: 12px solid #fff;
  box-shadow: inset 0 0 0 14px #1f2d3a;
}

.qr-grid.dense {
  background:
    linear-gradient(90deg, #17202a 10px, transparent 10px) 0 0 / 26px 26px,
    linear-gradient(#17202a 10px, transparent 10px) 0 0 / 26px 26px,
    linear-gradient(45deg, transparent 20px, #17202a 20px 27px, transparent 27px) 0 0 / 44px 44px,
    #fff;
}

.qr-mask {
  position: absolute;
  inset: 14px;
  display: grid;
  place-items: center;
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.88);
  color: var(--danger);
  font-size: 24px;
  font-weight: 900;
}

.hidden {
  display: none;
}

.status-row {
  gap: 8px;
  color: var(--muted);
  font-size: 14px;
}

.status-row p {
  margin: 0;
}

.dot {
  width: 9px;
  height: 9px;
  border-radius: 99px;
  background: var(--muted);
}

.dot.success {
  background: var(--success);
}

.dot.warning {
  background: var(--warning);
}

.metric-grid,
.admin-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 16px;
  margin-bottom: 20px;
}

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

.metric-card {
  padding: 20px;
}

.metric-card span {
  color: var(--muted);
  font-size: 13px;
  font-weight: 800;
}

.metric-card strong {
  display: block;
  margin: 10px 0 8px;
  font-size: 30px;
}

.metric-card p {
  margin-bottom: 0;
  color: var(--muted);
  font-size: 13px;
}

.metric-card.accent {
  background: #e6f3f0;
}

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

.pill {
  display: inline-flex;
  align-items: center;
  min-height: 28px;
  border-radius: 999px;
  padding: 0 10px;
  background: var(--surface-soft);
  color: var(--muted);
  font-size: 12px;
  font-weight: 800;
}

.entry-list,
.activity-list,
.code-list {
  display: grid;
  gap: 10px;
}

.monitor-stack {
  display: grid;
  gap: 12px;
}

.monitor-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 16px;
  background: #fbfdff;
}

.monitor-row strong {
  display: block;
}

.monitor-row p {
  margin: 4px 0 0;
  color: var(--muted);
  font-size: 13px;
}

.monitor-value {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 76px;
  min-height: 36px;
  border-radius: 8px;
  background: var(--surface-soft);
  color: var(--ink);
  font-weight: 900;
}

.monitor-value.good {
  background: #e4f3ef;
  color: var(--success);
}

.entry-item {
  gap: 12px;
  width: 100%;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 14px;
  background: #fff;
  text-align: left;
}

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

.entry-item p,
.activity-item p {
  margin: 4px 0 0;
  color: var(--muted);
  font-size: 13px;
}

.entry-icon {
  display: grid;
  place-items: center;
  width: 38px;
  height: 38px;
  border-radius: 8px;
  background: #f2eadb;
  color: #946012;
  font-weight: 900;
}

.entry-icon.green {
  background: #e4f3ef;
  color: var(--primary);
}

.entry-icon.blue {
  background: #e8eef8;
  color: var(--accent);
}

.activity-item {
  justify-content: space-between;
  gap: 12px;
  border-bottom: 1px solid var(--line);
  padding: 0 0 12px;
}

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

.activity-item time {
  color: var(--muted);
  font-size: 12px;
  white-space: nowrap;
}

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

.qr-stage {
  display: grid;
  grid-template-columns: 320px 1fr;
  gap: 22px;
  align-items: center;
}

.scan-meta strong {
  display: block;
  font-size: 22px;
}

.scan-meta p {
  margin: 10px 0;
  color: var(--muted);
}

.progress-track {
  overflow: hidden;
  height: 10px;
  border-radius: 999px;
  background: var(--surface-soft);
}

.progress-track span {
  display: block;
  width: 100%;
  height: 100%;
  border-radius: inherit;
  background: var(--primary);
  transition: width 0.3s ease;
}

.action-row {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin-top: 18px;
}

.steps {
  display: grid;
  gap: 14px;
  margin: 0;
  padding: 0;
  list-style: none;
}

.steps li {
  display: flex;
  gap: 12px;
}

.steps span,
.empty-state span {
  display: grid;
  place-items: center;
  flex: 0 0 auto;
  width: 28px;
  height: 28px;
  border-radius: 8px;
  background: #e4f3ef;
  color: var(--primary);
  font-weight: 900;
}

.steps p,
.empty-state p {
  margin: 3px 0 0;
  color: var(--muted);
}

.redeem-panel {
  align-self: start;
}

.redeem-result,
.code-item {
  margin-top: 16px;
  border-radius: 8px;
  padding: 14px;
}

.success-box {
  border: 1px solid rgba(34, 158, 98, 0.25);
  background: #eefaf4;
}

.error-box {
  border: 1px solid rgba(201, 75, 75, 0.25);
  background: #fff5f5;
}

.warning-box {
  border: 1px solid rgba(217, 144, 32, 0.25);
  background: #fff8ec;
}

.redeem-result p {
  margin: 5px 0 0;
  color: var(--muted);
}

.code-item {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  margin-top: 0;
  border: 1px solid var(--line);
}

.code-item span {
  color: var(--muted);
  font-size: 12px;
}

.table-panel {
  margin-bottom: 20px;
}

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

.compact-action {
  min-height: 34px;
  padding-inline: 12px;
  font-size: 13px;
}

.search-input {
  width: min(280px, 100%);
  min-height: 36px;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 0 12px;
  background: #fff;
  color: var(--ink);
  font: inherit;
}

.account-form {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 12px;
  margin-bottom: 18px;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 14px;
  background: #fbfdff;
}

.account-form textarea {
  min-height: 94px;
  resize: vertical;
}

.account-form.hidden {
  display: none;
}

.wide-field {
  grid-column: span 2;
}

.form-actions,
.row-actions {
  display: flex;
  align-items: end;
  gap: 8px;
}

.form-actions {
  align-self: end;
}

.row-actions {
  align-items: center;
  flex-wrap: wrap;
}

.segmented {
  display: inline-flex;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 3px;
  background: #fff;
}

.segmented button {
  min-height: 30px;
  border: 0;
  border-radius: 6px;
  padding: 0 12px;
  background: transparent;
  color: var(--muted);
  font-weight: 800;
}

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

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

table {
  width: 100%;
  min-width: 760px;
  border-collapse: collapse;
}

th,
td {
  border-bottom: 1px solid var(--line);
  padding: 13px 10px;
  text-align: left;
  font-size: 14px;
}

th {
  color: var(--muted);
  font-size: 12px;
}

.select-cell {
  width: 42px;
  text-align: center;
}

.select-cell input {
  width: 16px;
  height: 16px;
}

td .status {
  display: inline-flex;
  min-height: 26px;
  align-items: center;
  border-radius: 999px;
  padding: 0 9px;
  font-size: 12px;
  font-weight: 800;
}

.status.active {
  background: #e4f3ef;
  color: var(--success);
}

.status.issue {
  background: #fff5f5;
  color: var(--danger);
}

.status.maintenance {
  background: #fff8ec;
  color: var(--warning);
}

.empty-state {
  display: flex;
  gap: 12px;
  border: 1px dashed var(--line);
  border-radius: 8px;
  padding: 16px;
}

.login-mode {
  background:
    linear-gradient(145deg, #ffffff 0%, #ffffff 54%, #f4f8ff 100%);
}

.login-mode .app-shell {
  display: block;
  min-height: 100vh;
}

.login-mode .sidebar,
.login-mode .topbar {
  display: none;
}

.login-mode .workspace {
  display: grid;
  min-height: 100vh;
  padding: 0;
}

.admin-login-view.active {
  display: grid;
  min-height: 100vh;
}

.admin-login-shell {
  width: min(100%, 850px);
  margin: 0 auto;
  padding: 24vh 48px 44px;
}

.admin-login-brand {
  display: flex;
  align-items: center;
  gap: 32px;
  margin-bottom: 66px;
}

.admin-login-logo {
  display: grid;
  place-items: center;
  flex: 0 0 auto;
  width: 136px;
  height: 136px;
  border-radius: 36px;
  background: #f4f4f5;
}

.admin-login-logo span {
  position: relative;
  width: 72px;
  height: 76px;
  transform: skewX(-8deg);
  background: linear-gradient(145deg, #45c4ff 0 34%, #6b4dff 34% 66%, #8d2eff 66% 100%);
  clip-path: polygon(5% 0, 78% 12%, 58% 42%, 100% 42%, 28% 100%, 43% 57%, 0 57%);
}

.admin-login-logo span::after {
  content: "";
  position: absolute;
  left: 31px;
  top: 7px;
  width: 38px;
  height: 62px;
  background: #ffd525;
  clip-path: polygon(30% 0, 100% 0, 62% 36%, 100% 36%, 18% 100%, 38% 54%, 0 54%);
}

.admin-login-brand h2 {
  margin: 0;
  color: #27364a;
  font-size: 52px;
  font-weight: 900;
  line-height: 1.08;
}

.admin-login-brand p {
  margin: 18px 0 0;
  color: #68778a;
  font-size: 30px;
  line-height: 1.25;
}

.admin-login-form {
  display: grid;
  gap: 52px;
}

.admin-input {
  position: relative;
  display: block;
}

.admin-input .input-icon {
  position: absolute;
  left: 28px;
  top: 50%;
  z-index: 1;
  transform: translateY(-50%);
  color: #c4cbd6;
  font-size: 30px;
  line-height: 1;
}

.admin-input input {
  min-height: 98px;
  border: 0;
  border-radius: 10px;
  padding: 0 28px 0 74px;
  background: #f1f2f4;
  color: #263548;
  font-size: 30px;
  font-weight: 500;
  box-shadow: none;
}

.admin-input input::placeholder {
  color: #c2c7d0;
}

.admin-input input:focus {
  background: #eef5ff;
  box-shadow: 0 0 0 3px rgba(31, 125, 255, 0.12);
}

.login-options {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  margin-top: 6px;
}

.remember-row {
  display: flex;
  grid-template-columns: none;
  align-items: center;
  gap: 18px;
  color: #1f7dff;
  font-size: 30px;
  font-weight: 900;
}

.remember-row input {
  appearance: none;
  display: grid;
  place-items: center;
  width: 34px;
  height: 34px;
  min-height: 34px;
  border: 0;
  border-radius: 5px;
  padding: 0;
  background: #1f7dff;
}

.remember-row input::after {
  content: "✓";
  color: #fff;
  font-size: 28px;
  font-weight: 900;
  line-height: 1;
}

.login-options button {
  border: 0;
  background: transparent;
  color: #1f7dff;
  font-size: 30px;
  font-weight: 500;
}

.admin-login-button {
  min-height: 98px;
  border: 0;
  border-radius: 10px;
  background: #1f7dff;
  color: #fff;
  font-size: 30px;
  font-weight: 900;
  letter-spacing: 8px;
}

.admin-login-button:hover {
  background: #116dea;
}

.admin-login-form .inline-alert {
  margin: -28px 0 0;
  color: #9aa2ae;
  text-align: center;
}

.login-tools {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 56px;
  margin: 54px 0 34px;
}

.login-tools button {
  display: inline-flex;
  align-items: center;
  gap: 14px;
  border: 0;
  background: transparent;
  color: #9ca1aa;
  font-size: 28px;
}

.login-tools span {
  font-size: 28px;
}

.login-copyright {
  margin: 0;
  color: #73777e;
  font-size: 28px;
  text-align: center;
}

.login-copyright a {
  color: #2b92ff;
  text-decoration: none;
}

.buyer-page {
  background: #f2f4fa;
}

.buyer-shell {
  width: min(100%, 760px);
  margin: 0 auto;
  padding: 0 12px 34px;
}

.buyer-message,
.buyer-info {
  position: relative;
}

.buyer-banner {
  display: flex;
  align-items: center;
  min-height: 210px;
  margin: 0 -12px;
  padding: 44px 28px 26px;
  background:
    radial-gradient(circle at 80% 30%, rgba(53, 151, 255, 0.28), transparent 30%),
    linear-gradient(135deg, #f8fbff 0%, #dfefff 56%, #eef7ff 100%);
}

.buyer-banner h1 {
  margin: 0 0 12px;
  color: #3d424c;
  font-size: 36px;
  font-weight: 900;
}

.buyer-banner p {
  margin: 0;
  color: #5f6570;
  font-size: 20px;
  font-weight: 700;
}

.buyer-badge {
  display: inline-flex;
  align-items: center;
  min-height: 34px;
  border-radius: 999px;
  padding: 0 12px;
  background: #eef6ff;
  color: #1976d2;
  font-size: 13px;
  font-weight: 900;
  white-space: nowrap;
}

.buyer-badge.success {
  background: #e8f8ef;
  color: #168152;
}

.buyer-badge.danger {
  background: #fff0f0;
  color: #c94b4b;
}

.buyer-card,
.buyer-info,
.buyer-status-card {
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface);
  box-shadow: var(--shadow);
}

.buyer-card {
  padding: 24px;
}

.buyer-action-card {
  margin-top: 24px;
}

.buyer-link-code {
  margin: 0;
  color: var(--muted);
  font-size: 13px;
}

.buyer-link-code b {
  color: var(--ink);
  word-break: break-all;
}

.buyer-status-card {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px;
  margin: -42px 0 24px;
  padding: 22px;
}

.buyer-status-card article {
  border-radius: 8px;
  padding: 18px;
  background: #f5f5f6;
}

.buyer-status-card span,
.buyer-info span {
  display: block;
  color: #5b606a;
  font-size: 18px;
  font-weight: 900;
}

.buyer-status-card strong,
.buyer-info strong {
  display: block;
  margin-top: 12px;
  color: #666b75;
  font-size: 18px;
  font-weight: 800;
}

.scanner-shell {
  position: fixed;
  inset: 0;
  z-index: 50;
  overflow: hidden;
  width: 100%;
  min-height: 100vh;
  border: 0;
  border-radius: 0;
  background: #000;
}

.scanner-video {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.scanner-frame {
  position: absolute;
  inset: 11% 5% 14%;
  border: 0;
  border-radius: 8px;
  box-shadow:
    inset 0 0 0 4px transparent,
    0 0 0 999px rgba(0, 0, 0, 0.18);
}

.scanner-frame::before,
.scanner-frame::after {
  content: "";
  position: absolute;
  inset: 0;
  border: 5px solid #0fc78f;
  border-radius: 2px;
  clip-path: polygon(0 0, 12% 0, 12% 3%, 3% 3%, 3% 12%, 0 12%, 0 0, 100% 0, 88% 0, 88% 3%, 97% 3%, 97% 12%, 100% 12%, 100% 0, 100% 100%, 88% 100%, 88% 97%, 97% 97%, 97% 88%, 100% 88%, 100% 100%, 0 100%, 12% 100%, 12% 97%, 3% 97%, 3% 88%, 0 88%);
}

.scanner-line {
  position: absolute;
  left: 10%;
  right: 10%;
  top: 17%;
  height: 4px;
  border-radius: 999px;
  background: #0fc78f;
  box-shadow: 0 0 18px #0fc78f;
}

.scanner-close {
  position: absolute;
  left: 50%;
  bottom: 15%;
  display: grid;
  place-items: center;
  width: 64px;
  height: 64px;
  transform: translateX(-50%);
  border: 0;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.14);
  color: #fff;
  font-size: 44px;
  line-height: 1;
}

.hidden-file {
  display: none;
}

.buyer-card-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 18px;
}

.buyer-message {
  margin: 18px auto 0;
  max-width: 460px;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 14px;
  background: #fbfdff;
}

.buyer-message p {
  margin: 5px 0 0;
  color: var(--muted);
}

.buyer-actions {
  display: grid;
  justify-content: stretch;
  gap: 16px;
}

.buyer-big-action {
  width: 100%;
  min-height: 64px;
  border-radius: 999px;
  font-size: 20px;
  justify-content: center;
}

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

.buyer-info {
  padding: 16px;
}

.buyer-delivery-card {
  margin-top: 16px;
}

.buyer-delivery-card h2 {
  margin: 0 0 10px;
  font-size: 20px;
}

.buyer-delivery-card p {
  margin: 0;
  color: var(--muted);
  line-height: 1.7;
  white-space: pre-wrap;
}

.scanner-open {
  overflow: hidden;
}

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

  .sidebar {
    position: sticky;
    top: 0;
    z-index: 10;
    flex-direction: row;
    align-items: center;
    gap: 12px;
    overflow-x: auto;
    padding: 12px;
  }

  .brand {
    min-width: 180px;
  }

  .nav-list {
    display: flex;
    gap: 8px;
  }

  .nav-group {
    display: flex;
    gap: 8px;
  }

  .nav-sublist {
    padding-left: 0;
  }

  .nav-group.open .nav-sublist {
    display: flex;
    gap: 8px;
  }

  .nav-item {
    width: auto;
    min-width: 88px;
  }

  .sidebar-note {
    display: none;
  }

  .workspace {
    padding: 18px;
  }

  .auth-layout,
  .scan-layout,
  .redeem-layout,
  .content-grid,
  .qr-stage {
    grid-template-columns: 1fr;
  }

  .metric-grid,
  .admin-grid {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 640px) {
  .topbar {
    align-items: stretch;
    flex-direction: column;
  }

  .profile-chip {
    min-width: 0;
  }

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

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

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

  .wide-field {
    grid-column: auto;
  }

  .qr-card.large,
  .qr-card {
    width: 100%;
  }

  .activity-item,
  .code-item {
    align-items: flex-start;
    flex-direction: column;
  }

  .buyer-shell {
    padding-inline: 14px;
  }

  .buyer-card {
    padding: 20px;
  }

  .buyer-info-grid {
    grid-template-columns: 1fr;
  }

  .buyer-actions .primary-action,
  .buyer-actions .secondary-action,
  .buyer-actions .danger-action {
    width: 100%;
  }

  .buyer-card-head {
    align-items: flex-start;
    flex-direction: column;
  }

  .admin-login-shell {
    width: 100%;
    padding: 24vh 24px 34px;
  }

  .admin-login-brand {
    gap: 18px;
    margin-bottom: 34px;
  }

  .admin-login-logo {
    width: 68px;
    height: 68px;
    border-radius: 18px;
  }

  .admin-login-logo span {
    width: 38px;
    height: 42px;
  }

  .admin-login-logo span::after {
    left: 16px;
    top: 4px;
    width: 21px;
    height: 34px;
  }

  .admin-login-brand h2 {
    font-size: 26px;
  }

  .admin-login-brand p {
    margin-top: 8px;
    font-size: 17px;
  }

  .admin-login-form {
    gap: 26px;
  }

  .admin-input .input-icon {
    left: 16px;
    font-size: 18px;
  }

  .admin-input input {
    min-height: 50px;
    border-radius: 5px;
    padding-inline: 44px 14px;
    font-size: 17px;
  }

  .login-options {
    margin-top: 5px;
  }

  .remember-row {
    gap: 9px;
    font-size: 17px;
  }

  .remember-row input {
    width: 18px;
    height: 18px;
    min-height: 18px;
    border-radius: 3px;
  }

  .remember-row input::after {
    font-size: 16px;
  }

  .login-options button {
    font-size: 17px;
  }

  .admin-login-button {
    min-height: 50px;
    border-radius: 5px;
    font-size: 17px;
    letter-spacing: 6px;
  }

  .admin-login-form .inline-alert {
    margin-top: -12px;
    font-size: 12px;
  }

  .login-tools {
    gap: 22px;
    margin: 28px 0 22px;
  }

  .login-tools button {
    gap: 7px;
    font-size: 16px;
  }

  .login-tools span {
    font-size: 16px;
  }

  .login-copyright {
    font-size: 16px;
  }
}
