:root {
  --navy: #0b1d35;
  --navy-2: #102846;
  --navy-3: #173b63;
  --gold: #c69a3b;
  --gold-2: #e0bd68;
  --ink: #172033;
  --muted: #667085;
  --line: #dfe5ec;
  --soft-line: #edf1f5;
  --bg: #f6f8fb;
  --paper: #ffffff;
  --ok: #16754d;
  --warn: #9b5a00;
  --danger: #b42318;
  --info: #175cd3;
  --shadow: 0 20px 55px rgba(10, 31, 68, 0.10);
  --shadow-soft: 0 10px 32px rgba(10, 31, 68, 0.08);
  --radius: 18px;
  --radius-sm: 12px;
  --max: 1180px;
}
* { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body {
  margin: 0;
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  color: var(--ink);
  background: var(--bg);
  line-height: 1.5;
}
a { color: inherit; text-decoration: none; }
img { max-width: 100%; display: block; }
button, input, select, textarea { font: inherit; }
.container { width: min(var(--max), calc(100% - 36px)); margin: 0 auto; }
.skip-link {
  position: absolute; left: -999px; top: 0; background: var(--navy); color: white; padding: 10px 14px; z-index: 999;
}
.skip-link:focus { left: 12px; top: 12px; border-radius: 8px; }
.site-header {
  position: sticky; top: 0; z-index: 50;
  background: rgba(255,255,255,0.92);
  backdrop-filter: blur(14px);
  border-bottom: 1px solid rgba(223,229,236,0.8);
}
.header-inner { display: flex; align-items: center; justify-content: space-between; min-height: 78px; gap: 22px; }
.brand { display: flex; align-items: center; gap: 12px; min-width: 0; flex: 1 1 auto; }
.brand img { width: 54px; height: 54px; object-fit: contain; }
.brand-copy { display: grid; gap: 3px; min-width: 0; }
.brand-title { display: block; font-weight: 850; color: var(--navy); letter-spacing: -0.03em; line-height: 1.05; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.site-header .brand-title-short { display: none !important; }
.brand-sub { font-size: 12px; color: var(--muted); margin-top: 0; }
.nav { display: flex; align-items: center; gap: 18px; color: #344054; font-size: 14px; font-weight: 650; }
.nav a { padding: 8px 0; border-bottom: 2px solid transparent; }
.nav a:hover { color: var(--navy); border-color: var(--gold); }
.header-actions { display: flex; align-items: center; gap: 10px; flex: 0 0 auto; }
.mobile-nav-toggle {
  display: none;
  align-items: center;
  justify-content: center;
  border: 1px solid var(--line);
  border-radius: 999px;
  padding: 11px 16px;
  min-height: 42px;
  background: white;
  color: var(--navy);
  font-weight: 800;
  cursor: pointer;
  transition: transform .18s ease, box-shadow .18s ease, background .18s ease, border-color .18s ease;
}
.mobile-nav-toggle:hover { transform: translateY(-1px); box-shadow: var(--shadow-soft); }
.mobile-nav-panel {
  display: none;
  padding: 0 0 16px;
  border-top: 1px solid rgba(223,229,236,0.8);
}
.mobile-nav-panel:not([hidden]) { display: block; }
.mobile-nav {
  display: grid;
  gap: 4px;
  padding-top: 14px;
}
.mobile-nav a {
  padding: 10px 0;
  border-bottom: 1px solid var(--soft-line);
  color: #344054;
  font-size: 15px;
  font-weight: 700;
}
.mobile-nav-actions { display: flex; flex-wrap: wrap; gap: 10px; padding-top: 14px; }
.btn, button.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  border: 1px solid transparent;
  border-radius: 999px;
  padding: 11px 17px;
  min-height: 42px;
  font-weight: 800;
  cursor: pointer;
  transition: transform .18s ease, box-shadow .18s ease, background .18s ease, border-color .18s ease;
  white-space: nowrap;
}
.btn:hover { transform: translateY(-1px); box-shadow: var(--shadow-soft); }
.btn-primary { background: var(--navy); color: white; }
.btn-primary:hover { background: #07172b; }
.btn-gold { background: linear-gradient(135deg, var(--gold), var(--gold-2)); color: #101828; }
.btn-outline { background: white; border-color: var(--line); color: var(--navy); }
.btn-light { background: rgba(255,255,255,0.13); color: white; border-color: rgba(255,255,255,0.22); }
.btn-danger { background: var(--danger); color: white; }
.btn-archive { background: #2f3541; border-color: #596273; color: #f8fafc; }
.btn-archive:hover { background: #171b22; color: #ffffff; }
.btn-sm { padding: 8px 12px; min-height: 34px; font-size: 13px; }

.portal-confirm-overlay {
  position: fixed;
  inset: 0;
  z-index: 9999;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 20px;
  background: rgba(2, 6, 23, 0.72);
}
.portal-confirm-box {
  width: min(420px, 100%);
  border-radius: 22px;
  border: 1px solid rgba(148, 163, 184, 0.35);
  background: #ffffff;
  color: #111827;
  box-shadow: 0 24px 70px rgba(0,0,0,0.35);
  padding: 22px;
}
.portal-confirm-box p {
  margin: 0 0 18px;
  font-size: 18px;
  font-weight: 800;
  line-height: 1.35;
}
.portal-confirm-actions {
  display: flex;
  gap: 10px;
  justify-content: flex-end;
  flex-wrap: wrap;
}
body.admin-body.portal-dark .portal-confirm-box {
  background: #0f1f35;
  color: #f8fafc;
  border-color: #3a516f;
}
@media (max-width: 720px) {
  .portal-confirm-actions .btn { width: 100%; }
}
.hero {
  position: relative; overflow: hidden;
  background: radial-gradient(circle at 75% 10%, rgba(198,154,59,0.26), transparent 32%), linear-gradient(135deg, #08172a 0%, #102846 54%, #173b63 100%);
  color: white;
  padding: 78px 0 58px;
}
.hero:before {
  content: ""; position: absolute; inset: 0;
  background-image: linear-gradient(rgba(255,255,255,0.06) 1px, transparent 1px), linear-gradient(90deg, rgba(255,255,255,0.04) 1px, transparent 1px);
  background-size: 58px 58px;
  mask-image: linear-gradient(to bottom, rgba(0,0,0,0.75), transparent 78%);
}
.hero-grid { position: relative; display: grid; grid-template-columns: 1.15fr .85fr; gap: 42px; align-items: center; }
.eyebrow { display: inline-flex; align-items: center; gap: 8px; color: #f7dd9d; font-size: 13px; font-weight: 800; letter-spacing: .06em; text-transform: uppercase; }
.eyebrow:before { content: ""; width: 32px; height: 2px; background: var(--gold-2); display: inline-block; }
h1, h2, h3, p { margin-top: 0; }
h1 { font-size: clamp(42px, 6vw, 76px); line-height: .96; letter-spacing: -0.06em; margin: 18px 0 20px; }
.hero-lede { font-size: clamp(18px, 2.1vw, 22px); color: #d9e3ef; max-width: 760px; }
.hero-actions { display: flex; flex-wrap: wrap; gap: 12px; margin: 30px 0 22px; }
.trust-row { display: flex; flex-wrap: wrap; gap: 10px; }
.pill { display: inline-flex; align-items: center; gap: 7px; padding: 7px 10px; border-radius: 999px; font-size: 12px; font-weight: 750; border: 1px solid rgba(255,255,255,0.18); background: rgba(255,255,255,0.09); color: #edf5ff; }
.pill.dark { color: var(--navy); background: #f5f7fa; border-color: var(--line); }
.pill.ok { color: #075e3a; background: #eaf8f1; border-color: #c4ead8; }
.pill.warn { color: #7a4100; background: #fff4df; border-color: #f6d794; }
.hero-card {
  background: rgba(255,255,255,0.96);
  border: 1px solid rgba(255,255,255,0.55);
  border-radius: 28px;
  color: var(--ink);
  padding: 28px;
  box-shadow: 0 30px 80px rgba(0,0,0,0.22);
}
.hero-card-logo { width: 154px; margin-bottom: 20px; }
.hero-stat-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; margin-top: 22px; }
.stat-box { background: #f7f9fc; border: 1px solid var(--soft-line); border-radius: 16px; padding: 14px; }
.stat-box strong { display: block; font-size: 24px; color: var(--navy); letter-spacing: -0.04em; }
.stat-box span { color: var(--muted); font-size: 12px; font-weight: 700; }
.section { padding: 74px 0; }
.section-tight { padding: 46px 0; }
.section-white { background: white; }
.section-head { display: flex; justify-content: space-between; gap: 28px; align-items: end; margin-bottom: 28px; }
.section-kicker { color: var(--gold); font-weight: 850; text-transform: uppercase; letter-spacing: .08em; font-size: 12px; margin-bottom: 9px; }
h2 { font-size: clamp(30px, 4vw, 48px); line-height: 1.05; letter-spacing: -0.045em; color: var(--navy); margin-bottom: 12px; }
.section-lede { color: var(--muted); font-size: 17px; max-width: 780px; }
.grid { display: grid; gap: 18px; }
.grid-2 { grid-template-columns: repeat(2, minmax(0,1fr)); }
.grid-3 { grid-template-columns: repeat(3, minmax(0,1fr)); }
.grid-4 { grid-template-columns: repeat(4, minmax(0,1fr)); }
.card {
  background: var(--paper);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 24px;
  box-shadow: var(--shadow-soft);
}
.card h3 { color: var(--navy); margin-bottom: 8px; letter-spacing: -0.02em; }
.card p, .muted { color: var(--muted); }
.icon-mark {
  width: 42px; height: 42px; border-radius: 14px;
  background: linear-gradient(135deg, rgba(198,154,59,.18), rgba(16,40,70,.08));
  border: 1px solid var(--soft-line);
  display: inline-flex; align-items: center; justify-content: center;
  color: var(--navy); font-weight: 900; margin-bottom: 16px;
}
.clean-list { list-style: none; padding: 0; margin: 14px 0 0; display: grid; gap: 8px; }
.clean-list li { position: relative; padding-left: 20px; color: #344054; }
.clean-list li:before { content: ""; position: absolute; left: 0; top: .65em; width: 7px; height: 7px; border-radius: 99px; background: var(--gold); }
.split-panel {
  display: grid; grid-template-columns: .95fr 1.05fr; gap: 28px; align-items: stretch;
}
.readiness-panel { background: var(--navy); color: white; border-radius: 28px; padding: 32px; box-shadow: var(--shadow); }
.readiness-panel h2 { color: white; }
.readiness-panel .section-lede { color: #d3e1f2; }
.data-list { display: grid; gap: 10px; margin-top: 22px; }
.data-row { display: grid; grid-template-columns: 190px 1fr; gap: 10px; padding: 12px 0; border-bottom: 1px solid rgba(255,255,255,0.12); }
.data-row span:first-child { color: #b7c8dc; font-weight: 750; }
.notice-box {
  padding: 16px 18px; border-radius: 16px;
  background: #fff8e8; border: 1px solid #f3d48d; color: #684200;
}
.form-panel { background: white; border: 1px solid var(--line); border-radius: 24px; padding: 24px; box-shadow: var(--shadow-soft); }
.form-grid { display: grid; grid-template-columns: repeat(2, minmax(0,1fr)); gap: 14px; }
.form-row { display: grid; gap: 7px; }
.form-row.full { grid-column: 1 / -1; }
label { font-size: 13px; font-weight: 850; color: #344054; }
input, select, textarea {
  width: 100%; border: 1px solid #cfd8e3; border-radius: 12px; padding: 11px 12px;
  background: #fff; color: var(--ink); outline: none; transition: border-color .16s ease, box-shadow .16s ease;
}
textarea { min-height: 108px; resize: vertical; }
input:focus, select:focus, textarea:focus { border-color: var(--navy-3); box-shadow: 0 0 0 4px rgba(23,59,99,0.12); }
.checkbox-grid { display: grid; grid-template-columns: repeat(2, minmax(0,1fr)); gap: 8px; }
.check-card { display: flex; gap: 9px; align-items: center; border: 1px solid var(--line); padding: 10px; border-radius: 12px; color: #344054; font-weight: 650; }
.check-card input { width: auto; }
.footer { background: #07172b; color: #d8e5f5; padding: 36px 0; }
.footer-grid { display: grid; grid-template-columns: 1.2fr .8fr .8fr; gap: 24px; align-items: start; }
.footer a { color: white; font-weight: 700; }
.footer .brand-title { color: white; }
.admin-body { background: #f5f7fa; overflow-x: hidden; }
.portal-shell { min-height: 100vh; display: grid; grid-template-columns: 282px minmax(0, 1fr); max-width: 100%; overflow-x: hidden; }
.sidebar {
  position: sticky; top: 0; height: 100vh; overflow-y: auto;
  background: #07172b; color: #dbe8f5; padding: 22px 16px;
  border-right: 1px solid rgba(255,255,255,0.08);
}
.sidebar .brand { margin-bottom: 22px; min-width: 0; }
.sidebar .brand img { width: 50px; height: 50px; background: rgba(255,255,255,0.92); border-radius: 14px; padding: 4px; }
.sidebar .brand-title { color: white; }
.sidebar .brand-sub { color: #9fb2cb; }
.side-nav { display: grid; gap: 6px; }
.side-nav a {
  display: flex; align-items: center; justify-content: space-between;
  padding: 10px 12px; border-radius: 12px; color: #dbe8f5; font-weight: 700; font-size: 14px;
}
.side-nav a:hover, .side-nav a.active { background: rgba(255,255,255,0.10); color: white; }
.main { min-width: 0; }
.topbar {
  min-height: 72px; display: flex; align-items: center; justify-content: space-between; gap: 20px;
  background: rgba(255,255,255,0.96); border-bottom: 1px solid var(--line); padding: 0 28px; position: sticky; top: 0; z-index: 40;
  min-width: 0;
}
.topbar h1 { color: var(--navy); font-size: 26px; line-height: 1.1; margin: 0; letter-spacing: -0.04em; }
.topbar-user { color: var(--muted); font-size: 13px; font-weight: 750; }
.content { padding: 28px; min-width: 0; max-width: 100%; overflow-x: hidden; }
.kpi-grid { display: grid; grid-template-columns: repeat(4, minmax(0,1fr)); gap: 16px; margin-bottom: 18px; }
.kpi { background: white; border: 1px solid var(--line); border-radius: 18px; padding: 18px; box-shadow: var(--shadow-soft); }
.kpi .num { font-size: 34px; font-weight: 900; letter-spacing: -0.05em; color: var(--navy); }
.kpi .label { color: var(--muted); font-size: 12px; font-weight: 850; text-transform: uppercase; letter-spacing: .05em; }
.toolbar { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-bottom: 18px; flex-wrap: wrap; }
.table-wrap { max-width: 100%; overflow-x: auto; border: 1px solid var(--line); border-radius: 18px; background: white; box-shadow: var(--shadow-soft); }
table { width: 100%; border-collapse: collapse; min-width: 720px; }
th, td { padding: 12px 14px; border-bottom: 1px solid var(--soft-line); text-align: left; vertical-align: top; }
th { color: #475467; background: #f8fafc; font-size: 12px; text-transform: uppercase; letter-spacing: .05em; }
td { font-size: 14px; }
tr:last-child td { border-bottom: 0; }
@media (max-width: 640px) {
  .data-table {
    overflow-x: visible;
  }
  .data-table table,
  .data-table thead,
  .data-table tbody,
  .data-table tr,
  .data-table td {
    display: block;
    width: 100%;
    min-width: 0;
  }
  .data-table thead {
    position: absolute;
    width: 1px;
    height: 1px;
    overflow: hidden;
    clip: rect(0 0 0 0);
    white-space: nowrap;
  }
  .data-table tbody tr {
    padding: 10px 12px;
    border-bottom: 1px solid var(--line);
  }
  .data-table tbody tr:last-child {
    border-bottom: 0;
  }
  .data-table td {
    padding: 8px 0;
    border-bottom: 0;
  }
  .data-table td::before {
    content: attr(data-label);
    display: block;
    margin-bottom: 3px;
    color: var(--muted);
    font-size: 10px;
    font-weight: 850;
    text-transform: uppercase;
    letter-spacing: 0;
  }
  .data-table td.record-cell::before {
    display: none;
  }
  .data-table td.select-cell::before {
    display: none;
  }
  .data-table td.record-cell {
    padding-top: 10px;
    padding-bottom: 12px;
  }
  .data-table td.select-cell {
    display: flex;
    align-items: center;
    gap: 10px;
  }
  .data-table td.action-cell form,
  .data-table td.action-cell .btn {
    width: 100%;
  }
  .data-table td.action-cell .btn {
    min-height: 42px;
    white-space: normal;
  }
  #scanner-intake-queue .collapsed-panel-body {
    padding-left: 10px;
    padding-right: 10px;
  }
  #scanner-intake-queue .data-table tbody tr {
    padding-left: 8px;
    padding-right: 8px;
  }
}
.empty-state {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  padding: 16px;
  border: 1px solid var(--line);
  border-radius: 14px;
  background: #fbfcfe;
}
.empty-state strong { display: block; color: var(--navy); }
.empty-state p { margin: 4px 0 0; }
.status { display: inline-flex; align-items: center; border-radius: 999px; padding: 5px 9px; font-size: 12px; font-weight: 850; background: #eef2f6; color: #344054; white-space: nowrap; }
.status.open, .status.found, .status.reviewing, .status.submitted { background: #eaf1ff; color: #175cd3; }
.status.awarded, .status.active, .status.paid, .status.done, .status.completed, .status.preferred { background: #eaf8f1; color: #067647; }
.status.lost, .status.cancelled, .status.overdue, .status.danger, .status.do-not-use { background: #fff0ee; color: #b42318; }
.status.waiting, .status.pending, .status.due { background: #fff7e6; color: #9b5a00; }
.panel { background: white; border: 1px solid var(--line); border-radius: 20px; padding: 22px; box-shadow: var(--shadow-soft); margin-bottom: 18px; }
.panel h2 { font-size: 24px; margin-bottom: 14px; }
.panel h3 { margin: 0 0 10px; color: var(--navy); }
.detail-grid { display: grid; grid-template-columns: repeat(2, minmax(0,1fr)); gap: 12px; }
.detail { background: #f8fafc; border: 1px solid var(--soft-line); border-radius: 14px; padding: 12px; }
.detail .label { color: var(--muted); font-size: 12px; font-weight: 850; text-transform: uppercase; letter-spacing: .05em; }
.detail .value { margin-top: 4px; color: var(--ink); font-weight: 750; overflow-wrap: anywhere; }
.action-list { display: grid; gap: 10px; }
.action-item { display: flex; gap: 12px; align-items: flex-start; justify-content: space-between; padding: 12px; border: 1px solid var(--soft-line); border-radius: 14px; background: #fbfcfe; }
.action-item strong { color: var(--navy); }
.login-wrap { min-height: 100vh; display: grid; place-items: center; padding: 30px; background: radial-gradient(circle at 20% 10%, rgba(198,154,59,.22), transparent 35%), linear-gradient(135deg, #07172b, #102846); }
.login-card { width: min(460px, 100%); background: white; border-radius: 24px; padding: 30px; box-shadow: 0 30px 80px rgba(0,0,0,.25); }
.login-logo { width: 130px; margin: 0 auto 18px; }
.alert { border-radius: 14px; padding: 13px 14px; margin-bottom: 16px; font-weight: 700; }
.alert.info { background: #eaf1ff; color: #175cd3; border: 1px solid #c7d7fe; }
.alert.success { background: #ecfdf3; color: #067647; border: 1px solid #abefc6; }
.alert.warn { background: #fff7e6; color: #9b5a00; border: 1px solid #fedf89; }
.alert.danger { background: #fff0ee; color: #b42318; border: 1px solid #fecdca; }
.link { color: var(--info); font-weight: 850; text-decoration: underline; text-underline-offset: 3px; }
.record-open-card {
  position: relative;
  display: grid;
  gap: 5px;
  min-width: min(100%, 260px);
  padding: 13px 92px 13px 14px;
  border: 1px solid rgba(37, 99, 235, .22);
  border-radius: 14px;
  background: linear-gradient(135deg, #f8fbff, #eef5ff);
  color: var(--navy);
  text-decoration: none;
  box-shadow: 0 10px 24px rgba(15, 35, 66, .08);
}
.record-open-card:hover {
  border-color: rgba(37, 99, 235, .42);
  box-shadow: 0 14px 32px rgba(15, 35, 66, .12);
  transform: translateY(-1px);
}
.record-summary-card {
  width: 100%;
  cursor: pointer;
}
.record-summary-card:hover {
  transform: none;
}
.record-open-title {
  color: inherit;
  font-weight: 950;
  line-height: 1.2;
}
.record-open-meta {
  color: var(--muted);
  font-size: 12px;
  font-weight: 750;
  line-height: 1.35;
}
.record-open-action {
  position: absolute;
  top: 50%;
  right: 12px;
  transform: translateY(-50%);
  max-width: 76px;
  border: 1px solid rgba(37, 99, 235, .28);
  border-radius: 999px;
  padding: 6px 9px;
  background: #ffffff;
  color: #175cd3;
  font-size: 10px;
  font-weight: 950;
  line-height: 1.05;
  text-align: center;
  white-space: normal;
}
.record-open-card-opportunity {
  border-color: rgba(52, 211, 153, .34);
  background: linear-gradient(135deg, #f2fdf8, #eafaf2);
}
.record-open-card-opportunity .record-open-action {
  border-color: rgba(6, 118, 71, .24);
  color: #067647;
}
.record-open-card-job {
  border-color: rgba(34, 197, 94, .32);
  background: linear-gradient(135deg, #f3fdf5, #ecfbef);
}
.record-open-card-job .record-open-action {
  border-color: rgba(6, 118, 71, .24);
  color: #067647;
}
.record-open-card-message,
.record-open-card-message-unread {
  border-color: rgba(167, 139, 250, .34);
  background: linear-gradient(135deg, #f8f5ff, #eef4ff);
}
.record-open-card-message-unread {
  border-color: rgba(251, 113, 133, .46);
  background: linear-gradient(135deg, #fff5f7, #f2f0ff);
}
.record-open-card-message .record-open-action,
.record-open-card-message-unread .record-open-action {
  border-color: rgba(124, 58, 237, .24);
  color: #5b21b6;
}
.record-open-card-scanner {
  border-color: rgba(14, 165, 233, .34);
  background: linear-gradient(135deg, #f3fbff, #edf8ff);
}
.record-open-card-scanner .record-open-action {
  border-color: rgba(2, 132, 199, .24);
  color: #0369a1;
}
.record-open-card-connector-healthy {
  border-color: rgba(52, 211, 153, .34);
  background: linear-gradient(135deg, #f2fdf8, #ecfbef);
}
.record-open-card-connector-work,
.record-open-card-connector-warn {
  border-color: rgba(251, 191, 36, .42);
  background: linear-gradient(135deg, #fffaf0, #fff4df);
}
.record-open-card-connector-danger {
  border-color: rgba(248, 113, 113, .5);
  background: linear-gradient(135deg, #fff5f5, #fff0ee);
}
.record-open-card-connector-neutral {
  border-color: rgba(148, 163, 184, .42);
  background: linear-gradient(135deg, #f8fafc, #eef2f6);
}
.connector-toggle-action::before {
  content: "View";
}
.connector-record-panel[open] .connector-toggle-action::before {
  content: "Collapse";
}
.record-summary-card .connector-toggle-action {
  max-width: none;
  min-width: 78px;
  white-space: nowrap;
}
.scanner-result-facts {
  display: flex;
  flex-wrap: wrap;
  gap: 7px;
  margin-top: 8px;
}
.scanner-result-facts span {
  display: inline-flex;
  align-items: center;
  border: 1px solid var(--line);
  border-radius: 999px;
  padding: 5px 8px;
  color: var(--muted);
  font-size: 12px;
  font-weight: 800;
  line-height: 1.1;
}
.scanner-result-stack {
  display: grid;
  gap: 4px;
}
.scanner-result-actions,
.connector-card-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  align-items: center;
}
.scanner-result-award {
  margin-top: 8px;
}
.connector-category-body {
  display: grid;
  gap: 12px;
  padding: 12px 0 0;
}
.connector-record-panel {
  margin: 0;
}
.connector-record-panel > summary {
  list-style: none;
  padding: 0;
}
.connector-record-panel > summary::-webkit-details-marker {
  display: none;
}
.connector-card-body {
  display: grid;
  gap: 12px;
  padding: 12px 2px 2px;
}
.connector-notes {
  margin-top: 0;
}
.mini { font-size: 12px; color: var(--muted); }
.codebox { font-family: ui-monospace, SFMono-Regular, Menlo, monospace; font-size: 13px; background: #0b1d35; color: white; border-radius: 12px; padding: 12px; overflow-x: auto; }
.progress-bar { height: 10px; background: #edf1f5; border-radius: 999px; overflow: hidden; }
.progress-bar span { display: block; height: 100%; background: linear-gradient(90deg, var(--navy-3), var(--gold)); }
.public-thanks { min-height: 100vh; display: grid; place-items: center; padding: 30px; background: var(--bg); }
.public-thanks .card { max-width: 660px; text-align: center; }
@media (max-width: 1040px) {
  .nav { display: none; }
  .header-actions { display: none; }
  .mobile-nav-toggle { display: inline-flex; }
  .header-inner { gap: 14px; }
  .brand { min-width: 0; }
  .hero-grid, .split-panel { grid-template-columns: 1fr; }
  .grid-4, .kpi-grid { grid-template-columns: repeat(2, minmax(0,1fr)); }
  .portal-shell { grid-template-columns: 1fr; }
  .sidebar { position: static; height: auto; }
  .side-nav { grid-template-columns: repeat(2, minmax(0,1fr)); }
}
@media (max-width: 720px) {
  .container { width: min(100% - 24px, var(--max)); }
  .header-inner { min-height: 66px; gap: 8px; }
  .brand img { width: 42px; height: 42px; }
  .brand-sub { display: none; }
  .brand-copy { max-width: 170px; }
  .brand-title { white-space: normal; overflow: visible; text-overflow: clip; }
  .brand-title-full { display: block; font-size: 14px; line-height: 1.05; }
  .site-header .brand-title-short { display: none !important; }
  .mobile-nav-toggle { padding: 9px 12px; min-height: 38px; font-size: 13px; }
  .mobile-nav-actions .btn { flex: 1 1 150px; }
  .hero { padding: 56px 0 42px; }
  .section { padding: 48px 0; }
  .section-head { display: block; }
  .grid-2, .grid-3, .grid-4, .kpi-grid, .form-grid, .detail-grid, .footer-grid { grid-template-columns: 1fr; }
  .checkbox-grid { grid-template-columns: 1fr; }
  .data-row { grid-template-columns: 1fr; }
  .topbar { padding: 0 16px; }
  .content { padding: 18px; }
  .side-nav { grid-template-columns: 1fr; }
  .empty-state { display: grid; }
  .empty-state .btn { width: 100%; }
  .btn { max-width: 100%; white-space: normal; text-align: center; }
  .mobile-command-item, .quick-grid a { min-width: 0; overflow-wrap: anywhere; }
  .mobile-command-item strong, .mobile-command-metric strong { overflow-wrap: anywhere; }
}
@media (max-width: 420px) {
  .header-inner { min-height: 62px; gap: 6px; }
  .brand img { width: 38px; height: 38px; }
  .brand-copy { max-width: 145px; }
  .brand-title-full { font-size: 12px; line-height: 1.05; }
  .mobile-nav-toggle { padding: 8px 10px; min-height: 36px; font-size: 12px; }
}
@media print {
  .site-header, .sidebar, .topbar, .btn, .toolbar { display: none !important; }
  body, .admin-body { background: white; }
  .portal-shell { display: block; }
  .content { padding: 0; }
  .panel, .card, .table-wrap { box-shadow: none; break-inside: avoid; }
}

/* Phase intelligence import/export workflow */
.phase-panel { border-color: rgba(198,154,59,.35); background: linear-gradient(180deg, #ffffff, #fbfcff); }
.import-box { border: 1px dashed rgba(15, 35, 66, .25); border-radius: 16px; padding: 14px; margin: 12px 0 18px; background: #f8fafc; }
.import-box > summary { list-style: none; }
.import-box > summary::-webkit-details-marker { display: none; }
.phase-tabs { display: grid; gap: 12px; }
.phase-tabs > details { border: 1px solid var(--soft-line); border-radius: 16px; background: #fff; overflow: hidden; }
.phase-tabs > details > summary { cursor: pointer; padding: 14px 16px; font-weight: 900; color: var(--navy); background: #f8fafc; border-bottom: 1px solid var(--soft-line); }
.phase-card { padding: 16px; display: grid; gap: 14px; }
.phase-summary { border: 1px solid rgba(198,154,59,.28); background: #fffaf0; border-radius: 14px; padding: 13px 14px; }
.phase-summary p { margin: 6px 0 0; color: var(--ink); font-weight: 650; }
.phase-grid { align-items: start; }
.phase-mini-block { border: 1px solid var(--soft-line); background: #fbfcfe; border-radius: 14px; padding: 12px; }
.phase-mini-block strong { color: var(--navy); }
.phase-mini-block ul { margin-top: 8px; }
.raw-details { border: 1px solid var(--soft-line); border-radius: 14px; background: #f8fafc; padding: 10px 12px; }
.raw-details summary { cursor: pointer; font-weight: 850; color: var(--navy); }
.raw-details pre { white-space: pre-wrap; overflow-wrap: anywhere; margin: 12px 0 0; max-height: 420px; overflow: auto; font-size: 12px; }
@media (max-width: 720px) {
  .phase-card { padding: 12px; }
  .phase-panel .toolbar { display: block; }
  .phase-panel .toolbar .btn { margin: 4px 4px 4px 0; }
}

/* v3_23: opportunity detail AI/readability polish */
.phase-panel {
  border: 1px solid rgba(37, 99, 235, 0.22);
  box-shadow: 0 18px 42px rgba(15, 23, 42, 0.08);
}
.phase-panel h2 {
  color: #0f2a54;
}
.phase-ai-status {
  display: flex;
  flex-direction: column;
  gap: 4px;
  align-items: flex-end;
}
.auto-collapsed-panel {
  margin: 0;
}
.auto-collapsed-summary {
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  list-style: none;
}
.auto-collapsed-summary::-webkit-details-marker {
  display: none;
}
.auto-collapsed-summary h2,
.auto-collapsed-summary h3 {
  margin: 0;
}
.auto-collapsed-panel[open] .auto-collapsed-summary {
  padding-bottom: 14px;
  margin-bottom: 14px;
  border-bottom: 1px solid rgba(148, 163, 184, 0.28);
}
@media (max-width: 760px) {
  .phase-ai-status { align-items: flex-start; }
}

/* v1_61: opportunity detail brief and phase digest */
.opportunity-detail-toolbar {
  align-items: center;
  gap: 10px;
}
.opportunity-detail-toolbar form {
  margin: 0;
}
.opportunity-brief-panel {
  border-color: rgba(45, 95, 150, .22);
  background: linear-gradient(180deg, #ffffff, #f8fbff);
}
.opportunity-brief-header {
  align-items: flex-start;
  gap: 16px;
}
.opportunity-brief-header h1 {
  margin: 0;
  font-size: clamp(28px, 4vw, 46px);
  line-height: 1.05;
  letter-spacing: 0;
  color: var(--navy);
}
.opportunity-brief-header .eyebrow {
  margin: 0 0 8px;
  font-weight: 900;
  letter-spacing: 0;
  text-transform: uppercase;
  color: #2b5f96;
}
.brief-badges,
.brief-actions {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
  align-items: center;
}
.brief-badges {
  margin-top: 12px;
}
.brief-actions {
  justify-content: flex-end;
}
.opportunity-brief-overview {
  margin-top: 16px;
  border: 1px solid var(--soft-line);
  border-radius: 16px;
  padding: 16px;
  background: #f8fafc;
}
.opportunity-brief-overview h2 {
  margin: 0 0 8px;
  font-size: 20px;
}
.opportunity-brief-overview p {
  margin: 0;
  font-size: 16px;
  line-height: 1.55;
  color: var(--ink);
  font-weight: 650;
}
.opportunity-source-line {
  margin-top: 12px;
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
  align-items: center;
  padding: 10px 12px;
  border: 1px solid rgba(198, 154, 59, .32);
  border-radius: 14px;
  background: #fffaf0;
}
.opportunity-source-line span {
  text-transform: uppercase;
  font-size: 11px;
  font-weight: 900;
  color: #7c5a12;
  letter-spacing: 0;
}
.opportunity-source-line em {
  font-style: normal;
  color: var(--muted);
  font-weight: 750;
}
.opportunity-brief-grid {
  margin-top: 16px;
}
.opportunity-next-action {
  margin-top: 16px;
}
.opportunity-phase-digest {
  border-color: rgba(14, 116, 144, .22);
  background: linear-gradient(180deg, #ffffff, #f7fcff);
}
.phase-important-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
  gap: 14px;
}
.phase-important-card {
  border: 1px solid var(--soft-line);
  border-radius: 16px;
  padding: 16px;
  background: #fbfcfe;
  display: grid;
  gap: 12px;
}
.phase-important-card h3 {
  margin: 0;
}
.phase-card-summary {
  margin: 0;
  font-weight: 650;
  line-height: 1.5;
  color: var(--ink);
}
.compact-detail-grid {
  grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
}
.existing-phase-tabs {
  margin-top: 14px;
}
@media (max-width: 720px) {
  .opportunity-detail-toolbar,
  .opportunity-brief-header {
    display: grid;
    grid-template-columns: 1fr;
  }
  .brief-actions,
  .opportunity-detail-toolbar {
    justify-content: stretch;
  }
  .brief-actions .btn,
  .opportunity-detail-toolbar .btn,
  .opportunity-detail-toolbar form,
  .opportunity-detail-toolbar form .btn {
    width: 100%;
  }
  .opportunity-brief-header h1 {
    font-size: 30px;
  }
}

/* v3_24: sidebar consolidation / nested sections */
.side-group {
  border-radius: 12px;
  overflow: hidden;
}
.side-group > summary {
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 10px 12px;
  border-radius: 12px;
  color: #dbe8f5;
  font-weight: 800;
  font-size: 14px;
  list-style: none;
}
.side-group > summary::-webkit-details-marker { display: none; }
.side-group > summary::after { content: '▾'; opacity: .72; font-size: 11px; }
.side-group:not([open]) > summary::after { content: '▸'; }
.side-group > summary:hover,
.side-group.active > summary { background: rgba(255,255,255,0.10); color: #fff; }
.side-group > div { display: grid; gap: 4px; padding: 4px 0 4px 10px; }
.side-group > div a { font-size: 13px; padding: 8px 10px; border-radius: 10px; color: #c9d7e8; }
.side-group > div a::before { content: '•'; opacity: .6; margin-right: 6px; }
.opportunity-overview-card { border-color: rgba(15, 35, 66, .12); }
.opportunity-overview-card .overview-text { font-size: 15px; line-height: 1.55; color: var(--ink); font-weight: 650; }

/* v3_26 compact opportunity layout + clearer embedded parent sections */
.collapsed-panel {
  padding: 0;
  overflow: hidden;
}
.collapsed-panel-summary {
  cursor: pointer;
  list-style: none;
  padding: 18px 22px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  background: #ffffff;
}
.collapsed-panel-summary::-webkit-details-marker { display: none; }
.collapsed-panel-summary::after {
  content: 'Open';
  flex: 0 0 auto;
  border: 1px solid rgba(15, 35, 66, .14);
  border-radius: 999px;
  padding: 6px 10px;
  font-size: 12px;
  font-weight: 900;
  color: var(--navy);
  background: #f8fafc;
}
.collapsed-panel[open] > .collapsed-panel-summary::after { content: 'Close'; }
.collapsed-panel-summary h2 {
  margin: 0;
  font-size: 24px;
  color: var(--navy);
}
.collapsed-summary-note {
  margin-left: auto;
  color: var(--muted);
  font-size: 13px;
  font-weight: 850;
}
.collapsed-panel-body {
  padding: 0 22px 22px;
  border-top: 1px solid rgba(148, 163, 184, .28);
}
.collapsed-panel .inner-panel {
  box-shadow: none;
  margin-bottom: 0;
}
.compact-add-panel .collapsed-panel-summary h2,
.embedded-section > summary {
  font-size: 20px;
  font-weight: 950;
  color: var(--navy);
}
.embedded-section {
  padding: 0;
  overflow: hidden;
  background: #fff;
}
.embedded-section > summary {
  padding: 16px 18px;
  background: #f8fafc;
  border-radius: 14px;
}
.embedded-section[open] > summary {
  border-bottom-left-radius: 0;
  border-bottom-right-radius: 0;
  border-bottom: 1px solid rgba(148, 163, 184, .28);
}
.phase-panel.collapsed-panel {
  border: 1px solid rgba(37, 99, 235, 0.22);
}
.phase-panel .collapsed-panel-summary h2 {
  color: #0f2a54;
}
.go-no-go-collapsed {
  border-color: rgba(198,154,59,.35);
}
@media (max-width: 720px) {
  .collapsed-panel-summary { padding: 16px; align-items: flex-start; }
  .collapsed-panel-summary h2 { font-size: 20px; }
  .collapsed-summary-note { display: none; }
  .collapsed-panel-body { padding: 0 16px 16px; }
}

/* v3_27: compact settings/system sections, clearer embedded headers, and analytics visuals */
.embedded-section > summary {
  font-size: 22px;
  font-weight: 950;
  letter-spacing: -0.01em;
}
.embedded-section .embedded-section-title {
  font-size: 22px;
  font-weight: 950;
}
.analytics-visual-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 18px;
  margin-top: 18px;
}
.analytics-chart {
  background: #fff;
  border: 1px solid rgba(148, 163, 184, .28);
  border-radius: 18px;
  padding: 18px;
  box-shadow: 0 10px 28px rgba(15, 35, 66, .06);
}
.analytics-chart h3 {
  margin: 0 0 4px;
  font-size: 18px;
  color: var(--navy);
}
.analytics-chart .chart-note {
  margin: 0 0 14px;
  color: var(--muted);
  font-size: 13px;
}
.bar-row {
  display: grid;
  grid-template-columns: 92px 1fr 90px;
  align-items: center;
  gap: 10px;
  margin: 10px 0;
}
.bar-row .bar-label {
  font-size: 12px;
  color: var(--muted);
  font-weight: 850;
}
.bar-track {
  height: 14px;
  border-radius: 999px;
  background: #edf2f7;
  overflow: hidden;
  border: 1px solid rgba(148, 163, 184, .24);
}
.bar-fill {
  display: block;
  height: 100%;
  width: 0%;
  border-radius: 999px;
  background: linear-gradient(90deg, #0f2a54, #2f80ed);
}
.bar-fill.alt {
  background: linear-gradient(90deg, #9a6b12, #d6a63c);
}
.bar-row .bar-value {
  font-size: 12px;
  font-weight: 900;
  color: var(--navy);
  text-align: right;
}
.money-month {
  padding: 10px 0;
  border-bottom: 1px solid rgba(148, 163, 184, .18);
}
.money-month:last-child { border-bottom: 0; }
.money-month-title {
  font-size: 13px;
  font-weight: 950;
  color: var(--navy);
  margin-bottom: 6px;
}
.sub-directory-search {
  align-items: end;
}
.sub-directory-search label {
  font-size: 13px;
  font-weight: 900;
  color: var(--navy);
}
@media (max-width: 900px) {
  .analytics-visual-grid { grid-template-columns: 1fr; }
  .bar-row { grid-template-columns: 72px 1fr 76px; }
}

/* v3_29 actual analytics graph rendering */
.chart-svg-wrap {
  width: 100%;
  min-height: 230px;
  margin: 10px 0 12px;
  border: 1px solid rgba(148, 163, 184, .22);
  border-radius: 18px;
  overflow: hidden;
  background: #f8fafc;
}
.analytics-svg {
  display: block;
  width: 100%;
  height: 260px;
}
.analytics-chart .table-wrap {
  margin-top: 12px;
}
.payments-overview,
.payments-command {
  border-left: 5px solid #22c55e;
}
.payments-overview .kpi,
.payments-command .kpi {
  min-width: 0;
}
.payments-chart-panel .chart-svg-wrap {
  min-height: 220px;
}
.payments-chart-panel .analytics-svg {
  height: 235px;
}
.payments-breakdown .table-wrap,
.payments-command + .grid .table-wrap {
  margin-top: 10px;
}
.payments-breakdown td,
.payments-breakdown th {
  vertical-align: top;
}
.payments-breakdown .status {
  white-space: normal;
}
@media (max-width: 720px) {
  .payments-chart-panel .analytics-svg {
    height: 215px;
  }
  .payments-breakdown .table-wrap {
    overflow-x: auto;
  }
}
.pie-chart-layout {
  display: grid;
  grid-template-columns: minmax(180px, 260px) minmax(0, 1fr);
  gap: 16px;
  align-items: center;
}
.analytics-pie-svg {
  width: 100%;
  max-width: 260px;
  height: auto;
  display: block;
}
.pie-legend {
  display: grid;
  gap: 8px;
}
.pie-legend-row {
  display: grid;
  grid-template-columns: 14px minmax(0, 1fr) auto;
  gap: 8px;
  align-items: center;
  font-size: 12px;
  color: var(--muted);
  font-weight: 800;
}
.pie-legend-row strong { color: var(--navy); white-space: nowrap; }
.pie-label { overflow-wrap: anywhere; }
.pie-swatch { width: 12px; height: 12px; border-radius: 4px; display: inline-block; box-shadow: 0 0 0 1px rgba(15, 35, 66, .12) inset; }
@media (max-width: 900px) {
  .analytics-svg { height: 230px; }
  .pie-chart-layout { grid-template-columns: 1fr; }
  .analytics-pie-svg { margin: 0 auto; }
}

/* v1_10: phone/tablet account menu */
.topbar-actions { display:flex; align-items:center; gap:10px; flex-wrap:wrap; justify-content:flex-end; }
.portal-mail-shortcut {
  position: relative;
  width: 44px;
  height: 44px;
  border-radius: 999px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  text-decoration: none;
  color: var(--navy);
  background: #fff;
  border: 1px solid rgba(10,31,68,0.18);
  box-shadow: 0 8px 22px rgba(15,23,42,0.10);
  flex: 0 0 44px;
}
.portal-mail-shortcut:hover,
.portal-mail-shortcut:focus-visible {
  color: #fff;
  background: var(--navy);
  outline: none;
}
.portal-mail-icon {
  font-size: 21px;
  line-height: 1;
  font-weight: 900;
}
.portal-mail-badge {
  position: absolute;
  top: -6px;
  right: -6px;
  min-width: 22px;
  height: 22px;
  padding: 0 6px;
  border-radius: 999px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  background: #b91c1c;
  color: #fff;
  border: 2px solid #fff;
  font-size: 12px;
  line-height: 1;
  font-weight: 900;
  box-shadow: 0 6px 16px rgba(127, 29, 29, .32);
}
.mobile-menu { display:none; position:relative; }
.mobile-menu > summary { list-style:none; cursor:pointer; border:1px solid rgba(10,31,68,0.18); border-radius:999px; padding:10px 14px; font-weight:850; color:var(--navy); background:white; box-shadow:0 8px 22px rgba(15,23,42,0.10); }
.mobile-menu > summary::-webkit-details-marker { display:none; }
.mobile-menu[open] > summary { background:var(--navy); color:white; }
  .mobile-menu nav { position:absolute; right:0; top:46px; z-index:50; min-width:245px; max-height:70vh; overflow:auto; display:grid; gap:6px; padding:10px; border-radius:18px; border:1px solid rgba(10,31,68,0.16); background:white; box-shadow:0 22px 60px rgba(15,23,42,0.24); }
  .mobile-menu nav a { display:block; padding:11px 12px; border-radius:12px; text-decoration:none; color:var(--navy); font-weight:800; background:#f8fafc; }
  .mobile-menu nav a.active, .mobile-menu nav a:hover { background:#eaf1ff; }
  .mobile-menu nav .side-group { background:#fff; border:1px solid rgba(15,35,66,.10); border-radius:14px; }
  .mobile-menu nav .side-group > summary { color:var(--navy); background:#f8fafc; border-radius:14px; padding:11px 12px; }
  .mobile-menu nav .side-group.active > summary,
  .mobile-menu nav .side-group > summary:hover { background:#eaf1ff; color:var(--navy); }
  .mobile-menu nav .side-group > div { padding:5px; }
  .mobile-menu nav .side-group > div a { color:var(--navy); background:#fff; font-size:13px; }
  .mobile-menu nav .side-group > div a::before { color:var(--gold); }
@media(max-width:900px){
  .portal-shell{display:block}
  .sidebar{display:none}
  .topbar{position:sticky;top:0;z-index:40;margin:0 -18px 18px;padding:12px 16px;border-radius:0;background:rgba(255,255,255,0.96);backdrop-filter:blur(10px)}
  .topbar h1{font-size:22px}
  .content{padding:18px}
  .mobile-menu{display:block}
  .topbar .portal-theme-toggle{display:none!important}
  .capability-link{display:none!important}
}

/* v1_12: mobile portal header refinement + scanner intake anchor stability */
.portal-mobile-top-row { display: contents; }
.portal-mobile-brand { display: none; }
.portal-title-row { min-width: 0; display:flex; align-items:center; justify-content:space-between; gap:18px; width:100%; }
.portal-title-row > div:first-child { min-width:0; }
.portal-command-search { display:flex; align-items:center; gap:8px; flex:0 1 520px; min-width:260px; }
.portal-command-search input { min-height:40px; border-radius:999px; padding:9px 14px; }
.portal-command-search .btn { min-height:40px; }
.command-search-page .form-grid { align-items:end; }
.owner-daily-brief-panel .inner-panel,
.opportunity-war-room .inner-panel,
.subcontractor-action-center .inner-panel,
.agency-crm-panel .inner-panel,
.document-intelligence-queue .inner-panel { background:#f8fafc; border:1px solid var(--soft-line); border-radius:16px; padding:14px; }
.opportunity-war-room { border-color:rgba(37,99,235,.24); background:linear-gradient(180deg,#ffffff,#f8fbff); }
.notification-digest-panel { border-color:rgba(198,154,59,.28); }
.guided-next-steps-panel { border-color:rgba(23,59,99,.18); }
#scanner-intake-queue { scroll-margin-top: 96px; }
#opportunity-tracker { scroll-margin-top: 96px; }
@media(max-width:900px){
  .topbar{
    display:grid;
    grid-template-columns:1fr;
    gap:10px;
    min-height:auto;
  }
  .portal-mobile-top-row{
    display:flex;
    align-items:center;
    justify-content:space-between;
    gap:12px;
    width:100%;
  }
  .portal-mobile-brand{
    display:flex;
    align-items:center;
    gap:12px;
    min-width:0;
    text-decoration:none;
    color:var(--navy);
    font-weight:900;
    font-size:28px;
    letter-spacing:0;
    line-height:1;
  }
  .portal-mobile-brand img{
    width:56px;
    height:56px;
    object-fit:contain;
  }
  .portal-title-row{
    width:100%;
    display:grid;
    gap:10px;
  }
  .portal-title-row h1{
    font-size:21px;
  }
  .portal-title-row .topbar-user{
    margin-top:2px;
  }
  .topbar-actions{
    flex:0 0 auto;
  }
  .portal-command-search{
    min-width:0;
    width:100%;
    display:grid;
    grid-template-columns:1fr auto;
  }
  .portal-command-search .btn{width:auto;}
  .mobile-menu nav{
    right:0;
  }
  #scanner-intake-queue { scroll-margin-top: 118px; }
}
@media(max-width:420px){
  .portal-mobile-brand{font-size:25px;gap:10px;}
  .portal-mobile-brand img{width:50px;height:50px;}
}

/* v1_33: end-to-end opportunity flight plan and action inbox */
.opportunity-flight-plan,
.submission-packet-builder,
.subcontractor-quote-room,
.outcome-closeout-panel,
.owner-process-control {
  border-color: rgba(29, 78, 216, .20);
  background: linear-gradient(180deg, #ffffff, #f8fbff);
}
.flight-plan-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
  gap: 10px;
  margin: 14px 0;
}
.flight-step {
  display: grid;
  grid-template-columns: auto 1fr;
  grid-template-rows: auto auto;
  gap: 4px 9px;
  min-height: 96px;
  padding: 12px;
  border: 1px solid rgba(148, 163, 184, .30);
  border-radius: 12px;
  background: #fff;
  color: var(--ink);
  box-shadow: 0 6px 18px rgba(15, 23, 42, .04);
}
.flight-step span {
  grid-row: 1 / span 2;
  width: 28px;
  height: 28px;
  border-radius: 999px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-weight: 900;
  font-size: 12px;
  background: #e5e7eb;
  color: #475467;
}
.flight-step strong {
  display: block;
  font-size: 13px;
  line-height: 1.2;
  color: var(--navy);
}
.flight-step em {
  display: block;
  font-style: normal;
  font-size: 12px;
  line-height: 1.35;
  color: var(--muted);
}
.flight-step.done {
  border-color: rgba(22, 117, 77, .24);
  background: #f0fdf4;
}
.flight-step.done span {
  background: #dcfce7;
  color: var(--ok);
}
.flight-step.current {
  border-color: rgba(198, 154, 59, .52);
  box-shadow: 0 10px 26px rgba(198, 154, 59, .14);
}
.flight-step.current span {
  background: var(--gold);
  color: #101828;
}
.flight-step.waiting {
  opacity: .86;
}
.submission-packet-builder .inner-panel,
.subcontractor-quote-room .inner-panel,
.outcome-closeout-panel .inner-panel,
.owner-process-control .inner-panel {
  background: #f8fafc;
  border: 1px solid rgba(148, 163, 184, .22);
  border-radius: 16px;
  padding: 14px;
}
.compact-inline-form {
  gap: 6px;
  align-items: end;
}
.compact-inline-form .form-row {
  min-width: 160px;
}
#opportunity-flight-plan,
#submission-packet-builder,
#subcontractor-quote-room,
#opportunity-outcome-closeout {
  scroll-margin-top: 96px;
}
@media(max-width:900px){
  .flight-plan-grid {
    grid-template-columns: 1fr;
  }
  .flight-step {
    min-height: auto;
  }
  #opportunity-flight-plan,
  #submission-packet-builder,
  #subcontractor-quote-room,
  #opportunity-outcome-closeout {
    scroll-margin-top: 118px;
  }
}

/* v1_32: subcontractor coverage directory and bid submission cockpit */
.sub-coverage-summary,
.top-sub-directory,
.candidate-staging-panel,
.sub-coverage-workbench,
.submission-cockpit {
  border-color: rgba(37, 99, 235, .18);
  background: linear-gradient(180deg, #ffffff, #f8fbff);
}
.submission-cockpit {
  border-color: rgba(198, 154, 59, .34);
}
.submission-cockpit .inner-panel,
.sub-coverage-workbench .inner-panel {
  background: #f8fafc;
  border: 1px solid rgba(148, 163, 184, .22);
  border-radius: 16px;
  padding: 14px;
}
.sub-directory-search {
  align-items: end;
}
.sub-directory-search select,
.sub-directory-search input {
  min-height: 42px;
}
.candidate-staging-panel .table-wrap,
.sub-coverage-workbench .table-wrap,
.submission-cockpit .table-wrap {
  margin-top: 12px;
}
#coverage-capabilities,
#submission-cockpit {
  scroll-margin-top: 96px;
}
@media(max-width:900px){
  .sub-directory-search {
    grid-template-columns: 1fr !important;
  }
  #coverage-capabilities,
  #submission-cockpit {
    scroll-margin-top: 118px;
  }
}

/* v1_52: portal command polish, default dark work area, readable mobile actions */
.nav-badge {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 22px;
  height: 22px;
  padding: 0 7px;
  border-radius: 999px;
  background: var(--danger);
  color: #fff;
  font-size: 11px;
  font-weight: 950;
  line-height: 1;
}
.side-nav a .nav-badge,
.mobile-menu nav a .nav-badge {
  margin-left: auto;
}
.kpi-link {
  color: inherit;
  text-decoration: none;
}
.kpi-link:hover {
  transform: translateY(-1px);
  box-shadow: var(--shadow);
}
.action-list.compact .action-item {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: center;
}
.action-list.compact .action-item .btn {
  min-width: 84px;
  white-space: nowrap;
  overflow-wrap: normal;
}
.collapsed-summary-actions {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  flex: 0 0 auto;
}
.collapsed-summary-form {
  margin: 0;
}
.collapsed-summary-note {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  flex-wrap: wrap;
}
.connector-category-panel {
  margin: 10px 0;
}

body.admin-body.portal-dark {
  --bg: #07111f;
  --paper: #0d1b2f;
  --ink: #edf4ff;
  --muted: #a9b8cc;
  --line: #263750;
  --soft-line: #1c2b42;
  --shadow-soft: 0 16px 40px rgba(0, 0, 0, .28);
  --shadow: 0 24px 70px rgba(0, 0, 0, .36);
  background: #07111f;
  color: #edf4ff;
}
body.admin-body.portal-dark .main,
body.admin-body.portal-dark .content {
  background: #07111f;
}
body.admin-body.portal-dark .topbar {
  background: rgba(8, 19, 35, .96);
  border-bottom-color: #25364f;
}
body.admin-body.portal-dark .portal-mail-shortcut {
  color: #f7fbff;
  background: #10243d;
  border-color: #2f4564;
  box-shadow: 0 10px 24px rgba(0, 0, 0, .26);
}
body.admin-body.portal-dark .portal-mail-shortcut:hover,
body.admin-body.portal-dark .portal-mail-shortcut:focus-visible {
  color: #07111f;
  background: #eccb66;
  border-color: #eccb66;
}
body.admin-body.portal-dark .portal-mail-badge {
  border-color: #07111f;
}
body.admin-body.portal-dark .topbar h1,
body.admin-body.portal-dark .portal-mobile-brand,
body.admin-body.portal-dark .panel h2,
body.admin-body.portal-dark .panel h3,
body.admin-body.portal-dark .kpi .num,
body.admin-body.portal-dark .action-item strong,
body.admin-body.portal-dark .empty-state strong,
body.admin-body.portal-dark .detail .value,
body.admin-body.portal-dark .raw-details summary,
body.admin-body.portal-dark .collapsed-panel-summary h2,
body.admin-body.portal-dark .dashboard-fold-summary h2,
body.admin-body.portal-dark label {
  color: #f5f8ff;
}
body.admin-body.portal-dark .topbar-user,
body.admin-body.portal-dark .muted,
body.admin-body.portal-dark .mini,
body.admin-body.portal-dark .detail .label,
body.admin-body.portal-dark .kpi .label,
body.admin-body.portal-dark .collapsed-summary-note {
  color: #a9b8cc;
}
body.admin-body.portal-dark .panel,
body.admin-body.portal-dark .kpi,
body.admin-body.portal-dark .table-wrap,
body.admin-body.portal-dark .empty-state,
body.admin-body.portal-dark .form-panel,
body.admin-body.portal-dark .collapsed-panel-summary,
body.admin-body.portal-dark .dashboard-fold-summary,
body.admin-body.portal-dark .embedded-section,
body.admin-body.portal-dark .phase-tabs > details,
body.admin-body.portal-dark .action-item {
  background: #0d1b2f;
  border-color: #263750;
  color: #edf4ff;
}
body.admin-body.portal-dark .collapsed-panel-body,
body.admin-body.portal-dark .dashboard-fold-body,
body.admin-body.portal-dark .embedded-section[open] > summary {
  border-top-color: #263750;
}
body.admin-body.portal-dark .detail,
body.admin-body.portal-dark .raw-details,
body.admin-body.portal-dark .inner-panel,
body.admin-body.portal-dark .phase-mini-block,
body.admin-body.portal-dark .owner-daily-brief-panel .inner-panel,
body.admin-body.portal-dark .opportunity-war-room .inner-panel,
body.admin-body.portal-dark .subcontractor-action-center .inner-panel,
body.admin-body.portal-dark .agency-crm-panel .inner-panel,
body.admin-body.portal-dark .document-intelligence-queue .inner-panel {
  background: #10243d;
  border-color: #263750;
}
body.admin-body.portal-dark .opportunity-brief-panel,
body.admin-body.portal-dark .opportunity-phase-digest {
  background: linear-gradient(180deg, #0f2138, #0d1b2f);
  border-color: #2d4563;
}
body.admin-body.portal-dark .opportunity-brief-header h1 {
  color: #f7fbff;
}
body.admin-body.portal-dark .opportunity-brief-header .eyebrow {
  color: #8fc5ff;
}
body.admin-body.portal-dark .opportunity-brief-overview,
body.admin-body.portal-dark .phase-important-card {
  background: #10243d;
  border-color: #2b4260;
}
body.admin-body.portal-dark .opportunity-brief-overview p,
body.admin-body.portal-dark .phase-card-summary {
  color: #edf4ff;
}
body.admin-body.portal-dark .opportunity-source-line {
  background: rgba(224, 189, 104, .10);
  border-color: rgba(224, 189, 104, .38);
}
body.admin-body.portal-dark .opportunity-source-line span {
  color: #f4d27a;
}
body.admin-body.portal-dark .opportunity-source-line em {
  color: #c9d6e8;
}
body.admin-body.portal-dark th {
  background: #10243d;
  color: #c7d4e8;
}
body.admin-body.portal-dark td {
  color: #edf4ff;
}
body.admin-body.portal-dark th,
body.admin-body.portal-dark td {
  border-bottom-color: #1c2b42;
}
body.admin-body.portal-dark input,
body.admin-body.portal-dark select,
body.admin-body.portal-dark textarea {
  background: #08182b;
  color: #edf4ff;
  border-color: #334966;
}
body.admin-body.portal-dark input::placeholder,
body.admin-body.portal-dark textarea::placeholder {
  color: #8294ad;
}
body.admin-body.portal-dark .btn-outline,
body.admin-body.portal-dark button.btn.btn-outline {
  background: #10243d;
  border-color: #3a516f;
  color: #f5f8ff;
}
body.admin-body.portal-dark .btn-primary {
  background: #e0bd68;
  color: #081325;
}
body.admin-body.portal-dark .btn-primary:hover {
  background: #f0cf7c;
}
body.admin-body.portal-dark .btn-archive,
body.admin-body.portal-dark button.btn.btn-archive {
  background: #1f2937;
  border-color: #64748b;
  color: #f8fafc;
}
body.admin-body.portal-dark .btn-archive:hover,
body.admin-body.portal-dark button.btn.btn-archive:hover {
  background: #0f172a;
  border-color: #94a3b8;
}
body.admin-body.portal-dark .pill.dark,
body.admin-body.portal-dark .status {
  background: #10243d;
  border-color: #3a516f;
  color: #dbe8f5;
}
body.admin-body.portal-dark .mobile-menu > summary {
  background: #10243d;
  border-color: #3a516f;
  color: #f5f8ff;
}
body.admin-body.portal-dark .mobile-menu nav,
body.admin-body.portal-dark .mobile-menu nav .side-group,
body.admin-body.portal-dark .mobile-menu nav a,
body.admin-body.portal-dark .mobile-menu nav .side-group > summary,
body.admin-body.portal-dark .mobile-menu nav .side-group > div a {
  background: #0d1b2f;
  border-color: #263750;
  color: #f5f8ff;
}
body.admin-body.portal-dark .mobile-menu nav a.active,
body.admin-body.portal-dark .mobile-menu nav a:hover,
body.admin-body.portal-dark .mobile-menu nav .side-group.active > summary,
body.admin-body.portal-dark .mobile-menu nav .side-group > summary:hover {
  background: #10243d;
}

@media(max-width:900px){
  .portal-mobile-brand {
    font-size: 34px;
    gap: 14px;
  }
  .portal-mobile-brand img {
    width: 72px;
    height: 72px;
  }
}
@media(max-width:720px){
  .collapsed-panel-summary {
    align-items: center;
    flex-wrap: wrap;
  }
  .collapsed-panel-summary h2 {
    flex: 1 1 170px;
  }
  .collapsed-summary-note {
    display: inline-flex;
    margin-left: 0;
    flex: 1 1 auto;
  }
  .collapsed-summary-actions {
    order: 4;
    flex: 1 1 100%;
  }
  .collapsed-summary-actions .btn,
  .collapsed-summary-form,
  .collapsed-summary-form .btn {
    width: 100%;
  }
  .action-list.compact .action-item {
    grid-template-columns: minmax(0, 1fr) auto;
  }
  .action-list.compact .action-item .btn {
    width: auto;
    min-width: 78px;
    white-space: nowrap;
  }
}
@media(max-width:420px){
  .portal-mobile-brand {
    font-size: 31px;
    gap: 12px;
  }
  .portal-mobile-brand img {
    width: 64px;
    height: 64px;
  }
}

/* v1_53: dark theme polish, readable command controls, and section color accents */
.portal-mobile-brand img {
  background: rgba(255, 255, 255, .98);
  border: 1px solid rgba(15, 35, 66, .08);
  border-radius: 16px;
  box-shadow: 0 12px 28px rgba(0, 0, 0, .22);
  box-sizing: border-box;
  object-fit: contain;
  padding: 5px;
}
body.admin-body.portal-dark .portal-mobile-brand img {
  background: rgba(255, 255, 255, .98);
  border-color: rgba(255, 255, 255, .9);
}
body.admin-body.portal-dark .brand img {
  background: #ffffff;
  border-radius: 12px;
  box-sizing: border-box;
  object-fit: contain;
  padding: 4px;
}
body.admin-body.portal-dark .side-nav a[href="/portal/opportunities"],
body.admin-body.portal-dark .mobile-menu nav a[href="/portal/opportunities"] {
  border-left: 3px solid #34d399;
  background: linear-gradient(90deg, rgba(52, 211, 153, .16), rgba(52, 211, 153, .03));
}
body.admin-body.portal-dark .side-nav a[href="/portal/jobs"],
body.admin-body.portal-dark .mobile-menu nav a[href="/portal/jobs"] {
  border-left: 3px solid #22c55e;
  background: linear-gradient(90deg, rgba(34, 197, 94, .14), rgba(34, 197, 94, .03));
}
body.admin-body.portal-dark .side-nav a[href="/portal/scanner"],
body.admin-body.portal-dark .mobile-menu nav a[href="/portal/scanner"] {
  border-left: 3px solid #60a5fa;
  background: linear-gradient(90deg, rgba(96, 165, 250, .15), rgba(96, 165, 250, .03));
}
body.admin-body.portal-dark .side-nav a[href="/portal/messages"],
body.admin-body.portal-dark .mobile-menu nav a[href="/portal/messages"] {
  border-left: 3px solid #a78bfa;
  background: linear-gradient(90deg, rgba(167, 139, 250, .15), rgba(167, 139, 250, .03));
}
body.admin-body.portal-dark .kpi-grid > .kpi {
  border-top: 3px solid rgba(96, 165, 250, .45);
}
body.admin-body.portal-dark .kpi-grid > .kpi:nth-child(1) {
  border-top-color: #a78bfa;
  background: linear-gradient(180deg, #10243d, #111d39);
}
body.admin-body.portal-dark .kpi-grid > .kpi:nth-child(2),
body.admin-body.portal-dark .kpi-grid > .kpi:nth-child(4) {
  border-top-color: #60a5fa;
  background: linear-gradient(180deg, #10243d, #0d2238);
}
body.admin-body.portal-dark .kpi-grid > .kpi:nth-child(3),
body.admin-body.portal-dark .kpi-grid > .kpi:nth-child(5),
body.admin-body.portal-dark .kpi-grid > .kpi:nth-child(6) {
  border-top-color: #fb7185;
  background: linear-gradient(180deg, #10243d, #2a1423);
}
body.admin-body.portal-dark .kpi-grid > .kpi:nth-child(7) {
  border-top-color: #fbbf24;
  background: linear-gradient(180deg, #10243d, #29220d);
}
body.admin-body.portal-dark .kpi-grid > .kpi:nth-child(8) {
  border-top-color: #34d399;
  background: linear-gradient(180deg, #10243d, #0b261f);
}
body.admin-body.portal-dark .collapsed-panel-summary::after,
body.admin-body.portal-dark .dashboard-fold-summary::after {
  background: #142a46 !important;
  border-color: #45607f !important;
  color: #f7fbff !important;
  flex: 0 0 auto;
  line-height: 1;
  min-width: 66px;
  padding: 7px 14px;
  text-align: center;
  white-space: nowrap;
}
body.admin-body.portal-dark .collapsed-panel.saved-opportunity-views {
  border-color: rgba(52, 211, 153, .32);
}
body.admin-body.portal-dark .collapsed-panel.saved-opportunity-views > .collapsed-panel-summary {
  background: linear-gradient(135deg, #0d1b2f, #0d2a24);
}
body.admin-body.portal-dark .compact-add-panel > .collapsed-panel-summary,
body.admin-body.portal-dark .collapsed-panel[id="scanner-triage"] > .collapsed-panel-summary,
body.admin-body.portal-dark .collapsed-panel[id="scanner-regression"] > .collapsed-panel-summary,
body.admin-body.portal-dark .connector-category-panel > .collapsed-panel-summary {
  background: linear-gradient(135deg, #0d1b2f, #0d2740);
}
body.admin-body.portal-dark .action-list.compact .action-item {
  grid-template-columns: minmax(0, 1fr) max-content;
}
body.admin-body.portal-dark .action-list.compact .action-item .btn,
body.admin-body.portal-dark .action-item .btn {
  align-items: center;
  display: inline-flex;
  justify-content: center;
  line-height: 1.1;
  min-height: 38px;
  min-width: 92px;
  overflow-wrap: normal;
  text-align: center;
  white-space: nowrap;
  word-break: keep-all;
}
body.admin-body.portal-dark .btn-outline,
body.admin-body.portal-dark button.btn.btn-outline {
  box-shadow: 0 0 0 1px rgba(255, 255, 255, .02) inset;
}
body.admin-body.portal-dark .record-open-card {
  background: linear-gradient(135deg, #10243d, #0d1b2f);
  border-color: rgba(96, 165, 250, .28);
  box-shadow: 0 14px 30px rgba(0, 0, 0, .18);
  color: #f7fbff;
}
body.admin-body.portal-dark .record-open-card:hover {
  border-color: rgba(96, 165, 250, .5);
  box-shadow: 0 18px 36px rgba(0, 0, 0, .24);
}
body.admin-body.portal-dark .record-open-meta {
  color: #a9b8cc;
}
body.admin-body.portal-dark .record-open-action {
  background: #142a46;
  border-color: #45607f;
  color: #f7fbff;
}
body.admin-body.portal-dark .record-open-card-opportunity {
  background: linear-gradient(135deg, #10243d, #0b261f);
  border-color: rgba(52, 211, 153, .42);
}
body.admin-body.portal-dark .record-open-card-job {
  background: linear-gradient(135deg, #10243d, #0d2a24);
  border-color: rgba(34, 197, 94, .4);
}
body.admin-body.portal-dark .record-open-card-message {
  background: linear-gradient(135deg, #10243d, #181c3e);
  border-color: rgba(167, 139, 250, .42);
}
body.admin-body.portal-dark .record-open-card-message-unread {
  background: linear-gradient(135deg, #10243d, #2a1423);
  border-color: rgba(251, 113, 133, .5);
}
body.admin-body.portal-dark .record-open-card-scanner {
  background: linear-gradient(135deg, #10243d, #0d2740);
  border-color: rgba(56, 189, 248, .42);
}
body.admin-body.portal-dark .record-open-card-connector-healthy {
  background: linear-gradient(135deg, #10243d, #0b261f);
  border-color: rgba(52, 211, 153, .42);
}
body.admin-body.portal-dark .record-open-card-connector-work,
body.admin-body.portal-dark .record-open-card-connector-warn {
  background: linear-gradient(135deg, #10243d, #2a220d);
  border-color: rgba(251, 191, 36, .46);
}
body.admin-body.portal-dark .record-open-card-connector-danger {
  background: linear-gradient(135deg, #10243d, #2a1418);
  border-color: rgba(248, 113, 113, .5);
}
body.admin-body.portal-dark .record-open-card-connector-neutral {
  background: linear-gradient(135deg, #10243d, #172337);
  border-color: rgba(148, 163, 184, .42);
}
body.admin-body.portal-dark .scanner-result-facts span {
  background: #10243d;
  border-color: #334966;
  color: #c7d4e8;
}
body.admin-body.portal-dark .connector-record-panel > summary {
  background: transparent;
}
body.admin-body.portal-dark .status.danger,
body.admin-body.portal-dark .status.overdue,
body.admin-body.portal-dark .status.lost,
body.admin-body.portal-dark .status.cancelled,
body.admin-body.portal-dark .status.do-not-use,
body.admin-body.portal-dark .alert.danger {
  background: rgba(248, 113, 113, .16);
  border-color: rgba(248, 113, 113, .45);
  color: #fecaca;
}
body.admin-body.portal-dark .status.warn,
body.admin-body.portal-dark .status.waiting,
body.admin-body.portal-dark .status.pending,
body.admin-body.portal-dark .status.due,
body.admin-body.portal-dark .alert.warn {
  background: rgba(251, 191, 36, .16);
  border-color: rgba(251, 191, 36, .46);
  color: #fde68a;
}
body.admin-body.portal-dark .status.open,
body.admin-body.portal-dark .status.found,
body.admin-body.portal-dark .status.reviewing,
body.admin-body.portal-dark .status.submitted,
body.admin-body.portal-dark .alert.info {
  background: rgba(96, 165, 250, .16);
  border-color: rgba(96, 165, 250, .44);
  color: #bfdbfe;
}
body.admin-body.portal-dark .status.awarded,
body.admin-body.portal-dark .status.active,
body.admin-body.portal-dark .status.paid,
body.admin-body.portal-dark .status.done,
body.admin-body.portal-dark .status.completed,
body.admin-body.portal-dark .status.preferred {
  background: rgba(52, 211, 153, .16);
  border-color: rgba(52, 211, 153, .44);
  color: #bbf7d0;
}
body.admin-body.portal-dark .dashboard-section-title .pill.dark,
body.admin-body.portal-dark .toolbar .pill.dark {
  background: linear-gradient(135deg, #142a46, #1a3352);
  border-color: #4b6686;
  color: #f7fbff;
  line-height: 1;
  min-width: max-content;
  white-space: nowrap;
}
body.admin-body.portal-dark .dashboard-why,
body.admin-body.portal-dark .score-explain {
  background: #0a1728;
  border-color: #2f4663;
}
body.admin-body.portal-dark .embedded-section > summary {
  background: #132b49;
  border-color: #2f4663;
  color: #f7fbff;
}
body.admin-body.portal-dark .dashboard-why > summary,
body.admin-body.portal-dark .score-explain > summary {
  background: #132b49;
  color: #f7fbff;
}
body.admin-body.portal-dark .analytics-chart,
body.admin-body.portal-dark .chart-svg-wrap {
  background: #0a1728;
  border-color: #2f4663;
}
body.admin-body.portal-dark .analytics-svg rect:first-child {
  fill: #0a1728;
}
body.admin-body.portal-dark .analytics-svg line {
  stroke: #38516d;
}
body.admin-body.portal-dark .analytics-svg text {
  fill: #c7d4e8;
}
body.admin-body.portal-dark .payments-overview,
body.admin-body.portal-dark .payments-command {
  border-left-color: #4ade80;
}
body.admin-body.portal-dark .analytics-pie-svg rect:first-child {
  fill: #0a1728;
}
body.admin-body.portal-dark .pie-legend-row strong {
  color: #f7fbff;
}
body.admin-body.portal-dark .notification-digest-panel .kpi {
  min-width: 0;
  padding: 16px 12px;
}
body.admin-body.portal-dark .notification-digest-panel .kpi .label {
  line-height: 1.18;
  overflow-wrap: normal;
  word-break: normal;
}
@media(max-width:720px){
  body.admin-body.portal-dark .action-list.compact .action-item {
    grid-template-columns: 1fr;
  }
  body.admin-body.portal-dark .action-list.compact .action-item .btn {
    margin-top: 10px;
    width: 100%;
  }
  body.admin-body.portal-dark .dashboard-section-title .pill.dark {
    justify-self: start;
  }
  body.admin-body.portal-dark .notification-digest-panel .kpi-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr)) !important;
  }
  body.admin-body.portal-dark .notification-digest-panel .kpi .label {
    font-size: 11px;
  }
  .record-open-card {
    min-width: 0;
    width: 100%;
    padding: 14px;
  }
  .record-open-action {
    position: static;
    transform: none;
    justify-self: start;
    max-width: none;
    margin-top: 4px;
    padding: 6px 10px;
    white-space: nowrap;
  }
  .scanner-result-facts {
    gap: 6px;
  }
  .scanner-result-facts span {
    max-width: 100%;
  }
  .scanner-result-actions .btn,
  .connector-card-actions .btn {
    flex: 1 1 130px;
  }
  .connector-category-panel > summary {
    display: flex;
    align-items: center;
    gap: 8px;
    flex-wrap: wrap;
  }
}

/* v1_78: Dark-mode readability fix for imported phase cards/lists */
body.admin-body.portal-dark .phase-important-card,
body.admin-body.portal-dark .phase-mini-block {
  color: #edf4ff;
}
body.admin-body.portal-dark .phase-important-card h3,
body.admin-body.portal-dark .phase-mini-block strong {
  color: #f7fbff;
}
body.admin-body.portal-dark .phase-mini-block .clean-list li,
body.admin-body.portal-dark .phase-important-card .clean-list li {
  color: #dbe8f7;
}
body.admin-body.portal-dark .phase-mini-block .clean-list li::before,
body.admin-body.portal-dark .phase-important-card .clean-list li::before {
  background: #e0bd68;
  box-shadow: 0 0 0 3px rgba(224, 189, 104, 0.12);
}
body.admin-body.portal-dark .phase-important-card .detail,
body.admin-body.portal-dark .phase-important-card .phase-card-summary,
body.admin-body.portal-dark .phase-important-card p,
body.admin-body.portal-dark .phase-mini-block p {
  color: #edf4ff;
}
body.admin-body.portal-dark .phase-important-card .detail .label,
body.admin-body.portal-dark .phase-important-card .mini {
  color: #b7c7dc;
}
body.admin-body.portal-dark .phase-important-card .detail .value {
  color: #f7fbff;
}
@media (max-width: 720px) {
  .phase-important-card,
  .phase-mini-block {
    line-height: 1.45;
  }
  .phase-mini-block .clean-list,
  .phase-important-card .clean-list {
    gap: 10px;
  }
  .phase-mini-block .clean-list li,
  .phase-important-card .clean-list li {
    padding-left: 22px;
  }
}

/* v1_80: color-coded opportunity lifecycle badges */
.status.lifecycle-badge {
  border: 1px solid currentColor;
  font-weight: 900;
}
.status.lifecycle-phase-1-needed {
  background: #fff0ee;
  border-color: #fda29b;
  color: #b42318;
}
.status.lifecycle-phase-2-needed {
  background: #fff4e5;
  border-color: #fdb022;
  color: #9a4b00;
}
.status.lifecycle-phase-3-needed {
  background: #fef7c3;
  border-color: #facc15;
  color: #854d0e;
}
.status.lifecycle-all-phases-completed {
  background: #eaf8f1;
  border-color: #22c55e;
  color: #067647;
}
body.admin-body.portal-dark .status.lifecycle-phase-1-needed {
  background: rgba(248, 113, 113, .22);
  border-color: rgba(248, 113, 113, .72);
  color: #fecaca;
}
body.admin-body.portal-dark .status.lifecycle-phase-2-needed {
  background: rgba(251, 146, 60, .22);
  border-color: rgba(251, 146, 60, .72);
  color: #fed7aa;
}
body.admin-body.portal-dark .status.lifecycle-phase-3-needed {
  background: rgba(250, 204, 21, .22);
  border-color: rgba(250, 204, 21, .72);
  color: #fef08a;
}
body.admin-body.portal-dark .status.lifecycle-all-phases-completed {
  background: rgba(52, 211, 153, .20);
  border-color: rgba(52, 211, 153, .72);
  color: #bbf7d0;
}

/* v1.84: keep anchor navigation below sticky/mobile headers after phase imports. */
#opportunity-brief { scroll-margin-top: 96px; }
@media (max-width: 760px) { #opportunity-brief { scroll-margin-top: 118px; } }

/* v1.85: priority/high-value opportunity flag */
.btn-priority,
button.btn.btn-priority {
  background: linear-gradient(135deg, #14845f, #16a36f);
  border-color: #12805b;
  color: #ffffff;
}
.btn-priority:hover,
button.btn.btn-priority:hover,
.btn-priority.active {
  background: linear-gradient(135deg, #0f6b4e, #128a5e);
  color: #ffffff;
}
body.admin-body.portal-dark .btn-priority,
body.admin-body.portal-dark button.btn.btn-priority {
  background: linear-gradient(135deg, #16a36f, #21bf81);
  border-color: #21bf81;
  color: #052114;
  font-weight: 800;
}
body.admin-body.portal-dark .btn-priority:hover,
body.admin-body.portal-dark button.btn.btn-priority:hover,
body.admin-body.portal-dark .btn-priority.active {
  background: linear-gradient(135deg, #33d596, #52e0a9);
  color: #03180f;
}

/* v1_97: dark-mode readability fix for AI Phase summary cards */
body.admin-body.portal-dark .phase-summary {
  background: #10243d;
  border-color: #2b4260;
  color: #edf4ff;
}
body.admin-body.portal-dark .phase-summary strong,
body.admin-body.portal-dark .phase-summary p {
  color: #edf4ff !important;
}
body.admin-body.portal-dark .phase-card-summary,
body.admin-body.portal-dark .opportunity-phase-digest p {
  color: #edf4ff !important;
}

/* v69 desktop data table stability: keep wide tracker tables readable on PC while preserving mobile cards. */
@media (min-width: 641px) {
  #opportunity-tracker .data-table,
  .job-tracker-panel .data-table,
  .top-sub-directory .data-table,
  .subcontractor-directory-panel .data-table {
    overflow-x: auto;
  }
  #opportunity-tracker .data-table table {
    min-width: 1540px;
  }
  .job-tracker-panel .data-table table {
    min-width: 1280px;
  }
  .top-sub-directory .data-table table,
  .subcontractor-directory-panel .data-table table {
    min-width: 1180px;
  }
  #opportunity-tracker .data-table th,
  #opportunity-tracker .data-table td,
  .job-tracker-panel .data-table th,
  .job-tracker-panel .data-table td,
  .top-sub-directory .data-table th,
  .top-sub-directory .data-table td,
  .subcontractor-directory-panel .data-table th,
  .subcontractor-directory-panel .data-table td {
    word-break: normal;
    overflow-wrap: normal;
    hyphens: none;
  }
  #opportunity-tracker .data-table th,
  .job-tracker-panel .data-table th,
  .top-sub-directory .data-table th,
  .subcontractor-directory-panel .data-table th {
    white-space: nowrap;
  }
  #opportunity-tracker .record-open-card,
  .job-tracker-panel .record-open-card {
    min-width: 260px;
  }
}

/* v2.79 vendor profile / quote request refinements */
.btn-success, button.btn.btn-success {
  background: #16a34a;
  border-color: #16a34a;
  color: #ffffff;
}
.btn-success:hover, button.btn.btn-success:hover { background: #15803d; }
body.admin-body.portal-dark .btn-success,
body.admin-body.portal-dark button.btn.btn-success {
  background: #22c55e;
  border-color: #22c55e;
  color: #062313;
}
.vendor-profile-stack { display: grid; gap: 18px; }
.vendor-profile-card { border-radius: 22px; }
.vendor-profile-card h3 { margin: 0; font-size: 24px; }
.vendor-profile-card h4 { margin: 0 0 10px; font-size: 15px; color: var(--muted); text-transform: uppercase; letter-spacing: .02em; }
.vendor-profile-form { display: grid; gap: 14px; }
.vendor-field-with-action { display: grid; grid-template-columns: minmax(0,1fr) auto; gap: 10px; align-items: end; }
.vendor-field-action { align-self: end; padding-bottom: 0; }
.vendor-side-action { min-width: 112px; white-space: nowrap; }
.vendor-card-block { border-top: 1px solid var(--line); margin-top: 12px; padding-top: 14px; }
.vendor-card-actions { display: flex; flex-wrap: wrap; gap: 10px; margin-top: 14px; }
.quote-doc-list { display: grid; gap: 10px; }
.quote-doc-row { display: flex; justify-content: space-between; gap: 12px; align-items: center; padding: 10px 0; border-bottom: 1px solid var(--line); }
.quote-doc-actions { display: flex; flex-wrap: wrap; gap: 8px; justify-content: flex-end; }
.quote-email-list { margin-bottom: 10px; }
.quote-email-row { border: 1px solid rgba(20,184,166,.18); border-radius: 12px; padding: 12px; background: rgba(20,184,166,.06); }
.quote-email-row .status { margin-right: 6px; }
.quote-review-actions .grid-2 { align-items: start; }
.quote-email-detail .toolbar { align-items: flex-start; }
.quote-request-compose .quote-subject-pill { border: 1px solid var(--line); border-radius: 12px; padding: 12px 14px; font-weight: 900; background: rgba(224,189,104,.18); color: var(--navy); }
.quote-email-body { min-height: 520px; line-height: 1.55; font-size: 15px; }
body.admin-body.portal-dark .vendor-card-block,
body.admin-body.portal-dark .quote-doc-row { border-color: #263b58; }
body.admin-body.portal-dark .quote-email-row { background: rgba(20,184,166,.1); border-color: rgba(45,212,191,.24); }
body.admin-body.portal-dark .quote-request-compose .quote-subject-pill { background: #1f2f49; color: #f7fbff; border-color: #3a516f; }
@media (max-width: 720px) {
  .vendor-field-with-action { grid-template-columns: 1fr; }
  .vendor-side-action, .vendor-card-actions .btn, .quote-doc-actions .btn { width: 100%; }
  .quote-doc-row { display: grid; }
  .quote-doc-actions { justify-content: stretch; }
  .quote-email-body { min-height: 560px; font-size: 16px; }
}

/* v2.80 quote request workspace correction */
.quote-request-stack { display: grid; gap: 14px; }
.quote-request-card { border: 1px solid var(--line); border-radius: 18px; overflow: hidden; background: rgba(255,255,255,.72); }
.quote-request-card > summary { cursor: pointer; list-style: none; display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 14px 16px; font-weight: 900; }
.quote-request-card > summary::-webkit-details-marker { display: none; }
.quote-request-card-body { border-top: 1px solid var(--line); padding: 16px; }
.quote-inline-form { margin-top: 12px; }
.quote-inline-body, .quote-email-body { min-height: 560px; line-height: 1.62; font-size: 16px; padding: 16px; white-space: pre-wrap; }
.quote-send-button { min-width: 180px; }
.quote-subject-pill { border: 1px solid var(--line); border-radius: 14px; padding: 14px 16px; min-height: 52px; display: flex; align-items: center; font-weight: 900; background: rgba(224,189,104,.2); color: var(--navy); }
.vendor-field-with-action { grid-template-columns: minmax(0,1fr) auto; align-items: end; }
.vendor-side-action { min-width: 92px; padding-left: 12px; padding-right: 12px; }
.vendor-card-actions .btn { min-width: 150px; }
body.admin-body.portal-dark .quote-request-card { background: #0d2138; border-color: #263b58; }
body.admin-body.portal-dark .quote-request-card-body { border-color: #263b58; }
body.admin-body.portal-dark .quote-subject-pill { background: #1f2f49; color: #f7fbff; border-color: #3a516f; }
@media (max-width: 720px) {
  .quote-request-card > summary { align-items: flex-start; flex-direction: column; }
  .vendor-field-with-action { grid-template-columns: minmax(0,1fr) auto; gap: 8px; }
  .vendor-side-action { width: auto; min-width: 86px; }
  .quote-send-button { width: 100%; }
  .quote-inline-body, .quote-email-body { min-height: 620px; font-size: 16px; }
}
