﻿@import url('https://fonts.googleapis.com/css2?family=Playfair+Display:wght@600&family=Space+Grotesk:wght@400;500;600;700&display=swap');

:root {
  --bg: #0b0e14;
  --bg-accent: #121826;
  --ink: #f5f6fb;
  --muted: #b0b7c3;
  --accent: #ff7a1a;
  --accent-dark: #c95b00;
  --accent-soft: rgba(255, 122, 26, 0.18);
  --card: #141a28;
  --line: rgba(245, 246, 251, 0.12);
  --shadow: 0 24px 70px rgba(0, 0, 0, 0.45);
}

* {
  box-sizing: border-box;
}

body.page {
  margin: 0;
  font-family: "Space Grotesk", "Apple SD Gothic Neo", "Malgun Gothic", sans-serif;
  color: var(--ink);
  background: radial-gradient(circle at top right, rgba(255, 122, 26, 0.18) 0%, transparent 40%),
    radial-gradient(circle at 20% 20%, rgba(96, 165, 250, 0.18) 0%, transparent 45%),
    linear-gradient(135deg, var(--bg) 0%, var(--bg-accent) 100%);
  min-height: 100vh;
}

.bg-grid {
  position: fixed;
  inset: 0;
  background-image: linear-gradient(rgba(245, 246, 251, 0.06) 1px, transparent 1px),
    linear-gradient(90deg, rgba(245, 246, 251, 0.06) 1px, transparent 1px);
  background-size: 28px 28px;
  opacity: 0.28;
  pointer-events: none;
}

.page-shell {
  width: min(1600px, 96vw);
  max-width: 1600px;
  margin: 0 auto;
  padding: 28px 16px 64px;
  position: relative;
  z-index: 1;
  animation: fadeUp 0.6s ease;
}

.topbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
}

.main-topbar {
  justify-content: flex-end;
  margin-bottom: 12px;
}

.brand {
  display: flex;
  align-items: center;
  gap: 12px;
  font-weight: 900;
  letter-spacing: 0.6px;
  text-transform: uppercase;
}

.brand img {
  width: 60px;
  height: 60px;
  object-fit: contain;
  border-radius: 12px;
  background: #0f1422;
  padding: 6px;
  box-shadow: var(--shadow);
}

.brand span {
  font-size: 14px;
}

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

.avatar {
  width: 42px;
  height: 42px;
  border-radius: 50%;
  object-fit: cover;
  border: 1px solid rgba(255, 255, 255, 0.18);
  box-shadow: 0 6px 18px rgba(0, 0, 0, 0.35);
}

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 12px 20px;
  border-radius: 999px;
  text-decoration: none;
  border: 1px solid transparent;
  font-weight: 600;
  transition: transform 0.2s ease, box-shadow 0.2s ease, background 0.2s ease;
}

.btn.btn-sm {
  padding: 6px 12px;
  font-size: 12px;
}

.btn .btn-icon {
  width: 25px;
  height: 25px;
  object-fit: contain;
  flex-shrink: 0;
}

.btn.primary {
  background: #5865f2;
  color: #fff;
  box-shadow: 0 12px 24px rgba(88, 101, 242, 0.35);
}

.btn.primary:hover {
  background: #4752c4;
  transform: translateY(-1px);
}

.btn.ghost {
  background: rgba(20, 26, 40, 0.7);
  border-color: var(--line);
  color: var(--ink);
}

.btn.ghost:hover {
  transform: translateY(-1px);
  box-shadow: 0 12px 24px rgba(27, 31, 42, 0.12);
}

.hero {
  display: flex;
  flex-direction: column;
  gap: 10px;
  margin-top: 48px;
  align-items: center;
  text-align: center;
}

.landing {
  min-height: 70vh;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 28px;
}

.main-layout {
  display: grid;
  grid-template-columns: 1fr;
  gap: 18px;
  align-items: start;
}

.side-tab {
  display: flex;
  flex-direction: row;
  flex-wrap: nowrap;
  justify-content: center;
  align-items: center;
  gap: 10px;
  padding: 12px 16px;
  border-radius: 18px;
  border: 1px solid var(--line);
  background: rgba(20, 26, 40, 0.55);
  position: sticky;
  top: 20px;
  width: 100%;
  min-height: 64px;
  overflow-x: auto;
  height: 64px;
  overflow-y: hidden;
}

.side-link {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  align-self: center;
  text-decoration: none;
  color: var(--muted);
  font-size: 13px;
  padding: 9px 14px;
  border-radius: 999px;
  border: 1px solid var(--line);
  background: rgba(10, 14, 22, 0.55);
  transition: background 0.2s ease, color 0.2s ease, border-color 0.2s ease, transform 0.2s ease;
}

.side-link:hover {
  color: var(--ink);
  border-color: rgba(88, 101, 242, 0.5);
  background: rgba(88, 101, 242, 0.12);
  transform: translateY(-1px);
}

.side-link.active {
  color: var(--ink);
  border-color: rgba(88, 101, 242, 0.7);
  background: rgba(88, 101, 242, 0.22);
}

.side-group {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 6px 10px;
  border-radius: 999px;
  border: 1px solid var(--line);
  background: rgba(10, 14, 22, 0.45);
  flex-wrap: nowrap;
  transition: padding 0.2s ease, background 0.2s ease, border-color 0.2s ease;
}

.side-group-label {
  cursor: pointer;
  border: 1px solid var(--line);
  font-size: 12px;
  color: var(--muted);
  padding: 6px 10px;
  border-radius: 999px;
  background: rgba(10, 14, 22, 0.5);
  font-weight: 600;
}

.side-group-items {
  display: inline-flex;
  gap: 8px;
  flex-wrap: nowrap;
  max-width: 0;
  min-width: 0;
  width: 0;
  opacity: 0;
  overflow: hidden;
  transform: translateX(-6px);
  transition: max-width 0.25s ease, opacity 0.2s ease, transform 0.2s ease;
}

.side-group.collapsed .side-group-items {
  max-width: 0;
  width: 0;
  opacity: 0;
  pointer-events: none;
  transform: translateX(-6px);
}

.side-group.collapsed {
  padding: 0;
  border-color: transparent;
  background: transparent;
  gap: 0;
}

.side-group:not(.collapsed) .side-group-items {
  max-width: 520px;
  width: auto;
  opacity: 1;
  transform: translateX(0);
}

@media (max-width: 900px) {
  .side-tab {
    flex-wrap: wrap;
    overflow-x: visible;
  }

  .side-group {
    flex-wrap: wrap;
  }
}

.logo-spotlight {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 8px;
  margin-bottom: 2px;
  text-align: center;
}

.logo-spotlight img {
  width: 520px;
  height: 520px;
  max-width: 80vw;
  max-height: 80vw;
  object-fit: contain;
  padding: 0;
  border-radius: 0;
  background: transparent;
  box-shadow: none;
  border: none;
}

.logo-spotlight span {
  font-weight: 600;
  letter-spacing: 0.4px;
  text-transform: uppercase;
  color: var(--muted);
  line-height: 1.2;
}

.ranking-panel {
  background: #020617;
  border: 1px solid #1f2937;
  border-radius: 16px;
  padding: 20px;
  color: #e5e7eb;
}

.ranking-panel h3 {
  margin: 0 0 8px;
  color: #93c5fd;
  font-family: "Orbitron", sans-serif;
  font-size: 1rem;
}

.ranking-panel p {
  margin: 0;
  color: #9ca3af;
}

.ranking-panel--frame {
  padding: 0;
  overflow: hidden;
}

.ranking-frame {
  width: 100%;
  height: 80vh;
  min-height: 640px;
  border: none;
  display: block;
  background: #020617;
}

.hero-copy {
  position: relative;
  padding: 0;
}

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

.hero-copy h1 {
  font-family: "Playfair Display", "Times New Roman", serif;
  font-size: 52px;
  line-height: 1.05;
  margin: 16px 0;
}

.sub {
  color: var(--muted);
  font-size: 18px;
  line-height: 1.6;
  margin-bottom: 24px;
  max-width: 560px;
  margin-left: auto;
  margin-right: auto;
}

.cta {
  display: flex;
  gap: 12px;
  align-items: center;
  flex-wrap: wrap;
  justify-content: center;
}

.status {
  background: rgba(255, 122, 26, 0.12);
  border: 1px solid rgba(255, 122, 26, 0.35);
  padding: 10px 16px;
  border-radius: 999px;
  font-weight: 600;
}


.user-chip {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 8px 12px;
  background: rgba(20, 26, 40, 0.7);
  border-radius: 999px;
  border: 1px solid var(--line);
}

.user-chip img {
  width: 28px;
  height: 28px;
  border-radius: 50%;
}

.login,
.license {
  display: flex;
  justify-content: center;
  align-items: center;
  min-height: 60vh;
}

.login-card,
.license-card {
  background: var(--card);
  padding: 40px;
  border-radius: 28px;
  box-shadow: var(--shadow);
  border: 1px solid var(--line);
  max-width: 420px;
  text-align: center;
}

.login-logo {
  width: 160px;
  height: 160px;
  object-fit: contain;
  margin-bottom: 16px;
  padding: 0;
  border-radius: 0;
  background: transparent;
  border: none;
}

.notice {
  margin-top: 20px;
  padding: 14px 16px;
  border-radius: 16px;
  background: rgba(255, 122, 26, 0.12);
  border: 1px solid rgba(255, 122, 26, 0.3);
  text-align: left;
}

.notice-error {
  text-align: center;
}

.notice-success {
  background: rgba(88, 101, 242, 0.12);
  border-color: rgba(88, 101, 242, 0.35);
  text-align: center;
}

.license-form {
  margin-top: 16px;
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.license-form input {
  padding: 12px 14px;
  border-radius: 12px;
  border: 1px solid var(--line);
  background: rgba(20, 26, 40, 0.7);
  color: var(--ink);
  font-size: 16px;
}

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

.license-form input:focus {
  outline: none;
  border-color: rgba(88, 101, 242, 0.6);
  box-shadow: 0 0 0 3px rgba(88, 101, 242, 0.2);
}

.admin {
  display: flex;
  justify-content: center;
  align-items: center;
  min-height: 60vh;
}

.admin-card {
  width: min(1400px, 96vw);
  background: var(--card);
  padding: 36px;
  border-radius: 28px;
  box-shadow: var(--shadow);
  border: 1px solid var(--line);
}

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

.admin-header-actions {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
}

.admin-header h1 {
  margin: 0 0 6px;
}

.admin-header p {
  margin: 0;
  color: var(--muted);
}

.admin-table-wrap {
  margin-top: 16px;
  overflow-x: auto;
  border-radius: 16px;
  border: 1px solid var(--line);
}

.admin-table {
  width: 100%;
  border-collapse: collapse;
  min-width: 640px;
}

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

.admin-table thead {
  background: rgba(20, 26, 40, 0.7);
}

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

.admin-section {
  margin-top: 28px;
}

.admin-user-filter {
  margin: 12px 0 8px;
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.admin-user-label {
  color: var(--muted);
  font-size: 13px;
}

.admin-user-list {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}

.admin-pager {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-top: 12px;
  flex-wrap: wrap;
}

.admin-pager-info {
  color: var(--muted);
  font-size: 13px;
}

.admin-pager-links {
  display: flex;
  align-items: center;
  gap: 6px;
  flex-wrap: wrap;
}

.btn.is-disabled {
  opacity: 0.5;
  pointer-events: none;
}

.admin-form {
  display: flex;
  align-items: flex-end;
  gap: 12px;
  flex-wrap: wrap;
}

.admin-form label {
  display: flex;
  flex-direction: column;
  gap: 6px;
  font-size: 13px;
  color: var(--muted);
}

.admin-form input {
  padding: 10px 12px;
  border-radius: 10px;
  border: 1px solid var(--line);
  background: rgba(20, 26, 40, 0.7);
  color: var(--ink);
  min-width: 160px;
}

.profile {
  display: flex;
  justify-content: center;
  align-items: center;
  min-height: 60vh;
}

.profile-card {
  width: min(640px, 94vw);
  background: var(--card);
  padding: 36px;
  border-radius: 28px;
  box-shadow: var(--shadow);
  border: 1px solid var(--line);
}

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

.profile-header h1 {
  margin: 0 0 6px;
}

.profile-header p {
  margin: 0;
  color: var(--muted);
}

.profile-banner {
  margin: 12px 0 18px;
  height: 160px;
  border-radius: 20px;
  background: linear-gradient(135deg, rgba(88, 101, 242, 0.18), rgba(255, 122, 26, 0.18));
  border: 1px solid var(--line);
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--muted);
  font-size: 12px;
  text-transform: uppercase;
  letter-spacing: 1px;
}

.profile-banner.has-banner {
  background-size: cover;
  background-position: center;
}

.profile-user {
  display: flex;
  align-items: center;
  gap: 16px;
  margin-bottom: 18px;
}

.profile-avatar {
  width: 72px;
  height: 72px;
  border-radius: 18px;
  overflow: hidden;
  border: 1px solid var(--line);
  background: rgba(20, 26, 40, 0.7);
  display: flex;
  align-items: center;
  justify-content: center;
}

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

.profile-info h2 {
  margin: 0 0 6px;
}

.profile-info p {
  margin: 0;
  color: var(--muted);
  font-size: 14px;
}

.profile-license {
  margin: 12px 0 20px;
  padding: 16px;
  border-radius: 18px;
  border: 1px solid var(--line);
  background: rgba(20, 26, 40, 0.7);
}

.profile-license h3 {
  margin: 0 0 12px;
}

.profile-note {
  margin: 8px 0 0;
  color: var(--muted);
  font-size: 13px;
}

.program-token-actions {
  margin-top: 10px;
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.program-token-box {
  margin-top: 12px;
  padding: 12px 14px;
  border-radius: 12px;
  border: 1px dashed var(--line);
  background: rgba(10, 14, 22, 0.6);
  font-family: "Space Grotesk", monospace;
  letter-spacing: 1px;
  word-break: break-all;
}

.program-token-meta {
  margin-top: 8px;
  color: var(--muted);
  font-size: 12px;
}

.program-token-error {
  margin-top: 8px;
  font-size: 13px;
  color: #ffb37a;
}

.program-token-error.is-ok {
  color: #7ef2b7;
}

.license-row {
  display: flex;
  justify-content: space-between;
  color: var(--muted);
  margin-bottom: 8px;
}

.status-pill {
  padding: 4px 10px;
  border-radius: 999px;
  font-size: 12px;
  letter-spacing: 1px;
}

.status-pill.ok {
  background: rgba(24, 179, 110, 0.18);
  color: #7ef2b7;
}

.status-pill.warn {
  background: rgba(255, 122, 26, 0.2);
  color: #ffb37a;
}

.status-pill.off {
  background: rgba(120, 128, 150, 0.2);
  color: #c7cdd8;
}

.profile-form {
  display: flex;
  flex-direction: column;
  gap: 14px;
  margin-top: 12px;
}

.profile-form label {
  display: flex;
  flex-direction: column;
  gap: 6px;
  color: var(--muted);
  font-size: 13px;
}

.profile-form input,
.profile-form textarea {
  padding: 12px 14px;
  border-radius: 12px;
  border: 1px solid var(--line);
  background: rgba(20, 26, 40, 0.7);
  color: var(--ink);
  font-size: 16px;
}

.profile-form textarea {
  resize: vertical;
}

.profile-danger {
  margin-top: 18px;
  display: flex;
  justify-content: flex-end;
}

.btn.danger {
  background: #d64545;
  color: #fff;
  border-color: transparent;
  box-shadow: 0 10px 20px rgba(214, 69, 69, 0.3);
}

.btn.danger:hover {
  background: #b83b3b;
}

.notice strong {
  display: block;
  margin-bottom: 6px;
}

.link {
  color: var(--accent-dark);
  text-decoration: none;
  font-weight: 600;
}

.error {
  display: flex;
  justify-content: center;
  align-items: center;
  min-height: 60vh;
}

.error-card {
  background: var(--card);
  padding: 36px;
  border-radius: 24px;
  box-shadow: var(--shadow);
  border: 1px solid var(--line);
  max-width: 480px;
  text-align: center;
}

@keyframes floatIn {
  from {
    transform: translateY(12px);
    opacity: 0;
  }
  to {
    transform: translateY(0);
    opacity: 1;
  }
}

@keyframes fadeUp {
  from {
    transform: translateY(10px);
    opacity: 0;
  }
  to {
    transform: translateY(0);
    opacity: 1;
  }
}

@media (max-width: 900px) {
  .main-layout {
    grid-template-columns: 1fr;
  }

  .side-tab {
    position: static;
    flex-direction: row;
    justify-content: center;
    flex-wrap: wrap;
  }

  .logo-spotlight img {
    width: 300px;
    height: 300px;
  }

  .topbar {
    flex-direction: column;
    align-items: flex-start;
  }
}

/* === Tabs + Content (Main Page) === */
.content-area {
  display: flex;
  flex-direction: column;
  gap: 20px;
  min-height: 60vh;
}

.tab-content {
  display: none;
  animation: fadeUp 0.4s ease;
}

.tab-content.active {
  display: block;
}

.side-link {
  background: transparent;
  border: 1px solid transparent;
  cursor: pointer;
  text-align: left;
  font-family: inherit;
}
