:root {
  --ink: #13202f;
  --muted: #5b6777;
  --line: #dce3ea;
  --paper: #ffffff;
  --soft: #f4f7fa;
  --navy: #062746;
  --blue: #0f5f9e;
  --teal: #0f8f8a;
  --green: #157f54;
  --gold: #a66a00;
  --red: #b42318;
  --shadow: 0 18px 50px rgba(12, 31, 52, .12);
}
* { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body {
  margin: 0;
  font-family: Inter, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  color: var(--ink);
  background: var(--soft);
  line-height: 1.5;
}
a { color: inherit; text-decoration: none; }
button, input, textarea, select { font: inherit; }
.site-header {
  position: sticky;
  top: 0;
  z-index: 20;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
  padding: 12px clamp(18px, 4vw, 52px);
  background: rgba(255, 255, 255, .94);
  border-bottom: 1px solid var(--line);
  backdrop-filter: blur(12px);
}
.brand { display: flex; align-items: center; gap: 12px; min-width: 250px; }
.brand img { width: 58px; height: 42px; object-fit: contain; background: white; border-radius: 6px; }
.brand strong { display: block; font-size: .98rem; color: var(--navy); }
.brand small { display: block; font-size: .72rem; color: var(--muted); }
.site-nav { display: flex; align-items: center; gap: 8px; }
.site-nav a, .text-button {
  border: 0;
  background: transparent;
  color: var(--muted);
  padding: 10px 12px;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  gap: 7px;
}
.site-nav a:hover, .text-button:hover { color: var(--blue); }
.primary, .secondary {
  border: 0;
  border-radius: 8px;
  padding: 12px 16px;
  font-weight: 700;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  min-height: 42px;
}
.primary { color: white; background: var(--blue); }
.primary:hover { background: #0b5288; }
.secondary { color: var(--navy); background: #e8eef4; border: 1px solid var(--line); }
.secondary:hover { background: #dfe8f0; }
.small { min-height: 36px; padding: 8px 11px; font-size: .9rem; }
.full { width: 100%; }
.icon-button {
  width: 40px;
  height: 40px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: white;
  color: var(--navy);
  display: inline-grid;
  place-items: center;
  cursor: pointer;
}
.mobile-menu { display: none; }
.hero {
  min-height: calc(100vh - 68px);
  display: grid;
  grid-template-columns: minmax(0, 1.1fr) minmax(320px, .65fr);
  gap: clamp(28px, 5vw, 70px);
  align-items: center;
  padding: clamp(44px, 7vw, 92px) clamp(18px, 5vw, 72px);
  background:
    linear-gradient(115deg, rgba(255,255,255,.95), rgba(244,247,250,.86)),
    url("assets/justin-reavis-consulting-logo.png") right 8% center / min(520px, 48vw) no-repeat;
}
.eyebrow {
  margin: 0 0 10px;
  text-transform: uppercase;
  letter-spacing: .08em;
  color: var(--teal);
  font-size: .75rem;
  font-weight: 800;
}
h1, h2, h3, p { overflow-wrap: anywhere; }
h1 {
  margin: 0;
  max-width: 820px;
  font-size: clamp(2.3rem, 6vw, 5rem);
  line-height: .98;
  letter-spacing: 0;
  color: var(--navy);
}
h2 { margin: 0; font-size: clamp(1.8rem, 4vw, 3rem); line-height: 1.05; letter-spacing: 0; }
h3 { margin: 0 0 8px; font-size: 1.08rem; }
.lead { max-width: 720px; color: var(--muted); font-size: clamp(1.05rem, 2vw, 1.25rem); }
.hero-actions { display: flex; flex-wrap: wrap; gap: 12px; margin-top: 28px; }
.hero-panel {
  background: rgba(255,255,255,.92);
  border: 1px solid var(--line);
  border-radius: 8px;
  box-shadow: var(--shadow);
  padding: 22px;
}
.status-row { display: grid; grid-template-columns: 12px 1fr; gap: 8px 12px; align-items: center; }
.status-row small { grid-column: 2; color: var(--muted); }
.live-dot { width: 11px; height: 11px; border-radius: 50%; background: var(--green); box-shadow: 0 0 0 6px rgba(21,127,84,.12); }
.metrics { display: grid; grid-template-columns: repeat(3, 1fr); gap: 10px; margin: 22px 0; }
.metrics div { background: var(--soft); border: 1px solid var(--line); border-radius: 8px; padding: 12px; }
.metrics dt { color: var(--muted); font-size: .74rem; font-weight: 700; }
.metrics dd { margin: 4px 0 0; font-size: 1rem; font-weight: 800; color: var(--navy); }
.portal-preview { display: grid; gap: 10px; }
.portal-preview div { display: flex; align-items: center; gap: 10px; color: var(--muted); }
.trust-strip {
  display: flex;
  justify-content: center;
  flex-wrap: wrap;
  gap: 14px;
  padding: 16px clamp(18px, 5vw, 72px);
  background: #0f314f;
  color: white;
}
.trust-strip span { display: inline-flex; align-items: center; gap: 8px; font-weight: 700; font-size: .92rem; }
.section { padding: clamp(50px, 7vw, 84px) clamp(18px, 5vw, 72px); }
.section-heading { max-width: 760px; margin-bottom: 28px; }
.section-heading p:not(.eyebrow) { color: var(--muted); font-size: 1.04rem; }
.section-heading.compact { margin-bottom: 20px; }
.service-grid, .portal-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 14px;
}
.service-grid article, .portal-grid article, .kb-card, .kb-aside, .support-form, .stat-card, .table-wrap {
  background: var(--paper);
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 20px;
  box-shadow: 0 8px 24px rgba(12,31,52,.05);
}
.service-grid i, .portal-grid i { color: var(--blue); width: 28px; height: 28px; margin-bottom: 12px; }
.service-grid p, .portal-grid p, .kb-card p, .kb-aside p { color: var(--muted); margin: 0; }
.kb-section { background: white; }
.kb-tools { display: grid; gap: 12px; margin-bottom: 18px; }
.search-box {
  display: flex;
  align-items: center;
  gap: 10px;
  background: var(--soft);
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 0 14px;
  min-height: 52px;
}
.search-box input { width: 100%; border: 0; outline: 0; background: transparent; }
.chip-row { display: flex; flex-wrap: wrap; gap: 8px; }
.chip {
  border: 1px solid var(--line);
  border-radius: 999px;
  background: white;
  color: var(--muted);
  padding: 7px 11px;
  cursor: pointer;
  font-weight: 700;
  font-size: .86rem;
}
.chip.active { color: white; background: var(--teal); border-color: var(--teal); }
.kb-layout { display: grid; grid-template-columns: minmax(0, 1fr) 280px; gap: 16px; align-items: start; }
.kb-results { display: grid; gap: 12px; }
.kb-staff-category { display: grid; gap: 10px; }
.kb-staff-category > h3 {
  margin: 16px 0 0;
  padding: 10px 12px;
  background: #09243f;
  color: white;
  border-radius: 8px;
  font-size: 1rem;
}
.kb-card { cursor: pointer; }
.kb-card header { display: flex; gap: 10px; justify-content: space-between; align-items: start; }
.kb-card h3 { margin: 0; color: var(--navy); }
.kb-card details { margin-top: 10px; }
.kb-card summary { cursor: pointer; color: var(--blue); font-weight: 800; }
.kb-card-compact .steps { margin-bottom: 0; }
.kb-filter-grid {
  display: grid;
  grid-template-columns: minmax(0, 2fr) minmax(160px, 1fr) minmax(160px, 1fr);
  gap: 12px;
  margin-top: 14px;
}
.kb-control-panel strong { font-size: 1rem; white-space: nowrap; }
.kb-suggestion-box {
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 12px;
  background: #f8fafc;
}
.kb-suggestion-box h4 { margin: 0 0 8px; color: var(--navy); }
.suggestion-row {
  padding: 10px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: white;
  margin-top: 8px;
}
.suggestion-row small { display: block; color: var(--muted); margin-top: 2px; }
.remote-session-room {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 260px;
  gap: 14px;
}
.remote-video-wrap {
  min-height: 360px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #081827;
  display: grid;
  place-items: center;
  overflow: hidden;
  color: white;
}
.remote-video-wrap video {
  width: 100%;
  height: 100%;
  min-height: 360px;
  object-fit: contain;
}
.remote-video-wrap p { padding: 16px; color: white; }
.remote-side-panel {
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 14px;
  display: grid;
  align-content: start;
  gap: 10px;
}
.tag { display: inline-flex; align-items: center; border-radius: 999px; padding: 3px 8px; background: #e6f4f3; color: #0a6d69; font-size: .76rem; font-weight: 800; white-space: nowrap; }
.steps { margin: 14px 0 0; padding-left: 21px; color: var(--ink); }
.steps li { margin: 6px 0; }
.support-section { background: #eef3f7; }
.support-form { max-width: 860px; display: grid; gap: 14px; }
.field-pair { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; }
label { display: grid; gap: 6px; font-weight: 700; color: var(--navy); }
input, select, textarea {
  width: 100%;
  border: 1px solid var(--line);
  border-radius: 8px;
  min-height: 44px;
  padding: 10px 12px;
  background: white;
  color: var(--ink);
}
textarea { resize: vertical; }
.form-note { margin: 0; color: var(--muted); font-size: .9rem; }
.portal-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.site-footer {
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  gap: 12px;
  padding: 28px clamp(18px, 5vw, 72px);
  background: var(--navy);
  color: white;
}
.site-footer span { color: rgba(255,255,255,.72); }
.login-dialog { border: 0; border-radius: 8px; padding: 0; width: min(440px, calc(100vw - 28px)); }
.login-dialog::backdrop { background: rgba(6,39,70,.55); backdrop-filter: blur(4px); }
.dialog-card { position: relative; margin: 0; padding: 26px; display: grid; gap: 13px; }
.dialog-logo { width: 170px; height: 82px; object-fit: contain; justify-self: center; }
.dialog-card h2, .dialog-card p { margin: 0; text-align: center; }
.dialog-card p { color: var(--muted); }
.close { position: absolute; right: 12px; top: 12px; }
.login-error { min-height: 20px; color: var(--red) !important; font-weight: 700; font-size: .9rem; }
.demo-creds { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
.demo-creds button { border: 1px solid var(--line); border-radius: 8px; background: var(--soft); padding: 9px; cursor: pointer; font-weight: 700; color: var(--navy); }
.portal-app {
  position: fixed;
  inset: 0;
  z-index: 50;
  background: var(--soft);
  overflow: auto;
}
.hidden { display: none !important; }
.portal-shell { display: grid; grid-template-columns: 260px 1fr; min-height: 100vh; }
.portal-sidebar {
  position: sticky;
  top: 0;
  height: 100vh;
  overflow-y: auto;
  background: #09243f;
  color: white;
  padding: 18px;
  display: flex;
  flex-direction: column;
  gap: 16px;
}
.portal-sidebar img { width: 160px; height: 86px; object-fit: contain; background: white; border-radius: 8px; padding: 4px; }
.portal-sidebar p { margin: 0; color: rgba(255,255,255,.72); }
.portal-sidebar nav { display: grid; gap: 6px; }
.portal-sidebar nav button {
  border: 0;
  border-radius: 8px;
  padding: 10px;
  text-align: left;
  background: transparent;
  color: rgba(255,255,255,.72);
  cursor: pointer;
  font-weight: 700;
}
.portal-sidebar nav button.active, .portal-sidebar nav button:hover { background: rgba(255,255,255,.12); color: white; }
.portal-main { min-width: 0; max-height: 100vh; overflow: auto; }
.portal-topbar {
  position: sticky;
  top: 0;
  z-index: 1;
  background: rgba(244,247,250,.94);
  backdrop-filter: blur(10px);
  border-bottom: 1px solid var(--line);
  padding: 18px 22px;
  display: flex;
  justify-content: space-between;
  gap: 12px;
  align-items: center;
}
.portal-topbar h2 { font-size: 1.7rem; }
#portal-content { padding: 22px; display: grid; gap: 16px; }
.stats-grid { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 12px; }
.stat-card strong { display: block; font-size: 1.7rem; color: var(--navy); }
.stat-card span { color: var(--muted); font-weight: 700; font-size: .86rem; }
.table-wrap { overflow-x: auto; padding: 0; }
table { border-collapse: collapse; width: 100%; min-width: 660px; }
th, td { padding: 12px 14px; border-bottom: 1px solid var(--line); text-align: left; vertical-align: top; }
th { background: #eef3f7; color: var(--muted); font-size: .78rem; text-transform: uppercase; letter-spacing: .05em; }
.action-cell { display: flex; flex-wrap: wrap; gap: 6px; min-width: 230px; }
.action-cell .primary, .action-cell .secondary { width: auto; }
.badge { display: inline-flex; border-radius: 999px; padding: 4px 9px; font-weight: 800; font-size: .76rem; background: #e8eef4; color: var(--muted); white-space: nowrap; }
.badge.High, .badge.Urgent, .badge.Open { background: #fee4e2; color: var(--red); }
.badge.Completed, .badge.Paid, .badge.Active { background: #dcfae6; color: var(--green); }
.badge.Progress, .badge.Partial { background: #fff1cf; color: var(--gold); }
.portal-card-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px; }
.panel-title-row { display: flex; align-items: center; justify-content: space-between; gap: 12px; }
.panel-title-row p { margin: 4px 0 0; color: var(--muted); }
.portal-search { margin-top: 14px; }
.lookup-results { display: grid; gap: 8px; margin-top: 12px; }
.lookup-row {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  align-items: center;
  padding: 12px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #f8fafc;
}
.lookup-row small { display: block; color: var(--muted); margin-top: 2px; }
.link-button {
  border: 0;
  background: transparent;
  color: var(--blue);
  padding: 0;
  cursor: pointer;
  text-align: left;
}
.client-profile-header {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 16px;
  padding: 20px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: white;
}
.client-profile-header h2 { margin: 12px 0 4px; }
.client-profile-header p { margin: 0; color: var(--muted); }
.profile-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 12px;
}
.detail-item {
  background: white;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 14px;
}
.detail-item span { display: block; color: var(--muted); font-size: .78rem; font-weight: 800; text-transform: uppercase; margin-bottom: 5px; }
.detail-item strong { display: block; color: var(--ink); font-size: .98rem; overflow-wrap: anywhere; }
.detail-item.wide { grid-column: 1 / -1; }
.profile-section { display: grid; gap: 10px; }
.profile-section > h3 { margin: 8px 0 0; }
.app-modal-overlay {
  position: fixed;
  inset: 0;
  z-index: 100;
  display: grid;
  place-items: center;
  padding: 18px;
  background: rgba(6, 39, 70, .55);
  backdrop-filter: blur(4px);
}
.app-modal {
  width: min(860px, 100%);
  max-height: min(90vh, 900px);
  overflow: auto;
  background: white;
  border-radius: 8px;
  box-shadow: var(--shadow);
  padding: 0;
}
.app-modal header, .app-modal footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 16px 18px;
  border-bottom: 1px solid var(--line);
}
.app-modal footer { border-top: 1px solid var(--line); border-bottom: 0; justify-content: flex-end; }
.app-modal h2 { font-size: 1.35rem; }
.app-modal-body { padding: 18px; }
.form-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 14px;
}
.form-grid .span-2 { grid-column: 1 / -1; }
.line-item-editor {
  display: grid;
  gap: 10px;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 12px;
  background: #f8fafc;
}
.line-item-toolbar {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 10px;
  align-items: end;
}
.line-item-grid {
  display: grid;
  grid-template-columns: 86px minmax(220px, 1fr) 110px 140px 100px 42px;
  gap: 8px;
  align-items: center;
}
.line-item-grid-head {
  color: var(--muted);
  font-size: .76rem;
  font-weight: 800;
  text-transform: uppercase;
}
.line-item-row strong {
  color: var(--navy);
  text-align: right;
}
.line-item-actions {
  display: flex;
  justify-content: flex-end;
  gap: 6px;
  align-items: center;
}
.line-item-actions .small { padding: 8px 9px; }
.table-wrap td small {
  display: block;
  color: var(--muted);
  margin-top: 3px;
}
.line-item-total {
  justify-self: end;
  color: var(--muted);
  font-weight: 800;
}
.line-item-total strong { color: var(--navy); }
.form-error { color: var(--red); margin: 0 18px; font-weight: 700; }
@media (max-width: 900px) {
  .mobile-menu { display: inline-grid; }
  .site-nav {
    position: absolute;
    right: 16px;
    top: 66px;
    width: min(320px, calc(100vw - 32px));
    display: none;
    flex-direction: column;
    align-items: stretch;
    background: white;
    border: 1px solid var(--line);
    border-radius: 8px;
    padding: 10px;
    box-shadow: var(--shadow);
  }
  .site-nav.open { display: flex; }
  .hero, .kb-layout, .portal-shell { grid-template-columns: 1fr; }
  .hero { min-height: auto; background: linear-gradient(115deg, rgba(255,255,255,.96), rgba(244,247,250,.9)); }
  .service-grid, .stats-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .portal-sidebar { position: static; height: auto; }
  .portal-main { max-height: none; overflow: visible; }
  .profile-grid { grid-template-columns: 1fr 1fr; }
}
@media (max-width: 640px) {
  .brand { min-width: 0; }
  .brand img { width: 48px; }
  .brand small { display: none; }
  .field-pair, .service-grid, .portal-grid, .stats-grid, .portal-card-grid, .metrics, .form-grid, .profile-grid, .kb-filter-grid, .remote-session-room, .line-item-toolbar, .line-item-grid { grid-template-columns: 1fr; }
  .line-item-grid-head { display: none; }
  .line-item-row {
    border: 1px solid var(--line);
    border-radius: 8px;
    padding: 10px;
    background: white;
  }
  .line-item-row strong { text-align: left; }
  .line-item-actions { justify-content: flex-start; }
  .lookup-row, .client-profile-header, .panel-title-row { flex-direction: column; align-items: stretch; }
  .hero-actions { flex-direction: column; }
  .primary, .secondary { width: 100%; }
  .site-footer { display: grid; }
}
