:root {
  --sidebar-width: 260px;
}

html {
  font-size: 14px;
}

@media (min-width: 768px) {
  html {
    font-size: 16px;
  }
}

.btn:focus, .btn:active:focus, .btn-link.nav-link:focus, .form-control:focus, .form-check-input:focus {
  box-shadow: 0 0 0 0.1rem white, 0 0 0 0.25rem #258cfb;
}

html {
  position: relative;
  min-height: 100%;
}

body {
  margin-bottom: 60px;
}

/* ---- Sidebar ---- */
.sidebar {
  position: fixed;
  left: 0;
  top: 0;
  width: var(--sidebar-width);
  height: 100vh;
  background: #f8f9fa;
  border-right: 1px solid #dee2e6;
  z-index: 1050;
  overflow-y: auto;
  transition: transform 0.25s ease;
}

.sidebar-header {
  padding: 0.9rem 1.25rem;
  border-bottom: 1px solid #dee2e6;
}

.sidebar-brand {
  font-weight: 600;
  font-size: 1.1rem;
  color: #212529;
}

.sidebar-nav {
  padding: 0.75rem 0;
}

.sidebar-link {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  padding: 0.6rem 1.25rem;
  color: #212529;
  text-decoration: none;
  transition: background 0.15s ease;
}

.sidebar-link:hover {
  background: #e9ecef;
  color: #212529;
}

.sidebar-link i {
  width: 1.25rem;
  text-align: center;
}

.sidebar-divider {
  margin: 0.5rem 1rem;
  border-color: #dee2e6;
}

.sidebar-section {
  padding: 0.5rem 0 0.25rem;
}

.sidebar-section-label {
  font-size: 0.7rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: .06em;
  color: #6c757d;
  padding: 0 1.25rem;
  margin: 0.25rem 0 0.25rem;
}

.sidebar-project-row {
  display: flex;
  align-items: center;
}

.sidebar-project-link {
  display: flex;
  align-items: center;
  gap: 0.6rem;
  padding: 0.4rem 0.5rem 0.4rem 1.25rem;
  color: #212529;
  text-decoration: none;
  transition: background 0.15s ease;
  font-size: 0.875rem;
  flex: 1;
  min-width: 0;
}

.sidebar-project-link:hover {
  background: #e9ecef;
  color: #212529;
}

.sidebar-project-toggle {
  flex-shrink: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  width: 28px;
  height: 28px;
  border: none;
  background: transparent;
  color: #6c757d;
  cursor: pointer;
  border-radius: 4px;
  margin-right: 0.35rem;
  transition: background 0.15s ease;
}

.sidebar-project-toggle:hover {
  background: #dee2e6;
  color: #212529;
}

.sidebar-project-toggle i {
  font-size: 0.65rem;
  transition: transform 0.2s ease;
}

.sidebar-project-dot {
  flex-shrink: 0;
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: #adb5bd;
}

.sidebar-project-name {
  overflow: hidden;
  white-space: nowrap;
  text-overflow: ellipsis;
}

.sidebar-sprint-list {
  overflow: hidden;
  transition: height 0.2s ease;
}

.sidebar-sprint-link {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.3rem 1.25rem 0.3rem 2.5rem;
  color: #6c757d;
  text-decoration: none;
  font-size: 0.8rem;
  transition: background 0.15s ease;
}

.sidebar-sprint-link:hover {
  background: #e9ecef;
  color: #212529;
}

.sidebar-sprint-icon {
  font-size: 0.65rem;
  flex-shrink: 0;
  opacity: 0.6;
}

.sidebar-overlay {
  display: none;
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.4);
  z-index: 1040;
  transition: opacity 0.25s ease;
}

.app-content {
  transition: margin-left 0.25s ease;
}

/* Navbar brand: show only when sidebar is hidden */
.navbar-brand-when-sidebar-hidden {
  display: inline-block;
}

@media (max-width: 767px) {
  /* Mobile: hide navbar brand when sidebar is open */
  body.sidebar-open .navbar-brand-when-sidebar-hidden {
    display: none !important;
  }
}

@media (min-width: 768px) {
  /* Desktop: hide navbar brand when sidebar is visible */
  .navbar-brand-when-sidebar-hidden {
    display: none !important;
  }

  body.sidebar-closed .navbar-brand-when-sidebar-hidden {
    display: inline-block !important;
  }
}

/* Mobile: sidebar hidden by default, show on .sidebar-open */
@media (max-width: 767px) {
  .sidebar {
    transform: translateX(-100%);
  }

  body.sidebar-open .sidebar {
    transform: translateX(0);
  }

  body.sidebar-open .sidebar-overlay {
    display: block;
  }
}

/* Desktop: sidebar visible by default, hide on .sidebar-closed */
@media (min-width: 768px) {
  .sidebar {
    transform: translateX(0);
  }

  .app-content {
    margin-left: var(--sidebar-width);
  }

  body.sidebar-closed .sidebar {
    transform: translateX(-100%);
  }

  body.sidebar-closed .app-content {
    margin-left: 0;
  }
}

.form-floating > .form-control-plaintext::placeholder, .form-floating > .form-control::placeholder {
  color: var(--bs-secondary-color);
  text-align: end;
}

.form-floating > .form-control-plaintext:focus::placeholder, .form-floating > .form-control:focus::placeholder {
  text-align: start;
}