:root {
  --bg: #06070a;
  --panel: rgba(255, 255, 255, 0.04);
  --panel-border: rgba(255, 255, 255, 0.08);
  --text: #e9ecf2;
  --muted: #9aa3b5;
  --accent: #7dd3fc;
  --accent-2: #a78bfa;
  --danger: #f87171;
  --success: #34d399;
  --shadow: 0 20px 80px rgba(0, 0, 0, 0.45);
  --radius: 14px;
  --grid-gap: 22px;
  --container-width: 1100px;
  font-family: "Space Grotesk", "Inter", system-ui, -apple-system, sans-serif;
}

*,
*::before,
*::after {
  box-sizing: border-box;
}

body {
  margin: 0;
  background: radial-gradient(circle at 20% 20%, rgba(125, 211, 252, 0.08), transparent 25%),
    radial-gradient(circle at 80% 0%, rgba(167, 139, 250, 0.12), transparent 30%),
    var(--bg);
  color: var(--text);
  min-height: 100vh;
}

a {
  color: inherit;
  text-decoration: none;
}

.container {
  width: min(100%, var(--container-width));
  margin: 0 auto;
  padding: 0 18px;
}

.site-header {
  position: sticky;
  top: 0;
  z-index: 50;
  backdrop-filter: blur(12px);
  background: rgba(6, 7, 10, 0.6);
  border-bottom: 1px solid var(--panel-border);
}

.header-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  height: 64px;
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  font-weight: 700;
  letter-spacing: 0.5px;
}

.brand-mark {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 32px;
  height: 32px;
  border-radius: 10px;
  background: linear-gradient(135deg, rgba(125, 211, 252, 0.5), rgba(167, 139, 250, 0.6));
  color: #0b0c10;
  font-weight: 800;
  box-shadow: var(--shadow);
}

.nav {
  display: flex;
  gap: 16px;
}

.nav a {
  padding: 10px 14px;
  border-radius: 12px;
  transition: all 0.2s ease;
  color: var(--muted);
}

.nav a:hover {
  color: var(--text);
  background: var(--panel);
  border: 1px solid var(--panel-border);
}

.site-main {
  padding: 32px 0 80px;
}

.site-footer {
  padding: 32px 0 48px;
  color: var(--muted);
  border-top: 1px solid var(--panel-border);
  background: rgba(6, 7, 10, 0.65);
}

.hero {
  padding: 28px;
  border-radius: var(--radius);
  background: linear-gradient(145deg, rgba(125, 211, 252, 0.12), rgba(167, 139, 250, 0.1));
  border: 1px solid var(--panel-border);
  box-shadow: var(--shadow);
  margin-bottom: 32px;
}

.hero.compact {
  margin-bottom: 24px;
}

.hero h1 {
  margin: 6px 0 8px;
  font-size: clamp(1.8rem, 2.6vw, 2.5rem);
  letter-spacing: -0.02em;
}

.lede {
  color: var(--muted);
  margin: 0 0 14px;
}

.eyebrow {
  text-transform: uppercase;
  letter-spacing: 0.14em;
  font-size: 12px;
  color: var(--accent);
}

.hero-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  margin-top: 8px;
}

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 12px 16px;
  border-radius: 12px;
  font-weight: 600;
  border: 1px solid transparent;
  cursor: pointer;
  background: transparent;
  color: var(--text);
  transition: transform 0.15s ease, box-shadow 0.15s ease, border-color 0.15s ease, background 0.15s ease;
}

.btn.primary {
  background: linear-gradient(135deg, #67e8f9, #a78bfa);
  color: #0b0c10;
  box-shadow: 0 10px 40px rgba(103, 232, 249, 0.3);
}

.btn.ghost {
  border-color: var(--panel-border);
  background: rgba(255, 255, 255, 0.02);
}

.btn:hover {
  transform: translateY(-1px);
}

.panel-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(320px, 1fr));
  gap: var(--grid-gap);
}

.panel {
  background: var(--panel);
  border: 1px solid var(--panel-border);
  border-radius: var(--radius);
  padding: 22px;
  box-shadow: var(--shadow);
}

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

.panel h2 {
  margin: 4px 0 0;
}

.badge {
  display: inline-flex;
  align-items: center;
  padding: 6px 10px;
  border-radius: 10px;
  background: rgba(125, 211, 252, 0.18);
  color: var(--text);
  border: 1px solid rgba(125, 211, 252, 0.4);
  font-size: 12px;
}

.badge.neutral {
  background: rgba(154, 163, 181, 0.16);
  border-color: rgba(154, 163, 181, 0.25);
}

.badge.ghost {
  background: rgba(255, 255, 255, 0.08);
  border-color: var(--panel-border);
}

.form-group {
  display: flex;
  flex-direction: column;
  gap: 6px;
  margin-bottom: 14px;
}

.form-group label {
  color: var(--muted);
  font-weight: 600;
}

textarea,
input,
select {
  width: 100%;
  border-radius: 12px;
  border: 1px solid var(--panel-border);
  background: rgba(255, 255, 255, 0.03);
  color: var(--text);
  padding: 12px;
  font-size: 15px;
}

textarea:focus,
input:focus,
select:focus {
  outline: 1px solid rgba(125, 211, 252, 0.5);
}

textarea {
  resize: vertical;
}

.form-row {
  display: grid;
  gap: 14px;
  grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
}

.range-labels {
  display: flex;
  justify-content: space-between;
  color: var(--muted);
  font-size: 12px;
}

.form-actions {
  display: flex;
  gap: 12px;
  flex-wrap: wrap;
  margin-top: 6px;
}

.preview-area {
  margin-bottom: 16px;
}

.preview-frame {
  border-radius: 18px;
  border: 1px dashed var(--panel-border);
  background: rgba(255, 255, 255, 0.02);
  min-height: 240px;
  display: grid;
  place-items: center;
  text-align: center;
  padding: 24px;
  color: var(--muted);
}

.preview-placeholder span {
  display: block;
  font-weight: 700;
  color: var(--text);
}

.preview-placeholder small {
  color: var(--muted);
}

.log {
  border-top: 1px solid var(--panel-border);
  padding-top: 12px;
}

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

.log-list {
  list-style: none;
  padding: 0;
  margin: 0;
  display: grid;
  gap: 8px;
}

.log-list li {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  color: var(--muted);
}

.dot {
  width: 10px;
  height: 10px;
  border-radius: 50%;
  background: linear-gradient(135deg, var(--accent), var(--accent-2));
}

.login-panel {
  max-width: 480px;
  margin: 60px auto;
}

.alert {
  padding: 12px 14px;
  border-radius: 10px;
  margin-bottom: 14px;
  border: 1px solid var(--panel-border);
  color: var(--muted);
  background: rgba(255, 255, 255, 0.05);
}

.alert.error {
  border-color: rgba(248, 113, 113, 0.4);
  color: #fecdd3;
  background: rgba(248, 113, 113, 0.08);
}

.admin-grid .queue-list {
  list-style: none;
  padding: 0;
  margin: 0 0 14px;
  display: grid;
  gap: 10px;
}

.queue-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  padding: 12px;
  border: 1px solid var(--panel-border);
  border-radius: 12px;
  background: rgba(255, 255, 255, 0.03);
}

.item-title {
  font-weight: 600;
}

.status.pill {
  padding: 6px 12px;
  border-radius: 999px;
  border: 1px solid rgba(125, 211, 252, 0.35);
  color: var(--accent);
}

.status.ghost {
  border-color: var(--panel-border);
  color: var(--muted);
}

.table-scroll {
  overflow: auto;
}

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

.data-table th,
.data-table td {
  padding: 10px;
  text-align: left;
  border-bottom: 1px solid var(--panel-border);
}

.data-table th {
  color: var(--muted);
  font-weight: 600;
}

.data-table code {
  background: rgba(255, 255, 255, 0.04);
  padding: 4px 6px;
  border-radius: 6px;
}

.muted {
  color: var(--muted);
  margin-top: 8px;
}

.small-pre {
  font-size: 12px;
  white-space: pre-wrap;
  word-break: break-word;
  margin: 6px 0 0;
}

.spinner {
  width: 14px;
  height: 14px;
  border-radius: 50%;
  border: 2px solid rgba(255, 255, 255, 0.4);
  border-top-color: rgba(255, 255, 255, 0.9);
  animation: spin 0.7s linear infinite;
  display: inline-block;
}

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

.gallery-grid {
  display: grid;
  gap: 16px;
  grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
}

.gallery-card {
  background: rgba(255, 255, 255, 0.02);
  border: 1px solid var(--panel-border);
  border-radius: 14px;
  overflow: hidden;
  display: flex;
  flex-direction: column;
}

.gallery-thumb {
  background: #0f1117;
  display: grid;
  place-items: center;
  min-height: 180px;
}

.gallery-thumb img {
  width: 100%;
  display: block;
  object-fit: cover;
}

.gallery-meta {
  padding: 12px 14px 14px;
}

.gallery-name {
  font-weight: 700;
  margin-bottom: 6px;
}

.modal-backdrop {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.55);
  backdrop-filter: blur(6px);
  z-index: 200;
}

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

.modal {
  position: fixed;
  inset: 0;
  display: grid;
  place-items: center;
  z-index: 201;
  padding: 16px;
}

.modal-content {
  background: rgba(12, 14, 20, 0.9);
  border: 1px solid var(--panel-border);
  border-radius: 16px;
  box-shadow: var(--shadow);
  display: grid;
  grid-template-columns: 2fr 1fr;
  gap: 0;
  max-width: 1100px;
  width: min(1100px, 100%);
  overflow: hidden;
}

.modal-media {
  background: #0f1117;
  display: grid;
  place-items: center;
  padding: 16px;
}

.modal-media img {
  width: 100%;
  height: auto;
  display: block;
  object-fit: contain;
  border-radius: 12px;
}

.modal-meta {
  padding: 16px;
  border-left: 1px solid var(--panel-border);
  display: grid;
  gap: 10px;
}

.modal-row {
  display: grid;
  gap: 2px;
}

.model-panel {
  margin-top: 32px;
}

.model-grid {
  display: grid;
  gap: 16px;
  grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
}

.model-card {
  border: 1px solid var(--panel-border);
  border-radius: 14px;
  background: rgba(255, 255, 255, 0.02);
  overflow: hidden;
  display: flex;
  flex-direction: column;
  min-height: 260px;
}

.model-thumb {
  position: relative;
  height: 180px;
  background: linear-gradient(135deg, rgba(125, 211, 252, 0.12), rgba(167, 139, 250, 0.12));
  overflow: hidden;
}

.model-thumb-overlay {
  position: absolute;
  inset: 0;
  background: radial-gradient(circle at 30% 20%, rgba(125, 211, 252, 0.15), transparent 35%),
    radial-gradient(circle at 70% 0%, rgba(167, 139, 250, 0.15), transparent 40%);
}

.model-thumb-title {
  position: absolute;
  bottom: 12px;
  left: 14px;
  font-weight: 700;
}

.model-thumb-example-img {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  z-index: 1;
}

.model-thumb::after {
  content: "";
  position: absolute;
  inset: 0;
  background: linear-gradient(180deg, transparent 50%, rgba(6, 7, 10, 0.65) 95%);
  z-index: 2;
}

.model-thumb-title {
  z-index: 3;
}

.model-body {
  padding: 14px;
  display: grid;
  gap: 8px;
}

.model-name {
  font-weight: 700;
}

.model-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}

.pill {
  display: inline-flex;
  align-items: center;
  padding: 4px 8px;
  border-radius: 999px;
  border: 1px solid var(--panel-border);
  font-size: 12px;
  color: var(--muted);
}

@media (max-width: 900px) {
  .modal-content {
    grid-template-columns: 1fr;
  }
  .modal-meta {
    border-left: none;
    border-top: 1px solid var(--panel-border);
  }
}
@media (max-width: 768px) {
  .header-inner {
    gap: 12px;
  }
  .nav a {
    padding: 10px 10px;
  }
  .panel-grid {
    grid-template-columns: 1fr;
  }
  .hero {
    padding: 22px;
  }
  .site-main {
    padding-top: 20px;
  }
}
