/* ── Reset ── */
*,
*::before,
*::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

/* ── Tokens ── */
:root {
  --bg: #0d0f18;
  --surface: #151825;
  --surface2: #1e2235;
  --border: #2a2f4a;
  --accent: #4f8ef7;
  --accent-hover: #3a7de0;
  --success: #3ecf8e;
  --warn: #f5a623;
  --text: #e6e9f4;
  --text-muted: #6b739e;
  --sidebar-w: 260px;
  --radius: 14px;
  --radius-sm: 9px;
  --shadow: 0 8px 32px rgba(0, 0, 0, 0.5);
  --transition: 0.25s ease;
}

/* ── Base ── */
html,
body {
  height: 100%;
}

body {
  font-family: "Be Vietnam Pro", "Arial", sans-serif;
  background: var(--bg);
  color: var(--text);
  min-height: 100vh;
  display: flex;
  overflow-x: hidden;
}

/* ══════════════════════════════════════
   HAMBURGER BUTTON (mobile)
══════════════════════════════════════ */
.hamburger-btn {
  display: none;
  position: fixed;
  top: 16px;
  left: 16px;
  z-index: 1000;
  width: 44px;
  height: 44px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  cursor: pointer;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 5px;
  padding: 0;
  transition: background var(--transition), border-color var(--transition);
}

.hamburger-btn span {
  display: block;
  width: 20px;
  height: 2px;
  background: var(--text);
  border-radius: 2px;
  transition: all 0.3s ease;
}

.hamburger-btn:hover {
  background: var(--surface2);
  border-color: var(--accent);
}

/* Active (X) state */
.hamburger-btn.active span:nth-child(1) {
  transform: translateY(7px) rotate(45deg);
}

.hamburger-btn.active span:nth-child(2) {
  opacity: 0;
  transform: scaleX(0);
}

.hamburger-btn.active span:nth-child(3) {
  transform: translateY(-7px) rotate(-45deg);
}

/* ══════════════════════════════════════
   SIDEBAR OVERLAY (mobile backdrop)
══════════════════════════════════════ */
.sidebar-overlay {
  display: none;
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.6);
  backdrop-filter: blur(2px);
  z-index: 90;
  opacity: 0;
  pointer-events: none;
  transition: opacity var(--transition);
}

.sidebar-overlay.open {
  opacity: 1;
  pointer-events: auto;
}

/* ══════════════════════════════════════
   SIDEBAR
══════════════════════════════════════ */
.sidebar {
  width: var(--sidebar-w);
  min-height: 100vh;
  background: var(--surface);
  border-right: 1px solid var(--border);
  display: flex;
  flex-direction: column;
  padding: 24px 0;
  flex-shrink: 0;
  position: sticky;
  top: 0;
  height: 100vh;
  overflow-y: auto;
  z-index: 100;
}

/* ── Sidebar header ── */
.sidebar-header {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 0 20px 20px;
  border-bottom: 1px solid var(--border);
  margin-bottom: 20px;
}

.sidebar-logo {
  width: 44px;
  height: 44px;
  background: linear-gradient(135deg, #1e40af, var(--accent));
  border-radius: 12px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.3rem;
  color: #fff;
  flex-shrink: 0;
  box-shadow: 0 4px 14px rgba(79, 142, 247, 0.35);
}

.sidebar-brand-name {
  font-size: 17px;
  font-weight: 700;
  color: var(--text);
  letter-spacing: -0.3px;
}

.sidebar-brand-sub {
  font-size: 11px;
  color: var(--text-muted);
  margin-top: 2px;
  font-weight: 500;
}

/* ── Section label ── */
.sidebar-section-label {
  font-size: 10px;
  font-weight: 700;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 1.2px;
  padding: 0 20px 8px;
}

/* ── Nav items ── */
.sidebar-nav {
  display: flex;
  flex-direction: column;
  gap: 2px;
  padding: 0 10px;
}

.nav-item {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 11px 14px;
  border-radius: var(--radius-sm);
  color: var(--text-muted);
  text-decoration: none;
  font-size: 14px;
  font-weight: 500;
  transition: background var(--transition), color var(--transition), transform 0.15s;
  cursor: pointer;
}

.nav-item i {
  font-size: 16px;
  width: 20px;
  text-align: center;
  flex-shrink: 0;
}

.nav-item:hover {
  background: var(--surface2);
  color: var(--text);
  transform: translateX(2px);
}

.nav-item:hover i {
  color: var(--accent);
}

.nav-item.active {
  background: rgba(79, 142, 247, 0.12);
  color: var(--accent);
  border: 1px solid rgba(79, 142, 247, 0.2);
}

.nav-item.active i {
  color: var(--accent);
}

/* ── Sidebar footer ── */
.sidebar-footer {
  margin-top: auto;
  padding: 16px 20px 0;
  border-top: 1px solid var(--border);
}

.sidebar-version {
  font-size: 11px;
  color: var(--text-muted);
}

/* ══════════════════════════════════════
   MAIN AREA
══════════════════════════════════════ */
.main-area {
  flex: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 40px 24px;
  background: radial-gradient(ellipse at 60% 40%, #1a2040 0%, var(--bg) 65%);
  min-height: 100vh;
  min-width: 0;
}

/* ── Connection card ── */
.connection-card {
  width: 100%;
  max-width: 420px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 40px 32px;
  box-shadow: var(--shadow);
  animation: slideUp 0.3s ease;
}

@keyframes slideUp {
  from {
    opacity: 0;
    transform: translateY(16px);
  }

  to {
    opacity: 1;
    transform: translateY(0);
  }
}

.connection-card-header {
  text-align: center;
  margin-bottom: 30px;
}

.connection-logo {
  width: 64px;
  height: 64px;
  background: linear-gradient(135deg, #1e40af, var(--accent));
  border-radius: 18px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.8rem;
  color: #fff;
  margin: 0 auto 18px;
  box-shadow: 0 6px 20px rgba(79, 142, 247, 0.4);
}

.connection-title {
  font-size: 22px;
  font-weight: 700;
  color: var(--text);
  letter-spacing: -0.4px;
  margin-bottom: 6px;
}

.connection-sub {
  font-size: 13px;
  color: var(--text-muted);
}

/* ── Input ── */
.input-group {
  position: relative;
  margin-bottom: 20px;
}

.input-icon {
  position: absolute;
  left: 14px;
  top: 50%;
  transform: translateY(-50%);
  color: var(--text-muted);
  font-size: 16px;
  pointer-events: none;
}

.input-group input {
  width: 100%;
  padding: 14px 14px 14px 40px;
  background: var(--surface2);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  color: var(--text);
  font-family: inherit;
  font-size: 16px;
  font-weight: 500;
  text-align: center;
  letter-spacing: 2px;
  outline: none;
  transition: border-color 0.2s, box-shadow 0.2s;
}

.input-group input::placeholder {
  color: var(--text-muted);
  letter-spacing: normal;
  font-weight: 400;
}

.input-group input:focus {
  border-color: var(--accent);
  box-shadow: 0 0 0 3px rgba(79, 142, 247, 0.15);
}

/* ── Buttons group ── */
.btn-group {
  display: flex;
  flex-direction: column;
  gap: 10px;
  margin-bottom: 16px;
}

.btn {
  width: 100%;
  padding: 14px;
  border: none;
  border-radius: var(--radius-sm);
  font-family: inherit;
  font-size: 14px;
  font-weight: 700;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  letter-spacing: 0.5px;
  transition: all 0.2s;
}

.btn:hover {
  transform: translateY(-2px);
  box-shadow: 0 6px 20px rgba(0, 0, 0, 0.35);
}

.btn:active {
  transform: translateY(0);
}

.btn-orange {
  background: linear-gradient(135deg, #c45b0a, #ff8c42);
  color: #fff;
}

.btn-blue {
  background: linear-gradient(135deg, #1a4bbf, #4285f4);
  color: #fff;
}

.btn-green {
  background: linear-gradient(135deg, #1f6b35, #3ecf8e);
  color: #fff;
}

.connection-hint {
  text-align: center;
  font-size: 12px;
  color: var(--text-muted);
  line-height: 1.5;
}

/* ══════════════════════════════════════
   RESPONSIVE — Mobile (≤ 768px)
══════════════════════════════════════ */
@media (max-width: 768px) {
  .hamburger-btn {
    display: flex;
  }

  .sidebar-overlay {
    display: block;
    pointer-events: none;
  }

  .sidebar-overlay.open {
    pointer-events: auto;
  }

  .sidebar {
    position: fixed;
    left: 0;
    top: 0;
    height: 100%;
    transform: translateX(-100%);
    transition: transform var(--transition);
    box-shadow: 4px 0 24px rgba(0, 0, 0, 0.5);
  }

  .sidebar.open {
    transform: translateX(0);
  }

  .main-area {
    padding: 70px 16px 32px;
  }

  .connection-card {
    padding: 30px 20px;
    max-width: 100%;
  }

  .sidebar {
    width: min(84vw, 300px);
  }

  .sidebar-header {
    padding-left: 16px;
    padding-right: 16px;
  }

  .sidebar-section-label {
    padding-left: 16px;
    padding-right: 16px;
  }

  .sidebar-nav {
    padding-left: 8px;
    padding-right: 8px;
  }

  .nav-item {
    min-height: 46px;
  }

  .btn-group {
    gap: 12px;
  }

  .btn {
    padding: 13px 12px;
  }
}

@media (max-width: 480px) {
  .main-area {
    padding: 66px 12px 24px;
  }

  .connection-card {
    padding: 24px 16px;
    border-radius: 12px;
  }

  .connection-title {
    font-size: 20px;
  }

  .connection-sub {
    font-size: 12px;
  }

  .input-group input {
    font-size: 15px;
    letter-spacing: 1px;
  }
}

/* ══════════════════════════════════════
   STATUS INDICATOR (kept for other pages)
══════════════════════════════════════ */
.status-indicator {
  position: fixed;
  top: 20px;
  right: 20px;
  padding: 8px 14px;
  border-radius: 20px;
  font-size: 13px;
  font-weight: 700;
  z-index: 200;
}

.status-connected {
  background: rgba(62, 207, 142, 0.15);
  color: var(--success);
  border: 1px solid rgba(62, 207, 142, 0.3);
}

.status-disconnected {
  background: rgba(247, 95, 95, 0.15);
  color: #f75f5f;
  border: 1px solid rgba(247, 95, 95, 0.3);
}
/* ══════════════════════════════════════
   SIDEBAR AUTH + HOME LOGIN MODAL
══════════════════════════════════════ */
.sidebar-footer {
  display: flex;
  flex-direction: column;
  gap: 10px;
  padding: 16px;
  border-top: 1px solid var(--border);
}

.sidebar-auth-btn {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  width: 100%;
  padding: 11px 14px;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  background: var(--surface2);
  color: var(--text);
  font-family: inherit;
  font-size: 14px;
  font-weight: 600;
  cursor: pointer;
  transition: background 0.2s, border-color 0.2s, color 0.2s;
}

.sidebar-auth-btn:hover {
  border-color: var(--accent);
  color: var(--accent);
}

.sidebar-auth-btn.is-logout {
  border-color: rgba(247, 95, 95, 0.35);
  color: #f75f5f;
}

.sidebar-auth-btn.is-logout:hover {
  background: rgba(247, 95, 95, 0.12);
  border-color: #f75f5f;
}

.sidebar-auth-info {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 8px 10px;
  border-radius: var(--radius-sm);
  background: rgba(79, 142, 247, 0.1);
  border: 1px solid rgba(79, 142, 247, 0.2);
  color: var(--accent);
  font-size: 12px;
  font-weight: 600;
}

.sidebar-auth-info.d-none {
  display: none !important;
}

.sidebar-version {
  text-align: center;
  color: var(--text-muted);
  font-size: 12px;
}

.home-login-overlay {
  position: fixed;
  inset: 0;
  z-index: 2000;
  display: none;
  align-items: center;
  justify-content: center;
  background: rgba(5, 8, 18, 0.72);
  backdrop-filter: blur(6px);
  padding: 16px;
}

.home-login-overlay.open {
  display: flex;
}

.home-login-panel {
  width: 100%;
  max-width: 480px;
}

.home-login-screen.bs-login-screen {
  min-height: auto;
  padding: 0;
  background: transparent;
}

.home-login-screen .bs-login-home {
  position: absolute;
  /* margin-bottom: 12px; */
}

@keyframes spin {
  to {
    transform: rotate(360deg);
  }
}
