/* Leo2API admin overrides on top of Tabler (MIT) — dark theme */
:root {
  --leo-accent: #2cc7aa;
  --leo-accent-2: #33a1ff;
  --leo-danger: #e16068;
  --leo-warn: #f0c040;
  --leo-muted: #a8bfd8;
  --leo-dim: #7f96ad;
}

body {
  background: radial-gradient(circle at 15% 0%, #132a42 0%, #0b131e 45%, #080d14 100%);
  background-attachment: fixed;
}

/* Keep framework defaults readable against the custom dark background. */
.text-secondary {
  color: var(--leo-muted) !important;
}

.btn-outline-primary {
  color: #7cc0ff;
  border-color: rgba(124, 192, 255, 0.65);
}
.btn-outline-primary:hover,
.btn-outline-primary:focus-visible {
  color: #fff;
  background: #176fb9;
  border-color: #7cc0ff;
}

.btn-outline-secondary {
  color: #b9cbe0;
  border-color: #5f7893;
}
.btn-outline-secondary:hover,
.btn-outline-secondary:focus-visible {
  color: #fff;
  background: #425a73;
  border-color: #8da7c2;
}

.btn-outline-danger {
  color: #ff9ca5;
  border-color: rgba(255, 156, 165, 0.72);
}
.btn-outline-danger:hover,
.btn-outline-danger:focus-visible {
  color: #fff;
  background: #b9444d;
  border-color: #ff9ca5;
}

/* ── Navbar ─────────────────────────────── */
.leo-navbar {
  background: rgba(10, 18, 28, 0.85);
  backdrop-filter: blur(8px);
  border-bottom: 1px solid rgba(142, 181, 221, 0.14);
}
.leo-brand-mark {
  font-size: 20px;
  filter: drop-shadow(0 0 8px rgba(44, 199, 170, 0.5));
}
.leo-brand-sub {
  color: var(--leo-muted);
  font-size: 13px;
  margin-left: 8px;
}
.leo-nav-link {
  color: var(--leo-muted) !important;
  border-radius: 8px;
  padding: 0.5rem 0.75rem !important;
}
.leo-nav-link:hover {
  color: #fff !important;
  background: rgba(255, 255, 255, 0.06);
}

/* ── Tabs ───────────────────────────────── */
.leo-tabs .nav-link,
.leo-config-tabs .nav-link {
  color: var(--leo-muted);
  border: 1px solid rgba(142, 181, 221, 0.18);
  background: rgba(13, 25, 38, 0.5);
  border-radius: 10px;
  padding: 0.5rem 1.1rem;
  font-weight: 600;
}
.leo-tabs .nav-link.active,
.leo-config-tabs .nav-link.active {
  color: #fff;
  background: linear-gradient(135deg, rgba(44, 199, 170, 0.9), rgba(51, 161, 255, 0.85));
  border-color: transparent;
  box-shadow: 0 4px 16px rgba(44, 199, 170, 0.28);
}

/* Tab panes */
.tab-pane { display: none; }
.tab-pane.active { display: block; }
.config-cat-pane { display: none; }
.config-cat-pane.active { display: block; }

/* ── Cards ──────────────────────────────── */
.card {
  background: rgba(13, 25, 38, 0.78);
  border: 1px solid rgba(142, 181, 221, 0.16);
  border-radius: 14px;
  box-shadow: 0 8px 28px rgba(0, 0, 0, 0.35);
}
.card-header {
  background: rgba(255, 255, 255, 0.02);
  border-bottom: 1px solid rgba(142, 181, 221, 0.12);
}
.card-title,
.registrar-status {
  color: #e7f1fd;
}
.token-pool-count {
  color: var(--leo-muted);
  font-size: 13px;
  font-weight: 600;
  white-space: nowrap;
}
.registrar-status {
  line-height: 1.6;
  overflow-wrap: anywhere;
}
.registrar-log {
  margin: 16px 0 0;
  min-height: 180px;
  max-height: 420px;
  overflow: auto;
  padding: 14px 16px;
  white-space: pre-wrap;
  overflow-wrap: anywhere;
  font: 13px/1.6 var(--tblr-font-sans-serif, system-ui, sans-serif);
  color: #c9d8e8;
  border: 1px solid rgba(142, 181, 221, 0.14);
}

/* Keep field descriptions readable on the dark admin surface. Tabler's
   default label color is too dark when the body background is overridden. */
.card label.form-label,
.card .form-check-label,
.card .form-control-plaintext {
  color: #b9cbe0 !important;
}
.card label.form-label {
  font-weight: 600;
}
.card .form-check-label {
  font-weight: 500;
}
.card .form-control-plaintext {
  min-height: calc(1.4285714em + 0.875rem + 2px);
  padding-top: 0.4375rem;
  padding-bottom: 0.4375rem;
}

/* ── Status badges ──────────────────────── */
.status-badge {
  display: inline-block;
  padding: 3px 10px;
  border-radius: 999px;
  font-size: 12px;
  font-weight: 600;
  line-height: 1.5;
  border: 1px solid transparent;
}
.status-active { background: rgba(44, 199, 170, 0.14); color: #4de2c4; border-color: rgba(44, 199, 170, 0.35); }
.status-disabled { background: rgba(127, 150, 173, 0.14); color: #a8bfd8; border-color: rgba(127, 150, 173, 0.3); }
.status-exhausted { background: rgba(240, 192, 64, 0.12); color: #ffca58; border-color: rgba(240, 192, 64, 0.3); }
.status-invalid { background: rgba(225, 96, 104, 0.14); color: #ffb4bc; border-color: rgba(225, 96, 104, 0.35); }
.status-error { background: rgba(225, 96, 104, 0.14); color: #ffb4bc; border-color: rgba(225, 96, 104, 0.35); }
.status-abnormal { background: rgba(225, 96, 104, 0.14); color: #ffb4bc; border-color: rgba(225, 96, 104, 0.35); }
.status-pending { background: rgba(51, 161, 255, 0.14); color: #7cc0ff; border-color: rgba(51, 161, 255, 0.35); }
.status-temporary_unavailable { background: rgba(240, 192, 64, 0.12); color: #ffca58; border-color: rgba(240, 192, 64, 0.3); }
.status-reserved { background: rgba(51, 161, 255, 0.14); color: #7cc0ff; border-color: rgba(51, 161, 255, 0.35); }
.status-succeeded { background: rgba(44, 199, 170, 0.14); color: #4de2c4; border-color: rgba(44, 199, 170, 0.35); }

/* ── Token row controls ─────────────────── */
.switch-btn {
  width: 40px;
  height: 22px;
  border-radius: 999px;
  border: 1px solid rgba(127, 150, 173, 0.35);
  background: rgba(127, 150, 173, 0.15);
  position: relative;
  cursor: pointer;
  transition: background 0.2s;
  flex-shrink: 0;
}
.switch-btn.on { background: rgba(44, 199, 170, 0.55); border-color: rgba(44, 199, 170, 0.6); }
.switch-btn.off { background: rgba(127, 150, 173, 0.12); }
.switch-btn:disabled { opacity: 0.45; cursor: not-allowed; }
.switch-knob {
  position: absolute;
  top: 2px;
  left: 2px;
  width: 16px;
  height: 16px;
  border-radius: 50%;
  background: #fff;
  transition: left 0.2s;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.4);
}
.switch-btn.on .switch-knob { left: 20px; }
.switch-text { margin-left: 8px; font-size: 12px; color: var(--leo-muted); }

.action-mini {
  background: rgba(51, 161, 255, 0.12);
  color: #7cc0ff;
  border: 1px solid rgba(51, 161, 255, 0.3);
  border-radius: 8px;
  padding: 3px 9px;
  font-size: 12px;
  cursor: pointer;
  margin-right: 4px;
  white-space: nowrap;
}
.action-mini:hover { background: rgba(51, 161, 255, 0.25); }
.action-mini.danger { background: rgba(225, 96, 104, 0.12); color: #ffb4bc; border-color: rgba(225, 96, 104, 0.3); }
.action-mini.danger:hover { background: rgba(225, 96, 104, 0.25); }
.action-mini:disabled { opacity: 0.45; cursor: not-allowed; }

/* ── Logs ───────────────────────────────── */
.log-row-running td { background: rgba(51, 161, 255, 0.05) !important; }
.log-state-btn {
  background: rgba(44, 199, 170, 0.12);
  color: #4de2c4;
  border: 1px solid rgba(44, 199, 170, 0.3);
  border-radius: 8px;
  padding: 2px 8px;
  font-size: 12px;
  cursor: pointer;
}
.log-state-btn.failed {
  background: rgba(225, 96, 104, 0.12);
  color: #ffb4bc;
  border-color: rgba(225, 96, 104, 0.3);
}
.log-prompt-btn {
  background: none;
  border: none;
  color: var(--leo-accent-2);
  cursor: pointer;
  padding: 0;
  font-size: 13px;
  text-align: left;
  max-width: 100%;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.log-prompt-btn:hover { text-decoration: underline; }
.preview-btn { cursor: pointer; }

.stats-grid .stat-value { color: #e7f1fd; }
.logs-pagination { align-items: center; }

/* ── Task report ────────────────────────── */
.task-report-status { font-weight: 600; color: var(--leo-accent); }
.task-report-progress-bar { background: linear-gradient(90deg, var(--leo-accent), var(--leo-accent-2)); }
.task-report-items { max-height: 320px; overflow-y: auto; font-size: 13px; }
.task-report-current { color: var(--leo-muted); font-size: 13px; }
.refresh-status { color: var(--leo-muted); font-size: 13px; }
.task-report-badge {
  display: inline-block;
  padding: 2px 8px;
  border-radius: 999px;
  font-size: 12px;
  background: rgba(127, 150, 173, 0.14);
  color: var(--leo-muted);
}
.task-report-badge.success, .task-report-badge.succeeded { background: rgba(44, 199, 170, 0.14); color: #4de2c4; }
.task-report-badge.failed, .task-report-badge.error { background: rgba(225, 96, 104, 0.14); color: #ffb4bc; }
.task-report-badge.pending, .task-report-badge.running { background: rgba(51, 161, 255, 0.14); color: #7cc0ff; }

/* ── Dialogs / modals ───────────────────── */
.dialog-modal,
.preview-modal {
  position: fixed;
  inset: 0;
  background: rgba(4, 8, 14, 0.72);
  backdrop-filter: blur(6px);
  display: none;
  align-items: flex-start;
  justify-content: center;
  z-index: 1050;
  overflow-y: auto;
  padding: 6vh 16px 40px;
}
.dialog-modal.open,
.preview-modal.open { display: flex; }
.dialog-card {
  width: 100%;
  max-width: 640px;
  background: #101b2b;
  border: 1px solid rgba(142, 181, 221, 0.2);
  border-radius: 16px;
  box-shadow: 0 24px 64px rgba(0, 0, 0, 0.55);
  padding: 22px;
}
.preview-modal-dialog {
  width: 100%;
  max-width: 860px;
  background: #101b2b;
  border: 1px solid rgba(142, 181, 221, 0.2);
  border-radius: 16px;
  box-shadow: 0 24px 64px rgba(0, 0, 0, 0.55);
  padding: 22px;
}
.preview-content video, .preview-content img {
  max-width: 100%;
  border-radius: 10px;
  display: block;
  margin: 0 auto;
}
.preview-close { float: right; }
.error-detail-content, .prompt-detail-content {
  white-space: pre-wrap;
  word-break: break-all;
  font-size: 13px;
  color: var(--leo-muted);
  background: rgba(0, 0, 0, 0.3);
  border-radius: 10px;
  padding: 12px;
  max-height: 420px;
  overflow-y: auto;
  margin-top: 10px;
}

/* ── Toast ──────────────────────────────── */
.leo-toast {
  position: fixed;
  bottom: 24px;
  left: 50%;
  transform: translateX(-50%) translateY(20px);
  background: #101b2b;
  border: 1px solid rgba(142, 181, 221, 0.25);
  color: #e7f1fd;
  padding: 12px 22px;
  border-radius: 12px;
  box-shadow: 0 12px 36px rgba(0, 0, 0, 0.5);
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.25s, transform 0.25s;
  z-index: 1200;
  font-size: 14px;
  max-width: 80vw;
  overflow-wrap: anywhere;
}
.leo-toast.show { opacity: 1; transform: translateX(-50%) translateY(0); }
.leo-toast.success { border-color: rgba(44, 199, 170, 0.5); }
.leo-toast.error { border-color: rgba(225, 96, 104, 0.5); }

/* ── Misc ───────────────────────────────── */
.help { color: var(--leo-muted); }
.msg { color: var(--leo-muted); font-size: 13px; }
.leo-pre {
  background: rgba(0, 0, 0, 0.3);
  border-radius: 10px;
  color: var(--leo-muted);
}
.leo-hint { color: var(--leo-warn); }
.leo-footer { border-top: 1px solid rgba(142, 181, 221, 0.1); }
.leo-footer a { color: var(--leo-accent-2); text-decoration: none; }
.leo-footer a:hover { text-decoration: underline; }

.empty-state { color: var(--leo-dim); }

/* Tabler form-check inside label needs pointer */
.checkbox-label { cursor: pointer; user-select: none; }

/* ── JS-injected config inputs (built with .input-text / plain label / .help) ── */
.input-text {
  display: block;
  width: 100%;
  padding: 0.4375rem 0.75rem;
  font-size: 0.875rem;
  font-weight: 400;
  line-height: 1.4285714286;
  color: var(--tblr-body-color, #e7f1fd);
  background-color: var(--tblr-bg-forms, #0b1522);
  background-clip: padding-box;
  border: var(--tblr-border-width, 1px) solid var(--tblr-border-color, #2a3b52);
  border-radius: var(--tblr-border-radius, 8px);
  transition: border-color 0.15s ease-in-out, box-shadow 0.15s ease-in-out;
}
.input-text:focus {
  border-color: #3f6f9e;
  box-shadow: 0 0 0 0.25rem rgba(51, 161, 255, 0.15);
  outline: none;
}
.input-select {
  background-color: var(--tblr-bg-forms, #0b1522);
  color: var(--tblr-body-color, #e7f1fd);
}
.form-group > label:not(.form-label) {
  display: inline-block;
  margin-bottom: 0.25rem;
  font-weight: 500;
  color: var(--tblr-body-color, #e7f1fd);
}
.form-group .form-label { margin-bottom: 0.25rem; }

/* Table tweaks */
.table-vcenter td { vertical-align: middle; }
.card-table tbody tr:hover { background: rgba(255, 255, 255, 0.02); }
.card-table thead th {
  color: var(--leo-muted);
  font-size: 12px;
}
.table .empty-state { color: var(--leo-muted); }

/* Responsive */
@media (max-width: 768px) {
  .leo-brand-sub { display: none !important; }
  .card-header { align-items: flex-start; }
}

/* Workspace refresh: quiet operations console with one consistent shape scale. */
:root {
  --leo-bg: #0a0f0d;
  --leo-surface: #121a17;
  --leo-surface-2: #18221e;
  --leo-border: #283630;
  --leo-border-soft: rgba(151, 176, 163, 0.16);
  --leo-text: #edf5f0;
  --leo-muted: #9bad9f;
  --leo-dim: #718278;
  --leo-accent: #56d6b3;
  --leo-accent-strong: #2eb18d;
  --leo-danger: #f08b94;
  --leo-warn: #e7bd6a;
}

html,
body {
  min-height: 100%;
}

body {
  background: var(--leo-bg);
  color: var(--leo-text);
  font-family: "Segoe UI Variable", "Microsoft YaHei UI", "Microsoft YaHei", system-ui, sans-serif;
  letter-spacing: 0;
}

.leo-navbar {
  position: sticky;
  top: 0;
  z-index: 20;
  min-height: 68px;
  padding: 0;
  background: rgba(10, 15, 13, 0.96);
  border-bottom: 1px solid var(--leo-border);
  backdrop-filter: blur(14px);
}

.leo-topbar {
  display: flex;
  align-items: center;
  min-height: 68px;
  padding-inline: 24px;
}

.leo-brand {
  display: inline-flex;
  align-items: center;
  gap: 11px;
  margin: 0;
  color: var(--leo-text) !important;
  font-size: 15px;
  font-weight: 700;
  letter-spacing: 0.01em;
}

.leo-brand-mark {
  display: inline-grid;
  width: 32px;
  height: 32px;
  place-items: center;
  border: 1px solid rgba(86, 214, 179, 0.55);
  border-radius: 8px;
  color: var(--leo-accent);
  font-size: 12px;
  font-weight: 800;
  letter-spacing: 0;
  filter: none;
}

.leo-brand-sub {
  margin-left: 14px;
  color: var(--leo-dim);
  font-size: 12px;
}

.app-shell {
  display: grid;
  grid-template-columns: 232px minmax(0, 1fr);
  min-height: calc(100dvh - 68px);
}

.app-sidebar {
  display: flex;
  position: sticky;
  top: 68px;
  height: calc(100dvh - 68px);
  flex-direction: column;
  padding: 28px 14px 18px;
  background: #0e1512;
  border-right: 1px solid var(--leo-border);
}

.rail-heading {
  display: grid;
  gap: 6px;
  padding: 0 13px 25px;
}

.rail-heading strong {
  color: var(--leo-text);
  font-size: 17px;
  font-weight: 700;
}

.rail-overline {
  color: var(--leo-dim);
  font-size: 10px;
  font-weight: 800;
  letter-spacing: 0.16em;
}

.leo-tabs {
  display: grid;
  gap: 5px;
  margin: 0 !important;
}

.leo-tabs .nav-link {
  width: 100%;
  padding: 11px 13px;
  border: 1px solid transparent;
  border-radius: 7px;
  color: var(--leo-muted);
  font-size: 13px;
  font-weight: 650;
  text-align: left;
  transition: background-color 160ms ease, border-color 160ms ease, color 160ms ease;
}

.leo-tabs .nav-link:hover,
.leo-tabs .nav-link:focus-visible {
  color: var(--leo-text);
  background: rgba(86, 214, 179, 0.06);
  border-color: var(--leo-border-soft);
}

.leo-tabs .nav-link.active {
  color: var(--leo-accent);
  background: rgba(86, 214, 179, 0.12);
  border-color: rgba(86, 214, 179, 0.26);
  box-shadow: none;
}

.rail-metrics {
  display: grid;
  gap: 11px;
  margin: 28px 7px 0;
  padding: 15px 13px;
  border-top: 1px solid var(--leo-border);
  border-bottom: 1px solid var(--leo-border);
}

.rail-metric {
  display: grid;
  gap: 3px;
}

.rail-metric span,
.rail-metrics-updated {
  color: var(--leo-dim);
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 0.04em;
}

.rail-metric strong {
  color: var(--leo-text);
  font-size: 13px;
  font-weight: 700;
  line-height: 1.2;
  overflow-wrap: anywhere;
}

.rail-generation-counts {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px;
  padding-bottom: 12px;
  border-bottom: 1px solid var(--leo-border);
}

.rail-metric strong.metric-calendar {
  color: #f0c040;
  font-size: 20px;
}

.rail-metric strong.metric-today {
  color: #4de2c4;
  font-size: 20px;
}

.rail-metrics-updated {
  color: var(--leo-muted);
  font-weight: 500;
}

.rail-footer {
  display: flex;
  align-items: center;
  gap: 9px;
  margin-top: auto;
  padding: 16px 13px 2px;
  color: var(--leo-dim);
  font-size: 11px;
}

.rail-dot {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: var(--leo-accent);
  box-shadow: 0 0 0 3px rgba(86, 214, 179, 0.12);
}

.app-main {
  width: 100%;
  max-width: 1480px;
  min-width: 0;
  padding: 30px clamp(18px, 3vw, 48px) 54px;
}

.tab-pane.active {
  animation: pane-in 180ms ease-out both;
}

@keyframes pane-in {
  from { opacity: 0; transform: translateY(4px); }
  to { opacity: 1; transform: translateY(0); }
}

.card {
  overflow: hidden;
  background: var(--leo-surface);
  border: 1px solid var(--leo-border);
  border-radius: 8px;
  box-shadow: 0 14px 34px rgba(0, 0, 0, 0.16);
}

.card-header {
  min-height: 58px;
  padding: 15px 20px;
  background: var(--leo-surface-2);
  border-bottom: 1px solid var(--leo-border);
}

.card-title {
  color: var(--leo-text);
  font-size: 15px;
  font-weight: 700;
}

.card-body {
  padding: 22px;
}

.token-pool-count {
  color: var(--leo-muted);
  font-size: 12px;
  font-weight: 650;
}

.btn {
  min-height: 36px;
  border-radius: 6px;
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 0;
  transition: transform 140ms ease, background-color 140ms ease, border-color 140ms ease, color 140ms ease;
}

.btn:active {
  transform: translateY(1px);
}

.btn-primary {
  color: #07120f;
  background: var(--leo-accent);
  border-color: var(--leo-accent);
}

.btn-primary:hover,
.btn-primary:focus-visible {
  color: #07120f;
  background: #75e2c5;
  border-color: #75e2c5;
}

.btn-outline-primary {
  color: var(--leo-accent);
  border-color: rgba(86, 214, 179, 0.55);
}

.btn-outline-primary:hover,
.btn-outline-primary:focus-visible {
  color: #07120f;
  background: var(--leo-accent);
  border-color: var(--leo-accent);
}

.btn-outline-secondary {
  color: var(--leo-muted);
  border-color: #43534b;
}

.btn-outline-secondary:hover,
.btn-outline-secondary:focus-visible {
  color: var(--leo-text);
  background: var(--leo-surface-2);
  border-color: #6a7d72;
}

.btn-outline-danger {
  color: var(--leo-danger);
  border-color: rgba(240, 139, 148, 0.54);
}

.btn-outline-danger:hover,
.btn-outline-danger:focus-visible {
  color: #1b0d0f;
  background: var(--leo-danger);
  border-color: var(--leo-danger);
}

.form-control,
.form-select,
.input-text {
  min-height: 38px;
  color: var(--leo-text);
  background-color: #0e1613;
  border: 1px solid #2c3c34;
  border-radius: 6px;
}

.form-control::placeholder,
.input-text::placeholder {
  color: #687a70;
}

.form-control:focus,
.form-select:focus,
.input-text:focus {
  color: var(--leo-text);
  background-color: #101a16;
  border-color: var(--leo-accent-strong);
  box-shadow: 0 0 0 3px rgba(86, 214, 179, 0.13);
}

textarea.form-control {
  min-height: 112px;
  resize: vertical;
}

.card label.form-label,
.card .form-check-label,
.card .form-control-plaintext {
  color: #b7c8be !important;
  font-size: 12px;
}

.card label.form-label {
  margin-bottom: 7px;
  font-weight: 700;
}

.text-secondary {
  color: var(--leo-muted) !important;
}

.table-responsive {
  scrollbar-color: #3a4b42 #101713;
}

.card-table {
  margin: 0;
}

.card-table thead th {
  padding: 12px 20px;
  color: #80948a;
  background: #111a16;
  border-bottom: 1px solid var(--leo-border);
  font-size: 10px;
  font-weight: 800;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  white-space: nowrap;
}

.card-table tbody td {
  padding: 14px 20px;
  color: #d6e2da;
  border-bottom: 1px solid rgba(151, 176, 163, 0.1);
  font-size: 13px;
}

.card-table tbody tr:last-child td {
  border-bottom: 0;
}

.card-table tbody tr:hover td {
  background: rgba(86, 214, 179, 0.035);
}

.card-table code {
  padding: 4px 6px;
  color: #d9eee4;
  background: #1d2a24;
  border: 1px solid rgba(151, 176, 163, 0.14);
  border-radius: 5px;
  font-size: 12px;
}

.card-table .token-index {
  width: 3.5rem;
  color: var(--leo-dim);
  font-variant-numeric: tabular-nums;
  text-align: right;
}

.card-table .token-email {
  min-width: 180px;
  white-space: nowrap;
}

.token-table {
  min-width: 1180px;
}

.token-table tbody td {
  white-space: nowrap;
}

.token-pagination-wrap {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding: 14px 20px;
  border-top: 1px solid rgba(151, 176, 163, 0.1);
}
.token-page-info {
  color: var(--leo-muted);
  font-size: 12px;
  white-space: nowrap;
}
.token-pagination {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  flex-wrap: wrap;
  gap: 6px;
}
.token-pagination .btn {
  min-width: 34px;
}
.token-pagination-ellipsis {
  padding: 4px 2px;
  color: var(--leo-dim);
}

.status-badge {
  padding: 4px 9px;
  border-radius: 999px;
  font-size: 11px;
  font-weight: 750;
}

.status-active,
.status-succeeded {
  color: #6ce0c0;
  background: rgba(86, 214, 179, 0.12);
  border-color: rgba(86, 214, 179, 0.3);
}

.status-invalid,
.status-error,
.status-abnormal {
  color: #ffadb5;
  background: rgba(240, 139, 148, 0.12);
  border-color: rgba(240, 139, 148, 0.3);
}

.status-disabled {
  color: #a6b5ab;
  background: rgba(151, 176, 163, 0.1);
  border-color: rgba(151, 176, 163, 0.22);
}

.status-exhausted,
.status-temporary_unavailable {
  color: #f1ca78;
  background: rgba(231, 189, 106, 0.12);
  border-color: rgba(231, 189, 106, 0.28);
}

.registrar-status {
  color: var(--leo-text);
  line-height: 1.65;
  overflow-wrap: anywhere;
}

.registrar-mail-mode {
  min-width: 0;
  margin: 0;
  padding: 0 8px;
  border: 0;
}

.registrar-mail-mode-options {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 8px;
}

.registrar-mail-mode-option {
  position: relative;
  min-width: 0;
  cursor: pointer;
}

.registrar-mail-mode-option input {
  position: absolute;
  width: 1px;
  height: 1px;
  opacity: 0;
  pointer-events: none;
}

.registrar-mail-mode-option > span {
  display: grid;
  min-height: 68px;
  align-content: center;
  gap: 4px;
  padding: 12px 14px;
  border: 1px solid #2c3c34;
  border-radius: 6px;
  background: #0e1613;
  transition: background-color 140ms ease, border-color 140ms ease;
}

.registrar-mail-mode-option strong {
  color: var(--leo-text);
  font-size: 13px;
}

.registrar-mail-mode-option small {
  color: var(--leo-muted);
  font-size: 11px;
  line-height: 1.4;
}

.registrar-mail-mode-option input:checked + span {
  border-color: rgba(86, 214, 179, 0.58);
  background: rgba(86, 214, 179, 0.1);
  box-shadow: inset 3px 0 0 var(--leo-accent);
}

.registrar-mail-mode-option input:focus-visible + span {
  outline: 3px solid rgba(86, 214, 179, 0.18);
  outline-offset: 1px;
}

.registrar-mail-mode-option input:disabled + span {
  cursor: not-allowed;
  opacity: 0.55;
}

.registrar-outlook-panel {
  padding: 16px;
  border: 1px solid rgba(86, 214, 179, 0.28);
  border-radius: 7px;
  background: #0d1713;
}

.registrar-outlook-header,
.registrar-outlook-actions {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
}

.registrar-outlook-kicker {
  color: var(--leo-accent);
  font-size: 10px;
  font-weight: 800;
  letter-spacing: 0.12em;
}

.registrar-outlook-header h3 {
  margin: 5px 0 0;
  color: var(--leo-text);
  font-size: 14px;
  font-weight: 700;
}

.registrar-outlook-status {
  color: var(--leo-muted);
  font-size: 12px;
  font-weight: 650;
  white-space: nowrap;
}

.registrar-outlook-status.empty {
  color: var(--leo-danger);
}

.registrar-outlook-input {
  margin-top: 14px;
  font-family: ui-monospace, "Cascadia Code", Consolas, monospace;
  font-size: 11px;
  line-height: 1.55;
}

.registrar-outlook-actions {
  margin-top: 10px;
  color: var(--leo-muted);
  font-size: 11px;
}

.registrar-log,
.leo-pre {
  background: #0d1512;
  border: 1px solid var(--leo-border);
  border-radius: 6px;
  color: #b7c8be;
}

.leo-toast {
  right: 24px;
  bottom: 24px;
  left: auto;
  max-width: min(420px, calc(100vw - 36px));
  transform: translateY(12px);
  padding: 13px 16px;
  border: 1px solid var(--leo-border);
  border-left: 3px solid var(--leo-accent);
  border-radius: 7px;
  background: #15201b;
  color: var(--leo-text);
  box-shadow: 0 16px 38px rgba(0, 0, 0, 0.32);
}

.leo-toast.show {
  transform: translateY(0);
}

.leo-toast.error {
  border-left-color: var(--leo-danger);
}

.empty-state {
  padding: 34px !important;
  color: var(--leo-dim) !important;
  text-align: center;
}

.leo-login-brand {
  color: var(--leo-text);
  letter-spacing: -0.02em;
}

@media (max-width: 900px) {
  .app-shell {
    display: block;
  }

  .app-sidebar {
    position: static;
    height: auto;
    padding: 15px 16px 12px;
    border-right: 0;
    border-bottom: 1px solid var(--leo-border);
  }

  .rail-heading {
    display: flex;
    align-items: baseline;
    gap: 9px;
    padding: 0 4px 12px;
  }

  .rail-heading strong {
    font-size: 14px;
  }

  .leo-tabs {
    display: flex;
    gap: 6px;
    overflow-x: auto;
    padding-bottom: 2px;
  }

  .leo-tabs .nav-link {
    width: auto;
    flex: 0 0 auto;
    padding: 9px 12px;
    white-space: nowrap;
  }

  .rail-footer {
    display: none;
  }

  .app-main {
    padding: 20px 16px 40px;
  }
}

@media (max-width: 576px) {
  .leo-topbar {
    min-height: 60px;
    padding-inline: 16px;
  }

  .leo-navbar {
    min-height: 60px;
  }

  .leo-brand {
    font-size: 13px;
  }

  .leo-brand-mark {
    width: 29px;
    height: 29px;
  }

  .card-body {
    padding: 17px;
  }

  .card-header {
    padding: 13px 16px;
    flex-wrap: wrap;
    row-gap: 10px;
  }

  .card-header .ms-auto {
    width: 100%;
    margin-left: 0 !important;
    margin-top: 12px;
  }

  .card-header .ms-auto .btn {
    flex: 1 1 auto;
  }

  .card-table thead th,
  .card-table tbody td {
    padding-right: 14px;
    padding-left: 14px;
  }

  .registrar-mail-mode-options {
    grid-template-columns: 1fr;
  }

  .registrar-outlook-header,
  .registrar-outlook-actions {
    align-items: flex-start;
    flex-direction: column;
  }
}

@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    scroll-behavior: auto !important;
    transition-duration: 0.01ms !important;
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
  }
}
