:root {
  --green: #1dd1a1;
  --blue: #0b6efd;
  --red: #ff6b6b;
  --bg-dark: rgba(5, 10, 25, 0.85);
  --text-light: #f8f9fa;
  --card-bg: rgba(15, 20, 40, 0.9);
  --border-soft: rgba(255, 255, 255, 0.08);
  --radius: 14px;
}

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

html,
body {
  margin: 0;
  padding: 0;
  height: 100%;
  font-family: system-ui, -apple-system, BlinkMacSystemFont, "SF Pro Text",
    "Segoe UI", sans-serif;
  color: var(--text-light);
}

body {
  background: #050816;
}

.page-bg {
  position: fixed;
  inset: 0;
  width: 100%;
  height: 100%;
  background-image: url("../assets/bg-index.jpg");
  background-size: cover;
  background-position: center center;
  background-repeat: no-repeat;
  z-index: -2;
}

body::before {
  content: "";
  position: fixed;
  inset: 0;
  background: radial-gradient(circle at top, rgba(11, 110, 253, 0.4), transparent),
              radial-gradient(circle at bottom, rgba(29, 209, 161, 0.35), transparent),
              rgba(5, 8, 22, 0.9);
  z-index: -1;
}

.app-header,
.app-footer {
  padding: 0.75rem 1rem;
  display: flex;
  align-items: center;
  justify-content: space-between;
  backdrop-filter: blur(16px);
  background: linear-gradient(
    to bottom,
    rgba(5, 10, 25, 0.9),
    rgba(5, 10, 25, 0.6)
  );
  border-bottom: 1px solid var(--border-soft);
}

.app-footer {
  border-top: 1px solid var(--border-soft);
  border-bottom: none;
  justify-content: center;
  font-size: 0.75rem;
  opacity: 0.8;
}

.brand {
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.logo-dot {
  width: 18px;
  height: 18px;
  border-radius: 999px;
  background: conic-gradient(from 180deg, var(--green), var(--blue), var(--red));
  box-shadow: 0 0 12px rgba(11, 110, 253, 0.8);
}

.brand h1 {
  font-size: 1.1rem;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  margin: 0;
}

#top-nav {
  display: flex;
  gap: 0.5rem;
  overflow-x: auto;
}

#top-nav a {
  color: var(--text-light);
  text-decoration: none;
  font-size: 0.8rem;
  padding: 0.35rem 0.7rem;
  border-radius: 999px;
  border: 1px solid transparent;
  background: rgba(15, 20, 40, 0.7);
  white-space: nowrap;
}

#top-nav a.active {
  border-color: var(--blue);
  background: linear-gradient(135deg, rgba(11, 110, 253, 0.9), rgba(29, 209, 161, 0.8));
}

#view-root {
  padding: 0.75rem;
  min-height: calc(100vh - 110px);
}

.panel {
  max-width: 960px;
  margin: 0 auto;
  background: var(--bg-dark);
  border-radius: var(--radius);
  padding: 1rem;
  border: 1px solid var(--border-soft);
  box-shadow: 0 18px 40px rgba(0, 0, 0, 0.45);
}

.panel h2 {
  margin-top: 0;
  font-size: 1.2rem;
}

.panel p {
  font-size: 0.9rem;
  opacity: 0.9;
}

.card-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 0.75rem;
  margin-top: 0.75rem;
}

.card {
  background: var(--card-bg);
  border-radius: var(--radius);
  padding: 0.75rem;
  border: 1px solid var(--border-soft);
  font-size: 0.85rem;
}

.card h3 {
  margin-top: 0;
  font-size: 1rem;
}

.card.open {
  border-color: var(--green);
}

.card.full {
  border-color: var(--red);
}

.card.unknown {
  border-color: var(--blue);
}

button {
  font: inherit;
  border-radius: 999px;
  border: 1px solid transparent;
  padding: 0.4rem 0.9rem;
  cursor: pointer;
  background: var(--blue);
  color: #fff;
}

button.secondary {
  background: transparent;
  border-color: var(--border-soft);
}

.conflict {
  color: var(--red);
}

@media (min-width: 768px) {
  .app-header,
  .app-footer {
    padding-inline: 1.5rem;
  }

  #view-root {
    padding: 1.25rem;
  }
}
.portal-status {
  margin-left: 1rem;
  font-size: 0.85rem;
  color: #ccc;
}

.portal-status.connected {
  color: #4ade80;
}

.portal-status.connecting {
  color: #facc15;
}

.portal-status.error {
  color: #f97373;
}

.connect-portal {
  background: rgba(0,0,0,0.6);
  padding: 2rem;
  border-radius: 12px;
  max-width: 700px;
  margin: 2rem auto;
  color: white;
}

.connect-portal ol {
  margin: 1rem 0;
  padding-left: 1.5rem;
}

.connect-actions {
  margin-top: 1rem;
  display: flex;
  gap: 1rem;
  flex-wrap: wrap;
}

.btn-primary,
.btn-secondary {
  display: inline-block;
  padding: 0.75rem 1.5rem;
  border-radius: 8px;
  text-decoration: none;
  font-weight: bold;
  border: none;
  cursor: pointer;
}

.btn-primary {
  background: #0b6efd;
  color: white;
}

.btn-secondary {
  background: #111827;
  color: #e5e7eb;
}

.connect-status .error {
  color: #f97373;
}
