/* OfficeWarden portal: one stylesheet. */

/* Colours from the OfficeWarden design (teal). Light by default, dark when the system asks,
   and either one when the visitor picks it with the theme switch (html[data-theme]). */
:root {
  --radius: 14px;
  --bg: #F4F6FB;
  --surface: #FFFFFF;
  --surface-2: #EEF1F8;
  --line: #DFE4EF;
  --text: #141A2B;
  --muted: #5D6780;
  --accent: #3350D4;
  --accent-ink: #FFFFFF;
  --accent-soft: #E6EBFF;
  --side: #0D111C;
  --side-text: #A9B3CC;
  --side-active: #1D2438;
  --side-accent: #7F95FF;
  --good: #1A8F5C;
  --good-soft: #E0F5EA;
  --warn: #B7791F;
  --warn-soft: #FDF1D8;
  --bad: #C93A3A;
  --bad-soft: #FDE5E5;
  --shadow: 0 1px 2px rgba(18, 35, 32, .05), 0 12px 32px rgba(18, 35, 32, .08);
  color-scheme: light;
}
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
  --bg: #0D111C;
  --surface: #161C2C;
  --surface-2: #1D2438;
  --line: #29314A;
  --text: #E9ECF5;
  --muted: #96A0BA;
  --accent: #7F95FF;
  --accent-ink: #0D111C;
  --accent-soft: #1F2A52;
  --side: #0A0E18;
  --side-text: #96A0BA;
  --side-active: #1D2438;
  --side-accent: #7F95FF;
  --good: #4CC38A;
  --good-soft: #143326;
  --warn: #E0A84A;
  --warn-soft: #3A2C10;
  --bad: #F07575;
  --bad-soft: #3D1A1A;
  --shadow: none;
  color-scheme: dark;
  }
}
:root[data-theme="light"] {
  --bg: #F4F6FB;
  --surface: #FFFFFF;
  --surface-2: #EEF1F8;
  --line: #DFE4EF;
  --text: #141A2B;
  --muted: #5D6780;
  --accent: #3350D4;
  --accent-ink: #FFFFFF;
  --accent-soft: #E6EBFF;
  --side: #0D111C;
  --side-text: #A9B3CC;
  --side-active: #1D2438;
  --side-accent: #7F95FF;
  --good: #1A8F5C;
  --good-soft: #E0F5EA;
  --warn: #B7791F;
  --warn-soft: #FDF1D8;
  --bad: #C93A3A;
  --bad-soft: #FDE5E5;
  --shadow: 0 1px 2px rgba(18, 35, 32, .05), 0 12px 32px rgba(18, 35, 32, .08);
  color-scheme: light;
}
:root[data-theme="dark"] {
  --bg: #0D111C;
  --surface: #161C2C;
  --surface-2: #1D2438;
  --line: #29314A;
  --text: #E9ECF5;
  --muted: #96A0BA;
  --accent: #7F95FF;
  --accent-ink: #0D111C;
  --accent-soft: #1F2A52;
  --side: #0A0E18;
  --side-text: #96A0BA;
  --side-active: #1D2438;
  --side-accent: #7F95FF;
  --good: #4CC38A;
  --good-soft: #143326;
  --warn: #E0A84A;
  --warn-soft: #3A2C10;
  --bad: #F07575;
  --bad-soft: #3D1A1A;
  --shadow: none;
  color-scheme: dark;
}

* { box-sizing: border-box; }
html, body { margin: 0; }
body {
  background: var(--bg);
  color: var(--text);
  font: 15px/1.5 "Segoe UI", system-ui, -apple-system, Roboto, sans-serif;
}
a { color: var(--accent); text-decoration: none; }
a:hover { text-decoration: underline; }
h1, h2, h3 { margin: 0; line-height: 1.25; }
h1 { font-size: 1.55rem; }
h2 { font-size: 1.05rem; }
p { margin: 0; }
svg { width: 1.15em; height: 1.15em; flex: none; vertical-align: -0.18em; }
.muted { color: var(--muted); }
.small { font-size: .86rem; }
.inline { display: inline; }
.num { font-variant-numeric: tabular-nums; }

/* --- Shell ---------------------------------------------------------------- */
.shell { display: grid; grid-template-columns: 232px 1fr; min-height: 100vh; }
.side {
  background: var(--side); color: var(--side-text);
  padding: 20px 14px; display: flex; flex-direction: column; gap: 4px;
  position: sticky; top: 0; height: 100vh;
}
.brand { display: flex; align-items: center; gap: 10px; font-weight: 700; font-size: 1.12rem; color: #fff; padding: 4px 10px 18px; }
.brand:hover { text-decoration: none; }
.brand .logo { width: 28px; height: 28px; color: var(--side-accent); }
.side a.nav-link {
  display: flex; align-items: center; gap: 10px; padding: 9px 12px;
  border-radius: 10px; color: var(--side-text); font-weight: 500;
}
.side a.nav-link:hover { background: var(--side-active); text-decoration: none; }
.side a.nav-link.is-active { background: var(--side-active); color: #fff; box-shadow: inset 3px 0 0 var(--side-accent); }
.side-foot { margin-top: auto; padding: 12px 10px 0; border-top: 1px solid #29314A; font-size: .86rem; }
.side-foot .who { color: #fff; font-weight: 600; }
.side-foot button { background: none; border: 0; color: var(--side-text); padding: 6px 0; cursor: pointer; font: inherit; display: flex; gap: 8px; align-items: center; }
.side-foot button:hover { color: #fff; }
.main { padding: 28px 32px 60px; max-width: 1180px; width: 100%; }
.page-head { display: flex; align-items: flex-end; justify-content: space-between; gap: 16px; margin-bottom: 22px; flex-wrap: wrap; }
.page-head p { color: var(--muted); margin-top: 4px; }
.crumb { font-size: .86rem; color: var(--muted); margin-bottom: 6px; display: block; }

@media (max-width: 860px) {
  .shell { grid-template-columns: 1fr; }
  .side { position: static; height: auto; flex-direction: row; flex-wrap: wrap; align-items: center; padding: 10px; }
  .brand { padding: 4px 10px; }
  .side-foot { margin: 0 0 0 auto; border: 0; padding: 0; display: flex; gap: 12px; align-items: center; }
  .main { padding: 20px 16px 48px; }
}

/* --- Pieces --------------------------------------------------------------- */
.card { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); box-shadow: var(--shadow); padding: 20px; }
.card > h2 { margin-bottom: 14px; }
.grid { display: grid; gap: 16px; }
.grid-4 { grid-template-columns: repeat(4, 1fr); }
.grid-2 { grid-template-columns: 1.4fr 1fr; }
.grid-5 { grid-template-columns: repeat(6, 1fr); }
@media (max-width: 1000px) { .grid-4, .grid-5 { grid-template-columns: repeat(2, 1fr); } .grid-2 { grid-template-columns: 1fr; } }
.stack { display: grid; gap: 16px; }

.btn {
  display: inline-flex; align-items: center; gap: 8px; padding: 9px 16px; border-radius: 10px;
  border: 1px solid var(--line); background: var(--surface); color: var(--text);
  font: inherit; font-weight: 600; cursor: pointer;
}
.btn:hover { text-decoration: none; border-color: var(--accent); }
.btn-primary { background: var(--accent); border-color: var(--accent); color: var(--accent-ink); }
.btn-primary:hover { filter: brightness(1.08); }
.btn-danger { color: var(--bad); }
.btn-sm { padding: 6px 12px; font-size: .88rem; }
.btn-block { width: 100%; justify-content: center; }

.notice { padding: 11px 14px; border-radius: 10px; margin-bottom: 16px; border: 1px solid var(--line); background: var(--surface); }
.notice-success { background: var(--good-soft); border-color: transparent; color: var(--good); }
.notice-error { background: var(--bad-soft); border-color: transparent; color: var(--bad); }
.notice-trial { background: var(--accent-soft); border-color: transparent; }

.field { display: grid; gap: 6px; margin-bottom: 14px; }
.field > span { font-weight: 600; font-size: .9rem; }
input[type=text], input[type=email], input[type=password] {
  width: 100%; padding: 10px 12px; border-radius: 10px; border: 1px solid var(--line);
  background: var(--surface); color: var(--text); font: inherit;
}
input:focus-visible, .btn:focus-visible, a:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
.field-error { color: var(--bad); }
.row-form { display: flex; gap: 8px; }
.row-form input { flex: 1; }

/* --- Scores --------------------------------------------------------------- */
.pill { display: inline-flex; align-items: center; gap: 6px; padding: 2px 10px; border-radius: 999px; font-size: .82rem; font-weight: 600; background: var(--surface-2); color: var(--muted); white-space: nowrap; }
.pill.good { background: var(--good-soft); color: var(--good); }
.pill.warn { background: var(--warn-soft); color: var(--warn); }
.pill.bad { background: var(--bad-soft); color: var(--bad); }
.dot { width: 8px; height: 8px; border-radius: 50%; background: var(--muted); display: inline-block; }
.dot.on { background: var(--good); }

.stat .label { color: var(--muted); font-size: .86rem; font-weight: 600; }
.stat .value { font-size: 2rem; font-weight: 700; line-height: 1.15; margin-top: 6px; }
.stat .hint { color: var(--muted); font-size: .86rem; margin-top: 2px; }
.stat.lead { background: var(--accent); border-color: var(--accent); color: var(--accent-ink); }
.stat.lead .label, .stat.lead .hint { color: inherit; opacity: .85; }

.ring { --v: 0; --c: var(--muted); width: 132px; height: 132px; border-radius: 50%; display: grid; place-items: center; flex: none;
  background: conic-gradient(var(--c) calc(var(--v) * 1%), var(--surface-2) 0); }
.ring > div { width: 104px; height: 104px; border-radius: 50%; background: var(--surface); display: grid; place-items: center; text-align: center; }
.ring b { font-size: 2.1rem; line-height: 1; display: block; }
.ring small { color: var(--muted); font-size: .76rem; }
.ring.good { --c: var(--good); } .ring.warn { --c: var(--warn); } .ring.bad { --c: var(--bad); }
.hero { display: flex; gap: 24px; align-items: flex-start; flex-wrap: wrap; }
.hero h2 { font-size: 1.3rem; }

.part { padding: 14px 16px; }
.part .label { display: flex; gap: 8px; align-items: center; color: var(--muted); font-weight: 600; font-size: .86rem; }
.part .value { font-size: 1.5rem; font-weight: 700; margin-top: 4px; }
.part .bar { height: 6px; border-radius: 3px; background: var(--surface-2); margin-top: 8px; overflow: hidden; }
.part .bar i { display: block; height: 100%; border-radius: 3px; background: var(--muted); }
.part.good .bar i { background: var(--good); } .part.warn .bar i { background: var(--warn); } .part.bad .bar i { background: var(--bad); }

.findings { list-style: none; margin: 0; padding: 0; display: grid; gap: 10px; }
.findings li { display: grid; grid-template-columns: auto 1fr; gap: 12px; padding: 12px 14px; border-radius: 10px; background: var(--surface-2); }
.findings li.bad { background: var(--bad-soft); } .findings li.warn { background: var(--warn-soft); }
.findings li.bad svg { color: var(--bad); } .findings li.warn svg { color: var(--warn); } .findings li.info svg { color: var(--accent); }
.findings b { display: block; }
.findings span { color: var(--muted); font-size: .9rem; }
.findings li.bad span, .findings li.warn span { color: var(--text); opacity: .8; }

/* --- Tables --------------------------------------------------------------- */
.table { width: 100%; border-collapse: collapse; }
.table th { text-align: left; font-size: .8rem; text-transform: uppercase; letter-spacing: .04em; color: var(--muted); padding: 0 12px 10px; }
.table td { padding: 12px; border-top: 1px solid var(--line); vertical-align: middle; }
.table tr:hover td { background: var(--surface-2); }
.table a.name { font-weight: 600; color: var(--text); }
.table-wrap { overflow-x: auto; }
.kv { display: grid; grid-template-columns: 130px 1fr; gap: 8px 14px; margin: 0; }
.kv dt { color: var(--muted); }
.kv dd { margin: 0; }

/* --- Charts --------------------------------------------------------------- */
.bars { display: grid; grid-auto-flow: column; grid-auto-columns: 1fr; gap: 6px; align-items: end; height: 150px; }
.bars .col { display: grid; grid-template-rows: 1fr auto; height: 100%; gap: 6px; text-align: center; }
.bars .stack-bar { position: relative; align-self: stretch; background: var(--surface-2); border-radius: 6px; overflow: hidden; }
.bars .on, .bars .act { position: absolute; left: 0; right: 0; bottom: 0; }
.bars .on { background: var(--accent-soft); border-top: 2px solid var(--accent); }
.bars .act { background: var(--accent); }
.bars small { color: var(--muted); font-size: .72rem; }
.legend { display: flex; gap: 16px; font-size: .84rem; color: var(--muted); margin-top: 10px; }
.legend i { display: inline-block; width: 10px; height: 10px; border-radius: 2px; margin-right: 6px; }
.chart { width: 100%; height: 170px; display: block; }
.chart .grid-line { stroke: var(--line); stroke-width: 1; }
.chart .cpu { fill: none; stroke: var(--accent); stroke-width: 2; }
.chart .ram { fill: none; stroke: var(--warn); stroke-width: 2; }
.chart text { fill: var(--muted); font-size: 11px; }

/* --- Add a PC ------------------------------------------------------------- */
.code { font: 700 1.7rem/1 Consolas, "Cascadia Mono", monospace; letter-spacing: .06em; padding: 16px 20px; background: var(--surface-2); border-radius: 12px; display: inline-block; user-select: all; }
.steps { margin: 0; padding-left: 20px; display: grid; gap: 10px; }
pre.cmd { background: var(--side); color: #E9ECF5; padding: 12px 14px; border-radius: 10px; overflow-x: auto; margin: 8px 0 0; font: .88rem/1.5 Consolas, monospace; user-select: all; }
.empty { text-align: center; padding: 36px 20px; color: var(--muted); }

/* --- Signed-out pages ----------------------------------------------------- */
.auth-body { display: grid; place-items: center; min-height: 100vh; padding: 24px; }
.auth-card { width: min(420px, 100%); background: var(--surface); border: 1px solid var(--line); border-radius: 18px; box-shadow: var(--shadow); padding: 30px; }
.auth-card .brand { color: var(--text); padding: 0 0 18px; }
.auth-card .brand .logo { color: var(--accent); }
.auth-card h1 { margin-bottom: 6px; }
.auth-lede { color: var(--muted); margin-bottom: 20px; }
.auth-alt { text-align: center; margin-top: 16px; color: var(--muted); font-size: .9rem; }
.error-code { font-size: 3rem; font-weight: 800; color: var(--accent); line-height: 1; margin-bottom: 8px; }

.landing { width: min(760px, 100%); text-align: center; }
.landing .brand { justify-content: center; color: var(--text); font-size: 1.3rem; }
.landing .brand .logo { color: var(--accent); width: 34px; height: 34px; }
.landing h1 { font-size: clamp(1.9rem, 5vw, 2.8rem); margin: 8px 0 14px; }
.landing .lede { font-size: 1.12rem; color: var(--muted); max-width: 580px; margin: 0 auto 26px; }
.landing .cta { display: flex; gap: 12px; justify-content: center; flex-wrap: wrap; }
.landing .points { display: grid; grid-template-columns: repeat(3, 1fr); gap: 14px; margin-top: 40px; text-align: left; }
.landing .points .card svg { color: var(--accent); width: 1.5em; height: 1.5em; margin-bottom: 8px; }
@media (max-width: 700px) { .landing .points { grid-template-columns: 1fr; } }

details summary { cursor: pointer; color: var(--accent); font-weight: 600; }

/* Theme switch (light / dark), as on the public site. */
.theme-toggle { width: 34px; height: 34px; display: inline-grid; place-items: center; border: 1px solid var(--line); background: var(--surface); color: var(--text); border-radius: 8px; cursor: pointer; }
.theme-toggle:hover { background: var(--surface-2); }
.side .theme-toggle { background: transparent; border-color: #29314A; color: var(--side-text); }
.side .theme-toggle:hover { color: #fff; background: var(--side-active); }
.auth-tools { position: fixed; top: 16px; right: 16px; }

/* --- Portal sidebar, after the design's dashboard mock -------------------- */
.side { gap: 2px; overflow-y: auto; }
.side-office { color: var(--side-text); font-size: .82rem; line-height: 1.35; padding: 0 12px 14px; margin-top: -10px; }
.side a.nav-link { padding: 8px 12px; font-size: .93rem; }
.nav-count { margin-left: auto; background: #3A2C10; color: #E0A84A; border-radius: 999px; padding: 0 8px; font-size: .74rem; font-weight: 700; line-height: 1.6; }
.nav-add { color: var(--side-accent) !important; }
.side-more { margin-top: 14px; padding-top: 12px; border-top: 1px solid #1E2640; display: flex; flex-direction: column; gap: 2px; }
.side-more a.nav-link { font-size: .88rem; padding: 7px 12px; }
.side-foot { display: flex; flex-direction: column; gap: 10px; }
.trial-pill { background: #1F2A52; color: #7F95FF !important; border-radius: 8px; padding: 8px 10px; font-size: .82rem; font-weight: 600; text-decoration: none !important; }
.trial-pill.ended { background: #3A2C10; color: #E0A84A !important; }
.side-user { display: flex; align-items: center; gap: 8px; }
.side-user .who { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; color: #fff; font-weight: 600; }
.avatar { width: 30px; height: 30px; border-radius: 50%; background: #1D2438; color: #7F95FF; display: grid; place-items: center; font-size: .75rem; font-weight: 700; flex: none; }
.side-foot .signout { padding: 0; }
@media (max-width: 860px) {
  .side-office, .side-more, .side-user .who { display: none; }
  .side nav { display: flex; flex-wrap: wrap; gap: 2px; }
}

/* --- Portal page pieces -------------------------------------------------- */
.section-title { display: flex; align-items: center; gap: 10px; margin: 26px 0 12px; font-size: 1rem; }
.section-title .pill { font-size: .78rem; }
.toolbar { display: flex; gap: 10px; align-items: center; flex-wrap: wrap; margin-bottom: 16px; }
.toolbar input[type=search] { flex: 1; min-width: 200px; padding: 10px 12px; border-radius: 10px; border: 1px solid var(--line); background: var(--surface); color: var(--text); font: inherit; }
.soon { background: var(--surface-2); border-radius: 12px; padding: 16px; color: var(--muted); }
.soon b { color: var(--text); }
.big-number { font-size: 2.2rem; font-weight: 700; letter-spacing: -.02em; line-height: 1.1; }
.form-grid { display: grid; gap: 4px; max-width: 460px; }
.month-list { display: grid; gap: 10px; }
.month-list a.row { display: flex; justify-content: space-between; align-items: center; padding: 14px 16px; border: 1px solid var(--line); border-radius: 12px; color: var(--text); background: var(--surface); }
.month-list a.row:hover { border-color: var(--accent); text-decoration: none; }

/* --- Printable office report -------------------------------------------- */
.print-body { background: #fff; }
.report { max-width: 900px; margin: 0 auto; padding: 40px 32px; color: #141A2B; }
.report h1 { font-size: 1.7rem; margin: 6px 0 4px; }
.report h2 { font-size: 1rem; text-transform: uppercase; letter-spacing: .05em; color: #5D6780; margin: 28px 0 10px; border-bottom: 1px solid #DFE4EF; padding-bottom: 6px; }
.report-head { display: flex; justify-content: space-between; gap: 20px; align-items: flex-start; }
.report-brand { display: flex; align-items: center; gap: 8px; color: #3350D4; font-weight: 700; }
.report-brand .logo { width: 22px; height: 22px; }
.report-kpis { display: grid; grid-template-columns: repeat(5, 1fr); gap: 12px; margin-top: 22px; }
.report-kpis > div { border: 1px solid #DFE4EF; border-radius: 12px; padding: 12px 14px; }
.report-line { padding: 7px 0; border-bottom: 1px solid #EEF1F8; font-size: .93rem; }
.report-tools { display: flex; justify-content: flex-end; margin-bottom: 16px; }
@media print { .report-tools { display: none; } .report { padding: 0; } @page { size: A4; margin: 14mm; } }
@media (max-width: 700px) { .report-kpis { grid-template-columns: repeat(2, 1fr); } }

/* --- Admin panel: same building blocks, amber so it is never mistaken for a customer's view --- */
.admin-body { --side-accent: #E0A84A; }
.admin-badge { background: #3A2C10; color: #E0A84A; font-size: .7rem; font-weight: 700; letter-spacing: .04em; text-transform: uppercase; padding: 2px 8px; border-radius: 999px; margin-left: 4px; }
.admin-body .side .avatar { background: #3A2C10; color: #E0A84A; }
.admin-strip { background: var(--warn-soft); color: var(--warn); font-size: .82rem; font-weight: 600; padding: 6px 12px; border-radius: 8px; margin-bottom: 16px; display: inline-block; }
.toolbar a.pill { text-decoration: none; }
.side { overflow-x: hidden; }
.side .brand { flex-wrap: wrap; row-gap: 4px; }
.admin-body .side .brand { font-size: 1.02rem; }
