/* ====== SIDEBAR NAV ====== */
.sidebar {
  position: fixed;
  top: 0;
  left: 0;
  bottom: 0;
  width: 220px;
  background: var(--bg);
  border-right: 1px solid var(--border);
  display: flex;
  flex-direction: column;
  z-index: 100;
  overflow-y: auto;
  overflow-x: hidden;
}

/* Subtle chessboard pattern */
.sidebar::before {
  content: '';
  position: absolute;
  inset: 0;
  background: repeating-conic-gradient(rgba(201, 168, 76, 0.03) 0% 25%, transparent 0% 50%) 0 0 / 40px 40px;
  pointer-events: none;
  z-index: 0;
}

.sidebar > * {
  position: relative;
  z-index: 1;
}

/* Logo */
.sidebar-logo {
  display: flex;
  align-items: center;
  gap: 0.6rem;
  padding: 1.25rem 1rem;
  text-decoration: none;
  border-bottom: 1px solid var(--border);
}

.sidebar-logo svg {
  width: 28px;
  height: 28px;
  flex-shrink: 0;
  color: var(--gold);
}

.sidebar-logo span {
  font-family: var(--font-display);
  font-size: 1.1rem;
  color: var(--gold);
  font-weight: 700;
  line-height: 1.2;
}

/* Nav links */
.sidebar-nav {
  flex: 1;
  padding: 0.75rem 0;
  list-style: none;
}

.sidebar-nav li a {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  padding: 0.6rem 1.25rem;
  color: var(--text-dim);
  text-decoration: none;
  font-size: 0.85rem;
  letter-spacing: 0.02em;
  transition: color 0.15s, background 0.15s;
  border-left: 3px solid transparent;
}

.sidebar-nav li a:hover {
  color: var(--text-bright);
  background: rgba(201, 168, 76, 0.06);
}

.sidebar-nav li a.active {
  color: var(--gold);
  background: rgba(201, 168, 76, 0.08);
  border-left-color: var(--gold);
}

.sidebar-nav li a .nav-icon {
  font-size: 1.1rem;
  width: 1.4rem;
  text-align: center;
  flex-shrink: 0;
}

/* User section at bottom */
.sidebar-user {
  padding: 1rem 1.25rem;
  border-top: 1px solid var(--border);
  margin-top: auto;
}

.sidebar-user-name {
  font-size: 0.85rem;
  color: var(--text);
  margin-bottom: 0.5rem;
  font-weight: 500;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.sidebar-user .sidebar-logout {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  padding: 0.35rem 0.75rem;
  background: transparent;
  color: var(--text-dim);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  font-family: var(--font-body);
  font-size: 0.8rem;
  cursor: pointer;
  transition: all 0.15s;
  width: 100%;
  justify-content: center;
}

.sidebar-user .sidebar-logout:hover {
  color: var(--danger);
  border-color: var(--danger);
}

/* Mobile hamburger */
.sidebar-hamburger {
  display: none;
  position: fixed;
  top: 0.75rem;
  left: 0.75rem;
  z-index: 101;
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 0.5rem;
  cursor: pointer;
  flex-direction: column;
  gap: 4px;
}

.sidebar-hamburger span {
  display: block;
  width: 20px;
  height: 2px;
  background: var(--gold);
  transition: 0.2s;
}

/* Mobile overlay backdrop */
.sidebar-backdrop {
  display: none;
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.5);
  z-index: 99;
}

.sidebar-backdrop.active {
  display: block;
}

/* Main content offset */
.app-main {
  margin-left: 220px;
}

/* Responsive */
@media (max-width: 768px) {
  .sidebar {
    transform: translateX(-100%);
    transition: transform 0.25s ease;
  }

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

  .sidebar-hamburger {
    display: flex;
  }

  .app-main {
    margin-left: 0;
    padding-top: 3.5rem;
  }
}
