/* Zentech Partner Portal (mockup). Look and feel taken from www.zentechcanada.com:
   Inter / system font, near-black sections, Zentech red, pill buttons, tight bold headlines.
   Julian: colours live in the :root block below. */
:root {
  --dark: #121416;
  --dark-2: #1b1e22;
  --ink: #11151c;
  --muted: rgba(17, 21, 28, 0.64);
  --line: #e4e7eb;
  --paper: #f5f6f8;
  --white: #ffffff;
  --red: #e2231a;
  --red-soft: #ff5a4f;
  --red-tint: #fdecea;
  --good: #2e9e5b;
  --warn: #f2b134;
  --crit: #e2231a;
  --critp: #7a1018;
  --bar-muted: #d5d9df;
  --radius: 18px;
  --font: Inter, system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
}

* { box-sizing: border-box; }
html, body { margin: 0; }
body { font-family: var(--font); color: var(--ink); background: var(--paper); font-size: 15px; line-height: 1.6; letter-spacing: 0.2px; }
a { color: inherit; }
button, select, input { font-family: inherit; font-size: 14px; }
.wrap { max-width: 1200px; margin: 0 auto; padding: 0 24px; }
.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }

/* Sample banner */
.sample-banner { background: #fff4d6; color: #5b4300; font-size: 13px; font-weight: 600; text-align: center; padding: 8px 16px; border-bottom: 1px solid #f1dfa6; }

/* Header */
.topbar { background: var(--dark); color: var(--white); }
.topbar .wrap { display: flex; align-items: center; justify-content: space-between; min-height: 72px; gap: 16px; }
.logo { display: flex; align-items: center; gap: 10px; text-decoration: none; color: var(--white); }
.logo-mark { width: 34px; height: 34px; border-radius: 8px; background: var(--red); display: grid; place-items: center; font-weight: 800; font-size: 20px; letter-spacing: -1px; }
.logo-text { font-weight: 700; font-size: 17px; line-height: 1.05; letter-spacing: -0.3px; }
.logo-sep { width: 1px; height: 28px; background: rgba(255, 255, 255, 0.2); margin: 0 6px; }
.logo-portal { font-size: 13px; color: rgba(255, 255, 255, 0.7); font-weight: 500; }
.top-actions { display: flex; align-items: center; gap: 12px; }
.who { font-size: 13px; color: rgba(255, 255, 255, 0.75); }
.who strong { color: var(--white); }

/* Buttons */
.btn { display: inline-flex; align-items: center; gap: 8px; border-radius: 999px; padding: 11px 22px; font-weight: 600; border: 0; cursor: pointer; text-decoration: none; font-size: 15px; }
.btn-red { background: var(--red); color: var(--white); }
.btn-red:hover { background: #c81d15; }
.btn-ghost { background: transparent; color: var(--white); border: 1.5px solid rgba(255, 255, 255, 0.45); }
.btn-ghost:hover { border-color: var(--white); }
.btn-small { padding: 7px 16px; font-size: 13px; }
.btn-light { background: var(--white); color: var(--ink); border: 1.5px solid var(--line); }
.btn-light:hover { border-color: var(--ink); }

/* Hero */
.hero { background: var(--dark); color: var(--white); padding: 44px 0 56px; }
.eyebrow { color: var(--red-soft); text-transform: uppercase; font-size: 13px; font-weight: 600; letter-spacing: 1.6px; margin: 0 0 12px; }
.hero h1 { font-size: 44px; line-height: 1.04; letter-spacing: -1.5px; margin: 0 0 14px; font-weight: 700; max-width: 760px; }
.hero p.lead { color: rgba(255, 255, 255, 0.72); font-size: 17px; max-width: 720px; margin: 0 0 18px; }
.live { display: inline-flex; align-items: center; gap: 8px; font-size: 13px; color: rgba(255, 255, 255, 0.8); background: rgba(255, 255, 255, 0.06); border: 1px solid rgba(255, 255, 255, 0.12); padding: 6px 12px; border-radius: 999px; }
.live-dot { width: 8px; height: 8px; border-radius: 50%; background: #3ddc84; }

/* KPI cards overlap the hero */
.kpis { display: grid; grid-template-columns: repeat(5, 1fr); gap: 14px; margin-top: -34px; position: relative; }
.kpi { background: var(--white); border-radius: var(--radius); padding: 18px 20px; box-shadow: 0 8px 28px rgba(17, 21, 28, 0.08); border: 1px solid var(--line); min-width: 0; }
.kpi .k-label { font-size: 12.5px; color: var(--muted); font-weight: 600; letter-spacing: 0.3px; }
.kpi .k-value { font-size: 28px; font-weight: 700; letter-spacing: -0.8px; margin-top: 4px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.kpi .k-note { font-size: 12px; color: var(--muted); margin-top: 2px; }
.kpi.accent { border-top: 4px solid var(--red); }

/* Filter bar */
.filters { position: sticky; top: 0; z-index: 5; background: rgba(245, 246, 248, 0.94); backdrop-filter: blur(6px); border-bottom: 1px solid var(--line); margin-top: 22px; }
.filters .wrap { display: flex; flex-wrap: wrap; gap: 10px 14px; align-items: center; padding-top: 12px; padding-bottom: 12px; }
.chips { display: flex; gap: 6px; flex-wrap: wrap; }
.chip { border-radius: 999px; border: 1.5px solid var(--line); background: var(--white); padding: 7px 14px; cursor: pointer; font-weight: 600; font-size: 13px; color: var(--ink); }
.chip[aria-pressed="true"] { background: var(--ink); color: var(--white); border-color: var(--ink); }
.field { display: flex; align-items: center; gap: 8px; font-size: 13px; color: var(--muted); }
.field select, .field input { border: 1.5px solid var(--line); border-radius: 999px; padding: 7px 14px; background: var(--white); color: var(--ink); min-width: 170px; }
.field input { min-width: 200px; }
.filters .spacer { flex: 1; }

/* Sections and cards */
main { padding: 26px 0 60px; }
.section-title { font-size: 26px; letter-spacing: -0.8px; margin: 34px 0 6px; font-weight: 700; }
main .wrap > .section-title:first-child { margin-top: 4px; }
.section-sub { color: var(--muted); margin: 0 0 16px; font-size: 14px; }
.grid-2 { display: grid; grid-template-columns: 1.35fr 1fr; gap: 18px; }
.card { background: var(--white); border-radius: var(--radius); border: 1px solid var(--line); padding: 22px 22px 18px; min-width: 0; }
.card + .card { margin-top: 16px; }
.more { margin-top: 14px; }
.age-chips { margin-bottom: 14px; }
.card h3 { margin: 0 0 2px; font-size: 17px; letter-spacing: -0.3px; }
.card .card-sub { color: var(--muted); font-size: 13px; margin: 0 0 14px; }
.card-head { display: flex; justify-content: space-between; align-items: flex-start; gap: 12px; }

/* Charts */
.chart svg { width: 100%; height: auto; display: block; }
.chart text { font-family: var(--font); }
.hbar-row { display: grid; grid-template-columns: minmax(140px, 46%) 1fr 64px; align-items: center; gap: 10px; padding: 6px 0; font-size: 13px; }
.hbar-label { min-width: 0; }
.hbar-label .main { display: block; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-weight: 600; }
.hbar-label small { color: var(--muted); display: block; font-size: 11.5px; line-height: 1.35; }
.hbar-track { background: var(--paper); border-radius: 999px; height: 12px; overflow: hidden; }
.hbar-fill { height: 100%; border-radius: 999px; background: var(--red); }
.hbar-value { text-align: right; font-weight: 600; font-variant-numeric: tabular-nums; }
.stack { display: flex; height: 22px; border-radius: 999px; overflow: hidden; background: var(--paper); margin: 6px 0 12px; }
.stack div { height: 100%; }
.legend { display: flex; flex-wrap: wrap; gap: 8px 18px; font-size: 13px; }
.legend span { display: inline-flex; align-items: center; gap: 7px; }
.swatch { width: 11px; height: 11px; border-radius: 3px; display: inline-block; }

/* Tables */
.table-wrap { overflow-x: auto; border-radius: 12px; border: 1px solid var(--line); }
table { border-collapse: collapse; width: 100%; font-size: 13.5px; }
th, td { padding: 9px 12px; text-align: left; border-bottom: 1px solid var(--line); white-space: nowrap; }
th { background: var(--paper); font-size: 12px; text-transform: uppercase; letter-spacing: 0.6px; color: var(--muted); font-weight: 700; position: sticky; top: 0; }
td.num, th.num { text-align: right; font-variant-numeric: tabular-nums; }
td.name { white-space: normal; min-width: 220px; }
tr:last-child td { border-bottom: 0; }
tbody tr:hover { background: #fafbfc; }
tfoot td { font-weight: 700; background: var(--paper); }
.matrix td:first-child, .matrix th:first-child { position: sticky; left: 0; background: var(--white); z-index: 1; }
.matrix thead th:first-child { background: var(--paper); }
.share { display: inline-block; width: 70px; height: 6px; background: var(--paper); border-radius: 99px; vertical-align: middle; margin-right: 8px; overflow: hidden; }
.share i { display: block; height: 100%; background: var(--red); border-radius: 99px; }
.pill { display: inline-block; padding: 2px 10px; border-radius: 999px; font-size: 12px; font-weight: 600; color: var(--white); }
.zero { color: #b5bbc4; }
.empty { color: var(--muted); padding: 18px 0; font-size: 14px; }

/* Locations */
.locs { display: grid; grid-template-columns: repeat(4, 1fr); gap: 12px; margin-bottom: 16px; }
.loc { background: var(--paper); border-radius: 14px; padding: 12px 14px; }
.loc .l-name { font-size: 12.5px; color: var(--muted); font-weight: 600; }
.loc .l-value { font-size: 22px; font-weight: 700; letter-spacing: -0.5px; }

/* Definitions */
details { background: var(--white); border: 1px solid var(--line); border-radius: 14px; padding: 12px 18px; margin-bottom: 10px; }
summary { cursor: pointer; font-weight: 600; }
details p { color: var(--muted); margin: 8px 0 2px; font-size: 14px; }

/* Footer */
footer { background: var(--dark); color: rgba(255, 255, 255, 0.7); padding: 30px 0; font-size: 13px; }
footer .wrap { display: flex; justify-content: space-between; gap: 20px; flex-wrap: wrap; }
footer strong { color: var(--white); }

/* Sign-in page */
.signin { min-height: calc(100vh - 36px); background: var(--dark); color: var(--white); display: flex; flex-direction: column; }
.signin main { flex: 1; display: grid; grid-template-columns: 1.1fr 0.9fr; gap: 40px; align-items: center; padding: 40px 24px; }
.signin h1 { font-size: 48px; line-height: 1.03; letter-spacing: -1.6px; margin: 0 0 16px; }
.signin p.lead { color: rgba(255, 255, 255, 0.72); font-size: 17px; max-width: 520px; }
.signin-card { background: var(--white); color: var(--ink); border-radius: 22px; padding: 28px; }
.signin-card h2 { margin: 0 0 6px; font-size: 22px; letter-spacing: -0.5px; }
.signin-card .muted { color: var(--muted); font-size: 14px; margin: 0 0 16px; }
.fake-input { border: 1.5px solid var(--line); border-radius: 999px; padding: 11px 16px; color: #9aa1ab; background: var(--paper); margin-bottom: 10px; font-size: 14px; }
.demo-note { font-size: 12.5px; color: var(--muted); border-top: 1px solid var(--line); margin-top: 18px; padding-top: 14px; }
.brand-buttons { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; margin-top: 10px; }
.brand-buttons a { justify-content: center; }

/* Checks page */
.check-list { list-style: none; padding: 0; margin: 0; }
.check-list li { display: grid; grid-template-columns: 74px 1fr; gap: 12px; padding: 10px 0; border-bottom: 1px solid var(--line); font-size: 14px; }
.check-list .res { font-weight: 700; }
.check-list .pass { color: var(--good); }
.check-list .fail { color: var(--red); }
.check-list .detail { color: var(--muted); font-size: 12.5px; display: block; }
.summary-box { font-size: 20px; font-weight: 700; padding: 16px 20px; border-radius: 14px; margin: 10px 0 20px; }
.summary-box.ok { background: #e7f6ec; color: #17633a; }
.summary-box.bad { background: var(--red-tint); color: #9b150f; }

/* Phones and tablets */
@media (max-width: 1180px) {
  .kpis { grid-template-columns: repeat(3, 1fr); }
}
@media (max-width: 1000px) {
  .kpis { grid-template-columns: repeat(2, 1fr); }
  .kpis .kpi:last-child { grid-column: span 2; }
  .grid-2 { grid-template-columns: 1fr; }
  .locs { grid-template-columns: repeat(2, 1fr); }
  .signin main { grid-template-columns: 1fr; }
}
@media (max-width: 560px) {
  .wrap { padding: 0 16px; }
  .hero h1, .signin h1 { font-size: 32px; letter-spacing: -1px; }
  .kpi .k-value { font-size: 23px; }
  .logo-portal, .logo-sep, .who { display: none; }
  .field select, .field input { min-width: 0; width: 100%; }
  .field { width: 100%; }
  .hbar-row { grid-template-columns: 42% 1fr 60px; }
}

/* Live site: admin bar (Zentech only) and problem message */
.adminbar { background: #fff4d6; border-bottom: 1px solid #f1dfa6; font-size: 13px; }
.adminbar .wrap { display: flex; flex-wrap: wrap; align-items: center; gap: 6px 10px; padding-top: 8px; padding-bottom: 8px; }
.adminbar a { color: #5b4300; font-weight: 600; text-decoration: none; padding: 2px 10px; border-radius: 999px; border: 1px solid #e6cf86; }
.adminbar a.on { background: #5b4300; color: #fff; border-color: #5b4300; }
.adminbar details { margin: 0; padding: 2px 10px; border-radius: 10px; background: #fff; border-color: #e6cf86; }
.adminbar ul { margin: 6px 0 4px; padding-left: 18px; }
.adminbar .ok { color: #17633a; }
.problem { margin-top: 30px; }
.problem p { color: var(--muted); }
