/*
  Zweck: Desktop-Raster (Header, Rail, Hauptkonsole) der Kommandozentrale.
  Zielpfad: /home/mckiede/public_html/design/layout-desktop.css
  Verantwortlich: mckie-Portal
*/

.page-shell {
  display: flex;
  flex-direction: column;
  position: relative;
  width: 100%;
  height: 100vh;
  height: 100svh;
  min-height: 100vh;
  margin: 0;
  padding: var(--gap);
  overflow: hidden;
}

.page-shell::before,
.page-shell::after {
  content: '';
  position: absolute;
  z-index: 0;
  pointer-events: none;
}

.page-shell::before,
.page-shell::after {
  display: none;
}

.command-header,
.command-footer {
  display: grid;
  position: relative;
  z-index: 1;
  grid-template-columns: minmax(0, 2.2fr) minmax(15rem, 0.8fr);
  gap: var(--gap);
}

.command-header {
  --header-bar: clamp(1.25rem, 2vw, 1.8rem);
  --header-bar-sm: calc(var(--header-bar) * 0.56);
  --header-action-h: 3.85rem;
  display: grid;
  grid-template-columns: 12rem minmax(0, 1fr) minmax(11rem, 12.5rem) 2.8rem;
  grid-template-rows: var(--header-bar-sm) minmax(6.6rem, auto);
  gap: 0;
  min-height: 8.25rem;
  overflow: hidden;
  border: 0;
  border-radius: var(--radius-frame);
  background: var(--console-bg);
  box-shadow: none;
}

.header-bars {
  display: grid;
  position: absolute;
  top: 0;
  left: 12rem;
  right: 2.8rem;
  z-index: 0;
  /* study-bars: orange hoch, violett niedrig, oben bündig (Prototyp) */
  grid-template-columns: minmax(7rem, 0.36fr) minmax(0, 1fr) minmax(9rem, 0.22fr);
  align-items: start;
  gap: var(--console-matrix-gap);
  height: var(--header-bar);
  background: var(--console-bg);
}

.header-bar {
  display: block;
  height: var(--header-bar-sm);
  border-radius: 0 0 var(--radius-control) var(--radius-control);
}

.header-bar-orange {
  height: var(--header-bar);
  background: var(--console-frame);
}

.header-bar-violet {
  height: var(--header-bar-sm);
  background: var(--violet);
}

.header-bars .header-bar:first-child {
  border-bottom-left-radius: 0;
}

.header-bars .header-bar:last-child {
  border-bottom-right-radius: 0;
}

.console-svg {
  position: absolute;
  inset: 0;
  z-index: 0;
  width: 100%;
  height: 100%;
  overflow: visible;
  pointer-events: none;
}

.svg-frame-primary {
  fill: var(--console-frame);
}

.svg-frame-secondary {
  fill: var(--violet);
}

.svg-cutout {
  fill: var(--console-bg);
}

.header-block,
.command-footer {
  background: transparent;
  color: var(--text);
  border: 0;
}

.header-frame-svg,
.footer-frame-svg {
  filter: drop-shadow(0 1rem 2.2rem var(--wash-black-45));
}

.header-frame-svg {
  display: none;
}

.header-frame-svg .svg-frame-secondary:first-of-type {
  fill: var(--console-frame);
}

.header-elbow {
  position: relative;
  z-index: 1;
  min-height: 100%;
}

.header-elbow-left {
  grid-row: 1 / span 2;
  border-radius: var(--radius-frame) 0 0 var(--radius-frame);
  background: var(--console-frame);
}

.header-elbow-left::after {
  content: '';
  position: absolute;
  top: var(--header-bar);
  right: 0;
  bottom: var(--header-bar);
  width: calc(var(--header-bar) * 1.45);
  border-radius: var(--radius-cutout) 0 0 var(--radius-cutout);
  background: var(--console-bg);
}

.header-elbow-right {
  grid-column: 4;
  grid-row: 1 / span 2;
  border-radius: 0 var(--radius-frame) var(--radius-frame) 0;
  background: var(--violet);
}

.header-elbow-right::after {
  content: '';
  position: absolute;
  top: var(--header-bar);
  left: 0;
  bottom: var(--header-bar);
  width: calc(var(--header-bar) * 1.2);
  border-radius: 0 var(--radius-cutout) var(--radius-cutout) 0;
  background: var(--console-bg);
}

.header-elbow .system-label {
  position: absolute;
  top: 1.1rem;
  left: 1.1rem;
  max-width: 7rem;
  color: var(--black);
  font-size: 0.62rem;
  letter-spacing: 0.08em;
}

.header-brand {
  position: relative;
  z-index: 1;
  grid-column: 2;
  grid-row: 1 / span 2;
  min-width: 0;
  margin-top: var(--header-bar);
  padding: 1rem 0.75rem 1.1rem 0.85rem;
  overflow: visible;
  border-radius: 0;
  border-right: 0;
  clip-path: none;
  box-shadow: none;
}

.header-brand::before,
.header-brand::after {
  display: none;
}

.header-brand p {
  margin: 0;
  color: var(--orange);
  font-size: 0.82rem;
  font-weight: 900;
  letter-spacing: 0.14em;
  text-transform: uppercase;
}

.header-brand h1 {
  display: block;
  margin: 0;
  min-width: 0;
}

.header-brand .title-combo {
  display: inline;
  white-space: nowrap;
}

.header-status {
  position: relative;
  z-index: 2;
  grid-column: 3;
  grid-row: 1 / span 2;
  display: flex;
  flex-direction: column;
  justify-content: flex-end;
  align-items: flex-end;
  min-width: 0;
  margin-top: var(--header-bar);
  padding: 1rem 0.45rem 1.1rem 0.35rem;
  border-radius: 0;
  clip-path: none;
  text-align: right;
  text-transform: uppercase;
  border-left: 0;
  box-shadow: none;
  /* MUC pill sits above this box (top: negative) — must not clip */
  overflow: visible;
}

.header-status::before {
  display: none;
}

.header-status > span {
  position: absolute;
  z-index: 4;
  top: calc(var(--header-bar) * -1);
  right: 0;
  display: grid;
  align-items: center;
  min-width: 10rem;
  height: var(--header-bar);
  padding: 0 0.75rem;
  border-radius: 0 0 var(--radius-sm) var(--radius-sm);
  background: var(--console-frame);
  color: var(--black);
  font-size: 0.58rem;
  font-weight: 900;
  justify-content: center;
  letter-spacing: 0.16em;
  white-space: nowrap;
}

.header-status strong {
  container-type: inline-size;
  position: relative;
  z-index: 1;
  display: block;
  width: 100%;
  max-width: 100%;
  margin-top: auto;
  margin-bottom: 0.45rem;
  align-self: flex-end;
  overflow: hidden;
  font-size: clamp(0.58rem, 3.8cqi, 1.45rem);
  line-height: 1;
  white-space: nowrap;
}

.header-status .header-controls {
  flex-shrink: 0;
  height: var(--header-action-h);
  margin-top: 0;
  margin-left: auto;
}
