/* ============================================
   Adobe Bot — Admin Dashboard Stylesheet
   Dark sidebar · Light content · White cards
   ============================================ */

/* ---------- CSS Variables ---------- */
:root {
  /* Layout */
  --sidebar-bg: #111827;
  --sidebar-text: #9ca3af;
  --sidebar-hover: #1f2937;
  --sidebar-active: #1e40af;
  --sidebar-active-text: #ffffff;
  --sidebar-width: 240px;

  --content-bg: #f8fafc;
  --card-bg: #ffffff;
  --card-border: #e2e8f0;
  --card-shadow: 0 1px 3px rgba(0, 0, 0, 0.06);

  --text-primary: #1e293b;
  --text-secondary: #64748b;
  --text-muted: #94a3b8;

  --accent: #3b82f6;
  --accent-hover: #2563eb;
  --accent-light: #dbeafe;

  --good: #16a34a;
  --good-bg: #dcfce7;
  --warn: #d97706;
  --warn-bg: #fef3c7;
  --bad: #dc2626;
  --bad-bg: #fee2e2;

  --topbar-height: 60px;
  --radius: 8px;
  --radius-sm: 6px;
  --font: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
  --mono-font: 'JetBrains Mono', 'Fira Code', Consolas, monospace;
  --transition: 0.2s ease;

  /* Legacy aliases */
  --klein-50: #f3f4f6;
  --ink-700: #374151;
  --ink-900: #111827;
  --ink-600: #4b5563;
  --ink-500: #6b7280;
  --line: #e5e7eb;
  --line-soft: #f0f2f5;
  --klein: #111827;
}

/* ---------- Reset & Base ---------- */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

html { font-size: 14px; }

body {
  font-family: var(--font);
  color: var(--text-primary);
  background: var(--content-bg);
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
}

a { color: var(--accent); text-decoration: none; }
a:hover { text-decoration: underline; }

code, pre, .cell-mono {
  font-family: var(--mono-font);
  font-size: 0.92em;
}

h1, h2, h3 { font-weight: 700; line-height: 1.3; }

/* ---------- Shell Layout ---------- */
.shell {
  display: flex;
  min-height: 100vh;
}

/* ---------- Sidebar ---------- */
.sidebar {
  width: var(--sidebar-width);
  min-width: var(--sidebar-width);
  background: var(--sidebar-bg);
  color: var(--sidebar-text);
  display: flex;
  flex-direction: column;
  position: fixed;
  top: 0;
  left: 0;
  bottom: 0;
  z-index: 100;
  overflow-y: auto;
  transition: transform var(--transition);
}

.sidebar__logo {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 20px 16px 16px;
  font-size: 18px;
  font-weight: 800;
  color: #ffffff;
  border-bottom: 1px solid rgba(255, 255, 255, 0.06);
}

.sidebar__nav {
  flex: 1;
  padding: 12px 8px;
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.nav__group-label {
  padding: 14px 12px 6px;
  font-size: 11px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: #6b7280;
}

.nav__item {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 9px 12px;
  border-radius: var(--radius-sm);
  color: var(--sidebar-text);
  font-size: 14px;
  font-weight: 500;
  text-decoration: none;
  transition: background var(--transition), color var(--transition);
}

.nav__item:hover {
  background: var(--sidebar-hover);
  color: #ffffff;
  text-decoration: none;
}

.nav__item svg {
  width: 20px;
  height: 20px;
  flex-shrink: 0;
}

.nav__item--active,
.nav__item--active:hover {
  background: var(--sidebar-active);
  color: var(--sidebar-active-text);
}

/* ---------- Main Area ---------- */
.main {
  flex: 1;
  margin-left: var(--sidebar-width);
  display: flex;
  flex-direction: column;
  min-width: 0;
  min-height: 100vh;
}

/* ---------- Topbar ---------- */
.topbar {
  height: var(--topbar-height);
  background: var(--card-bg);
  border-bottom: 1px solid var(--card-border);
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 24px;
  position: sticky;
  top: 0;
  z-index: 50;
}

.topbar__title {
  font-size: 18px;
  font-weight: 700;
  color: var(--text-primary);
}

.topbar__subtitle {
  font-size: 12px;
  color: var(--text-muted);
  margin-top: 1px;
}

.topbar__right {
  display: flex;
  align-items: center;
  gap: 14px;
}

/* Status pill */
.status-pill {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 4px 12px;
  border-radius: 999px;
  background: var(--good-bg);
  color: var(--good);
  font-size: 12px;
  font-weight: 600;
}

.status-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--good);
  animation: pulse-dot 2s infinite;
}

@keyframes pulse-dot {
  0%, 100% { opacity: 1; }
  50% { opacity: 0.4; }
}

/* User chip & dropdown */
.user-chip {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 6px 12px;
  border: 1px solid var(--card-border);
  border-radius: 999px;
  background: var(--card-bg);
  cursor: pointer;
  font-size: 13px;
  font-weight: 500;
  color: var(--text-primary);
  transition: background var(--transition);
}

.user-chip:hover { background: var(--klein-50); }

.user-avatar {
  width: 28px;
  height: 28px;
  border-radius: 50%;
  background: var(--accent);
  color: #ffffff;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: 12px;
  font-weight: 700;
}

.dropdown {
  position: absolute;
  top: calc(100% + 6px);
  right: 0;
  min-width: 140px;
  background: var(--card-bg);
  border: 1px solid var(--card-border);
  border-radius: var(--radius-sm);
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
  padding: 4px;
  z-index: 200;
}

.dropdown__item {
  display: block;
  width: 100%;
  padding: 8px 12px;
  border: none;
  background: none;
  text-align: left;
  font-size: 13px;
  color: var(--text-primary);
  cursor: pointer;
  border-radius: 4px;
  transition: background var(--transition);
}

.dropdown__item:hover { background: var(--klein-50); }

.dropdown__item--danger { color: var(--bad); }
.dropdown__item--danger:hover { background: var(--bad-bg); }

/* ---------- Page Content ---------- */
.page {
  flex: 1;
  padding: 24px;
}

/* ---------- Cards ---------- */
.card {
  background: var(--card-bg);
  border: 1px solid var(--card-border);
  border-radius: var(--radius);
  box-shadow: var(--card-shadow);
  margin-bottom: 20px;
}

.card__header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 16px 20px;
  border-bottom: 1px solid var(--line-soft);
}

.card__header h2 { font-size: 16px; }
.card__header p { font-size: 12px; color: var(--text-muted); margin-top: 2px; }

.card__body {
  padding: 16px 20px;
}

/* ---------- Stats Grid ---------- */
.stats-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
  gap: 14px;
  margin-bottom: 20px;
}

.stat-card {
  background: var(--card-bg);
  border: 1px solid var(--card-border);
  border-radius: var(--radius);
  box-shadow: var(--card-shadow);
  padding: 16px 20px;
}

.stat-card__label {
  font-size: 12px;
  font-weight: 600;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.04em;
  margin-bottom: 6px;
}

.stat-card__value {
  font-size: 28px;
  font-weight: 800;
  color: var(--text-primary);
}

.stat-card__value--green { color: var(--good); }

/* ---------- Buttons ---------- */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  padding: 8px 16px;
  border: 1px solid transparent;
  border-radius: var(--radius-sm);
  font-size: 13px;
  font-weight: 600;
  font-family: var(--font);
  cursor: pointer;
  transition: background var(--transition), border-color var(--transition), color var(--transition);
  white-space: nowrap;
}

.btn:disabled {
  opacity: 0.5;
  cursor: not-allowed;
}

.btn--primary {
  background: var(--klein);
  color: #ffffff;
  border-color: var(--klein);
}

.btn--primary:hover:not(:disabled) {
  background: #1f2937;
  border-color: #1f2937;
}

.btn--ghost {
  background: transparent;
  color: var(--text-primary);
  border-color: var(--line);
}

.btn--ghost:hover:not(:disabled) {
  background: var(--klein-50);
}

.btn--danger {
  background: var(--bad);
  color: #ffffff;
  border-color: var(--bad);
}

.btn--danger:hover:not(:disabled) {
  background: #b91c1c;
  border-color: #b91c1c;
}

.btn--mother {
  background: #faf5ff;
  color: #7e22ce;
  border-color: #e9d5ff;
}

.btn--mother:hover:not(:disabled) {
  background: #f3e8ff;
  border-color: #d8b4fe;
}

.btn--sm {
  padding: 5px 10px;
  font-size: 12px;
}

/* ---------- Forms ---------- */
.form-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 14px;
}

.col-span-2 { grid-column: span 2; }

.field {
  display: flex;
  flex-direction: column;
  gap: 5px;
}

.field span {
  font-size: 13px;
  font-weight: 600;
  color: var(--ink-700);
}

.field-input,
.field-select,
.field-textarea {
  padding: 8px 12px;
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
  font-size: 13px;
  font-family: var(--font);
  color: var(--text-primary);
  background: var(--card-bg);
  transition: border-color var(--transition), box-shadow var(--transition);
  outline: none;
}

.field-input:focus,
.field-select:focus,
.field-textarea:focus {
  border-color: var(--accent);
  box-shadow: 0 0 0 3px rgba(59, 130, 246, 0.12);
}

.field-input::placeholder,
.field-textarea::placeholder {
  color: var(--text-muted);
}

.field-select {
  appearance: auto;
  cursor: pointer;
}

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

/* ---------- Table ---------- */
.table-wrap {
  overflow-x: auto;
}

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

.table thead th {
  position: sticky;
  top: 0;
  background: var(--klein-50);
  padding: 10px 12px;
  text-align: left;
  font-weight: 700;
  font-size: 12px;
  color: var(--ink-600);
  text-transform: uppercase;
  letter-spacing: 0.03em;
  border-bottom: 2px solid var(--line);
  white-space: nowrap;
  z-index: 2;
}

.table tbody td {
  padding: 10px 12px;
  border-bottom: 1px solid var(--line-soft);
  vertical-align: middle;
}

.table tbody tr:hover {
  background: #f1f5f9;
}

.col-check { width: 36px; text-align: center; }
.col-actions {
  position: sticky;
  right: 0;
  white-space: nowrap;
  background: var(--card-bg);
  box-shadow: -1px 0 0 var(--line-soft);
  z-index: 1;
}

.table thead .col-actions {
  right: 0;
  z-index: 3;
}

.table tbody tr:hover .col-actions {
  background: #f1f5f9;
}

.cell-primary { font-weight: 600; color: var(--text-primary); }
.cell-mono { font-family: var(--mono-font); font-size: 12px; }
.cell-sub { font-size: 12px; color: var(--text-muted); }

.empty-state {
  text-align: center;
  padding: 40px 20px;
  color: var(--text-muted);
  font-size: 14px;
}

/* Table footer & pagination */
.table-footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 12px 20px;
  border-top: 1px solid var(--line-soft);
  font-size: 13px;
}

.table-info { color: var(--text-muted); }

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

.page-info {
  font-size: 13px;
  color: var(--text-secondary);
  min-width: 50px;
  text-align: center;
}

.page-prev, .page-next { /* extends .btn .btn--ghost .btn--sm in HTML */ }

.page-size {
  padding: 5px 8px;
  font-size: 12px;
}

/* ---------- Toolbar ---------- */
.card__toolbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 10px 20px;
  border-bottom: 1px solid var(--line-soft);
  gap: 10px;
  flex-wrap: wrap;
}

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

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

.toolbar__search {
  width: 220px;
}

.toolbar__status,
.toolbar__filter {
  width: auto;
  min-width: 110px;
}

/* Bulk bar */
.bulk-bar {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 4px 10px;
  background: var(--accent-light);
  border-radius: var(--radius-sm);
  font-size: 12px;
  color: var(--accent);
  font-weight: 600;
}

.bulk-count { font-weight: 800; }

/* ---------- Pills / Badges ---------- */
.pill {
  display: inline-flex;
  align-items: center;
  padding: 3px 10px;
  border-radius: 999px;
  font-size: 12px;
  font-weight: 600;
  line-height: 1.4;
}

.pill--active {
  background: var(--good-bg);
  color: var(--good);
}

.pill--pending {
  background: var(--warn-bg);
  color: var(--warn);
}

.pill--disabled {
  background: var(--bad-bg);
  color: var(--bad);
}

.pill--mother {
  background: #f3e8ff;
  color: #7e22ce;
}

.pill--neutral {
  background: #e2e8f0;
  color: var(--text-secondary);
}

/* ---------- Modal ---------- */
.modal-mask {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.4);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 500;
  animation: fadeIn 0.2s ease;
}

[hidden] { display: none !important; }
.modal-mask[hidden] { display: none !important; }

.modal {
  background: var(--card-bg);
  border-radius: var(--radius);
  box-shadow: 0 20px 50px rgba(0, 0, 0, 0.15);
  width: 90%;
  max-width: 520px;
  max-height: 85vh;
  display: flex;
  flex-direction: column;
  animation: slideUp 0.25s ease;
}

.modal--lg { max-width: 680px; }

.modal__header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 16px 20px;
  border-bottom: 1px solid var(--line-soft);
}

.modal__header h3,
.modal-title {
  font-size: 16px;
  font-weight: 700;
}

.modal__close {
  background: none;
  border: none;
  font-size: 22px;
  color: var(--text-muted);
  cursor: pointer;
  padding: 2px 6px;
  border-radius: 4px;
  line-height: 1;
  transition: color var(--transition), background var(--transition);
}

.modal__close:hover {
  color: var(--text-primary);
  background: var(--klein-50);
}

.modal__body {
  padding: 16px 20px;
  overflow-y: auto;
  flex: 1;
}

.modal__footer {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 8px;
  padding: 12px 20px;
  border-top: 1px solid var(--line-soft);
}

@keyframes fadeIn {
  from { opacity: 0; }
  to { opacity: 1; }
}

@keyframes slideUp {
  from { opacity: 0; transform: translateY(20px); }
  to { opacity: 1; transform: translateY(0); }
}

/* ---------- CRUD Modal (generated by crud-table.js) ---------- */
.crud-modal { /* extends .modal-mask */ }
.crud-form { /* extends .form-grid */ }
.crud-save { /* extends .btn .btn--primary */ }

/* ---------- Row action buttons (generated by crud-table.js) ---------- */
.row-check, .check-all {
  width: 15px;
  height: 15px;
  accent-color: var(--accent);
  cursor: pointer;
}

.row-edit, .row-del, .row-custom {
  margin-right: 4px;
}

/* ---------- Toast ---------- */
.toast-stack {
  position: fixed;
  top: 16px;
  right: 16px;
  z-index: 999;
  display: flex;
  flex-direction: column;
  gap: 8px;
  pointer-events: none;
}

.toast {
  padding: 10px 18px;
  border-radius: var(--radius-sm);
  font-size: 13px;
  font-weight: 500;
  color: #ffffff;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
  animation: toastIn 0.3s ease;
  pointer-events: auto;
  max-width: 360px;
}

.toast--success { background: var(--good); }
.toast--error { background: var(--bad); }
.toast--info { background: var(--accent); }
.toast--warn { background: var(--warn); color: #78350f; }

.toast--out {
  animation: toastOut 0.3s ease forwards;
}

@keyframes toastIn {
  from { opacity: 0; transform: translateX(60px); }
  to { opacity: 1; transform: translateX(0); }
}

@keyframes toastOut {
  from { opacity: 1; transform: translateX(0); }
  to { opacity: 0; transform: translateX(60px); }
}

/* ---------- Mail Drawer ---------- */
.mail-drawer {
  position: fixed;
  inset: 0;
  z-index: 400;
}

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

.mail-drawer__mask {
  position: absolute;
  inset: 0;
  background: rgba(0, 0, 0, 0.3);
  animation: fadeIn 0.2s ease;
}

.mail-drawer__panel {
  position: absolute;
  top: 0;
  right: 0;
  bottom: 0;
  width: 480px;
  max-width: 92vw;
  background: var(--card-bg);
  box-shadow: -4px 0 20px rgba(0, 0, 0, 0.1);
  display: flex;
  flex-direction: column;
  animation: drawerIn 0.25s ease;
}

@keyframes drawerIn {
  from { transform: translateX(100%); }
  to { transform: translateX(0); }
}

.mail-drawer__head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  padding: 16px 20px;
  border-bottom: 1px solid var(--line-soft);
}

.mail-drawer__head h3 { font-size: 16px; }

.mail-drawer__identity {
  min-width: 0;
}

.mail-drawer__account {
  font-size: 13px;
  color: var(--accent);
  font-family: var(--mono-font);
  margin-top: 2px;
}

.mail-drawer__summary {
  margin-top: 4px;
  color: var(--text-muted);
  font-size: 12px;
}

.mail-drawer__head__tools {
  display: flex;
  align-items: center;
  gap: 6px;
}

.mail-drawer__body {
  flex: 1;
  overflow-y: auto;
  padding: 12px 16px;
}

/* Mail items */
.mail-item {
  padding: 12px 14px;
  border: 1px solid var(--line-soft);
  border-radius: var(--radius-sm);
  margin-bottom: 8px;
  transition: background var(--transition);
}

.mail-item:hover {
  background: var(--klein-50);
}

.mail-item:has(.mail-item__toggle:focus-visible) {
  outline: 2px solid var(--accent);
  outline-offset: 2px;
}

.mail-item--open { background: var(--klein-50); }

.mail-item__toggle {
  appearance: none;
  display: block;
  width: 100%;
  padding: 0;
  border: 0;
  outline: 0;
  background: transparent;
  color: inherit;
  font: inherit;
  text-align: left;
  cursor: pointer;
}

.mail-item__row {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 4px;
}

.mail-item__subject {
  font-weight: 600;
  font-size: 13px;
  color: var(--text-primary);
  flex: 1;
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.mail-item__folder {
  font-size: 11px;
  padding: 1px 8px;
  border-radius: 999px;
  background: var(--accent-light);
  color: var(--accent);
  font-weight: 600;
  flex-shrink: 0;
}

.mail-item__meta {
  display: block;
  font-size: 12px;
  color: var(--text-muted);
  margin-bottom: 4px;
}

.mail-item__preview {
  display: block;
  font-size: 12px;
  color: var(--text-secondary);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.mail-item--open .mail-item__preview { display: none; }

.mail-item__full {
  margin-top: 10px;
  overflow: hidden;
  border: 1px solid var(--line-soft);
  border-radius: 8px;
  background: #ffffff;
}

.mail-item__frame {
  display: block;
  width: 100%;
  height: min(52vh, 520px);
  min-height: 280px;
  border: 0;
  background: #ffffff;
}

/* OTP code badge */
.mail-item__otp {
  appearance: none;
  font: inherit;
  display: inline-flex;
  align-items: center;
  gap: 8px;
  margin: 6px 0;
  padding: 6px 12px;
  background: #eff6ff;
  border: 1px solid #bfdbfe;
  border-radius: 8px;
  cursor: pointer;
  transition: all 0.2s;
  user-select: none;
}

.mail-item__otp:hover {
  background: #dbeafe;
  border-color: #93c5fd;
  box-shadow: 0 1px 4px rgba(59, 130, 246, 0.15);
}

.mail-item__otp--copied {
  background: #dcfce7;
  border-color: #86efac;
}

.mail-item__otp-label {
  font-size: 11px;
  font-weight: 600;
  color: var(--accent);
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.mail-item__otp-code {
  font-family: 'JetBrains Mono', 'Fira Code', Consolas, monospace;
  font-size: 18px;
  font-weight: 700;
  color: var(--text-primary);
  letter-spacing: 2px;
}

.mail-item__otp-copy {
  color: var(--text-muted);
  flex-shrink: 0;
}

.mail-item__otp:hover .mail-item__otp-copy {
  color: var(--accent);
}

/* Mail empty states */
.mail-empty {
  text-align: center;
  padding: 40px 20px;
  color: var(--text-muted);
  font-size: 14px;
}

.mail-empty__hint {
  font-size: 12px;
  margin-top: 6px;
  color: var(--text-muted);
}

.mail-empty--error { color: var(--bad); }

.mail-empty__title {
  color: var(--text-primary);
  font-weight: 700;
}

.mail-empty--error .mail-empty__title {
  color: var(--bad);
}

.mail-empty__actions {
  display: flex;
  justify-content: center;
  gap: 8px;
  margin-top: 16px;
}

.mail-warning {
  margin-bottom: 10px;
  padding: 10px 12px;
  border: 1px solid #fde68a;
  border-radius: var(--radius-sm);
  background: #fffbeb;
  color: #92400e;
  font-size: 12px;
  line-height: 1.55;
}

.mail-list__footer {
  display: flex;
  justify-content: center;
  padding: 12px 0 4px;
}

.mail-list__footer--muted {
  color: var(--text-muted);
  font-size: 12px;
}

/* ---------- Import ---------- */
.import-hint {
  font-size: 13px;
  color: var(--ink-600);
  line-height: 1.7;
  margin-bottom: 12px;
  padding: 10px 14px;
  background: var(--klein-50);
  border-radius: var(--radius-sm);
  border: 1px solid var(--line);
}

.import-hint code {
  background: #e2e8f0;
  padding: 2px 6px;
  border-radius: 4px;
  font-size: 12px;
}

.import-textarea {
  min-height: 160px;
  font-family: var(--mono-font);
  font-size: 12px;
  line-height: 1.6;
}

/* ---------- Receive Card ---------- */
.receive-card {
  margin-bottom: 20px;
}

.receive-card__head {
  padding: 16px 20px 0;
}

.receive-card__head h2 { font-size: 16px; }
.receive-card__head p { font-size: 12px; color: var(--text-muted); margin-top: 2px; }

.receive-bar {
  display: flex;
  gap: 8px;
  padding: 12px 20px 16px;
}

.receive-bar .field-input { flex: 1; }

/* ---------- Register Page ---------- */
.reg-grid {
  display: grid;
  grid-template-columns: minmax(320px, 1fr) minmax(380px, 1.2fr);
  gap: 14px;
  align-items: start;
}

.reg-log {
  min-height: 280px;
  max-height: 520px;
  overflow: auto;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: #0f172a;
  color: #e2e8f0;
  padding: 12px 14px;
  font-family: var(--mono-font);
  font-size: 12px;
  line-height: 1.6;
}

.reg-log:empty::before {
  content: "暂无日志";
  color: #94a3b8;
}

.reg-pills {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.reg-pill {
  display: inline-flex;
  align-items: center;
  min-height: 32px;
  padding: 0 12px;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: var(--klein-50);
  color: var(--ink-700);
  font-size: 13px;
  font-weight: 600;
}

.reg-pill b { margin-left: 4px; color: var(--ink-900); }
.reg-pill--ok b { color: var(--good); }
.reg-pill--err b { color: var(--bad); }

.reg-runbar {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  align-items: center;
  justify-content: flex-end;
  margin-top: 16px;
  padding-top: 14px;
  border-top: 1px solid var(--line-soft);
}

.reg-hint {
  margin: 12px 0 0;
  padding: 12px 14px;
  border-radius: 10px;
  background: var(--klein-50);
  border: 1px solid var(--line);
  font-size: 13px;
  line-height: 1.65;
  color: var(--ink-700);
}

/* ---------- Login Page ---------- */
.login-page {
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 100vh;
  background: var(--klein-50);
}

.login-card {
  width: 100%;
  max-width: 400px;
}

.login-card .card { padding: 32px; }

.login-logo {
  text-align: center;
  margin-bottom: 24px;
}

.login-logo svg { margin-bottom: 8px; }

.login-logo h1 {
  font-size: 22px;
  font-weight: 800;
  color: var(--ink-900);
  margin: 0;
}

.login-logo p {
  color: var(--ink-500);
  font-size: 13px;
  margin: 4px 0 0;
}

.login-form .field { margin-bottom: 16px; }

.login-btn { width: 100%; }

/* ---------- Responsive ---------- */
@media (max-width: 1100px) {
  .reg-grid { grid-template-columns: 1fr; }
}

@media (max-width: 768px) {
  .sidebar {
    transform: translateX(-100%);
  }

  .sidebar.open {
    transform: translateX(0);
    box-shadow: 4px 0 20px rgba(0, 0, 0, 0.2);
  }

  .main {
    margin-left: 0;
  }

  .topbar {
    padding: 0 16px;
  }

  .topbar__subtitle { display: none; }

  .page {
    padding: 16px;
  }

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

  .col-span-2 { grid-column: span 1; }

  .toolbar__search { width: 100%; }

  .card__toolbar {
    flex-direction: column;
    align-items: stretch;
  }

  .toolbar__left, .toolbar__right {
    width: 100%;
  }

  .table-footer {
    flex-direction: column;
    gap: 8px;
    align-items: flex-start;
  }

  .modal { max-width: 95vw; }
  .modal--lg { max-width: 95vw; }

  .mail-drawer__panel { width: 100vw; max-width: 100vw; }

  .receive-bar {
    flex-direction: column;
  }

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

@media (max-width: 480px) {
  .stats-grid {
    grid-template-columns: 1fr;
  }
}
