/* ─────────────────────────────────────────────
   NPIA Layout — three-zone shell
   Rail (72) + Sidebar (280) + Main
   ───────────────────────────────────────────── */

html, body {
  font-family: var(--font-ui);
  color: var(--color-text);
  background: var(--color-bg);
  margin: 0;
  padding: 0;
}

.skip-link {
  position: absolute;
  left: -9999px;
  top: auto;
  width: 1px;
  height: 1px;
  overflow: hidden;
}
.skip-link:focus {
  position: fixed;
  left: var(--space-3);
  top: var(--space-3);
  width: auto;
  height: auto;
  padding: var(--space-2) var(--space-3);
  background: var(--color-surface);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-md);
  z-index: 1000;
}

/* ─── App shell ─── */
.app-shell {
  display: grid;
  grid-template-columns: var(--rail-width) var(--sidebar-width) 1fr;
  min-height: 100vh;
  transition: grid-template-columns 0.2s ease;
}

.shell--sidebar-collapsed {
  grid-template-columns: var(--rail-width) 0 1fr;
}
.shell--sidebar-collapsed .app-sidebar {
  display: none;
}

/* ─── Rail (72px) ─── */
.app-rail {
  background: var(--color-sidebar-rail);
  border-right: 1px solid rgba(0, 0, 0, 0.3);
  display: flex;
  flex-direction: column;
  align-items: center;
  padding: 18px 0;
  gap: 6px;
  position: sticky;
  top: 0;
  height: 100vh;
}
.rail-button {
  width: 44px;
  height: 44px;
  border-radius: 12px;
  background: transparent;
  border: none;
  color: var(--color-blue-muted);
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: background var(--transition-fast), color var(--transition-fast);
  padding: 0;
  text-decoration: none;
}
.rail-button:hover:not([disabled]) {
  background: rgba(125, 179, 255, 0.08);
  color: #fff;
  text-decoration: none;
}
.rail-button[disabled] {
  opacity: 0.45;
  cursor: not-allowed;
}
.rail-button--active {
  background: rgba(37, 99, 235, 0.22);
  color: #fff;
  box-shadow: inset 0 0 0 1px rgba(141, 187, 255, 0.25);
}
.rail-button:focus-visible {
  outline: 2px solid var(--color-blue-muted);
  outline-offset: 2px;
}
.rail-divider {
  width: 32px;
  height: 1px;
  background: var(--color-sidebar-border);
  margin: 6px 0;
}
.rail-spacer { flex: 1; }
.rail-avatar {
  width: 36px;
  height: 36px;
  border-radius: 50%;
  background: linear-gradient(135deg, var(--color-blue) 0%, var(--color-blue-hover) 100%);
  color: #fff;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 11px;
  font-weight: 600;
  font-family: var(--font-technical);
  letter-spacing: 0.04em;
  border: none;
  cursor: pointer;
}

/* ─── Sidebar (280px) ─── */
.app-sidebar {
  background: linear-gradient(180deg, var(--color-sidebar) 0%, #0d2541 100%);
  border-right: 1px solid rgba(234, 243, 255, 0.16);
  display: flex;
  flex-direction: column;
  padding: 22px 16px 16px;
  color: var(--color-text-light);
  position: sticky;
  top: 0;
  height: 100vh;
  overflow-y: auto;
}
.sidebar-brand {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 4px 8px 22px;
  border-bottom: 1px solid var(--color-sidebar-border);
  margin-bottom: 22px;
}
.sidebar-brand__mark {
  width: 36px;
  height: 36px;
  flex-shrink: 0;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  color: var(--color-text-light);
}
.sidebar-brand__text { line-height: 1.15; }
.sidebar-brand__name {
  font-weight: 700;
  letter-spacing: 0.06em;
  font-size: 14px;
  color: #fff;
}
.sidebar-brand__sub {
  font-size: 9px;
  letter-spacing: 0.18em;
  color: var(--color-blue-muted);
  font-family: var(--font-technical);
  text-transform: uppercase;
  margin-top: 3px;
  font-weight: 500;
}
.sidebar-section { margin-bottom: 18px; }
.sidebar-section__label {
  font-family: var(--font-technical);
  font-size: 9.5px;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: var(--color-text-soft);
  font-weight: 600;
  padding: 0 12px 10px;
}
.sidebar-nav__item {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 10px 12px;
  border-radius: 10px;
  color: var(--color-text-light);
  text-decoration: none;
  font-family: var(--font-ui);
  font-size: 12px;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  font-weight: 500;
  margin-bottom: 2px;
  position: relative;
  background: transparent;
  border: none;
  width: 100%;
  text-align: left;
  cursor: pointer;
}
.sidebar-nav__item svg { color: var(--color-blue-muted); flex-shrink: 0; }
.sidebar-nav__item:hover:not([disabled]) { background: rgba(125, 179, 255, 0.06); }
.sidebar-nav__item--active {
  background: rgba(37, 99, 235, 0.22);
  color: #fff;
  box-shadow: var(--shadow-sidebar-active);
  font-weight: 600;
}
.sidebar-nav__item--active svg { color: #fff; }
.sidebar-nav__item--active::before {
  content: '';
  position: absolute;
  left: -16px;
  top: 8px;
  bottom: 8px;
  width: 3px;
  border-radius: 0 2px 2px 0;
  background: var(--color-blue-muted);
}
.sidebar-nav__item[disabled] { opacity: 0.4; cursor: not-allowed; }
.sidebar-nav__item:focus-visible {
  outline: 2px solid var(--color-blue-muted);
  outline-offset: 2px;
}
.sidebar-spacer { flex: 1; }
.sidebar-profile {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 14px 12px;
  border-top: 1px solid var(--color-sidebar-border);
  margin-top: 12px;
}
.sidebar-profile__avatar {
  width: 38px;
  height: 38px;
  border-radius: 50%;
  background: linear-gradient(135deg, var(--color-blue) 0%, var(--color-blue-hover) 100%);
  color: #fff;
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 600;
  font-size: 12px;
  font-family: var(--font-technical);
  letter-spacing: 0.04em;
  flex-shrink: 0;
}
.sidebar-profile__info { line-height: 1.3; min-width: 0; flex: 1; }
.sidebar-profile__name {
  font-size: 13px;
  font-weight: 600;
  color: #fff;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.sidebar-profile__role {
  font-size: 9px;
  letter-spacing: 0.14em;
  color: var(--color-blue-muted);
  font-family: var(--font-technical);
  text-transform: uppercase;
  margin-top: 3px;
  font-weight: 500;
}
.sidebar-profile__role a {
  color: var(--color-blue-muted);
  text-decoration: none;
}
.sidebar-profile__role a:hover { color: #fff; }
.sidebar-profile__role button {
  background: transparent;
  border: none;
  color: inherit;
  font: inherit;
  letter-spacing: inherit;
  text-transform: inherit;
  cursor: pointer;
  padding: 0;
}
.sidebar-profile__role button:hover { color: #fff; }

/* ─── Main ─── */
.app-main {
  background: var(--color-bg);
  padding: 44px 56px 72px;
  overflow-y: visible;
  min-height: 100vh;
}

/* Page-header pattern moved to components.css (reusable BEM block). */

/* ─── Two-column layout for inquiry detail ─── */
.split {
  display: grid;
  grid-template-columns: 1fr;
  gap: var(--space-5);
}
@media (min-width: 960px) {
  .split--inquiry-detail { grid-template-columns: 2fr 1fr; }
}

/* ─── Auth shell — used by login (rendered without app-shell, via base_minimal) ─── */
.auth-shell {
  width: 100%;
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: var(--space-6) var(--space-5);
  background: var(--color-bg);
}
.auth-layout {
  width: 100%;
  max-width: 980px;
  display: grid;
  grid-template-columns: 1fr;
  gap: var(--space-5);
  align-items: center;
}
@media (min-width: 960px) {
  .auth-layout {
    grid-template-columns: minmax(0, 480px) minmax(0, 440px);
    gap: var(--space-6);
  }
}
.auth-panel {
  width: 100%;
  padding: var(--space-6);
  border: var(--border-width) solid var(--color-border);
  border-radius: 1.125rem;
  background: var(--color-surface-soft);
}
@media (min-width: 960px) {
  .auth-panel { padding: 2.25rem; }
}
.auth-panel__brand {
  margin-bottom: var(--space-5);
}
.auth-panel__brand img {
  height: 80px;
  width: auto;
}
.auth-panel__title {
  margin: 0 0 var(--space-4) 0;
  font-size: var(--text-3xl);
  font-weight: var(--weight-bold);
  letter-spacing: -0.015em;
  line-height: 1.15;
  color: var(--color-text);
}
.auth-panel__lead {
  margin: 0 0 var(--space-5) 0;
  font-size: var(--text-base);
  line-height: 1.55;
  color: var(--color-text-muted);
}
.auth-panel__list {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  flex-direction: column;
  gap: var(--space-3);
}
.auth-panel__list li {
  position: relative;
  padding-left: var(--space-5);
  font-size: var(--text-sm);
  color: var(--color-text);
}
.auth-panel__list li::before {
  content: "";
  position: absolute;
  left: 0;
  top: 0.55em;
  width: 0.5rem;
  height: 0.5rem;
  border-radius: var(--radius-pill);
  background: var(--color-blue);
}
.auth-card {
  width: 100%;
  max-width: 440px;
  padding: 2.5rem;
  border-radius: 1.125rem;
  border: var(--border-width) solid var(--color-border);
  box-shadow: var(--shadow-lg);
  background: var(--color-surface);
}
.auth-card__header {
  margin-bottom: var(--space-5);
}
.auth-card__title {
  margin: 0 0 var(--space-2) 0;
  font-size: var(--text-2xl);
  font-weight: var(--weight-bold);
  letter-spacing: -0.01em;
  color: var(--color-text);
}
.auth-card__subtitle {
  margin: 0;
  font-size: var(--text-sm);
  color: var(--color-text-muted);
}
.auth-submit {
  width: 100%;
  min-height: 48px;
  margin-top: var(--space-2);
  padding: 0 var(--space-4);
  font-size: var(--text-base);
  font-weight: var(--weight-medium);
  background: var(--color-blue);
  border-color: var(--color-blue);
  color: #fff;
}
.auth-submit:hover {
  background: var(--color-blue-hover);
  border-color: var(--color-blue-hover);
}
