:root {
  color-scheme: light;
  font-family: Inter, -apple-system, BlinkMacSystemFont, "Segoe UI", "Microsoft YaHei", sans-serif;
  background: #f5f6f8;
  color: #202631;
  --bg: #f5f6f8;
  --surface: #ffffff;
  --surface-soft: #fafbfc;
  --line: #dde3ea;
  --line-soft: #edf0f4;
  --text: #202631;
  --muted: #697386;
  --brand: #d71920;
  --brand-dark: #b5161d;
  --ink: #161c26;
  --nav: #101722;
  --blue: #1769e0;
  --green: #16803c;
  --yellow: #9a6100;
  --red: #b42318;
}
* { box-sizing: border-box; }
body { margin: 0; min-height: 100vh; background: var(--bg); }
a { color: var(--brand-dark); text-decoration: none; }
a:hover { text-decoration: underline; }
h1, h2, h3, p { margin: 0; }
h1 { font-size: 28px; line-height: 1.18; letter-spacing: 0; }
h2 { font-size: 17px; line-height: 1.35; }
p { color: var(--muted); line-height: 1.55; }
small, .muted { color: var(--muted); }
code {
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  font-size: 12px;
  background: #f7f9fb;
  border: 1px solid var(--line);
  border-radius: 6px;
  padding: 3px 6px;
  word-break: break-all;
}
.sidebar {
  position: fixed;
  inset: 0 auto 0 0;
  width: 236px;
  background: var(--nav);
  color: #fff;
  padding: 18px 14px;
  display: flex;
  flex-direction: column;
  gap: 18px;
}
.brand {
  display: flex;
  align-items: center;
  gap: 10px;
  color: #fff;
  padding: 4px 4px 12px;
  border-bottom: 1px solid rgba(255,255,255,.08);
}
.brand:hover { text-decoration: none; }
.brand-mark {
  display: grid;
  place-items: center;
  width: 40px;
  height: 40px;
  border-radius: 8px;
  background: var(--brand);
  font-weight: 800;
}
.brand strong { display: block; font-size: 17px; }
.brand small { display: block; color: #aeb8c6; margin-top: 2px; }
.nav { display: grid; gap: 6px; }
.nav a, .logout {
  display: block;
  color: #d8e0ea;
  padding: 10px 12px;
  border-radius: 8px;
  font-weight: 700;
}
.nav a:hover, .logout:hover, .nav a.active {
  background: #202a36;
  color: #fff;
  text-decoration: none;
}
.nav a.active { box-shadow: inset 3px 0 0 var(--brand); }
.nav-group {
  display: block;
  margin: 4px 0;
}
.nav-group summary {
  display: flex;
  align-items: center;
  justify-content: space-between;
  color: #8793a3;
  font-size: 12px;
  font-weight: 800;
  padding: 9px 12px 7px;
  cursor: pointer;
  list-style: none;
}
.nav-group summary::-webkit-details-marker {
  display: none;
}
.nav-group summary::after {
  content: "›";
  font-size: 15px;
  line-height: 1;
  flex: 0 0 auto;
  transform: rotate(0deg);
  transition: transform .15s ease;
}
.nav-group[open] summary::after {
  transform: rotate(90deg);
}
.nav-group a {
  margin: 3px 0 3px 12px;
  padding: 9px 10px 9px 12px;
  font-size: 14px;
  border-left: 2px solid #2c3745;
  border-radius: 0 8px 8px 0;
  min-height: 36px;
}
.nav-group a.active { border-left-color: var(--brand); }
.sidebar-user {
  border-top: 1px solid rgba(255,255,255,.08);
  padding: 12px 10px 0;
  display: grid;
  gap: 3px;
}
.sidebar-user strong { color: #fff; font-size: 14px; }
.sidebar-user small { color: #aeb8c6; }
.logout { margin-top: auto; }
.app-shell {
  margin-left: 236px;
  padding: 24px;
  display: grid;
  gap: 18px;
}
.page-head {
  min-height: 86px;
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 16px;
}
.page-head p { margin-top: 8px; max-width: 820px; }
.eyebrow {
  display: inline-block;
  margin-bottom: 7px;
  color: var(--brand-dark);
  font-size: 12px;
  font-weight: 800;
}
.page-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  justify-content: flex-end;
}
.button, button {
  border: 0;
  border-radius: 7px;
  padding: 10px 14px;
  background: var(--ink);
  color: #fff;
  font-weight: 800;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 38px;
  white-space: nowrap;
}
.button.primary, button[type="submit"] { background: var(--brand); }
.secondary { background: #4d5868; }
.danger-button { background: var(--red); }
.delete-button {
  background: #fff;
  color: var(--red);
  border: 1px solid #fecaca;
}
.delete-button:hover {
  background: #fef2f2;
}
.action-col {
  width: 110px;
  text-align: right;
}
.action-col form {
  display: inline-flex;
  margin: 0;
}
.tg-admin-table-wrap {
  overflow: visible;
  border: 0;
  background: transparent;
}
.tg-admin-table {
  min-width: 0;
  table-layout: auto;
  border-collapse: separate;
  border-spacing: 0 8px;
  font-size: 13px;
}
.tg-admin-table thead th {
  padding: 0 10px 2px;
  background: transparent;
  border: 0;
}
.tg-admin-table tbody tr {
  background: #f8fafc;
  box-shadow: inset 0 0 0 1px var(--line-soft);
}
.tg-admin-table tbody td {
  padding: 10px 12px;
  border: 0;
  vertical-align: middle;
}
.tg-admin-table tbody td:first-child {
  border-radius: 8px 0 0 8px;
}
.tg-admin-table tbody td:last-child {
  border-radius: 0 8px 8px 0;
}
.tg-admin-table code {
  display: inline-flex;
  max-width: 100%;
  background: #fff;
  color: var(--ink);
  font-size: 13px;
  font-weight: 800;
}
.tg-admin-table .action-col {
  width: 92px;
  text-align: right;
}
.tg-admin-table .delete-button {
  min-height: 32px;
  padding: 7px 13px;
  border-radius: 7px;
  background: var(--red);
  color: #fff;
  border: 1px solid var(--red);
  font-size: 13px;
  line-height: 1;
}
.tg-admin-table .delete-button:hover {
  background: #8f1d15;
  border-color: #8f1d15;
}
.button:hover { text-decoration: none; background: #273140; }
.button.secondary:hover { background: #3f4a59; }
.button.disabled {
  opacity: .45;
  pointer-events: none;
}
button:disabled {
  opacity: .55;
  cursor: not-allowed;
}
.table-button {
  min-height: 30px;
  padding: 6px 10px;
  font-size: 13px;
}
.check-row {
  min-height: 38px;
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 8px 10px;
  border: 1px solid var(--line);
  border-radius: 7px;
  background: #fff;
  font-size: 13px;
  font-weight: 800;
  color: #3f4a59;
}
.check-row input {
  width: auto;
  min-height: 0;
}
.modal-card {
  width: min(560px, calc(100vw - 32px));
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 18px;
  box-shadow: 0 24px 80px rgba(15, 23, 42, .22);
}
.modal-card::backdrop {
  background: rgba(15, 23, 42, .42);
}
.icon-button {
  min-width: 34px;
  width: 34px;
  min-height: 34px;
  height: 34px;
  padding: 0;
  border-radius: 7px;
  font-size: 20px;
  line-height: 1;
}
.modal-actions {
  display: flex;
  justify-content: flex-end;
  gap: 8px;
}
.client-modal-actions {
  align-items: center;
  justify-content: space-between;
}
.modal-save-actions {
  display: flex;
  gap: 8px;
}
.modal-danger-action {
  min-width: 0;
}
.compact-danger-button {
  min-height: 38px;
  padding-inline: 12px;
}
.modal-unbind-form {
  display: none;
}
.panel, .metrics div {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 8px;
}
.panel { padding: 18px; min-width: 0; }
.alert {
  border-radius: 8px;
  padding: 12px 14px;
  margin-bottom: 14px;
  font-weight: 800;
}
.alert.error {
  background: #fef2f2;
  border: 1px solid #fecaca;
  color: var(--red);
}
.alert.success {
  background: #f0fdf4;
  border: 1px solid #bbf7d0;
  color: var(--green);
}
.panel-title {
  display: flex;
  align-items: flex-start;
  gap: 12px;
  margin-bottom: 16px;
}
.panel-title p, .section-head p { margin-top: 4px; font-size: 13px; }
.panel-icon {
  width: 34px;
  height: 34px;
  border-radius: 8px;
  display: grid;
  place-items: center;
  background: #fff1f2;
  color: var(--brand-dark);
  font-weight: 900;
}
.section-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 14px;
}
.workflow-tabs {
  display: flex;
  gap: 8px;
  align-items: center;
  border-bottom: 1px solid var(--line);
}
.workflow-tabs a {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 12px 16px;
  color: #4b5565;
  border: 1px solid transparent;
  border-bottom: 0;
  border-radius: 8px 8px 0 0;
  font-weight: 800;
}
.workflow-tabs a span {
  width: 22px;
  height: 22px;
  border-radius: 999px;
  display: grid;
  place-items: center;
  background: #e8edf3;
  font-size: 12px;
}
.workflow-tabs a.active {
  background: #fff;
  border-color: var(--line);
  color: var(--brand-dark);
}
.workflow-tabs a.active span { background: var(--brand); color: #fff; }
.manager-layout {
  display: grid;
  grid-template-columns: 360px minmax(0, 1fr);
  gap: 18px;
  align-items: start;
}
.create-panel { position: sticky; top: 18px; }
.category-grid, .product-board {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 14px;
}
.category-card, .product-card {
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 14px;
  background: var(--surface-soft);
  display: grid;
  gap: 12px;
}
.card-topline {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 10px;
}
.id-pill, .code-pill {
  display: inline-flex;
  align-items: center;
  min-height: 24px;
  border-radius: 999px;
  padding: 3px 9px;
  background: #eef2f7;
  color: #3b4656;
  font-size: 12px;
  font-weight: 800;
}
.code-pill { background: #fff; border: 1px solid var(--line); }
.card-metrics, .stock-summary {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 10px;
}
.card-metrics div, .stock-summary div {
  border: 1px solid var(--line-soft);
  border-radius: 8px;
  background: #fff;
  padding: 10px;
  min-height: 70px;
}
.card-metrics small, .stock-summary small {
  display: block;
  margin-bottom: 7px;
}
.card-metrics strong, .stock-summary strong {
  font-size: 24px;
  line-height: 1;
}
.stock-summary .available {
  border-color: #b9d4ff;
  background: #f3f7ff;
}
.card-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  align-items: center;
}
form { display: grid; gap: 10px; }
.stack { grid-template-columns: 1fr; }
label {
  display: grid;
  gap: 6px;
  min-width: 0;
}
label > span {
  color: #586477;
  font-size: 12px;
  font-weight: 800;
}
input, textarea, select {
  width: 100%;
  border: 1px solid #cfd7e3;
  border-radius: 7px;
  padding: 10px 11px;
  font: inherit;
  background: #fff;
  color: var(--text);
  min-height: 38px;
}
textarea { resize: vertical; line-height: 1.45; }
input:focus, textarea:focus, select:focus {
  outline: 2px solid rgba(215, 25, 32, .15);
  border-color: var(--brand);
}
.split {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px;
}
.split.compact { align-items: end; }
.catalog-form {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr)) auto;
  gap: 10px;
  align-items: end;
}
.catalog-form.refined {
  grid-template-columns: repeat(4, minmax(0, 1fr)) 150px;
}
.form-grid, .compact-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 10px;
}
.span-2 { grid-column: span 2; }
.span-3 { grid-column: span 3; }
.inventory-tools {
  display: grid;
  grid-template-columns: minmax(0, 1.1fr) minmax(360px, .9fr);
  gap: 18px;
  align-items: start;
}
.inventory-upload-panel {
  margin-bottom: 18px;
}
.inventory-upload-form {
  display: grid;
  grid-template-columns: minmax(260px, 1.2fr) minmax(220px, .8fr) 160px;
  gap: 10px;
  align-items: end;
}
.inventory-textarea-field {
  grid-column: 1 / -1;
}
.inventory-upload-form textarea {
  min-height: 160px;
}
.inventory-upload-form > button[type="submit"] {
  min-height: 38px;
}
.inventory-board-panel {
  min-height: 620px;
}
.inventory-board-panel .table-wrap {
  max-height: 560px;
}
.inventory-board-panel .inventory-table {
  min-width: 1120px;
}
.inventory-board-panel .inventory-table th {
  position: sticky;
  top: 0;
  z-index: 1;
}
.table-wrap {
  overflow-x: auto;
  border: 1px solid var(--line-soft);
  border-radius: 8px;
  background: #fff;
}
.table-wrap.spaced { margin-top: 14px; }
table {
  width: 100%;
  border-collapse: collapse;
  font-size: 14px;
  min-width: 780px;
}
th, td {
  padding: 12px 11px;
  border-bottom: 1px solid var(--line-soft);
  text-align: left;
  vertical-align: top;
}
th {
  color: #596579;
  background: #f8fafc;
  font-weight: 800;
  white-space: nowrap;
}
tr:last-child td { border-bottom: 0; }
.inventory-table td:first-child strong,
.inventory-table td:first-child small {
  display: block;
}
.inventory-table td:first-child small { margin-top: 5px; }
.inline {
  display: inline-flex;
  flex-wrap: wrap;
  gap: 6px;
  align-items: center;
}
.service-entry-panel textarea {
  min-height: 150px;
}
.service-entry-panel select,
.client-picker {
  max-width: 420px;
}
.native-client-select {
  position: absolute;
  width: 1px;
  height: 1px;
  opacity: 0;
  pointer-events: none;
}
.client-search-picker {
  position: relative;
  max-width: 560px;
  display: grid;
  gap: 8px;
}
.client-search-input {
  padding-left: 12px;
}
.client-selected {
  min-height: 40px;
  border: 1px solid var(--line);
  border-radius: 7px;
  padding: 9px 11px;
  background: #f8fafc;
  color: var(--muted);
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
}
.client-selected.is-selected {
  background: #f0fdf4;
  border-color: #bbf7d0;
  color: #166534;
}
.client-selected strong {
  color: inherit;
}
.client-selected span {
  font-size: 12px;
  font-weight: 800;
}
.client-search-results {
  position: absolute;
  top: calc(100% + 6px);
  left: 0;
  right: 0;
  z-index: 40;
  max-height: 320px;
  overflow: auto;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
  box-shadow: 0 18px 48px rgba(15, 23, 42, .18);
  padding: 6px;
}
.client-search-result {
  width: 100%;
  min-height: 44px;
  padding: 8px 10px;
  border-radius: 6px;
  background: transparent;
  color: var(--text);
  justify-content: flex-start;
  display: grid;
  gap: 2px;
  text-align: left;
}
.client-search-result:hover,
.client-search-result.active {
  background: #fff1f2;
  color: var(--brand-dark);
}
.client-search-result span,
.client-search-empty {
  color: var(--muted);
  font-size: 12px;
  font-weight: 700;
}
.client-search-empty {
  padding: 12px;
}
.historical-import-mini {
  width: min(620px, calc(100vw - 288px));
  display: grid;
  gap: 6px;
  padding: 8px 10px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
}
.historical-import-mini .mini-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  color: #313b4a;
  font-size: 12px;
  line-height: 1.2;
}
.historical-import-mini .mini-head span {
  color: var(--muted);
  font-size: 12px;
  font-weight: 600;
}
.historical-import-mini .mini-controls {
  display: grid;
  grid-template-columns: minmax(150px, 1fr) auto minmax(230px, 1fr);
  gap: 6px;
  align-items: center;
}
.historical-import-mini select,
.historical-import-mini input[type="file"] {
  min-height: 32px;
  padding: 5px 8px;
  font-size: 13px;
}
.historical-import-mini input[type="file"] {
  width: 150px;
  min-width: 0;
}
.historical-upload-form {
  display: flex;
  align-items: center;
  gap: 6px;
  min-width: 0;
}
.historical-import-mini .small {
  min-height: 32px;
  padding: 6px 10px;
  font-size: 13px;
}
.service-entry-panel textarea {
  min-height: 148px;
  resize: vertical;
}
.service-edit-panel .table-wrap {
  margin-top: 2px;
}
.service-edit-table {
  min-width: 1180px;
  table-layout: fixed;
}
.service-edit-table th:nth-child(1) { width: 180px; }
.service-edit-table th:nth-child(2) { width: 190px; }
.service-edit-table th:nth-child(3) { width: 390px; }
.service-edit-table th:nth-child(4) { width: 160px; }
.service-edit-table th:nth-child(5) { width: 180px; }
.service-edit-table input {
  min-width: 0;
  width: 100%;
}
.service-edit-table td:last-child,
.service-edit-table th:last-child {
  width: 86px;
  text-align: right;
}
.service-edit-table th,
.service-edit-table td {
  padding: 10px;
  vertical-align: middle;
}
.service-edit-table input {
  min-height: 34px;
  padding: 7px 9px;
}
.service-note-textarea {
  min-height: 54px;
  max-height: 130px;
}
.service-confirm-modal {
  width: min(680px, calc(100vw - 32px));
}
.confirm-summary {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 8px;
  margin: 12px 0;
}
.confirm-summary div {
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 10px;
  background: #f8fafc;
}
.confirm-summary span {
  display: block;
  color: var(--muted);
  font-size: 12px;
  font-weight: 800;
  margin-bottom: 4px;
}
.confirm-summary strong {
  display: block;
  color: var(--text);
  line-height: 1.35;
}
.confirm-detail-list {
  border: 1px solid var(--line-soft);
  border-radius: 8px;
  background: #fff;
  padding: 10px 12px;
  margin-bottom: 14px;
  max-height: 260px;
  overflow: auto;
}
.confirm-detail-list ol {
  margin: 0;
  padding-left: 20px;
}
.confirm-detail-list li {
  padding: 4px 0;
  line-height: 1.45;
}
.bulk-tag-bar,
.service-save-bar {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  align-items: center;
  justify-content: space-between;
}
.bulk-tag-bar {
  justify-content: flex-start;
  padding: 12px;
  border: 1px solid var(--line-soft);
  border-radius: 8px;
  background: var(--surface-soft);
}
.bulk-tag-bar > span {
  color: #586477;
  font-size: 12px;
  font-weight: 800;
}
.tag-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 8px;
  min-width: 0;
}
.tag-check {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  min-height: 30px;
  padding: 4px 8px;
  border: 1px solid var(--line-soft);
  border-radius: 7px;
  background: #fff;
  color: #3b4656;
  font-size: 12px;
  font-weight: 700;
  white-space: nowrap;
}
.tag-check input {
  flex: 0 0 auto;
  width: auto;
  min-height: 0;
}
.tag-note {
  display: inline-flex;
  align-items: center;
  min-height: 30px;
  padding: 4px 9px;
  border-radius: 999px;
  background: #fee2e2;
  color: #991b1b;
  font-size: 13px;
  font-weight: 800;
}
.tag-note.neutral {
  min-height: 24px;
  background: #eef2f7;
  color: #344054;
  font-size: 12px;
}
.service-meta {
  display: grid;
  gap: 4px;
  min-width: 0;
}
.service-meta small {
  color: var(--muted);
  font-size: 12px;
  line-height: 1.3;
}
tr[data-blocked-clear="1"] {
  background: #fff7ed;
}
tr[data-blocked-clear="1"] input,
tr[data-blocked-clear="1"] .tag-check {
  opacity: .72;
}
.clear-return-panel {
  padding: 14px;
}
.clear-return-panel .section-head {
  margin-bottom: 6px;
}
.clear-return-toolbar {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
  margin: 0;
}
.clear-return-toolbar .button,
.clear-return-toolbar button {
  width: auto;
  min-height: 30px;
  padding: 6px 10px;
  font-size: 13px;
  line-height: 1;
}
.clear-return-toolbar .button.secondary,
.clear-return-toolbar button.secondary {
  background: #4d5868;
  color: #fff;
}
.clear-return-toolbar .import-inline-form {
  display: flex;
  align-items: center;
  gap: 6px;
  margin: 0;
  width: auto;
}
.clear-return-toolbar input[type="file"] {
  width: 210px;
  min-width: 0;
  min-height: 30px;
  padding: 4px 8px;
  font-size: 12px;
}
.compact-table th,
.compact-table td {
  padding: 8px 10px;
  vertical-align: middle;
}
.compact-table input {
  min-height: 32px;
  padding: 6px 9px;
}
.compact-table button {
  min-height: 32px;
  padding: 6px 10px;
}
.clear-return-table {
  min-width: 1480px;
}
.clear-return-table .inline {
  flex-wrap: nowrap;
}
.clear-return-table input[name^="returned_balance_"],
.clear-return-table input[name^="cumulative_recharge_"],
.clear-return-table input[name^="total_spend_"] {
  width: 120px;
}
.clear-bulk-form {
  display: grid;
  gap: 12px;
}
.bulk-return-actions {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  flex-wrap: wrap;
  padding-top: 2px;
}
.bulk-return-submit {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  flex-wrap: wrap;
  gap: 12px;
  margin-left: auto;
}
.activity-log-panel {
  padding: 14px;
}
.activity-filter-form {
  display: grid;
  grid-template-columns: minmax(260px, 1.8fr) repeat(3, minmax(130px, .75fr)) 150px 150px auto auto;
  gap: 8px;
  align-items: center;
  margin-bottom: 12px;
}
.activity-filter-form input,
.activity-filter-form select,
.activity-filter-form button,
.activity-filter-form .button {
  min-height: 34px;
  padding: 7px 10px;
}
.activity-log-wrap {
  max-height: 680px;
}
.activity-log-table {
  min-width: 1380px;
}
.activity-log-table th {
  position: sticky;
  top: 0;
  z-index: 1;
}
.activity-log-table td:first-child strong,
.activity-log-table td:first-child small,
.activity-log-table td:nth-child(2) small,
.activity-log-table td:nth-child(8) small {
  display: block;
}
.activity-log-table td:nth-child(4),
.activity-log-table td:nth-child(9) {
  max-width: 260px;
}
.activity-log-table code {
  display: inline-block;
  max-width: 220px;
  overflow: hidden;
  text-overflow: ellipsis;
}
.log-note {
  display: grid;
  gap: 3px;
  max-height: 74px;
  overflow: hidden;
}
.log-note span,
.log-note small {
  overflow-wrap: anywhere;
}
.status.recharge { background: #dbeafe; color: #1e40af; }
.status.clear { background: #fee2e2; color: #991b1b; }
.status.shipment, .status.completed { background: #dcfce7; color: #166534; }
.pagination {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 10px;
  margin-top: 12px;
  color: var(--muted);
  font-weight: 800;
}
.action-cell {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  align-items: center;
}
.action-cell.nowrap {
  flex-wrap: nowrap;
  min-width: max-content;
}
.management-table {
  min-width: 1080px;
}
.management-table th,
.management-table td {
  padding: 9px 8px;
  vertical-align: middle;
}
.management-table input,
.management-table select {
  min-height: 34px;
  padding: 7px 9px;
}
.management-table button,
.management-table .button {
  min-height: 34px;
  padding: 7px 10px;
}
.management-table .id-pill {
  min-height: 22px;
  padding: 2px 8px;
}
.category-table {
  min-width: 880px;
}
.category-table td:nth-child(3),
.category-table td:nth-child(4),
.product-table td:nth-child(5),
.product-table td:nth-child(6),
.product-table td:nth-child(7) {
  text-align: center;
}
.product-table {
  min-width: 1500px;
}
.product-table th:nth-child(3),
.product-table td:nth-child(3) {
  min-width: 190px;
}
.product-table th:nth-child(4),
.product-table td:nth-child(4) {
  min-width: 150px;
}
.product-table th:nth-child(12),
.product-table td:nth-child(12) {
  min-width: 180px;
}
.product-table .available-count {
  color: #1e40af;
}
.wide-inline { min-width: 520px; }
.inline-form {
  display: grid;
  grid-template-columns: 1.3fr 1fr repeat(7, minmax(120px, 1fr)) auto;
  gap: 8px;
  align-items: center;
  overflow-x: auto;
}
details summary {
  cursor: pointer;
  color: var(--brand-dark);
  font-weight: 800;
  margin-bottom: 8px;
  white-space: nowrap;
}
.stock-edit-form {
  min-width: 320px;
  margin-bottom: 8px;
  padding: 12px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
}
.inventory-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  min-width: 230px;
}
.status {
  display: inline-flex;
  align-items: center;
  min-height: 24px;
  border-radius: 999px;
  padding: 3px 9px;
  background: #e7ebf0;
  color: #344054;
  white-space: nowrap;
  font-size: 12px;
  font-weight: 800;
}
.status.active, .status.confirmed, .status.paid { background: #dcfce7; color: #166534; }
.status.hidden, .status.pending, .status.pending_clear, .status.needs_review, .status.reserved { background: #fef3c7; color: #92400e; }
.status.needs_account, .status.cancelled, .status.disabled { background: #fee2e2; color: #991b1b; }
.status.available { background: #dbeafe; color: #1e40af; }
.status.assigned { background: #e5e7eb; color: #374151; }
.status.dry_run, .status.needs_card, .status.processing, .status.pending_recharge, .status.unfreezing { background: #fef3c7; color: #92400e; }
.status.succeed, .status.normal, .status.authorized { background: #dcfce7; color: #166534; }
.status.failed, .status.freezing, .status.frozen, .status.risk_frozen, .status.system_frozen, .status.canceling, .status.cancelled, .status.deleted { background: #fee2e2; color: #991b1b; }
.credit-card-bound-table .status.available,
.credit-card-bill-table .status.available { background: #dcfce7; color: #166534; }
.status.uncleared { background: #e5e7eb; color: #374151; }
.status.needs_adjustment { background: #fee2e2; color: #991b1b; }
.status.adjusted { background: #dbeafe; color: #1e40af; }
.credit-card-metrics { margin-bottom: 16px; }
.secret-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 12px;
}
.secret-grid input[readonly] {
  background: #f8fafc;
  border-color: #cbd5e1;
  font-weight: 800;
}
.card-secret-panel {
  border-color: #f59e0b;
  box-shadow: 0 12px 30px rgba(245, 158, 11, .12);
}
.credit-card-toolbar,
.credit-card-upload-strip,
.credit-card-upload-left,
.credit-card-upload-right,
.credit-card-row-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  align-items: center;
}
.credit-card-upload-strip {
  justify-content: space-between;
  padding: 9px 10px;
  margin-bottom: 10px;
  border: 1px solid #dfe5ec;
  border-radius: 7px;
  background: linear-gradient(180deg, #fbfcfe, #f7f9fc);
}
.credit-card-upload-left,
.credit-card-upload-right {
  min-width: 0;
}
.credit-card-add-row[hidden] {
  display: none;
}
.credit-card-upload-left > span {
  color: #586477;
  font-size: 12px;
  font-weight: 800;
}
.credit-card-selection-count {
  min-height: 32px;
  padding: 7px 10px;
  border: 1px solid #cbd5e1;
  border-radius: 7px;
  background: #fff;
  color: #334155;
  font-size: 12px;
  font-weight: 800;
  white-space: nowrap;
}
.credit-card-upload-strip input[type="file"] {
  width: auto;
  min-height: 36px;
  padding: 5px 8px;
  background: #fff;
}
.credit-card-upload-strip .button,
.credit-card-upload-strip button,
.credit-card-toolbar .button,
.credit-card-toolbar button {
  width: 92px;
  min-height: 32px;
  padding: 7px 12px;
}
.credit-card-table-wrap {
  overflow-x: auto;
}
.credit-card-table {
  min-width: 980px;
}
.credit-card-table .select-col { width: 46px; }
.cc-check {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 28px;
  height: 28px;
  cursor: pointer;
}
.cc-check input {
  position: absolute;
  opacity: 0;
  pointer-events: none;
}
.cc-check span {
  width: 18px;
  height: 18px;
  border: 1.5px solid #cbd5e1;
  border-radius: 6px;
  background: #fff;
  box-shadow: inset 0 0 0 2px #fff;
}
.cc-check input:checked + span {
  border-color: var(--brand);
  background: var(--brand);
}
.cc-check input:checked + span::after {
  content: "";
  display: block;
  width: 8px;
  height: 4px;
  margin: 5px 0 0 4px;
  border-left: 2px solid #fff;
  border-bottom: 2px solid #fff;
  transform: rotate(-45deg);
}

.credit-card-table .account-col { width: 20%; }
.credit-card-table .id-col { width: 19%; }
.credit-card-table .amount-col { width: 12%; }
.credit-card-table .status-col { width: 11%; }
.credit-card-table .card-col { width: 25%; }
.credit-card-table .op-col { width: 13%; }
.credit-card-add-row td {
  background: #fbfdff;
  padding-top: 8px;
  padding-bottom: 8px;
}
.credit-card-add-row input {
  min-height: 32px;
  padding: 7px 9px;
  font-size: 13px;
}
.credit-card-row-actions {
  min-width: 160px;
}
.credit-card-row-actions .inline {
  margin: 0;
}
button.danger,
.table-button.danger {
  background: var(--red);
  color: #fff;
}
.copy-card-button {
  white-space: nowrap;
}
.replace-card-button {
  background: var(--brand);
  color: #fff;
}
.credit-card-client-hover {
  position: relative;
  display: inline-flex;
  align-items: center;
  max-width: 180px;
}
.credit-card-client-hover .client-current {
  color: var(--brand-dark);
  font-weight: 900;
  white-space: nowrap;
}
.credit-card-client-hover .client-current::before {
  content: "▶";
  margin-right: 6px;
  color: var(--brand);
  font-size: 11px;
}
.client-history-tip {
  position: fixed;
  left: 0;
  top: 0;
  z-index: 1000;
  display: none;
  width: max-content;
  max-width: 360px;
  padding: 9px 10px;
  border: 1px solid #d9e1eb;
  border-radius: 7px;
  background: #111827;
  color: #fff;
  box-shadow: 0 14px 35px rgba(15, 23, 42, .22);
  font-size: 12px;
  line-height: 1.5;
  pointer-events: none;
  white-space: normal;
}
.client-history-tip.is-visible {
  display: block;
}
.client-history-tip::before {
  content: "";
  position: absolute;
  left: 14px;
  top: -6px;
  width: 10px;
  height: 10px;
  background: #111827;
  transform: rotate(45deg);
}
.client-history-tip.is-above::before {
  top: auto;
  bottom: -6px;
}
.replace-card-dialog {
  width: min(660px, calc(100vw - 32px));
  padding: 0;
  border: 1px solid var(--line);
  border-radius: 8px;
  box-shadow: 0 24px 70px rgba(16, 24, 40, .24);
}
.replace-card-dialog::backdrop {
  background: rgba(15, 23, 42, .42);
}
.replace-card-dialog-body {
  display: grid;
  gap: 12px;
  padding: 18px 20px;
}
.replace-card-panel {
  display: grid;
  gap: 10px;
  padding: 14px 16px;
  border: 1px solid #dbe3ef;
  border-radius: 8px;
  background: #fff;
}
.replace-card-auto-panel {
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: center;
  background: #f8fafc;
}
.replace-card-auto-panel form {
  display: flex;
  align-items: center;
  gap: 10px;
  margin: 0;
}
.replace-card-auto-panel .table-button {
  flex: 0 0 auto;
  min-height: 38px;
  padding-inline: 16px;
}
.auto-replace-confirm {
  display: flex;
  align-items: center;
  gap: 8px;
  min-height: 38px;
  padding: 8px 10px;
  border: 1px solid #fecaca;
  border-radius: 8px;
  background: #fff7f7;
  color: #991b1b;
  font-size: 12px;
  font-weight: 900;
  line-height: 1.35;
}
.auto-replace-confirm input {
  flex: 0 0 auto;
  width: auto;
  height: auto;
  min-height: 0;
  margin: 0;
}
.replace-card-panel strong {
  display: block;
  font-size: 15px;
}
.replace-card-panel small {
  display: block;
  margin-top: 4px;
  color: #64748b;
  line-height: 1.45;
}
.reissue-mode-fieldset {
  display: grid;
  gap: 8px;
  margin: 0;
  padding: 12px;
  border: 1px solid #dbe3ef;
  border-radius: 8px;
  background: #f8fafc;
}
.reissue-mode-fieldset legend {
  padding: 0 6px;
  color: #334155;
  font-size: 13px;
  font-weight: 900;
}
.replace-card-panel-head {
  display: grid;
  gap: 2px;
}
.reissue-mode-options {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 8px;
}
.reissue-mode-options label {
  display: flex;
  align-items: center;
  gap: 8px;
  min-height: 38px;
  padding: 8px 11px;
  border: 1px solid #dbe3ef;
  border-radius: 8px;
  background: #fff;
  color: #334155;
  font-size: 13px;
  font-weight: 800;
  line-height: 1.35;
}
.reissue-mode-options label:has(input:checked) {
  border-color: #93b4e8;
  background: #eff6ff;
  color: #1e3a8a;
}
.reissue-mode-options input {
  flex: 0 0 auto;
  width: auto;
  height: auto;
  min-height: 0;
  margin: 0;
}
.manual-replace-form {
  display: grid;
  gap: 14px;
}
.dialog-title-row {
  display: flex;
  justify-content: space-between;
  gap: 16px;
  align-items: flex-start;
}
.dialog-title-row strong {
  display: block;
  font-size: 17px;
}
.dialog-title-row small {
  display: block;
  margin-top: 4px;
}
.icon-close {
  width: 30px;
  height: 30px;
  border-radius: 50%;
  padding: 0;
  background: #eef2f6;
  color: #344154;
  font-size: 20px;
  line-height: 1;
}
.manual-replace-form > label,
.manual-replace-two-col label {
  display: grid;
  gap: 6px;
  color: #344154;
  font-size: 13px;
  font-weight: 800;
}
.manual-replace-form > label input,
.manual-replace-two-col input {
  width: 100%;
  height: 38px;
}
.manual-replace-two-col {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
}
.dialog-actions {
  display: flex;
  justify-content: flex-end;
  gap: 8px;
  padding-top: 2px;
}
@media (max-width: 720px) {
  .replace-card-auto-panel {
    grid-template-columns: 1fr;
  }
  .replace-card-auto-panel form {
    align-items: stretch;
    flex-direction: column;
  }
  .reissue-mode-options {
    grid-template-columns: 1fr;
  }
  .manual-replace-two-col {
    grid-template-columns: 1fr;
  }
}
.card-copy-grid {
  display: grid;
  grid-template-columns: 32px minmax(96px, 1fr) 44px;
  gap: 4px 6px;
  align-items: center;
  max-width: 300px;
  font-size: 12px;
}
.card-copy-grid span {
  color: #64748b;
  font-weight: 800;
}
.card-copy-grid strong {
  font-size: 12px;
  white-space: nowrap;
}
.mini-copy-button {
  width: 42px;
  min-height: 24px;
  padding: 3px 6px;
  border-radius: 5px;
  font-size: 12px;
  line-height: 1;
}

.error-text {
  color: #b91c1c;
}

.credit-card-job {
  display: grid;
  gap: 8px;
  padding: 12px 14px;
  margin-bottom: 14px;
  border: 1px solid #bfdbfe;
  border-radius: 8px;
  background: #eff6ff;
  color: #1e3a8a;
}
.credit-card-job-head {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  align-items: center;
  font-weight: 800;
}
.credit-card-progress {
  height: 8px;
  overflow: hidden;
  border-radius: 999px;
  background: #dbeafe;
}
.credit-card-progress span {
  display: block;
  height: 100%;
  border-radius: inherit;
  background: #2563eb;
  transition: width .25s ease;
}
.module-tabs.credit-card-tabs {
  display: inline-flex;
  gap: 4px;
  align-items: center;
  margin: 0 0 8px 0;
  padding: 4px;
  border: 1px solid var(--line);
  border-radius: 8px 8px 0 0;
  border-bottom-color: #f8fafc;
  background: #f8fafc;
}
.module-tabs.credit-card-tabs button,
.module-tabs.credit-card-tabs a {
  -webkit-appearance: none;
  appearance: none;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 7px;
  min-height: 32px;
  padding: 7px 12px;
  border: 0;
  border-radius: 6px;
  background: transparent;
  color: #475569;
  font-family: inherit;
  font-size: 14px;
  font-weight: 800;
  line-height: 1;
  letter-spacing: 0;
  text-decoration: none;
  cursor: pointer;
}
.module-tabs.credit-card-tabs button:hover,
.module-tabs.credit-card-tabs a:hover {
  background: #eef2f6;
  text-decoration: none;
}
.module-tabs.credit-card-tabs button.is-active,
.module-tabs.credit-card-tabs a.is-active {
  background: #111827;
  color: #fff;
}
.module-tabs.credit-card-tabs span {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 20px;
  height: 18px;
  padding: 0 6px;
  border-radius: 999px;
  background: #e9eef5;
  color: #526071;
  font-family: inherit;
  font-size: 12px;
  font-weight: 800;
  line-height: 1;
}
.module-tabs.credit-card-tabs .is-active span {
  background: rgba(255,255,255,.18);
  color: #fff;
}
.credit-card-bound-toolbar,
.credit-card-bound-pager {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  align-items: center;
  padding: 12px;
  margin: 0 0 10px 0;
  border: 1px solid var(--line);
  border-radius: 0 8px 8px 8px;
  background: #fff;
}
.credit-card-bound-toolbar div:first-child {
  display: grid;
  gap: 2px;
}
.credit-card-bound-search {
  display: flex;
  gap: 8px;
  align-items: center;
  min-width: min(100%, 520px);
}
.credit-card-bound-search input {
  min-width: 320px;
  height: 38px;
}
.credit-card-bound-table {
  min-width: 1180px;
}
.credit-card-bound-table-wrap {
  border-color: #e5eaf0;
}
.credit-card-bound-table th,
.credit-card-table th,
.credit-card-bill-table th {
  background: #f9fafb;
  color: #526071;
  font-size: 13px;
}
.credit-card-bound-table td,
.credit-card-table td,
.credit-card-bill-table td {
  padding-top: 11px;
  padding-bottom: 11px;
}
.credit-card-bound-table .actions {
  display: flex;
  flex-wrap: nowrap;
  gap: 6px;
  align-items: center;
}
.credit-card-bound-table .actions .inline {
  margin: 0;
}
.credit-card-bound-table .table-button {
  min-height: 32px;
  padding-inline: 9px;
}
.credit-card-bound-table .copy-card-button {
  background: #111827;
}
.credit-card-bound-pager {
  margin: 10px 0 0 0;
  border-radius: 8px;
  background: #f8fafc;
}
.credit-card-bound-pager > div {
  display: flex;
  gap: 8px;
  align-items: center;
}
.button.disabled {
  opacity: .45;
  pointer-events: none;
}
.credit-card-bill-table {
  min-width: 0;
}
.credit-card-difference-table {
  width: 100%;
  min-width: 0;
  table-layout: fixed;
  font-size: 13px;
}
.credit-card-difference-table th,
.credit-card-difference-table td {
  padding: 10px 8px;
  vertical-align: top;
}
.credit-card-difference-table th:nth-child(1),
.credit-card-difference-table td:nth-child(1) { width: 34px; }
.credit-card-difference-table th:nth-child(2),
.credit-card-difference-table td:nth-child(2) { width: 16%; }
.credit-card-difference-table th:nth-child(3),
.credit-card-difference-table td:nth-child(3) { width: 17%; }
.credit-card-difference-table th:nth-child(4),
.credit-card-difference-table td:nth-child(4) { width: 8%; }
.credit-card-difference-table th:nth-child(5),
.credit-card-difference-table td:nth-child(5) { width: 14%; }
.credit-card-difference-table th:nth-child(6),
.credit-card-difference-table td:nth-child(6) { width: 12%; }
.credit-card-difference-table th:nth-child(7),
.credit-card-difference-table td:nth-child(7) { width: 8%; }
.credit-card-difference-table th:nth-child(8),
.credit-card-difference-table td:nth-child(8) { width: 7%; }
.credit-card-difference-table th:nth-child(9),
.credit-card-difference-table td:nth-child(9) { width: 10%; }
.credit-card-consumption-cell {
  min-width: 0;
  white-space: normal;
}

.credit-card-account-cell strong,
.credit-card-account-cell small,
.credit-card-current-card-cell strong,
.credit-card-current-card-cell small,
.credit-card-time-cell strong,
.credit-card-time-cell small {
  display: block;
}
.credit-card-account-cell,
.credit-card-current-card-cell,
.credit-card-time-cell {
  overflow-wrap: anywhere;
}
.credit-card-current-card-cell .status {
  display: inline-flex;
  margin-top: 4px;
}
.credit-card-difference-table .status {
  white-space: nowrap;
}

.credit-card-cell-line {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  width: 100%;
  white-space: nowrap;
}
.credit-card-cell-tags {
  display: flex;
  align-items: center;
  gap: 6px;
  margin-top: 6px;
  white-space: nowrap;
}
.credit-card-calibrate-button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 44px;
  height: 26px;
  padding: 0;
  border: 1px solid #d6dee8;
  border-radius: 6px;
  background: #ffffff;
  color: #b91c1c;
  font-size: 13px;
  font-weight: 800;
  line-height: 1;
  cursor: pointer;
  white-space: nowrap;
}
.credit-card-calibrate-button:hover {
  border-color: #ef4444;
  background: #fff7f7;
}
.credit-card-plus-button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 26px;
  height: 26px;
  padding: 0;
  border: 1px solid #d6dee8;
  border-radius: 6px;
  background: #ffffff;
  color: #b91c1c;
  font-size: 18px;
  font-weight: 900;
  line-height: 1;
  cursor: pointer;
}
.credit-card-plus-button:hover {
  border-color: #ef4444;
  background: #fff7f7;
}
.credit-card-count-note {
  display: inline-flex;
}
.credit-card-warning-mark {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  color: #9a4f00;
  font-size: 12px;
  font-weight: 800;
  white-space: nowrap;
}
.credit-card-warning-mark span {
  position: relative;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 18px;
  height: 16px;
  color: #111827;
  font-size: 11px;
  font-weight: 900;
  line-height: 1;
  z-index: 0;
}
.credit-card-warning-mark span::before {
  content: "";
  position: absolute;
  inset: 0;
  z-index: -1;
  background: #facc15;
  clip-path: polygon(50% 0, 100% 100%, 0 100%);
}
.credit-card-warning-mark span::after {
  content: "";
  position: absolute;
  inset: 2px;
  z-index: -2;
  background: #111827;
  clip-path: polygon(50% 0, 100% 100%, 0 100%);
}
.credit-card-calibration-dialog {
  width: min(760px, calc(100vw - 32px));
  padding: 0;
  border: 0;
  border-radius: 8px;
  background: transparent;
  color: var(--text);
}
.credit-card-calibration-dialog::backdrop {
  background: rgba(15, 23, 42, 0.32);
}
.credit-card-calibration-dialog .credit-card-calibration-card {
  margin: 0;
}
.credit-card-calibration-card {
  padding: 16px;
  border: 1px solid #dbe4f0;
  border-radius: 8px;
  background: #ffffff;
  box-shadow: 0 22px 60px rgba(15, 23, 42, 0.22);
}
.credit-card-calibration-card-head,
.credit-card-calibration-footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
}
.credit-card-calibration-card-head strong {
  display: block;
  font-size: 16px;
}
.credit-card-calibration-card-head small {
  display: block;
  margin-top: 3px;
  color: var(--muted);
}
.credit-card-card-close,
.credit-card-line-remove {
  border: 0;
  background: transparent;
  color: var(--muted);
  font-size: 14px;
  font-weight: 800;
  cursor: pointer;
}
.credit-card-card-close {
  width: 28px;
  height: 28px;
  border-radius: 6px;
  font-size: 22px;
  line-height: 1;
}
.credit-card-card-close:hover,
.credit-card-line-remove:hover {
  background: #f3f4f6;
  color: var(--red);
}
.credit-card-calibration-grid {
  display: grid;
  grid-template-columns: minmax(160px, 220px) minmax(240px, 1fr);
  gap: 10px;
  margin: 14px 0;
}
.credit-card-calibration-grid label {
  display: flex;
  flex-direction: column;
  gap: 5px;
  margin: 0;
}
.credit-card-calibration-grid span {
  color: var(--muted);
  font-size: 12px;
  font-weight: 800;
}
.credit-card-spend-lines {
  display: grid;
  gap: 8px;
  margin: 14px 0;
  max-height: min(45vh, 360px);
  overflow: auto;
}
.credit-card-spend-line {
  display: grid;
  grid-template-columns: minmax(130px, 1.1fr) minmax(190px, 1.5fr) minmax(90px, .7fr) minmax(130px, 1fr) auto;
  gap: 8px;
  align-items: center;
  padding: 8px;
  border: 1px solid #e5e7eb;
  border-radius: 8px;
  background: #f9fafb;
}
.credit-card-spend-line input,
.credit-card-calibration-grid input {
  height: 34px;
}
.credit-card-calibration-footer {
  justify-content: flex-end;
  flex-wrap: wrap;
}
.credit-card-calibration-footer strong {
  margin-right: auto;
  color: var(--text);
}
.credit-card-calibration-actions {
  display: flex;
  align-items: center;
  gap: 6px;
  min-width: 230px;
}
.credit-card-calibration-form,
.credit-card-calibration-sync-form {
  display: flex;
  align-items: center;
  gap: 6px;
}
.credit-card-calibration-form input {
  width: 118px;
  height: 32px;
  min-width: 0;
}
.credit-card-adjust-tools {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  margin-top: 3px;
  flex-wrap: wrap;
}
.credit-card-inline-adjust {
  margin-top: 0;
}
.credit-card-inline-adjust summary {
  list-style: none;
}
.credit-card-inline-adjust summary::-webkit-details-marker {
  display: none;
}
.credit-card-adjust-trigger {
  display: inline-flex;
  align-items: center;
  gap: 3px;
  width: auto;
  min-height: 0;
  padding: 0;
  border: 0;
  background: transparent;
  color: var(--red);
  font-size: 12px;
  font-weight: 800;
  line-height: 1.2;
  cursor: pointer;
  user-select: none;
}
.credit-card-adjust-trigger::before {
  content: "▸";
  font-size: 10px;
  line-height: 1;
}
.credit-card-inline-adjust[open] .credit-card-adjust-trigger::before {
  content: "▾";
}
.credit-card-inline-adjust .credit-card-calibration-form {
  margin-top: 5px;
}
.credit-card-difference-warning {
  display: inline-flex;
  align-items: center;
  min-height: 18px;
  padding: 1px 6px;
  border-radius: 999px;
  background: #fff4d6;
  color: #9a4f00;
  font-size: 12px;
  font-weight: 800;
  line-height: 1.2;
  white-space: nowrap;
}
.table-button.compact {
  min-height: 32px;
  padding: 6px 12px;
  font-size: 13px;
  white-space: nowrap;
}
.credit-card-bill-toolbar {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  align-items: center;
  padding: 8px 10px;
  margin: 0 0 10px 0;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #f8fafc;
}
.credit-card-bill-toolbar div:first-child {
  display: grid;
  gap: 2px;
}
.credit-card-bill-actions {
  display: flex;
  justify-content: space-between;
  gap: 10px;
  align-items: center;
  margin: 0 0 10px 0;
  color: #64748b;
  font-size: 12px;
}
.credit-card-bill-actions strong {
  color: #1f2937;
  font-size: 13px;
}
.credit-card-bill-toolbar small,
.muted {
  color: #64748b;
  font-size: 12px;
}
.status.unknown {
  background: #f1f5f9;
  color: #475569;
}

.danger-zone {
  border-color: #fecaca;
  background: #fff7f7;
}
.metrics {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 12px;
}
.metrics div { padding: 16px; min-height: 90px; }
.metrics small { display: block; margin-bottom: 8px; }
.metrics strong { font-size: 27px; line-height: 1; }
.danger { color: #dc2626; }
.dashboard-metrics div,
.tg-metrics div {
  min-height: 82px;
}
.profit-dashboard {
  display: grid;
  gap: 14px;
}
.profit-periods {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 14px;
}
.profit-period {
  border: 1px solid var(--line-soft);
  border-radius: 8px;
  background: #fbfcfe;
  padding: 14px;
}
.profit-period-head {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 12px;
  margin-bottom: 12px;
}
.profit-period-head small,
.profit-grid small,
.profit-grid span {
  display: block;
  color: var(--muted);
  font-weight: 800;
}
.profit-period-head strong {
  display: block;
  margin-top: 6px;
  font-size: 30px;
  line-height: 1;
}
.profit-period-head > span {
  flex: 0 0 auto;
  padding: 6px 9px;
  border-radius: 999px;
  background: #eef4ff;
  color: #31506d;
  font-size: 12px;
  font-weight: 800;
}
.profit-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px;
}
.profit-grid div {
  min-height: 82px;
  border: 1px solid var(--line-soft);
  border-radius: 8px;
  background: #fff;
  padding: 10px;
}
.profit-grid strong {
  display: block;
  margin: 6px 0;
  font-size: 20px;
  line-height: 1.1;
}
.profit-grid span {
  font-size: 12px;
  line-height: 1.35;
}
.dashboard-band {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 18px;
  align-items: stretch;
}
.dashboard-focus {
  display: grid;
  grid-template-rows: auto 1fr;
}
.focus-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px;
}
.focus-grid div {
  border: 1px solid var(--line-soft);
  border-radius: 8px;
  background: #fbfcfe;
  padding: 12px;
  min-height: 78px;
}
.focus-grid small {
  display: block;
  margin-bottom: 7px;
  color: var(--muted);
}
.focus-grid strong {
  font-size: 24px;
  line-height: 1;
}
.compact-feed {
  display: grid;
  gap: 8px;
}
.compact-feed a,
.compact-feed div {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr);
  gap: 5px 10px;
  align-items: center;
  border: 1px solid var(--line-soft);
  border-radius: 8px;
  padding: 10px;
  color: var(--text);
  background: #fff;
}
.compact-feed a:hover {
  border-color: var(--brand);
  text-decoration: none;
}
.compact-feed strong,
.compact-feed small {
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.compact-feed small {
  grid-column: 2;
  color: var(--muted);
}
.compact-commands {
  grid-template-columns: repeat(2, minmax(0, 1fr));
}
.tool-page {
  min-height: 100vh;
  background: #f5f6f8;
  color: var(--text);
}
.tool-shell {
  width: min(100% - 32px, 1180px);
  margin: 0 auto;
  padding: 28px 0 40px;
  display: grid;
  gap: 18px;
}
.tool-head {
  min-height: 112px;
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 18px;
  padding: 22px 24px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
  box-shadow: 0 12px 32px rgba(15, 23, 42, .06);
}
.tool-head h1 {
  font-size: 34px;
  line-height: 1.08;
}
.tool-head p {
  margin-top: 8px;
  max-width: 620px;
}
.tool-panel {
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
  padding: 18px;
  box-shadow: 0 12px 32px rgba(15, 23, 42, .05);
}
.twofa-workbench {
  display: grid;
  grid-template-columns: minmax(0, 1.15fr) 220px minmax(0, .95fr);
  gap: 16px;
  align-items: stretch;
}
.tool-input,
.tool-output {
  display: grid;
  gap: 10px;
}
.tool-input label,
.tool-output h2 {
  color: var(--text);
  font-size: 15px;
  font-weight: 800;
}
.tool-input textarea,
.tool-output textarea {
  width: 100%;
  min-height: 220px;
  resize: vertical;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 12px;
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  font-size: 14px;
  line-height: 1.5;
}
.tool-actions,
.tool-output-head {
  display: flex;
  justify-content: space-between;
  gap: 10px;
  align-items: center;
}
.twofa-status {
  display: grid;
  gap: 12px;
}
.twofa-status div {
  border: 1px solid var(--line-soft);
  border-radius: 8px;
  background: #fbfcfe;
  padding: 16px;
  display: grid;
  align-content: center;
  min-height: 100px;
}
.twofa-status small {
  display: block;
  margin-bottom: 8px;
  font-weight: 800;
}
.twofa-status strong {
  font-size: 34px;
  line-height: 1;
}
.tool-note {
  min-height: 24px;
  font-size: 13px;
}
.layout-2 {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
  gap: 18px;
}
.quick-strip {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 12px;
}
.quick-strip a, .mini-list a, .count-grid a {
  background: #fff;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 14px;
  color: var(--text);
}
.quick-strip a:hover, .mini-list a:hover, .count-grid a:hover {
  border-color: var(--brand);
  text-decoration: none;
}
.quick-strip strong, .quick-strip span, .mini-list span, .mini-list strong {
  display: block;
}
.quick-strip span { margin-top: 6px; color: var(--muted); }
.mini-list { display: grid; gap: 8px; }
.mini-list a {
  display: flex;
  justify-content: space-between;
  gap: 10px;
}
.count-grid {
  display: grid;
  grid-template-columns: repeat(6, minmax(0, 1fr));
  gap: 10px;
}
.count-grid a strong {
  display: block;
  margin: 4px 0;
  font-size: 24px;
}
.filters {
  display: flex;
  gap: 8px;
  align-items: center;
}
.filters select { min-width: 150px; }
.kv {
  display: grid;
  grid-template-columns: 120px minmax(0, 1fr);
  gap: 10px;
  margin: 0 0 14px;
}
.kv dt { color: var(--muted); }
.kv dd { margin: 0; min-width: 0; }
.code-box {
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #f8fafc;
  padding: 12px;
  margin-bottom: 10px;
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
}
.ship-layout {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 320px;
  gap: 18px;
  align-items: start;
}
.ship-main {
  min-width: 0;
}
.ship-product-list {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 8px;
  margin-bottom: 18px;
}
.ship-product-option {
  display: grid;
  gap: 5px;
  min-height: 68px;
  padding: 10px 12px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
  color: var(--text);
  text-align: left;
  cursor: pointer;
}
.ship-product-option strong,
.ship-product-option span {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.ship-product-option span {
  color: var(--muted);
  font-size: 12px;
  font-weight: 700;
}
.ship-product-option.active {
  border-color: var(--brand);
  background: #fff5f5;
  box-shadow: inset 0 0 0 1px var(--brand);
}
.ship-stock-head {
  margin-top: 4px;
}
.manual-ship-form {
  display: grid;
  grid-template-columns: minmax(180px, 1.3fr) 90px minmax(180px, 1fr) repeat(2, minmax(150px, 1fr));
  gap: 10px;
  align-items: start;
}
.manual-ship-form > .client-search-picker {
  max-width: none;
  min-width: 0;
}
.field-with-help {
  position: relative;
  display: block;
  min-width: 0;
  width: 100%;
}
.field-with-help > span {
  display: block;
  margin-bottom: 6px;
}
.field-with-help input,
.field-with-help select,
.field-with-help textarea {
  display: block;
  padding-right: 44px;
}
.field-with-help .check-row {
  padding-right: 44px;
}
.field-help {
  position: absolute;
  right: 12px;
  top: 50%;
  transform: translateY(-50%);
  width: 20px;
  height: 20px;
  min-height: 0;
  padding: 0;
  border: 1px solid #cfd7e3;
  border-radius: 999px;
  background: #f8fafc;
  color: #586477;
  font-size: 12px;
  font-weight: 900;
  line-height: 18px;
  text-align: center;
  cursor: help;
  box-shadow: 0 0 0 3px #fff;
  z-index: 3;
}
.field-help:hover,
.field-help:focus,
.field-help.is-open {
  border-color: var(--brand);
  background: #fff5f5;
  color: var(--brand);
}
.field-help::after {
  content: attr(data-tip);
  position: absolute;
  right: -1px;
  top: calc(100% + 8px);
  width: max-content;
  max-width: min(320px, calc(100vw - 48px));
  padding: 8px 10px;
  border: 1px solid #e3e8f0;
  border-radius: 8px;
  background: #111827;
  color: #fff;
  box-shadow: 0 10px 24px rgba(15, 23, 42, 0.18);
  font-size: 12px;
  font-weight: 500;
  line-height: 1.45;
  text-align: left;
  white-space: normal;
  opacity: 0;
  visibility: hidden;
  pointer-events: none;
  z-index: 20;
}
.field-help::before {
  content: "";
  position: absolute;
  right: 5px;
  top: calc(100% + 3px);
  border: 6px solid transparent;
  border-bottom-color: #111827;
  opacity: 0;
  visibility: hidden;
  pointer-events: none;
  z-index: 21;
}
.field-help:hover::after,
.field-help:hover::before,
.field-help:focus::after,
.field-help:focus::before,
.field-help.is-open::after,
.field-help.is-open::before {
  opacity: 1;
  visibility: visible;
}
.field-with-label .field-help {
  top: auto;
  bottom: 9px;
  transform: none;
}
.client-settings-form .split > *,
.client-settings-form .field-with-help {
  min-width: 0;
}
.client-settings-form .field-with-help input,
.client-settings-form .field-with-help select {
  min-height: 38px;
  padding-right: 46px;
}
.client-settings-form .field-with-help .field-help {
  top: 9px;
  right: 12px;
  transform: none;
  display: inline-flex;
  flex: 0 0 20px;
  align-items: center;
  justify-content: center;
}
.textarea-field .field-help {
  top: auto;
  bottom: 10px;
  transform: none;
}
.manual-ship-form .textarea-field {
  grid-column: 1 / -1;
}
.manual-ship-form .textarea-field textarea {
  grid-column: 1 / -1;
  min-height: 120px;
  resize: vertical;
}
.compact-note-textarea {
  min-height: 46px;
  max-height: 130px;
  resize: vertical;
}
.manual-ship-form .manual-ship-submit {
  justify-self: start;
}
.ship-action-panel {
  position: sticky;
  top: 18px;
  display: grid;
  gap: 12px;
}
.ship-selected-count {
  display: flex;
  align-items: end;
  gap: 8px;
  padding: 12px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #f8fafc;
}
.ship-selected-count strong {
  font-size: 32px;
  line-height: 1;
  color: var(--brand);
}
.ship-selected-count span {
  color: var(--muted);
  font-weight: 700;
}
.ship-stock-list {
  display: grid;
  gap: 8px;
  max-height: 720px;
  overflow: auto;
  padding-right: 4px;
}
.ship-stock-row {
  display: grid;
  grid-template-columns: 30px 70px minmax(220px, 1fr) minmax(340px, 2fr) 58px max-content 72px;
  gap: 12px;
  align-items: center;
  min-height: 56px;
  padding: 10px 12px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
  cursor: pointer;
}
.ship-stock-row:has(input:checked) {
  border-color: var(--brand);
  background: #fff5f5;
}
.ship-check {
  position: relative;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 28px;
  height: 28px;
  cursor: pointer;
}
.ship-check input {
  position: absolute;
  opacity: 0;
  pointer-events: none;
}
.ship-check > span {
  width: 18px;
  height: 18px;
  border: 1.5px solid #cbd5e1;
  border-radius: 6px;
  background: #fff;
  box-shadow: inset 0 0 0 2px #fff;
  transition: border-color .16s ease, background .16s ease, box-shadow .16s ease;
}
.ship-stock-row:hover .ship-check > span {
  border-color: #94a3b8;
}
.ship-check input:focus-visible + span {
  outline: 2px solid rgba(220, 38, 38, .28);
  outline-offset: 2px;
}
.ship-check input:checked + span {
  border-color: var(--brand);
  background: var(--brand);
}
.ship-check input:checked + span::after {
  content: "";
  display: block;
  width: 8px;
  height: 4px;
  margin: 5px 0 0 4px;
  border-left: 2px solid #fff;
  border-bottom: 2px solid #fff;
  transform: rotate(-45deg);
}
.stock-row-id {
  color: var(--muted);
  font-weight: 800;
}
.stock-row-main {
  display: grid;
  gap: 3px;
  min-width: 0;
}
.stock-row-main strong,
.stock-row-main small {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.stock-row-main small {
  color: var(--muted);
}
.stock-row-badges {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 6px;
  min-width: 0;
  justify-content: flex-start;
}
.stock-row-meta,
.stock-row-recharge,
.stock-row-origin,
.stock-row-card,
.stock-row-price {
  justify-self: start;
  border-radius: 999px;
  padding: 4px 8px;
  background: #eef2f7;
  color: #344054;
  font-size: 12px;
  font-weight: 800;
  white-space: nowrap;
  line-height: 1.2;
}
.stock-row-badges:empty {
  display: block;
}
.stock-row-price {
  background: #fee2e2;
  color: #991b1b;
  justify-self: end;
}
.stock-row-recharge {
  background: #dcfce7;
  color: #166534;
}
.stock-row-origin {
  background: #e0e7ff;
  color: #3730a3;
}
.stock-row-card {
  background: #f1f5f9;
  color: #475569;
}
.stock-row-card.status-card {
  background: #fef3c7;
  color: #92400e;
}
.hint-box {
  margin-top: 12px;
  border: 1px solid #fde68a;
  background: #fffbeb;
  color: #713f12;
  border-radius: 8px;
  padding: 12px;
  display: grid;
  gap: 6px;
}
.hint-box code {
  background: #fff7d6;
  border-color: #f5d76e;
}
.command-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 12px;
}
.command-grid div {
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 12px;
  background: #fbfcfe;
}
.command-grid strong, .command-grid code {
  display: block;
  margin-top: 6px;
}
.empty-state {
  border: 1px dashed #c9d2df;
  border-radius: 8px;
  padding: 22px;
  text-align: center;
  color: var(--muted);
  background: #fff;
}
.login {
  min-height: 100vh;
  display: grid;
  place-items: center;
  padding: 18px;
}
.login-panel {
  width: min(420px, calc(100vw - 32px));
  background: #fff;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 28px;
}
.form-error {
  color: var(--red);
  font-weight: 700;
  font-size: 13px;
}
.compact-form {
  display: grid;
  grid-template-columns: repeat(5, minmax(0, 1fr));
  gap: 12px;
  align-items: end;
}
.compact-form label {
  display: grid;
  gap: 6px;
  font-size: 13px;
  font-weight: 700;
}
.grid.two {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
  gap: 18px;
}
.template-board {
  display: grid;
  gap: 14px;
}
.template-editor {
  border: 1px solid var(--line-soft);
  border-radius: 8px;
  background: var(--surface-soft);
  padding: 14px;
  display: grid;
  grid-template-columns: minmax(0, 1.2fr) minmax(280px, .8fr);
  gap: 14px;
  align-items: stretch;
}
.template-heading {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 12px;
  margin-bottom: 10px;
}
.template-heading h3 {
  margin: 0 0 4px;
  font-size: 17px;
}
.template-heading p, #message-templates .section-head p {
  margin: 0;
  color: var(--muted);
  font-size: 13px;
}
.template-editor textarea {
  min-height: 168px;
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  font-size: 13px;
}
.template-actions {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  align-items: flex-start;
}
.tag-list {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}
.tag-chip {
  min-height: 28px;
  padding: 4px 8px;
  background: #fff;
  border: 1px solid #dce3ec;
  border-radius: 6px;
  color: #4b5565;
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  font-size: 12px;
  font-weight: 800;
}
.tag-chip:hover {
  background: #fff5f5;
  border-color: #f0b3b7;
  color: var(--brand-dark);
}
.template-preview {
  border: 1px solid #dce3ec;
  border-radius: 8px;
  background: #fff;
  padding: 12px;
  display: grid;
  grid-template-rows: auto minmax(0, 1fr);
  gap: 8px;
}
.template-preview span {
  color: var(--muted);
  font-size: 12px;
  font-weight: 800;
}
.template-preview pre {
  margin: 0;
  white-space: pre-wrap;
  word-break: break-word;
  font: 13px/1.45 ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  color: #202938;
}
.small {
  min-height: 32px;
  padding: 6px 10px;
  font-size: 13px;
}
@media (max-width: 1280px) {
  .category-grid, .product-board { grid-template-columns: 1fr; }
  .manager-layout { grid-template-columns: 320px minmax(0, 1fr); }
  .count-grid { grid-template-columns: repeat(3, minmax(0, 1fr)); }
}
@media (max-width: 1100px) {
  .twofa-workbench {
    grid-template-columns: 1fr;
  }
  .twofa-status {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
  .metrics, .profit-periods { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .layout-2, .quick-strip, .command-grid, .dashboard-band, .manager-layout, .inventory-tools, .ship-layout, .grid.two, .template-editor {
    grid-template-columns: 1fr;
  }
  .historical-import-mini {
    width: 100%;
  }
  .historical-import-mini .mini-controls {
    grid-template-columns: minmax(160px, 1fr) auto;
  }
  .historical-upload-form {
    grid-column: 1 / -1;
  }
  .ship-product-list { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .manual-ship-form { grid-template-columns: 1fr 100px; }
  .manual-ship-form > input,
  .manual-ship-form > select,
  .manual-ship-form > .client-search-picker,
  .manual-ship-form > .field-with-help,
  .manual-ship-form .manual-ship-submit {
    grid-column: 1 / -1;
  }
  .ship-action-panel { position: static; order: -1; }
  .create-panel { position: static; }
  .inline-form { grid-template-columns: 1fr 1fr; }
  .catalog-form, .catalog-form.refined { grid-template-columns: 1fr 1fr; }
  .inventory-upload-form { grid-template-columns: 1fr; }
  .activity-filter-form { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .span-2, .span-3 { grid-column: span 1; }
}
@media (max-width: 760px) {
  h1 { font-size: 24px; }
  .profit-periods,
  .profit-grid {
    grid-template-columns: 1fr;
  }
  .tool-shell {
    width: min(100% - 20px, 1180px);
    padding-top: 12px;
  }
  .tool-head {
    display: grid;
    padding: 18px;
  }
  .tool-head h1 {
    font-size: 28px;
  }
  .twofa-status {
    grid-template-columns: 1fr;
  }
  .tool-actions,
  .tool-output-head {
    align-items: stretch;
    flex-direction: column;
  }
  .tool-actions button,
  .tool-output-head button,
  .tool-head .button {
    width: 100%;
  }
  .credit-card-calibration-grid,
  .credit-card-spend-line {
    grid-template-columns: 1fr;
  }
  .credit-card-calibration-card-head,
  .credit-card-calibration-footer {
    align-items: stretch;
    flex-direction: column;
  }
  .credit-card-calibration-footer strong {
    margin-right: 0;
  }
  .sidebar {
    position: static;
    width: auto;
    min-height: auto;
  }
  .nav { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .nav-group {
    grid-column: 1 / -1;
  }
  .nav-group a { margin-left: 12px; }
  .app-shell { margin-left: 0; padding: 16px; }
  .page-head { display: grid; min-height: 0; }
  .page-actions { justify-content: flex-start; }
  .historical-import-mini .mini-controls {
    grid-template-columns: 1fr auto;
  }
  .historical-import-mini input[type="file"] {
    width: 100%;
  }
  .metrics, .split, .card-metrics, .stock-summary, .form-grid, .compact-grid, .count-grid {
    grid-template-columns: 1fr;
  }
  .filters { flex-direction: column; align-items: stretch; }
  .wide-inline { min-width: 420px; }
  .inline-form, .catalog-form, .catalog-form.refined, .activity-filter-form, .compact-form { grid-template-columns: 1fr; }
  .ship-product-list { grid-template-columns: 1fr; }
  .manual-ship-form { grid-template-columns: 1fr; }
  .manual-ship-form > input,
  .manual-ship-form > select,
  .manual-ship-form > .client-search-picker,
  .manual-ship-form > .field-with-help,
  .manual-ship-form .manual-ship-submit {
    grid-column: 1 / -1;
  }
  .ship-stock-list { max-height: none; }
  .ship-stock-row {
    grid-template-columns: 30px 58px minmax(0, 1fr) 64px;
    min-height: 70px;
  }
  .stock-row-badges {
    grid-column: 3 / 4;
  }
  .stock-row-catalog { display: none; }
  .stock-row-recharge,
  .stock-row-origin,
  .stock-row-card {
    grid-column: 3 / 4;
    justify-self: start;
  }
  .stock-row-price { justify-self: end; }
  .workflow-tabs { overflow-x: auto; }
  .workflow-tabs a { white-space: nowrap; }
  .clear-return-panel .table-wrap {
    border: 0;
    background: transparent;
    overflow: visible;
  }
  .clear-return-table {
    min-width: 0;
    display: block;
    width: 100%;
    border-collapse: separate;
  }
  .clear-return-table thead {
    display: none;
  }
  .clear-return-table tbody {
    display: grid;
    gap: 12px;
  }
  .clear-return-table tr {
    display: grid;
    gap: 8px;
    padding: 12px;
    background: #fff;
    border: 1px solid var(--line);
    border-radius: 8px;
  }
  .clear-return-table td {
    display: grid;
    grid-template-columns: 92px minmax(0, 1fr);
    gap: 8px;
    align-items: center;
    padding: 0;
    border: 0;
  }
  .clear-return-table td::before {
    color: var(--muted);
    font-size: 12px;
    font-weight: 800;
  }
  .clear-return-entry-table td:nth-child(1)::before,
  .clear-completed-table td:nth-child(1)::before { content: "客户"; }
  .clear-return-entry-table td:nth-child(2)::before,
  .clear-completed-table td:nth-child(2)::before { content: "绑定群"; }
  .clear-return-entry-table td:nth-child(3)::before,
  .clear-completed-table td:nth-child(3)::before { content: "户名"; }
  .clear-return-entry-table td:nth-child(4)::before,
  .clear-completed-table td:nth-child(4)::before { content: "广告账户"; }
  .clear-return-entry-table td:nth-child(5)::before,
  .clear-completed-table td:nth-child(5)::before { content: "标签"; }
  .clear-return-entry-table td:nth-child(6)::before { content: "状态"; }
  .clear-return-entry-table td:nth-child(7)::before,
  .clear-completed-table td:nth-child(7)::before { content: "清零时间"; }
  .clear-return-entry-table td:nth-child(8)::before { content: "最近回填"; }
  .clear-return-entry-table td:nth-child(9)::before,
  .clear-completed-table td:nth-child(6)::before { content: "清零余额"; }
  .clear-return-entry-table td:nth-child(10)::before { content: "总充值"; }
  .clear-return-entry-table td:nth-child(11)::before { content: "总消耗"; }
  .clear-completed-table td:nth-child(8)::before { content: "回填时间"; }
  .clear-return-table input[name^="returned_balance_"],
  .clear-return-table input[name^="cumulative_recharge_"],
  .clear-return-table input[name^="total_spend_"] {
    width: 100%;
  }
.bulk-return-actions {
    display: grid;
    justify-content: stretch;
  }
  .bulk-return-submit {
    display: grid;
    justify-content: stretch;
    margin-left: 0;
  }
}

.statement-page {
  background: var(--statement-bg);
  color: var(--statement-text);
  --statement-bg: #f3f5f8;
  --statement-surface: #ffffff;
  --statement-soft: #f8fafc;
  --statement-soft-2: #f4f7fb;
  --statement-border: #dbe3ee;
  --statement-border-strong: #d7dee8;
  --statement-text: #111827;
  --statement-muted: #647084;
  --statement-chip-bg: #edf4ff;
  --statement-chip-text: #1d4ed8;
  --statement-active-bg: #eef4fb;
  --statement-active-border: #9ec5ff;
  --statement-hover: #f8fbff;
  --statement-hero-bg: linear-gradient(135deg, #ffffff 0%, #f8fafc 68%, #eef6ff 100%);
  --statement-shadow: 0 8px 22px rgba(15, 23, 42, .045);
  --statement-hero-shadow: 0 12px 32px rgba(15, 23, 42, .07);
  --statement-balance-bg: #f0f7ff;
  --statement-negative-bg: #fff5f5;
  --statement-negative-border: #f8b4b4;
}
.statement-page[data-statement-theme="dark"] {
  color-scheme: dark;
  --statement-bg: #141922;
  --statement-surface: #202733;
  --statement-soft: #18212d;
  --statement-soft-2: #263241;
  --statement-border: #384658;
  --statement-border-strong: #46576d;
  --statement-text: #f3f7fb;
  --statement-muted: #b3bfcc;
  --statement-chip-bg: #203955;
  --statement-chip-text: #b7d6ff;
  --statement-active-bg: #233954;
  --statement-active-border: #6aa7f8;
  --statement-hover: #26313f;
  --statement-hero-bg: linear-gradient(135deg, #202733 0%, #1a2431 58%, #243a54 100%);
  --statement-shadow: 0 10px 28px rgba(0, 0, 0, .24);
  --statement-hero-shadow: 0 16px 40px rgba(0, 0, 0, .26);
  --statement-balance-bg: #1d3148;
  --statement-negative-bg: #3a2129;
  --statement-negative-border: #b65a65;
}
.statement-page[data-statement-theme="midnight"] {
  color-scheme: dark;
  --statement-bg: #070a12;
  --statement-surface: #101722;
  --statement-soft: #0c121d;
  --statement-soft-2: #162131;
  --statement-border: #253247;
  --statement-border-strong: #33445d;
  --statement-text: #f5f8fc;
  --statement-muted: #a7b4c5;
  --statement-chip-bg: #162945;
  --statement-chip-text: #c7ddff;
  --statement-active-bg: #1a2c48;
  --statement-active-border: #4d8df2;
  --statement-hover: #162031;
  --statement-hero-bg: linear-gradient(135deg, #101722 0%, #0e1622 58%, #192b46 100%);
  --statement-shadow: 0 12px 34px rgba(0, 0, 0, .34);
  --statement-hero-shadow: 0 18px 48px rgba(0, 0, 0, .38);
  --statement-balance-bg: #122744;
  --statement-negative-bg: #301b24;
  --statement-negative-border: #984654;
}
.statement-shell {
  width: min(1480px, calc(100% - 36px));
  margin: 0 auto;
  padding: 24px 0 44px;
  display: grid;
  gap: 16px;
}
.statement-hero {
  display: flex;
  justify-content: space-between;
  align-items: stretch;
  gap: 18px;
  padding: 22px 24px;
  border: 1px solid var(--statement-border-strong);
  border-radius: 8px;
  background: var(--statement-hero-bg);
  box-shadow: var(--statement-hero-shadow);
}
.statement-title {
  display: grid;
  align-content: center;
  gap: 7px;
  min-width: 0;
}
.statement-hero .eyebrow {
  margin: 0;
}
.statement-hero h1 {
  font-size: 34px;
  line-height: 1.08;
}
.statement-hero p {
  font-size: 14px;
}
.statement-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}
.statement-meta span,
.statement-result-count {
  display: inline-flex;
  align-items: center;
  min-height: 28px;
  padding: 5px 9px;
  border: 1px solid var(--statement-border);
  border-radius: 7px;
  background: var(--statement-soft);
  color: var(--statement-muted);
  font-size: 12px;
  font-weight: 800;
}
.statement-actions {
  display: flex;
  flex-wrap: wrap;
  justify-content: flex-end;
  align-content: flex-start;
  gap: 8px;
  min-width: max-content;
}
.statement-tool-links {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 4px;
  border: 1px solid var(--statement-border);
  border-radius: 8px;
  background: var(--statement-soft);
}
.statement-tool-links span,
.statement-tool-links a {
  min-height: 30px;
  padding: 6px 9px;
  border-radius: 6px;
  color: var(--statement-muted);
  font-size: 12px;
  font-weight: 800;
  line-height: 1.2;
}
.statement-tool-links span {
  color: var(--statement-muted);
}
.statement-tool-links a {
  background: var(--statement-active-bg);
  color: var(--statement-text);
  box-shadow: inset 0 0 0 1px var(--statement-active-border);
}
.statement-tool-links a:hover {
  text-decoration: none;
}
.statement-theme-switch {
  display: inline-flex;
  gap: 4px;
  padding: 4px;
  border: 1px solid var(--statement-border);
  border-radius: 8px;
  background: var(--statement-soft);
}
.statement-theme-switch button {
  min-height: 30px;
  padding: 6px 9px;
  border-radius: 6px;
  background: transparent;
  color: var(--statement-muted);
  font-size: 12px;
}
.statement-theme-switch button.is-active {
  background: var(--statement-active-bg);
  color: var(--statement-text);
  box-shadow: inset 0 0 0 1px var(--statement-active-border);
}
.statement-page input,
.statement-page select,
.statement-page textarea {
  background: var(--statement-soft);
  border-color: var(--statement-border);
  color: var(--statement-text);
}
.statement-page code {
  background: var(--statement-soft);
  border-color: var(--statement-border);
  color: var(--statement-text);
}
.statement-page .button {
  background: var(--statement-text);
  color: var(--statement-surface);
}
.statement-page[data-statement-theme="dark"] .button,
.statement-page[data-statement-theme="midnight"] .button {
  background: #e5edf7;
  color: #0b1220;
}
.statement-page .field-help {
  background: var(--statement-soft);
  border-color: var(--statement-border);
  color: var(--statement-muted);
}
.statement-page .danger {
  color: #ef4444;
}
.migration-pill {
  position: relative;
  display: inline-flex;
  align-items: center;
  min-height: 22px;
  margin-left: 6px;
  padding: 0 7px;
  border: 1px solid #bfdbfe;
  border-radius: 999px;
  background: #eff6ff;
  color: #1d4ed8;
  font-size: 12px;
  font-weight: 900;
  line-height: 1;
  vertical-align: middle;
  cursor: help;
  white-space: nowrap;
}
.migration-pill::after {
  content: attr(data-tip);
  position: absolute;
  left: 0;
  bottom: calc(100% + 8px);
  width: max-content;
  max-width: min(320px, calc(100vw - 48px));
  padding: 8px 10px;
  border: 1px solid #e3e8f0;
  border-radius: 8px;
  background: #111827;
  color: #fff;
  box-shadow: 0 10px 24px rgba(15, 23, 42, 0.18);
  font-size: 12px;
  font-weight: 600;
  line-height: 1.45;
  text-align: left;
  white-space: normal;
  opacity: 0;
  visibility: hidden;
  pointer-events: none;
  z-index: 40;
}
.migration-pill::before {
  content: "";
  position: absolute;
  left: 12px;
  bottom: calc(100% + 3px);
  border: 6px solid transparent;
  border-top-color: #111827;
  opacity: 0;
  visibility: hidden;
  pointer-events: none;
  z-index: 41;
}
.migration-pill:hover::after,
.migration-pill:hover::before,
.migration-pill:focus::after,
.migration-pill:focus::before {
  opacity: 1;
  visibility: visible;
}
.statement-page[data-statement-theme="dark"] .migration-pill,
.statement-page[data-statement-theme="midnight"] .migration-pill {
  border-color: rgba(96, 165, 250, 0.45);
  background: rgba(37, 99, 235, 0.18);
  color: #bfdbfe;
}
.statement-summary {
  display: grid;
  grid-template-columns: minmax(260px, 1.25fr) repeat(3, minmax(190px, 1fr));
  gap: 10px;
}
.statement-summary > div {
  min-height: 102px;
  padding: 15px;
  border: 1px solid var(--statement-border);
  border-radius: 8px;
  background: var(--statement-surface);
  display: grid;
  align-content: space-between;
  gap: 8px;
  box-shadow: var(--statement-shadow);
}

.statement-summary small {
  display: flex;
  align-items: center;
  gap: 5px;
  flex-wrap: wrap;
  line-height: 1.25;
  color: var(--statement-muted);
  font-weight: 800;
}
.statement-summary strong {
  font-size: 23px;
  line-height: 1;
  color: var(--statement-text);
}
.statement-balance {
  position: relative;
  background: var(--statement-balance-bg) !important;
  border-color: var(--statement-active-border) !important;
}
.statement-balance.is-negative {
  background: var(--statement-negative-bg) !important;
  border-color: var(--statement-negative-border) !important;
}
.statement-balance strong {
  font-size: 36px;
}
.statement-balance span {
  color: var(--statement-muted);
  font-size: 12px;
  font-weight: 800;
}
.statement-checkout-form {
  position: absolute;
  top: 14px;
  right: 14px;
  margin: 0;
}
.statement-checkout-form button {
  min-height: 30px;
  padding: 6px 12px;
  border-radius: 7px;
  font-size: 12px;
  line-height: 1;
}
.statement-summary .field-help {
  position: relative;
  right: auto;
  top: auto;
  transform: none;
  flex: 0 0 auto;
}
.statement-summary .field-help::after {
  right: auto;
  left: -8px;
}
.statement-summary .field-help::before {
  right: auto;
  left: 4px;
}
.statement-formula {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 10px;
  padding: 12px;
  border: 1px solid var(--statement-border);
  border-radius: 8px;
  background: var(--statement-surface);
  box-shadow: var(--statement-shadow);
}
.statement-formula div {
  min-width: 0;
  display: grid;
  gap: 5px;
  padding: 10px 12px;
  border: 1px solid var(--statement-border);
  border-radius: 7px;
  background: var(--statement-soft);
}
.statement-formula span {
  color: var(--statement-muted);
  font-size: 12px;
  font-weight: 800;
}
.statement-formula strong {
  color: var(--statement-text);
  font-size: 14px;
  line-height: 1.35;
  word-break: break-word;
}
.statement-tabs {
  position: sticky;
  top: 0;
  z-index: 5;
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  padding: 8px;
  border: 1px solid var(--statement-border);
  border-radius: 8px;
  background: var(--statement-surface);
  box-shadow: var(--statement-shadow);
}
.statement-tabs a {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  min-height: 34px;
  padding: 8px 12px;
  border-radius: 7px;
  color: var(--statement-muted);
  font-size: 13px;
  font-weight: 800;
  white-space: nowrap;
}
.statement-tabs a:hover,
.statement-tabs a.is-active {
  background: var(--statement-active-bg);
  color: var(--statement-text);
  text-decoration: none;
}
.statement-tabs a.is-active {
  box-shadow: inset 0 0 0 1px var(--statement-active-border);
}
.statement-tabs [data-nav-count] {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 22px;
  height: 22px;
  padding: 0 6px;
  border-radius: 999px;
  background: var(--statement-soft-2);
  color: var(--statement-muted);
  font-size: 11px;
  line-height: 1;
}
.statement-tabs a.is-active [data-nav-count] {
  background: var(--statement-active-bg);
  color: var(--statement-chip-text);
}
.statement-filter-bar {
  display: grid;
  grid-template-columns: minmax(360px, 1fr) minmax(440px, .95fr);
  gap: 8px;
  align-items: center;
  padding: 10px;
  border: 1px solid var(--statement-border);
  border-radius: 8px;
  background: var(--statement-surface);
  box-shadow: var(--statement-shadow);
}
.statement-range-buttons {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  align-items: center;
}
.statement-sort-buttons {
  display: inline-flex;
  gap: 4px;
  padding: 3px;
  border: 1px solid var(--statement-border);
  border-radius: 8px;
  background: var(--statement-soft);
}
.statement-range-buttons a {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 32px;
  padding: 7px 10px;
  border: 1px solid var(--statement-border);
  border-radius: 7px;
  background: var(--statement-soft);
  color: var(--statement-muted);
  font-size: 13px;
  font-weight: 800;
  white-space: nowrap;
}
.statement-sort-buttons a {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 30px;
  min-width: 30px;
  height: 30px;
  min-height: 30px;
  padding: 0;
  border-radius: 6px;
  color: var(--statement-muted);
  font-size: 15px;
  font-weight: 900;
  line-height: 1;
}
.statement-sort-buttons a:hover,
.statement-sort-buttons a.is-active,
.statement-range-buttons a:hover,
.statement-range-buttons a.is-active {
  background: var(--statement-active-bg);
  color: var(--statement-text);
  text-decoration: none;
  box-shadow: inset 0 0 0 1px var(--statement-active-border);
}
.statement-date-form {
  display: grid;
  grid-template-columns: minmax(120px, 1fr) minmax(120px, 1fr) auto;
  gap: 6px;
  align-items: end;
}
.statement-date-form label {
  gap: 4px;
}
.statement-date-actions {
  display: flex;
  gap: 6px;
  align-items: end;
  justify-content: flex-end;
}
.statement-date-form label span {
  color: var(--statement-muted);
  font-size: 11px;
  font-weight: 800;
}
.statement-date-form input,
.statement-date-form button {
  min-height: 32px;
  padding: 6px 9px;
  font-size: 13px;
}
.statement-filter-note {
  grid-column: 1 / -1;
  color: var(--statement-muted);
  font-size: 12px;
  font-weight: 700;
}
.statement-tools {
  display: grid;
  grid-template-columns: minmax(320px, 1fr) auto;
  gap: 10px;
  align-items: end;
  padding: 12px;
  border: 1px solid var(--statement-border);
  border-radius: 8px;
  background: var(--statement-surface);
  box-shadow: var(--statement-shadow);
}
.statement-tools label {
  display: grid;
  gap: 5px;
}
.statement-tools label span {
  color: var(--statement-muted);
  font-size: 12px;
  font-weight: 800;
}
.statement-result-count {
  min-height: 38px;
  justify-content: center;
  gap: 5px;
  background: var(--statement-soft);
}
.statement-result-count strong {
  color: var(--statement-text);
}
.statement-section {
  padding: 16px;
  border: 1px solid var(--statement-border);
  border-radius: 8px;
  background: var(--statement-surface);
  box-shadow: var(--statement-shadow);
}
.statement-table-wrap {
  max-height: none;
  overflow: visible;
  border-color: var(--statement-border);
  border-radius: 8px;
  background: var(--statement-surface);
}
.statement-table {
  width: 100%;
  min-width: 0;
  border-collapse: separate;
  border-spacing: 0;
}
.statement-table th,
.statement-table td {
  border-bottom-color: var(--statement-border);
}
.statement-table th {
  position: sticky;
  top: 0;
  z-index: 1;
  background: var(--statement-soft-2);
  color: var(--statement-muted);
  font-size: 12px;
}
.statement-table td {
  vertical-align: middle;
  color: var(--statement-text);
  white-space: normal;
  overflow-wrap: anywhere;
}
.statement-table tbody tr {
  background: var(--statement-surface);
}
.statement-table tbody tr:hover {
  background: var(--statement-hover);
}
.statement-chip {
  display: inline-flex;
  align-items: center;
  min-height: 26px;
  padding: 4px 9px;
  border-radius: 999px;
  background: var(--statement-chip-bg);
  color: var(--statement-chip-text);
  font-size: 12px;
  font-weight: 800;
  white-space: nowrap;
}
.statement-table tr[hidden] {
  display: none;
}
.statement-section[hidden] {
  display: none;
}
.segmented {
  display: inline-flex;
  gap: 4px;
  width: fit-content;
  padding: 4px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #eef3f8;
}
.segmented label {
  display: block;
  margin: 0;
}
.segmented input {
  position: absolute;
  opacity: 0;
  pointer-events: none;
}
.segmented span {
  display: inline-flex;
  min-height: 34px;
  align-items: center;
  justify-content: center;
  padding: 0 14px;
  border: 1px solid transparent;
  border-radius: 6px;
  background: #fff;
  color: #586477;
  font-weight: 800;
  cursor: pointer;
}
.segmented input:checked + span {
  border-color: var(--brand);
  background: var(--brand);
  color: #fff;
  box-shadow: 0 6px 16px rgba(215, 25, 32, .18);
}
@media (max-width: 980px) {
  .credit-card-upload-strip {
    align-items: stretch;
  }
  .credit-card-upload-left,
  .credit-card-upload-right {
    width: 100%;
  }
  .credit-card-selection-count,
  .credit-card-upload-strip input[type="file"],
  .credit-card-upload-strip .button,
  .credit-card-upload-strip button {
    width: 100%;
  }
  .statement-shell {
    width: min(100% - 20px, 1440px);
    padding-top: 12px;
  }
  .statement-hero {
    display: grid;
    padding: 18px;
  }
  .statement-actions {
    justify-content: flex-start;
    min-width: 0;
  }
  .statement-tool-links {
    flex-wrap: wrap;
  }
  .statement-summary {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
  .statement-balance {
    grid-column: 1 / -1;
  }
  .statement-filter-bar {
    grid-template-columns: 1fr;
  }
  .statement-date-actions {
    justify-content: flex-start;
  }
  .statement-tools {
    grid-template-columns: 1fr;
  }
  .statement-formula {
    grid-template-columns: 1fr;
  }
  .statement-result-count {
    justify-content: flex-start;
  }
}
@media (max-width: 560px) {
  .confirm-summary {
    grid-template-columns: 1fr;
  }
  .statement-summary {
    grid-template-columns: 1fr;
  }
  .statement-date-form {
    grid-template-columns: 1fr;
  }
  .statement-date-actions {
    justify-content: stretch;
  }
  .statement-date-actions button {
    flex: 1;
  }
}

.shipment-orders-wrap {
  overflow-x: hidden;
}

.shipment-orders-table {
  table-layout: fixed;
  width: 100%;
}

.shipment-orders-table th,
.shipment-orders-table td {
  vertical-align: top;
}

.shipment-orders-table small {
  display: block;
  margin-top: 3px;
}

.shipment-orders-table code {
  background: transparent;
  padding: 0;
  color: inherit;
  font-family: inherit;
}

.shipment-orders-table .cell-clip {
  display: block;
  max-width: 100%;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.shipment-orders-table .cell-clip-2 {
  display: -webkit-box;
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 2;
  line-height: 1.35;
  white-space: normal;
}

.shipment-cancel-button {
  margin-top: 6px;
  padding: 4px 10px;
  min-height: 26px;
}

.ship-col-order { width: 15%; }
.ship-col-mode { width: 5%; }
.ship-col-client { width: 7%; }
.ship-col-amount { width: 6%; }
.ship-col-product { width: 20%; }
.ship-col-type { width: 6%; }
.ship-col-identifier { width: 10%; }
.ship-col-snapshot { width: 17%; }
.ship-col-source { width: 8%; }
.ship-col-time { width: 6%; }

.profit-analytics-head {
  align-items: flex-start;
  gap: 16px;
}

.profit-filter {
  display: flex;
  flex-wrap: wrap;
  justify-content: flex-end;
  align-items: center;
  gap: 8px;
  min-width: 420px;
}

.profit-quick-buttons {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}

.profit-quick-buttons a,
.profit-filter button {
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 7px 10px;
  background: #fff;
  color: var(--muted);
  font-size: 12px;
  font-weight: 700;
}

.profit-quick-buttons a.active,
.profit-quick-buttons a:hover,
.profit-filter button {
  background: #111827;
  border-color: #111827;
  color: #fff;
}

.profit-filter label {
  display: grid;
  gap: 3px;
  color: var(--muted);
  font-size: 11px;
  font-weight: 700;
}

.profit-filter input {
  width: 134px;
  height: 34px;
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 0 9px;
  color: var(--text);
}

.profit-summary-row {
  display: grid;
  grid-template-columns: 1.25fr repeat(5, minmax(0, 1fr));
  gap: 10px;
  margin-top: 16px;
}

.profit-summary-row > div {
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 13px;
  min-height: 88px;
  background: #fff;
}

.profit-summary-row small,
.profit-summary-row span,
.profit-chart-title span,
.profit-chart-title small,
.profit-daily-list small {
  color: var(--muted);
  font-size: 12px;
}

.profit-summary-row strong {
  display: block;
  margin: 5px 0 3px;
  font-size: 22px;
}

.profit-total-card strong {
  font-size: 30px;
}

.profit-chart-layout {
  display: grid;
  grid-template-columns: minmax(0, 1.7fr) minmax(280px, 0.8fr);
  gap: 14px;
  margin-top: 14px;
}

.profit-chart-card,
.profit-daily-card {
  border: 1px solid var(--border);
  border-radius: 8px;
  background: #fff;
  padding: 14px;
}

.profit-chart-title {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 12px;
  margin-bottom: 10px;
}

.profit-chart-title strong,
.profit-chart-title span {
  display: block;
}

.profit-kline {
  width: 100%;
  height: 280px;
  display: block;
  background: linear-gradient(180deg, #f8fafc, #fff);
  border-radius: 8px;
}

.profit-kline .grid-line {
  stroke: #e5e7eb;
  stroke-width: 1;
}

.profit-kline .zero-line {
  stroke: #94a3b8;
  stroke-width: 1.3;
  stroke-dasharray: 5 5;
}

.profit-kline g.up line,
.profit-kline g.up rect {
  stroke: #16a34a;
  fill: #22c55e;
}

.profit-kline g.down line,
.profit-kline g.down rect {
  stroke: #dc2626;
  fill: #ef4444;
}

.profit-kline g line {
  stroke-width: 1.5;
}

.profit-chart-axis {
  display: flex;
  justify-content: space-between;
  color: var(--muted);
  font-size: 12px;
  margin-top: 6px;
}

.profit-daily-list {
  display: grid;
  gap: 8px;
  max-height: 300px;
  overflow: auto;
  padding-right: 4px;
}

.profit-daily-list > div {
  display: grid;
  grid-template-columns: 54px 90px minmax(0, 1fr);
  gap: 8px;
  align-items: center;
  padding: 8px 0;
  border-bottom: 1px solid var(--border);
}

.profit-daily-list strong,
.profit-daily-list small {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.inventory-upload-form .field-with-help input,
.inventory-upload-form .field-with-help textarea {
  padding-right: 52px;
}

.inventory-upload-form .field-with-label .field-help {
  right: 14px;
  width: 20px;
  height: 20px;
  min-height: 0;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  line-height: 1;
  box-sizing: border-box;
}

.inventory-upload-form label:not(.textarea-field) .field-help {
  top: auto;
  bottom: 10px;
  transform: none;
}

.inventory-upload-form .textarea-field .field-help {
  top: auto;
  bottom: 12px;
  transform: none;
}



.profit-kline .profit-line {
  fill: none;
  stroke: #2563eb;
  stroke-width: 2.2;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.profit-kline g.up circle {
  fill: #16a34a;
  stroke: #fff;
  stroke-width: 1.5;
}

.profit-kline g.down circle {
  fill: #dc2626;
  stroke: #fff;
  stroke-width: 1.5;
}
