/* App shell: sidebar, main column, page header, sign-in and load-error screens. */

.shell { display: flex; min-height: 100vh; }

.sidebar {
  position: fixed;
  inset: 0 auto 0 0;
  width: var(--sidebar-width);
  display: flex;
  flex-direction: column;
  padding: 24px 16px 20px;
  background: var(--sidebar);
  border-right: 1px solid var(--rule);
}

.brand {
  display: block;
  padding: 0 8px;
  font-size: 29px;
  font-weight: 600;
  letter-spacing: -1.7px;
  line-height: 1;
  color: var(--ink);
  text-decoration: none;
}

.nav { display: flex; flex-direction: column; gap: 5px; margin-top: 32px; }

.nav a {
  display: flex;
  align-items: center;
  gap: 11px;
  min-height: 44px;
  padding: 11px 12px;
  border-radius: var(--radius);
  font-size: 14px;
  font-weight: 600;
  color: #3c5142;
  text-decoration: none;
}
.nav a:hover { background: #e8eddf; color: var(--green-dark); }
.nav a.active { background: var(--green); color: #fff; font-weight: 700; }
.nav a .icon { flex: none; }
.nav .count {
  margin-left: auto;
  padding: 2px 6px;
  border-radius: 5px;
  background: #dfe7d8;
  font-size: 11px;
  font-weight: 600;
}
.nav a.active .count { background: rgb(255 255 255 / 0.15); }

.sidebar-user {
  margin-top: auto;
  padding-top: 18px;
  border-top: 1px solid var(--rule);
  display: grid;
  grid-template-columns: 30px 1fr;
  gap: 10px 10px;
  align-items: center;
}
.avatar {
  width: 30px;
  height: 30px;
  border-radius: 50%;
  background: #e8e6d8;
  color: #6f725b;
  display: grid;
  place-items: center;
  font-size: 11px;
  font-weight: 600;
  overflow: hidden;
}
.avatar img { width: 100%; height: 100%; object-fit: cover; }
.sidebar-user .name { font-size: 11px; font-weight: 500; line-height: 1.3; }
.sidebar-user .email { font-size: 10px; color: var(--ink-3); overflow: hidden; text-overflow: ellipsis; }
.sidebar-user .btn { grid-column: 1 / -1; justify-self: start; }

.main {
  flex: 1;
  margin-left: var(--sidebar-width);
  padding: 30px 34px 40px;
  max-width: calc(var(--content-max) + var(--sidebar-width));
  min-width: 0;
}

.page-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
  margin-bottom: 28px;
}
.page-header .subtitle { margin-top: 6px; font-size: 12px; color: var(--ink-3); }
.page-header .actions { display: flex; gap: 10px; align-items: center; }

.centered-screen {
  display: grid;
  place-items: center;
  min-height: 100vh;
  padding: 0 16px;
}
/* A page's load error is drawn inside the main column, which has its own height and padding. */
.main .centered-screen { min-height: 0; padding: 0; }

.centered-card {
  width: 100%;
  max-width: 28rem;
  margin: 4rem 0;
  padding: 28px;
  background: var(--paper);
  border: 1px solid var(--rule);
  border-radius: var(--radius-l);
  box-shadow: var(--shadow-card);
  display: flex;
  flex-direction: column;
  gap: 14px;
}
.centered-card h1 { font-size: 26px; }
.centered-card .divider { border-top: 1px solid var(--rule); margin: 4px 0; }
.centered-card .btn { justify-content: center; }

@media (max-width: 760px) {
  .sidebar { position: static; width: auto; flex-direction: row; align-items: center; gap: 12px; padding: 12px 16px; border-right: 0; border-bottom: 1px solid var(--rule); }
  .nav { flex-direction: row; margin-top: 0; overflow-x: auto; }
  .nav a { min-height: 36px; padding: 6px 10px; font-size: 12px; }
  .nav a span:not(.count) { display: none; }
  .sidebar-user { margin-top: 0; padding-top: 0; border: 0; margin-left: auto; }
  .sidebar-user .name, .sidebar-user .email { display: none; }
  .sidebar-user .btn { display: none; }
  .shell { flex-direction: column; }
  .main { margin-left: 0; padding: 20px 16px 32px; }
  h1 { font-size: 24px; }
}

@media (min-width: 761px) and (max-width: 1200px) {
  :root { --sidebar-width: 184px; }
  .main { padding: 26px 24px 36px; }
  .sidebar { padding-left: 12px; padding-right: 12px; }
  .page-header { gap: 16px; }
}
@media (min-width: 1700px) {
  .main { margin-right: auto; padding-left: 42px; padding-right: 42px; }
}
