.admin-app {
  height: 100vh;
  height: 100dvh;
  min-height: 0;
  overflow: hidden;
}

.admin-shell {
  display: grid;
  grid-template-columns: 300px minmax(0, 1fr);
  height: 100%;
  min-height: 0;
  overflow: hidden;
  background: #f4f7fb;
}

.admin-sidebar {
  height: 100%;
  min-height: 0;
  display: flex;
  flex-direction: column;
  padding: 22px 16px;
  color: #d8e1ec;
  background:
    linear-gradient(180deg, rgba(217, 45, 58, 0.12), transparent 34%),
    #101722;
  border-right: 1px solid rgba(255, 255, 255, 0.08);
}

.brand-lockup {
  display: flex;
  gap: 12px;
  align-items: center;
  padding: 0 8px 24px;
}

.brand-lockup > div:last-child {
  min-width: 0;
}

.brand-name {
  color: #ffffff;
  font-size: 20px;
  font-weight: 800;
}

.brand-kicker {
  color: #90a6bd;
  font-size: 12px;
  white-space: nowrap;
}

.admin-nav {
  display: grid;
  gap: 6px;
}

.admin-sidebar-body {
  flex: 1;
  min-height: 0;
  display: flex;
  flex-direction: column;
  gap: 14px;
}

.admin-sidebar-top {
  flex: 1;
  min-height: 0;
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.admin-sidebar-secondary {
  flex: 1;
  min-height: 0;
  padding-left: 18px;
}

.admin-nav-bottom {
  flex: 0 0 auto;
}

.admin-nav-link {
  display: flex;
  min-height: 44px;
  align-items: center;
  gap: 10px;
  padding: 0 12px;
  color: #9fb2c7;
  text-decoration: none;
  border-radius: 8px;
  transition:
    color var(--motion-fast) var(--ease-standard),
    background var(--motion-fast) var(--ease-standard),
    box-shadow var(--motion-normal) var(--ease-standard),
    transform var(--motion-fast) var(--ease-standard);
}

.admin-nav-link.active,
.admin-nav-link:hover {
  color: #ffffff;
  background: rgba(255, 255, 255, 0.08);
}

.admin-nav-link:hover {
  transform: translateX(2px);
}

.admin-nav-link.active {
  box-shadow: inset 3px 0 0 #d92d3a;
}

.admin-main {
  min-width: 0;
  height: 100%;
  min-height: 0;
  display: grid;
  grid-template-rows: 78px minmax(0, 1fr);
  overflow: hidden;
}

.admin-topbar {
  height: 78px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
  padding: 0 30px;
  background: rgba(255, 255, 255, 0.9);
  border-bottom: 1px solid #e7edf4;
  backdrop-filter: blur(14px);
}

.admin-topbar h1 {
  margin: 2px 0 0;
  color: #162033;
  font-size: 24px;
  line-height: 1.2;
  letter-spacing: 0;
}

.topbar-actions,
.topbar-resource-actions,
.topbar-session-actions,
.row-actions,
.pager-row div {
  display: flex;
  align-items: center;
  gap: 10px;
}

.topbar-actions {
  min-width: 0;
  justify-content: flex-end;
}

.topbar-resource-actions {
  min-width: 0;
  flex-wrap: nowrap;
  padding-right: 4px;
}

.topbar-session-actions {
  padding-left: 4px;
  border-left: 1px solid #e2e8f0;
}

.admin-content {
  position: relative;
  min-width: 0;
  min-height: 0;
  overflow: hidden;
  background: #f4f7fb;
}

.admin-content-viewport {
  position: relative;
  width: 100%;
  height: 100%;
  min-width: 0;
  min-height: 0;
}

.admin-content-viewport-scroll {
  overflow: auto;
  padding: 24px 30px 30px;
}

.admin-content-viewport-fixed {
  overflow: hidden;
}

.admin-route {
  min-width: 0;
  min-height: 0;
}

.admin-route-fixed {
  height: 100%;
  overflow: hidden;
}

.admin-route-fixed .admin-route-fallback {
  height: 100%;
  min-height: 0;
}

.admin-route-fallback {
  min-height: 100%;
  display: grid;
  place-items: center;
}

@media (max-width: 900px) {
  .admin-shell {
    height: 100%;
    grid-template-columns: 1fr;
    grid-template-rows: auto minmax(0, 1fr);
  }

  .admin-main {
    height: 100%;
    display: grid;
    grid-template-rows: auto minmax(0, 1fr);
    overflow: hidden;
  }

  .admin-sidebar {
    height: auto;
    flex-direction: row;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
  }

  .admin-sidebar-body {
    flex: 1;
    flex-direction: row;
    align-items: center;
    justify-content: flex-end;
  }

  .admin-sidebar-top,
  .admin-nav-bottom {
    flex: 0 0 auto;
  }

  .admin-sidebar-secondary {
    display: none;
  }

  .brand-lockup {
    padding: 0;
  }

  .admin-nav {
    display: flex;
    flex-wrap: wrap;
  }

  .admin-topbar {
    align-items: flex-start;
    flex-direction: column;
    height: auto;
    padding: 18px;
  }

  .topbar-actions {
    width: 100%;
    align-items: flex-start;
    justify-content: space-between;
  }

  .topbar-session-actions {
    padding-left: 0;
    border-left: 0;
  }

  .admin-content-viewport-scroll {
    min-height: 0;
    padding: 18px;
  }
}
