/* PLR app styles. Colours from the PLR logo: navy #202938, green #2FA43B.
   No inline styles anywhere: the Content Security Policy blocks them. */
:root {
  --navy: #202938;
  --navy-2: #2e3a4f;
  --navy-3: #3a4659;
  --green: #2fa43b;
  --green-text: #1d7a2b;
  --green-bg: #eaf6ec;
  --ground: #f4f6f9;
  --surface: #ffffff;
  --ink: #14181f;
  --ink-2: #3d4552;
  --muted: #5a6372;
  --line: #e3e7ee;
  --line-2: #c5ccd6;
  --amber-bg: #fff1dc;
  --amber: #8a3d00;
  --red-bg: #fdecec;
  --red: #a32121;
  --blue-bg: #e8eef8;
  --blue: #22406e;
  --radius: 12px;
}
* { box-sizing: border-box; }
html, body { margin: 0; }
body {
  font-family: Inter, -apple-system, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
  color: var(--ink);
  background: var(--ground);
  font-size: 15px;
  line-height: 1.45;
}
a { color: var(--green-text); }
a:hover { color: #145a1f; }
h1, h2, h3 { color: var(--navy); margin: 0; }
h1 { font-size: 30px; font-weight: 700; }
h2 { font-size: 19px; font-weight: 700; }
h3 { font-size: 16px; font-weight: 700; }
p { margin: 0; }
.muted { color: var(--muted); }
.small { font-size: 13px; }
.mono { font-family: ui-monospace, Menlo, Consolas, monospace; }
.stack { display: flex; flex-direction: column; gap: 16px; }
.stack-sm { display: flex; flex-direction: column; gap: 6px; }
.row { display: flex; flex-wrap: wrap; gap: 12px; align-items: center; }
.between { justify-content: space-between; }
.end { justify-content: flex-end; }
.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); }

/* Layout */
.shell { min-height: 100vh; display: flex; flex-wrap: wrap; }
.sidebar {
  flex: 1 1 240px; max-width: 260px; background: var(--navy);
  display: flex; flex-direction: column; gap: 2px; padding-bottom: 20px;
}
.sidebar .logo { display: block; width: 100%; height: auto; margin: 8px 0 16px; }
.sidebar nav a {
  display: flex; align-items: center; gap: 14px; padding: 12px 20px;
  color: #d5dbe5; text-decoration: none; font-weight: 500; border-left: 4px solid transparent;
}
.sidebar nav a:hover { background: #2a3446; color: #fff; }
.sidebar nav a.on { background: var(--navy-2); color: #fff; border-left-color: var(--green); }
.sidebar nav { display: flex; flex-direction: column; gap: 2px; }
.sidebar svg { width: 20px; height: 20px; flex-shrink: 0; }
.side-help {
  margin: auto 16px 0; padding: 16px; border: 1px solid var(--navy-3); border-radius: var(--radius);
  background: #263045; color: #b9c2d0; font-size: 13px; display: flex; flex-direction: column; gap: 8px;
}
.side-help strong { color: #fff; font-size: 14px; }
.main { flex: 999 1 560px; min-width: 0; padding: 20px 32px 48px; display: flex; flex-direction: column; gap: 24px; }
.topbar { display: flex; justify-content: flex-end; align-items: center; gap: 20px; flex-wrap: wrap; }
.avatar {
  width: 44px; height: 44px; border-radius: 999px; background: var(--navy); color: #fff;
  display: flex; align-items: center; justify-content: center; font-weight: 600;
}
.who { display: flex; align-items: center; gap: 12px; }
.who span { display: block; }
.who .name { font-weight: 600; }
.eyebrow { font-size: 13px; font-weight: 600; color: var(--muted); letter-spacing: 0.06em; text-transform: uppercase; }

/* Cards */
.card {
  background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius);
  padding: 22px; box-shadow: 0 1px 2px rgba(32, 41, 56, 0.04);
}
.kpis { display: grid; grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); gap: 16px; }
.kpi { display: flex; gap: 16px; align-items: flex-start; }
.kpi .ico {
  width: 52px; height: 52px; border-radius: 12px; background: var(--green-bg);
  display: flex; align-items: center; justify-content: center; flex-shrink: 0; color: var(--navy);
}
.kpi .ico svg { width: 26px; height: 26px; }
.kpi .label { font-size: 14px; color: var(--ink-2); }
.kpi .value { font-size: 30px; font-weight: 700; color: var(--navy); }
.kpi .value.green { color: var(--green-text); }
.cols { display: flex; flex-wrap: wrap; gap: 20px; align-items: flex-start; }
.col-wide { flex: 3 1 560px; min-width: 0; }
.col-narrow { flex: 2 1 320px; min-width: 0; }

/* Source cards and how-it-works */
.sources { display: flex; flex-wrap: wrap; gap: 14px; }
.src {
  flex: 1 1 170px; min-width: 0; border: 1px solid var(--line); border-radius: var(--radius);
  padding: 20px 16px; display: flex; flex-direction: column; align-items: center; gap: 8px; text-align: center;
}
.src .mark {
  width: 56px; height: 56px; border-radius: 999px; background: #edf0f4; color: var(--ink-2);
  display: flex; align-items: center; justify-content: center; font-weight: 700; font-size: 20px;
}
.src .mark.on { background: var(--navy); color: #fff; }
.src .mark.up { background: var(--green-bg); color: var(--green-text); }
.src .mark svg { width: 26px; height: 26px; }
.src .name { font-weight: 700; }
.src .desc { font-size: 13px; color: var(--muted); }
.src .sbtn { margin-top: auto; width: 100%; }
.how { background: #f1f7f2; border: 1px solid #d6ebda; border-radius: var(--radius); padding: 20px 22px; }
.how ol { list-style: none; margin: 16px 0 0; padding: 0; display: flex; flex-wrap: wrap; gap: 20px; }
.how li { flex: 1 1 200px; display: flex; gap: 12px; align-items: flex-start; }
.how .num {
  width: 36px; height: 36px; border-radius: 999px; background: var(--navy); color: #fff;
  display: flex; align-items: center; justify-content: center; font-weight: 600; flex-shrink: 0;
}
.how li:last-child .num { background: var(--green); }
.how strong { display: block; }
.how span.t { font-size: 14px; color: var(--ink-2); }

/* Buttons and forms */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  min-height: 44px; padding: 0 18px; border-radius: 10px; border: 0; cursor: pointer;
  font: inherit; font-weight: 600; font-size: 14px; text-decoration: none;
  background: var(--navy); color: #fff;
}
.btn:hover { background: #2c374b; color: #fff; }
.btn.big { min-height: 52px; padding: 0 24px; font-size: 15px; }
.btn.light { background: var(--green-bg); color: #1d6b28; }
.btn.light:hover { background: #d9efdd; color: #1d6b28; }
.btn.ghost { background: #fff; color: var(--ink); border: 1px solid var(--line-2); }
.btn.ghost:hover { background: #f5f7fa; color: var(--ink); }
.btn.danger { background: #fff; color: var(--red); border: 1px solid #e7b9b9; }
.btn.disabled, .btn:disabled { background: #f2f4f7; color: var(--muted); cursor: not-allowed; }
.btn.block { width: 100%; }
.btn svg { width: 18px; height: 18px; }
.link-btn { background: none; border: 0; padding: 0; color: #d5dbe5; font: inherit; cursor: pointer; text-decoration: underline; }
form.inline { display: inline; }
label { font-size: 14px; font-weight: 500; }
input[type=text], input[type=email], input[type=password], input[type=date], select, textarea {
  width: 100%; min-height: 44px; border: 1px solid var(--line-2); border-radius: 8px;
  padding: 0 12px; font: inherit; font-size: 15px; background: #fff; color: var(--ink);
}
textarea { padding: 10px 12px; }
input:focus, select:focus, textarea:focus, .btn:focus-visible, a:focus-visible {
  outline: 3px solid rgba(47, 164, 59, 0.45); outline-offset: 1px;
}
.code-input { font-size: 24px !important; letter-spacing: 0.3em; text-align: center; font-weight: 600; }
.field { display: flex; flex-direction: column; gap: 6px; }
.field .help { font-size: 13px; color: var(--muted); }
.field .err, .errorlist { color: var(--red); font-size: 13px; margin: 0; padding: 0; list-style: none; }
.form-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(260px, 1fr)); gap: 16px; }
.checks { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 8px; }
.checks label { font-weight: 400; display: flex; gap: 8px; align-items: center; }
.filters { display: flex; flex-wrap: wrap; gap: 12px; align-items: flex-end; }
.filters .field { flex: 1 1 200px; }

/* Alerts */
.alert { border-radius: 10px; padding: 12px 14px; font-size: 14px; }
.alert.info { background: var(--blue-bg); color: var(--blue); }
.alert.success { background: var(--green-bg); color: #1d6b28; }
.alert.warning { background: var(--amber-bg); color: var(--amber); }
.alert.error { background: var(--red-bg); color: var(--red); }

/* Tables */
.table-wrap { overflow-x: auto; }
table { width: 100%; border-collapse: collapse; font-size: 14px; }
th { text-align: left; font-weight: 500; color: var(--muted); background: #f5f7fa; padding: 12px 14px; white-space: nowrap; }
td { padding: 14px; border-bottom: 1px solid #eef1f5; vertical-align: middle; }
td.num, th.num { text-align: right; font-variant-numeric: tabular-nums; }
tr:last-child td { border-bottom: 0; }
.pill { display: inline-block; padding: 4px 10px; border-radius: 6px; font-size: 12px; font-weight: 600; border: 1px solid transparent; white-space: nowrap; }
.pill.blue { background: var(--blue-bg); color: var(--blue); border-color: #c7d4ea; }
.pill.amber { background: var(--amber-bg); color: var(--amber); border-color: #f3d3a6; }
.pill.green { background: var(--green-bg); color: #1d6b28; border-color: #bfe3c5; }
.pill.grey { background: #edf0f4; color: var(--ink-2); border-color: #d7dce3; }
.pill.red { background: var(--red-bg); color: var(--red); border-color: #efc4c4; }
.empty { padding: 28px; text-align: center; color: var(--muted); }

/* Activity */
.activity { list-style: none; margin: 0; padding: 0; }
.activity li { display: flex; gap: 12px; padding: 10px 0; border-bottom: 1px solid #eef1f5; }
.activity li:last-child { border-bottom: 0; }
.activity .tick {
  width: 34px; height: 34px; border-radius: 999px; background: var(--green-bg); color: var(--green-text);
  display: flex; align-items: center; justify-content: center; flex-shrink: 0;
}
.activity .tick svg { width: 18px; height: 18px; }
.activity .what { flex: 1 1 auto; font-size: 14px; font-weight: 600; }
.activity .what span { display: block; font-weight: 400; color: var(--muted); font-size: 13px; }
.activity time { font-size: 13px; color: var(--muted); white-space: nowrap; }

/* Steps */
.steps { list-style: none; margin: 0; padding: 14px 16px; display: flex; flex-wrap: wrap; gap: 10px 22px; }
.steps li { display: flex; align-items: center; gap: 8px; font-size: 13px; font-weight: 500; color: var(--muted); }
.steps .dot {
  width: 26px; height: 26px; border-radius: 999px; border: 1px solid var(--line-2); background: #fff;
  display: flex; align-items: center; justify-content: center; font-size: 12px; font-weight: 700;
}
.steps li.done .dot { background: var(--green); border-color: var(--green); color: #fff; }
.steps li.current { color: var(--ink); font-weight: 600; }
.steps li.current .dot { background: var(--navy); border-color: var(--navy); color: #fff; }

/* Sign-in pages */
.auth { min-height: 100vh; display: flex; align-items: center; justify-content: center; padding: 40px 16px; }
.auth-box { width: 100%; max-width: 440px; display: flex; flex-direction: column; gap: 20px; }
.auth-box.wide { max-width: 560px; }
.auth-logo { width: 100%; height: auto; border-radius: var(--radius); display: block; }
.auth .card { padding: 32px; }
.qr { width: 180px; height: 180px; border: 1px solid var(--line); border-radius: 8px; background: #fff; }
.codes { display: grid; grid-template-columns: repeat(2, 1fr); gap: 8px; list-style: none; padding: 0; margin: 0; }
.codes li { font-family: ui-monospace, Menlo, Consolas, monospace; font-size: 17px; padding: 8px 12px; background: #f5f7fa; border-radius: 8px; text-align: center; }
.note { font-size: 13px; color: var(--muted); text-align: center; }
.copy-box { word-break: break-all; background: #f5f7fa; border: 1px dashed var(--line-2); border-radius: 8px; padding: 12px; font-size: 14px; }

@media (max-width: 720px) {
  .sidebar { max-width: none; flex-basis: 100%; }
  .main { padding: 16px; }
  h1 { font-size: 26px; }
}
