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

:root {
  color-scheme: dark;
  --bg: #0b0f14;
  --panel: #111825;
  --panel-2: #0f1724;
  --json-background: rgb(29, 43, 67);
  --border: #1f2a3a;
  --text: #d1d8e2;
  --muted: #9fb0c4;
  --accent: #2d5c70;
  --accent-hover: #1e3f4d;
  --still-training: #f59e0b;
  --danger: #fb7185;
  --danger-border: rgba(251, 113, 133, 0.6);
  --success: #34d399;
  --shadow: 0 10px 30px rgba(3, 8, 20, 0.5);
  --topbar-height: 75px;
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  font-family: "Space Grotesk", system-ui, -apple-system, sans-serif;
  background: radial-gradient(1200px 800px at 10% 0%, #0f1724, #0b0f14);
  color: var(--text);
  overflow: hidden;
}

a {
  color: var(--accent);
  text-decoration: none;
}

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 10px 16px;
  border-radius: 10px;
  border: 1px solid transparent;
  background: var(--accent);
  color: var(--text);
  font: inherit;
  text-decoration: none;
  cursor: pointer;
}

.btn:hover {
  background: var(--accent-hover);
}

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

.btn.secondary:hover {
  background: var(--panel-2);
}

.btn-spinner {
  width: 16px;
  height: 16px;
  border-radius: 999px;
  border: 2px solid rgba(27, 18, 0, 0.4);
  border-top-color: rgba(27, 18, 0, 1);
  display: none;
  animation: spin 0.8s linear infinite;
}

.btn.is-loading .btn-text {
  display: none;
}

.btn.is-loading .btn-spinner {
  display: inline-block;
}

.page {
  min-height: 100vh;
  display: grid;
  grid-template-rows: var(--topbar-height) 1fr;
  height: 100vh;
}

.topbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 20px 32px;
  border-bottom: 1px solid var(--border);
  background:
    radial-gradient(760px 240px at 12% -42%, rgba(56, 189, 248, 0.04), transparent 70%),
    rgba(11, 15, 20, 0.72);
  backdrop-filter: blur(14px);
  height: var(--topbar-height);
  position: sticky;
  top: 0;
  z-index: 20;
}

.brand {
  display: flex;
  align-items: center;
  gap: 12px;
  font-weight: 600;
}

.sidebar-toggle {
  width: 20px;
  height: 40px;
  /* border-radius: 10px; */
  border-radius: 10px 0px 0px 10px;
  border: 1px solid var(--border);
  border-right: none;
  background: var(--panel);
  color: var(--text);
  z-index: 2000;
  display: grid;
  place-items: center;
  cursor: pointer;
  box-shadow: var(--shadow);
  transition: background 0.2s ease, border-color 0.2s ease, transform 0.2s ease;
}

.sidebar-toggle:hover {
  background: var(--accent);
}

.sidebar-toggle-icon {
  width: 10px;
  height: 10px;
  transition: transform 0.2s ease;
}

.page.sidebar-collapsed .sidebar-toggle-icon {
  transform: rotate(180deg);
}

.brand-mark {
  width: 60px;
  /* height: 45px; */
  /* border-radius: 10px; */
  /* background: linear-gradient(135deg, var(--accent), #0ea5e9); */
  display: grid;
  place-items: center;
  overflow: hidden;
}

.brand-logo {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.brand-text {
  font-size: 18px;
  letter-spacing: 0.3px;
}

.beta-badge {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 3px 8px;
  border-radius: 999px;
  border: 1px solid rgba(56, 189, 248, 0.45);
  background: rgba(56, 189, 248, 0.14);
  color: #7dd3fc;
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.main-layout {
  display: grid;
  grid-template-columns: 240px 1fr;
  flex: 1;
  overflow: hidden;
  height: 100%;
  position: relative;
  min-height: 0;
}

.page.sidebar-collapsed .main-layout {
  grid-template-columns: 72px 1fr;
}

.page.sidebar-collapsed .nav-item {
  font-size: 0;
  gap: 0;
  justify-content: center;
}

.page.sidebar-collapsed .nav-icon {
  margin: 0;
}

@media (max-width: 1024px) {
  .page.sidebar-collapsed .main-layout {
    grid-template-columns: 72px 1fr;
  }

  .page.sidebar-collapsed .nav-item {
    font-size: 0;
    gap: 0;
    justify-content: center;
  }

  .page.sidebar-collapsed .nav-icon {
    margin: 0;
  }
}

.sidebar {
  background:
    radial-gradient(620px 420px at -100% 50%, rgba(56, 189, 248, 0.08), transparent 74%),
    var(--panel);
  border-right: 1px solid var(--border);
  display: flex;
  flex-direction: column;
  /* padding: 24px 0; */
  padding-top: 12px;
  height: 100%;
  overflow-y: auto;
  position: relative;
  z-index: 2100;
  min-height: 0;
}

.sidebar-toggle-wrap {
  position: absolute;
  top: 46%;
  right: 0;
  transform: translateY(-50%);
  z-index: 2100;
}
.sidebar-nav {
  display: flex;
  flex-direction: column;
  gap: 4px;
  padding: 0 12px;
}

.nav-group {
  display: flex;
  flex-direction: column;
  gap: 4px;
  margin-bottom: 12px;
}

.nav-group:last-child {
  margin-bottom: 0;
}

.nav-category {
  font-size: 11px;
  font-weight: 500;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--muted);
  padding: 0 16px;
  height: 24px;
  display: flex;
  align-items: center;
  flex-shrink: 0;
}

.page.sidebar-collapsed .nav-category {
  font-size: 0;
  overflow: hidden;
  color: transparent;
  user-select: none;
}

.nav-item {
  display: flex;
  align-items: center;
  gap: 32px;
  padding: 0 16px;
  min-height: 44px;
  border-radius: 10px;
  color: var(--text);
  text-decoration: none;
  font-weight: 500;
  line-height: 20px;
  transition: background 0.2s;
}

.page.sidebar-collapsed .nav-item {
  font-size: 0;
  gap: 0;
  justify-content: center;
}

.page.sidebar-collapsed .nav-icon {
  margin: 0;
}

.nav-icon {
  width: 20px;
  height: 20px;
  flex-shrink: 0;
}

.nav-item:hover {
  background: var(--accent);
}

.nav-item.active {
  background: rgba(56, 189, 248, 0.1);
  color: var(--accent);
  border-left: 3px solid var(--accent);
  padding-left: 13px;
}

.sidebar-footer {
  margin-top: auto;
  padding: 12px;
  border-top: 1px solid var(--border);
}

.sidebar-footer .nav-item {
  margin: 0;
}

.content {
  /* padding: 0px 32px; */
  display: flex;
  flex-direction: column;
  align-items: stretch;
  justify-content: start;
  overflow-y: auto;
  /* height: 100%; */
  position: relative;
  z-index: 1;
  min-height: 0;
  background:
    radial-gradient(1100px 520px at 8% -18%, rgba(56, 189, 248, 0.07), transparent 62%),
    radial-gradient(1200px 560px at 102% 0%, rgba(37, 99, 235, 0.06), transparent 64%),
    linear-gradient(180deg, #0b0f14 0%, #0a111b 100%);
  padding: 0px
  /* border: 1px solid blue; */
}

.card {
  width: min(720px, 100%);
  background: var(--panel);
  border: 1px solid var(--border);
  border-radius: 18px;
  padding: 28px;
  box-shadow: var(--shadow);
}

.card h1,
.card h2,
.card h3 {
  margin-top: 0;
}

.muted {
  color: var(--muted);
}


.input {
  width: 100%;
  padding: 12px 14px;
  border-radius: 10px;
  border: 1px solid var(--border);
  background: var(--panel-2);
  color: var(--text);
}

.stack {
  display: flex;
  flex-direction: column;
  gap: 16px;
}

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

.contact-icon-button {
  border: none;
  background: transparent;
  color: var(--muted);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  padding: 0;
  margin-right: 8px;
}

.contact-icon-button:hover {
  color: var(--text);
}

.contact-icon {
  width: 18px;
  height: 18px;
}

.profile-menu {
  position: relative;
}

.profile-button {
  width: 40px;
  height: 40px;
  border-radius: 999px;
  border: 1px solid var(--border);
  background: var(--panel);
  color: var(--text);
  display: grid;
  place-items: center;
  cursor: pointer;
}

.profile-button:hover {
  background: var(--accent);
}

.profile-icon {
  width: 20px;
  height: 20px;
}

.profile-dropdown {
  position: absolute;
  right: 0;
  top: 100%;
  min-width: 180px;
  background: var(--panel);
  border: 1px solid var(--border);
  border-radius: 12px;
  box-shadow: var(--shadow);
  padding: 8px;
  display: flex;
  flex-direction: column;
  gap: 4px;
  opacity: 0;
  transform: translateY(-6px);
  pointer-events: none;
  transition: opacity 0.15s ease, transform 0.15s ease;
}

.profile-menu:hover .profile-dropdown,
.profile-menu:focus-within .profile-dropdown {
  opacity: 1;
  transform: translateY(0);
  pointer-events: auto;
}

.profile-item {
  padding: 10px 12px;
  border-radius: 8px;
  color: var(--text);
  font-weight: 500;
}

.profile-item-button {
  width: 100%;
  text-align: left;
  background: transparent;
  border: none;
  cursor: pointer;
  font: inherit;
}

.profile-item:hover {
  background: var(--accent);
}

.auth-page {
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  align-items: center;
  padding: 40px 24px 60px;
  gap: 24px;
}

.auth-logo img {
  width: 120px;
  height: auto;
  display: block;
}

.auth-container {
  width: 100%;
  padding: 0;
  display: flex;
  justify-content: center;
}

.auth-card {
  width: min(420px, 100%);
}

.auth-form input,
.auth-form select,
.auth-form textarea {
  width: 100%;
  padding: 12px 14px;
  border-radius: 10px;
  border: 1px solid var(--border);
  background: var(--panel-2);
  color: var(--text);
}

.auth-form input:focus,
.auth-form select:focus,
.auth-form textarea:focus {
  outline: 2px solid rgba(56, 189, 248, 0.35);
  outline-offset: 2px;
}

.auth-field {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.auth-label {
  color: var(--muted);
  font-size: 14px;
}

.auth-checkbox {
  display: flex;
  align-items: center;
  gap: 10px;
}

.auth-checkbox input[type="checkbox"] {
  width: auto;
  margin: 0;
}

.auth-checkbox-label {
  color: var(--muted);
  font-size: 14px;
}

.auth-error {
  color: var(--danger);
  font-size: 13px;
}

.auth-links {
  margin-top: 12px;
}


.detail-layout {
  width: calc(100% - 120px);
  margin: 60px;
  height: auto;
  align-self: stretch;
  display: flex;
  flex-direction: column;
  gap: 16px;
}

.back-link {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  color: var(--muted);
  font-weight: 500;
}

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

.back-icon {
  width: 28px;
  height: 28px;
  border-radius: 999px;
  border: 1px solid var(--border);
  display: grid;
  place-items: center;
}

.detail-card {
  background: var(--panel);
  border: 1px solid var(--border);
  border-radius: 18px;
  padding: 24px;
  box-shadow: var(--shadow);
}

.detail-card-header h2 {
  margin: 0 0 12px;
}

.detail-card-body {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.detail-row {
  display: grid;
  grid-template-columns: 180px 1fr;
  gap: 16px;
  padding: 10px 0;
  align-items: center;
  border-bottom: 1px solid var(--border);
}

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

.detail-label {
  color: var(--muted);
  font-size: 13px;
  text-transform: uppercase;
  letter-spacing: 0.04em;
}

.detail-value {
  color: var(--text);
}

.create-page-id-row {
  margin-top: 8px;
  display: inline-flex;
  align-items: center;
  gap: 0;
  flex-wrap: wrap;
  padding: 4px 0;
}

.create-page-id-code {
  font-size: 12px;
  /* font-weight: 600; */
  color: #8c98ab;
  padding: 6px 10px;
  border: 1px solid #728095;
  border-right: 0;
  border-radius: 8px 0 0 8px;
  background: rgba(148, 163, 184, 0.12);
}

.create-page-id-copy-btn {
  padding: 6px 10px;
  line-height: 1;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border-radius: 0 8px 8px 0;
  border: 1px solid #728095 !important;
  border-left: none !important;
}


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


