:root {
  --bg: #0e1116;
  --panel: #161b22;
  --panel-2: #1c2230;
  --border: #262d3a;
  --text: #e6edf3;
  --muted: #8b949e;
  --accent: #4b8bf5;      /* BeBrand placeholder */
  --accent-2: #17c3b2;    /* Baimbroq placeholder */
  --ok: #2ea043;
  --warn: #d29922;
  --bad: #f85149;
  --radius: 10px;
}

* { box-sizing: border-box; }
/* the hidden attribute must always win over element display rules
   (e.g. .login-wrap uses display:grid, which otherwise overrides it) */
[hidden] { display: none !important; }
body {
  margin: 0;
  font: 15px/1.5 system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  background: var(--bg);
  color: var(--text);
}
.muted { color: var(--muted); }
.small { font-size: 13px; }
.error { color: var(--bad); }

button {
  font: inherit;
  background: var(--accent);
  color: #fff;
  border: 0;
  padding: 8px 14px;
  border-radius: 8px;
  cursor: pointer;
}
button:hover { filter: brightness(1.08); }
button.ghost { background: transparent; color: var(--muted); border: 1px solid var(--border); }

input, select {
  font: inherit;
  width: 100%;
  padding: 9px 11px;
  background: var(--panel-2);
  border: 1px solid var(--border);
  border-radius: 8px;
  color: var(--text);
  margin-top: 4px;
}
label { display: block; margin: 12px 0; font-size: 14px; }

/* co-brand lockup (placeholder until jessie's assets land) */
.cobrand { display: flex; align-items: center; gap: 10px; font-weight: 700; letter-spacing: .3px; }
.cobrand-mark { color: var(--accent); }
.cobrand-mark.alt { color: var(--accent-2); }
.cobrand-x { color: var(--muted); font-weight: 400; }
.cobrand.small { font-size: 15px; }
.topbar-title { margin-left: 14px; padding-left: 14px; border-left: 1px solid var(--border); font-weight: 600; color: var(--text); }

/* login */
.login-wrap { min-height: 100vh; display: grid; place-items: center; padding: 20px; }
.login-card {
  width: 360px; max-width: 100%;
  background: var(--panel); border: 1px solid var(--border);
  border-radius: var(--radius); padding: 28px;
}
.login-card .cobrand { justify-content: center; font-size: 18px; margin-bottom: 18px; }
.login-card h1 { margin: 0 0 4px; font-size: 20px; }
.login-card button { width: 100%; margin-top: 8px; padding: 10px; }

/* app */
.topbar {
  display: flex; align-items: center; justify-content: space-between;
  padding: 14px 22px; background: var(--panel); border-bottom: 1px solid var(--border);
}
.topbar-right { display: flex; align-items: center; gap: 14px; }
.content { max-width: 1000px; margin: 0 auto; padding: 26px 22px; }
.row-head { display: flex; align-items: center; justify-content: space-between; margin: 8px 0 14px; }
.row-head h2 { margin: 0; font-size: 18px; }

.summary { display: flex; gap: 14px; flex-wrap: wrap; margin-bottom: 24px; }
.stat { background: var(--panel); border: 1px solid var(--border); border-radius: var(--radius); padding: 14px 18px; min-width: 120px; }
.stat .n { font-size: 24px; font-weight: 700; }
.stat .l { color: var(--muted); font-size: 13px; }

table.sites { width: 100%; border-collapse: collapse; background: var(--panel); border: 1px solid var(--border); border-radius: var(--radius); overflow: hidden; }
table.sites th, table.sites td { text-align: left; padding: 11px 14px; border-bottom: 1px solid var(--border); font-size: 14px; }
table.sites th { color: var(--muted); font-weight: 600; background: var(--panel-2); }
table.sites tr:last-child td { border-bottom: 0; }

.badge { display: inline-block; padding: 2px 9px; border-radius: 999px; font-size: 12px; font-weight: 600; }
.badge.ok { background: rgba(46,160,67,.15); color: var(--ok); }
.badge.warn { background: rgba(210,153,34,.15); color: var(--warn); }
.badge.bad { background: rgba(248,81,73,.15); color: var(--bad); }
.badge.neutral { background: var(--panel-2); color: var(--muted); }

dialog { background: var(--panel); color: var(--text); border: 1px solid var(--border); border-radius: var(--radius); width: 400px; max-width: 92vw; }
dialog::backdrop { background: rgba(0,0,0,.5); }
dialog h3 { margin-top: 0; }
dialog menu { display: flex; justify-content: flex-end; gap: 10px; padding: 0; margin: 18px 0 0; }
