/* ─── DASHBOARD VIEW ─── */
#dashboard-view {
  min-height: 100vh;
  background: var(--bg);
}
#dashboard-view.d-none {
  display: none;
}

/* ─── Topbar ─── */
#topbar {
  position: fixed;
  top: 0;
  left: var(--sidebar-w);
  right: 0;
  height: var(--topbar-h);
  background: rgba(255,255,255,0.92);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  border-bottom: 1px solid var(--border);
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 1.5rem;
  z-index: 100;
  transition: left 0.3s ease;
}

.topbar-left {
  display: flex;
  align-items: center;
  gap: 12px;
}
.topbar-toggle {
  color: var(--text) !important;
  font-size: 1.2rem;
  padding: 4px 8px;
  text-decoration: none;
}
.topbar-toggle:hover {
  background: var(--border-light);
  border-radius: 8px;
}
.topbar-logo {
  width: 100px;
  height: auto;
}
.topbar-brand {
  font-weight: 600;
  font-size: 1.05rem;
  color: var(--text);
}

.topbar-right {
  display: flex;
  align-items: center;
  gap: 12px;
}
.topbar-user-info {
  text-align: right;
  line-height: 1.3;
}
.topbar-greeting {
  font-size: 0.75rem;
  color: var(--text-muted);
  display: block;
}
.topbar-user {
  font-size: 0.9rem;
}
.topbar-avatar {
  width: 36px;
  height: 36px;
  border-radius: 50%;
  background: var(--primary-light);
  color: var(--primary);
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 600;
  font-size: 0.9rem;
}
.btn-topbar-logout {
  background: none;
  border: 1px solid var(--border);
  border-radius: 8px;
  color: var(--text-muted);
  width: 36px;
  height: 36px;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all var(--transition);
}
.btn-topbar-logout:hover {
  color: var(--danger);
  border-color: var(--danger);
  background: var(--danger-light);
  transform: translateY(-1px);
}
.btn-topbar-icon {
  background: none;
  border: 1px solid var(--border);
  border-radius: 8px;
  color: var(--text-muted);
  width: 36px;
  height: 36px;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all var(--transition);
}
.btn-topbar-icon:hover {
  color: var(--primary);
  border-color: var(--primary);
  background: var(--primary-light);
  transform: translateY(-1px);
}

/* ─── Sidebar ─── */
#sidebar {
  position: fixed;
  top: 0;
  left: 0;
  bottom: 0;
  width: var(--sidebar-w);
  background: var(--sidebar-bg);
  border-right: 1px solid var(--border);
  display: flex;
  flex-direction: column;
  z-index: 200;
  transition: transform 0.3s ease;
}

.sidebar-header {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 1rem 1.25rem;
  border-bottom: 1px solid var(--border);
  min-height: var(--topbar-h);
}
.sidebar-logo {
  width: 80px;
  height: auto;
}
.sidebar-title {
  font-weight: 700;
  font-size: 1rem;
  color: var(--text);
  line-height: 1.2;
}
.sidebar-sub {
  font-size: 0.75rem;
  color: var(--text-muted);
}

.sidebar-nav {
  flex: 1;
  overflow-y: auto;
  padding: 0.75rem 0;
}
.sidebar-section-label {
  font-size: 0.7rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.8px;
  color: var(--text-muted);
  padding: 0.75rem 1.25rem 0.4rem;
}

.sidebar-item {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 0.6rem 1.25rem;
  color: var(--text-secondary);
  text-decoration: none;
  font-size: 0.88rem;
  font-weight: 450;
  border-left: 3px solid transparent;
  transition: all 0.15s ease;
  position: relative;
}
.sidebar-item:hover {
  background: var(--border-light);
  color: var(--text);
  border-left-color: var(--primary);
  padding-left: 1.5rem;
}
.sidebar-item.active {
  background: var(--primary-light);
  color: var(--primary);
  border-left-color: var(--primary);
  font-weight: 500;
}
.sidebar-item-icon {
  width: 20px;
  text-align: center;
  font-size: 0.95rem;
  flex-shrink: 0;
}
.sidebar-item.active .sidebar-item-icon {
  color: var(--primary);
}

.sidebar-footer {
  padding: 0.75rem 1.25rem;
  border-top: 1px solid var(--border);
  text-align: center;
}

/* ─── Sidebar overlay ─── */
.sidebar-overlay {
  display: none;
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,0.4);
  z-index: 150;
}

/* ─── Main content ─── */
#main-content {
  margin-left: var(--sidebar-w);
  margin-top: var(--topbar-h);
  min-height: calc(100vh - var(--topbar-h));
  padding: 1.5rem;
  transition: margin-left 0.3s ease;
}

/* ─── Welcome screen ─── */
.welcome-container {
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: calc(100vh - var(--topbar-h) - 3rem);
}
.welcome-card {
  max-width: 640px;
  width: 100%;
}
.welcome-logo {
  width: 80px;
  height: auto;
  opacity: 0.6;
}
.welcome-title {
  font-weight: 700;
  font-size: 1.6rem;
  color: var(--text);
  margin-bottom: 0.5rem;
}
.welcome-text {
  font-size: 0.95rem;
}

.welcome-feature-card {
  padding: 1.25rem 0.75rem;
  background: var(--surface);
  border-radius: var(--radius);
  border: 1px solid var(--border);
  text-align: center;
  transition: all 0.25s cubic-bezier(0.34, 1.56, 0.64, 1);
  cursor: default;
}
.welcome-feature-card:hover {
  transform: translateY(-6px);
  box-shadow: var(--shadow-lg);
  border-color: var(--primary-light);
}
.welcome-feature-icon {
  width: 52px;
  height: 52px;
  border-radius: var(--radius);
  display: flex;
  align-items: center;
  justify-content: center;
  margin: 0 auto 0.75rem;
  font-size: 1.3rem;
}
.welcome-feature-card span {
  font-size: 0.82rem;
  font-weight: 500;
  color: var(--text-secondary);
}

/* ─── Responsive ─── */
@media (max-width: 991.98px) {
  #sidebar {
    transform: translateX(-100%);
  }
  #sidebar.sidebar-open {
    transform: translateX(0);
  }
  .sidebar-overlay.active {
    display: block;
  }
  #topbar {
    left: 0;
  }
  #main-content {
    margin-left: 0;
  }
}

@media (max-width: 575.98px) {
  #topbar {
    padding: 0 1rem;
  }
  .topbar-user-info {
    display: none;
  }
  #main-content {
    padding: 1rem;
  }
  .welcome-title {
    font-size: 1.25rem;
  }
}
