:root {
  --bg-1: #0b1f2a;
  --bg-2: #153a50;
  --panel: rgba(255, 255, 255, 0.9);
  --ink: #12222d;
  --muted: #4a606f;
  --accent: #0f8b8d;
  --ok: #1f9d55;
  --warn: #d97706;
  --bad: #c53030;
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  font-family: "Space Grotesk", sans-serif;
  color: var(--ink);
  min-height: 100vh;
  background:
    radial-gradient(circle at 10% 15%, rgba(255, 220, 130, 0.24), transparent 30%),
    radial-gradient(circle at 88% 20%, rgba(15, 139, 141, 0.3), transparent 33%),
    linear-gradient(150deg, var(--bg-1), var(--bg-2));
}

.shell {
  width: min(1200px, 94vw);
  margin: 2.2rem auto;
}

.hero {
  color: #f5fbff;
  margin-bottom: 1.2rem;
  position: relative;
  padding-right: 340px;
}

.welcome-banner {
  position: absolute;
  top: 0;
  right: 0;
  max-width: 320px;
  padding: 0.7rem 1rem;
  border: 1px solid rgba(255, 255, 255, 0.24);
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.12);
  color: #f5fbff;
  text-align: right;
  backdrop-filter: blur(8px);
  display: flex;
  align-items: center;
  gap: 0.8rem;
  font-size: 0.95rem;
}

#welcomeMessage {
  flex: 1;
}

.logout-btn {
  background: rgba(255, 255, 255, 0.18);
  border: none;
  color: #f5fbff;
  border-radius: 50%;
  width: 1.8rem;
  height: 1.8rem;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  font: inherit;
  font-weight: 500;
  font-size: 1.2rem;
  transition: background 0.2s ease;
}

.logout-btn:hover {
  background: rgba(255, 255, 255, 0.28);
}

.logout-btn:active {
  background: rgba(255, 255, 255, 0.35);
}

.eyebrow {
  text-transform: uppercase;
  letter-spacing: 0.09em;
  opacity: 0.8;
  margin: 0;
}

.hero h1 {
  margin: 0.4rem 0;
  font-size: clamp(1.6rem, 3.6vw, 2.6rem);
}

.tabs {
  display: flex;
  gap: 0.5rem;
  margin: 1rem 0 0.7rem;
}

.tab-btn {
  border: 1px solid rgba(255, 255, 255, 0.45);
  background: rgba(255, 255, 255, 0.12);
  color: #f3fbff;
  border-radius: 999px;
  padding: 0.45rem 0.9rem;
  cursor: pointer;
  font: inherit;
  font-weight: 700;
}

.tab-btn.active {
  background: #fff;
  color: var(--ink);
}

.auth-gate {
  margin: 1.2rem 0 1rem;
}

.auth-gate-card {
  max-width: 560px;
  padding: 2rem;
  border: 1px solid rgba(255, 255, 255, 0.18);
  border-radius: 22px;
  background: linear-gradient(180deg, rgba(255, 255, 255, 0.14), rgba(255, 255, 255, 0.08));
  box-shadow: 0 16px 40px rgba(4, 18, 31, 0.22);
  color: #f4fbff;
}

.auth-gate-card h2 {
  margin: 0 0 0.65rem;
  font-size: clamp(1.4rem, 3vw, 2rem);
}

.auth-gate-card p {
@media (max-width: 900px) {
  .hero {
    padding-right: 0;
  }

  .welcome-banner {
    position: static;
    max-width: none;
    margin-bottom: 0.8rem;
    text-align: left;
  }
}

  margin: 0 0 1rem;
  color: rgba(244, 251, 255, 0.9);
}

.auth-gate-btn {
  border: none;
  border-radius: 999px;
  padding: 0.8rem 1.1rem;
  background: #ffffff;
  color: var(--ink);
  font: inherit;
  font-weight: 700;
  cursor: pointer;
}

.subtitle {
  margin: 0;
  max-width: 70ch;
  opacity: 0.9;
}

.controls {
  display: flex;
  gap: 0.6rem;
  margin: 1rem 0;
}

.controls input,
.controls select,
.controls button {
  border: none;
  border-radius: 999px;
  padding: 0.72rem 1rem;
  font: inherit;
}

.controls input {
  flex: 1;
}

.controls select {
  background: #fff;
}

.namespace-dropdown {
  position: relative;
}

.namespace-dropdown summary {
  list-style: none;
  background: #fff;
  border-radius: 999px;
  padding: 0.72rem 1rem;
  cursor: pointer;
  border: 1px solid #dce7ef;
  white-space: nowrap;
}

.namespace-dropdown summary::-webkit-details-marker {
  display: none;
}

.namespace-dropdown-menu {
  position: absolute;
  right: 0;
  z-index: 20;
  margin-top: 0.45rem;
  width: min(560px, 88vw);
  max-height: 380px;
  overflow: auto;
  background: #fff;
  border: 1px solid #dce7ef;
  border-radius: 12px;
  padding: 0.75rem;
  box-shadow: 0 10px 24px rgba(18, 34, 45, 0.18);
}

.controls button {
  background: var(--accent);
  color: #fff;
  font-weight: 700;
  cursor: pointer;
}

.namespace-panel-actions {
  display: flex;
  gap: 0.4rem;
  margin-bottom: 0.45rem;
}

.namespace-panel-actions button {
  border: 1px solid #d6e2eb;
  background: #fff;
  border-radius: 999px;
  padding: 0.25rem 0.7rem;
  font: inherit;
  cursor: pointer;
}

.namespace-filters {
  display: flex;
  flex-wrap: wrap;
  gap: 0.45rem 0.7rem;
}

.deploy-panel h2 {
  margin-top: 0;
}

.deploy-form-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 1rem;
  margin-bottom: 1rem;
}

.deploy-form-grid label {
  display: inline-block;
  font-weight: 700;
  margin-bottom: 0.35rem;
}

.deploy-form-grid input[type="text"],
.deploy-form-grid input[type="search"],
.deploy-form-grid select {
  width: 100%;
  border: 1px solid #d7e4ed;
  border-radius: 8px;
  padding: 0.55rem 0.65rem;
  font: inherit;
  background: #fff;
}

.deploy-list-actions {
  margin-top: 0.5rem;
}

.deploy-project-list {
  border: 1px solid #d7e4ed;
  border-radius: 10px;
  background: #fff;
  max-height: 280px;
  overflow: auto;
  padding: 0.5rem;
}

.deploy-project-item {
  display: flex;
  gap: 0.4rem;
  padding: 0.2rem 0.3rem;
}

.deploy-namespace-row {
  display: flex;
  align-items: center;
  gap: 0.4rem;
  padding: 0.2rem 0.3rem;
  border-bottom: 1px solid #eef4f8;
  margin-bottom: 0.6rem;
  background-color: #f6fbff;
}

.deploy-namespace-toggle {
  border: 1px solid #d6e2eb;
  border-radius: 6px;
  background: #fff;
  color: var(--ink);
  width: 1.35rem;
  height: 1.35rem;
  line-height: 1;
  font: inherit;
  cursor: pointer;
  padding: 0;
}

.deploy-namespace-items {
  margin-bottom: 0.8rem;
}

.variables-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-top: 0.75rem;
}

.variables-header button {
  border: 1px solid #d6e2eb;
  border-radius: 999px;
  background: #fff;
  padding: 0.2rem 0.7rem;
  font: inherit;
  cursor: pointer;
}

.deploy-variables {
  display: flex;
  flex-direction: column;
  gap: 0.4rem;
  margin-top: 0.45rem;
}

.variable-row {
  display: grid;
  grid-template-columns: 1fr 1.2fr auto;
  gap: 0.4rem;
}

.var-remove {
  border: 1px solid #e6bcc0;
  border-radius: 8px;
  background: #fff3f4;
  color: #9b2226;
  font: inherit;
  cursor: pointer;
  padding: 0.45rem 0.7rem;
}

.deploy-submit {
  margin-top: 0.8rem;
  border: none;
  border-radius: 999px;
  background: var(--accent);
  color: #fff;
  font: inherit;
  font-weight: 700;
  padding: 0.62rem 0.95rem;
  cursor: pointer;
}

.deploy-submit:disabled {
  opacity: 0.6;
  cursor: not-allowed;
}

.deploy-results-actions {
  display: flex;
  justify-content: flex-end;
  margin-bottom: 0.5rem;
}

.deploy-results-actions button {
  border: 1px solid #e6bcc0;
  border-radius: 999px;
  background: #fff3f4;
  color: #9b2226;
  font: inherit;
  padding: 0.35rem 0.8rem;
  cursor: pointer;
  margin-left: 0.5rem;
}

.deploy-results-actions button:first-child {
  margin-left: 0;
}

.deploy-results-actions button:disabled {
  opacity: 0.5;
  cursor: not-allowed;
}

.deployment-result-checkbox {
  cursor: pointer;
}

.deploy-preview {
  margin-top: 0.75rem;
  background: #f6fbff;
  border: 1px solid #d8e8f3;
  border-radius: 10px;
  padding: 0.55rem 0.7rem;
  color: var(--ink);
}

.deploy-preview strong {
  display: inline-block;
  margin-bottom: 0.2rem;
}

.preview-projects {
  margin-top: 0.35rem;
  color: var(--muted);
  font-size: 0.86rem;
}

.modal {
  position: fixed;
  inset: 0;
  background: rgba(8, 16, 26, 0.56);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 50;
  padding: 1rem;
}

.modal-card {
  width: min(680px, 100%);
  background: #fff;
  border-radius: 14px;
  padding: 1rem;
  box-shadow: 0 12px 36px rgba(0, 0, 0, 0.28);
}

.modal-card h3 {
  margin: 0 0 0.5rem;
}

.modal-body {
  color: var(--ink);
}

.modal-actions {
  margin-top: 0.8rem;
  display: flex;
  justify-content: flex-end;
  gap: 0.5rem;
}

.modal-actions button {
  border-radius: 999px;
  padding: 0.62rem 0.95rem;
  min-width: 150px;
  border: 1px solid #d6e2eb;
  background: #fff;
  font: inherit;
  font-weight: 700;
  cursor: pointer;
}

.modal-actions .deploy-submit {
  margin-top: 0;
  border: none;
  background: var(--accent);
  color: #fff;
  font-weight: 700;
}

.modal-actions .deploy-submit:disabled {
  opacity: 0.6;
  cursor: not-allowed;
}

.namespace-filter-item {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  color: var(--ink);
  background: #fff;
  border: 1px solid #dce7ef;
  border-radius: 999px;
  padding: 0.22rem 0.55rem;
  font-size: 0.88rem;
}

.namespace-filter-count {
  color: var(--muted);
  font-size: 0.8rem;
}

.panel {
  background: var(--panel);
  border-radius: 18px;
  padding: 1rem;
  box-shadow: 0 12px 36px rgba(0, 0, 0, 0.22);
}

.meta {
  color: var(--muted);
  margin-bottom: 0.6rem;
}

.table-wrap {
  overflow-x: auto;
}

table {
  width: 100%;
  border-collapse: collapse;
  min-width: 880px;
}

thead th {
  text-align: left;
  font-size: 0.86rem;
  letter-spacing: 0.05em;
  text-transform: uppercase;
  color: var(--muted);
  border-bottom: 1px solid #dce7ef;
  padding: 0.7rem 0.55rem;
}

tbody td {
  padding: 0.7rem 0.55rem;
  border-bottom: 1px solid #e7eef3;
  vertical-align: top;
}

.env-list {
  margin: 0;
  padding-left: 1.1rem;
}

.env-list.compact {
  padding-left: 1rem;
}

.env-list.compact li {
  margin-bottom: 0.15rem;
}

.pipeline-source {
  display: inline-block;
  margin-left: 0.35rem;
  padding: 0.05rem 0.35rem;
  border-radius: 999px;
  font-size: 0.7rem;
  line-height: 1.2;
  font-weight: 600;
  vertical-align: middle;
}

.pipeline-source-deployment {
  background-color: #e8f5e9;
  color: #1b5e20;
  border: 1px solid #c8e6c9;
}

.pipeline-source-fallback {
  background-color: #fff8e1;
  color: #8a6d00;
  border: 1px solid #ffe082;
}

.env-list li {
  margin-bottom: 0.35rem;
}

.env-meta {
  color: var(--muted);
  margin-left: 0.35rem;
}

tbody tr:hover {
  background: rgba(15, 139, 141, 0.06);
}

.namespace-row td {
  background: rgba(18, 34, 45, 0.06);
  border-bottom: 1px solid #d0dee9;
  padding-top: 0.5rem;
  padding-bottom: 0.5rem;
}

.namespace-chip {
  display: inline-block;
  font-weight: 700;
  letter-spacing: 0.02em;
}

.namespace-toggle {
  border: 1px solid #c9d9e4;
  background: #fff;
  color: var(--ink);
  border-radius: 6px;
  width: 1.5rem;
  height: 1.5rem;
  margin-right: 0.45rem;
  cursor: pointer;
  font-weight: 700;
}

.namespace-count {
  margin-left: 0.55rem;
  color: var(--muted);
  font-size: 0.85rem;
}

.project-path {
  color: var(--muted);
  font-size: 0.8rem;
  margin-top: 0.1rem;
}

.status {
  display: inline-block;
  border-radius: 999px;
  padding: 0.2rem 0.58rem;
  font-size: 0.82rem;
  font-weight: 700;
}

.status.success {
  color: var(--ok);
  background: rgba(31, 157, 85, 0.15);
}

.status.running,
.status.pending {
  color: var(--warn);
  background: rgba(217, 119, 6, 0.15);
}

.status.failed,
.status.canceled {
  color: var(--bad);
  background: rgba(197, 48, 48, 0.15);
}

.status.manual {
  color: #d97706;
  background: rgba(217, 119, 6, 0.25);
  font-weight: 700;
}

.status.manual .manual-child-link {
  color: inherit;
  text-decoration: underline;
  text-underline-offset: 2px;
}

.status.unknown {
  color: #566b7b;
  background: rgba(86, 107, 123, 0.14);
}

.hidden {
  display: none;
}

.error {
  margin-top: 1rem;
  color: #9b2226;
  font-weight: 600;
}

.empty {
  margin-top: 1rem;
  color: var(--muted);
}

a {
  color: var(--accent);
  text-decoration: none;
}

a:hover {
  text-decoration: underline;
}

@media (max-width: 700px) {
  .controls {
    flex-direction: column;
  }

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