/* Django-admin-style layout for the pycommissions dashboard. */
:root {
  --pyc-sidebar: #417690;
  --pyc-sidebar-dark: #2f5366;
}

/* Layout wrapper: the top bar sits in normal flow above the app shell, and the
   shell fills the remaining viewport height. */
.app {
  display: flex;
  flex-direction: column;
  min-height: 100vh;
}

.app-shell {
  display: flex;
  flex: 1;
  min-height: 0;
}

/* Horizontal top navigation bar (mirrors the admin top navbar) that holds the
   account menu aligned at its right end instead of floating over the content. */
.topbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: .5rem 1rem;
  background: #fff;
  border-bottom: 1px solid #dee2e6;
  min-height: 56px;
}

.topbar-brand {
  font-size: 1.05rem;
  font-weight: 600;
  color: var(--pyc-sidebar-dark);
}

.topbar-actions {
  display: flex;
  align-items: center;
}

/* Centered authentication layout for anonymous users (e.g. the login page). */
.auth-shell {
  background: #f5f7fa;
}

.login-card {
  width: 100%;
  max-width: 420px;
  box-shadow: 0 .5rem 1rem rgba(0, 0, 0, .15);
}

.sidebar {
  width: 240px;
  background: var(--pyc-sidebar);
  color: #fff;
  display: flex;
  flex-direction: column;
  position: sticky;
  top: 0;
  height: 100%;
}

.sidebar-brand {
  padding: 1rem;
  font-size: 1.1rem;
  font-weight: 600;
  background: var(--pyc-sidebar-dark);
}

.sidebar-user {
  padding: .5rem 1rem;
  font-size: .9rem;
  opacity: .9;
}

.sidebar nav {
  flex: 1;
}

.sidebar-link {
  color: #e6f0f5;
  padding: .6rem 1rem;
  display: block;
}

.sidebar-link:hover {
  background: var(--pyc-sidebar-dark);
  color: #fff;
}

.sidebar-link.active {
  background: var(--pyc-sidebar-dark);
  font-weight: 600;
}

.sidebar-footer {
  border-top: 1px solid rgba(255, 255, 255, .15);
}

/* Logout renders as a POST form (Django's LogoutView is POST-only); style the
   submit button to look identical to the surrounding sidebar links. */
.logout-form {
  margin: 0;
  padding: 0;
}

.logout-button {
  width: 100%;
  background: transparent;
  border: none;
  text-align: left;
  cursor: pointer;
  font: inherit;
}

.main {
  flex: 1;
  padding: 1.25rem 1.5rem;
  min-width: 0;
}

/* Top-right account menu (mirrors the admin account menu) for the logged-in
   user. It is a normal flex child of .topbar-actions, so it sits aligned at
   the top-right inside the top bar instead of floating over the content. */
.account-menu {
  display: flex;
  align-items: center;
}

.account-menu-toggle {
  display: inline-flex;
  align-items: center;
  gap: .4rem;
}

.account-menu-icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 1.35rem;
  height: 1.35rem;
  border-radius: 50%;
  background: var(--pyc-sidebar);
  color: #fff;
  flex: 0 0 auto;
}

.account-menu-icon svg {
  width: .85rem;
  height: .85rem;
}

/* A .dropdown-item that is a submit button needs the browser button defaults
   (background/border/full-width) reset so it looks like a normal item. */
.dropdown-item.logout-button {
  width: 100%;
  background: transparent;
  border: none;
  text-align: left;
}

@media (max-width: 767.98px) {
  .app-shell {
    flex-direction: column;
  }
  .sidebar {
    width: 100%;
    height: auto;
    position: static;
  }
}
