/* Fettle Hosting client portal. Same look as the public demo (website/demo.html); fonts served from here. */
@font-face { font-family: "Plus Jakarta Sans"; src: url("fonts/plus-jakarta-sans-latin.52d04440a9fa.woff2") format("woff2"); font-weight: 400 800; font-display: swap; }
@font-face { font-family: "Bricolage Grotesque"; src: url("fonts/bricolage-grotesque-latin.c47ac31e5437.woff2") format("woff2"); font-weight: 600 800; font-display: swap; }

:root {
  --navy: #0B1D2E;
  --text: #22313F;
  --text-soft: #5B6B7A;
  --line: #DFE6EC;
  --bg: #FFFFFF;
  --bg-soft: #F4F7F9;
  --brand: #0C8A5F;
  --brand-dark: #08704C;
  --brand-tint: #E5F4EE;
  --amber: #F2A93B;
  --amber-dark: #9A5B05;
  --amber-tint: #FDF2E0;
  --bad: #C2412D;
  --bad-tint: #FBEAE6;
  --font: "Plus Jakarta Sans", system-ui, -apple-system, "Segoe UI", Roboto, Arial, sans-serif;
  --display: "Bricolage Grotesque", var(--font);
  --radius: 12px;
}
* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body { margin: 0; background: var(--bg-soft); color: var(--text); font-family: var(--font); font-size: 0.95rem; line-height: 1.55; -webkit-font-smoothing: antialiased; }
h1, h2, h3 { font-family: var(--display); letter-spacing: -0.02em; color: var(--navy); margin: 0; }
p { margin: 0; }
a { color: var(--brand-dark); }
button { font-family: inherit; }
.icon { width: 18px; height: 18px; fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; flex: none; }
.sr { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }

/* Layout */
.shell { display: grid; grid-template-columns: 240px minmax(0, 1fr); min-height: 100vh; }
.side { background: #fff; border-right: 1px solid var(--line); padding: 20px 14px; display: flex; flex-direction: column; gap: 22px; }
.logo { display: inline-flex; align-items: center; gap: 10px; color: var(--navy); font-weight: 800; font-size: 1.15rem; letter-spacing: -0.02em; padding: 0 8px; text-decoration: none; }
.logo svg { width: 28px; height: 28px; }
.logo b { color: var(--brand); font-weight: 800; }
.account { padding: 10px 12px; border: 1px solid var(--line); border-radius: 10px; font-size: 0.8rem; color: var(--text-soft); display: grid; gap: 6px; }
.account b { display: block; color: var(--navy); font-size: 0.9rem; }
.account form { display: flex; gap: 6px; }
.account select { font-size: 0.8rem; padding: 5px 8px; flex: 1; min-width: 0; }
nav.tabs { display: grid; gap: 2px; }
nav.tabs a { display: flex; align-items: center; gap: 10px; padding: 9px 12px; border-radius: 8px; color: var(--text); text-decoration: none; font-weight: 600; font-size: 0.9rem; }
nav.tabs a:hover { background: var(--bg-soft); }
nav.tabs a[aria-current="page"] { background: var(--brand-tint); color: var(--brand-dark); }
.side-foot { margin-top: auto; font-size: 0.78rem; color: var(--text-soft); padding: 0 8px; display: grid; gap: 10px; }
.side-foot form { margin: 0; }
.linkish { background: none; border: 0; padding: 0; color: var(--brand-dark); font: inherit; font-weight: 700; cursor: pointer; text-decoration: underline; }

main { padding: 28px clamp(16px, 3vw, 40px) 60px; min-width: 0; }
.view { max-width: 980px; }
.view-head { display: flex; flex-wrap: wrap; align-items: end; justify-content: space-between; gap: 8px 20px; margin-bottom: 20px; }
.view-head h1 { font-size: clamp(1.5rem, 2.6vw, 1.9rem); }
.view-head p { color: var(--text-soft); }

.card { background: #fff; border: 1px solid var(--line); border-radius: var(--radius); padding: 18px 20px; }
.card h2 { font-size: 1.05rem; margin-bottom: 12px; }
.grid { display: grid; gap: 16px; }
.g3 { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.g2 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.stack { display: grid; gap: 16px; grid-template-columns: minmax(0, 1fr); }

.pill { display: inline-flex; align-items: center; gap: 6px; font-size: 0.75rem; font-weight: 700; padding: 3px 10px; border-radius: 999px; white-space: nowrap; }
.pill.ok { background: var(--brand-tint); color: var(--brand-dark); }
.pill.warn { background: var(--amber-tint); color: var(--amber-dark); }
.pill.mute { background: var(--bg-soft); color: var(--text-soft); }
.pill.bad { background: var(--bad-tint); color: var(--bad); }
.dot { width: 8px; height: 8px; border-radius: 50%; background: currentColor; }

.stat { display: grid; gap: 2px; align-content: start; }
.stat small { color: var(--text-soft); font-weight: 600; font-size: 0.78rem; }
.stat b { font-family: var(--display); font-size: 1.6rem; color: var(--navy); font-variant-numeric: tabular-nums; line-height: 1.2; }
.stat span { font-size: 0.8rem; color: var(--text-soft); }

/* Who did it */
.who { display: inline-flex; align-items: center; vertical-align: middle; gap: 6px; font-size: 0.78rem; font-weight: 700; color: var(--navy); white-space: nowrap; }
.av { width: 22px; height: 22px; border-radius: 50%; display: inline-grid; place-items: center; font-size: 0.7rem; font-weight: 800; color: #fff; flex: none; }
.av.harry { background: var(--brand); }
.av.assistant { background: var(--amber); color: var(--navy); }
.av.monitoring { background: var(--navy); }

table { width: 100%; border-collapse: collapse; font-size: 0.88rem; }
th { text-align: left; font-size: 0.75rem; color: var(--text-soft); font-weight: 700; padding: 0 10px 8px 0; border-bottom: 1px solid var(--line); }
td { padding: 11px 10px 11px 0; border-bottom: 1px solid var(--line); vertical-align: middle; }
tr:last-child td { border-bottom: 0; }
td.num { font-variant-numeric: tabular-nums; }
.tablewrap { overflow-x: auto; }

.bar { height: 8px; background: var(--bg-soft); border-radius: 999px; overflow: hidden; margin-top: 6px; }
.bar i { display: block; height: 100%; background: var(--brand); border-radius: 999px; }
.bar i.hi { background: var(--amber); }
.meter { display: grid; gap: 2px; font-size: 0.85rem; }
.meter div { display: flex; justify-content: space-between; }
.meter b { font-variant-numeric: tabular-nums; color: var(--navy); }
.note { font-size: 0.8rem; color: var(--text-soft); }
.empty { color: var(--text-soft); font-size: 0.9rem; }

.layers { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 12px; }
.layer { border: 1px solid var(--line); border-radius: 10px; padding: 12px 14px; display: grid; gap: 4px; font-size: 0.85rem; align-content: start; }
.layer b { color: var(--navy); }
.layer span { color: var(--text-soft); font-size: 0.8rem; }

.btn { display: inline-flex; align-items: center; justify-content: center; gap: 8px; padding: 9px 16px; border-radius: 8px; font-weight: 700; font-size: 0.875rem; border: 2px solid transparent; cursor: pointer; text-decoration: none; }
.btn-primary { background: var(--brand); color: #fff; }
.btn-primary:hover { background: var(--brand-dark); }
.btn-outline { background: #fff; color: var(--navy); border-color: var(--line); }
.btn-outline:hover { border-color: var(--navy); }
label { font-weight: 700; font-size: 0.82rem; color: var(--navy); display: grid; gap: 4px; }
select, input[type="text"], input[type="email"], input[type="number"] { font: inherit; font-size: 0.9rem; padding: 9px 11px; border: 1px solid var(--line); border-radius: 8px; background: #fff; color: var(--text); width: 100%; }
select:focus, input:focus, button:focus-visible, a:focus-visible { outline: 2px solid var(--brand); outline-offset: 1px; }

/* Reports */
.report-list { display: grid; gap: 0; }
.report-list a { display: flex; justify-content: space-between; align-items: center; gap: 12px; padding: 12px 0; border-bottom: 1px solid var(--line); text-decoration: none; color: var(--navy); font-weight: 700; }
.report-list a:last-child { border-bottom: 0; }
.report-frame { width: 100%; height: 75vh; min-height: 520px; border: 1px solid var(--line); border-radius: var(--radius); background: #fff; display: block; }

/* History */
.log { display: grid; }
.log-row { display: grid; grid-template-columns: 120px 130px minmax(0, 1fr); gap: 10px 14px; padding: 12px 0; border-bottom: 1px solid var(--line); font-size: 0.88rem; align-items: start; }
.log-row:last-child { border-bottom: 0; }
.log-row time { color: var(--text-soft); font-variant-numeric: tabular-nums; font-size: 0.82rem; }
.log-row .on { color: var(--text-soft); font-size: 0.8rem; }
.filters { display: flex; flex-wrap: wrap; gap: 6px; margin-bottom: 8px; }
.filters a { border: 1px solid var(--line); background: #fff; border-radius: 999px; padding: 5px 12px; font-size: 0.8rem; font-weight: 700; color: var(--text-soft); text-decoration: none; }
.filters a[aria-current="true"] { background: var(--navy); border-color: var(--navy); color: #fff; }
.pager { display: flex; gap: 12px; align-items: center; margin-top: 14px; font-size: 0.85rem; }

/* Sign-in pages */
.entrance { min-height: 100vh; display: grid; place-items: center; padding: 24px 16px; }
.entrance .box { width: 100%; max-width: 420px; background: #fff; border: 1px solid var(--line); border-radius: 16px; padding: 28px; display: grid; gap: 16px; }
.entrance h1 { font-size: 1.5rem; }
.entrance form { display: grid; gap: 12px; }
.entrance button[type="submit"], .entrance .btn { width: 100%; }
.entrance .or { display: flex; align-items: center; gap: 10px; color: var(--text-soft); font-size: 0.8rem; }
.entrance .or::before, .entrance .or::after { content: ""; flex: 1; border-top: 1px solid var(--line); }
.entrance ul.errorlist { margin: 0; padding: 0; list-style: none; color: var(--bad); font-size: 0.85rem; }
.messages { margin: 0 0 16px; padding: 0; list-style: none; display: grid; gap: 6px; }
.messages li { background: var(--brand-tint); color: var(--brand-dark); border-radius: 10px; padding: 10px 14px; font-size: 0.88rem; font-weight: 600; }
.manage { max-width: 640px; display: grid; gap: 16px; }
.manage form { display: grid; gap: 12px; }
.manage button { justify-self: start; }

@media (max-width: 860px) {
  .shell { grid-template-columns: minmax(0, 1fr); }
  .side { border-right: 0; border-bottom: 1px solid var(--line); padding: 12px 16px; gap: 10px; flex-direction: row; flex-wrap: wrap; align-items: center; justify-content: space-between; }
  .account { order: 2; width: 100%; }
  .side-foot { order: 4; width: 100%; margin-top: 0; }
  nav.tabs { order: 3; display: flex; gap: 4px; overflow-x: auto; width: 100%; padding-bottom: 2px; scrollbar-width: none; }
  nav.tabs a { white-space: nowrap; padding: 7px 11px; font-size: 0.85rem; }
  main { padding: 20px 16px 48px; }
  .g3, .g2, .layers { grid-template-columns: minmax(0, 1fr); }
  .log-row { grid-template-columns: minmax(0, 1fr); gap: 4px; }
}

/* Activity in a half-width card: time and who on one line, what happened underneath */
.g2 .log-row { grid-template-columns: auto minmax(0, 1fr); gap: 4px 12px; }
.g2 .log-row > span:last-child { grid-column: 1 / -1; }
.manage ul { list-style: none; padding: 0; margin: 8px 0 0; display: flex; flex-wrap: wrap; gap: 8px; }
.manage h2 { font-size: 1.1rem; margin-top: 8px; }
