/* PRAS Field — Brand Styles for Aurum Developments
   Colors, typography, layout per 03_DATA_REFERENCE_v2.md Section 11 */

/* ========== CSS Variables ========== */
:root {
  --black: #070706;
  --gold: #C9A84C;
  --gold-light: #E8C97A;
  --gold-bg: #FBF6EA;
  --teal: #1A8A7A;
  --green: #1D9E75;
  --red: #E25555;
  --surface: #F5F3EE;
  --border: #CCCBC8;
  --muted: #6B6966;
  --body-text: #1A1A18;
  --page-bg: #F0EFEA;
  --white: #FFFFFF;
}

/* ========== Reset & Base ========== */
*, *::before, *::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

html {
  font-size: 15px;
  -webkit-text-size-adjust: 100%;
}

body {
  font-family: 'DM Sans', system-ui, -apple-system, sans-serif;
  color: var(--body-text);
  background: var(--page-bg);
  line-height: 1.5;
  min-height: 100vh;
}

/* ========== Navbar ========== */
.navbar {
  background: var(--black);
  padding: 0 1rem;
  display: flex;
  align-items: center;
  position: sticky;
  top: 0;
  z-index: 100;
  height: 60px;
  overflow: visible;
}

.navbar {
  justify-content: space-between;
}

.navbar-brand {
  display: flex;
  align-items: center;
  gap: 1rem;
  /* Clamp the brand container's hit-test box to the navbar height.
     Without this, a flex container's bounding box grows to match
     its tallest child (the 140px Aurum logo), and the empty 80px
     below the navbar intercepts clicks on COLD LIST / TODAY'S
     ROUTE / INSPECTION in the sticky tab-bar.
     The logo still visually overflows because the navbar has
     overflow:visible — only the click-blocking layout box shrinks.
     pointer-events:none is belt-and-suspenders so even unforeseen
     descendants don't catch clicks either. */
  height: 60px;
  pointer-events: none;
}

.navbar-actions {
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

/* Signed-in user badge (name + title) in navbar */
.navbar-user {
  text-align: right;
  margin-right: 12px;
  line-height: 1.2;
}
.navbar-user .user-name {
  color: var(--gold);
  font-size: 0.9rem;
  font-weight: 600;
  letter-spacing: 0.02em;
  text-shadow: 0 1px 0 rgba(0, 0, 0, 0.6);
}
.navbar-user .user-title {
  color: #F0EFEA;
  font-size: 0.68rem;
  font-weight: 500;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  opacity: 0.85;
  margin-top: 2px;
}

.navbar-logo {
  height: 140px;
  width: auto;
  position: relative;
  z-index: 101;
  /* Logo overflows the 60px navbar by ~80px and sits visually over
     the tab-bar. Without this, the invisible bottom of the logo's
     bounding box blocks clicks on COLD LIST / TODAY'S ROUTE. */
  pointer-events: none;
}

.navbar-logo-fgr {
  height: 48px;
  border-radius: 4px;
  pointer-events: none;
}

/* Thin gold divider between Aurum and FGR marks */
.navbar-divider {
  display: inline-block;
  width: 1px;
  height: 38px;
  background: rgba(201, 168, 76, 0.45);
  margin: 0 0.25rem;
  align-self: center;
}

/* PRAS FIELD wordmark — inscriptional display serif.
   Cinzel is modeled on ancient Roman monument lettering — the
   same aesthetic lineage as high-end luxury wordmarks. Layered
   shadow + stroke gives it a carved / pressed-gold presence on
   the black bar. */
.navbar-title {
  color: #D8B65A;
  font-family: 'Cinzel', 'Trajan Pro', 'Cormorant Garamond', Georgia, serif;
  font-size: 2.6rem;
  font-weight: 900;
  line-height: 1;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  margin-left: 1.25rem;
  padding-top: 2px;
  /* Layered text-shadow: dark underpainting + subtle top highlight
     + deep drop shadow = pressed / embossed gold look. */
  text-shadow:
    1px 1px 0 #6B4F0F,
    2px 2px 0 #4A3608,
    3px 3px 0 #2B1F04,
    4px 4px 7px rgba(0, 0, 0, 0.85),
    0 1px 0 rgba(255, 225, 140, 0.4);
  -webkit-text-stroke: 0.4px rgba(60, 40, 5, 0.9);
}

/* ========== Tab Bar ========== */
.tab-bar {
  background: var(--white);
  display: flex;
  overflow-x: auto;
  border-bottom: 2px solid var(--border);
  position: sticky;
  top: 60px; /* flush under the 60px sticky navbar */
  z-index: 99;
  -webkit-overflow-scrolling: touch;
}

.tab-btn {
  flex: 1;
  min-width: 0;
  padding: 0.75rem 0.5rem;
  border: none;
  background: transparent;
  color: var(--muted);
  font-family: inherit;
  font-size: 0.8rem;
  font-weight: 500;
  cursor: pointer;
  white-space: nowrap;
  transition: color 0.2s, border-color 0.2s;
  border-bottom: 3px solid transparent;
  text-transform: uppercase;
  letter-spacing: 0.04em;
}

.tab-btn:hover {
  color: var(--body-text);
}

.tab-btn.active {
  color: var(--gold);
  border-bottom-color: var(--gold);
  font-weight: 600;
}

/* ========== Tab Content ========== */
.tab-content {
  padding: 1rem;
  max-width: 960px;
  margin: 0 auto;
}

.tab-panel {
  display: none;
}

.tab-panel.active {
  display: block;
}

.panel-header {
  margin-bottom: 1.25rem;
}

.panel-header h2 {
  font-size: 1.5rem;
  font-weight: 700;
  color: var(--black);
  margin-bottom: 0.25rem;
}

.panel-subtitle {
  font-size: 0.87rem;
  color: var(--muted);
}

.panel-body {
  background: var(--white);
  border-radius: 8px;
  padding: 1.5rem;
  border: 1px solid var(--border);
}

.placeholder-text {
  color: var(--muted);
  font-style: italic;
  text-align: center;
  padding: 2rem 0;
}

/* ========== Buttons ========== */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  padding: 0.6rem 1.25rem;
  border: none;
  border-radius: 6px;
  font-family: inherit;
  font-size: 0.87rem;
  font-weight: 600;
  cursor: pointer;
  transition: background 0.2s, transform 0.1s;
}

.btn:active {
  transform: scale(0.97);
}

.btn-primary {
  background: var(--gold);
  color: var(--black);
}

.btn-primary:hover {
  background: var(--gold-light);
}

.btn-secondary {
  background: var(--surface);
  color: var(--body-text);
  border: 1px solid var(--border);
}

.btn-secondary:hover {
  background: var(--border);
}

.btn-teal {
  background: var(--teal);
  color: var(--white);
}

.btn-teal:hover {
  background: #158070;
}

.btn-danger {
  background: var(--red);
  color: var(--white);
}

.btn-danger:hover {
  background: #c94444;
}

.btn-sm {
  padding: 0.4rem 0.75rem;
  font-size: 0.8rem;
}

/* ========== Form Elements ========== */
.form-group {
  margin-bottom: 1rem;
}

.form-label {
  display: block;
  font-size: 0.73rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  color: var(--muted);
  margin-bottom: 0.35rem;
}

.form-input,
.form-select,
.form-textarea {
  width: 100%;
  padding: 0.6rem 0.75rem;
  font-family: inherit;
  font-size: 0.93rem;
  color: var(--body-text);
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 6px;
  transition: border-color 0.2s;
}

.form-input:focus,
.form-select:focus,
.form-textarea:focus {
  outline: none;
  border-color: var(--gold);
  box-shadow: 0 0 0 2px var(--gold-bg);
}

.form-textarea {
  resize: vertical;
  min-height: 80px;
}

/* ========== Score Badges ========== */
.badge {
  display: inline-block;
  padding: 0.2rem 0.6rem;
  border-radius: 4px;
  font-size: 0.73rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.04em;
}

.badge-a { background: #d4edda; color: #155724; }
.badge-b { background: var(--gold-bg); color: #856404; }
.badge-c { background: #e2e3e5; color: #383d41; }
.badge-disq { background: #f8d7da; color: #721c24; }
.badge-sent { background: #d1e7dd; color: #0f5132; font-weight: 600; padding: 0.22rem 0.6rem; border-radius: 4px; font-size: 0.72rem; letter-spacing: 0.04em; text-transform: uppercase; }

/* Gold send CTA — reusable outside of send modal too */
.btn.btn-gold {
  background: #C9A84C; color: #0D0D0A; border: 1px solid #C9A84C;
  font-weight: 700;
}
.btn.btn-gold:hover { background: #d6b658; }
.btn.btn-gold:disabled { opacity: 0.5; cursor: wait; }

/* ========== Tables ========== */
.table-wrap {
  overflow-x: hidden;
  width: 100%;
}

table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.87rem;
  table-layout: fixed;
}

th {
  text-align: left;
  padding: 0.5rem 0.4rem;
  font-size: 0.73rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  color: var(--muted);
  border-bottom: 2px solid var(--border);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

td {
  padding: 0.5rem 0.4rem;
  border-bottom: 1px solid var(--border);
  vertical-align: middle;
  overflow: hidden;
  text-overflow: ellipsis;
}

/* Column widths — fit everything in viewport */
#property-table .col-chevron { width: 2rem; }
#property-table th:nth-child(2) { width: 3.2rem; }  /* Score */
#property-table th:nth-child(3) { width: 3.2rem; }  /* Grade */
#property-table th:nth-child(5) { width: auto; }     /* Address — gets remaining space */
#property-table th:nth-child(9) { width: 5rem; }     /* Est. SF */
#property-table th:nth-child(12) { width: 6.5rem; }  /* Action */

tr:hover {
  background: var(--gold-bg);
}

/* ========== Upload Area ========== */
.upload-section {
  margin-bottom: 1.25rem;
}

.upload-area {
  border: 2px dashed var(--border);
  border-radius: 8px;
  padding: 2rem;
  text-align: center;
  cursor: pointer;
  transition: border-color 0.2s, background 0.2s;
}

.upload-area:hover,
.upload-area.drag-over {
  border-color: var(--gold);
  background: var(--gold-bg);
}

.upload-icon {
  font-size: 2rem;
  margin-bottom: 0.5rem;
}

.upload-text {
  color: var(--muted);
  margin-bottom: 0.75rem;
  font-size: 0.87rem;
}

.upload-help {
  margin-top: 0.75rem;
  font-size: 0.8rem;
  color: var(--muted);
}

.upload-help summary {
  cursor: pointer;
  color: var(--teal);
}

.upload-help code {
  background: var(--surface);
  padding: 0.1rem 0.3rem;
  border-radius: 3px;
  font-size: 0.75rem;
}

.upload-status {
  margin-top: 0.75rem;
  padding: 0.6rem 0.75rem;
  background: var(--surface);
  border-radius: 6px;
  font-size: 0.87rem;
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

/* ========== Status Tabs (Row 1) ========== */
.status-tabs {
  display: flex;
  gap: 0.3rem;
  margin-bottom: 0.5rem;
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
  flex-wrap: wrap;
}
.status-tab {
  padding: 0.45rem 0.8rem;
  border: 2px solid var(--border);
  border-radius: 8px;
  background: var(--white);
  color: var(--muted);
  font-family: inherit;
  font-size: 0.8rem;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.15s;
  white-space: nowrap;
}
.status-tab:hover {
  border-color: var(--gold);
  color: var(--text);
}
.status-tab.active {
  background: var(--gold-bg);
  border-color: var(--gold);
  color: var(--text);
}
.status-count {
  display: inline-block;
  background: var(--border);
  color: var(--muted);
  font-size: 0.68rem;
  font-weight: 700;
  padding: 0.1rem 0.4rem;
  border-radius: 10px;
  margin-left: 0.25rem;
  min-width: 1.2rem;
  text-align: center;
}
.status-tab.active .status-count {
  background: var(--gold);
  color: var(--white);
}

/* ========== Filter Bar (Row 2 — Priority) ========== */
.filter-bar {
  display: flex;
  gap: 0.4rem;
  margin-bottom: 1rem;
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
  align-items: center;
  flex-wrap: wrap;
}

.filter-btn {
  padding: 0.4rem 0.75rem;
  border: 1px solid var(--border);
  border-radius: 20px;
  background: var(--white);
  color: var(--muted);
  font-family: inherit;
  font-size: 0.75rem;
  font-weight: 600;
  cursor: pointer;
  white-space: nowrap;
  transition: all 0.2s;
}

.filter-btn:hover {
  border-color: var(--gold);
  color: var(--body-text);
}

.filter-btn.active {
  background: var(--gold);
  color: var(--black);
  border-color: var(--gold);
}

.filter-a.active { background: #d4edda; color: #155724; border-color: #d4edda; }
.filter-b.active { background: var(--gold-bg); color: #856404; border-color: var(--gold-bg); }
.filter-c.active { background: #e2e3e5; color: #383d41; border-color: #e2e3e5; }
.filter-disq.active { background: #f8d7da; color: #721c24; border-color: #f8d7da; }

/* ========== Data Completeness Badges ========== */
.badge-data-high { background: #d4edda; color: #155724; }
.badge-data-medium { background: var(--gold-bg); color: #856404; }
.badge-data-low { background: #f8d7da; color: #721c24; }
.badge-disqualified { background: #f8d7da; color: #721c24; }

/* ========== Feedback ========== */
.feedback-dashboard {
  margin-bottom: 1.5rem;
}

.dash-title {
  font-size: 0.73rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  color: var(--muted);
  margin-bottom: 0.75rem;
}

.dash-stats {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 0.5rem;
  margin-bottom: 1rem;
}

.dash-stat {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 0.75rem;
  text-align: center;
}

.dash-stat-val {
  font-size: 1.5rem;
  font-weight: 700;
  color: var(--gold);
  line-height: 1;
}

.dash-stat-lbl {
  font-size: 0.65rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  color: var(--muted);
  margin-top: 0.25rem;
}

.dash-entries {
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
}

.dash-entry {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 0.75rem;
}

.dash-entry-header {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  font-size: 0.87rem;
  margin-bottom: 0.25rem;
}

.dash-entry-date {
  color: var(--muted);
  font-size: 0.75rem;
}

.dash-entry-energy {
  margin-left: auto;
  font-weight: 700;
  font-size: 0.8rem;
}

.dash-entry-nums {
  font-size: 0.75rem;
  color: var(--muted);
  margin-bottom: 0.35rem;
}

.dash-entry-note {
  font-size: 0.8rem;
  color: var(--body-text);
  margin-top: 0.25rem;
  line-height: 1.4;
}

.dash-note-tag {
  font-size: 0.65rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  padding: 0.1rem 0.35rem;
  border-radius: 3px;
  margin-right: 0.25rem;
}

.dash-note-tag.good { background: #d4edda; color: #155724; }
.dash-note-tag.bad { background: #f8d7da; color: #721c24; }
.dash-note-tag.warn { background: var(--gold-bg); color: #856404; }
.dash-note-tag.idea { background: #d1ecf1; color: #0c5460; }

/* Energy bar */
.energy-bar {
  display: flex;
  gap: 0.3rem;
  margin: 0.5rem 0;
}

.energy-btn {
  flex: 1;
  padding: 0.6rem 0;
  border: 1px solid var(--border);
  border-radius: 6px;
  background: var(--surface);
  color: var(--muted);
  font-family: inherit;
  font-size: 0.87rem;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.15s;
}

.energy-btn:hover {
  border-color: var(--gold);
}

.energy-btn.active {
  background: var(--gold);
  border-color: var(--gold);
  color: var(--black);
}

.energy-label {
  font-size: 0.8rem;
  font-weight: 600;
  text-align: center;
  min-height: 1.2em;
}

@media (max-width: 640px) {
  .dash-stats { grid-template-columns: repeat(2, 1fr); }
  .energy-bar { flex-wrap: wrap; }
  .energy-btn { width: calc(20% - 0.24rem); flex: none; }
}

/* ========== Proposal ========== */
.state-warning {
  padding: 0.75rem;
  border-radius: 6px;
  font-size: 0.8rem;
  margin-bottom: 1rem;
}

.state-warning.blocked {
  background: #FEF0F0;
  color: #721c24;
  border: 1px solid #f8d7da;
}

.state-warning.info {
  background: var(--gold-bg);
  color: #856404;
  border: 1px solid var(--gold-light);
}

.proposal-info {
  text-align: center;
  padding: 1.5rem 0;
}

.proposal-badge {
  font-size: 1.5rem;
  font-weight: 700;
  color: var(--gold);
  font-family: 'Cormorant Garamond', Georgia, serif;
  letter-spacing: 0.04em;
}

.proposal-entity {
  font-size: 0.87rem;
  color: var(--muted);
  margin-top: 0.25rem;
}

.proposal-status {
  font-size: 0.8rem;
  color: var(--teal);
  margin-top: 0.25rem;
}

.proposal-actions {
  display: flex;
  gap: 0.5rem;
  margin-bottom: 1rem;
}

.proposal-actions .btn {
  flex: 1;
}

.proposal-iframe {
  width: 100%;
  height: 600px;
  border: 1px solid var(--border);
  border-radius: 8px;
  background: var(--black);
}

.proposal-list-item {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 0.6rem 0;
  border-bottom: 1px solid var(--border);
  gap: 0.5rem;
}

.proposal-list-info {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  font-size: 0.8rem;
  flex-wrap: wrap;
  min-width: 0;
}

.proposal-list-actions {
  display: flex;
  gap: 0.3rem;
  flex-shrink: 0;
}

@media (max-width: 640px) {
  .proposal-actions {
    flex-direction: column;
  }
  .proposal-list-item {
    flex-direction: column;
    align-items: flex-start;
  }
  .proposal-list-actions {
    width: 100%;
    margin-top: 0.35rem;
  }
  .proposal-list-actions .btn { flex: 1; }
}

/* ========== Edit Banner ========== */
.edit-banner {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 0.75rem;
  padding: 0.75rem 1rem;
  background: var(--gold-bg);
  border: 1px solid var(--gold);
  border-radius: 8px;
  margin-bottom: 1rem;
  font-size: 0.87rem;
  font-weight: 600;
  color: #856404;
}

/* ========== System Tier Cards ========== */
.system-tier-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 0.6rem;
  margin-top: 0.75rem;
}

.system-tier {
  display: block;
  padding: 0.85rem;
  border: 2px solid var(--border);
  border-radius: 10px;
  background: var(--surface);
  cursor: pointer;
  transition: all 0.15s;
  position: relative;
}

.system-tier input[type=radio] {
  position: absolute;
  opacity: 0;
}

.system-tier:hover {
  border-color: var(--gold-light);
}

.system-tier.active {
  background: var(--gold-bg);
  border-color: var(--gold);
  box-shadow: 0 0 0 3px rgba(201, 168, 76, 0.15);
}

.system-tier-head {
  font-family: 'Cormorant Garamond', Georgia, serif;
  font-size: 1.1rem;
  font-weight: 700;
  color: var(--gold);
  letter-spacing: 0.04em;
}

.system-tier.active .system-tier-head {
  color: var(--black);
}

.system-tier-name {
  font-size: 0.8rem;
  font-weight: 600;
  color: var(--body-text);
  margin-top: 0.15rem;
}

.system-tier-desc {
  font-size: 0.7rem;
  color: var(--muted);
  margin-top: 0.25rem;
  line-height: 1.4;
}

@media (max-width: 640px) {
  .system-tier-grid { grid-template-columns: 1fr; }
}

/* ========== Inspection Form ========== */
.insp-section {
  margin-bottom: 1rem;
}

.insp-section-head {
  background: var(--gold);
  padding: 0.5rem 0.75rem;
  border-radius: 8px 8px 0 0;
  display: flex;
  align-items: center;
  gap: 0.5rem;
  font-size: 0.8rem;
  font-weight: 600;
  color: var(--white);
  text-transform: uppercase;
  letter-spacing: 0.04em;
}

.insp-num {
  background: rgba(0,0,0,0.2);
  color: var(--white);
  width: 22px;
  height: 22px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 0.73rem;
  font-weight: 700;
  flex-shrink: 0;
}

.insp-section-body {
  background: var(--white);
  border: 1px solid var(--border);
  border-top: none;
  border-radius: 0 0 8px 8px;
  padding: 1rem;
}

.field-row {
  display: grid;
  gap: 0.6rem;
  margin-bottom: 0.75rem;
}

.field-row.cols-2 { grid-template-columns: repeat(2, 1fr); }
.field-row.cols-3 { grid-template-columns: repeat(3, 1fr); }
.field-row.cols-4 { grid-template-columns: repeat(4, 1fr); }

.field {
  display: flex;
  flex-direction: column;
  gap: 0.25rem;
}

/* Check grid */
.check-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 0.4rem;
}

.check-item {
  display: flex;
  align-items: center;
  gap: 0.6rem;
  padding: 0.6rem 0.75rem;
  border: 1px solid var(--border);
  border-radius: 8px;
  cursor: pointer;
  transition: all 0.15s;
  background: var(--surface);
  font-size: 0.8rem;
}

.check-item:hover {
  border-color: var(--gold);
  background: var(--gold-bg);
}

.check-item.checked {
  background: var(--gold-bg);
  border-color: var(--gold);
}

.check-item input[type=checkbox] {
  width: 16px;
  height: 16px;
  accent-color: var(--gold);
  cursor: pointer;
  flex-shrink: 0;
}

/* Score rows */
.score-row {
  margin-bottom: 0.6rem;
}

.score-label {
  font-size: 0.73rem;
  font-weight: 600;
  color: var(--muted);
  text-transform: uppercase;
  letter-spacing: 0.04em;
  margin-bottom: 0.3rem;
}

.score-opts {
  display: flex;
  gap: 0.3rem;
}

.score-opt {
  flex: 1;
  padding: 0.5rem 0.25rem;
  border: 1px solid var(--border);
  border-radius: 6px;
  text-align: center;
  cursor: pointer;
  font-size: 0.7rem;
  color: var(--muted);
  background: var(--surface);
  transition: all 0.15s;
  line-height: 1.3;
}

.score-opt:hover {
  border-color: var(--gold);
  color: var(--gold);
}

.score-opt.sel {
  background: var(--gold);
  border-color: var(--gold);
  color: var(--black);
  font-weight: 600;
}

.score-opt strong {
  display: block;
  font-size: 1rem;
  font-weight: 700;
  margin-bottom: 1px;
}

.score-total-bar {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.75rem;
  background: var(--surface);
  border-radius: 8px;
  margin-top: 0.75rem;
}

.score-total-num {
  font-size: 2rem;
  font-weight: 700;
  min-width: 50px;
  text-align: center;
  color: var(--muted);
}

.score-total-label {
  font-size: 0.87rem;
  color: var(--muted);
}

.score-total-band {
  margin-left: auto;
  font-size: 0.8rem;
  font-weight: 600;
}

/* Final call */
.final-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 0.5rem;
}

.final-opt {
  padding: 0.75rem;
  border: 2px solid var(--border);
  border-radius: 10px;
  cursor: pointer;
  transition: all 0.15s;
  background: var(--surface);
}

.final-opt:hover { transform: translateY(-1px); }
.final-opt-head { font-size: 0.87rem; font-weight: 700; margin-bottom: 0.15rem; }
.final-opt-sub { font-size: 0.75rem; color: var(--muted); }

.final-opt.coat { --fc: var(--green); --fbg: #E8F7F2; }
.final-opt.repairs { --fc: var(--gold); --fbg: var(--gold-bg); }
.final-opt.monitor { --fc: var(--muted); --fbg: var(--surface); }
.final-opt.notvbl { --fc: var(--red); --fbg: #FEF0F0; }

.final-opt.active {
  background: var(--fbg) !important;
  border-color: var(--fc) !important;
}
.final-opt.active .final-opt-head { color: var(--fc); }

/* Photos */
.photo-upload-area {
  border: 2px dashed var(--border);
  border-radius: 8px;
  padding: 1.5rem;
  text-align: center;
  margin-bottom: 0.75rem;
}

.photo-upload-area p {
  color: var(--muted);
  font-size: 0.8rem;
  margin-bottom: 0.5rem;
}

.photo-preview-list {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(140px, 1fr));
  gap: 0.5rem;
}

.photo-preview-item {
  border: 1px solid var(--border);
  border-radius: 8px;
  overflow: hidden;
  background: var(--white);
}

.photo-preview-item img {
  width: 100%;
  height: 100px;
  object-fit: cover;
}

.photo-preview-item select {
  width: 100%;
  border: none;
  border-top: 1px solid var(--border);
  border-radius: 0;
  padding: 0.3rem;
  font-size: 0.73rem;
}

.photo-preview-item .btn {
  width: 100%;
  border-radius: 0;
  padding: 0.3rem;
}

/* Pricing display */
.pricing-line {
  display: flex;
  justify-content: space-between;
  padding: 0.35rem 0;
  font-size: 0.87rem;
  border-bottom: 1px solid var(--surface);
}

.pricing-line.mod { color: var(--muted); font-size: 0.8rem; padding-left: 1rem; }
.pricing-line.addon { color: var(--teal); font-size: 0.8rem; }
.pricing-line.total-line { font-weight: 600; border-bottom: 2px solid var(--border); padding: 0.5rem 0; }

.pricing-grand {
  display: flex;
  justify-content: space-between;
  padding: 0.75rem 0 0;
  font-size: 1.1rem;
  font-weight: 700;
  color: var(--green);
}

.pricing-per-sf {
  margin-top: 0.75rem;
  padding: 0.75rem;
  background: var(--gold-bg);
  border: 1px solid var(--gold);
  border-radius: 6px;
}

.per-sf-row {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 0.5rem;
  text-align: center;
}

.per-sf-item {
  display: flex;
  flex-direction: column;
  gap: 0.2rem;
}

.per-sf-item strong {
  font-size: 1.1rem;
  font-weight: 700;
}

.per-sf-item small {
  font-size: 0.7rem;
  color: var(--muted);
  text-transform: uppercase;
  letter-spacing: 0.04em;
}

@media (max-width: 640px) {
  .per-sf-row {
    grid-template-columns: 1fr;
    gap: 0.5rem;
  }
}

@media (max-width: 640px) {
  .check-grid { grid-template-columns: 1fr; }
  .score-opts { flex-wrap: wrap; }
  .score-opt { flex: none; width: calc(50% - 0.15rem); }
  .final-grid { grid-template-columns: 1fr; }
  .field-row.cols-3, .field-row.cols-4 { grid-template-columns: repeat(2, 1fr); }
  .photo-preview-list { grid-template-columns: repeat(2, 1fr); }
}

/* ========== Photo Manager Modal ========== */
.photo-modal-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.75);
  z-index: 2000;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 1rem;
}

.photo-modal {
  background: var(--white);
  border-radius: 12px;
  max-width: 800px;
  width: 100%;
  max-height: 90vh;
  display: flex;
  flex-direction: column;
  overflow: hidden;
}

.photo-modal-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 1rem 1.25rem;
  border-bottom: 1px solid var(--border);
  background: var(--surface);
}

.photo-modal-header h3 {
  font-size: 1.1rem;
  margin: 0;
}

.photo-modal-header p {
  font-size: 0.8rem;
  color: var(--muted);
  margin: 0.15rem 0 0;
}

.photo-modal-body {
  padding: 1rem 1.25rem;
  overflow-y: auto;
  flex: 1;
}

.photo-modal-upload {
  margin-bottom: 1rem;
  padding-bottom: 1rem;
  border-bottom: 1px solid var(--border);
}

.pm-dropzone {
  border: 2px dashed var(--border);
  border-radius: 10px;
  padding: 1.5rem 1rem;
  text-align: center;
  cursor: pointer;
  transition: all 0.2s;
  background: var(--surface);
  margin-bottom: 1rem;
}

.pm-dropzone:hover {
  border-color: var(--gold);
  background: var(--gold-bg);
}

.pm-dropzone.drag-over {
  border-color: var(--gold);
  background: var(--gold-bg);
  transform: scale(1.01);
  border-style: solid;
}

.pm-dropzone.uploading {
  opacity: 0.6;
  pointer-events: none;
}

.pm-dropzone-icon {
  font-size: 2rem;
  margin-bottom: 0.5rem;
}

.pm-dropzone-text {
  font-size: 0.93rem;
  font-weight: 600;
  color: var(--body-text);
  margin: 0 0 0.25rem;
}

.pm-dropzone-sub {
  font-size: 0.75rem;
  color: var(--muted);
  margin: 0;
}

.photo-modal-list {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(160px, 1fr));
  gap: 0.75rem;
}

.pm-photo {
  border: 1px solid var(--border);
  border-radius: 8px;
  overflow: hidden;
  background: var(--surface);
}

.pm-photo img {
  width: 100%;
  height: 140px;
  object-fit: cover;
  cursor: pointer;
  display: block;
}

.pm-photo-meta {
  padding: 0.5rem;
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 0.4rem;
}

@media (max-width: 640px) {
  .photo-modal {
    max-height: 100vh;
    height: 100vh;
    border-radius: 0;
  }
  .photo-modal-list {
    grid-template-columns: repeat(2, 1fr);
  }
  .pm-photo img {
    height: 100px;
  }
}

/* ========== Saved Inspections ========== */
.saved-insp-item {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 0.6rem 0;
  border-bottom: 1px solid var(--border);
  gap: 0.5rem;
}

.saved-insp-info {
  min-width: 0;
}

.saved-insp-info strong {
  display: block;
  font-size: 0.87rem;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.saved-insp-info span {
  font-size: 0.75rem;
  color: var(--muted);
}

.saved-insp-meta {
  display: flex;
  align-items: center;
  gap: 0.4rem;
  flex-shrink: 0;
  font-size: 0.75rem;
  color: var(--muted);
}

/* ========== Route View ========== */
.route-date-header {
  font-size: 1.15rem;
  font-weight: 700;
  color: var(--text);
  padding: 0.6rem 0;
  margin-bottom: 0.5rem;
  border-bottom: 2px solid var(--gold);
}
.route-date-label {
  font-size: 0.72rem;
  color: var(--muted);
  font-style: italic;
}
.route-carryover-toggle {
  display: block;
  width: 100%;
  text-align: left;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 6px;
  padding: 0.6rem 0.8rem;
  font-family: inherit;
  font-size: 0.85rem;
  font-weight: 600;
  color: var(--muted);
  cursor: pointer;
  margin-top: 1rem;
  transition: background 0.15s;
}
.route-carryover-toggle:hover {
  background: var(--gold-bg);
  color: var(--text);
}
.dash-totals-row td {
  border-top: 2px solid var(--border);
  background: var(--surface);
}
.route-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 1rem;
}

.route-stats {
  display: flex;
  gap: 1rem;
  font-size: 0.87rem;
}

.route-count {
  font-weight: 700;
  color: var(--body-text);
}

.route-inspected {
  color: var(--green);
  font-weight: 600;
}

.route-separator {
  color: var(--border);
}

.route-remaining {
  color: var(--gold);
  font-weight: 600;
}

.route-progress {
  margin-bottom: 1rem;
}

.progress-bar {
  height: 8px;
  background: var(--surface);
  border-radius: 4px;
  overflow: hidden;
  border: 1px solid var(--border);
}

.progress-fill {
  height: 100%;
  background: linear-gradient(90deg, var(--gold), var(--green));
  border-radius: 4px;
  transition: width 0.3s ease;
}

.progress-label {
  font-size: 0.7rem;
  color: var(--muted);
  text-align: right;
  margin-top: 0.2rem;
}

.route-city-header {
  font-size: 0.73rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  color: var(--muted);
  padding: 0.75rem 0 0.35rem;
  border-bottom: 1px solid var(--border);
  margin-bottom: 0.5rem;
}

.route-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 0.75rem;
  margin-bottom: 0.5rem;
  transition: border-color 0.2s;
}

.route-card:hover {
  border-color: var(--gold);
}

.route-card.route-done {
  opacity: 0.6;
  border-left: 3px solid var(--green);
}

.route-card-main {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 0.75rem;
}

.route-card-info {
  flex: 1;
  min-width: 0;
}

.route-address {
  font-weight: 600;
  font-size: 0.93rem;
  color: var(--body-text);
}

.route-business {
  font-size: 0.8rem;
  color: var(--muted);
  margin-top: 0.15rem;
}

.route-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  margin-top: 0.35rem;
  font-size: 0.75rem;
  color: var(--muted);
}

.route-card-actions {
  display: flex;
  gap: 0.35rem;
  flex-shrink: 0;
}

.route-list {
  margin-bottom: 1rem;
}

@media (max-width: 640px) {
  .route-card-main {
    flex-direction: column;
    align-items: flex-start;
  }

  .route-card-actions {
    width: 100%;
    margin-top: 0.5rem;
  }

  .route-card-actions .btn {
    flex: 1;
  }
}

/* ========== Toast Notifications ========== */
#toast-container {
  position: fixed;
  bottom: 1rem;
  right: 1rem;
  z-index: 1000;
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
}

.toast {
  padding: 0.75rem 1rem;
  border-radius: 6px;
  font-size: 0.87rem;
  font-weight: 500;
  color: var(--white);
  box-shadow: 0 2px 8px rgba(0,0,0,0.15);
  animation: toast-in 0.3s ease;
  max-width: 360px;
}

.toast-success { background: var(--green); }
.toast-error { background: var(--red); }
.toast-info { background: var(--teal); }

@keyframes toast-in {
  from { opacity: 0; transform: translateY(1rem); }
  to { opacity: 1; transform: translateY(0); }
}

/* ========== Loading Spinner ========== */
.spinner {
  display: inline-block;
  width: 20px;
  height: 20px;
  border: 2px solid var(--border);
  border-top-color: var(--gold);
  border-radius: 50%;
  animation: spin 0.6s linear infinite;
}

@keyframes spin {
  to { transform: rotate(360deg); }
}

/* ========== Responsive ========== */
@media (max-width: 640px) {
  .navbar {
    padding: 0.75rem 1rem;
  }

  .navbar-logo {
    height: 80px;
  }

  .navbar-logo-fgr {
    height: 34px;
  }

  .navbar-divider {
    height: 26px;
    margin: 0 0.15rem;
  }

  .navbar-title {
    font-size: 1.35rem;
    margin-left: 0.55rem;
    letter-spacing: 0.07em;
    text-shadow:
      1px 1px 0 #6B4F0F,
      2px 2px 0 #4A3608,
      2px 2px 4px rgba(0, 0, 0, 0.85);
  }

  .tab-btn {
    font-size: 0.7rem;
    padding: 0.6rem 0.35rem;
  }

  .tab-content {
    padding: 0.75rem;
  }

  .panel-body {
    padding: 1rem;
  }

  .panel-header h2 {
    font-size: 1.25rem;
  }
}

/* ============================================================
   COLD LIST — Transparency / Expandable Rows / Import Summary
   ============================================================ */

/* ---- Import summary chips (top of Cold List after upload) ---- */
.import-summary {
  display: flex;
  flex-direction: column;
  gap: 0.45rem;
}
.import-summary__total {
  font-size: 0.9rem;
  color: var(--ink, #1a1a1a);
}
.import-summary__grid {
  display: flex;
  gap: 0.4rem;
  flex-wrap: wrap;
}
.chip {
  display: inline-flex;
  align-items: center;
  padding: 0.3rem 0.65rem;
  border-radius: 999px;
  font-size: 0.78rem;
  font-weight: 600;
  letter-spacing: 0.02em;
  border: 1px solid transparent;
}
.chip-new { background: #E8F5EE; color: #1D7A54; border-color: #BCE0CA; }
.chip-dup { background: #FBF6EA; color: #856404; border-color: #E8D89A; }
.chip-dq  { background: #FCEBEB; color: #A02B2B; border-color: #F0BCBC; }
.chip-err { background: #3a0a0a; color: #FFC7C7; border-color: #6b1111; }

/* ---- Chevron + expandable row mechanics ---- */
.col-chevron {
  width: 34px;
  padding: 0 !important;
  text-align: center;
}
.chevron-btn {
  background: transparent;
  border: none;
  color: var(--gold);
  font-size: 0.9rem;
  cursor: pointer;
  padding: 0.35rem 0.5rem;
  line-height: 1;
  border-radius: 4px;
  transition: background 0.15s;
}
.chevron-btn:hover {
  background: var(--gold-bg, #FBF6EA);
}
tr.property-row.expanded {
  background: var(--gold-bg, #FBF6EA) !important;
}
tr.property-detail-row > td {
  padding: 0 !important;
  background: #FAF8F1;
  border-top: 1px solid #E8D89A;
  border-bottom: 2px solid var(--gold, #C9A84C);
}

/* ---- Visit tier pill in main row ---- */
.tier-pill {
  display: inline-block;
  padding: 0.18rem 0.55rem;
  border-radius: 999px;
  font-size: 0.7rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  border: 1px solid transparent;
  white-space: nowrap;
}
.tier-low  { background: #EFEFEF; color: #555;    border-color: #CFCFCF; }
.tier-med  { background: #E6F4F1; color: #156B60; border-color: #A8D9D1; }
.tier-high { background: #FBF6EA; color: #856404; border-color: #E8D89A; }
.tier-plus { background: #1A8A7A; color: #fff;    border-color: #135D52; }

/* Remote-only action pill (sub-5000 SF) */
.pill {
  display: inline-block;
  padding: 0.3rem 0.65rem;
  border-radius: 6px;
  font-size: 0.72rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.04em;
}
.pill-remote {
  background: #EFEFEF;
  color: #666;
  border: 1px dashed #BBB;
}
.pill-phone {
  background: #F3EFE2;
  color: #7A5B0F;
  border: 1px dashed #C9A84C;
  cursor: help;
}

/* Solar satellite badge + enrichment button */
.solar-badge {
  display: inline-block;
  font-size: 0.6rem;
  font-weight: 700;
  color: #B8860B;
  background: #FFF8DC;
  border: 1px solid #DAA520;
  border-radius: 3px;
  padding: 0.05rem 0.3rem;
  margin-left: 0.3rem;
  vertical-align: middle;
  cursor: help;
  text-transform: uppercase;
  letter-spacing: 0.03em;
}
.btn-solar {
  background: #FFF8DC;
  color: #8B6914;
  border: 1px solid #DAA520;
  font-weight: 600;
  margin-left: auto;
}
.btn-solar:hover {
  background: #DAA520;
  color: #fff;
}
.btn-solar:disabled {
  opacity: 0.6;
  cursor: wait;
}
.solar-hint {
  font-size: 0.72rem;
  color: #B8860B;
  margin-top: 0.2rem;
  font-style: italic;
}

/* DQ inline reason beneath the badge in the grade cell */
.grade-cell {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 0.15rem;
}
.dq-inline {
  font-size: 0.68rem;
  font-weight: 600;
  color: #A02B2B;
  text-transform: uppercase;
  letter-spacing: 0.03em;
  cursor: help;
  max-width: 110px;
  line-height: 1.15;
}

/* Soft tint on the whole DQ row so it reads as "rejected" at a glance */
tr.property-row.row-dq {
  background: #FFF7F7;
}
tr.property-row.row-dq.expanded {
  background: #FCEBEB !important;
}

.action-cell {
  display: flex;
  gap: 0.25rem;
  flex-wrap: wrap;
  align-items: center;
}

.muted { color: #9a9a9a; }

/* ---- Grade detail panel ---- */
.grade-detail {
  padding: 1rem 1.25rem 1.25rem;
}
.grade-detail__header {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  gap: 1rem;
  margin-bottom: 0.9rem;
  padding-bottom: 0.6rem;
  border-bottom: 1px solid #E8D89A;
}
.grade-detail__title {
  font-size: 1rem;
  font-weight: 700;
  color: #222;
  letter-spacing: 0.01em;
}
.grade-detail__subhead {
  font-size: 0.75rem;
  font-weight: 700;
  text-transform: uppercase;
  color: #666;
  letter-spacing: 0.05em;
  margin: 1rem 0 0.5rem;
}
.grade-detail__score .score-num {
  font-size: 1.75rem;
  font-weight: 800;
  color: var(--gold, #C9A84C);
}
.grade-detail__score .score-out-of {
  font-size: 0.9rem;
  color: #888;
  margin-left: 0.2rem;
}
.grade-detail__footnote {
  margin-top: 0.9rem;
  padding-top: 0.7rem;
  border-top: 1px dashed #E8D89A;
  font-size: 0.78rem;
  color: #555;
}
.no-breakdown {
  padding: 0.8rem 1rem;
  background: #fff;
  border: 1px dashed #CFCFCF;
  border-radius: 6px;
  color: #777;
  font-size: 0.82rem;
  font-style: italic;
}

/* ---- Disqualified callout ---- */
.dq-callout {
  background: #FCEBEB;
  border: 1px solid #F0BCBC;
  border-left: 4px solid #A02B2B;
  border-radius: 6px;
  padding: 0.75rem 1rem;
  margin-bottom: 0.5rem;
}
.dq-reason {
  font-size: 0.72rem;
  font-weight: 800;
  letter-spacing: 0.08em;
  color: #A02B2B;
  margin-bottom: 0.25rem;
}
.dq-detail {
  font-size: 0.88rem;
  color: #4a1a1a;
  line-height: 1.4;
}

/* ---- Factor rows inside the detail panel ---- */
.factor-list {
  display: flex;
  flex-direction: column;
  gap: 0.35rem;
}
.factor-row {
  display: grid;
  grid-template-columns: 1fr 2fr auto;
  gap: 0.6rem;
  align-items: center;
  padding: 0.55rem 0.75rem;
  background: #fff;
  border-radius: 6px;
  border-left: 3px solid #CFCFCF;
  font-size: 0.84rem;
}
.factor-row__main {
  display: flex;
  flex-direction: column;
  gap: 0.15rem;
}
.factor-row__label {
  font-weight: 700;
  color: #222;
  font-size: 0.82rem;
}
.factor-row__value {
  font-size: 0.74rem;
  color: #666;
  text-transform: uppercase;
  letter-spacing: 0.03em;
}
.factor-row__detail {
  color: #444;
  line-height: 1.35;
  font-size: 0.82rem;
}
.factor-row__impact {
  font-weight: 800;
  font-size: 0.85rem;
  font-variant-numeric: tabular-nums;
  padding: 0.2rem 0.55rem;
  border-radius: 4px;
  background: #F0EFEA;
  color: #444;
  white-space: nowrap;
}

/* Severity color-coding (left border + impact pill) */
.factor-sev-positive_max    { border-left-color: #1D9E75; }
.factor-sev-positive_max    .factor-row__impact { background: #DFF6EA; color: #106140; }
.factor-sev-positive_strong { border-left-color: #2AB787; }
.factor-sev-positive_strong .factor-row__impact { background: #E6F7EF; color: #156B4A; }
.factor-sev-positive        { border-left-color: #5BC0A3; }
.factor-sev-positive        .factor-row__impact { background: #EDF7F3; color: #1E7A5A; }
.factor-sev-positive_weak   { border-left-color: #B9D8C9; }
.factor-sev-positive_weak   .factor-row__impact { background: #F2F7F4; color: #3F6B55; }
.factor-sev-neutral         { border-left-color: #CFCFCF; }
.factor-sev-neutral         .factor-row__impact { background: #F0EFEA; color: #666; }
.factor-sev-negative        { border-left-color: #E25555; }
.factor-sev-negative        .factor-row__impact { background: #FCEBEB; color: #A02B2B; }
.factor-sev-disqualify      { border-left-color: #A02B2B; background: #FFF4F4; }
.factor-sev-disqualify      .factor-row__impact { background: #A02B2B; color: #fff; }

/* ---- Mobile ---- */
@media (max-width: 720px) {
  .factor-row {
    grid-template-columns: 1fr auto;
    grid-template-areas:
      "label impact"
      "value impact"
      "detail detail";
    column-gap: 0.5rem;
    row-gap: 0.2rem;
  }
  .factor-row__main   { display: contents; }
  .factor-row__label  { grid-area: label; }
  .factor-row__value  { grid-area: value; }
  .factor-row__detail { grid-area: detail; margin-top: 0.2rem; }
  .factor-row__impact { grid-area: impact; align-self: start; }
  .grade-detail {
    padding: 0.8rem 0.9rem 1rem;
  }
  .grade-detail__header {
    flex-wrap: wrap;
  }
}

/* ============================================================
   Team Dashboard (admin only) — /api/admin/kpis
   ============================================================ */

.dash-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 1rem;
  flex-wrap: wrap;
}
.dash-range {
  display: inline-flex;
  gap: 0.25rem;
  background: var(--white);
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 0.25rem;
  box-shadow: 0 1px 2px rgba(0, 0, 0, 0.04);
}
.dash-range-btn {
  background: transparent;
  border: none;
  color: var(--body-text);
  font: inherit;
  font-size: 0.78rem;
  font-weight: 600;
  letter-spacing: 0.02em;
  padding: 0.45rem 0.85rem;
  border-radius: 6px;
  cursor: pointer;
  transition: background 0.15s, color 0.15s;
}
.dash-range-btn:hover {
  background: var(--surface);
}
.dash-range-btn.active {
  background: var(--black);
  color: var(--gold);
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.25);
}

.dash-loading,
.dash-empty {
  padding: 2rem;
  text-align: center;
  color: var(--muted);
  font-style: italic;
}

.dash-content {
  display: flex;
  flex-direction: column;
  gap: 1.25rem;
}

/* ---- Hero cards ---- */
.dash-hero {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 0.75rem;
}
.dash-card {
  background: var(--white);
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 0.9rem 1rem;
  position: relative;
  overflow: hidden;
}
.dash-card::before {
  content: '';
  position: absolute;
  top: 0; left: 0; bottom: 0;
  width: 4px;
  background: var(--muted);
}
.dash-card-gold::before  { background: var(--gold); }
.dash-card-green::before { background: var(--green); }
.dash-card-teal::before  { background: var(--teal); }
.dash-card-red::before   { background: var(--red); }
.dash-card-label {
  font-size: 0.68rem;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--muted);
  font-weight: 600;
}
.dash-card-value {
  font-size: 1.55rem;
  font-weight: 800;
  color: var(--black);
  line-height: 1.15;
  margin-top: 0.15rem;
}

/* ---- Stale alerts ---- */
.dash-alert {
  border-radius: 8px;
  padding: 0.75rem 1rem;
  font-size: 0.85rem;
  font-weight: 500;
  border: 1px solid transparent;
}
.dash-alert-ok {
  background: #EAF6EF;
  color: #156B4A;
  border-color: #BFE3CE;
}
.dash-alert-warn {
  background: #FFF4E5;
  color: #8A4B00;
  border-color: #F0C998;
}
.dash-alert strong { font-weight: 800; }

/* ---- 2-column layout ---- */
.dash-grid-2 {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 1rem;
}
.dash-panel {
  background: var(--white);
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 1rem 1.1rem;
}
.dash-panel-title {
  font-size: 0.78rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--muted);
  margin-bottom: 0.85rem;
}

/* ---- Pipeline funnel ---- */
.dash-funnel {
  display: flex;
  flex-direction: column;
  gap: 0.4rem;
}
.dash-funnel-row {
  display: grid;
  grid-template-columns: 80px 1fr 48px;
  align-items: center;
  gap: 0.6rem;
  font-size: 0.82rem;
}
.dash-funnel-label {
  font-weight: 600;
  color: var(--body-text);
}
.dash-funnel-bar-wrap {
  background: var(--surface);
  border-radius: 4px;
  height: 16px;
  overflow: hidden;
}
.dash-funnel-bar {
  height: 100%;
  background: var(--muted);
  border-radius: 4px;
  transition: width 0.3s;
}
.dash-funnel-bar-cold      { background: #9B9B9B; }
.dash-funnel-bar-routed    { background: var(--teal); }
.dash-funnel-bar-inspected { background: var(--gold); }
.dash-funnel-bar-proposed  { background: var(--gold-light); }
.dash-funnel-bar-closed    { background: var(--green); }
.dash-funnel-bar-lost      { background: var(--red); }
.dash-funnel-value {
  text-align: right;
  font-variant-numeric: tabular-nums;
  font-weight: 700;
  color: var(--body-text);
}

/* ---- Activity sparkline ---- */
.dash-spark {
  display: grid;
  grid-template-columns: repeat(7, 1fr);
  gap: 0.4rem;
  align-items: end;
  height: 110px;
}
.dash-spark-col {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.35rem;
  height: 100%;
}
.dash-spark-bars {
  flex: 1;
  width: 100%;
  display: flex;
  align-items: flex-end;
  justify-content: center;
  gap: 2px;
  min-height: 0;
}
.dash-spark-bar {
  width: 12px;
  min-height: 2px;
  border-radius: 2px 2px 0 0;
  transition: height 0.3s;
}
.dash-spark-insp { background: var(--gold); }
.dash-spark-prop { background: var(--teal); }
.dash-spark-label {
  font-size: 0.65rem;
  color: var(--muted);
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.04em;
}
.dash-spark-legend {
  margin-top: 0.6rem;
  font-size: 0.72rem;
  color: var(--muted);
  display: flex;
  gap: 0.9rem;
  align-items: center;
}
.dash-legend-dot {
  display: inline-block;
  width: 10px;
  height: 10px;
  border-radius: 2px;
  margin-right: 0.3rem;
  vertical-align: middle;
}
.dash-legend-insp { background: var(--gold); }
.dash-legend-prop { background: var(--teal); }

/* ---- Grade / State mix bars ---- */
.dash-mix {
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
}
.dash-mix-row {
  display: grid;
  grid-template-columns: 40px 1fr 90px;
  align-items: center;
  gap: 0.6rem;
  font-size: 0.82rem;
}
.dash-mix-label {
  font-weight: 800;
  text-align: center;
  padding: 0.2rem 0;
  border-radius: 4px;
  font-size: 0.75rem;
  letter-spacing: 0.04em;
}
.dash-mix-a  { background: #EAF6EF; color: #156B4A; }
.dash-mix-b  { background: #FBF6EA; color: #8A6B1A; }
.dash-mix-c  { background: #F5F3EE; color: #6B6966; }
.dash-mix-dq { background: #FCEBEB; color: #A02B2B; }
.dash-mix-state {
  background: var(--black);
  color: var(--gold);
}
.dash-mix-bar-wrap {
  background: var(--surface);
  border-radius: 4px;
  height: 12px;
  overflow: hidden;
}
.dash-mix-bar {
  height: 100%;
  background: var(--muted);
  border-radius: 4px;
  transition: width 0.3s;
}
.dash-mix-bar-a  { background: var(--green); }
.dash-mix-bar-b  { background: var(--gold); }
.dash-mix-bar-c  { background: #B0AEA9; }
.dash-mix-bar-dq { background: var(--red); }
.dash-mix-bar-state { background: var(--teal); }
.dash-mix-value {
  font-variant-numeric: tabular-nums;
  font-weight: 700;
  text-align: right;
  color: var(--body-text);
}
.dash-mix-pct {
  font-weight: 500;
  color: var(--muted);
}

/* ---- Leaderboard table ---- */
.dash-table-wrap {
  overflow-x: auto;
  margin: 0 -0.3rem;
}
.dash-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.85rem;
}
.dash-table thead th {
  text-align: left;
  font-size: 0.68rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--muted);
  padding: 0.5rem 0.6rem;
  border-bottom: 1px solid var(--border);
}
.dash-table th.num,
.dash-table td.num {
  text-align: right;
  font-variant-numeric: tabular-nums;
}
.dash-table tbody td {
  padding: 0.7rem 0.6rem;
  border-bottom: 1px solid var(--surface);
  vertical-align: middle;
}
.dash-table tbody tr:last-child td {
  border-bottom: none;
}
.dash-rank {
  width: 32px;
  font-weight: 800;
  color: var(--gold);
  font-size: 1rem;
}
.dash-rep-name {
  font-weight: 700;
  color: var(--body-text);
}
.dash-rep-title {
  font-size: 0.72rem;
  color: var(--muted);
  text-transform: uppercase;
  letter-spacing: 0.04em;
}
.dash-rep-money {
  font-weight: 800;
  color: var(--green);
}

/* ---- Footnote ---- */
.dash-footnote {
  font-size: 0.72rem;
  color: var(--muted);
  text-align: right;
  padding-top: 0.4rem;
}

/* ---- Mobile ---- */
@media (max-width: 720px) {
  .dash-header {
    flex-direction: column;
    align-items: stretch;
  }
  .dash-range {
    justify-content: space-between;
  }
  .dash-range-btn {
    flex: 1;
    padding: 0.45rem 0.4rem;
    font-size: 0.72rem;
  }
  .dash-hero {
    grid-template-columns: repeat(2, 1fr);
  }
  .dash-card-value {
    font-size: 1.3rem;
  }
  .dash-grid-2 {
    grid-template-columns: 1fr;
  }
  .dash-funnel-row {
    grid-template-columns: 68px 1fr 42px;
    font-size: 0.78rem;
  }
  .dash-mix-row {
    grid-template-columns: 36px 1fr 78px;
    font-size: 0.78rem;
  }
  .dash-spark {
    height: 90px;
  }
  .dash-spark-bar {
    width: 9px;
  }
  .dash-table {
    font-size: 0.78rem;
  }
  .dash-table thead th,
  .dash-table tbody td {
    padding: 0.5rem 0.4rem;
  }
  .dash-rep-title {
    display: none;
  }
}

/* ========== Cold List: mobile column hiding ========== */
@media (max-width: 640px) {
  .col-hide-mobile {
    display: none;
  }
  /* Reduce panel padding so table gets more room */
  #tab-coldlist .panel-body {
    padding-left: 0.5rem;
    padding-right: 0.5rem;
  }
  #property-table th,
  #property-table td {
    padding: 0.45rem 0.3rem;
    font-size: 0.78rem;
  }
  /* Truncate address on narrow screens */
  #property-table td:nth-child(5) {
    max-width: 110px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
  }
  /* Keep action cell compact */
  .action-cell .pill-phone {
    font-size: 0.58rem;
    padding: 0.15rem 0.35rem;
  }
  .action-cell .btn-sm {
    font-size: 0.65rem;
    padding: 0.3rem 0.45rem;
  }
}

/* ═══════════════════════════════════════════════════════════════
   PROPOSALS SENT TAB — pipeline view
   ═══════════════════════════════════════════════════════════════ */
.tab-badge {
  display: inline-block;
  background: #C9A84C; color: #0D0D0A;
  font-size: 0.65rem; font-weight: 700;
  padding: 0.08rem 0.35rem;
  border-radius: 8px;
  margin-left: 0.3rem;
  vertical-align: middle;
}
.sent-filter-bar {
  display: flex; flex-wrap: wrap; gap: 0.4rem;
  margin-bottom: 1rem;
  border-bottom: 1px solid rgba(201,168,76,0.15);
  padding-bottom: 0.6rem;
}
.sent-filter {
  background: transparent;
  border: 1px solid rgba(201,168,76,0.25);
  border-radius: 16px;
  color: #8a8578;
  font-size: 0.78rem; letter-spacing: 0.04em;
  padding: 0.35rem 0.85rem;
  cursor: pointer;
  transition: all 0.12s ease;
}
.sent-filter:hover { color: #d6d2c6; border-color: rgba(201,168,76,0.45); }
.sent-filter.active {
  background: #C9A84C; color: #0D0D0A; border-color: #C9A84C;
  font-weight: 700;
}
.sent-list { display: flex; flex-direction: column; gap: 0.6rem; }
.sent-card {
  background: #181816;
  border: 1px solid rgba(201,168,76,0.18);
  border-radius: 6px;
  padding: 0.85rem 1rem;
  transition: border-color 0.12s ease;
}
.sent-card:hover { border-color: rgba(201,168,76,0.35); }
.sent-card-row {
  display: grid;
  grid-template-columns: 12px 1fr auto;
  gap: 0.7rem;
  align-items: flex-start;
}
.sent-dot {
  width: 10px; height: 10px; border-radius: 50%;
  margin-top: 6px; flex-shrink: 0;
}
.sd-draft   { background: #555450; }
.sd-sent    { background: #C9A84C; }
.sd-viewed  { background: #185FA5; }
.sd-replied { background: #BA7517; }
.sd-signed  { background: #2e8b57; }
.sd-lost    { background: #A32D2D; }
.sent-card-title {
  display: flex; flex-wrap: wrap; align-items: center; gap: 0.4rem;
  font-size: 0.92rem;
  color: #F5F3EE;
}
.sent-card-entity { font-size: 0.62rem !important; padding: 0.1rem 0.45rem; }
.sent-card-sub {
  margin-top: 0.2rem;
  font-size: 0.75rem; color: #8a8578; line-height: 1.5;
}
.sent-card-right { text-align: right; }
.sent-card-total {
  font-family: "Barlow Condensed", sans-serif;
  font-size: 1.05rem; font-weight: 700;
  color: #C9A84C;
}
.sent-card-num {
  font-size: 0.68rem; color: #666;
  letter-spacing: 0.06em;
}
.sent-pill {
  font-size: 0.6rem; font-weight: 700;
  letter-spacing: 0.08em; text-transform: uppercase;
  padding: 0.1rem 0.4rem; border-radius: 3px;
}
.sent-pill-bounce { background: rgba(163,45,45,0.18); color: #e88080; border: 1px solid rgba(163,45,45,0.35); }
.sent-pill-reply  { background: rgba(186,117,23,0.18); color: #e8b080; border: 1px solid rgba(186,117,23,0.35); }
.sent-pill-sent   { background: rgba(46,139,87,0.18); color: #7fd5a2; border: 1px solid rgba(46,139,87,0.35); }

/* ═══════ Reply thread expand ═══════ */
.sent-card-expand {
  margin-top: 0.7rem;
  padding-top: 0.7rem;
  border-top: 1px solid rgba(255,255,255,0.06);
}
.reply-block {
  background: #0D0D0A;
  border: 1px solid rgba(255,255,255,0.08);
  border-radius: 6px;
  padding: 0.8rem 1rem;
  margin-bottom: 0.6rem;
}
.reply-head {
  display: flex; justify-content: space-between; align-items: center;
  gap: 0.5rem;
  margin-bottom: 0.35rem;
}
.reply-head strong { color: #F5F3EE; font-size: 0.88rem; }
.reply-from { color: #666; font-size: 0.72rem; margin-left: 0.35rem; }
.reply-intent {
  background: rgba(201,168,76,0.12);
  color: #C9A84C;
  font-size: 0.68rem; letter-spacing: 0.06em; text-transform: uppercase;
  font-weight: 700;
  padding: 0.18rem 0.6rem;
  border-radius: 3px;
  border: 1px solid rgba(201,168,76,0.3);
}
.reply-summary {
  color: #b8b5ac; font-size: 0.8rem; font-style: italic;
  margin-bottom: 0.45rem;
}
.reply-body {
  background: #181816;
  border: 1px solid rgba(255,255,255,0.06);
  padding: 0.6rem 0.8rem;
  border-radius: 4px;
  color: #d6d2c6;
  font-size: 0.8rem; line-height: 1.5;
  white-space: pre-wrap; word-wrap: break-word;
  max-height: 260px; overflow-y: auto;
  font-family: inherit;
  margin: 0;
}
.reply-draft { margin-top: 0.7rem; }
.reply-draft label {
  display: block;
  font-family: "Barlow Condensed", sans-serif;
  font-size: 0.7rem; letter-spacing: 0.1em; text-transform: uppercase;
  color: #8a8578;
  margin-bottom: 0.3rem;
}
.reply-draft textarea {
  width: 100%;
  min-height: 130px;
  background: #0D0D0A;
  border: 1px solid rgba(201,168,76,0.25);
  border-radius: 4px;
  color: #F5F3EE;
  font-size: 0.85rem; line-height: 1.5;
  padding: 0.6rem 0.8rem;
  font-family: inherit;
  resize: vertical;
}
.reply-draft textarea:focus {
  outline: none;
  border-color: rgba(201,168,76,0.55);
  box-shadow: 0 0 0 2px rgba(201,168,76,0.12);
}
.reply-draft-actions {
  display: flex; justify-content: flex-end;
  margin-top: 0.45rem;
}
.reply-sent-body pre {
  background: rgba(46,139,87,0.08);
  border: 1px solid rgba(46,139,87,0.25);
  padding: 0.6rem 0.8rem;
  border-radius: 4px;
  font-size: 0.8rem; color: #d6d2c6;
  white-space: pre-wrap; word-wrap: break-word;
  font-family: inherit;
  margin-top: 0.5rem;
}
.no-replies {
  color: #8a8578;
  font-size: 0.82rem;
  font-style: italic;
  padding: 0.5rem 0;
}
.sent-card-actions {
  display: flex; gap: 0.4rem; flex-wrap: wrap;
  margin-top: 0.6rem;
  padding-top: 0.6rem;
  border-top: 1px solid rgba(255,255,255,0.05);
}
.btn.btn-outline {
  background: transparent;
  border: 1px solid rgba(201,168,76,0.3);
  color: #d6d2c6;
}
.btn.btn-outline:hover { border-color: rgba(201,168,76,0.55); background: rgba(201,168,76,0.06); }

/* ═══════════════════════════════════════════════════════════════
   SEND PROPOSAL MODAL — PDF preview + approve gate
   ═══════════════════════════════════════════════════════════════ */
.send-modal-overlay {
  position: fixed; inset: 0; z-index: 2000;
  background: rgba(0,0,0,0.75);
  display: flex; align-items: center; justify-content: center;
  padding: 1rem;
  animation: fadeIn 0.15s ease-out;
}
.send-modal {
  background: #1a1a17;
  border: 1px solid rgba(201,168,76,0.3);
  border-radius: 10px;
  width: 100%; max-width: 960px;
  max-height: 92vh;
  display: flex; flex-direction: column;
  overflow: hidden;
  box-shadow: 0 20px 60px rgba(0,0,0,0.5);
}
.send-modal-head {
  display: flex; justify-content: space-between; align-items: center;
  padding: 1rem 1.25rem;
  border-bottom: 1px solid rgba(255,255,255,0.08);
  background: #0D0D0A;
}
.send-modal-head h3 {
  margin: 0;
  font-family: "Barlow Condensed", sans-serif;
  font-size: 1.1rem; font-weight: 700;
  text-transform: uppercase; letter-spacing: 0.06em;
  color: #C9A84C;
}
.send-modal-head .close-x {
  background: transparent; border: none; color: #8a8578;
  font-size: 1.5rem; cursor: pointer; line-height: 1;
  padding: 0 0.5rem;
}
.send-modal-body {
  display: grid;
  grid-template-columns: 1.3fr 1fr;
  gap: 0;
  flex: 1;
  min-height: 0;
}
.send-modal-pdf {
  border-right: 1px solid rgba(255,255,255,0.08);
  background: #0f0f0d;
  display: flex; flex-direction: column;
}
.send-modal-pdf-frame {
  flex: 1; width: 100%; border: 0;
  background: #2b2b28;
}
.send-modal-pdf-missing {
  flex: 1;
  display: flex; align-items: center; justify-content: center;
  color: #8a8578; font-size: 0.9rem; padding: 2rem; text-align: center;
}
.send-modal-form {
  padding: 1.25rem;
  overflow-y: auto;
  display: flex; flex-direction: column;
  gap: 0.9rem;
}
.send-modal-form label {
  font-family: "Barlow Condensed", sans-serif;
  font-size: 0.72rem; letter-spacing: 0.12em; text-transform: uppercase;
  color: #8a8578; margin-bottom: 0.25rem;
  display: block;
}
.send-modal-form input,
.send-modal-form textarea {
  width: 100%;
  background: #0D0D0A;
  border: 1px solid rgba(255,255,255,0.12);
  border-radius: 4px;
  color: #F5F3EE;
  font-size: 0.9rem;
  padding: 0.55rem 0.7rem;
  font-family: inherit;
}
.send-modal-form input:focus,
.send-modal-form textarea:focus {
  outline: none;
  border-color: rgba(201,168,76,0.5);
  box-shadow: 0 0 0 2px rgba(201,168,76,0.12);
}
.send-modal-form textarea { min-height: 90px; resize: vertical; }
.send-modal-summary {
  background: rgba(201,168,76,0.06);
  border: 1px solid rgba(201,168,76,0.25);
  border-radius: 6px;
  padding: 0.7rem 0.9rem;
  font-size: 0.78rem; line-height: 1.5;
  color: #d6d2c6;
}
.send-modal-summary strong { color: #C9A84C; }
.send-modal-actions {
  display: flex; gap: 0.6rem; justify-content: flex-end;
  padding: 0.9rem 1.25rem;
  border-top: 1px solid rgba(255,255,255,0.08);
  background: #0D0D0A;
}
.send-modal-actions .btn-ghost {
  background: transparent;
  border: 1px solid rgba(255,255,255,0.15);
  color: #d6d2c6;
}
.send-modal-actions .btn-ghost:hover { background: rgba(255,255,255,0.05); }
.send-modal-actions .btn-gold {
  background: #C9A84C;
  color: #0D0D0A;
  font-weight: 700;
  border: 1px solid #C9A84C;
}
.send-modal-actions .btn-gold:hover { background: #d6b658; }
.send-modal-actions .btn-gold:disabled { opacity: 0.5; cursor: wait; }

@media (max-width: 720px) {
  .send-modal { max-height: 100vh; height: 100vh; border-radius: 0; max-width: 100%; }
  .send-modal-body { grid-template-columns: 1fr; }
  .send-modal-pdf { max-height: 40vh; border-right: 0; border-bottom: 1px solid rgba(255,255,255,0.08); }
}
