:root {
  --bg: #000000;
  --panel: #121212;
  --panel-2: #1a1a1a;
  --text: #ffffff;
  --text-secondary: #d1d5db;
  --line: #333333;
  --blue: #3b82f6;
}
* { box-sizing: border-box; }
*::-webkit-scrollbar { width: 6px; height: 6px; }
*::-webkit-scrollbar-track { background: #000000; }
*::-webkit-scrollbar-thumb { background: #1e293b; border-radius: 999px; }
body {
  margin: 0;
  font-family: Inter, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  background: var(--bg);
  color: var(--text);
}

.header {
  position: sticky;
  top: 0;
  z-index: 15;
  background: var(--panel);
  border-bottom: 1px solid var(--line);
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 14px 24px;
}
.header-left { display: flex; align-items: baseline; gap: 10px; }
.header-left h1 { margin: 0; font-size: 24px; }
.header-left span { color: var(--text-secondary); font-size: 12px; }
.header-center {
  position: absolute;
  left: 50%;
  transform: translateX(-50%);
}
.brand-chip {
  background: #0f172a;
  border: 1px solid #1e3a5f;
  border-radius: 999px;
  height: 36px;
  min-width: 156px;
  display: grid;
  place-items: center;
  padding: 0 14px;
  box-shadow: 0 8px 20px rgba(0, 0, 0, 0.45);
}
.brand-chip img {
  height: 17px;
  width: auto;
  display: block;
}
.header-right { display: flex; align-items: center; gap: 8px; }
.header-status {
  display: flex;
  flex-direction: column;
  gap: 2px;
  font-size: 11px;
  color: var(--text-secondary);
  background: #0f172a;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 6px 8px;
}
.header-status strong {
  color: #ffffff;
}
.auth-badge {
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  gap: 2px;
  font-size: 11px;
  color: var(--text-secondary);
}
.auth-badge strong { font-size: 12px; color: #ffffff; }
.hidden { display: none !important; }

.sidebar {
  position: fixed;
  top: 62px;
  left: 0;
  width: 320px;
  height: calc(100vh - 62px);
  overflow-y: auto;
  background: var(--panel);
  color: var(--text);
  border-right: 1px solid var(--line);
  padding: 18px;
}
.sidebar h2 { margin: 0 0 14px; font-size: 18px; }
.config-group { margin-bottom: 14px; }
.config-label {
  display: block;
  font-size: 12px;
  font-weight: 700;
  color: var(--text-secondary);
  margin-bottom: 6px;
  text-transform: uppercase;
  letter-spacing: 0.03em;
}
input, textarea, select, button {
  width: 100%;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 10px;
  font-size: 13px;
  font-family: inherit;
  background: #000000;
  color: #e5e7eb;
}
textarea { resize: vertical; }

.logo-preview {
  margin-top: 8px;
  min-height: 130px;
  border: 1px dashed var(--line);
  border-radius: 8px;
  display: grid;
  place-items: center;
  color: var(--text-secondary);
  background: #0a0a0a;
  overflow: hidden;
  padding: 8px;
}
.logo-preview img { max-width: 100%; max-height: 120px; display: block; }

.grid-selector {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 6px;
}
.selector-item {
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 10px 8px;
  cursor: pointer;
  text-align: center;
  font-size: 11px;
  font-weight: 600;
  background: var(--panel-2);
  color: var(--text-secondary);
  transition: border-color 0.2s, background-color 0.2s, color 0.2s;
}
.selector-item:hover { border-color: #4b5563; }
.selector-item.active {
  border-color: var(--blue);
  background: var(--blue);
  color: #ffffff;
  box-shadow: 0 0 0 2px rgba(59, 130, 246, 0.22) inset;
}

.color-row { display: flex; gap: 8px; margin: 8px 0; }
.color-dot {
  width: 26px;
  height: 26px;
  border-radius: 999px;
  border: 2px solid transparent;
  cursor: pointer;
}
.color-dot.active { border-color: var(--blue); }

.chip-row { display: flex; gap: 8px; flex-wrap: wrap; }
.chip {
  border: 1px solid var(--line);
  border-radius: 999px;
  padding: 7px 10px;
  font-size: 12px;
  cursor: pointer;
  background: var(--panel-2);
  color: #d1d5db;
}
.chip.active {
  border-color: var(--blue);
  background: var(--blue);
  color: #ffffff;
}

.button-group { display: grid; grid-template-columns: 1fr; gap: 8px; }
.btn-primary {
  background: var(--blue);
  color: #fff;
  border-color: var(--blue);
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.03em;
}
.btn-secondary {
  width: auto;
  padding: 8px 10px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--panel-2);
  color: #e5e7eb;
  transition: border-color 0.2s, background-color 0.2s;
}
.btn-secondary:hover { border-color: #4b5563; background: #222222; }
.status { font-size: 12px; color: #94a3b8; margin: 6px 0 0; }

.main-content {
  margin-left: 320px;
  padding: 14px 20px 20px;
  max-width: calc(100vw - 320px);
  min-height: calc(100vh - 62px);
}
.admin-page {
  padding: 20px;
}
.main-head { margin-bottom: 12px; }
.main-head h2 { margin: 0; }

.card {
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: 12px;
  padding: 14px;
  margin-bottom: 14px;
}
.result-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 8px;
}
.result-head h3 {
  margin: 0;
}
.preview {
  width: 100%;
  aspect-ratio: 16 / 9;
  max-height: 74vh;
  border: 1px dashed var(--line);
  border-radius: 10px;
  background: #050505;
  display: grid;
  place-items: center;
  overflow: hidden;
  padding: 12px;
}
.render-media {
  width: 100%;
  height: 100%;
  object-fit: contain;
  object-position: center;
  display: block;
}
.table-wrap {
  overflow: auto;
  border: 1px solid var(--line);
  border-radius: 10px;
}
.admin-table {
  width: 100%;
  border-collapse: collapse;
  min-width: 900px;
}
.admin-table th,
.admin-table td {
  border-bottom: 1px solid var(--line);
  padding: 10px;
  font-size: 13px;
  text-align: left;
  vertical-align: middle;
}
.admin-table th {
  background: #0f1a2b;
  color: #cbd5e1;
}
.admin-table td input,
.admin-table td select {
  width: 100%;
}
.actions-cell {
  display: flex;
  gap: 8px;
}

.modal-overlay {
  position: fixed;
  inset: 0;
  background: rgba(15, 23, 42, 0.66);
  backdrop-filter: blur(4px);
  z-index: 60;
  display: none;
  align-items: center;
  justify-content: center;
  padding: 16px;
}
.modal-overlay.show { display: flex; }
.modal-content {
  width: 100%;
  max-width: 560px;
  background: var(--panel);
  border-radius: 16px;
  border: 1px solid var(--line);
  padding: 28px;
  text-align: center;
}
.auth-modal {
  max-width: 420px;
  text-align: left;
}
.auth-modal h2 {
  font-size: 24px;
  margin: 0 0 6px;
}
.auth-hint {
  margin: 8px 0 14px;
  padding: 8px 10px;
  border-radius: 8px;
  border: 1px solid #2a3a50;
  background: #111c2f;
  color: #bfdbfe;
  font-size: 12px;
}
.auth-actions {
  margin-top: 10px;
}
.auth-page {
  min-height: 100vh;
  margin: 0;
  background: radial-gradient(circle at 20% 10%, #111827, #000000 40%, #000000 100%);
}
.auth-shell {
  min-height: 100vh;
  display: grid;
  place-items: center;
  padding: 20px;
}
.auth-card {
  width: 100%;
  max-width: 460px;
  border: 1px solid var(--line);
  border-radius: 16px;
  background: var(--panel);
  box-shadow: 0 20px 50px rgba(15, 23, 42, 0.12);
  padding: 22px;
}
.auth-brand {
  display: grid;
  grid-template-columns: auto 1fr;
  gap: 12px;
  align-items: center;
  margin-bottom: 10px;
}
.auth-brand-logo {
  width: 46px;
  height: 46px;
  border-radius: 12px;
  background: #0f172a;
  border: 1px solid var(--line);
  display: grid;
  place-items: center;
}
.auth-brand-logo img {
  width: 34px;
  height: auto;
}
.auth-kicker {
  margin: 0 0 4px;
  font-size: 11px;
  color: #137fec;
  font-weight: 700;
  letter-spacing: 0.06em;
  text-transform: uppercase;
}
.auth-card h1 {
  margin: 0 0 2px;
  font-size: 38px;
  line-height: 0.95;
}
.auth-sub {
  margin: 0;
  color: #a5b4c8;
  font-size: 13px;
}
.auth-block {
  display: grid;
  gap: 10px;
  margin-top: 12px;
}
.auth-error {
  margin: 0 0 8px;
  color: #b91c1c;
  background: #2b1111;
  border: 1px solid #7f1d1d;
  border-radius: 8px;
  padding: 8px 10px;
  font-size: 12px;
}
.modal-logo {
  margin-bottom: 10px;
}
.modal-logo img {
  height: 17px;
  width: auto;
  display: block;
  margin: 0 auto;
}
.modal-content h2 {
  margin: 0;
  font-size: 30px;
  font-weight: 800;
  line-height: 1.1;
  color: #f8fafc;
}
.modal-content p {
  margin: 8px 0 20px;
  color: #94a3b8;
}
.loading-dots {
  display: inline-flex;
  gap: 8px;
  margin-bottom: 20px;
}
.loading-dots span {
  width: 10px;
  height: 10px;
  border-radius: 999px;
  background: #137fec;
  animation: pulse-custom 1.4s infinite;
}
.loading-dots span:nth-child(2) { animation-delay: 0.2s; opacity: 0.65; }
.loading-dots span:nth-child(3) { animation-delay: 0.4s; opacity: 0.35; }
.modal-card {
  border: 1px solid #2a3a50;
  background: #101b2c;
  border-radius: 12px;
  padding: 14px;
}
.modal-card img {
  width: 100%;
  height: auto;
  max-height: 210px;
  object-fit: cover;
  border-radius: 10px;
  margin-bottom: 10px;
}
.modal-card blockquote {
  margin: 0;
  font-size: 14px;
  font-style: italic;
  color: #dbeafe;
}
.quote-by {
  margin-top: 8px;
  font-size: 12px;
  color: #94a3b8;
}
.modal-foot {
  margin-top: 12px;
  font-size: 11px;
  color: #64748b;
}


@keyframes pulse-custom {
  0%, 100% { opacity: 1; }
  50% { opacity: 0.3; }
}

@media (max-width: 1100px) {
  .header {
    padding-top: 52px;
  }
  .header-center {
    top: 10px;
  }
  .sidebar {
    position: static;
    width: 100%;
    height: auto;
    border-right: 0;
    border-bottom: 1px solid var(--line);
  }
  .main-content {
    margin-left: 0;
    max-width: 100%;
  }
  .preview {
    max-height: none;
  }
}
