/* Sidebar layout */
.sidebar {
  position: fixed;
  left: 0;
  top: 0;
  bottom: 0;
  width: var(--sidebar-width);
  background: var(--brand-dark);
  display: flex;
  flex-direction: column;
  z-index: 100;
  overflow: hidden;
  transition: width var(--transition);
}

/* ── Header ──────────────────────────────────────────────── */
.sidebar-header {
  padding: 20px 16px;
  border-bottom: 1px solid rgba(255,255,255,.08);
  flex-shrink: 0;
}

.sidebar-logo {
  display: flex;
  align-items: center;
  gap: 10px;
  text-decoration: none;
}

.sidebar-logo-mark {
  width: 32px;
  height: 32px;
  background: var(--brand-primary);
  border-radius: var(--r-md);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 16px;
  font-weight: 700;
  color: #fff;
  flex-shrink: 0;
}

.sidebar-logo-text {
  font-size: 15px;
  font-weight: 700;
  color: #fff;
  line-height: 1;
}

.sidebar-logo-sub {
  font-size: 11px;
  color: rgba(255,255,255,.4);
  margin-top: 1px;
}

/* ── Navigation ──────────────────────────────────────────── */
.sidebar-nav {
  flex: 1;
  overflow-y: auto;
  overflow-x: hidden;
  padding: 0 8px;
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.sidebar-nav::-webkit-scrollbar {
  width: 4px;
}

.sidebar-nav::-webkit-scrollbar-track {
  background: transparent;
}

.sidebar-nav::-webkit-scrollbar-thumb {
  background: rgba(255,255,255,.12);
  border-radius: 2px;
}

/* ── Nav items ───────────────────────────────────────────── */
.sidebar-item {
  display: flex;
  align-items: center;
  gap: 9px;
  padding: 8px 10px;
  border-radius: var(--r-md);
  color: rgba(253,240,213,.5);
  font-size: 13.5px;
  font-weight: 500;
  text-decoration: none;
  transition: background var(--transition), color var(--transition);
  cursor: pointer;
  border: none;
  background: transparent;
  width: 100%;
  text-align: left;
  white-space: nowrap;
  overflow: hidden;
  margin-bottom: 2px;
}

.sidebar-item:hover {
  background: rgba(255,255,255,.07);
  color: var(--brand-cream);
}

.sidebar-item.active,
.sidebar-item[aria-current="page"] {
  background: rgba(251,118,44,.18);
  color: var(--brand-primary);
  font-weight: 600;
}

.sidebar-item-icon {
  width: 18px;
  height: 18px;
  font-size: 16px;
  flex-shrink: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  opacity: .8;
}

.sidebar-item.active .sidebar-item-icon,
.sidebar-item[aria-current="page"] .sidebar-item-icon {
  opacity: 1;
}

.sidebar-item-label {
  flex: 1;
  overflow: hidden;
  text-overflow: ellipsis;
}

.sidebar-item-badge {
  margin-left: auto;
  background: var(--brand-primary);
  color: #fff;
  font-size: 11px;
  font-weight: 600;
  padding: 1px 6px;
  border-radius: var(--r-full);
  line-height: 1.5;
  flex-shrink: 0;
}

/* Section label */
.sidebar-section-label {
  font-size: 11px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: .08em;
  color: rgba(255,255,255,.25);
  padding: 12px 10px 4px;
  white-space: nowrap;
  overflow: hidden;
}

/* Separator */
.sidebar-sep {
  height: 1px;
  background: rgba(255,255,255,.08);
  margin: 6px 10px;
  flex-shrink: 0;
}

/* ── Start timer button ──────────────────────────────────── */
.sb-start-btn {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  margin: 0 8px 8px;
  padding: 10px 12px;
  border-radius: var(--r-md);
  background: var(--brand-primary-light);
  color: var(--brand-primary);
  font-size: 13px;
  font-weight: 600;
  border: 1.5px solid var(--brand-primary);
  cursor: pointer;
  transition: background var(--transition);
  font-family: var(--font);
  width: calc(100% - 16px);
  line-height: 1.3;
  text-align: center;
}

.sb-start-btn:hover {
  background: var(--brand-primary-muted);
}

/* ── Footer ──────────────────────────────────────────────── */
.sidebar-footer {
  padding: 12px 8px;
  border-top: 1px solid rgba(255,255,255,.08);
  flex-shrink: 0;
  display: flex;
  flex-direction: column;
  gap: 8px;
  overflow: hidden;
}

.sidebar-user {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 8px 10px;
  border-radius: var(--r-md);
  text-decoration: none;
  transition: background var(--transition);
  overflow: hidden;
}

.sidebar-user:hover {
  background: rgba(255,255,255,.08);
}

.sidebar-user-info {
  flex: 1;
  min-width: 0;
  overflow: hidden;
}

.sidebar-user-name {
  font-size: 13px;
  font-weight: 600;
  color: #fff;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.sidebar-user-role {
  font-size: 11.5px;
  color: rgba(255,255,255,.4);
}

/* ── Tablet : icon-only (768px–1024px) ───────────────────── */
@media (max-width: 1024px) {
  .sidebar {
    width: 64px;
  }

  .sidebar-header {
    padding: 16px 0;
    display: flex;
    justify-content: center;
  }

  .sidebar-logo {
    justify-content: center;
    gap: 0;
  }

  .sidebar-logo-text,
  .sidebar-logo-sub {
    display: none;
  }

  .sidebar-nav {
    padding: 12px 6px;
    align-items: center;
  }

  .sidebar-item {
    justify-content: center;
    padding: 10px;
    gap: 0;
    width: 44px;
    height: 44px;
  }

  .sidebar-item-label,
  .sidebar-item-badge,
  .sidebar-section-label {
    display: none;
  }

  .sb-start-btn {
    width: 40px;
    height: 40px;
    padding: 0;
    border-radius: 50%;
    margin: 0 auto 8px;
  }

  .sb-start-btn span {
    display: none;
  }

  .sidebar-footer {
    padding: 12px 6px;
    align-items: center;
  }

  .sidebar-user {
    justify-content: center;
    padding: 8px;
    gap: 0;
  }

  .sidebar-user-info {
    display: none;
  }

  .sidebar-signout {
    display: none;
  }
}

/* ── Mobile : masquée (<768px) ───────────────────────────── */
@media (max-width: 768px) {
  .sidebar {
    display: none;
  }
}
