/*
 * ==========================================================================
 * layout.css — Aderian Zelly Layout System (Identity Onboarding)
 * ==========================================================================
 *
 * Defines the application shell: top bar and main content area.
 * Aligned with the CloudOps frontend design language.
 *
 * Layout structure:
 *   .az-page              – Full-height wrapper
 *     .az-topbar          – Sticky header bar (navy)
 *     .az-main            – Scrollable page content
 * ========================================================================== */

/* ---------- Global Reset ---------- */
*, *::before, *::after {
  box-sizing: border-box;
}

html, body {
  margin: 0;
  padding: 0;
  height: 100%;
  width: 100%;
}

body {
  font-family: var(--az-font-family);
  font-size: var(--az-font-size-body);
  color: var(--az-text-primary);
  background-color: var(--az-surface-main);
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  letter-spacing: var(--az-letter-spacing-body);
}

/* ---------- Page Wrapper ---------- */
.az-page {
  display: flex;
  flex-direction: column;
  min-height: 100vh;
}

/* ---------- Top Bar ---------- */
.az-topbar {
  position: sticky;
  top: 0;
  z-index: 10;
  display: flex;
  align-items: center;
  justify-content: space-between;
  background-color: var(--az-color-navy);
  color: var(--az-color-white);
  padding: var(--az-space-sm) var(--az-space-lg);
  min-height: 56px;
  flex-shrink: 0;
}

.az-topbar__left {
  display: flex;
  align-items: center;
  gap: var(--az-space-md);
}

.az-topbar__logo {
  display: flex;
  align-items: center;
  flex-shrink: 0;
  text-decoration: none;
}

.az-topbar__logo img {
  height: 28px;
  width: auto;
}

.az-topbar__service-name {
  font-family: var(--az-font-family);
  font-size: var(--az-font-size-body);
  font-weight: 500;
  color: var(--az-color-white);
  white-space: nowrap;
}

.az-topbar__nav {
  display: flex;
  list-style: none;
  margin: 0;
  padding: 0;
  gap: var(--az-space-xs);
}

.az-topbar__right {
  display: flex;
  align-items: center;
  gap: var(--az-space-md);
}

.az-topbar__username {
  color: var(--az-color-white);
  font-size: 14px;
  font-weight: 500;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  max-width: 400px;
}

.az-topbar__btn {
  display: inline-flex;
  align-items: center;
  padding: 6px 14px;
  background: rgba(255, 255, 255, 0.15);
  color: var(--az-color-white);
  border: 1px solid rgba(255, 255, 255, 0.25);
  border-radius: var(--az-radius-input);
  font-family: var(--az-font-family);
  font-size: 14px;
  font-weight: 500;
  text-decoration: none;
  cursor: pointer;
  transition: background var(--az-duration) var(--az-ease);
  white-space: nowrap;
}

.az-topbar__btn:hover {
  background: rgba(255, 255, 255, 0.25);
  color: var(--az-color-white);
}

/* ---------- Nav Links (in topbar) ---------- */
.az-nav-link {
  color: rgba(255, 255, 255, 0.7);
  text-decoration: none;
  padding: 6px 12px;
  border-radius: var(--az-radius-input);
  font-size: 0.9rem;
  font-weight: 500;
  transition: background-color var(--az-duration) var(--az-ease),
              color var(--az-duration) var(--az-ease);
}

.az-nav-link:hover {
  background-color: rgba(255, 255, 255, 0.1);
  color: var(--az-color-white);
}

.az-nav-link.active {
  background-color: rgba(255, 255, 255, 0.15);
  color: var(--az-color-white);
}

/* ---------- Main Content Area ---------- */
.az-main {
  flex: 1;
  background-color: var(--az-surface-main);
  padding: var(--az-space-lg);
}

/* ---------- Responsive (≤ 768px) ---------- */
@media (max-width: 767.98px) {
  .az-topbar {
    padding: var(--az-space-sm) var(--az-space-md);
  }

  .az-topbar__left {
    gap: var(--az-space-sm);
  }

  .az-topbar__username {
    display: none;
  }

  .az-main {
    padding: var(--az-space-md);
  }
}

@media (max-width: 480px) {
  .az-topbar__service-name {
    display: none;
  }
}
