:root {
  --bg: #f3f5f8;
  --surface: #ffffff;
  --surface-soft: #f8fafc;
  --ink: #162033;
  --muted: #66758a;
  --line: #dce3ec;
  --line-strong: #c7d1df;
  --primary: #1b66d1;
  --primary-dark: #124fa8;
  --danger: #c43d46;
  --success: #188451;
  --sidebar: #182230;
  --sidebar-soft: #223044;
  --shadow: 0 18px 48px rgba(31, 45, 61, 0.12);
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  font-family: Arial, "Malgun Gothic", sans-serif;
  color: var(--ink);
  background: var(--bg);
}

.app-shell {
  display: grid;
  grid-template-columns: 280px minmax(0, 1fr);
  min-height: 100vh;
}

.sidebar {
  position: sticky;
  top: 0;
  height: 100vh;
  display: flex;
  flex-direction: column;
  padding: 24px 18px;
  color: #fff;
  background: var(--sidebar);
}

.brand {
  display: grid;
  grid-template-columns: 48px 1fr;
  gap: 12px;
  align-items: center;
  padding: 8px 8px 26px;
}

.brand-mark {
  display: grid;
  place-items: center;
  width: 48px;
  height: 48px;
  border-radius: 8px;
  color: #fff;
  background: var(--primary);
  font-size: 13px;
  font-weight: 800;
}

.brand strong {
  display: block;
  font-size: 18px;
}

.brand span {
  display: block;
  margin-top: 3px;
  color: #aab7c7;
  font-size: 13px;
}

.tabs {
  display: grid;
  gap: 8px;
}

.tabs button {
  display: grid;
  grid-template-columns: 34px 1fr;
  align-items: center;
  gap: 10px;
  width: 100%;
  min-height: 48px;
  padding: 0 12px;
  border: 1px solid transparent;
  border-radius: 8px;
  color: #d7e0ec;
  background: transparent;
  text-align: left;
  font: inherit;
  font-weight: 700;
  cursor: pointer;
}

.tabs button.active,
.tabs button:hover {
  color: #fff;
  border-color: rgba(255, 255, 255, 0.08);
  background: var(--sidebar-soft);
}

.tabs button.active .tab-icon {
  color: #fff;
  background: var(--primary);
}

.tab-icon {
  display: grid;
  place-items: center;
  width: 30px;
  height: 30px;
  border-radius: 6px;
  color: #9fb0c4;
  background: rgba(255, 255, 255, 0.08);
  font-size: 12px;
  font-weight: 800;
}

.side-note {
  margin-top: auto;
  padding: 16px;
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.04);
}

.side-note span {
  display: block;
  margin-bottom: 6px;
  color: #9fb0c4;
  font-size: 12px;
}

.side-note strong {
  font-size: 14px;
}

.content {
  width: min(1180px, 100%);
  padding: 30px;
}

.topbar {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 18px;
  margin-bottom: 18px;
}

.eyebrow {
  margin: 0 0 6px;
  color: var(--primary);
  font-size: 12px;
  font-weight: 800;
  text-transform: uppercase;
}

h1,
h2,
p {
  margin-top: 0;
}

h1 {
  margin-bottom: 0;
  font-size: 28px;
  line-height: 1.2;
}

h2 {
  margin-bottom: 4px;
  font-size: 19px;
}

.badge {
  flex: 0 0 auto;
  padding: 7px 12px;
  border-radius: 999px;
  color: #fff;
  background: #778397;
  font-size: 13px;
  font-weight: 800;
}

.badge.ok {
  background: var(--success);
}

.badge.error {
  background: var(--danger);
}

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

.summary-grid div {
  padding: 16px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface);
}

.summary-grid span {
  display: block;
  margin-bottom: 6px;
  color: var(--muted);
  font-size: 13px;
}

.summary-grid strong {
  font-size: 18px;
}

.panel,
.logs {
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface);
  box-shadow: var(--shadow);
}

.panel {
  display: none;
  padding: 24px;
  margin-bottom: 18px;
}

.panel.active {
  display: block;
}

.panel-title {
  display: flex;
  justify-content: space-between;
  gap: 16px;
  padding-bottom: 18px;
  margin-bottom: 20px;
  border-bottom: 1px solid var(--line);
}

.panel-title p,
.logs-header p {
  margin-bottom: 0;
  color: var(--muted);
  font-size: 14px;
}

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

label {
  display: grid;
  gap: 7px;
  color: #344154;
  font-size: 13px;
  font-weight: 800;
}

input,
select {
  width: 100%;
  min-height: 44px;
  padding: 9px 11px;
  border: 1px solid var(--line-strong);
  border-radius: 7px;
  color: var(--ink);
  font: inherit;
  background: var(--surface-soft);
  outline: none;
}

input:focus,
select:focus {
  border-color: var(--primary);
  background: #fff;
  box-shadow: 0 0 0 3px rgba(27, 102, 209, 0.14);
}

button[type="submit"] {
  width: 100%;
  min-height: 48px;
  margin-top: 20px;
  border: 0;
  border-radius: 7px;
  color: #fff;
  background: var(--primary);
  font: inherit;
  font-weight: 800;
  cursor: pointer;
}

button[type="submit"]:hover {
  background: var(--primary-dark);
}

button[type="submit"].danger {
  background: var(--danger);
}

button:disabled {
  opacity: 0.65;
  cursor: wait;
}

.logs {
  overflow: hidden;
}

.logs-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding: 18px 20px;
  border-bottom: 1px solid var(--line);
}

.ghost {
  min-height: 34px;
  padding: 0 12px;
  border: 1px solid var(--line-strong);
  border-radius: 7px;
  color: var(--muted);
  background: #fff;
  font-weight: 800;
  cursor: pointer;
}

.ghost:hover {
  color: var(--ink);
  border-color: var(--primary);
}

.log-list {
  min-height: 230px;
  max-height: 470px;
  overflow: auto;
  padding: 18px 20px;
}

.empty {
  margin: 0;
  color: var(--muted);
}

.log-entry {
  padding: 15px;
  margin-bottom: 12px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface-soft);
}

.log-entry:last-child {
  margin-bottom: 0;
}

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

.log-title div {
  display: flex;
  align-items: center;
  gap: 8px;
}

.log-title strong {
  padding: 4px 8px;
  border-radius: 999px;
  color: #fff;
  font-size: 12px;
}

.log-entry.success strong {
  background: var(--success);
}

.log-entry.error strong {
  background: var(--danger);
}

.log-title span {
  color: var(--muted);
  font-size: 13px;
  font-weight: 700;
}

time {
  color: var(--muted);
  font-size: 13px;
}

pre {
  overflow-x: auto;
  margin: 0;
  padding: 13px;
  border-radius: 7px;
  color: #eaf1fb;
  background: #111827;
  font-size: 13px;
  line-height: 1.5;
}

.return-wrap {
  max-width: 760px;
  margin: 0 auto;
  padding: 40px 20px;
}

a {
  color: var(--primary);
  font-weight: 800;
}

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

  .sidebar {
    position: static;
    height: auto;
  }

  .tabs,
  .summary-grid,
  .grid {
    grid-template-columns: 1fr;
  }

  .content {
    padding: 20px;
  }

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