@import url('https://fonts.googleapis.com/css2?family=Space+Grotesk:wght@500;600;700&family=IBM+Plex+Mono:wght@400;500;600;700&display=swap');

:root {
  --bg: #f1eadc;
  --panel: #fff9ee;
  --ink: #161616;
  --muted: #746d61;
  --line: #161616;
  --red: #d94d33;
  --yellow: #f3b63f;
  --green: #2d9b67;
  --blue: #3867d6;
  --coal: #202126;
  --shadow: 7px 7px 0 var(--line);
  --radius: 22px;
}

* {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
}

body {
  min-height: 100vh;
  margin: 0;
  color: var(--ink);
  background:
    linear-gradient(90deg, rgba(22,22,22,.05) 1px, transparent 1px),
    linear-gradient(rgba(22,22,22,.05) 1px, transparent 1px),
    var(--bg);
  background-size: 34px 34px;
  font-family: "Space Grotesk", system-ui, sans-serif;
}

button,
input,
select,
textarea {
  font: inherit;
}

button {
  cursor: pointer;
}

.grain {
  position: fixed;
  inset: 0;
  pointer-events: none;
  opacity: .15;
  background-image:
    radial-gradient(circle at 25% 35%, #000 0 1px, transparent 1px),
    radial-gradient(circle at 75% 65%, #000 0 1px, transparent 1px);
  background-size: 13px 13px;
}

.auth-screen {
  min-height: 100vh;
  display: grid;
  grid-template-columns: minmax(0, 1.1fr) minmax(420px, .9fr);
  gap: 24px;
  padding: 24px;
}

.identity-side,
.auth-card,
.nav-rail,
.topbar,
.panel,
.kpi,
.modal {
  background: var(--panel);
  border: 2px solid var(--line);
  box-shadow: var(--shadow);
}

.identity-side {
  border-radius: 30px;
  padding: clamp(28px, 5vw, 70px);
  min-height: calc(100vh - 48px);
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  background:
    radial-gradient(circle at 15% 10%, rgba(243,182,63,.38), transparent 25rem),
    radial-gradient(circle at 80% 85%, rgba(56,103,214,.2), transparent 28rem),
    var(--panel);
}

.label-chip {
  width: fit-content;
  display: flex;
  align-items: center;
  gap: 10px;
  border: 2px solid var(--line);
  border-radius: 999px;
  padding: 10px 14px;
  background: var(--bg);
  box-shadow: 4px 4px 0 var(--line);
  font-family: "IBM Plex Mono", monospace;
  font-weight: 700;
}

.label-chip span {
  width: 10px;
  height: 10px;
  border: 2px solid var(--line);
  border-radius: 50%;
  background: var(--green);
}

.identity-side h1 {
  max-width: 900px;
  margin: 56px 0 18px;
  font-size: clamp(3rem, 7vw, 6.8rem);
  line-height: .88;
  letter-spacing: -.08em;
}

.identity-side p {
  max-width: 720px;
  margin: 0;
  color: var(--muted);
  font-size: 1.15rem;
  line-height: 1.65;
}

.signal-board {
  max-width: 760px;
  border: 2px solid var(--line);
  border-radius: 24px;
  background: var(--coal);
  color: #f6efd9;
  padding: 18px;
  box-shadow: 7px 7px 0 var(--line);
}

.signal-row {
  display: flex;
  justify-content: space-between;
  border-bottom: 1px solid rgba(255,255,255,.15);
  padding: 12px 4px;
  font-family: "IBM Plex Mono", monospace;
}

.signal-danger,
.signal-warning,
.signal-good {
  border: 2px solid #000;
  border-radius: 999px;
  color: #000;
  padding: 3px 9px;
  font-weight: 900;
}

.signal-danger { background: var(--red); }
.signal-warning { background: var(--yellow); }
.signal-good { background: var(--green); }

.signal-board pre {
  margin: 18px 0 0;
  white-space: pre-wrap;
  font-family: "IBM Plex Mono", monospace;
  line-height: 1.6;
  color: #d8d0b8;
}

.auth-card {
  border-radius: 30px;
  padding: clamp(26px, 4vw, 44px);
  min-height: calc(100vh - 48px);
  display: flex;
  flex-direction: column;
  justify-content: center;
}

.brand,
.app-brand {
  display: flex;
  align-items: center;
  gap: 14px;
  color: inherit;
  text-decoration: none;
}

.brand-logo,
.app-brand span {
  width: 54px;
  height: 54px;
  display: grid;
  place-items: center;
  border: 2px solid var(--line);
  border-radius: 16px;
  background: var(--yellow);
  box-shadow: 4px 4px 0 var(--line);
  font-family: "IBM Plex Mono", monospace;
  font-weight: 900;
}

.brand strong,
.app-brand strong {
  display: block;
  font-size: 1.2rem;
}

.brand span {
  display: block;
  color: var(--muted);
  font-weight: 600;
}

.auth-tabs {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px;
  margin: 34px 0 14px;
  padding: 6px;
  border: 2px solid var(--line);
  border-radius: 18px;
  background: var(--bg);
}

.auth-tab {
  border: 0;
  border-radius: 12px;
  padding: 13px;
  background: transparent;
  color: var(--muted);
  font-weight: 900;
}

.auth-tab.active {
  background: var(--coal);
  color: #fff;
}

.auth-status {
  border: 2px solid var(--line);
  border-radius: 16px;
  background: #fff2cc;
  padding: 12px 14px;
  margin-bottom: 14px;
  font-weight: 800;
}

.auth-status.error {
  background: #ffd9d0;
}

.auth-status.success {
  background: #dff4df;
}

.auth-form {
  display: none;
  gap: 14px;
}

.auth-form.active {
  display: grid;
}

label {
  display: grid;
  gap: 8px;
  color: var(--muted);
  font-weight: 800;
}

input,
select,
textarea {
  width: 100%;
  border: 2px solid var(--line);
  border-radius: 14px;
  background: #fffdf8;
  color: var(--ink);
  outline: none;
  padding: 14px;
}

input:focus,
select:focus,
textarea:focus {
  box-shadow: 4px 4px 0 var(--yellow);
}

.solid-btn,
.outline-btn,
.google-btn {
  border: 2px solid var(--line);
  border-radius: 14px;
  font-weight: 900;
  transition: transform .14s ease, box-shadow .14s ease;
}

.solid-btn {
  background: var(--coal);
  color: #fff;
  padding: 14px 18px;
  box-shadow: 4px 4px 0 var(--yellow);
}

.outline-btn {
  background: var(--panel);
  color: var(--ink);
  padding: 12px 16px;
  box-shadow: 3px 3px 0 var(--line);
}

.google-btn {
  background: #fff;
  color: var(--ink);
  padding: 13px 18px;
  box-shadow: 4px 4px 0 var(--line);
  display: flex;
  justify-content: center;
  align-items: center;
  gap: 12px;
}

.google-btn span {
  width: 28px;
  height: 28px;
  display: grid;
  place-items: center;
  border: 2px solid var(--line);
  border-radius: 50%;
  color: var(--blue);
  font-weight: 900;
}

.solid-btn:hover,
.outline-btn:hover,
.google-btn:hover {
  transform: translate(-2px, -2px);
}

.solid-btn:disabled,
.outline-btn:disabled,
.google-btn:disabled {
  cursor: not-allowed;
  opacity: .65;
  transform: none;
}

.separator {
  display: grid;
  grid-template-columns: 1fr auto 1fr;
  gap: 12px;
  align-items: center;
  margin: 20px 0;
  color: var(--muted);
  font-family: "IBM Plex Mono", monospace;
  font-size: .85rem;
}

.separator span {
  height: 2px;
  background: var(--line);
  opacity: .25;
}

.small-note {
  margin: 18px 0 0;
  color: var(--muted);
  font-size: .9rem;
  line-height: 1.55;
}

.app-screen {
  min-height: 100vh;
  display: grid;
  grid-template-columns: 270px minmax(0, 1fr);
  gap: 18px;
  padding: 18px;
}

.nav-rail {
  position: sticky;
  top: 18px;
  height: calc(100vh - 36px);
  border-radius: 28px;
  padding: 20px;
  display: flex;
  flex-direction: column;
}

.app-brand span {
  width: 44px;
  height: 44px;
  font-size: .9rem;
}

.nav-rail nav {
  display: grid;
  gap: 10px;
  margin: 34px 0;
}

.nav-link {
  border: 2px solid transparent;
  border-radius: 14px;
  background: transparent;
  color: var(--muted);
  text-align: left;
  padding: 13px 14px;
  font-weight: 900;
}

.nav-link.active,
.nav-link:hover {
  background: var(--coal);
  color: #fff;
  border-color: var(--line);
}

.workspace-card {
  margin-top: auto;
  border: 2px solid var(--line);
  border-radius: 18px;
  background: var(--bg);
  padding: 18px;
}

.workspace-card small,
.eyebrow,
.panel small {
  display: block;
  font-family: "IBM Plex Mono", monospace;
  text-transform: uppercase;
  letter-spacing: .12em;
  font-size: .72rem;
  color: var(--muted);
  font-weight: 800;
}

.workspace-card b {
  display: block;
  margin: 8px 0 4px;
}

.workspace-card span {
  color: var(--muted);
  font-weight: 700;
  word-break: break-word;
}

.workspace {
  min-width: 0;
}

.topbar {
  border-radius: 28px;
  padding: 20px 22px;
  display: flex;
  justify-content: space-between;
  gap: 18px;
  align-items: center;
  margin-bottom: 18px;
}

.topbar h2 {
  margin: 2px 0 0;
  font-size: clamp(2.2rem, 5vw, 4rem);
  line-height: .9;
  letter-spacing: -.08em;
}

.account {
  display: flex;
  align-items: center;
  gap: 12px;
}

.account b {
  display: block;
}

.account span {
  display: block;
  color: var(--muted);
  font-size: .9rem;
}

.avatar {
  width: 44px;
  height: 44px;
  border: 2px solid var(--line);
  border-radius: 50%;
  background: var(--green);
  color: #fff;
  display: grid;
  place-items: center;
  font-weight: 900;
}

.view {
  display: none;
}

.view.active {
  display: block;
}

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

.kpi {
  border-radius: 22px;
  padding: 20px;
}

.kpi span {
  color: var(--muted);
  font-weight: 800;
}

.kpi b {
  display: block;
  margin: 12px 0;
  font-size: 3rem;
  line-height: 1;
  letter-spacing: -.08em;
}

.kpi small {
  color: var(--muted);
  font-family: "IBM Plex Mono", monospace;
}

.kpi.red { background: #ffe0d9; }
.kpi.green { background: #ddf4df; }
.kpi.yellow { background: #fff0c5; }
.kpi.blue { background: #dfe8ff; }

.overview-grid,
.split {
  display: grid;
  grid-template-columns: minmax(0, 1.25fr) minmax(330px, .75fr);
  gap: 18px;
}

.panel {
  border-radius: 24px;
  padding: 22px;
}

.primary-panel {
  min-height: 390px;
}

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

.panel h3 {
  margin: 7px 0 0;
  font-size: clamp(1.45rem, 2.6vw, 2.25rem);
  line-height: 1;
  letter-spacing: -.06em;
}

.panel p {
  color: var(--muted);
  line-height: 1.65;
}

.severity,
.badge {
  border: 2px solid var(--line);
  border-radius: 999px;
  padding: 7px 11px;
  font-family: "IBM Plex Mono", monospace;
  font-size: .8rem;
  font-weight: 900;
  white-space: nowrap;
}

.severity,
.badge.bad {
  background: var(--red);
  color: #fff;
}

.badge.good {
  background: var(--green);
  color: #fff;
}

.badge.warn {
  background: var(--yellow);
  color: var(--ink);
}

.flow {
  display: grid;
  grid-template-columns: 1fr 60px 1fr 60px 1fr;
  align-items: center;
  margin: 42px 0;
}

.node {
  border: 2px solid var(--line);
  border-radius: 18px;
  padding: 22px 14px;
  text-align: center;
  box-shadow: 5px 5px 0 var(--line);
  font-family: "IBM Plex Mono", monospace;
  font-weight: 900;
}

.node.good { background: #ddf4df; }
.node.bad { background: #ffe0d9; }
.node.warn { background: #fff0c5; }

.line {
  height: 4px;
  background: var(--line);
}

.line.dashed {
  background: repeating-linear-gradient(90deg, var(--red) 0 9px, transparent 9px 15px);
}

.actions {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  margin-top: 22px;
}

.compact {
  padding: 10px 14px;
  font-size: .9rem;
}

.meter {
  height: 18px;
  border: 2px solid var(--line);
  border-radius: 999px;
  background: var(--bg);
  overflow: hidden;
  margin-top: 22px;
}

.meter span {
  display: block;
  width: 78%;
  height: 100%;
  background: repeating-linear-gradient(45deg, var(--red), var(--red) 8px, var(--yellow) 8px, var(--yellow) 16px);
}

.list,
.deploy-list {
  display: grid;
  gap: 12px;
}

.list-item,
.deploy-item {
  border: 2px solid var(--line);
  border-radius: 18px;
  background: var(--bg);
  padding: 16px;
  box-shadow: 4px 4px 0 var(--line);
}

.list-item {
  cursor: pointer;
}

.list-item:hover,
.deploy-item:hover {
  background: #fff2cc;
}

.item-top {
  display: flex;
  justify-content: space-between;
  gap: 14px;
}

.item-top b {
  display: block;
  font-size: 1.05rem;
}

.item-top small,
.item-meta {
  display: block;
  color: var(--muted);
  font-weight: 700;
}

.service-bar {
  height: 12px;
  border: 2px solid var(--line);
  background: var(--panel);
  border-radius: 999px;
  overflow: hidden;
  margin: 14px 0 8px;
}

.service-bar span {
  display: block;
  height: 100%;
  background: var(--green);
}

.service-bar.mid span {
  background: var(--yellow);
}

.service-bar.low span {
  background: var(--red);
}

.detail {
  min-height: 430px;
}

.empty {
  min-height: 310px;
  display: grid;
  place-items: center;
  text-align: center;
  border: 2px dashed rgba(22,22,22,.25);
  border-radius: 18px;
  color: var(--muted);
  font-weight: 800;
}

.detail-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0,1fr));
  gap: 12px;
  margin: 18px 0;
}

.detail-tile {
  border: 2px solid var(--line);
  border-radius: 16px;
  background: var(--bg);
  padding: 16px;
}

.detail-tile span {
  color: var(--muted);
  font-weight: 800;
}

.detail-tile b {
  display: block;
  margin-top: 6px;
  font-size: 1.65rem;
  letter-spacing: -.06em;
}

.deploy-item {
  display: grid;
  grid-template-columns: 1.2fr .7fr .7fr .8fr auto;
  gap: 12px;
  align-items: center;
}

.copilot-form {
  display: grid;
  gap: 12px;
  margin-top: 18px;
}

textarea {
  min-height: 180px;
  resize: vertical;
}

.ai-output {
  border: 2px solid var(--line);
  border-radius: 18px;
  background: var(--bg);
  padding: 18px;
  margin-top: 18px;
  color: var(--muted);
  line-height: 1.65;
}

.ai-output h4 {
  color: var(--ink);
  margin: 0 0 10px;
}

dialog {
  border: 0;
  background: transparent;
  padding: 0;
}

dialog::backdrop {
  background: rgba(22,22,22,.55);
}

.modal {
  width: min(480px, calc(100vw - 28px));
  border-radius: 24px;
  padding: 24px;
  display: grid;
  gap: 14px;
  position: relative;
}

.modal h3 {
  margin: 0;
  font-size: 2rem;
  letter-spacing: -.06em;
}

.modal-close {
  position: absolute;
  right: 14px;
  top: 14px;
  width: 36px;
  height: 36px;
  border: 2px solid var(--line);
  border-radius: 50%;
  background: var(--panel);
  font-weight: 900;
}

.toast {
  position: fixed;
  right: 22px;
  bottom: 22px;
  z-index: 20;
  max-width: 380px;
  border: 2px solid var(--line);
  border-radius: 18px;
  background: var(--coal);
  color: #fff;
  padding: 14px 16px;
  box-shadow: 5px 5px 0 var(--yellow);
  font-weight: 900;
  opacity: 0;
  transform: translateY(120px);
  transition: .22s ease;
}

.toast.show {
  opacity: 1;
  transform: translateY(0);
}

@media (max-width: 1100px) {
  .auth-screen,
  .app-screen,
  .overview-grid,
  .split {
    grid-template-columns: 1fr;
  }

  .identity-side,
  .auth-card {
    min-height: auto;
  }

  .nav-rail {
    position: static;
    height: auto;
  }

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

  .nav-link {
    text-align: center;
  }

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

@media (max-width: 720px) {
  .auth-screen,
  .app-screen {
    padding: 12px;
  }

  .identity-side h1 {
    font-size: 3.1rem;
  }

  .topbar,
  .account,
  .panel-head {
    flex-direction: column;
    align-items: stretch;
  }

  .kpis,
  .detail-grid {
    grid-template-columns: 1fr;
  }

  .flow {
    grid-template-columns: 1fr;
    gap: 10px;
  }

  .line {
    width: 4px;
    height: 28px;
    justify-self: center;
  }

  .nav-rail nav {
    grid-template-columns: 1fr 1fr;
  }

  .deploy-item {
    grid-template-columns: 1fr;
  }
}


.severity.neutral {
  background: var(--blue);
  color: #fff;
}

.compact-empty {
  min-height: 220px;
  padding: 28px;
}

.form-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px;
}

.list-empty {
  min-height: 240px;
  display: grid;
  place-items: center;
  text-align: center;
  border: 2px dashed rgba(22,22,22,.25);
  border-radius: 18px;
  color: var(--muted);
  font-weight: 800;
  padding: 20px;
}

.item-actions {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
  margin-top: 14px;
}

.danger-btn {
  border: 2px solid var(--line);
  border-radius: 14px;
  background: #ffe0d9;
  color: var(--ink);
  padding: 10px 14px;
  font-weight: 900;
  box-shadow: 3px 3px 0 var(--line);
}

.success-btn {
  border: 2px solid var(--line);
  border-radius: 14px;
  background: #ddf4df;
  color: var(--ink);
  padding: 10px 14px;
  font-weight: 900;
  box-shadow: 3px 3px 0 var(--line);
}

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