/* ── Landscape UI ─────────────────────────────────────── */
:root {
  --bg: #0f1117;
  --surface: #1a1d27;
  --border: #2a2d3a;
  --text: #e2e8f0;
  --muted: #8892a4;
  --green: #22c55e;
  --yellow: #eab308;
  --red: #ef4444;
  --blue: #3b82f6;
  --radius: 8px;
}

* { box-sizing: border-box; margin: 0; padding: 0; }

body {
  font-family: 'Inter', system-ui, sans-serif;
  background: var(--bg);
  color: var(--text);
  font-size: 14px;
  min-height: 100vh;
}

a { color: var(--blue); text-decoration: none; }

.dash-header {
  display: flex; align-items: center; justify-content: space-between;
  padding: 1.5rem 2rem; border-bottom: 1px solid var(--border);
  background: var(--surface);
}
.dash-header h2 { font-size: 1.25rem; font-weight: 600; }
.last-updated { font-size: 0.75rem; color: var(--muted); margin-top: 2px; display: block; }
.header-actions { display: flex; gap: 0.5rem; align-items: center; }

.btn-primary, .btn-secondary, .btn-outline, .btn-sm {
  padding: 0.45rem 1rem; border-radius: var(--radius); border: none;
  cursor: pointer; font-size: 0.85rem; font-weight: 500; transition: opacity .15s;
}
.btn-primary { background: var(--blue); color: #fff; }
.btn-secondary { background: var(--border); color: var(--text); }
.btn-outline { background: transparent; border: 1px solid var(--border); color: var(--muted); }
.btn-sm { padding: 0.25rem 0.6rem; font-size: 0.75rem; }
.btn-warn { background: #78350f; color: #fde68a; }
.btn-danger { background: #7f1d1d; color: #fca5a5; }
button:disabled { opacity: .5; cursor: not-allowed; }

.alert { padding: 0.75rem 1rem; border-radius: var(--radius); margin-bottom: 1rem; font-size: 0.875rem; }
.alert-error { background: #450a0a; border: 1px solid #7f1d1d; color: #fca5a5; }
.alert-success { background: #052e16; border: 1px solid #14532d; color: #86efac; }

.server-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(380px, 1fr));
  gap: 1rem; padding: 1.5rem 2rem;
}

.server-card {
  background: var(--surface); border: 1px solid var(--border);
  border-radius: var(--radius); padding: 1rem;
  border-left: 3px solid var(--border);
}
.server-card.healthy { border-left-color: var(--green); }
.server-card.warning { border-left-color: var(--yellow); }
.server-card.critical { border-left-color: var(--red); }
.server-card.unknown { border-left-color: var(--muted); }

.card-header { display: flex; align-items: center; gap: 0.5rem; margin-bottom: 0.75rem; flex-wrap: wrap; }
.status-dot { width: 8px; height: 8px; border-radius: 50%; background: var(--muted); flex-shrink: 0; }
.status-dot.healthy { background: var(--green); }
.status-dot.warning { background: var(--yellow); }
.status-dot.critical { background: var(--red); animation: pulse 1.5s infinite; }
@keyframes pulse { 0%,100% { opacity: 1; } 50% { opacity: .4; } }
.ip { font-size: 0.75rem; color: var(--muted); }

.metrics { display: flex; flex-direction: column; gap: 0.5rem; }
.metric { display: grid; grid-template-columns: 36px 1fr 90px; align-items: center; gap: 0.5rem; }
.metric-label { font-size: 0.75rem; color: var(--muted); }
.metric-val { font-size: 0.75rem; color: var(--muted); text-align: right; }
.bar-wrap { background: var(--bg); border-radius: 4px; height: 6px; overflow: hidden; }
.bar { height: 100%; border-radius: 4px; transition: width .5s; min-width: 2px; }
.bar-ok { background: var(--green); }
.bar-warn { background: var(--yellow); }
.bar-critical { background: var(--red); }

.info-row { display: flex; gap: 0.75rem; flex-wrap: wrap; margin-top: 0.25rem; font-size: 0.75rem; color: var(--muted); }
.card-footer { font-size: 0.7rem; color: var(--muted); margin-top: 0.75rem; border-top: 1px solid var(--border); padding-top: 0.5rem; }
.error-msg { font-size: 0.8rem; color: var(--red); margin: 0.5rem 0; }

.badge { font-size: 0.7rem; padding: 0.15rem 0.5rem; border-radius: 4px; font-weight: 500; }
.badge-error { background: #450a0a; color: #fca5a5; }
.badge-warn { background: #422006; color: #fde68a; }
.badge-info { background: #1e3a5f; color: #93c5fd; }
.badge-ok { background: #052e16; color: #86efac; }
.badge-off { background: #1a1d27; color: var(--muted); }
.badge-windows { background: #1e3a5f; color: #93c5fd; }

.empty-state { text-align: center; padding: 4rem 2rem; color: var(--muted); }
.empty-state p { margin-bottom: 1rem; }

.login-wrap { min-height: 100vh; display: flex; align-items: center; justify-content: center; }
.login-card { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); padding: 2rem; width: 360px; }
.login-logo { text-align: center; margin-bottom: 1.5rem; }
.logo-icon { font-size: 2rem; }
.login-logo h1 { font-size: 1.5rem; margin-top: 0.25rem; }
.login-logo p { color: var(--muted); font-size: 0.85rem; }
.field { display: flex; flex-direction: column; gap: 0.35rem; margin-bottom: 1rem; }
.field label { font-size: 0.8rem; color: var(--muted); }
.field input { background: var(--bg); border: 1px solid var(--border); color: var(--text); padding: 0.5rem 0.75rem; border-radius: var(--radius); font-size: 0.9rem; width: 100%; }
.field input:focus { outline: none; border-color: var(--blue); }
.login-card .btn-primary { width: 100%; padding: 0.6rem; }

.section-card { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); margin: 1.5rem 2rem; padding: 1.5rem; }
.section-card h3 { margin-bottom: 1rem; font-size: 1rem; }
.form-row { display: flex; gap: 1rem; flex-wrap: wrap; margin-bottom: 0.5rem; }
.form-row .field { flex: 1; min-width: 160px; }
.form-row .field-sm { flex: 0 0 100px; }
.form-row .field-check { display: flex; align-items: flex-end; padding-bottom: 0.5rem; }
.pubkey-notice { background: var(--bg); border: 1px solid var(--border); border-radius: var(--radius); padding: 0.75rem; margin: 0.75rem 0; font-size: 0.8rem; color: var(--muted); }
.pubkey-notice pre { margin-top: 0.5rem; word-break: break-all; white-space: pre-wrap; font-size: 0.72rem; }
.server-table { width: 100%; border-collapse: collapse; }
.server-table th, .server-table td { padding: 0.6rem 0.75rem; text-align: left; border-bottom: 1px solid var(--border); font-size: 0.82rem; }
.server-table th { color: var(--muted); font-weight: 500; }
.server-table td:last-child { display: flex; gap: 0.4rem; }
.empty-msg { color: var(--muted); }
