@import url('https://fonts.googleapis.com/css2?family=Inter:wght@300;400;500;600;700;800;900&family=JetBrains+Mono:wght@400;500;600&display=swap');

/* ============================================================
   QQ Bot Console — Clean Light Design System
   Inspired by Linear / Notion / Vercel
   ============================================================ */

:root {
  /* Blue primary */
  --primary: #2563eb;
  --primary-light: #3b82f6;
  --primary-soft: #eff6ff;
  --primary-border: #bfdbfe;

  /* Cyan accent */
  --accent: #0891b2;
  --accent-soft: #ecfeff;
  --accent-border: #a5f3fc;

  /* Semantic */
  --success: #16a34a;
  --success-soft: #f0fdf4;
  --success-border: #bbf7d0;
  --warning: #d97706;
  --warning-soft: #fffbeb;
  --warning-border: #fde68a;
  --danger: #dc2626;
  --danger-soft: #fef2f2;
  --danger-border: #fecaca;
  --info: #2563eb;
  --info-soft: #eff6ff;
  --info-border: #bfdbfe;

  /* Surfaces */
  --bg: #ffffff;
  --surface: #ffffff;
  --surface-hover: #f9fafb;
  --surface-raised: #fafafa;

  /* Borders */
  --border: #e5e7eb;
  --border-light: #f3f4f6;

  /* Text */
  --text: #111827;
  --text-secondary: #6b7280;
  --text-muted: #9ca3af;

  /* Shadows — very light */
  --shadow-xs: 0 1px 2px rgba(0,0,0,0.03);
  --shadow-sm: 0 1px 3px rgba(0,0,0,0.05);
  --shadow: 0 1px 3px rgba(0,0,0,0.06), 0 1px 2px rgba(0,0,0,0.04);
  --shadow-md: 0 4px 16px rgba(0,0,0,0.06);
  --shadow-lg: 0 8px 30px rgba(0,0,0,0.08);

  /* Radii */
  --radius-sm: 6px;
  --radius: 8px;
  --radius-md: 10px;
  --radius-lg: 12px;
  --radius-xl: 16px;
  --radius-full: 999px;

  /* Transitions */
  --transition: 0.15s ease;
  --transition-slow: 0.2s ease;
}

/* ============================================================
   Background — decorative layered design
   ============================================================ */
html {
  min-height: 100vh;
  background-color: #f8fafc;
  background-image:
    /* dot grid — more visible */
    radial-gradient(circle at center, rgba(37,99,235,0.08) 0.5px, transparent 0.5px),
    /* large blue orb — top right */
    radial-gradient(ellipse 900px 700px at 90% 0%, rgba(59,130,246,0.06) 0%, transparent 60%),
    /* large cyan orb — bottom left */
    radial-gradient(ellipse 800px 600px at 5% 95%, rgba(6,182,212,0.05) 0%, transparent 60%),
    /* medium indigo orb — left center */
    radial-gradient(ellipse 500px 500px at 0% 40%, rgba(99,102,241,0.04) 0%, transparent 55%),
    /* small blue orb — right center */
    radial-gradient(ellipse 400px 400px at 95% 55%, rgba(37,99,235,0.035) 0%, transparent 55%),
    /* subtle warm accent — top center */
    radial-gradient(ellipse 500px 300px at 50% 2%, rgba(59,130,246,0.025) 0%, transparent 60%);
  background-size:
    22px 22px,
    100% 100%,
    100% 100%,
    100% 100%,
    100% 100%,
    100% 100%;
  background-position: 0 0, 0 0, 0 0, 0 0, 0 0, 0 0;
  background-attachment: fixed;
}

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

body {
  font-family: "Inter", "PingFang SC", "Microsoft YaHei UI", "Microsoft YaHei", sans-serif;
  color: var(--text);
  min-height: 100vh;
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
  background: transparent;
}

a { color: inherit; text-decoration: none; }
svg { flex-shrink: 0; }

/* ============================================================
   Auth Pages
   ============================================================ */
body.auth-page {
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 100vh;
  padding: 24px;
}

.login-panel {
  background: #fff;
  border-radius: var(--radius-xl);
  box-shadow: var(--shadow-lg);
  width: 100%;
  max-width: 420px;
  border: 1px solid var(--border);
  animation: fadeIn 0.4s ease;
}

.login-body { padding: 36px 32px 32px; }

.login-header { text-align: center; margin-bottom: 28px; }

.login-header .brand {
  display: inline-block;
  font-size: 11px;
  font-weight: 700;
  color: var(--primary);
  text-transform: uppercase;
  letter-spacing: 2px;
  background: var(--primary-soft);
  padding: 4px 12px;
  border-radius: var(--radius-full);
  margin-bottom: 14px;
}

.login-header h1 {
  font-size: 24px;
  font-weight: 700;
  color: var(--text);
  letter-spacing: -0.02em;
}

.login-header .subtitle {
  font-size: 13px;
  color: var(--text-secondary);
  margin-top: 6px;
}

/* Tabs */
.tabs {
  display: flex;
  gap: 2px;
  margin-bottom: 22px;
  background: #f3f4f6;
  padding: 3px;
  border-radius: var(--radius);
}

.tab {
  flex: 1;
  padding: 8px 14px;
  text-align: center;
  font-size: 13px;
  font-weight: 500;
  color: var(--text-secondary);
  cursor: pointer;
  border-radius: var(--radius-sm);
  transition: all var(--transition);
  user-select: none;
}

.tab:hover { color: var(--text); }

.tab.active {
  background: #fff;
  color: var(--text);
  box-shadow: 0 1px 2px rgba(0,0,0,0.04);
}

.tab-content { display: none; }
.tab-content.active { display: block; animation: fadeIn 0.2s ease; }

/* Alerts */
.alert {
  font-size: 13px;
  padding: 10px 14px;
  border-radius: var(--radius);
  margin-bottom: 18px;
  display: flex;
  align-items: center;
  gap: 10px;
  font-weight: 500;
}

.alert-error { background: var(--danger-soft); color: #991b1b; border: 1px solid var(--danger-border); }
.alert-success { background: var(--success-soft); color: #166534; border: 1px solid var(--success-border); }

.alert-icon {
  flex-shrink: 0;
  width: 20px;
  height: 20px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  color: #fff;
  font-size: 11px;
  font-weight: 700;
}

.alert-error .alert-icon { background: var(--danger); }
.alert-success .alert-icon { background: var(--success); }

/* ============================================================
   Forms
   ============================================================ */
.form-field, .form-group { margin-bottom: 16px; }
.form-group:last-child, .form-field:last-child { margin-bottom: 0; }

.form-field label, .form-group label {
  display: block;
  font-size: 12px;
  font-weight: 600;
  color: var(--text);
  margin-bottom: 5px;
}

.input-wrap { position: relative; display: flex; align-items: center; }

.input-icon {
  position: absolute;
  left: 12px;
  color: var(--text-muted);
  pointer-events: none;
  z-index: 1;
  display: flex;
}

.input-icon svg { width: 16px; height: 16px; }

input, select, textarea {
  width: 100%;
  padding: 8px 12px;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  font-size: 13px;
  font-family: inherit;
  background: #fff;
  color: var(--text);
  transition: all var(--transition);
}

.form-field input, .form-group input { padding: 8px 12px 8px 36px; }

input:focus, select:focus, textarea:focus {
  outline: none;
  border-color: var(--primary);
  box-shadow: 0 0 0 3px rgba(37,99,235,0.08);
}

input:read-only { background: #f9fafb; color: var(--text-secondary); cursor: not-allowed; }
textarea { min-height: 72px; resize: vertical; }
.form-hint { font-size: 11px; color: var(--text-muted); margin-top: 4px; }

/* ============================================================
   Divider / Footer
   ============================================================ */
.login-footer {
  text-align: center;
  margin-top: 24px;
  padding-top: 18px;
  border-top: 1px solid var(--border-light);
}

.login-footer p { font-size: 12px; color: var(--text-muted); }

.login-footer a { color: var(--primary); font-weight: 600; }
.login-footer a:hover { opacity: 0.8; }

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

.topbar-brand {
  display: flex;
  align-items: center;
  gap: 10px;
  font-size: 14px;
  font-weight: 700;
  color: var(--text);
  letter-spacing: -0.01em;
}

.topbar-brand .dot {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: var(--success);
  box-shadow: 0 0 0 3px rgba(22,163,74,0.12);
}

.topbar-actions {
  display: flex;
  align-items: center;
  gap: 2px;
}

.topbar-actions .bot-label {
  font-size: 11px;
  color: var(--text-muted);
  margin-right: 8px;
  border: 1px solid var(--border);
  padding: 3px 10px;
  border-radius: var(--radius-full);
  font-weight: 500;
}

.topbar-link {
  font-size: 13px;
  color: var(--text-secondary);
  padding: 6px 12px;
  border-radius: var(--radius-sm);
  transition: all var(--transition);
  font-weight: 500;
}

.topbar-link:hover { background: #f3f4f6; color: var(--text); }

.topbar-link.active {
  background: #f3f4f6;
  color: var(--text);
}

.topbar-link.danger { color: #9ca3af; }
.topbar-link.danger:hover { color: var(--danger); background: var(--danger-soft); }

/* ============================================================
   Layout — persistent left sidebar
   ============================================================ */
.layout {
  display: flex;
  min-height: 100vh;
}

.layout-sidebar {
  width: 250px;
  min-width: 250px;
  background: #fff;
  border-right: 1px solid var(--border);
  display: flex;
  flex-direction: column;
  position: sticky;
  top: 0;
  height: 100vh;
  overflow-y: auto;
  z-index: 10;
}

.layout-sidebar::-webkit-scrollbar { width: 4px; }
.layout-sidebar::-webkit-scrollbar-thumb { background: #e5e7eb; border-radius: 2px; }

.layout-main {
  flex: 1;
  min-width: 0;
  overflow-y: auto;
}

/* Sidebar brand */
.sidebar-brand {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 18px 20px;
  font-size: 14px;
  font-weight: 700;
  color: var(--text);
  letter-spacing: -0.01em;
  border-bottom: 1px solid var(--border-light);
  flex-shrink: 0;
}

.sidebar-brand .dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--success);
  box-shadow: 0 0 0 3px rgba(22,163,74,0.12);
  flex-shrink: 0;
}

/* Sidebar section label */
.sidebar-section {
  padding: 14px 20px 6px;
  font-size: 10px;
  font-weight: 700;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.06em;
}

/* Main nav item */
.sidebar-item {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 9px 20px;
  font-size: 13px;
  font-weight: 500;
  color: var(--text-secondary);
  text-decoration: none;
  transition: all var(--transition);
  border-radius: 0;
  cursor: pointer;
}

.sidebar-item:hover { background: #f3f4f6; color: var(--text); }

.sidebar-item.active {
  background: var(--primary-soft);
  color: var(--primary);
  font-weight: 600;
}

.sidebar-item svg {
  width: 18px;
  height: 18px;
  flex-shrink: 0;
  color: var(--text-muted);
}

.sidebar-item.active svg { color: var(--primary); }

/* Sub nav item (indented) */
.sidebar-sub {
  border-top: 1px solid var(--border-light);
  padding: 4px 0;
}

.sidebar-sub-item {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 6px 20px 6px 48px;
  font-size: 12px;
  font-weight: 500;
  color: var(--text-secondary);
  text-decoration: none;
  transition: all var(--transition);
  cursor: pointer;
}

.sidebar-sub-item:hover { background: #f3f4f6; color: var(--text); }

.sidebar-sub-item.active {
  background: #f3f4f6;
  color: var(--text);
  font-weight: 600;
}

.sidebar-sub-item svg {
  width: 14px;
  height: 14px;
  flex-shrink: 0;
  color: var(--text-muted);
}

/* Sidebar footer */
.sidebar-footer {
  margin-top: auto;
  padding: 12px 20px;
  border-top: 1px solid var(--border-light);
  flex-shrink: 0;
}

.sidebar-footer .sidebar-item { padding: 8px 0; color: var(--text-muted); }
.sidebar-footer .sidebar-item:hover { background: transparent; color: var(--danger); }

/* ============================================================
   Page Layout (legacy — admin pages still use topbar)
   ============================================================ */
.page {
  max-width: 960px;
  margin: 0 auto;
  padding: 28px 24px 64px;
}

.page-wide {
  max-width: 1280px;
  margin: 0 auto;
  padding: 28px 24px 64px;
}

/* Sidebar layout (config page — kept for admin) */
.page-sidebar {
  display: grid;
  grid-template-columns: 240px minmax(0, 1fr);
  gap: 28px;
  align-items: start;
}

.sidebar-sticky {
  position: sticky;
  top: 76px;
}

.main-area > * { animation: fadeIn 0.35s ease both; }
.main-area > *:nth-child(2) { animation-delay: 0.06s; }
.main-area > *:nth-child(3) { animation-delay: 0.12s; }
.main-area > *:nth-child(4) { animation-delay: 0.18s; }

/* ============================================================
   Nav Tabs
   ============================================================ */
.nav-tabs {
  display: flex;
  gap: 2px;
  margin-bottom: 22px;
  background: #f3f4f6;
  padding: 3px;
  border-radius: var(--radius);
  width: fit-content;
}

.nav-tab {
  padding: 7px 16px;
  font-size: 13px;
  font-weight: 500;
  color: var(--text-secondary);
  border-radius: var(--radius-sm);
  transition: all var(--transition);
  cursor: pointer;
  white-space: nowrap;
  border: none;
  background: none;
  font-family: inherit;
}

.nav-tab:hover { color: var(--text); }

.nav-tab.active {
  background: #fff;
  color: var(--text);
  font-weight: 600;
  box-shadow: 0 1px 2px rgba(0,0,0,0.04);
}

.nav-tab .badge {
  display: inline-block;
  min-width: 18px;
  height: 18px;
  padding: 0 6px;
  margin-left: 6px;
  background: #e5e7eb;
  border-radius: var(--radius-full);
  font-size: 10px;
  font-weight: 600;
  text-align: center;
  line-height: 18px;
  color: var(--text-secondary);
}

.nav-tab.active .badge { background: #e5e7eb; color: var(--text); }

.nav-tab .refresh-timer {
  font-size: 10px;
  color: var(--text-muted);
  margin-left: 6px;
  font-weight: 400;
}

/* ============================================================
   Cards
   ============================================================ */
.card {
  background: #fff;
  border-radius: var(--radius-lg);
  border: 1px solid var(--border);
  overflow: hidden;
  transition: box-shadow var(--transition);
}

.card + .card { margin-top: 20px; }

.card-header {
  padding: 16px 20px;
  border-bottom: 1px solid var(--border-light);
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 10px;
}

.card-header h2, .card-title {
  font-size: 14px;
  font-weight: 600;
  color: var(--text);
  display: flex;
  align-items: center;
  gap: 8px;
}

.card-header .count, .date-tag {
  font-size: 11px;
  font-weight: 500;
  color: var(--text-muted);
  background: #f3f4f6;
  padding: 2px 10px;
  border-radius: var(--radius-full);
}

.card-title-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 14px;
  flex-wrap: wrap;
  gap: 10px;
}

.card-body { padding: 18px 20px; }

.card-desc {
  font-size: 13px;
  color: var(--text-secondary);
  line-height: 1.65;
  margin-bottom: 12px;
}

/* ============================================================
   Buttons
   ============================================================ */
.btn {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 7px 14px;
  border-radius: var(--radius);
  font-size: 12px;
  font-weight: 600;
  cursor: pointer;
  border: 1px solid transparent;
  font-family: inherit;
  text-decoration: none;
  transition: all var(--transition);
  white-space: nowrap;
  background: #fff;
  color: var(--text);
  border-color: var(--border);
}

.btn svg { width: 14px; height: 14px; }

.btn:hover { background: #f9fafb; border-color: #d1d5db; }
.btn:active { background: #f3f4f6; }
.btn:disabled { opacity: 0.4; cursor: not-allowed; pointer-events: none; }

.btn-primary {
  background: var(--primary);
  color: #fff;
  border-color: var(--primary);
}
.btn-primary:hover { background: #1d4ed8; border-color: #1d4ed8; color: #fff; }

.btn-success {
  background: var(--success);
  color: #fff;
  border-color: var(--success);
}
.btn-success:hover { background: #15803d; border-color: #15803d; color: #fff; }

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

.btn-ghost {
  background: transparent;
  color: var(--text-secondary);
  border-color: var(--border);
}
.btn-ghost:hover { background: #f9fafb; color: var(--text); }

.btn-danger-ghost {
  background: transparent;
  color: var(--danger);
  border-color: var(--danger-border);
}
.btn-danger-ghost:hover { background: var(--danger-soft); }

.btn-sm { padding: 4px 10px; font-size: 11px; border-radius: var(--radius-sm); }
.btn-accent { background: var(--accent); color: #fff; border-color: var(--accent); }
.btn-accent:hover { background: #0e7490; color: #fff; }

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

table {
  width: 100%;
  border-collapse: collapse;
}

th, td {
  padding: 11px 16px;
  text-align: left;
  border-bottom: 1px solid var(--border-light);
  font-size: 13px;
  line-height: 1.5;
}

th {
  font-weight: 500;
  color: var(--text-muted);
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  background: #fafafa;
  border-bottom: 1px solid var(--border);
}

tbody tr:hover { background: #fafafa; }
tbody tr:last-child td { border-bottom: none; }

td code {
  font-family: "JetBrains Mono", "Consolas", "Monaco", monospace;
  font-size: 11px;
  background: #f3f4f6;
  padding: 2px 8px;
  border-radius: 4px;
  color: var(--text);
}

/* ============================================================
   Badges
   ============================================================ */
.badge {
  display: inline-block;
  padding: 2px 8px;
  border-radius: var(--radius-full);
  font-size: 10px;
  font-weight: 600;
  letter-spacing: 0.01em;
}

.badge-green { background: var(--success-soft); color: #166534; border: 1px solid var(--success-border); }
.badge-red   { background: var(--danger-soft); color: #991b1b; border: 1px solid var(--danger-border); }
.badge-amber { background: var(--warning-soft); color: #92400e; border: 1px solid var(--warning-border); }
.badge-gray  { background: #f3f4f6; color: var(--text-secondary); border: 1px solid var(--border); }
.badge-blue  { background: var(--primary-soft); color: #1e40af; border: 1px solid var(--primary-border); }

/* ============================================================
   Avatar
   ============================================================ */
.avatar-cell { position: relative; display: inline-flex; }

.avatar, .avatar-img {
  width: 34px;
  height: 34px;
  border-radius: 50%;
  background: #f3f4f6;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 14px;
  font-weight: 600;
  color: var(--text-secondary);
  overflow: hidden;
  flex-shrink: 0;
}

.avatar img, .avatar-img img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.avatar-ring {
  position: absolute;
  inset: -3px;
  border-radius: 50%;
  border: 2px solid var(--success);
  opacity: 0.6;
}

.avatar-ring.online { animation: avatarPulse 2s ease-in-out infinite; }

@keyframes avatarPulse {
  0%, 100% { box-shadow: 0 0 0 3px rgba(22,163,74,0.12); }
  50% { box-shadow: 0 0 0 7px rgba(22,163,74,0.04); }
}

/* ============================================================
   Action Groups
   ============================================================ */
.action-group {
  display: flex;
  gap: 4px;
  align-items: center;
  flex-wrap: wrap;
}

.action-divider {
  width: 1px;
  height: 16px;
  background: var(--border);
  margin: 0 4px;
}

/* ============================================================
   Empty State
   ============================================================ */
.empty-state {
  text-align: center;
  padding: 48px 24px;
}

.empty-icon {
  width: 52px;
  height: 52px;
  border-radius: 50%;
  background: #f3f4f6;
  display: flex;
  align-items: center;
  justify-content: center;
  margin: 0 auto 14px;
  color: var(--text-muted);
}

.empty-icon svg { width: 26px; height: 26px; }

.empty-state h3 {
  font-size: 14px;
  font-weight: 600;
  color: var(--text);
  margin-bottom: 4px;
}

.empty-state p { font-size: 12px; color: var(--text-muted); }

/* ============================================================
   Modal
   ============================================================ */
.modal-overlay {
  display: none;
  position: fixed;
  inset: 0;
  z-index: 100;
  align-items: center;
  justify-content: center;
  background: rgba(0,0,0,0.2);
  backdrop-filter: blur(2px);
}

.modal-overlay.active { display: flex; }

.modal {
  background: #fff;
  border-radius: var(--radius-xl);
  box-shadow: var(--shadow-lg);
  width: 100%;
  max-width: 460px;
  border: 1px solid var(--border);
  animation: modalIn 0.2s ease;
  overflow: hidden;
}

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

.modal-header {
  padding: 16px 22px;
  border-bottom: 1px solid var(--border-light);
  font-size: 15px;
  font-weight: 600;
  color: var(--text);
}

.modal-body {
  padding: 20px 22px;
  max-height: 60vh;
  overflow-y: auto;
}

.modal-footer {
  padding: 12px 22px;
  border-top: 1px solid var(--border-light);
  display: flex;
  justify-content: flex-end;
  gap: 8px;
  background: #fafafa;
}

/* ============================================================
   Profile Section (horizontal card for index)
   ============================================================ */
.profile-card {
  display: flex;
  align-items: center;
  gap: 18px;
}

.profile-avatar-lg {
  width: 72px;
  height: 72px;
  border-radius: 50%;
  background: #f3f4f6;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 28px;
  font-weight: 700;
  color: var(--text-secondary);
  overflow: hidden;
  flex-shrink: 0;
  border: 2px solid #fff;
  outline: 1px solid var(--border);
}

.profile-avatar-lg img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

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

.profile-info .name {
  font-size: 17px;
  font-weight: 700;
  color: var(--text);
  margin-bottom: 2px;
  letter-spacing: -0.01em;
}

.profile-info .id {
  font-size: 11px;
  font-family: "JetBrains Mono", "Consolas", "Monaco", monospace;
  color: var(--text-muted);
  background: #f3f4f6;
  display: inline-block;
  padding: 2px 8px;
  border-radius: 4px;
  margin-bottom: 6px;
}

.profile-meta {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
  margin-top: 4px;
}

/* Controls in profile card */
.profile-controls {
  display: flex;
  gap: 6px;
  flex-shrink: 0;
}

/* ============================================================
   Sidebar profile (config page)
   ============================================================ */
.profile-section {
  text-align: center;
  padding: 20px 18px 16px;
}

.avatar-wrap {
  position: relative;
  display: inline-block;
  margin-bottom: 10px;
}

.avatar-wrap .avatar-img {
  width: 64px;
  height: 64px;
  font-size: 24px;
  border: 2px solid #fff;
  outline: 1px solid var(--border);
  border-radius: 50%;
}

.status-dot {
  position: absolute;
  bottom: 3px;
  right: 3px;
  width: 13px;
  height: 13px;
  border-radius: 50%;
  border: 2px solid #fff;
}

.status-dot.online { background: var(--success); }
.status-dot.offline { background: var(--text-muted); }

.profile-name {
  font-size: 15px;
  font-weight: 600;
  color: var(--text);
  margin-bottom: 4px;
}

.profile-id {
  font-size: 10px;
  font-family: "JetBrains Mono", "Consolas", "Monaco", monospace;
  color: var(--text-muted);
  background: #f3f4f6;
  display: inline-block;
  padding: 2px 8px;
  border-radius: 4px;
}

/* ============================================================
   Meta List
   ============================================================ */
.meta-list { padding: 2px 0; }

.meta-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 9px 16px;
  font-size: 12px;
  border-bottom: 1px solid var(--border-light);
}

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

.meta-label {
  color: var(--text-secondary);
  display: flex;
  align-items: center;
  gap: 8px;
}

.meta-label svg { width: 14px; height: 14px; color: var(--text-muted); }
.meta-value { font-weight: 500; font-size: 11px; }

/* ============================================================
   Control Buttons
   ============================================================ */
.control-list {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.ctrl-btn {
  display: flex;
  align-items: center;
  gap: 8px;
  width: 100%;
  padding: 9px 14px;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: #fff;
  font-size: 12px;
  font-weight: 500;
  color: var(--text);
  cursor: pointer;
  font-family: inherit;
  text-decoration: none;
  transition: all var(--transition);
}

.ctrl-btn:disabled { opacity: 0.4; cursor: not-allowed; }
.ctrl-btn svg { width: 15px; height: 15px; color: var(--text-muted); transition: color var(--transition); }

.ctrl-btn:hover:not(:disabled) { background: #f9fafb; border-color: #d1d5db; }

.ctrl-btn.success:hover:not(:disabled) { border-color: var(--success); background: var(--success-soft); color: #166534; }
.ctrl-btn.success:hover:not(:disabled) svg { color: var(--success); }

.ctrl-btn.danger:hover:not(:disabled) { border-color: var(--danger); background: var(--danger-soft); color: #991b1b; }
.ctrl-btn.danger:hover:not(:disabled) svg { color: var(--danger); }

.ctrl-btn.warning:hover:not(:disabled) { border-color: var(--warning); background: var(--warning-soft); }

/* ============================================================
   Sidebar Nav
   ============================================================ */
.sidebar-nav { padding: 0; }

.sidebar-nav-item {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 10px 14px;
  color: var(--text-secondary);
  font-size: 12px;
  font-weight: 500;
  border-bottom: 1px solid var(--border-light);
  transition: all var(--transition);
  cursor: pointer;
  text-decoration: none;
}

.sidebar-nav-item:last-child { border-bottom: none; }
.sidebar-nav-item:hover { background: #f9fafb; color: var(--text); }

.sidebar-nav-item.active {
  background: #f3f4f6;
  color: var(--text);
  font-weight: 600;
}

.sidebar-nav-item svg {
  width: 16px;
  height: 16px;
  flex-shrink: 0;
  color: var(--text-muted);
}

/* ============================================================
   Webhook Bar
   ============================================================ */
.webhook-bar {
  display: flex;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  overflow: hidden;
}

.webhook-bar:focus-within {
  border-color: var(--primary);
  box-shadow: 0 0 0 3px rgba(37,99,235,0.06);
}

.webhook-bar .protocol-tag {
  padding: 8px 14px;
  font-size: 10px;
  font-weight: 700;
  color: var(--success);
  background: var(--success-soft);
  border-right: 1px solid var(--success-border);
  text-transform: uppercase;
  letter-spacing: 0.5px;
  display: flex;
  align-items: center;
  white-space: nowrap;
}

.webhook-bar code {
  flex: 1;
  padding: 8px 14px;
  font-family: "JetBrains Mono", "Consolas", "Monaco", monospace;
  font-size: 11px;
  background: #fafafa;
  color: var(--text);
  word-break: break-all;
  min-width: 0;
  display: flex;
  align-items: center;
}

.webhook-bar .copy-btn {
  padding: 8px 18px;
  background: var(--text);
  color: #fff;
  border: none;
  font-size: 11px;
  font-weight: 600;
  cursor: pointer;
  font-family: inherit;
  white-space: nowrap;
  transition: all var(--transition);
}

.webhook-bar .copy-btn:hover { background: #1f2937; }
.webhook-bar .copy-btn.copied { background: var(--success); }

/* ============================================================
   Stats Row
   ============================================================ */
.stats-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
  margin-top: 14px;
}

.stat-card {
  padding: 16px;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  transition: all var(--transition);
  background: #fff;
}

.stat-card:hover {
  border-color: #d1d5db;
  box-shadow: var(--shadow-xs);
}

.stat-card .stat-icon {
  width: 30px;
  height: 30px;
  border-radius: var(--radius-sm);
  display: flex;
  align-items: center;
  justify-content: center;
  margin-bottom: 10px;
}

.stat-card .stat-icon svg { width: 15px; height: 15px; }

.stat-icon.success { background: var(--success-soft); color: var(--success); }
.stat-icon.primary { background: var(--primary-soft); color: var(--primary); }
.stat-icon.accent  { background: var(--accent-soft); color: var(--accent); }

.stat-card .stat-value {
  font-size: 24px;
  font-weight: 700;
  color: var(--text);
  line-height: 1.2;
  letter-spacing: -0.02em;
}

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

/* ============================================================
   Steps List
   ============================================================ */
.steps-list {
  list-style: none;
  position: relative;
  padding-left: 32px;
}

.steps-list::before {
  content: '';
  position: absolute;
  left: 14px;
  top: 6px;
  bottom: 6px;
  width: 1px;
  background: var(--border);
}

.step-item {
  position: relative;
  padding-bottom: 16px;
  font-size: 12px;
  color: var(--text-secondary);
  line-height: 1.6;
}

.step-item:last-child { padding-bottom: 0; }

.step-num {
  position: absolute;
  left: -32px;
  top: 0;
  width: 22px;
  height: 22px;
  border-radius: 50%;
  background: #fff;
  border: 1px solid var(--border);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 10px;
  font-weight: 700;
  color: var(--text-muted);
  z-index: 1;
  transition: all var(--transition);
}

.step-item:hover .step-num { border-color: var(--primary); color: var(--primary); }

.step-item.completed .step-num {
  background: var(--success);
  border-color: var(--success);
  color: #fff;
  font-size: 11px;
}

/* ============================================================
   Feature Items
   ============================================================ */
.feature-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 13px 0;
  border-bottom: 1px solid var(--border-light);
  gap: 14px;
}

.feature-item:last-child { border-bottom: none; }
.feature-info { flex: 1; min-width: 0; }

.feature-name {
  font-size: 13px;
  font-weight: 500;
  color: var(--text);
  margin-bottom: 2px;
}

.feature-desc {
  font-size: 11px;
  color: var(--text-muted);
  line-height: 1.5;
}

/* ============================================================
   Toggle Switch
   ============================================================ */
.toggle {
  position: relative;
  width: 40px;
  height: 22px;
  background: #d1d5db;
  border-radius: 11px;
  cursor: pointer;
  transition: all var(--transition);
  flex-shrink: 0;
}

.toggle:hover { background: #c4c8ce; }

.toggle.active { background: var(--primary); }

.toggle::after {
  content: '';
  position: absolute;
  top: 2px;
  left: 2px;
  width: 18px;
  height: 18px;
  background: #fff;
  border-radius: 50%;
  transition: all 0.2s cubic-bezier(0.34, 1.56, 0.64, 1);
  box-shadow: 0 1px 2px rgba(0,0,0,0.08);
}

.toggle.active::after { transform: translateX(18px); }

/* ============================================================
   Keyword Items
   ============================================================ */
.keyword-list { margin-top: 0; }

.keyword-item {
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 14px 16px;
  margin-bottom: 8px;
  transition: all var(--transition);
}

.keyword-item:hover {
  border-color: #d1d5db;
  box-shadow: var(--shadow-xs);
}

.keyword-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 8px;
  flex-wrap: wrap;
  gap: 8px;
}

.keyword-text {
  font-size: 13px;
  font-weight: 600;
  color: var(--text);
  display: flex;
  align-items: center;
  gap: 6px;
  flex-wrap: wrap;
}

.keyword-badge {
  font-size: 10px;
  padding: 2px 8px;
  background: #f3f4f6;
  color: var(--text-secondary);
  border-radius: var(--radius-full);
  font-weight: 500;
}

.keyword-actions { display: flex; gap: 4px; }

.keyword-actions button {
  padding: 4px 10px;
  font-size: 11px;
  border: 1px solid var(--border);
  background: #fff;
  border-radius: var(--radius-sm);
  cursor: pointer;
  color: var(--text-secondary);
  font-weight: 500;
  font-family: inherit;
  transition: all var(--transition);
}

.keyword-actions button:hover { border-color: #d1d5db; background: #f9fafb; }
.keyword-actions button.danger:hover { border-color: var(--danger); color: var(--danger); background: var(--danger-soft); }

.keyword-content {
  font-size: 12px;
  color: var(--text-secondary);
  line-height: 1.6;
}

/* ============================================================
   Master Items
   ============================================================ */
.master-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 9px 14px;
  border: 1px solid var(--border-light);
  border-radius: var(--radius);
  margin-bottom: 6px;
  background: #fafafa;
}

/* ============================================================
   Terminal / Log viewer — light
   ============================================================ */
.terminal {
  background: #fafafa;
  border-top: 1px solid var(--border);
  border-radius: 0 0 var(--radius-lg) var(--radius-lg);
  overflow: hidden;
}

.terminal-bar {
  height: 34px;
  background: #f5f5f5;
  display: flex;
  align-items: center;
  padding: 0 14px;
  gap: 7px;
  border-bottom: 1px solid var(--border-light);
}

.terminal-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
}

.terminal-dot.red    { background: #fca5a5; }
.terminal-dot.yellow { background: #fcd34d; }
.terminal-dot.green  { background: #86efac; }

.terminal-title {
  margin-left: 8px;
  font-size: 10px;
  color: var(--text-muted);
  font-family: "JetBrains Mono", "Consolas", "Monaco", monospace;
}

.terminal-body {
  max-height: 500px;
  overflow-y: auto;
  padding: 12px 16px;
  font-family: "JetBrains Mono", "Consolas", "Monaco", monospace;
  font-size: 12px;
  line-height: 1.7;
}

.terminal-body::-webkit-scrollbar { width: 5px; }
.terminal-body::-webkit-scrollbar-track { background: transparent; }
.terminal-body::-webkit-scrollbar-thumb { background: #d1d5db; border-radius: 3px; }

/* Log table */
.log-table {
  width: 100%;
  border-collapse: collapse;
  color: var(--text);
}

.log-table th, .log-table td {
  padding: 6px 12px;
  text-align: left;
  border-bottom: 1px solid #f3f4f6;
  font-size: 11px;
  vertical-align: top;
}

.log-table th {
  font-weight: 500;
  color: var(--text-muted);
  font-size: 10px;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  position: sticky;
  top: 0;
  background: #fafafa;
  z-index: 1;
}

.log-table tr:nth-child(even) td { background: rgba(0,0,0,0.01); }
.log-table td:first-child { color: var(--text-muted); white-space: nowrap; }

.type-tag {
  display: inline-block;
  padding: 1px 6px;
  border-radius: 3px;
  font-size: 9px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.04em;
}

.tag-event   { background: rgba(37,99,235,0.08); color: #2563eb; }
.tag-message { background: rgba(22,163,74,0.08); color: #16a34a; }
.tag-info    { background: rgba(107,114,128,0.08); color: #6b7280; }
.tag-warn    { background: rgba(217,119,6,0.08); color: #b45309; }
.tag-error   { background: rgba(220,38,38,0.08); color: #dc2626; }
.tag-unknown { background: rgba(107,114,128,0.05); color: var(--text-muted); }

.content-cell { word-break: break-all; }

.raw-line { margin-bottom: 1px; color: var(--text); }
.raw-event   { color: #2563eb; }
.raw-message { color: #16a34a; }
.raw-info    { color: var(--text); }
.raw-warn    { color: #b45309; }
.raw-error   { color: #dc2626; }

/* ============================================================
   File Chips
   ============================================================ */
.file-chips {
  display: flex;
  gap: 4px;
  flex-wrap: wrap;
  margin-top: 10px;
}

.file-chip {
  padding: 3px 10px;
  font-size: 11px;
  border-radius: var(--radius-full);
  cursor: pointer;
  background: #f3f4f6;
  color: var(--text-secondary);
  border: 1px solid transparent;
  transition: all var(--transition);
  font-family: "JetBrains Mono", "Consolas", "Monaco", monospace;
}

.file-chip:hover { background: #e5e7eb; color: var(--text); }

.file-chip.active {
  background: var(--text);
  color: #fff;
}

/* ============================================================
   Toolbar
   ============================================================ */
.toolbar {
  display: flex;
  gap: 8px;
  align-items: center;
  flex-wrap: wrap;
}

.toolbar select,
.toolbar input {
  padding: 6px 10px;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  font-size: 12px;
  font-family: inherit;
  background: #fff;
  color: var(--text);
  transition: all var(--transition);
}

.toolbar input { width: auto; min-width: 140px; }

.toolbar select:focus,
.toolbar input:focus {
  outline: none;
  border-color: var(--primary);
  box-shadow: 0 0 0 3px rgba(37,99,235,0.06);
}

/* ============================================================
   Quick Dates
   ============================================================ */
.quick-dates { display: flex; gap: 1px; }

.quick-date {
  padding: 4px 10px;
  font-size: 11px;
  border: 1px solid var(--border);
  background: #fff;
  border-radius: var(--radius-sm);
  cursor: pointer;
  font-family: inherit;
  color: var(--text-secondary);
  font-weight: 500;
  transition: all var(--transition);
}

.quick-date:hover { background: #f9fafb; }

.quick-date.active {
  background: var(--text);
  color: #fff;
  border-color: var(--text);
}

/* ============================================================
   View Toggle
   ============================================================ */
.view-toggle {
  display: flex;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  overflow: hidden;
}

.view-toggle button {
  padding: 6px 12px;
  border: none;
  background: #fff;
  font-size: 12px;
  cursor: pointer;
  font-family: inherit;
  color: var(--text-secondary);
  font-weight: 500;
  transition: all var(--transition);
}

.view-toggle button:not(:last-child) { border-right: 1px solid var(--border); }

.view-toggle button.active {
  background: #f3f4f6;
  color: var(--text);
  font-weight: 600;
}

.view-toggle button:hover:not(.active) { background: #f9fafb; }

/* ============================================================
   Toast
   ============================================================ */
.toast {
  position: fixed;
  bottom: 28px;
  left: 50%;
  transform: translateX(-50%);
  background: var(--text);
  color: #fff;
  padding: 10px 22px;
  border-radius: var(--radius-full);
  font-size: 12px;
  font-weight: 600;
  z-index: 999;
  box-shadow: var(--shadow-md);
  animation: toastIn 0.25s ease;
  pointer-events: none;
}

.toast.success { background: var(--success); }
.toast.error   { background: var(--danger); }
.toast.info    { background: var(--primary); }

/* ============================================================
   Stats Overview (Admin Dashboard)
   ============================================================ */
.stats-overview {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 14px;
  margin-bottom: 24px;
}

.stat-overview-card {
  background: #fff;
  border-radius: var(--radius-lg);
  border: 1px solid var(--border);
  padding: 18px 20px;
  display: flex;
  align-items: center;
  gap: 14px;
  transition: all var(--transition);
}

.stat-overview-card:hover {
  border-color: #d1d5db;
  box-shadow: var(--shadow-xs);
}

.stat-ov-icon {
  width: 40px;
  height: 40px;
  border-radius: var(--radius);
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

.stat-ov-icon.warning { background: var(--warning-soft); color: var(--warning); }
.stat-ov-icon.success { background: var(--success-soft); color: var(--success); }
.stat-ov-icon.primary { background: var(--primary-soft); color: var(--primary); }
.stat-ov-icon.accent  { background: var(--accent-soft); color: var(--accent); }

.stat-ov-icon svg { width: 20px; height: 20px; }

.stat-ov-value {
  font-size: 22px;
  font-weight: 700;
  color: var(--text);
  letter-spacing: -0.02em;
  line-height: 1.2;
}

.stat-ov-label {
  font-size: 11px;
  color: var(--text-muted);
  margin-top: 1px;
}

/* ============================================================
   Loading Spinner
   ============================================================ */
.loading {
  display: inline-block;
  width: 16px;
  height: 16px;
  border: 2px solid rgba(255,255,255,0.3);
  border-radius: 50%;
  border-top-color: #fff;
  animation: spin 0.6s linear infinite;
}

@keyframes spin { to { transform: rotate(360deg); } }

/* ============================================================
   Toggle Icon
   ============================================================ */
.toggle-icon {
  width: 16px;
  height: 16px;
  transition: transform 0.2s cubic-bezier(0.34, 1.56, 0.64, 1);
  flex-shrink: 0;
}

.toggle-icon.expanded  { transform: rotate(90deg); }
.toggle-icon.collapsed { transform: rotate(0deg); }

/* ============================================================
   Animations
   ============================================================ */
@keyframes fadeIn {
  from { opacity: 0; transform: translateY(10px); }
  to   { opacity: 1; transform: translateY(0); }
}

@keyframes modalIn {
  from { opacity: 0; transform: scale(0.96); }
  to   { opacity: 1; transform: scale(1); }
}

@keyframes toastIn {
  from { opacity: 0; transform: translateX(-50%) translateY(14px); }
  to   { opacity: 1; transform: translateX(-50%) translateY(0); }
}

/* ============================================================
   Config-specific
   ============================================================ */
.card-notice {
  margin-top: 14px;
  padding: 10px 16px;
  background: var(--warning-soft);
  border: 1px solid var(--warning-border);
  border-radius: var(--radius);
  font-size: 12px;
  color: #92400e;
  font-weight: 500;
}

.feature-divider {
  height: 1px;
  background: var(--border);
  margin: 4px 0;
}
.clickable { cursor: pointer; user-select: none; }

.config-panel { display: none; }
.config-panel.active { display: block; animation: fadeIn 0.25s ease; }

.section-header {
  display: flex;
  align-items: center;
  gap: 12px;
}

.sub-feature { padding: 10px 0; }
.sub-name { font-size: 14px; }

.form-actions {
  display: flex;
  gap: 10px;
  margin-top: 18px;
}

/* Prize List Styles */
.prizes-list {
  display: flex;
  flex-direction: column;
  gap: 10px;
  margin-top: 8px;
}

.prize-item {
  display: grid;
  grid-template-columns: 1fr 80px 120px 120px auto;
  gap: 10px;
  align-items: center;
  padding: 12px 14px;
  background: #fafafa;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  transition: all var(--transition);
}

.prize-item:hover {
  background: #f5f5f5;
  border-color: #d1d5db;
}

.prize-item input,
.prize-item select {
  width: 100%;
  padding: 6px 10px;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  font-size: 12px;
  background: #fff;
}

.prize-item input:focus,
.prize-item select:focus {
  outline: none;
  border-color: var(--primary);
  box-shadow: 0 0 0 3px rgba(37,99,235,0.06);
}

.prize-item .prize-name {
  font-weight: 500;
}

.prize-item .prize-probability {
  text-align: right;
}

.prizes-header {
  display: grid;
  grid-template-columns: 1fr 80px 120px 120px auto;
  gap: 10px;
  padding: 8px 14px;
  font-size: 11px;
  font-weight: 600;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.04em;
}

.prizes-header span {
  padding: 0 2px;
}

/* Prize List View */
.prize-list-view {
  margin-top: 16px;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  overflow: hidden;
}

.prize-list-table {
  width: 100%;
  border-collapse: collapse;
}

.prize-list-table th,
.prize-list-table td {
  padding: 10px 14px;
  text-align: left;
  font-size: 12px;
}

.prize-list-table th {
  background: #fafafa;
  font-weight: 600;
  color: var(--text-muted);
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  border-bottom: 1px solid var(--border);
}

.prize-list-table td {
  border-bottom: 1px solid var(--border-light);
  vertical-align: middle;
}

.prize-list-table tbody tr:hover {
  background: #fafafa;
}

.prize-list-table tbody tr:last-child td {
  border-bottom: none;
}

.prize-badge {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 3px 8px;
  border-radius: var(--radius-full);
  font-size: 11px;
  font-weight: 600;
}

.prize-badge.none { background: #f3f4f6; color: var(--text-muted); }
.prize-badge.cfPoints { background: var(--primary-soft); color: var(--primary); }
.prize-badge.gp { background: var(--success-soft); color: var(--success); }
.prize-badge.fireCoin { background: var(--warning-soft); color: var(--warning); }
.prize-badge.points { background: var(--accent-soft); color: var(--accent); }
.prize-badge.item { background: #f3e8ff; color: #7e22ce; }

.probability-bar {
  height: 6px;
  background: #e5e7eb;
  border-radius: 3px;
  overflow: hidden;
  margin-top: 4px;
}

.probability-fill {
  height: 100%;
  background: linear-gradient(90deg, var(--primary), var(--accent));
  border-radius: 3px;
  transition: width 0.3s ease;
}

.prize-actions {
  display: flex;
  gap: 4px;
}

.prize-actions button {
  padding: 4px 8px;
  font-size: 11px;
}

.prize-config-section {
  margin-bottom: 20px;
}

.prize-config-section + .prize-config-section {
  padding-top: 16px;
  border-top: 1px solid var(--border-light);
}

/* Responsive for Prize List */
@media (max-width: 800px) {
  .prize-item {
    grid-template-columns: 1fr;
    gap: 8px;
  }

  .prizes-header {
    display: none;
  }
}

.form-toggle-row {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 12px 0;
}

.form-toggle-label {
  font-size: 14px;
  font-weight: 600;
}

/* ============================================================
   Utilities
   ============================================================ */
.text-muted { color: var(--text-muted); }
.text-small { font-size: 11px; }
.font-mono { font-family: "JetBrains Mono", "Consolas", "Monaco", monospace; }
.mt-4 { margin-top: 16px; }
.mt-5 { margin-top: 20px; }
.mb-4 { margin-bottom: 16px; }
.flex { display: flex; }
.gap-2 { gap: 8px; }
.gap-3 { gap: 12px; }
.items-center { align-items: center; }
.btn-block { width: 100%; justify-content: center; padding: 12px 20px; font-size: 14px; }

/* ============================================================
   Responsive
   ============================================================ */
@media (max-width: 1100px) {
  .stats-overview { grid-template-columns: repeat(2, 1fr); }
}

@media (max-width: 800px) {
  .page-sidebar { grid-template-columns: 1fr; }
  .sidebar-sticky { position: static; }

  .topbar { padding: 0 16px; }

  .page, .page-wide { padding: 20px 16px 48px; }

  .profile-card { flex-direction: column; text-align: center; }
  .profile-controls { width: 100%; justify-content: center; }

  .stats-overview { grid-template-columns: 1fr; }
  .stats-row { grid-template-columns: 1fr; }

  .nav-tabs { width: 100%; overflow-x: auto; }

  .card-header { padding: 12px 16px; }
  .card-body { padding: 14px 16px; }

  .layout { flex-direction: column; }
  .layout-sidebar {
    width: 100%;
    min-width: 100%;
    height: auto;
    position: relative;
    border-right: none;
    border-bottom: 1px solid var(--border);
  }
  .layout-sidebar .sidebar-brand { padding: 14px 16px; }
  .layout-sidebar .sidebar-item { padding: 8px 16px; }
  .layout-sidebar .sidebar-sub-item { padding: 6px 16px 6px 40px; }
  .layout-sidebar .sidebar-footer { display: none; }
  .layout-main { overflow-y: visible; }
}

@media (max-height: 700px) {
  body.auth-page { padding-top: 12px; padding-bottom: 12px; }
  .login-body { padding: 24px 24px 20px; }
  .login-header { margin-bottom: 18px; }
}
