/* WattBridge.nl – gedeelde stijl van het setup-portal (hub) en het beheerdashboard (cloud).
   edge/esh_agent/static/style.css en cloud/esh_cloud/static/style.css moeten gelijk blijven
   (tests/test_static.py controleert dat). */
:root {
  --nacht: #0B1F33; --diep: #12324F; --stroom: #1F6FB2; --licht: #E8F1FA;
  --zon: #F5A623; --zon-bg: #FDF3E1; --groen: #1E9E5E; --groen-bg: #E5F6ED;
  --rood: #B42318; --rood-bg: #FDECEA; --grijs: #F2F4F7; --steen: #5B6573;

  --bg: #F7F9FB; --surface: #ffffff; --surface-alt: var(--grijs); --text: var(--nacht);
  --muted: var(--steen); --border: rgba(11, 31, 51, 0.09); --border-strong: rgba(11, 31, 51, 0.16);
  --accent: var(--stroom); --shadow: 0 1px 3px rgba(11, 31, 51, 0.06);
}
@media (prefers-color-scheme: dark) {
  :root {
    --bg: #0A141F; --surface: #102030; --surface-alt: #15283B; --text: #E7EEF5; --muted: #98A6B5;
    --border: rgba(232, 241, 250, 0.10); --border-strong: rgba(232, 241, 250, 0.18);
    --licht: #15304A; --groen-bg: #12301F; --rood-bg: #3A1C1A; --zon-bg: #3A2C12; --accent: #5AA6E6;
  }
  .logo .ink { fill: var(--text); }
}
* { box-sizing: border-box; }
html, body { margin: 0; padding: 0; }
body {
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", system-ui, sans-serif;
  background: var(--bg); color: var(--text); line-height: 1.5; min-height: 100vh; padding: 16px;
}
.wrap { max-width: 760px; margin: 0 auto; }
.wrap.wide { max-width: 1240px; }
header { text-align: center; padding: 16px 0 6px; }
.logo { height: 38px; width: auto; }
.brand-name { font-size: 26px; font-weight: 700; color: var(--accent); letter-spacing: -0.01em; }
.brand-logo { height: 40px; width: auto; max-width: 260px; }
h1 { font-size: 21px; margin: 6px 0 0; font-weight: 600; letter-spacing: -0.01em; }
.subtitle { color: var(--muted); font-size: 14px; margin: 0; }
h2 {
  font-size: 13px; text-transform: uppercase; letter-spacing: 0.06em; color: var(--muted);
  margin: 22px 4px 8px; font-weight: 600; display: flex; gap: 8px; align-items: center;
}
h2 .right { margin-left: auto; text-transform: none; letter-spacing: 0; }
h3 { font-size: 16px; margin: 0 0 8px; }
nav {
  display: flex; gap: 4px; justify-content: center; flex-wrap: wrap; margin: 16px auto 4px;
  padding: 4px; background: var(--surface-alt); border-radius: 12px; width: fit-content; max-width: 100%;
}
nav button { width: auto; padding: 7px 14px; font-size: 14px; background: none; color: var(--muted); border-radius: 9px; }
nav button.active { background: var(--surface); color: var(--text); box-shadow: var(--shadow); }
.card {
  background: var(--surface); border: 1px solid var(--border); border-radius: 14px; padding: 16px 18px;
  box-shadow: var(--shadow); margin-bottom: 12px;
}
.card.narrow { max-width: 420px; margin: 24px auto; }
.grid { display: grid; gap: 12px; grid-template-columns: repeat(auto-fit, minmax(200px, 1fr)); }
.tile { background: var(--surface); border: 1px solid var(--border); border-radius: 14px; padding: 14px 16px; }
.tile .label { color: var(--muted); font-size: 13px; }
.tile .value { font-size: 24px; font-weight: 600; }
label { display: block; font-size: 14px; font-weight: 500; margin: 10px 0 4px; }
label.check { display: flex; gap: 8px; align-items: center; font-weight: 600; }
label.check input { width: auto; }
.hint { color: var(--muted); font-size: 13px; margin: 2px 0 0; font-weight: 400; }
input, select, textarea {
  width: 100%; padding: 9px 11px; font: inherit; color: var(--text); background: var(--surface);
  border: 1px solid var(--border-strong); border-radius: 9px;
}
input:focus, select:focus, textarea:focus { outline: 2px solid var(--accent); outline-offset: 1px; }
button {
  width: 100%; padding: 10px 14px; font: inherit; font-weight: 600; border: 0; border-radius: 10px;
  background: var(--accent); color: #fff; cursor: pointer; margin-top: 12px;
}
button.secondary { background: var(--surface-alt); color: var(--text); }
button.danger { background: var(--rood); }
button.small { width: auto; padding: 5px 10px; font-size: 13px; margin: 0; }
button:disabled { opacity: 0.55; cursor: default; }
.row { display: flex; gap: 10px; flex-wrap: wrap; align-items: center; }
.row > * { flex: 1; }
.row > .auto { flex: 0 0 auto; }
.error { color: var(--rood); font-size: 14px; min-height: 1em; margin: 8px 0 0; white-space: pre-wrap; }
.ok { color: var(--groen); font-size: 14px; margin: 8px 0 0; }
.code {
  font-family: ui-monospace, SFMono-Regular, Menlo, monospace; font-size: 26px; letter-spacing: 0.08em;
  text-align: center; padding: 12px; background: var(--licht); border-radius: 10px; margin: 8px 0;
}
.mono { font-family: ui-monospace, SFMono-Regular, Menlo, monospace; font-size: 13px; word-break: break-all; }
.badge {
  display: inline-block; padding: 2px 9px; border-radius: 999px; font-size: 12px; font-weight: 600;
  background: var(--surface-alt); color: var(--muted); white-space: nowrap;
}
.badge.ok { background: var(--groen-bg); color: var(--groen); margin: 0; }
.badge.warn { background: var(--zon-bg); color: #9A6100; }
.badge.bad { background: var(--rood-bg); color: var(--rood); }
.badge.info { background: var(--licht); color: var(--accent); }
.dot { display: inline-block; width: 9px; height: 9px; border-radius: 50%; margin-right: 6px; background: var(--muted); }
.dot.ok { background: var(--groen); } .dot.warn { background: var(--zon); } .dot.bad { background: var(--rood); }
dl.kv { display: grid; grid-template-columns: max-content 1fr; gap: 4px 16px; margin: 0; font-size: 14px; }
dl.kv dt { color: var(--muted); }
dl.kv dd { margin: 0; word-break: break-word; }
table { width: 100%; border-collapse: collapse; font-size: 14px; }
th { text-align: left; color: var(--muted); font-weight: 600; font-size: 12px; text-transform: uppercase; letter-spacing: 0.04em; }
th, td { padding: 8px 10px; border-bottom: 1px solid var(--border); vertical-align: middle; }
tr.clickable { cursor: pointer; }
tr.clickable:hover td { background: var(--surface-alt); }
.table-wrap { overflow-x: auto; background: var(--surface); border: 1px solid var(--border); border-radius: 14px; }
.steps { display: flex; gap: 6px; justify-content: center; flex-wrap: wrap; margin: 16px 0 8px; padding: 0; list-style: none; }
.steps li { font-size: 13px; color: var(--muted); padding: 4px 10px; border-radius: 999px; background: var(--surface-alt); }
.steps li.active { background: var(--accent); color: #fff; }
.steps li.done { background: var(--groen-bg); color: var(--groen); }
.module-fields[hidden] { display: none; }
.actions { display: flex; gap: 10px; }
.actions button { flex: 1; }
.muted { color: var(--muted); }
a { color: var(--accent); }
footer { text-align: center; color: var(--muted); font-size: 12px; margin: 28px 0 8px; }
[hidden] { display: none !important; }
