/* Roboto is already loaded by tabm-brand.css (linked before this file in
   base.html) - no need to import it again here. Palette matches
   config-frontend/jetbuilt-dashboard's shared tokens for cross-tool
   cohesion (this hub is the front door to both). */

:root {
  --brand: #cc3627;
  --brand-hover: #e0483a;
  --brand-tint: rgba(204, 54, 39, 0.14);
  --bg: #12151c;
  --bg-well: #0b1019;
  --panel: #1b1f29;
  --panel-raised: #242a36;
  --border: #2b3140;
  --border-soft: #23272f;
  --text: #ecedf0;
  --muted: #9ba1ac;
  --faint: #666c78;
  --ok: #3fb27f;
  --ok-tint: rgba(63, 178, 127, 0.14);
  --warn: #e0a73d;
  --warn-tint: rgba(224, 167, 61, 0.14);
  --error: #ff6b54;
  --error-tint: rgba(255, 107, 84, 0.14);
  --radius: 6px;
}

* { box-sizing: border-box; }

html { font-size: 17px; }
html, body {
  background: var(--bg);
  color: var(--text);
  font-family: 'Roboto', -apple-system, 'Segoe UI', sans-serif;
  -webkit-font-smoothing: antialiased;
  margin: 0;
  padding: 0;
  min-height: 100%;
}

/* ---------- identity bar ----------
   .topbar/.brand/.brand-mark/.brand-name are owned by tabm-brand.css -
   only this app's own additions live here. */
.brand-divider { width: 1px; height: 20px; background: var(--border); }
.page-title { font-size: 0.85rem; color: var(--muted); }
.topbar-right { display: flex; align-items: center; gap: 0.9rem; }
.topbar-right .user-email { font-size: 0.8rem; color: var(--muted); }
.topbar-right form { margin: 0; }
.topbar-right .logout-btn {
  background: none; border: 1px solid var(--border); color: var(--muted);
  border-radius: 999px; padding: 0.32rem 0.85rem; font-size: 0.78rem; cursor: pointer;
}
.topbar-right .logout-btn:hover { color: var(--text); border-color: var(--faint); }

/* ---------- footer ---------- */
.app-footer {
  border-top: 1px solid var(--border);
  padding: 0.9rem 2rem;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  flex-wrap: wrap;
  font-size: 0.72rem;
  color: var(--faint);
  background: var(--bg-well);
  margin-top: 3rem;
}

main { max-width: 1100px; margin: 0 auto; padding: 1.5rem 2rem 3rem; }
main.centered { max-width: 380px; padding-top: 4rem; }
main.full { max-width: none; }

.tab-btn.active { background: var(--brand); border-color: var(--brand); color: #fff; }

h1, h2, h3, h4 { text-wrap: balance; margin-top: 0; }
.muted { color: var(--muted); font-size: 0.93rem; }

.banner {
  padding: 0.75rem 1rem;
  border-radius: var(--radius);
  margin-bottom: 1rem;
  border: 1px solid var(--border);
  font-size: 0.9rem;
}
.banner.error { border-color: var(--error); color: var(--error); background: var(--error-tint); }
.banner.ok { border-color: var(--ok); color: var(--ok); background: var(--ok-tint); }

/* ---------- forms ---------- */
.card {
  background: var(--panel);
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 1.5rem;
}
label { display: block; font-size: 0.82rem; color: var(--muted); margin: 0.9rem 0 0.3rem; }
input[type="text"], input[type="email"], input[type="password"] {
  width: 100%;
  background: var(--bg-well);
  border: 1px solid var(--border);
  color: var(--text);
  border-radius: var(--radius);
  padding: 0.55rem 0.7rem;
  font-size: 0.95rem;
  font-family: inherit;
}
input:focus { outline: none; border-color: var(--brand); }

button, .btn {
  background: var(--panel-raised);
  border: 1px solid var(--border);
  color: var(--text);
  border-radius: var(--radius);
  padding: 0.55rem 1rem;
  font-size: 0.88rem;
  font-weight: 500;
  cursor: pointer;
  font-family: inherit;
}
button:hover, .btn:hover { border-color: var(--faint); }
button.primary, .btn.primary {
  background: var(--brand);
  border-color: var(--brand);
  color: #fff;
}
button.primary:hover, .btn.primary:hover { background: var(--brand-hover); border-color: var(--brand-hover); }
button.danger { background: transparent; border-color: var(--error); color: var(--error); }
button.danger:hover { background: var(--error-tint); }

/* ---------- status chips ---------- */
.chip {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  font-size: 0.72rem;
  font-weight: 700;
  letter-spacing: 0.01em;
  padding: 0.2rem 0.55rem;
  border-radius: 999px;
  text-transform: uppercase;
}
.chip::before { content: ''; width: 6px; height: 6px; border-radius: 50%; background: currentColor; }
.chip.online { background: var(--ok-tint); color: var(--ok); }
.chip.offline { background: var(--border-soft); color: var(--faint); }

/* ---------- site picker ---------- */
.site-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(240px, 1fr));
  gap: 1rem;
  margin-top: 1.25rem;
}
.site-card {
  display: block;
  background: var(--panel);
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 1.1rem;
  text-decoration: none;
  color: var(--text);
  transition: border-color 0.15s;
}
.site-card:hover { border-color: var(--brand); }
.site-card h3 { margin: 0 0 0.5rem; font-size: 1rem; }
.site-card .muted { font-size: 0.78rem; }
.empty-state { color: var(--muted); padding: 2rem 0; text-align: center; }

/* ---------- admin ---------- */
table { width: 100%; border-collapse: collapse; margin-top: 1rem; }
th, td { text-align: left; padding: 0.6rem 0.7rem; border-bottom: 1px solid var(--border-soft); font-size: 0.88rem; }
th { color: var(--muted); font-weight: 500; font-size: 0.75rem; text-transform: uppercase; letter-spacing: 0.03em; }
.token-box {
  font-family: 'Consolas', 'SF Mono', monospace;
  background: var(--bg-well);
  border: 1px solid var(--ok);
  border-radius: var(--radius);
  padding: 0.7rem 0.9rem;
  word-break: break-all;
  font-size: 0.85rem;
  margin: 0.75rem 0;
}
.inline-form { display: flex; gap: 0.6rem; align-items: flex-end; flex-wrap: wrap; margin-top: 1rem; }
.inline-form label { margin: 0 0 0.3rem; }
.inline-form > div { flex: 1; min-width: 160px; }
