:root {
  --bg: #0a0f1a;
  --panel: #111827;
  --panel2: #0f1626;
  --border: #1f2b40;
  --text: #e6edf6;
  --muted: #8aa0bd;
  --accent: #4f7cff;
  --accent2: #22d3ee;
  --err: #f87171;
}
* { box-sizing: border-box; }
body {
  margin: 0;
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
  background: radial-gradient(1200px 600px at 70% -10%, #12203a 0%, var(--bg) 55%);
  color: var(--text);
  min-height: 100vh;
}
.hidden { display: none !important; }
.muted { color: var(--muted); }
.small { font-size: 0.82rem; }
.tiny { font-size: 0.75rem; }
.err { color: var(--err); }
.link { color: var(--accent2); text-decoration: none; }

/* Login */
.login { display: flex; align-items: center; justify-content: center; min-height: 100vh; }
.login-card {
  background: var(--panel); border: 1px solid var(--border);
  border-radius: 16px; padding: 2.2rem; width: 340px; text-align: center;
}
.login-card h1 { margin: 0 0 .3rem; font-size: 1.4rem; }
.login-card h1 span, .brand span { color: var(--accent2); font-weight: 400; }
.login-card input {
  width: 100%; margin: 1rem 0 .8rem; padding: .7rem .9rem;
  background: var(--panel2); border: 1px solid var(--border); border-radius: 10px; color: var(--text);
}

/* App */
.topbar {
  display: flex; align-items: center; gap: 1.5rem;
  padding: .9rem 1.4rem; border-bottom: 1px solid var(--border); background: rgba(17,24,39,.6);
  position: sticky; top: 0; backdrop-filter: blur(8px); z-index: 5;
}
.brand { font-weight: 600; font-size: 1.05rem; }
.tabs { display: flex; gap: .4rem; flex: 1; }
.tab {
  background: transparent; border: 1px solid transparent; color: var(--muted);
  padding: .45rem .9rem; border-radius: 8px; cursor: pointer; font-size: .9rem;
}
.tab.active { color: var(--text); background: var(--panel); border-color: var(--border); }
main { padding: 1.6rem; max-width: 1100px; margin: 0 auto; }
.panel-head { display: flex; align-items: center; justify-content: space-between; }
h2 { margin: .2rem 0 1rem; }
h3 { margin: 1.6rem 0 .6rem; }

/* Buttons */
.btn {
  background: var(--panel); border: 1px solid var(--border); color: var(--text);
  padding: .55rem 1rem; border-radius: 9px; cursor: pointer; font-size: .9rem;
}
.btn:hover { border-color: var(--accent); }
.btn.primary { background: var(--accent); border-color: var(--accent); color: #fff; }
.btn.ghost { background: transparent; }
.btn.small { padding: .4rem .7rem; font-size: .82rem; }
.btn:disabled { opacity: .5; cursor: default; }

/* Cards (tenants) */
.cards { display: grid; grid-template-columns: repeat(auto-fill, minmax(340px, 1fr)); gap: 1rem; }
.card { background: var(--panel); border: 1px solid var(--border); border-radius: 14px; padding: 1.1rem; }
.card-top { display: flex; align-items: center; justify-content: space-between; margin-bottom: .8rem; }
.card-title { font-weight: 600; display: flex; align-items: center; gap: .5rem; }
.dot { width: 9px; height: 9px; border-radius: 50%; display: inline-block; }
.metrics { display: grid; grid-template-columns: 1fr 1fr 1fr; gap: .7rem .5rem; margin-bottom: .9rem; }
.metrics div { display: flex; flex-direction: column; }
.metrics span { font-size: .72rem; }
.metrics b { font-size: .95rem; margin-top: 2px; }
.card-actions { display: flex; gap: .4rem; }

/* Config */
.config-list { display: flex; flex-direction: column; gap: .5rem; margin-bottom: .7rem; }
.cfg-row { display: flex; align-items: center; gap: .6rem; }
.cfg-key { min-width: 220px; font-family: ui-monospace, monospace; font-size: .85rem; color: var(--accent2); }
.cfg-val { flex: 1; padding: .5rem .7rem; background: var(--panel2); border: 1px solid var(--border); border-radius: 8px; color: var(--text); }
.cfg-textarea { width: 100%; padding: .6rem .8rem; background: var(--panel2); border: 1px solid var(--border); border-radius: 8px; color: var(--text); font-family: inherit; font-size: .9rem; resize: vertical; margin-bottom: .3rem; }
code { background: var(--panel2); padding: 1px 5px; border-radius: 5px; font-size: .82rem; color: var(--accent2); }
.save-row { display: flex; align-items: center; gap: .8rem; margin-top: 1rem; }
.save-row input { padding: .5rem .7rem; background: var(--panel2); border: 1px solid var(--border); border-radius: 8px; color: var(--text); }
hr { border: none; border-top: 1px solid var(--border); margin: 1.6rem 0; }

/* Switch */
.switch { position: relative; display: inline-block; width: 42px; height: 24px; }
.switch input { display: none; }
.switch span { position: absolute; inset: 0; background: var(--border); border-radius: 999px; transition: .2s; }
.switch span::before { content: ''; position: absolute; width: 18px; height: 18px; left: 3px; top: 3px; background: #fff; border-radius: 50%; transition: .2s; }
.switch input:checked + span { background: var(--accent); }
.switch input:checked + span::before { transform: translateX(18px); }

/* Provision */
.form-grid { display: grid; grid-template-columns: 1fr 1fr; gap: .8rem; margin-bottom: 1rem; }
.form-grid label { display: flex; flex-direction: column; gap: .3rem; font-size: .85rem; color: var(--muted); }
.form-grid input { padding: .55rem .7rem; background: var(--panel2); border: 1px solid var(--border); border-radius: 8px; color: var(--text); }
.out { background: #060a12; border: 1px solid var(--border); border-radius: 10px; padding: 1rem; margin-top: 1rem; white-space: pre-wrap; font-size: .82rem; color: var(--muted); max-height: 340px; overflow: auto; }
