:root {
  --sidebar-width: 260px;
}

body {
  background: var(--surface);
  font-family: "Segoe UI", system-ui, -apple-system, sans-serif;
}

.brand-mark {
  width: 36px;
  height: 36px;
  border-radius: 10px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  background: linear-gradient(145deg, var(--brand), var(--brand-dark));
  color: #fff;
  font-size: 1.1rem;
}

.sidebar {
  width: var(--sidebar-width);
  min-height: 100vh;
  background: var(--panel);
  position: sticky;
  top: 0;
  flex-shrink: 0;
}

.sidebar-nav .nav-section {
  font-size: 0.7rem;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: #6c757d;
  padding: 0.85rem 0.75rem 0.35rem;
}

.sidebar-nav .nav-link {
  display: flex;
  align-items: center;
  gap: 0.6rem;
  border-radius: 0.5rem;
  color: inherit;
  padding: 0.55rem 0.75rem;
  margin-bottom: 0.15rem;
}

.sidebar-nav .nav-link:hover,
.sidebar-nav .nav-link.active {
  background: var(--nav-hover-bg);
  color: var(--nav-active-color);
}

.topbar {
  background: var(--panel);
  position: sticky;
  top: 0;
  z-index: 20;
}

.stat-tile {
  background: var(--panel);
  border: 1px solid rgba(0,0,0,0.06);
  border-radius: 0.85rem;
  padding: 1rem 1.1rem;
  height: 100%;
}

.stat-tile .value {
  font-size: 1.6rem;
  font-weight: 700;
  line-height: 1.2;
}

.panel {
  background: var(--panel);
  border: 1px solid rgba(0,0,0,0.06);
  border-radius: 0.85rem;
  padding: 1.25rem;
}

.status-badge {
  font-size: 0.75rem;
  font-weight: 600;
  padding: 0.3rem 0.55rem;
  border-radius: 0.4rem;
}

.status-CONNECTED { background: #d1f2eb; color: #0b6b5d; }
.status-QR_REQUIRED { background: #fff3cd; color: #856404; }
.status-DISCONNECTED, .status-LOGGED_OUT { background: #f8d7da; color: #842029; }
.status-CONNECTING, .status-INITIALIZING { background: #cff4fc; color: #055160; }
.status-ERROR { background: #f8d7da; color: #842029; }

[data-bs-theme="dark"] .status-CONNECTED { background: #134e4a; color: #99f6e4; }
[data-bs-theme="dark"] .status-QR_REQUIRED { background: #713f12; color: #fde68a; }
[data-bs-theme="dark"] .status-DISCONNECTED,
[data-bs-theme="dark"] .status-LOGGED_OUT,
[data-bs-theme="dark"] .status-ERROR { background: #7f1d1d; color: #fecaca; }

.auth-body {
  min-height: 100vh;
  background: var(--auth-bg);
}

.auth-wrap {
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 1.5rem;
}

.auth-card {
  width: 100%;
  max-width: 440px;
  background: var(--panel);
  border-radius: 1rem;
  padding: 1.75rem;
  box-shadow: 0 10px 40px rgba(0,0,0,0.06);
  border: 1px solid rgba(0,0,0,0.05);
}

.install .auth-card,
.container .auth-card {
  max-width: none;
}

.qr-box {
  width: 260px;
  max-width: 100%;
  aspect-ratio: 1;
  border: 1px dashed rgba(0,0,0,0.15);
  border-radius: 0.75rem;
  display: flex;
  align-items: center;
  justify-content: center;
  background: #fff;
  margin: 0 auto;
  overflow: hidden;
}

.qr-box img {
  width: 100%;
  height: 100%;
  object-fit: contain;
}

.empty-state {
  text-align: center;
  padding: 2.5rem 1rem;
  color: #6c757d;
}

@media (max-width: 991.98px) {
  .sidebar {
    position: fixed;
    left: 0;
    top: 0;
    z-index: 1040;
    transform: translateX(-100%);
    transition: transform 0.2s ease;
  }
  .sidebar.open {
    transform: translateX(0);
  }
}
