* {
  box-sizing: border-box;
}

:root {
  color-scheme: dark;
  --bg: #060911;
  --card: #111827dd;
  --line: #263449;
  --muted: #94a3b8;
  --primary: #4f7cff;
  --purple: #8b5cf6;
  --green: #27e08a;
  --red: #fb5b6b;
  --yellow: #f6c85f;
}

body {
  margin: 0;
  min-height: 100vh;
  font-family: Tahoma, Arial, sans-serif;
  color: #edf3ff;
  background:
    radial-gradient(circle at 12% 10%, #174bd24a, transparent 30%),
    radial-gradient(circle at 88% 85%, #7c3aed45, transparent 32%),
    linear-gradient(145deg, #05070c, #0d1422 52%, #070a12);
}

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

.hidden {
  display: none !important;
}

.login-shell {
  width: min(460px, calc(100% - 32px));
  margin: 9vh auto;
}

.brand {
  text-align: center;
  margin-bottom: 22px;
}

.logo {
  width: 76px;
  height: 76px;
  display: grid;
  place-items: center;
  margin: 0 auto 14px;
  border-radius: 24px;
  font-size: 34px;
  background: linear-gradient(135deg, #2563eb, #8b5cf6);
  box-shadow: 0 20px 70px #2563eb60;
}

.card {
  border: 1px solid #ffffff16;
  border-radius: 22px;
  background: var(--card);
  box-shadow: 0 24px 80px #0008;
  backdrop-filter: blur(16px);
}

.login-card {
  padding: 30px;
}

label {
  display: block;
  margin: 14px 0 7px;
  color: #cbd5e1;
  font-size: 13px;
}

input,
select,
textarea {
  width: 100%;
  padding: 13px 14px;
  color: #fff;
  border: 1px solid #334155;
  border-radius: 12px;
  outline: none;
  background: #050912;
}

textarea {
  min-height: 130px;
  resize: vertical;
  direction: ltr;
  text-align: left;
  font-family: Consolas, monospace;
}

input:focus,
select:focus,
textarea:focus {
  border-color: #6592ff;
  box-shadow: 0 0 0 4px #2563eb25;
}

.btn {
  border: 0;
  border-radius: 11px;
  padding: 12px 17px;
  color: #fff;
  cursor: pointer;
  transition: .18s;
  background: #223047;
}

.btn:hover {
  transform: translateY(-1px);
  filter: brightness(1.12);
}

.btn-primary {
  background: linear-gradient(90deg, #2563eb, #7c3aed);
}

.btn-danger {
  background: #7f1d2d;
}

.btn-success {
  background: #08734d;
}

.btn-wide {
  width: 100%;
  margin-top: 20px;
}

.message {
  margin-top: 15px;
  padding: 12px;
  border-radius: 10px;
  font-size: 13px;
}

.message.error {
  color: #ffd0d5;
  border: 1px solid #fb5b6b55;
  background: #7f1d2d55;
}

.message.success {
  color: #c9ffe7;
  border: 1px solid #27e08a55;
  background: #07583c55;
}

.app-shell {
  max-width: 1280px;
  margin: auto;
  padding: 22px;
}

.topbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 20px;
  padding: 16px 19px;
}

.topbar h1 {
  margin: 0;
  font-size: 21px;
}

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

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

.sidebar {
  align-self: start;
  padding: 13px;
  position: sticky;
  top: 20px;
}

.nav-btn {
  width: 100%;
  margin: 4px 0;
  padding: 13px;
  border: 0;
  border-radius: 11px;
  color: #dbe7ff;
  text-align: right;
  cursor: pointer;
  background: transparent;
}

.nav-btn:hover,
.nav-btn.active {
  background: linear-gradient(90deg, #1e3a8a70, #6d28d970);
}

.content {
  min-width: 0;
}

.section {
  padding: 22px;
}

.section h2 {
  margin-top: 0;
}

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

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

.endpoint-item {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 15px;
  padding: 16px;
  border: 1px solid var(--line);
  border-radius: 14px;
  background: #08101d;
}

.endpoint-item h3 {
  margin: 0 0 8px;
}

.endpoint-item p {
  margin: 4px 0;
  color: var(--muted);
  font-size: 13px;
}

.badge {
  display: inline-flex;
  align-items: center;
  align-self: start;
  border-radius: 999px;
  padding: 6px 10px;
  font-size: 11px;
  background: #334155;
}

.badge.READY,
.badge.SUCCESS {
  color: #baffdf;
  background: #086244;
}

.badge.ERROR,
.badge.FAILED {
  color: #ffd1d6;
  background: #7f1d2d;
}

.badge.PENDING,
.badge.QUEUED,
.badge.RUNNING {
  color: #d7e5ff;
  background: #1e4a8d;
}

.wizard-progress {
  display: flex;
  gap: 7px;
  margin-bottom: 22px;
}

.progress-dot {
  height: 6px;
  flex: 1;
  border-radius: 10px;
  background: #263449;
}

.progress-dot.done,
.progress-dot.current {
  background: linear-gradient(90deg, #2563eb, #8b5cf6);
}

.wizard-actions {
  display: flex;
  justify-content: space-between;
  gap: 10px;
  margin-top: 20px;
}

.review {
  display: grid;
  gap: 8px;
  padding: 16px;
  border: 1px solid var(--line);
  border-radius: 13px;
  background: #070d17;
}

.review-row {
  display: grid;
  grid-template-columns: 150px 1fr;
  gap: 12px;
  padding: 8px 0;
  border-bottom: 1px solid #ffffff0d;
}

.job-head {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  align-items: center;
  margin-bottom: 15px;
}

.progress-bar {
  height: 9px;
  overflow: hidden;
  border-radius: 20px;
  background: #1e293b;
}

.progress-fill {
  width: 0;
  height: 100%;
  transition: width .4s;
  background: linear-gradient(90deg, #2563eb, #8b5cf6, #27e08a);
}

.timeline {
  display: grid;
  gap: 8px;
  margin: 17px 0;
}

.timeline-row {
  padding: 10px 12px;
  border-radius: 10px;
  color: #dce8fb;
  background: #0a1220;
  border-right: 3px solid #4169c9;
}

.timeline-row.SUCCESS {
  border-right-color: var(--green);
}

.timeline-row.WARNING {
  border-right-color: var(--yellow);
}

.timeline-row.ERROR {
  border-right-color: var(--red);
}

.terminal-wrap {
  overflow: hidden;
  position: relative;
  border: 1px solid #1f3a31;
  border-radius: 15px;
  background: #020704;
  box-shadow:
    inset 0 0 45px #001d0c,
    0 18px 60px #0008;
}

.terminal-wrap::after {
  content: "";
  pointer-events: none;
  position: absolute;
  inset: 0;
  opacity: .12;
  background: repeating-linear-gradient(
    0deg,
    transparent,
    transparent 2px,
    #a5ffd622 3px
  );
}

.terminal-head {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  padding: 10px 13px;
  color: #83ffbd;
  border-bottom: 1px solid #174a2e;
  background: #06120b;
  font-family: Consolas, monospace;
  font-size: 12px;
}

.terminal-controls {
  display: flex;
  gap: 7px;
}

.terminal-controls button,
.terminal-controls select {
  width: auto;
  padding: 5px 8px;
  border: 1px solid #236541;
  border-radius: 7px;
  color: #baffd8;
  background: #071d10;
  font-size: 11px;
}

.terminal {
  height: 350px;
  overflow-y: auto;
  padding: 15px;
  direction: ltr;
  text-align: left;
  white-space: pre-wrap;
  word-break: break-word;
  color: #45f590;
  font: 13px/1.65 Consolas, "Courier New", monospace;
  text-shadow: 0 0 8px #35ef8266;
}

.cursor {
  display: inline-block;
  width: 8px;
  height: 15px;
  vertical-align: middle;
  background: #72ffae;
  animation: blink .7s steps(1) infinite;
}

@keyframes blink {
  50% {
    opacity: 0;
  }
}

.empty {
  padding: 30px;
  text-align: center;
  color: var(--muted);
  border: 1px dashed #334155;
  border-radius: 13px;
}

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

  .sidebar {
    position: static;
  }

  .review-row {
    grid-template-columns: 1fr;
  }

  .terminal {
    height: 300px;
    font-size: 11px;
  }
}

.language-row {
  display: flex;
  justify-content: flex-end;
  margin-bottom: 15px;
}

.language-select {
  width: auto;
  min-width: 140px;
  padding: 9px 12px;
}

.top-actions {
  display: flex;
  align-items: center;
  gap: 10px;
}

.muted {
  color: #94a3b8;
}

.endpoint-actions {
  display: grid;
  gap: 8px;
  min-width: 110px;
  align-self: start;
}

.btn-edit {
  background: #1d4ed8;
}

.secret-field {
  position: relative;
}

.secret-field input {
  padding-inline-end: 55px;
}

.secret-toggle {
  position: absolute;
  inset-inline-end: 7px;
  top: 50%;
  width: 40px;
  height: 36px;
  padding: 0;
  transform: translateY(-50%);
  border: 1px solid #334155;
  border-radius: 8px;
  color: white;
  cursor: pointer;
  background: #172033;
}

.field-note {
  color: #94a3b8;
  font-size: 12px;
}

html[dir="ltr"] .nav-btn {
  text-align: left;
}

html[dir="ltr"] .timeline-row {
  border-right: 0;
  border-left: 3px solid #4169c9;
}

html[dir="ltr"] .timeline-row.SUCCESS {
  border-left-color: var(--green);
}

html[dir="ltr"] .timeline-row.WARNING {
  border-left-color: var(--yellow);
}

html[dir="ltr"] .timeline-row.ERROR {
  border-left-color: var(--red);
}

@media (max-width: 650px) {
  .topbar,
  .top-actions {
    flex-wrap: wrap;
  }
}


.failure-summary {
  margin-top: 14px;
  padding: 16px;
  border: 1px solid #fb5b6b88;
  border-radius: 13px;
  color: #ffd5da;
  background: #64182766;
}

.failure-summary strong {
  display: block;
  margin-bottom: 9px;
  font-size: 16px;
}

.failure-summary p {
  margin: 8px 0 13px;
  line-height: 1.9;
}

.failure-summary details {
  margin: 12px 0;
  padding: 10px;
  border-radius: 9px;
  background: #16070a;
}

.failure-summary pre {
  overflow: auto;
  direction: ltr;
  text-align: left;
  white-space: pre-wrap;
  color: #ff9aaa;
  font-family: Consolas, monospace;
}

.job-result-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 9px;
  margin-top: 14px;
}


.precheck-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 16px;
  margin: 22px 0;
}

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

.inventory-mini {
  padding: 7px 10px;
  border-radius: 9px;
  color: #b7c8e5 !important;
  background: #101a29;
}

.inventory-summary {
  display: grid;
  grid-template-columns:
    repeat(auto-fit, minmax(130px, 1fr));
  gap: 10px;
  margin: 18px 0;
}

.inventory-stat {
  display: grid;
  gap: 5px;
  padding: 15px;
  border: 1px solid #263449;
  border-radius: 12px;
  text-align: center;
  background: #07101c;
}

.inventory-stat strong {
  color: #68f0a6;
  font-size: 24px;
}

.inventory-stat span {
  color: #9fb0c9;
  font-size: 12px;
}

.inventory-group {
  margin: 10px 0;
  overflow: hidden;
  border: 1px solid #263449;
  border-radius: 12px;
  background: #07101c;
}

.inventory-group summary {
  display: flex;
  justify-content: space-between;
  gap: 10px;
  padding: 14px;
  cursor: pointer;
  color: #dbe8ff;
  background: #0c1727;
}

.inventory-table {
  display: grid;
  gap: 1px;
}

.inventory-row {
  display: grid;
  grid-template-columns:
    minmax(160px, 1fr)
    minmax(100px, 1fr)
    minmax(120px, 2fr);
  gap: 10px;
  padding: 10px 14px;
  border-top: 1px solid #ffffff0b;
}

.inventory-row code {
  direction: ltr;
  text-align: left;
  color: #65f0a0;
}

.inventory-row small {
  direction: ltr;
  text-align: left;
  color: #91a3be;
}

.inventory-json {
  overflow: auto;
  max-height: 500px;
  margin: 0;
  padding: 14px;
  direction: ltr;
  text-align: left;
  white-space: pre-wrap;
  color: #56ee9b;
  background: #020704;
  font-family: Consolas, monospace;
  font-size: 12px;
}

.precheck-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 16px;
  margin: 22px 0;
}

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

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