/* ==========================================
   🌐 GLOBAL VARIABLES & THEME COLORS
   ========================================== */
:root {
  --primary: #0a2342; /* dyb mørkeblå */
  --accent: #1e90ff;  /* lysere blå accent */
  --secondary: #6c757d;
  --bg-dark: #0b1624;
  --text-light: #f1f5fa;
  --text-dim: rgba(255, 255, 255, 0.8);
}

body.dark-mode {
  --primary: #121212;
  --accent: #4a90e2;
  --bg-dark: #0d0d0d;
  background-color: #0d0d0d;
  color: var(--text-light);
}

/* ==========================================
   🧩 BASE LAYOUT
   ========================================== */
body {
  overflow-x: hidden;
  font-family: "Segoe UI", Roboto, sans-serif;
  background: #f8f9fa;
  color: #212529;
  transition: background 0.3s, color 0.3s;
}

/* ==========================================
   🧱 SIDEBAR
   ========================================== */
.sidebar {
  position: fixed;
  top: 0;
  left: 0;
  width: 250px;
  height: 100vh;
  background: linear-gradient(180deg, #0b1624 0%, #0a1a33 60%, #081220 100%);
  color: var(--text-light);
  display: flex;
  flex-direction: column;
  transition: width 0.3s, background 0.3s;
  box-shadow: 3px 0 10px rgba(0, 0, 0, 0.35);
}
.sidebar.collapsed {
  width: 80px;
}

/* --- LOGO HEADER --- */
.brand {
  background: linear-gradient(180deg, #0d213f 0%, #0b1830 100%);
  border-bottom: 1px solid rgba(255, 255, 255, 0.1);
  color: #fff;
  text-align: center;
  padding: 1.3rem 1rem 1.1rem;
  box-shadow: inset 0 -2px 5px rgba(0, 0, 0, 0.2);
}
.brand .logo {
  width: 120px;
  height: auto;
  user-select: none;
  -webkit-user-drag: none;
}
.brand .pitlogic {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: .25rem;
}
.brand .pitlogic-logo {
  height: 22px;
  filter: drop-shadow(0 0 4px rgba(255,255,255,0.25));
}
.brand small {
  font-size: 0.75rem;
  opacity: 0.6;
}

/* --- SIDEBAR LINKS --- */
.sidebar nav {
  flex-grow: 1;
  margin-top: 0.5rem;
}
.sidebar a {
  color: var(--text-dim);
  text-decoration: none;
  padding: 0.8rem 1.1rem;
  display: flex;
  align-items: center;
  gap: 0.75rem;
  font-weight: 500;
  transition: all 0.25s ease;
  border-left: 3px solid transparent;
}
.sidebar a:hover {
  background: rgba(255, 255, 255, 0.05);
  border-left-color: var(--accent);
}
.sidebar a.active {
  background: rgba(30, 144, 255, 0.15);
  border-left-color: var(--accent);
  color: #fff;
}

/* --- USER INFO (BOTTOM) --- */
.user-info {
  background: rgba(255, 255, 255, 0.05);
  border-top: 1px solid rgba(255, 255, 255, 0.08);
  padding: 1rem;
  font-size: 0.9rem;
}
.user-info strong {
  color: #fff;
}
.user-info a.btn {
  font-size: 0.75rem;
  border-color: rgba(255, 255, 255, 0.4);
}

/* ==========================================
   🔝 TOPBAR (FAST I TOPPEN)
   ========================================== */
.topbar {
  position: fixed;
  top: 0;
  left: 250px; /* matcher sidebar-bredde */
  right: 0;
  height: 56px;
  background: linear-gradient(90deg, #0b1624 0%, #0a1a33 100%);
  color: #fff;
  display: flex;
  align-items: center;
  padding: 0 1rem;
  border-bottom: 1px solid rgba(255, 255, 255, 0.08);
  z-index: 1050;
  transition: left 0.3s;
}
.sidebar.collapsed ~ .main .topbar {
  left: 80px;
}
.topbar h5 {
  font-weight: 600;
  font-size: 1.05rem;
  color: #f8f9fa;
}
.topbar .btn {
  color: #fff;
  border-color: rgba(255, 255, 255, 0.3);
}
.topbar .btn:hover {
  background: rgba(255, 255, 255, 0.1);
}

/* ==========================================
   🧭 MAIN CONTENT AREA
   ========================================== */
.main {
  margin-left: 250px;
  padding: 80px 2rem 2rem; /* top-padding til topbar */
  transition: margin-left 0.3s;
}
.sidebar.collapsed ~ .main {
  margin-left: 80px;
}

/* --- TOGGLE BUTTON --- */
.toggle-btn {
  position: absolute;
  top: 1rem;
  right: -1.5rem;
  background: var(--accent);
  color: white;
  border-radius: 50%;
  border: 0;
  width: 2rem;
  height: 2rem;
  box-shadow: 0 0 6px rgba(30, 144, 255, 0.5);
}

/* ==========================================
   📱 RESPONSIVE (MOBILE)
   ========================================== */
@media (max-width: 768px) {
  .sidebar {
    position: fixed;
    left: -250px;
  }
  .sidebar.show {
    left: 0;
  }
  .topbar {
    left: 0 !important;
  }
  .main {
    margin-left: 0 !important;
    padding-top: 80px;
  }
}

/* ==========================================
   🌙 DARK MODE
   ========================================== */
body.dark-mode .sidebar {
  background: linear-gradient(180deg, #0a0f1a 0%, #070b12 100%);
}
body.dark-mode .brand {
  background: linear-gradient(180deg, #11192a 0%, #0a0f1a 100%);
}
body.dark-mode .sidebar a {
  color: rgba(255, 255, 255, 0.8);
}
body.dark-mode .sidebar a:hover,
body.dark-mode .sidebar a.active {
  background: rgba(255, 255, 255, 0.08);
  border-left-color: #1e90ff;
}
body.dark-mode .user-info {
  background: rgba(255, 255, 255, 0.05);
}
body.dark-mode .topbar {
  background: linear-gradient(90deg, #0b0b12 0%, #0f1a2b 100%);
  border-bottom: 1px solid rgba(255, 255, 255, 0.1);
}

/* ==========================================
   🎨 LOGO + VISUAL DETAILS
   ========================================== */
.logo {
  width: 60px;
  height: auto;
}
.brand .pitlogic-logo {
  height: 22px;
  filter: brightness(1.15);
}
.brand small {
  font-size: 0.75rem;
  opacity: 0.7;
}
