/* ============================================================
   ConstructOS Design System
   The AI-powered operating system for contractors.
   ============================================================ */

/* ------------------------------------------------------------
   1. GOOGLE FONTS IMPORT
   ------------------------------------------------------------ */
@import url('https://fonts.googleapis.com/css2?family=Inter:wght@300;400;500;600;700;800;900&family=JetBrains+Mono:wght@400;500;600;700&display=swap');

/* ------------------------------------------------------------
   2. CSS CUSTOM PROPERTIES (DESIGN TOKENS)
   ------------------------------------------------------------ */
:root {
  /* Colour palette */
  --navy:        #0a0f1e;
  --navy-mid:    #111827;
  --navy-card:   #1a2235;
  --navy-border: #1e2d45;
  --blue:        #3b82f6;
  --blue-dark:   #1d4ed8;
  --blue-glow:   rgba(59, 130, 246, 0.15);
  --gold:        #f59e0b;
  --gold-glow:   rgba(245, 158, 11, 0.15);
  --green:       #10b981;
  --red:         #ef4444;
  --white:       #ffffff;
  --grey-100:    #f1f5f9;
  --grey-300:    #cbd5e1;
  --grey-500:    #64748b;
  --grey-700:    #334155;

  /* Typography */
  --font-ui:   'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
  --font-mono: 'JetBrains Mono', 'Fira Code', 'Cascadia Code', monospace;

  /* Spacing scale */
  --space-1:  4px;
  --space-2:  8px;
  --space-3:  12px;
  --space-4:  16px;
  --space-5:  20px;
  --space-6:  24px;
  --space-8:  32px;
  --space-10: 40px;
  --space-12: 48px;
  --space-16: 64px;
  --space-20: 80px;
  --space-24: 96px;

  /* Border radius */
  --radius-sm: 4px;
  --radius:    8px;
  --radius-md: 12px;
  --radius-lg: 16px;
  --radius-xl: 24px;
  --radius-full: 9999px;

  /* Shadows */
  --shadow-sm: 0 1px 3px rgba(0,0,0,0.4), 0 1px 2px rgba(0,0,0,0.3);
  --shadow:    0 4px 12px rgba(0,0,0,0.4), 0 2px 6px rgba(0,0,0,0.3);
  --shadow-lg: 0 12px 40px rgba(0,0,0,0.5), 0 4px 16px rgba(0,0,0,0.4);
  --shadow-blue: 0 0 0 3px var(--blue-glow);
  --shadow-gold: 0 0 0 3px var(--gold-glow);

  /* Transitions */
  --transition: 150ms ease;
  --transition-md: 250ms ease;

  /* Sidebar */
  --sidebar-width: 240px;
  --header-height: 64px;
}

/* ------------------------------------------------------------
   3. CSS RESET
   ------------------------------------------------------------ */
*, *::before, *::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

html {
  font-size: 16px;
  scroll-behavior: smooth;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  text-rendering: optimizeLegibility;
}

body {
  font-family: var(--font-ui);
  background-color: var(--navy);
  color: var(--white);
  line-height: 1.6;
  min-height: 100vh;
}

img, video, svg {
  display: block;
  max-width: 100%;
}

button, input, select, textarea {
  font-family: inherit;
  font-size: inherit;
}

a {
  color: inherit;
  text-decoration: none;
}

ul, ol {
  list-style: none;
}

h1, h2, h3, h4, h5, h6 {
  font-weight: 700;
  line-height: 1.2;
  letter-spacing: -0.02em;
}

/* ------------------------------------------------------------
   4. UTILITY CLASSES
   ------------------------------------------------------------ */
.container {
  width: 100%;
  max-width: 1200px;
  margin-inline: auto;
  padding-inline: var(--space-6);
}

.container-wide {
  width: 100%;
  max-width: 1440px;
  margin-inline: auto;
  padding-inline: var(--space-8);
}

.text-mono   { font-family: var(--font-mono); }
.text-blue   { color: var(--blue); }
.text-gold   { color: var(--gold); }
.text-green  { color: var(--green); }
.text-red    { color: var(--red); }
.text-grey   { color: var(--grey-500); }
.text-white  { color: var(--white); }
.text-sm     { font-size: 0.875rem; }
.text-xs     { font-size: 0.75rem; }
.text-lg     { font-size: 1.125rem; }
.text-xl     { font-size: 1.25rem; }
.text-2xl    { font-size: 1.5rem; }
.text-3xl    { font-size: 1.875rem; }
.font-medium { font-weight: 500; }
.font-semi   { font-weight: 600; }
.font-bold   { font-weight: 700; }

.flex        { display: flex; }
.flex-col    { flex-direction: column; }
.items-center { align-items: center; }
.justify-between { justify-content: space-between; }
.justify-center  { justify-content: center; }
.gap-2  { gap: var(--space-2); }
.gap-3  { gap: var(--space-3); }
.gap-4  { gap: var(--space-4); }
.gap-6  { gap: var(--space-6); }
.gap-8  { gap: var(--space-8); }

.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0,0,0,0);
  white-space: nowrap;
  border: 0;
}

/* ------------------------------------------------------------
   5. BUTTONS
   ------------------------------------------------------------ */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: var(--space-2);
  padding: 10px 20px;
  border-radius: var(--radius);
  font-size: 0.9375rem;
  font-weight: 600;
  line-height: 1;
  letter-spacing: -0.01em;
  border: 1.5px solid transparent;
  cursor: pointer;
  transition: all var(--transition);
  white-space: nowrap;
  text-decoration: none;
}

.btn:focus-visible {
  outline: 2px solid var(--blue);
  outline-offset: 2px;
}

.btn-primary {
  background: var(--blue);
  color: var(--white);
  border-color: var(--blue);
}
.btn-primary:hover {
  background: var(--blue-dark);
  border-color: var(--blue-dark);
  transform: translateY(-1px);
  box-shadow: 0 4px 16px rgba(59, 130, 246, 0.35);
}
.btn-primary:active { transform: translateY(0); }

.btn-gold {
  background: var(--gold);
  color: var(--navy);
  border-color: var(--gold);
  font-weight: 700;
}
.btn-gold:hover {
  background: #d97706;
  border-color: #d97706;
  transform: translateY(-1px);
  box-shadow: 0 4px 16px rgba(245, 158, 11, 0.35);
}

.btn-outline {
  background: transparent;
  color: var(--white);
  border-color: rgba(255,255,255,0.3);
}
.btn-outline:hover {
  background: rgba(255,255,255,0.08);
  border-color: rgba(255,255,255,0.6);
}

.btn-outline-blue {
  background: transparent;
  color: var(--blue);
  border-color: var(--blue);
}
.btn-outline-blue:hover {
  background: var(--blue-glow);
}

.btn-ghost {
  background: transparent;
  color: var(--grey-300);
  border-color: transparent;
}
.btn-ghost:hover {
  background: rgba(255,255,255,0.06);
  color: var(--white);
}

.btn-danger {
  background: var(--red);
  color: var(--white);
  border-color: var(--red);
}
.btn-danger:hover {
  background: #dc2626;
  border-color: #dc2626;
}

.btn-sm {
  padding: 7px 14px;
  font-size: 0.8125rem;
  border-radius: var(--radius-sm);
}

.btn-lg {
  padding: 14px 28px;
  font-size: 1.0625rem;
  border-radius: var(--radius-md);
}

.btn-icon {
  padding: 10px;
  border-radius: var(--radius);
}

/* ------------------------------------------------------------
   6. FORM INPUTS
   ------------------------------------------------------------ */
.input,
.select,
.textarea {
  width: 100%;
  padding: 10px 14px;
  background: var(--navy-mid);
  border: 1.5px solid var(--navy-border);
  border-radius: var(--radius);
  color: var(--white);
  font-size: 0.9375rem;
  line-height: 1.5;
  transition: border-color var(--transition), box-shadow var(--transition);
}

.input::placeholder,
.textarea::placeholder {
  color: var(--grey-500);
}

.input:focus,
.select:focus,
.textarea:focus {
  outline: none;
  border-color: var(--blue);
  box-shadow: var(--shadow-blue);
}

.select {
  appearance: none;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='16' height='16' viewBox='0 0 24 24' fill='none' stroke='%2364748b' stroke-width='2'%3E%3Cpath d='m6 9 6 6 6-6'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 12px center;
  padding-right: 40px;
  cursor: pointer;
}

.select option {
  background: var(--navy-card);
}

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

.input-label {
  display: block;
  font-size: 0.875rem;
  font-weight: 500;
  color: var(--grey-300);
  margin-bottom: var(--space-2);
}

.input-group {
  display: flex;
  flex-direction: column;
  gap: var(--space-2);
}

.input-error {
  border-color: var(--red);
}
.input-error:focus {
  box-shadow: 0 0 0 3px rgba(239, 68, 68, 0.15);
}

.input-hint {
  font-size: 0.8125rem;
  color: var(--grey-500);
}
.input-hint-error {
  color: var(--red);
}

/* ------------------------------------------------------------
   7. BADGES
   ------------------------------------------------------------ */
.badge {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 3px 10px;
  border-radius: var(--radius-full);
  font-size: 0.75rem;
  font-weight: 600;
  letter-spacing: 0.02em;
  line-height: 1.6;
}

.badge-blue  { background: var(--blue-glow); color: var(--blue); border: 1px solid rgba(59,130,246,0.25); }
.badge-green { background: rgba(16,185,129,0.12); color: var(--green); border: 1px solid rgba(16,185,129,0.25); }
.badge-gold  { background: var(--gold-glow); color: var(--gold); border: 1px solid rgba(245,158,11,0.25); }
.badge-red   { background: rgba(239,68,68,0.12); color: var(--red); border: 1px solid rgba(239,68,68,0.25); }
.badge-grey  { background: rgba(100,116,139,0.12); color: var(--grey-300); border: 1px solid rgba(100,116,139,0.2); }

/* ------------------------------------------------------------
   8. CARDS
   ------------------------------------------------------------ */
.card {
  background: var(--navy-card);
  border: 1px solid var(--navy-border);
  border-radius: var(--radius-md);
  padding: var(--space-6);
}

.card-sm { padding: var(--space-4); border-radius: var(--radius); }
.card-lg { padding: var(--space-8); }

.card-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: var(--space-5);
}

.card-title {
  font-size: 1rem;
  font-weight: 600;
  color: var(--white);
  letter-spacing: -0.01em;
}

.card-subtitle {
  font-size: 0.8125rem;
  color: var(--grey-500);
  margin-top: 2px;
}

/* Stat card */
.stat-card {
  background: var(--navy-card);
  border: 1px solid var(--navy-border);
  border-radius: var(--radius-md);
  padding: var(--space-5) var(--space-6);
  display: flex;
  flex-direction: column;
  gap: var(--space-1);
}

.stat-card-label {
  font-size: 0.8125rem;
  font-weight: 500;
  color: var(--grey-500);
  text-transform: uppercase;
  letter-spacing: 0.06em;
}

.stat-card-value {
  font-family: var(--font-mono);
  font-size: 2rem;
  font-weight: 700;
  color: var(--white);
  line-height: 1.1;
  letter-spacing: -0.03em;
}

.stat-card-trend {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  font-size: 0.8125rem;
  font-weight: 600;
  margin-top: var(--space-1);
}
.stat-card-trend.up   { color: var(--green); }
.stat-card-trend.down { color: var(--red); }

/* ------------------------------------------------------------
   9. TABLE
   ------------------------------------------------------------ */
.table-wrapper {
  overflow-x: auto;
  border: 1px solid var(--navy-border);
  border-radius: var(--radius-md);
}

.table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.9rem;
}

.table thead {
  background: var(--navy-mid);
  border-bottom: 1px solid var(--navy-border);
}

.table th {
  padding: 11px var(--space-4);
  text-align: left;
  font-size: 0.75rem;
  font-weight: 600;
  color: var(--grey-500);
  text-transform: uppercase;
  letter-spacing: 0.06em;
  white-space: nowrap;
}

.table td {
  padding: 13px var(--space-4);
  color: var(--grey-300);
  border-bottom: 1px solid var(--navy-border);
  vertical-align: middle;
}

.table tbody tr:last-child td {
  border-bottom: none;
}

.table tbody tr {
  background: var(--navy-card);
  transition: background var(--transition);
}
.table tbody tr:nth-child(even) {
  background: rgba(26, 34, 53, 0.5);
}
.table tbody tr:hover {
  background: rgba(59, 130, 246, 0.06);
}

.table .mono {
  font-family: var(--font-mono);
  font-size: 0.875rem;
}

/* ------------------------------------------------------------
   10. PROGRESS BAR
   ------------------------------------------------------------ */
.progress-bar {
  width: 100%;
  height: 6px;
  background: var(--navy-border);
  border-radius: var(--radius-full);
  overflow: hidden;
}

.progress-bar-fill {
  height: 100%;
  border-radius: var(--radius-full);
  background: var(--blue);
  transition: width var(--transition-md);
}
.progress-bar-fill.green { background: var(--green); }
.progress-bar-fill.gold  { background: var(--gold); }
.progress-bar-fill.red   { background: var(--red); }

.progress-bar-lg { height: 10px; }
.progress-bar-sm { height: 4px; }

/* ------------------------------------------------------------
   11. TABS
   ------------------------------------------------------------ */
.tab-list {
  display: flex;
  align-items: center;
  gap: 0;
  border-bottom: 1px solid var(--navy-border);
  margin-bottom: var(--space-6);
}

.tab {
  padding: 10px var(--space-5);
  font-size: 0.9rem;
  font-weight: 500;
  color: var(--grey-500);
  border-bottom: 2px solid transparent;
  margin-bottom: -1px;
  cursor: pointer;
  transition: color var(--transition), border-color var(--transition);
  white-space: nowrap;
}

.tab:hover { color: var(--grey-300); }

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

/* ------------------------------------------------------------
   12. MODAL
   ------------------------------------------------------------ */
.modal-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,0.7);
  backdrop-filter: blur(4px);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 1000;
  padding: var(--space-4);
  opacity: 0;
  pointer-events: none;
  transition: opacity var(--transition-md);
}

.modal-overlay.open {
  opacity: 1;
  pointer-events: all;
}

.modal {
  background: var(--navy-card);
  border: 1px solid var(--navy-border);
  border-radius: var(--radius-lg);
  padding: var(--space-8);
  width: 100%;
  max-width: 560px;
  box-shadow: var(--shadow-lg);
  transform: translateY(16px);
  transition: transform var(--transition-md);
}

.modal-overlay.open .modal {
  transform: translateY(0);
}

.modal-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  margin-bottom: var(--space-6);
}

.modal-title {
  font-size: 1.25rem;
  font-weight: 700;
  color: var(--white);
}

.modal-close {
  background: none;
  border: none;
  color: var(--grey-500);
  cursor: pointer;
  padding: 4px;
  border-radius: var(--radius-sm);
  transition: color var(--transition);
  line-height: 1;
  font-size: 1.5rem;
}
.modal-close:hover { color: var(--white); }

.modal-footer {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: var(--space-3);
  margin-top: var(--space-6);
  padding-top: var(--space-5);
  border-top: 1px solid var(--navy-border);
}

/* ============================================================
   LANDING PAGE STYLES
   ============================================================ */

/* ------------------------------------------------------------
   13. LANDING NAVIGATION
   ------------------------------------------------------------ */
.landing-nav {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  z-index: 900;
  height: 68px;
  background: rgba(10, 15, 30, 0.92);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  border-bottom: 1px solid rgba(30, 45, 69, 0.6);
}

.landing-nav-inner {
  height: 100%;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--space-8);
}

.nav-logo {
  display: flex;
  align-items: center;
  gap: 10px;
  font-size: 1.1875rem;
  font-weight: 800;
  color: var(--white);
  letter-spacing: -0.03em;
  flex-shrink: 0;
}

.nav-logo-icon {
  width: 32px;
  height: 32px;
  background: var(--blue);
  border-radius: 7px;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

.nav-links {
  display: flex;
  align-items: center;
  gap: var(--space-2);
  margin-left: auto;
}

.nav-link {
  padding: 8px 14px;
  font-size: 0.9rem;
  font-weight: 500;
  color: var(--grey-300);
  border-radius: var(--radius);
  transition: color var(--transition), background var(--transition);
}
.nav-link:hover { color: var(--white); background: rgba(255,255,255,0.06); }

.nav-cta {
  margin-left: var(--space-2);
}

.nav-hamburger {
  display: none;
  flex-direction: column;
  gap: 5px;
  background: none;
  border: none;
  cursor: pointer;
  padding: 8px;
}
.nav-hamburger span {
  display: block;
  width: 22px;
  height: 2px;
  background: var(--grey-300);
  border-radius: 2px;
  transition: all var(--transition);
}

/* ------------------------------------------------------------
   14. HERO SECTION
   ------------------------------------------------------------ */
.hero {
  position: relative;
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  background-color: var(--navy);
  overflow: hidden;
  padding-top: 68px;
}

/* Blueprint grid — CSS only */
.hero::before {
  content: '';
  position: absolute;
  inset: 0;
  background-image:
    linear-gradient(rgba(59, 130, 246, 0.06) 1px, transparent 1px),
    linear-gradient(90deg, rgba(59, 130, 246, 0.06) 1px, transparent 1px),
    linear-gradient(rgba(59, 130, 246, 0.03) 1px, transparent 1px),
    linear-gradient(90deg, rgba(59, 130, 246, 0.03) 1px, transparent 1px);
  background-size:
    80px 80px,
    80px 80px,
    16px 16px,
    16px 16px;
  pointer-events: none;
}

/* Radial fade so grid fades toward edges */
.hero::after {
  content: '';
  position: absolute;
  inset: 0;
  background: radial-gradient(ellipse 80% 60% at 50% 0%, transparent 40%, var(--navy) 100%);
  pointer-events: none;
}

.hero-content {
  position: relative;
  z-index: 1;
  text-align: center;
  max-width: 860px;
  padding: var(--space-16) var(--space-6);
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: var(--space-6);
}

.hero-badge {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 6px 16px;
  background: rgba(59, 130, 246, 0.1);
  border: 1px solid rgba(59, 130, 246, 0.3);
  border-radius: var(--radius-full);
  font-size: 0.8125rem;
  font-weight: 600;
  color: var(--blue);
  letter-spacing: 0.02em;
}

.hero-badge-dot {
  width: 7px;
  height: 7px;
  background: var(--blue);
  border-radius: 50%;
  animation: pulse-dot 2s ease-in-out infinite;
}

@keyframes pulse-dot {
  0%, 100% { opacity: 1; transform: scale(1); }
  50%       { opacity: 0.5; transform: scale(0.8); }
}

.hero h1 {
  font-size: clamp(2.5rem, 7vw, 4.5rem);
  font-weight: 900;
  color: var(--white);
  line-height: 1.08;
  letter-spacing: -0.04em;
}

.hero-sub {
  font-size: clamp(1rem, 2.2vw, 1.2rem);
  color: var(--grey-300);
  line-height: 1.7;
  max-width: 620px;
  font-weight: 400;
}

.hero-cta {
  display: flex;
  align-items: center;
  gap: var(--space-4);
  flex-wrap: wrap;
  justify-content: center;
}

.hero-cta-note {
  font-size: 0.8125rem;
  color: var(--grey-500);
  display: flex;
  align-items: center;
  gap: var(--space-3);
}
.hero-cta-note span { display: flex; align-items: center; gap: 5px; }
.hero-cta-note span::before { content: '·'; }
.hero-cta-note span:first-child::before { content: none; }

/* Hero mock dashboard */
.hero-mockup {
  position: relative;
  width: 100%;
  max-width: 760px;
  margin-top: var(--space-8);
  background: var(--navy-card);
  border: 1px solid var(--navy-border);
  border-radius: var(--radius-lg);
  padding: var(--space-5);
  box-shadow:
    0 0 0 1px rgba(255,255,255,0.04),
    0 32px 80px rgba(0,0,0,0.6),
    0 0 60px rgba(59,130,246,0.08);
}

.hero-mockup-bar {
  display: flex;
  align-items: center;
  gap: 7px;
  margin-bottom: var(--space-5);
}
.hero-mockup-dot {
  width: 11px;
  height: 11px;
  border-radius: 50%;
}
.hero-mockup-dot:nth-child(1) { background: #ef4444; }
.hero-mockup-dot:nth-child(2) { background: #f59e0b; }
.hero-mockup-dot:nth-child(3) { background: #10b981; }

.hero-mockup-title {
  font-size: 0.75rem;
  color: var(--grey-500);
  font-family: var(--font-mono);
  margin-left: auto;
  margin-right: auto;
}

.hero-stats-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: var(--space-3);
}

.hero-stat {
  background: var(--navy-mid);
  border: 1px solid var(--navy-border);
  border-radius: var(--radius);
  padding: var(--space-4) var(--space-4);
}

.hero-stat-label {
  font-size: 0.6875rem;
  color: var(--grey-500);
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  margin-bottom: 6px;
}

.hero-stat-value {
  font-family: var(--font-mono);
  font-size: 1.375rem;
  font-weight: 700;
  color: var(--white);
  letter-spacing: -0.02em;
}

.hero-stat-trend {
  font-size: 0.6875rem;
  font-weight: 600;
  margin-top: 4px;
}
.hero-stat-trend.up   { color: var(--green); }
.hero-stat-trend.down { color: var(--red); }

/* ------------------------------------------------------------
   15. TRUSTED BY SECTION
   ------------------------------------------------------------ */
.trusted-section {
  background: var(--navy-mid);
  border-top: 1px solid var(--navy-border);
  border-bottom: 1px solid var(--navy-border);
  padding: var(--space-8) 0;
}

.trusted-label {
  text-align: center;
  font-size: 0.8125rem;
  font-weight: 500;
  color: var(--grey-500);
  text-transform: uppercase;
  letter-spacing: 0.1em;
  margin-bottom: var(--space-5);
}

.trade-pills {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: center;
  gap: var(--space-2);
}

.trade-pill {
  padding: 6px 16px;
  background: var(--navy-card);
  border: 1px solid var(--navy-border);
  border-radius: var(--radius-full);
  font-size: 0.875rem;
  font-weight: 500;
  color: var(--grey-300);
  transition: all var(--transition);
}
.trade-pill:hover {
  border-color: var(--blue);
  color: var(--blue);
  background: var(--blue-glow);
}

/* ------------------------------------------------------------
   16. FEATURES SECTION
   ------------------------------------------------------------ */
.features-section {
  background: var(--navy);
  padding: var(--space-24) 0;
}

.section-label {
  display: inline-block;
  font-size: 0.75rem;
  font-weight: 700;
  color: var(--blue);
  text-transform: uppercase;
  letter-spacing: 0.12em;
  margin-bottom: var(--space-4);
}

.section-title {
  font-size: clamp(1.75rem, 4vw, 2.75rem);
  font-weight: 800;
  color: var(--white);
  letter-spacing: -0.03em;
  margin-bottom: var(--space-5);
}

.section-desc {
  font-size: 1.0625rem;
  color: var(--grey-300);
  line-height: 1.7;
  max-width: 560px;
}

.features-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: var(--space-5);
  margin-top: var(--space-12);
}

.feature-card {
  background: var(--navy-card);
  border: 1px solid var(--navy-border);
  border-left: 3px solid var(--blue);
  border-radius: var(--radius-md);
  padding: var(--space-6);
  transition: border-color var(--transition), box-shadow var(--transition), transform var(--transition);
}

.feature-card:hover {
  border-color: var(--blue);
  border-left-color: var(--blue);
  box-shadow: 0 8px 32px rgba(59, 130, 246, 0.1);
  transform: translateY(-2px);
}

.feature-icon {
  width: 44px;
  height: 44px;
  background: var(--blue-glow);
  border: 1px solid rgba(59, 130, 246, 0.2);
  border-radius: var(--radius);
  display: flex;
  align-items: center;
  justify-content: center;
  margin-bottom: var(--space-4);
  color: var(--blue);
  font-size: 1.25rem;
}

.feature-title {
  font-size: 1.0625rem;
  font-weight: 700;
  color: var(--white);
  margin-bottom: var(--space-2);
  letter-spacing: -0.02em;
}

.feature-desc {
  font-size: 0.9rem;
  color: var(--grey-500);
  line-height: 1.65;
}

/* ------------------------------------------------------------
   17. MARGINIQ SECTION
   ------------------------------------------------------------ */
.marginiq-section {
  background: var(--navy-mid);
  border-top: 1px solid var(--navy-border);
  border-bottom: 1px solid var(--navy-border);
  padding: var(--space-24) 0;
  position: relative;
  overflow: hidden;
}

.marginiq-section::before {
  content: '';
  position: absolute;
  top: -200px;
  right: -200px;
  width: 600px;
  height: 600px;
  background: radial-gradient(circle, rgba(245, 158, 11, 0.06) 0%, transparent 70%);
  pointer-events: none;
}

.marginiq-layout {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: var(--space-16);
  align-items: center;
}

.marginiq-label {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 5px 14px;
  background: var(--gold-glow);
  border: 1px solid rgba(245, 158, 11, 0.3);
  border-radius: var(--radius-full);
  font-size: 0.75rem;
  font-weight: 700;
  color: var(--gold);
  text-transform: uppercase;
  letter-spacing: 0.08em;
  margin-bottom: var(--space-5);
}

.marginiq-title {
  font-size: clamp(1.75rem, 3.5vw, 2.5rem);
  font-weight: 800;
  color: var(--white);
  letter-spacing: -0.03em;
  line-height: 1.15;
  margin-bottom: var(--space-5);
}

.marginiq-desc {
  font-size: 1rem;
  color: var(--grey-300);
  line-height: 1.7;
  margin-bottom: var(--space-8);
}

.marginiq-bullets {
  display: flex;
  flex-direction: column;
  gap: var(--space-3);
}

.marginiq-bullet {
  display: flex;
  align-items: center;
  gap: var(--space-3);
  font-size: 0.9375rem;
  color: var(--grey-300);
  font-weight: 500;
}

.marginiq-bullet::before {
  content: '';
  width: 20px;
  height: 20px;
  background: var(--gold-glow);
  border: 1px solid rgba(245, 158, 11, 0.3);
  border-radius: 50%;
  flex-shrink: 0;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 24 24' fill='none' stroke='%23f59e0b' stroke-width='3'%3E%3Cpath d='M5 12l5 5 9-9'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: center;
}

/* MarginIQ mock dashboard card */
.marginiq-mock {
  background: var(--navy-card);
  border: 1px solid rgba(245, 158, 11, 0.2);
  border-radius: var(--radius-lg);
  padding: var(--space-6);
  box-shadow:
    0 0 0 1px rgba(245,158,11,0.06),
    0 24px 60px rgba(0,0,0,0.5),
    0 0 40px rgba(245,158,11,0.06);
  position: relative;
}

.marginiq-mock-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: var(--space-6);
}

.marginiq-mock-title {
  font-size: 0.875rem;
  font-weight: 700;
  color: var(--white);
}

.marginiq-badge {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 3px 10px;
  background: var(--gold-glow);
  border: 1px solid rgba(245, 158, 11, 0.3);
  border-radius: var(--radius-full);
  font-size: 0.6875rem;
  font-weight: 700;
  color: var(--gold);
  letter-spacing: 0.04em;
  text-transform: uppercase;
}

/* Margin gauge — linear */
.margin-gauge {
  margin-bottom: var(--space-5);
}

.margin-gauge-header {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  margin-bottom: var(--space-2);
}

.margin-gauge-label {
  font-size: 0.75rem;
  color: var(--grey-500);
  font-weight: 500;
}

.margin-gauge-value {
  font-family: var(--font-mono);
  font-size: 1.5rem;
  font-weight: 700;
  color: var(--green);
  letter-spacing: -0.02em;
}

.margin-gauge-bar {
  height: 8px;
  background: var(--navy-border);
  border-radius: var(--radius-full);
  overflow: hidden;
}

.margin-gauge-fill {
  height: 100%;
  border-radius: var(--radius-full);
  background: linear-gradient(90deg, var(--green), #34d399);
  transition: width 1s ease;
}

/* AI insight card */
.ai-insight-card {
  background: var(--navy-mid);
  border: 1px solid var(--navy-border);
  border-left: 3px solid var(--gold);
  border-radius: var(--radius);
  padding: var(--space-4);
  margin-bottom: var(--space-3);
}

.ai-insight-card:last-child { margin-bottom: 0; }

.ai-insight-label {
  font-size: 0.6875rem;
  font-weight: 700;
  color: var(--gold);
  text-transform: uppercase;
  letter-spacing: 0.1em;
  margin-bottom: 5px;
}

.ai-insight-text {
  font-size: 0.8125rem;
  color: var(--grey-300);
  line-height: 1.55;
}

/* MarginIQ hero section (within the mock) */
.marginiq-hero {
  background: linear-gradient(135deg, rgba(245,158,11,0.12) 0%, rgba(245,158,11,0.04) 100%);
  border: 1px solid rgba(245, 158, 11, 0.2);
  border-radius: var(--radius-md);
  padding: var(--space-6);
}

/* ------------------------------------------------------------
   18. HOW IT WORKS
   ------------------------------------------------------------ */
.how-section {
  background: var(--navy);
  padding: var(--space-24) 0;
}

.steps-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: var(--space-8);
  margin-top: var(--space-12);
  position: relative;
}

.steps-grid::before {
  content: '';
  position: absolute;
  top: 28px;
  left: calc(16.66% + 28px);
  right: calc(16.66% + 28px);
  height: 1px;
  background: linear-gradient(90deg, var(--blue), rgba(59,130,246,0.2));
  z-index: 0;
}

.step {
  text-align: center;
  position: relative;
  z-index: 1;
}

.step-number {
  width: 56px;
  height: 56px;
  background: var(--navy-card);
  border: 2px solid var(--blue);
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-family: var(--font-mono);
  font-size: 1.1rem;
  font-weight: 700;
  color: var(--blue);
  margin: 0 auto var(--space-5);
  box-shadow: 0 0 20px rgba(59,130,246,0.2);
}

.step-title {
  font-size: 1.0625rem;
  font-weight: 700;
  color: var(--white);
  margin-bottom: var(--space-2);
  letter-spacing: -0.02em;
}

.step-desc {
  font-size: 0.9rem;
  color: var(--grey-500);
  line-height: 1.65;
}

/* ------------------------------------------------------------
   19. PRICING SECTION
   ------------------------------------------------------------ */
.pricing-section {
  background: var(--navy-mid);
  border-top: 1px solid var(--navy-border);
  padding: var(--space-24) 0;
}

.pricing-toggle {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: var(--space-3);
  margin-top: var(--space-8);
  font-size: 0.9rem;
  color: var(--grey-300);
}

.pricing-toggle-track {
  width: 44px;
  height: 24px;
  background: var(--navy-border);
  border-radius: var(--radius-full);
  cursor: pointer;
  position: relative;
  transition: background var(--transition);
}

.pricing-toggle-track.active { background: var(--blue); }

.pricing-toggle-thumb {
  position: absolute;
  top: 3px;
  left: 3px;
  width: 18px;
  height: 18px;
  background: var(--white);
  border-radius: 50%;
  transition: transform var(--transition);
}

.pricing-toggle-track.active .pricing-toggle-thumb {
  transform: translateX(20px);
}

.pricing-save-badge {
  display: inline-flex;
  padding: 2px 8px;
  background: rgba(16,185,129,0.12);
  border: 1px solid rgba(16,185,129,0.25);
  border-radius: var(--radius-full);
  font-size: 0.75rem;
  font-weight: 600;
  color: var(--green);
}

.pricing-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: var(--space-5);
  margin-top: var(--space-10);
  align-items: start;
}

.pricing-card {
  background: var(--navy-card);
  border: 1px solid var(--navy-border);
  border-radius: var(--radius-lg);
  padding: var(--space-8);
  transition: border-color var(--transition), box-shadow var(--transition), transform var(--transition);
  position: relative;
}

.pricing-card:hover {
  border-color: rgba(59, 130, 246, 0.4);
  box-shadow: 0 8px 32px rgba(59, 130, 246, 0.08);
  transform: translateY(-2px);
}

.pricing-card.featured {
  border-color: var(--blue);
  box-shadow: 0 0 0 1px var(--blue), 0 16px 48px rgba(59, 130, 246, 0.15);
  transform: translateY(-4px);
}

.pricing-card.featured:hover {
  transform: translateY(-6px);
  box-shadow: 0 0 0 1px var(--blue), 0 24px 60px rgba(59, 130, 246, 0.2);
}

.pricing-featured-badge {
  position: absolute;
  top: -13px;
  left: 50%;
  transform: translateX(-50%);
  padding: 4px 16px;
  background: var(--blue);
  border-radius: var(--radius-full);
  font-size: 0.75rem;
  font-weight: 700;
  color: var(--white);
  white-space: nowrap;
  letter-spacing: 0.04em;
  text-transform: uppercase;
}

.pricing-tier {
  font-size: 0.75rem;
  font-weight: 700;
  color: var(--grey-500);
  text-transform: uppercase;
  letter-spacing: 0.1em;
  margin-bottom: var(--space-2);
}

.pricing-price {
  margin-bottom: var(--space-2);
}

.pricing-amount {
  font-family: var(--font-mono);
  font-size: 2.75rem;
  font-weight: 700;
  color: var(--white);
  letter-spacing: -0.04em;
  line-height: 1;
}

.pricing-amount sup {
  font-size: 1.25rem;
  font-weight: 600;
  vertical-align: super;
  letter-spacing: 0;
}

.pricing-period {
  font-size: 0.875rem;
  color: var(--grey-500);
  margin-top: 4px;
}

.pricing-custom {
  font-size: 2rem;
  font-weight: 800;
  color: var(--white);
  line-height: 1;
}

.pricing-desc {
  font-size: 0.875rem;
  color: var(--grey-500);
  line-height: 1.6;
  margin-bottom: var(--space-6);
  padding-bottom: var(--space-6);
  border-bottom: 1px solid var(--navy-border);
}

.pricing-features {
  display: flex;
  flex-direction: column;
  gap: var(--space-3);
  margin-bottom: var(--space-8);
}

.pricing-feature {
  display: flex;
  align-items: flex-start;
  gap: var(--space-3);
  font-size: 0.9rem;
  color: var(--grey-300);
}

.pricing-feature-check {
  width: 18px;
  height: 18px;
  background: rgba(16,185,129,0.12);
  border: 1px solid rgba(16,185,129,0.25);
  border-radius: 50%;
  flex-shrink: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  margin-top: 1px;
  color: var(--green);
  font-size: 0.6rem;
}

/* ------------------------------------------------------------
   20. FAQ SECTION
   ------------------------------------------------------------ */
.faq-section {
  background: var(--navy);
  padding: var(--space-24) 0;
}

.faq-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: var(--space-5);
  margin-top: var(--space-12);
}

.faq-item {
  background: var(--navy-card);
  border: 1px solid var(--navy-border);
  border-radius: var(--radius-md);
  padding: var(--space-6);
  transition: border-color var(--transition);
}

.faq-item:hover { border-color: rgba(59, 130, 246, 0.3); }

.faq-question {
  font-size: 0.9875rem;
  font-weight: 600;
  color: var(--white);
  margin-bottom: var(--space-3);
  letter-spacing: -0.01em;
}

.faq-answer {
  font-size: 0.9rem;
  color: var(--grey-500);
  line-height: 1.7;
}

/* ------------------------------------------------------------
   21. CTA BAND
   ------------------------------------------------------------ */
.cta-band {
  background: linear-gradient(135deg, var(--navy-mid) 0%, rgba(17,24,39,0.95) 100%);
  border-top: 1px solid var(--navy-border);
  border-bottom: 1px solid var(--navy-border);
  padding: var(--space-20) 0;
  text-align: center;
  position: relative;
  overflow: hidden;
}

.cta-band::before {
  content: '';
  position: absolute;
  inset: 0;
  background: radial-gradient(ellipse 60% 80% at 50% 50%, rgba(59,130,246,0.06) 0%, transparent 70%);
  pointer-events: none;
}

.cta-band-title {
  font-size: clamp(1.75rem, 4vw, 2.75rem);
  font-weight: 800;
  color: var(--white);
  letter-spacing: -0.03em;
  margin-bottom: var(--space-3);
}

.cta-band-sub {
  font-size: 1.0625rem;
  color: var(--grey-300);
  margin-bottom: var(--space-8);
}

/* ------------------------------------------------------------
   22. TESTIMONIALS
   ------------------------------------------------------------ */
.testimonial-section {
  background: var(--navy-mid);
  border-top: 1px solid var(--navy-border);
  padding: var(--space-24) 0;
}

.testimonial-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: var(--space-5);
  margin-top: var(--space-12);
}

.testimonial-card {
  background: var(--navy-card);
  border: 1px solid var(--navy-border);
  border-radius: var(--radius-md);
  padding: var(--space-6);
}

.testimonial-quote {
  font-size: 0.9375rem;
  color: var(--grey-300);
  line-height: 1.7;
  margin-bottom: var(--space-5);
  font-style: italic;
}

.testimonial-quote::before { content: '"'; }
.testimonial-quote::after  { content: '"'; }

.testimonial-author {
  display: flex;
  align-items: center;
  gap: var(--space-3);
}

.testimonial-avatar {
  width: 40px;
  height: 40px;
  background: var(--navy-border);
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 700;
  color: var(--blue);
  font-size: 0.875rem;
  flex-shrink: 0;
}

.testimonial-name {
  font-size: 0.9rem;
  font-weight: 600;
  color: var(--white);
}

.testimonial-role {
  font-size: 0.8125rem;
  color: var(--grey-500);
}

/* ------------------------------------------------------------
   23. FOOTER
   ------------------------------------------------------------ */
.footer-dark {
  background: var(--navy);
  border-top: 1px solid var(--navy-border);
  padding: var(--space-16) 0 var(--space-8);
}

.footer-grid {
  display: grid;
  grid-template-columns: 2fr 1fr 1fr 1fr;
  gap: var(--space-10);
  padding-bottom: var(--space-10);
  border-bottom: 1px solid var(--navy-border);
  margin-bottom: var(--space-8);
}

.footer-brand-tagline {
  font-size: 0.9rem;
  color: var(--grey-500);
  line-height: 1.65;
  margin-top: var(--space-3);
  max-width: 280px;
}

.footer-col-title {
  font-size: 0.75rem;
  font-weight: 700;
  color: var(--grey-500);
  text-transform: uppercase;
  letter-spacing: 0.1em;
  margin-bottom: var(--space-4);
}

.footer-links {
  display: flex;
  flex-direction: column;
  gap: var(--space-3);
}

.footer-link {
  font-size: 0.9rem;
  color: var(--grey-500);
  transition: color var(--transition);
}
.footer-link:hover { color: var(--white); }

.footer-bottom {
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.footer-copyright {
  font-size: 0.8125rem;
  color: var(--grey-700);
}

.footer-legal-links {
  display: flex;
  align-items: center;
  gap: var(--space-5);
}

.footer-legal-link {
  font-size: 0.8125rem;
  color: var(--grey-700);
  transition: color var(--transition);
}
.footer-legal-link:hover { color: var(--grey-500); }

/* ============================================================
   APP SHELL STYLES
   ============================================================ */

/* ------------------------------------------------------------
   24. APP LAYOUT
   ------------------------------------------------------------ */
.app-layout {
  display: grid;
  grid-template-columns: var(--sidebar-width) 1fr;
  grid-template-rows: 1fr;
  min-height: 100vh;
}

.app-body {
  display: flex;
  flex-direction: column;
  min-height: 100vh;
  overflow: hidden;
}

/* ------------------------------------------------------------
   25. SIDEBAR
   ------------------------------------------------------------ */
.sidebar {
  position: fixed;
  top: 0;
  left: 0;
  width: var(--sidebar-width);
  height: 100vh;
  background: var(--navy-mid);
  border-right: 1px solid var(--navy-border);
  display: flex;
  flex-direction: column;
  z-index: 100;
  overflow: hidden;
}

.sidebar-logo {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 0 var(--space-5);
  height: var(--header-height);
  border-bottom: 1px solid var(--navy-border);
  flex-shrink: 0;
}

.sidebar-logo-icon {
  width: 30px;
  height: 30px;
  background: var(--blue);
  border-radius: 7px;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

.sidebar-logo-text {
  font-size: 1.0625rem;
  font-weight: 800;
  color: var(--white);
  letter-spacing: -0.03em;
}

.sidebar-section {
  padding: var(--space-3) var(--space-3);
  flex: 1;
  overflow-y: auto;
}

.sidebar-section-label {
  font-size: 0.6875rem;
  font-weight: 700;
  color: var(--grey-700);
  text-transform: uppercase;
  letter-spacing: 0.1em;
  padding: var(--space-3) var(--space-2) var(--space-2);
}

.sidebar-nav {
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.sidebar-nav-item {
  display: flex;
  align-items: center;
  gap: var(--space-3);
  padding: 9px var(--space-3);
  border-radius: var(--radius);
  font-size: 0.9rem;
  font-weight: 500;
  color: var(--grey-500);
  cursor: pointer;
  transition: all var(--transition);
  border-left: 2px solid transparent;
  text-decoration: none;
}

.sidebar-nav-item:hover {
  background: rgba(255,255,255,0.05);
  color: var(--grey-300);
}

.sidebar-nav-item.active {
  background: var(--blue-glow);
  color: var(--blue);
  border-left-color: var(--blue);
  font-weight: 600;
}

.sidebar-nav-item-icon {
  width: 18px;
  height: 18px;
  flex-shrink: 0;
  opacity: 0.7;
}

.sidebar-nav-item.active .sidebar-nav-item-icon { opacity: 1; }

.sidebar-nav-item-badge {
  margin-left: auto;
  min-width: 20px;
  height: 20px;
  background: var(--blue);
  border-radius: var(--radius-full);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 0.6875rem;
  font-weight: 700;
  color: var(--white);
  padding: 0 6px;
}

.sidebar-footer {
  padding: var(--space-3);
  border-top: 1px solid var(--navy-border);
  flex-shrink: 0;
}

.sidebar-user {
  display: flex;
  align-items: center;
  gap: var(--space-3);
  padding: var(--space-2) var(--space-3);
  border-radius: var(--radius);
  cursor: pointer;
  transition: background var(--transition);
}
.sidebar-user:hover { background: rgba(255,255,255,0.05); }

.sidebar-user-avatar {
  width: 32px;
  height: 32px;
  background: var(--blue-dark);
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 0.8125rem;
  font-weight: 700;
  color: var(--white);
  flex-shrink: 0;
}

.sidebar-user-name {
  font-size: 0.875rem;
  font-weight: 600;
  color: var(--white);
  line-height: 1.2;
}

.sidebar-user-role {
  font-size: 0.75rem;
  color: var(--grey-500);
}

/* ------------------------------------------------------------
   26. APP HEADER
   ------------------------------------------------------------ */
.app-header {
  height: var(--header-height);
  background: var(--navy-mid);
  border-bottom: 1px solid var(--navy-border);
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 var(--space-6);
  flex-shrink: 0;
  position: sticky;
  top: 0;
  z-index: 50;
}

.app-header-title {
  font-size: 1.125rem;
  font-weight: 700;
  color: var(--white);
  letter-spacing: -0.02em;
}

.app-header-subtitle {
  font-size: 0.8125rem;
  color: var(--grey-500);
  margin-top: 1px;
}

.app-header-right {
  display: flex;
  align-items: center;
  gap: var(--space-3);
}

.app-search {
  display: flex;
  align-items: center;
  gap: var(--space-2);
  padding: 7px 14px;
  background: var(--navy);
  border: 1px solid var(--navy-border);
  border-radius: var(--radius);
  cursor: text;
  transition: border-color var(--transition);
}
.app-search:hover, .app-search:focus-within {
  border-color: var(--blue);
}
.app-search input {
  background: none;
  border: none;
  color: var(--white);
  font-size: 0.875rem;
  width: 180px;
}
.app-search input::placeholder { color: var(--grey-500); }
.app-search input:focus { outline: none; }

.app-header-icon-btn {
  width: 36px;
  height: 36px;
  background: var(--navy);
  border: 1px solid var(--navy-border);
  border-radius: var(--radius);
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  color: var(--grey-500);
  transition: all var(--transition);
  position: relative;
}
.app-header-icon-btn:hover {
  background: var(--navy-card);
  color: var(--white);
  border-color: var(--grey-700);
}

.notification-dot {
  position: absolute;
  top: 7px;
  right: 7px;
  width: 7px;
  height: 7px;
  background: var(--blue);
  border-radius: 50%;
  border: 1.5px solid var(--navy-mid);
}

.app-header-avatar {
  width: 34px;
  height: 34px;
  background: var(--blue-dark);
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 0.8125rem;
  font-weight: 700;
  color: var(--white);
  cursor: pointer;
  border: 2px solid var(--navy-border);
  transition: border-color var(--transition);
}
.app-header-avatar:hover { border-color: var(--blue); }

/* ------------------------------------------------------------
   27. APP MAIN CONTENT
   ------------------------------------------------------------ */
.app-main {
  flex: 1;
  overflow-y: auto;
  padding: var(--space-6);
  background: var(--navy);
}

/* ------------------------------------------------------------
   28. ESTIMATE BUILDER
   ------------------------------------------------------------ */
.estimate-layout {
  display: grid;
  grid-template-columns: 60% 40%;
  gap: var(--space-6);
  align-items: start;
}

.estimate-form-panel {
  display: flex;
  flex-direction: column;
  gap: var(--space-5);
}

.estimate-preview {
  background: var(--white);
  border-radius: var(--radius-md);
  overflow: hidden;
  box-shadow: var(--shadow-lg);
  color: #1a1a2e;
  position: sticky;
  top: calc(var(--header-height) + var(--space-6));
}

.estimate-preview-header {
  background: #f8fafc;
  border-bottom: 2px solid #e2e8f0;
  padding: var(--space-6) var(--space-8);
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
}

.estimate-preview-company {
  font-size: 1.25rem;
  font-weight: 800;
  color: #0a0f1e;
  letter-spacing: -0.02em;
  margin-bottom: 4px;
}

.estimate-preview-company-sub {
  font-size: 0.8125rem;
  color: #64748b;
  line-height: 1.5;
}

.estimate-preview-meta {
  text-align: right;
}

.estimate-preview-number {
  font-size: 1.0625rem;
  font-weight: 700;
  color: #0a0f1e;
  margin-bottom: 4px;
}

.estimate-preview-date {
  font-size: 0.8125rem;
  color: #64748b;
}

.estimate-preview-body {
  padding: var(--space-8);
}

.estimate-preview-client {
  margin-bottom: var(--space-6);
  padding-bottom: var(--space-6);
  border-bottom: 1px solid #e2e8f0;
}

.estimate-preview-client-label {
  font-size: 0.6875rem;
  font-weight: 700;
  color: #94a3b8;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  margin-bottom: var(--space-2);
}

.estimate-preview-client-name {
  font-size: 1rem;
  font-weight: 700;
  color: #0a0f1e;
  margin-bottom: 2px;
}

.estimate-preview-client-addr {
  font-size: 0.875rem;
  color: #64748b;
  line-height: 1.5;
}

/* Line items table */
.line-items-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.875rem;
  margin-bottom: var(--space-6);
}

.line-items-table thead tr {
  background: #f8fafc;
  border-bottom: 2px solid #e2e8f0;
}

.line-items-table th {
  padding: 10px 12px;
  text-align: left;
  font-size: 0.6875rem;
  font-weight: 700;
  color: #94a3b8;
  text-transform: uppercase;
  letter-spacing: 0.08em;
}

.line-items-table th:last-child,
.line-items-table td:last-child {
  text-align: right;
}

.line-items-table td {
  padding: 11px 12px;
  color: #334155;
  border-bottom: 1px solid #f1f5f9;
  vertical-align: top;
}

.line-items-table .item-desc {
  color: #0f172a;
  font-weight: 500;
}

.line-items-table .item-detail {
  font-size: 0.8125rem;
  color: #94a3b8;
  margin-top: 2px;
}

.line-items-table .mono {
  font-family: var(--font-mono);
  font-size: 0.8125rem;
}

/* Estimate totals */
.estimate-totals {
  margin-left: auto;
  width: 260px;
}

.estimate-total-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 8px 0;
  border-bottom: 1px solid #f1f5f9;
}

.estimate-total-row:last-child { border-bottom: none; }

.estimate-total-label {
  font-size: 0.875rem;
  color: #64748b;
}

.estimate-total-value {
  font-family: var(--font-mono);
  font-size: 0.9rem;
  color: #1e293b;
  font-weight: 600;
}

.estimate-total-row.grand-total .estimate-total-label {
  font-size: 1rem;
  font-weight: 800;
  color: #0a0f1e;
}

.estimate-total-row.grand-total .estimate-total-value {
  font-size: 1.1875rem;
  font-weight: 800;
  color: #0a0f1e;
}

.estimate-preview-footer {
  padding: var(--space-6) var(--space-8);
  background: #f8fafc;
  border-top: 1px solid #e2e8f0;
  font-size: 0.8125rem;
  color: #94a3b8;
  line-height: 1.6;
}

/* ============================================================
   MOBILE RESPONSIVE
   ============================================================ */

@media (max-width: 1024px) {
  .features-grid,
  .pricing-grid {
    grid-template-columns: repeat(2, 1fr);
  }

  .marginiq-layout {
    grid-template-columns: 1fr;
    gap: var(--space-10);
  }

  .footer-grid {
    grid-template-columns: 1fr 1fr;
    gap: var(--space-8);
  }

  .estimate-layout {
    grid-template-columns: 1fr;
  }

  .estimate-preview {
    position: static;
  }

  .hero-stats-grid {
    grid-template-columns: repeat(2, 1fr);
  }
}

@media (max-width: 768px) {
  /* Nav */
  .nav-links { display: none; }
  .nav-hamburger { display: flex; }

  .nav-links.mobile-open {
    display: flex;
    flex-direction: column;
    position: fixed;
    top: 68px;
    left: 0;
    right: 0;
    background: var(--navy-mid);
    border-bottom: 1px solid var(--navy-border);
    padding: var(--space-4);
    gap: var(--space-1);
    z-index: 899;
  }

  .nav-cta { display: none; }
  .nav-links.mobile-open .nav-cta { display: flex; }

  /* Hero */
  .hero h1 { font-size: 2.25rem; }
  .hero-cta { flex-direction: column; width: 100%; }
  .hero-cta .btn { width: 100%; justify-content: center; }
  .hero-stats-grid { grid-template-columns: repeat(2, 1fr); }
  .hero-content { padding: var(--space-10) var(--space-4); }

  /* Sections */
  .features-grid,
  .testimonial-grid,
  .steps-grid {
    grid-template-columns: 1fr;
  }

  .steps-grid::before { display: none; }

  .faq-grid { grid-template-columns: 1fr; }

  .pricing-grid { grid-template-columns: 1fr; }
  .pricing-card.featured { transform: none; }
  .pricing-card.featured:hover { transform: translateY(-2px); }

  .footer-grid { grid-template-columns: 1fr; }

  .footer-bottom {
    flex-direction: column;
    gap: var(--space-4);
    text-align: center;
  }

  .section-title { font-size: 1.625rem; }

  /* App shell */
  .app-layout {
    grid-template-columns: 1fr;
  }

  .sidebar {
    transform: translateX(-100%);
    transition: transform var(--transition-md);
    z-index: 200;
  }

  .sidebar.mobile-open {
    transform: translateX(0);
  }

  .sidebar-overlay {
    display: none;
    position: fixed;
    inset: 0;
    background: rgba(0,0,0,0.6);
    z-index: 199;
  }

  .sidebar-overlay.open { display: block; }

  .app-main { padding: var(--space-4); }

  .app-search { display: none; }

  .estimate-layout { grid-template-columns: 1fr; }
}

@media (max-width: 480px) {
  .hero-stats-grid { grid-template-columns: 1fr; }
  .container { padding-inline: var(--space-4); }
  .marginiq-title { font-size: 1.5rem; }
}

/* ============================================================
   DASHBOARD & ESTIMATE PAGES — App-shell page styles
   ============================================================ */

/* --- App body layout override for sidebar + main --- */
body.app-body {
  display: flex;
  flex-direction: row;
  overflow: hidden;
  height: 100vh;
}

.app-main {
  margin-left: var(--sidebar-width);
  flex: 1;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  overflow-y: auto;
  padding: 0;
  background: var(--navy);
}

/* --- App Header adjustments for app pages --- */
.app-header {
  padding: 0 var(--space-6);
  flex-shrink: 0;
}

.app-header-left {
  display: flex;
  flex-direction: column;
  gap: 1px;
}

.page-title {
  font-size: 1.125rem;
  font-weight: 700;
  color: var(--white);
  letter-spacing: -0.02em;
}

.page-subtitle {
  font-size: 0.8125rem;
  color: var(--grey-500);
}

/* Search in header */
.search-wrap {
  position: relative;
}

.search-icon {
  position: absolute;
  left: 10px;
  top: 50%;
  transform: translateY(-50%);
  color: var(--grey-500);
  pointer-events: none;
}

.search-input {
  background: var(--navy);
  border: 1px solid var(--navy-border);
  border-radius: var(--radius);
  color: var(--white);
  font-size: 0.875rem;
  padding: 7px 12px 7px 32px;
  width: 220px;
  outline: none;
  transition: border-color 150ms ease;
}

.search-input::placeholder { color: var(--grey-500); }
.search-input:focus { border-color: var(--blue); }

.icon-btn {
  position: relative;
  background: var(--navy);
  border: 1px solid var(--navy-border);
  border-radius: var(--radius);
  color: var(--grey-500);
  width: 36px;
  height: 36px;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: color 150ms, border-color 150ms;
  cursor: pointer;
}

.icon-btn:hover { color: var(--white); border-color: var(--grey-700); }

.notif-dot {
  position: absolute;
  top: 7px;
  right: 7px;
  width: 7px;
  height: 7px;
  background: var(--blue);
  border-radius: 50%;
  border: 1.5px solid var(--navy-mid);
}

.header-avatar {
  width: 34px;
  height: 34px;
  border-radius: 50%;
  background: var(--blue-dark);
  color: var(--white);
  font-size: 0.75rem;
  font-weight: 700;
  display: flex;
  align-items: center;
  justify-content: center;
  letter-spacing: 0.04em;
  cursor: pointer;
  border: 2px solid var(--navy-border);
}

/* --- Page content area --- */
.page-content {
  padding: var(--space-6);
  display: flex;
  flex-direction: column;
  gap: var(--space-6);
  flex: 1;
}

/* --- Sidebar nav icon size --- */
.nav-icon {
  width: 16px;
  height: 16px;
  flex-shrink: 0;
}

/* Sidebar MarginIQ item */
.sidebar-nav-item.marginiq-item {
  color: var(--gold);
  opacity: 0.85;
}

.sidebar-nav-item.marginiq-item:hover,
.sidebar-nav-item.marginiq-item.active {
  color: var(--gold);
  opacity: 1;
  background: rgba(245, 158, 11, 0.09);
  border-left-color: var(--gold);
}

/* User info in sidebar footer */
.user-avatar {
  width: 34px;
  height: 34px;
  border-radius: 50%;
  background: var(--blue-dark);
  color: var(--white);
  font-size: 0.75rem;
  font-weight: 700;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

.user-info {
  display: flex;
  flex-direction: column;
}

.user-name {
  font-size: 0.875rem;
  font-weight: 600;
  color: var(--white);
}

.user-role {
  font-size: 0.75rem;
  color: var(--grey-500);
}

/* --- Stats grid (dashboard) --- */
.stats-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: var(--space-4);
}

/* Override stat-card to use dashboard-specific classes */
.stat-card .stat-label {
  font-size: 0.75rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.07em;
  color: var(--grey-500);
}

.stat-card .stat-value {
  font-family: var(--font-mono);
  font-size: 1.75rem;
  font-weight: 700;
  color: var(--white);
  line-height: 1;
  letter-spacing: -0.02em;
}

.stat-card .stat-value.gold { color: var(--gold); }
.stat-card .stat-value.blue { color: var(--blue); }

.stat-card .stat-trend {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  font-size: 0.75rem;
  font-weight: 600;
}

.stat-card .trend-up     { color: var(--green); }
.stat-card .trend-neutral { color: var(--grey-500); }
.stat-card .trend-down   { color: var(--red); }

/* --- Two column layout for projects + marginiq --- */
.two-col-section {
  display: grid;
  grid-template-columns: 60fr 40fr;
  gap: var(--space-5);
  align-items: start;
}

/* --- Card overrides: no padding on card, header/footer borders --- */
.card {
  padding: 0;
}

.card-header {
  margin-bottom: 0;
  padding: var(--space-4) var(--space-5);
  border-bottom: 1px solid var(--navy-border);
}

.card-footer {
  padding: var(--space-3) var(--space-5);
  border-top: 1px solid var(--navy-border);
}

.card-gold-border {
  border-color: rgba(245, 158, 11, 0.35);
}

.card-blue-border {
  border-color: rgba(59, 130, 246, 0.35);
}

.card-badge {
  font-size: 0.6875rem;
  font-weight: 600;
  color: var(--grey-500);
  background: rgba(100,116,139,0.12);
  border: 1px solid var(--navy-border);
  padding: 2px 8px;
  border-radius: 20px;
}

/* --- Data table inside cards --- */
.table-wrap { overflow-x: auto; }

.data-table {
  width: 100%;
  border-collapse: collapse;
}

.data-table thead { background: rgba(0,0,0,0.15); }

.data-table th {
  padding: 9px var(--space-5);
  text-align: left;
  font-size: 0.6875rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.07em;
  color: var(--grey-500);
  white-space: nowrap;
}

.data-table td {
  padding: 11px var(--space-5);
  font-size: 0.875rem;
  border-top: 1px solid rgba(30, 45, 69, 0.6);
}

.data-table tbody tr:hover { background: rgba(255,255,255,0.025); }

.td-primary   { font-weight: 600; color: var(--white); }
.td-secondary { color: var(--grey-500); }
.td-muted     { color: var(--navy-border); }

/* mono in tables */
.data-table .mono { font-family: var(--font-mono); font-size: 0.8125rem; }

/* --- Link with arrow --- */
.link-arrow {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  font-size: 0.8125rem;
  font-weight: 600;
  color: var(--grey-500);
  transition: color 150ms;
}

.link-arrow:hover { color: var(--blue); }
.link-arrow.gold  { color: var(--gold); }
.link-arrow.gold:hover { color: #fbbf24; }

/* --- MarginIQ Gauge card --- */
.margin-gauge-wrap {
  padding: var(--space-4) var(--space-5) var(--space-2);
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: var(--space-2);
}

.margin-gauge { width: 100%; max-width: 180px; }
.gauge-svg    { width: 100%; }

.gauge-targets {
  display: flex;
  align-items: center;
  gap: var(--space-4);
  font-size: 0.75rem;
}

.gauge-target-label { color: var(--grey-500); }
.gauge-status-ok {
  display: flex;
  align-items: center;
  gap: 4px;
  color: var(--green);
  font-weight: 600;
}

.insight-list {
  list-style: none;
  padding: var(--space-2) var(--space-5) var(--space-2);
  display: flex;
  flex-direction: column;
  gap: var(--space-3);
}

.insight-item {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  font-size: 0.8125rem;
  color: var(--grey-500);
  line-height: 1.5;
}

.insight-dot {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: var(--gold);
  flex-shrink: 0;
  margin-top: 5px;
}

/* --- MarginIQ badge (gold pill) --- */
.badge-marginiq {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  background: rgba(245, 158, 11, 0.14);
  color: var(--gold);
  font-size: 0.6875rem;
  font-weight: 700;
  letter-spacing: 0.04em;
  padding: 3px 9px;
  border-radius: 20px;
  border: 1px solid rgba(245, 158, 11, 0.3);
}

/* --- Quick Actions --- */
.quick-actions-section { display: flex; flex-direction: column; }
.section-title-sm {
  font-size: 0.75rem;
  font-weight: 700;
  color: var(--grey-500);
  text-transform: uppercase;
  letter-spacing: 0.08em;
  margin-bottom: var(--space-3);
}

.quick-actions-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: var(--space-4);
}

.quick-action-card {
  display: flex;
  align-items: center;
  gap: var(--space-3);
  background: var(--navy-card);
  border: 1px solid var(--navy-border);
  border-radius: var(--radius-md);
  padding: var(--space-4) var(--space-5);
  color: var(--white);
  font-size: 0.9rem;
  font-weight: 600;
  transition: border-color 150ms, background 150ms;
  cursor: pointer;
}

.quick-action-card:hover {
  border-color: var(--blue);
  background: rgba(59, 130, 246, 0.05);
}

.qa-icon-wrap {
  width: 36px;
  height: 36px;
  border-radius: var(--radius);
  background: var(--blue-glow);
  color: var(--blue);
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

.qa-label { flex: 1; }
.qa-arrow { color: var(--grey-700); flex-shrink: 0; }
.quick-action-card:hover .qa-arrow { color: var(--blue); }

/* --- Recent Estimates section --- */
.recent-estimates-section {}

/* --- Estimate Builder page --- */
.estimate-layout {
  display: grid;
  grid-template-columns: 60fr 40fr;
  gap: var(--space-6);
  align-items: start;
}

.estimate-builder {
  display: flex;
  flex-direction: column;
  gap: var(--space-5);
}

/* Form grid inside cards */
.form-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: var(--space-3) var(--space-4);
  padding: var(--space-5);
}

.form-group { display: flex; flex-direction: column; gap: 5px; }
.form-group-full { grid-column: 1 / -1; }

.form-label {
  font-size: 0.6875rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--grey-500);
}

.form-input,
.form-textarea {
  background: var(--navy);
  border: 1px solid var(--navy-border);
  border-radius: var(--radius-sm);
  color: var(--white);
  font-size: 0.875rem;
  padding: 8px 11px;
  outline: none;
  width: 100%;
  transition: border-color 150ms;
}

.form-input:focus,
.form-textarea:focus { border-color: var(--blue); }
.form-input::placeholder,
.form-textarea::placeholder { color: var(--grey-500); }
.form-textarea { resize: vertical; line-height: 1.5; }

.input-autocomplete-wrap { position: relative; }
.input-autocomplete-wrap .form-input { padding-right: 34px; }
.input-icon-right {
  position: absolute;
  right: 10px;
  top: 50%;
  transform: translateY(-50%);
  color: var(--grey-500);
  pointer-events: none;
}

/* --- Line items table (builder) --- */
.line-items-table-wrap { overflow-x: auto; }

.line-items-table {
  width: 100%;
  border-collapse: collapse;
}

.line-items-table thead { background: rgba(0,0,0,0.15); }

.line-items-table th {
  padding: 8px 6px;
  text-align: left;
  font-size: 0.625rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.07em;
  color: var(--grey-500);
  border-bottom: 1px solid var(--navy-border);
  white-space: nowrap;
}

.line-items-table td {
  padding: 5px 6px;
  border-bottom: 1px solid rgba(30, 45, 69, 0.5);
  vertical-align: middle;
}

.line-items-table tbody tr:hover { background: rgba(255,255,255,0.02); }

.col-num    { width: 32px; text-align: center; padding-left: var(--space-5) !important; }
.col-desc   { min-width: 160px; }
.col-qty    { width: 68px; }
.col-unit   { width: 58px; }
.col-cost   { width: 90px; }
.col-markup { width: 76px; }
.col-total  { width: 88px; text-align: right; padding-right: var(--space-3) !important; }
.col-action { width: 32px; text-align: center; padding-right: var(--space-4) !important; }

.li-input {
  background: transparent;
  border: 1px solid transparent;
  border-radius: var(--radius-sm);
  color: var(--white);
  font-size: 0.875rem;
  padding: 4px 6px;
  width: 100%;
  outline: none;
  transition: border-color 150ms, background 150ms;
  font-family: inherit;
}

.li-input:focus {
  border-color: var(--blue);
  background: rgba(59,130,246,0.05);
}

.li-input:hover:not(:focus) { border-color: var(--navy-border); }
.li-input.mono { font-family: var(--font-mono); font-size: 0.8125rem; }

.li-total {
  font-family: var(--font-mono);
  font-size: 0.8125rem;
  font-weight: 600;
  color: var(--white);
}

.row-delete-btn {
  background: none;
  border: none;
  color: var(--grey-700);
  padding: 4px;
  border-radius: var(--radius-sm);
  display: flex;
  align-items: center;
  justify-content: center;
  transition: color 150ms, background 150ms;
  cursor: pointer;
}

.row-delete-btn:hover {
  color: var(--red);
  background: rgba(239,68,68,0.1);
}

.line-items-actions {
  display: flex;
  gap: var(--space-2);
  padding: var(--space-3) var(--space-4);
  border-top: 1px solid var(--navy-border);
}

/* btn-gold-outline */
.btn-gold-outline {
  background: transparent;
  color: var(--gold);
  border: 1px solid var(--gold);
  padding: 7px 14px;
  border-radius: var(--radius);
  font-size: 0.8125rem;
  font-weight: 600;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  cursor: pointer;
  transition: background 150ms;
  font-family: inherit;
}

.btn-gold-outline:hover { background: rgba(245,158,11,0.08); }

/* Cost summary card */
.cost-summary {
  padding: var(--space-4) var(--space-5);
  display: flex;
  flex-direction: column;
}

.cost-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 7px 0;
  font-size: 0.875rem;
  border-bottom: 1px solid rgba(30,45,69,0.6);
}

.cost-row:last-child { border-bottom: none; }

.cost-label { color: var(--grey-500); }
.cost-value { font-family: var(--font-mono); font-size: 0.8125rem; font-weight: 600; color: var(--white); }

.cost-row-divider { margin-top: 4px; padding-top: var(--space-3); border-top: 2px solid var(--navy-border); }

.cost-row-estimate .cost-label,
.cost-row-estimate .cost-value { color: var(--blue); font-weight: 700; }

.cost-row-margin .cost-label { color: var(--white); font-weight: 700; }
.cost-row-margin .cost-value { font-size: 0.9375rem; font-weight: 700; }
.margin-pct { color: var(--grey-500); font-size: 0.75rem; margin-left: 6px; }

.internal-badge {
  font-size: 0.625rem;
  font-weight: 600;
  color: var(--blue);
  background: rgba(59,130,246,0.1);
  border: 1px solid rgba(59,130,246,0.25);
  padding: 2px 8px;
  border-radius: 20px;
  white-space: nowrap;
}

/* MarginIQ alert box in cost card */
.marginiq-alert {
  margin: 0 var(--space-4) var(--space-4);
  background: rgba(245, 158, 11, 0.08);
  border: 1px solid rgba(245, 158, 11, 0.35);
  border-radius: var(--radius);
  padding: var(--space-3) var(--space-4);
}

.marginiq-alert-header {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 5px;
}

.alert-icon { font-size: 0.875rem; color: var(--gold); }
.marginiq-alert-title { font-size: 0.8125rem; font-weight: 700; color: var(--gold); }
.badge-marginiq-sm { font-size: 0.625rem; padding: 2px 7px; }

.marginiq-alert-body {
  font-size: 0.8125rem;
  color: rgba(245, 158, 11, 0.85);
  line-height: 1.5;
}

/* --- Estimate preview column --- */
.estimate-preview-col {
  position: sticky;
  top: calc(var(--header-height) + var(--space-6));
  align-self: start;
}

.estimate-preview-sticky {
  display: flex;
  flex-direction: column;
  gap: var(--space-3);
}

.estimate-preview-label {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 0.6875rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--grey-500);
}

/* --- Estimate document (white paper) --- */
.estimate-doc {
  background: #fff;
  color: #1a1a2e;
  border-radius: var(--radius-md);
  padding: 24px 26px 20px;
  box-shadow: 0 12px 40px rgba(0,0,0,0.5);
  font-size: 11px;
  line-height: 1.5;
}

.doc-header {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  margin-bottom: 14px;
}

.doc-company-name {
  font-size: 14px;
  font-weight: 800;
  color: #0a0f1e;
  margin-bottom: 3px;
}

.doc-company-details {
  font-size: 10px;
  color: #4a5568;
  line-height: 1.6;
}

.doc-estimate-label {
  text-align: right;
  font-size: 18px;
  font-weight: 900;
  letter-spacing: 0.05em;
  color: #0a0f1e;
  line-height: 1;
}

.doc-est-number {
  font-size: 11px;
  font-weight: 600;
  color: #3b82f6;
  margin-top: 3px;
  letter-spacing: 0.04em;
  font-family: var(--font-mono);
}

.doc-divider {
  border: none;
  border-top: 2px solid #e2e8f0;
  margin: 14px 0;
}

.doc-meta-row {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 8px;
  margin-bottom: 14px;
}

.doc-meta-label {
  font-size: 8px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: #718096;
  margin-bottom: 2px;
}

.doc-meta-value {
  font-size: 10.5px;
  font-weight: 600;
  color: #1a202c;
}

.doc-line-table {
  width: 100%;
  border-collapse: collapse;
  margin-bottom: 12px;
}

.doc-th {
  padding: 6px 6px;
  font-size: 8px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.07em;
  color: #718096;
  border-bottom: 2px solid #e2e8f0;
  text-align: left;
}

.doc-th-num { text-align: right; }

.doc-td {
  padding: 6px 6px;
  font-size: 10.5px;
  color: #2d3748;
  border-bottom: 1px solid #f0f4f8;
  text-align: left;
}

.doc-td-num { text-align: right; }
.doc-line-row:last-child .doc-td { border-bottom: none; }

.doc-totals {
  border-top: 2px solid #e2e8f0;
  padding-top: 8px;
  margin-left: auto;
  width: 180px;
  display: flex;
  flex-direction: column;
  gap: 3px;
}

.doc-total-row {
  display: flex;
  justify-content: space-between;
  font-size: 10.5px;
  color: #4a5568;
}

.doc-total-label { font-weight: 500; }
.doc-total-value { font-family: var(--font-mono); font-weight: 600; }

.doc-total-final {
  border-top: 2px solid #1a202c;
  margin-top: 3px;
  padding-top: 6px;
}

.doc-total-final .doc-total-label,
.doc-total-final .doc-total-value {
  font-size: 13px;
  font-weight: 800;
  color: #1a202c;
}

.doc-terms {
  margin-top: 16px;
  padding-top: 12px;
  border-top: 1px solid #e2e8f0;
}

.doc-terms-title {
  font-size: 8px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.07em;
  color: #718096;
  margin-bottom: 4px;
}

.doc-terms-body {
  font-size: 9.5px;
  color: #718096;
  line-height: 1.6;
}

.doc-signature {
  margin-top: 16px;
  padding-top: 12px;
  border-top: 1px solid #e2e8f0;
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.doc-sig-line {
  display: flex;
  align-items: flex-end;
  gap: 8px;
  font-size: 10px;
}

.doc-sig-label {
  color: #4a5568;
  font-weight: 600;
  white-space: nowrap;
}

.doc-sig-blank {
  color: #c4c4c4;
  border-bottom: 1px solid #c4c4c4;
  flex: 1;
  min-width: 60px;
  line-height: 1.8;
}

.doc-footer {
  margin-top: 14px;
  text-align: center;
  font-size: 10px;
  color: #a0aec0;
  font-style: italic;
}

.preview-actions {
  display: flex;
  gap: var(--space-3);
}

.preview-actions .btn {
  flex: 1;
  justify-content: center;
  font-size: 0.8125rem;
  padding: 8px 12px;
}

/* --- Responsive fixes for app pages --- */
@media (max-width: 1200px) {
  .estimate-layout,
  .two-col-section {
    grid-template-columns: 1fr;
  }
  .estimate-preview-col { position: static; }
  .stats-grid { grid-template-columns: repeat(2, 1fr); }
}

@media (max-width: 900px) {
  .quick-actions-grid { grid-template-columns: repeat(2, 1fr); }
  .doc-meta-row { grid-template-columns: 1fr 1fr; }
}

@media (max-width: 640px) {
  body.app-body { flex-direction: column; }
  .sidebar { display: none; }
  .app-main { margin-left: 0; }
  .stats-grid,
  .quick-actions-grid { grid-template-columns: 1fr; }
}


/* ============================================================
   MARGINIQ PAGE — app/marginiq.html
   ============================================================ */

/* ── Mobile hamburger (app pages) ─────────────────────────── */
.miq-hamburger {
  display: none;
  background: none;
  border: none;
  color: var(--grey-500);
  padding: 6px;
  border-radius: var(--radius);
  cursor: pointer;
  align-items: center;
  justify-content: center;
  margin-right: 4px;
}
.miq-hamburger:hover { color: var(--white); background: rgba(255,255,255,0.05); }

/* ── Sidebar overlay (mobile) ──────────────────────────────── */
.sidebar-overlay {
  display: none;
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.55);
  z-index: 99;
  opacity: 0;
  transition: opacity 250ms;
}
.sidebar-overlay.open {
  display: block;
  opacity: 1;
}

/* ── Header extras ─────────────────────────────────────────── */
.miq-header-meta {
  font-size: 0.8125rem;
  color: var(--grey-500);
  white-space: nowrap;
}

/* ── Notification dropdown ─────────────────────────────────── */
.miq-notif-wrap {
  position: relative;
}

.notif-dropdown {
  display: none;
  position: absolute;
  top: calc(100% + 8px);
  right: 0;
  width: 320px;
  background: var(--navy-card);
  border: 1px solid var(--navy-border);
  border-radius: var(--radius-md);
  box-shadow: var(--shadow-lg);
  overflow: hidden;
  z-index: 500;
}
.notif-dropdown.open { display: block; }

.notif-dropdown-header {
  padding: 11px 16px;
  font-size: 0.6875rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--grey-500);
  border-bottom: 1px solid var(--navy-border);
}

.notif-item {
  display: flex;
  align-items: flex-start;
  gap: 12px;
  padding: 12px 16px;
  border-bottom: 1px solid rgba(30,45,69,0.5);
  transition: background var(--transition);
}
.notif-item:last-child { border-bottom: none; }
.notif-item:hover { background: rgba(255,255,255,0.03); }
.notif-unread { background: rgba(59,130,246,0.04); }

.notif-icon { font-size: 14px; flex-shrink: 0; line-height: 1.5; }

.notif-body {
  display: flex;
  flex-direction: column;
  gap: 2px;
}
.notif-text {
  font-size: 0.8125rem;
  color: var(--grey-300);
  line-height: 1.45;
}
.notif-time {
  font-size: 0.6875rem;
  color: var(--grey-500);
}

/* ── MarginIQ Hero Banner ──────────────────────────────────── */
.miq-hero-inner {
  padding: 32px 36px 28px;
}

.miq-hero-top {
  margin-bottom: 16px;
}

.miq-hero-headline {
  font-size: 1.375rem;
  font-weight: 800;
  color: var(--white);
  margin-bottom: 12px;
  letter-spacing: -0.02em;
  line-height: 1.3;
}

.miq-hero-sub {
  font-size: 0.9375rem;
  color: var(--grey-300);
  max-width: 680px;
  margin-bottom: 28px;
  line-height: 1.65;
}

.miq-hero-stats {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 0;
}

.miq-hero-stat {
  display: flex;
  flex-direction: column;
  gap: 4px;
  padding-right: 36px;
}

.miq-stat-label {
  font-size: 0.6875rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--grey-500);
}

.miq-stat-value {
  font-family: var(--font-mono);
  font-size: 1.875rem;
  font-weight: 800;
  color: var(--gold);
  line-height: 1;
  letter-spacing: -0.02em;
}

.miq-stat-detail {
  font-size: 0.75rem;
  color: var(--grey-500);
}

.miq-hero-stat-divider {
  width: 1px;
  height: 52px;
  background: rgba(245,158,11,0.3);
  margin-right: 36px;
  flex-shrink: 0;
}

/* ── Two-column layout (chart + insights) ──────────────────── */
.miq-two-col {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 20px;
  align-items: start;
}

.miq-target-label {
  font-size: 0.75rem;
  color: var(--gold);
  opacity: 0.8;
}

/* ── Bar Chart (CSS-only horizontal bars) ──────────────────── */
.miq-chart-body {
  padding: 16px 20px 20px;
}

.miq-bar-chart {
  display: flex;
  flex-direction: column;
  gap: 14px;
  position: relative;
  margin-top: 8px;
}

/* Dashed vertical target line at 25% */
.miq-target-line {
  position: absolute;
  top: 0;
  bottom: 0;
  width: 1px;
  border-left: 2px dashed rgba(245,158,11,0.45);
  pointer-events: none;
  z-index: 1;
}

.miq-target-tick {
  position: absolute;
  top: -18px;
  left: 50%;
  transform: translateX(-50%);
  font-size: 0.625rem;
  font-weight: 700;
  color: var(--gold);
  white-space: nowrap;
}

.miq-bar-row {
  display: flex;
  align-items: center;
  gap: 12px;
  position: relative;
  z-index: 2;
}

.miq-bar-label {
  width: 140px;
  flex-shrink: 0;
  font-size: 0.8125rem;
  color: var(--grey-300);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.miq-bar-track {
  flex: 1;
  height: 10px;
  background: var(--navy-border);
  border-radius: var(--radius-full);
  overflow: hidden;
}

.miq-bar-fill {
  height: 100%;
  border-radius: var(--radius-full);
  transition: width 0.7s ease;
}

.miq-bar-green { background: var(--green); }
.miq-bar-best  { background: linear-gradient(90deg, var(--green), #4ade80); }
.miq-bar-red   { background: var(--red); }
.miq-bar-grey  { background: var(--grey-500); opacity: 0.6; }

.miq-bar-pct {
  width: 56px;
  flex-shrink: 0;
  font-family: var(--font-mono);
  font-size: 0.75rem;
  font-weight: 700;
  color: var(--grey-300);
  text-align: right;
}
.miq-pct-red   { color: var(--red); }
.miq-pct-muted { color: var(--grey-500); font-weight: 400; }

.miq-chart-legend {
  margin-top: 16px;
  font-size: 0.75rem;
  color: var(--grey-500);
  display: flex;
  align-items: center;
  gap: 4px;
  flex-wrap: wrap;
}

.miq-legend-dot {
  display: inline-block;
  width: 8px;
  height: 8px;
  border-radius: 50%;
  flex-shrink: 0;
}
.miq-dot-red   { background: var(--red); }
.miq-dot-green { background: var(--green); }
.miq-dot-grey  { background: var(--grey-500); }

/* ── AI Insights Feed ──────────────────────────────────────── */
.miq-powered-by {
  font-size: 0.6875rem;
  color: var(--gold);
  opacity: 0.7;
  font-weight: 600;
}

.miq-insight-feed {
  display: flex;
  flex-direction: column;
  gap: 12px;
  padding: 12px 20px 20px;
}

.miq-insight-item {
  display: flex;
  align-items: flex-start;
  gap: 12px;
  padding: 12px 14px;
  background: var(--navy);
  border: 1px solid var(--navy-border);
  border-radius: var(--radius);
}

.miq-insight-dot {
  width: 9px;
  height: 9px;
  border-radius: 50%;
  flex-shrink: 0;
  margin-top: 5px;
}

.miq-pulse { animation: miqPulse 2s ease-in-out infinite; }
.miq-pulse-gold  { background: var(--gold); }
.miq-pulse-green { background: var(--green); }
.miq-pulse-red   { background: var(--red); }

@keyframes miqPulse {
  0%, 100% { opacity: 1; transform: scale(1); }
  50%       { opacity: 0.55; transform: scale(1.3); }
}

.miq-insight-body {
  flex: 1;
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.miq-insight-text {
  font-size: 0.8125rem;
  color: var(--grey-300);
  line-height: 1.5;
}

/* ── Cost Breakdown ────────────────────────────────────────── */
.miq-cost-body {
  padding: 20px 24px;
}

.miq-cost-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 20px;
  margin-bottom: 20px;
}

.miq-cost-col {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.miq-cost-label {
  font-size: 0.6875rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.07em;
  color: var(--grey-500);
}

.miq-cost-amount {
  font-family: var(--font-mono);
  font-size: 1.375rem;
  font-weight: 800;
  color: var(--white);
  line-height: 1;
}

.miq-cost-pct {
  font-family: var(--font-mono);
  font-size: 0.8125rem;
  color: var(--grey-500);
}

.miq-rec-box {
  padding: 14px 18px;
  background: rgba(245,158,11,0.07);
  border: 1px solid rgba(245,158,11,0.25);
  border-radius: var(--radius);
}

.miq-rec-label {
  display: block;
  font-size: 0.6875rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.07em;
  color: var(--gold);
  margin-bottom: 6px;
}

.miq-rec-text {
  font-size: 0.875rem;
  color: var(--grey-300);
  line-height: 1.6;
}

/* ── Job Status Badges ─────────────────────────────────────── */
.miq-status {
  display: inline-flex;
  padding: 3px 10px;
  border-radius: var(--radius-full);
  font-size: 0.6875rem;
  font-weight: 700;
  letter-spacing: 0.03em;
  white-space: nowrap;
}
.miq-on-track    { background: rgba(16,185,129,0.12);  color: var(--green); }
.miq-at-risk     { background: rgba(245,158,11,0.12);  color: var(--gold); }
.miq-over-budget { background: rgba(239,68,68,0.12);   color: var(--red); }
.miq-completed   { background: rgba(59,130,246,0.12);  color: var(--blue); }

/* ── Upgrade CTA ───────────────────────────────────────────── */
.miq-cta-inner {
  display: flex;
  align-items: flex-start;
  gap: 48px;
  padding: 36px;
  flex-wrap: wrap;
}

.miq-cta-text {
  flex: 1;
  min-width: 280px;
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.miq-cta-headline {
  font-size: 1.25rem;
  font-weight: 800;
  color: var(--white);
  letter-spacing: -0.02em;
}

.miq-cta-sub {
  font-size: 0.9375rem;
  color: var(--grey-300);
  line-height: 1.65;
}

.miq-cta-features {
  list-style: none;
  display: flex;
  flex-direction: column;
  gap: 8px;
}
.miq-cta-features li {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 0.875rem;
  color: var(--grey-300);
}
.miq-cta-features li svg { color: var(--gold); flex-shrink: 0; }

.miq-cta-action {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 12px;
  flex-shrink: 0;
  min-width: 200px;
  padding-top: 8px;
}

.miq-cta-price {
  display: flex;
  align-items: baseline;
  gap: 2px;
  color: var(--gold);
}

.miq-price-amount {
  font-family: var(--font-mono);
  font-size: 2.625rem;
  font-weight: 800;
  line-height: 1;
}

.miq-price-period { font-size: 1rem; font-weight: 600; }

.miq-cta-note {
  font-size: 0.75rem;
  color: var(--grey-500);
  text-align: center;
}


/* ============================================================
   SETTINGS PAGE — app/settings.html
   ============================================================ */

/* ── Tab Bar ───────────────────────────────────────────────── */
.stg-tabs-bar {
  display: flex;
  align-items: center;
  gap: 2px;
  padding: 4px;
  background: var(--navy-card);
  border: 1px solid var(--navy-border);
  border-radius: var(--radius-md);
  width: fit-content;
  flex-wrap: wrap;
}

.stg-tab {
  padding: 7px 18px;
  border: none;
  border-radius: var(--radius);
  font-size: 0.875rem;
  font-weight: 500;
  color: var(--grey-500);
  background: transparent;
  cursor: pointer;
  transition: background var(--transition), color var(--transition);
  white-space: nowrap;
}
.stg-tab:hover { color: var(--grey-300); background: rgba(255,255,255,0.05); }
.stg-tab.active { background: var(--blue); color: var(--white); font-weight: 600; }

/* ── Panels ────────────────────────────────────────────────── */
.stg-panel { display: none; flex-direction: column; gap: 20px; }
.stg-panel.active { display: flex; }

.stg-card-body { padding: 20px 24px; }
.stg-narrow { max-width: 480px; }

/* ── Avatar ────────────────────────────────────────────────── */
.stg-avatar-row {
  display: flex;
  align-items: center;
  gap: 20px;
  flex-wrap: wrap;
}

.stg-avatar-circle {
  width: 72px;
  height: 72px;
  border-radius: 50%;
  background: var(--blue-dark);
  color: var(--white);
  font-size: 1.25rem;
  font-weight: 700;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

.stg-avatar-actions {
  display: flex;
  align-items: center;
  gap: 12px;
  flex-wrap: wrap;
}

.stg-hint { font-size: 0.75rem; color: var(--grey-500); }

/* ── Form grid ─────────────────────────────────────────────── */
.stg-form-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 16px;
  margin-bottom: 20px;
}
.stg-single-col { grid-template-columns: 1fr; }
.stg-full-col   { grid-column: 1 / -1; }

.stg-form-actions {
  display: flex;
  align-items: center;
  gap: 12px;
}

/* ── Logo drop zone ────────────────────────────────────────── */
.stg-logo-drop {
  border: 2px dashed var(--navy-border);
  border-radius: var(--radius-md);
  padding: 36px;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 8px;
  text-align: center;
  transition: border-color var(--transition);
}
.stg-logo-drop:hover { border-color: var(--blue); }

/* ── Billing card ──────────────────────────────────────────── */
.stg-billing-card {
  background: linear-gradient(135deg, var(--navy-card) 0%, rgba(15,29,56,1) 100%);
  border-color: rgba(59,130,246,0.3);
}

.stg-plan-badge-row {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-bottom: 8px;
}

.stg-plan-active {
  font-size: 0.6875rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.07em;
  color: var(--green);
}

.stg-plan-name {
  font-size: 1.125rem;
  font-weight: 800;
  color: var(--white);
  margin-bottom: 8px;
  letter-spacing: -0.02em;
}

.stg-plan-price-row {
  display: flex;
  align-items: baseline;
  gap: 4px;
  margin-bottom: 16px;
}

.stg-plan-price {
  font-family: var(--font-mono);
  font-size: 2.25rem;
  font-weight: 800;
  color: var(--blue);
  line-height: 1;
}

.stg-plan-period { font-size: 1rem; color: var(--grey-500); }

.stg-plan-meta {
  display: flex;
  gap: 24px;
  font-size: 0.875rem;
  color: var(--grey-500);
  margin-bottom: 20px;
  flex-wrap: wrap;
}
.stg-plan-meta strong { color: var(--white); }

.stg-plan-actions { display: flex; gap: 12px; flex-wrap: wrap; }

/* ── Usage bars ────────────────────────────────────────────── */
.stg-usage-list { display: flex; flex-direction: column; gap: 16px; }

.stg-usage-row {
  display: flex;
  align-items: center;
  gap: 16px;
}

.stg-usage-label {
  width: 80px;
  flex-shrink: 0;
  font-size: 0.875rem;
  color: var(--grey-300);
}

.stg-usage-count {
  font-family: var(--font-mono);
  font-size: 0.8125rem;
  color: var(--grey-500);
  white-space: nowrap;
  min-width: 120px;
  text-align: right;
}

/* ── Toggle switch ─────────────────────────────────────────── */
.stg-toggle-list { display: flex; flex-direction: column; }

.stg-toggle-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
  padding: 16px 24px;
  border-bottom: 1px solid rgba(30,45,69,0.6);
}
.stg-toggle-row:last-child { border-bottom: none; }

.stg-toggle-info { display: flex; flex-direction: column; gap: 2px; }

.stg-toggle-label {
  font-size: 0.9375rem;
  font-weight: 600;
  color: var(--white);
}

.stg-toggle-desc { font-size: 0.8125rem; color: var(--grey-500); }

.stg-switch {
  position: relative;
  flex-shrink: 0;
  display: inline-flex;
  cursor: pointer;
}

.stg-switch input {
  position: absolute;
  opacity: 0;
  width: 0;
  height: 0;
}

.stg-switch-track {
  display: block;
  width: 44px;
  height: 24px;
  background: var(--navy-border);
  border-radius: var(--radius-full);
  transition: background 0.2s;
  position: relative;
}

.stg-switch-thumb {
  position: absolute;
  top: 3px;
  left: 3px;
  width: 18px;
  height: 18px;
  background: var(--white);
  border-radius: 50%;
  transition: transform 0.2s;
  box-shadow: 0 1px 4px rgba(0,0,0,0.4);
}

.stg-switch input:checked + .stg-switch-track { background: var(--blue); }
.stg-switch input:checked + .stg-switch-track .stg-switch-thumb { transform: translateX(20px); }

/* ── Integrations ──────────────────────────────────────────── */
.stg-integration-list { display: flex; flex-direction: column; }

.stg-int-row {
  display: flex;
  align-items: center;
  gap: 16px;
  padding: 16px 24px;
  border-bottom: 1px solid rgba(30,45,69,0.6);
}
.stg-int-row:last-child { border-bottom: none; }

.stg-int-icon {
  width: 40px;
  height: 40px;
  border-radius: var(--radius);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 0.8125rem;
  font-weight: 800;
  flex-shrink: 0;
  color: var(--white);
}
.stg-int-qb       { background: #2CA01C; }
.stg-int-stripe   { background: #6772e5; }
.stg-int-gcal     { background: #4285f4; }
.stg-int-docusign { background: #1a5276; }

.stg-int-info {
  flex: 1;
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.stg-int-name { font-size: 0.9375rem; font-weight: 600; color: var(--white); }
.stg-int-desc { font-size: 0.8125rem; color: var(--grey-500); }

/* ── Security ──────────────────────────────────────────────── */
.stg-security-row {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 24px;
}

.stg-session-list { display: flex; flex-direction: column; }

.stg-session-row {
  display: flex;
  align-items: center;
  gap: 16px;
  padding: 14px 24px;
  border-bottom: 1px solid rgba(30,45,69,0.6);
}
.stg-session-row:last-child { border-bottom: none; }

.stg-session-current { background: rgba(16,185,129,0.04); }

.stg-session-icon { color: var(--grey-500); flex-shrink: 0; }

.stg-session-info { flex: 1; display: flex; flex-direction: column; gap: 2px; }

.stg-session-device { font-size: 0.875rem; font-weight: 600; color: var(--white); }
.stg-session-meta   { font-size: 0.8125rem; color: var(--grey-500); }


/* ============================================================
   RESPONSIVE — MOBILE  (MarginIQ + Settings)
   ============================================================ */

@media (max-width: 1023px) {
  .miq-hamburger { display: inline-flex; }
  .sidebar { transform: translateX(-100%); transition: transform 250ms ease; }
  .sidebar.mobile-open { transform: translateX(0); }
  .app-main { margin-left: 0 !important; }
  .miq-two-col { grid-template-columns: 1fr; }
  .miq-cost-grid { grid-template-columns: 1fr 1fr; }
  .stg-form-grid { grid-template-columns: 1fr; }
  .stg-full-col  { grid-column: span 1; }
  .miq-hero-stats { flex-direction: column; align-items: flex-start; }
  .miq-hero-stat-divider { width: 60px; height: 1px; margin-right: 0; margin-bottom: 4px; }
  .miq-cta-inner { flex-direction: column; gap: 24px; }
}

@media (max-width: 640px) {
  .miq-cost-grid { grid-template-columns: 1fr; }
  .stg-tabs-bar { width: 100%; }
  .stg-tab { flex: 1; text-align: center; padding: 7px 6px; font-size: 0.8125rem; }
  .miq-header-meta { display: none; }
  .miq-hero-headline { font-size: 1.125rem; }
  .miq-stat-value { font-size: 1.5rem; }
  .miq-hero-inner { padding: 20px; }
}
