﻿/* ============================================================
   ProxySubscription - Design System
   Based on traffic.dogegg.online reverse engineering
   ============================================================ */

/* ---------- CSS Variables ---------- */
:root {
  --bg: #f6f8fb;
  --panel: #ffffff;
  --ink: #172033;
  --text: #26364d;
  --muted: #64748b;
  --line: #dbe3ee;
  --primary: #2563eb;
  --primary-strong: #1e40af;
  --accent: #0891b2;
  --accent-strong: #0f766e;
  --gold: #a16207;
  --warn: #b45309;
  --danger: #b42318;
  --success: #15803d;
  --shadow: 0 24px 70px rgba(37, 99, 235, 0.12);
  --motion-ease: cubic-bezier(0.22, 1, 0.36, 1);
  --radius: 8px;
  --radius-lg: 16px;
  --radius-xl: 20px;
}

html[data-theme="dark"] {
  --bg: #0b1120;
  --panel: #111827;
  --ink: #f1f5f9;
  --text: #cbd5e1;
  --muted: #64748b;
  --line: #1e293b;
  --primary: #60a5fa;
  --primary-strong: #93bbfd;
  --accent: #22d3ee;
  --accent-strong: #67e8f9;
  --gold: #fbbf24;
  --warn: #fbbf24;
  --danger: #fda4af;
  --success: #4ade80;
  --shadow: 0 24px 70px rgba(0, 0, 0, 0.3);
}

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

body {
  font-family: Inter, "Segoe UI", "Microsoft YaHei", "PingFang SC", Arial, sans-serif;
  background: var(--bg);
  color: var(--text);
  min-height: 100vh;
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
  transition: background 0.3s var(--motion-ease), color 0.3s var(--motion-ease);
}

a {
  color: var(--primary);
  text-decoration: none;
}

/* ---------- Login Page ---------- */
.login-page {
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 20px;
  position: relative;
  overflow: hidden;
}

/* Grid background */
.login-page::before {
  content: '';
  position: absolute;
  inset: 0;
  background-image:
    linear-gradient(rgba(37, 99, 235, 0.03) 1px, transparent 1px),
    linear-gradient(90deg, rgba(37, 99, 235, 0.03) 1px, transparent 1px);
  background-size: 40px 40px;
  z-index: 0;
}

/* Color halo */
.login-page::after {
  content: '';
  position: absolute;
  top: -20%;
  left: 50%;
  transform: translateX(-50%);
  width: 600px;
  height: 600px;
  background: radial-gradient(circle, rgba(37, 99, 235, 0.08) 0%, transparent 70%);
  border-radius: 50%;
  z-index: 0;
  pointer-events: none;
}

.login-card {
  position: relative;
  z-index: 1;
  background: color-mix(in srgb, var(--panel) 86%, transparent);
  backdrop-filter: blur(18px);
  -webkit-backdrop-filter: blur(18px);
  border-radius: var(--radius-xl);
  box-shadow: var(--shadow);
  padding: 42px 34px;
  width: 100%;
  max-width: 420px;
  border: 1px solid var(--line);
  animation: surface-enter 0.5s var(--motion-ease);
}

@keyframes surface-enter {
  from { opacity: 0; transform: translateY(16px) scale(0.97); }
  to { opacity: 1; transform: translateY(0) scale(1); }
}

.login-logo {
  width: 96px;
  height: 96px;
  border-radius: 22px;
  box-shadow: 0 8px 24px rgba(37, 99, 235, 0.15);
  margin: 0 auto 20px;
  display: block;
  background: var(--primary);
}

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

.login-eyebrow {
  font-size: 11px;
  font-weight: 760;
  letter-spacing: 0;
  text-transform: uppercase;
  color: var(--primary);
  margin-bottom: 4px;
}

.login-title {
  font-size: 24px;
  font-weight: 800;
  color: var(--ink);
  margin-bottom: 4px;
}

.login-desc {
  font-size: 14px;
  color: var(--muted);
}

.login-pills {
  display: flex;
  gap: 8px;
  justify-content: center;
  flex-wrap: wrap;
  margin-bottom: 24px;
}

.pill {
  padding: 4px 12px;
  border-radius: 20px;
  font-size: 12px;
  font-weight: 600;
  background: rgba(37, 99, 235, 0.08);
  color: var(--primary);
  border: 1px solid rgba(37, 99, 235, 0.15);
}

/* Form */
.form-group {
  margin-bottom: 16px;
}

.form-label {
  display: block;
  font-size: 13px;
  font-weight: 600;
  color: var(--text);
  margin-bottom: 6px;
}

.form-input {
  width: 100%;
  height: 44px;
  padding: 0 14px;
  border: 1.5px solid var(--line);
  border-radius: var(--radius);
  font-size: 14px;
  font-family: inherit;
  color: var(--ink);
  background: var(--bg);
  transition: border-color 0.2s var(--motion-ease), box-shadow 0.2s var(--motion-ease);
  outline: none;
}

.form-input:focus {
  border-color: var(--primary);
  box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.1);
}

.form-input::placeholder {
  color: var(--muted);
}

/* Buttons */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  height: 40px;
  padding: 0 16px;
  border: none;
  border-radius: var(--radius);
  font-size: 14px;
  font-weight: 600;
  font-family: inherit;
  cursor: pointer;
  transition: transform 0.15s var(--motion-ease), box-shadow 0.15s var(--motion-ease), opacity 0.15s var(--motion-ease);
  gap: 6px;
}

.btn:hover { transform: translateY(-2px); }
.btn:active { transform: translateY(0) scale(0.97); }
.btn:disabled { opacity: 0.5; cursor: not-allowed; transform: none; }

.btn-primary {
  width: 100%;
  height: 44px;
  background: linear-gradient(135deg, var(--primary), var(--accent));
  color: #fff;
  font-size: 15px;
  font-weight: 700;
  box-shadow: 0 4px 14px rgba(37, 99, 235, 0.25);
}

.btn-primary:hover { box-shadow: 0 6px 20px rgba(37, 99, 235, 0.35); }

.btn-ghost {
  background: transparent;
  color: var(--primary);
  height: 36px;
  padding: 0 13px;
}

.btn-ghost:hover { background: rgba(37, 99, 235, 0.06); }

.btn-danger {
  background: var(--danger);
  color: #fff;
}

.btn-outline {
  background: transparent;
  border: 1.5px solid var(--line);
  color: var(--text);
}

.btn-sm {
  height: 36px;
  padding: 0 13px;
  font-size: 13px;
}

.btn-xs {
  height: 30px;
  padding: 0 10px;
  font-size: 12px;
  border-radius: 6px;
}

/* Theme toggle */
.theme-toggle {
  position: absolute;
  top: 14px;
  right: 14px;
  width: 36px;
  height: 36px;
  border-radius: 50%;
  border: 1px solid var(--line);
  background: var(--panel);
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 18px;
  transition: background 0.2s;
  color: var(--text);
}

.theme-toggle:hover { background: var(--bg); }

/* Footer */
.login-footer {
  text-align: center;
  margin-top: 20px;
  font-size: 12px;
  color: var(--muted);
}

/* ---------- Dashboard ---------- */
.dashboard-page {
  min-height: 100vh;
}

/* Topbar */
.topbar {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  z-index: 100;
  height: 56px;
  background: var(--panel);
  border-bottom: 1px solid var(--line);
  display: flex;
  align-items: center;
  padding: 0 20px;
  gap: 16px;
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
}

.topbar-brand {
  display: flex;
  align-items: center;
  gap: 8px;
  font-weight: 800;
  font-size: 16px;
  color: var(--ink);
  text-decoration: none;
}

.topbar-brand-icon {
  width: 32px;
  height: 32px;
  border-radius: 8px;
  background: linear-gradient(135deg, var(--primary), var(--accent));
  display: flex;
  align-items: center;
  justify-content: center;
  color: #fff;
  font-size: 16px;
}

.brand-mark {
  width: 32px;
  height: 32px;
  border-radius: 8px;
  flex: 0 0 32px;
}

.topbar-spacer { flex: 1; }

.topbar-status {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 13px;
  font-weight: 600;
  color: var(--success);
}

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

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

/* Shell */
.shell {
  max-width: 1180px;
  margin: 0 auto;
  padding: 24px 20px 60px;
}

/* Usage notice */
.usage-notice {
  background: rgba(37, 99, 235, 0.04);
  border: 1px solid rgba(37, 99, 235, 0.12);
  border-radius: var(--radius);
  padding: 12px 16px;
  font-size: 13px;
  color: var(--primary);
  margin-bottom: 24px;
  display: flex;
  align-items: center;
  gap: 8px;
}

.usage-notice-icon { font-size: 16px; }

/* Meter block */
.meter-block {
  background: var(--panel);
  border-radius: var(--radius-lg);
  border: 1px solid var(--line);
  padding: 42px 34px;
  margin-bottom: 20px;
  display: flex;
  align-items: center;
  gap: 40px;
  box-shadow: var(--shadow);
  animation: surface-enter 0.5s var(--motion-ease);
  background-image:
    linear-gradient(rgba(37, 99, 235, 0.025) 1px, transparent 1px),
    linear-gradient(90deg, rgba(8, 145, 178, 0.025) 1px, transparent 1px);
  background-size: 32px 32px;
}

.meter-ring-container {
  position: relative;
  flex-shrink: 0;
}

.meter-ring {
  transform: rotate(-90deg);
}

.meter-ring-bg {
  fill: none;
  stroke: var(--line);
  stroke-width: 8;
}

.meter-ring-fill {
  fill: none;
  stroke: var(--primary);
  stroke-width: 8;
  stroke-linecap: round;
  transition: stroke-dashoffset 0.8s var(--motion-ease);
}

.meter-percent {
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 22px;
  font-weight: 800;
  color: var(--ink);
}

.meter-info {
  flex: 1;
  min-width: 0;
}

.meter-title {
  font-size: 15px;
  font-weight: 700;
  color: var(--ink);
  margin-bottom: 2px;
}

.meter-package {
  font-size: 13px;
  color: var(--muted);
  margin-bottom: 14px;
}

.meter-stats {
  display: flex;
  gap: 20px;
  flex-wrap: wrap;
}

.meter-stat {
  text-align: center;
  display: flex;
  flex-direction: column;
}

.meter-stat-value {
  font-size: 18px;
  font-weight: 800;
  color: var(--ink);
}

.meter-stat-label {
  font-size: 11px;
  color: var(--muted);
  margin-top: 2px;
}

/* Identity card */
.identity {
  background: var(--panel);
  border-radius: var(--radius-lg);
  border: 1px solid var(--line);
  padding: 20px 34px;
  margin-bottom: 20px;
  display: flex;
  align-items: center;
  gap: 16px;
  box-shadow: var(--shadow);
  animation: surface-enter 0.5s var(--motion-ease) 0.1s both;
}

.avatar {
  width: 48px;
  height: 48px;
  border-radius: 50%;
  background: linear-gradient(135deg, var(--primary), var(--accent));
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 20px;
  color: #fff;
  font-weight: 700;
  flex-shrink: 0;
}

.identity-info {
  flex: 1;
  min-width: 0;
}

.identity-name {
  font-size: 16px;
  font-weight: 700;
  color: var(--ink);
}

.identity-handle {
  font-size: 13px;
  color: var(--muted);
}

.identity-badge {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  font-size: 11px;
  font-weight: 600;
  color: var(--gold);
  background: rgba(161, 98, 7, 0.1);
  padding: 2px 10px;
  border-radius: 20px;
  margin-top: 4px;
}

/* Panel */
.panel {
  background: var(--panel);
  border-radius: var(--radius-lg);
  border: 1px solid var(--line);
  box-shadow: var(--shadow);
  animation: surface-enter 0.5s var(--motion-ease) 0.2s both;
}

.panel-header {
  padding: 20px 34px;
  border-bottom: 1px solid var(--line);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  flex-wrap: wrap;
}

.panel-title {
  font-size: 16px;
  font-weight: 700;
  color: var(--ink);
  display: flex;
  align-items: center;
  gap: 8px;
}

.panel-body {
  padding: 24px 34px 34px;
}

/* Info rows */
.info-row {
  display: flex;
  align-items: center;
  padding: 14px 0;
  border-bottom: 1px solid var(--line);
  gap: 12px;
}

.info-row:last-child { border-bottom: none; }

.info-label {
  font-size: 13px;
  font-weight: 600;
  color: var(--muted);
  min-width: 90px;
  flex-shrink: 0;
}

.info-value {
  font-size: 14px;
  color: var(--ink);
  word-break: break-all;
  flex: 1;
  min-width: 0;
}

.info-actions {
  flex-shrink: 0;
  display: flex;
  gap: 6px;
}

.subscription-link {
  display: flex;
  align-items: center;
  gap: 8px;
  background: var(--bg);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 8px 14px;
  font-size: 13px;
  font-family: "SF Mono", "Cascadia Code", "Consolas", monospace;
  color: var(--ink);
  margin-top: 8px;
  word-break: break-all;
}

/* Status badge */
.badge {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 4px 12px;
  border-radius: 20px;
  font-size: 12px;
  font-weight: 600;
}

.badge-active {
  background: rgba(21, 128, 61, 0.1);
  color: var(--success);
}

.badge-expired {
  background: rgba(180, 35, 24, 0.1);
  color: var(--danger);
}

.badge-dot {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: currentColor;
}

/* ---------- Modal ---------- */
.modal-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.4);
  z-index: 200;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 20px;
  backdrop-filter: blur(4px);
}

.modal-content {
  position: fixed;
  z-index: 201;
  background: var(--panel);
  border-radius: var(--radius-lg);
  padding: 28px 30px;
  width: 100%;
  max-width: 480px;
  box-shadow: 0 24px 70px rgba(0, 0, 0, 0.2);
  border: 1px solid var(--line);
  animation: surface-enter 0.3s var(--motion-ease);
  max-height: 85vh;
  overflow-y: auto;
}

.modal-title {
  font-size: 18px;
  font-weight: 800;
  color: var(--ink);
  margin-bottom: 16px;
}

/* Toast */
.toast-container {
  position: fixed;
  top: 20px;
  right: 20px;
  z-index: 300;
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.toast {
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 12px 18px;
  font-size: 14px;
  font-weight: 600;
  color: var(--ink);
  box-shadow: 0 8px 30px rgba(0, 0, 0, 0.12);
  animation: toast-in 0.3s var(--motion-ease);
  min-width: 200px;
  max-width: 360px;
  display: flex;
  align-items: center;
  gap: 8px;
}

.toast-success { border-left: 3px solid var(--success); }
.toast-error { border-left: 3px solid var(--danger); }
.toast-warning { border-left: 3px solid var(--warn); }

.toast-removing {
  animation: toast-out 0.3s var(--motion-ease) forwards;
}

@keyframes toast-in {
  from { opacity: 0; transform: translateX(30px); }
  to { opacity: 1; transform: translateX(0); }
}

@keyframes toast-out {
  from { opacity: 1; transform: translateX(0); }
  to { opacity: 0; transform: translateX(30px); }
}

/* ---------- Responsive ---------- */
@media (max-width: 768px) {
  .meter-block {
    flex-direction: column;
    text-align: center;
    padding: 28px 20px;
  }

  .meter-stats {
    justify-content: center;
  }

  .login-card {
    padding: 28px 20px;
  }

  .panel-header,
  .panel-body {
    padding-left: 20px;
    padding-right: 20px;
  }

  .identity {
    padding: 16px 20px;
  }

  .info-row {
    flex-direction: column;
    align-items: flex-start;
    gap: 4px;
  }

  .info-label {
    min-width: auto;
  }

  .shell {
    padding: 16px 12px 40px;
  }
}

/* ---------- Utility ---------- */
.text-center { text-align: center; }
.text-muted { color: var(--muted); }
.text-success { color: var(--success); }
.text-danger { color: var(--danger); }
.text-primary { color: var(--primary); }
.text-sm { font-size: 13px; }
.text-xs { font-size: 11px; }
.mt-sm { margin-top: 8px; }
.mt-md { margin-top: 16px; }
.mt-lg { margin-top: 24px; }
.mb-sm { margin-bottom: 8px; }
.mb-md { margin-bottom: 16px; }
.flex-center { display: flex; align-items: center; justify-content: center; }
.gap-sm { gap: 8px; }
.gap-md { gap: 12px; }
.spinner {
  width: 20px; height: 20px;
  border: 2.5px solid var(--line);
  border-top-color: var(--primary);
  border-radius: 50%;
  animation: spin 0.6s linear infinite;
  display: inline-block;
}
@keyframes spin { to { transform: rotate(360deg); } }

/* ---------- Blueprint Components ---------- */
.dashboard-page {
  padding-top: 56px;
}

.icon-button {
  width: 36px;
  height: 36px;
  flex: 0 0 36px;
  display: inline-grid;
  place-items: center;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: transparent;
  color: var(--text);
  font: 700 18px/1 inherit;
  cursor: pointer;
  transition: background 0.15s var(--motion-ease), transform 0.15s var(--motion-ease);
}

.icon-button:hover { background: rgba(37, 99, 235, 0.07); transform: translateY(-2px); }
.icon-button:active { transform: scale(0.97); }

.page-loading {
  min-height: 100vh;
  display: grid;
  place-items: center;
}

.details-list { margin: 0; }

.row {
  display: grid;
  grid-template-columns: minmax(100px, 0.3fr) minmax(0, 1fr);
  align-items: center;
  gap: 16px;
  padding: 14px 0;
  border-bottom: 1px solid var(--line);
}

.row dt { color: var(--muted); font-size: 13px; font-weight: 600; }
.row dd { margin: 0; min-width: 0; color: var(--ink); word-break: break-word; }

.uuid-control {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.uuid-control code,
.link-row code {
  font-family: "SF Mono", "Cascadia Code", Consolas, monospace;
  font-size: 12px;
}

.subscription-links { margin-top: 24px; }
.subscription-links h3 { margin-bottom: 10px; color: var(--ink); font-size: 14px; }

.link-row {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 36px;
  align-items: center;
  gap: 12px;
  padding: 12px 14px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--bg);
  margin-top: 8px;
}

.link-row strong { display: block; color: var(--ink); font-size: 13px; }
.link-row code { display: block; overflow: hidden; color: var(--muted); text-overflow: ellipsis; white-space: nowrap; }
.panel-actions { display: flex; flex-wrap: wrap; gap: 6px; }

.form-error {
  min-height: 22px;
  margin: 6px 0 10px;
  color: var(--danger);
  font-size: 13px;
}

.text-button {
  border: 0;
  background: none;
  color: var(--primary);
  font: inherit;
  font-weight: 700;
  cursor: pointer;
}

.app-dialog {
  width: min(520px, calc(100vw - 32px));
  max-height: min(760px, calc(100vh - 40px));
  margin: auto;
  padding: 28px 30px;
  overflow: auto;
  border: 1px solid var(--line);
  border-radius: var(--radius-lg);
  background: var(--panel);
  color: var(--text);
  box-shadow: 0 24px 70px rgba(0, 0, 0, 0.25);
}

.app-dialog[open] { animation: surface-enter 0.25s var(--motion-ease); }
.app-dialog::backdrop { background: rgba(11, 17, 32, 0.56); backdrop-filter: blur(4px); }

.dialog-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 18px;
}

.dialog-header h2 { color: var(--ink); font-size: 18px; }
.product-list { display: grid; gap: 10px; }

.product-card {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: center;
  gap: 14px;
  padding: 14px 16px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--bg);
}

.product-card h3 { color: var(--ink); font-size: 14px; }
.product-card p, .product-card small { display: block; color: var(--muted); font-size: 12px; }
.product-card.is-disabled { opacity: 0.55; }
.product-action { display: flex; align-items: center; gap: 12px; }
.product-action strong { color: var(--primary); white-space: nowrap; }
.empty-state { padding: 22px; color: var(--muted); text-align: center; }

@media (max-width: 600px) {
  .topbar { padding: 0 12px; gap: 8px; }
  .topbar-brand span { display: none; }
  .topbar-status { font-size: 12px; }
  .row { grid-template-columns: 1fr; gap: 4px; }
  .uuid-control { align-items: flex-start; flex-direction: column; }
  .panel-actions { width: 100%; }
  .panel-actions .btn { flex: 1; min-width: 74px; }
  .identity { align-items: flex-start; flex-wrap: wrap; }
  .identity .btn { margin-left: 64px; }
  .app-dialog { padding: 24px 20px; }
  .product-card { grid-template-columns: 1fr; }
  .product-action { justify-content: space-between; }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { scroll-behavior: auto !important; animation-duration: 0.01ms !important; animation-iteration-count: 1 !important; transition-duration: 0.01ms !important; }
}

/* ---------- Admin Console ---------- */
.admin-shell {
  max-width: 1440px;
  margin: 0 auto;
  padding: 30px 24px 64px;
}

.admin-heading {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 20px;
  margin-bottom: 24px;
}

.admin-heading h1 { color: var(--ink); font-size: clamp(26px, 4vw, 38px); line-height: 1.15; }
.admin-heading p:last-child { margin-top: 6px; color: var(--muted); }

.admin-stats {
  display: grid;
  grid-template-columns: repeat(7, minmax(130px, 1fr));
  gap: 12px;
  margin-bottom: 24px;
  overflow-x: auto;
  padding-bottom: 4px;
}

.stat-card {
  min-width: 130px;
  padding: 18px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--panel);
}

.stat-card span { display: block; color: var(--muted); font-size: 12px; }
.stat-card strong { display: block; margin-top: 4px; color: var(--ink); font-size: 22px; }

.admin-tabs {
  display: flex;
  gap: 6px;
  overflow-x: auto;
  border-bottom: 1px solid var(--line);
}

.admin-tab {
  min-width: 82px;
  height: 42px;
  padding: 0 16px;
  border: 0;
  border-bottom: 2px solid transparent;
  background: transparent;
  color: var(--muted);
  font: 700 14px/1 inherit;
  cursor: pointer;
}

.admin-tab.is-active { border-bottom-color: var(--primary); color: var(--primary); }

.admin-workspace {
  min-height: 360px;
  padding: 22px;
  border: 1px solid var(--line);
  border-top: 0;
  border-radius: 0 0 var(--radius-lg) var(--radius-lg);
  background: var(--panel);
}

.admin-toolbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 18px;
}

.admin-toolbar h2 { color: var(--ink); font-size: 18px; }
.admin-search { display: flex; width: min(480px, 100%); gap: 8px; }
.admin-search .form-input { flex: 1; }
.admin-table-wrap { width: 100%; overflow-x: auto; }

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

.admin-table th,
.admin-table td {
  padding: 12px 10px;
  border-bottom: 1px solid var(--line);
  text-align: left;
  vertical-align: middle;
}

.admin-table th { color: var(--muted); font-size: 11px; font-weight: 760; text-transform: uppercase; }
.admin-table td { color: var(--text); }
.admin-table td strong { display: block; color: var(--ink); }
.admin-table td small { display: block; margin-top: 2px; color: var(--muted); }
.admin-table code { color: var(--ink); font-family: "SF Mono", "Cascadia Code", Consolas, monospace; }
.table-actions { white-space: nowrap; }
.table-select { width: 130px; height: 34px; }

.badge-admin {
  background: rgba(161, 98, 7, 0.1);
  color: var(--gold);
}

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

.check-field {
  min-height: 44px;
  display: flex;
  align-items: center;
  gap: 8px;
  color: var(--text);
  font-size: 13px;
  font-weight: 600;
}

.check-field input { width: 18px; height: 18px; accent-color: var(--primary); }

.dialog-summary {
  display: flex;
  flex-direction: column;
  gap: 2px;
  margin-bottom: 18px;
  padding: 12px 14px;
  border-left: 3px solid var(--primary);
  background: var(--bg);
}

.dialog-summary strong { color: var(--ink); }
.dialog-summary span { color: var(--muted); font-size: 12px; }
.dialog-actions {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  flex-wrap: wrap;
}
.admin-setup-entry[hidden] { display: none; }

@media (max-width: 760px) {
  .admin-shell { padding: 20px 12px 48px; }
  .admin-heading { align-items: flex-start; flex-direction: column; }
  .admin-workspace { padding: 16px 12px; }
  .admin-toolbar { align-items: flex-start; flex-direction: column; }
  .admin-search { width: 100%; }
  .form-grid { grid-template-columns: 1fr; }
}
