/* YRB PCR App v1 — neutral, clean. No framework. */

:root {
  --bg: #f6f7f9;
  --surface: #ffffff;
  --surface-2: #fafbfc;
  --border: #dfe3e8;
  --border-strong: #c6ccd4;
  --text: #1c2330;
  --text-dim: #5a6472;
  --text-faint: #8a94a3;
  --accent: #1f5fa9;
  --accent-dark: #17497f;
  --accent-soft: #eaf1fa;
  --warn: #b4690e;
  --warn-soft: #fdf4e6;
  --danger: #b3261e;
  --danger-soft: #fdeceb;
  --ok: #1d6f42;
  --ok-soft: #e9f5ee;
  --radius: 8px;
  --radius-sm: 5px;
  --shadow: 0 1px 2px rgba(16,24,40,.06), 0 1px 3px rgba(16,24,40,.08);
  --shadow-lg: 0 10px 32px rgba(16,24,40,.16);
  --font: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
}

* { box-sizing: border-box; }
html, body { height: 100%; }
body {
  margin: 0; background: var(--bg); color: var(--text);
  font-family: var(--font); font-size: 14px; line-height: 1.5;
  -webkit-font-smoothing: antialiased;
}
button, input, select, textarea { font: inherit; color: inherit; }
[hidden] { display: none !important; }

/* ------------------------------------------------------------- buttons -- */
.btn {
  display: inline-flex; align-items: center; gap: 7px; justify-content: center;
  padding: 8px 14px; border-radius: var(--radius-sm); border: 1px solid var(--border-strong);
  background: var(--surface); cursor: pointer; font-weight: 500; white-space: nowrap;
  transition: background .12s, border-color .12s;
}
.btn:hover:not(:disabled) { background: var(--surface-2); border-color: var(--text-faint); }
.btn:disabled { opacity: .5; cursor: not-allowed; }
.btn-primary { background: var(--accent); border-color: var(--accent); color: #fff; }
.btn-primary:hover:not(:disabled) { background: var(--accent-dark); border-color: var(--accent-dark); }
.btn-ok { background: var(--ok); border-color: var(--ok); color: #fff; }
.btn-ok:hover:not(:disabled) { filter: brightness(.93); }
.btn-danger { background: var(--surface); border-color: #e3b5b2; color: var(--danger); }
.btn-danger:hover:not(:disabled) { background: var(--danger-soft); border-color: var(--danger); }
.btn-ghost { border-color: transparent; background: transparent; }
.btn-ghost:hover:not(:disabled) { background: rgba(0,0,0,.05); }
.btn-sm { padding: 5px 10px; font-size: 13px; }

/* --------------------------------------------------------------- login -- */
#login {
  min-height: 100vh; display: grid; place-items: center; padding: 24px;
}
.login-card {
  width: 100%; max-width: 420px; background: var(--surface); border: 1px solid var(--border);
  border-radius: var(--radius); box-shadow: var(--shadow); padding: 32px;
}
.login-card h1 { margin: 0 0 4px; font-size: 20px; letter-spacing: -.01em; }
.login-card .sub { color: var(--text-dim); margin: 0 0 24px; font-size: 13px; }
.role-list { display: grid; gap: 10px; }
.role-btn {
  display: flex; align-items: center; justify-content: space-between; gap: 12px;
  width: 100%; text-align: left; padding: 14px 16px; border: 1px solid var(--border-strong);
  border-radius: var(--radius-sm); background: var(--surface); cursor: pointer;
  transition: border-color .12s, background .12s;
}
.role-btn:hover:not(:disabled) { border-color: var(--accent); background: var(--accent-soft); }
.role-btn:disabled { opacity: .55; cursor: not-allowed; }
.role-btn strong { display: block; font-size: 15px; }
.role-btn span { color: var(--text-dim); font-size: 12.5px; }
/* Public Map (BETA) entry on the sign-in card */
.public-divider { display: flex; align-items: center; gap: 10px; margin: 18px 0 10px; color: var(--text-faint); font-size: 12px; }
.public-divider::before, .public-divider::after { content: ""; flex: 1; border-top: 1px solid var(--border); }
.public-btn {
  display: flex; align-items: center; text-align: left; padding: 14px 16px; border-radius: var(--radius);
  border: 1px dashed var(--border-strong); background: var(--surface-2); color: inherit; text-decoration: none;
  transition: border-color .12s, background .12s;
}
.public-btn:hover { border-color: var(--accent); background: var(--accent-soft); }
.public-btn strong { display: block; font-size: 15px; }
.public-btn span { color: var(--text-dim); font-size: 12.5px; }
.public-btn strong .beta-tag, .beta-tag {
  display: inline-block; margin-left: 6px; padding: 0 6px; border-radius: 4px; vertical-align: 2px;
  background: var(--warn-soft); color: var(--warn); border: 1px solid #ecc994; font-size: 10.5px; font-weight: 700;
}
.pill {
  font-size: 11px; font-weight: 600; letter-spacing: .03em; text-transform: uppercase;
  padding: 3px 8px; border-radius: 99px; background: var(--surface-2);
  border: 1px solid var(--border); color: var(--text-faint);
}
.pin-row { display: flex; gap: 8px; margin-top: 18px; }
.pin-row input {
  flex: 1; padding: 10px 12px; border: 1px solid var(--border-strong);
  border-radius: var(--radius-sm); letter-spacing: .25em; font-size: 16px;
}
.pin-row input:focus { outline: 2px solid var(--accent); outline-offset: -1px; border-color: var(--accent); }

/* -------------------------------------------------------------- shell --- */
.topbar {
  background: var(--surface); border-bottom: 1px solid var(--border);
  padding: 0 20px; display: flex; align-items: center; gap: 16px; height: 56px;
  position: sticky; top: 0; z-index: 20;
}
.brand { display: flex; align-items: baseline; gap: 9px; font-weight: 650; letter-spacing: -.01em; }
.brand .mark { color: var(--accent); }
.brand .ver { font-size: 11px; color: var(--text-faint); font-weight: 400; }
.topbar .spacer { flex: 1; }
.who { color: var(--text-dim); font-size: 13px; }

.tabs {
  background: var(--surface); border-bottom: 1px solid var(--border);
  padding: 0 20px; display: flex; gap: 2px; position: sticky; top: 56px; z-index: 19;
  overflow-x: auto;
}
.tab {
  appearance: none; border: 0; background: none; cursor: pointer; padding: 12px 14px;
  color: var(--text-dim); font-weight: 500; border-bottom: 2px solid transparent;
  display: flex; align-items: center; gap: 7px; white-space: nowrap;
}
.tab:hover { color: var(--text); }
.tab[aria-selected="true"] { color: var(--accent); border-bottom-color: var(--accent); }
.badge {
  min-width: 20px; padding: 1px 6px; border-radius: 99px; font-size: 11.5px; font-weight: 650;
  background: var(--warn-soft); color: var(--warn); border: 1px solid #f0dcbb;
}
.badge.zero { background: var(--surface-2); color: var(--text-faint); border-color: var(--border); }

main { padding: 22px 20px 56px; max-width: 1500px; margin: 0 auto; }
.panel-title { margin: 0 0 14px; font-size: 16px; font-weight: 650; }

/* --------------------------------------------------------------- cards -- */
.tiles { display: grid; grid-template-columns: repeat(auto-fit, minmax(210px, 1fr)); gap: 14px; }
.tile {
  background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius);
  padding: 16px 18px; box-shadow: var(--shadow); text-align: left; cursor: pointer;
  transition: border-color .12s, transform .08s;
}
.tile:hover { border-color: var(--accent); }
.tile:active { transform: translateY(1px); }
.tile.static { cursor: default; }
.tile.static:hover { border-color: var(--border); }
.tile .label { color: var(--text-dim); font-size: 12.5px; font-weight: 500; }
.tile .value { font-size: 30px; font-weight: 680; letter-spacing: -.02em; margin-top: 4px; }
.tile .value.sm { font-size: 17px; font-weight: 600; line-height: 1.35; }
.tile .note { color: var(--text-faint); font-size: 12px; margin-top: 3px; }
.tile.alert { border-color: #f0dcbb; background: var(--warn-soft); }
.tile.alert .value { color: var(--warn); }


.card {
  background: var(--surface); border: 1px solid var(--border);
  border-radius: var(--radius); box-shadow: var(--shadow);
}
.card-pad { padding: 18px; }
.section-head { display: flex; align-items: center; gap: 12px; margin: 26px 0 12px; }
.section-head h3 { margin: 0; font-size: 14px; font-weight: 650; }
.section-head .spacer { flex: 1; }

/* -------------------------------------------------------------- filters - */
.filters { display: flex; flex-wrap: wrap; gap: 9px; margin-bottom: 14px; align-items: center; }
.filters input[type="search"], .filters input[type="date"], .filters select {
  padding: 8px 10px; border: 1px solid var(--border-strong); border-radius: var(--radius-sm);
  background: var(--surface);
}
.filters input[type="search"] { min-width: 280px; flex: 1; max-width: 460px; }
.filters label { color: var(--text-faint); font-size: 12.5px; }

/* --------------------------------------------------------------- table -- */
.table-wrap { overflow-x: auto; background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); box-shadow: var(--shadow); }
table { border-collapse: collapse; width: 100%; font-size: 13.5px; }
thead th {
  text-align: left; padding: 10px 12px; background: var(--surface-2);
  border-bottom: 1px solid var(--border); color: var(--text-dim);
  font-weight: 600; font-size: 12px; text-transform: uppercase; letter-spacing: .04em;
  position: sticky; top: 0; white-space: nowrap;
}
tbody td { padding: 10px 12px; border-bottom: 1px solid #eef1f4; vertical-align: top; }
tbody tr:last-child td { border-bottom: 0; }
tbody tr { cursor: pointer; }
tbody tr:hover td { background: var(--accent-soft); }
td.num, th.num { white-space: nowrap; font-variant-numeric: tabular-nums; }
.truncate { max-width: 360px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

.chip {
  display: inline-block; padding: 2px 8px; border-radius: 99px; font-size: 11.5px;
  font-weight: 600; border: 1px solid var(--border); background: var(--surface-2); color: var(--text-dim);
  white-space: nowrap;
}
.chip.open { background: var(--warn-soft); color: var(--warn); border-color: #f0dcbb; }
.chip.closed { background: var(--ok-soft); color: var(--ok); border-color: #c9e3d5; }
.chip.pending { background: var(--warn-soft); color: var(--warn); border-color: #f0dcbb; }
.chip.approved { background: var(--ok-soft); color: var(--ok); border-color: #c9e3d5; }

/* ------------------------------------------------------------- review --- */
.review { display: grid; grid-template-columns: 330px 1fr; gap: 16px; align-items: start; }
.review-list { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); box-shadow: var(--shadow); overflow: hidden; max-height: calc(100vh - 220px); overflow-y: auto; }
.review-item { padding: 12px 14px; border-bottom: 1px solid #eef1f4; cursor: pointer; }
.review-item:last-child { border-bottom: 0; }
.review-item:hover { background: var(--surface-2); }
.review-item[aria-current="true"] { background: var(--accent-soft); box-shadow: inset 3px 0 0 var(--accent); }
.review-item .ttl { font-weight: 600; font-size: 13.5px; }
.review-item .meta { color: var(--text-dim); font-size: 12px; margin-top: 2px; }
.review-item .miss { margin-top: 6px; display: flex; gap: 5px; flex-wrap: wrap; }
.dup-chip, .fu-chip { font-size: 10.5px; font-weight: 650; text-transform: uppercase; letter-spacing: .03em;
  border-radius: 4px; padding: 2px 6px; white-space: nowrap; }
.dup-chip { background: var(--danger-soft); color: var(--danger); border: 1px solid #f3cdca; }
.fu-chip { background: var(--warn-soft); color: var(--warn); border: 1px solid #f0dcbb; }
.dup-cell { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; min-width: 220px; }
.dup-why { font-size: 12px; color: var(--text-dim); flex: 1; min-width: 140px; }
tr.row-dup td { background: #fff6f5; }
tr.row-fu td { background: #fffaf0; }
.dup-bar { display: flex; align-items: center; justify-content: space-between; gap: 12px; flex-wrap: wrap; }
.miss-chip { font-size: 10.5px; font-weight: 650; text-transform: uppercase; letter-spacing: .03em;
  padding: 2px 6px; border-radius: 4px; background: var(--danger-soft); color: var(--danger); }

.raw-box {
  background: var(--surface-2); border: 1px solid var(--border); border-radius: var(--radius-sm);
  padding: 12px 14px; font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  font-size: 12px; white-space: pre-wrap; word-break: break-word; max-height: 300px; overflow: auto;
  color: var(--text-dim);
}

/* ---------------------------------------------------------------- form -- */
.form-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 14px; }
.field { display: flex; flex-direction: column; gap: 5px; min-width: 0; }
.field.full { grid-column: 1 / -1; }
.field > label { font-size: 12.5px; font-weight: 600; color: var(--text-dim); }
.field > label .req { color: var(--danger); margin-left: 2px; }
.field input, .field select, .field textarea {
  padding: 8px 10px; border: 1px solid var(--border-strong); border-radius: var(--radius-sm);
  background: var(--surface); width: 100%;
}
.field textarea { resize: vertical; min-height: 84px; }
.field input:focus, .field select:focus, .field textarea:focus {
  outline: 2px solid var(--accent); outline-offset: -1px; border-color: var(--accent);
}
.field .hint { font-size: 11.5px; color: var(--text-faint); }
.field.missing input, .field.missing select, .field.missing textarea { border-color: var(--danger); background: var(--danger-soft); }
.readonly { background: var(--surface-2) !important; color: var(--text-dim); }

/* road picker */
.rp { position: relative; }
.rp-menu {
  position: absolute; z-index: 40; left: 0; right: 0; top: calc(100% + 3px);
  background: var(--surface); border: 1px solid var(--border-strong); border-radius: var(--radius-sm);
  box-shadow: var(--shadow-lg); max-height: 280px; overflow-y: auto;
}
.rp-opt { padding: 8px 11px; cursor: pointer; display: flex; justify-content: space-between; gap: 10px; }
.rp-opt:hover, .rp-opt.active { background: var(--accent-soft); }
.rp-opt .nm { font-weight: 500; }
.rp-opt .mt { color: var(--text-faint); font-size: 12px; font-variant-numeric: tabular-nums; white-space: nowrap; }
.rp-empty { padding: 10px 11px; color: var(--text-faint); font-size: 13px; }

/* -------------------------------------------------------------- modal --- */
.modal-backdrop {
  position: fixed; inset: 0; background: rgba(16,24,40,.45); z-index: 50;
  display: grid; place-items: start center; padding: 40px 16px; overflow-y: auto;
}
.modal {
  background: var(--surface); border-radius: var(--radius); box-shadow: var(--shadow-lg);
  width: 100%; max-width: 860px;
}
.modal-head { display: flex; align-items: center; gap: 12px; padding: 16px 20px; border-bottom: 1px solid var(--border); }
.modal-head h2 { margin: 0; font-size: 16px; }
.modal-head .spacer { flex: 1; }
.modal-body { padding: 20px; }
.modal-foot { display: flex; gap: 9px; justify-content: flex-end; align-items: center; padding: 14px 20px; border-top: 1px solid var(--border); background: var(--surface-2); border-radius: 0 0 var(--radius) var(--radius); }
/* Destructive action sits apart from the confirming ones so it is not clicked by reflex. */
.modal-foot .spacer { flex: 1; }
.modal-foot .btn-danger { margin-right: auto; }

/* ------------------------------------------------------------- import --- */
.dropzone {
  border: 2px dashed var(--border-strong); border-radius: var(--radius); padding: 44px 24px;
  text-align: center; background: var(--surface); transition: border-color .12s, background .12s;
}
.dropzone.over { border-color: var(--accent); background: var(--accent-soft); }
.dropzone h3 { margin: 0 0 6px; font-size: 16px; }
.dropzone p { margin: 0 0 14px; color: var(--text-dim); }

.paste-area {
  margin-top: 14px; background: var(--surface); border: 1px solid var(--border);
  border-radius: var(--radius); box-shadow: var(--shadow); padding: 16px 18px;
}
.paste-head h3 { margin: 0 0 4px; font-size: 14px; font-weight: 650; }
.paste-head p { margin: 0 0 12px; color: var(--text-dim); font-size: 13px; max-width: 760px; }
.paste-area textarea {
  width: 100%; padding: 10px 12px; border: 1px solid var(--border-strong);
  border-radius: var(--radius-sm); resize: vertical; font-size: 13px; background: var(--surface-2);
}
.paste-area textarea:focus { outline: 2px solid var(--accent); outline-offset: -1px; background: var(--surface); }
kbd {
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace; font-size: 11.5px;
  background: var(--surface-2); border: 1px solid var(--border-strong); border-bottom-width: 2px;
  border-radius: 4px; padding: 1px 5px; color: var(--text);
}

.import-row { display: flex; align-items: flex-start; gap: 10px; padding: 11px 0; border-bottom: 1px solid #eef1f4; }
.import-row:last-child { border-bottom: 0; }
.import-row .nm { font-weight: 600; font-size: 13.5px; }
.import-row .dt { color: var(--text-faint); font-size: 12px; }

/* ------------------------------------------------------------ foreman -- */
.area-chip {
  font-weight: 650; font-size: 13px; padding: 4px 11px; border-radius: 99px;
  background: var(--accent-soft); color: var(--accent-dark); border: 1px solid #cfe0f2;
}
.area-card {
  max-width: 680px; margin: 30px auto; background: var(--surface); border: 1px solid var(--border);
  border-radius: var(--radius); box-shadow: var(--shadow); padding: 28px;
}
.area-card h2 { margin: 0 0 4px; font-size: 18px; }
.area-card p { margin: 0 0 20px; color: var(--text-dim); font-size: 13.5px; }
.area-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(170px, 1fr)); gap: 11px; }
.area-pick {
  padding: 18px 16px; border: 1px solid var(--border-strong); border-radius: var(--radius-sm);
  background: var(--surface); cursor: pointer; text-align: left;
  transition: border-color .12s, background .12s;
}
.area-pick:hover { border-color: var(--accent); background: var(--accent-soft); }
.area-pick.current { border-color: var(--accent); box-shadow: inset 0 0 0 1px var(--accent); }
.area-pick strong { display: block; font-size: 19px; letter-spacing: -.01em; }
.area-pick span { color: var(--text-dim); font-size: 12.5px; }

.switch { display: inline-flex; align-items: center; gap: 7px; font-size: 13px; color: var(--text-dim); cursor: pointer; }
.switch input { width: 16px; height: 16px; cursor: pointer; }

.cb-chip {
  font-size: 10.5px; font-weight: 700; text-transform: uppercase; letter-spacing: .04em;
  padding: 2px 7px; border-radius: 4px; background: var(--danger-soft); color: var(--danger);
  border: 1px solid #f3cdca; white-space: nowrap;
}
.review-item .meta.clip {
  overflow: hidden; text-overflow: ellipsis; display: -webkit-box;
  -webkit-line-clamp: 2; -webkit-box-orient: vertical; white-space: normal;
}

.ro-block {
  display: grid; gap: 1px; background: var(--border); border: 1px solid var(--border);
  border-radius: var(--radius-sm); overflow: hidden; margin-bottom: 16px;
}
.ro-row { display: flex; gap: 14px; background: var(--surface); padding: 9px 13px; }
.ro-label {
  width: 155px; flex: none; color: var(--text-dim); font-size: 12.5px; font-weight: 600;
}
.ro-value { font-size: 13.5px; white-space: pre-wrap; word-break: break-word; }
.ro-value.empty { color: var(--text-faint); }
.ro-note { color: var(--text-faint); font-size: 12px; }
/* The admin's read-only copy of the foreman block: same rows, tinted so it reads as
   somebody else's entry rather than another set of fields waiting to be filled in. */
.resp-block { background: var(--border); }
.resp-block .ro-row { background: var(--surface-2); }
.msg-block {
  background: var(--surface-2); border: 1px solid var(--border);
  border-radius: var(--radius-sm); padding: 13px 15px;
}
.msg-block .ro-label { width: auto; display: block; margin-bottom: 5px; }
.msg-block p { margin: 0; font-size: 14px; white-space: pre-wrap; line-height: 1.55; }

@media (max-width: 640px) {
  .ro-row { flex-direction: column; gap: 2px; }
  .ro-label { width: auto; }
  .modal-foot { flex-wrap: wrap; }
  .modal-foot .btn { flex: 1; }
}

/* ------------------------------------------------------------ manager -- */
.filters .sep { color: var(--text-faint); font-size: 12.5px; padding: 0 2px; }

.report-head {
  display: flex; align-items: flex-start; gap: 20px; justify-content: space-between;
  background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius);
  box-shadow: var(--shadow); padding: 20px 22px; margin-bottom: 14px;
}
.rh-sub { color: var(--text-dim); font-size: 12.5px; }
.rh-title { margin: 2px 0 0; font-size: 22px; letter-spacing: -.02em; }
.hero { text-align: right; }
.hero-n { font-size: 52px; font-weight: 700; line-height: 1; letter-spacing: -.03em; color: var(--accent); }
.hero-l { color: var(--text-dim); font-size: 12.5px; margin-top: 3px; }

.report-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; margin-top: 14px; }
.report-grid.three { grid-template-columns: repeat(3, 1fr); }

.pie-wrap { display: flex; gap: 20px; align-items: center; flex-wrap: wrap; }
.pie-wrap svg { flex: none; }
.legend { display: grid; gap: 7px; min-width: 190px; flex: 1; }
.lg-row { display: flex; align-items: center; gap: 9px; font-size: 13px; }
.lg-dot { width: 11px; height: 11px; border-radius: 3px; flex: none; }
.lg-name { flex: 1; color: var(--text); }
.lg-val { color: var(--text-dim); font-variant-numeric: tabular-nums; }

.top3 { list-style: none; counter-reset: t; margin: 0; padding: 0; display: grid; gap: 8px; }
.top3 li {
  counter-increment: t; display: flex; align-items: center; gap: 11px;
  padding: 10px 13px; background: var(--surface-2); border: 1px solid var(--border);
  border-radius: var(--radius-sm);
}
.top3 li::before {
  content: counter(t); width: 22px; height: 22px; flex: none; border-radius: 50%;
  background: var(--accent); color: #fff; font-size: 12px; font-weight: 700;
  display: grid; place-items: center;
}
.t3-name { flex: 1; font-weight: 600; }
.t3-val { font-variant-numeric: tabular-nums; font-weight: 600; }
.t3-val em { color: var(--text-dim); font-style: normal; font-weight: 400; margin-left: 5px; }

table.mini { width: 100%; border-collapse: collapse; font-size: 13px; }
table.mini td { padding: 5px 8px; border-bottom: 1px solid #eef1f4; }
table.mini td.num { text-align: right; font-variant-numeric: tabular-nums; white-space: nowrap; }
table.mini td.dim { color: var(--text-faint); width: 54px; }
table.mini tr.total td { font-weight: 700; border-top: 2px solid var(--border-strong); border-bottom: 0; }

.rb { display: grid; gap: 9px; }
.rb-row { display: flex; align-items: center; gap: 10px; font-size: 13px; }
.rb-name { width: 108px; flex: none; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; color: var(--text-dim); }
.rb-track { flex: 1; height: 9px; background: var(--surface-2); border: 1px solid var(--border); border-radius: 99px; overflow: hidden; }
.rb-track i { display: block; height: 100%; border-radius: 99px; }
.rb-val { width: 66px; text-align: right; font-weight: 600; font-variant-numeric: tabular-nums; }
.rb-pct { color: var(--text-faint); font-weight: 400; margin-left: 5px; font-size: 11.5px; }

.report-foot { color: var(--text-faint); font-size: 11.5px; margin: 16px 0 0; }
.pt-sub { color: var(--text-faint); font-weight: 500; }
.rh-filter { font-weight: 600; color: var(--accent); margin-top: 3px; }

/* Forecast panel (v6) — internal planning, hidden in print. */
.fc { margin-bottom: 14px; border-left: 4px solid var(--accent); }
.fc-head { display: flex; align-items: baseline; justify-content: space-between; gap: 12px; flex-wrap: wrap; }
.fc-tag {
  font-size: 11.5px; color: var(--text-dim); background: var(--surface-2);
  border: 1px solid var(--border); border-radius: 99px; padding: 2px 10px;
}
.fc-main { display: flex; gap: 28px; align-items: center; flex-wrap: wrap; margin: 6px 0 16px; }
.fc-figure { min-width: 220px; }
.fc-n { font-size: 44px; font-weight: 700; line-height: 1.05; letter-spacing: -.03em; color: var(--accent); }
.fc-l { color: var(--text-dim); font-size: 12.5px; margin-top: 3px; }
.fc-range { margin-top: 8px; font-size: 14px; }
.fc-basis { flex: 1; min-width: 260px; color: var(--text-dim); font-size: 13px; }
.fc-basis p { margin: 0 0 6px; }
.fc-sub { margin: 0 0 10px; font-size: 13px; color: var(--text-dim); font-weight: 600; }
.fc-how { margin-top: 14px; font-size: 13px; color: var(--text-dim); }
.fc-how summary { cursor: pointer; color: var(--accent); font-weight: 600; }
.fc-how p { margin: 8px 0 0; max-width: 820px; }
.fc .report-grid { margin-top: 0; }
.fc-warn { color: var(--warn); font-weight: 600; }
.print-only { display: none; }

@media (max-width: 1100px) {
  .report-grid, .report-grid.three { grid-template-columns: 1fr; }
}

/* The page exists to be printed into the MOTI monthly report, so the print layout is
   a first-class view, not an afterthought: controls out, colours kept, nothing split
   across a page break. */
@media print {
  @page { margin: 12mm; size: portrait; }
  body { background: #fff; }
  .no-print, #login, #app, #foreman, #toastRoot, #modalRoot { display: none !important; }
  main { padding: 0; max-width: none; }
  .print-only { display: block; }
  .period-stamp { font-size: 13px; margin-bottom: 10px; color: #000; }
  .card, .report-head, .tile {
    box-shadow: none !important; border: 1px solid #c9ced5 !important;
    break-inside: avoid; page-break-inside: avoid;
  }
  .report-grid { grid-template-columns: 1fr 1fr !important; }
  .report-grid.three { grid-template-columns: repeat(3, 1fr) !important; }
  .tiles { grid-template-columns: repeat(4, 1fr) !important; }
  .hero-n { color: #17497f !important; }
  * { -webkit-print-color-adjust: exact; print-color-adjust: exact; }
}

/* -------------------------------------------------------------- misc ---- */
.notice { padding: 10px 13px; border-radius: var(--radius-sm); font-size: 13px; margin-bottom: 12px; }
.notice.err { background: var(--danger-soft); color: var(--danger); border: 1px solid #f3cdca; }
.notice.warn { background: var(--warn-soft); color: var(--warn); border: 1px solid #f0dcbb; }
.notice.ok { background: var(--ok-soft); color: var(--ok); border: 1px solid #c9e3d5; }
.empty { padding: 48px 20px; text-align: center; color: var(--text-faint); }
.spinner {
  width: 15px; height: 15px; border: 2px solid var(--border-strong); border-top-color: var(--accent);
  border-radius: 50%; animation: spin .7s linear infinite; display: inline-block;
}
@keyframes spin { to { transform: rotate(360deg); } }
.toast {
  position: fixed; bottom: 20px; left: 50%; transform: translateX(-50%); z-index: 90;
  background: #1c2330; color: #fff; padding: 11px 18px; border-radius: var(--radius-sm);
  box-shadow: var(--shadow-lg); font-size: 13.5px;
}
footer { text-align: center; color: var(--text-faint); font-size: 12px; padding: 0 0 26px; }

@media (max-width: 900px) {
  .review { grid-template-columns: 1fr; }
  .review-list { max-height: 300px; }
  .form-grid { grid-template-columns: 1fr; }
  main { padding: 16px 12px 44px; }
  .topbar, .tabs { padding: 0 12px; }
}

.rh-flag {
  margin-top: 7px; display: inline-block; font-size: 12px; font-weight: 600;
  color: var(--warn); background: var(--warn-soft); border: 1px solid #f0dcbb;
  border-radius: 4px; padding: 3px 9px;
}
.t3-note { margin: 10px 0 0; font-size: 12px; color: var(--text-faint); }

/* ---------------------------------------------- alert recipients (v12.5) --- */
.rc-tablewrap { overflow-x: auto; margin-bottom: 18px; }
.rc-table { width: 100%; border-collapse: collapse; font-size: 13.5px; }
.rc-table th { text-align: left; font-size: 12px; color: var(--text-faint); font-weight: 600; padding: 6px 8px; border-bottom: 1px solid var(--border); }
.rc-table td { padding: 9px 8px; border-bottom: 1px solid var(--border); vertical-align: middle; }
.rc-table .chip { margin: 1px 2px 1px 0; }
.rc-sub { font-size: 12px; color: var(--text-faint); }
.rc-email { word-break: break-all; }
.rc-actions { white-space: nowrap; text-align: right; }
.rc-off td { opacity: .55; }
.rc-off td.rc-actions, .rc-off td:nth-child(4) { opacity: 1; }
.rc-empty { color: var(--text-faint); text-align: center; padding: 18px; }
.rc-h3 { font-size: 14px; margin: 0 0 10px; }
.rc-form { background: var(--surface-2); border: 1px solid var(--border); border-radius: var(--radius-sm); padding: 14px; }
.rc-areas { display: flex; flex-wrap: wrap; gap: 6px 14px; padding: 4px 0; }
.rc-area, .rc-toggle, .field > label.rc-toggle { display: inline-flex; align-items: center; gap: 6px; font-weight: 400; font-size: 13.5px; color: var(--text); cursor: pointer; }
.field .rc-area input, .field .rc-toggle input, .rc-toggle input { width: auto; padding: 0; margin: 0; }
.rc-formfoot { display: flex; justify-content: flex-end; gap: 9px; margin-top: 12px; }
.rc-form .notice { margin: 12px 0 0; }
@media (max-width: 640px) {
  .rc-table thead { display: none; }
  .rc-table tr { display: block; border-bottom: 1px solid var(--border); padding: 6px 0; }
  .rc-table td { display: block; border: 0; padding: 3px 4px; }
  .rc-actions { text-align: left; }
}
