:root {
  --bg: #eef2f5;
  --panel: #ffffff;
  --panel-soft: #f8fafc;
  --text: #14202b;
  --muted: #64748b;
  --line: #d8e0e8;
  --line-strong: #c6d1dc;
  --accent: #d9285c;
  --accent-dark: #ad1844;
  --accent-soft: #fff1f5;
  --primary: #23566a;
  --primary-dark: #183f4f;
  --primary-soft: #e8f3f6;
  --focus: #2a6f83;
  --success: #07895b;
  --success-soft: #edfdf5;
  --warn: #b7791f;
  --warn-bg: #fff7df;
  --warn-line: #e8bf61;
  --danger: #c7372f;
  --danger-soft: #fff0ef;
  --shadow-sm: 0 1px 2px rgba(16, 24, 40, 0.04);
  --shadow-md: 0 14px 34px rgba(20, 32, 43, 0.08);
  --shadow-lg: 0 24px 60px rgba(20, 32, 43, 0.13);
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.72) 0, rgba(255, 255, 255, 0) 260px),
    var(--bg);
  color: var(--text);
}

.shell {
  width: min(1180px, calc(100vw - 32px));
  margin: 0 auto;
  padding: 28px 0 42px;
}

.shell.narrow {
  width: min(860px, calc(100vw - 32px));
}

.create-shell {
  width: min(1040px, calc(100vw - 32px));
}

.page-shell {
  width: min(560px, calc(100vw - 32px));
  margin: 0 auto;
  padding: 48px 0;
}

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

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

.form-error {
  border: 1px solid #d92d20;
  color: #b42318;
  background: #fff0ee;
  border-radius: 8px;
  padding: 10px 12px;
}

.check-row {
  align-items: center;
  display: inline-flex;
  gap: 8px;
  line-height: 1.4;
}

.check-row span {
  color: var(--text);
  font-size: 14px;
  font-weight: 700;
}

.check-row input[type="checkbox"],
.mini-check input[type="checkbox"],
.business-check input[type="checkbox"] {
  appearance: none;
  background: linear-gradient(180deg, #fff 0%, #f7fafc 100%);
  border: 1.5px solid #a9bac8;
  border-radius: 5px;
  box-shadow: inset 0 1px 1px rgba(15, 23, 42, 0.04);
  cursor: pointer;
  flex: 0 0 auto;
  height: 17px;
  margin: 0;
  min-height: auto;
  padding: 0;
  position: relative;
  transition: background 0.15s ease, border-color 0.15s ease, box-shadow 0.15s ease;
  width: 17px;
}

.check-row input[type="checkbox"]:checked,
.mini-check input[type="checkbox"]:checked,
.business-check input[type="checkbox"]:checked {
  background: var(--accent);
  border-color: var(--accent);
  box-shadow: 0 0 0 3px rgba(31, 93, 115, 0.13);
}

.check-row input[type="checkbox"]:checked::after,
.mini-check input[type="checkbox"]:checked::after,
.business-check input[type="checkbox"]:checked::after {
  border: solid #fff;
  border-width: 0 2px 2px 0;
  content: "";
  height: 8px;
  left: 5px;
  position: absolute;
  top: 2px;
  transform: rotate(45deg);
  width: 4px;
}

.check-row input[type="checkbox"]:focus-visible,
.mini-check input[type="checkbox"]:focus-visible,
.business-check input[type="checkbox"]:focus-visible {
  outline: 3px solid rgba(31, 93, 115, 0.18);
  outline-offset: 2px;
}

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

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

.topbar-actions form {
  margin: 0;
}

.admin-nav {
  align-items: center;
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  justify-content: flex-end;
}

.admin-nav * {
  box-sizing: border-box;
}

.admin-menu {
  position: relative;
}

.admin-menu:not([open]) .admin-menu-panel {
  display: none;
}

.admin-home,
.admin-menu summary,
.admin-logout {
  align-items: center;
  background: #fff;
  border: 1px solid var(--line-strong);
  border-radius: 999px;
  box-shadow: var(--shadow-sm);
  color: #243447;
  cursor: pointer;
  display: inline-flex;
  font-size: 13px;
  font-weight: 800;
  justify-content: center;
  list-style: none;
  line-height: 1;
  min-height: 40px;
  min-width: 78px;
  padding: 0 16px;
  position: relative;
  text-align: center;
  text-decoration: none;
  transition: background 160ms ease, border-color 160ms ease, color 160ms ease, box-shadow 160ms ease, transform 160ms ease;
  white-space: nowrap;
}

.admin-menu summary {
  padding: 0 32px;
}

.admin-menu summary::-webkit-details-marker {
  display: none;
}

.admin-menu summary::after {
  content: "⌄";
  color: var(--muted);
  font-size: 12px;
  line-height: 1;
  position: absolute;
  right: 14px;
  top: 50%;
  transform: translateY(-53%);
  transition: transform 160ms ease;
}

.admin-menu[open] summary::after {
  transform: translateY(-47%) rotate(180deg);
}

.admin-menu[open] summary,
.admin-home:hover,
.admin-menu summary:hover,
.admin-logout:hover {
  background: var(--primary-soft);
  border-color: #9bb8c5;
  box-shadow: 0 10px 22px rgba(31, 93, 115, 0.12);
  color: var(--primary-dark);
  transform: translateY(-1px);
}

.admin-menu-panel {
  background: #fff;
  border: 1px solid var(--line);
  border-radius: 12px;
  box-shadow: var(--shadow-lg);
  display: grid;
  gap: 6px;
  min-width: 180px;
  padding: 9px;
  position: absolute;
  right: 0;
  top: calc(100% + 8px);
  z-index: 20;
}

.admin-home-menu .admin-menu-panel {
  min-width: 210px;
}

.admin-menu-panel::before {
  content: "";
  height: 10px;
  left: 0;
  position: absolute;
  right: 0;
  top: -10px;
}

.admin-menu-panel a,
.admin-menu-panel button {
  align-items: center;
  background: transparent;
  border: 0;
  border-radius: 9px;
  box-shadow: none;
  color: #243447;
  display: inline-flex;
  font-size: 13px;
  font-weight: 800;
  justify-content: center;
  line-height: 1;
  min-height: 36px;
  min-width: 0;
  padding: 0 12px;
  text-align: center;
  text-decoration: none;
  white-space: nowrap;
  width: 100%;
}

.admin-menu-panel a:hover,
.admin-menu-panel button:hover {
  background: var(--primary-soft);
  color: var(--primary-dark);
}

.admin-menu-panel form {
  display: block;
}

.topbar-actions .admin-home,
.topbar-actions .ghost-link,
.topbar-actions button {
  min-width: auto;
  min-height: 40px;
  padding: 0 12px;
  font-size: 13px;
}

.topbar-actions .admin-menu summary {
  min-height: 40px;
  padding: 0 32px;
}

h1,
h2,
p {
  margin: 0;
}

h1 {
  font-size: 28px;
  line-height: 1.2;
}

h2 {
  font-size: 17px;
  margin-bottom: 16px;
}

h3 {
  font-size: 15px;
  margin: 0 0 12px;
}

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

.section-title-row h2 {
  margin-bottom: 0;
}

.inline-copy {
  min-height: 34px;
  min-width: auto;
  padding: 0 12px;
}

p {
  color: var(--muted);
  margin-top: 6px;
}

.account-line {
  color: var(--primary-dark);
  font-size: 13px;
  font-weight: 700;
}

.panel-note {
  border: 1px solid var(--line);
  background: #f8fafc;
  border-radius: 8px;
  color: #475467;
  font-size: 14px;
  line-height: 1.5;
  margin: 0 0 14px;
  padding: 10px 12px;
}

.phone-tool {
  display: grid;
  gap: 14px;
}

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

.phone-status-row .panel-note {
  flex: 1;
  margin-bottom: 0;
}

.phone-actions {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 8px;
}

.phone-actions button {
  width: 100%;
  min-width: auto;
}

.phone-actions-compact {
  grid-template-columns: repeat(2, minmax(0, 1fr));
  max-width: 320px;
}

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

.legal-phone-panel {
  display: grid;
  gap: 12px;
}

.legal-phone-actions {
  max-width: 560px;
}

.legal-phone-control-row {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 10px;
  align-items: stretch;
}

.legal-phone-control-row .legal-phone-actions {
  grid-column: 1 / 4;
  max-width: none;
}

.legal-phone-result {
  grid-column: 1 / -1;
  min-height: 86px;
}

.phone-number-field {
  align-self: end;
}

.phone-copy-row {
  align-items: stretch;
  display: grid;
  grid-template-columns: minmax(0, 1fr) 72px;
  gap: 8px;
}

.phone-copy-row .small-button {
  min-height: 42px;
}

.phone-result {
  min-height: 96px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #f8fafc;
  color: var(--text);
  padding: 12px;
  white-space: pre-wrap;
  overflow-wrap: anywhere;
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  font-size: 13px;
  line-height: 1.45;
}

.phone-result.is-error {
  border-color: #d92d20;
  background: #fff0ee;
  color: #b42318;
}

.phone-result-large {
  min-height: 180px;
}

.phone-sms-panel {
  border-top: 1px solid var(--line);
  padding-top: 14px;
}

.phone-sms-panel .section-title-row {
  margin-bottom: 10px;
}

.phone-extra {
  border-top: 1px solid var(--line);
  padding-top: 12px;
}

.phone-extra summary {
  cursor: pointer;
  font-weight: 700;
  margin-bottom: 12px;
}

.ghost-link,
.button-link,
button {
  border: 1px solid var(--accent);
  background: var(--accent);
  color: #fff;
  min-height: 42px;
  padding: 0 16px;
  border-radius: 8px;
  text-decoration: none;
  font-weight: 700;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
}

.ghost-link {
  background: #fff;
  color: var(--accent);
}

.notice {
  border: 1px solid var(--warn-line);
  background: var(--warn-bg);
  border-radius: 8px;
  padding: 12px 14px;
  display: flex;
  gap: 12px;
  margin-bottom: 18px;
}

.notice span {
  color: #594318;
}

.error {
  display: none;
  border: 1px solid #d92d20;
  color: #b42318;
  background: #fff0ee;
  border-radius: 8px;
  padding: 12px 14px;
  margin-bottom: 18px;
}

.error:not(:empty) {
  display: block;
}

.success {
  display: none;
  border: 1px solid #12b76a;
  color: #067647;
  background: #ecfdf3;
  border-radius: 8px;
  padding: 12px 14px;
  margin-bottom: 18px;
}

.success:not(:empty) {
  display: block;
}

.warning {
  display: none;
  border: 1px solid var(--warn-line);
  color: #594318;
  background: var(--warn-bg);
  border-radius: 8px;
  padding: 10px 12px;
  margin-bottom: 16px;
}

.warning:not(:empty) {
  display: block;
}

.amzkeys-alert {
  align-items: center;
  display: flex;
  gap: 12px;
  justify-content: space-between;
}

.amzkeys-alert span {
  flex: 1;
}

.amzkeys-alert a {
  color: var(--primary-dark);
  font-weight: 800;
  text-decoration: none;
  white-space: nowrap;
}

.ocr-quality {
  border: 1px solid var(--line);
  border-radius: 8px;
  font-size: 14px;
  line-height: 1.5;
  margin-bottom: 16px;
  padding: 10px 12px;
}

.ocr-quality.is-ok {
  background: #ecfdf3;
  border-color: #12b76a;
  color: #067647;
}

.ocr-quality.is-warning {
  background: #fffaeb;
  border-color: #fedf89;
  color: #93370d;
}

.ocr-quality ul {
  margin: 8px 0 0;
  padding-left: 20px;
}

.ocr-diagnostics {
  border: 1px solid var(--line);
  border-radius: 8px;
  margin-top: 14px;
  padding: 10px 12px;
}

.ocr-diagnostics summary {
  cursor: pointer;
  font-weight: 700;
}

.ocr-diagnostics table {
  border-collapse: collapse;
  font-size: 13px;
  margin-top: 10px;
  width: 100%;
}

.ocr-diagnostics th,
.ocr-diagnostics td {
  border-bottom: 1px solid var(--line);
  padding: 8px 6px;
  text-align: left;
}

.ocr-diagnostics th {
  color: var(--muted);
  font-weight: 700;
}

.automation-history table {
  border-collapse: collapse;
  font-size: 13px;
  width: 100%;
}

.automation-history th,
.automation-history td {
  border-bottom: 1px solid var(--line);
  padding: 8px 6px;
  text-align: left;
  vertical-align: top;
}

.automation-history th {
  color: var(--muted);
  font-weight: 700;
}

.field-warning span {
  color: #b54708;
}

.field-warning input,
.field-warning textarea {
  border-color: #f79009;
  background: #fffaf0;
}

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

.wide {
  grid-column: 1 / -1;
}

.right-column {
  grid-column: 2;
}

.detail-lower {
  align-items: start;
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 16px;
}

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

.panel,
.table-wrap {
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 18px;
  overflow-x: auto;
}

.task-search {
  align-items: center;
  display: grid;
  grid-template-columns: minmax(260px, 1fr) auto auto;
  gap: 10px;
  margin-bottom: 14px;
  max-width: 720px;
}

.task-search input {
  min-height: 38px;
}

.task-filter-tabs {
  align-items: center;
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  justify-content: flex-start;
  margin: 0 0 14px;
}

.task-filter-tabs .tasks-pagination-top {
  margin-left: auto;
}

.task-filter-tab {
  align-items: center;
  border: 1px solid var(--line);
  border-radius: 999px;
  color: #345066;
  display: inline-flex;
  font-size: 13px;
  font-weight: 800;
  min-height: 32px;
  padding: 0 12px;
  text-decoration: none;
}

.task-filter-tab:hover {
  background: #edf7fb;
  border-color: #9dbbd2;
}

.task-filter-tab.is-active {
  background: #1f5d73;
  border-color: #1f5d73;
  color: #fff;
}

.called-car-toolbar {
  background: linear-gradient(180deg, #fffaf2 0%, #f7f1e7 100%);
  border: 1px solid var(--line);
  border-radius: 14px;
  display: flex;
  margin: 0 0 14px;
  padding: 10px 12px;
}

.called-car-toolbar-row {
  align-items: center;
  column-gap: 14px;
  display: flex;
  flex-wrap: nowrap;
  justify-content: space-between;
  min-height: 48px;
  overflow-x: auto;
  scrollbar-width: thin;
  width: 100%;
}

.called-car-filter-form,
.called-car-batch-form {
  align-items: center;
  display: flex;
  flex: 0 0 auto;
  flex-wrap: nowrap;
  gap: 8px;
  margin: 0;
}

.called-car-filter-form .small-button,
.called-car-filter-form .small-link,
.called-car-batch-form .small-button,
.called-car-batch-form .danger-button,
.called-car-batch-form .mini-check,
.called-car-account-tab {
  align-items: center;
  display: inline-flex;
  height: 38px;
  justify-content: center;
  line-height: 1;
}

.called-car-filter-form {
  background: rgba(255, 255, 255, 0.62);
  border: 1px solid rgba(185, 171, 149, 0.58);
  border-radius: 999px;
  padding: 5px;
}

.called-car-batch-form {
  background: rgba(255, 255, 255, 0.68);
  border: 1px solid rgba(185, 171, 149, 0.7);
  border-radius: 999px;
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.72);
  padding: 5px;
}

.called-car-filter-form label {
  align-items: center;
  color: var(--muted);
  display: inline-flex;
  font-size: 13px;
  font-weight: 700;
  gap: 7px;
  height: 38px;
  line-height: 1;
  white-space: nowrap;
}

.called-car-filter-form input {
  align-items: center;
  appearance: auto;
  display: inline-flex;
  font: inherit;
  height: 38px;
  line-height: 38px;
  margin-top: 0;
  min-height: 0;
  padding: 0 12px;
  vertical-align: middle;
  width: 138px;
}

.called-car-filter-form input::-webkit-date-and-time-value {
  line-height: 38px;
  min-height: 38px;
  text-align: left;
}

.called-car-filter-form input::-webkit-calendar-picker-indicator {
  margin: 0;
}

.called-car-batch-form .mini-check {
  color: var(--muted);
  font-size: 13px;
  font-weight: 700;
  gap: 7px;
  padding: 0 9px;
  white-space: nowrap;
}

.called-car-batch-form input[type="checkbox"] {
  appearance: none;
  background: #fff;
  border: 2px solid #a9bfd1;
  border-radius: 6px;
  box-sizing: border-box;
  display: inline-grid;
  height: 18px;
  margin: 0;
  place-content: center;
  width: 18px;
}

.called-car-batch-form input[type="checkbox"]::before {
  background: #fff;
  clip-path: polygon(14% 48%, 0 64%, 40% 100%, 100% 18%, 84% 5%, 36% 68%);
  content: "";
  height: 10px;
  transform: scale(0);
  transition: transform 120ms ease;
  width: 10px;
}

.called-car-batch-form input[type="checkbox"]:checked {
  background: #68775f;
  border-color: #68775f;
}

.called-car-batch-form input[type="checkbox"]:checked::before {
  transform: scale(1);
}

.called-car-account-filter {
  align-items: center;
  display: flex;
  flex: 1 0 auto;
  flex-wrap: nowrap;
  gap: 7px;
  justify-content: center;
  min-width: max-content;
}

.called-car-age-pill {
  background: #edf7f1;
  border-color: #b9dbc5;
  color: #1f6f44;
}

.batch-wenshushu-button {
  background: #eef7fb;
  border-color: #b7d8e8;
  color: #1f5d73;
}

.batch-mail-check-button {
  background: #eef7fb;
  border-color: #b7d8e8;
  color: #1f5d73;
}

.unmarked-mail-toolbar .called-car-account-filter {
  justify-content: flex-start;
}

@media (max-width: 760px) {
  .called-car-toolbar-row {
    align-items: stretch;
    flex-direction: column;
    overflow-x: visible;
  }

  .called-car-filter-form,
  .called-car-batch-form {
    align-items: stretch;
    flex-direction: column;
    border-radius: 14px;
    width: 100%;
  }

  .called-car-account-filter {
    flex-wrap: wrap;
    justify-content: flex-start;
    min-width: 0;
  }

  .called-car-filter-form input,
  .called-car-filter-form .small-button,
  .called-car-filter-form .small-link,
  .called-car-batch-form .small-button,
  .called-car-batch-form .danger-button,
  .called-car-batch-form .mini-check {
    justify-content: center;
    width: 100%;
  }
}

.called-car-account-tab {
  align-items: center;
  background: #fff;
  border: 1px solid var(--line);
  border-radius: 999px;
  color: #496274;
  display: inline-flex;
  font-size: 12px;
  font-weight: 800;
  gap: 6px;
  min-height: 0;
  padding: 0 12px;
  text-decoration: none;
}

.called-car-account-tab span {
  align-items: center;
  background: #edf4f7;
  border-radius: 999px;
  color: #1f5d73;
  display: inline-flex;
  font-size: 11px;
  min-width: 20px;
  padding: 2px 6px;
  justify-content: center;
}

.called-car-account-tab:hover {
  border-color: #9dbbd2;
  box-shadow: 0 8px 18px rgba(31, 93, 115, 0.12);
}

.called-car-account-tab.is-active {
  background: #1f5d73;
  border-color: #1f5d73;
  color: #fff;
}

.called-car-account-tab.is-active span {
  background: rgba(255, 255, 255, 0.22);
  color: #fff;
}

.task-row-select {
  align-items: center;
  background: #f4f8f6;
  border: 1px solid #cdd8cf;
  border-radius: 999px;
  color: #51634f;
  display: inline-flex;
  font-size: 12px;
  font-weight: 800;
  gap: 6px;
  line-height: 1;
  margin-bottom: 6px;
  padding: 5px 9px;
  width: fit-content;
}

.table-meta,
.pagination {
  color: var(--muted);
  font-size: 13px;
  margin-top: 12px;
}

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

.tasks-pagination-top {
  border-top: 0;
  margin-bottom: 0;
  margin-top: 0;
  padding-top: 0;
}

.pagination-jump {
  align-items: center;
  display: inline-flex;
  gap: 8px;
  margin: 0;
}

.pagination-jump label {
  align-items: center;
  color: var(--muted);
  display: inline-flex;
  gap: 6px;
  font-size: 13px;
  font-weight: 700;
  white-space: nowrap;
}

.pagination-jump input {
  min-height: 34px;
  padding: 0 8px;
  text-align: center;
  width: 76px;
}

.pagination-jump .small-button {
  min-height: 34px;
  width: auto;
}

.pagination-disabled {
  align-items: center;
  border: 1px solid var(--line);
  border-radius: 8px;
  color: #98a2b3;
  display: inline-flex;
  font-weight: 700;
  min-height: 34px;
  padding: 0 10px;
}

.grid {
  display: grid;
  gap: 12px;
}

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

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

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

.document-preview {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 12px;
  margin-top: 18px;
}

.document-preview figure {
  margin: 0;
}

.image-zoom {
  display: block;
  width: 100%;
  min-height: 0;
  border: 0;
  background: transparent;
  padding: 0;
}

.image-zoom:hover {
  background: transparent;
}

.document-preview img {
  display: block;
  width: 100%;
  aspect-ratio: 4 / 3;
  object-fit: contain;
  background: #f8fafc;
  border: 1px solid var(--line);
  border-radius: 8px;
}

.document-preview figcaption {
  color: var(--muted);
  font-size: 12px;
  margin-top: 6px;
}

.two-factor-panel {
  overflow-x: hidden;
}

.two-factor-row {
  align-items: center;
  display: grid;
  grid-template-columns: minmax(0, 1fr) 120px;
  gap: 14px;
  justify-content: start;
  max-width: 100%;
  width: 1000px;
}

.two-factor-uploader {
  align-items: center;
  border: 1px dashed #98a2b3;
  border-radius: 8px;
  background: #f8fafc;
  color: #344054;
  cursor: pointer;
  display: flex;
  gap: 10px;
  justify-content: center;
  min-height: 84px;
  min-width: 0;
  padding: 12px 16px;
  text-align: center;
  transition: border-color 160ms ease, background 160ms ease;
}

.two-factor-uploader:hover,
.two-factor-uploader:focus,
.two-factor-uploader.is-dragover {
  border-color: var(--accent);
  background: #fff7fa;
  outline: none;
}

.two-factor-uploader strong,
.two-factor-uploader span {
  display: block;
}

.two-factor-uploader span {
  color: var(--muted);
  font-size: 13px;
  margin-top: 6px;
}

.two-factor-uploader strong {
  font-size: 15px;
}

.two-factor-preview[hidden] {
  display: none;
}

.two-factor-preview {
  width: 120px;
  max-width: 100%;
  margin-top: 0;
}

.two-factor-preview img {
  display: block;
  width: 100%;
  aspect-ratio: 1 / 1;
  object-fit: contain;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
  max-width: 100%;
}

.two-factor-preview .image-zoom {
  height: 100%;
  min-width: 0;
  width: 100%;
}

.inline-status {
  min-height: 20px;
  color: #067647;
  font-size: 13px;
  margin-top: 10px;
}

.inline-status.is-error {
  color: #b42318;
}

.raw-ocr {
  border-top: 1px solid var(--line);
  margin-top: 16px;
  padding-top: 12px;
}

.raw-ocr summary {
  cursor: pointer;
  font-weight: 700;
}

.raw-ocr h4 {
  margin: 12px 0 6px;
}

.raw-ocr pre {
  background: #101828;
  border-radius: 8px;
  color: #f8fafc;
  font-size: 12px;
  line-height: 1.5;
  max-height: 260px;
  overflow: auto;
  padding: 12px;
  white-space: pre-wrap;
}

.image-modal[hidden] {
  display: none;
}

.image-modal {
  position: fixed;
  inset: 0;
  z-index: 20;
  display: grid;
  grid-template-rows: auto 1fr;
  gap: 14px;
  background: rgba(15, 23, 42, 0.82);
  padding: 18px;
  overflow: hidden;
}

.image-modal-toolbar {
  display: flex;
  justify-content: flex-end;
  gap: 8px;
}

.image-modal-control {
  min-width: auto;
  min-height: 36px;
  border-color: #fff;
  background: #fff;
  color: var(--text);
  padding: 0 12px;
}

.image-stage {
  min-height: 0;
  display: grid;
  place-items: center;
  overflow: hidden;
  touch-action: none;
}

.image-stage img {
  max-width: min(1180px, 96vw);
  max-height: calc(100vh - 92px);
  object-fit: contain;
  background: #fff;
  border-radius: 8px;
  transform-origin: center;
  cursor: grab;
  user-select: none;
  will-change: transform;
}

.image-stage img.is-dragging {
  cursor: grabbing;
}

label {
  display: grid;
  gap: 7px;
  margin-bottom: 12px;
}

label:last-child {
  margin-bottom: 0;
}

label span {
  font-size: 13px;
  color: #344054;
  font-weight: 700;
}

label:has(input[required], textarea[required]) span::after {
  content: "必填";
  display: inline-flex;
  align-items: center;
  min-height: 20px;
  margin-left: 8px;
  border: 1px solid #f79009;
  border-radius: 999px;
  background: #fffaeb;
  color: #b54708;
  padding: 0 7px;
  font-size: 12px;
}

label:has(input[required]) input,
label:has(textarea[required]) textarea {
  border-color: #f2b94b;
  background: #fffdf5;
}

input,
textarea,
select {
  width: 100%;
  min-height: 42px;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 9px 11px;
  font-size: 15px;
  background: #fff;
  font-family: inherit;
}

textarea {
  min-height: 148px;
  resize: vertical;
  line-height: 1.5;
}

.compact-inputs textarea {
  min-height: 82px;
}

.create-shell .panel {
  background: #fff;
  box-shadow: var(--shadow-sm);
}

.create-shell h2 {
  align-items: center;
  display: flex;
  gap: 10px;
}

.create-shell h2::before {
  background: var(--accent);
  border-radius: 999px;
  content: "";
  display: inline-block;
  height: 18px;
  width: 4px;
}

.create-two {
  align-items: stretch;
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 16px;
}

.create-field {
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--panel-soft);
  display: grid;
  gap: 10px;
  grid-template-rows: auto auto 1fr;
  min-height: 206px;
  padding: 14px;
}

.create-field-compact {
  grid-template-rows: auto 1fr;
  min-height: 104px;
}

.create-field-head {
  align-items: center;
  display: flex;
  gap: 10px;
  justify-content: space-between;
}

.create-field label,
.create-field-head label {
  color: #344054;
  display: block;
  font-size: 13px;
  font-weight: 700;
  margin: 0;
}

.create-field label::after,
.create-field-head label::after {
  content: "必填";
  display: inline-flex;
  align-items: center;
  min-height: 20px;
  margin-left: 8px;
  border: 1px solid #f79009;
  border-radius: 999px;
  background: #fffaeb;
  color: #b54708;
  padding: 0 7px;
  font-size: 12px;
}

.create-field textarea {
  min-height: 118px;
  height: 118px;
  resize: vertical;
}

.create-field input[type="text"],
.create-field input[type="file"],
.create-field input:not([type]) {
  min-height: 48px;
}

.create-field input[type="file"] {
  align-self: end;
  background: #fff;
}

.secondary-action {
  border-color: var(--primary);
  background: var(--primary);
  color: #fff;
  min-height: 32px;
  white-space: nowrap;
}

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

.inventory-pick-row {
  align-items: center;
  color: var(--muted);
  display: flex;
  font-size: 13px;
  min-height: 20px;
}

.inventory-pick-row strong {
  color: var(--primary);
}

.inventory-summary {
  align-items: center;
  display: grid;
  grid-template-columns: auto auto minmax(280px, 1fr);
  gap: 14px;
}

.inventory-summary > div {
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #f8fafc;
  min-width: 150px;
  padding: 10px 12px;
}

.inventory-summary strong,
.inventory-summary span {
  display: block;
}

.inventory-summary span {
  color: var(--muted);
  font-size: 13px;
  margin-top: 4px;
}

.inventory-summary .task-search {
  margin-bottom: 0;
  max-width: none;
}

.inventory-tabs {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.inventory-tabs a {
  border: 1px solid var(--line-strong);
  border-radius: 8px;
  color: var(--primary-dark);
  font-weight: 800;
  min-height: 36px;
  padding: 8px 12px;
  text-decoration: none;
}

.inventory-tabs a.is-active {
  background: var(--primary);
  border-color: var(--primary);
  color: #fff;
}

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

.inventory-table-head .task-search {
  margin: 0;
}

.inventory-api-entry {
  align-items: center;
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 16px;
}

.inventory-api-entry p {
  max-width: 680px;
}

.inventory-import-form {
  display: grid;
  gap: 12px;
}

.inventory-import-form input,
.inventory-import-form select {
  min-height: 42px;
}

.inventory-import-form textarea {
  min-height: 118px;
}

.email-test-layout {
  align-items: start;
}

.email-test-form {
  display: grid;
  gap: 14px;
}

.email-test-form textarea {
  min-height: 340px;
  resize: vertical;
}

.email-test-summary {
  margin-bottom: 14px;
}

.email-test-table {
  margin: 0;
  overflow-x: auto;
}

.email-test-table td:last-child {
  max-width: 360px;
  white-space: normal;
}

.email-code-result,
.email-code-inline {
  border: 1px solid #a9cbd8;
  background: var(--primary-soft);
  border-radius: 8px;
  color: var(--primary-dark);
  display: grid;
  gap: 4px;
  margin-bottom: 16px;
  max-width: 100%;
  min-width: 0;
  overflow: hidden;
  padding: 10px 12px;
  word-break: break-word;
  overflow-wrap: anywhere;
}

.email-code-result > *,
.email-code-inline > * {
  min-width: 0;
  max-width: 100%;
  overflow-wrap: anywhere;
}

.email-code-result[hidden] {
  display: none;
}

.email-code-result.is-error,
.email-code-inline.is-error {
  background: var(--danger-soft);
  border-color: #f0aaa4;
  color: var(--danger);
}

.email-code-result p {
  background: rgba(255, 255, 255, 0.45);
  border-radius: 6px;
  line-height: 1.55;
  margin: 4px 0 0;
  max-height: 96px;
  overflow: auto;
  padding: 6px 8px;
  white-space: pre-wrap;
  word-break: break-word;
  overflow-wrap: anywhere;
}

.email-code-inline {
  font-size: 12px;
  margin: 8px 0 0;
  padding: 8px;
}

.email-code-inline:empty {
  display: none;
}

.compact-action-form {
  align-content: start;
}

.inline-form {
  margin: 0;
}

.amzkeys-layout {
  align-items: start;
  display: grid;
  grid-template-columns: minmax(320px, 0.8fr) minmax(0, 1.2fr);
  gap: 16px;
}

.amzkeys-config-panel textarea {
  min-height: 104px;
}

.amzkeys-work-panel {
  display: grid;
  gap: 18px;
}

.amzkeys-card-facts {
  background: var(--primary-soft);
  border: 1px solid #bdd8df;
  border-radius: 8px;
  color: var(--primary-dark);
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px;
  font-size: 13px;
  font-weight: 700;
  padding: 10px 12px;
}

.amzkeys-action-row {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px;
}

.amzkeys-action-row form,
.amzkeys-action-row button {
  width: 100%;
}

.recharge-search-row {
  align-items: end;
  display: grid;
  grid-template-columns: minmax(0, 1fr) 120px;
  gap: 10px;
}

.recharge-search-row label {
  margin-bottom: 0;
}

.recharge-search-row .small-button {
  min-height: 42px;
  width: 100%;
}

.recharge-results {
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #f8fafc;
  display: grid;
  gap: 8px;
  min-height: 54px;
  padding: 10px;
}

.recharge-card-result {
  background: #fff;
  border-color: var(--line);
  color: var(--text);
  display: grid;
  grid-template-columns: minmax(110px, 1fr) repeat(4, minmax(0, 1fr));
  gap: 8px;
  justify-content: stretch;
  min-height: auto;
  min-width: auto;
  padding: 10px;
  text-align: left;
}

.recharge-card-result:hover,
.recharge-card-result.is-selected {
  background: var(--primary-soft);
  border-color: var(--primary);
  color: var(--primary-dark);
}

.recharge-card-result span {
  color: inherit;
  font-size: 13px;
  overflow-wrap: anywhere;
}

.recharge-selected-summary {
  border: 1px solid #12b76a;
  background: #ecfdf3;
  border-radius: 8px;
  color: #067647;
  font-size: 13px;
  font-weight: 700;
  padding: 8px 10px;
}

.muted-line.is-error {
  color: #b42318;
}

.amzkeys-status {
  background: #f8fafc;
  border: 1px solid var(--line);
  border-radius: 8px;
  display: grid;
  gap: 8px;
  margin-bottom: 16px;
  padding: 12px;
}

.amzkeys-status .muted-line {
  display: flex;
  flex-wrap: wrap;
  gap: 8px 14px;
}

.amzkeys-status .is-ok {
  color: #07834f;
}

.amzkeys-status .is-error {
  color: #c92a4b;
}

.amzkeys-status .is-unknown {
  color: #6d7d91;
}

.inventory-table {
  margin-top: 16px;
}

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

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

.email-read-button {
  white-space: nowrap;
}

.modal-backdrop[hidden] {
  display: none;
}

.modal-backdrop {
  align-items: center;
  background: rgba(15, 23, 42, 0.58);
  display: grid;
  inset: 0;
  justify-items: center;
  padding: 24px;
  position: fixed;
  z-index: 40;
}

body.modal-open {
  overflow: hidden;
}

.modal-panel {
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: 10px;
  box-shadow: var(--shadow-lg);
  width: min(900px, calc(100vw - 48px));
}

.modal-card {
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: 12px;
  box-shadow: var(--shadow-lg);
  padding: 20px;
  width: min(560px, calc(100vw - 48px));
}

.modal-title-row {
  align-items: start;
  display: flex;
  gap: 16px;
  justify-content: space-between;
  margin-bottom: 16px;
}

.modal-title-row h2,
.modal-title-row p {
  margin: 0;
}

.modal-title-row p {
  margin-top: 6px;
}

.transfer-form {
  display: grid;
  gap: 14px;
}

.transfer-close-button {
  flex: 0 0 auto;
}

.inventory-mail-panel {
  display: grid;
  gap: 12px;
  grid-template-rows: auto auto minmax(0, 1fr);
  max-height: min(820px, calc(100vh - 48px));
  overflow: hidden;
  padding: 18px;
  width: min(1080px, calc(100vw - 48px));
}

.modal-header {
  align-items: start;
  display: flex;
  gap: 16px;
  justify-content: space-between;
}

.modal-header h2 {
  margin-bottom: 6px;
}

.modal-header p {
  color: var(--muted);
  font-size: 13px;
}

.inventory-mail-list {
  display: grid;
  gap: 12px;
  min-height: 0;
  overflow: auto;
  overscroll-behavior: contain;
  padding-right: 6px;
}

.inventory-email-result {
  grid-column: 1 / -1;
  max-height: 320px;
  overflow: auto;
  text-align: left;
}

.inventory-email-message {
  border-top: 1px solid rgba(35, 86, 106, 0.18);
  display: grid;
  gap: 6px;
  padding-top: 8px;
}

.inventory-mail-list .inventory-email-message {
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
  padding: 14px;
}

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

.mail-message-title {
  display: grid;
  gap: 4px;
  min-width: 0;
}

.mail-message-title span,
.mail-message-meta {
  color: var(--muted);
  font-size: 13px;
}

.mail-message-title span {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.mail-message-actions {
  display: flex;
  flex: 0 0 auto;
  gap: 8px;
}

.inventory-email-message-head .danger-button,
.inventory-email-message-head .small-button {
  min-height: 32px;
  min-width: 72px;
  padding: 0 10px;
  width: auto;
  white-space: nowrap;
}

.inventory-email-message:first-of-type {
  border-top: 0;
  padding-top: 0;
}

.inventory-email-message p {
  margin: 0;
  color: var(--text);
}

.mail-message-preview {
  display: -webkit-box;
  line-height: 1.55;
  max-height: 4.7em;
  overflow: hidden;
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 3;
}

.mail-message-detail {
  background: #f8fbfd;
  border: 1px solid rgba(35, 86, 106, 0.14);
  border-radius: 8px;
  color: var(--text);
  display: grid;
  gap: 8px;
  padding: 12px;
}

.mail-message-detail[hidden] {
  display: none;
}

.mail-message-detail pre {
  background: #fff;
  border: 1px solid var(--line);
  border-radius: 8px;
  font-family: inherit;
  line-height: 1.6;
  margin: 0;
  max-height: 360px;
  overflow: auto;
  padding: 10px;
  white-space: pre-wrap;
  word-break: break-word;
}

.inventory-mail-empty {
  background: var(--primary-soft);
  border: 1px solid #a9cbd8;
  border-radius: 8px;
  color: var(--primary-dark);
  padding: 14px;
}

.inline-mark-form {
  grid-column: 1 / -1;
  display: grid;
  gap: 6px;
  grid-template-columns: 100px minmax(120px, 1fr) auto;
}

.inline-mark-form select,
.inline-mark-form input {
  min-height: 32px;
  padding: 5px 8px;
}

.mini-check {
  align-items: center;
  color: var(--muted);
  display: inline-flex;
  font-size: 12px;
  gap: 5px;
  grid-column: 1 / -1;
  line-height: 1.25;
}

.trash-toolbar {
  align-items: center;
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  justify-content: space-between;
  margin-bottom: 14px;
}

.trash-filter-form {
  align-items: end;
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
}

.trash-filter-form label {
  color: var(--muted);
  font-size: 13px;
  font-weight: 700;
}

.trash-filter-form input,
.trash-filter-form select {
  display: block;
  margin-top: 5px;
  min-height: 34px;
  padding: 0 8px;
}

.trash-reason-pill {
  margin-left: 8px;
}

.trash-batch-form {
  align-items: center;
  display: flex;
  gap: 8px;
  margin: 0;
}

.trash-check-cell {
  width: 86px;
}

.trash-check-cell .mini-check,
th .mini-check {
  grid-column: auto;
  white-space: nowrap;
}

.user-form {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr)) auto;
  gap: 12px;
  align-items: end;
}

.user-form button {
  min-width: 100px;
}

.user-row-actions {
  display: grid;
  gap: 8px;
  min-width: 260px;
}

.password-change-form {
  display: grid;
  grid-template-columns: minmax(120px, 1fr) auto;
  gap: 8px;
  align-items: center;
}

.password-change-form input {
  min-height: 34px;
  font-size: 13px;
}

.password-change-form .small-button {
  min-height: 34px;
  white-space: nowrap;
}

input:focus,
textarea:focus,
select:focus {
  outline: 2px solid color-mix(in srgb, var(--focus) 26%, transparent);
  border-color: var(--focus);
}

input[type="file"] {
  padding: 8px;
}

input[type="file"]::file-selector-button {
  border: 1px solid var(--line-strong);
  border-radius: 8px;
  background: #fff;
  color: #243447;
  cursor: pointer;
  font: inherit;
  font-weight: 700;
  margin-right: 10px;
  min-height: 32px;
  padding: 0 12px;
}

input[type="file"]::file-selector-button:hover {
  background: var(--primary-soft);
  border-color: #9bb8c5;
  color: var(--primary-dark);
}

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

button {
  min-width: 180px;
  font-size: 15px;
}

.small-link,
.danger-button {
  min-height: 34px;
  border-radius: 8px;
  padding: 0 10px;
  font-size: 13px;
}

.small-link {
  border: 1px solid var(--line);
  background: #fff;
  color: var(--text);
  text-decoration: none;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-weight: 700;
}

.danger-button {
  min-width: auto;
  border-color: #d92d20;
  background: #fff;
  color: #b42318;
}

.danger-button:hover {
  border-color: #d92d20;
  background: #fff0ee;
  color: #b42318;
}

.start-button {
  border-color: #079455;
  background: #079455;
  color: #fff;
}

.start-button:hover {
  background: #067647;
}

.ocr-button {
  border-color: #667085;
  background: #667085;
  color: #fff;
}

.ocr-button:hover {
  background: #475467;
}

.row-actions {
  min-width: 210px;
}

.progress-cell {
  min-width: 300px;
}

.business-progress-cell {
  min-width: 330px;
}

.business-progress-form {
  display: grid;
  gap: 6px;
}

.business-progress-form label {
  display: grid;
  gap: 4px;
}

.business-progress-form input {
  min-height: 34px;
  padding: 6px 8px;
}

.business-progress-actions,
.compact-business-form {
  align-items: center;
  gap: 8px;
}

.business-progress-actions {
  display: flex;
  flex-wrap: nowrap;
  justify-content: start;
  min-width: 0;
}

.compact-business-form {
  display: grid;
  grid-template-columns: auto minmax(150px, 1fr) auto;
}

.appeal-progress-form {
  display: grid;
  gap: 8px;
}

.compact-business-form .business-check {
  align-items: center;
  display: inline-flex;
  gap: 6px;
  min-height: 34px;
  white-space: nowrap;
}

.appeal-progress-form .business-check {
  align-items: center;
  display: inline-flex;
  gap: 6px;
  min-height: 34px;
  white-space: nowrap;
}

.appeal-progress-head {
  align-items: center;
  display: flex;
  gap: 12px;
}

.compact-business-form .business-check input[type="checkbox"] {
  flex: 0 0 auto;
  height: 16px;
  margin: 0;
  min-height: auto;
  padding: 0;
  width: 16px;
}

.appeal-progress-form .business-check input[type="checkbox"] {
  flex: 0 0 auto;
  height: 16px;
  margin: 0;
  min-height: auto;
  padding: 0;
  width: 16px;
}

.appeal-date {
  font-size: 12px;
  margin: 0;
  white-space: nowrap;
}

.appeal-note-row {
  align-items: center;
  display: grid;
  gap: 8px;
  grid-template-columns: minmax(160px, 1fr) auto;
}

.appeal-note-row .small-button {
  min-height: 34px;
  min-width: 82px;
  width: auto;
}

.appeal-extra-actions {
  align-items: center;
  display: grid;
  gap: 8px;
  grid-template-columns: repeat(2, minmax(0, 1fr));
}

.appeal-export-form {
  margin: 0;
}

.appeal-info-button,
.appeal-export-button,
.wenshushu-upload-button {
  min-height: 34px;
  width: 100%;
}

.appeal-export-button {
  background: #fff;
  color: var(--primary-dark);
}

.wenshushu-upload-button {
  background: #eef7ff;
  border-color: #9ac4e8;
  color: #1f5c87;
}

.task-card-recharge-form {
  align-items: center;
  display: grid;
  gap: 6px;
  grid-template-columns: minmax(58px, 1fr) auto;
  margin: 0;
}

.task-card-recharge-form input {
  border: 1px solid var(--line);
  border-radius: 8px;
  font-size: 13px;
  min-height: 34px;
  min-width: 0;
  padding: 0 8px;
  text-align: center;
  width: 100%;
}

.recharge-task-button {
  background: #0f8f61;
  border-color: #0f8f61;
  color: #fff;
  min-height: 34px;
  min-width: 58px;
  width: auto;
}

.recharge-task-button:hover {
  background: #087443;
  border-color: #087443;
}

.email-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-top: 6px;
}

.email-actions .small-button {
  min-height: 30px;
  width: auto;
}

.compact-business-form .small-button,
.business-progress-actions .small-button {
  justify-self: start;
  min-height: 34px;
  min-width: 64px;
  width: auto;
}

.task-progress-link {
  min-height: 34px;
}

.business-progress-actions .small-button,
.business-progress-actions .small-link {
  align-items: center;
  border-radius: 8px;
  display: inline-flex;
  flex: 0 0 auto;
  justify-content: center;
  min-width: 58px;
  padding-inline: 11px;
  white-space: nowrap;
}

.business-progress-actions .task-progress-link {
  max-width: 88px;
  overflow: hidden;
  text-overflow: ellipsis;
}

@media (max-width: 760px) {
  .business-progress-actions {
    gap: 6px;
  }

  .business-progress-actions .small-button,
  .business-progress-actions .small-link {
    min-width: 50px;
    padding-inline: 8px;
  }

  .compact-business-form {
    grid-template-columns: auto minmax(130px, 1fr);
  }

  .compact-business-form .small-button {
    grid-column: 1 / -1;
    justify-self: end;
  }
}

.progress-cell span:last-child {
  display: block;
  margin-top: 6px;
}

.progress-meter {
  width: 100%;
  height: 8px;
  border-radius: 999px;
  background: #eef2f6;
  overflow: hidden;
  margin-top: 8px;
}

.progress-meter i {
  display: block;
  height: 100%;
  width: 0;
  border-radius: inherit;
  background: linear-gradient(90deg, #1570ef, var(--accent));
  transition: width 240ms ease;
}

.progress-meter.is-active i {
  animation: progress-pulse 1.1s ease-in-out infinite alternate;
}

.submit-progress {
  grid-column: 1 / -1;
  border: 1px solid #b2ddff;
  color: #1849a9;
  background: #eff8ff;
  border-radius: 8px;
  padding: 12px 14px;
}

.submit-progress strong,
.submit-progress span {
  display: block;
}

.submit-progress span {
  margin-top: 4px;
  color: #475467;
  font-size: 13px;
}

button:disabled {
  cursor: wait;
  opacity: 0.72;
}

@keyframes progress-pulse {
  from {
    filter: brightness(0.96);
  }
  to {
    filter: brightness(1.14);
  }
}

.muted-line {
  display: block;
  color: var(--muted);
  font-size: 12px;
  margin-top: 4px;
}

.status-pill {
  display: inline-flex;
  align-items: center;
  min-height: 24px;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: #f8fafc;
  color: #344054;
  padding: 0 9px;
  font-size: 12px;
  font-weight: 700;
}

.email-check-pill.is-ok {
  border-color: #abefc6;
  background: #ecfdf3;
  color: #067647;
}

.email-check-pill.is-error {
  border-color: #fda29b;
  background: #fff0ee;
  color: #b42318;
}

.email-check-pill.is-warn {
  border-color: #fedf89;
  background: #fffaeb;
  color: #93370d;
}

.email-check-pill.is-muted {
  color: var(--muted);
}

.inventory-tools {
  align-items: center;
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  justify-content: flex-end;
  margin-top: 10px;
}

.inventory-tools .small-link.is-selected {
  background: var(--primary);
  border-color: var(--primary);
  color: #fff;
}

.inventory-progress-panel {
  background: #f8fbfd;
  border: 1px solid var(--line);
  border-radius: 10px;
  margin-top: 14px;
  padding: 14px;
}

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

.inventory-progress-meter {
  margin: 8px 0;
}

.inventory-progress-panel p {
  color: var(--text);
  margin: 8px 0 0;
}

.inventory-progress-stats {
  color: var(--muted);
  font-size: 13px;
  margin-top: 6px;
}

.password-display {
  display: block;
  min-height: 34px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #f8fafc;
  color: var(--text);
  padding: 7px 9px;
  margin-top: 6px;
  white-space: nowrap;
  overflow-x: auto;
  font-size: 13px;
}

.small-button {
  min-width: auto;
  min-height: 34px;
  border-radius: 8px;
  padding: 0 10px;
  font-size: 13px;
}

.row-actions form {
  margin: 0;
}

.task-delete-form {
  position: relative;
}

.delete-confirm-panel {
  background: #fff;
  border: 1px solid #f2b8b5;
  border-radius: 8px;
  box-shadow: var(--shadow-md);
  display: grid;
  gap: 8px;
  min-width: 190px;
  padding: 10px;
  position: absolute;
  right: 0;
  top: calc(100% + 6px);
  z-index: 5;
}

.delete-confirm-panel[hidden] {
  display: none;
}

.delete-confirm-panel strong {
  font-size: 13px;
}

.delete-confirm-panel .mini-check {
  align-items: center;
  color: #34475b;
  display: flex;
  font-size: 12px;
  gap: 7px;
  grid-column: 1 / -1;
  line-height: 1.35;
  white-space: nowrap;
}

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

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

.landing-action-grid {
  grid-template-columns: repeat(2, minmax(86px, 1fr));
  align-items: stretch;
}

.landing-action-grid .task-card-recharge-form {
  grid-column: 1 / -1;
}

.called-car-inline-button {
  background: #2264a6;
  border-color: #2264a6;
  color: #fff;
}

.archive-button {
  background: #5b6d7d;
  border-color: #5b6d7d;
  color: #fff;
}

.archive-button:hover {
  background: #445765;
  border-color: #445765;
}

input[readonly] {
  background: #f8fafc;
  color: var(--muted);
}

button:hover,
.button-link:hover {
  background: var(--accent-dark);
}

.facts {
  display: grid;
  grid-template-columns: 132px 1fr;
  gap: 12px;
  margin: 0;
}

.status-facts {
  grid-template-columns: 150px 1fr;
}

.facts dt {
  color: var(--muted);
}

.facts dd {
  margin: 0;
  overflow-wrap: anywhere;
}

.missing {
  margin: 0;
  padding-left: 20px;
}

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

.compact-table {
  min-width: 0;
  table-layout: auto;
}

.compact-table th,
.compact-table td {
  overflow-wrap: anywhere;
}

.system-runs-table {
  min-width: 920px;
}

.system-audit-table {
  min-width: 960px;
}

.system-maintenance-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  justify-content: flex-end;
}

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

.dashboard-card {
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #f8fafc;
  display: grid;
  gap: 5px;
  min-height: 118px;
  padding: 14px;
}

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

.dashboard-card strong {
  color: var(--text);
  font-size: 20px;
  line-height: 1.2;
}

.dashboard-card small {
  color: var(--muted);
  line-height: 1.35;
  overflow-wrap: anywhere;
}

.dashboard-card.is-ok {
  border-color: #8ed9b3;
  background: #f0fdf4;
}

.dashboard-card.is-warn {
  border-color: var(--warn-line);
  background: var(--warn-bg);
}

.dashboard-card.is-error {
  border-color: #f1a4a0;
  background: #fff0ee;
}

.danger-inline {
  border-color: #d92d20;
  background: #fff0ee;
  color: #b42318;
}

.danger-inline:hover {
  border-color: #d92d20;
  background: #ffd7d4;
  color: #912018;
}

.self-check-time {
  color: var(--muted);
  font-size: 13px;
  font-weight: 700;
  margin-bottom: 12px;
}

.system-check-grid {
  display: grid;
  gap: 10px;
  grid-template-columns: repeat(3, minmax(0, 1fr));
}

.check-card {
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #f8fafc;
  display: grid;
  gap: 4px;
  min-height: 108px;
  padding: 12px;
}

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

.check-card strong {
  color: var(--text);
  font-size: 18px;
}

.check-card small {
  color: var(--muted);
  line-height: 1.35;
  overflow-wrap: anywhere;
}

.check-card.is-ok {
  border-color: #8ed9b3;
  background: #f0fdf4;
}

.check-card.is-ok strong {
  color: #067647;
}

.check-card.is-warn {
  border-color: var(--warn-line);
  background: var(--warn-bg);
}

.check-card.is-warn strong {
  color: #9a6700;
}

.check-card.is-error {
  border-color: #f1a4a0;
  background: #fff0ee;
}

.check-card.is-error strong {
  color: #b42318;
}

.storage-table {
  min-width: 720px;
}

.openai-usage-table {
  min-width: 420px;
}

.empty-state {
  border: 1px dashed var(--line-strong);
  border-radius: 8px;
  color: var(--muted);
  font-weight: 700;
  padding: 16px;
}

.source-badge {
  display: inline-flex;
  align-items: center;
  margin-left: 8px;
  padding: 2px 8px;
  border-radius: 999px;
  background: #edf7f5;
  color: #0c6b5b;
  font-size: 12px;
  font-weight: 700;
  line-height: 1.5;
  vertical-align: 1px;
}

.secure-export-form {
  display: flex;
  align-items: center;
  gap: 8px;
}

.secure-export-form input {
  width: 138px;
  min-height: 38px;
  padding: 0 10px;
}

.sensitive-control {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 8px;
  align-items: center;
}

.sensitive-control .small-button {
  min-height: 40px;
  white-space: nowrap;
}

.email-cell .small-button {
  width: fit-content;
  min-height: 30px;
  margin-top: 6px;
  padding: 0 10px;
}

.col-person {
  width: 170px;
}

.col-email {
  width: 260px;
}

.col-progress {
  width: 340px;
}

.col-actions {
  width: 280px;
}

.row-actions .small-link,
.row-actions .danger-button,
.row-actions .start-button,
.row-actions .resume-button,
.row-actions .small-button {
  width: 100%;
  min-width: auto;
  padding: 0 9px;
}

.row-actions [hidden] {
  display: none;
}

.danger-button.is-confirm {
  background: #d92d20;
  color: #fff;
}

.danger-button.is-confirm:hover {
  background: #b42318;
  color: #fff;
}

.row-actions .is-confirm {
  box-shadow: 0 0 0 2px rgba(223, 47, 95, 0.18);
}

.task-toast[hidden] {
  display: none;
}

.task-toast {
  border: 1px solid #b2ddff;
  border-radius: 8px;
  background: #eff8ff;
  color: #1849a9;
  font-weight: 700;
  margin-bottom: 12px;
  padding: 10px 12px;
}

.task-toast.is-code {
  border-color: #fedf89;
  background: #fffaeb;
  color: #93370d;
}

.task-toast.is-warning {
  border-color: #fda29b;
  background: #fff0ee;
  color: #b42318;
}

.resume-button {
  border-color: #1570ef;
  background: #1570ef;
}

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

th {
  color: #344054;
  background: #f8fafc;
}

td {
  overflow-wrap: normal;
}

.email-cell,
.person-cell {
  white-space: nowrap;
}

@media (max-width: 820px) {
  .topbar,
  .phone-status-row,
  .notice {
    align-items: flex-start;
    flex-direction: column;
  }

  .form-grid,
  .info-grid,
  .document-preview,
  .phone-actions,
  .legal-phone-control-row,
  .task-search,
  .inventory-summary,
  .grid.two,
  .grid.three,
  .grid.four {
    grid-template-columns: 1fr;
  }

  .wide {
    grid-column: auto;
  }

  .right-column {
    grid-column: auto;
  }

  .detail-lower {
    grid-template-columns: 1fr;
  }

  .two-factor-row {
    grid-template-columns: 1fr;
    max-width: 100%;
  }

  .two-factor-preview {
    width: 120px;
  }

  .actions {
    justify-content: stretch;
  }

  button,
  .button-link {
    width: 100%;
  }
}

/* Modern refined refresh */
.shell {
  width: min(1240px, calc(100vw - 40px));
  padding: 34px 0 56px;
}

.shell.narrow {
  width: min(920px, calc(100vw - 40px));
}

.page-shell {
  padding: 56px 0;
}

.topbar {
  align-items: flex-start;
  margin-bottom: 22px;
  padding: 2px 0 4px;
}

h1 {
  color: #101a23;
  font-size: 32px;
  font-weight: 800;
}

h2 {
  color: #14202b;
  font-size: 18px;
  font-weight: 800;
}

h3 {
  color: #243447;
  font-size: 14px;
  font-weight: 800;
}

p {
  color: #66778d;
  font-size: 15px;
}

.topbar-actions {
  align-items: center;
}

.panel,
.table-wrap,
.auth-panel {
  background: rgba(255, 255, 255, 0.96);
  border: 1px solid rgba(198, 209, 220, 0.92);
  border-radius: 8px;
  box-shadow: var(--shadow-md);
}

.panel {
  padding: 22px;
}

.table-wrap {
  padding: 14px 18px 18px;
}

.auth-panel {
  padding: 22px;
}

.panel h2,
.table-wrap h2 {
  position: relative;
}

.panel h2::before {
  content: "";
  display: inline-block;
  width: 4px;
  height: 18px;
  margin: 0 9px -3px 0;
  border-radius: 999px;
  background: linear-gradient(180deg, var(--primary), var(--accent));
}

.ghost-link,
.button-link,
button,
.small-link,
.danger-button {
  border-radius: 8px;
  box-shadow: var(--shadow-sm);
  transition:
    background 160ms ease,
    border-color 160ms ease,
    color 160ms ease,
    box-shadow 160ms ease,
    transform 160ms ease;
}

.ghost-link,
.small-link {
  background: #fff;
  border-color: var(--line-strong);
  color: #243447;
}

.ghost-link:hover,
.small-link:hover {
  background: var(--primary-soft);
  border-color: #9bb8c5;
  color: var(--primary-dark);
}

.button-link,
button {
  background: var(--primary);
  border-color: var(--primary);
}

button:hover,
.button-link:hover {
  background: var(--primary-dark);
  border-color: var(--primary-dark);
}

button:active,
.button-link:active,
.ghost-link:active,
.small-link:active,
.danger-button:active {
  transform: translateY(1px);
}

.topbar-actions .admin-home,
.topbar-actions .ghost-link,
.topbar-actions button {
  min-height: 38px;
  padding: 0 14px;
}

.topbar-actions .admin-home,
.topbar-actions .admin-logout,
.topbar-actions .admin-menu summary {
  min-height: 40px;
}

.actions button,
button[type="submit"]:not(.small-button):not(.danger-button):not(.ghost-link) {
  background: var(--accent);
  border-color: var(--accent);
}

.actions button:hover,
button[type="submit"]:not(.small-button):not(.danger-button):not(.ghost-link):hover {
  background: var(--accent-dark);
  border-color: var(--accent-dark);
}

.actions .ghost-link {
  background: #fff;
  border-color: var(--line-strong);
  color: #243447;
}

.actions .ghost-link:hover {
  background: var(--primary-soft);
  border-color: #9bb8c5;
  color: var(--primary-dark);
}

.start-button {
  background: var(--success);
  border-color: var(--success);
}

.start-button:hover {
  background: #066f4c;
  border-color: #066f4c;
}

.resume-button {
  background: #2463a7;
  border-color: #2463a7;
}

.resume-button:hover {
  background: #1b4f86;
  border-color: #1b4f86;
}

.ocr-button {
  background: #51677a;
  border-color: #51677a;
}

.ocr-button:hover {
  background: #3e5162;
  border-color: #3e5162;
}

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

.danger-button:hover {
  border-color: var(--danger);
  background: var(--danger-soft);
  color: var(--danger);
}

.danger-button.is-confirm {
  background: var(--danger);
  border-color: var(--danger);
}

input,
textarea,
select,
.password-display {
  border-color: var(--line);
  border-radius: 8px;
  box-shadow: inset 0 1px 0 rgba(16, 24, 40, 0.02);
}

input,
textarea,
select {
  color: #162433;
}

input:hover,
textarea:hover,
select:hover {
  border-color: #b8c7d6;
}

input:focus,
textarea:focus,
select:focus {
  outline: 3px solid rgba(42, 111, 131, 0.18);
  border-color: var(--focus);
  box-shadow: 0 0 0 1px rgba(42, 111, 131, 0.04);
}

input[readonly] {
  background: #f3f7fa;
}

label span {
  color: #34475b;
  font-size: 12px;
}

label:has(input[required], textarea[required]) span::after {
  border-color: #f0b75c;
  background: #fff8e8;
  color: #9b5d12;
}

label:has(input[required]) input,
label:has(textarea[required]) textarea {
  background: #fffdf8;
}

.error,
.success,
.warning,
.notice,
.task-toast,
.submit-progress,
.ocr-quality {
  border-radius: 8px;
  box-shadow: var(--shadow-sm);
}

.success,
.ocr-quality.is-ok {
  background: var(--success-soft);
  border-color: #77d6ad;
  color: #056444;
}

.error,
.task-toast.is-warning {
  background: var(--danger-soft);
  border-color: #f0a19b;
  color: #9c2721;
}

.warning,
.notice,
.task-toast.is-code,
.ocr-quality.is-warning {
  background: var(--warn-bg);
  border-color: var(--warn-line);
  color: #81520f;
}

.task-toast {
  background: #edf6ff;
  border-color: #a8ccec;
  color: #1f5380;
}

.status-pill {
  background: #edf4f7;
  border-color: #c2d4dc;
  color: var(--primary-dark);
}

.progress-meter {
  height: 7px;
  background: #e7edf2;
}

.progress-meter i {
  background: linear-gradient(90deg, var(--primary) 0%, #2f8b94 55%, var(--accent) 100%);
}

.task-search {
  max-width: none;
  grid-template-columns: minmax(320px, 1fr) auto auto;
  padding: 4px 0 12px;
}

.task-search input {
  background: #f8fbfc;
}

table {
  border-collapse: separate;
  border-spacing: 0;
}

th,
td {
  border-bottom: 1px solid #e2e8ef;
}

th {
  background: #f3f7fa;
  color: #3b4f63;
  font-size: 12px;
  font-weight: 800;
}

td {
  color: #1d2b3a;
  font-size: 13px;
}

tbody tr {
  transition: background 140ms ease;
}

tbody tr:hover {
  background: #f9fbfd;
}

.person-cell,
.email-cell {
  line-height: 1.42;
}

.muted-line {
  color: #718197;
}

.password-display {
  background: #f6f9fb;
}

.row-actions {
  min-width: 250px;
}

.action-grid {
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 7px;
}

.row-actions .small-link,
.row-actions .danger-button,
.row-actions .start-button,
.row-actions .resume-button,
.row-actions .small-button {
  min-height: 32px;
}

.edit-button {
  border-color: #aac8dc;
  color: #245b78;
}

.edit-button:hover {
  background: #edf7fb;
  border-color: #7aaac0;
  color: #164860;
}

.task-status-form {
  display: contents;
}

.status-button {
  border-color: #2563a8;
  background: #2563a8;
  color: #fff;
}

.status-button:hover {
  border-color: #1d4f86;
  background: #1d4f86;
  color: #fff;
}

.status-options-panel {
  background: #f8fbfd;
  border: 1px solid var(--line);
  border-radius: 8px;
  display: grid;
  gap: 6px;
  grid-column: 1 / -1;
  grid-template-columns: repeat(5, minmax(0, 1fr));
  padding: 8px;
}

.status-options-panel[hidden] {
  display: none;
}

.status-option-button {
  background: #fff;
  border-color: #9db5c8;
  color: #102a43;
}

.status-option-button:hover {
  background: #edf7fb;
  border-color: #2563a8;
  color: #102a43;
}

.business-status-pill {
  border-color: #d7c5ff;
  background: #f4f0ff;
  color: #5a3db0;
}

.warning-status-pill {
  border-color: #f2b8a8;
  background: #fff1ed;
  color: #b42318;
}

.document-preview {
  gap: 14px;
}

.document-preview img {
  background: #f4f7fa;
  border-color: #cbd7e2;
  box-shadow: var(--shadow-sm);
}

.image-zoom {
  border-radius: 8px;
}

.image-zoom:hover img {
  border-color: #97b5c3;
  box-shadow: 0 10px 24px rgba(20, 32, 43, 0.1);
}

.two-factor-row {
  width: min(1000px, 100%);
}

.two-factor-uploader {
  background: #f6fafb;
  border-color: #98b2c0;
}

.two-factor-uploader:hover,
.two-factor-uploader:focus,
.two-factor-uploader.is-dragover {
  border-color: var(--primary);
  background: var(--primary-soft);
}

.two-factor-preview img {
  border-color: #cbd7e2;
  box-shadow: var(--shadow-sm);
}

.raw-ocr,
.ocr-diagnostics,
.phone-extra,
.phone-sms-panel {
  border-color: #dde6ee;
}

.raw-ocr summary,
.ocr-diagnostics summary,
.phone-extra summary {
  color: #26384b;
}

.raw-ocr pre,
.phone-result {
  border-radius: 8px;
}

.phone-result {
  background: #f5f8fb;
  border-color: #d5e0e9;
}

.facts {
  row-gap: 14px;
}

.facts dt {
  color: #6d7d91;
  font-weight: 700;
}

.facts dd {
  color: #172635;
}

.admin-menu-panel button,
.admin-menu-panel button[type="submit"]:not(.small-button):not(.danger-button):not(.ghost-link) {
  background: transparent;
  border: 0;
  color: #243447;
  justify-content: center;
}

.admin-menu-panel button:hover,
.admin-menu-panel button[type="submit"]:not(.small-button):not(.danger-button):not(.ghost-link):hover {
  background: var(--primary-soft);
  border: 0;
  color: var(--primary-dark);
}

.image-modal {
  background: rgba(13, 22, 31, 0.86);
}

.image-modal-control {
  border-color: rgba(255, 255, 255, 0.88);
  background: rgba(255, 255, 255, 0.92);
  color: #172635;
}

@media (max-width: 820px) {
  .shell,
  .shell.narrow {
    width: min(100% - 24px, 1240px);
    padding-top: 22px;
  }

  h1 {
    font-size: 28px;
  }

  .panel,
  .table-wrap {
    padding: 16px;
  }

  .task-search {
    grid-template-columns: 1fr;
  }

  .inventory-summary,
  .inventory-api-entry,
  .amzkeys-layout,
  .amzkeys-card-facts,
  .amzkeys-action-row,
  .recharge-search-row,
  .recharge-card-result,
  .recharge-record-stats,
  .recharge-record-filter,
  .system-entry-grid,
  .dashboard-grid,
  .period-stat-grid {
    grid-template-columns: 1fr;
  }

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

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

  .admin-nav {
    justify-content: flex-start;
  }

  .admin-menu-panel {
    left: 0;
    right: auto;
  }

  .system-check-grid {
    grid-template-columns: 1fr;
  }
}

.theme-switcher {
  align-items: center;
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
}

.theme-switch-form {
  margin: 0;
}

.theme-switcher .small-button.is-selected,
.theme-switcher .small-button:disabled {
  background: var(--primary);
  border-color: var(--primary);
  color: #fff;
  cursor: default;
  opacity: 1;
}

body.theme-brass {
  --bg: #f5f1e8;
  --panel: #fffdf8;
  --panel-soft: #fbf7ef;
  --text: #20242a;
  --muted: #6f716e;
  --line: #ddd4c4;
  --line-strong: #bdb4a6;
  --accent: #b96f2f;
  --accent-dark: #965522;
  --accent-soft: #fff1d6;
  --primary: #68755d;
  --primary-dark: #58644f;
  --primary-soft: #e9e7dc;
  --focus: #b96f2f;
  --success: #3f745d;
  --success-soft: #e9f3ed;
  --warn: #8b511f;
  --warn-bg: #fff1d6;
  --warn-line: #e4c28d;
  --danger: #c84c3d;
  --danger-soft: #fff0eb;
  --shadow-sm: 0 2px 0 rgba(82, 96, 79, 0.14);
  --shadow-md: 0 16px 34px rgba(82, 96, 79, 0.12);
  --shadow-lg: 0 24px 60px rgba(82, 96, 79, 0.16);
  background:
    linear-gradient(180deg, rgba(255, 253, 248, 0.78), rgba(255, 253, 248, 0) 340px),
    repeating-linear-gradient(135deg, rgba(82, 96, 79, 0.025) 0 1px, transparent 1px 14px),
    var(--bg);
}

body.theme-brass .panel,
body.theme-brass .table-wrap {
  border-radius: 10px;
}

body.theme-brass .panel h2::before {
  background: linear-gradient(180deg, var(--primary), var(--accent));
}

body.theme-brass .admin-menu summary,
body.theme-brass .admin-home,
body.theme-brass .admin-logout,
body.theme-brass .ghost-link,
body.theme-brass .small-link,
body.theme-brass .button-link,
body.theme-brass button,
body.theme-brass .danger-button {
  border-radius: 9px;
}

body.theme-brass .admin-menu summary,
body.theme-brass .admin-home,
body.theme-brass .admin-logout {
  border-radius: 999px;
}

body.theme-brass .ghost-link,
body.theme-brass .small-link,
body.theme-brass .admin-home,
body.theme-brass .admin-menu summary,
body.theme-brass .admin-logout {
  background: var(--panel);
  border-color: var(--line-strong);
  color: var(--primary);
}

body.theme-brass .ghost-link:hover,
body.theme-brass .small-link:hover,
body.theme-brass .admin-home:hover,
body.theme-brass .admin-menu[open] summary,
body.theme-brass .admin-menu summary:hover,
body.theme-brass .admin-logout:hover {
  background: #f3eadb;
  border-color: #928675;
  box-shadow: 0 12px 24px rgba(84, 73, 56, 0.14);
  color: var(--primary);
}

body.theme-brass .admin-menu-panel {
  background: rgba(255, 252, 245, 0.98);
  border-color: #c9bda9;
  box-shadow: 0 18px 38px rgba(84, 73, 56, 0.18);
}

body.theme-brass button,
body.theme-brass .button-link {
  background: var(--primary);
  border-color: var(--primary);
  color: #fff;
}

body.theme-brass button:hover,
body.theme-brass .button-link:hover {
  background: var(--primary-dark);
  border-color: var(--primary-dark);
  box-shadow: 0 9px 18px rgba(104, 117, 93, 0.18);
  transform: translateY(-1px);
}

body.theme-brass button:active,
body.theme-brass .button-link:active,
body.theme-brass .ghost-link:active,
body.theme-brass .small-link:active,
body.theme-brass .danger-button:active {
  box-shadow: inset 0 2px 5px rgba(0, 0, 0, 0.18);
  transform: translateY(0);
}

body.theme-brass .actions button,
body.theme-brass button[type="submit"]:not(.small-button):not(.danger-button):not(.ghost-link),
body.theme-brass .status-button,
body.theme-brass .resume-button,
body.theme-brass .email-code-button {
  background: var(--accent);
  border-color: var(--accent);
  color: #fff;
}

body.theme-brass .actions button:hover,
body.theme-brass button[type="submit"]:not(.small-button):not(.danger-button):not(.ghost-link):hover,
body.theme-brass .status-button:hover,
body.theme-brass .resume-button:hover,
body.theme-brass .email-code-button:hover {
  background: var(--accent-dark);
  border-color: var(--accent-dark);
  color: #fff;
}

body.theme-brass .start-button {
  background: #5f8268;
  border-color: #5f8268;
  color: #fff;
}

body.theme-brass .start-button:hover {
  background: #52745b;
  border-color: #52745b;
}

body.theme-brass .ocr-button {
  background: #8a806f;
  border-color: #8a806f;
  color: #fff;
}

body.theme-brass .ocr-button:hover {
  background: #776f61;
  border-color: #776f61;
}

body.theme-brass .archive-button {
  background: #7b7567;
  border-color: #7b7567;
  color: #fff;
}

body.theme-brass .archive-button:hover {
  background: #696355;
  border-color: #696355;
}

body.theme-brass .danger-button {
  background: var(--panel);
  border-color: #e7aaa1;
  color: var(--danger);
}

body.theme-brass .danger-button:hover {
  background: var(--danger);
  border-color: var(--danger);
  color: #fff;
}

body.theme-brass .edit-button,
body.theme-brass .appeal-info-button,
body.theme-brass .appeal-export-button,
body.theme-brass .wenshushu-upload-button,
body.theme-brass .recharge-task-button {
  background: var(--panel);
  border-color: var(--line-strong);
  color: var(--primary);
}

body.theme-brass .edit-button:hover,
body.theme-brass .appeal-info-button:hover,
body.theme-brass .appeal-export-button:hover,
body.theme-brass .wenshushu-upload-button:hover,
body.theme-brass .recharge-task-button:hover {
  background: #f3eadb;
  border-color: #928675;
  color: var(--primary);
}

body.theme-brass .task-filter-tab {
  background: var(--panel);
  border-color: var(--line-strong);
  color: var(--primary);
}

body.theme-brass .task-filter-tab:hover {
  background: #f3eadb;
  border-color: #928675;
}

body.theme-brass .task-filter-tab.is-active,
body.theme-brass .theme-switcher .small-button.is-selected,
body.theme-brass .theme-switcher .small-button:disabled {
  background: var(--primary);
  border-color: var(--primary);
  color: #fff;
}

body.theme-brass .called-car-account-tab {
  background: var(--panel);
  border-color: var(--line-strong);
  color: var(--primary);
}

body.theme-brass .called-car-account-tab span {
  background: #efe7d8;
  color: var(--accent-dark);
}

body.theme-brass .called-car-account-tab:hover {
  background: #f3eadb;
  border-color: #928675;
  box-shadow: 0 8px 18px rgba(111, 95, 68, 0.14);
}

body.theme-brass .called-car-account-tab.is-active {
  background: var(--primary);
  border-color: var(--primary);
  color: #fff;
}

body.theme-brass .called-car-account-tab.is-active span {
  background: rgba(255, 255, 255, 0.22);
  color: #fff;
}

body.theme-brass .called-car-toolbar {
  background: linear-gradient(180deg, #fbf7ef 0%, #f2eadc 100%);
  border-color: var(--line-strong);
}

body.theme-brass .called-car-filter-form,
body.theme-brass .called-car-batch-form {
  background: rgba(255, 252, 247, 0.7);
  border-color: var(--line-strong);
}

body.theme-brass .called-car-age-pill {
  background: #eef0e3;
  border-color: #c8cfb3;
  color: #68724a;
}

body.theme-brass .batch-wenshushu-button,
body.theme-brass .batch-mail-check-button {
  background: #efe7d8;
  border-color: #d2c1a8;
  color: var(--accent-dark);
}

body.theme-brass .status-pill,
body.theme-brass .business-status-pill,
body.theme-brass .email-check-pill {
  background: #eee8dd;
  border-color: #d7cdbc;
  color: var(--primary);
}

body.theme-brass .warning-status-pill {
  background: var(--warn-bg);
  border-color: var(--warn-line);
  color: var(--warn);
}

body.theme-brass .collection-channel-pill,
body.theme-brass .email-check-pill.is-ok {
  background: var(--success-soft);
  border-color: #c5ded0;
  color: var(--success);
}

body.theme-brass .email-check-pill.is-error {
  background: var(--danger-soft);
  border-color: #efbeb6;
  color: var(--danger);
}

body.theme-brass th {
  background: #eee7db;
  color: #4c4b47;
}

body.theme-brass tbody tr:hover {
  background: #fffaf0;
}

body.theme-brass .progress-meter {
  background: #eee8dd;
}

body.theme-brass .progress-meter i {
  background: linear-gradient(90deg, var(--primary), var(--accent));
}

body.theme-brass .admin-menu-panel a:hover,
body.theme-brass .admin-menu-panel button:hover,
body.theme-brass .admin-menu-panel button[type="submit"]:not(.small-button):not(.danger-button):not(.ghost-link):hover {
  background: #f3eadb;
  color: var(--primary);
}

.global-warning-banner {
  align-items: center;
  position: sticky;
  top: 0;
  z-index: 1000;
  display: flex;
  gap: 12px;
  justify-content: center;
  padding: 10px 16px;
  background: #c62828;
  color: #fff;
  font-weight: 800;
  text-align: center;
  box-shadow: 0 8px 22px rgba(198, 40, 40, 0.22);
}

.global-warning-banner span {
  flex: 1;
}

.global-warning-close {
  appearance: none;
  background: rgba(255, 255, 255, 0.14);
  border: 1px solid rgba(255, 255, 255, 0.42);
  border-radius: 999px;
  color: #fff;
  cursor: pointer;
  flex: 0 0 auto;
  font: inherit;
  font-size: 12px;
  font-weight: 900;
  line-height: 1;
  padding: 7px 12px;
}

.global-warning-close:hover {
  background: rgba(255, 255, 255, 0.24);
}

.status-mini-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(210px, 1fr));
  gap: 12px;
}

.status-mini-card,
.alert-row {
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 12px 14px;
  background: var(--panel-soft);
}

.status-mini-card strong,
.status-mini-card span,
.status-mini-card small {
  display: block;
}

.status-mini-card strong,
.alert-row strong {
  color: var(--text);
}

.status-mini-card span {
  margin-top: 6px;
  font-weight: 800;
}

.status-mini-card small {
  margin-top: 4px;
  color: var(--muted);
}

.status-mini-card.is-ok,
.alert-row.is-ok {
  border-color: #b6dfc8;
  background: var(--success-soft);
}

.status-mini-card.is-warn,
.alert-row.is-warn {
  border-color: var(--warn-line);
  background: var(--warn-bg);
}

.status-mini-card.is-error,
.alert-row.is-error {
  border-color: var(--danger-line);
  background: var(--danger-soft);
}

.alert-row {
  display: flex;
  gap: 12px;
  align-items: flex-start;
  margin-top: 10px;
}

.alert-row:first-child {
  margin-top: 0;
}

.alert-row span {
  color: var(--muted);
}

.audit-group {
  border: 1px solid var(--line);
  border-radius: 8px;
  margin-top: 12px;
  overflow: hidden;
}

.audit-group:first-child {
  margin-top: 0;
}

.audit-group summary {
  cursor: pointer;
  padding: 12px 14px;
  font-weight: 800;
  background: var(--panel-soft);
}

.audit-group summary span {
  color: var(--muted);
  font-weight: 700;
}

.audit-group table {
  border-radius: 0;
}

.audit-tabs-wrap {
  display: grid;
  gap: 12px;
}

.audit-tabs {
  align-items: center;
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.audit-tab {
  background: var(--panel-soft);
  border: 1px solid var(--line);
  border-radius: 999px;
  color: var(--muted);
  cursor: pointer;
  font-size: 13px;
  font-weight: 800;
  min-height: 34px;
  min-width: 0;
  padding: 0 14px;
}

.audit-tab span {
  color: inherit;
  opacity: 0.72;
}

.audit-tab:hover,
.audit-tab.is-active {
  background: var(--primary);
  border-color: var(--primary);
  color: #fff;
}

.audit-tab-panel {
  display: none;
}

.audit-tab-panel.is-active {
  display: block;
}

.scheduler-time-form input {
  min-width: 130px;
}

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

.recharge-record-stats {
  display: grid;
  gap: 10px;
  grid-template-columns: repeat(4, minmax(0, 1fr));
}

.recharge-record-stat {
  background: var(--panel-soft);
  border: 1px solid var(--line);
  border-radius: 9px;
  display: grid;
  gap: 5px;
  min-height: 86px;
  padding: 12px;
}

.recharge-record-stat span {
  color: var(--muted);
  font-size: 12px;
  font-weight: 800;
}

.recharge-record-stat strong {
  color: var(--text);
  font-size: 19px;
  line-height: 1.15;
  overflow-wrap: anywhere;
}

.recharge-record-stat small {
  color: var(--muted);
  line-height: 1.35;
}

.recharge-record-filter {
  align-items: end;
  display: grid;
  gap: 10px;
  grid-template-columns: minmax(180px, 1.6fr) minmax(150px, 1fr) minmax(150px, 1fr) 120px;
}

.recharge-record-filter label {
  margin: 0;
}

.recharge-record-filter .small-button {
  min-height: 42px;
  width: 100%;
}

.management-inventory-panel {
  display: grid;
  gap: 16px;
}

.management-import-form {
  align-items: end;
  grid-template-columns: minmax(0, 1fr) minmax(150px, 220px);
}

.management-import-form textarea {
  min-height: 96px;
}

.management-table-head {
  border-top: 1px solid var(--line);
  padding-top: 12px;
}

.management-inventory-table {
  table-layout: fixed;
}

.management-recharge-hero {
  display: grid;
  gap: 12px;
}

.management-amzkeys-layout {
  grid-template-columns: minmax(320px, 1fr) minmax(320px, 1fr);
}

.system-workbench {
  display: grid;
  gap: 14px;
}

.system-tabs {
  align-items: end;
  border-bottom: 1px solid var(--line);
  display: flex;
  gap: 6px;
  overflow-x: auto;
  padding: 0 2px;
}

.system-tab {
  background: color-mix(in srgb, var(--panel) 88%, var(--primary-soft));
  border: 1px solid var(--line);
  border-bottom-color: var(--line);
  border-radius: 10px 10px 0 0;
  color: var(--muted);
  cursor: pointer;
  font-weight: 800;
  min-height: 42px;
  min-width: 88px;
  padding: 0 18px;
  position: relative;
  transition: background 0.18s ease, border-color 0.18s ease, color 0.18s ease, transform 0.18s ease;
}

.system-tab:hover {
  background: var(--primary-soft);
  border-color: var(--line-strong);
  color: var(--primary-dark);
  transform: translateY(-1px);
}

.system-tab.is-active {
  background: var(--panel);
  border-color: var(--line-strong);
  border-bottom-color: var(--panel);
  color: var(--primary-dark);
  box-shadow: 0 -8px 20px rgba(15, 23, 42, 0.04);
  margin-bottom: -1px;
}

.system-tab.is-active::after {
  background: linear-gradient(90deg, var(--primary), var(--accent));
  border-radius: 999px;
  bottom: 7px;
  content: "";
  height: 3px;
  left: 18px;
  position: absolute;
  right: 18px;
}

.system-tab-panel {
  display: none;
  gap: 14px;
}

.system-tab-panel.is-active {
  display: grid;
}

.system-hero-panel {
  background:
    linear-gradient(135deg, color-mix(in srgb, var(--primary-soft) 70%, transparent), transparent 58%),
    var(--panel);
}

.management-data-grid {
  display: grid;
  gap: 14px;
}

.system-entry-grid {
  display: grid;
  gap: 14px;
  grid-template-columns: repeat(3, minmax(0, 1fr));
}

.system-entry-card {
  background:
    linear-gradient(135deg, color-mix(in srgb, var(--primary-soft) 60%, transparent), transparent 58%),
    var(--panel-soft);
  border: 1px solid var(--line);
  border-radius: 10px;
  display: grid;
  gap: 16px;
  min-height: 190px;
  padding: 16px;
}

.system-entry-card span {
  color: var(--muted);
  display: block;
  font-size: 13px;
  font-weight: 800;
}

.system-entry-card strong {
  color: var(--text);
  display: block;
  font-size: 26px;
  line-height: 1.15;
  margin-top: 8px;
  overflow-wrap: anywhere;
}

.system-entry-card p {
  color: var(--muted);
  font-size: 14px;
  line-height: 1.55;
  margin-top: 10px;
}

.system-entry-card .button-link {
  align-self: end;
  justify-self: start;
  min-height: 38px;
  padding: 0 16px;
}

.system-entry-card.is-warn {
  border-color: var(--warn-line);
  background:
    linear-gradient(135deg, color-mix(in srgb, var(--warn-bg) 70%, transparent), transparent 58%),
    var(--panel);
}

.system-entry-card.is-error {
  border-color: var(--danger-line);
  background:
    linear-gradient(135deg, color-mix(in srgb, var(--danger-soft) 70%, transparent), transparent 58%),
    var(--panel);
}

.stat-band {
  background: var(--panel-soft);
  border: 1px solid var(--line);
  border-radius: 10px;
  display: grid;
  gap: 12px;
  padding: 14px;
}

.stat-band-title {
  align-items: baseline;
  display: flex;
  flex-wrap: wrap;
  gap: 8px 12px;
}

.stat-band-title strong {
  color: var(--text);
  font-size: 16px;
}

.stat-band-title span {
  color: var(--muted);
  font-size: 13px;
}

.period-stat-grid {
  display: grid;
  gap: 10px;
  grid-template-columns: repeat(auto-fit, minmax(118px, 1fr));
}

.period-stat-cell {
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: 8px;
  display: grid;
  gap: 5px;
  min-height: 76px;
  padding: 11px 12px;
}

.period-stat-cell span {
  color: var(--muted);
  font-size: 12px;
  font-weight: 800;
}

.period-stat-cell strong {
  color: var(--text);
  font-size: 19px;
  line-height: 1.15;
  overflow-wrap: anywhere;
}

.system-workbench .small-button,
.system-workbench button[type="submit"]:not(.danger-button):not(.ghost-link) {
  background: var(--primary);
  border-color: var(--primary);
  color: #fff;
}

.system-workbench .small-button:hover,
.system-workbench button[type="submit"]:not(.danger-button):not(.ghost-link):hover {
  background: var(--primary-dark);
  border-color: var(--primary-dark);
  color: #fff;
}

.system-workbench .danger-inline,
.system-workbench .danger-button {
  background: var(--danger-soft);
  border-color: var(--danger-line);
  color: var(--danger);
}

.system-workbench .danger-inline:hover,
.system-workbench .danger-button:hover {
  background: var(--danger);
  border-color: var(--danger);
  color: #fff;
}

.system-workbench .ocr-button {
  background: var(--muted);
  border-color: var(--muted);
  color: #fff;
}

.system-workbench .ocr-button:hover {
  background: var(--text);
  border-color: var(--text);
}

body.theme-brass .system-tab {
  background: #eee7db;
  border-color: #d8cebd;
  color: #70695f;
}

body.theme-brass .system-tab:hover {
  background: #f3eadb;
  border-color: #b6aa98;
  color: var(--primary);
}

body.theme-brass .system-tab.is-active {
  background: var(--panel);
  border-color: #b6aa98;
  border-bottom-color: var(--panel);
  color: var(--primary);
}

body.theme-brass .system-tab.is-active::after {
  background: linear-gradient(90deg, #8b6f47, #c7913d);
}

body.theme-brass .audit-tab {
  background: #eee7db;
  border-color: #d8cebd;
  color: #70695f;
}

body.theme-brass .audit-tab:hover,
body.theme-brass .audit-tab.is-active {
  background: var(--primary);
  border-color: var(--primary);
  color: #fff;
}

body.theme-brass .system-workbench .small-button,
body.theme-brass .system-workbench button[type="submit"]:not(.danger-button):not(.ghost-link) {
  background: var(--primary);
  border-color: var(--primary);
  color: #fff;
}

body.theme-brass .system-workbench .small-button:hover,
body.theme-brass .system-workbench button[type="submit"]:not(.danger-button):not(.ghost-link):hover {
  background: #665b4d;
  border-color: #665b4d;
  color: #fff;
}

body.theme-brass .system-workbench .ocr-button {
  background: #8a806f;
  border-color: #8a806f;
  color: #fff;
}

body.theme-brass .system-workbench .ocr-button:hover {
  background: #776f61;
  border-color: #776f61;
}

body.theme-brass .system-hero-panel {
  background:
    linear-gradient(135deg, rgba(243, 234, 219, 0.85), transparent 58%),
    var(--panel);
}
