:root {
  --bg: #f6f7fb;
  --surface: rgba(255, 255, 255, 0.92);
  --surface-strong: #ffffff;
  --surface-muted: rgba(248, 250, 252, 0.9);
  --border: rgba(15, 23, 42, 0.07);
  --border-strong: rgba(15, 23, 42, 0.1);
  --text: #101828;
  --muted: #667085;
  --primary: #111827;
  --accent: #315efb;
  --accent-soft: rgba(49, 94, 251, 0.08);
  --success: #16a34a;
  --warning: #f59e0b;
  --danger: #dc2626;
  --shadow: 0 18px 40px rgba(15, 23, 42, 0.06);
  --shadow-soft: 0 8px 22px rgba(15, 23, 42, 0.04);
  --radius: 24px;
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  font-family: Inter, -apple-system, BlinkMacSystemFont, "SF Pro Display", "Segoe UI", sans-serif;
  background:
    radial-gradient(circle at top left, rgba(49, 94, 251, 0.08), transparent 28%),
    radial-gradient(circle at top right, rgba(125, 211, 252, 0.08), transparent 25%),
    var(--bg);
  color: var(--text);
  line-height: 1.45;
}

.login-body {
  min-height: 100vh;
  display: grid;
  place-items: center;
  padding: 24px;
}

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

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

.brand {
  display: flex;
  align-items: center;
  gap: 16px;
}

.centered {
  justify-content: center;
}

.brand strong {
  display: block;
  font-size: 1.04rem;
  letter-spacing: -0.02em;
}

.brand p,
.muted,
.subtle {
  margin: 4px 0 0;
  color: var(--muted);
}

.eyebrow {
  display: inline-block;
  font-size: 0.76rem;
  line-height: 1;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: #7c8799;
}

.brand-mark {
  width: 48px;
  height: 48px;
  border-radius: 16px;
  background: linear-gradient(145deg, #0f172a, #315efb);
  color: white;
  display: grid;
  place-items: center;
  font-weight: 700;
  box-shadow: 0 12px 28px rgba(49, 94, 251, 0.18);
}

.sidebar-panel,
.sidebar-note {
  display: grid;
  gap: 16px;
}

.sidebar-note {
  padding: 16px;
  border-radius: 20px;
  background: rgba(255, 255, 255, 0.8);
  border: 1px solid rgba(15, 23, 42, 0.06);
  box-shadow: var(--shadow-soft);
}

.sidebar-note p {
  margin: 0;
  color: var(--muted);
  line-height: 1.55;
  max-width: 28ch;
}

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

.nav-section {
  display: grid;
  gap: 10px;
}

.nav a,
.button-link {
  text-decoration: none;
  color: var(--text);
  padding: 14px 15px;
  border-radius: 18px;
  transition: background 0.2s ease, color 0.2s ease, transform 0.2s ease, border-color 0.2s ease;
  border: 1px solid transparent;
}

.nav a span,
.nav a small {
  display: block;
}

.nav a span {
  font-weight: 600;
  letter-spacing: -0.02em;
}

.nav a small {
  margin-top: 4px;
  color: var(--muted);
  line-height: 1.4;
}

.nav a:hover,
.button-link:hover {
  background: rgba(255, 255, 255, 0.75);
  border-color: rgba(49, 94, 251, 0.08);
  transform: translateY(-1px);
}

.nav a.active {
  background: rgba(49, 94, 251, 0.1);
  color: var(--primary);
  border-color: rgba(49, 94, 251, 0.18);
  box-shadow: var(--shadow-soft);
}

.nav a.active small {
  color: #3857c9;
}

.workflow-panel {
  padding: 18px;
  border-radius: 22px;
  background: rgba(255, 255, 255, 0.78);
  border: 1px solid rgba(15, 23, 42, 0.05);
  box-shadow: var(--shadow-soft);
}

.workflow-list {
  display: grid;
  gap: 10px;
}

.workflow-link {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 12px 14px;
  border-radius: 16px;
  color: var(--text);
  text-decoration: none;
  background: transparent;
  border: 1px solid rgba(15, 23, 42, 0.04);
}

.workflow-link strong {
  width: 28px;
  height: 28px;
  border-radius: 999px;
  display: inline-grid;
  place-items: center;
  background: rgba(15, 23, 42, 0.06);
  font-size: 0.84rem;
}

.workflow-link span {
  font-weight: 500;
}

.workflow-link.current,
.workflow-link:hover {
  background: rgba(49, 94, 251, 0.08);
  border-color: rgba(49, 94, 251, 0.12);
}

.workflow-link.current strong {
  background: var(--accent);
  color: white;
}

.sidebar-footer {
  margin-top: auto;
  display: grid;
  gap: 14px;
}

.sidebar-meta {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
}

.subtle-pill {
  color: var(--muted);
  background: rgba(15, 23, 42, 0.05);
}

.ghost-link {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 44px;
  padding: 0 14px;
  border-radius: 16px;
  color: var(--text);
  text-decoration: none;
  background: rgba(255, 255, 255, 0.72);
  border: 1px solid rgba(15, 23, 42, 0.06);
  transition: background 0.2s ease, transform 0.2s ease;
}

.ghost-link:hover {
  background: rgba(49, 94, 251, 0.08);
  transform: translateY(-1px);
}

.ghost-button {
  width: 100%;
}

.content {
  padding: 30px 32px 40px;
  max-width: 1560px;
  width: 100%;
  margin: 0 auto;
}

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

.topbar h1,
.card h2,
.login-card h1 {
  margin: 0;
  letter-spacing: -0.03em;
}

.topbar p,
.card p,
.login-card p {
  line-height: 1.6;
  max-width: 68ch;
}

.topbar-meta {
  min-width: 140px;
  padding: 14px 16px;
  border-radius: 20px;
  background: rgba(255, 255, 255, 0.78);
  border: 1px solid rgba(15, 23, 42, 0.06);
  box-shadow: var(--shadow-soft);
}

.topbar-meta strong {
  display: block;
  margin-top: 6px;
  font-size: 0.96rem;
}

.notice {
  margin-bottom: 24px;
  padding: 14px 18px;
  border-radius: 18px;
  background: rgba(49, 94, 251, 0.07);
  border: 1px solid rgba(49, 94, 251, 0.16);
  box-shadow: var(--shadow-soft);
}

.stats-grid,
.two-col {
  display: grid;
  gap: 22px;
  margin-bottom: 22px;
}

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

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

.card,
.login-card,
.card-subtle,
.job-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  backdrop-filter: blur(16px);
  transition: transform 0.2s ease, box-shadow 0.2s ease, border-color 0.2s ease;
}

.card,
.login-card {
  padding: 24px;
}

.card-subtle,
.job-card {
  padding: 18px;
}

.card:hover,
.card-subtle:hover,
.job-card:hover {
  transform: translateY(-1px);
  border-color: rgba(49, 94, 251, 0.12);
  box-shadow: 0 24px 48px rgba(15, 23, 42, 0.07);
}

.login-card {
  width: min(470px, 100%);
  padding: 32px;
}

.hero {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 20px;
}

.hero-pills,
.section-title,
.list-row,
.actions-right {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.section-title {
  margin-bottom: 18px;
  flex-wrap: wrap;
}

.section-title.tight {
  margin-bottom: 12px;
}

.section-title a {
  color: var(--accent);
  text-decoration: none;
  font-weight: 600;
}

.section-title a:hover {
  text-decoration: underline;
}

.pill,
.status {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 8px 12px;
  border-radius: 999px;
  font-size: 0.86rem;
  background: rgba(15, 23, 42, 0.05);
}

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

.status-ready,
.status-done,
.status-success {
  color: var(--success);
  background: rgba(22, 163, 74, 0.12);
}

.status-running,
.status-provisioning,
.status-queued,
.status-warning {
  color: var(--warning);
  background: rgba(245, 158, 11, 0.13);
}

.status-error,
.status-failed,
.status-danger {
  color: var(--danger);
  background: rgba(220, 38, 38, 0.12);
}

.stat-card strong {
  display: block;
  font-size: 2.4rem;
  margin-top: 12px;
  letter-spacing: -0.04em;
}

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

.stack,
.list {
  display: grid;
  gap: 16px;
}

.list > * {
  min-width: 0;
}

.pool-row {
  padding: 18px;
  border-radius: 20px;
  align-items: flex-start;
}

.action-grid,
.info-grid,
.summary-grid,
.page-kpis {
  display: grid;
  gap: 16px;
  margin-bottom: 22px;
}

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

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

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

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

.action-card,
.info-card,
.kpi-card {
  padding: 18px;
  border-radius: 22px;
  border: 1px solid rgba(15, 23, 42, 0.06);
  background: var(--surface-muted);
  box-shadow: var(--shadow-soft);
}

.action-card h3,
.info-card h3,
.kpi-card h3,
.helper-block h3 {
  margin: 0 0 6px;
  letter-spacing: -0.02em;
}

.action-card p,
.info-card p,
.kpi-card p,
.helper-block p {
  margin: 0;
  color: var(--muted);
  max-width: 60ch;
}

.kpi-card strong {
  display: block;
  margin-top: 8px;
  font-size: 1.9rem;
  letter-spacing: -0.04em;
}

.action-card a {
  display: inline-flex;
  margin-top: 14px;
  color: var(--accent);
  text-decoration: none;
  font-weight: 600;
}

.action-card a:hover {
  text-decoration: underline;
}

.helper-block {
  padding: 18px;
  border-radius: 20px;
  border: 1px solid rgba(15, 23, 42, 0.05);
  background: rgba(248, 250, 252, 0.86);
}

.empty-state {
  padding: 22px;
  border-radius: 22px;
  border: 1px dashed rgba(49, 94, 251, 0.22);
  background: rgba(49, 94, 251, 0.04);
}

.empty-state h3 {
  margin: 0 0 8px;
  letter-spacing: -0.02em;
}

.empty-state p {
  margin: 0 0 14px;
  color: var(--muted);
}

.helper-list {
  display: grid;
  gap: 10px;
  margin: 14px 0 0;
}

.helper-item {
  display: flex;
  gap: 10px;
  align-items: flex-start;
  color: var(--muted);
}

.helper-item strong {
  min-width: 22px;
  color: var(--text);
}

.field-section {
  grid-column: span 2;
  padding: 18px;
  border-radius: 20px;
  background: rgba(248, 250, 252, 0.8);
  border: 1px solid rgba(15, 23, 42, 0.05);
}

.field-section h3 {
  margin: 0 0 6px;
  letter-spacing: -0.02em;
}

.field-section p {
  margin: 0 0 16px;
  color: var(--muted);
}

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

.table-wrap table {
  min-width: 760px;
}

.qr-shell {
  display: grid;
  place-items: center;
  min-height: 320px;
  padding: 20px;
  border-radius: 24px;
  background: rgba(248, 250, 252, 0.86);
  border: 1px solid rgba(15, 23, 42, 0.06);
}

.qr-shell svg {
  width: min(100%, 320px);
  height: auto;
}

.inline-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

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

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

.span-2 {
  grid-column: span 2;
}

label {
  display: grid;
  gap: 8px;
  font-size: 0.94rem;
  font-weight: 500;
  color: #344054;
}

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

input,
select,
textarea {
  width: 100%;
  border: 1px solid rgba(15, 23, 42, 0.1);
  background: rgba(255, 255, 255, 0.96);
  border-radius: 16px;
  padding: 13px 15px;
  color: var(--text);
  transition: border-color 0.2s ease, box-shadow 0.2s ease, background 0.2s ease;
}

input::placeholder,
textarea::placeholder {
  color: #98a2b3;
}

input:focus,
select:focus,
textarea:focus {
  outline: none;
  border-color: rgba(49, 94, 251, 0.35);
  box-shadow: 0 0 0 4px rgba(49, 94, 251, 0.1);
  background: #ffffff;
}

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

.checkbox {
  grid-column: span 2;
  display: flex;
  align-items: center;
  gap: 10px;
  min-height: 48px;
  padding: 0 2px;
}

.checkbox input {
  width: auto;
}

button,
.button-link {
  border: none;
  cursor: pointer;
  background: var(--accent);
  color: white;
  border-radius: 16px;
  padding: 12px 16px;
  display: inline-flex;
  justify-content: center;
  align-items: center;
  font-weight: 600;
  transition: transform 0.2s ease, box-shadow 0.2s ease, opacity 0.2s ease;
  box-shadow: 0 12px 26px rgba(49, 94, 251, 0.18);
}

button:hover,
.button-link:hover {
  transform: translateY(-1px);
  opacity: 0.98;
}

button.secondary {
  background: rgba(15, 23, 42, 0.07);
  color: var(--text);
  box-shadow: none;
}

button.secondary:hover {
  background: rgba(15, 23, 42, 0.1);
}

table {
  width: 100%;
  border-collapse: collapse;
  overflow: hidden;
  border-radius: 18px;
}

thead {
  background: rgba(15, 23, 42, 0.03);
}

th,
td {
  text-align: left;
  padding: 15px 12px;
  border-bottom: 1px solid rgba(15, 23, 42, 0.06);
  vertical-align: top;
}

th {
  font-size: 0.82rem;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: #667085;
  font-weight: 700;
}

tbody tr {
  transition: background 0.2s ease;
}

tbody tr:hover {
  background: rgba(49, 94, 251, 0.03);
}

pre {
  white-space: pre-wrap;
  margin: 10px 0 0;
  color: var(--muted);
  font-family: ui-monospace, SFMono-Regular, Menlo, monospace;
}

code {
  padding: 2px 6px;
  border-radius: 8px;
  background: rgba(15, 23, 42, 0.06);
}

.login-brand {
  justify-content: flex-start;
  margin-bottom: 18px;
}

.login-copy {
  margin-bottom: 20px;
}

.login-copy p {
  margin-top: 8px;
}

.login-form {
  gap: 18px;
}

.login-form button {
  margin-top: 4px;
  width: 100%;
  min-height: 56px;
  border-radius: 18px;
}

.job-card pre {
  max-height: 240px;
  overflow: auto;
  padding: 12px 14px;
  background: rgba(15, 23, 42, 0.03);
  border: 1px solid rgba(15, 23, 42, 0.05);
  border-radius: 16px;
}

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

  .sidebar {
    border-right: none;
    border-bottom: 1px solid var(--border);
    position: static;
    height: auto;
  }

  .stats-grid,
  .action-grid,
  .info-grid,
  .summary-grid,
  .two-col,
  .form-grid,
  .compact {
    grid-template-columns: 1fr;
  }

  .checkbox,
  .span-2 {
    grid-column: span 1;
  }

  .topbar,
  .hero,
  .section-title,
  .list-row {
    flex-direction: column;
    align-items: flex-start;
  }

  .sidebar-meta {
    width: 100%;
  }

  .topbar-meta {
    width: 100%;
  }
}
