/* App shell: sidebar 240px, header, content offset, identity chip, nav active. */

.app {
  min-height: 100vh;
}

.sidebar {
  position: fixed;
  inset: 0 auto 0 0;
  z-index: var(--z-sidebar);
  width: var(--sidebar-width);
  display: flex;
  flex-direction: column;
  background: var(--navy-800);
  color: #eef4ee;
  overflow: hidden;
}

.sidebar-brand {
  display: flex;
  align-items: center;
  gap: var(--space-2);
  height: var(--header-height);
  padding: 0 var(--space-2);
  border-bottom: 1px solid rgba(255, 255, 255, 0.08);
  flex-shrink: 0;
}

.brand-mark {
  flex-shrink: 0;
  width: 36px;
  height: 36px;
  display: grid;
  place-items: center;
  background: var(--teal);
  color: #fff;
  font-size: var(--text-sm);
  font-weight: 700;
  letter-spacing: 0.04em;
  border-radius: var(--radius);
}

.brand-text {
  display: flex;
  flex-direction: column;
  min-width: 0;
  line-height: 1.25;
}

.brand-text strong {
  font-size: var(--text-md);
  font-weight: 600;
  color: #fff;
}

.brand-text span {
  font-size: var(--text-xs);
  color: rgba(232, 238, 244, 0.62);
  letter-spacing: 0.06em;
  text-transform: uppercase;
}

.sidebar-nav {
  display: flex;
  flex-direction: column;
  gap: 4px;
  padding: var(--space-2) var(--space-1);
  flex: 1;
  overflow-y: auto;
}

.nav-item {
  display: flex;
  align-items: center;
  gap: 12px;
  min-height: 40px;
  padding: 8px 12px;
  color: rgba(232, 238, 244, 0.82);
  border-radius: var(--radius);
  text-decoration: none;
  font-size: var(--text-sm);
  font-weight: 500;
}

.nav-item:hover {
  background: rgba(255, 255, 255, 0.06);
  color: #fff;
  text-decoration: none;
}

.nav-item.is-active {
  background: rgba(106, 143, 110, 0.22);
  color: #fff;
  box-shadow: inset 3px 0 0 var(--teal);
}

.nav-item .nav-icon {
  flex-shrink: 0;
  width: 20px;
  height: 20px;
  color: currentColor;
}

.nav-label {
  white-space: nowrap;
}

.nav-admin.is-hidden {
  display: none !important;
}

.app-body {
  margin-left: var(--sidebar-width);
  min-width: 0;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}

.header {
  position: sticky;
  top: 0;
  z-index: var(--z-header);
  display: flex;
  align-items: center;
  gap: var(--space-2);
  height: var(--header-height);
  padding: 0 var(--space-3);
  background: var(--card);
  border-bottom: 1px solid var(--border);
}

.nav-toggle {
  display: none;
  width: 40px;
  height: 40px;
  padding: 0;
  border: 0;
  background: transparent;
  color: var(--navy);
  border-radius: var(--radius);
  cursor: pointer;
}

.nav-toggle svg {
  width: 22px;
  height: 22px;
  margin: 0 auto;
}

.page-title {
  flex: 1;
  font-size: var(--text-xl);
  font-weight: 600;
  letter-spacing: -0.02em;
  color: var(--navy);
}

.identity-chip {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 6px 10px 6px 6px;
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: 999px;
  max-width: 240px;
}

.identity-avatar {
  width: 32px;
  height: 32px;
  display: grid;
  place-items: center;
  background: var(--navy);
  color: #fff;
  font-size: var(--text-xs);
  font-weight: 600;
  letter-spacing: 0.04em;
  border-radius: 50%;
  flex-shrink: 0;
}

.identity-meta {
  display: flex;
  flex-direction: column;
  min-width: 0;
  line-height: 1.2;
}

.identity-name {
  font-size: var(--text-sm);
  font-weight: 600;
  color: var(--text);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.identity-role {
  font-size: var(--text-xs);
  color: var(--text-muted);
  text-transform: capitalize;
}

.main {
  flex: 1;
  padding: var(--space-3);
}

.nav-overlay {
  display: none;
}

.page-header {
  display: flex;
  flex-wrap: wrap;
  align-items: flex-end;
  justify-content: space-between;
  gap: var(--space-2);
  margin-bottom: var(--space-3);
}

.page-header h2 {
  font-size: var(--text-lg);
  font-weight: 600;
  color: var(--navy);
}

.page-lede {
  margin-top: 4px;
  font-size: var(--text-sm);
  color: var(--text-muted);
}

.header-actions {
  display: flex;
  align-items: center;
  gap: 12px;
  flex-shrink: 0;
}

.lang-switch {
  display: inline-flex;
  padding: 3px;
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: 999px;
}

.lang-btn {
  min-width: 40px;
  min-height: 28px;
  padding: 2px 10px;
  border: 0;
  background: transparent;
  color: var(--text-muted);
  font-size: var(--text-xs);
  font-weight: 700;
  letter-spacing: 0.04em;
  border-radius: 999px;
  cursor: pointer;
}

.lang-btn.is-active {
  background: var(--teal);
  color: #fff;
}
