:root {
  --bg: #0f1117;
  --panel: #171a23;
  --panel-2: #1f2430;
  --text: #f4f6fb;
  --muted: #9ca3af;
  --border: rgba(255, 255, 255, 0.09);
  --accent: #ff3b7f;
  --accent-2: #8b5cf6;
  --danger: #ef4444;
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  min-height: 100vh;
  background:
    radial-gradient(circle at top left, rgba(255, 59, 127, 0.18), transparent 34%),
    radial-gradient(circle at bottom right, rgba(139, 92, 246, 0.18), transparent 38%),
    var(--bg);
  color: var(--text);
  font-family: Arial, Helvetica, sans-serif;
}

.shell {
  min-height: 100vh;
}

.header {
  min-height: 78px;
  padding: 18px 28px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 18px;
  border-bottom: 1px solid var(--border);
  background: rgba(15, 17, 23, 0.86);
  backdrop-filter: blur(14px);
}

.brand {
  display: flex;
  align-items: center;
  gap: 14px;
}

.brand-logo {
  width: 46px;
  height: 46px;
  display: grid;
  place-items: center;
  border-radius: 16px;
  background: linear-gradient(135deg, var(--accent), var(--accent-2));
  color: white;
  font-size: 24px;
  font-weight: 800;
}

.brand-title {
  font-size: 20px;
  font-weight: 800;
}

.brand-subtitle {
  color: var(--muted);
  font-size: 13px;
}

.top-nav {
  display: flex;
  gap: 10px;
  padding: 14px 28px;
  border-bottom: 1px solid var(--border);
  background: rgba(15, 17, 23, 0.58);
  overflow-x: auto;
}

.nav-item {
  border: 1px solid transparent;
  border-radius: 999px;
  padding: 11px 16px;
  background: rgba(255, 255, 255, 0.04);
  color: var(--muted);
  font-size: 14px;
  cursor: pointer;
  white-space: nowrap;
}

.nav-item:hover {
  color: var(--text);
  background: rgba(255, 255, 255, 0.08);
}

.nav-item.active {
  color: white;
  border-color: rgba(255, 255, 255, 0.14);
  background: linear-gradient(135deg, rgba(255, 59, 127, 0.4), rgba(139, 92, 246, 0.32));
}

.main {
  padding: 28px;
}

.page-head {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 18px;
  margin-bottom: 24px;
}

h1,
h2,
p {
  margin-top: 0;
}

h1 {
  margin-bottom: 8px;
  font-size: 34px;
}

h2 {
  margin-bottom: 10px;
}

p {
  color: var(--muted);
  line-height: 1.6;
}

.user-pill,
.phase-pill {
  display: inline-flex;
  align-items: center;
  min-height: 34px;
  padding: 8px 12px;
  border: 1px solid var(--border);
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.05);
  color: var(--muted);
  font-size: 13px;
  white-space: nowrap;
}

.dashboard-grid {
  display: grid;
  grid-template-columns: 1fr 320px;
  gap: 18px;
  margin-bottom: 18px;
}

.hero-card,
.info-card,
.card {
  border: 1px solid var(--border);
  border-radius: 22px;
  padding: 24px;
  background: rgba(23, 26, 35, 0.84);
  box-shadow: 0 20px 80px rgba(0, 0, 0, 0.22);
}

.hero-card h2 {
  font-size: 28px;
}

.info-label {
  color: var(--muted);
  font-size: 13px;
  margin-bottom: 8px;
}

.info-value {
  font-size: 32px;
  font-weight: 800;
  margin-bottom: 10px;
}

.module-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 18px;
}

.module-card {
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  min-height: 210px;
}

.small-button,
.primary-link {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 42px;
  padding: 0 16px;
  border: 0;
  border-radius: 13px;
  background: linear-gradient(135deg, var(--accent), var(--accent-2));
  color: white;
  text-decoration: none;
  font-weight: 700;
  cursor: pointer;
}

.module-layout {
  display: grid;
  gap: 14px;
}

.module-header-card {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 18px;
}

.iframe-note {
  color: var(--muted);
  font-size: 13px;
}

.iframe-shell {
  min-height: 720px;
  overflow: hidden;
  border: 1px solid var(--border);
  border-radius: 22px;
  background: var(--panel);
}

iframe {
  width: 100%;
  height: 720px;
  border: 0;
  background: white;
}

.empty-state {
  display: grid;
  place-items: center;
  min-height: 320px;
  color: var(--muted);
}

.error {
  border-color: rgba(239, 68, 68, 0.4);
}

@media (max-width: 1100px) {
  .dashboard-grid {
    grid-template-columns: 1fr;
  }

  .module-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .module-header-card {
    flex-direction: column;
    align-items: flex-start;
  }
}

@media (max-width: 700px) {
  .header,
  .page-head {
    flex-direction: column;
    align-items: flex-start;
  }

  .module-grid {
    grid-template-columns: 1fr;
  }

  .main {
    padding: 18px;
  }
}

.status-badge {
  display: inline-flex;
  align-items: center;
  min-height: 28px;
  padding: 6px 10px;
  border-radius: 999px;
  font-size: 12px;
  font-weight: 800;
  white-space: nowrap;
}

.status-ready {
  color: #bbf7d0;
  background: rgba(34, 197, 94, 0.16);
  border: 1px solid rgba(34, 197, 94, 0.26);
}

.status-transition {
  color: #fde68a;
  background: rgba(245, 158, 11, 0.16);
  border: 1px solid rgba(245, 158, 11, 0.26);
}

.status-auth {
  color: #fecaca;
  background: rgba(239, 68, 68, 0.16);
  border: 1px solid rgba(239, 68, 68, 0.26);
}

.status-unknown {
  color: var(--muted);
  background: rgba(255, 255, 255, 0.06);
  border: 1px solid var(--border);
}

.module-card-top,
.module-title-row {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 14px;
}

.module-note {
  color: #c7cad1;
}

.module-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin: 14px 0 18px;
}

.module-meta span {
  display: inline-flex;
  align-items: center;
  min-height: 28px;
  padding: 6px 10px;
  border-radius: 999px;
  color: var(--muted);
  background: rgba(255, 255, 255, 0.05);
  font-size: 12px;
}

.module-meta-large {
  margin-bottom: 0;
}

.phase-card {
  border: 1px solid var(--border);
  border-radius: 22px;
  padding: 22px;
  margin-bottom: 18px;
  background: rgba(23, 26, 35, 0.74);
}

.phase-list {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 12px;
}

.phase-list div {
  padding: 14px;
  border-radius: 16px;
  background: rgba(255, 255, 255, 0.05);
}

.phase-list strong,
.phase-list span {
  display: block;
}

.phase-list span {
  color: var(--muted);
  margin-top: 6px;
  font-size: 13px;
}

.warning-box {
  border: 1px solid rgba(239, 68, 68, 0.26);
  border-radius: 16px;
  padding: 14px 16px;
  color: #fecaca;
  background: rgba(239, 68, 68, 0.1);
}

.warning-box.soft {
  border-color: rgba(245, 158, 11, 0.26);
  color: #fde68a;
  background: rgba(245, 158, 11, 0.1);
}

@media (max-width: 1100px) {
  .phase-list {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

@media (max-width: 700px) {
  .phase-list {
    grid-template-columns: 1fr;
  }

  .module-card-top,
  .module-title-row {
    flex-direction: column;
  }
}

.hidden {
  display: none !important;
}

.login-panel {
  display: grid;
  place-items: center;
  min-height: 520px;
}

.login-card {
  width: min(420px, 100%);
  border: 1px solid var(--border);
  border-radius: 24px;
  padding: 26px;
  background: rgba(23, 26, 35, 0.88);
  box-shadow: 0 20px 80px rgba(0, 0, 0, 0.28);
}

.login-card form {
  display: grid;
  gap: 12px;
  margin-top: 18px;
}

.login-card input {
  width: 100%;
  min-height: 44px;
  border: 1px solid var(--border);
  border-radius: 14px;
  padding: 0 14px;
  background: rgba(255, 255, 255, 0.06);
  color: var(--text);
  font-size: 15px;
}

.login-card button,
.logout-button {
  min-height: 38px;
  border: 0;
  border-radius: 12px;
  padding: 0 14px;
  background: linear-gradient(135deg, var(--accent), var(--accent-2));
  color: white;
  font-weight: 800;
  cursor: pointer;
}

.login-error {
  min-height: 22px;
  margin-top: 14px;
  color: #fecaca;
}

.logout-button {
  margin-left: 10px;
  min-height: 28px;
  font-size: 12px;
}

.user-pill {
  gap: 10px;
  flex-wrap: wrap;
}

.creator-control {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  min-height: 30px;
  padding: 4px 8px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.05);
}

.creator-control span {
  color: var(--muted);
  font-size: 12px;
}

.creator-control strong {
  color: var(--text);
  font-size: 13px;
}

.creator-control select {
  min-height: 28px;
  border: 1px solid var(--border);
  border-radius: 999px;
  padding: 0 10px;
  background: rgba(15, 17, 23, 0.9);
  color: var(--text);
}
