body {
  font-family: system-ui, sans-serif;
  max-width: 1100px;
  margin: 2rem auto;
  padding: 0 1rem;
  line-height: 1.5;
  color: #1f2328;
}

body.wide { max-width: 1600px; }

h1 { margin-bottom: 0.25rem; }
h2 { margin-top: 2rem; }

.meta {
  color: #57606a;
  font-size: 0.9rem;
}

.date-form {
  margin: 1rem 0 1.5rem;
  display: flex;
  gap: 0.5rem;
  align-items: center;
}

.empty { color: #57606a; font-style: italic; }

.topbar { text-align: right; font-size: 0.9rem; margin-bottom: 0.5rem; }

.login-form {
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
  max-width: 320px;
  margin-top: 1rem;
}
.login-form label { display: flex; flex-direction: column; gap: 0.25rem; font-size: 0.9rem; }
.login-form input {
  padding: 0.45rem 0.5rem;
  border: 1px solid #d0d7de;
  border-radius: 4px;
  font-size: 1rem;
}
.login-form button {
  padding: 0.5rem;
  border: 0;
  border-radius: 4px;
  background: #1f6feb;
  color: #fff;
  font-size: 1rem;
  cursor: pointer;
}
.login-error { color: #cf222e; font-size: 0.9rem; }

/* Targets form */
.saved-note {
  background: #dafbe1;
  border: 1px solid #2da44e;
  color: #0a5132;
  padding: 0.4rem 0.7rem;
  border-radius: 4px;
  display: inline-block;
  font-size: 0.9rem;
}
table.targets input[type="number"],
table.targets input[type="text"] {
  width: 9rem;
  padding: 0.25rem 0.4rem;
  border: 1px solid #d0d7de;
  border-radius: 4px;
  text-align: right;
  font-variant-numeric: tabular-nums;
}
table.targets .new-row input[type="text"] { text-align: left; width: 12rem; }

/* Velocity table */
table.velocity th.grp { text-align: center; background: #eaeef2; }
td.vel-ok   { background: #d2f5dd; color: #0a5132; font-weight: 600; }
td.vel-warn { background: #fff3cd; color: #7a5b00; font-weight: 600; }
td.vel-bad  { background: #ffd6d6; color: #8a1f1f; font-weight: 600; }
td.vel-na   { color: #afb8c1; }
span.vel-ok, span.vel-warn, span.vel-bad { padding: 0 0.25rem; border-radius: 3px; }
span.vel-ok { background: #d2f5dd; }
span.vel-warn { background: #fff3cd; }
span.vel-bad { background: #ffd6d6; }
table.velocity tr.no-target td,
table.velocity tr.no-target th { color: #8c959f; }

table {
  border-collapse: collapse;
  margin: 0.75rem 0 1.5rem;
  font-variant-numeric: tabular-nums;
  font-size: 0.92rem;
}

table th, table td {
  border: 1px solid #d0d7de;
  padding: 0.35rem 0.6rem;
  text-align: left;
}

table thead th {
  background: #f6f8fa;
  font-weight: 600;
}

td.num, th.num { text-align: right; }
td.empty { color: #afb8c1; text-align: center; }

table.pivot th.agent {
  text-align: left;
  background: #f6f8fa;
  white-space: nowrap;
}

td.total-col, th.total-col {
  background: #f6f8fa;
  font-weight: 600;
}

/* Cells where total > unique (duplicate calls in that hour) */
td.dup { background: #fff8c5; }
.uniq { color: #57606a; font-weight: normal; }

/* FLC split-callouts below the pivot */
.low-flc-note { margin: 0.5rem 0; }
.flag {
  display: inline-block;
  margin: 0 0.25rem 0.25rem 0;
  padding: 0.1rem 0.5rem;
  border-radius: 4px;
  font-size: 0.8rem;
  font-weight: 600;
  color: #fff;
}
.flag-low { background: #d1242f; }   /* FLC < 3 — red */
.flag-ok  { background: #1a7f37; }   /* FLC ≥ 3 — green */

/* Data-health coverage highlights */
.ok  { color: #1a7f37; }
.bad { color: #d1242f; }
tr.row-missing > * { background: #ffebe9; }   /* missing expected day/month — red tint */
tr.row-thin    > * { background: #fff8c5; }   /* partial scrape — amber tint */

.stale-banner {
  margin: 0.5rem 0;
  padding: 0.5rem 0.75rem;
  border-left: 4px solid #d1242f;
  background: #fff5f5;
}
.scrape-btn {
  display: inline-block;
  margin-left: 0.25rem;
  padding: 0.1rem 0.5rem;
  border-radius: 4px;
  background: #0969da;
  color: #fff;
  font-size: 0.8rem;
  font-weight: 600;
  text-decoration: none;
}
.scrape-btn:hover { background: #0a5cc0; }
.scrape-link { text-decoration: none; color: #57606a; }
.scrape-link:hover { color: #0969da; }

table.flat td:first-child, table.flat td:nth-child(2) {
  white-space: nowrap;
}

/* MTD compare layout — 3 tables side-by-side, wrap on narrow viewports */
.compare-grid {
  display: flex;
  flex-wrap: wrap;
  gap: 1.25rem;
  align-items: flex-start;
}
.compare-panel {
  flex: 1 1 320px;
  min-width: 0;
}
.compare-panel h2 {
  margin: 0 0 0.25rem;
  font-size: 1.1rem;
}
.compare-panel table { width: 100%; }

/* Monthly view */
tr.zero-day td { color: #afb8c1; }
tr.day-row td, tr.day-row th { background: #f6f8fa; font-weight: 600; }
tr.agent-row td { font-size: 0.85rem; }
td.agent-indent { padding-left: 1.5rem; color: #57606a; }
.agent-count { font-weight: normal; color: #8b949e; font-size: 0.8rem; }
tr.cust-row td { font-size: 0.8rem; color: #57606a; }
td.cust-indent { padding-left: 3rem; }
td.plan-cell { font-size: 0.75rem; max-width: 200px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
