:root {
  --bg: #0f0f0d;
  --surface: rgba(24, 24, 22, 0.9);
  --surface-strong: #171715;
  --surface-soft: rgba(255, 255, 255, 0.06);
  --line: rgba(255, 255, 255, 0.12);
  --text: #f7f4ef;
  --muted: #c8c1b4;
  --red: #e53b2f;
  --red-soft: rgba(229, 59, 47, 0.14);
  --leaf: #9db53d;
  --shadow: 0 24px 60px rgba(0, 0, 0, 0.34);
  --radius: 24px;
}

* {
  box-sizing: border-box;
}

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

body {
  background:
    radial-gradient(circle at top left, rgba(229, 59, 47, 0.22), transparent 32%),
    radial-gradient(circle at right center, rgba(157, 181, 61, 0.2), transparent 28%),
    linear-gradient(180deg, #171614 0%, #0b0b0a 100%);
  color: var(--text);
  font-family: 'DM Sans', sans-serif;
  overflow-x: hidden;
}

.background-orb {
  position: fixed;
  border-radius: 999px;
  filter: blur(40px);
  opacity: 0.18;
  pointer-events: none;
}

.orb-one {
  width: 24rem;
  height: 24rem;
  top: -6rem;
  left: -4rem;
  background: var(--red);
}

.orb-two {
  width: 20rem;
  height: 20rem;
  bottom: 0;
  right: -5rem;
  background: var(--leaf);
}

.page-shell {
  position: relative;
  z-index: 1;
  width: min(1240px, calc(100% - 32px));
  margin: 0 auto;
  padding: 32px 0 48px;
}

.login-layout,
.app-layout {
  display: grid;
  gap: 24px;
}

.login-layout {
  grid-template-columns: 1.2fr 0.9fr;
  align-items: stretch;
  min-height: calc(100vh - 80px);
}

.brand-panel,
.login-card,
.panel-card,
.topbar,
.stat-card {
  border: 1px solid var(--line);
  background: var(--surface);
  backdrop-filter: blur(12px);
  box-shadow: var(--shadow);
}

.brand-panel,
.login-card,
.panel-card {
  border-radius: var(--radius);
}

.brand-panel {
  padding: 42px;
  display: flex;
  flex-direction: column;
  justify-content: center;
  background:
    linear-gradient(155deg, rgba(255, 255, 255, 0.03), transparent 45%),
    linear-gradient(180deg, rgba(229, 59, 47, 0.08), rgba(0, 0, 0, 0));
}

.brand-logo {
  width: 142px;
  aspect-ratio: 1;
  object-fit: cover;
  border-radius: 50%;
  margin-bottom: 18px;
  border: 8px solid rgba(255, 255, 255, 0.04);
}

.brand-panel h1,
.login-card h2,
.panel-card h3,
.topbar h2 {
  font-family: 'Space Grotesk', sans-serif;
  margin: 0;
}

.brand-panel h1 {
  font-size: clamp(2.5rem, 4vw, 4.5rem);
  line-height: 0.95;
  margin-bottom: 16px;
}

.brand-panel p {
  color: var(--muted);
  font-size: 1.05rem;
  max-width: 36rem;
}

.brand-badge,
.card-tag,
.count-pill {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  width: fit-content;
  border-radius: 999px;
  padding: 8px 14px;
  background: var(--surface-soft);
  color: var(--muted);
  font-size: 0.85rem;
  border: 1px solid rgba(255, 255, 255, 0.08);
}

.deployment-badge {
  display: inline-flex;
  width: fit-content;
  margin: 16px 0 18px;
  padding: 10px 16px;
  border-radius: 999px;
  font-size: 0.83rem;
  letter-spacing: 0.03em;
  color: #ffe7df;
  background: rgba(229, 59, 47, 0.12);
  border: 1px solid rgba(229, 59, 47, 0.28);
}

.feature-list {
  list-style: none;
  padding: 0;
  margin: 24px 0 0;
  display: grid;
  gap: 12px;
}

.feature-list li {
  padding: 14px 16px;
  border-radius: 18px;
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid rgba(255, 255, 255, 0.06);
}

.login-card {
  padding: 32px;
  align-self: center;
}

.muted {
  color: var(--muted);
}

.stack-form {
  display: grid;
  gap: 16px;
  margin-top: 24px;
}

.stack-form.compact {
  margin-top: 12px;
}

.stack-form label {
  display: grid;
  gap: 8px;
}

.stack-form span {
  font-size: 0.92rem;
  color: var(--muted);
}

input,
select,
button {
  font: inherit;
}

input,
select {
  width: 100%;
  border: 1px solid rgba(255, 255, 255, 0.12);
  border-radius: 16px;
  padding: 14px 16px;
  color: var(--text);
  background: rgba(255, 255, 255, 0.04);
}

input:focus,
select:focus {
  outline: 2px solid rgba(229, 59, 47, 0.32);
  border-color: rgba(229, 59, 47, 0.45);
}

.primary-button,
.ghost-button,
.table-actions button {
  border: 0;
  border-radius: 16px;
  padding: 14px 18px;
  cursor: pointer;
  transition: transform 0.2s ease, box-shadow 0.2s ease, opacity 0.2s ease;
}

.primary-button {
  background: linear-gradient(135deg, var(--red), #ff6a40);
  color: white;
  box-shadow: 0 10px 26px rgba(229, 59, 47, 0.28);
}

.ghost-button,
.table-actions button.secondary {
  background: rgba(255, 255, 255, 0.05);
  color: var(--text);
  border: 1px solid rgba(255, 255, 255, 0.08);
}

.table-actions button.danger {
  background: var(--red-soft);
  color: #ffd5ce;
  border: 1px solid rgba(229, 59, 47, 0.2);
}

.primary-button:hover,
.ghost-button:hover,
.table-actions button:hover {
  transform: translateY(-1px);
}

.login-help {
  margin-top: 20px;
  padding: 16px 18px;
  border-radius: 18px;
  background: rgba(157, 181, 61, 0.08);
  border: 1px solid rgba(157, 181, 61, 0.2);
  display: grid;
  gap: 4px;
  color: #dce8a8;
}

.deployment-note {
  margin: 14px 0 0;
  color: #ffcfbf;
  font-size: 0.92rem;
}

.hidden {
  display: none !important;
}

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

.topbar-left,
.topbar-right {
  display: flex;
  align-items: center;
  gap: 16px;
}

.topbar-logo {
  width: 68px;
  height: 68px;
  border-radius: 50%;
  object-fit: cover;
}

.eyebrow {
  margin: 0 0 2px;
  font-size: 0.84rem;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--leaf);
}

.user-chip {
  padding: 12px 16px;
  border-radius: 18px;
  background: rgba(255, 255, 255, 0.05);
  display: grid;
  gap: 4px;
}

.dashboard {
  display: grid;
  gap: 24px;
}

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

.panel-grid-hero {
  grid-template-columns: 1.2fr 0.8fr;
}

.panel-card {
  padding: 24px;
}

.highlight-card {
  background:
    radial-gradient(circle at top right, rgba(157, 181, 61, 0.18), transparent 35%),
    linear-gradient(160deg, rgba(229, 59, 47, 0.14), rgba(255, 255, 255, 0.02));
}

.profile-meta {
  margin-top: 16px;
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
}

.profile-meta span {
  padding: 10px 14px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid rgba(255, 255, 255, 0.08);
}

.section-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 12px;
  margin-bottom: 18px;
}

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

.empty-state {
  color: var(--muted);
  padding: 18px 0 8px;
}

table {
  width: 100%;
  border-collapse: collapse;
}

th,
td {
  padding: 12px 10px;
  text-align: left;
  border-bottom: 1px solid rgba(255, 255, 255, 0.08);
  vertical-align: top;
}

th {
  color: var(--muted);
  font-weight: 500;
  font-size: 0.9rem;
}

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

.table-actions button {
  padding: 10px 12px;
  border-radius: 12px;
}

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

.stat-card {
  border-radius: 22px;
  padding: 22px;
  display: grid;
  gap: 10px;
}

.stat-card span {
  color: var(--muted);
}

.stat-card strong {
  font-family: 'Space Grotesk', sans-serif;
  font-size: 2rem;
}

.toast {
  position: fixed;
  right: 24px;
  bottom: 24px;
  min-width: 260px;
  max-width: 360px;
  padding: 16px 18px;
  border-radius: 18px;
  background: rgba(20, 20, 18, 0.96);
  border: 1px solid rgba(255, 255, 255, 0.12);
  box-shadow: var(--shadow);
}

.animate-in {
  animation: fade-slide 0.5s ease both;
}

@keyframes fade-slide {
  from {
    opacity: 0;
    transform: translateY(16px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

@media (max-width: 980px) {
  .login-layout,
  .panel-grid,
  .panel-grid-hero,
  .stats-grid {
    grid-template-columns: 1fr;
  }

  .topbar {
    flex-direction: column;
    align-items: flex-start;
  }

  .topbar-right {
    width: 100%;
    justify-content: space-between;
  }
}

@media (max-width: 640px) {
  .page-shell {
    width: min(100% - 20px, 1240px);
    padding-top: 18px;
  }

  .brand-panel,
  .login-card,
  .panel-card {
    padding: 20px;
  }

  .topbar {
    padding: 18px;
  }

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

  .user-chip,
  .ghost-button,
  .primary-button {
    width: 100%;
  }

  .table-actions {
    flex-direction: column;
  }
}
