/* layout.css — Sidebar, topbar, content area */

#app {
  min-height: 100vh;
}

/* Authenticated shell */
.shell {
  display: grid;
  grid-template-columns: var(--sidebar-width) 1fr;
  grid-template-rows: var(--topbar-height) 1fr;
  grid-template-areas:
    "sidebar topbar"
    "sidebar content";
  min-height: 100vh;
}

/* Sidebar */
.sidebar {
  grid-area: sidebar;
  background: var(--brand-blue);
  color: var(--white);
  display: flex;
  flex-direction: column;
  position: sticky;
  top: 0;
  height: 100vh;
}

.sidebar__brand {
  padding: 0 18px;
  height: var(--topbar-height);
  display: flex;
  flex-direction: column;
  justify-content: center;
  border-bottom: 1px solid rgba(255, 255, 255, 0.08);
}

.sidebar__brand-name {
  font-weight: 800;
  font-size: 16px;
  letter-spacing: 1px;
  color: var(--white);
}

.sidebar__brand-sub {
  font-size: 10px;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  color: rgba(255, 255, 255, 0.55);
}

.sidebar__nav {
  flex: 1;
  padding: 12px 10px;
  display: flex;
  flex-direction: column;
  gap: 2px;
  overflow-y: auto;
}

.sidebar__link {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 9px 12px;
  border-radius: var(--radius);
  color: rgba(255, 255, 255, 0.78);
  font-size: 13px;
  font-weight: 500;
  cursor: pointer;
}

.sidebar__link:hover {
  background: var(--brand-blue-mid);
  color: var(--white);
  text-decoration: none;
}

.sidebar__link.is-active {
  background: var(--brand-blue-mid);
  color: var(--white);
}

.sidebar__link-icon {
  width: 16px;
  text-align: center;
  font-size: 13px;
  opacity: 0.85;
}

.sidebar__footer {
  padding: 12px 18px;
  font-size: 11px;
  color: rgba(255, 255, 255, 0.4);
  border-top: 1px solid rgba(255, 255, 255, 0.08);
}

/* Topbar */
.topbar {
  grid-area: topbar;
  background: var(--white);
  border-bottom: 1px solid var(--gray-200);
  height: var(--topbar-height);
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 22px;
  position: sticky;
  top: 0;
  z-index: 10;
}

.topbar__title {
  font-size: 16px;
  font-weight: 700;
  color: var(--brand-blue);
}

.topbar__right {
  display: flex;
  align-items: center;
  gap: 16px;
}

.topbar__action {
  display: inline-flex;
  align-items: center;
  gap: 6px;
}

.topbar__user {
  display: flex;
  align-items: center;
  gap: 9px;
}

.topbar__avatar {
  width: 30px;
  height: 30px;
  border-radius: 50%;
  background: var(--brand-accent);
  color: var(--white);
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 700;
  font-size: 12px;
}

.topbar__user-meta {
  line-height: 1.2;
}
.topbar__user-name { font-weight: 600; font-size: 12px; }
.topbar__user-role { font-size: 11px; color: var(--gray-500); }

/* Content area */
.content {
  grid-area: content;
  padding: 22px 26px 60px;
  overflow-x: auto;
}

.page-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 18px;
}

.page-header__titles h1 { margin-bottom: 2px; }
.page-header__sub { color: var(--gray-500); font-size: 13px; }

.page-header__actions {
  display: flex;
  gap: 10px;
  flex-shrink: 0;
}

/* Full-page login layout */
.auth-screen {
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  background:
    radial-gradient(circle at 20% 20%, rgba(29, 23, 230, 0.40), transparent 45%),
    radial-gradient(circle at 80% 80%, rgba(29, 23, 230, 0.20), transparent 50%),
    var(--brand-blue);
  padding: 24px;
}

/* Detail page 3-column grid */
.detail-grid {
  display: grid;
  grid-template-columns: 280px 1fr 300px;
  gap: 18px;
  align-items: start;
}

@media (max-width: 1200px) {
  .detail-grid {
    grid-template-columns: 1fr;
  }
}

/* Metric card grid */
.metric-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
  gap: 14px;
  margin-bottom: 24px;
}
