:root {
  color-scheme: light;
  --bg: #f4f6f8;
  --panel: #ffffff;
  --ink: #17202a;
  --muted: #667085;
  --line: #d7dde5;
  --line-soft: #e8edf3;
  --primary: #0f766e;
  --primary-dark: #0b5f59;
  --primary-soft: #e7f5f2;
  --danger: #b42318;
  --danger-soft: #fff1f0;
  --warning: #a15c07;
  --warning-soft: #fff7e6;
  --nav: #1f2a37;
  --shadow: 0 14px 34px rgba(16, 24, 40, 0.08);
}

* {
  box-sizing: border-box;
}

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

button,
input,
select,
textarea {
  font: inherit;
}

button {
  min-height: 38px;
  border: 0;
  border-radius: 7px;
  padding: 0 13px;
  cursor: pointer;
  font-weight: 700;
  white-space: nowrap;
}

.button-like {
  display: inline-flex;
  align-items: center;
  min-height: 38px;
  border-radius: 7px;
  padding: 0 13px;
  font-weight: 700;
  text-decoration: none;
  white-space: nowrap;
}

button:disabled {
  cursor: not-allowed;
  opacity: 0.55;
}

input,
select,
textarea {
  width: 100%;
  min-height: 40px;
  border: 1px solid var(--line);
  border-radius: 7px;
  background: #fff;
  color: var(--ink);
  padding: 9px 10px;
  outline: none;
}

input:focus,
select:focus,
textarea:focus {
  border-color: var(--primary);
  box-shadow: 0 0 0 3px rgba(15, 118, 110, 0.14);
}

textarea {
  resize: vertical;
}

label {
  display: grid;
  gap: 6px;
  color: #344054;
  font-size: 14px;
  font-weight: 700;
}

.password-field {
  position: relative;
  display: block;
}

.password-field input {
  padding-right: 50px;
}

.password-toggle {
  position: absolute;
  top: 50%;
  right: 7px;
  display: inline-grid;
  width: 34px;
  min-height: 30px;
  place-items: center;
  border: 1px solid transparent;
  background: transparent;
  padding: 0;
  transform: translateY(-50%);
}

.password-toggle:hover {
  background: #f2f4f7;
}

.eye-icon {
  position: relative;
  display: block;
  width: 20px;
  height: 12px;
  border: 2px solid #667085;
  border-radius: 999px / 700px;
}

.eye-icon::before {
  content: "";
  position: absolute;
  top: 50%;
  left: 50%;
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: #667085;
  transform: translate(-50%, -50%);
}

.password-toggle.showing .eye-icon::after {
  content: "";
  position: absolute;
  top: 4px;
  left: -4px;
  width: 27px;
  height: 2px;
  border-radius: 999px;
  background: #667085;
  transform: rotate(-35deg);
}

.primary {
  background: var(--primary);
  color: white;
}

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

.secondary {
  border: 1px solid var(--line);
  background: white;
  color: #253044;
}

.secondary:hover {
  background: #f8fafc;
}

.ghost {
  border: 1px solid rgba(255, 255, 255, 0.14);
  background: transparent;
  color: #d7dee8;
}

.danger {
  border: 1px solid #f3b8b2;
  background: var(--danger-soft);
  color: var(--danger);
}

.full {
  width: 100%;
}

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

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

.hidden {
  display: none !important;
}

.stack {
  display: grid;
  gap: 14px;
}

.auth-shell,
.client-shell {
  display: grid;
  min-height: 100vh;
  place-items: center;
  padding: 24px;
}

.auth-panel,
.code-panel {
  width: min(520px, 100%);
  border: 1px solid var(--line-soft);
  border-radius: 8px;
  background: var(--panel);
  box-shadow: var(--shadow);
  padding: 28px;
}

.auth-panel h1,
.code-panel h1,
.topbar h1 {
  margin: 0;
  line-height: 1.15;
}

.alert {
  border: 1px solid #fed7aa;
  border-radius: 7px;
  background: #fff7ed;
  color: #9a3412;
  padding: 12px;
}

.notice {
  position: fixed;
  top: 18px;
  right: 18px;
  z-index: 100;
  width: min(420px, calc(100vw - 36px));
  border: 1px solid #a7f3d0;
  border-radius: 8px;
  background: #ecfdf5;
  box-shadow: var(--shadow);
  color: #065f46;
  padding: 13px 14px;
  font-weight: 800;
}

.notice[data-type="error"] {
  border-color: #fecaca;
  background: #fff1f0;
  color: #991b1b;
}

.app-shell {
  display: grid;
  min-height: 100vh;
  grid-template-columns: 252px minmax(0, 1fr);
}

.sidebar {
  position: sticky;
  top: 0;
  display: grid;
  height: 100vh;
  align-content: start;
  gap: 22px;
  background: var(--nav);
  color: #f8fafc;
  padding: 22px;
}

.brand {
  display: flex;
  align-items: center;
  gap: 12px;
  padding-bottom: 6px;
}

.brand-mark {
  display: grid;
  width: 42px;
  height: 42px;
  place-items: center;
  border-radius: 7px;
  background: #10b981;
  color: #06231d;
  font-weight: 900;
}

.brand small {
  display: block;
  color: #a7b4c5;
}

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

.nav-tabs button {
  justify-content: start;
  border: 1px solid transparent;
  background: transparent;
  color: #d7dee8;
  text-align: left;
}

.nav-tabs button:hover {
  background: rgba(255, 255, 255, 0.06);
}

.nav-tabs button.active {
  border-color: rgba(16, 185, 129, 0.3);
  background: rgba(16, 185, 129, 0.15);
  color: #ffffff;
}

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

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

.topbar p,
.section-header p,
.toolbar p {
  margin: 5px 0 0;
  color: var(--muted);
}

.tab-panel {
  display: none;
}

.tab-panel.active {
  display: grid;
  gap: 18px;
}

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

.grid.two {
  grid-template-columns: minmax(310px, 390px) minmax(0, 1fr);
}

.accounts-layout {
  display: grid;
  grid-template-columns: minmax(310px, 380px) minmax(0, 1fr);
  gap: 16px;
  align-items: start;
}

.list-area {
  display: grid;
  gap: 14px;
  min-width: 0;
}

.metric-grid {
  display: grid;
  grid-template-columns: repeat(5, minmax(130px, 1fr));
  gap: 12px;
}

.overview-layout,
.dashboard-rank-grid {
  display: grid;
  gap: 14px;
  margin-top: 14px;
}

.overview-layout {
  grid-template-columns: minmax(360px, 520px) minmax(0, 1fr);
  align-items: start;
}

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

.metric,
.panel,
.table-wrap {
  border: 1px solid var(--line-soft);
  border-radius: 8px;
  background: var(--panel);
  box-shadow: 0 1px 2px rgba(16, 24, 40, 0.03);
}

.metric {
  padding: 16px;
}

.dashboard-metrics .metric {
  display: grid;
  gap: 6px;
  min-height: 104px;
  align-content: start;
}

.metric-primary {
  border-color: rgba(15, 118, 110, 0.24);
  background: linear-gradient(180deg, #ecfdf5 0%, #ffffff 72%);
}

.metric-warn {
  border-color: #fed7aa;
  background: linear-gradient(180deg, #fff7ed 0%, #ffffff 72%);
}

.metric span {
  display: block;
  color: var(--muted);
  font-size: 13px;
}

.metric strong {
  display: block;
  margin-top: 8px;
  font-size: 28px;
}

.metric small {
  color: var(--muted);
  font-size: 12px;
  line-height: 1.4;
}

.panel {
  padding: 18px;
}

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

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

.chart-header h2,
.chart-header p {
  margin: 0;
}

.chart-header p {
  margin-top: 5px;
  color: var(--muted);
  font-size: 13px;
}

.chart-header > strong {
  min-width: 86px;
  color: var(--primary);
  font-size: 30px;
  line-height: 1;
  text-align: right;
}

.trend-chart {
  display: grid;
  gap: 8px;
}

.trend-chart svg {
  width: 100%;
  height: 170px;
  border: 1px solid var(--line-soft);
  border-radius: 8px;
  background:
    linear-gradient(to bottom, rgba(215, 221, 229, 0.55) 1px, transparent 1px) 0 0 / 100% 25%,
    #fbfcfe;
}

.trend-area {
  fill: rgba(15, 118, 110, 0.12);
}

.trend-line {
  fill: none;
  stroke: var(--primary);
  stroke-linecap: round;
  stroke-linejoin: round;
  stroke-width: 2.2;
  vector-effect: non-scaling-stroke;
}

.trend-dot {
  fill: #ffffff;
  stroke: var(--primary);
  stroke-width: 1.5;
  vector-effect: non-scaling-stroke;
}

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

.rank-bars {
  display: grid;
  gap: 13px;
}

.rank-bar {
  display: grid;
  gap: 7px;
}

.rank-row {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  color: #344054;
  font-size: 13px;
  font-weight: 800;
}

.rank-row span {
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.rank-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 7px;
}

.rank-actions .compact-action {
  min-height: 30px;
  padding: 6px 10px;
  font-size: 12px;
}

.ops-panel {
  align-content: start;
}

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

.task-panel .section-header p {
  margin: 5px 0 0;
  color: var(--muted);
  font-size: 13px;
}

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

.task-card {
  display: grid;
  gap: 4px;
  border: 1px solid var(--line-soft);
  border-radius: 8px;
  background: #fbfcfe;
  padding: 11px;
}

.task-card.has-work {
  border-color: #fed7aa;
  background: #fffaf2;
}

.task-card span,
.task-card small {
  color: var(--muted);
  font-size: 12px;
  line-height: 1.35;
}

.task-card strong {
  color: #253044;
  font-size: 22px;
}

.task-list-grid {
  display: grid;
  gap: 10px;
}

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

.ops-card {
  display: grid;
  gap: 4px;
  border: 1px solid var(--line-soft);
  border-radius: 8px;
  background: #fbfcfe;
  padding: 12px;
}

.ops-card span,
.ops-card small {
  color: var(--muted);
  font-size: 12px;
  line-height: 1.45;
}

.ops-card strong {
  color: #253044;
}

.form-panel {
  position: sticky;
  top: 20px;
}

.panel h2,
.toolbar h2,
.section-header h2 {
  margin: 0;
  font-size: 18px;
}

.section-header {
  display: flex;
  align-items: start;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 14px;
}

.section-header.compact {
  align-items: center;
}

.section-header.compact span {
  color: var(--muted);
  font-size: 13px;
  font-weight: 800;
}

.toolbar {
  display: flex;
  align-items: start;
  justify-content: space-between;
  gap: 14px;
  border: 1px solid var(--line-soft);
  border-radius: 8px;
  background: var(--panel);
  padding: 16px;
}

.toolbar-actions {
  display: flex;
  align-items: end;
  justify-content: flex-end;
  flex-wrap: wrap;
  gap: 10px;
  width: min(900px, 100%);
}

.toolbar-actions > button {
  flex: 0 0 auto;
}

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

.account-status-switch button {
  display: flex;
  align-items: center;
  justify-content: space-between;
  min-height: 54px;
  border: 1px solid var(--line-soft);
  background: #ffffff;
  color: #253044;
  padding: 10px 12px;
  text-align: left;
}

.account-status-switch button span {
  overflow: hidden;
  color: #475467;
  text-overflow: ellipsis;
}

.account-status-switch button strong {
  color: #17202a;
  font-size: 20px;
}

.account-status-switch button.active {
  border-color: rgba(15, 118, 110, 0.35);
  background: var(--primary-soft);
  box-shadow: 0 8px 22px rgba(15, 118, 110, 0.08);
}

.account-status-switch button.active span,
.account-status-switch button.active strong {
  color: var(--primary-dark);
}

.search-box {
  flex: 1 1 190px;
  width: min(360px, 100%);
}

.compact-filter {
  flex-basis: 230px;
  width: min(260px, 100%);
}

.inline-fields {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
}

.empty-state {
  display: grid;
  gap: 10px;
  align-items: start;
  background: #f7fbff;
}

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

.empty-state button {
  width: fit-content;
}

.empty-line {
  padding: 18px;
  color: var(--muted);
  text-align: center;
}

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

.actions.split {
  justify-content: space-between;
}

.actions.right {
  justify-content: flex-end;
}

.row-actions {
  display: flex;
  align-items: center;
  gap: 8px;
  min-width: 160px;
}

.compact-action {
  min-height: 34px;
  padding: 0 12px;
}

.more-actions {
  position: relative;
}

.more-actions summary {
  display: inline-flex;
  align-items: center;
  min-height: 34px;
  border: 1px solid var(--line);
  border-radius: 7px;
  background: white;
  color: #253044;
  padding: 0 12px;
  cursor: pointer;
  font-size: 13px;
  font-weight: 800;
  list-style: none;
  white-space: nowrap;
}

.more-actions summary::-webkit-details-marker {
  display: none;
}

.more-menu {
  display: grid;
  width: 112px;
  gap: 8px;
  margin-top: 8px;
}

.more-menu button {
  width: 100%;
}

.token-chip {
  display: inline-flex;
  align-items: center;
  min-height: 24px;
  margin: 4px 8px 0 0;
  border: 1px solid #d9e5ef;
  border-radius: 7px;
  background: #f8fafc;
  color: #475467;
  padding: 0 7px;
  font-family: ui-monospace, SFMono-Regular, Consolas, "Liberation Mono", monospace;
  font-size: 12px;
  font-weight: 800;
  white-space: nowrap;
}

button.token-chip {
  cursor: copy;
  line-height: 1.2;
}

button.token-chip:hover {
  border-color: #8aa8c4;
  background: #edf5fc;
  color: #1f4f76;
}

button.token-chip:focus-visible {
  outline: 2px solid #2f80c8;
  outline-offset: 2px;
}

.quick-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.copy-list {
  display: grid;
  max-height: 280px;
  gap: 10px;
  overflow: auto;
  padding-right: 4px;
}

.batch-summary {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.batch-preview {
  display: grid;
  gap: 10px;
}

.batch-preview-table {
  max-height: 340px;
}

.batch-import-dialog textarea[name="text"] {
  min-height: 220px;
}

.copy-item {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 10px;
  align-items: start;
  border: 1px solid var(--line-soft);
  border-radius: 8px;
  background: #f8fafc;
  padding: 10px;
}

.copy-item strong {
  display: block;
  margin-bottom: 5px;
}

.copy-item pre {
  margin: 0;
  color: #475467;
  font-family: inherit;
  font-size: 12px;
  line-height: 1.55;
  white-space: pre-wrap;
  word-break: break-word;
}

.link-details {
  display: grid;
  gap: 8px;
}

.link-details summary {
  cursor: pointer;
  color: var(--primary);
  font-weight: 800;
}

.qr-tools {
  display: grid;
  gap: 12px;
  margin-top: -4px;
  border-top: 1px solid var(--line-soft);
  padding-top: 14px;
}

.qr-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.qr-preview {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  align-items: center;
  border: 1px solid #bae6fd;
  border-radius: 8px;
  background: #f0f9ff;
  padding: 12px;
}

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

.secret-mask {
  font-family: "SFMono-Regular", Consolas, monospace;
  color: #075985;
}

.scanner-video {
  width: 100%;
  aspect-ratio: 4 / 3;
  border-radius: 8px;
  background: #0f172a;
  object-fit: cover;
}

.qr-status {
  border: 1px solid var(--line-soft);
  border-radius: 7px;
  background: #f8fafc;
  color: var(--muted);
  padding: 10px;
  font-weight: 700;
}

.table-section {
  padding: 0;
  overflow: hidden;
}

.table-section .section-header {
  padding: 14px 16px 0;
}

.table-wrap {
  overflow: auto;
}

.table-wrap.embedded {
  border: 0;
  border-radius: 0;
  box-shadow: none;
}

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

#tab-tokens table {
  min-width: 960px;
}

#tab-accounts table {
  min-width: 1040px;
}

.account-info-cell strong {
  display: block;
  max-width: 100%;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

#tab-ledger table,
.ledger-table {
  width: max-content;
  min-width: 100%;
  table-layout: fixed;
}

.ledger-table-wrap {
  max-height: calc(100vh - 230px);
  contain: layout paint;
  transform: translateZ(0);
}

.ledger-table input,
.ledger-table select {
  width: 100%;
  min-width: 0;
  min-height: 34px;
  padding: 6px 8px;
  font-size: 13px;
}

.ledger-table .ledger-field-head,
.ledger-table .ledger-field-cell {
  width: var(--col-width, 140px);
  min-width: var(--col-width, 140px);
  max-width: var(--col-width, 140px);
  overflow: hidden;
}

.ledger-table.row-low th,
.ledger-table.row-low td {
  padding-top: 7px;
  padding-bottom: 7px;
}

.ledger-table.row-medium th,
.ledger-table.row-medium td {
  padding-top: 11px;
  padding-bottom: 11px;
}

.ledger-table.row-high th,
.ledger-table.row-high td {
  padding-top: 16px;
  padding-bottom: 16px;
}

.ledger-table.row-extra th,
.ledger-table.row-extra td {
  padding-top: 22px;
  padding-bottom: 22px;
}

.ledger-table.row-low input,
.ledger-table.row-low select {
  min-height: 30px;
  padding-top: 4px;
  padding-bottom: 4px;
}

.ledger-table .sticky-col {
  position: sticky;
  left: 0;
  z-index: 4;
  width: var(--ledger-sticky-current, var(--ledger-sticky-width, 168px));
  min-width: var(--ledger-sticky-current, var(--ledger-sticky-width, 168px));
  max-width: var(--ledger-sticky-current, var(--ledger-sticky-width, 168px));
  background: #ffffff;
  box-shadow: 1px 0 0 var(--line-soft);
}

.mobile-perf-note {
  margin: 0 0 10px;
  border: 1px solid #dbeafe;
  border-radius: 8px;
  background: #eff6ff;
  padding: 8px 10px;
  color: #1e3a8a;
  font-size: 12px;
  font-weight: 700;
}

.table-load-more {
  display: flex;
  justify-content: center;
  border-top: 1px solid var(--line-soft);
  padding: 12px;
}

.ledger-table th.sticky-col {
  z-index: 5;
  background: #f8fafc;
}

.field-icon {
  min-width: 28px;
  min-height: 24px;
  margin-left: 6px;
  border: 1px solid var(--line);
  background: #ffffff;
  padding: 0 6px;
  color: var(--muted);
}

.ledger-resize-handle {
  position: absolute;
  top: 0;
  right: -4px;
  z-index: 8;
  width: 12px;
  height: 100%;
  cursor: col-resize;
  touch-action: none;
}

.ledger-resize-handle::after {
  content: "";
  position: absolute;
  top: 9px;
  right: 5px;
  width: 2px;
  height: calc(100% - 18px);
  border-radius: 999px;
  background: transparent;
}

.ledger-resize-handle:hover::after,
.ledger-table.is-resizing .ledger-resize-handle::after {
  background: #93c5fd;
}

.ledger-table th {
  position: relative;
}

.ledger-table .ledger-date-input {
  text-align: center;
  font-variant-numeric: tabular-nums;
}

.ledger-date-control {
  position: relative;
  display: block;
}

.ledger-date-display {
  width: 100%;
  min-width: 0;
  min-height: 30px;
  padding: 4px 8px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #ffffff;
  color: var(--text);
  font-size: 13px;
  font-variant-numeric: tabular-nums;
  text-align: center;
}

.ledger-date-picker {
  position: absolute;
  inset: 0;
  width: 100%;
  min-width: 0;
  height: 100%;
  opacity: 0;
  pointer-events: none;
}

.ledger-mobile-list {
  display: grid;
  gap: 10px;
}

.ledger-mobile-card {
  display: grid;
  gap: 10px;
  border: 1px solid var(--line-soft);
  border-radius: 10px;
  background: #ffffff;
  padding: 12px;
  box-shadow: var(--shadow-soft);
}

.ledger-mobile-card-head,
.ledger-mobile-foot {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
}

.ledger-mobile-card-head strong {
  min-width: 0;
  overflow: hidden;
  font-size: 14px;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.ledger-mobile-fields {
  display: grid;
  gap: 8px;
}

.ledger-mobile-field {
  display: grid;
  grid-template-columns: minmax(72px, 32%) minmax(0, 1fr);
  align-items: center;
  gap: 8px;
  border: 1px solid var(--line-soft);
  border-left: 4px solid var(--field-color, var(--line-soft));
  border-radius: 8px;
  background: #fbfdff;
  padding: 8px;
}

.ledger-mobile-field > span {
  min-width: 0;
  overflow: hidden;
  color: #475467;
  font-size: 12px;
  font-weight: 800;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.ledger-mobile-field input,
.ledger-mobile-field select,
.ledger-mobile-field textarea,
.ledger-mobile-field .ledger-date-display {
  min-height: 36px;
  font-size: 13px;
}

.ledger-mobile-extra {
  border-top: 1px dashed var(--line-soft);
  padding-top: 8px;
}

.ledger-mobile-extra summary {
  cursor: pointer;
  color: var(--primary);
  font-size: 13px;
  font-weight: 800;
}

.ledger-mobile-extra .ledger-mobile-fields {
  margin-top: 8px;
}

.ledger-mobile-foot {
  color: var(--muted);
  font-size: 12px;
  font-weight: 800;
}

.ledger-mobile-foot strong {
  color: var(--ink);
}

.field-options-editor {
  display: grid;
  gap: 10px;
  border: 1px solid var(--line-soft);
  border-radius: 8px;
  background: #fbfdff;
  padding: 12px;
}

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

.field-options-head strong {
  color: #344054;
  font-size: 14px;
}

.field-options-head span {
  color: var(--muted);
  font-size: 12px;
  font-weight: 700;
}

.field-option-list {
  display: grid;
  max-height: 260px;
  gap: 8px;
  overflow: auto;
  padding-right: 4px;
}

.field-option-row {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 42px 38px;
  gap: 8px;
  align-items: center;
}

.field-option-row input {
  min-height: 38px;
}

.icon-button {
  display: grid;
  min-width: 38px;
  min-height: 38px;
  place-items: center;
  padding: 0;
  font-size: 18px;
  line-height: 1;
}

.option-add-button {
  width: fit-content;
}

.ledger-field-head[style],
.ledger-field-cell[style] {
  background: color-mix(in srgb, var(--field-color) 22%, #ffffff);
}

.colored-select[style] {
  border-color: color-mix(in srgb, var(--field-color) 70%, var(--line));
  background: color-mix(in srgb, var(--field-color) 28%, #ffffff);
}

.ledger-config-dialog {
  min-width: min(520px, calc(100vw - 40px));
}

.field-config-list {
  display: grid;
  max-height: min(620px, calc(100vh - 220px));
  overflow: auto;
  border: 1px solid var(--line-soft);
  border-radius: 8px;
}

.field-config-row {
  display: grid;
  grid-template-columns: 24px 30px minmax(0, 1fr) 38px 38px 38px 48px;
  gap: 8px;
  align-items: center;
  border-bottom: 1px solid var(--line-soft);
  background: #ffffff;
  padding: 8px 10px;
}

.field-config-row:last-child {
  border-bottom: 0;
}

.field-config-row.is-hidden {
  background: #f8fafc;
  color: var(--muted);
}

.field-drag {
  color: #98a2b3;
  font-weight: 900;
}

.field-type-icon {
  display: grid;
  width: 26px;
  height: 26px;
  place-items: center;
  border: 1px solid var(--line-soft);
  border-radius: 7px;
  background: #f8fafc;
  color: #344054;
  font-weight: 900;
}

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

th {
  background: #f8fafc;
  color: #526074;
  font-size: 12px;
  text-transform: uppercase;
}

tr:last-child td {
  border-bottom: 0;
}

.tag,
.pill {
  display: inline-flex;
  align-items: center;
  min-height: 26px;
  border-radius: 999px;
  padding: 0 10px;
  background: #e7ebf0;
  color: #344054;
  font-size: 12px;
  font-weight: 800;
  white-space: nowrap;
}

.tag.active,
.tag.ready,
.pill.good {
  background: #dcfce7;
  color: #166534;
}

.tag.blocked {
  background: var(--warning-soft);
  color: var(--warning);
}

.tag.idle {
  background: #eef2ff;
  color: #3730a3;
}

.tag.pending,
.tag.duplicate,
.tag.warning {
  background: var(--warning-soft);
  color: var(--warning);
}

.tag.sent,
.tag.healthy {
  background: #dcfce7;
  color: #166534;
}

.tag.error,
.tag.revoked,
.tag.archived,
.tag.bad,
.pill.bad {
  background: #fee2e2;
  color: #991b1b;
}

.reminder-list {
  display: grid;
  gap: 7px;
  margin: 12px 0;
}

.reminder-list p {
  margin: 0;
}

.reminder-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  border-top: 1px solid var(--line-soft);
  padding-top: 8px;
}

.reminder-item button {
  min-height: 30px;
  padding: 0 10px;
}

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

.setting-card {
  display: grid;
  align-content: start;
  gap: 12px;
  border: 1px solid var(--line-soft);
  border-radius: 8px;
  background: #fbfcfe;
  padding: 14px;
}

.backup-card {
  border-color: #bdece4;
  background: #f4fbf9;
}

.backup-card .button-like {
  width: fit-content;
}

.feishu-card {
  grid-column: span 2;
}

.backup-status {
  display: grid;
  gap: 4px;
  border: 1px solid var(--line-soft);
  border-radius: 8px;
  background: #f8fafc;
  padding: 10px;
}

.backup-status p {
  margin: 0;
}

.setting-card p {
  margin: 0;
}

.choice-grid {
  display: grid;
  gap: 10px;
}

.choice-grid button {
  display: grid;
  height: auto;
  min-height: 64px;
  justify-items: start;
  gap: 4px;
  padding: 12px 14px;
  text-align: left;
  white-space: normal;
}

.choice-grid button span {
  font-size: 12px;
  font-weight: 600;
  line-height: 1.45;
  opacity: 0.78;
}

.check-row {
  display: flex;
  align-items: center;
  gap: 10px;
  font-weight: 700;
}

.check-row input {
  width: 18px;
  min-height: 18px;
}

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

.client-info {
  display: grid;
  gap: 10px;
  margin: 18px 0 0;
}

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

.client-info-item {
  display: grid;
  gap: 3px;
  border: 1px solid var(--line-soft);
  border-radius: 8px;
  background: #f8fafc;
  padding: 10px 11px;
}

.client-info-item.wide {
  grid-column: 1 / -1;
}

.client-info-item span {
  color: var(--muted);
  font-size: 12px;
  font-weight: 700;
}

.client-info-item strong {
  color: #253044;
  font-size: 14px;
  line-height: 1.3;
  word-break: break-word;
}

.client-info-note {
  border: 1px solid #c7d2fe;
  border-radius: 8px;
  background: #eef2ff;
  color: #3730a3;
  padding: 10px 11px;
  font-size: 12px;
  font-weight: 700;
  line-height: 1.55;
}

.client-info-note.warning {
  border-color: #fed7aa;
  background: #fff7ed;
  color: #9a3412;
}

.device-request-card {
  border: 1px solid var(--line-soft);
  border-radius: 8px;
  background: #fff;
  padding: 12px;
  box-shadow: 0 10px 22px rgba(16, 24, 40, 0.06);
}

.device-reset-confirm {
  display: grid;
  gap: 10px;
}

.code-box {
  display: grid;
  gap: 14px;
  margin-top: 18px;
  border: 1px solid #cfe8e5;
  border-radius: 8px;
  background: #f6fbfa;
  padding: 18px;
  text-align: center;
}

.code-box.waiting {
  border-color: var(--line);
  background: #f8fafc;
}

.watermark-text {
  min-height: 20px;
  margin: 12px 0 0;
  color: #7c8798;
  font-size: 12px;
  text-align: center;
  word-break: break-word;
}

.code-label {
  color: var(--muted);
  font-size: 13px;
}

#codeValue {
  font-family: ui-monospace, SFMono-Regular, Consolas, "Liberation Mono", monospace;
  font-size: 52px;
  line-height: 1;
  letter-spacing: 0;
}

.countdown {
  display: grid;
  gap: 8px;
}

.meter {
  height: 8px;
  overflow: hidden;
  border-radius: 999px;
  background: #dbe4ee;
}

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

dialog {
  width: min(720px, calc(100vw - 32px));
  border: 1px solid var(--line-soft);
  border-radius: 8px;
  box-shadow: var(--shadow);
  padding: 20px;
}

dialog::backdrop {
  background: rgba(15, 23, 42, 0.38);
}

.dialog-body {
  display: grid;
  gap: 14px;
}

.dialog-body h2 {
  margin: 0;
}

@media (max-width: 1050px) {
  .accounts-layout,
  .grid.two,
  .metric-grid,
  .settings-grid,
  .ops-list,
  .overview-layout,
  .dashboard-rank-grid {
    grid-template-columns: 1fr;
  }

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

  .form-panel {
    position: static;
  }
}

@media (max-width: 900px) {
  .app-shell {
    display: block;
    padding-bottom: 88px;
  }

  .sidebar {
    position: fixed;
    top: auto;
    right: 0;
    bottom: 0;
    left: 0;
    z-index: 80;
    height: auto;
    gap: 8px;
    padding: 8px 10px calc(8px + env(safe-area-inset-bottom));
    box-shadow: 0 -10px 26px rgba(15, 23, 42, 0.18);
  }

  .brand,
  .sidebar form {
    display: none;
  }

  .nav-tabs {
    display: flex;
    gap: 6px;
    overflow-x: auto;
    padding-bottom: 2px;
    scrollbar-width: none;
  }

  .nav-tabs::-webkit-scrollbar {
    display: none;
  }

  .nav-tabs button {
    flex: 0 0 auto;
    min-width: 76px;
    min-height: 42px;
    padding: 0 8px;
    text-align: center;
    justify-content: center;
    font-size: 12px;
  }

  .workspace {
    padding: 16px 12px 22px;
  }

  .topbar,
  .toolbar,
  .toolbar-actions {
    display: grid;
  }

  .search-box {
    width: 100%;
  }

  .chart-header {
    display: grid;
  }

  .chart-header > strong {
    text-align: left;
  }

  .trend-chart svg {
    height: 170px;
  }
}

/* 2026-08 approved full-workspace redesign */
.redesigned-list-area,
#tab-migration.active,
#tab-health.active,
#tab-logs.active,
#tab-audit.active,
#tab-settings.active {
  display: grid;
  gap: 12px;
}

.ops-commandbar {
  display: flex;
  min-height: 58px;
  align-items: center;
  gap: 9px;
  border: 1px solid #e3e8f0;
  border-radius: 7px;
  background: #ffffff;
  padding: 9px 11px;
  box-shadow: 0 1px 2px rgba(23, 35, 58, 0.02);
}

.ops-commandbar button,
.ops-commandbar .button-like,
.token-secondary-actions button,
.migration-impact button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 7px;
}

.ops-commandbar .ui-icon,
.token-secondary-actions .ui-icon,
.migration-impact .ui-icon,
.token-management-table .ui-icon {
  width: 16px;
  height: 16px;
}

.command-search {
  display: flex;
  width: min(310px, 30vw);
  min-width: 210px;
  height: 38px;
  align-items: center;
  gap: 8px;
  border: 1px solid #dce2eb;
  border-radius: 6px;
  background: #ffffff;
  color: #8a96a8;
  padding: 0 11px;
}

.command-search:focus-within {
  border-color: #7ca5f8;
  box-shadow: 0 0 0 3px rgba(47, 115, 246, 0.1);
}

.command-search input {
  min-width: 0;
  min-height: 0;
  flex: 1;
  border: 0;
  border-radius: 0;
  background: transparent;
  padding: 0;
  box-shadow: none;
  font-size: 12px;
}

.command-search .ui-icon {
  flex: 0 0 16px;
}

.command-segment {
  display: flex;
  min-width: max-content;
  gap: 2px;
  border: 1px solid #e3e8ef;
  border-radius: 6px;
  background: #f7f8fa;
  padding: 3px;
}

.command-segment button {
  min-height: 30px;
  border: 0;
  border-radius: 4px;
  background: transparent;
  color: #788599;
  padding: 0 10px;
  font-size: 11px;
  font-weight: 700;
}

.command-segment button strong {
  margin-left: 3px;
  color: inherit;
  font-size: inherit;
}

.command-segment button.active {
  background: #ffffff;
  color: #2f73f6;
  box-shadow: 0 1px 5px rgba(27, 39, 62, 0.1);
}

.command-sort {
  min-height: 38px;
  font-size: 11px;
}

.command-actions {
  display: flex;
  align-items: center;
  gap: 7px;
  margin-left: auto;
}

.command-select {
  display: flex;
  height: 38px;
  align-items: center;
  gap: 7px;
  border: 1px solid #dfe4ec;
  border-radius: 6px;
  background: #ffffff;
  color: #7b8799;
  padding: 0 9px;
  font-size: 10px;
  font-weight: 700;
}

.command-select select {
  width: auto;
  max-width: 260px;
  min-height: 0;
  border: 0;
  background: transparent;
  padding: 0 20px 0 0;
  box-shadow: none;
  color: #334056;
  font-size: 11px;
}

.list-context-line,
.token-secondary-actions {
  display: flex;
  min-height: 28px;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  color: #7b8799;
  padding: 0 3px;
  font-size: 10px;
}

.live-sync-indicator {
  display: inline-flex;
  align-items: center;
  gap: 6px;
}

.live-sync-indicator i,
.log-summary-line i {
  display: inline-block;
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: #36ad78;
}

.redesigned-table-section {
  overflow: hidden;
  border-color: #e3e8f0;
  border-radius: 7px;
  padding: 0;
}

.redesigned-table-section .table-wrap {
  border: 0;
}

.account-load-more {
  position: relative;
  display: flex;
  min-height: 48px;
  align-items: center;
  justify-content: center;
  gap: 14px;
  border-top: 1px solid #edf1f5;
  background: #fbfcfe;
  color: #748095;
  padding: 8px 14px;
  font-size: 12px;
}

.account-load-more > span strong {
  color: #344054;
}

.account-load-more button {
  min-height: 32px;
  padding: 0 14px;
}

.account-load-more > i {
  position: absolute;
  right: 0;
  bottom: 0;
  left: 0;
  height: 1px;
  pointer-events: none;
}

.account-load-more.all-loaded small {
  color: #98a2b3;
}

@media (max-width: 560px) {
  .account-load-more {
    justify-content: space-between;
    gap: 8px;
    padding: 8px 10px;
  }

  .account-load-more button {
    padding: 0 10px;
    font-size: 11px;
  }
}

.redesigned-table-section table {
  font-size: 12px;
}

.redesigned-table-section th {
  height: 39px;
  background: #f8f9fb;
  color: #7d899c;
  font-size: 10px;
  font-weight: 700;
}

.redesigned-table-section td {
  height: 64px;
  padding: 10px 13px;
  vertical-align: middle;
}

.account-management-table {
  min-width: 1040px;
}

.account-management-table th:first-child {
  width: 24%;
}

.account-management-table th:last-child {
  width: 285px;
}

.account-identity {
  display: flex;
  min-width: 0;
  align-items: center;
  gap: 9px;
}

.account-identity > span,
.token-context-account > span {
  display: grid;
  width: 30px;
  height: 30px;
  flex: 0 0 30px;
  place-items: center;
  border-radius: 7px;
  background: #eef4ff;
  color: #2f73f6;
  font-size: 11px;
  font-weight: 800;
}

.account-identity > div,
.token-context-account > div {
  display: grid;
  min-width: 0;
  gap: 3px;
}

.account-identity strong,
.account-identity small,
.token-context-account strong,
.token-context-account small {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.account-identity small,
.account-date-cell small,
.account-cycle-cell small,
.token-context-account small,
.token-management-table small,
.cell-subline {
  display: block;
  color: #929daf;
  font-size: 9px;
  font-weight: 500;
}

.account-date-cell strong,
.account-cycle-cell strong,
.token-management-table td > strong {
  display: block;
  margin-bottom: 3px;
  color: #2c384d;
  font-size: 11px;
}

.account-date-cell small.attention,
.token-expiry-cell small {
  color: #bd7111;
}

.account-seat-cell {
  white-space: nowrap;
}

.account-seat-meter {
  display: inline-block;
  width: 52px;
  height: 5px;
  overflow: hidden;
  border-radius: 4px;
  background: #edf0f5;
  margin-right: 7px;
  vertical-align: middle;
}

.account-seat-meter i {
  display: block;
  height: 100%;
  border-radius: 4px;
  background: #3e7bf4;
}

.account-actions,
.token-management-table .row-actions,
.health-management-table .row-actions {
  min-width: max-content;
  flex-wrap: nowrap;
  gap: 5px;
}

.icon-summary {
  display: grid !important;
  width: 32px;
  min-height: 30px !important;
  place-items: center;
  padding: 0 !important;
}

.icon-summary .ui-icon {
  width: 16px;
  height: 16px;
}

.more-actions[open] .more-menu {
  min-width: 128px;
  gap: 5px;
  border: 1px solid #e2e7ef;
  border-radius: 6px;
  background: #ffffff;
  padding: 7px;
  box-shadow: 0 10px 24px rgba(31, 47, 77, 0.12);
}

.more-actions[open] .more-menu button {
  min-height: 31px;
  font-size: 11px;
}

.token-commandbar .token-search-control {
  width: min(340px, 34vw);
}

.token-account-select {
  min-width: 300px;
}

.token-account-select select {
  width: 220px;
}

.token-context-strip {
  display: flex;
  min-height: 64px;
  align-items: center;
  justify-content: space-between;
  gap: 18px;
  border: 1px solid #dce5f6;
  border-radius: 7px;
  background: #f7faff;
  padding: 11px 14px;
}

.token-context-account {
  display: flex;
  min-width: 0;
  align-items: center;
  gap: 9px;
}

.token-context-metrics {
  display: flex;
  align-items: center;
  gap: 26px;
  color: #788599;
  font-size: 10px;
}

.token-context-metrics strong {
  margin-left: 4px;
  color: #2c384d;
}

.token-secondary-actions > div {
  display: flex;
  gap: 6px;
}

.token-secondary-actions button {
  min-height: 30px;
  font-size: 10px;
}

.token-revoke-entry {
  border-color: #f1c9c9;
  color: #c63f3f;
}

.single-token-revoke-control,
.single-token-revoke-confirm {
  display: inline-flex;
  align-items: center;
  gap: 5px;
}

.token-single-revoke-trigger {
  border-color: #efcaca;
  color: #c83f3f;
}

.single-token-revoke-confirm .danger {
  box-shadow: 0 0 0 2px rgba(216, 67, 67, 0.08);
}

.token-batch-revoke-bar {
  display: flex;
  min-height: 54px;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  border: 1px solid #f0cccc;
  border-radius: 7px;
  background: #fff8f8;
  padding: 9px 12px;
}

.token-batch-revoke-bar > div:first-child {
  display: flex;
  min-width: max-content;
  align-items: baseline;
  gap: 10px;
}

.token-batch-revoke-bar > div:first-child strong {
  color: #a93737;
  font-size: 12px;
}

.token-batch-revoke-bar > div:first-child span {
  color: #7c5860;
  font-size: 10px;
}

.token-batch-revoke-bar .actions {
  overflow-x: auto;
  flex-wrap: nowrap;
  scrollbar-width: none;
}

.token-batch-revoke-bar .actions::-webkit-scrollbar {
  display: none;
}

.token-batch-revoke-bar button {
  min-height: 32px;
  padding: 0 11px;
  white-space: nowrap;
}

.token-identity-line {
  display: flex;
  min-width: 0;
  align-items: center;
  gap: 8px;
}

.token-revoke-checkbox {
  width: 16px !important;
  min-width: 16px !important;
  height: 16px;
  min-height: 16px !important;
  flex: 0 0 16px;
  margin: 0;
  padding: 0 !important;
  accent-color: #d94747;
}

@media (max-width: 900px) {
  .token-batch-revoke-bar {
    display: grid;
    gap: 8px;
  }

  .token-batch-revoke-bar .actions {
    justify-content: flex-start;
  }
}

.token-management-table {
  min-width: 1080px;
}

.token-management-table th:first-child {
  width: 20%;
}

.token-management-table th:last-child {
  width: 260px;
}

.token-code-button {
  display: inline-flex;
  min-height: 24px;
  align-items: center;
  gap: 6px;
  border: 0;
  background: transparent;
  color: #30415c;
  padding: 0;
  font-family: ui-monospace, SFMono-Regular, Consolas, monospace;
  font-size: 11px;
}

.token-code-button .ui-icon {
  width: 13px;
  height: 13px;
}

.token-device-cell > span {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  color: #455268;
  font-size: 10px;
}

.token-device-cell .ui-icon {
  width: 14px;
  height: 14px;
}

.ledger-commandbar {
  flex-wrap: wrap;
}

.ledger-view-name {
  display: flex;
  align-items: center;
  gap: 7px;
  margin-right: 2px;
}

.ledger-view-name span {
  color: #8b96a7;
  font-size: 9px;
}

.ledger-commandbar > button {
  min-height: 36px;
  font-size: 10px;
}

.ledger-commandbar > button strong {
  display: grid;
  min-width: 16px;
  height: 16px;
  place-items: center;
  border-radius: 8px;
  background: #eef4ff;
  color: #2f73f6;
  font-size: 8px;
}

.ledger-search-control {
  width: 210px;
  min-width: 170px;
}

.ledger-active-filters {
  display: flex;
  min-height: 42px;
  align-items: center;
  gap: 7px;
  overflow-x: auto;
  border: 1px solid #e3e8f0;
  border-radius: 7px;
  background: #ffffff;
  padding: 7px 10px;
  color: #7d899a;
  font-size: 9px;
}

.ledger-filter-chip {
  display: inline-flex;
  min-height: 27px;
  align-items: center;
  border: 1px solid #dfe4eb;
  border-radius: 5px;
  background: #f8f9fb;
  color: #4e5b70;
  padding: 0 8px;
  white-space: nowrap;
}

.ledger-section .ledger-table-wrap {
  max-height: calc(100vh - 230px);
  border: 0;
  border-radius: 0;
}

.ledger-table .sticky-col {
  box-shadow: 1px 0 0 #e3e8f0;
}

.migration-workspace {
  display: grid;
  gap: 13px;
}

.migration-steps {
  display: flex;
  min-height: 68px;
  align-items: center;
  justify-content: center;
  border: 1px solid #e3e8f0;
  border-radius: 7px;
  background: #ffffff;
  padding: 12px;
}

.migration-steps > div {
  display: flex;
  align-items: center;
  gap: 8px;
  color: #8b96a7;
}

.migration-steps > div > b {
  display: grid;
  width: 28px;
  height: 28px;
  place-items: center;
  border-radius: 50%;
  background: #eef1f5;
  color: #7a8698;
  font-size: 11px;
}

.migration-steps > div.active {
  color: #253148;
}

.migration-steps > div.active > b {
  background: #2f73f6;
  color: #ffffff;
}

.migration-steps span {
  display: grid;
  font-size: 11px;
  font-weight: 700;
}

.migration-steps small {
  color: #9aa4b2;
  font-size: 8px;
  font-weight: 500;
}

.migration-steps > i {
  width: 84px;
  height: 1px;
  background: #dfe4eb;
  margin: 0 16px;
}

.migration-account-grid {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 92px minmax(0, 1fr);
  align-items: center;
}

.migration-account-card {
  overflow: hidden;
  padding: 0;
}

.migration-select {
  gap: 7px;
  padding: 3px 17px 16px;
  color: #7d899b;
  font-size: 9px;
}

.migration-select select {
  height: 44px;
  font-size: 11px;
}

.migration-facts {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  border-top: 1px solid #e3e8f0;
  background: #fafbfc;
}

.migration-facts p {
  display: grid;
  gap: 4px;
  margin: 0;
  border-right: 1px solid #e3e8f0;
  padding: 13px;
}

.migration-facts p:last-child {
  border: 0;
}

.migration-facts span {
  color: #8793a5;
  font-size: 9px;
}

.migration-facts strong {
  font-size: 12px;
}

.migration-direction {
  display: grid;
  justify-items: center;
  gap: 7px;
  color: #2f73f6;
  font-size: 8px;
}

.migration-direction .ui-icon {
  width: 27px;
  height: 27px;
}

.migration-impact {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding: 14px 17px;
}

.migration-impact h2 {
  margin: 0 0 4px;
  font-size: 14px;
}

.migration-impact p {
  margin: 0;
  color: #7c889a;
  font-size: 10px;
}

.migration-impact details {
  margin-top: 8px;
  color: #667387;
  font-size: 10px;
}

.migration-impact details label {
  margin-top: 7px;
  font-size: 10px;
}

.health-summary-strip {
  display: grid;
  grid-template-columns: minmax(270px, 1.5fr) 1fr 1fr;
  overflow: hidden;
  border: 1px solid #e3e8f0;
  border-radius: 7px;
  background: #ffffff;
}

.health-summary-strip > div,
.health-summary-strip > p {
  display: flex;
  align-items: center;
  gap: 12px;
  margin: 0;
  border-right: 1px solid #e3e8f0;
  padding: 14px 18px;
}

.health-summary-strip > p:last-child {
  border: 0;
}

.health-summary-strip > div > div {
  display: grid;
  gap: 3px;
}

.health-summary-strip > p {
  flex-wrap: wrap;
}

.health-summary-strip > p span {
  width: 100%;
  color: #7c889a;
  font-size: 9px;
}

.health-summary-strip > p strong {
  font-size: 22px;
}

.health-summary-strip small {
  color: #8c97a8;
  font-size: 9px;
}

.health-score-ring {
  display: grid;
  width: 48px;
  height: 48px;
  place-items: center;
  border: 6px solid #dff4ec;
  border-top-color: #249b6c;
  border-radius: 50%;
  color: #249b6c;
  font-weight: 800;
}

.health-status-segment {
  overflow-x: auto;
}

.health-management-table {
  min-width: 980px;
}

.health-risk {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: 10px;
  font-weight: 700;
}

.health-risk .ui-icon {
  width: 14px;
  height: 14px;
}

.health-risk.bad {
  color: #ce4b48;
}

.health-risk.warning {
  color: #b36d12;
}

.logs-search-control,
.audit-search-control {
  width: min(360px, 38vw);
}

.log-summary-line {
  display: flex;
  min-height: 42px;
  align-items: center;
  gap: 18px;
  border-bottom: 1px solid #e3e8f0;
  padding: 0 14px;
  color: #667387;
  font-size: 10px;
}

.log-summary-line span {
  display: inline-flex;
  align-items: center;
  gap: 6px;
}

.log-summary-line i.denied {
  background: #d95855;
}

.log-summary-line small {
  margin-left: auto;
  color: #8e99aa;
}

.log-management-table {
  min-width: 980px;
}

.log-device-text {
  display: block;
  max-width: 250px;
  overflow: hidden;
  color: #536075;
  font-size: 10px;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.audit-timeline-panel {
  display: grid;
  grid-template-columns: 80px minmax(0, 1fr);
  padding: 17px;
}

.audit-timeline-date {
  display: grid;
  grid-template-rows: auto 1fr;
  justify-items: center;
  gap: 8px;
  color: #7d899a;
  font-size: 10px;
}

.audit-timeline-date i {
  width: 1px;
  height: 100%;
  background: #e2e7ee;
}

.audit-timeline-list {
  display: grid;
}

.audit-timeline-item {
  display: grid;
  grid-template-columns: 34px minmax(0, 1fr) auto;
  align-items: center;
  gap: 11px;
  border-bottom: 1px solid #e7ebf1;
  padding: 12px 0;
}

.audit-timeline-item:last-child {
  border: 0;
}

.audit-action-icon {
  display: grid;
  width: 32px;
  height: 32px;
  place-items: center;
  border-radius: 7px;
  background: #eef4ff;
  color: #2f73f6;
}

.audit-action-icon.success {
  background: #eaf8f2;
  color: #249b6c;
}

.audit-action-icon.warning {
  background: #fff5e6;
  color: #bd7416;
}

.audit-action-icon.danger {
  background: #fff0f0;
  color: #d25250;
}

.audit-action-icon .ui-icon {
  width: 16px;
  height: 16px;
}

.audit-timeline-item > div {
  display: grid;
  gap: 3px;
}

.audit-timeline-item p {
  margin: 0;
  color: #4f5c70;
  font-size: 10px;
}

.audit-timeline-item small,
.audit-object {
  color: #8793a5;
  font-size: 9px;
}

.audit-object {
  border: 1px solid #e1e6ed;
  border-radius: 5px;
  background: #f8f9fb;
  padding: 5px 8px;
}

.settings-shell {
  display: grid;
  grid-template-columns: 190px minmax(0, 1fr);
  gap: 13px;
}

.settings-section-nav {
  display: grid;
  align-content: start;
  gap: 4px;
  border: 1px solid #e3e8f0;
  border-radius: 7px;
  background: #ffffff;
  padding: 8px;
}

.settings-section-nav button {
  display: flex;
  align-items: center;
  justify-content: flex-start;
  gap: 9px;
  border: 0;
  border-radius: 5px;
  background: transparent;
  color: #637084;
  padding: 0 10px;
  font-size: 11px;
}

.settings-section-nav button.active {
  background: #eef4ff;
  color: #2f73f6;
}

.settings-section-nav .ui-icon {
  width: 16px;
  height: 16px;
}

.settings-main-panel {
  overflow: hidden;
  padding: 0;
}

.settings-main-panel > .section-header {
  border-bottom: 1px solid #e3e8f0;
  padding: 14px 16px;
}

.settings-main-panel .settings-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 0;
}

.settings-main-panel .setting-card {
  border: 0;
  border-bottom: 1px solid #e7ebf1;
  border-radius: 0;
  box-shadow: none;
  padding: 16px;
}

.settings-main-panel .setting-card:last-child {
  border-bottom: 0;
}

.settings-shell[data-settings-section="security"] [data-settings-panel]:not([data-settings-panel="security"]),
.settings-shell[data-settings-section="feishu"] [data-settings-panel]:not([data-settings-panel="feishu"]),
.settings-shell[data-settings-section="system"] [data-settings-panel]:not([data-settings-panel="system"]),
.settings-shell[data-settings-section="data"] [data-settings-panel]:not([data-settings-panel="data"]) {
  display: none;
}

.system-parameter-card {
  display: grid;
  padding: 0 !important;
}

.system-parameter-card > strong {
  padding: 15px 16px;
}

.setting-summary-row {
  display: grid;
  grid-template-columns: 36px minmax(0, 1fr) auto;
  align-items: center;
  gap: 10px;
  border-top: 1px solid #e7ebf1;
  padding: 12px 16px;
}

.setting-summary-row > span {
  display: grid;
  width: 32px;
  height: 32px;
  place-items: center;
  border-radius: 7px;
  background: #f1f4f8;
  color: #617087;
}

.setting-summary-row .ui-icon {
  width: 16px;
  height: 16px;
}

.setting-summary-row > div {
  display: grid;
  gap: 3px;
}

.setting-summary-row small {
  color: #8793a5;
  font-size: 9px;
}

.setting-summary-row > b {
  color: #3d4a60;
  font-size: 11px;
}

@media (max-width: 1100px) {
  .ops-commandbar {
    flex-wrap: wrap;
  }

  .command-actions {
    margin-left: 0;
  }

  .account-commandbar .command-actions,
  .token-commandbar .command-actions,
  .audit-commandbar .command-actions {
    margin-left: auto;
  }

  .command-search {
    width: 280px;
  }

  .token-account-select {
    min-width: 270px;
  }
}

@media (max-width: 900px) {
  .redesigned-list-area,
  #tab-migration,
  #tab-health,
  #tab-logs,
  #tab-audit,
  #tab-settings {
    gap: 10px;
  }

  .ops-commandbar {
    display: flex;
    min-height: 0;
    align-items: stretch;
    gap: 8px;
    padding: 8px;
  }

  .command-search,
  .token-commandbar .token-search-control,
  .logs-search-control,
  .audit-search-control {
    order: 1;
    width: 100%;
    min-width: 0;
  }

  .command-segment {
    order: 2;
    max-width: 100%;
    overflow-x: auto;
    scrollbar-width: none;
  }

  .command-sort,
  .command-select {
    order: 3;
    flex: 1;
  }

  .command-actions {
    order: 3;
    flex: 1;
    margin-left: 0 !important;
  }

  .command-actions button,
  .command-actions .button-like {
    flex: 1;
  }

  .account-commandbar .command-actions button.secondary {
    display: none;
  }

  .account-management-table {
    min-width: 0 !important;
  }

  .account-management-table thead {
    display: none;
  }

  .account-management-table tbody {
    display: grid;
  }

  .account-management-table tr {
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto;
    gap: 8px 12px;
    border-bottom: 1px solid #e7ebf1;
    padding: 12px;
  }

  .account-management-table td {
    display: block;
    width: auto !important;
    min-width: 0 !important;
    height: auto !important;
    border: 0 !important;
    padding: 0 !important;
    white-space: normal !important;
  }

  .account-management-table td.account-info-cell {
    grid-column: 1;
    grid-row: 1;
  }

  .account-management-table td.account-platform {
    display: none;
  }

  .account-management-table td:nth-child(3) {
    grid-column: 2;
    grid-row: 1;
  }

  .account-date-cell {
    grid-column: 1;
  }

  .account-date-cell::before {
    content: "结算日 ";
    color: #8793a5;
    font-size: 9px;
  }

  .account-date-cell strong {
    display: inline;
  }

  .account-seat-cell {
    grid-column: 2;
    align-self: center;
  }

  .account-cycle-cell {
    grid-column: 1 / -1;
  }

  .account-actions {
    grid-column: 1 / -1;
    overflow-x: visible;
  }

  .account-management-table td:last-child {
    grid-column: 1 / -1;
  }

  .account-more-actions .more-menu {
    width: min(240px, calc(100vw - 65px));
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .token-commandbar .token-account-select {
    order: 2;
    width: 100%;
    min-width: 0;
  }

  .token-account-select select {
    width: 100%;
    max-width: none;
  }

  .token-context-strip {
    display: grid;
    gap: 11px;
  }

  .token-context-metrics {
    justify-content: space-between;
  }

  .token-secondary-actions {
    align-items: flex-start;
  }

  .token-secondary-actions > div {
    overflow-x: auto;
  }

  .token-management-table {
    min-width: 0 !important;
  }

  .token-management-table thead {
    display: none;
  }

  .token-management-table tbody {
    display: grid;
  }

  .token-management-table tr {
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto;
    gap: 9px 12px;
    border-bottom: 1px solid #e7ebf1;
    padding: 12px;
  }

  .token-management-table td {
    display: block;
    width: auto !important;
    min-width: 0 !important;
    height: auto !important;
    border: 0 !important;
    padding: 0 !important;
    white-space: normal !important;
  }

  .token-status-cell {
    grid-column: 2;
    grid-row: 1;
  }

  .token-expiry-cell {
    grid-column: 1;
  }

  .token-device-cell {
    grid-column: 2;
  }

  .token-cycle-cell,
  .token-management-table td:last-child {
    grid-column: 1 / -1;
  }

  .token-management-table .row-actions {
    overflow-x: visible;
  }

  .ledger-commandbar {
    display: flex;
    overflow: visible;
  }

  .ledger-view-name {
    flex: 0 0 100%;
  }

  .ledger-commandbar > button {
    flex: 1;
  }

  .ledger-commandbar .ledger-status-select,
  .ledger-commandbar .ledger-search-control {
    display: none;
  }

  .ledger-commandbar .command-actions {
    display: flex;
    flex: 0 0 100%;
  }

  .ledger-active-filters {
    -webkit-overflow-scrolling: touch;
  }

  .ledger-section .ledger-table-wrap {
    max-height: 520px;
    overflow: auto;
    overscroll-behavior-inline: contain;
    -webkit-overflow-scrolling: touch;
  }

  .ledger-table .sticky-col {
    min-width: var(--ledger-sticky-width, 168px);
    max-width: var(--ledger-sticky-width, 168px);
  }

  .migration-steps {
    justify-content: flex-start;
    overflow-x: auto;
  }

  .migration-steps > i {
    width: 36px;
    margin: 0 8px;
  }

  .migration-account-grid {
    grid-template-columns: 1fr;
    gap: 8px;
  }

  .migration-direction {
    transform: rotate(90deg);
    padding: 6px;
  }

  .migration-direction span {
    display: none;
  }

  .migration-impact {
    display: grid;
  }

  .health-summary-strip {
    grid-template-columns: 1fr 1fr;
  }

  .health-summary-strip > div {
    grid-column: 1 / -1;
    border-bottom: 1px solid #e3e8f0;
  }

  .health-summary-strip > p {
    border-right: 1px solid #e3e8f0;
  }

  .health-commandbar .health-status-segment {
    flex: 1 0 100%;
  }

  .health-management-table,
  .log-management-table {
    min-width: 850px !important;
  }

  .audit-timeline-panel {
    grid-template-columns: 45px minmax(0, 1fr);
    padding: 12px;
  }

  .audit-timeline-item {
    grid-template-columns: 30px minmax(0, 1fr);
  }

  .audit-object {
    display: none;
  }

  .settings-shell {
    grid-template-columns: 1fr;
  }

  .settings-section-nav {
    display: flex;
    overflow-x: auto;
    scrollbar-width: thin;
  }

  .settings-section-nav button {
    flex: 0 0 auto;
  }
}

@media (max-width: 520px) {
  .auth-panel,
  .code-panel {
    padding: 20px;
  }

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

  #codeValue {
    font-size: 42px;
  }

  .inline-fields {
    grid-template-columns: 1fr;
  }

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

  .qr-preview {
    display: grid;
  }

  .qr-actions button {
    flex: 1 1 100%;
  }
}

/* 2026-05-29 visual refresh: quieter, denser admin workspace. */
:root {
  --bg: #f5f7fb;
  --panel: #ffffff;
  --ink: #111827;
  --muted: #64748b;
  --line: #cfd8e3;
  --line-soft: #e6ebf2;
  --primary: #0f766e;
  --primary-dark: #0b5f59;
  --primary-soft: #e8f6f3;
  --danger: #b42318;
  --danger-soft: #fff1f0;
  --warning: #a15c07;
  --warning-soft: #fff7e6;
  --nav: #111827;
  --shadow: 0 18px 48px rgba(15, 23, 42, 0.08);
  --shadow-soft: 0 8px 22px rgba(15, 23, 42, 0.05);
}

body {
  background:
    linear-gradient(180deg, #eef3f8 0, #f5f7fb 260px),
    var(--bg);
  letter-spacing: 0;
}

button,
.button-like,
input,
select,
textarea,
.metric,
.panel,
.table-wrap,
.tag,
.pill,
.token-chip,
dialog,
.notice,
.client-info-note,
.client-info-item,
.code-box,
.task-card,
.setting-card,
.ops-card {
  border-radius: 8px;
}

button,
.button-like {
  min-height: 36px;
  padding: 0 12px;
  transition: background 0.16s ease, border-color 0.16s ease, color 0.16s ease, box-shadow 0.16s ease, transform 0.16s ease;
}

button:hover,
.button-like:hover {
  box-shadow: 0 6px 16px rgba(15, 23, 42, 0.08);
}

button:active {
  transform: translateY(1px);
}

input,
select,
textarea {
  border-color: #d6dee8;
  background: #fbfdff;
}

input:focus,
select:focus,
textarea:focus {
  border-color: #0f766e;
  box-shadow: 0 0 0 3px rgba(15, 118, 110, 0.12);
}

.primary {
  background: #0f766e;
  box-shadow: 0 8px 18px rgba(15, 118, 110, 0.18);
}

.secondary {
  border-color: #d8e0ea;
  background: #ffffff;
}

.danger {
  border-color: #fecaca;
}

.app-shell {
  grid-template-columns: 244px minmax(0, 1fr);
  gap: 0;
}

.sidebar {
  position: sticky;
  top: 0;
  height: 100vh;
  border-right: 1px solid rgba(255, 255, 255, 0.08);
  background: #111827;
  box-shadow: 12px 0 36px rgba(15, 23, 42, 0.10);
}

.brand {
  border-bottom: 1px solid rgba(255, 255, 255, 0.08);
  padding-bottom: 18px;
}

.brand-mark {
  background: #ecfdf5;
  color: #0f766e;
}

.brand strong {
  color: #ffffff;
}

.brand small {
  color: #9ca3af;
}

.nav-tabs {
  gap: 6px;
}

.nav-tabs button {
  min-height: 40px;
  border: 1px solid transparent;
  border-radius: 8px;
  color: #cbd5e1;
  font-size: 14px;
}

.nav-tabs button:hover {
  background: rgba(255, 255, 255, 0.07);
  box-shadow: none;
}

.nav-tabs button.active {
  border-color: rgba(20, 184, 166, 0.22);
  background: rgba(15, 118, 110, 0.20);
  color: #ffffff;
}

.workspace {
  width: min(100%, 1600px);
  padding: 24px;
}

.topbar {
  position: sticky;
  top: 0;
  z-index: 40;
  align-items: center;
  margin: -24px -24px 18px;
  border-bottom: 1px solid rgba(207, 216, 227, 0.8);
  background: rgba(245, 247, 251, 0.92);
  padding: 18px 24px;
  backdrop-filter: blur(14px);
}

.topbar h1 {
  font-size: 24px;
}

.topbar p {
  font-size: 13px;
}

.tab-panel.active {
  gap: 14px;
}

.metric,
.panel,
.table-wrap {
  border-color: #e3e9f1;
  box-shadow: var(--shadow-soft);
}

.panel {
  padding: 16px;
}

.metric {
  padding: 15px;
}

.metric-grid {
  gap: 10px;
}

.dashboard-metrics .metric {
  min-height: 96px;
}

.metric span,
.metric small,
.task-card span,
.task-card small,
.client-info-item span {
  color: #64748b;
}

.metric strong {
  color: #0f172a;
  font-size: 26px;
}

.metric-primary {
  border-color: #bdece4;
  background: linear-gradient(180deg, #ecfdf8 0%, #ffffff 78%);
}

.metric-warn {
  border-color: #fed7aa;
  background: linear-gradient(180deg, #fff7ed 0%, #ffffff 76%);
}

.overview-layout {
  grid-template-columns: minmax(380px, 500px) minmax(0, 1fr);
}

.chart-header {
  align-items: center;
}

.chart-header h2,
.panel h2,
.toolbar h2,
.section-header h2 {
  color: #0f172a;
  font-size: 17px;
}

.trend-chart svg {
  height: 190px;
  border-color: #e3e9f1;
  background:
    linear-gradient(to bottom, rgba(226, 232, 240, 0.75) 1px, transparent 1px) 0 0 / 100% 25%,
    #fbfdff;
}

.trend-line {
  stroke-width: 2.4;
}

.trend-area {
  fill: rgba(15, 118, 110, 0.10);
}

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

.task-card {
  background: #f8fafc;
}

.task-card.has-work {
  background: #fff9ed;
}

.task-list-grid {
  gap: 8px;
}

.reminder-list {
  margin: 0;
  border: 1px solid #e6ebf2;
  border-radius: 8px;
  background: #fbfdff;
  padding: 11px;
}

.reminder-item {
  border-top-color: #edf2f7;
}

.rank-bars {
  gap: 12px;
}

.rank-row {
  color: #1f2937;
}

.meter {
  height: 7px;
  background: #dfe7f0;
}

.toolbar {
  align-items: end;
  border: 1px solid #e3e9f1;
  border-radius: 8px;
  background: #ffffff;
  box-shadow: var(--shadow-soft);
  padding: 14px;
}

.toolbar-actions {
  align-items: end;
  gap: 9px;
}

.search-box span {
  color: #64748b;
  font-size: 12px;
}

.table-section {
  padding: 0;
  overflow: hidden;
}

.table-section .section-header {
  padding: 14px 16px;
}

.table-wrap {
  overflow: auto;
}

.table-wrap.embedded {
  border-width: 1px 0 0;
  border-radius: 0;
  box-shadow: none;
}

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

th {
  position: sticky;
  top: 0;
  z-index: 2;
  background: #f8fafc;
  color: #475569;
  font-size: 12px;
  text-transform: none;
}

td {
  background: #ffffff;
  vertical-align: top;
}

tbody tr:hover td {
  background: #fbfdff;
}

.row-actions,
.actions {
  gap: 8px;
}

.compact-action {
  min-width: 86px;
}

.more-actions summary {
  border-color: #d8e0ea;
  background: #ffffff;
}

.tag,
.pill {
  min-height: 26px;
  padding: 4px 10px;
  font-size: 12px;
}

.tag.active,
.tag.ready,
.tag.sent,
.tag.healthy,
.pill.good {
  background: #dcfce7;
  color: #166534;
}

.tag.duplicate {
  background: var(--warning-soft);
  color: var(--warning);
}

.tag.error {
  background: #fee2e2;
  color: #991b1b;
}

.tag.idle {
  background: #eef2ff;
  color: #3730a3;
}

.notice {
  border-color: #99f6e4;
}

dialog {
  max-height: min(860px, calc(100vh - 32px));
  overflow: auto;
  border-color: #e3e9f1;
}

.auth-shell,
.client-shell {
  background: #f5f7fb;
}

.auth-panel,
.code-panel {
  border-color: #e1e8f0;
  box-shadow: 0 22px 60px rgba(15, 23, 42, 0.12);
}

.code-panel {
  width: min(560px, 100%);
}

.client-head {
  align-items: center;
}

.eyebrow {
  color: #0f766e;
}

.code-box {
  border-color: #d8eee9;
  background: #f8fcfb;
}

#codeValue {
  color: #111827;
}

.client-info-note,
.client-info-item {
  border-color: #e1e8f0;
}

.security-notice-overlay {
  position: fixed;
  inset: 0;
  z-index: 200;
  display: grid;
  place-items: center;
  background: rgba(15, 23, 42, 0.48);
  padding: 18px;
}

.security-notice-dialog {
  display: grid;
  width: min(440px, 100%);
  gap: 16px;
  border: 1px solid #d8e0ea;
  border-radius: 8px;
  background: #ffffff;
  box-shadow: 0 24px 70px rgba(15, 23, 42, 0.22);
  padding: 20px;
}

.security-notice-icon {
  display: grid;
  width: 36px;
  height: 36px;
  place-items: center;
  border-radius: 8px;
  background: #ecfdf5;
  color: #0f766e;
  font-size: 20px;
  font-weight: 900;
}

.security-notice-content {
  display: grid;
  gap: 9px;
}

.security-notice-content h2,
.security-notice-content p {
  margin: 0;
}

.security-notice-content h2 {
  color: #0f172a;
  font-size: 20px;
  line-height: 1.25;
}

.security-notice-content p:not(.eyebrow) {
  color: #475569;
  font-size: 14px;
  line-height: 1.65;
}

@media (max-width: 1050px) {
  .overview-layout,
  .dashboard-rank-grid,
  .metric-grid {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 900px) {
  .app-shell {
    display: block;
    padding-bottom: 88px;
  }

  .sidebar {
    position: fixed;
    top: auto;
    right: 0;
    bottom: 0;
    left: 0;
    z-index: 80;
    height: auto;
    gap: 8px;
    border-right: 0;
    background: rgba(17, 24, 39, 0.98);
    box-shadow: 0 -12px 34px rgba(15, 23, 42, 0.18);
    padding: 10px 10px calc(10px + env(safe-area-inset-bottom));
  }

  .brand,
  .sidebar form {
    display: none;
  }

  .nav-tabs {
    display: flex;
    gap: 6px;
    overflow-x: auto;
    padding-bottom: 2px;
    scrollbar-width: none;
  }

  .nav-tabs::-webkit-scrollbar {
    display: none;
  }

  .nav-tabs button {
    flex: 0 0 auto;
    min-width: 76px;
    min-height: 42px;
    justify-content: center;
    padding: 0 8px;
    font-size: 12px;
    text-align: center;
  }

  .workspace {
    padding: 14px 10px 20px;
  }

  .topbar {
    position: static;
    margin: 0 0 12px;
    border: 1px solid #e3e9f1;
    border-radius: 8px;
    padding: 14px;
  }

  .toolbar,
  .toolbar-actions {
    align-items: stretch;
  }

  th {
    position: static;
  }
}

@media (max-width: 520px) {
  .panel,
  .toolbar {
    padding: 12px;
  }

  .metric {
    padding: 13px;
  }

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

  button,
  .button-like {
    min-height: 40px;
  }
}

/* 2026-05-31 ops UI redesign: denser, calmer, mobile-first admin surfaces. */
:root {
  --bg: #f4f6f8;
  --panel: #ffffff;
  --ink: #101828;
  --muted: #667085;
  --line: #d9e0e8;
  --line-soft: #e8edf3;
  --primary: #0f766e;
  --primary-dark: #0a5f59;
  --primary-soft: #e6f4f1;
  --danger: #b42318;
  --danger-soft: #fff1f0;
  --warning: #b54708;
  --warning-soft: #fff7e6;
  --nav: #151922;
  --shadow: 0 16px 38px rgba(16, 24, 40, 0.08);
  --shadow-soft: 0 8px 22px rgba(16, 24, 40, 0.05);
}

body {
  background: #f4f6f8;
  color: var(--ink);
}

button,
.button-like,
input,
select,
textarea,
.metric,
.panel,
.table-wrap,
.toolbar,
.notice,
dialog,
.auth-panel,
.code-panel {
  border-radius: 8px;
}

button,
.button-like {
  min-height: 38px;
  font-size: 13px;
  letter-spacing: 0;
}

button:hover,
.button-like:hover {
  box-shadow: 0 8px 18px rgba(16, 24, 40, 0.08);
}

input,
select,
textarea {
  border-color: #d6dee8;
  background: #fbfdff;
}

input:focus,
select:focus,
textarea:focus {
  border-color: var(--primary);
  box-shadow: 0 0 0 3px rgba(15, 118, 110, 0.12);
}

.primary {
  background: var(--primary);
  color: #ffffff;
  box-shadow: 0 8px 18px rgba(15, 118, 110, 0.16);
}

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

.secondary {
  border-color: #d7dee8;
  background: #ffffff;
  color: #243041;
}

.danger {
  border-color: #f4b5ae;
}

.app-shell {
  grid-template-columns: 232px minmax(0, 1fr);
}

.sidebar {
  background: #151922;
  box-shadow: none;
  padding: 18px 14px;
}

.brand {
  gap: 10px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.08);
  padding: 0 6px 16px;
}

.brand-mark {
  width: 38px;
  height: 38px;
  border: 1px solid rgba(20, 184, 166, 0.28);
  background: #0f766e;
  color: #ffffff;
}

.brand strong {
  color: #ffffff;
  font-size: 15px;
}

.brand small {
  color: #98a2b3;
}

.nav-tabs {
  gap: 5px;
}

.nav-tabs button {
  min-height: 38px;
  justify-content: start;
  border: 1px solid transparent;
  border-radius: 8px;
  color: #cbd5e1;
  padding: 0 11px;
  font-size: 13px;
  font-weight: 750;
}

.nav-tabs button:hover {
  background: rgba(255, 255, 255, 0.06);
  box-shadow: none;
}

.nav-tabs button.active {
  border-color: rgba(20, 184, 166, 0.22);
  background: #20312f;
  color: #ffffff;
}

.workspace {
  width: min(100%, 1520px);
  padding: 20px;
}

.topbar {
  position: sticky;
  top: 0;
  z-index: 40;
  align-items: center;
  margin: -20px -20px 16px;
  border-bottom: 1px solid rgba(214, 222, 232, 0.9);
  background: rgba(244, 246, 248, 0.94);
  padding: 14px 20px;
  backdrop-filter: blur(12px);
}

.topbar h1 {
  color: #0f172a;
  font-size: 22px;
}

.topbar p,
.section-header p,
.toolbar p {
  color: #667085;
  font-size: 13px;
}

.tab-panel.active {
  gap: 12px;
}

.metric-grid {
  gap: 10px;
}

.metric,
.panel,
.table-wrap,
.toolbar {
  border-color: #e2e8f0;
  box-shadow: var(--shadow-soft);
}

.panel {
  padding: 14px;
}

.metric {
  display: grid;
  gap: 5px;
  min-height: 88px;
  align-content: start;
  padding: 14px;
}

.metric span,
.metric small {
  color: #667085;
  font-size: 12px;
}

.metric strong {
  margin-top: 4px;
  color: #0f172a;
  font-size: 25px;
}

.metric-primary {
  border-color: #b7e4dd;
  background: #f1fbf8;
}

.metric-warn {
  border-color: #f8c98a;
  background: #fff8ed;
}

.overview-layout {
  grid-template-columns: minmax(340px, 480px) minmax(0, 1fr);
  gap: 12px;
}

.dashboard-rank-grid {
  gap: 12px;
}

.chart-panel,
.task-panel,
.ops-panel {
  gap: 12px;
}

.chart-header h2,
.panel h2,
.toolbar h2,
.section-header h2 {
  color: #101828;
  font-size: 16px;
}

.trend-chart svg {
  height: 176px;
  border-color: #e2e8f0;
  background:
    linear-gradient(to bottom, rgba(226, 232, 240, 0.85) 1px, transparent 1px) 0 0 / 100% 25%,
    #fcfdff;
}

.trend-line {
  stroke: #0f766e;
  stroke-width: 2.4;
}

.trend-area {
  fill: rgba(15, 118, 110, 0.09);
}

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

.task-card,
.ops-card {
  border-color: #e2e8f0;
  background: #f8fafc;
  padding: 10px;
}

.task-card.has-work {
  border-color: #f8c98a;
  background: #fff8ed;
}

.reminder-list {
  border-color: #e2e8f0;
  background: #fbfdff;
  padding: 10px;
}

.rank-row {
  color: #344054;
}

.meter {
  height: 7px;
  background: #e2e8f0;
}

.meter span,
#meterBar {
  background: #0f766e;
}

.toolbar {
  align-items: end;
  padding: 12px;
}

.toolbar-actions {
  gap: 8px;
}

.search-box {
  width: min(320px, 100%);
}

.search-box span {
  color: #667085;
  font-size: 12px;
}

.table-section {
  padding: 0;
  overflow: hidden;
}

.table-section .section-header {
  margin: 0;
  padding: 13px 15px;
}

.table-wrap.embedded {
  border-width: 1px 0 0;
}

table {
  font-size: 13px;
}

th,
td {
  padding: 11px 13px;
}

th {
  position: sticky;
  top: 0;
  z-index: 2;
  border-bottom: 1px solid #e2e8f0;
  background: #f8fafc;
  color: #667085;
  font-size: 12px;
  text-transform: none;
}

td {
  background: #ffffff;
}

tbody tr:hover td {
  background: #fbfdff;
}

.row-actions,
.actions {
  gap: 7px;
}

.compact-action {
  min-width: 82px;
}

.more-actions summary {
  border-color: #d7dee8;
}

.tag,
.pill {
  min-height: 24px;
  padding: 3px 9px;
  font-size: 12px;
}

.notice {
  border-color: #99f6e4;
  box-shadow: var(--shadow);
}

dialog {
  width: min(720px, calc(100vw - 24px));
  max-height: min(860px, calc(100vh - 24px));
  border-color: #e2e8f0;
  box-shadow: 0 24px 70px rgba(16, 24, 40, 0.18);
}

.dialog-body {
  gap: 12px;
}

.copy-item,
.qr-preview,
.client-info-note,
.client-info-item,
.code-box,
.security-notice-dialog {
  border-color: #e2e8f0;
}

.auth-shell,
.client-shell {
  background: #f4f6f8;
}

.auth-panel,
.code-panel {
  border-color: #e2e8f0;
  box-shadow: 0 20px 54px rgba(16, 24, 40, 0.12);
}

.code-panel {
  width: min(540px, 100%);
}

.code-box {
  background: #f8fcfb;
}

#codeValue {
  color: #0f172a;
}

.security-notice-overlay {
  background: rgba(16, 24, 40, 0.50);
}

.security-notice-icon {
  background: #e6f4f1;
  color: #0f766e;
}

@media (max-width: 1050px) {
  .overview-layout,
  .dashboard-rank-grid,
  .metric-grid {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 900px) {
  .app-shell {
    display: block;
    padding-bottom: 84px;
  }

  .sidebar {
    position: fixed;
    top: auto;
    right: 0;
    bottom: 0;
    left: 0;
    z-index: 80;
    height: auto;
    border-right: 0;
    background: rgba(21, 25, 34, 0.98);
    box-shadow: 0 -12px 34px rgba(16, 24, 40, 0.20);
    padding: 9px 9px calc(9px + env(safe-area-inset-bottom));
  }

  .brand,
  .sidebar form {
    display: none;
  }

  .nav-tabs {
    display: flex;
    gap: 6px;
    overflow-x: auto;
    scrollbar-width: none;
  }

  .nav-tabs::-webkit-scrollbar {
    display: none;
  }

  .nav-tabs button {
    flex: 0 0 auto;
    min-width: 72px;
    min-height: 40px;
    justify-content: center;
    padding: 0 8px;
    font-size: 12px;
    text-align: center;
  }

  .workspace {
    padding: 12px 10px 18px;
  }

  .topbar {
    position: static;
    display: grid;
    gap: 10px;
    margin: 0 0 12px;
    border: 1px solid #e2e8f0;
    border-radius: 8px;
    background: #ffffff;
    padding: 13px;
  }

  .topbar h1 {
    font-size: 19px;
  }

  .toolbar,
  .toolbar-actions {
    display: grid;
    align-items: stretch;
  }

  .toolbar-actions > button,
  .toolbar-actions > label,
  .search-box,
  .compact-filter {
    width: 100%;
  }

  th {
    position: static;
  }

  table {
    min-width: 820px;
  }
}

@media (max-width: 520px) {
  .panel,
  .toolbar {
    padding: 12px;
  }

  .metric {
    min-height: 82px;
    padding: 12px;
  }

  .metric strong {
    font-size: 23px;
  }

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

  button,
  .button-like {
    min-height: 40px;
  }

  .auth-panel,
  .code-panel,
  .security-notice-dialog {
    padding: 18px;
  }
}

/* 2026-05-31 mobile table ergonomics: compact frozen columns and account actions. */
.account-actions {
  flex-wrap: nowrap;
  min-width: 560px;
}

.account-actions.blocked-account-actions {
  min-width: 180px;
}

#tab-ledger .sticky-col strong {
  display: block;
  max-width: 100%;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

@media (max-width: 900px) {
  #tab-ledger table,
  .ledger-table {
    min-width: 100%;
  }

  .ledger-table-wrap {
    max-height: calc(100vh - 250px);
    overscroll-behavior-x: contain;
    -webkit-overflow-scrolling: touch;
  }

  .ledger-table .sticky-col {
    width: var(--ledger-sticky-current, var(--ledger-sticky-width, 160px));
    min-width: var(--ledger-sticky-current, var(--ledger-sticky-width, 160px));
    max-width: var(--ledger-sticky-current, var(--ledger-sticky-width, 160px));
  }

  .ledger-table th.sticky-col {
    font-size: 12px;
  }

  .ledger-table td.sticky-col {
    padding-right: 8px;
  }

  .ledger-table td.sticky-col strong {
    max-width: calc(var(--ledger-sticky-current, var(--ledger-sticky-width, 160px)) - 18px);
  }

  .ledger-table input,
  .ledger-table select {
    min-width: 0;
    max-width: 100%;
  }

  #tab-accounts table {
    min-width: 980px;
  }

  #tab-accounts th:first-child,
  #tab-accounts td:first-child {
    min-width: 220px;
    max-width: 240px;
  }

  #tab-accounts th:nth-child(2),
  #tab-accounts td:nth-child(2) {
    min-width: 76px;
    max-width: 90px;
    text-align: center;
  }

  #tab-accounts td:first-child strong,
  #tab-accounts td:nth-child(2) {
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
  }

  .account-actions {
    min-width: 560px;
    max-width: none;
    overflow-x: auto;
    flex-wrap: nowrap;
    padding-bottom: 2px;
    scrollbar-width: none;
  }

  .account-actions.blocked-account-actions {
    min-width: 180px;
  }

  .account-actions::-webkit-scrollbar {
    display: none;
  }

  .account-actions button,
  .account-actions summary {
    min-height: 32px;
    padding: 0 10px;
    font-size: 12px;
  }
}

@media (max-width: 520px) {
  #tab-ledger table,
  .ledger-table {
    min-width: 100%;
  }

  .ledger-table .sticky-col {
    width: var(--ledger-sticky-current, var(--ledger-sticky-width, 156px));
    min-width: var(--ledger-sticky-current, var(--ledger-sticky-width, 156px));
    max-width: var(--ledger-sticky-current, var(--ledger-sticky-width, 156px));
    padding-left: 9px;
  }

  .ledger-table td.sticky-col strong {
    max-width: calc(var(--ledger-sticky-current, var(--ledger-sticky-width, 156px)) - 18px);
    font-size: 12px;
  }

  .ledger-table input,
  .ledger-table select {
    min-width: 0;
    max-width: 100%;
  }

  #tab-accounts table {
    min-width: 940px;
  }

  #tab-accounts th:first-child,
  #tab-accounts td:first-child {
    min-width: 205px;
    max-width: 220px;
  }

  #tab-accounts th:nth-child(2),
  #tab-accounts td:nth-child(2) {
    min-width: 68px;
    max-width: 78px;
  }

  .account-actions {
    min-width: 540px;
    max-width: none;
  }
}

/* 2026-06-01 workbench redesign: visual refresh without changing data or flows. */
:root {
  --bg: #eef3f7;
  --panel: #ffffff;
  --ink: #111827;
  --text: #111827;
  --muted: #64748b;
  --line: #cfd8e3;
  --line-soft: #e6edf4;
  --primary: #0f766e;
  --primary-dark: #0b5f59;
  --primary-soft: #e5f6f2;
  --nav: #17212f;
  --shadow: 0 18px 44px rgba(15, 23, 42, 0.10);
  --shadow-soft: 0 10px 28px rgba(15, 23, 42, 0.08);
}

body {
  background:
    linear-gradient(180deg, #f7fafc 0, #eef3f7 360px),
    var(--bg);
}

button,
.button-like {
  border-radius: 9px;
}

input,
select,
textarea {
  border-radius: 9px;
  background: #fbfdff;
}

.app-shell {
  grid-template-columns: 236px minmax(0, 1fr);
}

.sidebar {
  gap: 18px;
  border-right: 1px solid rgba(255, 255, 255, 0.08);
  background: #17212f;
  padding: 20px 16px;
}

.brand {
  border-bottom: 1px solid rgba(226, 232, 240, 0.12);
  padding: 4px 4px 18px;
}

.brand-mark {
  width: 40px;
  height: 40px;
  border-radius: 10px;
  background: #14b8a6;
  color: #052e2b;
}

.brand strong {
  font-size: 15px;
}

.nav-tabs {
  gap: 5px;
}

.nav-tabs button {
  min-height: 40px;
  border-radius: 9px;
  padding: 0 11px;
  color: #cbd5e1;
  font-size: 13px;
}

.nav-tabs button.active {
  border-color: rgba(45, 212, 191, 0.36);
  background: #0f766e;
  box-shadow: 0 8px 20px rgba(20, 184, 166, 0.18);
}

.workspace {
  padding: 24px;
}

.topbar {
  position: sticky;
  top: 0;
  z-index: 30;
  align-items: center;
  border: 1px solid rgba(226, 232, 240, 0.9);
  border-radius: 12px;
  background: rgba(255, 255, 255, 0.88);
  box-shadow: 0 8px 24px rgba(15, 23, 42, 0.05);
  margin-bottom: 16px;
  padding: 14px 16px;
  backdrop-filter: blur(12px);
}

.topbar h1 {
  margin: 0;
  font-size: 21px;
}

.topbar p {
  font-size: 13px;
}

.metric,
.panel,
.table-wrap,
.toolbar {
  border-color: rgba(207, 216, 227, 0.82);
  border-radius: 12px;
  box-shadow: 0 1px 2px rgba(15, 23, 42, 0.04);
}

.toolbar {
  align-items: center;
  background: rgba(255, 255, 255, 0.92);
  padding: 14px;
}

.toolbar h2,
.panel h2,
.section-header h2,
.chart-header h2 {
  color: #0f172a;
  font-size: 17px;
}

.toolbar-actions {
  gap: 8px;
}

.toolbar-actions .primary,
.toolbar-actions .secondary,
.actions .primary,
.actions .secondary,
.actions .danger {
  min-height: 36px;
}

.dashboard-metrics {
  grid-template-columns: repeat(5, minmax(150px, 1fr));
}

.metric {
  min-height: 98px;
  padding: 15px;
}

.metric span {
  font-weight: 800;
}

.metric strong {
  margin-top: 6px;
  color: #0f172a;
  font-size: 30px;
}

.metric-primary {
  border-color: rgba(15, 118, 110, 0.28);
  background: linear-gradient(180deg, #e6fffb 0%, #ffffff 76%);
}

.metric-warn {
  border-color: #fed7aa;
  background: linear-gradient(180deg, #fff7ed 0%, #ffffff 74%);
}

.overview-layout {
  grid-template-columns: minmax(390px, 1.08fr) minmax(340px, 0.92fr);
}

.task-card,
.ops-card,
.reminder-list,
.field-options-editor,
.copy-item,
.qr-preview,
.backup-status {
  border-radius: 10px;
}

.task-card {
  background: #f8fafc;
}

.task-card.has-work {
  border-color: #fbbf24;
  background: #fffbeb;
}

.reminder-list {
  border: 1px solid var(--line-soft);
  background: #fbfdff;
  padding: 12px;
}

.reminder-list > strong {
  display: block;
  margin-bottom: 7px;
}

.reminder-item {
  align-items: center;
}

.chart-panel {
  padding: 16px;
}

.trend-chart svg {
  border-radius: 10px;
  background:
    linear-gradient(to bottom, rgba(226, 232, 240, 0.85) 1px, transparent 1px) 0 0 / 100% 25%,
    #fbfdff;
}

.table-wrap {
  background: #ffffff;
}

table {
  font-size: 13px;
}

th {
  position: sticky;
  top: 0;
  z-index: 2;
  background: #f8fafc;
  color: #475569;
  font-size: 12px;
  text-transform: none;
}

th,
td {
  border-bottom-color: #e7edf4;
}

tbody tr:hover td {
  background: #fbfdff;
}

.tag {
  border-radius: 999px;
  font-weight: 900;
}

.token-chip {
  border-radius: 999px;
}

.notice {
  top: auto;
  right: 22px;
  bottom: 22px;
  max-width: min(360px, calc(100vw - 28px));
  min-height: 0;
  border-radius: 12px;
  padding: 11px 13px;
  font-size: 14px;
  line-height: 1.35;
}

dialog {
  border-radius: 14px;
  box-shadow: 0 22px 80px rgba(15, 23, 42, 0.22);
}

.dialog-body {
  border-radius: 14px;
}

.ledger-table-wrap {
  border-radius: 0 0 12px 12px;
}

.mobile-perf-note {
  margin: 0 12px 10px;
}

@media (max-width: 1050px) {
  .dashboard-metrics {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

@media (max-width: 900px) {
  body {
    background: #f4f7fa;
  }

  .app-shell {
    padding-bottom: 76px;
  }

  .sidebar {
    border-top: 1px solid rgba(226, 232, 240, 0.25);
    background: rgba(15, 23, 42, 0.96);
    padding: 7px 8px calc(7px + env(safe-area-inset-bottom));
    backdrop-filter: blur(18px);
  }

  .nav-tabs {
    display: grid;
    grid-template-columns: repeat(9, minmax(56px, 1fr));
    gap: 4px;
    overflow-x: auto;
  }

  .nav-tabs button {
    min-width: 56px;
    min-height: 48px;
    border-radius: 10px;
    padding: 5px 4px;
    color: #cbd5e1;
    font-size: 11px;
    line-height: 1.15;
  }

  .nav-tabs button::before {
    display: block;
    margin-bottom: 3px;
    color: #94a3b8;
    font-size: 15px;
    line-height: 1;
  }

  .nav-tabs button[data-tab="overview"]::before { content: "⌂"; }
  .nav-tabs button[data-tab="accounts"]::before { content: "□"; }
  .nav-tabs button[data-tab="ledger"]::before { content: "▦"; }
  .nav-tabs button[data-tab="tokens"]::before { content: "◇"; }
  .nav-tabs button[data-tab="migration"]::before { content: "⇄"; }
  .nav-tabs button[data-tab="health"]::before { content: "✓"; }
  .nav-tabs button[data-tab="logs"]::before { content: "≡"; }
  .nav-tabs button[data-tab="audit"]::before { content: "◎"; }
  .nav-tabs button[data-tab="settings"]::before { content: "⚙"; }

  .nav-tabs button.active {
    background: #0f766e;
    color: #ffffff;
  }

  .nav-tabs button.active::before {
    color: #ccfbf1;
  }

  .workspace {
    padding: 10px 10px 18px;
  }

  .topbar {
    position: static;
    display: flex;
    margin-bottom: 10px;
    padding: 12px;
  }

  .topbar h1 {
    font-size: 18px;
  }

  .topbar p {
    display: none;
  }

  .topbar .secondary {
    min-height: 34px;
    padding: 0 10px;
    font-size: 12px;
  }

  .tab-panel.active {
    gap: 12px;
  }

  .toolbar {
    gap: 10px;
    padding: 12px;
  }

  .toolbar-actions {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    width: 100%;
  }

  .toolbar-actions > button,
  .toolbar-actions > label,
  .search-box,
  .compact-filter {
    width: 100%;
  }

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

  .metric {
    min-height: 86px;
    padding: 12px;
  }

  .metric strong {
    font-size: 24px;
  }

  .panel {
    padding: 14px;
  }

  .section-header {
    margin-bottom: 10px;
  }

  .table-wrap {
    border-radius: 12px;
  }

  table {
    font-size: 13px;
  }

  .notice {
    right: 10px;
    bottom: calc(80px + env(safe-area-inset-bottom));
    width: min(420px, calc(100vw - 20px));
  }
}

@media (max-width: 1200px) and (pointer: coarse) {
  .app-shell {
    display: block;
    padding-bottom: 76px;
  }

  .sidebar {
    position: fixed;
    top: auto;
    right: 0;
    bottom: 0;
    left: 0;
    z-index: 80;
    height: auto;
    border-top: 1px solid rgba(226, 232, 240, 0.25);
    border-right: 0;
    background: rgba(15, 23, 42, 0.96);
    padding: 7px 8px calc(7px + env(safe-area-inset-bottom));
    box-shadow: 0 -10px 26px rgba(15, 23, 42, 0.18);
    backdrop-filter: blur(18px);
  }

  .brand,
  .sidebar form {
    display: none;
  }

  .nav-tabs {
    display: grid;
    grid-template-columns: repeat(9, minmax(56px, 1fr));
    gap: 4px;
    overflow-x: auto;
    padding-bottom: 2px;
    scrollbar-width: none;
  }

  .nav-tabs::-webkit-scrollbar {
    display: none;
  }

  .nav-tabs button {
    min-width: 56px;
    min-height: 48px;
    justify-content: center;
    border-radius: 10px;
    padding: 5px 4px;
    text-align: center;
    font-size: 11px;
    line-height: 1.15;
  }

  .workspace {
    padding: 10px 10px 18px;
  }

  .topbar {
    position: static;
    margin-bottom: 10px;
  }

  .notice {
    right: 10px;
    bottom: calc(80px + env(safe-area-inset-bottom));
    max-width: min(330px, calc(100vw - 20px));
  }
}

.force-mobile-nav .app-shell {
  display: block;
  padding-bottom: 76px;
}

.force-mobile-nav .sidebar {
  position: fixed;
  top: auto;
  right: 0;
  bottom: 0;
  left: 0;
  z-index: 100;
  height: auto;
  border-top: 1px solid rgba(226, 232, 240, 0.25);
  border-right: 0;
  background: rgba(15, 23, 42, 0.96);
  padding: 7px 8px calc(7px + env(safe-area-inset-bottom));
  box-shadow: 0 -10px 26px rgba(15, 23, 42, 0.18);
  backdrop-filter: blur(18px);
}

.force-mobile-nav .brand,
.force-mobile-nav .sidebar form {
  display: none;
}

.force-mobile-nav .nav-tabs {
  display: grid;
  grid-template-columns: repeat(9, minmax(56px, 1fr));
  gap: 4px;
  overflow-x: auto;
  padding-bottom: 2px;
  scrollbar-width: none;
}

.force-mobile-nav .nav-tabs::-webkit-scrollbar {
  display: none;
}

.force-mobile-nav .nav-tabs button {
  min-width: 56px;
  min-height: 48px;
  justify-content: center;
  border-radius: 10px;
  padding: 5px 4px;
  text-align: center;
  font-size: 11px;
  line-height: 1.15;
}

.force-mobile-nav .workspace {
  padding: 10px 10px 18px;
}

.force-mobile-nav .topbar {
  position: static;
  margin-bottom: 10px;
}

.force-mobile-nav .notice {
  right: 10px;
  bottom: calc(80px + env(safe-area-inset-bottom));
  max-width: min(330px, calc(100vw - 20px));
}

@media (max-width: 520px) {
  .dashboard-metrics,
  .metric-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

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

  .toolbar-actions {
    grid-template-columns: 1fr;
  }

  .account-status-switch {
    gap: 7px;
  }

  .account-status-switch button {
    min-height: 48px;
    padding: 8px 9px;
    font-size: 12px;
  }

  .account-status-switch button strong {
    font-size: 17px;
  }

  .inline-fields {
    grid-template-columns: 1fr;
  }
}

/* 2026-06-13 product UI redesign: stable ops console with cleaner hierarchy. */
:root {
  --bg: #edf2f6;
  --panel: #ffffff;
  --ink: #182230;
  --text: #182230;
  --muted: #667085;
  --line: #cbd5e1;
  --line-soft: #e5ebf2;
  --primary: #0e746f;
  --primary-dark: #085c59;
  --primary-soft: #e4f5f2;
  --accent: #335cff;
  --accent-soft: #edf1ff;
  --danger: #b42318;
  --danger-soft: #fff0ee;
  --warning: #a15c07;
  --warning-soft: #fff6e5;
  --success: #16784f;
  --success-soft: #e8f7ef;
  --nav: #101722;
  --shadow: 0 20px 46px rgba(16, 24, 40, 0.10);
  --shadow-soft: 0 8px 20px rgba(16, 24, 40, 0.06);
  --focus: 0 0 0 3px rgba(14, 116, 111, 0.16);
}

html {
  background: var(--bg);
}

body {
  background:
    linear-gradient(180deg, #f7fafc 0, #edf2f6 330px),
    var(--bg);
  color: var(--ink);
  font-size: 14px;
}

button,
.button-like,
input,
select,
textarea {
  border-radius: 8px;
}

button,
.button-like {
  min-height: 38px;
  padding: 0 13px;
  font-size: 13px;
  font-weight: 800;
}

button:hover,
.button-like:hover {
  box-shadow: 0 7px 16px rgba(16, 24, 40, 0.08);
}

button:focus-visible,
.button-like:focus-visible,
input:focus-visible,
select:focus-visible,
textarea:focus-visible,
summary:focus-visible {
  outline: none;
  box-shadow: var(--focus);
}

input,
select,
textarea {
  min-height: 40px;
  border-color: #d7e0ea;
  background: #fbfdff;
  color: #182230;
}

input:focus,
select:focus,
textarea:focus {
  border-color: var(--primary);
  box-shadow: var(--focus);
}

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

.primary {
  background: var(--primary);
  color: #ffffff;
  box-shadow: 0 8px 18px rgba(14, 116, 111, 0.18);
}

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

.secondary {
  border: 1px solid #d7e0ea;
  background: #ffffff;
  color: #263445;
}

.secondary:hover {
  border-color: #b9c6d5;
  background: #f8fafc;
}

.danger {
  border: 1px solid #f3b8b2;
  background: var(--danger-soft);
  color: var(--danger);
}

.ghost {
  border-color: rgba(255, 255, 255, 0.18);
  color: #d9e4f0;
}

.app-shell {
  grid-template-columns: 248px minmax(0, 1fr);
}

.sidebar {
  gap: 20px;
  border-right: 1px solid rgba(226, 232, 240, 0.08);
  background:
    linear-gradient(180deg, #121b29 0, #101722 48%, #0e141f 100%);
  padding: 22px 16px;
}

.brand {
  gap: 11px;
  border-bottom: 1px solid rgba(226, 232, 240, 0.10);
  padding: 0 6px 18px;
}

.brand-mark {
  width: 42px;
  height: 42px;
  border: 1px solid rgba(45, 212, 191, 0.28);
  border-radius: 8px;
  background: #e4f5f2;
  color: #075a56;
  box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.55);
}

.brand strong {
  color: #ffffff;
  font-size: 15px;
}

.brand small {
  color: #94a3b8;
}

.nav-tabs {
  gap: 6px;
}

.nav-tabs button {
  min-height: 42px;
  justify-content: start;
  border: 1px solid transparent;
  border-radius: 8px;
  color: #cbd5e1;
  padding: 0 12px;
  text-align: left;
}

.nav-tabs button::before {
  display: inline-grid;
  width: 22px;
  height: 22px;
  margin-right: 8px;
  place-items: center;
  border-radius: 6px;
  background: rgba(148, 163, 184, 0.12);
  color: #aab7c8;
  font-size: 12px;
}

.nav-tabs button[data-tab="overview"]::before { content: "01"; }
.nav-tabs button[data-tab="accounts"]::before { content: "02"; }
.nav-tabs button[data-tab="tokens"]::before { content: "03"; }
.nav-tabs button[data-tab="ledger"]::before { content: "04"; }
.nav-tabs button[data-tab="migration"]::before { content: "05"; }
.nav-tabs button[data-tab="health"]::before { content: "06"; }
.nav-tabs button[data-tab="logs"]::before { content: "07"; }
.nav-tabs button[data-tab="audit"]::before { content: "08"; }
.nav-tabs button[data-tab="settings"]::before { content: "09"; }

.nav-tabs button:hover {
  background: rgba(255, 255, 255, 0.07);
  box-shadow: none;
}

.nav-tabs button.active {
  border-color: rgba(45, 212, 191, 0.34);
  background: #163d3b;
  color: #ffffff;
  box-shadow: inset 3px 0 0 #2dd4bf;
}

.nav-tabs button.active::before {
  background: rgba(204, 251, 241, 0.16);
  color: #ccfbf1;
}

.workspace {
  width: min(100%, 1560px);
  padding: 22px;
}

.topbar {
  position: sticky;
  top: 0;
  z-index: 35;
  align-items: center;
  margin: 0 0 16px;
  border: 1px solid rgba(203, 213, 225, 0.72);
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.90);
  box-shadow: 0 1px 2px rgba(16, 24, 40, 0.05);
  padding: 15px 16px;
  backdrop-filter: blur(14px);
}

.topbar h1 {
  color: #101828;
  font-size: 22px;
}

.topbar p,
.section-header p,
.toolbar p {
  color: #667085;
  font-size: 13px;
}

.notice {
  border-color: #99f6e4;
  border-radius: 8px;
  background: #ecfdf5;
  color: #056455;
  box-shadow: var(--shadow);
}

.tab-panel.active {
  gap: 14px;
}

.metric,
.panel,
.table-wrap,
.toolbar,
.auth-panel,
.code-panel,
dialog {
  border-color: rgba(203, 213, 225, 0.86);
  border-radius: 8px;
  box-shadow: var(--shadow-soft);
}

.panel,
.toolbar {
  background: rgba(255, 255, 255, 0.94);
}

.panel {
  padding: 16px;
}

.toolbar {
  align-items: center;
  padding: 14px;
}

.toolbar h2,
.panel h2,
.section-header h2,
.chart-header h2 {
  color: #101828;
  font-size: 17px;
}

.toolbar-actions {
  gap: 9px;
}

.dashboard-metrics {
  grid-template-columns: repeat(5, minmax(145px, 1fr));
}

.metric {
  position: relative;
  min-height: 104px;
  overflow: hidden;
  background: #ffffff;
  padding: 16px;
}

.metric::before {
  content: "";
  position: absolute;
  top: 0;
  right: 0;
  left: 0;
  height: 3px;
  background: #d7e0ea;
}

.metric-primary::before {
  background: var(--primary);
}

.metric-warn::before {
  background: #f59e0b;
}

.metric span {
  color: #667085;
  font-size: 12px;
  font-weight: 800;
}

.metric strong {
  margin-top: 7px;
  color: #101828;
  font-size: 30px;
  line-height: 1;
}

.metric small {
  color: #667085;
}

.metric-primary {
  border-color: rgba(14, 116, 111, 0.25);
  background: linear-gradient(180deg, #f0fbf8 0, #ffffff 72%);
}

.metric-warn {
  border-color: #fed7aa;
  background: linear-gradient(180deg, #fff8ed 0, #ffffff 72%);
}

.overview-layout {
  grid-template-columns: minmax(390px, 1.06fr) minmax(360px, 0.94fr);
  gap: 14px;
}

.dashboard-rank-grid {
  gap: 14px;
}

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

.task-card,
.ops-card,
.setting-card,
.reminder-list,
.client-info-item,
.client-info-note,
.copy-item,
.qr-preview,
.backup-status,
.field-options-editor {
  border-radius: 8px;
}

.task-card,
.ops-card,
.setting-card {
  border-color: #e2e8f0;
  background: #f8fafc;
}

.task-card.has-work {
  border-color: #f6c36b;
  background: #fff8ed;
}

.task-card strong {
  color: #101828;
}

.reminder-list {
  border: 1px solid #e2e8f0;
  background: #fbfdff;
}

.reminder-item {
  align-items: center;
}

.chart-panel {
  padding: 16px;
}

.chart-header > strong {
  color: var(--primary);
}

.trend-chart svg {
  height: 182px;
  border-color: #e2e8f0;
  border-radius: 8px;
  background:
    linear-gradient(to bottom, rgba(226, 232, 240, 0.82) 1px, transparent 1px) 0 0 / 100% 25%,
    #fbfdff;
}

.trend-line {
  stroke: var(--primary);
}

.trend-area {
  fill: rgba(14, 116, 111, 0.10);
}

.meter {
  height: 7px;
  background: #e2e8f0;
}

.meter span,
#meterBar {
  background: linear-gradient(90deg, var(--primary), #335cff);
}

.account-status-switch {
  gap: 9px;
}

.account-status-switch button {
  min-height: 58px;
  border-color: #e2e8f0;
  border-radius: 8px;
  background: #ffffff;
}

.account-status-switch button.active {
  border-color: rgba(14, 116, 111, 0.34);
  background: var(--primary-soft);
  box-shadow: inset 0 0 0 1px rgba(14, 116, 111, 0.08);
}

.account-status-switch button strong {
  color: #101828;
}

.account-status-switch button.active strong,
.account-status-switch button.active span {
  color: #075a56;
}

.table-section {
  overflow: hidden;
  padding: 0;
}

.table-section .section-header {
  margin: 0;
  padding: 14px 16px;
}

.table-wrap {
  background: #ffffff;
}

.table-wrap.embedded {
  border-width: 1px 0 0;
}

table {
  border-collapse: separate;
  border-spacing: 0;
  font-size: 13px;
}

th,
td {
  border-bottom: 1px solid #e7edf4;
  padding: 11px 13px;
}

th {
  background: #f8fafc;
  color: #526176;
  font-size: 12px;
  font-weight: 900;
  text-transform: none;
}

td {
  background: #ffffff;
}

tbody tr:hover td {
  background: #f9fbfd;
}

.compact-action {
  min-width: 78px;
}

.tag,
.pill {
  min-height: 24px;
  border: 1px solid transparent;
  border-radius: 999px;
  padding: 3px 9px;
  font-size: 12px;
  font-weight: 900;
}

.tag.active,
.tag.ready,
.tag.sent,
.tag.healthy,
.pill.good {
  border-color: #bcebd0;
  background: var(--success-soft);
  color: var(--success);
}

.tag.idle {
  border-color: #c7d2fe;
  background: var(--accent-soft);
  color: #3347a8;
}

.tag.blocked,
.tag.pending,
.tag.duplicate,
.tag.warning {
  border-color: #fed7aa;
  background: var(--warning-soft);
  color: var(--warning);
}

.tag.error,
.tag.revoked,
.tag.archived,
.tag.bad,
.pill.bad {
  border-color: #fecaca;
  background: var(--danger-soft);
  color: var(--danger);
}

dialog {
  width: min(720px, calc(100vw - 28px));
  max-height: min(860px, calc(100vh - 28px));
  padding: 20px;
}

dialog::backdrop {
  background: rgba(16, 24, 40, 0.46);
  backdrop-filter: blur(2px);
}

.auth-shell,
.client-shell {
  align-items: center;
  background:
    linear-gradient(135deg, #f7fafc 0, #eef4f7 48%, #f7f8fb 100%);
}

.auth-panel,
.code-panel {
  border-color: rgba(203, 213, 225, 0.86);
  background: rgba(255, 255, 255, 0.96);
  box-shadow: 0 24px 72px rgba(16, 24, 40, 0.16);
}

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

.code-panel {
  width: min(560px, 100%);
  padding: 30px;
}

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

.client-head {
  align-items: center;
}

.client-head h1,
.auth-panel h1,
.code-panel h1 {
  color: #101828;
}

.code-box {
  gap: 15px;
  border-color: rgba(14, 116, 111, 0.22);
  border-radius: 8px;
  background: linear-gradient(180deg, #f2fbf8 0, #ffffff 100%);
  padding: 20px;
}

.code-box.waiting {
  border-color: #d7e0ea;
  background: #f8fafc;
}

#codeValue {
  color: #101828;
  font-size: 56px;
}

.code-label,
.countdown,
.watermark-text {
  color: #667085;
}

.client-info {
  margin-top: 16px;
}

.client-info-item {
  border-color: #e2e8f0;
  background: #f8fafc;
}

.client-info-note {
  border-color: #c7d2fe;
  background: var(--accent-soft);
  color: #3347a8;
}

.client-info-note.warning {
  border-color: #fed7aa;
  background: var(--warning-soft);
  color: #9a4d00;
}

.security-notice-overlay {
  background: rgba(16, 24, 40, 0.54);
  backdrop-filter: blur(3px);
}

.security-notice-dialog {
  border-color: #d7e0ea;
  border-radius: 8px;
  box-shadow: 0 26px 84px rgba(16, 24, 40, 0.24);
}

.security-notice-icon {
  border-radius: 8px;
  background: var(--primary-soft);
  color: #075a56;
}

@media (max-width: 1180px) {
  .dashboard-metrics,
  .metric-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .overview-layout,
  .dashboard-rank-grid,
  .settings-grid {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 900px) {
  .app-shell {
    display: block;
    padding-bottom: 78px;
  }

  .sidebar {
    position: fixed;
    top: auto;
    right: 0;
    bottom: 0;
    left: 0;
    z-index: 100;
    height: auto;
    border-top: 1px solid rgba(226, 232, 240, 0.20);
    border-right: 0;
    background: rgba(16, 23, 34, 0.97);
    box-shadow: 0 -12px 34px rgba(16, 24, 40, 0.22);
    padding: 7px 8px calc(7px + env(safe-area-inset-bottom));
    backdrop-filter: blur(18px);
  }

  .brand,
  .sidebar form {
    display: none;
  }

  .nav-tabs,
  .force-mobile-nav .nav-tabs {
    display: grid;
    grid-template-columns: repeat(9, minmax(56px, 1fr));
    gap: 4px;
    overflow-x: auto;
    scrollbar-width: none;
  }

  .nav-tabs button,
  .force-mobile-nav .nav-tabs button {
    min-width: 56px;
    min-height: 48px;
    justify-content: center;
    border-radius: 8px;
    padding: 5px 4px;
    font-size: 11px;
    line-height: 1.15;
    text-align: center;
  }

  .nav-tabs button::before,
  .force-mobile-nav .nav-tabs button::before {
    display: block;
    width: auto;
    height: auto;
    margin: 0 0 3px;
    background: transparent;
    font-size: 10px;
  }

  .workspace,
  .force-mobile-nav .workspace {
    padding: 10px 10px 18px;
  }

  .topbar,
  .force-mobile-nav .topbar {
    position: static;
    display: flex;
    margin-bottom: 10px;
    padding: 12px;
  }

  .topbar h1 {
    font-size: 18px;
  }

  .topbar p {
    display: none;
  }

  .toolbar,
  .toolbar-actions {
    display: grid;
    align-items: stretch;
  }

  .toolbar-actions {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    width: 100%;
  }

  .toolbar-actions > button,
  .toolbar-actions > label,
  .search-box,
  .compact-filter {
    width: 100%;
  }

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

  th {
    position: static;
  }

  .notice,
  .force-mobile-nav .notice {
    right: 10px;
    bottom: calc(82px + env(safe-area-inset-bottom));
    width: min(420px, calc(100vw - 20px));
    max-width: calc(100vw - 20px);
  }
}

@media (max-width: 560px) {
  .auth-shell,
  .client-shell {
    padding: 16px;
  }

  .auth-panel,
  .code-panel,
  .security-notice-dialog {
    padding: 20px;
  }

  .dashboard-metrics,
  .metric-grid,
  .task-summary-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .metric {
    min-height: 90px;
    padding: 13px;
  }

  .metric strong {
    font-size: 24px;
  }

  .toolbar-actions {
    grid-template-columns: 1fr;
  }

  .account-status-switch {
    gap: 7px;
  }

  .account-status-switch button {
    min-height: 50px;
    padding: 8px 9px;
  }

  .account-status-switch button strong {
    font-size: 17px;
  }

  #codeValue {
    font-size: 44px;
  }
}

/* Operations workspace refresh: dense, calm, and designed for daily use. */
:root {
  --bg: #f5f7fa;
  --panel: #ffffff;
  --ink: #1d2433;
  --muted: #667085;
  --line: #dfe5ec;
  --line-soft: #ebeff4;
  --primary: #087f72;
  --primary-dark: #05675d;
  --primary-soft: #e7f6f3;
  --accent: #2f6fce;
  --accent-soft: #edf4ff;
  --warning: #a56008;
  --warning-soft: #fff6e8;
  --danger: #c43b36;
  --danger-soft: #fff0ef;
  --nav: #1c1f25;
  --shadow: 0 12px 32px rgba(21, 31, 49, 0.07);
}

body {
  background: var(--bg);
  color: var(--ink);
  font-family: Inter, "PingFang SC", "Microsoft YaHei", Arial, sans-serif;
}

button,
.button-like {
  min-height: 36px;
  border-radius: 6px;
  font-size: 13px;
  font-weight: 750;
}

.primary {
  background: var(--primary);
  box-shadow: none;
}

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

.secondary,
.button-like.secondary {
  border-color: #d6dee8;
  background: #ffffff;
  color: #344054;
}

.secondary:hover,
.button-like.secondary:hover {
  border-color: #b9c7d8;
  background: #f8fafc;
}

input,
select,
textarea {
  min-height: 38px;
  border-color: #d8e0e9;
  border-radius: 6px;
  background: #ffffff;
  color: var(--ink);
}

input:focus,
select:focus,
textarea:focus {
  border-color: var(--accent);
  box-shadow: 0 0 0 3px rgba(47, 111, 206, 0.12);
}

.app-shell {
  grid-template-columns: 236px minmax(0, 1fr);
  background: var(--bg);
}

.sidebar {
  gap: 18px;
  border-right: 1px solid rgba(255, 255, 255, 0.07);
  background: #1c1f25;
  padding: 22px 14px;
}

.brand {
  gap: 10px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.10);
  padding: 0 8px 18px;
}

.brand-mark {
  width: 36px;
  height: 36px;
  border: 1px solid rgba(153, 243, 226, 0.34);
  border-radius: 7px;
  background: #d9fbf3;
  color: #075f57;
  font-size: 13px;
}

.brand strong {
  color: #ffffff;
  font-size: 15px;
  letter-spacing: 0;
}

.brand small {
  margin-top: 2px;
  color: #9ca7b8;
  font-size: 11px;
}

.nav-tabs {
  gap: 4px;
}

.nav-tabs button {
  min-height: 40px;
  border: 1px solid transparent;
  border-radius: 6px;
  color: #bac3d0;
  padding: 0 10px;
  font-size: 13px;
}

.nav-tabs button::before {
  width: 20px;
  height: 20px;
  margin-right: 8px;
  border-radius: 5px;
  background: rgba(255, 255, 255, 0.07);
  color: #aeb8c5;
  font-size: 10px;
  font-weight: 800;
}

.nav-tabs button:hover {
  background: rgba(255, 255, 255, 0.06);
  color: #ffffff;
}

.nav-tabs button.active {
  border-color: rgba(104, 225, 206, 0.26);
  background: #183d3a;
  box-shadow: inset 3px 0 0 #68e1ce;
  color: #ffffff;
}

.nav-tabs button.active::before {
  background: rgba(204, 251, 241, 0.16);
  color: #d5fff7;
}

.sidebar form .ghost {
  min-height: 36px;
  border: 1px solid rgba(255, 255, 255, 0.12);
  background: transparent;
  color: #c8d1db;
  font-size: 12px;
}

.workspace {
  width: min(100%, 1540px);
  padding: 24px 28px 36px;
}

.topbar {
  position: sticky;
  top: 0;
  z-index: 35;
  align-items: center;
  margin: 0 -4px 18px;
  border-bottom: 1px solid #e0e6ed;
  background: rgba(245, 247, 250, 0.94);
  padding: 6px 4px 17px;
  backdrop-filter: blur(14px);
}

.workspace-kicker {
  display: block;
  color: var(--accent);
  font-size: 10px;
  font-weight: 800;
  letter-spacing: 0.08em;
}

.topbar h1 {
  margin-top: 4px;
  color: #182230;
  font-size: 25px;
  line-height: 1.1;
}

.topbar p {
  color: #667085;
  font-size: 13px;
}

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

.system-status {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  color: #526070;
  font-size: 12px;
  font-weight: 700;
}

.system-status i {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: #16a34a;
  box-shadow: 0 0 0 3px #dcfce7;
}

.metric-grid {
  gap: 10px;
}

.metric,
.panel,
.table-wrap,
.toolbar {
  border-color: #e0e6ed;
  border-radius: 8px;
  box-shadow: none;
}

.metric {
  position: relative;
  min-height: 112px;
  overflow: hidden;
  background: #ffffff;
  padding: 15px 16px;
}

.metric::before {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 3px;
  background: #b7c4d5;
  content: "";
}

.metric-primary {
  border-color: #bde8e0;
  background: #ffffff;
}

.metric-primary::before {
  background: var(--primary);
}

.metric-warn {
  border-color: #f4d7ad;
  background: #ffffff;
}

.metric-warn::before {
  background: #d78917;
}

.metric span,
.metric small {
  color: #697586;
}

.metric strong {
  margin-top: 10px;
  color: #1d2939;
  font-size: 29px;
  letter-spacing: 0;
}

.metric small {
  margin-top: auto;
}

.overview-layout,
.dashboard-rank-grid {
  gap: 12px;
  margin-top: 12px;
}

.overview-layout {
  grid-template-columns: minmax(500px, 1.2fr) minmax(380px, 0.8fr);
}

.panel {
  background: #ffffff;
  padding: 18px;
}

.panel h2,
.toolbar h2,
.section-header h2 {
  color: #1d2939;
  font-size: 16px;
  line-height: 1.25;
}

.section-header,
.chart-header {
  padding-bottom: 12px;
}

.section-header p,
.chart-header p,
.toolbar p {
  color: #667085;
  font-size: 12px;
}

.task-panel,
.chart-panel {
  gap: 12px;
}

.task-summary-grid {
  gap: 0;
  border-top: 1px solid #edf1f5;
  border-bottom: 1px solid #edf1f5;
}

.task-card {
  min-height: 80px;
  border: 0;
  border-right: 1px solid #edf1f5;
  border-radius: 0;
  background: transparent;
  padding: 12px 10px;
}

.task-card:last-child {
  border-right: 0;
}

.task-card.has-work {
  background: #fffaf0;
  box-shadow: inset 0 -2px 0 #e7a23b;
}

.task-card strong {
  color: #1d2939;
  font-size: 22px;
}

.task-list-grid {
  gap: 0;
}

.reminder-list {
  border: 0;
  border-top: 1px solid #edf1f5;
  border-radius: 0;
  background: transparent;
  padding: 12px 0;
}

.reminder-list:first-child {
  border-top: 0;
  padding-top: 0;
}

.reminder-item {
  min-height: 34px;
}

.chart-panel {
  background: #ffffff;
}

.chart-header > strong {
  color: var(--accent);
  font-size: 27px;
}

.trend-chart svg {
  height: 205px;
  border-color: #e7ecf2;
  border-radius: 7px;
  background: #fbfcfe;
}

.trend-area {
  fill: rgba(47, 111, 206, 0.11);
}

.trend-line,
.trend-dot {
  stroke: var(--accent);
}

.rank-bar {
  gap: 6px;
  padding: 2px 0 10px;
}

.rank-row {
  color: #344054;
}

.meter {
  height: 6px;
  border-radius: 999px;
  background: #edf1f5;
}

.meter span {
  border-radius: inherit;
  background: var(--accent);
}

.rank-actions .compact-action {
  min-height: 28px;
  border-color: #d8e3f0;
  color: #24599d;
  padding: 4px 9px;
}

.toolbar {
  align-items: center;
  background: #ffffff;
  padding: 14px 16px;
}

.toolbar-actions {
  gap: 8px;
}

.toolbar-actions .primary,
.toolbar-actions .secondary {
  min-height: 36px;
}

.account-status-switch {
  gap: 8px;
}

.account-status-switch button {
  min-height: 50px;
  border-color: #e0e6ed;
  border-radius: 7px;
  background: #ffffff;
}

.account-status-switch button.active {
  border-color: #a6ddd3;
  background: #effaf7;
  box-shadow: none;
}

.table-wrap {
  background: #ffffff;
}

th {
  border-bottom-color: #dfe6ee;
  background: #f8fafc;
  color: #526070;
  font-size: 12px;
}

td {
  border-bottom-color: #edf1f5;
  color: #344054;
}

tbody tr:hover td {
  background: #f7fbff;
}

.token-chip {
  border-color: #dbe5f0;
  border-radius: 5px;
  background: #f7fafc;
  color: #4a5a6d;
}

.tag,
.pill {
  min-height: 22px;
  border-radius: 999px;
  font-size: 11px;
  font-weight: 800;
}

.notice {
  border-radius: 7px;
  box-shadow: 0 16px 34px rgba(21, 31, 49, 0.16);
}

dialog {
  border-color: #dce4ed;
  border-radius: 10px;
  box-shadow: 0 26px 74px rgba(21, 31, 49, 0.22);
}

@media (max-width: 1180px) {
  .overview-layout {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 900px) {
  .app-shell {
    display: block;
    padding-bottom: 80px;
  }

  .sidebar {
    border-top: 1px solid rgba(255, 255, 255, 0.08);
    background: rgba(28, 31, 37, 0.98);
    box-shadow: 0 -8px 24px rgba(21, 31, 49, 0.14);
  }

  .nav-tabs,
  .force-mobile-nav .nav-tabs {
    gap: 2px;
  }

  .nav-tabs button,
  .force-mobile-nav .nav-tabs button {
    min-width: 58px;
    min-height: 48px;
    border-radius: 6px;
    color: #b8c1ce;
    font-size: 10px;
  }

  .nav-tabs button::before,
  .force-mobile-nav .nav-tabs button::before {
    margin-bottom: 4px;
    color: #9ba7b8;
    font-size: 9px;
  }

  .nav-tabs button.active,
  .force-mobile-nav .nav-tabs button.active {
    background: #183d3a;
    box-shadow: inset 0 -2px 0 #68e1ce;
  }

  .workspace,
  .force-mobile-nav .workspace {
    padding: 12px 12px 22px;
  }

  .topbar,
  .force-mobile-nav .topbar {
    position: static;
    margin: 0 0 12px;
    padding: 2px 0 14px;
  }

  .workspace-kicker {
    font-size: 9px;
  }

  .topbar h1 {
    font-size: 20px;
  }

  .topbar p,
  .system-status {
    display: none;
  }

  .metric-grid,
  .dashboard-metrics {
    gap: 8px;
  }

  .metric {
    min-height: 94px;
    padding: 12px;
  }

  .metric strong {
    font-size: 24px;
  }

  .panel {
    padding: 14px;
  }

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

  .task-card:nth-child(2) {
    border-right: 0;
  }

  .task-card:nth-child(n + 3) {
    border-top: 1px solid #edf1f5;
  }

  .toolbar,
  .toolbar-actions {
    gap: 8px;
  }

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

  .toolbar-actions .search-box,
  .toolbar-actions .compact-filter {
    grid-column: span 2;
  }

  .notice,
  .force-mobile-nav .notice {
    bottom: calc(82px + env(safe-area-inset-bottom));
  }
}

@media (max-width: 560px) {
  .topbar-actions {
    gap: 0;
  }

  #refreshBtn {
    min-width: 68px;
    padding: 0 10px;
    font-size: 12px;
  }

  .toolbar-actions {
    grid-template-columns: 1fr;
  }

  .toolbar-actions .search-box,
  .toolbar-actions .compact-filter {
    grid-column: auto;
  }

  .dashboard-rank-grid {
    gap: 10px;
  }

  .trend-chart svg {
    height: 170px;
  }
}

/* 2026 blue enterprise interface. Final overrides intentionally preserve all existing workflows. */
:root {
  --bg: #f5f7fb;
  --panel: #ffffff;
  --ink: #182230;
  --muted: #748094;
  --line: #dfe5ee;
  --line-soft: #edf1f6;
  --primary: #2f73f6;
  --primary-dark: #205fd9;
  --primary-soft: #edf4ff;
  --accent: #2f73f6;
  --accent-soft: #edf4ff;
  --success: #169b62;
  --success-soft: #eaf9f1;
  --warning: #b86a05;
  --warning-soft: #fff6e8;
  --danger: #d4443e;
  --danger-soft: #fff0ef;
  --nav: #101b31;
  --shadow: 0 8px 24px rgba(29, 45, 75, 0.06);
  --shadow-soft: 0 1px 2px rgba(29, 45, 75, 0.03);
}

body {
  background: var(--bg);
  color: var(--ink);
  font-family: Inter, "PingFang SC", "Microsoft YaHei", Arial, sans-serif;
}

button,
.button-like {
  min-height: 36px;
  border-radius: 6px;
  font-size: 13px;
  font-weight: 700;
}

.primary {
  background: var(--primary);
  color: #ffffff;
  box-shadow: none;
}

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

.secondary,
.button-like.secondary {
  border: 1px solid #dbe2eb;
  background: #ffffff;
  color: #425067;
}

.secondary:hover,
.button-like.secondary:hover {
  border-color: #b9c8dc;
  background: #f8faff;
  color: #245fcf;
}

input,
select,
textarea {
  border-color: #dbe2eb;
  border-radius: 6px;
}

input:focus,
select:focus,
textarea:focus {
  border-color: var(--primary);
  box-shadow: 0 0 0 3px rgba(47, 115, 246, 0.12);
}

.app-shell {
  grid-template-columns: 236px minmax(0, 1fr);
  background: var(--bg);
}

.sidebar {
  display: flex;
  flex-direction: column;
  gap: 18px;
  border-right: 1px solid rgba(255, 255, 255, 0.06);
  background: var(--nav);
  padding: 22px 14px 16px;
}

.brand {
  gap: 11px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.09);
  padding: 0 8px 18px;
}

.brand-mark {
  display: grid;
  width: 40px;
  height: 40px;
  flex: 0 0 40px;
  place-items: center;
  border: 0;
  border-radius: 7px;
  background: #2f73f6;
  color: #ffffff;
  box-shadow: 0 6px 18px rgba(47, 115, 246, 0.24);
}

.brand-icon {
  width: 22px;
  height: 22px;
}

.brand strong {
  color: #ffffff;
  font-size: 16px;
  letter-spacing: 0;
}

.brand small {
  margin-top: 3px;
  color: #8f9db3;
  font-size: 11px;
}

.nav-tabs {
  display: grid;
  gap: 5px;
}

.nav-tabs button {
  display: flex;
  min-height: 42px;
  align-items: center;
  justify-content: flex-start;
  gap: 10px;
  border: 1px solid transparent;
  border-radius: 6px;
  background: transparent;
  color: #b6c0cf;
  padding: 0 12px;
  font-size: 13px;
  text-align: left;
}

.nav-tabs button::before {
  display: none !important;
  content: none !important;
}

.nav-tabs button:hover {
  background: rgba(255, 255, 255, 0.06);
  color: #ffffff;
}

.nav-tabs button.active {
  border-color: rgba(91, 147, 255, 0.46);
  background: #2f73f6;
  color: #ffffff;
  box-shadow: 0 8px 20px rgba(8, 20, 43, 0.22);
}

.nav-icon {
  width: 18px;
  height: 18px;
  flex: 0 0 18px;
}

.nav-mobile-label {
  display: none;
}

.mobile-more-button {
  display: none !important;
}

.sidebar-reminder {
  display: grid;
  gap: 10px;
  margin-top: auto;
  border: 1px solid rgba(137, 158, 191, 0.15);
  border-radius: 7px;
  background: #1a2942;
  color: #dce5f3;
  padding: 13px;
}

.sidebar-reminder-title {
  display: flex;
  align-items: center;
  gap: 8px;
}

.sidebar-reminder-icon {
  width: 16px;
  height: 16px;
  color: #6fa3ff;
}

#sidebarReminderDetails {
  display: grid;
  gap: 6px;
  color: #c1cada;
  font-size: 12px;
  line-height: 1.5;
}

#sidebarReminderDetails span,
#sidebarReminderDetails small {
  display: block;
}

#sidebarReminderDetails strong {
  color: #ffffff;
  font-size: 16px;
}

.sidebar form .ghost {
  border-color: rgba(255, 255, 255, 0.12);
  color: #b8c3d2;
}

.workspace {
  width: 100%;
  max-width: none;
  padding: 0 24px 36px;
}

.topbar {
  position: sticky;
  top: 0;
  z-index: 35;
  align-items: center;
  margin: 0 -24px 24px;
  border: 0;
  border-bottom: 1px solid #e2e7ef;
  border-radius: 0;
  background: rgba(255, 255, 255, 0.96);
  box-shadow: none;
  padding: 15px 24px;
  backdrop-filter: blur(12px);
}

.workspace-kicker {
  display: block;
  color: #8a96a8;
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 0;
}

.topbar h1 {
  margin-top: 3px;
  color: #172033;
  font-size: 23px;
  line-height: 1.15;
}

.topbar p {
  margin-top: 4px;
  color: #7b8798;
  font-size: 12px;
}

.topbar-actions {
  display: flex;
  align-items: center;
  gap: 9px;
}

.system-status {
  color: #637087;
}

.system-status i {
  background: #1eb56f;
  box-shadow: 0 0 0 3px #dff8eb;
}

.topbar-icon-button,
.refresh-button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 7px;
}

.topbar-icon-button {
  width: 36px;
  min-height: 36px;
  border: 1px solid #e0e6ee;
  background: #ffffff;
  color: #546176;
  padding: 0;
}

.topbar-icon {
  width: 17px;
  height: 17px;
}

.refresh-button .ui-icon {
  width: 17px;
  height: 17px;
}

.admin-avatar {
  display: grid;
  width: 34px;
  height: 34px;
  place-items: center;
  border: 3px solid #eef3fb;
  border-radius: 50%;
  background: #2f73f6;
  color: #ffffff;
  font-size: 12px;
  font-weight: 800;
}

.tab-panel.active {
  gap: 14px;
}

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

.dashboard-metrics .metric,
.metric {
  display: flex;
  min-height: 112px;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  overflow: hidden;
  border: 1px solid #e2e7ef;
  border-radius: 8px;
  background: #ffffff;
  box-shadow: var(--shadow-soft);
  padding: 16px 18px;
}

.metric::before {
  display: none;
}

.metric-copy {
  display: grid;
  gap: 5px;
  min-width: 0;
}

.metric span {
  color: #758095;
  font-size: 12px;
  font-weight: 700;
}

.metric strong {
  margin: 0;
  color: #172033;
  font-size: 30px;
  line-height: 1;
}

.metric small {
  overflow: hidden;
  color: #9aa4b3;
  font-size: 11px;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.metric-primary,
.metric-success,
.metric-accent {
  border-color: #e2e7ef;
  background: #ffffff;
}

.metric-icon {
  display: grid !important;
  width: 44px;
  height: 44px;
  flex: 0 0 44px;
  place-items: center;
  border-radius: 8px;
  background: #edf4ff;
  color: #2f73f6 !important;
}

.metric-icon-success {
  background: #e9f9f0;
  color: #16a064 !important;
}

.metric-icon-accent {
  background: #f3ebff;
  color: #7b43df !important;
}

.metric-icon .ui-icon {
  width: 23px;
  height: 23px;
}

.panel,
.table-wrap,
.toolbar,
.auth-panel,
.code-panel,
dialog {
  border-color: #e2e7ef;
  border-radius: 8px;
  background: #ffffff;
  box-shadow: var(--shadow-soft);
}

.panel {
  padding: 18px;
}

.panel h2,
.toolbar h2,
.section-header h2,
.chart-header h2 {
  color: #1b2538;
  font-size: 17px;
}

.section-header p,
.chart-header p,
.toolbar p {
  color: #7a8698;
  font-size: 12px;
}

.overview-layout {
  grid-template-columns: minmax(0, 1fr);
  gap: 12px;
  margin-top: 12px;
}

.dashboard-rank-grid {
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px;
  margin-top: 0;
}

.task-panel {
  padding: 0;
}

.task-panel > .section-header {
  margin: 0;
  border-bottom: 1px solid #edf1f6;
  padding: 17px 20px 14px;
}

.task-filter-tabs {
  display: flex;
  gap: 6px;
  overflow-x: auto;
  border-bottom: 1px solid #edf1f6;
  padding: 11px 20px;
  scrollbar-width: none;
}

.task-filter-tabs::-webkit-scrollbar {
  display: none;
}

.task-filter-tabs button {
  min-height: 34px;
  border: 1px solid #e1e6ee;
  background: #f7f9fc;
  color: #667287;
  padding: 0 13px;
}

.task-filter-tabs button strong {
  margin-left: 3px;
  color: inherit;
}

.task-filter-tabs button.active {
  border-color: var(--primary);
  background: var(--primary);
  color: #ffffff;
  box-shadow: 0 5px 14px rgba(47, 115, 246, 0.18);
}

.task-list-grid {
  display: grid;
  gap: 0;
  padding: 0 20px 4px;
}

.reminder-list {
  display: grid;
  gap: 8px;
  border: 0;
  border-top: 1px solid #edf1f6;
  border-radius: 0;
  background: transparent;
  padding: 15px 0;
}

.reminder-list:first-child {
  border-top: 0;
}

.reminder-list > strong {
  color: #3d495f;
  font-size: 13px;
}

.reminder-item {
  min-height: 38px;
  align-items: center;
}

.reminder-item > span {
  min-width: 0;
  overflow-wrap: anywhere;
}

.chart-panel {
  padding: 18px;
}

.chart-header > strong {
  color: var(--primary);
}

.trend-chart svg {
  height: 210px;
  border: 0;
  border-radius: 0;
  background: #fbfcff;
}

.trend-area {
  fill: rgba(47, 115, 246, 0.09);
}

.trend-line,
.trend-dot {
  stroke: var(--primary);
}

.meter {
  height: 6px;
  background: #edf1f6;
}

.meter span,
#meterBar {
  background: var(--primary);
}

.rank-actions .compact-action {
  border-color: #d9e4f6;
  color: #2b64c7;
}

.toolbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 18px;
  padding: 15px 17px;
}

.toolbar-actions {
  display: flex;
  align-items: end;
  justify-content: flex-end;
  gap: 8px;
  flex-wrap: wrap;
}

.search-box,
.compact-filter {
  min-width: 190px;
}

.account-status-switch {
  grid-template-columns: repeat(3, minmax(120px, 1fr));
  gap: 10px;
}

.account-status-switch button {
  min-height: 60px;
  border: 1px solid #e1e6ee;
  border-radius: 8px;
  background: #ffffff;
  padding: 10px 14px;
}

.account-status-switch button.active {
  border-color: #9bbcff;
  background: #edf4ff;
  box-shadow: inset 0 0 0 1px rgba(47, 115, 246, 0.05);
}

.account-status-switch button.active strong,
.account-status-switch button.active span {
  color: #245fcf;
}

.table-section {
  overflow: hidden;
  padding: 0;
}

.table-section .section-header {
  margin: 0;
  padding: 14px 17px;
}

.table-wrap {
  overflow: auto;
  background: #ffffff;
  -webkit-overflow-scrolling: touch;
}

.table-wrap.embedded {
  border-width: 1px 0 0;
}

table {
  border-collapse: separate;
  border-spacing: 0;
  color: #3d495f;
  font-size: 13px;
}

th,
td {
  border-bottom-color: #edf1f6;
  padding: 11px 13px;
}

th {
  background: #f8fafd;
  color: #627087;
  font-size: 12px;
}

td {
  background: #ffffff;
}

tbody tr:hover td {
  background: #f8fbff;
}

.account-info-cell {
  min-width: 190px;
}

#tab-accounts th:nth-child(2),
#tab-accounts td:nth-child(2),
#tab-accounts th:nth-child(3),
#tab-accounts td:nth-child(3),
#tab-accounts th:nth-child(4),
#tab-accounts td:nth-child(4) {
  min-width: 76px;
  white-space: nowrap;
}

#tab-accounts th:last-child,
#tab-accounts td:last-child {
  min-width: 520px;
}

.account-actions,
.row-actions {
  flex-wrap: nowrap;
}

.token-chip {
  border: 1px solid #d8e3f4;
  border-radius: 5px;
  background: #f1f6ff;
  color: #2f67c8;
}

.token-expiry {
  display: block;
  margin-top: 6px;
  white-space: nowrap;
}

.tag,
.pill {
  min-height: 22px;
  border-radius: 999px;
  font-size: 11px;
  font-weight: 800;
}

.tag.active,
.tag.ready,
.tag.sent,
.tag.healthy,
.pill.good {
  border-color: #c9eed9;
  background: #eaf9f1;
  color: #148454;
}

.tag.idle {
  border-color: #cbdcff;
  background: #edf4ff;
  color: #2d67cf;
}

.tag.blocked,
.tag.pending,
.tag.duplicate,
.tag.warning {
  border-color: #f7d8a6;
  background: #fff6e8;
  color: #a65d03;
}

.tag.error,
.tag.revoked,
.tag.archived,
.tag.bad,
.pill.bad {
  border-color: #f4cbc8;
  background: #fff0ef;
  color: #c53d37;
}

.settings-grid {
  gap: 12px;
}

#tab-settings > .panel {
  border: 0;
  background: transparent;
  box-shadow: none;
  padding: 0;
}

.setting-card,
.ops-card {
  border-color: #e2e7ef;
  border-radius: 8px;
  background: #ffffff;
}

.auth-shell,
.client-shell {
  background: #f5f7fb;
}

.auth-panel,
.code-panel {
  border-color: #e0e6ef;
  background: #ffffff;
  box-shadow: 0 22px 65px rgba(31, 50, 84, 0.13);
}

.eyebrow {
  color: var(--primary);
}

.code-box,
.code-box.waiting {
  border-color: #d9e4f5;
  background: #f7faff;
}

.client-info-note {
  border-color: #cbdcff;
  background: #edf4ff;
  color: #285dad;
}

.notice {
  z-index: 170;
  border-radius: 7px;
  box-shadow: 0 14px 35px rgba(29, 45, 75, 0.14);
}

.mobile-more-sheet {
  display: none;
}

@media (max-width: 1180px) {
  .metric-grid,
  .dashboard-metrics {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .dashboard-rank-grid {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 900px) {
  body {
    background: #f5f7fb;
  }

  body.mobile-more-open {
    overflow: hidden;
  }

  .app-shell {
    display: block;
    padding-bottom: calc(74px + env(safe-area-inset-bottom));
  }

  .sidebar,
  .force-mobile-nav .sidebar {
    position: fixed;
    inset: auto 0 0;
    z-index: 140;
    display: block;
    height: auto;
    border-top: 1px solid rgba(255, 255, 255, 0.10);
    border-right: 0;
    background: #101b31;
    box-shadow: 0 -8px 22px rgba(16, 27, 49, 0.18);
    padding: 6px 8px calc(6px + env(safe-area-inset-bottom));
    backdrop-filter: none;
  }

  .brand,
  .sidebar-reminder,
  .sidebar form {
    display: none;
  }

  .nav-tabs,
  .force-mobile-nav .nav-tabs {
    display: grid;
    grid-template-columns: repeat(5, minmax(0, 1fr));
    gap: 2px;
    overflow: hidden;
  }

  .nav-tabs button[data-tab="migration"],
  .nav-tabs button[data-tab="health"],
  .nav-tabs button[data-tab="logs"],
  .nav-tabs button[data-tab="audit"],
  .nav-tabs button[data-tab="settings"] {
    display: none;
  }

  .nav-tabs .mobile-more-button,
  .force-mobile-nav .nav-tabs .mobile-more-button {
    display: flex !important;
  }

  .nav-tabs button,
  .force-mobile-nav .nav-tabs button {
    display: flex;
    min-width: 0;
    min-height: 54px;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 4px;
    border: 0;
    border-radius: 6px;
    background: transparent;
    color: #aeb9c9;
    padding: 4px 2px;
    font-size: 10px;
    line-height: 1;
    text-align: center;
  }

  .nav-tabs button .nav-icon,
  .force-mobile-nav .nav-tabs button .nav-icon {
    width: 19px;
    height: 19px;
  }

  .nav-tabs button .nav-label {
    display: none;
  }

  .nav-tabs button .nav-mobile-label {
    display: inline;
  }

  .nav-tabs button.active,
  .force-mobile-nav .nav-tabs button.active {
    border: 0;
    background: rgba(47, 115, 246, 0.14);
    box-shadow: inset 0 -2px 0 #4c86f7;
    color: #74a3ff;
  }

  .workspace,
  .force-mobile-nav .workspace {
    width: 100%;
    padding: 0 10px 18px;
  }

  .topbar,
  .force-mobile-nav .topbar {
    position: static;
    margin: 0 -10px 12px;
    border-bottom: 1px solid #e3e8f0;
    background: #ffffff;
    padding: 12px 12px;
    backdrop-filter: none;
  }

  .workspace-kicker,
  .topbar p,
  .system-status,
  .admin-avatar,
  .topbar-icon-button {
    display: none;
  }

  .topbar h1 {
    margin: 0;
    font-size: 20px;
  }

  .refresh-button {
    width: 36px;
    min-width: 36px;
    padding: 0;
  }

  .refresh-button span {
    display: none;
  }

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

  .dashboard-metrics .metric,
  .metric {
    min-height: 84px;
    gap: 8px;
    padding: 11px 12px;
  }

  .metric strong {
    font-size: 24px;
  }

  .metric small {
    display: none;
  }

  .metric-icon {
    width: 36px;
    height: 36px;
    flex-basis: 36px;
  }

  .metric-icon .ui-icon {
    width: 19px;
    height: 19px;
  }

  .panel {
    padding: 14px;
  }

  .task-panel {
    padding: 0;
  }

  .task-panel > .section-header {
    padding: 14px 14px 11px;
  }

  .task-panel > .section-header p {
    display: none;
  }

  .task-filter-tabs {
    gap: 6px;
    padding: 9px 14px;
  }

  .task-filter-tabs button {
    min-height: 34px;
    padding: 0 12px;
  }

  .task-list-grid {
    padding: 0 14px 2px;
  }

  .reminder-item {
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto;
    gap: 8px;
  }

  .reminder-item .actions {
    flex-wrap: nowrap;
  }

  .reminder-item button {
    min-height: 34px;
    padding: 0 10px;
  }

  .dashboard-rank-grid {
    grid-template-columns: 1fr;
  }

  .toolbar {
    display: grid;
    align-items: stretch;
    gap: 12px;
    padding: 14px;
  }

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

  .toolbar-actions > button,
  .toolbar-actions > .button-like {
    width: 100%;
  }

  .toolbar-actions .search-box,
  .toolbar-actions .compact-filter {
    grid-column: 1 / -1;
    width: 100%;
    min-width: 0;
  }

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

  .account-status-switch button {
    min-height: 54px;
    padding: 8px;
  }

  .table-wrap:not(.ledger-table-wrap) table {
    min-width: 780px;
  }

  .row-actions,
  .account-actions {
    min-width: max-content;
  }

  .notice,
  .force-mobile-nav .notice {
    top: 10px;
    right: 10px;
    bottom: auto;
    width: auto;
    max-width: calc(100vw - 20px);
    padding: 8px 11px;
    font-size: 12px;
  }

  .mobile-more-sheet {
    position: fixed;
    inset: 0;
    z-index: 160;
    display: block;
    visibility: hidden;
    opacity: 0;
    pointer-events: none;
    transition: opacity 150ms ease, visibility 150ms ease;
  }

  .mobile-more-sheet.open {
    visibility: visible;
    opacity: 1;
    pointer-events: auto;
  }

  .mobile-more-backdrop {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
    border-radius: 0;
    background: rgba(13, 24, 43, 0.42);
    padding: 0;
  }

  .mobile-more-panel {
    position: absolute;
    right: 10px;
    bottom: calc(74px + env(safe-area-inset-bottom));
    left: 10px;
    border: 1px solid #e0e6ef;
    border-radius: 8px;
    background: #ffffff;
    box-shadow: 0 18px 55px rgba(17, 32, 57, 0.25);
    padding: 14px;
    transform: translateY(10px);
    transition: transform 150ms ease;
  }

  .mobile-more-sheet.open .mobile-more-panel {
    transform: translateY(0);
  }

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

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

  .mobile-more-grid button {
    display: grid;
    min-height: 74px;
    place-items: center;
    gap: 7px;
    border: 1px solid #e2e7ef;
    background: #f8faff;
    color: #425067;
    padding: 9px 5px;
    font-size: 11px;
  }

  .mobile-more-grid .nav-icon {
    width: 21px;
    height: 21px;
    color: #2f73f6;
  }
}

@media (max-width: 560px) {
  .metric span {
    font-size: 11px;
  }

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

  .account-status-switch button strong {
    font-size: 17px;
  }

  .chart-panel {
    padding: 14px;
  }

  .trend-chart svg {
    height: 168px;
  }
}

/* 2026-08 operations dashboard refinement */
.task-panel {
  margin-top: 12px;
}

.task-panel > .task-panel-header {
  display: flex;
  min-height: 66px;
  align-items: center;
  justify-content: space-between;
  gap: 18px;
  padding: 13px 18px;
}

.task-panel-header .task-filter-tabs {
  flex: 0 1 auto;
  margin-left: auto;
  border: 0;
  padding: 0;
}

.task-table-wrap {
  overflow-x: auto;
  border-top: 1px solid #edf1f6;
  -webkit-overflow-scrolling: touch;
}

.task-table {
  width: 100%;
  min-width: 920px;
  border-collapse: collapse;
  table-layout: fixed;
}

.task-table th,
.task-table td {
  border-bottom: 1px solid #edf1f6;
  padding: 12px 18px;
  text-align: left;
  vertical-align: middle;
}

.task-table th {
  background: #fbfcfe;
  color: #6f7b8f;
  font-size: 12px;
  font-weight: 700;
}

.task-table th:nth-child(1) {
  width: 27%;
}

.task-table th:nth-child(2) {
  width: 13%;
}

.task-table th:nth-child(3) {
  width: 14%;
}

.task-table th:nth-child(4) {
  width: 10%;
}

.task-table th:nth-child(5) {
  width: 36%;
}

.task-table tbody tr:last-child td {
  border-bottom: 0;
}

.task-table tbody tr:hover td {
  background: #fbfdff;
}

.task-account-cell {
  display: flex;
  min-width: 0;
  align-items: center;
  gap: 10px;
}

.task-account-cell > div {
  display: grid;
  min-width: 0;
  gap: 2px;
}

.task-account-cell strong,
.task-account-cell small {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.task-account-cell strong {
  color: #253148;
  font-size: 13px;
}

.task-account-cell small {
  color: #8b96a8;
  font-size: 10px;
}

.task-copy-button {
  display: inline-flex;
  width: auto;
  min-width: 0;
  min-height: 24px !important;
  max-width: 100%;
  align-items: center;
  gap: 6px;
  border: 0;
  border-radius: 4px;
  background: transparent;
  color: inherit;
  padding: 0 3px 0 0;
  text-align: left;
}

.task-copy-button:hover,
.task-copy-button:focus-visible {
  background: #edf4ff;
  color: #2f73f6;
}

.task-copy-button .ui-icon {
  width: 13px;
  height: 13px;
  flex: 0 0 13px;
  color: #8b96a8;
}

.task-copy-button:hover .ui-icon,
.task-copy-button:focus-visible .ui-icon {
  color: currentColor;
}

.task-copy-account strong,
.task-copy-seat span {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.task-copy-account {
  justify-content: flex-start;
}

.task-copy-seat {
  color: #4d5a70;
  font-size: 11px;
  font-weight: 700;
}

.task-account-icon {
  display: grid;
  width: 32px;
  height: 32px;
  flex: 0 0 32px;
  place-items: center;
  border-radius: 50%;
  background: #eaf2ff;
  color: #2f73f6;
}

.task-account-icon .ui-icon {
  width: 17px;
  height: 17px;
}

.task-account-icon-expired {
  background: #fff0f0;
  color: #ef5151;
}

.task-account-icon-device {
  background: #edf4ff;
  color: #2f73f6;
}

.task-account-icon-settlement {
  background: #fff4e8;
  color: #f08a24;
}

.task-account-icon-vacant {
  background: #eaf2ff;
  color: #2f73f6;
}

.task-type {
  display: inline-flex;
  min-height: 25px;
  align-items: center;
  border-radius: 5px;
  padding: 0 9px;
  font-size: 11px;
  font-weight: 700;
  white-space: nowrap;
}

.task-type-settlement {
  background: #fff1e2;
  color: #ed7c14;
}

.task-type-vacant {
  background: #eaf2ff;
  color: #2f73f6;
}

.task-type-device {
  background: #edf4ff;
  color: #2f73f6;
}

.task-type-expired {
  background: #ffeded;
  color: #ef4d4d;
}

.task-row-actions {
  flex-wrap: nowrap;
  gap: 6px;
}

.task-row-actions .compact-action {
  min-height: 32px;
  padding: 0 11px;
  white-space: nowrap;
}

.overview-task-empty {
  border-top: 1px solid #edf1f6;
  color: #8a95a7;
  padding: 28px 18px;
  text-align: center;
}

.overview-task-more {
  display: flex;
  justify-content: center;
  border-top: 1px solid #edf1f6;
  background: #fbfcfe;
  padding: 9px 18px;
}

.overview-task-more button {
  min-height: 32px;
  gap: 6px;
  border-color: transparent;
  background: transparent;
  color: #536178;
  font-size: 11px;
}

.overview-task-more button:hover {
  border-color: #dce5f5;
  background: #f1f6ff;
  color: #2f73f6;
}

.overview-task-more .ui-icon {
  width: 14px;
  height: 14px;
}

.task-date-cell strong,
.task-date-cell small {
  display: block;
  white-space: nowrap;
}

.task-date-cell small {
  margin-top: 3px;
  color: #8793a5;
  font-size: 10px;
}

.task-date-cell small.overdue {
  color: #e26722;
  font-weight: 700;
}

.overview-task-mobile-list {
  display: none;
}

.overview-insights-grid {
  display: grid;
  grid-template-columns: minmax(0, 1.45fr) minmax(360px, 1fr);
  gap: 12px;
}

.overview-insights-grid .chart-panel {
  min-height: 320px;
}

.trend-chart-controls {
  display: flex;
  flex: 0 0 auto;
  align-items: center;
  justify-content: flex-end;
  gap: 14px;
}

.trend-chart-controls > strong {
  min-width: 48px;
  color: #2f73f6;
  font-size: 27px;
  line-height: 1;
  text-align: right;
}

.trend-mode-switch button {
  min-height: 30px;
  padding: 0 12px;
}

.trend-bar-chart {
  display: grid;
  height: 228px;
  min-width: 760px;
  grid-template-columns: repeat(30, minmax(14px, 1fr));
  align-items: end;
  gap: 8px;
  border-top: 1px dashed #e3e8f0;
  padding: 22px 10px 0;
}

.trend-bar-chart.monthly {
  min-width: 720px;
  grid-template-columns: repeat(12, minmax(36px, 1fr));
  gap: 12px;
}

.trend-chart-scroll {
  overflow-x: auto;
  overscroll-behavior-inline: contain;
  scrollbar-width: thin;
  scroll-behavior: smooth;
  -webkit-overflow-scrolling: touch;
}

.trend-bar-column {
  display: grid;
  height: 100%;
  grid-template-rows: 20px minmax(0, 1fr) 24px;
  align-items: end;
  gap: 4px;
  text-align: center;
}

.trend-bar-column strong {
  color: #3c475b;
  font-size: 11px;
}

.trend-bar-column small {
  color: #8b96a7;
  font-size: 10px;
}

.overview-rank-account,
.rank-item-name {
  display: grid;
  min-width: 0;
  gap: 2px;
}

.overview-rank-account strong,
.rank-item-name b {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.overview-rank-account small,
.rank-item-name small {
  color: #8b96a7;
  font-size: 10px;
  font-weight: 500;
}

.trend-bar-track {
  position: relative;
  display: flex;
  width: min(34px, 72%);
  height: 100%;
  justify-self: center;
  align-items: flex-end;
  overflow: hidden;
  border-radius: 4px 4px 0 0;
  background: #f1f4f9;
}

.trend-bar-track i {
  display: block;
  width: 100%;
  border-radius: 4px 4px 0 0;
  background: #2f73f6;
}

.trend-bar-track i.high {
  background: #ef5151;
}

.overview-rank-table {
  display: grid;
  margin-top: 12px;
}

.overview-rank-head,
.overview-rank-row {
  display: grid;
  grid-template-columns: 46px minmax(0, 1fr) 64px 62px;
  align-items: center;
  gap: 10px;
}

.overview-rank-head {
  color: #8a95a7;
  padding: 8px 0;
  font-size: 10px;
}

.overview-rank-row {
  min-height: 45px;
  border-top: 1px solid #edf1f6;
  color: #68758a;
  font-size: 11px;
}

.overview-rank-row > strong {
  overflow: hidden;
  color: #3b475c;
  font-size: 12px;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.overview-rank-index {
  display: grid;
  width: 23px;
  height: 23px;
  place-items: center;
  border-radius: 50%;
  background: #edf1f6;
  color: #6c788b;
  font-weight: 800;
}

.overview-rank-index.top {
  background: #2f73f6;
  color: #ffffff;
}

.overview-rank-value {
  color: #ef5151;
  font-weight: 800;
}

.seat-rank-panel {
  margin-top: 0;
}

/* Real mobile browsers can report a desktop-like viewport. Keep both paths identical. */
.force-mobile-nav .app-shell {
  display: block;
  padding-bottom: calc(56px + env(safe-area-inset-bottom));
}

.force-mobile-nav .sidebar {
  position: fixed;
  inset: auto 0 0;
  z-index: 140;
  height: auto;
  border-top: 1px solid rgba(255, 255, 255, 0.1);
  border-right: 0;
  background: #101b31;
  box-shadow: 0 -6px 18px rgba(16, 27, 49, 0.16);
  padding: 4px 6px calc(4px + env(safe-area-inset-bottom));
}

.force-mobile-nav .brand,
.force-mobile-nav .sidebar-reminder,
.force-mobile-nav .sidebar form {
  display: none;
}

.force-mobile-nav .nav-tabs {
  display: grid;
  grid-template-columns: repeat(5, minmax(0, 1fr));
  gap: 2px;
  overflow: hidden;
  padding: 0;
}

.force-mobile-nav .nav-tabs button[data-tab="migration"],
.force-mobile-nav .nav-tabs button[data-tab="health"],
.force-mobile-nav .nav-tabs button[data-tab="logs"],
.force-mobile-nav .nav-tabs button[data-tab="audit"],
.force-mobile-nav .nav-tabs button[data-tab="settings"] {
  display: none;
}

.force-mobile-nav .nav-tabs .mobile-more-button {
  display: flex !important;
}

.force-mobile-nav .nav-tabs button {
  display: flex;
  min-width: 0;
  min-height: 44px;
  flex-direction: row;
  align-items: center;
  justify-content: center;
  gap: 4px;
  border: 0;
  border-radius: 5px;
  padding: 0 2px;
  font-size: 10px;
  line-height: 1;
  white-space: nowrap;
}

.force-mobile-nav .nav-tabs button .nav-icon {
  width: 16px;
  height: 16px;
  flex: 0 0 16px;
}

.force-mobile-nav .nav-tabs button .nav-label {
  display: none;
}

.force-mobile-nav .nav-tabs button .nav-mobile-label {
  display: inline;
}

.force-mobile-nav .nav-tabs button.active {
  background: rgba(47, 115, 246, 0.16);
  box-shadow: inset 0 -2px 0 #4c86f7;
  color: #8bb3ff;
}

.force-mobile-nav .mobile-more-panel {
  bottom: calc(58px + env(safe-area-inset-bottom));
}

@media (max-width: 900px) {
  .app-shell {
    padding-bottom: calc(56px + env(safe-area-inset-bottom));
  }

  .sidebar {
    padding: 4px 6px calc(4px + env(safe-area-inset-bottom));
  }

  .nav-tabs {
    grid-template-columns: repeat(5, minmax(0, 1fr));
    gap: 2px;
  }

  .nav-tabs button {
    min-width: 0;
    min-height: 44px;
    flex-direction: row;
    gap: 4px;
    padding: 0 2px;
    white-space: nowrap;
  }

  .nav-tabs button .nav-icon {
    width: 16px;
    height: 16px;
    flex: 0 0 16px;
  }

  .task-panel > .task-panel-header {
    display: grid;
    gap: 10px;
    padding: 13px 12px 10px;
  }

  .task-panel-header .task-filter-tabs {
    width: 100%;
    margin: 0;
  }

  .task-panel-header .task-filter-tabs button {
    flex: 0 0 auto;
    min-height: 31px;
    padding: 0 10px;
    font-size: 10px;
  }

  .task-table-wrap {
    display: none;
  }

  .overview-task-mobile-list {
    display: grid;
    gap: 0;
    border-top: 1px solid #edf1f6;
  }

  .overview-task-card {
    display: grid;
    gap: 10px;
    border-bottom: 1px solid #edf1f6;
    padding: 12px;
  }

  .overview-task-card:last-child {
    border-bottom: 0;
  }

  .overview-task-card-head {
    display: flex;
    min-width: 0;
    align-items: flex-start;
    justify-content: space-between;
    gap: 8px;
  }

  .overview-task-card-head .task-account-cell {
    min-width: 0;
  }

  .overview-task-meta {
    display: flex;
    align-items: center;
    gap: 18px;
    color: #8994a6;
    font-size: 10px;
  }

  .overview-task-meta strong {
    margin-left: 4px;
    color: #4a566b;
    font-size: 11px;
  }

  .overview-task-card .task-row-actions {
    display: flex;
    overflow-x: auto;
    flex-wrap: nowrap;
    padding-bottom: 1px;
    scrollbar-width: none;
  }

  .overview-task-card .task-row-actions::-webkit-scrollbar {
    display: none;
  }

  .overview-insights-grid {
    grid-template-columns: 1fr;
  }

  .overview-insights-grid .chart-panel {
    min-height: 0;
  }

  .chart-panel .chart-header {
    display: grid;
  }

  .trend-chart-controls {
    width: 100%;
    justify-content: space-between;
  }

  .trend-chart-controls > strong {
    text-align: right;
  }

  .trend-bar-chart {
    height: 184px;
    min-width: 720px;
    gap: 7px;
    padding: 18px 2px 0;
  }

  .trend-bar-chart.monthly {
    min-width: 680px;
    gap: 10px;
  }

  .trend-bar-track {
    width: min(26px, 76%);
  }

  .overview-rank-head,
  .overview-rank-row {
    grid-template-columns: 40px minmax(0, 1fr) 50px 52px;
    gap: 7px;
  }

  .mobile-more-panel {
    bottom: calc(58px + env(safe-area-inset-bottom));
  }
}

/* Final column guards for the approved management tables. */
#tab-accounts .account-management-table th:last-child,
#tab-accounts .account-management-table td:last-child {
  width: 245px;
  min-width: 245px;
  max-width: 245px;
}

#tab-accounts .account-management-table th:nth-child(6),
#tab-accounts .account-management-table td:nth-child(6) {
  width: 116px;
  min-width: 116px;
}

#tab-tokens .token-management-table th:last-child,
#tab-tokens .token-management-table td:last-child {
  width: 260px;
  min-width: 260px;
}

@media (max-width: 900px) {
  #tab-accounts .account-management-table td:last-child,
  #tab-accounts .account-management-table td:nth-child(6),
  #tab-tokens .token-management-table td:last-child {
    width: auto !important;
    min-width: 0 !important;
    max-width: none !important;
  }
}

/* 2026-08-02 v10: mobile tables stay horizontal and the ledger identity column can slide away. */
.token-account-cell strong,
.token-account-cell small {
  display: block;
  max-width: 210px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.token-account-cell strong {
  color: #344159;
  font-size: 11px;
}

.token-account-cell small {
  margin-top: 3px;
  color: #8a95a7;
  font-size: 10px;
}

@media (max-width: 900px) {
  #tab-accounts .account-table-section .table-wrap,
  .task-table-wrap {
    display: block !important;
    max-width: 100%;
    overflow-x: auto;
    overscroll-behavior-inline: contain;
    touch-action: pan-x pan-y;
    -webkit-overflow-scrolling: touch;
  }

  #tab-accounts .account-management-table {
    display: table !important;
    width: 1060px !important;
    min-width: 1060px !important;
    border-collapse: collapse;
    table-layout: fixed;
  }

  #tab-accounts .account-management-table thead {
    display: table-header-group !important;
  }

  #tab-accounts .account-management-table tbody {
    display: table-row-group !important;
  }

  #tab-accounts .account-management-table tr {
    display: table-row !important;
    border: 0;
    padding: 0;
  }

  #tab-accounts .account-management-table th,
  #tab-accounts .account-management-table td {
    display: table-cell !important;
    height: 64px !important;
    border-bottom: 1px solid #e7ebf1 !important;
    padding: 10px 12px !important;
    vertical-align: middle;
    white-space: nowrap !important;
  }

  #tab-accounts .account-management-table th {
    height: 39px !important;
  }

  #tab-accounts .account-management-table th:nth-child(1),
  #tab-accounts .account-management-table td:nth-child(1) {
    width: 240px !important;
    min-width: 240px !important;
    max-width: 240px !important;
  }

  #tab-accounts .account-management-table th:nth-child(2),
  #tab-accounts .account-management-table td:nth-child(2) {
    display: table-cell !important;
    width: 100px !important;
    min-width: 100px !important;
    max-width: 100px !important;
  }

  #tab-accounts .account-management-table th:nth-child(3),
  #tab-accounts .account-management-table td:nth-child(3) {
    width: 82px !important;
  }

  #tab-accounts .account-management-table th:nth-child(4),
  #tab-accounts .account-management-table td:nth-child(4) {
    width: 112px !important;
  }

  #tab-accounts .account-management-table th:nth-child(5),
  #tab-accounts .account-management-table td:nth-child(5) {
    width: 116px !important;
  }

  #tab-accounts .account-management-table th:nth-child(6),
  #tab-accounts .account-management-table td:nth-child(6) {
    width: 120px !important;
    min-width: 120px !important;
    max-width: 120px !important;
  }

  #tab-accounts .account-management-table th:nth-child(7),
  #tab-accounts .account-management-table td:nth-child(7) {
    width: 290px !important;
    min-width: 290px !important;
    max-width: 290px !important;
  }

  #tab-accounts .account-management-table .account-actions {
    min-width: max-content !important;
    overflow: visible;
    flex-wrap: nowrap;
  }

  #tab-accounts .account-management-table .account-info-cell,
  #tab-accounts .account-management-table .account-date-cell,
  #tab-accounts .account-management-table .account-seat-cell,
  #tab-accounts .account-management-table .account-cycle-cell,
  #tab-accounts .account-management-table td:last-child {
    grid-column: auto;
    grid-row: auto;
  }

  #tab-accounts .account-management-table .account-date-cell::before {
    content: none;
  }

  .overview-task-mobile-list {
    display: none !important;
  }

  .task-table {
    width: 900px;
    min-width: 900px;
    table-layout: fixed;
  }

  .task-table th,
  .task-table td {
    padding: 10px 12px;
    white-space: nowrap;
  }

  .task-table th:nth-child(1) { width: 245px; }
  .task-table th:nth-child(2) { width: 110px; }
  .task-table th:nth-child(3) { width: 100px; }
  .task-table th:nth-child(4) { width: 90px; }
  .task-table th:nth-child(5) { width: 355px; }

  .token-account-cell {
    grid-column: 1 / -1;
  }

  .token-account-cell strong,
  .token-account-cell small {
    max-width: min(100%, 330px);
  }

  .ledger-table-wrap {
    --ledger-sticky-offset: 0px;
    touch-action: pan-x pan-y;
  }

  .ledger-table .sticky-col {
    width: var(--ledger-sticky-width, 168px);
    min-width: var(--ledger-sticky-width, 168px);
    max-width: var(--ledger-sticky-width, 168px);
    transform: translate3d(calc(0px - var(--ledger-sticky-offset)), 0, 0);
    will-change: transform;
  }

  .ledger-table-wrap.is-sticky-collapsed .sticky-col {
    pointer-events: none;
  }
}

.force-mobile-nav #tab-accounts .account-table-section .table-wrap,
.force-mobile-nav .task-table-wrap {
  display: block !important;
  max-width: 100%;
  overflow-x: auto;
  overscroll-behavior-inline: contain;
  touch-action: pan-x pan-y;
  -webkit-overflow-scrolling: touch;
}

.force-mobile-nav .overview-task-mobile-list {
  display: none !important;
}

.force-mobile-nav .ledger-table .sticky-col {
  transform: translate3d(calc(0px - var(--ledger-sticky-offset, 0px)), 0, 0);
  will-change: transform;
}

/* 2026-08-02 v12: seat management always remains a horizontal table. */
#tab-tokens .token-table-section .table-wrap {
  display: block !important;
  max-width: 100%;
  overflow-x: auto;
  overscroll-behavior-inline: contain;
  touch-action: pan-x pan-y;
  -webkit-overflow-scrolling: touch;
}

#tab-tokens .token-management-table {
  display: table !important;
  width: 100% !important;
  min-width: 1150px !important;
  border-collapse: collapse;
  table-layout: fixed;
}

#tab-tokens .token-management-table thead {
  display: table-header-group !important;
}

#tab-tokens .token-management-table tbody {
  display: table-row-group !important;
}

#tab-tokens .token-management-table tr {
  display: table-row !important;
  border: 0;
  padding: 0;
}

#tab-tokens .token-management-table th,
#tab-tokens .token-management-table td {
  display: table-cell !important;
  height: 64px !important;
  border-bottom: 1px solid #e7ebf1 !important;
  padding: 10px 12px !important;
  vertical-align: middle;
  white-space: nowrap !important;
}

#tab-tokens .token-management-table th {
  height: 39px !important;
}

#tab-tokens .token-management-table th:nth-child(1),
#tab-tokens .token-management-table td:nth-child(1) {
  width: 190px !important;
  min-width: 190px !important;
  max-width: 190px !important;
}

#tab-tokens .token-management-table th:nth-child(2),
#tab-tokens .token-management-table td:nth-child(2) {
  width: 100px !important;
  min-width: 100px !important;
  max-width: 100px !important;
}

#tab-tokens .token-management-table th:nth-child(3),
#tab-tokens .token-management-table td:nth-child(3) {
  width: 150px !important;
  min-width: 150px !important;
  max-width: 150px !important;
}

#tab-tokens .token-management-table th:nth-child(4),
#tab-tokens .token-management-table td:nth-child(4) {
  width: 220px !important;
  min-width: 220px !important;
  max-width: 220px !important;
}

#tab-tokens .token-management-table th:nth-child(5),
#tab-tokens .token-management-table td:nth-child(5) {
  width: 130px !important;
  min-width: 130px !important;
  max-width: 130px !important;
}

#tab-tokens .token-management-table th:nth-child(6),
#tab-tokens .token-management-table td:nth-child(6) {
  width: 360px !important;
  min-width: 360px !important;
  max-width: 360px !important;
}

#tab-tokens .token-management-table .token-status-cell,
#tab-tokens .token-management-table .token-expiry-cell,
#tab-tokens .token-management-table .token-account-cell,
#tab-tokens .token-management-table .token-cycle-cell,
#tab-tokens .token-management-table td:last-child {
  grid-column: auto;
  grid-row: auto;
}

#tab-tokens .token-management-table .token-account-cell strong,
#tab-tokens .token-management-table .token-account-cell small {
  max-width: 196px;
}

#tab-tokens .token-management-table .row-actions {
  min-width: max-content;
  overflow: visible;
  flex-wrap: nowrap;
}

/* Account classification: operational labels stay compact in wide tables. */
.account-classification-tags,
.task-account-tags {
  display: flex;
  min-width: 0;
  align-items: center;
  flex-wrap: wrap;
  gap: 4px;
  margin-top: 4px;
}

.account-type-tag,
.account-source-tag {
  display: inline-flex;
  min-height: 20px;
  align-items: center;
  border: 1px solid transparent;
  border-radius: 5px;
  padding: 1px 6px;
  font-size: 11px;
  font-weight: 700;
  line-height: 16px;
  white-space: nowrap;
}

.account-type-tag.shared {
  border-color: #bfdbfe;
  background: #eff6ff;
  color: #1d4ed8;
}

.account-type-tag.exclusive {
  border-color: #a7f3d0;
  background: #ecfdf5;
  color: #047857;
}

.account-type-tag.unclassified,
.account-source-tag.unclassified {
  border-color: #d1d5db;
  background: #f3f4f6;
  color: #6b7280;
}

.account-source-tag.self {
  border-color: #cbd5e1;
  background: #f8fafc;
  color: #475569;
}

.account-source-tag.finished {
  border-color: #fde68a;
  background: #fffbeb;
  color: #a16207;
}

.account-source-tag.other {
  border-color: #ddd6fe;
  background: #f5f3ff;
  color: #6d28d9;
}

.account-classification-fields {
  display: grid;
  grid-template-columns: minmax(0, 1.2fr) minmax(150px, 0.8fr) minmax(150px, 1fr);
  gap: 12px;
  align-items: end;
}

.segmented-field {
  min-width: 0;
  border: 0;
  padding: 0;
  margin: 0;
}

.segmented-field legend {
  margin-bottom: 6px;
  font-size: 13px;
  font-weight: 700;
}

.segmented-field > div {
  display: flex;
  min-height: 40px;
  gap: 3px;
  border: 1px solid #dfe4ec;
  border-radius: 6px;
  background: #f7f8fa;
  padding: 3px;
}

.segmented-field label {
  min-width: 0;
  flex: 1;
}

.segmented-field input {
  position: absolute;
  opacity: 0;
  pointer-events: none;
}

.segmented-field span {
  display: flex;
  min-height: 32px;
  align-items: center;
  justify-content: center;
  border-radius: 4px;
  color: #64748b;
  cursor: pointer;
  font-size: 12px;
  font-weight: 700;
}

.segmented-field input:checked + span {
  background: #ffffff;
  color: #2563eb;
  box-shadow: 0 1px 5px rgba(30, 41, 59, 0.12);
}

.task-account-tags {
  margin-top: 3px;
}

@media (max-width: 760px) {
  .account-classification-fields {
    grid-template-columns: 1fr;
  }

  .account-commandbar {
    overflow-x: auto;
    overscroll-behavior-x: contain;
    scrollbar-width: none;
  }

  .account-commandbar::-webkit-scrollbar {
    display: none;
  }
}

/* 2026-08-22: temporary account-wide seat freeze. */
.account-status-stack {
  display: flex;
  min-width: 0;
  align-items: center;
  flex-wrap: wrap;
  gap: 4px;
}

.account-status-stack small {
  width: 100%;
  color: #a45f0a;
  font-size: 9px;
  white-space: nowrap;
}

.tag.frozen,
.pill.frozen {
  border-color: #f3c878;
  background: #fff6df;
  color: #a45f0a;
}

.account-freeze-action {
  border-color: #efcc8c !important;
  color: #9a6212 !important;
}

.account-freeze-action.is-frozen {
  border-color: #9bd6b2 !important;
  color: #147447 !important;
}

.freeze-explanation {
  border-left: 3px solid #e4a137;
  background: #fff8e8;
  color: #75521c;
  padding: 10px 12px;
  font-size: 12px;
  line-height: 1.55;
}

.freeze-duration-actions button.active {
  border-color: #447bec;
  background: #eef4ff;
  color: #285fcf;
}

.freeze-time-preview {
  display: grid;
  gap: 4px;
  border: 1px solid #dce4f1;
  border-radius: 7px;
  background: #f7f9fc;
  padding: 11px 12px;
}

.freeze-time-preview span {
  color: #7c899c;
  font-size: 11px;
  font-weight: 700;
}

.freeze-time-preview strong {
  color: #26344b;
  font-size: 13px;
}

.account-freeze-card {
  border: 1px solid #f0c46f;
  border-radius: 8px;
  background: #fffaf0;
  padding: 13px;
  box-shadow: 0 10px 24px rgba(117, 82, 28, 0.08);
}

.account-freeze-title {
  display: flex;
  align-items: center;
  gap: 10px;
}

.account-freeze-title > span {
  display: grid;
  width: 32px;
  height: 32px;
  flex: 0 0 32px;
  place-items: center;
  border-radius: 50%;
  background: #f3ad3d;
  color: #fff;
  font-weight: 900;
}

.account-freeze-title > div {
  display: grid;
  gap: 2px;
}

.account-freeze-title strong {
  color: #6f4710;
  font-size: 15px;
}

.account-freeze-title small {
  color: #a46b1e;
  font-size: 11px;
}

.account-freeze-copy {
  color: #765522;
  font-size: 12px;
  line-height: 1.6;
}

.account-freeze-window {
  display: grid;
  gap: 4px;
  border-top: 1px solid #f2d79f;
  padding-top: 10px;
}

.account-freeze-window span {
  color: #a27634;
  font-size: 11px;
  font-weight: 700;
}

.account-freeze-window strong {
  color: #61400f;
  font-size: 13px;
  line-height: 1.5;
}

/* Desktop account table: dense columns and viewport-safe action menu. */
#tab-accounts .account-more-actions[open] .more-menu {
  position: fixed;
  z-index: 520;
  top: 0;
  left: 0;
  width: 152px;
  min-width: 152px;
  max-height: min(360px, calc(100vh - 16px));
  overflow-y: auto;
  visibility: hidden;
  margin: 0;
}

#tab-accounts .account-more-actions[open] .more-menu.positioned {
  visibility: visible;
}

@media (min-width: 1101px) {
  #tab-accounts .account-table-section {
    width: min(1320px, 100%);
  }

  #tab-accounts .account-table-section .table-wrap {
    overflow: visible;
  }

  #tab-accounts .account-management-table {
    width: 1320px;
    min-width: 0;
    max-width: 100%;
    table-layout: fixed;
  }

  #tab-accounts .account-management-table th,
  #tab-accounts .account-management-table td {
    padding-right: 10px;
    padding-left: 10px;
  }

  #tab-accounts .account-management-table th:nth-child(1),
  #tab-accounts .account-management-table td:nth-child(1) {
    width: 300px;
  }

  #tab-accounts .account-management-table th:nth-child(2),
  #tab-accounts .account-management-table td:nth-child(2) {
    width: 112px;
  }

  #tab-accounts .account-management-table th:nth-child(3),
  #tab-accounts .account-management-table td:nth-child(3) {
    width: 82px;
  }

  #tab-accounts .account-management-table th:nth-child(4),
  #tab-accounts .account-management-table td:nth-child(4) {
    width: 112px;
  }

  #tab-accounts .account-management-table th:nth-child(5),
  #tab-accounts .account-management-table td:nth-child(5) {
    width: 108px;
  }

  #tab-accounts .account-management-table th:nth-child(6),
  #tab-accounts .account-management-table td:nth-child(6) {
    width: 124px;
    min-width: 124px;
    max-width: 124px;
  }

  #tab-accounts .account-management-table th:nth-child(7),
  #tab-accounts .account-management-table td:nth-child(7) {
    width: 272px;
    min-width: 272px;
    max-width: 272px;
  }

  #tab-accounts .account-management-table .account-actions {
    min-width: 0;
    justify-content: flex-start;
  }
}

/* 2026-08-11: settlement-aligned seat expiry workflow. */
.expiry-alignment-tag {
  display: inline-flex;
  min-height: 19px;
  align-items: center;
  width: max-content;
  max-width: 100%;
  margin-top: 5px;
  border: 1px solid transparent;
  border-radius: 4px;
  padding: 1px 6px;
  font-size: 9px;
  font-weight: 700;
  line-height: 15px;
  white-space: nowrap;
}

.expiry-alignment-tag.aligned {
  border-color: #b7e4c7;
  background: #eefbf3;
  color: #167347;
}

.expiry-alignment-tag.grace {
  border-color: #f1cf91;
  background: #fff8e8;
  color: #9a6414;
}

.expiry-alignment-tag.warning {
  border-color: #f2b4b4;
  background: #fff0f0;
  color: #c63f3f;
}

.expiry-alignment-tag.neutral {
  border-color: #d8dee8;
  background: #f5f7fa;
  color: #68758a;
}

.token-alignment-select {
  min-width: 178px;
}

.settlement-rule-summary {
  display: grid;
  gap: 4px;
  border-left: 3px solid #4b83e8;
  background: #f4f8ff;
  color: #44536a;
  padding: 10px 12px;
}

.settlement-rule-summary strong {
  color: #25324a;
  font-size: 13px;
}

.settlement-rule-summary span {
  font-size: 12px;
}

.expiry-rule-feedback {
  min-height: 36px;
  border: 1px solid #d9e0ea;
  border-radius: 6px;
  background: #f7f9fc;
  color: #647187;
  padding: 9px 11px;
  font-size: 12px;
  line-height: 1.45;
}

.expiry-rule-feedback.aligned {
  border-color: #b7e4c7;
  background: #eefbf3;
  color: #167347;
}

.expiry-rule-feedback.grace {
  border-color: #f1cf91;
  background: #fff8e8;
  color: #8b5b15;
}

.expiry-rule-feedback.warning,
.expiry-rule-feedback.unaligned {
  border-color: #f2b4b4;
  background: #fff0f0;
  color: #b73535;
}

.align-preview-list {
  display: grid;
  max-height: min(420px, 55vh);
  overflow-y: auto;
  border: 1px solid #e1e6ee;
  border-radius: 7px;
}

.align-preview-row {
  display: grid;
  grid-template-columns: minmax(130px, 1fr) 100px 24px 100px;
  align-items: center;
  gap: 10px;
  border-bottom: 1px solid #edf0f4;
  padding: 10px 12px;
  font-size: 12px;
}

.align-preview-row:last-child {
  border-bottom: 0;
}

.align-preview-row > span:first-child {
  display: grid;
  min-width: 0;
}

.align-preview-row small {
  color: #8a96a8;
}

.align-preview-row .ui-icon {
  width: 16px;
  color: #8793a5;
}

.task-account-icon-cutoff {
  background: #fff4e8;
  color: #d56e15;
}

.task-type-cutoff {
  background: #fff1e2;
  color: #c7620d;
}

#tab-tokens .token-management-table th:nth-child(3),
#tab-tokens .token-management-table td:nth-child(3) {
  width: 190px !important;
  min-width: 190px !important;
  max-width: 190px !important;
}

@media (max-width: 760px) {
  #tab-tokens .token-commandbar {
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto;
    align-items: center;
  }

  #tab-tokens .token-commandbar .token-search-control,
  #tab-tokens .token-commandbar .token-account-select {
    grid-column: 1 / -1;
    width: 100%;
  }

  #tab-tokens .token-commandbar .token-account-select,
  #tab-tokens .token-commandbar .token-alignment-select,
  #tab-tokens .token-commandbar .command-actions {
    order: 2;
  }

  #tab-tokens .token-commandbar .command-select > span {
    flex: 0 0 auto;
    white-space: nowrap;
  }

  #tab-tokens .token-commandbar .token-account-select select {
    min-width: 0;
    flex: 1;
  }

  #tab-tokens .token-commandbar .command-actions {
    min-width: max-content;
    overflow-x: auto;
  }

  #tab-tokens .token-commandbar .command-actions button {
    min-width: max-content;
    white-space: nowrap;
  }

  .token-alignment-select {
    width: 100%;
    min-width: 0;
  }

  .align-preview-row {
    grid-template-columns: minmax(110px, 1fr) 82px 18px 82px;
    gap: 6px;
    padding: 9px;
    font-size: 10px;
  }
}

/* 2026-08-07: persistent notes in the daily task table. */
.task-table th:nth-child(1) { width: 24%; }
.task-table th:nth-child(2) { width: 9%; }
.task-table th:nth-child(3) { width: 11%; }
.task-table th:nth-child(4) { width: 8%; }
.task-table th:nth-child(5) { width: 22%; }
.task-table th:nth-child(6) { width: 26%; }

.task-note-cell {
  min-width: 0;
}

.task-note-button {
  display: block;
  width: 100%;
  min-width: 0;
  min-height: 30px;
  overflow: hidden;
  border: 1px dashed #cbd5e1;
  border-radius: 6px;
  background: #f8fafc;
  color: #8793a5;
  padding: 6px 9px;
  text-align: left;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.task-note-button:hover,
.task-note-button:focus-visible {
  border-color: #8eb1f6;
  background: #f2f6ff;
  color: #2f67c8;
}

.task-note-button.has-note {
  border-style: solid;
  border-color: #f0cf84;
  background: #fff8e8;
  color: #765719;
}

.todo-note-dialog {
  width: min(440px, calc(100vw - 56px));
}

@media (max-width: 900px) {
  .task-table {
    width: 1055px;
    min-width: 1055px;
  }

  .task-table th:nth-child(1) { width: 245px; }
  .task-table th:nth-child(2) { width: 110px; }
  .task-table th:nth-child(3) { width: 110px; }
  .task-table th:nth-child(4) { width: 90px; }
  .task-table th:nth-child(5) { width: 260px; }
  .task-table th:nth-child(6) { width: 240px; }
}

/* 2026-08-07: on-demand 2FA secret viewing. */
#tab-accounts .account-more-actions .more-menu button {
  justify-content: flex-start;
}

#tab-accounts .account-more-actions .more-menu .ui-icon {
  width: 15px;
  height: 15px;
  flex: 0 0 15px;
}

.account-secret-dialog {
  width: min(440px, calc(100vw - 56px));
}

.secret-reveal-box {
  display: flex;
  min-width: 0;
  align-items: center;
  gap: 8px;
  border: 1px solid #dbe2eb;
  border-radius: 7px;
  background: #f8fafc;
  padding: 10px;
}

.secret-reveal-box code {
  min-width: 0;
  flex: 1;
  overflow-wrap: anywhere;
  color: #1f2a3d;
  font-size: 15px;
  line-height: 1.55;
  letter-spacing: 0;
}

.secret-reveal-box .icon-button {
  width: 36px;
  min-width: 36px;
  min-height: 36px;
  padding: 0;
}

.secret-security-note {
  margin: 0;
  border-left: 3px solid #e7a832;
  color: #7b5a18;
  padding: 2px 0 2px 10px;
  font-size: 12px;
  line-height: 1.6;
}

/* 2026-08-03: true idle-account workflow and compact search controls. */
.command-search .search-clear-button {
  display: inline-grid;
  width: 24px;
  min-width: 24px;
  height: 24px;
  min-height: 24px;
  flex: 0 0 24px;
  place-items: center;
  border: 0;
  border-radius: 50%;
  background: transparent;
  color: #94a0b2;
  padding: 0;
}

.command-search .search-clear-button:hover,
.command-search .search-clear-button:focus-visible {
  background: #eef1f5;
  color: #344159;
}

.command-search .search-clear-button[hidden] {
  display: none;
}

.command-search .search-clear-button .ui-icon {
  width: 14px;
  height: 14px;
}

.seat-field-disabled {
  opacity: 0.55;
}

.seat-field-disabled input {
  cursor: not-allowed;
}

.idle-sort-indicator {
  display: inline-flex;
  min-width: max-content;
  height: 38px;
  align-items: center;
  gap: 7px;
  color: #657187;
  font-size: 11px;
  font-weight: 700;
}

.idle-sort-indicator .ui-icon {
  width: 15px;
  height: 15px;
}

.idle-note-cell {
  min-width: 0;
}

.idle-note-cell button {
  display: block;
  width: 100%;
  min-width: 0;
  min-height: 30px;
  overflow: hidden;
  border: 1px solid transparent;
  border-radius: 5px;
  background: #fff8e7;
  color: #785a16;
  padding: 6px 8px;
  text-align: left;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.idle-note-cell button:hover,
.idle-note-cell button:focus-visible {
  border-color: #f0cb74;
  background: #fff4d6;
}

#tab-accounts .idle-account-table th:nth-child(1),
#tab-accounts .idle-account-table td:nth-child(1) {
  width: 300px;
}

#tab-accounts .idle-account-table th:nth-child(2),
#tab-accounts .idle-account-table td:nth-child(2) {
  width: 82px;
}

#tab-accounts .idle-account-table th:nth-child(3),
#tab-accounts .idle-account-table td:nth-child(3) {
  width: 112px;
}

#tab-accounts .idle-account-table th:nth-child(4),
#tab-accounts .idle-account-table td:nth-child(4) {
  width: 108px;
}

#tab-accounts .idle-account-table th:nth-child(5),
#tab-accounts .idle-account-table td:nth-child(5) {
  width: 250px;
  min-width: 250px;
  max-width: 250px;
}

#tab-accounts .idle-account-table th:nth-child(6),
#tab-accounts .idle-account-table td:nth-child(6) {
  width: 272px;
  min-width: 272px;
  max-width: 272px;
}

@media (min-width: 1101px) {
  #tab-accounts .idle-account-table {
    width: 1180px;
  }
}

@media (max-width: 900px) {
  #tab-accounts .idle-account-table {
    width: 980px !important;
    min-width: 980px !important;
  }

  #tab-accounts .idle-account-table th:nth-child(1),
  #tab-accounts .idle-account-table td:nth-child(1) {
    width: 240px !important;
    min-width: 240px !important;
    max-width: 240px !important;
  }

  #tab-accounts .idle-account-table th:nth-child(2),
  #tab-accounts .idle-account-table td:nth-child(2) {
    display: table-cell !important;
    width: 82px !important;
    min-width: 82px !important;
    max-width: 82px !important;
  }

  #tab-accounts .idle-account-table th:nth-child(3),
  #tab-accounts .idle-account-table td:nth-child(3) {
    width: 112px !important;
    min-width: 112px !important;
    max-width: 112px !important;
  }

  #tab-accounts .idle-account-table th:nth-child(4),
  #tab-accounts .idle-account-table td:nth-child(4) {
    width: 116px !important;
    min-width: 116px !important;
    max-width: 116px !important;
  }

  #tab-accounts .idle-account-table th:nth-child(5),
  #tab-accounts .idle-account-table td:nth-child(5) {
    width: 180px !important;
    min-width: 180px !important;
    max-width: 180px !important;
  }

  #tab-accounts .idle-account-table th:nth-child(6),
  #tab-accounts .idle-account-table td:nth-child(6) {
    width: 250px !important;
    min-width: 250px !important;
    max-width: 250px !important;
  }
}

/* 2026-08-03: let desktop account tables use the full workspace width. */
@media (min-width: 1101px) {
  #tab-accounts .account-table-section {
    width: 100%;
    max-width: none;
  }

  #tab-accounts .account-table-section .table-wrap {
    width: 100%;
    overflow-x: auto;
  }

  #tab-accounts .account-management-table,
  #tab-accounts .idle-account-table {
    width: 100%;
    min-width: 1180px;
    max-width: none;
  }
}
