:root {
  --bg: #f6f8fb;
  --bg-alt: #ffffff;
  --surface: #ffffff;
  --surface-2: #ffffff;
  --accent: #0d6efd;
  --accent-2: #0a58ca;
  --text: #111827;
  --muted: #6b7280;
  --border: #e5e7eb;
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  font-family: "Segoe UI", "Inter", sans-serif;
  background: var(--bg);
  color: var(--text);
  min-height: 100vh;
  overflow-x: hidden;
}

body.login {
  display: flex;
  align-items: center;
  justify-content: center;
}

.bg {
  position: fixed;
  inset: 0;
  background: linear-gradient(180deg, #f6f8fb 0%, #eef2f7 100%);
  z-index: -1;
}

.topbar {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 24px 40px;
  border-bottom: 1px solid var(--border);
  background: var(--bg-alt);
  box-shadow: 0 8px 20px rgba(15, 23, 42, 0.06);
}

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

.logo {
  width: 56px;
  height: 56px;
  border-radius: 12px;
  background: #ffffff;
  display: grid;
  place-items: center;
  border: 1px solid var(--border);
  box-shadow: 0 6px 16px rgba(15, 23, 42, 0.08);
  overflow: hidden;
}

.logo img {
  width: 80%;
  height: 80%;
  object-fit: contain;
}

.title h1 {
  margin: 0;
  font-weight: 600;
  letter-spacing: 0.5px;
}

.title p {
  margin: 4px 0 0;
  color: var(--muted);
  font-size: 14px;
}

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

.btn {
  border: none;
  padding: 10px 18px;
  border-radius: 12px;
  font-family: "Segoe UI", "Inter", sans-serif;
  font-weight: 500;
  cursor: pointer;
  transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.btn.slim {
  padding: 6px 12px;
  font-size: 12px;
  margin-left: 8px;
}

.btn:hover {
  transform: translateY(-1px);
  box-shadow: 0 8px 20px rgba(0, 0, 0, 0.2);
}

.btn.primary {
  background: var(--accent);
  color: #ffffff;
}

.btn.ghost {
  background: transparent;
  border: 1px solid var(--border);
  color: #1f2937;
}

.status {
  padding: 6px 12px;
  border-radius: 999px;
  background: rgba(13, 110, 253, 0.1);
  color: var(--accent);
  font-size: 13px;
}

.status.warn {
  background: rgba(220, 53, 69, 0.12);
  color: #dc3545;
}

.status.neutral {
  background: rgba(255, 255, 255, 0.1);
  color: var(--muted);
}

.layout {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
  gap: 20px;
  padding: 28px 40px 120px;
}

.panel {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 20px;
  padding: 18px;
  display: flex;
  flex-direction: column;
  min-height: 380px;
  box-shadow: 0 12px 28px rgba(15, 23, 42, 0.08);
}

.panel-head {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  margin-bottom: 16px;
}

.panel-head h2 {
  margin: 0;
  font-size: 20px;
}

.panel-meta {
  color: var(--muted);
  font-size: 12px;
  display: flex;
  align-items: center;
  gap: 8px;
}

.stack {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.card {
  padding: 14px;
  border-radius: 14px;
  background: var(--surface-2);
  border: 1px solid var(--border);
  transition: border 0.2s ease, transform 0.2s ease;
}

.card:hover {
  border-color: rgba(13, 110, 253, 0.3);
  transform: translateY(-2px);
}

.card h3 {
  margin: 0 0 6px;
  font-size: 16px;
}

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

.card-row {
  display: flex;
  justify-content: flex-start;
  flex-wrap: wrap;
  align-items: center;
  gap: 10px;
  margin-top: 12px;
}

.pill {
  padding: 4px 10px;
  border-radius: 999px;
  font-size: 12px;
  background: rgba(13, 110, 253, 0.1);
  color: var(--accent);
}

.pill.ok {
  background: rgba(25, 135, 84, 0.15);
  color: #198754;
}

.pill.warn {
  background: rgba(220, 53, 69, 0.12);
  color: #dc3545;
}

.pill.running {
  background: rgba(255, 193, 7, 0.2);
  color: #b45309;
}

.pill.neutral {
  background: rgba(255, 255, 255, 0.1);
  color: var(--muted);
}

.drawer {
  position: fixed;
  right: 24px;
  bottom: 24px;
  width: min(560px, 90vw);
  max-height: 70vh;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 20px;
  padding: 16px;
  box-shadow: 0 18px 40px rgba(15, 23, 42, 0.18);
  transform: translateY(120%);
  transition: transform 0.3s ease;
  overflow: hidden;
}

.drawer.open {
  transform: translateY(0);
}

.drawer-head {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  margin-bottom: 10px;
}

.login-shell {
  width: min(420px, 90vw);
  padding: 40px 0;
  display: grid;
  place-items: center;
}

.login-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 24px;
  padding: 32px;
  text-align: center;
  box-shadow: 0 20px 50px rgba(0, 0, 0, 0.35);
}

.login-card h1 {
  margin: 16px 0 4px;
}

.login-card p {
  margin: 0 0 20px;
  color: var(--muted);
}

.login-form {
  display: grid;
  gap: 14px;
  text-align: left;
}

.login-form label {
  font-size: 13px;
  color: var(--muted);
  display: grid;
  gap: 6px;
}

.login-form input {
  background: #ffffff;
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 10px 12px;
  color: var(--text);
  font-family: "Segoe UI", "Inter", sans-serif;
}

.login-form input:focus {
  outline: none;
  border-color: rgba(13, 110, 253, 0.6);
}

.login-error {
  margin-bottom: 12px;
  padding: 8px 12px;
  border-radius: 12px;
  background: rgba(244, 87, 87, 0.2);
  color: #ff9b9b;
  font-size: 13px;
}

.log-body {
  margin: 0;
  background: #f3f4f6;
  padding: 12px;
  border-radius: 12px;
  overflow: auto;
  max-height: 50vh;
  font-size: 12px;
  line-height: 1.5;
  white-space: pre-wrap;
}

.inline-form {
  display: flex;
  gap: 8px;
  margin-top: 10px;
  flex-wrap: wrap;
}

.inline-form select,
.inline-form input {
  background: #ffffff;
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 8px 10px;
  color: var(--text);
  font-family: "Segoe UI", "Inter", sans-serif;
}

.inline-form textarea {
  width: 100%;
  min-height: 220px;
  background: #ffffff;
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 10px;
  color: var(--text);
  font-family: "Segoe UI", "Inter", sans-serif;
  resize: vertical;
}

.inline-form select:focus,
.inline-form input:focus {
  outline: none;
  border-color: rgba(13, 110, 253, 0.6);
}

.inline-form textarea:focus {
  outline: none;
  border-color: rgba(13, 110, 253, 0.6);
}

@media (max-width: 900px) {
  .topbar {
    flex-direction: column;
    align-items: flex-start;
    gap: 16px;
  }

  .layout {
    padding: 20px;
  }
}
