:root {
  --bg: #f5f7f6;
  --bg-2: #eef3ef;
  --surface: rgba(255, 255, 255, .88);
  --surface-2: rgba(15, 23, 42, .045);
  --glass: rgba(255, 255, 255, .74);
  --line: rgba(15, 23, 42, .12);
  --ink: #0b1220;
  --soft: #475569;
  --muted: #64748b;
  --green: #2bb34b;
  --green-soft: rgba(43, 179, 75, .16);
  --yellow: #eab308;
  --red: #ef4444;
  --blue: #0284c7;
  --shadow: 0 24px 70px rgba(15, 23, 42, .12);
  --shadow-soft: 0 12px 34px rgba(15, 23, 42, .08);
}

* {
  box-sizing: border-box;
}

html,
body {
  min-height: 100%;
  margin: 0;
}

body {
  background:
    radial-gradient(circle at 32% 0%, rgba(43, 179, 75, .12), transparent 28%),
    linear-gradient(145deg, #f8faf9, #eef5f0 54%, #f5f7f6);
  color: var(--ink);
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  letter-spacing: 0;
}

button,
a {
  font: inherit;
}

a {
  color: inherit;
}

.shell {
  display: grid;
  grid-template-columns: 260px 1fr;
  min-height: 100vh;
}

.sidebar {
  position: sticky;
  top: 0;
  height: 100vh;
  display: flex;
  flex-direction: column;
  gap: 24px;
  padding: 26px 18px;
  border-right: 1px solid var(--line);
  background: rgba(255, 255, 255, .78);
  box-shadow: var(--shadow-soft);
  backdrop-filter: blur(22px);
}

.brand {
  display: flex;
  align-items: flex-start;
  justify-content: center;
  gap: 12px;
  min-height: 122px;
  text-decoration: none;
}

.brand img {
  width: 92px;
  height: 108px;
  object-fit: contain;
}

.brand span {
  display: none;
  color: var(--ink);
  font-weight: 820;
  letter-spacing: .02em;
}

.nav {
  display: grid;
  gap: 8px;
}

.nav-item {
  width: 100%;
  min-height: 42px;
  padding: 10px 12px;
  border: 1px solid transparent;
  border-radius: 14px;
  background: transparent;
  color: #334155;
  text-align: left;
  cursor: pointer;
}

.nav-item:hover,
.nav-item.active {
  border-color: rgba(43, 179, 75, .34);
  background: var(--green-soft);
  color: #0f172a;
}

.sidebar-note {
  margin-top: auto;
  padding: 16px;
  border: 1px solid var(--line);
  border-radius: 18px;
  background: var(--surface-2);
}

.sidebar-note strong,
.sidebar-note span {
  display: block;
}

.sidebar-note strong {
  color: var(--green);
  margin-bottom: 8px;
}

.sidebar-note span {
  color: var(--soft);
  font-size: .9rem;
  line-height: 1.35;
}

.main {
  min-width: 0;
  padding: 30px;
}

.topbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
  margin-bottom: 28px;
}

.eyebrow {
  margin: 0 0 8px;
  color: var(--green);
  font-size: .76rem;
  font-weight: 850;
  letter-spacing: .12em;
  text-transform: uppercase;
}

h1,
h2,
h3,
p {
  margin: 0;
}

h1 {
  font-size: clamp(2rem, 4vw, 3.6rem);
  line-height: 1;
}

h2 {
  font-size: clamp(2rem, 3.6vw, 4rem);
  line-height: 1.02;
  max-width: 1060px;
}

h3 {
  font-size: 1.22rem;
}

p {
  color: var(--soft);
  line-height: 1.45;
}

.topbar-actions {
  display: flex;
  gap: 10px;
}

.primary-button,
.ghost-button,
.chip {
  min-height: 42px;
  padding: 0 16px;
  border-radius: 999px;
  cursor: pointer;
}

.primary-button {
  border: 1px solid rgba(255, 255, 255, .18);
  background: linear-gradient(135deg, var(--green), #166534);
  color: #fff;
  font-weight: 780;
}

.ghost-button,
.chip {
  border: 1px solid var(--line);
  background: rgba(255, 255, 255, .055);
  color: var(--soft);
}

.chip.active,
.chip:hover,
.ghost-button:hover {
  border-color: rgba(43, 179, 75, .38);
  color: var(--ink);
}

.view {
  display: none;
}

.view.active {
  display: block;
}

.glass,
.panel,
.project-card,
.pipeline-stage,
.inbox-card,
.supabase-project-row,
.access-card,
.playbook-card,
.project-entity-panel {
  border: 1px solid rgba(15, 23, 42, .1);
  background:
    linear-gradient(135deg, rgba(255, 255, 255, .92), rgba(255, 255, 255, .64)),
    var(--glass);
  box-shadow: var(--shadow);
  backdrop-filter: blur(20px) saturate(1.08);
}

.hero-grid {
  display: grid;
  grid-template-columns: minmax(0, 1.55fr) minmax(320px, .7fr);
  gap: 18px;
}

.hero-card,
.health-card,
.panel {
  border-radius: 26px;
  padding: 24px;
}

.hero-card h2 {
  max-width: 760px;
}

.hero-card p {
  max-width: 760px;
  margin-top: 18px;
  font-size: 1.05rem;
}

.hero-pills,
.inbox-toolbar {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin-top: 22px;
}

.pill {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  min-height: 34px;
  padding: 8px 12px;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: rgba(255, 255, 255, .68);
  color: var(--soft);
  font-size: .9rem;
}

.pill b {
  color: var(--ink);
}

.health-card {
  display: grid;
  align-content: center;
  gap: 12px;
}

.status-dot {
  width: 16px;
  height: 16px;
  border-radius: 999px;
  background: var(--green);
  box-shadow: 0 0 0 10px rgba(43, 179, 75, .14);
}

.health-card strong {
  font-size: 1.4rem;
}

.metric-grid {
  display: grid;
  grid-template-columns: repeat(5, minmax(0, 1fr));
  gap: 14px;
  margin-top: 18px;
}

.metric-card {
  min-height: 126px;
  padding: 18px;
  border: 1px solid var(--line);
  border-radius: 22px;
  background: rgba(255, 255, 255, .78);
  box-shadow: var(--shadow-soft);
}

.metric-card span,
.metric-card small {
  display: block;
}

.metric-card span {
  color: var(--muted);
  font-size: .82rem;
}

.metric-card strong {
  display: block;
  margin-top: 12px;
  color: var(--ink);
  font-size: 1.9rem;
  line-height: 1;
}

.metric-card small {
  margin-top: 10px;
  color: var(--soft);
  line-height: 1.28;
}

.section-grid {
  display: grid;
  gap: 18px;
  margin-top: 18px;
}

.section-grid.two {
  grid-template-columns: repeat(2, minmax(0, 1fr));
}

.panel-head {
  display: flex;
  justify-content: space-between;
  gap: 16px;
  align-items: start;
  margin-bottom: 18px;
}

.panel-head a {
  color: var(--green);
  font-size: .92rem;
  text-decoration: none;
}

.mini-pipeline,
.inbox-list,
.risk-list,
.decision-list {
  display: grid;
  gap: 10px;
}

.mini-stage,
.inbox-row,
.risk-row,
.decision-row {
  display: grid;
  gap: 8px;
  padding: 14px;
  border: 1px solid var(--line);
  border-radius: 16px;
  background: rgba(255, 255, 255, .66);
}

.mini-stage {
  grid-template-columns: 1fr auto;
  align-items: center;
}

.tag {
  display: inline-flex;
  align-items: center;
  width: fit-content;
  min-height: 26px;
  padding: 5px 9px;
  border-radius: 999px;
  background: rgba(43, 179, 75, .14);
  color: var(--green);
  font-size: .76rem;
  font-weight: 820;
}

.tag.yellow {
  background: rgba(234, 179, 8, .12);
  color: var(--yellow);
}

.tag.red {
  background: rgba(239, 68, 68, .12);
  color: var(--red);
}

.tag.blue {
  background: rgba(56, 189, 248, .12);
  color: var(--blue);
}

.section-intro {
  margin-bottom: 22px;
}

.section-intro p {
  margin-top: 14px;
  max-width: 900px;
}

.pipeline-board {
  display: grid;
  grid-template-columns: repeat(6, minmax(250px, 1fr));
  gap: 14px;
  overflow-x: auto;
  padding-bottom: 6px;
}

.pipeline-stage {
  min-height: 420px;
  padding: 16px;
  border-radius: 24px;
}

.pipeline-stage header {
  display: grid;
  gap: 8px;
  margin-bottom: 14px;
}

.pipeline-stage h3 {
  margin: 0;
}

.pipeline-stage p {
  font-size: .86rem;
  line-height: 1.35;
}

.stage-checks {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}

.stage-checks span {
  min-height: 24px;
  padding: 4px 8px;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: rgba(255, 255, 255, .7);
  color: var(--muted);
  font-size: .72rem;
  font-weight: 720;
}

.stage-card {
  display: grid;
  gap: 10px;
  padding: 14px;
  border: 1px solid var(--line);
  border-radius: 16px;
  background: rgba(255, 255, 255, .78);
  margin-bottom: 10px;
  cursor: pointer;
  text-align: left;
  width: 100%;
  color: inherit;
}

.stage-card:hover,
.stage-card.active,
.project-card:hover {
  transform: translateY(-2px);
  border-color: rgba(43, 179, 75, .35);
}

.stage-card strong {
  color: var(--ink);
}

.stage-card span {
  color: var(--soft);
  font-size: .88rem;
  line-height: 1.32;
}

.stage-card small,
.project-card small {
  color: var(--muted);
  line-height: 1.3;
}

.stage-card small b {
  color: var(--ink);
}

.stage-card-foot {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  align-items: center;
}

.pipeline-toolbar {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 12px;
  margin-bottom: 16px;
}

.gate-card {
  padding: 14px;
  border: 1px solid var(--line);
  border-radius: 18px;
  background: rgba(255, 255, 255, .72);
  box-shadow: var(--shadow-soft);
}

.gate-card b,
.gate-card span {
  display: block;
}

.gate-card b {
  color: var(--ink);
  margin-bottom: 6px;
}

.gate-card span {
  color: var(--soft);
  font-size: .86rem;
  line-height: 1.32;
}

.project-grid,
.playbook-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 16px;
}

.project-card,
.playbook-card {
  display: grid;
  gap: 14px;
  min-height: 260px;
  padding: 20px;
  border-radius: 24px;
}

.project-card {
  cursor: pointer;
  text-align: left;
  color: inherit;
  transition: transform .18s ease, border-color .18s ease;
}

.project-card.active {
  border-color: rgba(43, 179, 75, .42);
  box-shadow: 0 22px 60px rgba(43, 179, 75, .12);
}

.project-card p,
.playbook-card p {
  font-size: .94rem;
}

.meta-list {
  display: grid;
  gap: 8px;
}

.meta-list div {
  display: grid;
  grid-template-columns: 116px 1fr;
  gap: 12px;
  padding: 10px 12px;
  border: 1px solid var(--line);
  border-radius: 14px;
  background: rgba(255, 255, 255, .64);
}

.entity-layout {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(360px, .55fr);
  gap: 18px;
  align-items: start;
}

.project-entity-panel {
  position: sticky;
  top: 30px;
  display: grid;
  gap: 16px;
  min-height: 520px;
  padding: 22px;
  border-radius: 26px;
}

.entity-head {
  display: grid;
  gap: 10px;
}

.entity-title-row {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  align-items: start;
}

.entity-title-row h3 {
  font-size: 1.7rem;
}

.entity-section {
  display: grid;
  gap: 8px;
}

.entity-section h4 {
  margin: 0;
  color: var(--ink);
  font-size: .92rem;
}

.entity-list {
  display: grid;
  gap: 8px;
}

.entity-list div {
  display: grid;
  grid-template-columns: 112px 1fr;
  gap: 10px;
  padding: 10px 12px;
  border: 1px solid var(--line);
  border-radius: 14px;
  background: rgba(255, 255, 255, .68);
}

.entity-list b {
  color: var(--green);
  font-size: .76rem;
  text-transform: uppercase;
  letter-spacing: .08em;
}

.entity-list span {
  color: var(--soft);
  font-size: .9rem;
  line-height: 1.32;
}

.meta-list b {
  color: var(--green);
  font-size: .78rem;
  letter-spacing: .08em;
  text-transform: uppercase;
}

.meta-list span {
  color: var(--soft);
  font-size: .88rem;
  line-height: 1.3;
}

.inbox-toolbar {
  margin: 0 0 18px;
}

.email-flow {
  display: grid;
  grid-template-columns: repeat(5, minmax(0, 1fr));
  gap: 10px;
  margin-bottom: 16px;
}

.email-flow div {
  position: relative;
  min-height: 102px;
  padding: 14px;
  border: 1px solid var(--line);
  border-radius: 18px;
  background: rgba(255, 255, 255, .72);
  box-shadow: var(--shadow-soft);
}

.email-flow div:not(:last-child)::after {
  content: "";
  position: absolute;
  top: 50%;
  right: -9px;
  width: 8px;
  height: 8px;
  border-top: 2px solid rgba(43, 179, 75, .42);
  border-right: 2px solid rgba(43, 179, 75, .42);
  transform: translateY(-50%) rotate(45deg);
}

.email-flow b,
.email-flow span {
  display: block;
}

.email-flow b {
  color: var(--ink);
  margin-bottom: 8px;
}

.email-flow span {
  color: var(--soft);
  font-size: .86rem;
  line-height: 1.32;
}

.email-workbench {
  display: grid;
  grid-template-columns: minmax(260px, .72fr) minmax(320px, .95fr) minmax(380px, 1.2fr);
  gap: 16px;
  align-items: start;
}

.supabase-layout {
  display: grid;
  grid-template-columns: minmax(0, 1.1fr) minmax(360px, .9fr);
  gap: 18px;
  margin-bottom: 18px;
}

.supabase-main {
  display: grid;
  align-content: start;
  gap: 16px;
}

.supabase-org-box {
  display: grid;
  gap: 8px;
  padding: 14px;
  border: 1px solid rgba(43, 179, 75, .24);
  border-radius: 18px;
  background: rgba(43, 179, 75, .08);
}

.supabase-org-box code,
.supabase-org-box a {
  overflow-wrap: anywhere;
}

.supabase-org-box code {
  color: var(--ink);
  font-weight: 820;
}

.supabase-org-box a {
  color: var(--green);
  text-decoration: none;
}

.supabase-stats {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
}

.supabase-checklist,
.supabase-project-list,
.table-chip-grid {
  display: grid;
  gap: 10px;
}

.supabase-step,
.supabase-project-row {
  width: 100%;
  border: 1px solid var(--line);
  border-radius: 18px;
  background: rgba(255, 255, 255, .68);
}

.supabase-step {
  display: grid;
  grid-template-columns: auto 1fr auto;
  gap: 12px;
  align-items: start;
  padding: 14px;
}

.supabase-step strong,
.supabase-project-row strong {
  display: block;
  color: var(--ink);
}

.supabase-step p,
.supabase-project-row span {
  display: block;
  margin-top: 4px;
  color: var(--soft);
  font-size: .9rem;
}

.supabase-step small {
  color: var(--muted);
}

.supabase-project-row {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 14px;
  align-items: center;
  padding: 14px;
  color: inherit;
  cursor: pointer;
  text-align: left;
}

.deploy-layout {
  display: grid;
  grid-template-columns: minmax(0, 1.15fr) minmax(360px, .85fr);
  gap: 18px;
  margin-bottom: 18px;
}

.deploy-main,
.deploy-checklist,
.deploy-tree,
.deploy-project-rules {
  display: grid;
  gap: 10px;
}

.deploy-summary {
  display: grid;
  gap: 8px;
  margin: 14px 0;
}

.deploy-summary div,
.deploy-step,
.deploy-path {
  display: grid;
  gap: 10px;
  padding: 14px;
  border: 1px solid var(--line);
  border-radius: 18px;
  background: rgba(255, 255, 255, .68);
}

.deploy-summary div {
  grid-template-columns: 132px 1fr;
  align-items: start;
}

.deploy-summary b,
.deploy-path strong,
.deploy-step strong {
  color: var(--ink);
}

.deploy-summary span,
.deploy-summary code,
.deploy-path code,
.deploy-step p,
.deploy-project-rules li {
  color: var(--soft);
  line-height: 1.35;
}

.deploy-summary code,
.deploy-path code {
  overflow-wrap: anywhere;
  font-size: .84rem;
}

.deploy-step {
  grid-template-columns: auto 1fr auto;
  align-items: start;
}

.deploy-step small {
  color: var(--muted);
}

.deploy-path {
  grid-template-columns: minmax(180px, .55fr) minmax(0, 1fr);
  align-items: start;
}

.deploy-project-rules ol {
  display: grid;
  gap: 10px;
  margin: 0;
  padding-left: 18px;
}

.supabase-project-row:hover {
  transform: translateY(-2px);
  border-color: rgba(43, 179, 75, .35);
}

.table-chip-grid {
  grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
}

.table-chip {
  min-height: 40px;
  padding: 10px 12px;
  border: 1px solid var(--line);
  border-radius: 14px;
  background: rgba(255, 255, 255, .72);
  color: var(--soft);
  font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, monospace;
  font-size: .82rem;
}

.mailbox-list,
.thread-list-panel,
.email-detail {
  min-height: 560px;
  padding: 16px;
  border: 1px solid rgba(15, 23, 42, .1);
  border-radius: 24px;
  background:
    linear-gradient(135deg, rgba(255, 255, 255, .92), rgba(255, 255, 255, .66)),
    var(--glass);
  box-shadow: var(--shadow);
  backdrop-filter: blur(20px) saturate(1.08);
}

.mailbox-list,
.thread-list {
  display: grid;
  gap: 10px;
}

.inbox-card,
.thread-card {
  display: grid;
  gap: 10px;
  width: 100%;
  padding: 14px;
  border: 1px solid var(--line);
  border-radius: 18px;
  background: rgba(255, 255, 255, .72);
  color: inherit;
  text-align: left;
  cursor: pointer;
}

.inbox-card:hover,
.inbox-card.active,
.thread-card:hover,
.thread-card.active {
  border-color: rgba(43, 179, 75, .38);
  box-shadow: var(--shadow-soft);
}

.inbox-card header,
.thread-card header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
}

.inbox-card h3,
.thread-card h4,
.email-detail h3 {
  margin: 0;
}

.inbox-card code {
  color: var(--ink);
  font-size: 1.02rem;
  word-break: break-word;
}

.inbox-card p,
.thread-card p,
.email-detail p {
  font-size: .9rem;
}

.mailbox-meta,
.thread-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}

.thread-card strong,
.thread-card span {
  display: block;
}

.thread-card strong {
  color: var(--ink);
}

.thread-card span {
  color: var(--muted);
  font-size: .82rem;
}

.panel-head.compact {
  margin-bottom: 12px;
}

.email-detail {
  display: grid;
  gap: 14px;
}

.email-detail-head {
  display: grid;
  gap: 10px;
}

.email-body,
.reply-box,
.integration-box {
  padding: 14px;
  border: 1px solid var(--line);
  border-radius: 18px;
  background: rgba(255, 255, 255, .7);
}

.reply-box {
  display: grid;
  gap: 10px;
}

.reply-box textarea {
  width: 100%;
  min-height: 132px;
  resize: vertical;
  padding: 12px;
  border: 1px solid var(--line);
  border-radius: 14px;
  background: rgba(255, 255, 255, .88);
  color: var(--ink);
  font: inherit;
}

.reply-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.integration-box {
  display: grid;
  gap: 8px;
}

.integration-box ol {
  display: grid;
  gap: 8px;
  margin: 0;
  padding-left: 18px;
  color: var(--soft);
  font-size: .9rem;
}

.access-matrix {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 14px;
}

.access-card {
  min-height: 220px;
  padding: 18px;
  border-radius: 22px;
}

.access-card h3 {
  color: var(--green);
}

.access-card ul {
  display: grid;
  gap: 8px;
  padding-left: 18px;
  color: var(--soft);
}

.finance-layout {
  display: grid;
  grid-template-columns: .8fr 1.2fr;
  gap: 18px;
}

.formula {
  display: grid;
  gap: 10px;
  margin-top: 14px;
}

.formula span,
.formula strong {
  padding: 14px;
  border: 1px solid var(--line);
  border-radius: 16px;
  background: rgba(255, 255, 255, .68);
}

.formula strong {
  border-color: rgba(43, 179, 75, .34);
  background: var(--green-soft);
}

.finance-table,
.decision-table {
  display: grid;
  gap: 8px;
}

.table-row {
  display: grid;
  grid-template-columns: 1.2fr repeat(4, minmax(90px, 1fr));
  gap: 8px;
  align-items: center;
  padding: 12px;
  border: 1px solid var(--line);
  border-radius: 16px;
  background: rgba(255, 255, 255, .68);
}

.table-row.head {
  color: var(--muted);
  font-size: .78rem;
  font-weight: 820;
  letter-spacing: .08em;
  text-transform: uppercase;
}

.decision-table .table-row {
  grid-template-columns: .9fr 1.1fr 1.4fr .9fr;
}

.table-row span {
  color: var(--soft);
  font-size: .9rem;
}

.table-row strong {
  color: var(--ink);
}

@media (max-width: 1180px) {
  .shell {
    grid-template-columns: 1fr;
  }

  .sidebar {
    position: static;
    height: auto;
  }

  .nav {
    grid-template-columns: repeat(4, minmax(0, 1fr));
  }

  .sidebar-note {
    display: none;
  }

  .hero-grid,
  .section-grid.two,
  .finance-layout,
  .entity-layout,
  .supabase-layout,
  .deploy-layout {
    grid-template-columns: 1fr;
  }

  .metric-grid,
  .project-grid,
  .access-matrix,
  .playbook-grid,
  .pipeline-toolbar,
  .email-flow {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .project-entity-panel {
    position: static;
  }

  .email-workbench {
    grid-template-columns: 1fr;
  }

  .mailbox-list,
  .thread-list-panel,
  .email-detail {
    min-height: auto;
  }
}

@media (max-width: 760px) {
  .main {
    padding: 18px;
  }

  .topbar,
  .topbar-actions {
    align-items: stretch;
    flex-direction: column;
  }

  .nav,
  .metric-grid,
  .project-grid,
  .access-matrix,
  .playbook-grid,
  .pipeline-toolbar,
  .email-flow {
    grid-template-columns: 1fr;
  }

  .brand {
    min-height: 92px;
    justify-content: flex-start;
  }

  .brand img {
    width: 74px;
    height: 86px;
  }

  .email-flow div::after {
    display: none;
  }

  .table-row,
  .decision-table .table-row,
  .meta-list div,
  .entity-list div,
  .deploy-summary div,
  .deploy-step,
  .deploy-path {
    grid-template-columns: 1fr;
  }
}

/* Corporate control app pass */
:root {
  --bg: #f4f6f8;
  --bg-2: #eef2f4;
  --surface: #ffffff;
  --surface-2: #f7faf8;
  --glass: #ffffff;
  --line: #dbe3df;
  --ink: #111827;
  --soft: #374151;
  --muted: #6b7280;
  --green: #279a43;
  --green-soft: #e8f6ec;
  --yellow: #b7791f;
  --red: #c24132;
  --blue: #2563eb;
  --shadow: 0 1px 2px rgba(16, 24, 40, .06), 0 8px 22px rgba(16, 24, 40, .06);
  --shadow-soft: 0 1px 2px rgba(16, 24, 40, .06);
}

body {
  background: var(--bg);
  color: var(--ink);
}

.shell {
  grid-template-columns: 244px minmax(0, 1fr);
}

.sidebar {
  gap: 16px;
  padding: 18px 14px;
  border-right: 1px solid #172033;
  background: #0f172a;
  box-shadow: none;
  backdrop-filter: none;
}

.brand {
  min-height: 104px;
  align-items: center;
  justify-content: flex-start;
  padding: 8px 10px;
  border-bottom: 1px solid rgba(255, 255, 255, .1);
}

.brand img {
  width: 82px;
  height: 96px;
}

.nav {
  gap: 4px;
}

.nav-item {
  min-height: 38px;
  padding: 9px 10px;
  border-radius: 8px;
  color: #cbd5e1;
  font-size: .92rem;
}

.nav-item:hover,
.nav-item.active {
  border-color: rgba(74, 222, 128, .2);
  background: rgba(43, 179, 75, .16);
  color: #ffffff;
}

.sidebar-note {
  padding: 12px;
  border-color: rgba(255, 255, 255, .1);
  border-radius: 8px;
  background: rgba(255, 255, 255, .055);
}

.sidebar-note strong {
  color: #86efac;
}

.sidebar-note span {
  color: #cbd5e1;
}

.main {
  padding: 0;
}

.topbar {
  position: sticky;
  top: 0;
  z-index: 10;
  min-height: 82px;
  margin: 0;
  padding: 18px 28px;
  border-bottom: 1px solid var(--line);
  background: rgba(255, 255, 255, .94);
  backdrop-filter: blur(14px);
}

.view {
  padding: 22px 28px 30px;
}

h1 {
  font-size: 1.52rem;
  line-height: 1.18;
}

h2 {
  max-width: 920px;
  font-size: 1.5rem;
  line-height: 1.2;
}

h3 {
  font-size: 1rem;
}

p {
  color: var(--soft);
  line-height: 1.42;
}

.eyebrow {
  margin-bottom: 5px;
  color: var(--muted);
  font-size: .68rem;
  letter-spacing: .1em;
}

.workspace-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-top: 8px;
}

.workspace-meta span,
.system-badge {
  display: inline-flex;
  align-items: center;
  min-height: 24px;
  padding: 4px 8px;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: #f8fafc;
  color: var(--muted);
  font-size: .74rem;
  font-weight: 700;
}

.system-badge.green {
  border-color: #b7e8c4;
  background: #edf9f0;
  color: #166534;
}

.system-badge.yellow {
  border-color: #f3d99a;
  background: #fff8e1;
  color: #8a5a00;
}

.topbar-actions {
  align-items: center;
}

.primary-button,
.ghost-button,
.chip {
  min-height: 36px;
  padding: 0 12px;
  border-radius: 8px;
  font-size: .88rem;
}

.primary-button {
  border-color: #1e7d37;
  background: #279a43;
  box-shadow: var(--shadow-soft);
}

.ghost-button,
.chip {
  background: #ffffff;
  color: var(--soft);
}

.control-toolbar {
  display: grid;
  grid-template-columns: minmax(260px, 420px) 1fr;
  gap: 14px;
  align-items: center;
  margin-bottom: 14px;
  padding: 12px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #ffffff;
  box-shadow: var(--shadow-soft);
}

.toolbar-search {
  display: grid;
  grid-template-columns: auto 1fr;
  gap: 10px;
  align-items: center;
  padding: 8px 10px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #f9fafb;
  color: var(--muted);
  font-size: .82rem;
  font-weight: 750;
}

.toolbar-search input {
  min-width: 0;
  border: 0;
  outline: 0;
  background: transparent;
  color: var(--ink);
  font: inherit;
}

.toolbar-status {
  display: flex;
  flex-wrap: wrap;
  justify-content: flex-end;
  gap: 8px;
}

.glass,
.panel,
.project-card,
.pipeline-stage,
.inbox-card,
.supabase-project-row,
.access-card,
.playbook-card,
.project-entity-panel,
.mailbox-list,
.thread-list-panel,
.email-detail {
  border: 1px solid var(--line);
  background: var(--surface);
  box-shadow: var(--shadow-soft);
  backdrop-filter: none;
}

.hero-grid {
  grid-template-columns: minmax(0, 1fr) 360px;
  gap: 14px;
}

.hero-card,
.health-card,
.panel,
.mailbox-list,
.thread-list-panel,
.email-detail {
  border-radius: 8px;
  padding: 16px;
}

.hero-card p {
  max-width: 780px;
  margin-top: 8px;
  font-size: .95rem;
}

.hero-pills,
.inbox-toolbar {
  gap: 8px;
  margin-top: 14px;
}

.pill,
.tag {
  border-radius: 999px;
}

.pill {
  min-height: 28px;
  padding: 5px 8px;
  background: #f9fafb;
  font-size: .78rem;
}

.health-card {
  align-content: start;
  gap: 10px;
}

.health-card strong {
  font-size: 1rem;
}

.status-dot {
  width: 10px;
  height: 10px;
  box-shadow: 0 0 0 6px rgba(39, 154, 67, .12);
}

.metric-grid {
  grid-template-columns: repeat(6, minmax(0, 1fr));
  gap: 10px;
  margin-top: 14px;
}

.metric-card {
  min-height: 86px;
  padding: 12px;
  border-radius: 8px;
  background: #ffffff;
}

.metric-card span {
  font-size: .72rem;
  font-weight: 760;
  text-transform: uppercase;
  letter-spacing: .06em;
}

.metric-card strong {
  margin-top: 8px;
  font-size: 1.35rem;
}

.metric-card small {
  margin-top: 6px;
  font-size: .78rem;
}

.portfolio-control-panel {
  margin-top: 14px;
}

.portfolio-control-table {
  display: grid;
  gap: 0;
  overflow-x: auto;
  border: 1px solid var(--line);
  border-radius: 8px;
}

.ops-table-row {
  display: grid;
  grid-template-columns: minmax(180px, 1.2fr) 120px 120px 80px 90px 72px minmax(260px, 1.5fr);
  gap: 12px;
  align-items: center;
  width: 100%;
  min-width: 980px;
  padding: 11px 12px;
  border: 0;
  border-bottom: 1px solid var(--line);
  background: #ffffff;
  color: inherit;
  text-align: left;
}

.ops-table-row:last-child {
  border-bottom: 0;
}

.ops-table-row:not(.ops-table-head) {
  cursor: pointer;
}

.ops-table-row:not(.ops-table-head):hover {
  background: #f7fbf8;
}

.ops-table-head {
  background: #f8fafc;
  color: var(--muted);
  font-size: .72rem;
  font-weight: 850;
  letter-spacing: .06em;
  text-transform: uppercase;
}

.ops-table-row strong {
  color: var(--ink);
}

.ops-table-row span {
  color: var(--soft);
  font-size: .84rem;
  line-height: 1.28;
}

.section-grid {
  gap: 14px;
  margin-top: 14px;
}

.panel-head {
  margin-bottom: 12px;
}

.panel-head a {
  color: #166534;
  font-size: .82rem;
  font-weight: 750;
}

.mini-stage,
.inbox-row,
.risk-row,
.decision-row,
.stage-card,
.gate-card,
.meta-list div,
.entity-list div,
.email-flow div,
.supabase-step,
.supabase-project-row,
.table-chip,
.inbox-card,
.thread-card,
.email-body,
.reply-box,
.integration-box,
.formula span,
.formula strong,
.table-row {
  border-radius: 8px;
  background: #ffffff;
  box-shadow: none;
}

.section-intro {
  margin-bottom: 14px;
  padding: 14px 16px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #ffffff;
}

.section-intro p {
  margin-top: 6px;
  max-width: 920px;
  font-size: .92rem;
}

.pipeline-board {
  grid-template-columns: repeat(6, minmax(230px, 1fr));
  gap: 10px;
}

.pipeline-stage {
  min-height: 380px;
  padding: 12px;
  border-radius: 8px;
}

.pipeline-stage p,
.stage-card span,
.stage-card small,
.project-card small,
.meta-list span,
.entity-list span {
  font-size: .8rem;
}

.project-grid,
.playbook-grid {
  gap: 12px;
}

.project-card,
.playbook-card,
.access-card {
  min-height: 0;
  padding: 14px;
  border-radius: 8px;
}

.project-card:hover,
.stage-card:hover,
.stage-card.active,
.project-card.active,
.supabase-project-row:hover {
  transform: none;
}

.entity-layout {
  grid-template-columns: minmax(0, 1fr) 420px;
  gap: 14px;
}

.project-entity-panel {
  top: 96px;
  min-height: 0;
  padding: 16px;
  border-radius: 8px;
}

.entity-title-row h3 {
  font-size: 1.16rem;
}

.email-workbench {
  gap: 12px;
}

.email-flow,
.supabase-layout,
.deploy-layout,
.finance-layout {
  gap: 12px;
}

.deploy-summary div,
.deploy-step,
.deploy-path {
  border-radius: 8px;
  background: #ffffff;
}

.deploy-layout {
  margin-bottom: 14px;
}

.deploy-summary {
  margin: 12px 0;
}

.email-flow div {
  min-height: 90px;
}

.access-matrix {
  gap: 12px;
}

.table-row {
  padding: 10px;
}

@media (max-width: 1180px) {
  .sidebar {
    background: #0f172a;
  }

  .hero-grid,
  .control-toolbar {
    grid-template-columns: 1fr;
  }

  .toolbar-status {
    justify-content: flex-start;
  }

  .metric-grid {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }
}

@media (max-width: 760px) {
  .view {
    padding: 16px;
  }

  .topbar {
    padding: 16px;
  }

  .metric-grid {
    grid-template-columns: 1fr;
  }

  .brand img {
    width: 70px;
    height: 82px;
  }
}
