:root {
  --green: #133c39;
  --green2: #1b4c48;
  --ink: #202d2b;
  --muted: #74817e;
  --line: #e4ebe8;
  --bg: #f5f8f6;
  font-family: Inter, Arial, sans-serif;
  color: var(--ink);
  background: var(--bg);
  font-synthesis: none;
  font-size: 14px;
}
* { box-sizing: border-box; }
body { margin: 0; }
button, input, select { font: inherit; }
button, a, input, select { -webkit-tap-highlight-color: transparent; }
button, a { touch-action: manipulation; }
button { cursor: pointer; border: 0; }
a { color: inherit; text-decoration: none; }
button:disabled { opacity: .55; cursor: wait; }
button:focus-visible, a:focus-visible, summary:focus-visible { outline: 3px solid #84b7a5; outline-offset: 3px; }
input:focus, select:focus { outline: 2px solid #84b7a5; outline-offset: 1px; }
[hidden] { display: none !important; }
h1, h2, p { margin: 0; }
h1 { font-size: 28px; line-height: 1.2; letter-spacing: -.6px; font-weight: 600; }
h2 { font-size: 16px; font-weight: 600; }
.muted { color: var(--muted); }
.loading { padding: 40px; color: var(--muted); }
.company-name { font-size: 18px; font-weight: 600; color: var(--green); }
.login { min-height: 100vh; display: grid; place-items: center; padding: 24px; }
.login-card { max-width: 420px; width: 100%; background: #fff; border: 1px solid var(--line); border-radius: 10px; padding: 38px; }
.login-card .company-name { margin-bottom: 24px; }
.login-card h1 { font-size: 27px; margin-bottom: 12px; }
.login-card > .muted { font-size: 14px; line-height: 1.6; margin-bottom: 26px; }
.login-card label { display: block; margin: 20px 0 8px; }
.login-card input { width: 100%; border: 1px solid #d6dfda; border-radius: 6px; height: 44px; padding: 10px 12px; background: #fff; color: var(--ink); }
.password-wrap { position: relative; }
.password-wrap input { padding-right: 88px; }
.password-wrap button { position: absolute; right: 5px; top: 5px; height: 34px; background: none; color: var(--muted); font-size: 12px; padding: 0 8px; }
.login-card .primary { width: 100%; margin-top: 26px; height: 45px; }
.error { color: #a54335; margin-top: 16px; line-height: 1.5; }
.app { min-height: 100vh; }
.topbar { background: #fff; border-bottom: 1px solid var(--line); }
.header-inner { max-width: 1280px; margin: 0 auto; min-height: 76px; padding: 18px 40px; display: flex; justify-content: space-between; align-items: center; gap: 20px; }
.site-name { font-size: 12px; color: var(--muted); }
.top-actions { display: flex; gap: 25px; align-items: center; }
.page { max-width: 1280px; margin: 0 auto; padding: 36px 40px 26px; }
.page-heading { display: flex; justify-content: space-between; align-items: center; gap: 20px; margin-bottom: 28px; }
.page-actions { display: flex; flex-wrap: wrap; gap: 8px; }
.primary { background: var(--green); color: #fff; padding: 11px 20px; border-radius: 6px; }
.primary:hover { background: var(--green2); }
.secondary { background: #fff; color: var(--green); padding: 11px 14px; border: 1px solid #d7e2dc; border-radius: 6px; font-size: 12px; white-space: nowrap; }
.secondary:hover { background: #edf4ef; }
.filters { display: flex; gap: 10px; align-items: center; margin-bottom: 17px; flex-wrap: wrap; }
.filters select, .date-range { height: 39px; background: #fff; border: 1px solid #dbe4de; border-radius: 6px; }
.filters select { padding: 0 28px 0 12px; font-size: 12px; color: var(--ink); }
.date-range { display: flex; align-items: center; padding: 0 10px; gap: 8px; }
.date-range input { border: 0; background: none; font-size: 12px; color: var(--ink); width: 119px; padding: 6px 0; }
.date-range span { color: #a6b2ad; }
.compact { height: 39px; font-size: 12px; padding: 0 15px; }
.timezone { margin-left: auto; font-size: 10px; color: var(--muted); }
.coverage { font-size: 11px; color: var(--muted); margin: 0 0 23px; line-height: 1.6; }
.metrics { display: grid; grid-template-columns: repeat(5, minmax(0, 1fr)); gap: 14px; margin-bottom: 23px; }
.metric { background: #fff; border: 1px solid var(--line); border-radius: 8px; padding: 20px 20px 17px; min-height: 130px; }
.metric-label { font-size: 11px; color: #71817a; display: flex; justify-content: space-between; gap: 5px; align-items: center; }
.metric-label .help { font-size: 11px; border: 1px solid #dbe4de; border-radius: 50%; height: 14px; width: 14px; text-align: center; line-height: 12px; color: #a1aea7; cursor: help; }
.metric-value { font-size: 31px; letter-spacing: -1.1px; font-weight: 500; margin-top: 15px; line-height: 1.1; }
.metric:first-child { background: var(--green); color: #fff; border-color: var(--green); }
.metric:first-child .metric-label { color: #bfd0c8; }
.metric:first-child .help { border-color: #ffffff40; color: #c0d1c6; }
.metric:first-child .metric-delta { color: #bfd0c8; }
.metric-delta { font-size: 10px; color: var(--muted); margin-top: 12px; min-height: 12px; }
.metric-delta.positive { color: #408464; }
.metric-delta.negative { color: #aa6b50; }
.metric:first-child .metric-delta.positive { color: #c1d9b9; }
.metric:first-child .metric-delta.negative { color: #f4c3a9; }
.card { background: #fff; border: 1px solid var(--line); border-radius: 8px; margin-bottom: 22px; min-width: 0; overflow: hidden; }
.card-heading { padding: 23px 24px 15px; display: flex; align-items: center; justify-content: space-between; gap: 15px; }
.chart-total { font-size: 18px; font-weight: 500; color: var(--green); }
.charts { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: 22px; }
.chart { padding: 0 14px 14px; min-height: 200px; }
.chart svg { width: 100%; height: auto; display: block; }
.chart text { font-family: Arial, sans-serif; font-size: 10px; fill: #8a9791; }
.chart .gridline { stroke: #edf1ee; stroke-dasharray: 3 4; }
.chart .plot-line { stroke: var(--green2); stroke-width: 2.4; fill: none; stroke-linecap: round; stroke-linejoin: round; }
.chart .plot-point { fill: var(--green2); stroke: #fff; stroke-width: 1.5; }
.chart .lead-bar { fill: #8ba98c; }
.chart .plot-point:hover { r: 5; fill: #92b890; }
.table-scroll { overflow-x: auto; }
.data-table { border-collapse: collapse; width: 100%; font-size: 12px; }
.data-table th { background: #f8faf8; padding: 13px 24px; text-align: right; font-size: 10px; color: #78877f; font-weight: 500; white-space: nowrap; border-bottom: 1px solid var(--line); }
.data-table td { padding: 13px 24px; text-align: right; border-bottom: 1px solid #eff3f0; white-space: nowrap; font-variant-numeric: tabular-nums; }
.data-table th:first-child, .data-table td:first-child { text-align: left; }
.data-table tbody tr:hover { background: #fafcfb; }
.data-table tfoot { font-weight: 600; background: #f4f8f5; }
.data-table tfoot td { border-bottom: 0; }
.text-button { font-size: 11px; background: none; color: var(--muted); padding: 4px; }
.text-button:hover { color: var(--green); }
.notice { background: #edf3ea; border: 1px solid #dce7d7; border-radius: 6px; color: #516b50; padding: 14px 18px; font-size: 12px; line-height: 1.7; margin-bottom: 23px; }
.page-error { border: 1px solid #ecd5cd; background: #fff4f0; color: #954b36; padding: 15px 18px; border-radius: 6px; font-size: 13px; margin-bottom: 20px; }
.sr-only { position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip: rect(0, 0, 0, 0); white-space: nowrap; border: 0; }
footer { border-top: 1px solid var(--line); padding-top: 19px; display: flex; gap: 18px; align-items: flex-start; flex-wrap: wrap; font-size: 10px; color: var(--muted); margin-top: 7px; }
footer details { flex: 1; min-width: 180px; }
footer summary { cursor: pointer; padding: 4px 0; }
footer details p { line-height: 1.75; margin-top: 12px; max-width: 760px; }
footer > .muted { padding-top: 4px; white-space: nowrap; }
#toast { position: fixed; bottom: 24px; left: 50%; transform: translateX(-50%); background: var(--green); color: #fff; padding: 14px 22px; border-radius: 8px; z-index: 10; font-size: 12px; max-width: calc(100vw - 30px); box-shadow: 0 3px 20px #0002; }
@media (max-width: 1000px) {
  .page, .header-inner { padding-left: 25px; padding-right: 25px; }
  .metrics { gap: 10px; }
  .metric { padding: 17px 14px; }
  .metric-value { font-size: 28px; }
  .card-heading { padding-left: 20px; padding-right: 20px; }
  .data-table td, .data-table th { padding: 12px 18px; }
  .charts { gap: 16px; }
}
@media (max-width: 800px) {
  .metrics { grid-template-columns: repeat(3, minmax(0, 1fr)); }
  .charts { grid-template-columns: 1fr; gap: 0; }
  .metric { min-height: 118px; }
  .page { padding-top: 28px; }
  .page-heading { align-items: flex-start; flex-direction: column; gap: 16px; }
  .chart { min-height: unset; }
  .chart svg { max-height: 260px; }
  .timezone { display: none; }
}
@media (max-width: 500px) {
  .header-inner { display: grid; grid-template-columns: 1fr auto; padding: 17px 16px; gap: 8px 12px; }
  .company-name { font-size: 17px; }
  .top-actions { display: contents; }
  .site-name { grid-column: 1; grid-row: 2; font-size: 11px; }
  #logout { grid-column: 2; grid-row: 1; justify-self: end; }
  .page { padding: 25px 16px; }
  h1 { font-size: 24px; }
  .page-heading { margin-bottom: 22px; }
  .page-actions { gap: 7px; }
  .secondary { font-size: 11px; padding: 10px 11px; }
  .metrics { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; }
  .metric { padding: 17px; min-height: 120px; }
  .metric:last-child { grid-column: 1 / -1; display: grid; grid-template-columns: 1fr 1fr; min-height: 80px; align-items: center; }
  .metric:last-child .metric-value { margin: 0; text-align: right; grid-column: 2; grid-row: 1 / 3; }
  .metric:last-child .metric-delta { margin-top: 8px; }
  .metric-value { font-size: 30px; }
  .filters { gap: 8px; margin-bottom: 13px; }
  .filters select { width: calc(100% - 95px); order: 0; height: 37px; }
  .filters .compact { width: 87px; order: 1; height: 37px; }
  .date-range { width: 100%; order: 2; justify-content: space-between; margin-top: 1px; }
  .date-range input { width: 44%; text-align: center; font-size: 12px; }
  .coverage { font-size: 10px; margin-bottom: 18px; }
  .card-heading { padding: 19px 18px 14px; }
  h2 { font-size: 14px; }
  .card { margin-bottom: 16px; }
  .chart { padding: 0 6px 9px; }
  .data-table th, .data-table td { padding: 12px 16px; }
  .data-table { font-size: 11px; }
  .text-button { font-size: 10px; }
  .notice { font-size: 11px; padding: 12px 14px; }
  .login-card { padding: 28px; }
  footer { gap: 12px; font-size: 9px; }
  footer > .muted { display: block; width: 100%; }
}
@media (prefers-reduced-motion: reduce) {
  * { scroll-behavior: auto !important; }
}
