:root {
  color-scheme: light;
  font-family: "Microsoft YaHei UI", "Microsoft YaHei", system-ui, sans-serif;
  background: #f5f7fa;
  color: #172033;
}
* { box-sizing: border-box; }
body { margin: 0; min-width: 320px; min-height: 100vh; background: #f5f7fa; }
button, input, select, textarea { font: inherit; letter-spacing: 0; }
button { cursor: pointer; }
.hidden { display: none !important; }
.shell { min-height: 100vh; }
.topbar { height: 68px; padding: 0 28px; border-bottom: 1px solid #e3e8ef; display: flex; align-items: center; justify-content: space-between; gap: 20px; background: #fff; }
.brand { font-size: 16px; line-height: 1.2; font-weight: 800; color: #101828; }
.product { margin-top: 3px; font-size: 12px; color: #667085; }
.top-actions { display: flex; align-items: center; gap: 10px; }
.status { font-size: 12px; color: #667085; }
main { min-height: calc(100vh - 68px); }
.auth-view { min-height: calc(100vh - 68px); display: grid; place-items: center; padding: 36px 18px; }
.auth-panel { width: min(100%, 420px); border: 1px solid #e1e6ed; border-radius: 8px; padding: 28px; background: #fff; box-shadow: 0 14px 38px rgba(16, 24, 40, .08); }
h1, h2, h3, p { margin: 0; }
.auth-panel h1 { font-size: 22px; }
.auth-panel > p { margin-top: 9px; color: #667085; font-size: 13px; line-height: 1.7; }
.segmented { margin: 24px 0 18px; padding: 3px; display: grid; grid-template-columns: 1fr 1fr; gap: 3px; border: 1px solid #e0e5ec; border-radius: 6px; background: #f1f4f7; }
.segmented button { height: 36px; border: 0; border-radius: 4px; background: transparent; color: #667085; font-weight: 700; }
.segmented button.active { background: #fff; color: #101828; box-shadow: 0 1px 3px rgba(16, 24, 40, .12); }
.field { display: block; margin-bottom: 15px; color: #475467; font-size: 12px; font-weight: 700; }
.field input, .field select, .field textarea, .inline-form input { width: 100%; margin-top: 7px; border: 1px solid #d0d7e1; border-radius: 6px; outline: 0; background: #fff; color: #172033; }
.field input, .field select, .inline-form input { height: 41px; padding: 0 12px; }
.field textarea { padding: 10px 12px; resize: vertical; }
.field input:focus, .field select:focus, .field textarea:focus, .inline-form input:focus { border-color: #159a75; box-shadow: 0 0 0 3px rgba(21, 154, 117, .12); }
.button { min-height: 36px; border: 1px solid transparent; border-radius: 6px; padding: 0 14px; font-size: 13px; font-weight: 800; }
.button.primary { background: #0f9f77; color: #fff; }
.button.primary:hover { background: #0b8563; }
.button.secondary { border-color: #d0d7e1; background: #fff; color: #344054; }
.button.secondary:hover { background: #f1f4f7; }
.button.danger { border-color: #efc8cd; background: #fff; color: #b42334; }
.button.danger:hover { background: #fff1f3; }
.button.full { width: 100%; height: 43px; }
.button:disabled { cursor: not-allowed; opacity: .45; }
.message { margin: 12px 0; border: 1px solid #ecd888; border-radius: 6px; padding: 10px 12px; background: #fffbea; color: #7a5a08; font-size: 12px; line-height: 1.6; }
.dashboard { width: min(1220px, calc(100% - 40px)); margin: 0 auto; padding: 30px 0 64px; }
.account-bar { display: flex; align-items: center; justify-content: space-between; gap: 16px; }
.account-bar h1 { font-size: 22px; }
.muted { margin-top: 5px; color: #667085; font-size: 12px; }
.role-badge { border: 1px solid #a8dfcc; border-radius: 999px; padding: 5px 10px; background: #ecfdf5; color: #067647; font-size: 11px; font-weight: 800; }
.tabs { margin-top: 24px; display: flex; gap: 4px; border-bottom: 1px solid #dfe5ec; overflow-x: auto; }
.tabs button { height: 42px; border: 0; border-bottom: 2px solid transparent; padding: 0 18px; background: transparent; color: #667085; font-size: 13px; font-weight: 800; white-space: nowrap; }
.tabs button:hover { color: #344054; }
.tabs button.active { border-bottom-color: #0f9f77; color: #101828; }
.view-section { padding-top: 24px; }
.balance-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 14px; }
.balance { min-height: 132px; border: 1px solid #dfe5ec; border-radius: 8px; padding: 20px; background: #fff; box-shadow: 0 1px 2px rgba(16, 24, 40, .04); }
.balance span { display: block; color: #667085; font-size: 12px; font-weight: 700; }
.balance strong { display: inline-block; margin-top: 19px; font-size: 29px; }
.balance small { margin-left: 7px; color: #667085; font-size: 11px; }
.balance.available { border-color: #b7e4d2; background: #f0fbf6; }
.balance.available strong { color: #067647; }
.balance.frozen { border-color: #bfdcf0; background: #f1f8fd; }
.balance.frozen strong { color: #175f8c; }
.balance.payment strong { display: block; font-size: 16px; color: #475467; }
.balance.payment small { display: block; margin: 8px 0 0; }
.notice-band { margin-top: 18px; border-left: 3px solid #0f9f77; padding: 13px 16px; background: #eef8f5; color: #475467; font-size: 12px; line-height: 1.8; }
.section-heading { display: flex; align-items: flex-start; justify-content: space-between; gap: 16px; margin-bottom: 14px; }
.section-heading h2 { font-size: 17px; }
.section-heading p { margin-top: 5px; color: #667085; font-size: 12px; }
.redeem-band { margin-bottom: 16px; display: grid; grid-template-columns: minmax(0, 1fr) auto auto; align-items: end; gap: 10px; border-bottom: 1px solid #dfe5ec; padding-bottom: 16px; }
.redeem-band .field { margin: 0; }
.redeem-band .button { height: 41px; }
.card-shop-link { display: inline-flex; align-items: center; justify-content: center; text-decoration: none; white-space: nowrap; }
.data-list { border: 1px solid #dfe5ec; border-radius: 8px; overflow: hidden; background: #fff; }
.data-row { min-height: 65px; padding: 13px 16px; display: grid; grid-template-columns: minmax(0, 1fr) auto; align-items: center; gap: 18px; border-top: 1px solid #e6eaf0; }
.data-row:first-child { border-top: 0; }
.row-title { overflow: hidden; color: #1d2939; font-size: 13px; font-weight: 800; text-overflow: ellipsis; white-space: nowrap; }
.row-subtitle { margin-top: 5px; overflow: hidden; color: #667085; font-size: 11px; text-overflow: ellipsis; white-space: nowrap; }
.row-value { text-align: right; color: #067647; font-size: 13px; font-weight: 800; }
.row-value.negative { color: #b42334; }
.row-side { display: flex; flex-direction: column; align-items: flex-end; gap: 9px; }
.row-actions { display: flex; flex-wrap: wrap; justify-content: flex-end; gap: 7px; }
.empty { padding: 40px 18px; text-align: center; color: #98a2b3; font-size: 12px; }
#ledger-more { margin-top: 14px; }
.admin-grid { display: grid; grid-template-columns: minmax(0, .9fr) minmax(0, 1.1fr); gap: 18px; }
.admin-block { border: 1px solid #dfe5ec; border-radius: 8px; padding: 18px; background: #fff; }
.admin-block h3 { margin-bottom: 16px; font-size: 14px; }
.block-description { margin: -8px 0 16px; color: #667085; font-size: 12px; line-height: 1.7; }
.review-block { grid-column: 1 / -1; }
.review-heading { margin-bottom: 14px; display: flex; align-items: flex-start; justify-content: space-between; gap: 14px; }
.review-heading h3 { margin-bottom: 5px; }
.review-heading p { color: #667085; font-size: 12px; line-height: 1.6; }
.review-actions { display: flex; flex-wrap: wrap; justify-content: flex-end; gap: 8px; }
.inline-form { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 8px; }
.inline-form input { margin: 0; }
.button.link { border: 0; background: transparent; color: #0f6cbd; }
.reset-help { margin: 0 0 16px; color: #667085; font-size: 12px; line-height: 1.7; }
.reset-credential-row { display: grid; grid-template-columns: minmax(0, 1fr) auto; align-items: end; gap: 8px; }
.reset-credential-row .button { height: 41px; white-space: nowrap; }
.admin-reset-output { margin-top: 12px; border: 1px solid #f4d58d; border-radius: 8px; padding: 12px; background: #fff8e7; color: #7a4f00; font-size: 12px; line-height: 1.7; word-break: break-word; }
.compact-list { margin: 12px 0 18px; max-height: 260px; overflow: auto; border: 1px solid #dfe5ec; border-radius: 6px; }
.compact-user { width: 100%; padding: 11px 12px; display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 12px; border: 0; border-top: 1px solid #e6eaf0; text-align: left; background: #fff; color: #344054; }
.compact-user:first-child { border-top: 0; }
.compact-user:hover { background: #f5f7fa; }
.compact-user small { display: block; margin-top: 4px; color: #667085; }
.compact-user strong { color: #067647; font-size: 12px; }
.compact-batch { padding: 11px 12px; display: grid; grid-template-columns: minmax(0, 1fr) auto; align-items: center; gap: 12px; border-top: 1px solid #e6eaf0; }
.compact-batch:first-child { border-top: 0; }
.compact-batch small { display: block; margin-top: 4px; color: #667085; line-height: 1.5; }
.compact-batch strong { color: #067647; font-size: 12px; }
.compact-batch .row-side { gap: 5px; }
.form-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 0 12px; }
.form-grid .span-two { grid-column: 1 / -1; }
.check-field { grid-column: 1 / -1; margin-bottom: 15px; display: flex; align-items: center; gap: 8px; color: #475467; font-size: 12px; }
.modal-dialog { width: min(520px, calc(100% - 28px)); max-height: min(88vh, 680px); border: 1px solid #dfe5ec; border-radius: 8px; padding: 0; overflow: auto; background: #fff; color: #172033; box-shadow: 0 24px 70px rgba(16, 24, 40, .22); }
.modal-dialog::backdrop { background: rgba(16, 24, 40, .46); animation: backdrop-fade-in 160ms ease-out; }
.modal-dialog[open] { animation: dialog-fade-in 180ms ease-out; }
.modal-form { padding: 20px; }
.dialog-header { display: flex; align-items: flex-start; justify-content: space-between; gap: 18px; }
.dialog-header h2 { font-size: 17px; }
.dialog-header p { margin-top: 6px; color: #667085; font-size: 12px; line-height: 1.6; }
.dialog-close { width: 34px; height: 34px; flex: 0 0 34px; border: 1px solid #d0d7e1; border-radius: 6px; background: #fff; color: #475467; font-size: 23px; line-height: 1; }
.dialog-close:hover { background: #f1f4f7; color: #101828; }
.price-context { margin: 18px 0 16px; display: flex; align-items: center; justify-content: space-between; gap: 18px; border-bottom: 1px solid #e6eaf0; padding-bottom: 14px; }
.price-context span { color: #667085; font-size: 12px; }
.price-context strong { color: #067647; font-size: 13px; text-align: right; }
.price-field-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 0 12px; }
.dialog-note { color: #667085; font-size: 12px; line-height: 1.7; }
.dialog-actions { margin-top: 20px; display: flex; flex-wrap: wrap; justify-content: flex-end; gap: 9px; }
.card-codes-dialog { width: min(680px, calc(100% - 28px)); }
.card-codes-output { width: 100%; min-height: 300px; margin-top: 18px; border: 1px solid #d0d7e1; border-radius: 6px; padding: 12px; resize: vertical; background: #f8fafc; color: #172033; font: 12px/1.7 Consolas, monospace; letter-spacing: 0; }
.card-details-dialog { width: min(760px, calc(100% - 28px)); }
.card-detail-list { max-height: 430px; margin-top: 18px; overflow: auto; }
.feedback-layout { display: grid; grid-template-columns: minmax(320px, .9fr) minmax(360px, 1.1fr); gap: 18px; }
.feedback-form, .feedback-history { border: 1px solid #dfe5ec; border-radius: 8px; padding: 18px; background: #fff; }
.feedback-form h3, .feedback-list-heading h3 { margin: 0; color: #1d2939; font-size: 14px; }
.feedback-upload-row { margin-top: 2px; display: flex; flex-wrap: wrap; align-items: center; gap: 10px; color: #667085; font-size: 11px; }
.feedback-image-preview { display: flex; flex-wrap: wrap; gap: 8px; min-height: 0; margin: 12px 0; }
.feedback-image-thumb { position: relative; width: 90px; height: 68px; overflow: hidden; border: 1px solid #dfe5ec; border-radius: 6px; background: #f8fafc; }
.feedback-image-thumb img { width: 100%; height: 100%; object-fit: cover; }
.feedback-image-thumb button { position: absolute; top: 3px; right: 3px; width: 20px; height: 20px; border: 0; border-radius: 4px; background: rgba(16, 24, 40, .78); color: #fff; font-size: 15px; line-height: 1; }
.feedback-list-heading { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding-bottom: 12px; border-bottom: 1px solid #e6eaf0; }
.count-badge { min-width: 22px; border: 1px solid #b7e4d2; border-radius: 999px; padding: 2px 7px; background: #ecfdf5; color: #067647; font-size: 11px; font-weight: 800; text-align: center; }
.feedback-list, .admin-feedback-list { min-height: 120px; }
.feedback-card { padding: 15px 0; border-top: 1px solid #e6eaf0; }
.feedback-card:first-child { border-top: 0; }
.feedback-card-header { display: flex; align-items: flex-start; justify-content: space-between; gap: 10px; }
.feedback-card-title { color: #1d2939; font-size: 13px; font-weight: 800; line-height: 1.5; }
.feedback-meta { margin-top: 5px; color: #667085; font-size: 11px; line-height: 1.55; }
.feedback-status { flex: 0 0 auto; border: 1px solid #b7e4d2; border-radius: 999px; padding: 3px 8px; background: #ecfdf5; color: #067647; font-size: 11px; font-weight: 800; white-space: nowrap; }
.feedback-status.open { border-color: #f4d58d; background: #fff8e7; color: #9a6700; }
.feedback-status.in_progress { border-color: #b9d7f0; background: #f0f7fd; color: #175f8c; }
.feedback-status.closed { border-color: #d0d5dd; background: #f2f4f7; color: #475467; }
.feedback-reply { margin-top: 10px; border-left: 2px solid #0f9f77; padding-left: 10px; color: #344054; font-size: 12px; line-height: 1.7; white-space: pre-wrap; }
.feedback-attachments { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 11px; }
.feedback-attachments img { width: 112px; height: 84px; border: 1px solid #dfe5ec; border-radius: 6px; object-fit: cover; }
.feedback-card-actions { margin-top: 11px; display: flex; justify-content: flex-end; }
.feedback-card-actions button { min-height: 30px; padding: 0 10px; font-size: 11px; }
.feedback-filter { display: grid; grid-template-columns: minmax(0, 1fr) 170px 170px auto; gap: 10px; margin-bottom: 16px; }
.feedback-filter input, .feedback-filter select { height: 41px; border: 1px solid #d0d7e1; border-radius: 6px; padding: 0 12px; outline: 0; background: #fff; color: #172033; }
.feedback-filter input:focus, .feedback-filter select:focus { border-color: #159a75; box-shadow: 0 0 0 3px rgba(21, 154, 117, .12); }
.admin-feedback-card { border: 1px solid #dfe5ec; border-radius: 8px; padding: 18px; background: #fff; }
.admin-feedback-card + .admin-feedback-card { margin-top: 12px; }
.admin-feedback-description { margin: 13px 0 0; color: #344054; font-size: 13px; line-height: 1.75; white-space: pre-wrap; }
.admin-feedback-details { margin-top: 11px; color: #667085; font-size: 12px; line-height: 1.7; white-space: pre-wrap; }
.admin-feedback-controls { margin-top: 16px; display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px; }
.admin-feedback-controls label { color: #475467; font-size: 12px; font-weight: 700; }
.admin-feedback-controls select, .admin-feedback-controls textarea { width: 100%; margin-top: 7px; border: 1px solid #d0d7e1; border-radius: 6px; padding: 9px 12px; outline: 0; background: #fff; color: #172033; }
.admin-feedback-controls textarea { min-height: 86px; resize: vertical; }
.admin-feedback-controls select:focus, .admin-feedback-controls textarea:focus { border-color: #159a75; box-shadow: 0 0 0 3px rgba(21, 154, 117, .12); }
.admin-feedback-save { display: flex; justify-content: flex-end; margin-top: 14px; }
.analytics-heading { align-items: center; }
.analytics-controls { display: flex; align-items: center; gap: 8px; }
.analytics-controls label { color: #667085; font-size: 12px; font-weight: 700; white-space: nowrap; }
.analytics-controls select { height: 36px; border: 1px solid #d0d7e1; border-radius: 6px; padding: 0 32px 0 10px; outline: 0; background: #fff; color: #344054; font-size: 12px; font-weight: 700; }
.analytics-controls select:focus { border-color: #159a75; box-shadow: 0 0 0 3px rgba(21, 154, 117, .12); }
.analytics-summary { display: grid; grid-template-columns: repeat(6, minmax(0, 1fr)); border: 1px solid #dfe5ec; border-radius: 8px; overflow: hidden; background: #fff; }
.analytics-metric { min-width: 0; padding: 17px 16px; border-left: 1px solid #e6eaf0; }
.analytics-metric:first-child { border-left: 0; }
.analytics-metric span, .analytics-metric small { display: block; color: #667085; font-size: 11px; line-height: 1.5; }
.analytics-metric strong { display: block; margin: 9px 0 5px; overflow: hidden; color: #172033; font-size: 19px; text-overflow: ellipsis; white-space: nowrap; }
.analytics-metric:first-child strong { color: #067647; }
.analytics-metric strong.cell-positive { color: #067647; }
.analytics-metric strong.cell-negative { color: #b42334; }
.analytics-section { margin-top: 18px; border-top: 1px solid #dfe5ec; padding-top: 16px; }
.analytics-section-title { display: flex; align-items: baseline; justify-content: space-between; gap: 12px; margin-bottom: 10px; }
.analytics-section-title h3 { color: #1d2939; font-size: 14px; }
.analytics-section-title span { color: #667085; font-size: 11px; }
.analytics-split { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 22px; }
.table-scroll { width: 100%; overflow-x: auto; border: 1px solid #dfe5ec; border-radius: 8px; background: #fff; }
.analytics-table { width: 100%; min-width: 720px; border-collapse: collapse; table-layout: auto; }
.analytics-table th, .analytics-table td { border-bottom: 1px solid #e6eaf0; padding: 11px 13px; text-align: right; vertical-align: middle; white-space: nowrap; }
.analytics-table th { background: #f8fafc; color: #667085; font-size: 11px; font-weight: 800; }
.analytics-table td { color: #344054; font-size: 12px; }
.analytics-table th:first-child, .analytics-table td:first-child { text-align: left; }
.analytics-table tbody tr:last-child td { border-bottom: 0; }
.analytics-table tbody tr:hover td { background: #fafcfb; }
.analytics-table .cell-primary { color: #172033; font-weight: 800; }
.analytics-table .cell-positive { color: #067647; font-weight: 800; }
.analytics-table .cell-negative { color: #b42334; font-weight: 800; }
.analytics-table .cell-detail { display: block; max-width: 260px; margin-top: 3px; overflow: hidden; color: #667085; font-size: 10px; text-overflow: ellipsis; white-space: nowrap; }
.analytics-table .table-empty { height: 86px; color: #98a2b3; text-align: center; }
.analytics-ledger-table { min-width: 960px; }
.analytics-ledger-table td:last-child { max-width: 320px; overflow: hidden; text-overflow: ellipsis; }
@keyframes dialog-fade-in { from { opacity: 0; transform: translateY(8px); } to { opacity: 1; transform: translateY(0); } }
@keyframes backdrop-fade-in { from { opacity: 0; } to { opacity: 1; } }
@media (max-width: 820px) {
  .topbar { height: auto; min-height: 68px; padding: 14px 18px; }
  .dashboard { width: min(100% - 28px, 1220px); padding-top: 22px; }
  .balance-grid, .admin-grid, .feedback-layout, .analytics-split { grid-template-columns: 1fr; }
  .analytics-summary { grid-template-columns: repeat(3, minmax(0, 1fr)); }
  .analytics-metric:nth-child(4) { border-left: 0; }
  .analytics-metric:nth-child(n+4) { border-top: 1px solid #e6eaf0; }
  .balance { min-height: 112px; }
  .form-grid { grid-template-columns: 1fr; }
  .form-grid .span-two { grid-column: auto; }
  .price-field-grid { grid-template-columns: 1fr; }
  .redeem-band { grid-template-columns: 1fr; align-items: stretch; }
  .card-shop-link { width: 100%; }
  .feedback-filter { grid-template-columns: 1fr 1fr; }
  .feedback-filter input { grid-column: 1 / -1; }
}
@media (max-width: 520px) {
  .top-actions .status { display: none; }
  .auth-panel { padding: 22px 18px; }
  .account-bar { align-items: flex-start; }
  .tabs button { padding: 0 13px; }
  .data-row { grid-template-columns: 1fr; gap: 7px; }
  .row-value { text-align: left; }
  .row-side { align-items: flex-start; }
  .row-actions { justify-content: flex-start; }
  .feedback-filter { grid-template-columns: 1fr; }
  .feedback-filter input { grid-column: auto; }
  .admin-feedback-controls { grid-template-columns: 1fr; }
  .analytics-heading { align-items: flex-start; }
  .analytics-heading, .analytics-controls { flex-direction: column; }
  .analytics-controls { width: 100%; align-items: stretch; }
  .analytics-controls select, .analytics-controls .button { width: 100%; }
  .analytics-summary { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .analytics-metric:nth-child(3), .analytics-metric:nth-child(5) { border-left: 0; }
  .analytics-metric:nth-child(n+3) { border-top: 1px solid #e6eaf0; }
  .analytics-metric:nth-child(4) { border-left: 1px solid #e6eaf0; }
}

/* Windows 11 inspired visual system. Layout rules above remain the compatibility base. */
:root {
  color-scheme: light;
  font-family: "Segoe UI Variable", "Segoe UI", "Microsoft YaHei UI", system-ui, sans-serif;
  --win-bg: #f3f3f3;
  --win-surface: rgba(255, 255, 255, .88);
  --win-surface-solid: #ffffff;
  --win-surface-subtle: #f9f9f9;
  --win-layer: #eeeeee;
  --win-border: rgba(0, 0, 0, .08);
  --win-border-strong: rgba(0, 0, 0, .14);
  --win-text: #1a1a1a;
  --win-muted: #616161;
  --win-subtle: #7a7a7a;
  --win-accent: #0f6cbd;
  --win-accent-hover: #115ea3;
  --win-accent-pressed: #0c3b5e;
  --win-accent-soft: #eff6fc;
  --win-positive: #107c10;
  --win-positive-soft: #f1faf1;
  --win-negative: #c42b1c;
  --win-negative-soft: #fdf3f2;
  --win-warning: #8a5d00;
  --win-warning-soft: #fff8e1;
  --win-shadow-card: 0 1px 2px rgba(0, 0, 0, .06), 0 8px 24px rgba(0, 0, 0, .035);
  --win-shadow-flyout: 0 8px 28px rgba(0, 0, 0, .16), 0 2px 6px rgba(0, 0, 0, .08);
  background: var(--win-bg);
  color: var(--win-text);
}

body {
  background: var(--win-bg);
  color: var(--win-text);
  -webkit-font-smoothing: antialiased;
}

button,
input,
select,
textarea {
  letter-spacing: 0;
}

button,
a,
input,
select,
textarea {
  transition: border-color 120ms ease, background-color 120ms ease, color 120ms ease, box-shadow 120ms ease;
}

button:focus-visible,
a:focus-visible,
input:focus-visible,
select:focus-visible,
textarea:focus-visible {
  outline: 2px solid var(--win-accent);
  outline-offset: 2px;
}

.topbar {
  position: sticky;
  top: 0;
  z-index: 20;
  height: 64px;
  padding: 0 32px;
  border-bottom: 1px solid var(--win-border);
  background: rgba(249, 249, 249, .84);
  box-shadow: 0 1px 0 rgba(255, 255, 255, .72);
  backdrop-filter: blur(22px) saturate(1.35);
}

.brand {
  color: var(--win-text);
  font-size: 17px;
  font-weight: 700;
}

.product,
.status,
.muted,
.section-heading p,
.block-description,
.dialog-header p,
.dialog-note {
  color: var(--win-muted);
}

.status {
  position: relative;
  padding-left: 14px;
}

.status::before {
  content: "";
  position: absolute;
  top: 50%;
  left: 0;
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: var(--win-positive);
  transform: translateY(-50%);
  box-shadow: 0 0 0 3px rgba(16, 124, 16, .1);
}

main {
  min-height: calc(100vh - 64px);
}

.auth-view {
  min-height: calc(100vh - 64px);
}

.auth-panel,
.balance,
.admin-block,
.feedback-form,
.feedback-history,
.admin-feedback-card {
  border: 1px solid var(--win-border);
  border-radius: 12px;
  background: var(--win-surface);
  box-shadow: var(--win-shadow-card);
  backdrop-filter: blur(18px);
}

.auth-panel {
  width: min(100%, 432px);
  padding: 30px;
  box-shadow: 0 18px 48px rgba(0, 0, 0, .1), 0 1px 2px rgba(0, 0, 0, .05);
}

.auth-panel h1,
.account-bar h1 {
  color: var(--win-text);
  font-weight: 650;
}

.segmented {
  padding: 3px;
  border: 1px solid var(--win-border);
  border-radius: 9px;
  background: var(--win-layer);
}

.segmented button {
  border-radius: 6px;
  color: var(--win-muted);
  font-weight: 600;
}

.segmented button:hover {
  background: rgba(255, 255, 255, .5);
  color: var(--win-text);
}

.segmented button.active {
  background: var(--win-surface-solid);
  color: var(--win-text);
  box-shadow: 0 1px 2px rgba(0, 0, 0, .1);
}

.field,
.check-field,
.admin-feedback-controls label,
.analytics-controls label {
  color: #424242;
  font-weight: 600;
}

.field input,
.field select,
.field textarea,
.inline-form input,
.feedback-filter input,
.feedback-filter select,
.admin-feedback-controls select,
.admin-feedback-controls textarea,
.analytics-controls select,
.card-codes-output {
  border: 1px solid var(--win-border-strong);
  border-bottom-color: rgba(0, 0, 0, .38);
  border-radius: 8px;
  background: rgba(255, 255, 255, .92);
  color: var(--win-text);
}

.field input:hover,
.field select:hover,
.field textarea:hover,
.inline-form input:hover,
.feedback-filter input:hover,
.feedback-filter select:hover,
.admin-feedback-controls select:hover,
.admin-feedback-controls textarea:hover,
.analytics-controls select:hover {
  background: var(--win-surface-solid);
  border-color: rgba(0, 0, 0, .22);
  border-bottom-color: rgba(0, 0, 0, .5);
}

.field input:focus,
.field select:focus,
.field textarea:focus,
.inline-form input:focus,
.feedback-filter input:focus,
.feedback-filter select:focus,
.admin-feedback-controls select:focus,
.admin-feedback-controls textarea:focus,
.analytics-controls select:focus {
  border-color: var(--win-accent);
  border-bottom-color: var(--win-accent);
  box-shadow: 0 0 0 1px var(--win-accent);
}

.button {
  min-height: 34px;
  border-radius: 8px;
  font-weight: 600;
}

.button.primary {
  border-color: rgba(0, 0, 0, .08);
  background: var(--win-accent);
  color: #ffffff;
  box-shadow: inset 0 1px rgba(255, 255, 255, .18);
}

.button.primary:hover {
  background: var(--win-accent-hover);
}

.button.primary:active {
  background: var(--win-accent-pressed);
}

.button.secondary {
  border-color: var(--win-border-strong);
  background: rgba(255, 255, 255, .72);
  color: #242424;
  box-shadow: 0 1px 1px rgba(0, 0, 0, .04);
}

.button.secondary:hover {
  background: var(--win-surface-solid);
}

.button.danger {
  border-color: rgba(196, 43, 28, .24);
  background: rgba(255, 255, 255, .74);
  color: var(--win-negative);
}

.button.danger:hover {
  background: var(--win-negative-soft);
}

.message {
  border: 1px solid rgba(138, 93, 0, .22);
  border-radius: 8px;
  background: var(--win-warning-soft);
  color: var(--win-warning);
}

.dashboard {
  width: min(1360px, calc(100% - 48px));
  padding: 28px 0 64px;
}

.role-badge,
.count-badge,
.feedback-status {
  border-color: rgba(15, 108, 189, .2);
  background: var(--win-accent-soft);
  color: var(--win-accent-pressed);
}

.tabs {
  margin-top: 22px;
  gap: 3px;
  border: 1px solid var(--win-border);
  border-radius: 10px;
  padding: 3px;
  background: rgba(234, 234, 234, .78);
}

.tabs button {
  height: 38px;
  border: 0;
  border-radius: 7px;
  padding: 0 16px;
  color: var(--win-muted);
  font-weight: 600;
}

.tabs button:hover {
  background: rgba(255, 255, 255, .52);
  color: var(--win-text);
}

.tabs button.active {
  border: 0;
  background: var(--win-surface-solid);
  color: var(--win-text);
  box-shadow: 0 1px 2px rgba(0, 0, 0, .1);
}

.view-section {
  padding-top: 26px;
}

.balance {
  min-height: 128px;
  padding: 20px;
}

.balance.available {
  border-color: rgba(16, 124, 16, .2);
  background: linear-gradient(180deg, rgba(255, 255, 255, .96), var(--win-positive-soft));
}

.balance.available strong,
.row-value,
.compact-user strong,
.compact-batch strong,
.price-context strong,
.analytics-table .cell-positive,
.analytics-metric strong.cell-positive {
  color: var(--win-positive);
}

.balance.frozen {
  border-color: rgba(15, 108, 189, .2);
  background: linear-gradient(180deg, rgba(255, 255, 255, .96), var(--win-accent-soft));
}

.balance.frozen strong {
  color: var(--win-accent);
}

.row-value.negative,
.analytics-table .cell-negative,
.analytics-metric strong.cell-negative {
  color: var(--win-negative);
}

.notice-band {
  border: 1px solid rgba(15, 108, 189, .18);
  border-left: 3px solid var(--win-accent);
  border-radius: 8px;
  background: var(--win-accent-soft);
  color: #424242;
}

.section-heading h2,
.admin-block h3,
.feedback-form h3,
.feedback-list-heading h3,
.analytics-section-title h3,
.analytics-summary-title h3 {
  color: var(--win-text);
  font-weight: 650;
}

.redeem-band,
.price-context,
.feedback-list-heading {
  border-color: var(--win-border);
}

.data-list,
.compact-list,
.table-scroll {
  border: 1px solid var(--win-border);
  border-radius: 10px;
  background: var(--win-surface-solid);
  box-shadow: 0 1px 2px rgba(0, 0, 0, .035);
}

.data-row,
.compact-user,
.compact-batch,
.feedback-card {
  border-color: var(--win-border);
}

.data-row:hover,
.compact-user:hover {
  background: var(--win-surface-subtle);
}

.row-title,
.feedback-card-title,
.analytics-table .cell-primary {
  color: var(--win-text);
}

.row-subtitle,
.compact-user small,
.compact-batch small,
.feedback-meta,
.analytics-section-title span,
.analytics-table .cell-detail,
.analytics-metric span,
.analytics-metric small {
  color: var(--win-muted);
}

.modal-dialog {
  border: 1px solid var(--win-border);
  border-radius: 12px;
  background: rgba(255, 255, 255, .96);
  color: var(--win-text);
  box-shadow: var(--win-shadow-flyout);
  backdrop-filter: blur(24px);
}

.modal-dialog::backdrop {
  background: rgba(0, 0, 0, .34);
  backdrop-filter: blur(2px);
}

.dialog-close {
  border-color: transparent;
  border-radius: 8px;
  background: transparent;
  color: var(--win-muted);
}

.dialog-close:hover {
  background: var(--win-layer);
  color: var(--win-text);
}

.feedback-status.open {
  border-color: rgba(138, 93, 0, .22);
  background: var(--win-warning-soft);
  color: var(--win-warning);
}

.feedback-status.in_progress {
  border-color: rgba(15, 108, 189, .2);
  background: var(--win-accent-soft);
  color: var(--win-accent-pressed);
}

.feedback-status.closed {
  border-color: var(--win-border);
  background: var(--win-layer);
  color: var(--win-muted);
}

.feedback-reply {
  border-left-color: var(--win-accent);
}

.analytics-summary-title {
  margin: 20px 0 10px;
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 12px;
}

.analytics-summary-title h3 {
  margin: 0;
  font-size: 14px;
}

.analytics-summary-title span {
  color: var(--win-muted);
  font-size: 11px;
}

.analytics-summary {
  border: 1px solid var(--win-border);
  border-radius: 10px;
  background: var(--win-surface-solid);
  box-shadow: var(--win-shadow-card);
}

.analytics-metric {
  border-color: var(--win-border);
  padding: 18px 16px;
}

.analytics-metric strong {
  color: var(--win-text);
  font-size: 20px;
  font-weight: 650;
}

.analytics-metric:first-child strong {
  color: var(--win-accent);
}

.analytics-section {
  margin-top: 24px;
  border-top: 0;
  padding-top: 0;
}

.analytics-table th,
.analytics-table td {
  border-color: var(--win-border);
  padding: 12px 14px;
}

.analytics-table th {
  background: var(--win-surface-subtle);
  color: var(--win-muted);
  font-weight: 600;
}

.analytics-table td {
  color: #424242;
}

.analytics-table tbody tr:hover td {
  background: var(--win-accent-soft);
}

.referral-admin-grid {
  margin-top: 18px;
}

.referral-table {
  min-width: 1040px;
}

.referral-table .button {
  min-height: 30px;
  margin-left: 8px;
  padding: 5px 9px;
  font-size: 11px;
}

@media (max-width: 820px) {
  .topbar {
    height: auto;
    min-height: 64px;
    padding: 12px 18px;
  }
  .dashboard {
    width: min(100% - 28px, 1360px);
    padding-top: 20px;
  }
  .analytics-summary {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }
  .analytics-metric:nth-child(4) {
    border-left: 0;
  }
  .analytics-metric:nth-child(n+4) {
    border-top: 1px solid var(--win-border);
  }
}

@media (max-width: 520px) {
  .auth-panel {
    padding: 24px 18px;
  }
  .tabs button {
    padding: 0 13px;
  }
  .analytics-summary-title {
    align-items: flex-start;
    flex-direction: column;
    gap: 4px;
  }
  .analytics-summary {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
  .analytics-metric:nth-child(3),
  .analytics-metric:nth-child(5) {
    border-left: 0;
  }
  .analytics-metric:nth-child(n+3) {
    border-top: 1px solid var(--win-border);
  }
  .analytics-metric:nth-child(4) {
    border-left: 1px solid var(--win-border);
  }
}
