:root {
  font-family: Arial, Helvetica, sans-serif;
  color: #1b2a3a;
  background: #edf3f8;
  --nav: #064983;
  --nav-dark: #043865;
  --blue: #0f73c9;
  --blue-dark: #075da8;
  --line: #bdd0e1;
  --line-soft: #d8e4ee;
  --panel: #ffffff;
  --pale: #edf6fd;
  --pale-2: #dfeef9;
  --text-muted: #617488;
}

* { box-sizing: border-box; }
html, body { margin: 0; min-height: 100%; background: #edf3f8; }
body { min-height: 100vh; font-size: 12px; }
button, input, select, textarea { font: inherit; }
button { cursor: pointer; }
button:disabled { cursor: not-allowed; opacity: .48; }
a { color: inherit; text-decoration: none; }
h1, h2, p { margin-top: 0; }
h1 { margin-bottom: 5px; font-size: 22px; }
h2 { margin: 0 0 7px; font-size: 16px; }

.app-shell { min-height: 100vh; }

/* Global enterprise navigation */
.topbar {
  height: 50px;
  display: grid;
  grid-template-columns: auto minmax(520px, 1fr) auto;
  align-items: stretch;
  padding: 0 12px;
  background: linear-gradient(#0a5b9d, var(--nav-dark));
  color: #fff;
  border-bottom: 1px solid #032b50;
  box-shadow: inset 0 -1px rgba(255,255,255,.08);
}
.brand-lockup {
  display: flex;
  align-items: center;
  gap: 10px;
  min-width: 210px;
  padding-right: 16px;
  color: #fff;
}
.brand-mark { font-size: 28px; line-height: 1; font-weight: 900; font-style: italic; letter-spacing: -.06em; }
.brand-word { font-size: 17px; font-weight: 700; letter-spacing: .09em; }
.global-nav { display: flex; align-items: stretch; min-width: 0; }
.global-nav a,
.global-nav-item {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 82px;
  padding: 0 14px;
  border: 0;
  border-left: 1px solid rgba(255,255,255,.06);
  background: transparent;
  color: #fff;
  font-size: 12px;
  font-weight: 700;
  white-space: nowrap;
}
.global-nav a:hover,
.global-nav-item:not(:disabled):hover,
.global-nav-item.active { background: linear-gradient(#1780d0, #0d67b2); }
.global-nav-item:disabled { color: rgba(255,255,255,.72); opacity: 1; }
.global-tools { display: flex; align-items: center; gap: 10px; padding-left: 12px; }
.global-project-search {
  position: relative;
  width: 315px;
}
.global-project-search .search-icon {
  position: absolute;
  left: 10px;
  top: 50%;
  transform: translateY(-50%);
  color: #d9edff;
  font-size: 18px;
  pointer-events: none;
}
.global-project-search input {
  width: 100%;
  height: 31px;
  padding: 5px 10px 5px 31px;
  border: 1px solid rgba(255,255,255,.18);
  border-radius: 4px;
  background: rgba(255,255,255,.12);
  color: #fff;
  outline: none;
}
.global-project-search input::placeholder { color: #d4e5f4; }
.global-project-search input:focus { background: #fff; color: #15334e; border-color: #9ec7e6; }
.environment {
  padding: 4px 8px;
  border: 1px solid rgba(255,255,255,.25);
  border-radius: 3px;
  color: #e7f2fb;
  font-size: 10px;
  white-space: nowrap;
}

/* Project context header */
.project-context {
  min-height: 70px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
  padding: 8px 12px 7px;
  background: #fff;
  border-bottom: 1px solid #c6d8e7;
}
.project-context-copy { min-width: 0; }
.project-context-copy h1 {
  margin: 0;
  color: #143552;
  font-size: 20px;
  line-height: 1.2;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.project-context-meta {
  margin-top: 5px;
  color: #5f7790;
  font-size: 11px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.project-context-actions { display: flex; align-items: center; gap: 8px; flex: 0 0 auto; }
.header-action {
  min-height: 32px;
  padding: 5px 12px;
  border: 1px solid #b9ccdd;
  border-radius: 4px;
  background: linear-gradient(#fff, #edf4fa);
  color: #17466f;
  font-weight: 700;
  white-space: nowrap;
}
.header-action:hover:not(:disabled) { background: linear-gradient(#fff, #e0effa); }
.header-action-primary { border-color: #0c64ad; background: linear-gradient(#1983d7, #0c6cba); color: #fff; }
.header-action-primary:hover:not(:disabled) { background: linear-gradient(#1d8fe8, #0c6cba); }

/* Project tabs */
.workspace-tabs {
  display: flex;
  min-height: 37px;
  padding-left: 7px;
  overflow-x: auto;
  border-top: 1px solid #fff;
  border-bottom: 1px solid #a9c3d9;
  background: linear-gradient(#eaf4fb, #d9eaf7);
}
.workspace-tab {
  min-height: 36px;
  padding: 0 17px;
  border: 0;
  border-left: 1px solid #c4d6e5;
  border-right: 1px solid #f8fbfe;
  background: transparent;
  color: #184f7c;
  font-weight: 700;
  white-space: nowrap;
}
.workspace-tab:hover { background: #edf7fe; }
.workspace-tab.active {
  margin-top: 2px;
  border: 1px solid #9fbfd8;
  border-bottom-color: #fff;
  background: #fff;
  color: #075ca5;
}

.projects-page { width: 100%; padding: 6px 7px 18px; }
.dev-banner { display: none; }

/* General cards/forms retained for the other project tabs */
.content-card {
  padding: 16px;
  border: 1px solid #c0d1df;
  border-radius: 3px;
  background: #fff;
  box-shadow: 0 1px 2px rgba(29,61,87,.05);
}
.view-section[hidden] { display: none !important; }
.section-header { display: flex; align-items: flex-start; justify-content: space-between; gap: 16px; margin-bottom: 14px; }
.section-header.compact { margin-bottom: 10px; }
.section-header p { margin-bottom: 0; color: #687b8f; font-size: 12px; line-height: 1.4; }
.eyebrow { margin-bottom: 4px; color: #6a7d90; font-size: 10px; font-weight: 700; letter-spacing: .1em; }
.count-pill, .due-chip { padding: 6px 9px; border: 1px solid #c9d7e3; border-radius: 3px; background: #eff6fb; color: #526c82; font-size: 11px; font-weight: 700; }
.project-selector > label, .filters label > span, .details-grid label > span, .stacked-field > span, .field-label { display: block; margin-bottom: 5px; color: #5f7184; font-size: 11px; font-weight: 700; }
.form-input { width: 100%; min-height: 34px; padding: 7px 8px; border: 1px solid #bdcddd; border-radius: 3px; background: #fff; color: #172033; outline: none; }
.form-input:focus { border-color: #5d99c9; box-shadow: 0 0 0 2px rgba(28,116,188,.12); }
.form-input:disabled { background: #f0f3f5; color: #7d8993; }
textarea.form-input { resize: vertical; }
.btn { min-height: 33px; padding: 6px 10px; border: 1px solid transparent; border-radius: 3px; font-weight: 700; white-space: nowrap; }
.btn-primary { background: #0d72c6; color: #fff; }
.btn-secondary { border-color: #b9cbd9; background: linear-gradient(#fff, #eef4f8); color: #284a66; }
.btn-danger { border-color: #d4a3a3; background: #fff7f7; color: #992f2f; }
.btn-small { min-height: 29px; padding: 5px 8px; font-size: 11px; }
.toolbar-actions, .quick-links, .rfi-actions { display: flex; flex-wrap: wrap; gap: 6px; }
.filters { display: grid; gap: 8px; margin-bottom: 12px; }
.filters.three-col { grid-template-columns: 2fr 1fr 1fr; }
.filters.two-col { grid-template-columns: 2fr 1fr; }
.table-wrap { width: 100%; overflow-x: auto; border: 1px solid #c8d7e3; border-radius: 2px; }
.data-table { width: 100%; border-collapse: collapse; min-width: 760px; }
.data-table th { padding: 7px 8px; border-right: 1px solid #d6e1e9; border-bottom: 1px solid #bdcedd; background: linear-gradient(#f7fafc, #eaf1f6); color: #38566f; font-size: 11px; text-align: left; white-space: nowrap; }
.data-table td { padding: 7px 8px; border-right: 1px solid #e1e9ef; border-bottom: 1px solid #e7edf2; font-size: 11px; white-space: nowrap; }
.project-row-actions-cell { width: 292px; min-width: 292px; position: sticky; right: 0; z-index: 2; background: #fff; box-shadow: -1px 0 0 #d6e1e9, -8px 0 12px rgba(29,61,87,.06); }
.project-list-table th:last-child { position: sticky; right: 0; z-index: 3; box-shadow: -1px 0 0 #bdcedd, -8px 0 12px rgba(29,61,87,.06); }
.project-row-actions { display: flex; align-items: center; gap: 4px; white-space: nowrap; }
.project-row-action { min-width: 62px; padding-left: 8px; padding-right: 8px; }
.empty-row td { padding: 28px 18px !important; text-align: center; color: #68778a; white-space: normal !important; }
.empty-row strong, .empty-row span { display: block; }
.empty-row strong { margin-bottom: 5px; color: #2b394a; }
.metric-grid { display: grid; grid-template-columns: repeat(5,minmax(0,1fr)); gap: 8px; margin-bottom: 12px; }
.metric-card { min-height: 84px; padding: 12px; border: 1px solid #d2dfe9; border-radius: 3px; background: #f7fafc; }
.metric-card span { display: block; margin-bottom: 7px; color: #68778a; font-size: 11px; font-weight: 700; }
.metric-card strong { font-size: 18px; }
.panel-block { margin-top: 12px; padding: 14px; border: 1px solid #d1dee8; border-radius: 3px; background: #f9fbfd; }
.panel-block.flush { margin-top: 0; }
.muted { margin-bottom: 0; color: #687b8d; font-size: 11px; line-height: 1.45; }
.small-text { margin-top: 8px; font-size: 10px; }
.details-grid { display: grid; grid-template-columns: repeat(3,minmax(0,1fr)); gap: 10px; }
.stacked-field { display: block; margin-top: 11px; }
.empty-panel { display: flex; min-height: 115px; flex-direction: column; align-items: center; justify-content: center; padding: 20px; border: 1px dashed #c3d2de; border-radius: 3px; background: #f8fafc; color: #68778a; text-align: center; }
.empty-panel strong { margin-bottom: 5px; color: #2c394a; }
.empty-panel span { max-width: 560px; font-size: 11px; line-height: 1.4; }
.compact-empty { min-height: 160px; }
.two-column-layout { display: grid; grid-template-columns: minmax(0,.9fr) minmax(380px,1.1fr); gap: 12px; }
.transmittal-layout { display: grid; grid-template-columns: minmax(0,.8fr) minmax(0,1.2fr); gap: 10px; }

/* BID MANAGEMENT - matched to the approved dense construction-bidding layout */
.bid-management-view { padding: 0; background: transparent; border: 0; }
.bid-management-layout {
  display: grid;
  grid-template-columns: 246px minmax(0,1fr);
  gap: 6px;
  min-height: calc(100vh - 169px);
}
.bid-filter-panel {
  min-width: 0;
  align-self: start;
  border: 1px solid #aebfd0;
  background: #fff;
  box-shadow: inset 0 1px #fff;
}
body.bid-management-window-mode {
  overflow: hidden;
}
body.bid-management-window-mode .projects-page {
  height: var(--bid-management-viewport-height, calc(100vh - 127px));
  padding-bottom: 6px;
  overflow: hidden;
}
body.bid-management-window-mode #bidManagementView {
  height: 100%;
  min-height: 0;
  overflow: hidden;
}
body.bid-management-window-mode .bid-management-layout {
  height: 100%;
  min-height: 0;
  align-items: stretch;
  overflow: hidden;
}
body.bid-management-window-mode .bid-filter-panel {
  align-self: stretch;
  height: 100%;
  min-height: 0;
  overflow-x: hidden;
  overflow-y: auto;
  overscroll-behavior: contain;
}
body.bid-management-window-mode .bid-main-panel {
  height: 100%;
  min-height: 0;
  overflow: hidden;
}
body.bid-management-window-mode .bid-view-toolbar,
body.bid-management-window-mode .bid-db-source-bar,
body.bid-management-window-mode .bid-db-metrics,
body.bid-management-window-mode .bid-table-footer {
  flex: 0 0 auto;
}
body.bid-management-window-mode .bid-table-shell {
  flex: 1 1 0;
  min-height: 0;
  overflow: auto;
  overscroll-behavior: contain;
}
body.bid-management-window-mode .bid-data-table thead {
  position: sticky;
  top: 0;
  z-index: 4;
}
body.bid-management-window-mode .bid-table-footer {
  position: relative;
  z-index: 5;
}

.bid-filter-title {
  height: 31px;
  display: flex;
  align-items: center;
  gap: 7px;
  padding: 0 9px;
  border-bottom: 1px solid #d2bf75;
  background: linear-gradient(#fffdf2, #f5ecc5);
  color: #283a4b;
  font-size: 13px;
}
.bid-filter-actions {
  height: 32px;
  display: flex;
  align-items: center;
  gap: 4px;
  padding: 0 7px;
  border-bottom: 1px solid #bfd1df;
  background: linear-gradient(#edf7fe, #d8e9f7);
}
.bid-filter-actions button {
  height: 24px;
  padding: 0 8px;
  border: 1px solid transparent;
  border-radius: 2px;
  background: transparent;
  color: #28516f;
  font-weight: 700;
}
.bid-filter-actions button:hover { border-color: #aac5da; background: #fff; }
.bid-filter-actions button:first-child {
  border-color: #0b6bb7;
  background: linear-gradient(#1682d4, #0b6fbd);
  color: #fff;
}
.bid-filter-section { border-bottom: 1px solid #d7e0e7; padding: 8px 9px; }
.bid-filter-section-title { margin-bottom: 7px; color: #253b4d; font-weight: 700; }
.bid-filter-section label { display: block; margin: 0 0 7px; color: #253b4d; font-size: 11px; }
.bid-compact-input {
  width: 100%;
  height: 29px;
  margin-top: 3px;
  padding: 4px 6px;
  border: 1px solid #adc0d1;
  border-radius: 1px;
  background: #fff;
  color: #253b4d;
  outline: none;
}
.bid-compact-input:focus { border-color: #4e91c4; box-shadow: 0 0 0 1px #b8d8ee; }
.bid-status-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 5px 8px; }
.bid-status-grid label { margin: 0; white-space: nowrap; }
.bid-status-grid input { vertical-align: middle; margin: 0 4px 0 0; }
.bid-filter-details { padding: 0; }
.bid-filter-details summary {
  padding: 8px 9px;
  cursor: pointer;
  list-style-position: inside;
  font-weight: 700;
  color: #2d4e68;
  background: linear-gradient(#fafcfd, #f1f5f8);
}
.bid-filter-detail-body { padding: 7px 9px 9px; }
.bid-inline-check { display: block !important; margin-top: 7px !important; }

.bid-main-panel {
  min-width: 0;
  display: flex;
  flex-direction: column;
  border: 1px solid #aebfd0;
  background: #fff;
}
.bid-view-toolbar {
  min-height: 39px;
  display: flex;
  align-items: center;
  gap: 7px;
  padding: 4px 7px;
  border-bottom: 1px solid #abc4d8;
  background: linear-gradient(#f7fbfe, #dbeaf6);
  white-space: nowrap;
  overflow-x: auto;
}
.bid-view-toggle { display: flex; align-items: center; gap: 4px; }
.bid-view-toggle strong { margin-right: 4px; color: #243b4f; }
.bid-view-toggle button,
.bid-selection-summary button,
.bid-settings-button,
.bid-action-toolbar button {
  height: 27px;
  padding: 0 9px;
  border: 1px solid #b7c9d8;
  border-radius: 3px;
  background: linear-gradient(#fff, #e9f1f7);
  color: #274a65;
  font-weight: 700;
}
.bid-view-toggle button.active { border-color: #2676b8; background: linear-gradient(#348cd1, #176db3); color: #fff; }
.bid-action-toolbar { display: flex; align-items: center; gap: 3px; }
.bid-action-toolbar button { border-color: #b7c9d8; background: linear-gradient(#fff, #e9f1f7); color: #264d6a; }
.bid-selection-summary { display: flex; align-items: center; gap: 6px; margin-left: auto; color: #526b7e; font-size: 10px; }
.bid-settings-button { width: 30px; min-width: 30px; padding: 0; }
.bid-action-toolbar button:not(:disabled):hover { border-color: #b7c9d8; background: #fff; }
.bid-action-toolbar button:disabled { opacity: .48; }

.bid-table-shell { flex: 1 1 auto; min-height: 0; overflow: auto; background: #fff; }
.bid-data-table { width: 100%; min-width: 1540px; border-collapse: collapse; table-layout: auto; }
.bid-data-table thead { position: sticky; top: 0; z-index: 2; }
.bid-data-table th {
  height: 29px;
  padding: 5px 7px;
  border-right: 1px solid #c7d5df;
  border-bottom: 1px solid #afc4d4;
  background: linear-gradient(#f5f8fa, #e2ebf2);
  color: #25445d;
  font-size: 10.5px;
  font-weight: 700;
  text-align: left;
  white-space: nowrap;
  cursor: pointer;
}
.bid-data-table th:first-child { width: 34px; text-align: center; cursor: default; }
.bid-data-table td {
  height: 27px;
  max-width: 230px;
  padding: 4px 7px;
  border-right: 1px solid #dce5ec;
  border-bottom: 1px solid #e1e8ee;
  color: #2e3c47;
  font-size: 10.5px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  vertical-align: middle;
}
.bid-data-table tbody tr:nth-child(even) { background: #fbfdff; }
.bid-data-table tbody tr:hover { background: #eef7ff; }
.bid-data-table td:first-child { text-align: center; }
.bid-data-table .bid-link-cell { color: #075fa8; text-decoration: underline; text-underline-offset: 1px; }
.bid-status-cell { display: inline-flex; align-items: center; gap: 5px; color: #165b8f; }
.bid-status-dot { width: 9px; height: 9px; flex: 0 0 auto; border-radius: 50%; background: #8796a3; box-shadow: inset 0 -1px rgba(0,0,0,.18); }
.bid-status-dot.will-bid { background: #1fb14a; }
.bid-status-dot.not-bidding { background: #e3342f; }
.bid-status-dot.pending { background: #f0a21a; }
.bid-status-dot.invited { background: #2f8bd3; }
.bid-status-dot.no-response { background: #9da8b1; }

.bid-table-footer {
  min-height: 45px;
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 5px 8px;
  border-top: 1px solid #b5cada;
  background: linear-gradient(#eef7fd, #dcecf8);
}
.bid-pagination { display: flex; align-items: center; gap: 3px; }
.bid-pagination button {
  min-width: 27px;
  height: 27px;
  padding: 0 6px;
  border: 1px solid #b4c8d8;
  border-radius: 3px;
  background: #fff;
  color: #315a78;
}
.bid-pagination button.active { border-color: #0b6db8; background: #0f75c8; color: #fff; }
.bid-page-size { display: flex; align-items: center; gap: 5px; color: #405c72; white-space: nowrap; }
.bid-page-size select { height: 28px; border: 1px solid #aec3d3; background: #fff; }
.bid-display-count { margin-left: auto; color: #31536d; white-space: nowrap; }
.bid-update-status {
  min-height: 31px;
  padding: 0 16px;
  border: 1px solid #075fa8;
  border-radius: 3px;
  background: linear-gradient(#1682d4, #0870bf);
  color: #fff;
  font-weight: 700;
}

.notice { position: fixed; right: 18px; bottom: 18px; display: none; max-width: 430px; padding: 10px 13px; border: 1px solid #143e62; border-radius: 3px; background: #153f61; color: #fff; font-size: 12px; box-shadow: 0 5px 18px rgba(0,0,0,.18); z-index: 50; }
.notice.show { display: block; }

@media (max-width: 1220px) {
  .topbar { grid-template-columns: auto 1fr; height: auto; min-height: 50px; }
  .global-tools { grid-column: 1 / -1; padding: 5px 0 7px; justify-content: flex-end; }
  .global-nav { overflow-x: auto; }
  .bid-management-layout { grid-template-columns: 220px minmax(0,1fr); }
}
@media (max-width: 900px) {
  .project-context { align-items: stretch; flex-direction: column; }
  .project-context-actions { justify-content: flex-end; }
  .bid-management-layout { grid-template-columns: 1fr; }
  .bid-filter-panel { display: none; }
  .metric-grid { grid-template-columns: repeat(2,minmax(0,1fr)); }
  .details-grid, .two-column-layout, .transmittal-layout { grid-template-columns: 1fr; }
}
@media (max-width: 650px) {
  .brand-word { display: none; }
  .brand-lockup { min-width: 60px; }
  .global-project-search { width: min(100%, 280px); }
  .workspace-tab { padding: 0 10px; }
  .project-context-copy h1 { font-size: 16px; }
  .project-context-actions { flex-wrap: wrap; }
  .content-card { padding: 10px; }
  .filters.three-col, .filters.two-col, .details-grid, .metric-grid { grid-template-columns: 1fr; }
}
