/**
 * ValOS Platform Shell — base geometry
 * tab rail | workbench | ops screen | inspector
 * v1.1.0-base
 */

:root {
  --void-950: #05070a;
  --space-900: #0b1018;
  --surface-800: #141b24;
  --signal-blue: #38bdf8;
  --text-primary: #f8fafc;
  --text-secondary: #a8b3c3;
  --text-tertiary: #64748b;
  --border-color: rgba(255, 255, 255, 0.08);
  --pane-edge: rgba(226, 232, 240, 0.26);
  --header-height: 52px;
  --rail-width: 56px;
  --workbench-width: 272px;
  --inspector-width: 360px;
  --font-primary: "Geist", "Inter", system-ui, -apple-system, sans-serif;
  --font-mono: "Geist Mono", ui-monospace, monospace;
}

* {
  box-sizing: border-box;
}

html,
body {
  height: 100%;
  margin: 0;
  background: var(--void-950);
  color: var(--text-primary);
  font-family: var(--font-primary);
}

.shell-root {
  display: flex;
  flex-direction: column;
  height: 100%;
  min-height: 100vh;
}

/* ── Header ── */
.shell-header {
  height: var(--header-height);
  flex-shrink: 0;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding: 0 16px;
  background: rgba(11, 16, 24, 0.92);
  border-bottom: 1px solid var(--pane-edge);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  box-shadow: 0 8px 32px rgba(0, 0, 0, 0.25);
  z-index: 5;
}

.shell-brand {
  display: flex;
  align-items: center;
  gap: 10px;
  min-width: 0;
}

.shell-brand-mark {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 32px;
  height: 32px;
  border-radius: 12px;
  background: linear-gradient(145deg, #1a2330 0%, #0b1018 55%, #141b24 100%);
  color: var(--signal-blue);
  box-shadow: 0 0 0 1px rgba(255, 255, 255, 0.06), 0 4px 12px rgba(0, 0, 0, 0.4);
  flex-shrink: 0;
}

.shell-brand h1 {
  margin: 0;
  font-size: 16px;
  font-weight: 700;
  letter-spacing: 0.02em;
  line-height: 1.2;
}

.shell-brand-valos {
  color: var(--text-secondary);
  margin-right: 0.25em;
}

.shell-brand-name {
  color: var(--text-primary);
  font-weight: 800;
}

.shell-badge {
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--signal-blue);
  border: 1px solid rgba(56, 189, 248, 0.35);
  background: rgba(56, 189, 248, 0.08);
  padding: 2px 8px;
  border-radius: 999px;
}

.shell-header-actions {
  display: flex;
  align-items: center;
  gap: 8px;
}

.shell-person-tile {
  appearance: none;
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 4px 10px 4px 4px;
  border-radius: 999px;
  border: 1px solid var(--border-color);
  background: var(--space-900);
  color: var(--text-primary);
  cursor: default;
  font: inherit;
}

.shell-avatar {
  width: 32px;
  height: 32px;
  border-radius: 50%;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: 11px;
  font-weight: 800;
  background: #1e3a5f;
  color: #93c5fd;
  border: 1px solid rgba(56, 189, 248, 0.3);
}

.shell-person-meta {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  line-height: 1.2;
}

.shell-person-name {
  font-size: 12px;
  font-weight: 650;
}

.shell-person-role {
  font-size: 10px;
  color: var(--text-tertiary);
}

/* ── Body: 4 panes ── */
.shell-body {
  flex: 1;
  display: grid;
  grid-template-columns:
    var(--rail-width)
    var(--workbench-width)
    minmax(0, 1fr)
    var(--inspector-width);
  min-height: 0;
  background: #06090e;
}

/* 1. Tab rail */
.shell-tab-rail {
  background: var(--space-900);
  border-right: 1px solid var(--border-color);
  display: flex;
  flex-direction: column;
  align-items: center;
  padding: 10px 6px;
  gap: 8px;
  box-shadow: 1px 0 0 rgba(0, 0, 0, 0.35);
  z-index: 2;
  overflow: hidden;
}

.shell-tab-rail .shell-pane-label {
  writing-mode: vertical-rl;
  transform: rotate(180deg);
  font-size: 9px;
  font-weight: 800;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--text-tertiary);
  margin-bottom: 8px;
  opacity: 0.7;
}

.shell-slot-empty {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 10px;
  flex: 1;
  padding-top: 8px;
}

.shell-slot-mark {
  width: 36px;
  height: 36px;
  border-radius: 10px;
  border: 1px dashed rgba(255, 255, 255, 0.12);
  background: rgba(255, 255, 255, 0.02);
}

/* ── Blueprint: tab rail items — colors = Hub shell rail (shell.css accents) ── */
.shell-tab-rail[data-blueprint] {
  padding: 10px 6px;
  gap: 4px;
}

.shell-tab-rail[data-blueprint] .shell-pane-label {
  display: none;
}

.shell-tab-item {
  appearance: none;
  position: relative;
  display: flex;
  align-items: center;
  justify-content: center;
  width: 100%;
  padding: 12px 8px;
  border: 0;
  border-radius: 10px;
  background: transparent;
  color: #f3f4f6;
  cursor: pointer;
  transition: background 0.12s ease, color 0.12s ease;
}

.shell-tab-item:hover:not(:disabled) {
  background: rgba(255, 255, 255, 0.06);
  color: #ffffff;
}

.shell-tab-icon {
  display: inline-flex;
  line-height: 0;
  flex-shrink: 0;
  filter: drop-shadow(0 0 4px currentColor);
}

/* Idle accent hues — same hex as Hub .hub-rail-item.accent-* */
.shell-tab-item.accent-blue .shell-tab-icon {
  color: #38bdf8;
}
.shell-tab-item.accent-cyan .shell-tab-icon {
  color: #00e5ff;
}
.shell-tab-item.accent-orange .shell-tab-icon {
  color: #fb923c;
}
.shell-tab-item.accent-purple .shell-tab-icon {
  color: #8b5cf6;
}
.shell-tab-item.accent-rose .shell-tab-icon {
  color: #fb7185;
}
.shell-tab-item.accent-yellow .shell-tab-icon {
  color: #fbbf24;
}
.shell-tab-item.accent-green .shell-tab-icon {
  color: #00e58f;
}

.shell-tab-item.active {
  background: rgba(255, 255, 255, 0.06);
  color: #ffffff;
}

.shell-tab-item.accent-blue.active {
  background: rgba(56, 189, 248, 0.14);
  box-shadow: inset 2px 0 0 #38bdf8, 0 0 12px rgba(56, 189, 248, 0.14);
}
.shell-tab-item.accent-blue.active .shell-tab-icon {
  color: #7dd3fc;
  filter: drop-shadow(0 0 6px #38bdf8);
}

.shell-tab-item.accent-cyan.active {
  background: rgba(0, 229, 255, 0.12);
  box-shadow: inset 2px 0 0 #00e5ff, 0 0 12px rgba(0, 229, 255, 0.12);
}
.shell-tab-item.accent-cyan.active .shell-tab-icon {
  color: #67f6ff;
  filter: drop-shadow(0 0 6px #00e5ff);
}

.shell-tab-item.accent-orange.active {
  background: rgba(251, 146, 60, 0.14);
  box-shadow: inset 2px 0 0 #fb923c, 0 0 12px rgba(251, 146, 60, 0.14);
}
.shell-tab-item.accent-orange.active .shell-tab-icon {
  color: #fdba74;
  filter: drop-shadow(0 0 6px #fb923c);
}

.shell-tab-item.accent-purple.active {
  background: rgba(139, 92, 246, 0.14);
  box-shadow: inset 2px 0 0 #8b5cf6, 0 0 12px rgba(139, 92, 246, 0.14);
}
.shell-tab-item.accent-purple.active .shell-tab-icon {
  color: #c4b5fd;
  filter: drop-shadow(0 0 6px #8b5cf6);
}

.shell-tab-item.accent-rose.active {
  background: rgba(251, 113, 133, 0.14);
  box-shadow: inset 2px 0 0 #fb7185, 0 0 12px rgba(251, 113, 133, 0.14);
}
.shell-tab-item.accent-rose.active .shell-tab-icon {
  color: #fda4af;
  filter: drop-shadow(0 0 6px #fb7185);
}

.shell-tab-item.accent-yellow.active {
  background: rgba(251, 191, 36, 0.12);
  box-shadow: inset 2px 0 0 #fbbf24, 0 0 12px rgba(251, 191, 36, 0.12);
}
.shell-tab-item.accent-yellow.active .shell-tab-icon {
  color: #fde68a;
  filter: drop-shadow(0 0 6px #fbbf24);
}

.shell-tab-item.accent-green.active {
  background: rgba(0, 229, 143, 0.12);
  box-shadow: inset 2px 0 0 #00e58f, 0 0 12px rgba(0, 229, 143, 0.12);
}
.shell-tab-item.accent-green.active .shell-tab-icon {
  color: #6ee7b7;
  filter: drop-shadow(0 0 6px #00e58f);
}

.shell-tab-item.grey,
.shell-tab-item:disabled {
  opacity: 0.45;
  cursor: not-allowed;
}

.shell-tab-tip {
  display: none;
  position: absolute;
  left: calc(100% + 8px);
  top: 50%;
  transform: translateY(-50%);
  padding: 6px 10px;
  border-radius: 6px;
  background: #1a1a1a;
  border: 1px solid #333;
  color: #f0f0f0;
  font-size: 12px;
  font-weight: 600;
  white-space: nowrap;
  pointer-events: none;
  z-index: 50;
  box-shadow: 0 4px 14px rgba(0, 0, 0, 0.45);
}

.shell-tab-item:hover .shell-tab-tip,
.shell-tab-item:focus-visible .shell-tab-tip {
  display: block;
}

.bp-ops-iframe {
  flex: 1;
  width: 100%;
  min-height: 0;
  height: 100%;
  border: 0;
  background: #05070a;
  display: block;
}

.shell-ops:has(.bp-ops-iframe) {
  display: flex;
  flex-direction: column;
  overflow: hidden;
  padding: 0;
}

.bp-ops-panel {
  max-width: 520px;
  margin: 8vh auto 0;
  padding: 28px 24px;
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 16px;
  background: rgba(15, 23, 42, 0.45);
}

.bp-ops-title {
  margin: 0 0 10px;
  font-size: 1.35rem;
  font-weight: 700;
}

.bp-ops-meta {
  margin: 16px 0 0;
  font-size: 12px;
  color: #64748b;
}

.bp-ops-meta code {
  font-family: var(--font-mono);
  color: #7dd3fc;
  font-size: 11px;
}

.bp-chip {
  display: inline-block;
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  padding: 2px 7px;
  border-radius: 999px;
  border: 1px solid #334155;
}

.bp-chip.live {
  border-color: #14532d;
  color: #00e58f;
  background: #052e1a;
}

.bp-chip.warn {
  border-color: #854d0e;
  color: #fbbf24;
  background: #422006;
}

/* 2. Workbench */
.shell-workbench {
  background: #0c1118;
  border-right: 1px solid var(--border-color);
  display: flex;
  flex-direction: column;
  min-width: 0;
  min-height: 0;
  overflow: hidden;
  box-shadow: 1px 0 0 rgba(0, 0, 0, 0.3);
}

/* 3. Ops screen */
.shell-ops {
  min-width: 0;
  min-height: 0;
  overflow: auto;
  display: flex;
  flex-direction: column;
  background:
    radial-gradient(ellipse 50% 30% at 50% 0%, rgba(56, 189, 248, 0.04), transparent),
    var(--void-950);
}

/* 4. Inspector */
.shell-inspector {
  background: #0a0f16;
  border-left: 1px solid var(--border-color);
  display: flex;
  flex-direction: column;
  min-width: 0;
  min-height: 0;
  overflow: hidden;
  box-shadow: -1px 0 0 rgba(0, 0, 0, 0.3);
}

/* Shared pane chrome */
.shell-pane-head {
  flex-shrink: 0;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  padding: 12px 12px 10px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.05);
  background: rgba(255, 255, 255, 0.015);
  font-size: 11px;
  font-weight: 800;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--text-secondary);
}

.shell-pane-meta {
  font-weight: 600;
  letter-spacing: 0.04em;
  color: var(--text-tertiary);
  font-size: 10px;
}

.shell-pane-body {
  flex: 1;
  overflow: auto;
  padding: 14px;
}

.shell-pane-body--center {
  display: flex;
  align-items: center;
  justify-content: center;
}

.shell-slot-blurb {
  margin: 0;
  font-size: 11px;
  color: var(--text-tertiary);
  text-align: center;
  letter-spacing: 0.02em;
}

.shell-ops-empty {
  max-width: 440px;
  margin: auto;
  padding: 28px 24px;
  text-align: center;
  border: 1px dashed rgba(255, 255, 255, 0.1);
  border-radius: 16px;
  background: rgba(15, 23, 42, 0.35);
}

.shell-stage-kicker {
  margin: 0 0 6px;
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--text-tertiary);
}

.shell-stage-title {
  margin: 0 0 10px;
  font-size: 1.2rem;
  font-weight: 700;
}

.shell-stage-blurb {
  margin: 0;
  font-size: 13px;
  color: var(--text-secondary);
  line-height: 1.5;
}

.shell-stage-blurb code {
  font-family: var(--font-mono);
  font-size: 12px;
  color: var(--signal-blue);
}

.shell-muted {
  margin: 0 0 14px;
  font-size: 12px;
  color: var(--text-tertiary);
  line-height: 1.45;
}

.shell-dl {
  margin: 0;
  display: grid;
  grid-template-columns: 72px 1fr;
  gap: 8px 10px;
  font-size: 12px;
}

.shell-dl dt {
  margin: 0;
  color: var(--text-tertiary);
  font-weight: 600;
}

.shell-dl dd {
  margin: 0;
  color: var(--text-primary);
  font-family: var(--font-mono);
  font-size: 11px;
}

@media (max-width: 960px) {
  .shell-body {
    grid-template-columns: var(--rail-width) minmax(0, 1fr) minmax(240px, 32vw);
  }
  .shell-workbench {
    display: none;
  }
}

@media (max-width: 720px) {
  .shell-body {
    grid-template-columns: minmax(0, 1fr);
    grid-template-rows: 1fr auto;
  }
  .shell-tab-rail,
  .shell-workbench {
    display: none;
  }
  .shell-inspector {
    max-height: 36vh;
    border-left: 0;
    border-top: 1px solid var(--border-color);
  }
}
