/* Falconet Dashboard MVP — styles */
*,*::before,*::after { box-sizing: border-box; }
html,body { margin:0; padding:0; }
body {
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Arial, sans-serif;
  background: #0f172a;
  color: #e2e8f0;
  font-size: 14px;
  line-height: 1.4;
  min-height: 100vh;
}

/* ---------- TOPBAR ---------- */
.topbar {
  background: linear-gradient(90deg,#0b1224,#1e293b);
  border-bottom: 1px solid #334155;
  position: sticky; top:0; z-index: 10;
}
.topbar-inner {
  max-width: 1400px; margin: 0 auto;
  padding: 12px 24px;
  display: flex; justify-content: space-between; align-items: center;
  gap: 16px; flex-wrap: wrap;
}
.brand { display: flex; align-items: center; gap: 10px; }
.brand-dot {
  width: 12px; height: 12px; border-radius: 50%;
  background: #22c55e;
  box-shadow: 0 0 10px #22c55e;
  animation: pulse 2s infinite;
}
@keyframes pulse {
  0%,100% { opacity: 1; }
  50% { opacity: 0.5; }
}
.brand-name { font-weight: 700; font-size: 18px; letter-spacing: 1px; }
.brand-sub { color: #94a3b8; font-size: 12px; }
.top-meta { display: flex; align-items: center; gap: 14px; flex-wrap: wrap; font-size: 12px; color: #cbd5e1; }
.muted { color: #94a3b8; }
.pill {
  padding: 4px 10px; border-radius: 999px; font-size: 11px;
  background: #1e293b; border: 1px solid #475569;
}
.pill-on { background: #064e3b; border-color: #10b981; color: #6ee7b7; }
.btn-logout {
  color: #fca5a5; text-decoration: none; padding: 6px 12px;
  border: 1px solid #7f1d1d; border-radius: 6px; font-size: 12px;
  transition: all 0.15s;
}
.btn-logout:hover { background: #7f1d1d; color: #fff; }

/* ---------- GRID ---------- */
.dash-grid {
  max-width: 1400px; margin: 24px auto;
  padding: 0 24px;
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 20px;
}
@media (max-width: 900px) { .dash-grid { grid-template-columns: 1fr; } }

/* ---------- CARDS ---------- */
.card {
  background: #1e293b;
  border: 1px solid #334155;
  border-radius: 10px;
  padding: 20px;
  box-shadow: 0 4px 6px rgba(0,0,0,0.1);
}
.card-title {
  font-size: 16px;
  margin: 0 0 16px 0;
  padding-bottom: 12px;
  border-bottom: 1px solid #334155;
  color: #f1f5f9;
  font-weight: 600;
}
.card-subtitle {
  font-weight: 400; font-size: 12px;
  color: #94a3b8; margin-left: 8px;
}

/* ---------- KPI ---------- */
.kpi-row {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(140px, 1fr));
  gap: 12px;
}
.kpi {
  background: #0f172a;
  border: 1px solid #334155;
  border-radius: 8px;
  padding: 14px;
  transition: all 0.2s;
}
.kpi.warn { border-color: #f59e0b; background: #422006; }
.kpi.crit { border-color: #ef4444; background: #450a0a; }
.kpi-label { color: #94a3b8; font-size: 11px; text-transform: uppercase; letter-spacing: 1px; margin-bottom: 6px; }
.kpi-val { font-size: 28px; font-weight: 700; color: #f8fafc; }
.kpi-val.small { font-size: 16px; line-height: 1.5; }
.kpi-unit { font-size: 14px; color: #94a3b8; margin-left: 2px; }
.kpi-bar {
  height: 6px; background: #334155; border-radius: 3px;
  overflow: hidden; margin-top: 10px;
}
.kpi-bar-fill {
  height: 100%; background: #22c55e; transition: width 0.4s, background 0.4s;
  width: 0%;
}
.kpi.warn .kpi-bar-fill { background: #f59e0b; }
.kpi.crit .kpi-bar-fill { background: #ef4444; }
.kpi-foot { color: #94a3b8; font-size: 11px; margin-top: 6px; }

/* ---------- TABLES ---------- */
.data-table { width: 100%; border-collapse: collapse; }
.data-table th, .data-table td {
  text-align: left; padding: 8px 10px;
  border-bottom: 1px solid #334155;
  font-size: 13px;
}
.data-table th {
  color: #94a3b8; font-size: 11px;
  font-weight: 600; text-transform: uppercase;
  letter-spacing: 0.5px;
}
.data-table tbody tr:hover { background: rgba(51,65,85,0.5); }
.data-table tbody tr:last-child td { border-bottom: none; }
.loading { color: #94a3b8; text-align: center; padding: 20px !important; font-style: italic; }

/* status badges */
.badge {
  display: inline-block; padding: 3px 8px; border-radius: 4px;
  font-size: 11px; font-weight: 600; text-transform: uppercase;
  letter-spacing: 0.5px;
}
.badge-ok { background: #064e3b; color: #6ee7b7; }
.badge-warn { background: #422006; color: #fcd34d; }
.badge-crit { background: #450a0a; color: #fca5a5; }
.badge-down { background: #450a0a; color: #fca5a5; }
.badge-missing { background: #1e293b; color: #94a3b8; border: 1px dashed #475569; }

td.num { text-align: right; font-variant-numeric: tabular-nums; }
td.mono { font-family: "Courier New", monospace; font-size: 12px; color: #cbd5e1; }
td.host { font-weight: 500; color: #f1f5f9; }

/* ---------- FOOT ---------- */
.footbar {
  text-align: center; padding: 20px;
  color: #64748b; font-size: 11px;
  margin-top: 20px;
}

/* ---------- LOGIN ---------- */
.login-body {
  display: flex; align-items: center; justify-content: center;
  min-height: 100vh; padding: 20px;
  background: linear-gradient(135deg, #0f172a, #1e293b);
}
.login-card {
  background: #1e293b;
  border: 1px solid #334155;
  border-radius: 12px;
  padding: 32px;
  width: 100%; max-width: 380px;
  box-shadow: 0 20px 50px rgba(0,0,0,0.4);
}
.login-logo {
  font-size: 24px; font-weight: 700; letter-spacing: 2px;
  color: #f8fafc; text-align: center;
}
.login-sub {
  text-align: center; color: #94a3b8; font-size: 12px;
  margin: 4px 0 24px 0;
}
.login-label { display: block; color: #94a3b8; font-size: 12px; margin-bottom: 6px; }
.login-input {
  width: 100%; padding: 10px 12px;
  background: #0f172a; border: 1px solid #475569;
  color: #f1f5f9; border-radius: 6px; font-size: 14px;
}
.login-input:focus { outline: none; border-color: #3b82f6; }
.login-btn {
  width: 100%; margin-top: 16px; padding: 12px;
  background: #2563eb; color: #fff; border: none;
  border-radius: 6px; font-size: 14px; font-weight: 600;
  cursor: pointer; transition: background 0.15s;
}
.login-btn:hover { background: #1d4ed8; }
.login-error {
  background: #450a0a; border: 1px solid #7f1d1d;
  color: #fca5a5; padding: 10px 12px;
  border-radius: 6px; margin-bottom: 16px; font-size: 13px;
}
.login-foot {
  text-align: center; color: #64748b; font-size: 11px;
  margin-top: 20px; padding-top: 16px;
  border-top: 1px solid #334155;
}
