/* Fonts: DM Sans + DM Mono loaded in views/partials/head.php */

* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

:root {
  --bg: #0a0a0f;
  --bg-elevated: #12121a;
  --bg-card: #1a1a24;
  --border: rgba(255, 255, 255, 0.1);
  --text: #ffffff;
  --text-muted: #a0a0b0;
  --purple: #a855f7;
  --purple-dark: #7c3aed;
  --purple-glow: rgba(168, 85, 247, 0.2);
  --green: #22c55e;
  --red: #ef4444;
  --yellow: #f59e0b;
  --accent: var(--purple);
  --accent-h: #c084fc;
  --muted: var(--text-muted);
  --muted2: #9aa0b3;
  --muted3: #7a8195;
  --surface2: #151524;
  --surface3: #10101a;
  --radius: 12px;
  --radius-sm: 8px;
}

body {
  font-family: 'DM Sans', 'Inter', -apple-system, BlinkMacSystemFont, sans-serif;
  background: var(--bg);
  color: var(--text);
  font-size: 14px;
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
  overflow-x: hidden;
}

.blob {
  position: fixed;
  border-radius: 50%;
  filter: blur(80px);
  opacity: 0.35;
  pointer-events: none;
  z-index: 0;
}

.blob-1 {
  width: 420px;
  height: 420px;
  background: radial-gradient(circle, rgba(124, 58, 237, 0.55) 0%, transparent 70%);
  top: -120px;
  right: -80px;
}

.blob-2 {
  width: 360px;
  height: 360px;
  background: radial-gradient(circle, rgba(168, 85, 247, 0.35) 0%, transparent 70%);
  bottom: -100px;
  left: -60px;
}

a.logo,
.logo-flk {
  text-decoration: none;
  color: var(--text);
}

.logo-flk .logo-l {
  color: #a855f7;
  text-shadow: 0 0 28px rgba(168, 85, 247, 0.45);
}

#particles {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  z-index: 1;
  pointer-events: none;
}

nav, .content, .dash-wrap, .login-wrap, .modal-bg {
  position: relative;
  z-index: 10;
}

nav {
  position: sticky;
  top: 0;
  z-index: 100;
  height: 64px;
  background: rgba(10, 10, 15, 0.95);
  backdrop-filter: blur(10px);
  border-bottom: 1px solid var(--border);
  display: flex;
  align-items: center;
  padding: 0 24px;
  justify-content: space-between;
}

.nav-left, .nav-right {
  display: flex;
  align-items: center;
  gap: 16px;
}

.logo {
  font-size: 22px;
  font-weight: 900;
  letter-spacing: -1px;
  color: var(--text);
  text-decoration: none;
}

.logo-lg {
  font-size: 48px;
  font-weight: 900;
  letter-spacing: -2px;
  text-align: center;
  margin-bottom: 24px;
}

.nav-avatar {
  width: 32px;
  height: 32px;
  border-radius: 50%;
  border: 2px solid var(--purple);
}

.nav-username {
  font-size: 14px;
  font-weight: 500;
}

.nav-badge {
  padding: 4px 10px;
  background: rgba(168, 85, 247, 0.15);
  border: 1px solid rgba(168, 85, 247, 0.3);
  border-radius: 6px;
  font-size: 11px;
  font-weight: 700;
  color: var(--purple);
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.nav-icon-btn {
  width: 36px;
  height: 36px;
  border-radius: 8px;
  background: var(--bg-elevated);
  border: 1px solid var(--border);
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--text-muted);
  cursor: pointer;
  transition: all 0.2s;
  text-decoration: none;
}

.nav-icon-btn:hover {
  background: var(--bg-card);
  color: var(--purple);
  border-color: var(--purple);
}

.btn {
  position: relative;
  overflow: hidden;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 0 20px;
  height: 44px;
  border-radius: 8px;
  font-size: 14px;
  font-weight: 600;
  cursor: pointer;
  border: none;
  text-decoration: none;
  font-family: inherit;
  -webkit-tap-highlight-color: transparent;
  transition:
    transform 0.22s cubic-bezier(0.34, 1.45, 0.64, 1),
    box-shadow 0.28s ease,
    background 0.22s ease,
    border-color 0.22s ease,
    filter 0.2s ease;
}

.btn > *:not(.ripple) {
  position: relative;
  z-index: 1;
}

.btn .ripple {
  position: absolute;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.38);
  transform: scale(0);
  animation: btn-ripple 0.65s ease-out forwards;
  pointer-events: none;
  z-index: 0;
}

.btn-outline .ripple {
  background: rgba(168, 85, 247, 0.35);
}

.btn-danger .ripple {
  background: rgba(255, 255, 255, 0.3);
}

.btn-safe .ripple {
  background: rgba(0, 0, 0, 0.12);
}

@keyframes btn-ripple {
  to {
    transform: scale(2.6);
    opacity: 0;
  }
}

.btn:not(:disabled):hover {
  transform: translateY(-2px);
}

.btn:not(:disabled):active {
  transform: translateY(0) scale(0.98);
  transition-duration: 0.08s;
}

.btn:focus-visible {
  outline: none;
  box-shadow: 0 0 0 3px var(--purple-glow), 0 0 24px rgba(168, 85, 247, 0.25);
}

.btn-primary, .btn-purple {
  background: var(--purple);
  color: white;
  box-shadow: 0 4px 14px rgba(124, 58, 237, 0.35);
}

.btn-primary:hover, .btn-purple:hover {
  background: var(--purple-dark);
  box-shadow: 0 0 28px rgba(168, 85, 247, 0.45), 0 8px 20px rgba(124, 58, 237, 0.28);
  filter: brightness(1.05);
}

.btn-white {
  background: white;
  color: #000;
  box-shadow: 0 4px 14px rgba(0, 0, 0, 0.15);
}

.btn-white:hover {
  background: #f5f5f5;
  box-shadow: 0 8px 22px rgba(0, 0, 0, 0.2);
}

.btn-outline {
  background: transparent;
  border: 1px solid var(--border);
  color: var(--text);
  box-shadow: none;
}

.btn-outline:hover {
  background: var(--bg-elevated);
  border-color: var(--purple);
  box-shadow: 0 0 18px rgba(168, 85, 247, 0.12);
}

.btn-full {
  width: 100%;
}

.btn:disabled {
  opacity: 0.5;
  cursor: not-allowed;
  transform: none !important;
  box-shadow: none !important;
  filter: none !important;
}

.card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 20px;
  transition: all 0.2s;
}

.card:hover {
  border-color: rgba(168, 85, 247, 0.3);
}

.input, input[type="text"], input[type="email"], input[type="password"], textarea, select {
  width: 100%;
  padding: 0 16px;
  height: 44px;
  background: var(--bg-elevated);
  border: 1px solid var(--border);
  border-radius: 8px;
  color: var(--text);
  font-size: 14px;
  font-family: inherit;
  outline: none;
  transition: all 0.2s;
}

textarea {
  padding: 12px 16px;
  min-height: 100px;
  resize: vertical;
}

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

.input:focus, input:focus, textarea:focus, select:focus {
  border-color: var(--purple);
  box-shadow: 0 0 0 3px var(--purple-glow);
}

.badge {
  padding: 4px 10px;
  border-radius: 6px;
  font-size: 12px;
  font-weight: 600;
  display: inline-block;
}

.badge-purple {
  background: rgba(168, 85, 247, 0.15);
  border: 1px solid rgba(168, 85, 247, 0.3);
  color: var(--purple);
}

.badge-green {
  background: rgba(34, 197, 94, 0.1);
  border: 1px solid rgba(34, 197, 94, 0.2);
  color: var(--green);
}

.badge-red {
  background: rgba(239, 68, 68, 0.1);
  border: 1px solid rgba(239, 68, 68, 0.2);
  color: var(--red);
}

.badge-gray {
  background: var(--bg-elevated);
  border: 1px solid var(--border);
  color: var(--text-muted);
}

.toast {
  position: fixed;
  bottom: 24px;
  right: 24px;
  z-index: 9999;
  min-width: 300px;
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 16px;
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.4);
  display: flex;
  align-items: center;
  gap: 12px;
  opacity: 0;
  transform: translateY(20px);
  transition: all 0.3s;
  pointer-events: none;
}

.toast.show {
  opacity: 1;
  transform: translateY(0);
  pointer-events: all;
}

.toast-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  flex-shrink: 0;
}

.toast.ok .toast-dot {
  background: var(--green);
}

.toast.err .toast-dot {
  background: var(--red);
}

.toast-msg {
  flex: 1;
}

.feedback {
  padding: 12px;
  border-radius: 8px;
  font-size: 13px;
  display: none;
}

.feedback.ok {
  display: block;
  background: rgba(34, 197, 94, 0.1);
  border: 1px solid rgba(34, 197, 94, 0.2);
  color: var(--green);
}

.feedback.err {
  display: block;
  background: rgba(239, 68, 68, 0.1);
  border: 1px solid rgba(239, 68, 68, 0.2);
  color: var(--red);
}

.login-wrap {
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 24px;
}

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

.login-card-inner {
  padding: 48px 40px;
  text-align: center;
}

.login-title {
  font-size: 28px;
  font-weight: 700;
  margin-bottom: 8px;
}

.login-sub {
  font-size: 15px;
  color: var(--text-muted);
  margin-bottom: 32px;
}

.page-login .login-wrap {
  min-height: 100vh;
}

.page-login .login-card {
  background: rgba(22, 22, 34, 0.88);
  border: 1px solid rgba(168, 85, 247, 0.18);
  box-shadow:
    0 24px 48px rgba(0, 0, 0, 0.45),
    0 0 0 1px rgba(255, 255, 255, 0.04) inset;
  border-radius: var(--radius);
  backdrop-filter: blur(12px);
}

.login-logo {
  font-size: 52px;
  font-weight: 900;
  letter-spacing: -0.06em;
  line-height: 1;
  margin-bottom: 20px;
}

.login-logo .logo-l {
  color: #a855f7;
  text-shadow: 0 0 32px rgba(168, 85, 247, 0.5);
}

.login-tos-check {
  display: flex;
  align-items: flex-start;
  gap: 8px;
  margin: 10px 0 14px;
  cursor: pointer;
  font-size: 11px;
  color: var(--muted2);
  text-align: left;
}

.login-tos-check input {
  width: 14px;
  height: 14px;
  margin-top: 1px;
  accent-color: #7c3aed;
  flex-shrink: 0;
}

.login-tos-check a {
  color: #a9a3ff;
  text-decoration: none;
}

.login-tos-check a:hover {
  text-decoration: underline;
}

.login-discord-btn {
  position: relative;
  overflow: hidden;
  height: 44px;
  border-radius: var(--radius-sm);
  font-size: 13px;
  font-weight: 700;
  color: #fff !important;
  background: linear-gradient(100deg, #6d28d9 0%, #a855f7 45%, #c084fc 100%) !important;
  background-size: 200% 100%;
  box-shadow: 0 8px 28px rgba(124, 58, 237, 0.4);
  border: none;
  transition:
    transform 0.22s cubic-bezier(0.34, 1.45, 0.64, 1),
    box-shadow 0.28s ease,
    filter 0.22s ease,
    background-position 0.5s ease;
}

.login-discord-btn:hover {
  background-position: 100% 0 !important;
  box-shadow: 0 12px 36px rgba(168, 85, 247, 0.45), 0 0 40px rgba(192, 132, 252, 0.2);
  filter: brightness(1.06);
}

.login-discord-btn:active {
  transform: scale(0.98);
  transition-duration: 0.08s;
}

.login-discord-btn svg {
  fill: #fff;
}

.login-hint {
  margin-top: 12px;
  font-size: 11px;
  color: #7f8398;
}

.dash-wrap {
  max-width: 1400px;
  margin: 0 auto;
  padding: 32px 24px;
}

.dash-grid {
  display: grid;
  grid-template-columns: 300px 1fr;
  gap: 24px;
}

.dash-sidebar, .dash-main {
  display: flex;
  flex-direction: column;
  gap: 16px;
}

.dash-main .section-title {
  display: flex;
  align-items: center;
  gap: 10px;
  font-size: 15px;
  font-weight: 700;
  letter-spacing: -0.02em;
  color: var(--text);
  margin-bottom: 4px;
}

.dash-main .section-title svg {
  color: var(--purple);
  flex-shrink: 0;
  filter: drop-shadow(0 0 8px rgba(168, 85, 247, 0.35));
}

.dash-main .license-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(min(100%, 300px), 1fr));
  gap: 18px;
  margin-top: 14px;
}

.dash-main .license-card {
  position: relative;
  display: flex;
  flex-direction: column;
  background: linear-gradient(155deg, rgba(22, 22, 34, 0.98) 0%, rgba(14, 14, 22, 0.99) 100%);
  border: 1px solid rgba(168, 85, 247, 0.18);
  border-radius: 14px;
  padding: 20px;
  overflow: hidden;
  box-shadow:
    0 4px 24px rgba(0, 0, 0, 0.35),
    inset 0 1px 0 rgba(255, 255, 255, 0.04);
  transition: border-color 0.2s ease, box-shadow 0.2s ease, transform 0.2s ease;
}

.dash-main .license-card::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 3px;
  background: linear-gradient(90deg, #7c3aed, #a855f7, #c084fc);
  opacity: 0.9;
}

.dash-main .license-card:hover {
  border-color: rgba(168, 85, 247, 0.38);
  box-shadow:
    0 8px 32px rgba(124, 58, 237, 0.12),
    0 4px 24px rgba(0, 0, 0, 0.35);
  transform: translateY(-2px);
}

.dash-main .license-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 12px;
}

.dash-main .license-name {
  font-size: 18px;
  font-weight: 800;
  letter-spacing: -0.03em;
  line-height: 1.2;
  color: var(--text);
}

.dash-main .license-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 8px 14px;
  font-size: 12px;
  color: var(--muted2);
}

.dash-main .license-meta span:first-of-type {
  font-family: 'DM Mono', ui-monospace, monospace;
  font-weight: 600;
  color: #c4b5fd;
}

.dash-main .license-desc {
  font-size: 13px;
  line-height: 1.55;
  color: var(--text-muted);
  margin-top: 10px;
  padding-top: 12px;
  border-top: 1px solid rgba(255, 255, 255, 0.06);
}

.profile-card-body {
  text-align: center;
  padding: 32px 24px;
}

.profile-avatar {
  width: 80px;
  height: 80px;
  border-radius: 50%;
  border: 3px solid var(--purple);
  margin: 0 auto 16px;
}

.profile-name {
  font-size: 18px;
  font-weight: 600;
  margin-bottom: 4px;
}

.profile-since {
  font-size: 13px;
  color: var(--text-muted);
  margin-bottom: 16px;
}

.profile-stats {
  display: flex;
  background: var(--bg-elevated);
  border-radius: 8px;
  overflow: hidden;
  margin-top: 20px;
}

.pstat {
  flex: 1;
  padding: 12px;
  text-align: center;
}

.pstat-val {
  font-size: 20px;
  font-weight: 700;
  color: var(--purple);
}

.pstat-lbl {
  font-size: 11px;
  color: var(--text-muted);
  margin-top: 4px;
  text-transform: uppercase;
}

.pstat-div {
  width: 1px;
  background: var(--border);
}

.spinner {
  width: 16px;
  height: 16px;
  border: 2px solid rgba(255, 255, 255, 0.2);
  border-top-color: var(--purple);
  border-radius: 50%;
  animation: spin 0.6s linear infinite;
  display: inline-block;
}

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

.anim {
  opacity: 0;
  animation: fadeIn 0.4s ease forwards;
}

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

.anim-1 { animation-delay: 0.05s; }
.anim-2 { animation-delay: 0.1s; }
.anim-3 { animation-delay: 0.15s; }

.modal-bg {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.82);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  z-index: 1000;
  display: none;
  align-items: safe center;
  justify-content: center;
  padding: max(16px, env(safe-area-inset-top, 0px))
    max(20px, env(safe-area-inset-right, 0px))
    max(16px, env(safe-area-inset-bottom, 0px))
    max(20px, env(safe-area-inset-left, 0px));
  overflow-y: auto;
  overscroll-behavior: contain;
}

.modal-bg.open {
  display: flex;
  animation: modal-bg-in 0.2s ease-out;
}

@keyframes modal-bg-in {
  from { opacity: 0; }
  to { opacity: 1; }
}

.modal {
  background: var(--bg-card);
  border: 1px solid rgba(255, 255, 255, 0.12);
  border-radius: var(--radius);
  max-width: 600px;
  width: 100%;
  max-height: min(90vh, 100dvh - 32px);
  overflow-y: auto;
  overflow-x: hidden;
  margin: auto;
  box-shadow:
    0 0 0 1px rgba(168, 85, 247, 0.08),
    0 25px 50px -12px rgba(0, 0, 0, 0.65),
    0 0 80px -20px rgba(124, 58, 237, 0.35);
  flex-shrink: 0;
  animation: modal-sheet-in 0.25s cubic-bezier(0.34, 1.15, 0.64, 1);
}

@keyframes modal-sheet-in {
  from {
    opacity: 0;
    transform: translateY(12px) scale(0.98);
  }
  to {
    opacity: 1;
    transform: translateY(0) scale(1);
  }
}

/* Tall editor modals: scroll body, keep actions visible */
.modal.modal-sticky-footer {
  display: flex;
  flex-direction: column;
  overflow: hidden;
  max-height: min(90vh, 100dvh - 32px);
}

.modal.modal-sticky-footer > .modal-title {
  flex-shrink: 0;
}

.modal.modal-sticky-footer > .modal-body {
  flex: 1 1 auto;
  min-height: 0;
  overflow-y: auto;
  -webkit-overflow-scrolling: touch;
}

.modal.modal-sticky-footer > .modal-actions {
  flex-shrink: 0;
  margin-top: 0;
}

.modal-header {
  padding: 20px 24px;
  border-bottom: 1px solid var(--border);
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.modal-title {
  font-size: 18px;
  font-weight: 700;
  letter-spacing: -0.02em;
  margin: 0;
}

.modal-close {
  width: 32px;
  height: 32px;
  border-radius: 6px;
  background: var(--bg-elevated);
  border: 1px solid var(--border);
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  color: var(--text-muted);
  transition: all 0.2s;
}

.modal-close:hover {
  color: var(--text);
  border-color: var(--purple);
}

.modal-body {
  padding: 20px 24px;
}

.modal-actions {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: flex-end;
  gap: 10px;
  padding-top: 16px;
  margin-top: 4px;
}

.page-admin .modal:has(.modal-body) > .modal-title {
  padding: 20px 24px 16px;
  border-bottom: 1px solid var(--border);
  flex-shrink: 0;
}

.page-admin .modal:has(.modal-body) > .modal-body {
  padding: 20px 24px;
}

.page-admin .modal:has(.modal-body) > .modal-actions {
  padding: 16px 24px 20px;
  margin-top: 0;
  border-top: 1px solid var(--border);
  background: rgba(21, 21, 36, 0.65);
}

.page-admin .modal:not(:has(.modal-body)) > .modal-title {
  padding: 20px 24px 12px;
  border-bottom: 1px solid var(--border);
}

.page-admin .modal:not(:has(.modal-body)) > *:not(.modal-title):not(.modal-actions):not([type='hidden']) {
  padding-left: 24px;
  padding-right: 24px;
}

.page-admin .modal:not(:has(.modal-body)) > .modal-title ~ *:not(.modal-actions):not([type='hidden']) {
  padding-top: 4px;
}

.page-admin .modal:not(:has(.modal-body)) .form-group:first-of-type {
  padding-top: 16px;
}

.page-admin .modal:not(:has(.modal-body)) > .modal-actions {
  padding: 16px 24px 24px;
  margin-top: 8px;
  border-top: 1px solid var(--border);
  background: rgba(21, 21, 36, 0.5);
}

::-webkit-scrollbar {
  width: 8px;
  height: 8px;
}

::-webkit-scrollbar-track {
  background: var(--bg);
}

::-webkit-scrollbar-thumb {
  background: var(--bg-card);
  border-radius: 4px;
}

::-webkit-scrollbar-thumb:hover {
  background: var(--border);
}

/* ── Admin panel (.page-admin) ─────────────────────────────── */
.page-admin .layout {
  display: grid;
  grid-template-columns: 220px 1fr;
  min-height: calc(100vh - 64px);
  max-width: 1600px;
  margin: 0 auto;
  padding: 0 24px 32px;
  gap: 0;
  align-items: stretch;
  position: relative;
  z-index: 20;
}

.page-admin .sidebar {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius) 0 0 var(--radius);
  padding: 16px 12px;
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.page-admin .sidebar-label {
  font-size: 10px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--muted2);
  margin: 12px 8px 6px;
}

.page-admin .sidebar-label:first-child {
  margin-top: 4px;
}

.page-admin .nav-item {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 12px;
  border-radius: var(--radius-sm);
  font-size: 13px;
  font-weight: 500;
  color: var(--text-muted);
  cursor: pointer;
  transition: background 0.15s, color 0.15s;
  border: 1px solid transparent;
}

.page-admin .nav-item:hover {
  background: var(--bg-elevated);
  color: var(--text);
}

.page-admin .nav-item.active {
  background: rgba(168, 85, 247, 0.12);
  border-color: rgba(168, 85, 247, 0.25);
  color: var(--purple);
}

.page-admin .content {
  background: var(--surface2);
  border: 1px solid var(--border);
  border-left: none;
  border-radius: 0 var(--radius) var(--radius) 0;
  padding: 24px;
  overflow: auto;
}

.page-admin .panel {
  display: none;
}

.page-admin .panel.active {
  display: block;
}

.page-admin .panel-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 12px;
  margin-bottom: 20px;
}

.page-admin .panel-title {
  font-size: 20px;
  font-weight: 700;
}

.page-admin .stats-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 16px;
}

.page-admin .stat-card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 16px 18px;
  display: flex;
  align-items: center;
  gap: 14px;
}

.page-admin .stat-icon {
  width: 40px;
  height: 40px;
  border-radius: 10px;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

.page-admin .stat-val {
  font-size: 22px;
  font-weight: 800;
  line-height: 1.1;
}

.page-admin .stat-lbl {
  font-size: 11px;
  color: var(--muted2);
  text-transform: uppercase;
  letter-spacing: 0.04em;
  margin-top: 2px;
}

.page-admin .table-wrap {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  overflow-x: auto;
}

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

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

.page-admin .table-wrap th {
  font-size: 11px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--muted2);
  background: var(--bg-elevated);
}

.page-admin .loading {
  padding: 32px;
  text-align: center;
  color: var(--muted2);
}

.page-admin .form-group {
  margin-bottom: 16px;
}

.page-admin .form-group label {
  display: block;
  font-size: 12px;
  font-weight: 600;
  color: var(--muted2);
  margin-bottom: 6px;
}

.page-admin textarea.input {
  min-height: 88px;
  height: auto;
  padding-top: 12px;
  padding-bottom: 12px;
}

.page-admin .editor-toolbar {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  padding: 8px;
  background: var(--bg-elevated);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm) var(--radius-sm) 0 0;
  border-bottom: none;
}

.page-admin .editor-btn {
  min-width: 32px;
  height: 32px;
  padding: 0 8px;
  border-radius: 6px;
  border: 1px solid var(--border);
  background: var(--surface2);
  color: var(--text);
  cursor: pointer;
  font-size: 13px;
}

.page-admin .editor-content {
  min-height: 160px;
  max-height: 360px;
  overflow-y: auto;
  padding: 12px;
  background: var(--bg-elevated);
  border: 1px solid var(--border);
  border-radius: 0 0 var(--radius-sm) var(--radius-sm);
  outline: none;
}

.page-admin .modal-wide {
  max-width: 920px;
}

.btn-sm {
  height: 32px;
  padding: 0 12px;
  font-size: 12px;
}

.btn-danger {
  background: var(--red);
  color: #fff;
  box-shadow: 0 4px 14px rgba(239, 68, 68, 0.35);
}

.btn-danger:hover {
  filter: brightness(1.08);
  box-shadow: 0 8px 22px rgba(239, 68, 68, 0.4);
}

.btn-safe {
  background: var(--green);
  color: #0a0f0c;
  box-shadow: 0 4px 14px rgba(34, 197, 94, 0.3);
}

.btn-safe:hover {
  filter: brightness(1.05);
  box-shadow: 0 8px 22px rgba(34, 197, 94, 0.35);
}

.badge-yellow {
  background: rgba(245, 158, 11, 0.12);
  border: 1px solid rgba(245, 158, 11, 0.35);
  color: var(--yellow);
}

.badge-orange {
  background: rgba(249, 115, 22, 0.12);
  border: 1px solid rgba(249, 115, 22, 0.35);
  color: #fb923c;
}

.mono,
.input-mono {
  font-family: 'DM Mono', ui-monospace, monospace;
  font-size: 13px;
}

.card-pad {
  padding: 20px;
}

@media (max-width: 768px) {
  nav {
    padding: 0 16px;
  }
  
  .nav-username {
    display: none;
  }
  
  .dash-grid {
    grid-template-columns: 1fr;
  }
  
  .dash-wrap {
    padding: 16px;
  }

  .page-admin .layout {
    grid-template-columns: 1fr;
    padding: 0 12px 24px;
  }

  .page-admin .sidebar {
    flex-direction: row;
    flex-wrap: wrap;
    border-radius: var(--radius);
    border-right: 1px solid var(--border);
    margin-bottom: 12px;
  }

  .page-admin .content {
    border-left: 1px solid var(--border);
    border-radius: var(--radius);
  }

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

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