:root {
  --bg: #f5f7fb;
  --card: #ffffff;
  --text: #172033;
  --muted: #667085;
  --line: #d7deea;
  --primary: #0b4ea2;
  --primary-dark: #083a79;
  --accent: #f5b301;
  --danger: #b42318;
  --success: #067647;
  --warning: #b54708;
}
* { box-sizing: border-box; }
body { margin: 0; font-family: Arial, Helvetica, sans-serif; background: var(--bg); color: var(--text); line-height: 1.45; }
a { color: var(--primary); text-decoration: none; }
a:hover { text-decoration: underline; }
.topbar { background: #0a1833; color: white; display: flex; justify-content: space-between; align-items: center; gap: 24px; padding: 14px 28px; position: sticky; top: 0; z-index: 10; box-shadow: 0 4px 20px rgba(0,0,0,.16); }
.brand { display: flex; align-items: center; gap: 12px; }
.brand small { display: block; color: #c6d2e3; font-size: 12px; margin-top: 2px; }
.brand-mark { display: inline-flex; align-items: center; justify-content: center; width: 44px; height: 44px; border-radius: 12px; background: linear-gradient(135deg, var(--primary), #1d7fe6); color: #fff; font-weight: 800; letter-spacing: .5px; }
.topbar nav { display: flex; flex-wrap: wrap; gap: 14px; justify-content: flex-end; }
.topbar nav a { color: white; font-weight: 600; font-size: 14px; }
.container { max-width: 1200px; margin: 0 auto; padding: 28px; }
.card { background: var(--card); border: 1px solid var(--line); border-radius: 18px; padding: 24px; box-shadow: 0 8px 28px rgba(25,35,60,.06); margin-bottom: 22px; }
.card.wide { max-width: 980px; margin-left: auto; margin-right: auto; }
.card.narrow { max-width: 560px; margin: 40px auto; }
.accent-card { border-top: 5px solid var(--accent); }
.auth-grid, .grid-2 { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 22px; align-items: start; }
.grid-2.compact { gap: 14px; }
.page-head { display: flex; justify-content: space-between; align-items: flex-start; gap: 20px; margin-bottom: 22px; }
h1, h2, h3, h4 { margin-top: 0; }
h1 { font-size: 30px; margin-bottom: 8px; }
h2 { font-size: 22px; }
.muted { color: var(--muted); }
.small { font-size: 14px; }
form { margin: 0; }
.grid-form { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 16px; }
.grid-form.single { grid-template-columns: 1fr; }
.full { grid-column: 1 / -1; }
label { display: flex; flex-direction: column; gap: 6px; font-weight: 700; font-size: 14px; color: #26334d; }
input, select, textarea { width: 100%; border: 1px solid var(--line); border-radius: 12px; padding: 11px 12px; font: inherit; background: white; color: var(--text); }
textarea { resize: vertical; }
button, .button { display: inline-flex; align-items: center; justify-content: center; border: 0; background: var(--primary); color: white; border-radius: 12px; padding: 11px 16px; font-weight: 800; cursor: pointer; box-shadow: 0 4px 12px rgba(11,78,162,.18); }
button:hover, .button:hover { background: var(--primary-dark); text-decoration: none; }
button.secondary, .button.secondary { background: #eef4ff; color: var(--primary); box-shadow: none; }
.primary { background: var(--primary); }
.danger-button { background: var(--danger); padding: 8px 10px; border-radius: 10px; }
.actions { display: flex; gap: 12px; align-items: center; justify-content: flex-end; margin-top: 8px; }
.flash-wrap { margin-bottom: 20px; }
.flash { border-radius: 14px; padding: 12px 14px; margin-bottom: 10px; border: 1px solid var(--line); background: white; }
.flash.success { border-color: #a6f4c5; background: #ecfdf3; color: var(--success); }
.flash.warning { border-color: #fedf89; background: #fffaeb; color: var(--warning); }
.flash.danger { border-color: #fecdca; background: #fef3f2; color: var(--danger); }
.table-wrap { overflow-x: auto; }
table { border-collapse: collapse; width: 100%; font-size: 14px; }
th, td { border-bottom: 1px solid var(--line); padding: 11px 10px; text-align: left; vertical-align: top; }
th { background: #f8fafc; color: #344054; }
.pill { display: inline-flex; border-radius: 999px; padding: 4px 9px; font-size: 12px; font-weight: 800; background: #eef4ff; color: var(--primary); white-space: nowrap; }
.pill.draft { background: #f2f4f7; color: #344054; }
.pill.submitted { background: #fff7ed; color: #c2410c; }
.pill.in_review { background: #eff8ff; color: #175cd3; }
.pill.evaluated { background: #ecfdf3; color: #067647; }
.pill.awarded { background: #ecfdf3; color: #067647; }
.pill.no_awarded { background: #fef3f2; color: #b42318; }
.detail-list { display: grid; grid-template-columns: 160px 1fr; gap: 10px 14px; }
.detail-list dt { font-weight: 800; color: #344054; }
.detail-list dd { margin: 0; color: #101828; white-space: pre-wrap; }
.file-list { list-style: none; padding: 0; margin: 0; display: grid; gap: 10px; }
.file-list li { display: flex; justify-content: space-between; gap: 12px; align-items: center; border: 1px solid var(--line); border-radius: 12px; padding: 10px 12px; }
.file-list span { color: var(--muted); font-size: 13px; }
.metric-row { display: grid; grid-template-columns: repeat(5, minmax(0, 1fr)); gap: 14px; margin-bottom: 22px; }
.metric-row > div { background: white; border: 1px solid var(--line); border-radius: 16px; padding: 18px; box-shadow: 0 8px 28px rgba(25,35,60,.05); }
.metric-row strong { display: block; font-size: 28px; color: var(--primary); }
.metric-row span { color: var(--muted); font-size: 13px; font-weight: 700; }
.criterion { border: 1px solid var(--line); border-radius: 16px; padding: 18px; margin-bottom: 18px; }
.criterion legend { font-weight: 900; color: var(--primary); padding: 0 6px; }
.criterion legend span { color: var(--muted); font-weight: 600; }
.criterion label { margin-top: 12px; }
.checkbox { flex-direction: row; align-items: center; }
.checkbox input { width: auto; }
.review-card { border: 1px solid var(--line); border-radius: 16px; padding: 16px; margin-top: 14px; background: #fcfcfd; }
.inline-form { display: inline-flex; gap: 8px; align-items: center; }
.inline-form.stacked { display: grid; grid-template-columns: 1fr; gap: 8px; }
@media (max-width: 820px) {
  .topbar, .page-head { flex-direction: column; align-items: stretch; }
  .auth-grid, .grid-2, .grid-form, .metric-row { grid-template-columns: 1fr; }
  .detail-list { grid-template-columns: 1fr; }
  .container { padding: 18px; }
}
@media print {
  .topbar, .actions, button, .button { display: none !important; }
  body { background: white; }
  .card { box-shadow: none; border-color: #bbb; }
  .container { max-width: 100%; padding: 0; }
}

/* AI integration additions */
.brand-logo { width: 180px; height: auto; object-fit: contain; border-radius: 8px; background: #05080d; padding: 4px; }
.brand-mark { display:none; }
.stacked-form label { display:block; margin-bottom: 0.9rem; }
.section-head-inline { display:flex; justify-content:space-between; align-items:flex-start; gap:1rem; flex-wrap:wrap; }
.notice { padding: 0.9rem 1rem; border-radius: 12px; margin: 0.75rem 0; line-height: 1.45; }
.notice.info { background:#e8f1ff; border:1px solid #b9d4ff; color:#102a4c; }
.notice.warning { background:#fff6db; border:1px solid #f2d37c; color:#4f3900; }
.ai-panel { border-top: 4px solid #1f6feb; }
.metric-grid { display:grid; grid-template-columns: repeat(auto-fit, minmax(120px, 1fr)); gap:0.75rem; margin: 1rem 0; }
.metric { background:#f7f9fc; border:1px solid #e3e8ef; border-radius: 14px; padding: 0.85rem; }
.metric span { display:block; color:#5a6575; font-size: 0.82rem; margin-bottom:0.3rem; }
.metric strong { font-size:1.35rem; color:#0f172a; }
.grid-3 { display:grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap:1rem; }
.mini-card { background:#fbfdff; border:1px solid #dbe5f1; border-radius:14px; padding:1rem; }
.table-wrap.tall { max-height: 520px; overflow:auto; border:1px solid #e5eaf0; border-radius:12px; }
.text-block { white-space: pre-wrap; background:#0f172a; color:#e5e7eb; padding:1rem; border-radius:12px; max-height:420px; overflow:auto; }
.button-link { display:inline-block; padding:.45rem .7rem; background:#1f6feb; color:#fff !important; border-radius:8px; text-decoration:none; }
.pill.complete, .pill.met { background:#dcfce7; color:#14532d; }
.pill.running, .pill.queued, .pill.partially-met { background:#fef9c3; color:#713f12; }
.pill.failed, .pill.not-met { background:#fee2e2; color:#7f1d1d; }
.pill.insufficient-data { background:#e5e7eb; color:#374151; }
@media (max-width: 900px) { .grid-3 { grid-template-columns: 1fr; } .brand-logo { width: 140px; } }
