/* ── Design tokens: Navy / Bright Blue / White / Light Gray ─────────────────
   Typography and shape system (IBM Plex, sharp corners) unchanged - only
   the color palette moved from the warm amber "Trade Blueprint" scheme to
   this navy/blue scheme. */
:root {
  --ink: #163A5F;
  --ink-soft: #1e4a73;
  --accent: #2D7FF9;
  --accent-bright: #2D7FF9;
  --accent-bg: #e9f1fe;
  --accent-border: #bdd8fd;
  --paper: #f4f6f9;
  --card: #ffffff;
  --line: #dde3ea;
  --line-soft: #eef1f5;
  --muted: #5b6b7d;
  --faint: #96a5b5;
  --success: #15803d;
  --success-bg: #f0fdf4;
  --warn: #d97706;
  --warn-bg: #fffbeb;
  --danger: #b91c1c;
  --danger-bg: #fef2f2;

  /* Legacy aliases kept so any un-migrated `var(--brand-*)` reference still
     resolves to the new palette instead of silently breaking. */
  --brand-blue: var(--accent);
  --brand-dark: var(--ink);
  --brand-light: var(--accent-bg);
  --accent-light: var(--success-bg);

  /* Re-theme Bootstrap's own component colors (Bootstrap 5.3 is fully
     CSS-variable driven, so this cascades into every .btn-primary,
     .badge.bg-primary, .alert-primary, .text-primary, link color, etc.
     without touching each template). */
  --bs-primary: var(--accent);
  --bs-primary-rgb: 45, 127, 249;
  --bs-primary-text-emphasis: #163A5F;
  --bs-primary-bg-subtle: var(--accent-bg);
  --bs-primary-border-subtle: var(--accent-border);
  --bs-link-color: var(--accent);
  --bs-link-color-rgb: 45, 127, 249;
  --bs-link-hover-color: #1a63d1;
  --bs-link-hover-color-rgb: 26, 99, 209;
  --bs-body-bg: var(--paper);
  --bs-border-color: var(--line);
  --bs-secondary-color: var(--muted);
  --bs-border-radius: 3px;
  --bs-border-radius-sm: 2px;
  --bs-border-radius-lg: 4px;
}

body {
  font-family: 'IBM Plex Sans', 'Segoe UI', system-ui, sans-serif;
  color: var(--ink);
  background: var(--paper);
}

h1, h2, h3, h4, h5, h6,
.navbar-brand, .btn, .fw-800, .fw-700 {
  font-family: 'IBM Plex Sans Condensed', 'IBM Plex Sans', system-ui, sans-serif;
}

/* Numeric/calculator output — the "spec sheet" tell */
.result-metric .value,
.stat-card .stat-value,
.pricing-price,
.price-panel .price-value,
.hero .stat-num,
#lm_pct, #lm_profit, #lm_total_cost, #lm_total_cost2,
#lm_labor, #lm_supplies, #lm_overhead {
  font-family: 'IBM Plex Mono', 'Courier New', monospace;
}

/* Navbar */
.navbar {
  border-bottom-width: 2px !important;
}

.navbar-brand {
  font-weight: 700;
  font-size: 1.4rem;
  letter-spacing: 0;
}

.navbar-brand .brand-accent {
  color: var(--accent);
}

/* Hero */
.hero {
  background:
    repeating-linear-gradient(0deg, rgba(255,255,255,0.035) 0px, rgba(255,255,255,0.035) 1px, transparent 1px, transparent 32px),
    repeating-linear-gradient(90deg, rgba(255,255,255,0.035) 0px, rgba(255,255,255,0.035) 1px, transparent 1px, transparent 32px),
    var(--ink);
  color: white;
  padding: 5rem 0 4rem;
  border-bottom: 3px solid var(--accent);
}

.hero h1 {
  font-size: 3rem;
  font-weight: 700;
  letter-spacing: -0.5px;
  line-height: 1.15;
}

.hero .lead {
  font-size: 1.2rem;
  opacity: 0.85;
}

.hero-badge {
  display: inline-block;
  background: rgba(45, 127, 249, 0.15);
  border: 1px solid rgba(45, 127, 249, 0.4);
  color: #8fc0ff;
  font-family: 'IBM Plex Mono', monospace;
  font-size: 0.72rem;
  font-weight: 600;
  letter-spacing: 0.6px;
  text-transform: uppercase;
  padding: 0.25rem 0.75rem;
  border-radius: 2px;
  margin-bottom: 1rem;
}

/* Tool Cards */
.tool-card {
  border: 1.5px solid var(--line);
  border-radius: 3px;
  padding: 1.75rem;
  background: var(--card);
  height: 100%;
  transition: border-color 0.15s, transform 0.15s;
  text-decoration: none;
  color: inherit;
  display: block;
}

.tool-card:hover {
  border-color: var(--accent);
  transform: translateY(-2px);
  color: inherit;
}

.tool-card .badge-free {
  background: var(--accent-bg);
  color: var(--accent);
  font-family: 'IBM Plex Mono', monospace;
  font-size: 0.68rem;
  font-weight: 600;
  padding: 0.2rem 0.5rem;
  border-radius: 2px;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.tool-card .badge-pro {
  background: var(--ink-soft);
  color: white;
  font-family: 'IBM Plex Mono', monospace;
  font-size: 0.68rem;
  font-weight: 600;
  padding: 0.2rem 0.5rem;
  border-radius: 2px;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

/* Calculator layout */
.calc-container {
  max-width: 820px;
  margin: 0 auto;
}

.calc-card {
  background: var(--card);
  border: 1.5px solid var(--line);
  border-radius: 3px;
  padding: 2rem;
}

.result-card {
  border-radius: 3px;
  border: 2px solid var(--ink);
  background: var(--ink);
  color: white;
}

.result-metric {
  text-align: center;
  padding: 1rem;
}

.result-metric .value {
  font-size: 2.2rem;
  font-weight: 600;
  line-height: 1;
}

.result-metric .label {
  font-size: 0.8rem;
  opacity: 0.7;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  margin-top: 0.3rem;
}

/* Margin bar */
.margin-bar-wrap {
  background: rgba(255,255,255,0.15);
  border-radius: 2px;
  height: 8px;
  overflow: hidden;
}

.margin-bar {
  height: 100%;
  border-radius: 2px;
  background: linear-gradient(90deg, #b91c1c, #d97706, #15803d);
  transition: width 0.6s ease;
}

/* Scorecard */
.score-row {
  display: flex;
  align-items: center;
  gap: 1rem;
  padding: 0.6rem 0;
  border-bottom: 1px solid var(--line-soft);
}

.score-row:last-child { border-bottom: none; }

.score-label { flex: 1; font-size: 0.9rem; }

.score-bar-wrap {
  flex: 1;
  background: var(--line-soft);
  border-radius: 2px;
  height: 6px;
  overflow: hidden;
}

.score-bar {
  height: 100%;
  border-radius: 2px;
  background: var(--accent);
}

.score-pts {
  font-family: 'IBM Plex Mono', monospace;
  font-weight: 600;
  font-size: 0.9rem;
  width: 60px;
  text-align: right;
}

/* Dashboard */
.stat-card {
  background: var(--card);
  border: 1.5px solid var(--line);
  border-radius: 3px;
  padding: 1.5rem;
  text-align: center;
}

.stat-card .stat-value {
  font-size: 2.5rem;
  font-weight: 600;
  color: var(--accent);
  line-height: 1;
}

.stat-card .stat-label {
  font-size: 0.8rem;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  color: var(--muted);
  margin-top: 0.4rem;
}

/* Bid table */
.bid-table th {
  font-family: 'IBM Plex Mono', monospace;
  font-size: 0.72rem;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  color: var(--muted);
  font-weight: 600;
  background: var(--paper);
}

.margin-pill {
  display: inline-block;
  padding: 0.2rem 0.5rem;
  border-radius: 2px;
  font-family: 'IBM Plex Mono', monospace;
  font-size: 0.78rem;
  font-weight: 600;
}

.margin-good { background: var(--success-bg); color: var(--success); }
.margin-ok   { background: var(--warn-bg); color: #854d0e; }
.margin-bad  { background: var(--danger-bg); color: var(--danger); }

/* Proposal */
.proposal-header {
  background: var(--ink);
  color: white;
  padding: 2.5rem 3rem;
  border-radius: 3px 3px 0 0;
}

.proposal-body {
  background: white;
  padding: 2.5rem 3rem;
  border-radius: 0 0 3px 3px;
  border: 1.5px solid var(--line);
  border-top: none;
}

/* Pricing */
.pricing-card {
  border: 1.5px solid var(--line);
  border-radius: 3px;
  padding: 2.5rem;
  background: var(--card);
  height: 100%;
  transition: border-color 0.15s;
}

.pricing-card.featured {
  border-color: var(--accent);
  border-width: 2px;
  position: relative;
}

.pricing-badge {
  position: absolute;
  top: -14px;
  left: 50%;
  transform: translateX(-50%);
  background: var(--accent);
  color: white;
  font-family: 'IBM Plex Mono', monospace;
  font-size: 0.72rem;
  font-weight: 600;
  padding: 0.3rem 0.9rem;
  border-radius: 2px;
  white-space: nowrap;
}

.pricing-price {
  font-family: 'IBM Plex Mono', monospace;
  font-size: 2.75rem;
  font-weight: 600;
  color: var(--ink);
  letter-spacing: -0.5px;
}

.pricing-price sup { font-size: 1.4rem; }

.feature-list li {
  padding: 0.5rem 0;
  font-size: 0.95rem;
}

.feature-list li::before {
  content: '✓';
  color: var(--accent);
  font-weight: 700;
  margin-right: 0.6rem;
}

.feature-locked::before {
  content: '—' !important;
  color: var(--faint) !important;
  font-weight: 400 !important;
}

/* Misc */
.section-label {
  font-family: 'IBM Plex Mono', monospace;
  font-size: 0.72rem;
  text-transform: uppercase;
  letter-spacing: 1px;
  color: var(--muted);
  font-weight: 600;
}

.page-header {
  background: var(--card);
  border-bottom: 2px solid var(--ink);
  padding: 1.5rem 0;
  margin-bottom: 2rem;
}

.page-header h1 {
  font-size: 1.75rem;
  font-weight: 700;
  margin: 0;
}

@media print {
  .no-print { display: none !important; }
  body { background: white; }
}
