:root {
  --bg: #0f1419;
  --surface: #1a2332;
  --surface2: #243044;
  --border: #2d3a4f;
  --text: #e7ecf3;
  --muted: #8b9cb3;
  --green: #3dd68c;
  --red: #f07178;
  --amber: #ffcc66;
  --accent: #5b9cf5;
  --radius: 10px;
  font-family: "Segoe UI", system-ui, sans-serif;
}

* { box-sizing: border-box; }

body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  min-height: 100vh;
}

a { color: var(--accent); }

.container {
  max-width: 1100px;
  margin: 0 auto;
  padding: 1.5rem;
}

header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  margin-bottom: 1.5rem;
  flex-wrap: wrap;
}

header h1 {
  margin: 0;
  font-size: 1.4rem;
  font-weight: 600;
}

nav {
  display: flex;
  gap: 0.5rem;
  flex-wrap: wrap;
}

nav button, .btn {
  background: var(--surface2);
  color: var(--text);
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 0.5rem 1rem;
  cursor: pointer;
  font-size: 0.9rem;
}

nav button.active, .btn-primary {
  background: var(--accent);
  border-color: var(--accent);
  color: #fff;
}

.btn-danger { background: #8b2e2e; border-color: #a33; color: #fff; }
.btn-sm { padding: 0.35rem 0.7rem; font-size: 0.82rem; }

.cards {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
  gap: 1rem;
}

.card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 1rem 1.1rem;
}

.card h3 { margin: 0 0 0.75rem; font-size: 1.05rem; }

.status-dot {
  display: inline-block;
  width: 10px;
  height: 10px;
  border-radius: 50%;
  margin-right: 6px;
}

.status-ok .status-dot { background: var(--green); }
.status-error .status-dot { background: var(--red); }
.status-unknown .status-dot { background: var(--muted); }

.meta { color: var(--muted); font-size: 0.85rem; line-height: 1.6; }
.meta strong { color: var(--text); font-weight: 500; }

.card-actions {
  display: flex;
  gap: 0.5rem;
  margin-top: 1rem;
  flex-wrap: wrap;
}

.panel {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 1.25rem;
}

.form-grid {
  display: grid;
  gap: 1rem;
  max-width: 520px;
}

label {
  display: block;
  font-size: 0.85rem;
  color: var(--muted);
  margin-bottom: 0.35rem;
}

input[type="text"], input[type="password"], input[type="number"] {
  width: 100%;
  padding: 0.55rem 0.7rem;
  border-radius: 8px;
  border: 1px solid var(--border);
  background: var(--bg);
  color: var(--text);
}

.checkbox-row {
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.log-viewer {
  background: #0a0e14;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 1rem;
  height: 420px;
  overflow-y: auto;
  font-family: Consolas, "Courier New", monospace;
  font-size: 0.82rem;
  line-height: 1.5;
}

.log-line { margin-bottom: 0.35rem; }
.log-error { color: var(--red); }
.log-info { color: var(--muted); }

.login-wrap {
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 1rem;
}

.login-box {
  width: 100%;
  max-width: 380px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 2rem;
}

.login-box h1 {
  margin: 0 0 0.25rem;
  font-size: 1.3rem;
}

.login-box p {
  color: var(--muted);
  font-size: 0.9rem;
  margin: 0 0 1.5rem;
}

.error-banner {
  background: #3a1f1f;
  border: 1px solid var(--red);
  color: #ffc9c9;
  padding: 0.65rem 0.85rem;
  border-radius: 8px;
  margin-bottom: 1rem;
  font-size: 0.88rem;
}

.hidden { display: none !important; }

.toolbar {
  display: flex;
  gap: 0.75rem;
  margin-bottom: 1rem;
  flex-wrap: wrap;
  align-items: center;
}

.modal-backdrop {
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,0.6);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 100;
  padding: 1rem;
}

.modal {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 1.25rem;
  width: 100%;
  max-width: 480px;
}

.modal h2 { margin: 0 0 1rem; font-size: 1.1rem; }

.modal-actions {
  display: flex;
  gap: 0.5rem;
  justify-content: flex-end;
  margin-top: 1rem;
}
