:root {
  --navy: #1f4e78;
  --navy-900: #14324d;
  --navy-800: #1a4063;
  --gold: #c49a3b;
  --gold-100: #fbf6ea;
  --gold-200: #f0e2c0;
  --ink: #1b2836;
  --muted: #5e6e80;
  --line: #e3e8ee;
  --bg: #f3f5f8;
  --card: #ffffff;
  --red: #9c3b3b;
  --red-bg: #f8ecec;
  --green: #1f7a4d;
  --green-bg: #e7f5ee;
  --blue: #1f4e78;
  --blue-bg: #e7f0f8;
  --orange: #b86a1b;
  --orange-bg: #fbf1e4;
  --grey: #5e6e80;
  --grey-bg: #eef1f4;
  --shadow: 0 1px 2px rgba(20, 40, 60, 0.05);
  --sidebar: 236px;
  --font: "Segoe UI", Aptos, "Liberation Sans", "Nimbus Sans", Arial, sans-serif;
}

* { box-sizing: border-box; }
html, body { margin: 0; padding: 0; }
body {
  font-family: var(--font);
  color: var(--ink);
  background: var(--bg);
  font-size: 15px;
  line-height: 1.45;
}
a { color: var(--navy); }
button, input, select, textarea { font: inherit; color: inherit; }
:focus-visible { outline: 2px solid var(--gold); outline-offset: 2px; }

.nav-toggle { position: absolute; opacity: 0; pointer-events: none; }
.shell { display: flex; min-height: 100vh; }

.sidebar {
  width: var(--sidebar);
  background: var(--navy-900);
  color: #e8eef4;
  display: flex;
  flex-direction: column;
  position: sticky;
  top: 0;
  height: 100vh;
  flex-shrink: 0;
}
.brand { padding: 18px 16px 14px; border-bottom: 3px solid var(--gold); }
.brand-kicker {
  display: block;
  font-size: 11px;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--gold);
  font-weight: 650;
}
.brand-name { display: block; margin-top: 4px; font-size: 18px; font-weight: 650; color: white; }
.brand-sub { display: block; margin-top: 2px; color: #b7c9d8; font-size: 12px; }
.nav { padding: 8px 0 16px; overflow: auto; flex: 1; }
.nav-label {
  margin: 16px 16px 6px;
  font-size: 11px;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: #8eabc4;
}
.nav a {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin: 1px 8px;
  padding: 8px 12px;
  border-radius: 6px;
  color: #e7eef5;
  text-decoration: none;
}
.nav a:hover { background: rgba(255, 255, 255, 0.06); }
.nav a.active { background: rgba(255, 255, 255, 0.08); box-shadow: inset 3px 0 0 var(--gold); }
.nav-count {
  background: var(--gold);
  color: #1b2836;
  border-radius: 99px;
  min-width: 18px;
  text-align: center;
  font-size: 11px;
  font-weight: 700;
  padding: 0 6px;
}
.sidebar-foot {
  border-top: 1px solid rgba(255, 255, 255, 0.08);
  padding: 12px 14px 14px;
}
.who { display: block; color: white; font-weight: 650; }
.who-role { display: block; color: #b7c9d8; font-size: 12px; margin-bottom: 8px; }
.signout { margin: 0; }
.signout button {
  background: transparent;
  color: #d5e2ec;
  border: 1px solid rgba(255, 255, 255, 0.2);
  border-radius: 6px;
  padding: 4px 10px;
  cursor: pointer;
}
.signout button:hover { border-color: var(--gold); color: white; }

.main { flex: 1; min-width: 0; display: flex; flex-direction: column; }
.topbar {
  height: 58px;
  background: white;
  border-bottom: 1px solid var(--line);
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 0 18px;
  position: sticky;
  top: 0;
  z-index: 5;
}
.burger {
  display: none;
  border: 1px solid var(--line);
  background: white;
  border-radius: 6px;
  padding: 6px 10px;
  cursor: pointer;
}
.search { flex: 1; }
.search input {
  width: min(560px, 100%);
  border: 1px solid var(--line);
  background: var(--bg);
  border-radius: 8px;
  padding: 8px 12px;
}
.search input:focus { background: white; border-color: var(--navy); outline: none; }
.content { padding: 22px 24px 56px; }

.page-head {
  display: flex;
  justify-content: space-between;
  align-items: flex-end;
  gap: 16px;
  margin-bottom: 16px;
}
h1 { font-size: 26px; line-height: 1.2; margin: 0; color: var(--navy-900); font-weight: 650; }
h2 { font-size: 16px; margin: 0; }
.sub { margin: 4px 0 0; color: var(--muted); }
.page-actions, .actions { display: flex; gap: 8px; flex-wrap: wrap; align-items: center; }

.btn, button.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  background: var(--navy);
  color: white;
  text-decoration: none;
  border: 1px solid var(--navy);
  border-radius: 6px;
  padding: 7px 12px;
  cursor: pointer;
  font-weight: 600;
}
.btn:hover { background: var(--navy-900); }
.btn.secondary, a.btn.secondary {
  background: white;
  color: var(--navy);
}
.btn.secondary:hover { background: var(--gold-100); }
.btn.gold { background: var(--gold); border-color: var(--gold); color: #1b2836; }
.btn.gold:hover { filter: brightness(0.96); }
.btn.danger { background: white; color: var(--red); border-color: #e4c6c6; }
.btn.small { padding: 4px 8px; font-size: 13px; font-weight: 600; }

.stats {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 12px;
  margin-bottom: 16px;
}
.stat {
  background: white;
  border: 1px solid var(--line);
  border-top: 3px solid var(--navy);
  border-radius: 8px;
  padding: 12px 14px 14px;
  text-decoration: none;
  color: inherit;
  box-shadow: var(--shadow);
}
.stat:hover { border-color: #c9d4e0; }
.stat.warn { border-top-color: var(--gold); }
.stat.alert { border-top-color: var(--red); }
.stat-value { display: block; font-size: 28px; font-weight: 700; color: var(--navy-900); letter-spacing: -0.03em; }
.stat-label { display: block; margin-top: 2px; font-weight: 650; }
.stat-note { display: block; color: var(--muted); font-size: 12px; margin-top: 2px; }
.stat-split { display: flex; gap: 10px; margin-top: 6px; font-size: 13px; }
.stat-split a { text-decoration: none; }
.stat-split strong { color: var(--navy-900); }

.banner {
  background: var(--gold-100);
  border: 1px solid var(--gold-200);
  border-left: 4px solid var(--gold);
  border-radius: 8px;
  padding: 10px 14px;
  margin-bottom: 16px;
}
.banner a { font-weight: 650; }

.layout-2 {
  display: grid;
  grid-template-columns: 1.3fr 0.9fr;
  gap: 16px;
  margin-bottom: 16px;
}
.card {
  background: white;
  border: 1px solid var(--line);
  border-radius: 8px;
  box-shadow: var(--shadow);
}
.card-head {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  gap: 8px;
  padding: 12px 14px;
  border-bottom: 1px solid var(--line);
}
.card-head h2 { font-size: 15px; }
.card-body { padding: 0; }
.card-body.pad { padding: 14px; }

.work-row, .handoff {
  display: grid;
  grid-template-columns: 92px 1fr auto;
  gap: 10px;
  align-items: start;
  padding: 10px 14px;
  border-top: 1px solid var(--line);
  text-decoration: none;
  color: inherit;
}
.card-body > :first-child { border-top: 0; }
.work-row:hover, .handoff:hover { background: #f7f9fb; }
.when { color: var(--muted); font-size: 13px; }
.when.late { color: var(--red); font-weight: 700; }
.work-title { font-weight: 650; color: var(--navy-900); }
.work-meta { color: var(--muted); font-size: 13px; }
.stack { display: flex; flex-direction: column; gap: 2px; min-width: 0; }
.handoff { grid-template-columns: 1fr auto; }

.panel { margin-top: 16px; }
.panel > .card-head, .section-head {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  margin: 8px 0;
}
.segment { display: inline-flex; border: 1px solid var(--line); border-radius: 6px; overflow: hidden; background: white; }
.segment a {
  padding: 4px 10px;
  text-decoration: none;
  color: var(--muted);
  border-left: 1px solid var(--line);
}
.segment a:first-child { border-left: 0; }
.segment a.on { background: var(--navy); color: white; }

.month { margin-top: 14px; }
.month > header {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  border-bottom: 2px solid var(--navy);
  padding-bottom: 4px;
}
.month > header span { color: var(--muted); font-size: 13px; }
.fra-group {
  display: grid;
  grid-template-columns: 240px 1fr;
  gap: 8px 16px;
  padding: 10px 0;
  border-bottom: 1px solid var(--line);
}
.fra-group .fra-name { font-weight: 700; color: var(--navy-900); text-decoration: none; }
.fra-group ul { list-style: none; margin: 0; padding: 0; }
.fra-group li {
  display: grid;
  grid-template-columns: 64px minmax(140px, 200px) 1fr auto auto;
  gap: 8px;
  align-items: center;
  padding: 3px 0;
}
.fra-group time { color: var(--muted); font-variant-numeric: tabular-nums; }

.table-wrap { overflow-x: auto; background: white; border: 1px solid var(--line); border-radius: 8px; }
table.data { width: 100%; border-collapse: collapse; }
table.data th {
  text-align: left;
  font-size: 11px;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--muted);
  font-weight: 700;
  padding: 10px 12px;
  background: #f8fafc;
  border-bottom: 1px solid var(--line);
  white-space: nowrap;
}
table.data td {
  padding: 10px 12px;
  border-top: 1px solid var(--line);
  vertical-align: middle;
}
table.data tbody tr:hover td { background: #f7f9fb; }
table.data tr.overdue td:first-child { box-shadow: inset 3px 0 0 var(--red); }
table.data tr.pending td:first-child { box-shadow: inset 3px 0 0 var(--gold); }
table.data a.rowlink { font-weight: 650; text-decoration: none; color: var(--navy-900); }
table.data a.rowlink:hover { text-decoration: underline; }
.num { text-align: right; font-variant-numeric: tabular-nums; }
.muted { color: var(--muted); }
.nowrap { white-space: nowrap; }

.pill {
  display: inline-block;
  border-radius: 99px;
  padding: 2px 8px;
  font-size: 12px;
  font-weight: 650;
  background: var(--grey-bg);
  color: var(--grey);
  white-space: nowrap;
}
.pill.green { background: var(--green-bg); color: var(--green); }
.pill.blue { background: var(--blue-bg); color: var(--blue); }
.pill.gold { background: var(--gold-100); color: #8a6a1d; }
.pill.orange { background: var(--orange-bg); color: var(--orange); }
.pill.red { background: var(--red-bg); color: var(--red); }
.pill.grey { background: var(--grey-bg); color: var(--grey); }
.flag {
  display: inline-block;
  font-size: 11px;
  font-weight: 750;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: var(--red);
}

.filters {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-bottom: 12px;
  align-items: center;
}
.filters input, .filters select {
  border: 1px solid var(--line);
  background: white;
  border-radius: 6px;
  padding: 7px 10px;
}
.filters input[type="search"] { min-width: 220px; }

.tabs {
  display: flex;
  gap: 0;
  border-bottom: 1px solid var(--line);
  margin: 8px 0 16px;
  overflow-x: auto;
}
.tabs a {
  padding: 8px 14px;
  text-decoration: none;
  color: var(--muted);
  border-bottom: 2px solid transparent;
  white-space: nowrap;
  font-weight: 650;
}
.tabs a.on { color: var(--navy); border-bottom-color: var(--gold); }
.tabs a.soon { font-weight: 500; }

.record-head { margin-bottom: 4px; }
.crumbs { color: var(--muted); font-size: 13px; margin-bottom: 4px; }
.crumbs a { color: var(--muted); }
.record-title { display: flex; gap: 10px; align-items: center; flex-wrap: wrap; }
.code {
  font-family: ui-monospace, "SFMono-Regular", Menlo, Consolas, monospace;
  background: var(--navy);
  color: white;
  border-radius: 4px;
  padding: 2px 6px;
  font-size: 13px;
}
.facts {
  display: flex;
  flex-wrap: wrap;
  gap: 8px 16px;
  color: var(--muted);
  margin: 8px 0 0;
}
.facts strong { color: var(--ink); font-weight: 650; }

.kv {
  display: grid;
  grid-template-columns: 180px 1fr;
  gap: 6px 12px;
  margin: 0;
}
.kv dt { color: var(--muted); }
.kv dd { margin: 0; }
.split { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; }
.note {
  white-space: pre-wrap;
  background: #f8fafc;
  border-radius: 6px;
  padding: 10px 12px;
}

.later {
  border: 1px dashed #c9d4e0;
  background: white;
  border-radius: 8px;
  padding: 18px 18px 8px;
}
.later h2 { margin-bottom: 6px; }
.phase {
  display: inline-block;
  background: var(--gold-100);
  color: #8a6a1d;
  border-radius: 99px;
  padding: 1px 8px;
  font-size: 12px;
  font-weight: 700;
  margin-left: 6px;
}

.form-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px 16px;
  background: white;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 16px;
}
.field { display: flex; flex-direction: column; gap: 4px; }
.field.span-2 { grid-column: 1 / -1; }
.field label { font-size: 13px; font-weight: 650; color: var(--navy-900); }
.req { color: var(--red); margin-left: 3px; }
.help { margin: 0; color: var(--muted); font-size: 12px; }
.error { margin: 0; color: var(--red); font-size: 13px; }
.input, .select, .textarea {
  border: 1px solid #cfd6de;
  border-radius: 6px;
  padding: 8px 10px;
  background: white;
  width: 100%;
}
.textarea { min-height: 96px; }
.form-actions { grid-column: 1 / -1; display: flex; gap: 8px; margin-top: 4px; }
.checks, form ul { list-style: none; padding: 0; margin: 0; columns: 2; }
form ul li { break-inside: avoid; margin: 3px 0; }

.uw-stats { grid-template-columns: repeat(3, 1fr); }
.board { display: flex; gap: 8px; overflow-x: auto; padding-bottom: 8px; }
.lane {
  flex: 0 0 180px;
  background: white;
  border: 1px solid var(--line);
  border-radius: 8px;
  min-height: 120px;
}
.lane.side { background: #fbf7f2; }
.lane header {
  display: flex;
  justify-content: space-between;
  gap: 8px;
  padding: 8px 10px;
  border-bottom: 1px solid var(--line);
  font-size: 12px;
  font-weight: 700;
}
.lane-empty { color: var(--muted); padding: 8px 10px; margin: 0; }
.uw-card {
  display: flex;
  flex-direction: column;
  gap: 2px;
  margin: 8px;
  padding: 8px;
  border: 1px solid var(--line);
  border-left: 3px solid var(--gold);
  border-radius: 6px;
  text-decoration: none;
  color: inherit;
  background: white;
}
.uw-card:hover { border-color: var(--navy); }
.swim { margin-top: 18px; }
.swim h2 { margin: 0 0 8px; }
.input.tiny { width: 72px; }
.queue-row { display: block; margin-bottom: 8px; padding: 10px 12px; }

@media (max-width: 980px) {
  .uw-stats { grid-template-columns: 1fr 1fr; }
}

.messages { list-style: none; padding: 0; margin: 0 0 12px; }
.message {
  background: var(--green-bg);
  border-left: 4px solid var(--green);
  padding: 8px 12px;
  border-radius: 6px;
  margin-bottom: 6px;
}
.message.error { background: var(--red-bg); border-left-color: var(--red); }

.pager {
  display: flex;
  gap: 12px;
  align-items: center;
  padding: 10px 12px;
  color: var(--muted);
  font-size: 13px;
}
.empty { color: var(--muted); padding: 16px; margin: 0; }

.timeline-event { display: grid; grid-template-columns: 140px 1fr; gap: 8px; padding: 8px 0; border-top: 1px solid var(--line); }
.action-bar { display: flex; flex-wrap: wrap; gap: 8px; margin: 12px 0; }
.inline { display: flex; flex-wrap: wrap; gap: 6px; align-items: center; }
.inline input, .inline select { border: 1px solid var(--line); border-radius: 6px; padding: 6px 8px; }

.login-body { min-height: 100vh; display: grid; grid-template-columns: 1.1fr 1fr; background: white; }
.login-hero {
  background: var(--navy-900);
  color: white;
  padding: 64px 56px;
  display: flex;
  flex-direction: column;
  justify-content: center;
  border-bottom: 0;
  position: relative;
}
.login-hero:after {
  content: "";
  position: absolute;
  left: 0; right: 0; bottom: 0;
  height: 8px;
  background: var(--gold);
}
.login-hero h1 { color: white; font-size: 40px; margin: 8px 0; }
.login-hero p { max-width: 420px; color: #d5e2ec; font-size: 16px; }
.login-panel { display: flex; align-items: center; justify-content: center; padding: 40px 24px; }
.login-card { width: min(380px, 100%); }
.login-card h2 { font-size: 22px; margin: 0 0 16px; color: var(--navy-900); }
.login-card input {
  border: 1px solid #cfd6de;
  border-radius: 6px;
  padding: 8px 10px;
  width: 100%;
}
.login-card .field { margin-bottom: 12px; }
.login-card .btn { width: 100%; margin-top: 6px; }
.or { text-align: center; color: var(--muted); margin: 14px 0; font-size: 13px; }
.btn-microsoft { width: 100%; background: white; color: var(--navy); }

.result-block { margin-bottom: 18px; }
.result-block h2 { margin-bottom: 6px; }
.result-block ul { margin: 0; padding-left: 18px; }
.result-block li { margin: 4px 0; }

@media (max-width: 980px) {
  .stats { grid-template-columns: 1fr 1fr; }
  .layout-2, .split, .fra-group, .login-body { grid-template-columns: 1fr; }
  .fra-group li { grid-template-columns: 64px 1fr; }
  .login-hero { padding: 32px 24px; }
  .login-hero:after { height: 6px; }
}
.center-nav {
  display: flex;
  gap: 4px;
  overflow-x: auto;
  padding: 2px 0 10px;
  margin: 0 0 12px;
  border-bottom: 3px solid var(--navy);
}
.center-nav a {
  flex: 0 0 auto;
  text-decoration: none;
  color: var(--navy);
  font-weight: 650;
  font-size: 13px;
  padding: 8px 10px;
  border-radius: 8px 8px 0 0;
}
.center-nav a.on { background: var(--navy); color: white; }
.tab-count {
  display: inline-block;
  min-width: 1.2em;
  margin-left: 4px;
  padding: 0 6px;
  border-radius: 99px;
  background: var(--gold);
  color: var(--navy-900);
  font-size: 11px;
  text-align: center;
}
.center-nav a.on .tab-count { background: white; }
.table-scroll { overflow-x: auto; background: white; border: 1px solid var(--line); border-radius: 8px; -webkit-overflow-scrolling: touch; }
table.dense { width: max-content; min-width: 100%; border-collapse: collapse; font-size: 13px; }
table.dense th, table.dense td { padding: 6px 8px; border-bottom: 1px solid var(--line); white-space: nowrap; text-align: left; vertical-align: middle; }
table.dense th { background: #eef3f8; font-size: 11px; letter-spacing: 0.03em; text-transform: uppercase; color: var(--navy); }
table.dense td.sticky { position: sticky; left: 0; background: white; z-index: 1; box-shadow: 1px 0 0 var(--line); }
table.dense tbody tr:hover td { background: #f7f9fb; }
table.dense tbody tr:hover td.sticky { background: #f7f9fb; }
.cell-form { margin: 0; }
.cell-input, .cell-form select { border: 1px solid #d5dde6; border-radius: 4px; padding: 3px 4px; font-size: 12px; max-width: 148px; background: white; }
.bulk-bar { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; margin: 8px 0 10px; }
.funnel { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 8px; }
.funnel li { display: grid; grid-template-columns: 150px 1fr 36px; gap: 8px; align-items: center; }
.funnel-bar { display: block; height: 12px; background: linear-gradient(90deg, var(--navy), #3d6f99); border-radius: 99px; }
.funnel-count { font-weight: 700; color: var(--navy-900); }
.switcher { display: flex; flex-direction: column; gap: 2px; font-size: 12px; }
.switcher select { min-width: min(100%, 280px); }
.enroll-jumps { display: grid; grid-template-columns: repeat(auto-fill, minmax(200px, 1fr)); gap: 8px; margin: 0 0 16px; }
.email-copy { background: var(--gold-100); border-left: 3px solid var(--gold); padding: 8px 10px; margin: 6px 0 12px; }
.call-search { position: relative; flex: 1; }
.call-results, .call-empty {
  position: absolute;
  z-index: 30;
  top: calc(100% + 6px);
  left: 0;
  right: 0;
  background: white;
  border: 1px solid var(--line);
  border-radius: 8px;
  box-shadow: 0 8px 24px rgba(20, 40, 60, 0.12);
  margin: 0;
  padding: 6px;
  list-style: none;
  max-height: 50vh;
  overflow: auto;
}
.call-results a { display: flex; gap: 8px; align-items: baseline; text-decoration: none; color: inherit; padding: 8px; border-radius: 6px; }
.call-results a:hover { background: #f4f7fb; }
.call-empty { padding: 12px; color: var(--muted); }
.call-drawer {
  position: fixed;
  z-index: 40;
  top: 0;
  right: 0;
  bottom: 0;
  width: min(440px, 100%);
  background: white;
  border-left: 4px solid var(--gold);
  box-shadow: -12px 0 32px rgba(20, 40, 60, 0.16);
  overflow: auto;
  transform: translateX(110%);
}
.call-drawer.open { transform: none; }
.call-head, .call-body { padding: 16px; }
.call-head { display: flex; flex-wrap: wrap; gap: 8px; align-items: flex-start; background: var(--navy); color: white; }
.call-head h2, .call-head .muted, .call-head .sub { color: white; margin: 0; }
.call-head .pill { background: var(--gold); color: var(--navy-900); }
.stack-form { display: flex; flex-direction: column; gap: 8px; }
.stack-form label { display: flex; flex-direction: column; gap: 4px; font-size: 13px; font-weight: 650; }
.stack-form input, .stack-form select, .stack-form textarea { font: inherit; border: 1px solid #d5dde6; border-radius: 6px; padding: 8px; }
@media (max-width: 820px) {
  .call-drawer { width: 100%; }
  .call-results, .call-empty { left: 8px; right: 8px; }
}
.add-person { margin-top: 16px; }

@media (max-width: 820px) {
  .funnel li { grid-template-columns: 1fr auto; }
  .funnel-bar { grid-column: 1 / -1; }
  .page-actions { width: 100%; }
  .switcher, .switcher select { width: 100%; }
}

@media (max-width: 820px) {
  .burger { display: inline-flex; }
  .sidebar {
    position: fixed;
    z-index: 20;
    transform: translateX(-100%);
    transition: transform 0.16s ease;
  }
  .nav-toggle:checked ~ .shell .sidebar { transform: none; }
  .content { padding: 16px; }
  .form-grid { grid-template-columns: 1fr; }
  .field.span-2 { grid-column: auto; }
  .page-head { flex-direction: column; align-items: flex-start; }
}
.tone-expired, .tone-soon-30 { background: var(--red-bg); color: var(--red); font-weight: 700; }
.loa { white-space: normal; max-width: 280px; }
.tone-soon-60 { background: var(--gold-100); }
.tone-soon-90 { background: var(--blue-bg); }
.tone-ok { color: var(--green); }
