/* ═══════════════════════════════════════════════════
   DX工作室 — 简洁专业风 v3.0
   灵感来源: 1688ai.vip 清爽卡片风格
   背景: 浅灰  #f0f4f8
   主色: 靛紫  #4f46e5
   卡片: 纯白  #ffffff
════════════════════════════════════════════════════ */

@import url('https://fonts.googleapis.com/css2?family=Outfit:wght@300;400;500;600;700;900&family=Noto+Sans+SC:wght@400;500;700&display=swap');

:root {
  --accent:     #4f46e5;
  --accent-h:   #4338ca;
  --accent-lt:  #eef2ff;
  --accent-md:  #c7d2fe;
  --green:      #16a34a;
  --green-lt:   #dcfce7;
  --orange:     #ea580c;
  --orange-lt:  #ffedd5;
  --red:        #dc2626;
  --red-lt:     #fee2e2;
  --yellow:     #d97706;
  --yellow-lt:  #fef3c7;
  --blue:       #2563eb;
  --blue-lt:    #dbeafe;

  --bg:         #f0f4f8;
  --bg2:        #e8eef6;
  --white:      #ffffff;
  --card-br:    #e2e8f0;
  --text:       #1e293b;
  --text-2:     #475569;
  --text-3:     #94a3b8;
  --text-4:     #cbd5e1;

  --r:          12px;
  --r-sm:       8px;
  --shadow:     0 1px 4px rgba(0,0,0,.06), 0 2px 8px rgba(0,0,0,.04);
  --shadow-md:  0 4px 20px rgba(0,0,0,.09);
  --shadow-lg:  0 8px 32px rgba(79,70,229,.14);
}

*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
html { scroll-behavior: smooth; }
body {
  font-family: 'Outfit', 'Noto Sans SC', sans-serif;
  background: var(--bg);
  color: var(--text);
  line-height: 1.6;
  min-height: 100vh;
  font-size: 15px;
}

.container { max-width: 760px; margin: 0 auto; padding: 0 16px; }
.page-body { min-height: calc(100vh - 110px); }

/* ══════════════════════════════════════════
   NAVBAR
══════════════════════════════════════════ */
.top-navbar {
  background: var(--white);
  border-bottom: 1px solid var(--card-br);
  box-shadow: var(--shadow);
  position: sticky; top: 0; z-index: 100;
}
.navbar-inner {
  max-width: 760px; margin: 0 auto; padding: 0 16px;
  height: 54px; display: flex; align-items: center;
  justify-content: space-between; gap: 12px;
}
.navbar-logo a {
  font-size: 1.15rem; font-weight: 800; text-decoration: none; color: var(--text);
  display: flex; align-items: center; gap: 7px;
}
.navbar-logo a::before {
  content: '◈';
  color: var(--accent); font-size: 1.1rem;
}
.header-controls { display: flex; align-items: center; gap: 8px; }

/* CDKey form */
.cdkey-form { display: flex; align-items: center; gap: 6px; }
.cdkey-input {
  border: 1.5px solid var(--card-br); border-radius: var(--r-sm);
  padding: 6px 12px; font-size: .84rem; font-family: inherit;
  outline: none; background: var(--bg); color: var(--text);
  width: 190px; transition: border-color .2s, box-shadow .2s;
}
.cdkey-input:focus { border-color: var(--accent); box-shadow: 0 0 0 3px rgba(79,70,229,.1); }
.btn-activate {
  background: var(--accent); color: #fff;
  border: none; border-radius: var(--r-sm); padding: 6px 14px;
  font-size: .84rem; font-weight: 600; font-family: inherit;
  cursor: pointer; white-space: nowrap; transition: background .2s, transform .15s;
}
.btn-activate:hover { background: var(--accent-h); transform: translateY(-1px); }

/* Quota badge */
.quota-badge {
  display: inline-flex; align-items: center; gap: 5px;
  background: var(--accent-lt); border: 1px solid var(--accent-md);
  border-radius: 20px; padding: 4px 12px;
  font-size: .82rem; font-weight: 600; color: var(--accent);
}

/* Nav buttons */
.action-nav { display: flex; align-items: center; gap: 5px; }
.nav-btn {
  display: inline-flex; align-items: center; gap: 4px;
  padding: 5px 12px; border-radius: var(--r-sm);
  font-size: .8rem; font-weight: 600; font-family: inherit;
  text-decoration: none; cursor: pointer; border: none;
  background: var(--bg); color: var(--text-2);
  transition: all .15s;
}
.nav-btn:hover { background: var(--bg2); color: var(--text); }
.nav-btn.buy {
  background: var(--accent); color: #fff;
}
.nav-btn.buy:hover { background: var(--accent-h); }

/* ══════════════════════════════════════════
   STEPS BAR (under navbar)
══════════════════════════════════════════ */
.steps-bar {
  background: var(--white); border-bottom: 1px solid var(--card-br);
  padding: 0;
}
.steps-inner {
  max-width: 760px; margin: 0 auto; padding: 10px 16px;
  display: flex; align-items: center; gap: 12px; flex-wrap: wrap;
}
.step-item {
  display: flex; align-items: center; gap: 8px;
  background: var(--bg); border: 1px solid var(--card-br);
  border-radius: 8px; padding: 7px 14px;
  text-decoration: none; cursor: pointer;
  transition: border-color .2s, box-shadow .2s;
  flex: 1; min-width: 160px;
}
.step-item:hover { border-color: var(--accent); box-shadow: 0 0 0 2px rgba(79,70,229,.08); }
.step-num {
  width: 22px; height: 22px; border-radius: 50%;
  display: flex; align-items: center; justify-content: center;
  font-size: .72rem; font-weight: 800; flex-shrink: 0;
}
.step-num.s1 { background: #dbeafe; color: #1d4ed8; }
.step-num.s2 { background: #fef3c7; color: #92400e; }
.step-text { font-size: .8rem; color: var(--text-2); line-height: 1.3; }
.step-text strong { display: block; font-size: .82rem; color: var(--text); font-weight: 700; }
.step-link { margin-left: auto; color: var(--accent); font-size: .75rem; font-weight: 600; }

/* ══════════════════════════════════════════
   PAGE WRAPPER
══════════════════════════════════════════ */
.page-body { padding: 20px 0 40px; }

/* ══════════════════════════════════════════
   ALERT
══════════════════════════════════════════ */
.alert-security {
  display: flex; gap: 12px; align-items: flex-start;
  background: #fffbeb; border: 1px solid #fde68a;
  border-left: 4px solid var(--yellow);
  border-radius: var(--r-sm); padding: .9rem 1rem;
  margin-bottom: 14px; font-size: .83rem; color: #78350f;
}
.alert-security .icon { font-size: 1rem; flex-shrink: 0; margin-top: 1px; }
.alert-security .danger { color: var(--red); font-weight: 600; }

.alert-info {
  display: flex; gap: 12px; align-items: flex-start;
  background: var(--white); border: 1px solid var(--card-br);
  border-left: 4px solid var(--accent);
  border-radius: var(--r-sm); padding: .9rem 1rem;
  margin-bottom: 14px; font-size: .83rem; color: var(--text-2);
  position: relative;
}
.alert-info .content { flex: 1; }
.alert-close {
  background: none; border: none; cursor: pointer;
  color: var(--text-4); font-size: .95rem; padding: 0 2px;
  align-self: flex-start; transition: color .15s;
}
.alert-close:hover { color: var(--text); }

/* ══════════════════════════════════════════
   CARD
══════════════════════════════════════════ */
.card {
  background: var(--white); border: 1px solid var(--card-br);
  border-radius: var(--r); box-shadow: var(--shadow);
  margin-bottom: 14px; overflow: hidden;
}
.card-header {
  display: flex; align-items: center; gap: 10px;
  padding: 14px 18px; border-bottom: 1px solid var(--card-br);
}
.card-icon {
  width: 28px; height: 28px; border-radius: 8px;
  display: flex; align-items: center; justify-content: center;
  font-size: .9rem; flex-shrink: 0;
}
.card-icon.blue { background: var(--blue-lt); }
.card-icon.purple { background: var(--accent-lt); }
.card-icon.green { background: var(--green-lt); }
.card-title { font-size: .95rem; font-weight: 700; color: var(--text); }
.card-subtitle { font-size: .78rem; color: var(--text-3); margin-top: 1px; }
.card-body { padding: 18px; }

/* ══════════════════════════════════════════
   STATS
══════════════════════════════════════════ */
.stats-grid {
  display: grid; grid-template-columns: repeat(4,1fr); gap: 10px;
  margin-bottom: 14px;
}
.stat-card {
  background: var(--white); border: 1px solid var(--card-br);
  border-radius: var(--r); padding: 14px 12px;
  text-align: center; box-shadow: var(--shadow);
}
.stat-title { font-size: .75rem; color: var(--text-3); font-weight: 500; margin-bottom: 5px; }
.stat-value { font-size: 1.8rem; font-weight: 800; line-height: 1; }
.val-total  { color: var(--accent); }
.val-pending{ color: var(--yellow); }
.val-success{ color: var(--green); }
.val-danger { color: var(--red); }

/* ══════════════════════════════════════════
   QUEUE BAR
══════════════════════════════════════════ */
.queue-card {
  background: var(--white); border: 1px solid var(--card-br);
  border-radius: var(--r); padding: 12px 18px;
  margin-bottom: 14px; display: flex; align-items: center; gap: 10px;
  box-shadow: var(--shadow);
}
.q-icon { font-size: 1.1rem; flex-shrink: 0; }
.q-text { font-size: .86rem; color: var(--text-2); font-weight: 500; flex: 1; }
.queue-pulse {
  width: 9px; height: 9px; background: var(--green);
  border-radius: 50%; flex-shrink: 0;
  animation: pulse 2s ease-in-out infinite;
}
@keyframes pulse {
  0%,100% { box-shadow: 0 0 0 0 rgba(22,163,74,.4); }
  50% { box-shadow: 0 0 0 5px rgba(22,163,74,0); }
}

/* ══════════════════════════════════════════
   MAIN TABLE CARD
══════════════════════════════════════════ */
.main-card {
  background: var(--white); border: 1px solid var(--card-br);
  border-radius: var(--r); box-shadow: var(--shadow);
  margin-bottom: 14px; overflow: hidden;
}
.main-card-header {
  display: flex; align-items: center; justify-content: space-between;
  padding: 12px 16px; border-bottom: 1px solid var(--card-br);
  flex-wrap: wrap; gap: 8px;
}
.tab-bar { display: flex; gap: 3px; }
.tab-btn {
  padding: 5px 13px; border-radius: 6px; border: none;
  font-size: .8rem; font-weight: 600; cursor: pointer; font-family: inherit;
  background: transparent; color: var(--text-3); transition: all .15s;
}
.tab-btn.active { background: var(--accent-lt); color: var(--accent); }
.tab-btn:hover:not(.active) { background: var(--bg); }

.table-actions {
  display: flex; align-items: center; gap: 8px;
  padding: 10px 16px; border-bottom: 1px solid var(--card-br);
  flex-wrap: wrap;
}
.search-input {
  flex: 1; min-width: 160px;
  border: 1.5px solid var(--card-br); border-radius: var(--r-sm);
  padding: 7px 11px; font-size: .83rem; font-family: inherit;
  outline: none; background: var(--bg); color: var(--text);
  transition: border-color .2s;
}
.search-input:focus { border-color: var(--accent); }

/* Submit / Import button */
.btn-import {
  display: inline-flex; align-items: center; gap: 6px;
  background: var(--accent); color: #fff;
  border: none; border-radius: var(--r-sm);
  padding: 7px 16px; font-size: .86rem; font-weight: 700;
  font-family: inherit; cursor: pointer; white-space: nowrap;
  transition: background .2s, transform .15s;
  box-shadow: 0 2px 8px rgba(79,70,229,.25);
}
.btn-import:hover { background: var(--accent-h); transform: translateY(-1px); }

/* Table */
.table-wrap { overflow-x: auto; }
table { width: 100%; border-collapse: collapse; }
thead { background: var(--bg); }
th {
  padding: 9px 13px; text-align: left;
  font-size: .73rem; font-weight: 700; color: var(--text-3);
  text-transform: uppercase; letter-spacing: .05em;
  border-bottom: 1px solid var(--card-br); white-space: nowrap;
}
td {
  padding: 11px 13px; font-size: .84rem; color: var(--text-2);
  border-bottom: 1px solid var(--card-br); vertical-align: middle;
}
tbody tr:last-child td { border-bottom: none; }
tbody tr { transition: background .12s; }
tbody tr:hover { background: #f8f9ff; }
.td-email { color: var(--accent); font-weight: 600; font-size: .83rem; max-width: 180px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.td-msg { font-size: .77rem; color: var(--text-3); max-width: 180px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

/* Pagination */
.pag-row {
  display: flex; align-items: center; justify-content: space-between;
  padding: 10px 16px; font-size: .8rem; color: var(--text-3);
  border-top: 1px solid var(--card-br); flex-wrap: wrap; gap: 6px;
}
.page-btn {
  background: var(--white); border: 1px solid var(--card-br);
  border-radius: 6px; padding: 3px 9px;
  font-size: .78rem; cursor: pointer; font-family: inherit;
  transition: all .12s; color: var(--text-2);
}
.page-btn:hover { border-color: var(--accent); color: var(--accent); }
.page-btn.active { background: var(--accent); color: #fff; border-color: var(--accent); }

/* ══════════════════════════════════════════
   BADGES
══════════════════════════════════════════ */
.badge {
  display: inline-flex; align-items: center; gap: 3px;
  padding: 2px 8px; border-radius: 20px;
  font-size: .72rem; font-weight: 700;
}
.badge-pending { background: var(--yellow-lt); color: #92400e; }
.badge-running { background: var(--blue-lt); color: #1d4ed8; animation: blink 1.5s ease-in-out infinite; }
.badge-success { background: var(--green-lt); color: #065f46; }
.badge-failed  { background: var(--red-lt); color: #991b1b; }
.badge-error   { background: var(--yellow-lt); color: #854d0e; }
.badge-type-full    { background: var(--accent-lt); color: var(--accent); }
.badge-type-extract { background: var(--blue-lt); color: #1d4ed8; }
.badge-express { background: var(--yellow-lt); color: #713f12; }
@keyframes blink { 0%,100% { opacity:1; } 50% { opacity:.65; } }

/* ══════════════════════════════════════════
   USAGE NOTES
══════════════════════════════════════════ */
.usage-card { background: var(--white); border: 1px solid var(--card-br); border-radius: var(--r); padding: 18px; box-shadow: var(--shadow); margin-bottom: 14px; }
.usage-title { font-size: .95rem; font-weight: 700; color: var(--text); margin-bottom: 14px; display: flex; align-items: center; gap: 8px; }
.usage-item {
  display: flex; align-items: flex-start; gap: 10px;
  padding: 10px 0; border-bottom: 1px solid var(--bg2); font-size: .84rem;
}
.usage-item:last-child { border-bottom: none; padding-bottom: 0; }
.usage-icon { width: 24px; height: 24px; border-radius: 6px; display: flex; align-items: center; justify-content: center; font-size: .8rem; flex-shrink: 0; }
.usage-icon.g { background: var(--green-lt); }
.usage-icon.y { background: var(--yellow-lt); }
.usage-icon.r { background: var(--red-lt); }
.usage-icon.b { background: var(--blue-lt); }
.usage-icon.p { background: var(--accent-lt); }
.usage-content strong { color: var(--text); font-weight: 700; }
.usage-content { color: var(--text-2); line-height: 1.5; }
.tag-warn { background: var(--yellow-lt); color: #92400e; font-size: .7rem; font-weight: 700; padding: 1px 7px; border-radius: 4px; margin-left: 6px; vertical-align: middle; }
.tag-ok   { background: var(--green-lt);  color: #065f46; font-size: .7rem; font-weight: 700; padding: 1px 7px; border-radius: 4px; margin-left: 6px; vertical-align: middle; }

/* ══════════════════════════════════════════
   ACTION DROPDOWN
══════════════════════════════════════════ */
.action-dropdown { position: relative; display: inline-block; }
.dropdown-trigger {
  background: var(--bg); color: var(--text-2);
  border: 1px solid var(--card-br); padding: 4px 10px;
  border-radius: 6px; cursor: pointer; font-size: .78rem;
  font-weight: 600; display: inline-flex; align-items: center; gap: 4px;
  transition: all .12s; font-family: inherit;
}
.dropdown-trigger:hover { background: var(--bg2); }
.action-dropdown-content {
  display: none; position: absolute; right: 0; top: 100%; margin-top: 4px;
  background: var(--white); min-width: 120px;
  box-shadow: var(--shadow-md); z-index: 999;
  border-radius: 10px; border: 1px solid var(--card-br); padding: 4px; overflow: hidden;
}
.action-dropdown.open .action-dropdown-content { display: block; animation: fadeDown .12s ease-out; }
.action-dropdown-content button {
  display: block; width: 100%; text-align: left;
  background: transparent; border: none; padding: 7px 11px;
  color: var(--text); cursor: pointer; font-size: .81rem;
  transition: background .1s; border-radius: 6px;
  white-space: nowrap; font-family: inherit; font-weight: 500;
}
.action-dropdown-content button:hover { background: var(--bg); }
.action-dropdown-content button.danger { color: var(--red); }
.action-dropdown-content button.danger:hover { background: var(--red-lt); }
@keyframes fadeDown { from { opacity:0; transform:translateY(-5px); } to { opacity:1; transform:none; } }

/* ══════════════════════════════════════════
   MODAL
══════════════════════════════════════════ */
.modal-overlay {
  display: none; position: fixed; inset: 0; z-index: 2000;
  background: rgba(15,23,42,.4); backdrop-filter: blur(4px);
  align-items: center; justify-content: center; padding: 1rem;
}
.modal-overlay.open { display: flex; animation: fadeIn .15s; }
@keyframes fadeIn { from { opacity:0; } to { opacity:1; } }
.modal, .modal-box {
  background: var(--white); border-radius: 16px;
  padding: 24px; width: 100%; max-width: 480px;
  box-shadow: var(--shadow-lg);
  animation: slideUp .2s ease-out;
}
@keyframes slideUp { from { opacity:0; transform:translateY(16px); } to { opacity:1; transform:none; } }
.modal h2, .modal-title { font-size: 1.1rem; font-weight: 800; margin-bottom: 1.2rem; color: var(--text); }
.modal-actions { display: flex; gap: 8px; justify-content: flex-end; margin-top: 1.2rem; }

/* Import tabs */
.import-tabs { display: flex; gap: 4px; margin-bottom: 16px; background: var(--bg); border-radius: 8px; padding: 3px; }
.import-tab-btn {
  flex: 1; padding: 6px; border-radius: 6px; border: none;
  font-size: .82rem; font-weight: 600; cursor: pointer; font-family: inherit;
  background: transparent; color: var(--text-3); transition: all .15s;
}
.import-tab-btn.active { background: var(--white); color: var(--accent); box-shadow: var(--shadow); }

/* Form */
.form-group { margin-bottom: 12px; }
.form-label { display: block; font-size: .82rem; font-weight: 600; color: var(--text-2); margin-bottom: 5px; }
.form-row { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.form-input, .form-textarea, .form-select {
  width: 100%; border: 1.5px solid var(--card-br);
  border-radius: var(--r-sm); padding: 8px 12px;
  font-size: .88rem; font-family: inherit; outline: none;
  background: var(--bg); color: var(--text);
  transition: border-color .2s, box-shadow .2s;
}
.form-input:focus, .form-textarea:focus, .form-select:focus {
  border-color: var(--accent); box-shadow: 0 0 0 3px rgba(79,70,229,.08);
  background: var(--white);
}
.form-textarea { resize: vertical; min-height: 90px; }
.form-hint { font-size: .74rem; color: var(--text-3); margin-top: 4px; }

/* Buttons */
.btn {
  display: inline-flex; align-items: center; gap: 5px;
  padding: 7px 16px; border-radius: var(--r-sm); border: none;
  font-size: .86rem; font-weight: 600; font-family: inherit;
  cursor: pointer; transition: all .15s;
}
.btn-primary { background: var(--accent); color: #fff; box-shadow: 0 2px 8px rgba(79,70,229,.25); }
.btn-primary:hover { background: var(--accent-h); transform: translateY(-1px); }
.btn-secondary { background: var(--bg2); color: var(--text-2); border: 1px solid var(--card-br); }
.btn-secondary:hover { background: var(--bg); }
.btn-danger { background: var(--red-lt); color: var(--red); }
.btn-danger:hover { background: #fca5a5; }
.btn-sm { padding: 5px 11px; font-size: .79rem; border-radius: 6px; }
.btn-submit-big {
  width: 100%; padding: 13px; background: var(--accent); color: #fff;
  border: none; border-radius: 10px; font-size: 1rem; font-weight: 700;
  font-family: inherit; cursor: pointer; transition: background .2s, transform .15s;
  box-shadow: 0 4px 14px rgba(79,70,229,.3);
  display: flex; align-items: center; justify-content: center; gap: 8px;
}
.btn-submit-big:hover { background: var(--accent-h); transform: translateY(-1px); }

/* Submit mode tabs */
.submit-mode-bar {
  display: flex; gap: 8px; margin-bottom: 16px;
}
.mode-btn {
  flex: 1; padding: 9px 12px; border-radius: 8px;
  border: 1.5px solid var(--card-br); background: var(--bg);
  font-size: .86rem; font-weight: 600; cursor: pointer; font-family: inherit;
  color: var(--text-3); transition: all .15s;
}
.mode-btn.active {
  border-color: var(--accent); background: var(--accent-lt); color: var(--accent);
}
.mode-btn:hover:not(.active) { border-color: var(--accent-md); }

/* Payment warning */
.pay-warn {
  background: #fff7ed; border: 1px solid #fed7aa;
  border-radius: 8px; padding: 10px 14px;
  font-size: .82rem; color: #92400e; margin: 14px 0;
  display: flex; align-items: center; gap: 6px;
}

/* Query row */
.query-row { display: flex; gap: 8px; }
.query-hint { font-size: .8rem; color: var(--text-3); margin-top: 8px; text-align: center; }

/* Required asterisk */
.req { color: var(--red); margin-left: 2px; }

/* Query results table */
.query-results-table { width: 100%; border-collapse: collapse; margin-top: 10px; font-size: .82rem; }
.query-results-table th { padding: 8px 10px; background: var(--bg); color: var(--text-3); font-size: .72rem; text-transform: uppercase; letter-spacing: .05em; border-bottom: 1px solid var(--card-br); text-align: left; }
.query-results-table td { padding: 9px 10px; border-bottom: 1px solid var(--card-br); color: var(--text-2); vertical-align: middle; }
.query-results-table tbody tr:last-child td { border-bottom: none; }
.query-results-table tbody tr:hover { background: #f8f9ff; }

/* ══════════════════════════════════════════
   TOAST
══════════════════════════════════════════ */
.toast-container { position: fixed; bottom: 20px; right: 20px; z-index: 9999; display: flex; flex-direction: column; gap: 7px; }
.toast {
  display: flex; align-items: center; gap: 9px;
  background: var(--white); border: 1px solid var(--card-br);
  border-radius: 10px; padding: 11px 16px;
  box-shadow: var(--shadow-md);
  font-size: .86rem; font-weight: 600; color: var(--text);
  animation: slideInR .2s ease-out; min-width: 200px; max-width: 320px;
}
.toast.success { border-left: 4px solid var(--green); }
.toast.error   { border-left: 4px solid var(--red); }
.toast.info    { border-left: 4px solid var(--accent); }
@keyframes slideInR { from { opacity:0; transform:translateX(16px); } to { opacity:1; transform:none; } }

/* ══════════════════════════════════════════
   LOGIN
══════════════════════════════════════════ */
.login-wrap {
  min-height: 100vh; display: flex; align-items: center;
  justify-content: center; padding: 2rem; background: var(--bg);
}
.login-card {
  background: var(--white); border-radius: 16px;
  padding: 32px 28px; width: 100%; max-width: 360px;
  box-shadow: var(--shadow-md); border: 1px solid var(--card-br);
}
.login-logo { text-align: center; margin-bottom: 24px; }
.login-logo h1 { font-size: 1.3rem; font-weight: 800; color: var(--text); }
.login-logo h1::before { content: '◈ '; color: var(--accent); }
.login-logo p { font-size: .82rem; color: var(--text-3); margin-top: 4px; }

/* ══════════════════════════════════════════
   ADMIN LAYOUT
══════════════════════════════════════════ */
.admin-layout { display: flex; min-height: 100vh; }
.admin-sidebar {
  width: 210px; background: var(--white); border-right: 1px solid var(--card-br);
  position: sticky; top: 0; height: 100vh; overflow-y: auto; flex-shrink: 0;
}
.admin-logo { padding: 18px 14px 12px; border-bottom: 1px solid var(--card-br); }
.admin-logo h1 { font-size: 1rem; font-weight: 800; color: var(--text); }
.admin-logo h1::before { content: '◈ '; color: var(--accent); }
.admin-logo p { font-size: .73rem; color: var(--text-3); margin-top: 2px; }
.sidebar-nav { padding: 8px; }
.sidebar-item {
  display: flex; align-items: center; gap: 8px; width: 100%;
  padding: 8px 11px; border-radius: var(--r-sm); border: none;
  background: transparent; color: var(--text-2);
  font-size: .85rem; font-weight: 600; font-family: inherit;
  cursor: pointer; text-decoration: none; transition: all .12s; margin-bottom: 2px;
}
.sidebar-item:hover { background: var(--bg); color: var(--text); }
.sidebar-item.active { background: var(--accent-lt); color: var(--accent); }
.sidebar-item .icon { font-size: .95rem; }

.admin-main { flex: 1; padding: 24px; overflow-y: auto; background: var(--bg); }
.admin-section { display: none; }
.admin-section.active { display: block; }
.admin-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(150px,1fr)); gap: 10px; margin-bottom: 18px; }
.admin-stat-card {
  background: var(--white); border: 1px solid var(--card-br);
  border-radius: var(--r); padding: 16px; text-align: center; box-shadow: var(--shadow);
}
.admin-stat-card .num { font-size: 2rem; font-weight: 900; line-height: 1; margin-bottom: 4px; color: var(--accent); }
.admin-stat-card .lbl { font-size: .74rem; color: var(--text-3); font-weight: 500; }
.card { background: var(--white); border: 1px solid var(--card-br); border-radius: var(--r); padding: 18px; box-shadow: var(--shadow); margin-bottom: 14px; }
.table-responsive { overflow-x: auto; }
.admin-section table { width: 100%; border-collapse: collapse; }
.admin-section th { padding: 9px 12px; text-align: left; font-size: .72rem; font-weight: 700; color: var(--text-3); text-transform: uppercase; letter-spacing: .05em; border-bottom: 1px solid var(--card-br); background: var(--bg); white-space: nowrap; }
.admin-section td { padding: 10px 12px; font-size: .83rem; color: var(--text-2); border-bottom: 1px solid var(--card-br); vertical-align: middle; }
.admin-section tbody tr:last-child td { border-bottom: none; }
.admin-section tbody tr:hover { background: #f8f9ff; }
.td-email { color: var(--accent); font-weight: 600; font-size: .83rem; }
.td-msg { font-size: .77rem; color: var(--text-3); max-width: 200px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

@media (max-width: 640px) {
  .stats-grid { grid-template-columns: repeat(2,1fr); }
  .form-row { grid-template-columns: 1fr; }
  .navbar-inner { flex-wrap: wrap; height: auto; min-height: 52px; gap: 6px; padding: 8px 12px; }
  .cdkey-input { width: 140px; }
  .admin-layout { flex-direction: column; }
  .admin-sidebar { width: 100%; height: auto; position: static; }
  .admin-main { padding: 14px; }
  .steps-inner { gap: 8px; }
  .step-item { min-width: 140px; }
}
