/* ═══════════════════════════════════════════════════════════════════════
   LUMEX Design System — Premium Contractor Identity
   ═══════════════════════════════════════════════════════════════════════ */

:root {
  --lx-bg: #0a0f1a;
  --lx-surface: #111827;
  --lx-card: #1a2332;
  --lx-border: #1e293b;
  --lx-border-hover: #334155;
  --lx-text: #f8fafc;
  --lx-text-secondary: #94a3b8;
  --lx-text-muted: #64748b;
  --lx-primary: #3b82f6;
  --lx-primary-hover: #2563eb;
  --lx-primary-glow: rgba(59, 130, 246, 0.15);
  --lx-accent: #60a5fa;
  --lx-success: #22c55e;
  --lx-warning: #f59e0b;
  --lx-danger: #ef4444;
  --lx-radius: 12px;
  --lx-radius-sm: 8px;
  --lx-radius-lg: 16px;
  --lx-shadow: 0 4px 24px rgba(0, 0, 0, 0.35);
  --lx-shadow-lg: 0 8px 40px rgba(0, 0, 0, 0.5);
  --lx-max-width: 1200px;
  --lx-font: "IBM Plex Sans", "Inter", system-ui, -apple-system, "Segoe UI", sans-serif;
  --lx-font-mono: "IBM Plex Mono", "SF Mono", "Consolas", monospace;

  /* preserve old names for lumex.js status classes */
  --lumex-bg: var(--lx-bg);
  --lumex-text: var(--lx-text);
  --lumex-primary: var(--lx-primary);
  --lumex-card: var(--lx-card);
  --lumex-border: var(--lx-border);
  --lumex-accent: var(--lx-accent);
  --lumex-radius: var(--lx-radius);
}

/* ── Reset ──────────────────────────────────────────────────────────── */
*, *::before, *::after { box-sizing: border-box; margin: 0; }

html {
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  text-rendering: optimizeLegibility;
}

body {
  font-family: var(--lx-font);
  background: var(--lx-bg);
  color: var(--lx-text);
  line-height: 1.6;
  min-height: 100vh;
}

a { color: var(--lx-primary); text-decoration: none; }
a:hover { color: var(--lx-accent); }

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

/* ── Skip Link ──────────────────────────────────────────────────────── */
.skip-link {
  position: absolute; left: -999px; top: 0;
  background: var(--lx-primary); color: #fff;
  padding: 0.6rem 1rem; z-index: 100;
  border-radius: 0 0 var(--lx-radius-sm) 0;
  font-weight: 600;
}
.skip-link:focus { left: 0; }

/* ── Header ─────────────────────────────────────────────────────────── */
.site-header {
  max-width: var(--lx-max-width);
  margin: 0 auto;
  padding: 1.25rem 1.5rem;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1.5rem;
}

.brand-block {
  display: flex;
  align-items: center;
  gap: 0.9rem;
  text-decoration: none;
  color: inherit;
}

.brand-block img,
.brand-block div[aria-hidden] {
  width: 44px; height: 44px;
  border-radius: 10px;
  flex-shrink: 0;
}

.brand-title {
  font-size: 1.1rem;
  font-weight: 700;
  letter-spacing: 0.03em;
  color: var(--lx-text);
}

.brand-subtitle {
  font-size: 0.8rem;
  color: var(--lx-text-muted);
  letter-spacing: 0.04em;
  text-transform: uppercase;
}

.site-nav {
  display: flex;
  flex-wrap: wrap;
  gap: 0.25rem;
}

.site-nav a {
  color: var(--lx-text-secondary);
  font-size: 0.88rem;
  font-weight: 500;
  padding: 0.4rem 0.75rem;
  border-radius: var(--lx-radius-sm);
  border: 1px solid transparent;
  transition: all 0.15s ease;
}

.site-nav a:hover,
.site-nav a:focus-visible {
  color: var(--lx-text);
  background: rgba(255, 255, 255, 0.04);
  border-color: var(--lx-border);
}

.site-nav a[aria-current="page"] {
  color: var(--lx-primary);
  background: var(--lx-primary-glow);
  border-color: rgba(59, 130, 246, 0.25);
}

/* ── Page Shell ─────────────────────────────────────────────────────── */
.page-shell {
  max-width: var(--lx-max-width);
  margin: 0 auto;
  padding: 0 1.5rem 4rem;
}

/* ── Grid System ────────────────────────────────────────────────────── */
.grid { display: grid; gap: 1.25rem; }
.grid-two { grid-template-columns: repeat(2, 1fr); }
.grid-three { grid-template-columns: repeat(3, 1fr); }

/* ── Card ───────────────────────────────────────────────────────────── */
.card {
  background: var(--lx-card);
  border: 1px solid var(--lx-border);
  border-radius: var(--lx-radius);
  padding: 1.5rem;
  box-shadow: var(--lx-shadow);
  transition: border-color 0.2s ease, box-shadow 0.2s ease;
}

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

/* ── Hero ───────────────────────────────────────────────────────────── */
.hero {
  margin: 0.5rem 0 2rem;
  padding: 3rem 2.5rem;
  background: linear-gradient(135deg, rgba(59, 130, 246, 0.08) 0%, rgba(96, 165, 250, 0.04) 50%, transparent 100%),
              var(--lx-surface);
  border: 1px solid var(--lx-border);
  border-radius: var(--lx-radius-lg);
  position: relative;
  overflow: hidden;
}

.hero::before {
  content: '';
  position: absolute;
  top: 0; right: 0;
  width: 400px; height: 400px;
  background: radial-gradient(circle, rgba(59, 130, 246, 0.06) 0%, transparent 70%);
  pointer-events: none;
}

.hero h1 {
  font-size: clamp(1.75rem, 4vw, 2.5rem);
  font-weight: 700;
  line-height: 1.2;
  margin-bottom: 1rem;
  letter-spacing: -0.02em;
}

.hero p {
  max-width: 65ch;
  color: var(--lx-text-secondary);
  font-size: 1.05rem;
  margin-bottom: 1.25rem;
  line-height: 1.7;
}

/* ── Buttons ────────────────────────────────────────────────────────── */
.btn, button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  font-family: var(--lx-font);
  font-size: 0.9rem;
  font-weight: 600;
  padding: 0.7rem 1.25rem;
  border-radius: var(--lx-radius-sm);
  border: 1px solid var(--lx-primary);
  background: var(--lx-primary);
  color: #fff;
  cursor: pointer;
  text-decoration: none;
  transition: all 0.15s ease;
  white-space: nowrap;
}

.btn:hover, button:hover {
  background: var(--lx-primary-hover);
  border-color: var(--lx-primary-hover);
  box-shadow: 0 0 20px rgba(59, 130, 246, 0.25);
  color: #fff;
}

.btn.secondary, button.secondary {
  background: transparent;
  color: var(--lx-text-secondary);
  border-color: var(--lx-border);
}

.btn.secondary:hover, button.secondary:hover {
  color: var(--lx-text);
  background: rgba(255, 255, 255, 0.04);
  border-color: var(--lx-border-hover);
  box-shadow: none;
}

.cta-row {
  display: flex;
  gap: 0.75rem;
  flex-wrap: wrap;
  align-items: center;
}

/* ── Typography ─────────────────────────────────────────────────────── */
.section-title {
  font-size: 1.15rem;
  font-weight: 700;
  margin: 1.5rem 0 0.75rem;
  letter-spacing: -0.01em;
}

.section-subtitle {
  color: var(--lx-text-muted);
  font-size: 0.9rem;
  margin: -0.5rem 0 1rem;
}

.list {
  padding-left: 1.25rem;
  color: var(--lx-text-secondary);
  line-height: 1.8;
}

.helper {
  color: var(--lx-text-muted);
  font-size: 0.82rem;
  line-height: 1.5;
}

.inline-note {
  border-left: 3px solid var(--lx-primary);
  padding: 0.6rem 0.85rem;
  background: var(--lx-primary-glow);
  border-radius: 0 var(--lx-radius-sm) var(--lx-radius-sm) 0;
  font-size: 0.9rem;
  color: var(--lx-text-secondary);
}

/* ── KPI Strips ─────────────────────────────────────────────────────── */
.kpi-strip {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 0.75rem;
}

.kpi-strip-four {
  grid-template-columns: repeat(4, 1fr);
}

.kpi {
  background: var(--lx-surface);
  border: 1px solid var(--lx-border);
  border-radius: var(--lx-radius-sm);
  padding: 0.85rem 1rem;
}

.kpi .label {
  display: block;
  color: var(--lx-text-muted);
  font-size: 0.75rem;
  font-weight: 500;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  margin-bottom: 0.3rem;
}

.kpi .value {
  font-size: 1.35rem;
  font-weight: 700;
  font-family: var(--lx-font-mono);
  color: var(--lx-text);
}

/* ── Forms ───────────────────────────────────────────────────────────── */
.form-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 1rem;
}

.form-group {
  display: flex;
  flex-direction: column;
  gap: 0.4rem;
}

.form-group.full { grid-column: 1 / -1; }

label {
  font-size: 0.85rem;
  font-weight: 500;
  color: var(--lx-text-secondary);
}

input, select, textarea {
  width: 100%;
  font-family: var(--lx-font);
  font-size: 0.9rem;
  border: 1px solid var(--lx-border);
  border-radius: var(--lx-radius-sm);
  padding: 0.65rem 0.85rem;
  background: var(--lx-bg);
  color: var(--lx-text);
  transition: border-color 0.15s ease, box-shadow 0.15s ease;
}

input:focus, select:focus, textarea:focus {
  outline: none;
  border-color: var(--lx-primary);
  box-shadow: 0 0 0 3px rgba(59, 130, 246, 0.12);
}

input::placeholder, textarea::placeholder {
  color: var(--lx-text-muted);
}

textarea {
  min-height: 110px;
  resize: vertical;
}

select {
  -webkit-appearance: none;
  appearance: none;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 12 12'%3E%3Cpath d='M3 5l3 3 3-3' fill='none' stroke='%2394a3b8' stroke-width='1.5'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 0.8rem center;
  padding-right: 2.2rem;
}

/* ── Result Messages ────────────────────────────────────────────────── */
.result {
  margin-top: 1rem;
  padding: 0.85rem 1rem;
  border-radius: var(--lx-radius-sm);
  border: 1px solid var(--lx-border);
  background: var(--lx-surface);
  font-size: 0.9rem;
}

.result.success {
  border-color: rgba(34, 197, 94, 0.4);
  background: rgba(34, 197, 94, 0.08);
  color: #86efac;
}

.result.error {
  border-color: rgba(239, 68, 68, 0.4);
  background: rgba(239, 68, 68, 0.08);
  color: #fca5a5;
}

/* ── Status Pills ───────────────────────────────────────────────────── */
.status-pill {
  display: inline-block;
  padding: 0.2rem 0.6rem;
  border-radius: 6px;
  font-size: 0.78rem;
  font-weight: 600;
  text-transform: capitalize;
  letter-spacing: 0.02em;
}

.status-pill.active    { background: rgba(59, 130, 246, 0.15);  color: var(--lx-accent); }
.status-pill.completed { background: rgba(34, 197, 94, 0.12);   color: #86efac; }
.status-pill.paid      { background: rgba(34, 197, 94, 0.12);   color: #86efac; }
.status-pill.issued    { background: rgba(245, 158, 11, 0.12);  color: #fbbf24; }
.status-pill.overdue   { background: rgba(239, 68, 68, 0.12);   color: #fca5a5; }
.status-pill.lead      { background: rgba(148, 163, 184, 0.12); color: var(--lx-text-muted); }

/* ── Property & Job Pills ───────────────────────────────────────────── */
.property-pill, .job-pill {
  background: var(--lx-surface);
  border: 1px solid var(--lx-border);
  border-radius: var(--lx-radius-sm);
  padding: 0.75rem 0.85rem;
  transition: border-color 0.15s ease;
}

.property-pill:hover, .job-pill:hover {
  border-color: var(--lx-border-hover);
}

/* ── Invoice Cards ──────────────────────────────────────────────────── */
.invoice-card {
  cursor: pointer;
  transition: border-color 0.2s ease, transform 0.15s ease;
}

.invoice-card:hover {
  border-color: var(--lx-primary);
  transform: translateY(-1px);
}

.line-item-row {
  display: flex;
  justify-content: space-between;
  padding: 0.45rem 0;
  border-bottom: 1px solid rgba(30, 41, 59, 0.5);
  font-size: 0.9rem;
}

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

/* ── Month Bars (Revenue Chart) ─────────────────────────────────────── */
.month-bar {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  padding: 0.45rem 0;
}

.month-bar .bar {
  height: 10px;
  border-radius: 5px;
  background: linear-gradient(90deg, var(--lx-primary), var(--lx-accent));
  min-width: 6px;
  transition: width 0.3s ease;
}

/* ── Footer ─────────────────────────────────────────────────────────── */
.site-footer {
  max-width: var(--lx-max-width);
  margin: 0 auto;
  padding: 2rem 1.5rem;
  color: var(--lx-text-muted);
  font-size: 0.82rem;
  border-top: 1px solid var(--lx-border);
}

/* ── Ops Page Extras ────────────────────────────────────────────────── */
.btn-sm {
  font-family: var(--lx-font);
  border: 1px solid var(--lx-border);
  background: rgba(59, 130, 246, 0.1);
  color: var(--lx-primary);
  font-size: 0.82rem;
  font-weight: 600;
  border-radius: var(--lx-radius-sm);
  padding: 0.4rem 0.75rem;
  cursor: pointer;
  transition: all 0.15s ease;
}
.btn-sm:hover { background: rgba(59, 130, 246, 0.2); }
.btn-sm.secondary { color: var(--lx-text-secondary); background: rgba(148, 163, 184, 0.08); }
.btn-sm.secondary:hover { background: rgba(148, 163, 184, 0.15); color: var(--lx-text); }

.panel-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
  gap: 0.5rem;
}

.lead-card, .dispatch-card { transition: border-color 0.15s ease; }
.lead-card:hover, .dispatch-card:hover { border-color: var(--lx-primary); }

.dialog-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: 100;
}

.dialog-box {
  background: var(--lx-card);
  border: 1px solid var(--lx-border);
  border-radius: var(--lx-radius);
  padding: 1.5rem;
  width: 100%;
  max-width: 440px;
  box-shadow: var(--lx-shadow-lg);
}

.dialog-box h3 { margin: 0 0 1rem; font-size: 1.1rem; }
.dialog-actions { display: flex; gap: 0.5rem; margin-top: 1.25rem; }

.ops-strip {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 0.75rem;
  margin-bottom: 1.5rem;
}

/* ── Service Cards (Home + Services pages) ──────────────────────────── */
.service-card {
  position: relative;
  overflow: hidden;
  transition: border-color 0.2s ease, transform 0.2s ease;
}

.service-card:hover {
  border-color: var(--lx-primary);
  transform: translateY(-2px);
  box-shadow: var(--lx-shadow-lg);
}

.service-card::after {
  content: '';
  position: absolute;
  bottom: 0; left: 0; right: 0;
  height: 3px;
  background: linear-gradient(90deg, var(--lx-primary), var(--lx-accent));
  opacity: 0;
  transition: opacity 0.2s ease;
}

.service-card:hover::after { opacity: 1; }

/* ── Social Proof Strip ─────────────────────────────────────────────── */
.proof-strip {
  display: flex;
  justify-content: center;
  gap: 3rem;
  padding: 1.5rem 0;
  margin: 2rem 0;
  border-top: 1px solid var(--lx-border);
  border-bottom: 1px solid var(--lx-border);
}

.proof-item {
  text-align: center;
}

.proof-item .proof-value {
  font-size: 1.5rem;
  font-weight: 700;
  font-family: var(--lx-font-mono);
  color: var(--lx-primary);
}

.proof-item .proof-label {
  font-size: 0.78rem;
  color: var(--lx-text-muted);
  text-transform: uppercase;
  letter-spacing: 0.06em;
}

/* ── Auth Page Centering ────────────────────────────────────────────── */
.auth-center {
  max-width: 460px;
  margin: 0 auto;
}

/* ── Responsive ─────────────────────────────────────────────────────── */
@media (max-width: 900px) {
  .grid-three,
  .grid-two,
  .form-grid,
  .kpi-strip,
  .kpi-strip-four {
    grid-template-columns: 1fr;
  }

  .site-header {
    flex-direction: column;
    align-items: flex-start;
    padding: 1rem;
  }

  .site-nav { width: 100%; }

  .hero {
    padding: 2rem 1.25rem;
  }

  .proof-strip {
    flex-direction: column;
    gap: 1rem;
    align-items: center;
  }

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

  .page-shell { padding: 0 1rem 3rem; }
}

@media (max-width: 600px) {
  .kpi-strip, .kpi-strip-four {
    grid-template-columns: repeat(2, 1fr);
  }

  .ops-strip {
    grid-template-columns: 1fr;
  }
}

/* ═══════════════════════════════════════════════════════════════════════
   Help / Support Bar — injected by lumex.js on every page
   ═══════════════════════════════════════════════════════════════════════ */
.lx-help-bar {
  position: fixed;
  bottom: 0;
  left: 0;
  right: 0;
  background: var(--lx-surface);
  border-top: 1px solid var(--lx-border);
  padding: 10px 20px;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 24px;
  font-size: 13px;
  color: var(--lx-text-secondary);
  z-index: 999;
}
.lx-help-bar a {
  color: var(--lx-primary);
  text-decoration: none;
  font-weight: 500;
}
.lx-help-bar a:hover {
  text-decoration: underline;
}
.lx-help-bar .lx-help-sep {
  color: var(--lx-text-muted);
}
@media (max-width: 600px) {
  .lx-help-bar {
    flex-direction: column;
    gap: 6px;
    padding: 8px 16px;
    font-size: 12px;
  }
  .lx-help-bar .lx-help-sep { display: none; }
}
/* Add bottom padding to body so content isn't hidden behind fixed bar */
body { padding-bottom: 48px; }
