/* =========================================================
   BuildDaily – Discovery / Metro Theme Overrides
   ========================================================= */

:root {
  --bd-border: #000;
  --bd-text:   #111;
  --bd-muted:  #6b7280;
  --bd-bg:     #fff;
  --bd-shadow: 0 4px 12px rgba(0,0,0,.08);
  --bd-radius: 8px;

  --bd-success: #1a7f2e;
  --bd-info:    #1f6fe5;
  --bd-warn:    #c88719;
  --bd-error:   #b3261e;

  --bd-soft: #f7f7f9;

  --bd-font: Inter, ui-sans-serif, system-ui, -apple-system, "Segoe UI",
             Roboto, "Helvetica Neue", Arial, "Apple Color Emoji", "Segoe UI Emoji";
}

[data-theme="dark"] {
  --bd-border: #fff;
  --bd-text:   #f5f5f7;
  --bd-muted:  #9aa0a6;
  --bd-bg:     #191a1f;
  --bd-shadow: 0 6px 20px rgba(0,0,0,.35);

  --bd-success: #25c06d;
  --bd-info:    #5aa3ff;
  --bd-warn:    #ffb347;
  --bd-error:   #ff6b6b;

  --bd-soft: #20232a;
}

/* === Typography ========================================= */
html, body {
  font-family: var(--bd-font);
  color: var(--bd-text);
  font-size: 15px;
}
h1,h2,h3,h4,h5,h6 {
  font-weight: 600;
  letter-spacing: .2px;
  color: var(--bd-text);
}
.soft-muted { color: var(--bd-muted) !important; }

/* === Cards / Tiles ====================================== */
.bd-card {
  background: var(--bd-bg);
  border: 1px solid var(--bd-border) !important;
  border-radius: var(--bd-radius) !important;
  box-shadow: var(--bd-shadow);
}

.bd-card .dropdown-menu {
  position: absolute;
  will-change: transform;
  z-index: 2000; /* higher than .bd-card */
}

/* === Buttons ============================================ */
.btn-ghost {
  border:1px solid rgba(2,6,23,.08);
  background:#fff;
  color:#111827;
  padding:.35rem .6rem;
  border-radius:.45rem;
  font-size:.85rem;
}
.btn-ghost:hover { background:#f9fafb; }

.btn-primary-soft {
  border:1px solid rgba(37,99,235,.2);
  background:#eff6ff;
  color:#1d4ed8;
  padding:.35rem .6rem;
  border-radius:.45rem;
  font-size:.85rem;
}
.btn-primary-soft:hover { background:#e0efff; }

/* === Inputs ============================================= */
.bd-input,
.form-control.bd-input,
.form-select.bd-input {
  border:1px solid var(--bd-border) !important;
  border-radius:6px !important;
  box-shadow:none !important;
  font-size:.9rem;
}
.bd-input:focus { outline:none; box-shadow:0 0 0 2px rgba(37,99,235,.35) !important; }

/* === Avatars ============================================ */
.avatar-initials {
  width:40px; height:40px;
  border-radius:8px;
  background:#eef2ff;
  color:#3b82f6;
  display:flex;
  align-items:center;
  justify-content:center;
  font-weight:600;
}
.contact-row .avatar-initials { width:32px; height:32px; }

/* === Chips / Tags ======================================= */
.bd-tag {
  display:inline-block;
  padding:.20rem .45rem;
  border-radius:2px;
  font-size:.72rem;
  line-height:1;
  background:#f3f4f6;
  color:#374151;
  border:1px solid rgba(15,23,42,.08);
  margin-right:.25rem;
}

/* === Company Table ====================================== */
.companies-table { width:100%; border-collapse:separate; border-spacing:0; }
.companies-table thead th {
  text-transform:uppercase;
  font-size:.75rem;
  letter-spacing:.08em;
  color:#111827;
  background:#fafbfc;
  border-bottom:1px solid rgba(2,6,23,.06);
  padding:.65rem .9rem;
}
.companies-table tbody td {
  padding:.8rem .9rem;
  border-top:1px solid rgba(2,6,23,.06);
  vertical-align:middle;
}
.companies-table tbody tr:hover td { background:#fafcff; }
.actions-col { width:176px; text-align:right; white-space:nowrap; }

/* === Company Rows ======================================= */
.company-name { font-weight:500; font-size:1.05rem; letter-spacing:.15px; color:#0f172a; }
.company-sub { font-size:.85rem; color:#6b7280; }
.detail-row { background:#fbfdff; }
.detail-inner { padding:16px 4px; }
.contact-row td { background:#fff; }

/* === Detail Cards ======================================= */
.detail-card {
  border:1px solid rgba(2,6,23,.06);
  border-radius:.6rem;
  background:#fff;
  padding:16px;
  margin-bottom:1rem;
}
.detail-head { font-weight:600; font-size:.92rem; color:#111827; }
.detail-item { font-size:.9rem; color:#374151; }
.detail-muted { color:#6b7280; font-size:.85rem; }

/* === Utility Helpers ==================================== */
.bd-accent::before { background:#222; }
.bd-toast-stack { position: fixed; bottom: 16px; right: 16px; z-index: 1080; }

.bd-input-icon {
  position: relative;
  display: block;
}

.bd-input-icon .bd-icon {
  position: absolute;
  top: 50%;
  left: 0.75rem;       /* distance from input border */
  transform: translateY(-50%);
  font-size: 1rem;
  color: #6c757d;      /* muted */
  pointer-events: none;
}

.bd-input-icon > .form-control.bd-has-left-icon {
  padding-left: 2.5rem !important;  /* reserve room for the icon */
}
/* === Discovery Badges ===
   Small, thin-border badges with muted fill and crisp text.
   Replace Bootstrap's chunky pill badges.
*/

.bd-badge {
  display: inline-block;
  font-size: 0.72rem;          /* smaller than Bootstrap default */
  font-weight: 500;
  line-height: 1.2;
  padding: 2px 6px;
  border-radius: 4px;          /* subtle rounding */
  border: 1px solid #000;      /* thin black or contextual border */
  background: #f9f9f9;         /* default muted fill */
  color: #111;                 /* default text color */
  vertical-align: middle;
  white-space: nowrap;
}

/* Contextual variations — muted fills + thin borders */
.bd-badge-success {
  border-color: #1a7f2e;
  background: #e8f4ec;
  color: #145522;
}

.bd-badge-warning {
  border-color: #c88719;
  background: #fff5e1;
  color: #7a4f00;
}

.bd-badge-danger {
  border-color: #b3261e;
  background: #fdebea;
  color: #7a1a14;
}

.bd-badge-info {
  border-color: #1f6fe5;
  background: #e9f1fd;
  color: #123f87;
}

.bd-badge-primary {
  border-color: #00429d;
  background: #e5ecf7;
  color: #102a56;
}

.bd-badge-secondary {
  border-color: #555;
  background: #f0f0f0;
  color: #333;
}
/* === Discovery Card Accents (muted professional palette) === */
.card.border-start {
  border-left-width: 4px !important;
}

.border-start.border-primary {
  border-left-color: #2b3d52 !important; /* muted navy */
}

.border-start.border-success {
  border-left-color: #5c7457 !important; /* sage green */
}

.border-start.border-info {
  border-left-color: #4c6a88 !important; /* steel blue */
}

.border-start.border-warning {
  border-left-color: #a68b49 !important; /* sand/tan */
}

.border-start.border-secondary {
  border-left-color: #666 !important; /* muted gray */
}
.company-card {
  opacity: 0;
  transform: translateY(10px);
  transition: opacity 0.3s ease, transform 0.3s ease;
}
.company-card.htmx-added {
  opacity: 1;
  transform: translateY(0);
}

/* === TomSelect — Discovery unified (drop-in) ===================== */
/* Hide originals when enhanced */
select.ts-hidden-accessible,
select.form-select-sm.tomselected,
select.enhanced.tomselected,
input.tag-input.tomselected,
input.owner-input.tomselected {
  display: none !important;
}

/* Wrapper (outer box) */
.ts-wrapper.form-select-sm,
.ts-wrapper.tag-input,
.ts-wrapper.owner-input {
  width: 100% !important;
  max-width: 100% !important;
  border: 1px solid var(--bd-border) !important;   /* thin, theme border */
  border-radius: 6px !important;                    /* match .bd-input */
  background: #fff !important;
  font-size: .875rem !important;
  box-sizing: border-box !important;
  margin: 0 !important;
  display: flex !important;                         /* not inline-flex */
  align-items: center !important;
  padding: 0 !important;
}

/* Remove inner border (fixes “double box”) */
.ts-wrapper .ts-control {
  border: 0 !important;
  background: transparent !important;
  box-shadow: none !important;
  height: 100% !important;
  padding: 0 .5rem !important;
  display: flex !important;
  align-items: center !important;

}

/* Input inside control */
.ts-wrapper .ts-control input {
  flex: 1 1 auto !important;
  min-width: 120px !important;                      /* keep placeholder visible */
  height: auto !important;
  line-height: 1.2 !important;
  font-size: .8rem !important;
  margin: 0 !important;
  padding: 0 !important;
  border: 0 !important;
  background: transparent !important;
}

/* Single selects (Estimator, Status, etc.) */
.ts-wrapper.form-select-sm.single {
  height: 26.55px !important;                       /* matches .form-select-sm */
  align-items: center !important;
}

/* Multi/tag selects (Departments, Scope, etc.) */
.ts-wrapper.multi.form-select-sm,
.ts-wrapper.multi.tag-input {
  min-height: 26.55px !important;  /* match single baseline */
  height: auto !important;
  align-items: flex-start !important;
  flex-wrap: wrap !important;
}

.ts-wrapper.multi .ts-control {
  padding: 2px 4px !important;     /* small breathing room */
  gap: 2px !important;
}


/* Tag chips */
.ts-wrapper.multi .ts-control .item {
  background: #e9ecef !important;
  border: 1px solid var(--bd-border) !important;
  border-radius: .3rem !important;
  padding: 0 6px !important;
  font-size: .75rem !important;
  line-height: 1.3 !important;
  margin: 1px 2px 1px 0 !important;
  color: #000 !important;
  display: inline-flex !important;
  align-items: center !important;
  max-height: 20px !important;
}

/* Dropdown rows */
.ts-dropdown .option {
  padding: .25rem .5rem !important;
  display: flex !important;
  align-items: center !important;
  gap: .35rem !important;
}


/* Owner field: behave like input, not a chip selector */
.ts-wrapper.owner-input,
.ts-wrapper.owner-input.single {
  height: 26.55px !important;
  align-items: center !important;
}

.ts-wrapper.owner-input .ts-control .item,
.ts-wrapper.owner-input .ts-control .ts-item-as-text {
  background: transparent !important;
  border: 0 !important;
  padding: 0 !important;
  margin: 0 !important;
  line-height: 1.2 !important;
  font-size: .875rem !important;
}
/* Force Owner selected value to render like plain text, not a chip */
.ts-wrapper.owner-input .ts-control .item {
  box-shadow: none !important;
  border: 0 !important;
  background: transparent !important;
}
.bd-badge {
  display: inline-block;
  font-size: 0.75rem;
  padding: 0.2rem 0.55rem;
  border-radius: 1rem;
  background: #f0f0f0;
  color: #333;
  margin-right: 0.25rem;
}
.bd-badge.alt {
  background: #e5f2ff;
  color: #004085;
}
/* Slightly larger estimate badge */
.bd-badge.bd-badge-lg {
  font-size: .9rem;
  padding: .25rem .65rem;
}

/* Owner/description column a bit wider so text doesn't wrap */
.flex-grow-1[style] {
  min-width: 320px; /* increase from ~200 */
}
#file-table th a {
  color: #212529;
  font-weight: 500;
}
#file-table th a:hover {
  text-decoration: underline;
}
#file-table td {
  font-size: .85rem;
  vertical-align: middle;
}
.bd-bulkbar {
  background: #f8f9fa;
  border: 1px solid #000;
  border-radius: .5rem;
  padding: .35rem .5rem;
}
#rfp-form .form-control,
#rfp-form .form-select,
#rfp-form .ts-wrapper.form-control {
  border: 1px solid #000 !important;
  box-shadow: none !important;
}
/* Default hidden state for message UI */
.hidden-message-wrap {
  display: none;
}/* Hide by default using a class */
/* Hide message template + editor unless msg-show is set */
#message-mode-toggle.msg-hidden #message-template-wrap,
#message-mode-toggle.msg-hidden #message-template-wrap .ts-wrapper,
#message-mode-toggle.msg-hidden #custom-message-wrap {
  display: none !important;
}

#message-mode-toggle.msg-show #message-template-wrap {
  display: flex !important;
}
#message-mode-toggle.msg-show #message-template-wrap .ts-wrapper {
  display: block !important;
}
#message-mode-toggle.msg-show #custom-message-wrap {
  display: block !important;
}
.bd-progress {
  height: 6px;
  border: 1px solid #000;
  border-radius: 3px;
  background: #f8f9fa; /* muted background */
  overflow: hidden;
}

.bd-progress-bar {
  height: 100%;
}

.bd-progress-good {
  background-color: #28a745; /* green */
}

.bd-progress-warn {
  background-color: #ffc107; /* yellow */
}

.bd-progress-bad {
  background-color: #dc3545; /* red */
}
.bd-left-accent { border-left: 4px solid transparent; }
.bd-accent-success { border-left-color: #28a745; }
.bd-accent-warn { border-left-color: #ffc107; }
.bd-accent-danger { border-left-color: #dc3545; }
.bd-accent-info { border-left-color: #0dcaf0; }
.bd-accent-muted { border-left-color: #6c757d; }
/* discovery.css */
.bd-chip input[type="radio"] { display:none; }
.bd-chip input[type="radio"]:checked + span {
  background:#fff9db;
  border-color:#000;
  font-weight:600;
}
.bd-card.bd-left-accent {
  position: relative;
  overflow: hidden; /* ensures stripe respects card border radius */
}
/* Fix dropdowns inside RFP cards being clipped */
.bd-card.bd-left-accent {
  overflow: visible !important;
}

.bd-dropdown-fix {
  z-index: 2100;        /* higher than card */
  max-height: 260px;    /* avoid running off screen */
  overflow-y: auto;     /* scroll if too long */
}

.bd-card.bd-left-accent::before {
  content: "";
  position: absolute;
  top: 0;
  left: 0;
  bottom: 0;
  width: 6px;
  border-radius: var(--bd-radius) 0 0 var(--bd-radius); /* match card radius */
}

.bd-card.bd-accent-success::before { background-color: #28a745; }
.bd-card.bd-accent-warn::before    { background-color: #ffc107; }
.bd-card.bd-accent-danger::before  { background-color: #dc3545; }
.bd-card.bd-accent-info::before    { background-color: #0dcaf0; }
.bd-card.bd-accent-muted::before   { background-color: #6c757d; }
.bd-text-sm { font-size: .875rem; }        /* smaller font for names */
.bd-quote-badge {
  font-size: .75rem;
  padding: 2px 6px;
  margin-left: 4px;
  border: 1px solid #000;
  border-radius: 4px;
  background: #f8f9fa;
  white-space: nowrap;
}
/* === RFP Cards / Compact Styling ===================== */

/* smaller text for recipient/company */
.bd-text-sm {
  font-size: 0.875rem;
  line-height: 1.25rem;
}

/* compact quote badges (scope header top 3 quotes) */
.bd-quote-badge,
.bd-badge.bd-badge-lg {
  font-size: 0.8rem;
  padding: 2px 6px;
  border-radius: 4px;
  border: 1px solid #000;
  background: #f8f9fa;
  margin-left: 4px;
  display: inline-block;
  vertical-align: middle;
  white-space: nowrap;
}

/* keep quote badges from looking too “pill-like” */
.bd-badge.bd-badge-lg {
  font-weight: 500;
  background: #f0f0f0;
}

/* progress bar styling for vendor response rates */
.bd-progress {
  height: 6px;
  border: 1px solid #000;
  border-radius: 3px;
  background: #f8f9fa;
  overflow: hidden;
}

.bd-progress-bar {
  height: 100%;
  transition: width 0.3s ease;
}

/* contextual colors */
.bd-progress-good {
  background-color: #28a745; /* green */
}

.bd-progress-warn {
  background-color: #ffc107; /* yellow */
}

.bd-progress-bad {
  background-color: #dc3545; /* red */
}

/* coverage chips refinements */
.bd-chip-good {
  background: #e8f4ec;
  border-color: #28a745;
  color: #145522;
}

.bd-chip-warn {
  background: #fff8e1;
  border-color: #ffc107;
  color: #7a4f00;
}

.bd-chip-bad {
  background: #fdebea;
  border-color: #dc3545;
  color: #7a1a14;
}

.bd-chip-muted {
  background: #f3f4f6;
  border-color: #6c757d;
  color: #374151;
}
/* Make full radio chip highlight, not just text */
.bd-chip {
  display:inline-flex;
  align-items:center;
  gap:.25rem;
  padding:.2rem .55rem;
  font-size:.75rem;
  font-weight:500;
  border:1px solid #000;
  border-radius:.5rem;
  white-space:nowrap; /* prevent text wrapping */
}


.bd-chip input[type="radio"] {
  display: none;
}

.bd-chip:has(input[type="radio"]:checked) {
  background: #fff9db;
  border-color: #000;
  font-weight: 600;
}

.table-secondary td {
  background: #f8f9fa !important;
  font-weight: 500;
}

.table tbody tr:nth-child(even) td {
  background: #fcfcfc;
}

input.form-control-sm.text-end,
select.form-select-sm {
  font-size: .8rem;
  padding: .2rem .3rem;
}
.takeoff-row td {
  border-bottom: 1px solid #000 !important;
  padding: .25rem .4rem;
  font-size: .85rem;
  vertical-align: middle;
}

.takeoff-row .cell {
  outline: none;
  min-width: 60px;
}

.takeoff-row .cell:focus {
  background: #fffbe6;  /* pale yellow highlight */
  outline: 1px solid #000;
}

.num-cell {
  text-align: right;
  font-family: monospace;
}


.table-secondary td {
  background: #f8f9fa !important;
  font-weight: 500;
}

.border-dashed {
  border-style: dashed !important;
}
.crew-row td {
  border-bottom: 1px solid #000 !important;
  padding: .25rem .4rem;
  font-size: .85rem;
  vertical-align: middle;
}

.crew-row td[contenteditable="true"] {
  outline: none;
  cursor: text;
}

/* Left accent stripe */
.bd-left-accent {
  position: relative;
}
.bd-left-accent::before {
  content: "";
  position: absolute;
  top: 0; left: 0; bottom: 0;
  width: 4px;
  background-color: var(--accent-color, #6c757d);
}

/* Chevron animation */
.chevron {
  transition: transform 0.25s ease;
}
.chevron.rotate {
  transform: rotate(180deg) !important;
}
#takeoff-table th {
  text-align: right !important;
}
#takeoff-table th:first-child {
  text-align: left !important;
}
/* Base Discovery badge */
/* Base Discovery badge */
.bd-badge {
  display: inline-flex;
  align-items: center;
  gap: .3rem;
  padding: .25rem .6rem;
  font-size: .8rem;
  font-weight: 500;
  border: 1px solid #000;
  border-radius: .4rem;
  line-height: 1.2;
  white-space: nowrap;
  background: #f9f9f9;  /* neutral fallback */
  color: #333;          /* neutral fallback */
}


/* Revenue (muted blue) */
.bd-badge-revenue {
  background-color: #eaf1fb !important;
  color: #084298 !important;
}

/* Costs (muted pink/red) */
.bd-badge-cost {
  background-color: #fdecec !important;
  color: #8c1c13 !important;
}

/* Gross Profit (muted light green) */
.bd-badge-gross {
  background-color: #e9f8e9 !important;
  color: #145a14 !important;
}

/* Net Profit (muted stronger green) */
.bd-badge-net {
  background-color: #d6f5d6 !important;
  color: #083d14 !important;
}

/* Cashflow Positive (green) */
.bd-badge-cash-pos {
  background-color: #e9f8e9 !important;
  color: #0b5d0b !important;
}

/* Cashflow Negative (red) */
.bd-badge-cash-neg {
  background-color: #fdecec !important;
  color: #a11212 !important;
}

/* Suggested Markup (muted teal/blue-green) */
.bd-badge-markup-suggest {
  background-color: #e6f9f9 !important;
  color: #0b4f4f !important;
}

/* Current Markup (neutral gray) */
.bd-badge-markup-current {
  background-color: #f2f2f2 !important;
  color: #333 !important;
}

#bid-results-table {
  font-family: "Inter", "Segoe UI", sans-serif;
  font-size: 0.9rem;
  width: 100%;
  border-collapse: collapse;
}
#bid-results-table th,
#bid-results-table td {
  padding: .4rem .6rem;
  vertical-align: middle;
}
.editable-input {
  width: 120px !important;
  font-family: inherit;
  font-size: 0.9rem;
  padding: .2rem .4rem;
}
.table-responsive {
  overflow-x: auto;
  -webkit-overflow-scrolling: touch; /* smooth on iOS */
}
.bd-timeline {
  position: relative;
  border-left: 2px solid #e0e0e0; /* vertical line */
  margin-left: .5rem;
  padding-left: 1.5rem;           /* spacing for text after dot */
}


.bd-timeline-item {
  position: relative;
  margin-bottom: 1rem;
}

/* Dot marker */
/* Dot marker */
.bd-timeline-item::before {
  content: "";
  position: absolute;
  left: -1.9rem;     /* pull dot directly over the line */
  top: 0.55rem;      /* vertically aligned with first text line */
  width: 10px;
  height: 10px;
  border-radius: 50%;
  background: #6c757d; /* default gray */
  border: 2px solid #fff;
  box-shadow: 0 0 0 1px #ccc;
}


/* Color-coded dots */
.bd-timeline-item.quote::before   { background: #198754; } /* green */
.bd-timeline-item.followup::before{ background: #0d6efd; } /* blue */
.bd-timeline-item.decline::before { background: #dc3545; } /* red */
.bd-timeline-item.system::before  { background: #6c757d; } /* gray */

/* Text styling */
.bd-timeline-item .fw-semibold {
  font-size: 0.85rem;
}
.bd-timeline-item .text-muted.small {
  font-size: 0.75rem;
  margin-left: .25rem;
}
.bd-timeline-item .fst-italic {
  font-size: 0.8rem;
  color: #555;
  margin-top: 0.15rem;
}
.bd-chip-warn { background:#fff7e6; border-color:#f0ad4e; }
.bd-chip-good { background:#e9f7ef; border-color:#28a745; }
.bd-chip-info { background:#e7f1fb; border-color:#0d6efd; color:#084298; }
/* Discovery-style active chip variations */
.bd-chip.active-good {
  background:#d4f3db;   /* a touch richer than #e9f7ef */
  border-color:#28a745;
  font-weight:600;
}

.bd-chip.active-warn {
  background:#ffe8c2;   /* a touch richer than #fff7e6 */
  border-color:#f0ad4e;
  font-weight:600;
}

.bd-chip.active-info {
  background:#d0e4fc;   /* richer than #e7f1fb */
  border-color:#0d6efd;
  color:#06357a;
  font-weight:600;
}
/* === Fix Lead Pipeline filter row alignment === */
#lead-search-form .form-select-sm,
#lead-search-form .ts-wrapper.form-select-sm,
#lead-search-form .ts-wrapper.js-tag-filter {
  height: 32px !important;
  min-height: 32px !important;
  max-height: 32px !important;
  font-size: .85rem !important;
  line-height: 1.2 !important;
  padding-top: 0 !important;
  padding-bottom: 0 !important;
  display: flex !important;
  align-items: center !important;
  box-sizing: border-box !important;
}

#lead-search-form .ts-wrapper .ts-control {
  height: 100% !important;
  min-height: 100% !important;
  max-height: 100% !important;
  padding: 0 .5rem !important;
  display: flex !important;
  align-items: center !important;
}

#lead-search-form .ts-wrapper .ts-control input {
  height: auto !important;
  line-height: 1.2 !important;
  font-size: .85rem !important;
  margin: 0 !important;
  padding: 0 !important;
  border: 0 !important;
  background: transparent !important;
}

#lead-search-form .ts-wrapper.multi .ts-control {
  flex-wrap: wrap !important;
  gap: 2px !important;
  padding: 2px 4px !important;
}

/* Shrink the tag chips so they fit cleanly in 32px control */
#lead-search-form .ts-wrapper.multi .ts-control .item {
  background: #e9ecef !important;
  border: 1px solid #000 !important;
  border-radius: .25rem !important;
  font-size: .75rem !important;
  line-height: 1.2 !important;
  padding: 0 5px !important;
  margin: 1px 2px 1px 0 !important;
  max-height: 18px !important;
}
/* === Force unified compact height (26.55px) for Lead Pipeline filters === */
#lead-search-form .form-control,
#lead-search-form .form-select-sm,
#lead-search-form .ts-wrapper.form-select-sm,
#lead-search-form .ts-wrapper.js-tag-filter,
#lead-search-form .ts-wrapper.tag-input {
  height: 26.55px !important;
  min-height: 26.55px !important;
  max-height: 26.55px !important;
  font-size: .8rem !important;
  line-height: 1.2 !important;
  padding-top: 0 !important;
  padding-bottom: 0 !important;
  display: flex !important;
  align-items: center !important;
  box-sizing: border-box !important;
}

/* Input group for search box */
#lead-search-form .input-group-sm .form-control {
  height: 26.55px !important;
  font-size: .8rem !important;
  padding: 0 .45rem !important;
}

/* Inner TomSelect controls */
#lead-search-form .ts-wrapper .ts-control {
  height: 100% !important;
  min-height: 100% !important;
  max-height: 100% !important;
  padding: 0 .4rem !important;
  display: flex !important;
  align-items: center !important;
}

/* Tag multi-select cleanup */
#lead-search-form .ts-wrapper.multi .ts-control {
  flex-wrap: wrap !important;
  gap: 2px !important;
  padding: 0 2px !important;
}

#lead-search-form .ts-wrapper.multi .ts-control .item {
  background: #e9ecef !important;
  border: 1px solid #000 !important;
  border-radius: .25rem !important;
  font-size: .7rem !important;
  line-height: 1.2 !important;
  padding: 0 5px !important;
  margin: 1px 2px 1px 0 !important;
  max-height: 16px !important;
}

/* segmented radio bar */
/* Distribution badge dropdown */
.bd-dist{
  display:inline-flex; align-items:center; gap:.35rem;
  border:1px solid #000; border-radius:.5rem;
  padding:.2rem .55rem; line-height:1; font-size:.78rem;
  background:#fff; color:#212529;
}
.bd-dist:hover{ background:#f8f9fa; }
.bd-dist.dropdown-toggle::after{ margin-left:.35rem; }

.bd-dist-info  { background:#e7f1fb; border-color:#0d6efd; color:#0b5ed7; }
.bd-dist-warn  { background:#fff7e6; border-color:#f0ad4e; color:#a96f05; }
.bd-dist-bad   { background:#ffe5e5; border-color:#dc3545; color:#b02a37; }
.bd-dist-muted { background:#f1f3f5; border-color:#6c757d; color:#495057; }

.dropdown-menu{ font-size:.8rem; min-width: 220px; }
.dropdown-item.active{ font-weight:600; }

/* inline edit affordance */
.bd-clickable{ cursor:pointer; border-radius:.25rem; transition:background .12s ease; }
.bd-clickable:hover{ background:#fff9db; }

/* inline edit badge */
.edit-badge{
  display:inline-flex; align-items:center; border:1px solid #000;
  border-radius:.35rem; background:#fff9db; min-width:140px; padding:0 .25rem;
}


/* inline edit behavior */
.cell-wrapper { display:inline-block; min-width:180px; text-align:right; }
.cell-display { display:inline-block; min-width:140px; }
.bd-clickable { cursor:pointer; }
.edit-badge { display:inline-flex; align-items:center; border:1px solid #000;
  border-radius:.35rem; background:#fff9db; min-width:140px; padding:0 .25rem; }
.editable-input { border:none; outline:none; background:transparent; font:inherit; width:100%; }
.hidden { display:none !important; }

/* muted chip for competitor label */
.bd-chip-muted { background:#f1f3f5; border-color:#6c757d; color:#495057; }

.save-checkmark {
  animation: fadeOut 1.2s ease forwards;
  font-size: 0.85rem;
  opacity: 0.9;
}

@keyframes fadeOut {
  0%   { opacity: 1; transform: scale(1); }
  80%  { opacity: 1; }
  100% { opacity: 0; transform: scale(0.8); }
}
/* Chip-style dropdown caret (status badge) */
.bd-chip.dropdown-toggle::after{
  content:"";
  display:inline-block;
  margin-left:.35rem;
  vertical-align:.2em;
  border-top:.35em solid currentColor;
  border-right:.35em solid transparent;
  border-left:.35em solid transparent;
}

/* (optional) slightly larger hit area for chip triggers */
.bd-chip.dropdown-toggle {
  cursor: pointer;
}
.btn .bd-chip-inner {
  border: none;
  background: transparent;
  padding: 0;
  font-weight: 500;
}
/* Discovery inputs */
.bd-input {
  border: 1px solid #000;
  border-radius: .35rem;
  font-size: .9rem;
  padding: .4rem .55rem;
  width: 100%;
  font-family: "Inter", "Segoe UI", sans-serif;
  box-shadow: none !important;
}

.bd-input:focus {
  outline: none;
  border-color: #111;
  background-color: #fffdf5;
}

/* Avatar centering */
#profile-avatar {
  display: flex;
  flex-direction: column;
  align-items: center;
}

/* Hide ugly file input */
#profile-avatar input[type="file"] {
  display: none;
}

/* Override bootstrap progress colors for Discovery style */
.progress-bar.bg-danger { background-color: #b3261e !important; }
.progress-bar.bg-warning { background-color: #c88719 !important; }
.progress-bar.bg-info    { background-color: #1f6fe5 !important; }
.progress-bar.bg-success { background-color: #1a7f2e !important; }
.progress-bar.bg-secondary { background-color: #999 !important; }
/* Offcanvas padding */
#rightbar .offcanvas-body {
  padding: 1rem; /* give breathing room */
}

#rightbar .bd-card {
  margin-bottom: .5rem;
  margin-left: .3rem;
  margin-right: .3rem;
}

.offcanvas {
  z-index: 1045 !important;
}
.offcanvas-backdrop {
  z-index: 1040 !important;
}
.offcanvas-backdrop {
  background-color: rgba(0,0,0,.25) !important; /* softer than default .5 */
}
/* Rightbar font + sizing */
#rightbar {
  font-family: var(--bd-font) !important;
  font-size: 0.9rem;
  color: var(--bd-text);
}

/* Offcanvas header Discovery style */
#rightbar .offcanvas-header {
  padding: 0.5rem 0.75rem;   /* tighter than Bootstrap default */
  border-bottom: 1px solid var(--bd-border);
}

#rightbar .offcanvas-header h5 {
  font-size: 0.95rem;        /* smaller heading */
  font-weight: 500;
  margin: 0;
  color: var(--bd-text);
  letter-spacing: .1px;
}

/* Replace Bootstrap X */
#rightbar .bd-close {
  border: 1px solid var(--bd-border);
  border-radius: 6px;
  padding: 2px 6px;
  font-size: 0.9rem;
  background: #fff;
  color: var(--bd-text);
  cursor: pointer;
  line-height: 1;
}

#rightbar .bd-close:hover {
  background: #f9f9f9;
}
/* Rightbar links → muted Discovery look, no Bootstrap purple */
#rightbar a {
  color: var(--bd-text);
  font-size: 0.85rem;
  text-decoration: none;
}
#rightbar a:hover {
  color: var(--bd-muted);
  text-decoration: underline;
}

/* Card header labels inside rightbar */
#rightbar .section-title {
  font-size: 0.8rem;
  font-weight: 500;
  color: var(--bd-muted);
  text-transform: uppercase;
  letter-spacing: .04em;
  margin-bottom: .35rem;
}

/* Offcanvas close icon anchored top right */
#rightbar .offcanvas-header {
  position: relative;
  padding: 0.5rem 0.75rem;
  border-bottom: 1px solid var(--bd-border);
}
#rightbar .offcanvas-header .bd-close {
  position: absolute;
  top: 0.5rem;
  right: 0.75rem;
  border: none;
  background: transparent;
  font-size: 1rem;
  color: var(--bd-muted);
  cursor: pointer;
}
#rightbar .offcanvas-header .bd-close:hover {
  color: var(--bd-text);
}
/* 🔍 Responsive global search bar */
.search-wrapper {
  min-width: 180px;     /* never collapse too far */
  max-width: 100%;      /* default full width */
}

@media (min-width: 576px) {   /* sm+ */
  .search-wrapper { max-width: 400px; }
}

@media (min-width: 768px) {   /* md+ */
  .search-wrapper { max-width: 600px; }
}

@media (min-width: 992px) {   /* lg+ */
  .search-wrapper { max-width: 800px; }
}

@media (min-width: 1200px) {  /* xl+ */
  .search-wrapper { max-width: 1000px; }
}

@media (min-width: 1400px) {  /* xxl */
  .search-wrapper { max-width: 1200px; }
}
/* 🔧 Remove white strip on left of logo box */
#page-topbar .navbar-header {
  padding-left: 0 !important; /* override px-3 spacing */
}

#page-topbar .navbar-brand-box {
  margin-left: 0 !important;
}
.fade-area.htmx-request {
  opacity: 0.5;
  transition: opacity 0.2s ease-in-out;
}
#search-clear {
  background: transparent;
  border: none;
  line-height: 1;
}

#search-clear:hover {
  color: #000;
}
/* 🔄 Skeleton shimmer */
.skeleton {
  position: relative;
  background: #f0f0f0;
  overflow: hidden;
}
.skeleton::after {
  content: "";
  position: absolute;
  top: 0; left: -150px;
  height: 100%; width: 150px;
  background: linear-gradient(90deg, transparent, rgba(255,255,255,.6), transparent);
  animation: shimmer 1.2s infinite;
}
@keyframes shimmer {
  100% { transform: translateX(100%); }
}

/* Skeleton table rows */
.skeleton-row {
  height: 20px;
  margin-bottom: 10px;
  border-radius: 4px;
}
/* Fade dim when htmx request fires */
#main-content.htmx-request {
  opacity: 0.5;
  transition: opacity 0.2s ease-in-out;
}
/* === Quick Search Results (Discovery style) === */
#quick-search-results .list-group {
  border: 1px solid #000;          /* thin black border like other Discovery cards */
  border-radius: .5rem;
  overflow: hidden;
}

#quick-search-results .list-group-item {
  padding: .45rem .75rem;
  font-size: .875rem;
  border: none;
  border-bottom: 1px solid #f0f0f0;
  display: flex;
  align-items: center;
  gap: .5rem;
}

#quick-search-results .list-group-item:last-child {
  border-bottom: none;
}

#quick-search-results .list-group-item:hover {
  background-color: #f8f9fa;
}

#quick-search-results .bd-badge {
  font-size: .7rem;
  padding: .2rem .45rem;
  border-radius: .35rem;
  flex-shrink: 0;
}

#quick-search-results .fw-medium {
  font-weight: 500;
}

#quick-search-results .text-truncate {
  max-width: 320px;  /* keep snippet from pushing too wide */
}
/* === Quick Search Panel Animation === */
#quick-search-results {
  opacity: 0;
  transform: translateY(4px);
  transition: opacity .18s ease, transform .18s ease;
  pointer-events: none;
}

#quick-search-results.is-visible {
  opacity: 1;
  transform: translateY(0);
  pointer-events: auto;
}
/* === Quick Search Loading Spinner Animation === */
#quick-search-results .loading-state {
  opacity: 0;
  transition: opacity .15s ease;
}

#quick-search-results .loading-state.show {
  opacity: 1;
}
/* Force all FA icons in quick search panel to neutral */
#quick-search-results i.fa-solid,
#quick-search-results i.fa-regular,
#quick-search-results i.fa-light,
#quick-search-results i.fa-duotone {
  color: #444 !important;    /* soft dark neutral */
}

#quick-search-results .qs-item { position: relative; padding-right: 32px; }
#quick-search-results .qs-chevron {
  position: absolute;
  right: 12px;
  top: 50%;
  transform: translateY(-50%);
  color: #9aa0a6;
}
/* === Fix card/list-group border radius clipping === */
.bd-card .list-group {
  border: 0 !important;              /* outer card already has border */
  border-radius: inherit !important; /* use the card's rounding */
  overflow: hidden;                   /* clip children to rounded card */
}

.bd-card .list-group-item {
  border-left: 0 !important;
  border-right: 0 !important;
}

.bd-card .list-group-item:first-child {
  border-top: 0 !important;
}

.bd-card .list-group-item:last-child {
  border-bottom: 0 !important;
}
.bd-highlight {
  background: #fff9db;   /* pale yellow */
  border-radius: 3px;
  padding: 0 .15em;
  font-weight: 600;
}
/* === Search-only badge utilities (punch through globals) === */
.bd-badge-search {
  display: inline-flex;
  align-items: center;
  gap: .3rem;
  padding: 2px 6px;
  font-size: .78rem;
  line-height: 1.2;
  border: 1px solid #000 !important;
  border-radius: 4px;
  white-space: nowrap;
}

/* Module colors (hard override) */
.bd-badge-search-estimate  { background:#e9f1fd !important; color:#123f87 !important; border-color:#1f6fe5 !important; }
.bd-badge-search-lead      { background:#e8f4ec !important; color:#145522 !important; border-color:#1a7f2e !important; }
.bd-badge-search-contact   { background:#f0f0f0 !important; color:#333 !important;    border-color:#555 !important; }
.bd-badge-search-rfi       { background:#fff5e1 !important; color:#7a4f00 !important; border-color:#c88719 !important; }
.bd-badge-search-submittal { background:#e5ecf7 !important; color:#102a56 !important; border-color:#00429d !important; }
.bd-badge-search-drawing   { background:#fdebea !important; color:#7a1a14 !important; border-color:#b3261e !important; }

/* Ensure modal panels retain bottom rounding */
.modal-panel {
  border-radius: .65rem !important;  /* match your card rounding */
  overflow: hidden;                 /* clip inner children so footer respects radius */
}

/* Fix sticky footer corner clipping */
.modal-panel > .border-top {
  border-bottom-left-radius: .65rem !important;
  border-bottom-right-radius: .65rem !important;
}

/* Ensure cards retain rounded corners with inner content */
.card {
  border-radius: .65rem !important;
  overflow: hidden; /* clip children like footer, list-group, images */
}

.card > .card-footer,
.card > .list-group:last-child,
.card > img:last-child {
  border-bottom-left-radius: .65rem !important;
  border-bottom-right-radius: .65rem !important;
}

/* Responsive tweaks for company detail */
@media (max-width: 768px) {
  /* Stack address/locations/products vertically full width */
  .company-detail .row.g-4 > [class*="col-"] {
    flex: 0 0 100% !important;
    max-width: 100% !important;
  }

  /* Contact cards: make them full-width on narrow screens */
  #contact-card-container .card {
    min-width: 100% !important;
  }
}
/* Lead card responsiveness */
@media (max-width: 768px) {
  .lead-col { flex: 0 0 100% !important; max-width: 100% !important; }
  .bd-card { width: 100% !important; }
  .lead-col .bd-card .d-flex { flex-wrap: wrap !important; }
}

/* =========================================================
   BuildDaily – Mobile & Card Responsiveness Fixes
   (append-only, safe to copy/paste)
   ========================================================= */

/* 🔹 Responsive Estimate Nav Tabs (stack on small screens) */
@media (max-width: 480px) {
  #estimate-nav .bd-footer-link {
    flex: 1 1 100% !important;
    justify-content: center;
    margin-bottom: .25rem;
  }
}

/* 🔹 Stack Estimate Header Info rows */
@media (max-width: 576px) {
  .estimate-header-info > div {
    flex: 0 0 100% !important;
    margin-bottom: .5rem;
  }
}

/* 🔹 Activity Timeline tweaks for readability on phones */
@media (max-width: 576px) {
  .bd-timeline {
    padding-left: 1rem;
  }
  .bd-timeline-item .fw-semibold {
    font-size: .8rem;
  }
  .bd-timeline-item .text-muted.small {
    font-size: .7rem;
  }
}

/* 🔹 TomSelect: bump tap target size on touch devices */
@media (max-width: 768px) {
  .ts-wrapper.form-select-sm,
  .ts-wrapper.tag-input,
  .ts-wrapper.owner-input {
    min-height: 34px !important;  /* bigger for touch */
  }
}

/* 🔹 Prevent card content from clipping rounded corners */
.bd-card,
.card {
  border-radius: .65rem !important;   /* unify Discovery radius */
      /* ensure children respect corners */
}
/* =========================================================
   BuildDaily – Estimate Files Mobile Tweaks
   ========================================================= */

/* 🔹 Make file list tables scrollable on narrow screens */
#estimate-file-manager .table-responsive {
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
}

/* 🔹 Enlarge checkbox hit area on touch devices */
@media (max-width: 768px) {
  .bd-file-check {
    width: 1.25rem !important;
    height: 1.25rem !important;
  }
}

/* 🔹 Prevent long file/folder names from breaking layout */
.bd-file-name,
.bd-folder-link span {
  display: inline-block;
  max-width: 160px;
  overflow: hidden;
  text-overflow: ellipsis;
  vertical-align: middle;
}

@media (max-width: 576px) {
  .bd-file-name,
  .bd-folder-link span {
    max-width: 120px;
  }
}
/* =========================================================
   BuildDaily – Estimate List Mobile Tweaks
   ========================================================= */

/* Relax column widths on small screens */
@media (max-width: 576px) {
  .col-est-owner,
  .col-est-status,
  .col-est-due,
  .estimate-list-header > div {
    min-width: auto !important;
    flex: 1 1 100% !important;
  }
  .col-est-actions {
    flex: 1 1 100% !important;
    text-align: left !important;
    margin-top: .25rem;
  }
}

/* Enlarge checkboxes for touch */
@media (max-width: 768px) {
  .js-estimate-select {
    width: 1.25rem;
    height: 1.25rem;
  }
}

/* Tighter truncation for owner/description */
@media (max-width: 576px) {
  .col-est-owner .text-truncate {
    max-width: 200px;
  }
}
/* =========================================================
   BuildDaily – Estimate Card/Detail Mobile Tweaks
   ========================================================= */

/* Allow row flex children to wrap instead of overflow */
.est-row > .d-flex {
  flex-wrap: wrap;
}

/* Relax column widths on phones */
@media (max-width: 576px) {
  .col-est-owner,
  .col-est-status,
  .col-est-due,
  .col-est-actions {
    min-width: auto !important;
    flex: 1 1 100% !important;
  }
  .col-est-actions {
    text-align: left !important;
    margin-top: .25rem;
  }
  .col-est-owner .text-truncate {
    max-width: 200px;
  }
}

/* Enlarge checkbox hit area for touch */
@media (max-width: 768px) {
  .js-estimate-select {
    width: 1.25rem;
    height: 1.25rem;
  }
}
/* =========================================================
   BuildDaily – Takeoff Table Mobile Handling
   ========================================================= */

/* On narrow screens, let takeoff tables scroll horizontally */
@media (max-width: 768px) {
  #crew-body,
  #items-body {
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
  }
  #crew-table,
  #takeoff-table {
    min-width: 800px;   /* enforce a base width so columns don't collapse */
  }
}
/* =========================================================
   BuildDaily – Estimate Submodules Mobile Tweaks
   ========================================================= */

/* TomSelect revision dropdowns: enlarge touch target */
@media (max-width: 768px) {
  #revision-select-letters + .ts-wrapper,
  #revision-select-bidders + .ts-wrapper,
  .ts-wrapper.single {
    min-height: 34px !important;
  }
}

/* Bid Results cell widths */
@media (max-width: 576px) {
  #bid-results-table .cell-wrapper {
    min-width: 90px !important; /* narrower baseline for mobile */
  }
}

/* Revisions & Addendums buttons spacing */
@media (max-width: 576px) {
  #estimate-revisions td.text-end,
  #estimate-addendums .d-flex.gap-1 {
    flex-wrap: wrap;
    gap: .25rem !important;
  }
}
/* =========================================================
   BuildDaily – Estimate Nav Bar Fix
   ========================================================= */

#estimate-nav .bd-footer-link {
  display: inline-flex;
  align-items: center;
  gap: .35rem;
  padding: .35rem .75rem;
  font-size: .85rem;
  font-weight: 500;
  color: #222;
  border: 1px solid #000;
  border-radius: .4rem;
  background: #f9f9f9;
  text-decoration: none;
  white-space: nowrap;
  transition: background .15s ease, color .15s ease;
}

#estimate-nav .bd-footer-link i {
  font-size: .85em;
  opacity: .7;
}

#estimate-nav .bd-footer-link:hover {
  background: #fff;
  color: #000;
}

#estimate-nav .bd-footer-link.active {
  background: #fff9db;
  border-color: #000;
  color: #333;
  font-weight: 600;
}

#estimate-nav {
  flex-wrap: wrap;
}
/* =========================================================
   BuildDaily – Bidder List Header Fix
   ========================================================= */

#estimate-bidders .d-flex.align-items-center.gap-2.flex-wrap {
  flex-wrap: nowrap; /* don’t wrap by default */
}

@media (max-width: 576px) {
  #estimate-bidders .d-flex.align-items-center.gap-2.flex-wrap {
    flex-wrap: wrap; /* allow wrapping on small screens */
  }
}
/* =========================================================
   BuildDaily – Normalize header control heights
   ========================================================= */

/* Match buttons to small form-select height */
.bidders-header-actions .btn-sm {
  padding-top: .2rem;
  padding-bottom: .2rem;
  line-height: 1.2;
  font-size: .8rem;
}
/* =========================================================
   BuildDaily – Fix Bidder Header Button Wrapping
   ========================================================= */

/* Don’t let buttons shrink or wrap inside bidders header */
.bidders-header-actions .btn-sm {
  white-space: nowrap !important;  /* keep text on one line */
  flex-shrink: 0 !important;       /* don’t shrink to fit */
}
/* =========================================================
   BuildDaily – Bid Letter Header Fix
   ========================================================= */

/* Prevent header buttons from wrapping text */
.bidletters-header-actions .btn-sm {
  white-space: nowrap !important;  /* keep label inline */
  flex-shrink: 0 !important;       /* don’t collapse */
}

/* Keep buttons/selects aligned at unified height */
.bidletters-header-actions .form-select-sm,
.bidletters-header-actions .btn-sm {
  height: 28px !important;
  font-size: .8rem !important;
  line-height: 1.25 !important;
  display: inline-flex;
  align-items: center;
}
/* Discovery-style nav link buttons (used in RFP form) */
#rfp-form .bd-nav-link {
  display: inline-flex;
  align-items: center;
  gap: .35rem;
  padding: .35rem .75rem;
  font-size: .8rem;
  font-weight: 500;
  color: #212529;
  border: 1px solid #000;
  border-radius: .5rem;
  background: #fff;
  cursor: pointer;
  user-select: none;
  transition: all .15s ease;
}

#rfp-form .bd-nav-link i {
  font-size: .85em;
  opacity: .7;
}

#rfp-form .bd-nav-link:hover {
  background: #f8f9fa;
}

#rfp-form .bd-nav-link.active {
  background: #fff9db;
  border-color: #e0c84d;
  color: #5c4c00;
}

#rfp-form .bd-nav-link.active i {
  color: #5c4c00;
  opacity: 1;
}
.ts-dropdown, .ts-wrapper .ts-dropdown {
  position: absolute !important;
  z-index: 3000 !important; /* above modal content */
}
/* === Fix dropdown clipping inside modals === */

/* Let modals show overflow when a portal dropdown is open */
.bd-portal-open .modal-panel { overflow: visible !important; }

/* Cards inside modals must not clip dropdowns */
.modal-overlay .card,
.modal-overlay .bd-card {
  overflow: visible !important;
}

/* Hard override for dropdowns inside our portal */
#bd-portal-root .ts-dropdown {
  position: fixed !important;   /* kill the global absolute rule */
  z-index: 9999999 !important;  /* guarantee top */
  pointer-events: auto;
  max-height: 260px;
  overflow-y: auto;
}

/* Mapbox portal list */
#bd-portal-root .bd-address-suggestions-portal {
  position: fixed !important;
  z-index: 9999999 !important;
  pointer-events: auto;
  max-height: 240px;
  overflow-y: auto;
  background: #fff;
}
/* When a portaled dropdown is open, don't let containers clip it */
.bd-portal-open .modal-overlay,
.bd-portal-open .modal-panel {
  transform: none !important;
  contain: initial !important;
  will-change: auto !important;
}

.bd-portal-open .card,
.bd-portal-open .bd-card {
  overflow: visible !important;  /* while dropdown is open */
}

/* Hard guarantees for anything rendered in the portal */
#bd-portal-root .ts-dropdown {
  position: fixed !important;
  z-index: 9999999 !important;
  max-height: 260px;
  overflow-y: auto;
  pointer-events: auto;
}

/* === Discovery Badges (unified to match Dashboard) === */
.bd-badge {
  display: inline-flex;
  align-items: center;
  gap: .35rem;
  font-size: 0.75rem;
  font-weight: 500;
  line-height: 1.2;
  padding: 0.25rem 0.6rem;
  border: 1px solid #000;
  border-radius: .75rem;     /* pill-like but not chunky */
  background: #f9f9f9;
  color: #333;
  white-space: nowrap;
}

/* Pill variation (explicit) */
.bd-badge.bd-pill {
  border-radius: 999px !important;
  padding: 0.25rem 0.75rem;
}

/* Contextuals */
.bd-badge-success  { background:#e8f4ec; color:#145522; border-color:#1a7f2e; }
.bd-badge-warning  { background:#fff5e1; color:#7a4f00; border-color:#c88719; }
.bd-badge-danger   { background:#fdebea; color:#7a1a14; border-color:#b3261e; }
.bd-badge-info     { background:#e9f1fd; color:#123f87; border-color:#1f6fe5; }
.bd-badge-primary  { background:#e5ecf7; color:#102a56; border-color:#00429d; }
.bd-badge-secondary{ background:#f0f0f0; color:#333;    border-color:#555; }

/* Small inline badge (like list-compact) */
.list-compact .bd-badge {
  font-size: .7rem;
  padding: 0.2rem 0.45rem;
  border-radius: .35rem;
}
/* === Override Bootstrap Fonts with Discovery Font === */
body,
h1, h2, h3, h4, h5, h6,
.btn,
.badge,
.table,
.nav,
.dropdown-menu,
.list-group-item,
.form-control,
.form-select,
label,
.alert,
.card,
.modal,
.tooltip,
.popover {
  font-family: var(--bd-font) !important;
  letter-spacing: 0 !important;
}

/* Normalize badge font sizing to Discovery spec */
.badge,
.bd-badge {
  font-size: 0.75rem !important;
  font-weight: 500 !important;
  line-height: 1.2 !important;
  padding: 0.25rem 0.55rem !important;
  border-radius: .35rem !important;
}
.bd-folder-link,
  .bd-file-name {
    cursor: pointer;
    transition: color .15s ease, background-color .15s ease;
  }
  .bd-folder-link:hover,
  .bd-file-name:hover {
    text-decoration: underline;
    text-decoration-thickness: 1px;
    background-color: #fffbea; /* matches your row hover tint */
  }

  /* Full-row left stripe for folders (hover + selected) */
  .bd-file-row.is-folder > td:first-child { position: relative; }
  .bd-file-row.is-folder:hover > td:first-child::before,
  .bd-file-row.is-folder.selected > td:first-child::before {
    content: "";
    position: absolute;
    left: 0; top: 0; bottom: 0;
    width: 4px;
    background: #fcc419; /* Discovery yellow */
    border-radius: .25rem 0 0 .25rem;
  }

  .bd-file-row.is-folder > td:first-child,
  .bd-file-row.is-file > td:first-child {
    position: relative;
  }
  .bd-file-row.is-folder:hover > td:first-child::before,
  .bd-file-row.is-folder.selected > td:first-child::before,
  .bd-file-row.is-file:hover > td:first-child::before,
  .bd-file-row.is-file.selected > td:first-child::before {
    content: "";
    position: absolute;
    left: 0; top: 0; bottom: 0;
    width: 4px;
    background: #fcc419; /* Discovery yellow */
    border-radius: .25rem 0 0 .25rem;
  }
/* Arrow between pipeline chips */
.bd-arrow {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: .8rem;
  color: #666;
  margin: 0 .25rem;
}

.bd-arrow::before {
  content: "\f061"; /* fa-arrow-right */
  font-family: "Font Awesome 6 Free";
  font-weight: 900;
  opacity: .7;
}
/* Allow dropdowns inside bidder cards to escape clipping */
#estimate-bidders .bd-card,
#estimate-bidders .bd-card.bd-left-accent {
  overflow: visible !important;
}
@keyframes slideUpFade {
  from {
    transform: translateY(30px) !important;
    opacity: 0 !important;
  }
  to {
    transform: translateY(0) !important;
    opacity: 1 !important;
  }
}

.est-row.htmx-added {
  animation: slideUpFade 0.35s ease-out both !important;
}
/* === Local override for Estimate list badges === */
.estimate-list .bd-badge {
  font-size: 0.8rem;
  padding: 0.25rem 0.6rem;
  border-radius: .4rem;
  font-weight: 500;
  border: 1px solid #000;
  background: #f9f9f9;
  color: #333;
}

.estimate-list .bd-badge-high {
  background: #fdebea;
  border-color: #b3261e;
  color: #7a1a14;
}

.estimate-list .bd-badge-low {
  background: #e9f1fd;
  border-color: #1f6fe5;
  color: #123f87;
}

.estimate-list .bd-badge-normal {
  background: #f0f0f0;
  border-color: #555;
  color: #333;
}

/* clickable estimate badge link */
.estimate-list .estimate-badge-link {
  cursor: pointer;
}

.estimate-list .estimate-badge-link .bd-badge {
  transition: background-color .25s ease, transform .25s ease;
}

.estimate-list .estimate-badge-link:hover .bd-badge {
  background-color: #fff9db;   /* Discovery pale yellow */
  transform: scale(1.05);
}

/* Pulse animation when new row loads */
@keyframes badgePulse {
  0%   { box-shadow: 0 0 0 0 rgba(240, 173, 78, 0.6); }
  70%  { box-shadow: 0 0 0 6px rgba(240, 173, 78, 0); }
  100% { box-shadow: 0 0 0 0 rgba(240, 173, 78, 0); }
}

.est-row.htmx-added .estimate-badge-link .bd-badge {
  animation: badgePulse 1s ease-out;
}
/* === Estimate List Column Layout Overrides === */
/* Checkbox + Estimate # */
.estimate-list .col-est-rail {
  flex: 0 0 110px !important;
  min-width: 110px !important;
  justify-content: flex-start;
}

/* Owner / Description — main content */
.estimate-list .col-est-owner {
  flex: 3 1 auto !important;
  min-width: 260px !important;
  max-width: 480px !important;
}

/* Estimator (stacked with due if needed) */
.estimate-list .col-est-user {
  flex: 1 1 120px !important;
  min-width: 120px !important;
  max-width: 160px !important;
  text-align: right;
}

/* Status + Priority */
.estimate-list .col-est-status {
  flex: 1 1 120px !important;
  min-width: 120px !important;
  max-width: 160px !important;
  justify-content: flex-start;
}

/* Due Date — flexes, but content right-aligned */
.estimate-list .col-est-due {
  flex: 1 1 auto !important;
  min-width: 160px !important;
  text-align: right;
}

/* Actions — fixed, stuck to right edge */
.estimate-list .col-est-actions {
  flex: 0 0 120px !important;
  min-width: 120px !important;
  max-width: 140px !important;
  text-align: right !important;
  margin-left: auto !important;   /* pushes it hard-right */
  display: flex !important;
  justify-content: flex-end !important;
  gap: .25rem;
}


.chevron {
  transition: transform 0.25s ease !important;
}
.chevron.rotate {
  transform: rotate(180deg);
}
/* Reset the bad flex rule just for headers */
.estimate-list-header > div {
  flex: initial !important;
}

/* Column sizing for headers ONLY */
.estimate-list-header .col-est-rail {
  flex: 0 0 110px !important;
  min-width: 110px !important;
  justify-content: flex-start;
}

.estimate-list-header .col-est-owner {
  flex: 3 1 auto !important;
  min-width: 120px !important;
  max-width: 400px !important;
}

.estimate-list-header .col-est-status {
  flex: 1 1 110px !important;
  min-width: 110px !important;
  max-width: 110px !important;
  justify-content: flex-start;
}

.estimate-list-header .col-est-user {
  flex: 1 1 160px !important;
  min-width: 160px !important;
  max-width: 220px !important;
  text-align: right !important;
}

.estimate-list-header .col-est-actions {
  flex: 0 0 120px !important;
  min-width: 120px !important;
  max-width: 140px !important;
  margin-left: auto !important;
  display: flex !important;
  justify-content: flex-end !important;
  text-align: right !important;
}/* --- Chevron rotation --- */
.chev { transition: transform .25s ease !important; }
.chev.rotate { transform: rotate(180deg) !important; }

/* --- Card entry/exit (fade only, for row swaps) --- */
.est-row.htmx-added {
  animation: cardFadeIn .18s ease-out both !important;
}
.est-row.htmx-swapping {
  animation: cardFadeOut .18s ease-in both !important;
}

/* --- Accordion-style expandable section --- */
.expandable {
  max-height: 0 !important;
  overflow: hidden !important;
  opacity: 0 !important;
  transition: max-height .35s ease, opacity .25s ease !important;
}
.expandable.show {
  max-height: 2000px !important; /* tall enough for full content */
  opacity: 1 !important;
}
.est-row.htmx-added {
  animation: cardSlideIn .28s ease-out both;
}
.est-row.htmx-swapping {
  animation: cardSlideOut .20s ease-in both;
}


/* --- Keyframes --- */
@keyframes cardFadeIn {
  from { opacity: 0; }
  to   { opacity: 1; }
}
@keyframes cardFadeOut {
  from { opacity: 1; }
  to   { opacity: 0; }
}
/* --- Estimate Nav: Render Style --- */
#estimate-nav {
  border-top: 1px solid #000 !important;
  margin-top: .5rem !important;
  padding: .6rem 0 !important;
  display: flex !important;
  justify-content: center !important;
  background: #fff !important;
}

#estimate-nav nav {
  display: flex !important;
  flex-wrap: wrap !important;
  justify-content: center !important;
  gap: .6rem !important;
  width: 100% !important;
}

/* Pill baseline */
#estimate-nav .bd-pill-link {
  display: inline-flex !important;
  align-items: center !important;
  gap: .45rem !important;
  font-size: .85rem !important;
  font-weight: 500 !important;
  color: #2d2d2d !important;
  background: #f5f6f8 !important;   /* cool gray base */
  border-radius: .35rem !important; /* subtle, not bubble */
  padding: .45rem .9rem !important;
  line-height: 1.2 !important;
  text-decoration: none !important;
  transition: background .2s ease, color .2s ease !important;
  cursor: pointer !important;
}

/* Icon style */
#estimate-nav .bd-pill-link i {
  font-size: .9em !important;
  opacity: .65 !important;
  transition: opacity .2s ease, color .2s ease !important;
}

/* Hover */
#estimate-nav .bd-pill-link:hover {
  background: #e8eaed !important;
  color: #000 !important;
}
#estimate-nav .bd-pill-link:hover i {
  opacity: .9 !important;
}

/* Active state (navy/charcoal) */
#estimate-nav .bd-pill-link.active {
  background: #1a1f2d !important;  /* dark navy/charcoal */
  color: #fff !important;
  font-weight: 600 !important;
}
#estimate-nav .bd-pill-link.active i {
  opacity: 1 !important;
  color: #fff !important;
}

/* Count badge inside pill */
#estimate-nav .bd-pill-link .bd-badge {
  font-size: .7rem !important;
  background: #e0a53c !important;   /* warm gold/orange accent */
  color: #fff !important;
  border-radius: .5rem !important;
  padding: .1rem .45rem !important;
  line-height: 1 !important;
}
.bd-workflow-square {
  display: inline-block;
  width: 12px;
  height: 12px;
  border-radius: 3px;       /* rounded corners */
  margin-right: 4px;
}

.bd-workflow-square {
  display: inline-block;
  width: 12px;
  height: 12px;
  border-radius: 3px;
  margin-right: 4px;
  border: 1px solid #000;   /* thin Discovery border */
}

/* Softer fills pulled from Discovery badge styles */
.bd-workflow-good  { background:#e8f4ec; border-color:#1a7f2e; }
.bd-workflow-warn  { background:#fff5e1; border-color:#c88719; }
.bd-workflow-bad   { background:#fdebea; border-color:#b3261e; }
.bd-workflow-muted { background:#f3f4f6; border-color:#6c757d; }

/* Responsive company detail tweaks */
.company-detail-card .card {
  width: 100%;
}

#detail-row-[id] .d-flex.flex-wrap {
  gap: 1rem;
}

/* Contact cards grow/shrink fluidly */
#detail-row-[id] .card[id^="contact-card-"] {
  flex: 1 1 100%;
  min-width: 260px;
  max-width: 100%;
}

@media (min-width: 768px) {
  #detail-row-[id] .card[id^="contact-card-"] {
    flex: 1 1 280px;
    max-width: 340px;
  }
}
/* =========================================================
   BuildDaily – Fix Estimate List Header Alignment (All Widths)
   ========================================================= */

/* Ensure header and row columns use the same flex-basis */
@media (min-width: 768px) {
  .estimate-list-header .col-est-rail,
  .estimate-list .col-est-rail {
    flex: 0 0 110px !important;
    min-width: 110px !important;
  }
  .estimate-list-header .col-est-owner,
  .estimate-list .col-est-owner {
    flex: 3 1 0 !important;
    min-width: 260px !important;
    max-width: 480px !important;
  }
  .estimate-list-header .col-est-status,
  .estimate-list .col-est-status {
    flex: 1 1 0 !important;
    min-width: 120px !important;
    max-width: 160px !important;
  }
  .estimate-list-header .col-est-user,
  .estimate-list .col-est-user {
    flex: 1 1 0 !important;
    min-width: 160px !important;
    max-width: 220px !important;
  }
  .estimate-list-header .col-est-due,
  .estimate-list .col-est-due {
    flex: 1 1 0 !important;
    min-width: 160px !important;
  }
  .estimate-list-header .col-est-actions,
  .estimate-list .col-est-actions {
    flex: 0 0 120px !important;
    min-width: 120px !important;
    justify-content: flex-end !important;
    text-align: right !important;
  }
}

/* Stack columns gracefully on tablets/phones */
@media (max-width: 767.98px) {
  .estimate-list-header > div,
  .est-row > .d-flex > div {
    flex: 1 1 100% !important;
    min-width: 100% !important;
    text-align: left !important;
  }
}

/* =========================================================
   BuildDaily – Hide Gridstack Handles on Mobile
   ========================================================= */

/* =========================================================
   BuildDaily — Gridster Vertical Spacing & Layout Polish
   ========================================================= */
/* --- Gridster base fix --- */
.gridster {
  position: relative !important;
  background: #f8f9fa;
  padding: 0 !important;
}

.gridster > ul {
  margin: 0 !important;
  padding: 0 !important;
  list-style: none;
}

.gridster > ul > li {
  margin: 0 !important;        /* ❌ remove vertical margin drift */
  padding: 0 !important;
  position: absolute !important;
}

/* Widget appearance */
.gridster .widget {
  background: #fff;
  border: 1px solid var(--bd-border);
  border-radius: .5rem;
  box-shadow: 0 2px 4px rgba(0,0,0,.05);
  display: flex;
  flex-direction: column;
  height: 100%;
  width: 100%;
}
/* === Rounded corner + shadow fix for Gridster widgets === */
.gridster > ul > li {
  overflow: visible !important;          /* allow card to render full radius */
  z-index: 1;                            /* keep card above base layer */
}

.gridster .widget {
  overflow: visible !important;          /* allow inner shadows/rounded edges */
  border-radius: 0.5rem !important;      /* restore full curve */
}

.gridster .card-header {
  border-top-left-radius: 0.5rem;
  border-top-right-radius: 0.5rem;
}

.gridster .card-body {
  border-bottom-left-radius: 0.5rem;
  border-bottom-right-radius: 0.5rem;
}
/* --- Fix rounded corner clipping on Gridster widgets --- */
.gridster > ul > li.gs-w {
  overflow: visible !important;        /* allow card corners/shadows to show */
  z-index: 2 !important;               /* keep above grid background */
}

/* Prevent parent container from clipping bottom shadows */
.gridster {
  overflow: visible !important;
  padding-bottom: 20px !important;     /* breathing room for shadows */
}


/* Explicit rounded corners for headers/bodies */
.gridster .card-header {
  border-top-left-radius: 0.5rem;
  border-top-right-radius: 0.5rem;
}
.gridster .card-body {
  border-bottom-left-radius: 0.5rem;
  border-bottom-right-radius: 0.5rem;
}
/* --- Dashboard header spacing cleanup --- */
.container-fluid.py-4 {
  padding-top: 0rem !important;   /* ↓ reduced from 4 → 1rem */
  margin-top: 0 !important;       /* eliminate external gap */
}

/* Optional: make the welcome card hug top tighter */
.bd-card.mb-3.p-3.bg-white {
  margin-top: 0 !important;
}

/* Ensure consistent background transition */
body, .app-content {
  background-color: #f8f9fa;      /* same tone as dashboard backdrop */
}
/* =========================================================
   BuildDaily – Dashboard Layout Fix: Disable Gridstack Conflicts
   ========================================================= */

/* Reinforce Gridster behavior only */
.gridster {
  position: relative !important;
  overflow: visible !important;
  background: #f8f9fa;
  padding-bottom: 20px !important;
}

.gridster > ul {
  list-style: none;
  margin: 0 !important;
  padding: 0 !important;
  position: relative !important;
}

.gridster > ul > li {
  position: absolute !important;
  overflow: visible !important;
  z-index: 2 !important;
}

.gridster .widget {
  border-radius: 0.5rem !important;
  overflow: visible !important;
  box-shadow: 0 4px 10px rgba(0,0,0,.08);
}
.bd-metric {
  cursor: grab;
}
.bd-metric:active {
  cursor: grabbing;
}
