:root {
  color-scheme: light;
  --bg: #f5f7fa;
  --panel: #ffffff;
  --ink: #1d2129;
  --muted: #86909c;
  --line: #e5e6eb;
  --accent: #165dff;
  --accent-2: #4080ff;
  --accent-dark: #1d2129;
  --gold: #f5a700;
  --accent-ink: #ffffff;
  --warn: #a15c07;
  --danger: #b42318;
  --ok: #087443;
  --brand-gradient: #165dff;
  --brand-soft-gradient: #e8f0ff;
  --shadow: 0 18px 48px rgba(29, 33, 41, .12);
  --soft-shadow: 0 2px 8px rgba(0, 0, 0, .08);
}

* { box-sizing: border-box; }
body {
  margin: 0;
  min-height: 100vh;
  background:
    linear-gradient(180deg, #fbfffd 0%, var(--bg) 48%, #f8fffb 100%);
  color: var(--ink);
  font-family: Inter, "Microsoft YaHei", "PingFang SC", system-ui, sans-serif;
  letter-spacing: 0;
}
button, input, select, textarea {
  font: inherit;
}
button {
  border: 0;
  cursor: pointer;
}
button:focus-visible, input:focus-visible, select:focus-visible, textarea:focus-visible {
  outline: 3px solid rgba(82, 201, 154, .24);
  outline-offset: 1px;
  border-color: var(--accent);
}
.hidden { display: none !important; }
.muted { color: var(--muted); }
.eyebrow {
  margin: 0 0 6px;
  color: var(--accent);
  font-size: 12px;
  font-weight: 700;
  text-transform: uppercase;
}
.login-shell {
  min-height: 100vh;
  display: grid;
  place-items: center;
  padding: 24px;
  background: linear-gradient(135deg, #fbfffd 0%, #e9f8ef 48%, #ffffff 100%);
}
.login-panel {
  width: min(520px, 100%);
  display: grid;
  gap: 24px;
  padding: 28px 40px 34px;
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: 8px;
  box-shadow: var(--shadow);
}
.login-head {
  display: grid;
  gap: 12px;
  min-height: 0;
}
.login-language-row {
  display: flex;
  justify-content: flex-end;
  min-height: 56px;
}
.login-brand {
  display: grid;
  place-items: center;
  padding: 2px 0 8px;
}
.login-logo {
  display: block;
  width: min(282px, 100%);
  height: auto;
  max-height: 282px;
  object-fit: contain;
  border-radius: 8px;
}
.login-head .language-field {
  position: static;
  width: 178px;
}
h1, h2, h3, p { margin-top: 0; }
h1 { margin-bottom: 8px; font-size: 30px; }
h2 { margin-bottom: 0; font-size: 24px; }
h3 { margin-bottom: 0; font-size: 18px; }
.form-grid {
  display: grid;
  gap: 14px;
}

.modal-box .form-grid {
  grid-template-columns: repeat(2, minmax(0, 1fr));
  align-items: start;
}

.modal-box .form-note,
.modal-box .form-field.wide,
.modal-box .password-step {
  grid-column: 1 / -1;
}
label {
  display: grid;
  gap: 7px;
  color: #364152;
  font-size: 13px;
}
.form-note {
  display: grid;
  gap: 6px;
  padding: 10px 12px;
  border: 1px solid #cfe8d8;
  border-radius: 8px;
  background: linear-gradient(135deg, #fbfffd 0%, #edf9f2 100%);
  color: #344054;
  font-size: 13px;
  line-height: 20px;
}
.form-note span {
  color: #0d5f45;
  font-weight: 800;
}
.form-note p {
  margin: 0;
}
.language-field {
  min-width: 118px;
  gap: 6px;
  color: var(--muted);
  font-size: 12px;
  font-weight: 700;
}
.language-field select {
  min-height: 34px;
  padding: 6px 8px;
}
input, select, textarea {
  width: 100%;
  min-height: 38px;
  padding: 8px 10px;
  border: 1px solid var(--line);
  border-radius: 6px;
  background: #fff;
  color: var(--ink);
}

input[type="file"] {
  padding: 7px 10px;
}
textarea { min-height: 88px; resize: vertical; }
.primary, .ghost, .soft, .danger {
  min-height: 36px;
  padding: 8px 13px;
  border-radius: 6px;
  font-weight: 700;
  white-space: nowrap;
}
.primary { background: var(--brand-gradient); color: var(--accent-ink); box-shadow: 0 8px 18px rgba(18, 147, 99, .18); }
.ghost { background: transparent; color: var(--muted); border: 1px solid var(--line); }
.soft { background: #eef9f3; color: var(--accent); }
.danger { background: #fff1f0; color: var(--danger); }
.primary:hover { filter: brightness(.97); }
.ghost:hover, .soft:hover, .danger:hover { filter: brightness(.98); }
.app-shell {
  min-height: 100vh;
  display: grid;
  grid-template-columns: 248px minmax(0, 1fr);
}
.sidebar {
  display: flex;
  flex-direction: column;
  gap: 18px;
  padding: 18px 16px;
  background: linear-gradient(180deg, #e7f8ef 0%, #d8f0e2 48%, #cde9dc 100%);
  color: var(--ink);
  box-shadow: 1px 0 0 rgba(255,255,255,.06) inset;
}
.brand {
  display: grid;
  grid-template-columns: 42px minmax(0, 1fr);
  grid-template-areas:
    "logo name"
    "logo user";
  column-gap: 10px;
  row-gap: 2px;
  min-height: 64px;
  align-content: center;
  align-items: center;
  padding: 0 12px 16px;
  border-bottom: 1px solid rgba(18, 147, 99, .16);
}
.brand-logo {
  grid-area: logo;
  width: 42px;
  height: 42px;
  object-fit: contain;
  border-radius: 10px;
  background: #fff;
}
.brand strong {
  grid-area: name;
  min-width: 0;
  color: #0b3b2b;
  font-size: 18px;
  line-height: 1.1;
  white-space: nowrap;
}
.brand span {
  grid-area: user;
  min-width: 0;
  overflow: hidden;
  color: #5f756b;
  font-size: 12px;
  text-overflow: ellipsis;
  white-space: nowrap;
}
nav {
  display: grid;
  gap: 6px;
  align-content: start;
}
.nav-btn {
  width: 100%;
  height: 48px;
  padding: 0 16px;
  border-radius: 8px;
  background: transparent;
  color: #31564a;
  text-align: left;
  display: flex;
  align-items: center;
  justify-content: flex-start;
  font-size: 16px;
  font-weight: 700;
  line-height: 1;
  letter-spacing: 0;
  white-space: nowrap;
  transition: background-color .16s ease, color .16s ease;
}
.nav-btn.active, .nav-btn:hover {
  background: linear-gradient(135deg, rgba(255,255,255,.75), rgba(82,201,154,.24));
  color: #0d5f45;
}
.sidebar .ghost {
  margin-top: auto;
  min-height: 42px;
  color: #31564a;
  border-color: rgba(18, 147, 99, .22);
}
.workspace {
  min-width: 0;
  display: grid;
  grid-template-rows: auto 1fr;
}
.topbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 18px;
  padding: 22px 28px;
  background: linear-gradient(90deg, #ffffff 0%, #f2fbf6 62%, #e8f8ef 100%);
  border-bottom: 1px solid var(--line);
  position: sticky;
  top: 0;
  z-index: 5;
}
.toolbar {
  display: flex;
  flex-wrap: wrap;
  justify-content: flex-end;
  gap: 8px;
}
.topbar-actions {
  display: flex;
  align-items: flex-end;
  justify-content: flex-end;
  gap: 12px;
}
.notification-center {
  position: relative;
  align-self: end;
}
.notification-trigger {
  position: relative;
  min-height: 34px;
  min-width: 76px;
  border: 1px solid #e5e6eb;
  border-radius: 4px;
  padding: 0 12px;
  background: #ffffff;
  color: #4e5969;
  font-weight: 700;
}
.notification-trigger:hover {
  border-color: #165dff;
  color: #165dff;
}
.notification-trigger em {
  position: absolute;
  top: -7px;
  right: -7px;
  display: grid;
  min-width: 18px;
  height: 18px;
  place-items: center;
  border-radius: 9px;
  padding: 0 5px;
  background: #f53f3f;
  color: #ffffff;
  font-size: 12px;
  font-style: normal;
  line-height: 18px;
}
.notification-menu {
  position: absolute;
  top: calc(100% + 8px);
  right: 0;
  z-index: 30;
  width: min(360px, calc(100vw - 24px));
  border: 1px solid #e5e6eb;
  border-radius: 4px;
  padding: 10px;
  background: #ffffff;
  box-shadow: 0 12px 32px rgba(0, 0, 0, .16);
}
.notification-menu-title {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 2px 2px 10px;
  border-bottom: 1px solid #f2f3f5;
}

.theme-toggle {
  min-height: 34px;
  padding: 6px 12px;
  border: 1px solid #e5e6eb;
  border-radius: 6px;
  background: #ffffff;
  color: #4e5969;
  white-space: nowrap;
}
.notification-sound-toggle {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  min-height: 28px;
  color: #4e5969;
  font-size: 12px;
  font-weight: 700;
}
.notification-sound-toggle input {
  width: 16px;
  min-height: 16px;
  padding: 0;
}
.notification-list {
  display: grid;
  gap: 8px;
  max-height: 360px;
  overflow-y: auto;
  padding-top: 10px;
}
.notification-item {
  display: grid;
  gap: 4px;
  width: 100%;
  min-height: 54px;
  border: 1px solid #e5e6eb;
  border-left: 4px solid #165dff;
  border-radius: 4px;
  padding: 8px 10px;
  background: #ffffff;
  color: #1d2129;
  text-align: left;
}
.notification-item.warn {
  border-left-color: #ff7d00;
}
.notification-item.danger {
  border-left-color: #f53f3f;
}
.notification-item span,
.notification-empty {
  color: #86909c;
  font-size: 12px;
}
.content {
  padding: 16px 22px 28px;
  display: grid;
  gap: 12px;
}
.stats {
  display: grid;
  grid-template-columns: repeat(4, minmax(150px, 1fr));
  gap: 10px;
}
.stat {
  min-height: 78px;
  padding: 12px 14px;
  background: linear-gradient(135deg, #ffffff 0%, #f0fbf5 100%);
  border: 1px solid #cfe8d8;
  border-radius: 8px;
  box-shadow: var(--soft-shadow);
}
.stat strong { display: block; font-size: 22px; margin-top: 3px; color: var(--accent-dark); }
.workbench {
  display: grid;
  grid-template-columns: repeat(4, minmax(140px, 1fr));
  gap: 12px;
}
.dashboard-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(180px, 1fr));
  gap: 10px;
}
.dashboard-panel {
  min-width: 0;
  padding: 12px;
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: 8px;
  box-shadow: var(--soft-shadow);
}
.dashboard-panel h3 {
  margin-bottom: 8px;
  font-size: 15px;
  color: #0d5f45;
}
.dashboard-list {
  display: grid;
  gap: 8px;
  margin: 0;
  padding: 0;
  list-style: none;
}
.dashboard-list li {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  min-height: 28px;
  color: #344054;
  font-size: 13px;
}
.recent-panel {
  padding: 12px;
  background: linear-gradient(135deg, #ffffff 0%, #f6fdf9 100%);
  border: 1px solid var(--line);
  border-radius: 8px;
  box-shadow: var(--soft-shadow);
}
.quick-card {
  min-height: 54px;
  padding: 12px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--panel);
  color: var(--ink);
  text-align: left;
  font-weight: 800;
  box-shadow: var(--soft-shadow);
}
.dashboard-panel .workbench {
  grid-template-columns: 1fr;
  gap: 8px;
}
.dashboard-panel .quick-card {
  min-height: 36px;
  padding: 9px 11px;
  font-size: 13px;
}
.quick-card:hover {
  border-color: rgba(18, 147, 99, .34);
  color: var(--accent);
}
.filter-bar {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  align-items: end;
  padding: 12px;
  background: linear-gradient(135deg, #ffffff 0%, #f5fdf8 100%);
  border: 1px solid var(--line);
  border-radius: 8px;
}
.filter-bar label {
  flex: 0 1 180px;
  min-width: min(180px, 100%);
}
.filter-bar label:first-child {
  flex-basis: 260px;
}
.filter-bar button {
  flex: 0 0 auto;
  min-width: 92px;
}
.table-shell {
  display: grid;
  gap: 8px;
  min-width: 0;
}
.table-tools {
  display: flex;
  justify-content: flex-end;
}
.table-reset {
  min-height: 30px;
  padding: 5px 10px;
  border: 1px solid var(--line);
  border-radius: 6px;
  background: #fff;
  color: var(--muted);
  font-size: 12px;
  font-weight: 700;
}
.table-reset:hover {
  color: var(--accent);
  border-color: rgba(18, 147, 99, .36);
}
.table-wrap {
  overflow: auto;
  max-height: calc(100vh - 248px);
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: 8px;
  box-shadow: var(--soft-shadow);
}
table {
  width: 100%;
  min-width: 760px;
  table-layout: fixed;
  border-collapse: collapse;
  border: 1px solid var(--line);
}
th, td {
  height: 64px;
  padding: 0 10px;
  border-bottom: 1px solid var(--line);
  border-right: 1px solid var(--line);
  text-align: left;
  font-size: 13px;
  line-height: 20px;
  vertical-align: middle;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
th:last-child,
td:last-child {
  border-right: 0;
}
th {
  position: relative;
  color: #475467;
  background: #f2fbf6;
  font-weight: 700;
}
.th-label {
  display: block;
  overflow: hidden;
  text-overflow: ellipsis;
}
.col-resizer {
  position: absolute;
  top: 0;
  right: -4px;
  width: 8px;
  height: 100%;
  cursor: col-resize;
  z-index: 4;
}
.col-resizer::after {
  content: "";
  position: absolute;
  top: 14px;
  bottom: 14px;
  left: 3px;
  width: 1px;
  background: transparent;
}
.col-resizer:hover::after,
body.resizing-columns .col-resizer::after {
  background: #65c99a;
}
body.resizing-columns {
  cursor: col-resize;
  user-select: none;
}
tbody tr:hover td {
  background: #f7fdf9;
}
.col-amount, .col-number {
  text-align: right;
  font-variant-numeric: tabular-nums;
}
.col-status {
  text-align: center;
}
.fill-cell {
  color: transparent;
}
th.col-action, td.col-action {
  position: sticky;
  right: 0;
  z-index: 1;
  background: var(--panel);
  box-shadow: -1px 0 0 var(--line);
}
th.col-action {
  z-index: 2;
  background: #f2fbf6;
}
tbody tr:hover td.col-action {
  background: #f7fdf9;
}
td.actions {
  overflow: visible;
  white-space: normal;
}
.action-group {
  display: inline-flex;
  align-items: center;
  justify-content: flex-start;
  gap: 6px;
  flex-wrap: nowrap;
  max-width: 100%;
}
.action-group button {
  min-height: 28px;
  padding: 5px 8px;
  font-size: 12px;
}
.empty-cell {
  height: 64px;
  text-align: center;
  color: var(--muted);
  background: var(--panel);
}
.badge {
  display: inline-flex;
  align-items: center;
  min-height: 24px;
  padding: 3px 8px;
  border-radius: 999px;
  background: #eef2f6;
  color: #344054;
  font-size: 12px;
  font-weight: 700;
}
.badge.ok { background: #e7f8ef; color: var(--ok); }
.badge.warn { background: #fff4df; color: var(--warn); }
.badge.danger { background: #fff1f0; color: var(--danger); }
.empty {
  padding: 32px;
  text-align: center;
  color: var(--muted);
}
dialog {
  width: min(920px, calc(100vw - 32px));
  border: 0;
  border-radius: 8px;
  padding: 0;
  box-shadow: var(--shadow);
}
dialog::backdrop { background: rgba(15, 23, 42, .42); }
.modal-box {
  display: grid;
  grid-template-rows: auto minmax(0, 1fr) auto;
  gap: 14px;
  padding: 18px;
  max-height: calc(100vh - 48px);
  overflow: hidden;
}
.modal-box header, .modal-box footer {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 10px;
}
.modal-box header {
  position: sticky;
  top: 0;
  z-index: 3;
  min-height: 42px;
  background: var(--panel);
}
.modal-box footer {
  position: relative;
  z-index: 3;
  justify-content: flex-end;
  padding: 12px 0 0;
  background: var(--panel);
  border-top: 1px solid var(--line);
}
#modalBody {
  min-height: 0;
  overflow: auto;
  padding-right: 6px;
}
.icon-btn {
  position: sticky;
  top: 0;
  flex: 0 0 auto;
  width: 34px;
  height: 34px;
  border-radius: 6px;
  background: #f2f4f7;
  color: var(--ink);
  font-size: 20px;
}
.toast {
  position: fixed;
  right: 18px;
  bottom: 18px;
  max-width: min(420px, calc(100vw - 36px));
  padding: 12px 14px;
  background: #17202a;
  color: white;
  border-radius: 8px;
  box-shadow: var(--shadow);
  z-index: 20;
}
.kv-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(150px, 1fr));
  gap: 10px;
}
.kv-item {
  min-width: 0;
  padding: 12px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fbfcfd;
}
.kv-item span {
  display: block;
  margin-bottom: 5px;
  color: var(--muted);
  font-size: 12px;
}
.kv-item strong {
  display: block;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  font-size: 13px;
}
.detail-section {
  display: grid;
  gap: 10px;
  margin-bottom: 16px;
}
.detail-section h4 {
  margin: 0;
  font-size: 14px;
}

@media (max-width: 900px) {
  .app-shell { grid-template-columns: 1fr; }
  .sidebar { position: static; }
  .stats { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .workbench, .dashboard-grid, .kv-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .topbar { align-items: flex-start; flex-direction: column; }
  .topbar-actions { width: 100%; justify-content: space-between; }
}

@media (max-width: 560px) {
  .content, .topbar { padding-left: 14px; padding-right: 14px; }
  .stats, .workbench, .dashboard-grid, .kv-grid { grid-template-columns: 1fr; }
  .modal-box .form-grid { grid-template-columns: 1fr; }
  .topbar-actions { display: grid; width: 100%; }
  .login-panel { padding: 24px 20px 28px; }
  .login-language-row { justify-content: center; min-height: 48px; }
  .login-head .language-field { width: min(178px, 100%); }
  .login-logo { width: min(260px, 100%); }
}

/* NEW-JIFEN-MALL-GAME 后台主题：浅灰背景、白色面板、蓝色主操作。 */
body {
  background: #f5f7fa;
}

button:focus-visible,
input:focus-visible,
select:focus-visible,
textarea:focus-visible {
  outline: 2px solid rgba(22, 93, 255, .28);
  border-color: #165dff;
}

.login-shell {
  background: #f5f7fa;
}

.login-panel,
.stat,
.dashboard-panel,
.recent-panel,
.filter-bar,
.table-wrap,
.kv-item,
dialog,
.modal-box footer {
  background: #ffffff;
  border-color: #e5e6eb;
  box-shadow: 0 2px 8px rgba(0, 0, 0, .08);
}

.form-note {
  border-color: #e5e6eb;
  background: #f7f8fa;
}

.form-note span,
.dashboard-panel h3 {
  color: #1d2129;
}

.primary {
  background: #165dff;
  box-shadow: none;
}

.primary:hover {
  background: #0e4bd8;
  filter: none;
}

.soft {
  background: transparent;
  color: #165dff;
}

.ghost {
  background: #ffffff;
  color: #4e5969;
  border-color: #e5e6eb;
}

.sidebar {
  background: #ffffff;
  color: #1d2129;
  border-right: 1px solid #e5e6eb;
  box-shadow: none;
}

.brand {
  border-bottom-color: #e5e6eb;
}

.brand strong {
  color: #1d2129;
}

.brand span,
.nav-btn {
  color: #4e5969;
}

.nav-btn.active,
.nav-btn:hover {
  color: #165dff;
  background: #e8f0ff;
}

.sidebar .ghost {
  color: #4e5969;
  border-color: #e5e6eb;
  background: #ffffff;
}

.topbar {
  background: #ffffff;
  border-bottom-color: #e5e6eb;
}

.eyebrow {
  color: #86909c;
}

.stat strong {
  color: #1d2129;
}

.quick-card {
  background: #ffffff;
  border-color: #e5e6eb;
  box-shadow: 0 2px 8px rgba(0, 0, 0, .08);
}

.quick-card:hover {
  border-color: #165dff;
  color: #165dff;
  box-shadow: 0 4px 14px rgba(22, 93, 255, .14);
}

.table-reset {
  border-color: #e5e6eb;
  color: #4e5969;
}

.table-reset:hover {
  color: #165dff;
  border-color: #165dff;
}

th,
th.col-action {
  color: #4e5969;
  background: #f7f8fa;
}

tbody tr:hover td,
tbody tr:hover td.col-action {
  background: #f7f8fa;
}

.col-resizer:hover::after,
body.resizing-columns .col-resizer::after {
  background: #165dff;
}

.badge {
  border: 1px solid #e5e6eb;
  background: #f7f8fa;
  color: #4e5969;
}

.badge.ok {
  border-color: #b7ebc6;
  background: #f2fff6;
  color: #00a870;
}

.badge.warn {
  border-color: #ffd8a6;
  background: #fff7ef;
  color: #b85d00;
}

.badge.danger {
  border-color: #f5c2c0;
  background: #fff3f3;
  color: #c21f1f;
}

.qr-thumb {
  display: block;
  width: 42px;
  height: 42px;
  object-fit: contain;
  border: 1px solid #e5e6eb;
  border-radius: 4px;
  background: #fff;
}

.toast {
  background: #1d2129;
  border-radius: 4px;
}

/* Requested admin polish: icons, regular text weight, compact tables and sortable headers. */
body,
button,
input,
select,
textarea,
label,
h1,
h2,
h3,
h4,
p,
span,
strong,
th,
.badge,
.nav-btn,
.primary,
.ghost,
.soft,
.danger,
.table-reset,
.notification-trigger,
.notification-sound-toggle,
.dashboard-panel h3,
.form-note span {
  font-weight: 400 !important;
}

.content {
  align-content: start;
}

.nav-btn {
  gap: 8px;
  height: 42px;
  padding: 0 12px;
  box-sizing: border-box;
}

.nav-icon {
  flex: 0 0 18px;
  width: 18px;
  height: 18px;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.8;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.nav-label {
  display: inline-flex;
  flex: 0 0 4em;
  width: 4em;
  min-width: 4em;
  align-items: center;
  justify-content: space-between;
  overflow: visible;
  white-space: nowrap;
}

.nav-label.count-1 {
  justify-content: center;
}

.nav-char {
  display: inline-block;
  line-height: 1;
}

.filter-bar {
  align-self: start;
  align-items: center;
  min-height: 0;
  padding: 10px 12px;
}

.filter-bar label {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr);
  align-items: center;
  gap: 8px;
  flex-basis: 240px;
  min-width: 220px;
  line-height: 20px;
  white-space: nowrap;
}

.filter-bar label:first-child {
  flex-basis: 300px;
}

.filter-bar input,
.filter-bar select {
  min-height: 34px;
  padding: 6px 10px;
}

.filter-bar button {
  min-height: 34px;
  padding: 6px 18px;
}

th,
td {
  height: 48px;
}

.sort-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 6px;
  width: 100%;
  min-height: 32px;
  border: 0;
  padding: 0 12px 0 0;
  background: transparent;
  color: inherit;
  text-align: left;
}

.sort-mark {
  flex: 0 0 auto;
  color: #86909c;
  font-size: 12px;
}

.sortable-th:hover .sort-mark {
  color: #165dff;
}

.settings-table th,
.settings-table td {
  height: 54px;
  line-height: 18px;
}

.settings-table .col-long {
  white-space: normal;
  text-overflow: clip;
}

.settings-table .col-action {
  width: 88px;
}

.settings-table .action-group button {
  min-height: 26px;
  padding: 4px 8px;
}

.modal-box {
  gap: 14px;
}

.modal-box footer {
  position: relative;
  min-height: 46px;
  margin-top: 4px;
  padding: 10px 0 0;
  box-shadow: none !important;
}

.password-step {
  max-width: 520px;
}

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

.choice-row {
  display: grid;
  grid-template-columns: 18px minmax(0, 1fr);
  align-items: start;
  gap: 10px;
  min-height: 42px;
  padding: 10px 12px;
  border: 1px solid #e5e6eb;
  border-radius: 8px;
  background: #fff;
}

.choice-row input {
  width: 16px;
  height: 16px;
  margin-top: 2px;
}

.choice-row span {
  display: grid;
  gap: 3px;
  min-width: 0;
}

.choice-row strong {
  color: #1d2129;
  line-height: 20px;
}

.choice-row em {
  color: #86909c;
  font-style: normal;
  line-height: 18px;
}

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

.permission-group {
  display: grid;
  align-content: start;
  gap: 8px;
  min-width: 0;
}

.permission-group h4 {
  margin: 0;
  color: #1d2129;
  font-size: 15px;
}

.empty {
  padding: 14px;
  color: #86909c;
  border: 1px dashed #dcdfe6;
  border-radius: 8px;
}

@media (max-width: 760px) {
  .permission-groups {
    grid-template-columns: 1fr;
  }
}

/* Keep operation pages visually consistent: same normal text size everywhere. */
body,
button,
input,
select,
textarea,
label,
p,
span,
strong,
th,
td,
.badge,
.nav-btn,
.primary,
.ghost,
.soft,
.danger,
.table-reset,
.notification-trigger,
.notification-sound-toggle,
.notification-item,
.notification-empty,
.filter-bar,
.kv-item,
.form-note {
  font-size: 14px !important;
}

.settings-table th,
.settings-table td {
  height: 54px;
  line-height: 20px;
  font-size: 14px !important;
}

.settings-table .action-group button {
  min-height: 30px;
  padding: 5px 10px;
  font-size: 14px !important;
}

.fill-cell {
  display: none;
}

body[data-theme="dark"] {
  color-scheme: dark;
  --bg: #101623;
  --panel: #161d2b;
  --ink: #e6edf7;
  --muted: #9aa8ba;
  --line: #263244;
  --accent: #4f8cff;
  --accent-2: #78a6ff;
  --accent-ink: #ffffff;
  --warn: #f6b95f;
  --danger: #ff7b72;
  --ok: #4fd18b;
  --brand-gradient: linear-gradient(135deg, #2f73ff 0%, #19b989 100%);
  --brand-soft-gradient: #18243a;
  --shadow: 0 18px 48px rgba(0, 0, 0, .34);
  --soft-shadow: 0 2px 10px rgba(0, 0, 0, .24);
  background: #101623;
  color: var(--ink);
}

body[data-theme="dark"] .login-shell,
body[data-theme="dark"] .app-shell {
  background: linear-gradient(180deg, #0e1420 0%, #101623 100%);
}

body[data-theme="dark"] .login-panel,
body[data-theme="dark"] .stat,
body[data-theme="dark"] .dashboard-panel,
body[data-theme="dark"] .recent-panel,
body[data-theme="dark"] .filter-bar,
body[data-theme="dark"] .table-wrap,
body[data-theme="dark"] .kv-item,
body[data-theme="dark"] dialog,
body[data-theme="dark"] .modal-box,
body[data-theme="dark"] .modal-box footer,
body[data-theme="dark"] .notification-menu,
body[data-theme="dark"] .quick-card {
  background: #161d2b;
  border-color: #263244;
  color: var(--ink);
  box-shadow: 0 2px 10px rgba(0, 0, 0, .28);
}

body[data-theme="dark"] .sidebar,
body[data-theme="dark"] .topbar {
  background: #121a27;
  border-color: #263244;
  color: var(--ink);
  box-shadow: none;
}

body[data-theme="dark"] .brand {
  border-bottom-color: #263244;
}

body[data-theme="dark"] .brand strong,
body[data-theme="dark"] h1,
body[data-theme="dark"] h2,
body[data-theme="dark"] h3,
body[data-theme="dark"] h4,
body[data-theme="dark"] .stat strong,
body[data-theme="dark"] .dashboard-panel h3,
body[data-theme="dark"] .choice-row strong,
body[data-theme="dark"] .permission-group h4 {
  color: #e6edf7;
}

body[data-theme="dark"] .brand span,
body[data-theme="dark"] .nav-btn,
body[data-theme="dark"] .muted,
body[data-theme="dark"] .eyebrow,
body[data-theme="dark"] label,
body[data-theme="dark"] .language-field,
body[data-theme="dark"] .choice-row em {
  color: #9aa8ba;
}

body[data-theme="dark"] .login-logo {
  box-shadow: 0 0 0 1px rgba(255, 255, 255, .08);
}

body[data-theme="dark"] .nav-btn.active,
body[data-theme="dark"] .nav-btn:hover {
  color: #d7e6ff;
  background: #1d2b43;
}

body[data-theme="dark"] input,
body[data-theme="dark"] select,
body[data-theme="dark"] textarea {
  background: #101827;
  color: #e6edf7;
  border-color: #2d3a4f;
}

body[data-theme="dark"] input::placeholder,
body[data-theme="dark"] textarea::placeholder {
  color: #6f7e91;
}

body[data-theme="dark"] .primary {
  background: linear-gradient(135deg, #2f73ff 0%, #19b989 100%);
  color: #ffffff;
}

body[data-theme="dark"] .ghost,
body[data-theme="dark"] .theme-toggle,
body[data-theme="dark"] .sidebar .ghost,
body[data-theme="dark"] .table-reset {
  background: #101827;
  color: #c4cfdd;
  border-color: #2d3a4f;
}

body[data-theme="dark"] .soft {
  background: #18243a;
  color: #8db5ff;
}

body[data-theme="dark"] .danger {
  background: #321b22;
  color: #ff9c96;
}

body[data-theme="dark"] th,
body[data-theme="dark"] th.col-action {
  color: #c4cfdd;
  background: #1a2332;
}

body[data-theme="dark"] td {
  color: #dce5f2;
}

body[data-theme="dark"] tbody tr:hover td,
body[data-theme="dark"] tbody tr:hover td.col-action {
  background: #1a2332;
}

body[data-theme="dark"] table,
body[data-theme="dark"] th,
body[data-theme="dark"] td {
  border-color: #263244;
}

body[data-theme="dark"] .form-note,
body[data-theme="dark"] .choice-row,
body[data-theme="dark"] .empty {
  background: #101827;
  border-color: #2d3a4f;
  color: #c4cfdd;
}

body[data-theme="dark"] .form-note span {
  color: #8db5ff;
}

body[data-theme="dark"] .badge {
  background: #1a2332;
  border-color: #2d3a4f;
  color: #c4cfdd;
}

body[data-theme="dark"] .badge.ok {
  border-color: #1f6f4a;
  background: #10291f;
  color: #66e29b;
}

body[data-theme="dark"] .badge.warn {
  border-color: #7a5521;
  background: #2a2115;
  color: #f6c06d;
}

body[data-theme="dark"] .badge.danger {
  border-color: #74333a;
  background: #2b171d;
  color: #ff9c96;
}

body[data-theme="dark"] .qr-thumb,
body[data-theme="dark"] .brand-logo {
  background: #ffffff;
  border-color: #2d3a4f;
}

body[data-theme="dark"] .toast {
  background: #eef4ff;
  color: #101827;
}
