/* Cosmetic overrides only. Keep the legacy grid, control dimensions, visibility,
   and script-controlled status colors intact. Loaded for screen media only. */
@media screen {
  body {
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
    color: #263449;
    background-color: #f3f5f8;
  }

  h1, h2, h3, h4, h5, h6 {
    color: #172b46;
    text-rendering: optimizeLegibility;
  }

  a {
    color: #1768a6;
  }

  a:hover {
    color: #104c7b;
  }

  a:focus-visible, button:focus-visible, input:focus-visible,
  select:focus-visible, textarea:focus-visible {
    outline: 2px solid #2684c7;
    outline-offset: 2px;
  }

  .navbar-inner {
    background: #1768a6;
    border-radius: 8px;
    box-shadow: 0 2px 6px rgba(23, 43, 70, 0.08);
    filter: none;
  }

  .nav-primary .navbar-inner {
    background: #172b46;
  }

  .navbar .brand, .navbar .nav > li > a {
    color: #ffffff;
    text-shadow: none;
  }

  .navbar .nav > li > a:hover,
  .navbar .nav > li > a:focus,
  .navbar .nav .active > a,
  .navbar .nav .active > a:hover {
    color: #ffffff;
    background-color: #104c7b;
    box-shadow: none;
  }

  .well {
    background-color: #ffffff;
    border-color: #dce3ec;
    border-radius: 8px;
    box-shadow: 0 2px 8px rgba(23, 43, 70, 0.04);
  }

  .main .tab-content {
    background-color: #ffffff;
    border-color: #c5d8e8;
    border-radius: 8px;
  }

  .nav-tabs > li {
    background-color: #edf2f7;
    border-color: #dce3ec;
    box-shadow: none;
  }

  .nav-tabs > .active > a, .nav-tabs > .active > a:hover {
    color: #172b46;
    background-color: #ffffff;
    border-color: #dce3ec;
    border-bottom-color: transparent;
  }

  /* Shared button treatment; retain the existing size and layout rules. */
  .btn, input[type="submit"], input[type="button"], input[type="reset"],
  .ui-dialog-buttonpane .ui-button {
    font-family: inherit;
    border-radius: 6px;
    border-color: var(--button-border, #bac7d6);
    background-color: var(--button-bg, #ffffff);
    color: var(--button-text, #263449);
    background-image: none;
    text-shadow: none;
    box-shadow: 0 1px 2px rgba(23, 43, 70, 0.06);
    filter: none;
  }

  /* Most legacy color classes indicate no distinct action: use one neutral style. */
  .btn .icon-white {
    background-image: url("../bootstrap/img/glyphicons-halflings.png");
  }

  .btn-danger, .btn[title="delete" i], .btn[href*="/delete"] {
    --button-bg: #ffffff;
    --button-hover: #ffffff;
    --button-border: #b8323c;
    --button-text: #b8323c;
  }

  /* Replace the old delete X with an outlined trash can, including dynamic rows. */
  :is(.btn-danger, .btn[title="delete" i], .btn[href*="/delete"]) :is(.icon-remove, .icon-trash),
  .btn[href*="/delete"]::before {
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23b8323c' stroke-width='1.8' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M3 6h18M9 6V3h6v3M5 6l1 15h12l1-15M10 10v7M14 10v7'/%3E%3C/svg%3E");
    background-position: center;
    background-size: 14px 14px;
    background-repeat: no-repeat;
  }

  .btn[href*="/delete"]::before {
    content: "";
    display: inline-block;
    width: 14px;
    height: 14px;
    margin-right: 4px;
    vertical-align: text-top;
  }

  :is(.btn, input[type="submit"], input[type="button"], input[type="reset"],
      .ui-dialog-buttonpane .ui-button):is(:hover, :active, .active, .ui-state-active) {
    background-color: var(--button-hover, #eaf0f6);
    border-color: var(--button-border, #bac7d6);
    color: var(--button-text, #263449);
    background-image: none;
    text-decoration: none;
    box-shadow: none;
  }

  :is(.btn, input[type="submit"], input[type="button"], input[type="reset"],
      .ui-dialog-buttonpane .ui-button):focus-visible {
    outline: 2px solid #2684c7;
    outline-offset: 2px;
  }

  :is(.btn, input[type="submit"], input[type="button"], input[type="reset"],
      .ui-dialog-buttonpane .ui-button):is(:disabled, .disabled, .ui-state-disabled) {
    background-color: var(--button-bg, #ffffff);
    border-color: var(--button-border, #bac7d6);
    color: var(--button-text, #263449);
    opacity: 0.55;
    box-shadow: none;
    cursor: default;
  }

  input, select, textarea, .uneditable-input {
    font-family: inherit;
  }

  input[type="text"], input[type="password"], input[type="number"],
  input[type="email"], input[type="search"], input[type="tel"],
  input[type="url"], select, textarea, .uneditable-input {
    border-color: #bac7d6;
    border-radius: 4px;
    box-shadow: none;
  }

  /* Data tables only: leave tables used for form layout and previews alone. */
  .table {
    background-color: #ffffff;
    font-variant-numeric: tabular-nums;
  }

  .table th {
    color: #435269;
    background-color: #f3f5f8;
    font-weight: 600;
  }

  .table th, .table td, .table-bordered, .table > tbody + tbody {
    border-color: #e2e7ee;
  }

  .table > thead > tr > th {
    border-bottom: 1px solid #d6dee8;
  }

  .table > thead a {
    color: #435269;
  }

  .table > thead a:hover, .table > thead a:focus {
    color: #104c7b;
    text-decoration: underline;
  }

  .table:not(.scrolling-table) > tbody > tr > td {
    vertical-align: middle;
  }

  /* Keep border widths intact while quieting the vertical grid lines. */
  .table-bordered > tbody > tr > td + td,
  .table-bordered > thead > tr > th + th {
    border-left-color: transparent;
  }

  .table-striped > tbody > tr:nth-child(odd) > td,
  .table-stripped > tbody > tr:nth-child(odd) > td {
    background-color: #fafbfd;
  }

  .table-striped > tbody > tr:hover > td,
  .table-stripped > tbody > tr:hover > td {
    background-color: #f0f4f8;
  }

  /* Contact groups retain their expand/collapse behavior and fixed row sizing. */
  .table .companyRow td {
    background-color: #edf1f5;
    color: #34465c;
    font-weight: 600;
  }

  .table .companyRow:hover td {
    background-color: #e5ecf3;
  }

  /* Existing contact rules use !important; override only their presentation. */
  .table .companyRow td, .table #contactRow td {
    border-bottom-color: #e2e7ee !important;
  }

  .table #contactRow {
    background-color: #ffffff !important;
  }

  .table #contactRow:hover {
    background-color: #f0f4f8 !important;
  }

  .table #contactRow td input {
    border-left-color: #bac7d6 !important;
  }

  .scrolling-table {
    box-shadow: none;
  }

  .scrolling-table tr th {
    background-color: #f3f5f8;
  }

  .scrolling-table thead th {
    color: #435269 !important;
  }

  #bid-pic {
    box-shadow: 0 2px 8px rgba(23, 43, 70, 0.12);
  }

  .dropdown-menu, .ui-autocomplete {
    border-color: #dce3ec;
    box-shadow: 0 8px 24px rgba(23, 43, 70, 0.14);
  }

  .ui-widget, #popup_container {
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  }

  .ui-dialog, #popup_container {
    border-color: #bac7d6;
    border-radius: 8px;
    box-shadow: 0 16px 48px rgba(23, 43, 70, 0.2);
  }

  .ui-dialog .ui-dialog-titlebar, #popup_title {
    color: #172b46;
    background: #eaf0f6;
    border-color: #dce3ec;
    text-shadow: none;
  }

  .fc .fc-state-default, .fc .fc-button-inner {
    background: #ffffff;
    border-color: #bac7d6;
    color: #263449;
    box-shadow: none;
    text-shadow: none;
  }

  .fc .fc-state-hover, .fc .fc-state-hover .fc-button-inner {
    background: #eaf0f6;
  }

  .fc .fc-state-active, .fc .fc-state-active .fc-button-inner,
  .fc .fc-state-down, .fc .fc-state-down .fc-button-inner {
    background: #eaf0f6;
    border-color: #8296ae;
    color: #263449;
  }

  .fc .fc-state-disabled {
    opacity: 0.55;
  }

  .fc .fc-button-effect span {
    background: transparent;
    border-color: transparent;
  }

  .fc .fc-widget-header, .fc .fc-widget-content {
    border-color: #dce3ec;
  }

  .fc .fc-widget-header {
    color: #34465c;
    background-color: #eaf0f6;
  }

  .copyright {
    color: #64748b;
  }

  .bid-progress {
    margin: 24px 0;
  }

  .bid-progress ol {
    display: flex;
    gap: 12px;
    margin: 0;
    padding: 0;
    list-style: none;
  }

  .bid-progress li {
    flex: 1;
    min-width: 0;
  }

  .bid-progress-step {
    display: flex;
    align-items: center;
    gap: 10px;
    width: 100%;
    min-height: 56px;
    padding: 10px 12px;
    border: 1px solid #dce3ec;
    border-radius: 8px;
    background: #ffffff;
    color: #34465c;
    font: inherit;
    text-align: left;
  }

  .bid-progress-step:not(:disabled):hover {
    border-color: #1768a6;
    background: #edf5fc;
  }

  .bid-progress-step.is-current {
    border-color: #1768a6;
    background: #edf5fc;
    color: #104c7b;
    font-weight: 600;
  }

  .bid-progress-step:disabled {
    cursor: default;
  }

  .bid-progress-step:disabled:not(.is-current) {
    background: #f3f5f8;
    color: #64748b;
  }

  .bid-progress-number {
    flex-shrink: 0;
    width: 26px;
    line-height: 26px;
    border-radius: 50%;
    background: #eaf0f6;
    color: #34465c;
    text-align: center;
  }

  .is-current .bid-progress-number {
    background: #1768a6;
    color: #ffffff;
  }

  /* The login view already uses white labels; preserve that contrast. */
  body.page-login {
    background: #172b46;
    color: #ffffff;
  }

  .page-login a:not(.btn), .page-login .copyright {
    color: #c5e5ff;
  }

  .page-login a:not(.btn):hover {
    color: #ffffff;
  }
}
