/* Brand palette/fonts lifted from 180systems.com itself (header/nav blue,
   CTA orange, Montserrat headings over Inter body text) so this internal
   tool reads as the same product family as the public site. The fonts
   themselves are loaded by a non-blocking <link> in each page's <head>, not
   an @import here: an @import holds up the whole page until Google answers,
   so a slow moment on the internet connection made every menu click hang. */

:root {
  --brand-blue: #297fb7;
  --brand-blue-dark: #1a4a6e;
  --brand-orange: #ea9244;
  --brand-bg: #f4f7fa;
}

body {
  font-family: 'Inter', system-ui, sans-serif;
  margin: 0;
  padding: 1.5rem 2rem;
  color: #1a1a1a;
}

h1, h2, h3, h4 {
  font-family: 'Montserrat', system-ui, sans-serif;
  color: var(--brand-blue-dark);
}

/* Shared by app/templates/base.html and vendor/base.html -- the same
   blue/logo banner 180systems.com itself uses, so the admin and vendor
   sides of this tool read as the same product as the public website. */
.brand-header {
  display: flex;
  align-items: center;
  gap: 1.25rem;
  background: var(--brand-blue);
  color: #fff;
  padding: 1rem 1.5rem;
  margin: -1.5rem -2rem 0;
}

.brand-header img {
  height: 48px;
  width: auto;
}

.brand-header-text h1 {
  margin: 0;
  font-size: 1.4rem;
  color: #fff;
}

.topnav {
  background: var(--brand-blue-dark);
  margin: 0 -2rem 1.5rem;
  padding: 0.6rem 2rem;
  display: flex;
  flex-wrap: wrap;
  gap: 0.3rem 1.5rem;
}

.topnav a {
  margin-right: 0;
  font-weight: 600;
  color: #fff;
  text-decoration: none;
  text-transform: uppercase;
  font-size: 0.82rem;
  letter-spacing: 0.02em;
}

.topnav a:hover {
  text-decoration: underline;
}

button,
input[type="submit"] {
  font-family: 'Inter', system-ui, sans-serif;
  background: var(--brand-blue);
  color: #fff;
  border: none;
  padding: 0.45rem 0.9rem;
  border-radius: 4px;
  font-weight: 600;
  cursor: pointer;
}

button:hover,
input[type="submit"]:hover {
  background: var(--brand-blue-dark);
}

.active-rfp-bar {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 0.75rem;
  margin-bottom: 1.5rem;
  padding: 0.6rem 1rem;
  background: #eef4ff;
  border: 1px solid #b6cdf5;
  border-radius: 6px;
  font-size: 0.95rem;
}

.active-rfp-bar form {
  display: inline-flex;
  gap: 0.4rem;
  align-items: center;
  margin: 0;
}

table {
  border-collapse: collapse;
  width: 100%;
  margin-bottom: 1rem;
}

th, td {
  border: 1px solid #ddd;
  padding: 0.4rem 0.6rem;
  text-align: left;
}

th {
  background: #f5f5f5;
}

.row-actions form {
  display: inline;
}

.results-table {
  table-layout: fixed;
  width: 100%;
}

.results-table th,
.results-table td {
  word-wrap: break-word;
  overflow-wrap: break-word;
}

.results-table th:first-child,
.results-table td:first-child {
  width: 22%;
}

.results-table th:not(:first-child),
.results-table td:not(:first-child) {
  text-align: center;
}

.results-table td,
.results-flagged-table td {
  vertical-align: top;
}

.results-flagged-table td:nth-child(3) {
  text-align: center;
}

.results-table td.fit-low {
  background: #fdecea;
  color: #b00020;
  font-weight: 600;
}

.results-total-row td {
  font-weight: 600;
  border-top: 2px solid #999;
}

.results-vendor-nav,
.results-section-nav {
  font-size: 0.9rem;
  background: #f5f5f5;
  border-radius: 4px;
  padding: 0.5rem 0.75rem;
  margin: 0.5rem 0 1rem;
}

.results-section-nav {
  margin-top: -0.5rem;
}

.inline-form input, .inline-form select {
  margin-right: 0.5rem;
}

.stacked-form label {
  display: block;
  margin-bottom: 0.75rem;
}

.stacked-form input, .stacked-form select {
  display: block;
  margin-top: 0.25rem;
  min-width: 320px;
}

/* A checkbox and its text on one line, in a list of choices. */
.stacked-form label.check-option {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  margin-bottom: 0.4rem;
}

.stacked-form label.check-option input {
  display: inline-block;
  min-width: 0;
  margin: 0;
}

.error {
  color: #b00020;
  font-weight: 600;
}

/* Requirements Library: one fixed-layout table per 100-row block (see
   requirements_list.html), sharing these column widths so they line up. */
.req-table {
  table-layout: fixed;
  margin: 0;
}
.req-table + .req-block,
.req-block + .req-block {
  margin-top: -1px;  /* collapse the border between consecutive blocks */
}
.req-block {
  content-visibility: auto;
}
.req-block:last-of-type {
  margin-bottom: 1rem;
}
.req-table td {
  overflow-wrap: anywhere;
}
/* Edit / Insert / Delete on one line, so a one-line requirement is a
   one-line row. */
.req-table .row-actions { white-space: nowrap; overflow-wrap: normal; }
.req-table .row-actions a { margin-right: 0.45rem; }
.req-table .row-actions button { padding: 0.05rem 0.45rem; font-size: 0.85rem; }
.req-table col.c-check { width: 2.5rem; }
.req-table col.c-id { width: 4rem; }
.req-table col.c-section { width: 15%; }
.req-table col.c-category { width: 17%; }
.req-table col.c-type { width: 7rem; }
.req-table col.c-actions { width: 11rem; }

tr.draggable-row {
  cursor: grab;
  user-select: none;
}

tr.placeable {
  background: #fff8e1;
}

/* padding-left (not a leading-space/nbsp character) so every wrapped
   line of a long sub-requirement is indented, not just the first one. */
tr.sub-requirement .requirement-text,
td.sub-requirement {
  color: #444;
  padding-left: 2rem;
}

tr.drop-row-active {
  outline: 2px solid #1a73e8;
  outline-offset: -2px;
  background: #e8f0fe;
}

.drop-bar {
  position: sticky;
  top: 0;
  z-index: 20;
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 0.5rem;
  margin: 0 -2rem 1rem;
  padding: 0.75rem 2rem;
  background: #f5f5f5;
  border-bottom: 2px solid #ccc;
  box-shadow: 0 2px 4px rgba(0, 0, 0, 0.08);
  font-size: 0.9rem;
}

.drop-bar-sep {
  margin-left: 0.75rem;
  color: #555;
}

.drop-zone {
  border: 2px dashed #aaa;
  border-radius: 6px;
  padding: 0.5rem 0.75rem;
  font-size: 0.9rem;
  font-weight: 600;
}

.drop-zone-active {
  border-color: #1a73e8;
  background: #e8f0fe;
}

.app-confirm-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.4);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 1000;
}

.app-confirm-overlay[hidden] {
  display: none;
}

.app-confirm-box {
  background: #fff;
  border-radius: 8px;
  padding: 1.25rem 1.5rem;
  max-width: 420px;
  box-shadow: 0 4px 20px rgba(0, 0, 0, 0.25);
}

.app-confirm-box p {
  margin-top: 0;
  margin-bottom: 1rem;
}

.app-confirm-box button {
  margin-right: 0.5rem;
}

.vendor-deadline {
  font-size: 0.6em;
  font-weight: 400;
  color: rgba(255, 255, 255, 0.85);
}

.vendor-deadline-locked {
  color: #ffe08a;
}

.column-legend {
  font-size: 0.9rem;
  background: #f4f7fa;
  border: 1px solid #d8e2ea;
  border-radius: 6px;
  padding: 0.6rem 0.9rem;
}

.column-legend strong {
  margin-right: 0.25rem;
}

.gap-scale-divider td {
  background: #eef4ff;
  font-weight: 600;
  font-size: 0.9rem;
  padding: 0.6rem 0.75rem;
}

.section-header-row td {
  background: #e4ecf3;
  color: #1a4a6e;
  font-weight: 700;
  padding: 0.5rem 0.75rem;
}

.category-header-row td {
  background: #f2f6fa;
  color: #1a4a6e;
  font-weight: 600;
  font-size: 0.92rem;
  padding: 0.4rem 0.75rem 0.4rem 1.25rem;
}

.group-note {
  color: #607080;
  font-weight: 400;
  font-style: italic;
}

.group-child-row td:first-child {
  padding-left: 1.75rem;
  color: #444;
}

.group-child-cell {
  color: #8a97a3;
  font-style: italic;
  font-size: 0.85rem;
  text-align: center;
}

.respond-table {
  table-layout: fixed;
  width: 100%;
}

.respond-table thead th {
  position: sticky;
  top: 2.8rem;
  background: #fff;
  box-shadow: 0 1px 0 #ccc;
  z-index: 2;
}

/* Wtg and In each only ever hold a single character (a 1-5 digit, or "N"),
   so both are sized just wide enough for that plus a little breathing
   room -- freed width goes to col-comments below. */
.col-wtg {
  width: 2ch;
  text-align: center;
}

/* Question is deliberately given an explicit width (rather than "whatever
   the other columns leave over") so it's a known, reducible quantity: 35ch
   was the sample RFP spreadsheet's own Text column width (see
   export_requirements' COL_TEXT), reduced 20% to 28ch with the freed 7ch
   given to col-comments; then col-comments' own 46.5ch was in turn reduced
   20% to 37.2ch, with that freed 9.3ch given back here, landing on 37.3ch.
   font-size is trimmed a little on top of that so more of a long
   requirement is visible without needing as many wrapped lines. */
.col-question {
  width: 37.3ch;
  font-size: 0.85rem;
}

/* Mirrors the sample RFP spreadsheet's own Response column width (see
   export_requirements' COL_RESPONSE). A gap-scale <select>'s own dropdown
   list isn't constrained by this width when open (browsers size the open
   list to its longest option regardless), so this doesn't truncate a long
   option's text. Centered on the class itself (shared by both the <th>
   and every data <td>) so the "Your response" heading centers the same
   way its cells do. */
.col-response {
  width: 22ch;
  text-align: center;
}

.col-in {
  width: 2ch;
  text-align: center;
}

/* 46.5ch (see col-question's own comment above for how this got there)
   reduced 20%, with the freed 9.3ch given to col-question. */
.col-comments {
  width: 37.2ch;
}

/* Comment body cells stay left-aligned (free text reads better that way)
   -- only the header label itself centers, to match the other columns'
   headings. */
.respond-table thead th.col-comments {
  text-align: center;
}

.respond-table td input,
.respond-table td select {
  width: 100%;
  box-sizing: border-box;
}

.response-cell {
  text-align: center;
}

.response-cell-input {
  width: 100%;
  box-sizing: border-box;
  text-align: center;
}

.in-input {
  text-align: center;
  text-transform: uppercase;
}

.response-input {
  background: #fff9db;
}

input.response-input,
input.comments-input,
select.response-input {
  text-align: center;
  text-overflow: ellipsis;
  overflow: hidden;
  white-space: nowrap;
}

/* Left-align while actively typing -- centered text re-centers itself
   after every keystroke, which reads as lag/jumpiness while entering a
   long answer. Ellipsis-on-blur (above) is what signals truncated
   content; the title attribute (see respond.html's script) covers the
   rest via hover. */
input.response-input:focus,
input.comments-input:focus {
  text-align: left;
}

/* Currency/percent fields (Estimated Cost, and the Revenue rows in
   Developer/Implementer Information) show "$"/"%" as part of the value
   text itself (see respond.html's tryFormatCurrency/tryFormatPercent) --
   deliberately not a separate overlaid symbol, so it centers as one unit
   with the number instead of looking stuck to one edge. */
.calculated-field {
  background: #eef3f7;
  color: #33475a;
}

/* Live-computed sum of a cost section's license/implementation rows (see
   respond.html's cost-total-row + recomputeCostTotal script), and the
   "License Costs"/"Implementation Costs" heading above each of those
   groups -- both styled like the category headers above so they read as
   summary/divider lines, not just another answerable row. */
.cost-total-row td {
  background: #f2f6fa;
  font-weight: 600;
}

.cost-total-value {
  text-align: center;
}

.cost-group-heading-row td {
  background: #e4ecf3;
  color: #1a4a6e;
  font-weight: 700;
  padding: 0.5rem 0.75rem;
}

.respond-section-nav {
  position: sticky;
  top: 0;
  z-index: 3;
  background: #fff;
  border-bottom: 1px solid #ccc;
  padding: 0.6rem 0.75rem;
  margin-bottom: 0.5rem;
}

.respond-section-nav select {
  margin-left: 0.4rem;
}

.section-header-row {
  scroll-margin-top: 4.8rem;
}

.section-toggle-list {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
  gap: 0.4rem 1.5rem;
  margin-bottom: 0.75rem;
}

.section-toggle {
  display: flex;
  align-items: baseline;
  gap: 0.4rem;
  font-weight: normal;
}

.section-toggle small {
  color: #666;
}

.weighting-changed {
  font-weight: 700;
  background: #fff3cd;
}

.library-search-results {
  max-height: 220px;
  overflow-y: auto;
  border: 1px solid #ccc;
  border-radius: 4px;
  margin-top: 0.25rem;
}

.library-search-results:empty {
  border: none;
  margin-top: 0;
}

.library-search-result {
  padding: 0.4rem 0.6rem;
  cursor: pointer;
  font-size: 0.9rem;
  border-bottom: 1px solid #eee;
}

.library-search-result:last-child {
  border-bottom: none;
}

.library-search-result:hover {
  background: #eef4ff;
}

.visual-reconcile {
  display: flex;
  gap: 1.5rem;
  margin-top: 1rem;
}

.visual-pane {
  flex: 1 1 50%;
  min-width: 0;
  max-height: 75vh;
  overflow-y: auto;
  border: 1px solid #d8e2ea;
  border-radius: 6px;
  padding: 0.75rem 1rem;
}

.visual-pane h2 {
  position: sticky;
  top: -0.75rem;
  background: #fff;
  margin: -0.75rem -1rem 0.75rem;
  padding: 0.75rem 1rem 0.5rem;
  border-bottom: 1px solid #eee;
}

.visual-category {
  border: 1px solid transparent;
  border-radius: 4px;
  padding: 0.3rem 0.5rem;
  margin-bottom: 0.5rem;
}

.visual-category h3 {
  margin: 0.2rem 0;
  font-size: 0.95rem;
  color: #1a4a6e;
}

.visual-category-items {
  margin: 0;
  padding-left: 1.25rem;
  font-size: 0.9rem;
}

.visual-category-active {
  border-color: #1a73e8;
  background: #e8f0fe;
}

.visual-just-added {
  color: #1a73e8;
  font-weight: 600;
}

.visual-new-items, .visual-matched-items {
  list-style: none;
  margin: 0;
  padding: 0;
}

.visual-item-new {
  cursor: grab;
  user-select: none;
  background: #fff8e1;
  border: 1px solid #e8d68a;
  border-radius: 4px;
  padding: 0.4rem 0.6rem;
  margin-bottom: 0.4rem;
  font-size: 0.9rem;
}

.visual-item-matched {
  color: #888;
  background: #f5f5f5;
  border-radius: 4px;
  padding: 0.4rem 0.6rem;
  margin-bottom: 0.4rem;
  font-size: 0.9rem;
}

.visual-item-matched small {
  color: #999;
}

/* Apply with drag and drop: file indentation on both sides, multi-select,
   and the line a drop lands below. */
.visual-indented { margin-left: 1.5rem; }
.visual-category-items li.visual-indented { list-style-type: circle; }
.visual-item-new.selected { background: #dbe8fd; border-color: #1a73e8; }
.visual-item-new.dragging { opacity: 0.5; }
.visual-drop { border-bottom: 2px solid transparent; }
.visual-drop-active { border-bottom-color: #1a73e8; background: #e8f0fe; }
.visual-placed { color: #1a73e8; font-weight: 600; background: #eef4ff; }
.visual-unplace { margin-left: 0.4rem; padding: 0 0.4rem; line-height: 1.2; }
.visual-apply { margin-top: 1rem; }

/* Apply Recommendations: requirement text indented as in the file (or, for
   a close match's library wording, as in the library). */
td.req-text.req-indented, span.req-text.req-indented { padding-left: 1.75rem; }
span.req-text.req-indented { display: inline-block; }
td.req-text.req-indented::before, span.req-text.req-indented::before { content: "\21B3\00a0"; color: #8a96a3; margin-left: -1.1rem; }

/* Import Previous RFPs section picker: the section last worked on. */
.section-picker tr.last-section td { background: #fff8e1; }
.section-picker tfoot th { text-align: left; }

/* "Requirements not in the library" review (rfp_library_review.html) */
.library-review-table { width: 100%; table-layout: fixed; margin: 0; }
.library-review-table + .review-block, .review-block + .review-block { margin-top: -1px; }
.review-block { content-visibility: auto; }
.library-review-table col.c-src { width: 4rem; }
.library-review-table col.c-section { width: 26%; }
.library-review-table col.c-decision { width: 17.5rem; }
.library-review-table td { overflow-wrap: anywhere; }
.library-review-table td { vertical-align: top; }
.library-review-table textarea {
  width: 100%; box-sizing: border-box; font: inherit; font-size: 0.95em; resize: vertical;
}
.library-review-table select, .library-review-table input[type=text] { width: 100%; box-sizing: border-box; }
.library-review-table td.decision input.merge-id { width: 5em; }
.library-review-table .merge-detail { margin: 2px 0 4px 1.4em; padding: 4px 6px; background: #eef3f8; border-radius: 4px; }
.library-review-table .merge-target { display: block; margin-bottom: 2px; }
.library-review-table td.decision label { display: block; margin: 1px 0; font-weight: normal; }

/* Requirements Library: the ways to change the library, as five groups. */
.lib-groups {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(175px, 1fr));
  gap: 0.75rem;
  margin: 0 0 1rem;
}
.lib-group {
  border: 1px solid #d6dde5;
  border-top: 3px solid var(--brand-blue);
  border-radius: 4px;
  padding: 0.5rem 0.75rem;
  background: #fff;
  font-size: 0.9rem;
}
.lib-group h3 {
  margin: 0 0 0.35rem;
  font-size: 0.9rem;
}
.lib-group ul {
  margin: 0;
  padding-left: 1.1rem;
}
.lib-group li { margin: 0.2rem 0; }
/* One colour for every option, whether or not it has been clicked before
   (browsers otherwise show visited links in purple). */
.lib-group a, .lib-group a:visited { color: var(--brand-blue); }
.lib-group p { margin: 0 0 0.35rem; }
.lib-group form.inline-tool { display: inline; }
.lib-group form.inline-tool button { padding: 0.05rem 0.45rem; font-size: 0.8rem; }
.lib-group form.inline-tool input { font-size: 0.8rem; }
.lib-group .lib-note { margin: 0.4rem 0 0; font-size: 0.8rem; color: #555; }

/* A small text-like button (e.g. the x that removes one screenshot). */
button.link-button {
  background: none; border: none; color: #b00020; padding: 0 0.3rem; font-size: 1rem; cursor: pointer;
}

/* Search RFPs: matches from older RFP workbooks outside the app
   (app/older_rfps.py), set apart from the app's own RFPs. */
.lookup-result.older-rfp > summary { color: #555; }
.older-rfp-tag {
  display: inline-block;
  padding: 0 0.4rem;
  margin-right: 0.3rem;
  border-radius: 3px;
  background: var(--brand-orange);
  color: #fff;
  font-size: 0.8em;
  font-weight: 600;
}
.older-rfps-note { color: #555; font-size: 0.9em; }

/* Reorder Sections page */
.section-order {
  list-style: decimal;
  padding-left: 2.2rem;
  max-width: 44rem;
}

.section-order li {
  padding: 0.35rem 0.5rem;
  margin-bottom: 0.25rem;
  border: 1px solid #d6dde6;
  border-radius: 4px;
  background: #fff;
  cursor: grab;
}

.section-order .section-row { display: flex; align-items: center; gap: 0.6rem; }
.section-order li.dragging { opacity: 0.4; }
.section-order li.drop-before { border-top: 3px solid #1f6aa5; }
.section-order li.drop-after { border-bottom: 3px solid #1f6aa5; }
.section-order .drag-handle { color: #8a96a3; letter-spacing: -3px; }
.section-order .section-name { flex: 1; }
.section-order small { color: #66717d; }
.section-order .section-move button { padding: 0 0.45rem; }

/* Search RFPs: tick requirements to copy them (requirements_lookup.html). */
.lookup-copy-bar {
  position: sticky;
  top: 0;
  z-index: 5;
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.5rem 0.75rem;
  padding: 0.5rem 0.75rem;
  margin: 0.75rem 0;
  background: var(--brand-bg);
  border: 1px solid #d5dee8;
  border-radius: 4px;
}
#pick-count { font-weight: 600; }
#copy-status { color: #1a7f37; }
.lookup-copy-hint { flex-basis: 100%; color: #555; font-size: 0.85em; }
.lookup-table { table-layout: fixed; width: 100%; }
.lookup-table col.pick-col { width: 2rem; }
.lookup-table col.wtg-col { width: 3.5rem; }
.lookup-table tr.req-heading td { background: #eef3f8; font-weight: 600; color: var(--brand-blue-dark); }
.lookup-table td.req-text { cursor: pointer; }
.lookup-table tr.via-parent td.req-text { color: #666; }


/* Finalist round and added requirements */
.new-badge {
  display: inline-block;
  padding: 0 0.35rem;
  border-radius: 3px;
  background: #fff1c2;
  color: #6b4e00;
  font-size: 0.75em;
  font-weight: 600;
  vertical-align: middle;
}

.finalist-access {
  border: 1px solid #d6dde6;
  border-radius: 4px;
  padding: 0.5rem 1rem 1rem;
  margin-bottom: 1rem;
  max-width: 48rem;
}

.finalist-access .invite-text {
  width: 100%;
  font-family: inherit;
  margin-bottom: 0.4rem;
}

fieldset .check-option { margin-bottom: 0.3rem; }

/* Vendors menu: a contact who is no longer the vendor's contact. */
tr.inactive-row td, tr.inactive-row input { color: #888; }
.notice {
  background: #eaf4ea;
  border-left: 4px solid #3c8d40;
  padding: 0.5rem 0.75rem;
}
