﻿/* =====================================================================
   BuildSync theme  (D2A edition)
   Load AFTER bootstrap.min.css (Bootstrap 5.3). One file restyles the
   whole app; page specific <style> blocks can be removed over time.

   Palette rules
     D2A navy   : base, dark panels, headings, top menu
     D2A teal   : main action color (buttons, links, progress)
     BuildSync violet : system signals only (badges, approvals, AI)
   ===================================================================== */

:root {
  /* brand */
  --bs-navy: #00223B;
  --bs-navy-2: #0B3150;
  --bs-navy-3: #14405F;
  --bs-teal: #017BA0;
  --bs-teal-dark: #015F7C;
  --bs-teal-light: #5FC3E4;
  --bs-teal-soft: #E3F1F6;
  --bs-violet: #5646F2;
  --bs-violet-soft: #EEECFF;
  --bs-violet-ink: #3F31D6;

  /* surfaces */
  --bs-ground: #EBEFF3;
  --bs-surface: #FFFFFF;
  --bs-surface-2: #F2F5F8;
  --bs-line: #E1E6EC;
  --bs-ink: #00223B;
  --bs-muted: #5A6275;
  --bs-on-dark-muted: #A7BCCB;

  /* status (each pair passes 4.5:1) */
  --bs-done-bg: #E6F4EF;  --bs-done-ink: #0E6B5C;
  --bs-wait-bg: #FFF5D6;  --bs-wait-ink: #8A5A00;
  --bs-late-bg: #FFEDE3;  --bs-late-ink: #B2410B;
  --bs-info-bg: #E4ECFD;  --bs-info-ink: #1E4DA8;
  --bs-none-bg: #EEF0F4;  --bs-none-ink: #4A5268;

  /* shape and type */
  --bs-radius-sm: 10px;
  --bs-radius: 14px;
  --bs-radius-lg: 22px;
  --bs-radius-xl: 28px;
  --bs-shadow: 0 1px 2px rgba(0, 34, 59, .06);
  --bs-shadow-lg: 0 12px 40px rgba(0, 34, 59, .16);
  --bs-font-body: "Plus Jakarta Sans", system-ui, -apple-system, "Segoe UI", sans-serif;
  --bs-font-display: "Sora", "Plus Jakarta Sans", system-ui, sans-serif;

  /* map onto Bootstrap 5 variables */
  --bs-body-font-family: var(--bs-font-body);
  --bs-body-color: var(--bs-ink);
  --bs-body-bg: var(--bs-ground);
  --bs-primary: var(--bs-teal);
  --bs-primary-rgb: 1, 123, 160;
  --bs-link-color: var(--bs-teal);
  --bs-link-color-rgb: 1, 123, 160;
  --bs-link-hover-color: var(--bs-teal-dark);
  --bs-link-hover-color-rgb: 1, 95, 124;
  --bs-border-color: var(--bs-line);
  --bs-border-radius: var(--bs-radius-sm);
  --bs-secondary-color: var(--bs-muted);
}

/* ---------- base ---------- */
html, body { background: var(--bs-ground); }
body {
  font-family: var(--bs-font-body);
  color: var(--bs-ink);
  font-size: 15px;
  -webkit-font-smoothing: antialiased;
}
h1, h2, h3, h4, .h1, .h2, .h3, .h4, .bs-display {
  font-family: var(--bs-font-display);
  font-weight: 600;
  letter-spacing: -.02em;
  color: var(--bs-ink);
}
h5, h6, .h5, .h6 { font-weight: 700; color: var(--bs-ink); }
a { color: var(--bs-teal); text-decoration: none; }
a:hover { color: var(--bs-teal-dark); }
.text-muted, .text-secondary { color: var(--bs-muted) !important; }
.tabular, td, .money { font-variant-numeric: tabular-nums; }
:focus-visible { outline: 3px solid rgba(1, 123, 160, .45); outline-offset: 2px; }

/* ---------- app shell ---------- */
.bs-app { min-height: 100vh; display: flex; flex-direction: column; }
.bs-shell { width: 100%; max-width: 1360px; margin: 0 auto; padding: 16px 24px 40px; flex: 1 0 auto; position: relative; }

.bs-topbar {
  position: sticky; top: 12px; z-index: 1030;
  display: flex; align-items: center; gap: 16px;
  background: var(--bs-surface); border-radius: 20px;
  padding: 8px 10px 8px 18px; box-shadow: var(--bs-shadow);
  margin-bottom: 20px;
}
.bs-brand { display: flex; align-items: center; gap: 16px; flex-shrink: 0; }
.bs-brand img.bs-logo-app { height: 30px; width: auto; }
.bs-brand img.bs-logo-company { height: 40px; width: auto; max-width: 170px; object-fit: contain; }
.bs-brand .bs-brand-divider { width: 1px; height: 32px; background: var(--bs-line); }
.bs-brand .bs-company-text { font-family: var(--bs-font-display); font-weight: 700; font-size: 16px; color: var(--bs-navy); }

.bs-nav { display: flex; gap: 4px; background: var(--bs-surface-2); border-radius: 14px; padding: 4px; margin: 0; list-style: none; }
.bs-nav > li { position: relative; }
.bs-nav .bs-nav-link {
  height: 40px; padding: 0 14px; border-radius: 11px; border: 0; background: transparent;
  display: flex; align-items: center; gap: 6px;
  font-weight: 600; font-size: 14px; color: #3C4458; white-space: nowrap;
}
.bs-nav .bs-nav-link:hover { background: #E4E9EF; color: var(--bs-ink); }
.bs-nav .bs-nav-link.active, .bs-nav .show > .bs-nav-link { background: var(--bs-navy); color: #FFFFFF; }
.bs-nav .dropdown-toggle::after { border-top-color: currentColor; margin-left: 2px; }

.bs-count {
  min-width: 20px; height: 20px; padding: 0 6px; border-radius: 10px;
  background: var(--bs-violet); color: #FFFFFF; font-size: 11px; font-weight: 700;
  display: inline-flex; align-items: center; justify-content: center;
}


.bs-icon-btn {
  position: relative; width: 44px; height: 44px; border-radius: 12px; border: 0;
  background: var(--bs-surface-2); color: var(--bs-ink);
  display: inline-flex; align-items: center; justify-content: center; flex-shrink: 0;
}
.bs-icon-btn:hover { background: #E4E9EF; color: var(--bs-ink); }
.bs-icon-btn .bs-dot-count { position: absolute; top: 4px; right: 3px; }
.bs-avatar-btn {
  width: 44px; height: 44px; border-radius: 12px; border: 0; background: var(--bs-navy); color: var(--bs-teal-light);
  font-family: var(--bs-font-display); font-weight: 700; font-size: 14px;
}

.bs-footer {
  max-width: 1360px; margin: 0 auto; width: 100%; padding: 18px 30px 28px;
  display: flex; justify-content: space-between; gap: 12px; flex-wrap: wrap;
  font-size: 13px; color: var(--bs-muted);
}
.bs-footer strong { color: var(--bs-navy); }

/* faint BuildSync logo watermark (Package 9.1: BuildSync screens show BuildSync logos only).
   Remove the element in _Layout.cshtml to turn it off. */
.bs-watermark {
  position: fixed; right: 3vw; bottom: 3vh; width: min(36vw, 460px); aspect-ratio: 1803 / 565;
  background-repeat: no-repeat; background-size: contain; background-position: center;
  opacity: .035; pointer-events: none; z-index: 0;
}
/* Lift the shell above the watermark WITHOUT creating a stacking context.
   z-index:40 here used to trap every modal inside #content: Bootstrap appends
   .modal-backdrop to <body> at z-index 1050, so a modal at 1055 nested inside a
   z-index:40 box still painted underneath it and the whole dialog looked greyed
   out. "auto" keeps these above the watermark (they come after it in the DOM and
   it sits at z-index:0) while letting .modal escape to the root stacking context. */
.bs-shell > *:not(.bs-watermark):not(.offcanvas):not(.modal) { position: relative; z-index: auto; }

/* mobile menu
   The top bar needs about 900px to lay out: brand 248, the six nav items 562,
   the bell and avatar 88. It used to collapse to the hamburger below 1199.98px,
   throwing away 300px for nothing. That bit hard on Windows, where 125% display
   scaling turns a 1440px window into 1152 CSS pixels: the whole navigation
   disappeared on a perfectly wide screen and every menu went with it.
   It now collapses at 991.98px, measured: at 992px the bar needs 896 of the 929
   pixels it has, and at 960 it was 47 short. */
.bs-menu-btn { display: none; }
@media (max-width: 1199.98px) and (min-width: 992px) {
  .bs-nav { gap: 0; }
  .bs-nav .bs-nav-link { padding: 0 11px; }
  .bs-brand img.bs-logo-company { height: 34px; }
}
@media (max-width: 991.98px) {
  .bs-nav { display: none; }
  .bs-menu-btn { display: inline-flex; margin-left: auto; }
  .bs-brand img.bs-logo-company { height: 34px; }
}
@media (max-width: 575.98px) {
  .bs-shell { padding: 10px 12px 32px; }
  .bs-topbar { top: 8px; border-radius: 16px; padding: 6px 6px 6px 12px; gap: 10px; }
  .bs-brand { gap: 10px; }
  .bs-brand img.bs-logo-app { height: 22px; }
  .bs-brand img.bs-logo-company { height: 30px; }
  .bs-brand .bs-brand-divider { height: 24px; }
  .bs-hero { padding: 22px 20px !important; border-radius: 22px !important; }
  .bs-hero h1 { font-size: 30px !important; }
}
.bs-offcanvas { background: var(--bs-navy); color: #FFFFFF; }
.bs-offcanvas .offcanvas-title { font-family: var(--bs-font-display); }
.bs-offcanvas .bs-menu-group { font-size: 11px; font-weight: 700; letter-spacing: .1em; text-transform: uppercase; color: var(--bs-on-dark-muted); margin: 18px 0 6px; }
.bs-offcanvas a { display: flex; align-items: center; justify-content: space-between; height: 46px; padding: 0 12px; border-radius: 12px; color: #FFFFFF; font-weight: 600; }
.bs-offcanvas a:hover, .bs-offcanvas a.active { background: var(--bs-navy-2); color: #FFFFFF; }

/* ---------- page building blocks ---------- */
.bs-page-head { display: flex; justify-content: space-between; align-items: flex-end; gap: 16px; flex-wrap: wrap; margin-bottom: 18px; }
.bs-page-head h1 { font-size: 34px; margin: 0; }
.bs-page-head .bs-eyebrow { font-size: 14px; color: var(--bs-muted); font-weight: 500; }

.bs-hero {
  position: relative; overflow: hidden;
  background: var(--bs-navy); color: #FFFFFF; border-radius: var(--bs-radius-xl); padding: 30px 34px;
}
.bs-hero::before {
  content: ""; position: absolute; right: -70px; top: -80px; width: 300px; height: 300px;
  border-radius: 50%; border: 44px solid var(--bs-navy-2); pointer-events: none;
}
.bs-hero > * { position: relative; }
.bs-hero h1, .bs-hero h2, .bs-hero h3 { color: #FFFFFF; }
.bs-hero h1 { font-size: 46px; line-height: 1.04; letter-spacing: -.03em; }
.bs-hero .bs-accent { color: var(--bs-teal-light); }
.bs-hero .text-muted, .bs-hero .bs-muted { color: var(--bs-on-dark-muted) !important; }
.bs-hero .bs-stat { background: var(--bs-navy-2); }
.bs-hero .bs-stat .bs-stat-label, .bs-hero .bs-stat .bs-stat-note { color: var(--bs-on-dark-muted); }
.bs-hero .bs-stat .bs-stat-value { color: #FFFFFF; }
.bs-hero .btn-light { background: var(--bs-teal-light); border-color: var(--bs-teal-light); color: var(--bs-navy); font-weight: 700; }
.bs-hero .btn-outline-light { border-color: #1D4A6B; background: var(--bs-navy-2); color: #FFFFFF; }

.bs-tile { background: var(--bs-surface); border-radius: var(--bs-radius-xl); padding: 24px 26px; box-shadow: var(--bs-shadow); }
.bs-tile-title { font-family: var(--bs-font-display); font-size: 22px; font-weight: 600; letter-spacing: -.01em; margin: 0; }
.bs-tile-head { display: flex; justify-content: space-between; align-items: baseline; gap: 12px; margin-bottom: 14px; }
.bs-tile-hint { font-size: 12px; font-weight: 600; color: var(--bs-muted); white-space: nowrap; }

.bs-stat { background: var(--bs-surface-2); border-radius: 18px; padding: 16px 18px; display: flex; flex-direction: column; gap: 4px; }
.bs-stat-label { font-size: 13px; color: var(--bs-muted); font-weight: 500; }
.bs-stat-value { font-family: var(--bs-font-display); font-size: 28px; font-weight: 600; letter-spacing: -.02em; line-height: 1.1; }
.bs-stat-note { font-size: 12px; color: var(--bs-muted); }

.bs-row-item { display: flex; align-items: center; gap: 14px; padding: 14px 0; border-top: 1px solid #EEF1F5; }
.bs-row-item:first-child { border-top: 0; }
.bs-icon-chip {
  width: 46px; height: 46px; border-radius: 15px; flex-shrink: 0;
  display: inline-flex; align-items: center; justify-content: center;
  font-family: var(--bs-font-display); font-weight: 700; font-size: 14px;
  background: var(--bs-surface-2); color: var(--bs-ink);
}

/* status chips: <span class="bs-chip bs-chip-done">Paid</span> */
.bs-chip { display: inline-flex; align-items: center; gap: 6px; padding: 5px 12px; border-radius: 999px; font-size: 12px; font-weight: 700; line-height: 1.3; white-space: nowrap; background: var(--bs-none-bg); color: var(--bs-none-ink); }
.bs-chip-done { background: var(--bs-done-bg); color: var(--bs-done-ink); }
.bs-chip-wait { background: var(--bs-wait-bg); color: var(--bs-wait-ink); }
.bs-chip-late { background: var(--bs-late-bg); color: var(--bs-late-ink); }
.bs-chip-info { background: var(--bs-info-bg); color: var(--bs-info-ink); }
.bs-chip-next, .bs-chip-system { background: var(--bs-violet-soft); color: var(--bs-violet-ink); }
.bs-chip-brand { background: var(--bs-teal-light); color: var(--bs-navy); }

/* segmented tabs: use on .nav-pills or .nav-tabs with class bs-segmented */
.bs-segmented { display: inline-flex; flex-wrap: wrap; gap: 4px; background: var(--bs-surface); border-radius: 16px; padding: 5px; border: 0 !important; box-shadow: var(--bs-shadow); }
.bs-segmented .nav-link { border: 0 !important; border-radius: 12px !important; height: 42px; padding: 0 18px; display: flex; align-items: center; font-weight: 700; font-size: 14px; color: #3C4458; background: transparent; }
.bs-segmented .nav-link:hover { background: var(--bs-surface-2); color: var(--bs-ink); }
.bs-segmented .nav-link.active { background: var(--bs-navy) !important; color: #FFFFFF !important; }

/* progress ring: <div class="bs-ring" style="--p:58">58%</div> */
.bs-ring {
  --p: 0; --size: 64px; width: var(--size); height: var(--size); border-radius: 50%; flex-shrink: 0;
  background: conic-gradient(var(--bs-teal) calc(var(--p) * 1%), #EEF0F4 0);
  display: grid; place-items: center; font-family: var(--bs-font-display); font-weight: 600; font-size: 15px;
  position: relative;
}
.bs-ring::before { content: ""; position: absolute; inset: 7px; border-radius: 50%; background: var(--bs-surface); }
.bs-ring > span { position: relative; }

/* stage tracker: <ol class="bs-stages"><li class="done">Demo</li><li class="current">Drywall</li><li>Final</li></ol> */
.bs-stages { list-style: none; margin: 0; padding: 0; display: grid; grid-auto-flow: column; grid-auto-columns: minmax(0, 1fr); gap: 6px; }
.bs-stages li { display: flex; flex-direction: column; gap: 10px; font-size: 13px; font-weight: 500; color: var(--bs-muted); }
.bs-stages li::before { content: ""; height: 10px; border-radius: 5px; background: var(--bs-line); }
.bs-stages li.done { color: var(--bs-ink); }
.bs-stages li.done::before { background: var(--bs-teal); }
.bs-stages li.current { color: var(--bs-ink); font-weight: 700; }
.bs-stages li.current::before { background: #8E83FF; }
.bs-hero .bs-stages li { color: #8FA6B8; }
.bs-hero .bs-stages li::before { background: var(--bs-navy-3); }
.bs-hero .bs-stages li.done, .bs-hero .bs-stages li.current { color: #FFFFFF; }
.bs-hero .bs-stages li.done::before { background: var(--bs-teal-light); }

/* ---------- Bootstrap components ---------- */
.card { border: 0; border-radius: var(--bs-radius-lg); box-shadow: var(--bs-shadow); background: var(--bs-surface); }
.card-header { background: transparent; border-bottom: 1px solid #EEF1F5; padding: 18px 22px; font-weight: 700; }
.card-header:first-child { border-radius: var(--bs-radius-lg) var(--bs-radius-lg) 0 0; }
.card-body { padding: 22px; }
.card-footer { background: transparent; border-top: 1px solid #EEF1F5; padding: 14px 22px; }
.card-title { font-family: var(--bs-font-display); font-weight: 600; font-size: 20px; }

.btn { --bs-btn-border-radius: 12px; --bs-btn-font-weight: 600; --bs-btn-padding-y: .55rem; --bs-btn-padding-x: 1.05rem; font-size: 14px; }
.btn-sm { --bs-btn-border-radius: 10px; --bs-btn-padding-y: .35rem; --bs-btn-padding-x: .75rem; font-size: 13px; }
.btn-lg { --bs-btn-border-radius: 14px; }
.btn-primary {
  --bs-btn-bg: var(--bs-teal); --bs-btn-border-color: var(--bs-teal);
  --bs-btn-hover-bg: var(--bs-teal-dark); --bs-btn-hover-border-color: var(--bs-teal-dark);
  --bs-btn-active-bg: #014C63; --bs-btn-active-border-color: #014C63;
  --bs-btn-disabled-bg: var(--bs-teal); --bs-btn-disabled-border-color: var(--bs-teal);
}
.btn-dark, .btn-navy {
  --bs-btn-color: #FFFFFF; --bs-btn-bg: var(--bs-navy); --bs-btn-border-color: var(--bs-navy);
  --bs-btn-hover-color: #FFFFFF; --bs-btn-hover-bg: var(--bs-navy-2); --bs-btn-hover-border-color: var(--bs-navy-2);
  --bs-btn-active-bg: var(--bs-navy-2);
}
.btn-outline-primary {
  --bs-btn-color: var(--bs-teal); --bs-btn-border-color: #B9DCE8;
  --bs-btn-hover-bg: var(--bs-teal-soft); --bs-btn-hover-color: var(--bs-teal-dark); --bs-btn-hover-border-color: var(--bs-teal);
  --bs-btn-active-bg: var(--bs-teal-soft); --bs-btn-active-color: var(--bs-teal-dark);
}
.btn-light, .btn-outline-secondary {
  --bs-btn-color: var(--bs-ink); --bs-btn-bg: var(--bs-surface); --bs-btn-border-color: #D5DBE3;
  --bs-btn-hover-bg: var(--bs-surface-2); --bs-btn-hover-color: var(--bs-ink); --bs-btn-hover-border-color: #C7CFD9;
}
.btn-secondary { --bs-btn-bg: var(--bs-surface-2); --bs-btn-color: var(--bs-ink); --bs-btn-border-color: var(--bs-surface-2); --bs-btn-hover-bg: #E4E9EF; --bs-btn-hover-color: var(--bs-ink); --bs-btn-hover-border-color: #E4E9EF; }
.btn-danger { --bs-btn-bg: #C2410C; --bs-btn-border-color: #C2410C; --bs-btn-hover-bg: #9A3412; --bs-btn-hover-border-color: #9A3412; }
.btn-outline-danger { --bs-btn-color: #B2410B; --bs-btn-border-color: #F3C3A8; --bs-btn-hover-bg: var(--bs-late-bg); --bs-btn-hover-color: #9A3412; --bs-btn-hover-border-color: #B2410B; }
.btn-success { --bs-btn-bg: #0E6B5C; --bs-btn-border-color: #0E6B5C; --bs-btn-hover-bg: #0B574B; --bs-btn-hover-border-color: #0B574B; }

.form-label { font-weight: 600; font-size: 13px; color: #3C4458; margin-bottom: 6px; }
.form-control, .form-select {
  border-radius: 12px; border-color: #D5DBE3; min-height: 44px; font-size: 14px; color: var(--bs-ink); background-color: var(--bs-surface);
}
textarea.form-control { min-height: 96px; }
.form-control-sm, .form-select-sm { min-height: 36px; border-radius: 10px; }
.form-control:focus, .form-select:focus { border-color: var(--bs-teal); box-shadow: 0 0 0 .2rem rgba(1, 123, 160, .18); }
.form-check-input:checked { background-color: var(--bs-teal); border-color: var(--bs-teal); }
.input-group-text { border-radius: 12px; background: var(--bs-surface-2); border-color: #D5DBE3; color: var(--bs-muted); }

.table { --bs-table-bg: transparent; --bs-table-striped-bg: #F7F9FB; --bs-table-hover-bg: #F2F6F9; --bs-table-border-color: #EEF1F5; margin-bottom: 0; }
.table > thead th, .table > thead td {
  font-size: 12px; font-weight: 700; text-transform: uppercase; letter-spacing: .05em; color: var(--bs-muted);
  background: transparent; border-bottom-width: 1px; padding-top: 12px; padding-bottom: 12px; white-space: nowrap;
}
.table > tbody td { padding-top: 14px; padding-bottom: 14px; vertical-align: middle; }
.table-light, .table > thead.table-light th { --bs-table-bg: transparent; }
.table-responsive { border-radius: var(--bs-radius); }

.badge { font-weight: 700; border-radius: 999px; padding: .42em .8em; }
.badge.bg-primary { background: var(--bs-teal) !important; }
.badge.bg-danger { background: var(--bs-violet) !important; } /* counters use violet */
.badge.bg-success { background: var(--bs-done-bg) !important; color: var(--bs-done-ink) !important; }
.badge.bg-warning { background: var(--bs-wait-bg) !important; color: var(--bs-wait-ink) !important; }
.badge.bg-info { background: var(--bs-info-bg) !important; color: var(--bs-info-ink) !important; }
.badge.bg-secondary, .badge.bg-light { background: var(--bs-none-bg) !important; color: var(--bs-none-ink) !important; }

.nav-tabs { border-bottom: 1px solid var(--bs-line); gap: 4px; }
.nav-tabs .nav-link { border: 0; border-bottom: 3px solid transparent; color: var(--bs-muted); font-weight: 700; padding: 12px 16px; }
.nav-tabs .nav-link:hover { color: var(--bs-ink); border-bottom-color: #D5DBE3; }
.nav-tabs .nav-link.active { color: var(--bs-ink); background: transparent; border-bottom-color: var(--bs-teal); }
.nav-pills .nav-link { border-radius: 12px; font-weight: 700; color: #3C4458; }
.nav-pills .nav-link.active { background: var(--bs-navy); }

.modal-content { border: 0; border-radius: var(--bs-radius-xl); box-shadow: var(--bs-shadow-lg); }
.modal-header { border-bottom: 1px solid #EEF1F5; padding: 20px 24px; }
.modal-title { font-family: var(--bs-font-display); font-weight: 600; font-size: 22px; }
.modal-body { padding: 22px 24px; }
.modal-footer { border-top: 1px solid #EEF1F5; padding: 14px 24px; }
.modal-backdrop.show { opacity: .45; }
.modal-backdrop { background: var(--bs-navy); }

.dropdown-menu { border: 0; border-radius: 16px; box-shadow: var(--bs-shadow-lg); padding: 8px; font-size: 14px; }
.dropdown-item { border-radius: 10px; padding: 9px 12px; font-weight: 500; color: var(--bs-ink); display: flex; align-items: center; justify-content: space-between; gap: 10px; }
.dropdown-item:hover, .dropdown-item:focus { background: var(--bs-surface-2); color: var(--bs-ink); }
.dropdown-item.active, .dropdown-item:active { background: var(--bs-teal-soft); color: var(--bs-teal-dark); }
.dropdown-header { font-size: 11px; font-weight: 700; letter-spacing: .08em; text-transform: uppercase; color: var(--bs-muted); }

.alert { border: 0; border-radius: var(--bs-radius); font-weight: 500; }
.alert-success { background: var(--bs-done-bg); color: var(--bs-done-ink); }
.alert-warning { background: var(--bs-wait-bg); color: var(--bs-wait-ink); }
.alert-danger { background: var(--bs-late-bg); color: var(--bs-late-ink); }
.alert-info, .alert-primary { background: var(--bs-info-bg); color: var(--bs-info-ink); }

.pagination { --bs-pagination-border-radius: 10px; --bs-pagination-active-bg: var(--bs-navy); --bs-pagination-active-border-color: var(--bs-navy); --bs-pagination-color: var(--bs-ink); gap: 4px; }
.pagination .page-link { border-radius: 10px !important; }
.progress { --bs-progress-bg: #E9EDF2; --bs-progress-bar-bg: var(--bs-teal); border-radius: 999px; }
.list-group-item { border-color: #EEF1F5; }
.breadcrumb { font-size: 14px; }

/* third party widgets */
.select2-container--default .select2-selection--single,
.select2-container--default .select2-selection--multiple { border: 1px solid #D5DBE3 !important; border-radius: 12px !important; min-height: 44px; }
.select2-container .select2-selection--single { height: 44px !important; display: flex; align-items: center; }
.select2-container--default .select2-selection--single .select2-selection__arrow { height: 42px !important; }
.select2-container--default .select2-selection--multiple .select2-selection__choice { background: var(--bs-teal-soft) !important; color: var(--bs-teal-dark) !important; border: 0 !important; border-radius: 8px !important; }
.select2-dropdown { border: 0 !important; border-radius: 14px !important; box-shadow: var(--bs-shadow-lg); overflow: hidden; }
.select2-results__option--highlighted { background: var(--bs-teal) !important; }
.swal2-popup { border-radius: var(--bs-radius-xl) !important; font-family: var(--bs-font-body) !important; }
.swal2-title { font-family: var(--bs-font-display) !important; color: var(--bs-ink) !important; }
.swal2-styled.swal2-confirm { background: var(--bs-teal) !important; border-radius: 12px !important; }
.swal2-styled.swal2-cancel { background: var(--bs-surface-2) !important; color: var(--bs-ink) !important; border-radius: 12px !important; }
.note-editor.note-frame { border-radius: 12px; border-color: #D5DBE3; }

/* ---------- Bootstrap 4 bridge (remove once pages are converted) ---------- */
.mr-1 { margin-right: .25rem !important; } .mr-2 { margin-right: .5rem !important; } .mr-3 { margin-right: 1rem !important; }
.ml-1 { margin-left: .25rem !important; } .ml-2 { margin-left: .5rem !important; } .ml-3 { margin-left: 1rem !important; } .ml-auto { margin-left: auto !important; }
.pl-2 { padding-left: .5rem !important; } .pr-2 { padding-right: .5rem !important; }
.float-right { float: right !important; } .float-left { float: left !important; }
.text-right { text-align: right !important; } .text-left { text-align: left !important; }
.font-weight-bold { font-weight: 700 !important; } .font-weight-normal { font-weight: 400 !important; }
.form-group { margin-bottom: 1rem; }
.btn-block { display: block; width: 100%; }
.sr-only { position: absolute !important; width: 1px !important; height: 1px !important; padding: 0 !important; margin: -1px !important; overflow: hidden !important; clip: rect(0, 0, 0, 0) !important; white-space: nowrap !important; border: 0 !important; }
.badge-primary { background: var(--bs-teal); color: #FFFFFF; }
.badge-success { background: var(--bs-done-bg); color: var(--bs-done-ink); }
.badge-warning { background: var(--bs-wait-bg); color: var(--bs-wait-ink); }
.badge-danger { background: var(--bs-late-bg); color: var(--bs-late-ink); }
.badge-info { background: var(--bs-info-bg); color: var(--bs-info-ink); }
.badge-secondary, .badge-light, .badge-dark { background: var(--bs-none-bg); color: var(--bs-none-ink); }

/* leftovers from the old template wrapper, in case a page still uses them */
.layout-px-spacing { padding: 0 !important; }
#content, .main-content { margin: 0 !important; padding: 0 !important; width: auto !important; }

/* =====================================================================
   Ask BuildSync (package 8): drawer, chat bubbles, Show me tour
   ===================================================================== */
.bs-menu-ask { width: 100%; height: 46px; margin: 4px 0 6px; border: 0; border-radius: 12px; background: var(--bs-violet); color: #FFFFFF; font-weight: 700; text-align: left; padding: 0 12px; }
.bs-ask-messages { flex: 1; overflow-y: auto; display: flex; flex-direction: column; gap: 10px; padding-right: 2px; }
.bs-ask-msg { max-width: 92%; border-radius: 16px; padding: 10px 14px; font-size: 14px; line-height: 1.5; }
.bs-ask-msg p { margin: 0 0 6px; } .bs-ask-msg p:last-child { margin-bottom: 0; }
.bs-ask-msg ol, .bs-ask-msg ul { margin: 4px 0 6px; padding-left: 20px; }
.bs-ask-msg.me { align-self: flex-end; background: var(--bs-teal); color: #FFFFFF; border-bottom-right-radius: 6px; }
.bs-ask-msg.ai { align-self: flex-start; background: var(--bs-surface-2); color: var(--bs-ink); border-bottom-left-radius: 6px; }
.bs-ask-msg.ai a { color: var(--bs-teal-dark); font-weight: 600; }
.bs-ask-actions { display: flex; flex-wrap: wrap; align-items: center; gap: 6px; margin-top: 8px; }
.bs-ask-rate { margin-left: auto; display: inline-flex; gap: 2px; }
.bs-ask-rate button { border: 0; background: transparent; font-size: 15px; opacity: .6; padding: 2px 4px; }
.bs-ask-rate button:hover { opacity: 1; }
.bs-ask-suggestions { display: flex; flex-wrap: wrap; gap: 6px; }
.bs-ask-chip { border: 1px solid var(--bs-line); background: var(--bs-violet-soft); color: var(--bs-violet-ink); border-radius: 999px; padding: 6px 12px; font-size: 13px; font-weight: 600; text-align: left; }
.bs-menu-ask { width: 100%; }
.bs-ask-form textarea { width: 100%; resize: none; border: 1.5px solid var(--bs-line); border-radius: 14px; padding: 10px 12px; font-size: 15px; }
.bs-ask-form textarea:focus { outline: none; border-color: var(--bs-violet); }
.bs-ask-typing { display: inline-flex; gap: 4px; }
.bs-ask-typing span { width: 7px; height: 7px; border-radius: 50%; background: var(--bs-muted); animation: bsAskDot 1s infinite ease-in-out; }
.bs-ask-typing span:nth-child(2) { animation-delay: .15s; } .bs-ask-typing span:nth-child(3) { animation-delay: .3s; }
@keyframes bsAskDot { 0%, 80%, 100% { opacity: .25; transform: translateY(0); } 40% { opacity: 1; transform: translateY(-3px); } }

.bs-tour-ring { position: fixed; z-index: 2000; border: 3px solid var(--bs-violet); border-radius: 12px; pointer-events: none;
  box-shadow: 0 0 0 9999px rgba(0, 34, 59, .35); transition: all .2s ease; animation: bsTourPulse 1.4s infinite; }
@keyframes bsTourPulse { 0%, 100% { outline: 0 solid rgba(86, 70, 242, .45); } 50% { outline: 8px solid rgba(86, 70, 242, 0); } }
.bs-tour-tip { position: fixed; z-index: 2001; width: min(320px, calc(100vw - 16px)); background: #FFFFFF; color: var(--bs-ink); border-radius: 14px;
  padding: 12px 14px; box-shadow: 0 12px 32px rgba(0, 34, 59, .25); font-size: 14px; }
.bs-tour-tip p { margin: 0 0 8px; }
.bs-tour-nav { display: flex; align-items: center; gap: 6px; } .bs-tour-nav span { margin-right: auto; font-size: 12px; color: var(--bs-muted); }


/* =====================================================================
   Auth pages (login, forgot password, OTP, reset). These used to pull
   four stylesheets out of wwwroot/Content/theme; they are themed here
   now so that folder can go.
   ===================================================================== */
.bs-auth { min-height: 100vh; display: grid; grid-template-columns: 1fr 1fr; background: var(--bs-ground); }
.bs-auth-panel { display: flex; align-items: center; justify-content: center; padding: 40px 24px; }
.bs-auth-card { width: 100%; max-width: 400px; }
.bs-auth-logo { max-width: 200px; height: auto; margin-bottom: 28px; }
.bs-auth-card h1 { font-family: var(--bs-font-display); font-size: 26px; font-weight: 700; color: var(--bs-ink); margin: 0 0 6px; }
.bs-auth-card .bs-auth-sub { color: var(--bs-muted); font-size: 14px; margin: 0 0 26px; }
.bs-auth-card label { font-size: 13px; font-weight: 600; color: var(--bs-ink); margin-bottom: 6px; }
.bs-auth-card .form-control { height: 46px; border-radius: var(--bs-radius-sm); border: 1px solid var(--bs-line); background: var(--bs-surface); }
.bs-auth-card .form-control:focus { border-color: var(--bs-teal); box-shadow: 0 0 0 3px var(--bs-teal-soft); }
.bs-auth-card .btn-primary { height: 46px; width: 100%; border-radius: var(--bs-radius-sm); font-weight: 700; }
.bs-auth-foot { margin-top: 24px; font-size: 13px; color: var(--bs-muted); }
.bs-auth-foot a { font-weight: 600; }
.bs-auth-art { position: relative; background: var(--bs-navy); overflow: hidden; }
.bs-auth-art img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; opacity: .55; }
.bs-auth-art .bs-auth-art-ink { position: absolute; left: 48px; right: 48px; bottom: 48px; color: #FFFFFF; }
.bs-auth-art .bs-auth-art-ink h2 { font-family: var(--bs-font-display); font-size: 30px; font-weight: 700; margin: 0 0 8px; }
.bs-auth-art .bs-auth-art-ink p { color: var(--bs-on-dark-muted); margin: 0; }
.bs-auth-alert { border-radius: var(--bs-radius-sm); padding: 10px 14px; font-size: 14px; margin-bottom: 18px; }
.bs-auth-alert-bad { background: var(--bs-late-bg); color: var(--bs-late-ink); }
.bs-auth-alert-ok { background: var(--bs-done-bg); color: var(--bs-done-ink); }
/* ASP.NET renders the validation summary even with no errors, as
   <div class="... validation-summary-valid"><ul><li style="display:none"></li></ul></div>,
   so :empty never matches it and an empty coloured box showed on a clean login page. */
.bs-auth-alert:empty,
.bs-auth-alert.validation-summary-valid { display: none; }
@media (max-width: 900px) {
  .bs-auth { grid-template-columns: 1fr; }
  .bs-auth-art { display: none; }
}

/* Password reset flow. The class names are the hooks the existing jQuery uses
   (.reset-msg is toggled with .show(), the code boxes are .squire-input), so they
   are kept and styled here instead of in each page. */
.bs-auth .reset-lead { color: var(--bs-muted); font-size: 14px; margin: 0 0 24px; }
.bs-auth .reset-msg { display: none; margin-bottom: 16px; font-weight: 600; font-size: 14px;
  border-radius: var(--bs-radius-sm); padding: 10px 14px; background: var(--bs-late-bg); color: var(--bs-late-ink); }
.bs-auth .reset-msg.text-success { background: var(--bs-done-bg); color: var(--bs-done-ink); }
.bs-auth .otp-row { display: flex; gap: 8px; justify-content: space-between; margin-bottom: 20px; }
.bs-auth .otp-row input.squire-input {
  width: 100%; height: 52px; padding: 0; text-align: center; font-size: 20px; font-weight: 700;
  border: 1px solid var(--bs-line); border-radius: var(--bs-radius-sm); background: var(--bs-surface); color: var(--bs-ink);
}
.bs-auth .otp-row input.squire-input:focus { border-color: var(--bs-teal); box-shadow: 0 0 0 3px var(--bs-teal-soft); outline: none; }
.bs-auth .spinner { display: inline-block; width: 14px; height: 14px; border: 2px solid rgba(255,255,255,.45);
  border-top-color: #FFFFFF; border-radius: 50%; animation: bsAuthSpin .7s linear infinite; vertical-align: -2px; }
.bs-auth .spinner.hidden { display: none; }
@keyframes bsAuthSpin { to { transform: rotate(360deg); } }

/* Dashboard chart hosts. Lives here rather than in a <style> block on the page,
   per the theme's own conversion rule: no page level colour, radius or shadow. */
.bs-apex { min-height: 260px; width: 100%; }
.bs-apex.is-loading, .bs-apex.is-empty { display: grid; place-items: center; min-height: 260px; color: var(--bs-muted); font-size: 14px; }
.bs-apex .apexcharts-canvas, .bs-apex .apexcharts-svg { width: 100% !important; max-width: 100% !important; }
.bs-apex .apexcharts-legend { padding: 6px 8px; }
/* ApexCharts renders the legend inside an SVG <foreignObject> sized to the SVG itself.
   On a donut with a centre label the SVG comes out shorter than the legend it has
   already laid out, and because both nodes default to overflow:hidden the bottom of
   the legend gets sliced off ("Paid / Pending" was cut in half). The card has room
   below, so let these two nodes overflow instead of guessing at chart heights. */
.bs-apex .apexcharts-svg,
.bs-apex .apexcharts-svg > foreignObject { overflow: visible; }
.bs-apex .apexcharts-legend .apexcharts-legend-series { margin: 4px 8px; }

/* Chart text contrast. The ApexCharts tooltip was inheriting a dark surface AND dark
   ink, so the figures inside it were unreadable. Pin both sides explicitly, and keep
   axis and legend labels on the readable ink tokens rather than the series palette. */
.bs-apex .apexcharts-tooltip.apexcharts-theme-light,
.bs-apex .apexcharts-tooltip {
  background: var(--bs-surface) !important;
  color: var(--bs-ink) !important;
  border: 1px solid var(--bs-line) !important;
  box-shadow: 0 8px 24px rgba(0, 34, 59, .16) !important;
}
.bs-apex .apexcharts-tooltip-title {
  background: var(--bs-surface-2) !important;
  color: var(--bs-ink) !important;
  border-bottom: 1px solid var(--bs-line) !important;
  font-weight: 700;
}
.bs-apex .apexcharts-tooltip-text,
.bs-apex .apexcharts-tooltip-text-y-label,
.bs-apex .apexcharts-tooltip-text-y-value { color: var(--bs-ink) !important; }
.bs-apex .apexcharts-xaxistooltip,
.bs-apex .apexcharts-yaxistooltip {
  background: var(--bs-ink) !important; color: #FFFFFF !important; border-color: var(--bs-ink) !important;
}
.bs-apex .apexcharts-xaxistooltip:after, .bs-apex .apexcharts-xaxistooltip:before { border-bottom-color: var(--bs-ink) !important; }
.bs-apex .apexcharts-xaxis text,
.bs-apex .apexcharts-yaxis text { fill: var(--bs-muted) !important; }
.bs-apex .apexcharts-legend-text { color: var(--bs-ink) !important; }
.bs-apex .apexcharts-datalabel-value { fill: var(--bs-ink) !important; }
/* A label drawn ON a slice sits on a saturated fill, so it goes white, not ink. */
.bs-apex .apexcharts-pie-series .apexcharts-datalabel { fill: #FFFFFF !important; }
.bs-stat-value.is-loading { display: inline-block; min-width: 3ch; border-radius: 8px;
  background: rgba(255, 255, 255, .22); color: transparent !important; animation: bsStatPulse 1.2s ease-in-out infinite; }
@keyframes bsStatPulse { 0%, 100% { opacity: .55; } 50% { opacity: 1; } }
@media (max-width: 992px) { .bs-apex, .bs-apex.is-loading, .bs-apex.is-empty { min-height: 230px; } }
@media (max-width: 576px) { .bs-apex, .bs-apex.is-loading, .bs-apex.is-empty { min-height: 210px; } }

/* Package 9.1: phone bottom menu bar. Only on small screens; the page gets bottom padding so nothing is covered.
   Safe area aware for phones with a home indicator (the layout already uses viewport-fit=cover). */
.bs-tabbar { display: none; }
@media (max-width: 767.98px) {
  .bs-tabbar {
    display: grid; grid-template-columns: repeat(5, 1fr);
    position: fixed; left: 0; right: 0; bottom: 0; z-index: 1030;
    background: var(--bs-surface); border-top: 1px solid var(--bs-line);
    box-shadow: 0 -6px 24px rgba(0, 34, 59, .08);
    padding: 4px max(6px, env(safe-area-inset-right)) calc(4px + env(safe-area-inset-bottom)) max(6px, env(safe-area-inset-left));
  }
  .bs-tabbar a, .bs-tabbar button {
    display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 2px;
    min-height: 52px; border: 0; background: none; padding: 4px 2px; border-radius: var(--bs-radius-sm);
    color: var(--bs-muted); font: 600 11px/1.1 var(--bs-font-body); text-decoration: none; cursor: pointer;
  }
  .bs-tabbar svg { width: 22px; height: 22px; }
  .bs-tabbar .active { color: var(--bs-teal); background: var(--bs-teal-soft); }
  .bs-tabbar a:focus-visible, .bs-tabbar button:focus-visible { outline: 2px solid var(--bs-teal); outline-offset: 1px; }
  body.bs-has-tabbar { padding-bottom: calc(64px + env(safe-area-inset-bottom)); }
}
@media print { .bs-tabbar { display: none !important; } body.bs-has-tabbar { padding-bottom: 0 !important; } }
/* Package 9.1: on phones, menus that drop down on the page open above the bottom bar. */
@media (max-width: 767.98px) { .dropdown-menu { z-index: 1040; } }

/* Package 9.1: Ask BuildSync as a chat bubble (bottom right) and a chat window.
   Phones: the bubble sits above the bottom menu bar and the chat opens full screen. */
.bs-ask-bubble {
  position: fixed; right: max(20px, env(safe-area-inset-right)); bottom: calc(20px + env(safe-area-inset-bottom)); z-index: 1040;
  width: 56px; height: 56px; border-radius: 50%; border: 0; padding: 0;
  display: flex; align-items: center; justify-content: center;
  background: var(--bs-navy); box-shadow: var(--bs-shadow-lg); cursor: pointer;
  transition: transform .15s ease;
}
.bs-ask-bubble:hover { transform: translateY(-2px); }
.bs-ask-bubble:focus-visible { outline: 3px solid var(--bs-teal-light); outline-offset: 2px; }
.bs-ask-bubble img { width: 30px; height: 30px; }
.bs-ask-bubble-label {
  position: absolute; right: 64px; top: 50%; transform: translateY(-50%);
  background: var(--bs-navy); color: #FFFFFF; font: 700 13px/1 var(--bs-font-body);
  padding: 7px 10px; border-radius: 999px; white-space: nowrap; box-shadow: var(--bs-shadow);
  opacity: 0; pointer-events: none; transition: opacity .15s ease;
}
.bs-ask-bubble:hover .bs-ask-bubble-label, .bs-ask-bubble:focus-visible .bs-ask-bubble-label { opacity: 1; }
.bs-ask-bubble.bs-ask-lift { bottom: calc(96px + env(safe-area-inset-bottom)); } /* above the estimator's result bar */

.bs-ask-chat {
  position: fixed; right: max(20px, env(safe-area-inset-right)); bottom: calc(88px + env(safe-area-inset-bottom)); z-index: 1046;
  width: min(380px, calc(100vw - 32px)); height: min(560px, calc(100vh - 120px));
  display: flex; flex-direction: column; overflow: hidden;
  background: var(--bs-surface); color: var(--bs-ink); border-radius: 20px; box-shadow: var(--bs-shadow-lg);
  border: 1px solid var(--bs-line);
}
.bs-ask-chat[hidden] { display: none; }
.bs-ask-chat *, .bs-ask-chat *::before, .bs-ask-chat *::after { box-sizing: border-box; }
.bs-ask-chat.bs-ask-lift { bottom: calc(164px + env(safe-area-inset-bottom)); height: min(560px, calc(100vh - 196px)); }
.bs-ask-chat-head { display: flex; align-items: flex-start; gap: 6px; padding: 12px 10px 12px 16px; background: var(--bs-navy); color: #FFFFFF; }
.bs-ask-chat-title { flex: 1; min-width: 0; }
.bs-ask-chat-title h2 { margin: 0; font: 700 17px/1.2 var(--bs-font-display); color: #FFFFFF; }
.bs-ask-chat-sub { font-size: 12px; color: var(--bs-on-dark-muted); margin-top: 2px; }
.bs-ask-chat-btn { border: 0; background: transparent; color: #FFFFFF; width: 34px; height: 34px; border-radius: 10px; display: inline-flex; align-items: center; justify-content: center; }
.bs-ask-chat-btn:hover { background: rgba(255, 255, 255, .12); }
.bs-ask-chat-btn:focus-visible { outline: 2px solid var(--bs-teal-light); }
.bs-ask-chat-body { flex: 1; min-height: 0; display: flex; flex-direction: column; gap: 10px; padding: 12px 14px 14px; }
.bs-ask-chat.bs-ask-minimized { height: auto; }
.bs-ask-chat.bs-ask-minimized .bs-ask-chat-body { display: none; }
.bs-ask-chat.bs-ask-minimized .bs-ask-chat-head { cursor: pointer; }

@media (max-width: 767.98px) {
  body.bs-has-tabbar .bs-ask-bubble { bottom: calc(64px + env(safe-area-inset-bottom) + 12px); }
  .bs-ask-chat, .bs-ask-chat.bs-ask-lift {
    inset: 0; width: 100%; height: 100%; height: 100dvh; border-radius: 0; border: 0; z-index: 1060;
    padding-bottom: env(safe-area-inset-bottom);
  }
  .bs-ask-chat .bs-ask-min { display: none; }
  .bs-ask-chat-head { padding-top: calc(12px + env(safe-area-inset-top)); }
  html.bs-ask-open, html.bs-ask-open body { overflow: hidden; }
  html.bs-ask-open .bs-ask-bubble { display: none; }
}
@media print { .bs-ask-bubble, .bs-ask-chat { display: none !important; } }

/* Shown over the login card while a stored device token is exchanged for a session,
   so a remembered person never sees the form flash up before being let in. */
.bs-auth-resume {
  position: fixed; inset: 0; z-index: 2100;
  display: grid; place-items: center;
  background: var(--bs-bg, #EDF1F5);
}
.bs-auth-resume[hidden] { display: none; }
.bs-auth-resume-inner { text-align: center; color: var(--bs-muted); }
.bs-auth-resume-inner .spinner-border { color: var(--bs-teal); width: 2rem; height: 2rem; }
.bs-auth-resume-inner p { margin: 12px 0 0; font-size: 14px; }

/* =====================================================================
   Look and feel: compact project lists (Financials, Subcontractors,
   Expenses, Tasks, Change Orders, Permits, Payment Stages) and the
   folder count badges on Documents. Display only. Rows are about 46px.
   ===================================================================== */
.bs-compact { color: var(--bs-ink); }
.bs-ctable-wrap {
  overflow-x: auto; -webkit-overflow-scrolling: touch;
  border: 1px solid var(--bs-line); border-radius: var(--bs-radius-sm);
  background: var(--bs-surface); max-width: 100%;
}
.bs-ctable { width: 100%; min-width: 680px; margin: 0; border-collapse: collapse; font-size: 13.5px; line-height: 1.35; color: var(--bs-ink); }
.bs-ctable > thead > tr > th {
  padding: 8px 12px; white-space: nowrap; text-align: left;
  font-size: 11.5px; font-weight: 700; letter-spacing: .03em; text-transform: uppercase;
  color: var(--bs-muted); background: var(--bs-surface-2); border-bottom: 1px solid var(--bs-line);
}
.bs-ctable > tbody > tr > td { height: 46px; padding: 6px 12px; vertical-align: middle; border-bottom: 1px solid var(--bs-line); }
.bs-ctable > tbody > tr:last-child > td { border-bottom: 0; }
.bs-ctable > tbody > tr:not(.bs-detail-row):hover > td { background: var(--bs-surface-2); }
.bs-ctable > tfoot > tr > th, .bs-ctable > tfoot > tr > td {
  height: 44px; padding: 6px 12px; font-weight: 700; vertical-align: middle;
  background: var(--bs-surface-2); border-top: 1px solid var(--bs-line);
}
.bs-ctable .bs-num { text-align: right; white-space: nowrap; font-variant-numeric: tabular-nums; }
.bs-ctable .bs-act { text-align: right; white-space: nowrap; }
.bs-ctable .bs-act .btn { padding: 2px 10px; font-size: 12.5px; line-height: 1.5; border-radius: 8px; }
.bs-ctable .bs-act .btn + .btn { margin-left: 4px; }
.bs-ctable .bs-act .btn-icon { width: 30px; height: 28px; padding: 0; display: inline-flex; align-items: center; justify-content: center; }
.bs-ctable .bs-nowrap { white-space: nowrap; }
.bs-ctable .bs-ell { max-width: 260px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.bs-ctable td.bs-ell { display: table-cell; }
.bs-ctable .bs-who .bs-ell { display: inline-block; max-width: 220px; vertical-align: middle; }
.bs-ctable .bs-chip { padding: 3px 10px; font-size: 11.5px; }
.bs-ctable .bs-chip + .bs-chip { margin-left: 4px; }
.bs-ctable a[href^="tel:"], .bs-ctable a[href^="mailto:"] { color: var(--bs-teal-dark); text-decoration: none; }
.bs-ctable a[href^="tel:"]:hover, .bs-ctable a[href^="mailto:"]:hover { text-decoration: underline; }
.bs-compact .bs-muted, .bs-ctable .bs-muted, .bs-detail-row .bs-muted { color: var(--bs-muted); }
.bs-compact .bs-neg, .bs-ctable .bs-neg, .bs-detail-row .bs-neg { color: var(--bs-late-ink); }
.bs-who { display: flex; align-items: center; gap: 10px; min-width: 0; }
.bs-ini {
  flex: 0 0 auto; width: 28px; height: 28px; border-radius: 50%;
  display: inline-flex; align-items: center; justify-content: center;
  background: var(--bs-teal-soft); color: var(--bs-teal-dark); font-size: 11.5px; font-weight: 700;
}
.bs-trade {
  display: inline-block; margin: 1px 4px 1px 0; padding: 2px 8px; border-radius: 999px; white-space: nowrap;
  font-size: 11.5px; font-weight: 600; background: var(--bs-surface-2); border: 1px solid var(--bs-line); color: var(--bs-ink);
}
.bs-bar { display: inline-block; width: 90px; height: 6px; border-radius: 999px; background: var(--bs-line); overflow: hidden; vertical-align: middle; }
.bs-bar > span { display: block; height: 100%; border-radius: 999px; background: var(--bs-teal); }
.bs-pct { display: inline-block; min-width: 38px; margin-left: 6px; font-size: 12px; color: var(--bs-muted); text-align: right; font-variant-numeric: tabular-nums; }
.bs-row-toggle { cursor: pointer; }
.bs-row-caret {
  flex: 0 0 auto; width: 22px; height: 22px; padding: 0; border: 0; border-radius: 6px;
  background: transparent; color: var(--bs-muted); display: inline-flex; align-items: center; justify-content: center;
}
.bs-row-caret:hover { background: var(--bs-line); color: var(--bs-ink); }
.bs-row-caret:focus-visible, .bs-ctable .btn:focus-visible { outline: 2px solid var(--bs-teal); outline-offset: 1px; }
.bs-row-caret i { font-size: 11px; transition: transform .15s; }
.bs-row-caret[aria-expanded="true"] i { transform: rotate(90deg); }
.bs-ctable [data-bs-rowtoggle] .fa-chevron-down { font-size: 10px; margin-left: 2px; transition: transform .15s; }
.bs-ctable [data-bs-rowtoggle][aria-expanded="true"] .fa-chevron-down { transform: rotate(180deg); }
.bs-ctable > tbody > tr.is-open > td { background: var(--bs-surface-2); }
.bs-ctable > tbody > tr.bs-detail-row > td { height: auto; padding: 10px 16px 14px; background: var(--bs-surface-2); }
.bs-ctable-inner { min-width: 0; background: var(--bs-surface); border: 1px solid var(--bs-line); border-radius: var(--bs-radius-sm); }
.bs-ctable-inner > tbody > tr > td { height: 40px; }
.bs-detail-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(180px, 1fr)); gap: 8px 20px; margin: 0; }
.bs-detail-grid dt { font-size: 11.5px; font-weight: 700; letter-spacing: .03em; text-transform: uppercase; color: var(--bs-muted); }
.bs-detail-grid dd { margin: 2px 0 0; white-space: pre-line; overflow-wrap: anywhere; }
.bs-co-detail .sub-item { margin-bottom: 6px; padding: 8px 10px !important; box-shadow: none !important; }
.bs-fin-summary {
  display: flex; flex-wrap: wrap; gap: 6px 24px; margin-bottom: 10px; padding: 8px 12px;
  border: 1px solid var(--bs-line); border-radius: var(--bs-radius-sm); background: var(--bs-surface); font-size: 13.5px;
}
.bs-fin-summary strong { font-variant-numeric: tabular-nums; }
.bs-fin-summary-label { color: var(--bs-muted); margin-right: 4px; }

/* Expenses: the existing Bootstrap table, in the same compact look */
.bs-compact-bs { border: 1px solid var(--bs-line); border-radius: var(--bs-radius-sm); background: var(--bs-surface); }
.bs-compact-bs > .table { margin: 0; font-size: 13.5px; --bs-table-border-color: var(--bs-line); }
.bs-compact-bs > .table.table-bordered > :not(caption) > * > * { border-left-width: 0; border-right-width: 0; }
.bs-compact-bs > .table > thead th {
  padding: 8px 12px; font-size: 11.5px; font-weight: 700; letter-spacing: .03em; text-transform: uppercase;
  color: var(--bs-muted); background: var(--bs-surface-2); white-space: nowrap;
}
.bs-compact-bs > .table > tbody td { height: 46px; padding: 6px 12px; vertical-align: middle; }
.bs-compact-bs > .table .btn-sm { padding: 2px 10px; font-size: 12.5px; }

/* Permits and Payment Stages: same content, tighter spacing */
#tab-permits.bs-compact-tab .perm-card { margin-bottom: 10px; border-radius: var(--bs-radius-sm); }
#tab-permits.bs-compact-tab .perm-head { padding: 8px 12px 8px 16px; }
#tab-permits.bs-compact-tab .perm-ico { width: 30px; height: 30px; border-radius: 8px; font-size: .9rem; }
#tab-permits.bs-compact-tab .perm-name { font-size: .92rem; }
#tab-permits.bs-compact-tab .perm-body { padding: 4px 12px 10px 16px; }
#tab-permits.bs-compact-tab .insp-table th { padding: 6px 10px; }
#tab-permits.bs-compact-tab .insp-table td { padding: 6px 10px; height: 44px; }
#tab-permits.bs-compact-tab .icon-btn { width: 28px; height: 28px; }
#tab-paystages.bs-compact-tab .stg-stats { gap: .5rem; margin-bottom: .75rem; }
#tab-paystages.bs-compact-tab .stg-stat { padding: .5rem .75rem .5rem .9rem; }
#tab-paystages.bs-compact-tab .stg-table > tbody > tr > td { height: 44px; padding: .35rem .6rem; }

/* Documents: number of files in each folder, shown before the folder menu */
.bs-folder-count {
  flex: 0 0 auto; min-width: 24px; margin: 0 6px 0 8px; padding: 1px 8px; border-radius: 999px; text-align: center;
  font-size: 11.5px; font-weight: 700; line-height: 1.5; font-variant-numeric: tabular-nums;
  background: var(--bs-teal-soft); color: var(--bs-teal-dark);
}
.bs-folder-count.is-zero { background: transparent; color: var(--bs-muted); font-weight: 500; opacity: .55; }

@media (max-width: 575.98px) {
  .bs-fin-summary { gap: 4px 16px; font-size: 13px; }
  .bs-ctable .bs-ell { max-width: 180px; }
}


/* ===================== Property card (project page) ===================== */
.bs-property .card-header { background: var(--bs-surface, #fff); }
.bs-property-addr { font-size: 13px; color: var(--bs-muted, #5F6670); }
.bs-property-views { display: grid; grid-template-columns: repeat(auto-fit, minmax(200px, 1fr)); gap: 10px; }
.bs-property-view { margin: 0; }
.bs-property-view img,
.bs-property-view iframe { display: block; width: 100%; height: 190px; border: 1px solid #E4E7EC; border-radius: 8px; object-fit: cover; background: #F2F4F7; }
.bs-property-view figcaption { font-size: 12px; color: #5F6670; margin-top: 4px; }
.bs-property-links { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 10px; }
.bs-property-links .btn { min-height: 34px; }
