/* Paladio shared app shell — left nav + top bar */

.app.paladio-shell {
  display: grid;
  grid-template-rows: 48px 1fr;
  grid-template-columns: 240px 1fr;
  grid-template-areas:
    "shell-topbar shell-topbar"
    "shell-sidenav shell-main";
  height: 100vh;
}

.shell-topbar {
  grid-area: shell-topbar;
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 0 16px;
  border-bottom: 1px solid var(--line);
  background: var(--bg-1);
  z-index: 50;
}

.shell-topbar .brand {
  display: flex;
  align-items: center;
  gap: 8px;
  font-weight: 600;
  font-size: 13px;
  min-width: 140px;
}

.shell-topbar .brand-mark {
  width: 16px;
  height: 16px;
  position: relative;
}

.shell-topbar .brand-mark::before {
  content: "";
  position: absolute;
  inset: 0;
  background: linear-gradient(135deg, var(--blue), var(--violet));
  transform: rotate(45deg);
  border-radius: 2px;
}

.shell-topbar .brand-mark::after {
  content: "";
  position: absolute;
  inset: 4px;
  background: var(--bg-1);
  transform: rotate(45deg);
  border-radius: 1px;
}

.shell-layer-tabs {
  display: flex;
  align-items: center;
  gap: 2px;
}

.shell-layer-tab {
  padding: 6px 12px;
  font-size: 12.5px;
  color: var(--fg-2);
  border-radius: 6px;
  text-decoration: none;
}

.shell-layer-tab:hover {
  color: var(--fg-0);
  background: var(--bg-2);
}

.shell-layer-tab.active {
  color: var(--fg-0);
  background: var(--bg-3);
}

.shell-layer-tab.disabled {
  opacity: 0.45;
  pointer-events: none;
}

.shell-topbar-extra {
  margin-left: auto;
  display: flex;
  align-items: center;
  gap: 12px;
}

.shell-sidenav {
  grid-area: shell-sidenav;
  border-right: 1px solid var(--line);
  background: var(--bg-1);
  overflow-y: auto;
  padding: 14px 10px 32px;
  display: flex;
  flex-direction: column;
  gap: 18px;
}

.shell-main {
  grid-area: shell-main;
  display: grid;
  grid-template-rows: auto 1fr auto;
  min-height: 0;
  overflow: hidden;
}

.shell-main .module-hdr {
  border-bottom: 1px solid var(--line);
  background: var(--bg-1);
}

.shell-main .main {
  min-height: 0;
  overflow: hidden;
}

.shell-nav-section.inactive-layer .shell-nav-section-title {
  color: var(--fg-2);
}

.shell-nav-section.inactive-layer .shell-nav-item:not(.disabled) {
  color: var(--fg-2);
}

.shell-nav-section.inactive-layer .shell-nav-item.layer-forge:not(.disabled):hover {
  color: var(--amber);
}

.shell-nav-section.inactive-layer .shell-nav-item.layer-flux:not(.disabled):hover {
  color: var(--blue);
}

.shell-nav-section.inactive-layer .shell-nav-item.layer-fidelity:not(.disabled):hover {
  color: var(--teal);
}

.shell-nav-item.disabled {
  opacity: 0.45;
  cursor: not-allowed;
}

.shell-nav-soon {
  margin-left: 6px;
  font-size: 9px;
  font-weight: 500;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  color: var(--fg-4);
}

.shell-nav-section + .shell-nav-section {
  margin-top: 4px;
}

.shell-nav-section {
  display: flex;
  flex-direction: column;
  gap: 1px;
}

.shell-nav-section-title {
  font-size: 10px;
  font-weight: 600;
  color: var(--fg-3);
  text-transform: uppercase;
  letter-spacing: 0.08em;
  padding: 4px 10px 6px;
}

.shell-nav-item {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 6px 10px;
  border-radius: 6px;
  color: var(--fg-1);
  font-size: 12.5px;
  position: relative;
  width: 100%;
  text-align: left;
}

.shell-nav-item:hover {
  background: var(--bg-2);
  color: var(--fg-0);
}

.shell-nav-item.active {
  background: var(--bg-3);
  color: var(--fg-0);
}

.shell-nav-item.active::before {
  content: "";
  position: absolute;
  left: 0;
  top: 7px;
  bottom: 7px;
  width: 2px;
  background: var(--teal);
  border-radius: 2px;
}

.shell-nav-item.layer-forge.active::before { background: var(--amber); }
.shell-nav-item.layer-flux.active::before { background: var(--blue); }
.shell-nav-item.layer-fidelity.active::before { background: var(--teal); }

.shell-nav-item .icn {
  width: 14px;
  height: 14px;
  flex: 0 0 auto;
  color: var(--fg-2);
}

.shell-nav-item.active .icn {
  color: var(--fg-0);
}

.shell-tenant-card {
  margin: 4px 4px 0;
  padding: 10px;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: var(--bg-2);
}

.shell-tenant-card .name {
  font-weight: 600;
  font-size: 12.5px;
}

.shell-tenant-card .meta {
  font-size: 10.5px;
  color: var(--fg-3);
  margin-top: 4px;
}

.fidelity-app.paladio-shell,
.flux-app.paladio-shell {
  display: contents;
}

.fidelity-app.paladio-shell > .hdr,
.flux-app.paladio-shell > .hdr {
  display: none;
}

.fidelity-app.paladio-shell .fidelity-subtabs {
  display: none;
}

/* Shared page chrome rhythm — Flux, Fidelity, Forge audit */
.paladio-shell .screen {
  --screen-pad-x: 20px;
  --screen-header-pad-top: 20px;
  --screen-header-pad-bottom: 16px;
  --screen-content-pad-bottom: 28px;
  --screen-block-gap: 16px;
  display: flex;
  flex-direction: column;
  min-height: 0;
  height: 100%;
  overflow: hidden;
}

.paladio-shell .screen-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 16px;
  padding: var(--screen-header-pad-top) var(--screen-pad-x) var(--screen-header-pad-bottom);
  flex-shrink: 0;
}

.paladio-shell .screen-eyebrow {
  font-size: 9.5px;
  color: var(--fg-3);
  text-transform: uppercase;
  letter-spacing: 0.1em;
  font-family: var(--font-mono);
  margin: 0 0 6px;
}

.paladio-shell .screen-title {
  font-size: 18px;
  font-weight: 600;
  letter-spacing: -0.015em;
  margin: 0 0 8px;
  line-height: 1.3;
}

.paladio-shell .screen-sub {
  font-size: 12.5px;
  color: var(--fg-2);
  max-width: 72ch;
  margin: 0;
  line-height: 1.55;
}

.paladio-shell .screen-header .actions {
  display: flex;
  gap: 8px;
  flex-shrink: 0;
  align-items: center;
  flex-wrap: wrap;
}

.paladio-shell .screen-content {
  padding: 0 var(--screen-pad-x) var(--screen-content-pad-bottom);
  display: flex;
  flex-direction: column;
  gap: var(--screen-block-gap);
  min-width: 0;
  flex: 1;
  overflow-y: auto;
  min-height: 0;
}

/* Side-by-side layouts must win over the default screen-content flex column */
.paladio-shell .screen-content.fidelity-policies-layout,
.paladio-shell .screen-content.fidelity-profile-layout {
  display: grid;
  grid-template-columns: minmax(260px, 300px) minmax(0, 1fr);
  gap: 20px;
  align-items: start;
  flex: 1;
  min-height: 0;
}

/* Fidelity HITL — full-height two-column shell inside unified Paladio */
.paladio-shell .screen > .fidelity-approval-layout {
  flex: 1;
  min-height: 0;
}

.paladio-shell .screen-content > .state-banner {
  margin: 0;
}

.paladio-shell .screen-banner-above {
  padding: 12px var(--screen-pad-x) 0;
}
