/* ============================================================
   Maloney Construction — Estimating Portal  v2
   ============================================================ */

*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

:root {
  --primary:      #1B3A6B;
  --primary-700:  #142C52;
  --primary-50:   #EEF3FB;
  --accent:       #2563EB;
  --accent-hover: #1D4ED8;
  --success:      #15803D;
  --success-50:   #F0FDF4;
  --success-100:  #DCFCE7;
  --error:        #DC2626;
  --error-50:     #FEF2F2;
  --warning:      #D97706;
  --warning-50:   #FFFBEB;
  --warning-100:  #FEF3C7;
  --gray-50:      #F8FAFC;
  --gray-100:     #F1F5F9;
  --gray-200:     #E2E8F0;
  --gray-300:     #CBD5E1;
  --gray-400:     #94A3B8;
  --gray-500:     #64748B;
  --gray-600:     #475569;
  --gray-700:     #334155;
  --gray-800:     #1E293B;
  --gray-900:     #0F172A;
  --white:        #FFFFFF;
  --radius-sm:    4px;
  --radius:       8px;
  --radius-lg:    12px;
  --shadow-sm:    0 1px 2px rgba(0,0,0,.06);
  --shadow:       0 1px 3px rgba(0,0,0,.1), 0 1px 2px rgba(0,0,0,.06);
  --shadow-md:    0 4px 6px rgba(0,0,0,.07), 0 2px 4px rgba(0,0,0,.05);
  --shadow-lg:    0 10px 20px rgba(0,0,0,.08), 0 4px 8px rgba(0,0,0,.04);
}

body {
  font-family: 'Inter', 'Segoe UI', Arial, sans-serif;
  font-size: 14px;
  color: var(--gray-800);
  background: var(--gray-100);
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  -webkit-font-smoothing: antialiased;
}

/* ============================================================
   NAVBAR
   ============================================================ */
.navbar {
  background: var(--white);
  height: 64px;
  padding: 0 32px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-shrink: 0;
  border-bottom: 1px solid var(--gray-200);
  box-shadow: 0 1px 4px rgba(0,0,0,.06);
  position: sticky;
  top: 0;
  z-index: 100;
}

.nav-brand {
  display: flex;
  align-items: center;
  gap: 14px;
  text-decoration: none;
}

.nav-logo-img {
  height: 38px;
  width: auto;
  display: block;
}

.nav-divider {
  width: 1px;
  height: 28px;
  background: var(--gray-200);
  margin: 0 2px;
}

.nav-module {
  font-weight: 500;
  font-size: 13px;
  color: var(--gray-500);
  letter-spacing: .1px;
}

.nav-links {
  display: flex;
  align-items: center;
  gap: 6px;
}

.nav-links a {
  color: var(--gray-600);
  text-decoration: none;
  font-size: 13px;
  font-weight: 500;
  padding: 6px 12px;
  border-radius: var(--radius-sm);
  transition: background .15s, color .15s;
}

.nav-links a:hover {
  background: var(--gray-100);
  color: var(--gray-900);
}

.nav-links .nav-btn-logout {
  background: var(--gray-100);
  color: var(--gray-700);
  border: 1px solid var(--gray-200);
}

.nav-links .nav-btn-logout:hover {
  background: var(--gray-200);
  color: var(--gray-900);
}

/* ============================================================
   MAIN LAYOUT
   ============================================================ */
.main-content {
  flex: 1;
  padding: 32px 36px;
  max-width: 1280px;
  width: 100%;
  margin: 0 auto;
}

.footer {
  text-align: center;
  padding: 14px;
  font-size: 11px;
  color: var(--gray-400);
  background: var(--white);
  border-top: 1px solid var(--gray-200);
  letter-spacing: .3px;
}

/* ============================================================
   ALERTS
   ============================================================ */
.alert {
  padding: 11px 16px;
  border-radius: var(--radius);
  margin-bottom: 18px;
  font-size: 13px;
  font-weight: 500;
  display: flex;
  align-items: center;
  gap: 8px;
}
.alert-error   { background: var(--error-50);   color: var(--error);   border: 1px solid #FECACA; }
.alert-success { background: var(--success-50); color: var(--success); border: 1px solid var(--success-100); }
.alert-info    { background: var(--primary-50); color: var(--accent);  border: 1px solid #BFDBFE; }

/* ============================================================
   CARDS
   ============================================================ */
.card {
  background: var(--white);
  border-radius: var(--radius-lg);
  border: 1px solid var(--gray-200);
  padding: 24px 28px;
  box-shadow: var(--shadow);
  margin-bottom: 18px;
}

.card-title {
  font-size: 15px;
  font-weight: 700;
  color: var(--gray-900);
  margin-bottom: 6px;
  letter-spacing: -0.2px;
}

.card-desc {
  font-size: 13px;
  color: var(--gray-500);
  margin-bottom: 18px;
  line-height: 1.55;
}

/* ============================================================
   PAGE HEADER
   ============================================================ */
.page-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  margin-bottom: 24px;
}

.page-title {
  font-size: 24px;
  font-weight: 700;
  color: var(--gray-900);
  letter-spacing: -0.5px;
}

.page-subtitle {
  font-size: 13px;
  color: var(--gray-500);
  margin-top: 3px;
}

.back-link {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  font-size: 12px;
  font-weight: 500;
  color: var(--accent);
  text-decoration: none;
  margin-bottom: 6px;
  opacity: .8;
  transition: opacity .15s;
}
.back-link:hover { opacity: 1; text-decoration: underline; }

/* ============================================================
   BUTTONS
   ============================================================ */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 7px;
  padding: 8px 18px;
  border-radius: var(--radius);
  border: 1px solid transparent;
  font-family: inherit;
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
  text-decoration: none;
  transition: all .18s ease;
  letter-spacing: .1px;
  white-space: nowrap;
}

.btn:hover    { transform: translateY(-1px); box-shadow: var(--shadow-md); }
.btn:active   { transform: translateY(0); box-shadow: none; }
.btn:disabled { opacity: .45; cursor: not-allowed; transform: none; box-shadow: none; }

.btn-primary {
  background: var(--primary);
  color: var(--white);
  border-color: var(--primary-700);
}
.btn-primary:hover { background: var(--primary-700); }

.btn-accent {
  background: var(--accent);
  color: var(--white);
  border-color: var(--accent-hover);
}
.btn-accent:hover { background: var(--accent-hover); }

.btn-secondary {
  background: var(--white);
  color: var(--gray-700);
  border-color: var(--gray-300);
}
.btn-secondary:hover { background: var(--gray-50); border-color: var(--gray-400); }

.btn-success {
  background: var(--success);
  color: var(--white);
  border-color: #126D34;
}
.btn-success:hover { background: #126D34; }

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

.btn-ghost {
  background: transparent;
  color: var(--gray-600);
  border-color: transparent;
}
.btn-ghost:hover { background: var(--gray-100); transform: none; box-shadow: none; }

.btn-sm  { padding: 5px 12px; font-size: 12px; }
.btn-lg  { padding: 11px 28px; font-size: 15px; }
.btn-xl  { padding: 14px 32px; font-size: 15px; }
.btn-block { width: 100%; }

/* ============================================================
   STATS ROW (Dashboard)
   ============================================================ */
.stats-row {
  display: grid;
  grid-template-columns: repeat(6, 1fr);
  gap: 16px;
  margin-bottom: 24px;
}

.stat-card {
  background: var(--white);
  border: 1px solid var(--gray-200);
  border-radius: var(--radius-lg);
  padding: 18px 22px;
  box-shadow: var(--shadow-sm);
}

.stat-label {
  font-size: 11px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: .6px;
  color: var(--gray-500);
  margin-bottom: 8px;
}

.stat-value {
  font-size: 28px;
  font-weight: 700;
  color: var(--gray-900);
  letter-spacing: -1px;
  line-height: 1;
}

.stat-value.stat-processing { color: var(--warning); }
.stat-value.stat-complete   { color: var(--success); }
.stat-value.stat-error      { color: var(--error); }
.stat-value.stat-review     { color: #A78BFA; }

/* ============================================================
   TABLE
   ============================================================ */
.table-wrap {
  overflow: hidden;
  border-radius: var(--radius-lg);
  border: 1px solid var(--gray-200);
  box-shadow: var(--shadow);
}

.table {
  width: 100%;
  border-collapse: collapse;
  font-size: 13px;
  background: var(--white);
}

.table thead {
  background: var(--gray-50);
  border-bottom: 1px solid var(--gray-200);
}

.table th {
  font-size: 11px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: .5px;
  color: var(--gray-500);
  padding: 11px 18px;
  text-align: left;
  white-space: nowrap;
}

.table td {
  padding: 13px 18px;
  border-bottom: 1px solid var(--gray-100);
  vertical-align: middle;
  color: var(--gray-700);
}

.table tbody tr:last-child td { border-bottom: none; }
.table tbody tr:hover td { background: var(--gray-50); }

.job-link {
  color: var(--gray-900);
  font-weight: 600;
  text-decoration: none;
  letter-spacing: -0.1px;
}
.job-link:hover { color: var(--accent); text-decoration: underline; }

.text-muted { color: var(--gray-400); font-size: 12px; }

.table-actions { display: flex; align-items: center; gap: 6px; }

/* ============================================================
   BADGES
   ============================================================ */
.badge {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 3px 10px;
  border-radius: 100px;
  font-size: 11px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: .4px;
  white-space: nowrap;
}

.badge::before {
  content: '';
  width: 6px;
  height: 6px;
  border-radius: 50%;
  flex-shrink: 0;
}

.badge-pending    { background: var(--primary-50); color: var(--accent); }
.badge-pending::before { background: var(--accent); }

.badge-processing { background: var(--warning-100); color: #92400E; }
.badge-processing::before { background: var(--warning); animation: pulse 1.4s ease-in-out infinite; }

.badge-complete   { background: var(--success-100); color: #145028; }
.badge-complete::before { background: var(--success); }

.badge-error      { background: var(--error-50); color: var(--error); }
.badge-error::before { background: var(--error); }

/* ============================================================
   EMPTY STATE
   ============================================================ */
.empty-state {
  text-align: center;
  padding: 72px 24px;
  background: var(--white);
  border-radius: var(--radius-lg);
  border: 1px solid var(--gray-200);
  box-shadow: var(--shadow);
}

.empty-icon {
  width: 64px;
  height: 64px;
  background: var(--primary-50);
  border-radius: var(--radius-lg);
  display: flex;
  align-items: center;
  justify-content: center;
  margin: 0 auto 18px;
}

.empty-title {
  font-size: 17px;
  font-weight: 700;
  color: var(--gray-800);
  margin-bottom: 8px;
  letter-spacing: -0.2px;
}

.empty-body {
  font-size: 13px;
  color: var(--gray-500);
  margin-bottom: 24px;
  line-height: 1.6;
}

/* ============================================================
   LOGIN
   ============================================================ */
.login-wrap {
  position: fixed;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  background: linear-gradient(160deg, #050812 0%, #070C1A 55%, #09101F 100%);
  overflow: hidden;
}

/* subtle grid overlay — matches hero */
.login-wrap::before {
  content: '';
  position: absolute;
  inset: 0;
  background-image:
    linear-gradient(rgba(255,255,255,.025) 1px, transparent 1px),
    linear-gradient(90deg, rgba(255,255,255,.025) 1px, transparent 1px);
  background-size: 60px 60px;
  pointer-events: none;
}

/* purple radial glow — matches hero */
.login-wrap::after {
  content: '';
  position: absolute;
  top: -10%;
  left: 50%;
  transform: translateX(-50%);
  width: 80vw;
  height: 80vw;
  background: radial-gradient(circle, rgba(124,58,237,.18) 0%, transparent 65%);
  pointer-events: none;
}

.login-card {
  background: rgba(17,17,24,.75);
  border: none;
  border-radius: 16px;
  width: 420px;
  padding: 48px 44px 52px;
  text-align: center;
  box-shadow: 0 24px 80px rgba(0,0,0,.5);
  position: relative;
  z-index: 1;
  backdrop-filter: blur(12px);
}

.login-heading {
  font-size: 1.75rem;
  font-weight: 800;
  color: #FAFAFA;
  letter-spacing: -0.8px;
  margin: 16px 0 32px;
}

.login-error {
  background: rgba(239,68,68,.1);
  border: 1px solid rgba(239,68,68,.25);
  color: #FCA5A5;
  font-size: 13px;
  border-radius: 8px;
  padding: 10px 14px;
  margin-bottom: 20px;
  text-align: left;
}

.login-form {
  text-align: left;
}

.login-field {
  margin-bottom: 20px;
}

.login-field label {
  display: block;
  font-size: 13px;
  font-weight: 600;
  color: #A1A1AA;
  margin-bottom: 8px;
}

.login-field input {
  width: 100%;
  background: #1C1C24;
  border: 1px solid rgba(255,255,255,.1);
  border-radius: 10px;
  color: #FAFAFA;
  font-family: inherit;
  font-size: 15px;
  padding: 12px 16px;
  outline: none;
  box-sizing: border-box;
  transition: border-color .15s;
}

.login-field input::placeholder { color: #52525B; }
.login-field input:focus { border-color: rgba(173,255,196,.4); }

.login-btn {
  width: 100%;
  background: #ADFFC4;
  color: #050812;
  font-family: inherit;
  font-size: 15px;
  font-weight: 700;
  border: none;
  border-radius: 10px;
  padding: 13px;
  cursor: pointer;
  margin-top: 4px;
  transition: background .15s, transform .1s, box-shadow .15s;
  box-shadow: 0 4px 20px rgba(173,255,196,.2);
}

.login-btn:hover {
  background: #86EFB0;
  transform: translateY(-1px);
  box-shadow: 0 6px 24px rgba(173,255,196,.3);
}

/* ============================================================
   FORMS
   ============================================================ */
.form-group {
  margin-bottom: 16px;
}

.form-group label {
  display: block;
  font-size: 12px;
  font-weight: 600;
  color: var(--gray-600);
  margin-bottom: 6px;
  letter-spacing: .2px;
}

.form-control {
  width: 100%;
  padding: 9px 13px;
  border: 1.5px solid var(--gray-200);
  border-radius: var(--radius);
  font-family: inherit;
  font-size: 14px;
  color: var(--gray-800);
  background: var(--white);
  outline: none;
  transition: border-color .15s, box-shadow .15s;
}

.form-control:focus {
  border-color: var(--accent);
  box-shadow: 0 0 0 3px rgba(37,99,235,.12);
}

.form-control::placeholder { color: var(--gray-400); }

/* ============================================================
   MODAL
   ============================================================ */
.modal-overlay {
  position: fixed;
  inset: 0;
  background: rgba(15,23,42,.5);
  backdrop-filter: blur(2px);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 999;
  animation: fadeIn .15s ease;
}

.modal-card {
  background: var(--white);
  border-radius: var(--radius-lg);
  padding: 32px 36px;
  width: 440px;
  box-shadow: var(--shadow-lg);
  animation: slideUp .18s ease;
}

.modal-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 22px;
}

.modal-title {
  font-size: 18px;
  font-weight: 700;
  color: var(--gray-900);
  letter-spacing: -0.3px;
}

.modal-close {
  background: none;
  border: none;
  color: var(--gray-400);
  cursor: pointer;
  font-size: 20px;
  padding: 2px;
  line-height: 1;
  transition: color .15s;
}
.modal-close:hover { color: var(--gray-700); }

.modal-actions {
  display: flex;
  gap: 10px;
  justify-content: flex-end;
  margin-top: 20px;
}

@keyframes fadeIn  { from { opacity: 0 } to { opacity: 1 } }
@keyframes slideUp { from { opacity: 0; transform: translateY(12px) } to { opacity: 1; transform: translateY(0) } }

/* ============================================================
   STEP INDICATOR
   ============================================================ */
.steps {
  display: flex;
  align-items: center;
  margin-bottom: 28px;
  gap: 0;
}

.step {
  display: flex;
  align-items: center;
  gap: 10px;
  flex: 1;
}

.step:last-child { flex: none; }

.step-circle {
  width: 32px;
  height: 32px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 13px;
  font-weight: 700;
  flex-shrink: 0;
  border: 2px solid var(--gray-300);
  color: var(--gray-400);
  background: var(--white);
  transition: all .2s;
}

.step-label {
  font-size: 12px;
  font-weight: 600;
  color: var(--gray-400);
  white-space: nowrap;
  transition: color .2s;
}

.step-connector {
  flex: 1;
  height: 2px;
  background: var(--gray-200);
  margin: 0 8px;
  min-width: 24px;
  transition: background .2s;
}

/* Active step */
.step.active .step-circle {
  background: var(--primary);
  border-color: var(--primary);
  color: var(--white);
}
.step.active .step-label { color: var(--primary); }

/* Completed step */
.step.done .step-circle {
  background: var(--success);
  border-color: var(--success);
  color: var(--white);
}
.step.done .step-label { color: var(--success); }
.step.done + .step-connector { background: var(--success); }

/* ============================================================
   JOB LAYOUT
   ============================================================ */
.job-layout {
  display: grid;
  grid-template-columns: 1fr 440px;
  gap: 18px;
  align-items: start;
}

@media (max-width: 960px) {
  .job-layout { grid-template-columns: 1fr; }
  .stats-row  { grid-template-columns: repeat(3, 1fr); }
  .main-content { padding: 20px 18px; }
}

.job-main    { display: flex; flex-direction: column; }
.job-sidebar { display: flex; flex-direction: column; }

/* ============================================================
   DROP ZONE
   ============================================================ */
.drop-zone {
  border: 2px dashed var(--gray-300);
  border-radius: var(--radius-lg);
  padding: 40px 24px;
  text-align: center;
  color: var(--gray-500);
  cursor: pointer;
  transition: all .18s;
  background: var(--gray-50);
  margin-bottom: 14px;
}

.drop-zone:hover,
.drop-zone.drag-over {
  border-color: var(--accent);
  background: #EFF6FF;
  color: var(--accent);
}

.drop-icon-wrap {
  width: 52px;
  height: 52px;
  background: var(--gray-200);
  border-radius: var(--radius-lg);
  display: flex;
  align-items: center;
  justify-content: center;
  margin: 0 auto 14px;
  transition: background .18s;
}

.drop-zone:hover .drop-icon-wrap,
.drop-zone.drag-over .drop-icon-wrap {
  background: rgba(37,99,235,.12);
}

.drop-zone p { font-size: 13px; line-height: 1.5; }
.drop-hint   { font-size: 11px; color: var(--gray-400); margin-top: 5px; }
.file-label  { color: var(--accent); cursor: pointer; font-weight: 600; text-decoration: underline; }

/* ============================================================
   FILE LIST
   ============================================================ */
.file-list { display: flex; flex-direction: column; gap: 7px; margin-bottom: 14px; }

.file-item {
  display: flex;
  align-items: center;
  gap: 10px;
  background: var(--gray-50);
  border: 1px solid var(--gray-200);
  border-radius: var(--radius);
  padding: 8px 12px;
  font-size: 12px;
  transition: border-color .15s;
}

.file-item:hover { border-color: var(--gray-300); }

.file-icon {
  width: 28px;
  height: 28px;
  background: var(--primary-50);
  border-radius: var(--radius-sm);
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

.file-name  { flex: 1; font-weight: 500; color: var(--gray-800); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.file-size  { color: var(--gray-400); white-space: nowrap; font-size: 11px; }
.file-remove {
  background: none; border: none; color: var(--gray-400);
  cursor: pointer; font-size: 16px; padding: 0 2px;
  line-height: 1; transition: color .15s;
}
.file-remove:hover { color: var(--error); }

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

/* ============================================================
   STATUS CARD
   ============================================================ */
.status-card {
  border-radius: var(--radius-lg);
  padding: 16px 20px;
  margin-top: 16px;
  border: 1px solid var(--gray-200);
  background: var(--gray-50);
}

.status-idle       { background: var(--gray-50); border-color: var(--gray-200); }
.status-processing { background: var(--warning-50); border-color: #FDE68A; }
.status-complete   { background: var(--success-50); border-color: var(--success-100); }
.status-error      { background: var(--error-50); border-color: #FECACA; }

.status-row   { display: flex; align-items: center; gap: 10px; margin-bottom: 6px; }

.status-dot {
  width: 10px; height: 10px;
  border-radius: 50%;
  background: var(--gray-400);
  flex-shrink: 0;
}

.status-processing .status-dot { background: var(--warning); animation: pulse 1.3s ease-in-out infinite; }
.status-complete   .status-dot { background: var(--success); }
.status-error      .status-dot { background: var(--error); }

.status-label   { font-weight: 700; font-size: 13px; color: var(--gray-800); }
.status-message { font-size: 12px; color: var(--gray-600); white-space: pre-wrap; word-break: break-word; line-height: 1.55; }
.status-text    { font-size: 12px; color: var(--gray-400); }

/* ============================================================
   PROGRESS BAR
   ============================================================ */
.progress-bar {
  height: 4px;
  background: rgba(0,0,0,.08);
  border-radius: 2px;
  margin-top: 12px;
  overflow: hidden;
}

.progress-fill {
  height: 100%;
  width: 35%;
  background: var(--warning);
  border-radius: 2px;
  animation: shimmer 1.8s ease-in-out infinite;
}

.status-complete .progress-fill { background: var(--success); }

@keyframes shimmer {
  0%   { width: 8%;  margin-left: 0; }
  50%  { width: 38%; margin-left: 28%; }
  100% { width: 8%;  margin-left: 90%; }
}

/* ============================================================
   DOWNLOAD BUTTONS
   ============================================================ */
.download-buttons {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
}

.btn-download {
  padding: 16px 20px;
  font-size: 14px;
  border-radius: var(--radius-lg);
  flex-direction: column;
  gap: 6px;
  height: auto;
}

.btn-download .dl-icon {
  font-size: 24px;
  line-height: 1;
}

.btn-download .dl-label {
  font-size: 13px;
  font-weight: 700;
}

.btn-download .dl-sub {
  font-size: 11px;
  font-weight: 400;
  opacity: .8;
}

/* ============================================================
   JSON EDITOR
   ============================================================ */
.json-editor {
  width: 100%;
  height: 420px;
  font-family: 'Consolas', 'JetBrains Mono', 'Courier New', monospace;
  font-size: 11.5px;
  border: 1.5px solid var(--gray-200);
  border-radius: var(--radius);
  padding: 12px;
  resize: vertical;
  outline: none;
  color: var(--gray-800);
  background: var(--gray-900);
  color: #E2E8F0;
  line-height: 1.55;
  tab-size: 2;
}

.json-editor:focus { border-color: var(--accent); box-shadow: 0 0 0 3px rgba(37,99,235,.1); }
.json-actions { display: flex; align-items: center; gap: 10px; margin-top: 12px; flex-wrap: wrap; }

/* ============================================================
   SECTION DIVIDER
   ============================================================ */
.section-divider {
  display: flex;
  align-items: center;
  gap: 12px;
  margin: 24px 0 20px;
}

.section-divider-line {
  flex: 1;
  height: 1px;
  background: var(--gray-200);
}

.section-divider-label {
  font-size: 11px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: .7px;
  color: var(--gray-400);
}

/* ============================================================
   ANIMATIONS
   ============================================================ */
@keyframes pulse {
  0%, 100% { opacity: 1; }
  50%       { opacity: .35; }
}

/* ============================================================
   UTILITIES
   ============================================================ */
.text-center { text-align: center; }
.mt-4 { margin-top: 4px; }
.mt-8 { margin-top: 8px; }

/* ============================================================
   DARK MODE — body.dark
   ============================================================ */
body.dark {
  background: #09090B;
  color: #FAFAFA;
}

/* ── App shell layout ── */
.app-shell {
  display: flex;
  min-height: 100vh;
}

/* ── Sidebar ── */
.sidebar {
  width: 228px;
  min-width: 228px;
  background: #111113;
  border-right: 1px solid rgba(255,255,255,.07);
  display: flex;
  flex-direction: column;
  position: sticky;
  top: 0;
  height: 100vh;
  overflow-y: auto;
  overflow-x: hidden;
  flex-shrink: 0;
}

.sb-brand {
  padding: 20px 16px 12px;
  border-bottom: 1px solid rgba(255,255,255,.06);
}

.sb-wordmark {
  font-size: 20px;
  font-weight: 900;
  color: #FAFAFA;
  letter-spacing: -1px;
  text-decoration: none;
}

.sb-new {
  padding: 12px 12px 4px;
}

.sb-new-btn {
  width: 100%;
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 9px 14px;
  background: #ADFFC4;
  color: #050812;
  font-family: inherit;
  font-size: 13px;
  font-weight: 700;
  border: none;
  border-radius: 8px;
  cursor: pointer;
  transition: background .15s, transform .15s, box-shadow .15s;
  letter-spacing: .1px;
  text-decoration: none;
}
.sb-new-btn:hover { background: #86EFB0; transform: translateY(-1px); box-shadow: 0 4px 12px rgba(173,255,196,.2); }

.sb-nav {
  padding: 8px 8px 4px;
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.sb-link {
  display: flex;
  align-items: center;
  gap: 9px;
  padding: 8px 10px;
  border-radius: 7px;
  font-size: 13px;
  font-weight: 500;
  color: #71717A;
  text-decoration: none;
  transition: background .12s, color .12s;
}
.sb-link:hover { background: rgba(255,255,255,.05); color: #D4D4D8; }
.sb-link.active { background: rgba(255,255,255,.08); color: #FAFAFA; }
.sb-link svg { flex-shrink: 0; opacity: .7; }
.sb-link.active svg { opacity: 1; }

.sb-section-label {
  padding: 14px 18px 4px;
  font-size: 10px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: .8px;
  color: #3F3F46;
}

.sb-recents {
  padding: 2px 8px 8px;
  display: flex;
  flex-direction: column;
  gap: 1px;
}

.sb-recent {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 6px 10px;
  border-radius: 6px;
  font-size: 12px;
  font-weight: 400;
  color: #71717A;
  text-decoration: none;
  transition: background .12s, color .12s;
  overflow: hidden;
}
.sb-recent:hover { background: rgba(255,255,255,.04); color: #A1A1AA; }
.sb-recent.active { background: rgba(255,255,255,.06); color: #D4D4D8; }

.sb-recent-dot {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  flex-shrink: 0;
}
.sb-dot-pending    { background: #3F3F46; }
.sb-dot-processing { background: #F59E0B; animation: pulse 1.4s ease-in-out infinite; }
.sb-dot-complete   { background: #86EFB0; }
.sb-dot-error      { background: #EF4444; }

.sb-recent-name {
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.sb-bottom {
  margin-top: auto;
  padding: 12px 8px 16px;
  border-top: 1px solid rgba(255,255,255,.06);
}

.sb-signout {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 8px 10px;
  border-radius: 7px;
  font-size: 13px;
  font-weight: 500;
  color: #52525B;
  text-decoration: none;
  transition: background .12s, color .12s;
}
.sb-signout:hover { background: rgba(255,255,255,.04); color: #A1A1AA; }

/* ── Main content area ── */
.app-main {
  flex: 1;
  overflow-y: auto;
  padding: 32px 40px;
  min-width: 0;
}

/* ── Dark overrides for existing components ── */
body.dark .card {
  background: #18181B;
  border-color: rgba(255,255,255,.07);
  box-shadow: none;
}

body.dark .card-title { color: #FAFAFA; }
body.dark .card-desc  { color: #71717A; }

body.dark .page-title    { color: #FAFAFA; }
body.dark .page-subtitle { color: #52525B; }
body.dark .back-link     { color: #60A5FA; }

body.dark .stat-card {
  background: #18181B;
  border-color: rgba(255,255,255,.07);
  box-shadow: none;
}
body.dark .stat-label { color: #52525B; }
body.dark .stat-value { color: #FAFAFA; }
body.dark .stat-value.stat-complete   { color: #86EFB0; }
body.dark .stat-value.stat-processing { color: #F59E0B; }
body.dark .stat-value.stat-error      { color: #EF4444; }
body.dark .stat-value.stat-review     { color: #A78BFA; }

body.dark .table-wrap { border-color: rgba(255,255,255,.07); }
body.dark .table      { background: #18181B; }
body.dark .table thead { background: #111113; border-color: rgba(255,255,255,.07); }
body.dark .table th   { color: #52525B; }
body.dark .table td   { border-color: rgba(255,255,255,.05); color: #A1A1AA; }
body.dark .table tbody tr:hover td { background: rgba(255,255,255,.03); }
body.dark .job-link   { color: #FAFAFA; }
body.dark .job-link:hover { color: #60A5FA; }
body.dark .text-muted { color: #3F3F46; }

body.dark .badge-pending    { background: rgba(96,165,250,.12); color: #60A5FA; }
body.dark .badge-processing { background: rgba(245,158,11,.12); color: #F59E0B; }
body.dark .badge-processing::before { background: #F59E0B; }
body.dark .badge-complete   { background: rgba(34,197,94,.1);  color: #86EFB0; }
body.dark .badge-complete::before { background: #86EFB0; }
body.dark .badge-error      { background: rgba(239,68,68,.12); color: #EF4444; }
body.dark .badge-error::before { background: #EF4444; }

body.dark .btn-secondary {
  background: #27272A;
  color: #A1A1AA;
  border-color: rgba(255,255,255,.1);
}
body.dark .btn-secondary:hover { background: #3F3F46; color: #FAFAFA; }

body.dark .btn-danger  { background: #7F1D1D; color: #FCA5A5; border-color: #991B1B; }
body.dark .btn-danger:hover { background: #991B1B; }

body.dark .empty-state { background: #18181B; border-color: rgba(255,255,255,.07); }
body.dark .empty-title { color: #A1A1AA; }
body.dark .empty-body  { color: #52525B; }

body.dark .form-control {
  background: #1C1C1F;
  border-color: rgba(255,255,255,.1);
  color: #FAFAFA;
}
body.dark .form-control:focus {
  border-color: rgba(96,165,250,.5);
  box-shadow: 0 0 0 3px rgba(37,99,235,.15);
}
body.dark .form-control::placeholder { color: #3F3F46; }
body.dark .form-group label { color: #71717A; }

body.dark .modal-overlay { background: rgba(0,0,0,.7); }
body.dark .modal-card { background: #18181B; border: 1px solid rgba(255,255,255,.1); }
body.dark .modal-title { color: #FAFAFA; }
body.dark .modal-close { color: #52525B; }
body.dark .modal-close:hover { color: #A1A1AA; }

body.dark .alert-error   { background: rgba(239,68,68,.1);  color: #FCA5A5; border-color: rgba(239,68,68,.2); }
body.dark .alert-success { background: rgba(34,197,94,.1);  color: #86EFAC; border-color: rgba(34,197,94,.2); }
body.dark .alert-info    { background: rgba(96,165,250,.1); color: #93C5FD; border-color: rgba(96,165,250,.2); }

body.dark .step-circle { background: #18181B; border-color: #27272A; color: #52525B; }
body.dark .step-label  { color: #52525B; }
body.dark .step-connector { background: #27272A; }
body.dark .step.active .step-circle { background: var(--accent); border-color: var(--accent); color: #fff; }
body.dark .step.active .step-label  { color: var(--accent); }
body.dark .step.done .step-circle   { background: #166534; border-color: #166534; color: #fff; }
body.dark .step.done .step-label    { color: #86EFB0; }
body.dark .step.done + .step-connector { background: #166534; }

body.dark .status-card        { background: #1C1C1F; border-color: rgba(255,255,255,.07); }
body.dark .status-idle        { background: #1C1C1F; border-color: rgba(255,255,255,.07); }
body.dark .status-processing  { background: rgba(245,158,11,.07); border-color: rgba(245,158,11,.2); }
body.dark .status-complete    { background: rgba(34,197,94,.07);  border-color: rgba(34,197,94,.2); }
body.dark .status-error       { background: rgba(239,68,68,.07);  border-color: rgba(239,68,68,.2); }
body.dark .status-label   { color: #FAFAFA; }
body.dark .status-message { color: #71717A; }
body.dark .status-text    { color: #3F3F46; }
body.dark .status-dot     { background: #3F3F46; }

body.dark .json-editor { background: #0D0D0F; border-color: rgba(255,255,255,.08); color: #D4D4D8; }
body.dark .json-editor:focus { border-color: rgba(96,165,250,.4); }

body.dark .section-divider-line  { background: rgba(255,255,255,.07); }
body.dark .section-divider-label { color: #3F3F46; }

body.dark .drop-zone {
  border-color: rgba(255,255,255,.1);
  background: #111113;
  color: #52525B;
}
body.dark .drop-zone:hover,
body.dark .drop-zone.drag-over {
  border-color: var(--accent);
  background: rgba(37,99,235,.08);
  color: #60A5FA;
}
body.dark .drop-icon-wrap { background: #27272A; }
body.dark .drop-hint { color: #3F3F46; }

body.dark .file-item { background: #1C1C1F; border-color: rgba(255,255,255,.08); }
body.dark .file-icon { background: rgba(37,99,235,.15); }
body.dark .file-name { color: #D4D4D8; }
body.dark .file-size { color: #52525B; }

body.dark .footer { background: #050812; border-color: rgba(255,255,255,.04); color: #1E293B; }
.footer { background: #050812; border-top: 1px solid rgba(255,255,255,.04); color: #374151; }

/* ============================================================
   AI INPUT BOX
   ============================================================ */
.ai-input-wrap {
  background: #1C1C1F;
  border: 1px solid rgba(255,255,255,.1);
  border-radius: 14px;
  padding: 14px 16px 12px;
  transition: border-color .2s;
  box-shadow: 0 0 0 0 rgba(37,99,235,0);
}
.ai-input-wrap:focus-within {
  border-color: rgba(96,165,250,.4);
  box-shadow: 0 0 0 3px rgba(37,99,235,.1);
}

.ai-attachments {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-bottom: 10px;
}

.ai-chip {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  background: #27272A;
  border: 1px solid rgba(255,255,255,.08);
  border-radius: 7px;
  padding: 4px 8px 4px 10px;
  font-size: 11.5px;
  font-weight: 500;
  color: #A1A1AA;
  max-width: 200px;
}
.ai-chip-name { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.ai-chip-size { color: #52525B; font-size: 10px; flex-shrink: 0; }
.ai-chip-rm {
  background: none;
  border: none;
  color: #52525B;
  cursor: pointer;
  font-size: 15px;
  line-height: 1;
  padding: 0 0 0 2px;
  transition: color .12s;
  flex-shrink: 0;
}
.ai-chip-rm:hover { color: #EF4444; }

.ai-textarea {
  width: 100%;
  background: transparent;
  border: none;
  outline: none;
  font-family: inherit;
  font-size: 14px;
  color: #D4D4D8;
  resize: none;
  line-height: 1.6;
  min-height: 72px;
  max-height: 240px;
}
.ai-textarea::placeholder { color: #3F3F46; }

.ai-footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-top: 10px;
  padding-top: 10px;
  border-top: 1px solid rgba(255,255,255,.06);
}

.ai-attach-label {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 6px 12px;
  background: transparent;
  border: 1px solid rgba(255,255,255,.1);
  border-radius: 7px;
  font-size: 12px;
  font-weight: 500;
  color: #71717A;
  cursor: pointer;
  transition: background .12s, color .12s, border-color .12s;
  user-select: none;
}
.ai-attach-label:hover { background: rgba(255,255,255,.05); color: #A1A1AA; border-color: rgba(255,255,255,.15); }
.ai-attach-label svg { flex-shrink: 0; }

.ai-run-btn {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  padding: 8px 18px;
  background: var(--accent);
  color: #fff;
  font-family: inherit;
  font-size: 13px;
  font-weight: 600;
  border: none;
  border-radius: 8px;
  cursor: pointer;
  transition: background .15s, transform .15s, box-shadow .15s;
  letter-spacing: .1px;
}
.ai-run-btn:hover:not(:disabled) {
  background: var(--accent-hover);
  transform: translateY(-1px);
  box-shadow: 0 4px 16px rgba(37,99,235,.3);
}
.ai-run-btn:disabled { opacity: .5; cursor: not-allowed; }

/* ============================================================
   PROJECTS TABLE (dark)
   ============================================================ */
body.dark .projects-table-wrap {
  background: #18181B;
  border: 1px solid rgba(255,255,255,.07);
  border-radius: 12px;
  overflow: hidden;
}

body.dark .projects-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 13px;
}

body.dark .projects-table thead {
  background: #111113;
  border-bottom: 1px solid rgba(255,255,255,.07);
}

body.dark .projects-table th {
  font-size: 10px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: .6px;
  color: #3F3F46;
  padding: 10px 16px;
  text-align: left;
  white-space: nowrap;
}

body.dark .projects-table td {
  padding: 12px 16px;
  border-bottom: 1px solid rgba(255,255,255,.04);
  vertical-align: middle;
  color: #A1A1AA;
}

body.dark .projects-table tbody tr:last-child td { border-bottom: none; }
body.dark .projects-table tbody tr:hover td { background: rgba(255,255,255,.02); }

.proj-name {
  font-weight: 600;
  color: #FAFAFA;
  text-decoration: none;
  font-size: 13px;
}
.proj-name:hover { color: #60A5FA; }

.proj-value { font-variant-numeric: tabular-nums; color: #86EFB0; font-weight: 600; }
.proj-value-empty { color: #27272A; }

/* Inline editable cell */
.editable-cell {
  position: relative;
}
.editable-cell .edit-display { cursor: pointer; }
.editable-cell .edit-display:hover { color: #D4D4D8; }
.editable-cell .edit-form { display: none; }
.editable-cell.editing .edit-display { display: none; }
.editable-cell.editing .edit-form { display: flex; gap: 4px; align-items: center; }

.edit-input {
  background: #27272A;
  border: 1px solid rgba(96,165,250,.4);
  border-radius: 5px;
  color: #FAFAFA;
  font-family: inherit;
  font-size: 12px;
  padding: 3px 7px;
  outline: none;
  width: 120px;
}
.edit-input:focus { border-color: #60A5FA; }

.edit-save-btn {
  background: var(--accent);
  color: #fff;
  border: none;
  border-radius: 5px;
  padding: 3px 8px;
  font-size: 11px;
  cursor: pointer;
}

/* ============================================================
   DARK — Download buttons
   ============================================================ */
body.dark .btn-success {
  background: #166534;
  border-color: #14532D;
  color: #86EFAC;
}
body.dark .btn-success:hover { background: #15803D; }

body.dark .btn-download {
  background: #1C1C1F;
  border-color: rgba(255,255,255,.1);
  color: #A1A1AA;
}
body.dark .btn-download:hover { background: #27272A; border-color: rgba(255,255,255,.15); color: #FAFAFA; }
body.dark #xlsxBtn { border-color: rgba(34,197,94,.25); color: #86EFAC; }
body.dark #xlsxBtn:hover { background: rgba(34,197,94,.1); }
body.dark #docxBtn { border-color: rgba(96,165,250,.25); color: #93C5FD; }
body.dark #docxBtn:hover { background: rgba(96,165,250,.1); }
body.dark .btn-download.btn-success { background: #1C1C1F; border-color: rgba(34,197,94,.4); color: #86EFAC; }
body.dark .btn-download.btn-success:hover { background: rgba(34,197,94,.08); border-color: rgba(34,197,94,.6); }
body.dark .btn-download.btn-primary { background: #1C1C1F; border-color: rgba(96,165,250,.4); color: #93C5FD; }
body.dark .btn-download.btn-primary:hover { background: rgba(96,165,250,.08); border-color: rgba(96,165,250,.6); }

/* ============================================================
   PUBLIC NAV (landing page)
   ============================================================ */
.public-nav {
  height: 64px;
  padding: 0 48px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  position: sticky;
  top: 0;
  z-index: 100;
  background: rgba(5,8,18,.92);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  border-bottom: 1px solid rgba(255,255,255,.04);
}

.nav-wordmark {
  font-size: 22px;
  font-weight: 900;
  color: #fff;
  letter-spacing: -1px;
  line-height: 1;
}

.navbar .nav-wordmark {
  font-size: 20px;
  color: var(--primary);
}

.public-nav-links {
  display: flex;
  align-items: center;
  gap: 12px;
}

.btn-nav-login {
  display: inline-flex;
  align-items: center;
  padding: 8px 20px;
  background: #ADFFC4;
  color: #050812;
  font-weight: 700;
  font-size: 13px;
  border-radius: var(--radius);
  text-decoration: none;
  transition: background .15s, transform .15s, box-shadow .15s;
  letter-spacing: .1px;
}
.btn-nav-login:hover { background: #86EFB0; transform: translateY(-1px); box-shadow: 0 4px 16px rgba(173,255,196,.3); }

.btn-nav-link {
  color: #94A3B8;
  text-decoration: none;
  font-size: 14px;
  font-weight: 500;
  transition: color .15s;
}
.btn-nav-link:hover { color: #F1F5F9; }

/* Lapsed subscription banner */
.billing-banner {
  background: #78350F;
  color: #FEF3C7;
  padding: 10px 20px;
  font-size: 13px;
  font-weight: 500;
  text-align: center;
  border-bottom: 1px solid rgba(251,191,36,0.3);
}
.billing-banner a {
  color: #FDE68A;
  font-weight: 600;
  text-decoration: underline;
  margin-left: 8px;
}
.billing-banner a:hover { color: #fff; }

/* Legal pages */
.legal-page {
  max-width: 800px;
  margin: 2rem auto;
  padding: 2rem;
  background: #fff;
  border-radius: 8px;
  box-shadow: 0 1px 3px rgba(0,0,0,0.1);
}
body.dark .legal-page {
  background: #18181B;
  box-shadow: 0 1px 3px rgba(0,0,0,0.3);
}
.legal-content { line-height: 1.6; color: #333; }
body.dark .legal-content { color: #D4D4D8; }
.legal-content h1, .legal-content h2 { margin-top: 2rem; margin-bottom: 1rem; color: #1a1a1a; }
body.dark .legal-content h1, body.dark .legal-content h2 { color: #F1F5F9; }
.legal-content h3 { margin-top: 1.5rem; margin-bottom: 0.5rem; }
.legal-content p { margin-bottom: 1rem; }
.legal-content ul, .legal-content ol { margin-bottom: 1rem; padding-left: 2rem; }
.legal-content table { border-collapse: collapse; width: 100%; margin: 1rem 0; }
.legal-content table td, .legal-content table th { border: 1px solid #ddd; padding: 0.5rem; }
body.dark .legal-content table td, body.dark .legal-content table th { border-color: rgba(255,255,255,0.1); }
.legal-content a { color: #2563EB; text-decoration: underline; }

/* Site footer */
.site-footer {
  padding: 24px 20px;
  text-align: center;
  font-size: 12px;
  color: #64748B;
  border-top: 1px solid rgba(255,255,255,0.06);
  margin-top: 3rem;
}
.footer-legal { margin-bottom: 6px; }
.footer-legal a { color: #64748B; text-decoration: none; margin: 0 4px; }
.footer-legal a:hover { text-decoration: underline; color: #94A3B8; }
.footer-legal span { color: #334155; margin: 0 2px; }
.footer-copyright { color: #475569; }

/* ============================================================
   LOGIN — Scoper wordmark
   ============================================================ */
.login-wordmark {
  font-size: 26px;
  font-weight: 900;
  color: #ADFFC4;
  letter-spacing: -1.2px;
  line-height: 1;
  display: block;
}

/* ============================================================
   LANDING — shared
   ============================================================ */
.lp-eyebrow {
  display: inline-block;
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 1.2px;
  text-transform: uppercase;
  color: #A78BFA;
  background: rgba(139,92,246,.12);
  border: 1px solid rgba(139,92,246,.25);
  padding: 4px 12px;
  border-radius: 100px;
  margin-bottom: 1.25rem;
}

.lp-eyebrow-dark {
  color: #A78BFA;
  background: rgba(139,92,246,.1);
  border-color: rgba(139,92,246,.2);
}

.lp-h1 {
  font-size: clamp(2.4rem, 5vw, 3.4rem);
  font-weight: 900;
  line-height: 1.08;
  letter-spacing: -2px;
  color: #fff;
  margin-bottom: 1.25rem;
}

.lp-accent { color: #ADFFC4; }

.lp-sub {
  font-size: 1.05rem;
  color: #94A3B8;
  line-height: 1.65;
  margin-bottom: 2rem;
  max-width: 480px;
}

.lp-h2 {
  font-size: clamp(1.9rem, 3.5vw, 2.6rem);
  font-weight: 800;
  letter-spacing: -1.5px;
  line-height: 1.12;
  color: #fff;
  margin-bottom: .75rem;
}

.lp-section-sub {
  font-size: 1rem;
  color: #4A5568;
  line-height: 1.6;
  margin-bottom: 3rem;
}

.btn-lp-primary {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 14px 32px;
  background: #ADFFC4;
  color: #050812;
  font-weight: 700;
  font-size: 15px;
  border-radius: var(--radius-lg);
  text-decoration: none;
  transition: background .15s, transform .18s, box-shadow .18s;
  box-shadow: 0 4px 24px rgba(173,255,196,.28);
  letter-spacing: .1px;
}
.btn-lp-primary:hover {
  background: #86EFB0;
  transform: translateY(-2px);
  box-shadow: 0 8px 32px rgba(173,255,196,.4);
}

/* ============================================================
   LANDING — Page wrapper (unified background + grid)
   ============================================================ */
.lp-page {
  background-color: #070C1A;
  background-image:
    linear-gradient(rgba(255,255,255,.03) 1px, transparent 1px),
    linear-gradient(90deg, rgba(255,255,255,.03) 1px, transparent 1px);
  background-size: 48px 48px;
}

/* ============================================================
   LANDING — Hero
   ============================================================ */
.lp-hero {
  background: transparent;
  padding: 80px 48px 100px;
  position: relative;
  overflow: hidden;
}

/* radial glow — purple */
.lp-hero::after {
  content: '';
  position: absolute;
  top: -120px;
  left: 30%;
  width: 700px;
  height: 700px;
  background: radial-gradient(circle, rgba(124,58,237,.18) 0%, transparent 65%);
  pointer-events: none;
}

.lp-hero-inner {
  max-width: 1200px;
  margin: 0 auto;
  display: grid;
  grid-template-columns: 1fr 1.1fr;
  gap: 64px;
  align-items: center;
  position: relative;
  z-index: 1;
}

.lp-hero-text { max-width: 520px; }

/* ── Browser mock ── */
.lp-hero-shot {
  display: flex;
  justify-content: center;
}

.browser-frame {
  width: 100%;
  max-width: 560px;
  background: #1E293B;
  border-radius: 12px;
  box-shadow:
    0 0 0 1px rgba(255,255,255,.08),
    0 24px 64px rgba(0,0,0,.6),
    0 8px 24px rgba(0,0,0,.4);
  overflow: hidden;
  transform: perspective(1000px) rotateY(-4deg) rotateX(2deg);
  transition: transform .3s ease;
}
.browser-frame:hover { transform: perspective(1000px) rotateY(-1deg) rotateX(1deg); }

.browser-top {
  background: #0F172A;
  padding: 10px 16px;
  display: flex;
  align-items: center;
  gap: 12px;
  border-bottom: 1px solid rgba(255,255,255,.06);
}

.browser-dots {
  display: flex;
  gap: 6px;
  flex-shrink: 0;
}

.browser-dots i {
  display: block;
  width: 11px;
  height: 11px;
  border-radius: 50%;
  list-style: none;
}
.browser-dots i:nth-child(1) { background: #EF4444; }
.browser-dots i:nth-child(2) { background: #EAB308; }
.browser-dots i:nth-child(3) { background: #86EFB0; }

.browser-address {
  flex: 1;
  background: #1E293B;
  border-radius: 6px;
  padding: 4px 12px;
  font-size: 11px;
  color: #64748B;
  font-family: 'Inter', monospace;
  letter-spacing: .3px;
}

.browser-body {
  padding: 16px;
  background: #111113;
}

/* sim stat cards — 6 pipeline metrics */
.sim-stats {
  display: grid;
  grid-template-columns: repeat(6, 1fr);
  gap: 6px;
  margin-bottom: 10px;
}
.sim-stat {
  background: rgba(255,255,255,0.03);
  border: 1px solid rgba(255,255,255,0.06);
  border-radius: 6px;
  padding: 8px 8px;
}
.sim-stat-lbl {
  font-size: 7px; font-weight: 700; text-transform: uppercase;
  letter-spacing: .4px; color: #64748B; margin-bottom: 4px;
}
.sim-stat-val {
  font-size: 15px; font-weight: 800; color: #F1F5F9;
  letter-spacing: -.5px; line-height: 1;
}

/* sim projects table — 5 columns */
.sim-table {
  background: rgba(255,255,255,0.02);
  border: 1px solid rgba(255,255,255,0.06);
  border-radius: 6px;
  overflow: hidden;
  font-size: 10px;
}
.sim-thead {
  display: grid;
  grid-template-columns: 2.2fr 1.2fr .9fr .8fr 1.4fr;
  padding: 6px 10px;
  background: rgba(255,255,255,0.03);
  border-bottom: 1px solid rgba(255,255,255,0.06);
  font-size: 8px; font-weight: 700; text-transform: uppercase;
  letter-spacing: .4px; color: #64748B;
}
.sim-row {
  display: grid;
  grid-template-columns: 2.2fr 1.2fr .9fr .8fr 1.4fr;
  padding: 7px 10px;
  border-bottom: 1px solid rgba(255,255,255,0.04);
  align-items: center;
}
.sim-row:last-child { border-bottom: none; }

/* Project name + date */
.sim-proj { display: flex; flex-direction: column; gap: 1px; min-width: 0; }
.sim-proj-name {
  font-weight: 600; color: #60A5FA;
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.sim-proj-date { font-size: 8px; color: #475569; }

/* Dropdown-style bid status */
.sim-dropdown {
  background: rgba(255,255,255,0.05); border: 1px solid rgba(255,255,255,0.08);
  border-radius: 4px; padding: 2px 6px; font-size: 9px; color: #CBD5E1;
  white-space: nowrap;
}
.sim-chev { font-size: 7px; color: #64748B; margin-left: 2px; }

/* Outcome indicators */
.sim-outcome { font-size: 9px; font-weight: 600; white-space: nowrap; }
.sim-outcome-won { color: #10B981; }
.sim-outcome-pending { color: #64748B; }

/* Value + client */
.sim-val { color: #E2E8F0; font-weight: 500; }
.sim-client {
  color: #64748B; white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}

/* ============================================================
   LANDING — Capabilities
   ============================================================ */
.lp-section-header {
  text-align: center;
  margin-bottom: 64px;
}

/* How It Works — three-step section */
.lp-steps { background: transparent; padding: 96px 48px; }
.lp-steps-inner { max-width: 1400px; margin: 0 auto; }
.lp-steps-grid {
  display: grid; grid-template-columns: repeat(3, 1fr); gap: 72px;
}
.lp-step { text-align: center; }
.lp-step-num {
  font-size: 1rem; font-weight: 700; letter-spacing: 1.2px;
  text-transform: uppercase; color: #F1F5F9; margin-bottom: 1.5rem;
}
.lp-step-icon { margin-bottom: 1.5rem; }
.lp-step-title {
  font-size: 1.5rem; font-weight: 700; color: #F1F5F9;
  margin-bottom: .75rem; letter-spacing: -.3px;
}
.lp-step-body {
  font-size: 1rem; color: #64748B; line-height: 1.65; margin: 0;
}
.lp-eyebrow-lg {
  font-size: 1.1rem; padding: 8px 24px; letter-spacing: 1px;
}
@media (max-width: 700px) {
  .lp-steps-grid { grid-template-columns: 1fr; gap: 56px; }
  .lp-steps { padding: 64px 24px; }
}

/* ============================================================
   LANDING — FEATURE SHOWCASE CAROUSEL
   ============================================================ */
.lp-showcase {
  background: transparent;
  padding: 80px 48px;
}
.lp-showcase-inner {
  max-width: 1100px;
  margin: 0 auto;
}

/* Section header above carousel */
.sc-section-header {
  text-align: center;
  margin-bottom: 24px;
}
.sc-section-title {
  font-size: clamp(1.9rem, 3.5vw, 2.6rem);
  font-weight: 800;
  letter-spacing: -1.5px;
  line-height: 1.12;
  color: #FFFFFF;
  margin: 0 0 8px 0;
}
.sc-section-sub {
  font-size: 14px;
  color: #6B6F82;
  margin: 0;
}

/* ── Showcase Split Layout ── */
.sc-split {
  display: flex;
  gap: 48px;
  align-items: center;
  margin-top: 48px;
}

/* Left: holographic graphic (~55%) */
.sc-graphic-wrap {
  flex: 0 0 55%;
  position: relative;
  -webkit-mask-image: radial-gradient(ellipse 82% 78% at 50% 50%, black 40%, transparent 100%);
  mask-image: radial-gradient(ellipse 82% 78% at 50% 50%, black 40%, transparent 100%);
}
.sc-graphic-perspective {
  transform: perspective(900px) rotateX(10deg) rotateY(-8deg) scale(1.02);
  transform-origin: center center;
}
.sc-viz { width: 100%; height: auto; display: block; }

.viz-grid line {
  stroke: rgba(99,102,241,0.1);
  stroke-width: 0.5;
}

/* Right: feature list (~45%) */
.sc-feature-list {
  flex: 0 0 45%;
  display: flex;
  flex-direction: column;
  gap: 6px;
}
.sc-feature-row {
  padding: 18px 0 18px 18px;
  border-left: 2px solid rgba(124,154,224,0.22);
}

.sc-feat-title    { font-size: 18px; font-weight: 500; color: #FFFFFF; margin: 0 0 4px 0; }
.sc-feat-subtitle { font-size: 13px; color: #8B8FA3; margin: 0 0 8px 0; }
.sc-feat-desc     { font-size: 13px; color: #6B6F82; line-height: 1.6; margin: 0; }

/* Responsive */
@media (max-width: 768px) {
  .sc-split { flex-direction: column; gap: 32px; }
  .sc-graphic-wrap,
  .sc-feature-list { flex: 0 0 100%; width: 100%; }
}
@media (max-width: 640px) {
  .lp-showcase { padding: 56px 16px 72px; }
}

/* ============================================================
   LANDING — CTA
   ============================================================ */
.lp-cta {
  background: transparent;
  padding: 80px 48px;
  text-align: center;
  position: relative;
  overflow: hidden;
}

.lp-cta-inner {
  position: relative;
  z-index: 1;
}

.lp-cta .lp-h2 { color: #fff; margin-bottom: .75rem; }

/* Hero dual CTAs + social proof */
.lp-hero-ctas { display: flex; gap: 14px; align-items: center; flex-wrap: wrap; }
.btn-lp-outline {
  display: inline-flex; align-items: center; padding: 12px 28px;
  border: 1.5px solid rgba(173,255,196,0.4); color: #ADFFC4;
  font-size: .95rem; font-weight: 600; border-radius: var(--radius);
  text-decoration: none; transition: border-color .15s, background .15s;
  letter-spacing: .1px;
}
.btn-lp-outline:hover { border-color: #ADFFC4; background: rgba(173,255,196,0.06); }
.lp-social-proof {
  margin-top: 1.5rem; font-size: .85rem; color: #64748B; line-height: 1.5;
  max-width: 440px;
}

/* Mid-page demo strip */
.lp-demo-strip {
  padding: 36px 48px; text-align: center;
  border-top: 1px solid rgba(255,255,255,0.04);
  border-bottom: 1px solid rgba(255,255,255,0.04);
}
.lp-demo-strip-inner {
  display: flex; align-items: center; justify-content: center;
  gap: 20px; flex-wrap: wrap;
}
.lp-demo-strip-inner p {
  color: #94A3B8; font-size: .95rem; margin: 0;
}

/* Showcase disclaimer */
.sc-disclaimer { font-size: .75rem; color: #475569; margin-top: .5rem; }

/* Founder section */
.lp-founder { padding: 80px 48px; }
.lp-founder-inner { max-width: 960px; margin: 0 auto; }
.lp-founder .lp-h2 { text-align: center; margin-bottom: 3rem; }
.lp-founder-grid {
  display: grid; grid-template-columns: 320px 1fr; gap: 48px;
  align-items: start;
}
.lp-founder-photo img {
  width: 100%; border-radius: 12px;
  border: 1px solid rgba(255,255,255,0.06);
}
.lp-founder-quote {
  margin: 0; padding: 0; border: none;
  font-size: .95rem; color: #CBD5E1; line-height: 1.75;
  font-style: italic;
}
.lp-founder-quote p { margin-bottom: 1rem; }
.lp-founder-attr { margin-top: 1.5rem; }
.lp-founder-name { font-size: .95rem; font-weight: 600; color: #F1F5F9; font-style: normal; }
.lp-founder-role { font-size: .85rem; color: #94A3B8; margin-top: 2px; }
.lp-founder-license { font-size: .8rem; color: #64748B; margin-top: 2px; }

@media (max-width: 768px) {
  .lp-founder-grid { grid-template-columns: 1fr; }
  .lp-founder-photo { max-width: 280px; margin: 0 auto; }
  .lp-founder { padding: 56px 24px; }
}

/* ============================================================
   LANDING — Responsive
   ============================================================ */
@media (max-width: 900px) {
  .lp-hero-inner {
    grid-template-columns: 1fr;
    gap: 48px;
  }
  .lp-hero-text { max-width: 100%; }
  .browser-frame { transform: none; }
  .lp-hero, .lp-steps, .lp-showcase, .lp-cta, .lp-demo-strip { padding-left: 24px; padding-right: 24px; }
  .public-nav { padding: 0 24px; }
}

@media (max-width: 540px) {
  .sim-stats { grid-template-columns: repeat(3, 1fr); }
  .sim-thead, .sim-row { grid-template-columns: 2fr 1fr; }
  .sim-thead span:nth-child(n+3),
  .sim-row span:nth-child(n+3) { display: none; }
}


/* ============================================================
   HOME PAGE — centered AI input
   ============================================================ */
.home-wrap {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  min-height: calc(100vh - 40px);
  padding: 40px 24px;
}

.home-welcome {
  text-align: center;
  margin-bottom: 28px;
}

.home-greeting {
  font-size: clamp(2rem, 4vw, 2.8rem);
  font-weight: 800;
  color: #FAFAFA;
  letter-spacing: -1.5px;
  line-height: 1.1;
  margin-bottom: 8px;
}

.home-tagline {
  font-size: 1rem;
  color: #3F3F46;
}

.home-input-outer {
  width: 100%;
  max-width: 700px;
}

/* sb-new-btn as anchor */
.sb-new-btn {
  text-decoration: none;
  display: flex;
}

/* ============================================================
   JOB PAGE — centered layout
   ============================================================ */
.job-wrap {
  display: flex;
  flex-direction: column;
  align-items: center;
  padding: 48px 24px 40px;
  min-height: calc(100vh - 40px);
}

.job-wrap-header {
  width: 100%;
  max-width: 700px;
  margin-bottom: 24px;
}

.job-progress-bar {
  height: 3px;
  background: rgba(255,255,255,.08);
  border-radius: 2px;
  overflow: hidden;
  margin-top: 10px;
}

.job-progress-fill {
  height: 100%;
  width: 40%;
  background: #F59E0B;
  border-radius: 2px;
  animation: job-slide 1.6s ease-in-out infinite;
}

@keyframes job-slide {
  0%   { transform: translateX(-100%); }
  100% { transform: translateX(350%); }
}

.job-error-msg {
  font-size: 12px;
  color: #FCA5A5;
  margin-top: 8px;
  line-height: 1.5;
}

/* ============================================================
   PROJECTS PAGE — bid status dropdown
   ============================================================ */
.bid-status-select {
  background: #1C1C1F;
  border: 1px solid rgba(255,255,255,.1);
  border-radius: 6px;
  color: #A1A1AA;
  font-family: inherit;
  font-size: 12px;
  padding: 4px 8px;
  cursor: pointer;
  outline: none;
}

.bid-status-select:focus { border-color: rgba(96,165,250,.4); }

/* ============================================================
   AUTH — switch links, hints, success message
   ============================================================ */
.auth-switch-link {
  margin-top: 16px;
  font-size: 13px;
  color: #52525B;
  text-align: center;
}
.auth-switch-link a {
  color: #ADFFC4;
  text-decoration: none;
  font-weight: 500;
}
.auth-switch-link a:hover { text-decoration: underline; }

.auth-hint {
  font-size: 13px;
  color: #71717A;
  margin-bottom: 24px;
  line-height: 1.5;
}

.login-success-msg {
  background: rgba(173,255,196,.08);
  border: 1px solid rgba(173,255,196,.25);
  color: #ADFFC4;
  border-radius: 8px;
  padding: 10px 14px;
  font-size: 13px;
  margin-bottom: 16px;
  line-height: 1.5;
  word-break: break-all;
}

/* ============================================================
   SIDEBAR — user email + admin link
   ============================================================ */
.sb-user-email {
  font-size: 11px;
  color: #3F3F46;
  padding: 0 10px 10px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.sb-admin-link {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 7px 10px;
  border-radius: 6px;
  font-size: 13px;
  font-weight: 500;
  color: #A78BFA;
  text-decoration: none;
  transition: background .12s, color .12s;
  margin-bottom: 4px;
}
.sb-admin-link:hover,
.sb-admin-link.active {
  background: rgba(167,139,250,.08);
  color: #C4B5FD;
}

/* ============================================================
   ADMIN — user management table
   ============================================================ */
.admin-users-wrap {
  overflow-x: auto;
}

.admin-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 13px;
}

.admin-table th {
  text-align: left;
  padding: 10px 14px;
  font-size: 11px;
  font-weight: 600;
  letter-spacing: .6px;
  text-transform: uppercase;
  color: #52525B;
  border-bottom: 1px solid rgba(255,255,255,.06);
}

.admin-table td {
  padding: 12px 14px;
  border-bottom: 1px solid rgba(255,255,255,.04);
  vertical-align: middle;
  color: #A1A1AA;
}

.admin-table tbody tr:hover td { background: rgba(255,255,255,.02); }
.admin-row-self td { color: #D4D4D8; }

.admin-td-email { color: #E4E4E7 !important; font-weight: 500; }
.admin-td-num   { text-align: center; }
.admin-td-date  { color: #52525B !important; font-size: 12px; }

.admin-td-actions {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
}

.admin-set-pw-form {
  display: flex;
  align-items: center;
  gap: 6px;
}

.admin-pw-input {
  background: #1C1C24;
  border: 1px solid rgba(255,255,255,.1);
  border-radius: 6px;
  color: #E4E4E7;
  font-size: 12px;
  font-family: inherit;
  padding: 5px 10px;
  width: 140px;
  outline: none;
  transition: border-color .15s;
}
.admin-pw-input:focus { border-color: rgba(173,255,196,.4); }
.admin-pw-input::placeholder { color: #3F3F46; }

.admin-btn {
  padding: 5px 12px;
  border-radius: 6px;
  font-size: 12px;
  font-weight: 600;
  font-family: inherit;
  cursor: pointer;
  border: none;
  transition: opacity .15s;
}
.admin-btn:hover { opacity: .8; }

.admin-btn-pw {
  background: rgba(173,255,196,.12);
  color: #ADFFC4;
}

.admin-btn-delete {
  background: rgba(239,68,68,.1);
  color: #FCA5A5;
}

.admin-role-badge {
  display: inline-flex;
  align-items: center;
  padding: 2px 9px;
  border-radius: 100px;
  font-size: 11px;
  font-weight: 600;
  letter-spacing: .3px;
}
.admin-role-admin {
  background: rgba(167,139,250,.15);
  color: #C4B5FD;
}
.admin-role-user {
  background: rgba(255,255,255,.06);
  color: #71717A;
}

.admin-you-badge {
  display: inline-flex;
  margin-left: 6px;
  padding: 1px 7px;
  border-radius: 100px;
  font-size: 10px;
  font-weight: 600;
  background: rgba(173,255,196,.1);
  color: #ADFFC4;
  vertical-align: middle;
}

/* ============================================================
   ERROR PAGES — 403 / 404 / 500
   ============================================================ */
.error-page {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  min-height: calc(100vh - 120px);
  text-align: center;
  padding: 48px 24px;
}

.error-code {
  font-size: clamp(5rem, 15vw, 9rem);
  font-weight: 900;
  color: rgba(255,255,255,.05);
  letter-spacing: -4px;
  line-height: 1;
  margin-bottom: 16px;
  user-select: none;
}

.error-title {
  font-size: 1.75rem;
  font-weight: 800;
  color: #FAFAFA;
  letter-spacing: -0.5px;
  margin-bottom: 12px;
}

.error-body-text {
  color: #52525B;
  font-size: 15px;
  line-height: 1.6;
  margin-bottom: 32px;
  max-width: 380px;
}

/* ── Generic form controls (used in modals) ─────────────────────────────── */
.form-label {
  display: block;
  font-size: 11px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: .5px;
  color: var(--gray-500);
  margin-bottom: 5px;
}

.form-input {
  width: 100%;
  box-sizing: border-box;
  background: var(--gray-50);
  border: 1px solid var(--gray-200);
  border-radius: 8px;
  color: var(--gray-900);
  font-family: inherit;
  font-size: 13px;
  padding: 9px 12px;
  outline: none;
  transition: border-color .15s;
}
.form-input:focus { border-color: var(--accent); }
.form-input::placeholder { color: var(--gray-400); }
select.form-input { appearance: none; 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='%2371717A' stroke-width='2'%3E%3Cpolyline points='6 9 12 15 18 9'/%3E%3C/svg%3E"); background-repeat: no-repeat; background-position: right 10px center; padding-right: 28px; }

/* ── Price Book ─────────────────────────────────────────────────────────── */
.pb-category-section  { margin-bottom: 32px; }

.pb-category-header   {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 10px;
}

.pb-category-title    {
  font-size: 12px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: .7px;
  color: var(--gray-700);
}

.pb-count-badge       {
  font-size: 11px;
  background: var(--gray-100);
  color: var(--gray-500);
  border-radius: 10px;
  padding: 1px 8px;
  font-weight: 600;
}

.pb-table-wrap        {
  border: 1px solid var(--gray-200);
  border-radius: var(--radius-lg);
  overflow: hidden;
  margin-bottom: 8px;
}

.pb-table             { width: 100%; border-collapse: collapse; font-size: 13px; background: var(--white); }

.pb-table th          {
  font-size: 10px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: .5px;
  color: var(--gray-500);
  padding: 9px 14px;
  background: var(--gray-50);
  border-bottom: 1px solid var(--gray-200);
  text-align: left;
}

.pb-table td          {
  padding: 10px 14px;
  border-bottom: 1px solid var(--gray-100);
  color: var(--gray-700);
  vertical-align: middle;
}

.pb-table tbody tr:last-child td { border-bottom: none; }
.pb-table tbody tr:hover td      { background: var(--gray-50); }

.pb-empty-row td      {
  color: var(--gray-400);
  font-style: italic;
  text-align: center;
  padding: 18px;
}

.pb-add-btn           {
  font-size: 12px;
  color: var(--accent);
  background: none;
  border: none;
  cursor: pointer;
  padding: 4px 6px;
  font-weight: 600;
  display: inline-flex;
  align-items: center;
  gap: 5px;
  transition: opacity .15s;
}
.pb-add-btn:hover     { opacity: .75; }

.pb-action-btn        {
  background: none;
  border: none;
  cursor: pointer;
  font-size: 11px;
  font-weight: 600;
  padding: 3px 7px;
  border-radius: 5px;
  transition: background .12s;
}

.pb-edit-btn          { color: var(--accent); }
.pb-edit-btn:hover    { background: rgba(37,99,235,.08); }

.pb-delete-btn        { color: #DC2626; }
.pb-delete-btn:hover  { background: rgba(220,38,38,.08); }

/* Import preview */
.pb-import-summary    { font-size: 13px; color: var(--gray-600); margin-bottom: 10px; }

.pb-preview-wrap      {
  max-height: 340px;
  overflow-y: auto;
  border: 1px solid var(--gray-200);
  border-radius: var(--radius-lg);
}

.pb-preview-table     { width: 100%; border-collapse: collapse; font-size: 12px; }

.pb-preview-table th  {
  padding: 8px 10px;
  background: var(--gray-50);
  border-bottom: 1px solid var(--gray-200);
  font-size: 10px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: .5px;
  color: var(--gray-500);
  text-align: left;
  position: sticky;
  top: 0;
}

.pb-preview-table td  {
  padding: 7px 10px;
  border-bottom: 1px solid var(--gray-100);
  color: var(--gray-700);
}

.pb-row-valid         { background: #F0FDF4; }
.pb-row-error         { background: #FEF2F2; }
.pb-error-msg         { font-size: 11px; color: #DC2626; font-weight: 500; }

/* ── Price Book Accordion ───────────────────────────────────────────────── */
.pb-accordion {
  background: var(--white);
  border: 1px solid var(--gray-200);
  border-radius: var(--radius-lg);
  overflow: hidden;
  box-shadow: var(--shadow-sm);
}

.pb-ac-item { border-bottom: 1px solid var(--gray-100); }
.pb-ac-item:last-child { border-bottom: none; }

.pb-ac-header {
  display: flex;
  align-items: center;
  gap: 11px;
  padding: 13px 18px;
  cursor: pointer;
  user-select: none;
  transition: background .12s;
}
.pb-ac-header:hover { background: var(--gray-50); }

.pb-ac-arrow {
  color: var(--gray-400);
  flex-shrink: 0;
  transition: transform .22s ease;
  transform: rotate(0deg);
}
.pb-ac-open .pb-ac-arrow { transform: rotate(90deg); }

.pb-ac-title {
  font-size: 13px;
  font-weight: 600;
  color: var(--gray-800);
  flex: 1;
}

.pb-ac-badge {
  font-size: 11px;
  font-weight: 700;
  background: #DCFCE7;
  color: #15803D;
  border-radius: 10px;
  padding: 2px 9px;
  min-width: 18px;
  text-align: center;
  line-height: 1.6;
}

.pb-ac-add {
  display: flex;
  align-items: center;
  gap: 5px;
  padding: 5px 11px;
  background: none;
  border: 1px solid var(--accent);
  border-radius: 6px;
  color: var(--accent);
  font-size: 11px;
  font-weight: 600;
  cursor: pointer;
  transition: background .12s, color .12s;
}
.pb-ac-add:hover { background: var(--accent); color: #fff; }

/* Smooth collapse via grid-template-rows */
.pb-ac-body {
  display: grid;
  grid-template-rows: 0fr;
  transition: grid-template-rows .22s ease;
}
.pb-ac-open .pb-ac-body { grid-template-rows: 1fr; }
.pb-ac-inner { overflow: hidden; }

.pb-ac-table { width: 100%; border-collapse: collapse; }
.pb-ac-table thead tr {
  border-top: 1px solid var(--gray-100);
  background: var(--gray-50);
}
.pb-ac-table th {
  font-size: 10px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: .5px;
  color: var(--gray-400);
  padding: 7px 18px;
  text-align: left;
}
.pb-ac-table td {
  padding: 10px 18px;
  font-size: 13px;
  color: var(--gray-700);
  border-bottom: 1px solid var(--gray-100);
  vertical-align: middle;
}
.pb-ac-table tbody tr:last-child td { border-bottom: none; }
.pb-ac-table tbody tr:hover td      { background: var(--gray-50); }
.pb-notes-cell { color: var(--gray-400); }

/* ── Insights ──────────────────────────────────────────────────────────── */
.insights-empty {
  display: flex; flex-direction: column; align-items: center;
  justify-content: center; padding: 80px 24px; text-align: center; gap: 14px;
}
.insights-empty svg     { color: #3F3F46; }
.insights-empty h2      { font-size: 20px; font-weight: 700; color: #FAFAFA; margin: 0; }
.insights-empty p       { font-size: 14px; color: #71717A; max-width: 360px; margin: 0; }

.insights-section-label {
  font-size: 13px; font-weight: 500; text-transform: uppercase;
  letter-spacing: .5px; color: #8B8FA3; margin-bottom: 14px;
}

.insights-chart-card {
  background: #16161E;
  border: 0.5px solid rgba(255,255,255,.06);
  border-radius: 10px;
  padding: 22px 24px;
}
.insights-chart-title {
  font-size: 13px; font-weight: 600; color: #D0D2DB; margin-bottom: 18px;
}

.insights-li-table {
  width: 100%; border-collapse: collapse; font-size: 13px;
}
.insights-li-table thead {
  border-bottom: 1px solid rgba(255,255,255,.07);
}
.insights-li-table th {
  font-size: 10px; font-weight: 700; text-transform: uppercase;
  letter-spacing: .6px; color: #3F3F46; padding: 0 0 10px 0; text-align: left;
}
.insights-li-table td {
  padding: 10px 0;
  border-bottom: 1px solid rgba(255,255,255,.04);
  color: #A1A1AA;
}
.insights-li-table tbody tr:last-child td { border-bottom: none; }
.insights-li-table td:first-child         { color: #FAFAFA; }

.insights-locked-card {
  background: #16161E;
  border: 0.5px solid rgba(255,255,255,.06);
  border-radius: 10px;
  padding: 56px 24px;
  display: flex; align-items: center; justify-content: center;
}
.insights-locked-content {
  display: flex; flex-direction: column; align-items: center;
  gap: 10px; text-align: center; max-width: 380px;
}
.insights-locked-content svg  { color: #4A4D5E; margin-bottom: 4px; }
.insights-locked-title        { font-size: 16px; font-weight: 600; color: #D0D2DB; }
.insights-locked-desc         { font-size: 13px; color: #6B6F82; line-height: 1.6; }
.insights-locked-badge {
  display: inline-block; margin-top: 6px;
  background: rgba(124,154,224,.1); color: #7C9AE0;
  border: 0.5px solid rgba(124,154,224,.25);
  border-radius: 20px; padding: 4px 14px;
  font-size: 11px; font-weight: 500; letter-spacing: .4px;
}

/* ── Bid Outcome Buttons ──────────────────────────────────────────── */
.bid-outcome-group {
  display: inline-flex;
  gap: 4px;
}
.bid-outcome-btn {
  font-size: 11px;
  font-weight: 600;
  padding: 3px 9px;
  border-radius: 4px;
  border: 1px solid transparent;
  cursor: pointer;
  background: rgba(255,255,255,.05);
  color: #52525B;
  transition: all .12s;
  white-space: nowrap;
}
.bid-outcome-btn:hover { color: #A1A1AA; background: rgba(255,255,255,.09); }
.bid-outcome-btn.boi-pending.active {
  background: #27272A;
  color: #A1A1AA;
  border-color: rgba(255,255,255,.15);
}
.bid-outcome-btn.boi-won.active {
  background: rgba(134,239,176,.12);
  color: #86EFB0;
  border-color: rgba(134,239,176,.3);
}
.bid-outcome-btn.boi-lost.active {
  background: rgba(239,68,68,.1);
  color: #F87171;
  border-color: rgba(239,68,68,.3);
}

/* ── Insights v2 ──────────────────────────────────────────────────── */
.insights-charts-row {
  display: flex;
  gap: 16px;
  margin-bottom: 20px;
  flex-wrap: wrap;
}
.insights-charts-row .insights-chart-card {
  margin-bottom: 0;
}

.insights-finding-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
  gap: 12px;
  margin: 0 0 4px 0;
}
.insights-finding-card {
  background: #111118;
  border: 0.5px solid rgba(255,255,255,.05);
  border-radius: 8px;
  padding: 16px 18px;
}
.insights-finding-title {
  font-size: 11px;
  font-weight: 700;
  color: #7C9AE0;
  margin-bottom: 6px;
  text-transform: uppercase;
  letter-spacing: .3px;
}
.insights-finding-text {
  font-size: 13px;
  color: #8B8FA3;
  line-height: 1.6;
}

.insights-rec-list {
  margin: 0;
  padding: 0;
  list-style: none;
}
.insights-rec-list li {
  font-size: 13px;
  color: #D0D2DB;
  padding: 8px 0;
  border-bottom: 1px solid rgba(255,255,255,.04);
  display: flex;
  gap: 10px;
}
.insights-rec-list li:last-child { border-bottom: none; }
.insights-rec-list li::before {
  content: "→";
  color: #7C9AE0;
  flex-shrink: 0;
}

.analysis-footer {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-top: 18px;
  padding-top: 14px;
  border-top: 1px solid rgba(255,255,255,.04);
  font-size: 12px;
  color: #4A4D5E;
  flex-wrap: wrap;
}

/* Outlier table */
.insights-outlier-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 13px;
}
.insights-outlier-table th {
  font-size: 11px;
  font-weight: 600;
  color: #4A4D5E;
  text-transform: uppercase;
  letter-spacing: .4px;
  padding: 0 0 10px 0;
  border-bottom: 1px solid rgba(255,255,255,.05);
}
.insights-outlier-table td {
  padding: 9px 0;
  border-bottom: 1px solid rgba(255,255,255,.04);
  color: #6B6F82;
}
.insights-outlier-table td:first-child { color: #D0D2DB; }
.insights-outlier-table tbody tr:last-child td { border-bottom: none; }
.outlier-above  { color: #C4868A; font-weight: 500; }
.outlier-below  { color: #85A8A0; font-weight: 500; }
.outlier-neutral { color: #6B6F82; }

/* Scope gap cards */
.scope-gap-card {
  background: #111118;
  border: none;
  border-left: 2px solid #5A7BA8;
  border-radius: 0;
  padding: 12px 16px;
  margin-bottom: 10px;
}
.scope-gap-card:last-child { margin-bottom: 0; }
.scope-gap-title { font-size: 13px; font-weight: 500; color: #D0D2DB; }
.scope-gap-pct   { font-size: 12px; color: #5A7BA8; margin-top: 4px; }

/* Competitive edge cards */
.edge-card {
  background: rgba(122,155,130,.08);
  border: none;
  border-left: 2px solid #7A9B82;
  border-radius: 0;
  padding: 12px 16px;
  margin-bottom: 10px;
}
.edge-card:last-child { margin-bottom: 0; }

/* Data sufficiency banner */
.data-banner {
  font-size: 12px;
  color: #4A4D5E;
  padding: 12px 16px;
  border: 0.5px solid rgba(255,255,255,.05);
  border-radius: 6px;
  margin-bottom: 14px;
  background: #16161E;
}

/* Insights-scoped stat row: 4 cards full width */
.insights-stats {
  grid-template-columns: repeat(4, 1fr);
}

/* Insights-scoped stat cards */
.insights-stats .stat-card {
  background: #16161E;
  border: 0.5px solid rgba(255,255,255,.06);
  border-radius: 10px;
}
.insights-stats .stat-label {
  color: #6B6F82;
  font-size: 12px;
}
.insights-stats .stat-value {
  color: #E2E4EB;
  font-size: 28px;
  font-weight: 500;
}

/* Refresh Analysis button */
.btn-refresh-analysis {
  background: rgba(255,255,255,.04);
  border: 0.5px solid rgba(255,255,255,.08);
  color: #6B6F82;
  border-radius: 6px;
  font-size: 12px;
  padding: 5px 12px;
  cursor: pointer;
  transition: all .12s;
}
.btn-refresh-analysis:hover {
  background: rgba(255,255,255,.07);
  color: #8B8FA3;
}

/* ==========================================================================
   In-App Estimate Editor
   ========================================================================== */

.editor-topbar {
  display: flex;
  align-items: center;
  gap: 16px;
  margin-bottom: 20px;
  padding-bottom: 16px;
  border-bottom: 1px solid var(--border);
}
.editor-back {
  font-size: 13px;
  color: var(--text-muted);
  text-decoration: none;
  white-space: nowrap;
}
.editor-back:hover { color: var(--text-primary); }
.editor-job-name {
  flex: 1;
  font-size: 15px;
  font-weight: 600;
  color: var(--text-primary);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.editor-finalize-btn { white-space: nowrap; }

.editor-summary-card,
.editor-sections-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 20px 24px;
  margin-bottom: 16px;
}

.editor-section-label {
  font-size: 11px;
  font-weight: 600;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: .6px;
  margin-bottom: 14px;
}

/* Bid summary table */
.bid-summary-table { width: 100%; border-collapse: collapse; font-size: 13px; }
.bid-summary-total-row {
  font-weight: 700;
  font-size: 14px;
  border-top: 2px solid var(--border);
  color: var(--text-primary);
}
.bid-summary-amount { text-align: right; font-variant-numeric: tabular-nums; }

/* Takeoff sections */
.editor-section {
  margin-bottom: 20px;
  border: 1px solid var(--border);
  border-radius: 8px;
  overflow: hidden;
}
.editor-section-hdr {
  display: flex;
  align-items: center;
  gap: 12px;
  background: var(--surface-2);
  padding: 10px 14px;
}
.editor-section-title {
  flex: 1;
  font-size: 13px;
  font-weight: 600;
  color: var(--text-primary);
}
.editor-section-subtotal {
  font-size: 13px;
  font-weight: 600;
  font-variant-numeric: tabular-nums;
  color: var(--text-primary);
}
.editor-save-badge {
  font-size: 11px;
  min-width: 60px;
  text-align: right;
  color: var(--text-muted);
}
.editor-save-badge.saving { color: #FBBF24; }
.editor-save-badge.saved  { color: #34D399; }
.editor-save-badge.error  { color: #F87171; }

/* Editor spreadsheet table */
.editor-table { width: 100%; border-collapse: collapse; font-size: 13px; }
.editor-th {
  font-size: 11px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: .5px;
  color: var(--text-muted);
  padding: 7px 10px;
  background: var(--surface-2);
  border-bottom: 1px solid var(--border);
  text-align: left;
}
.editor-td {
  padding: 5px 7px;
  border-bottom: 1px solid rgba(255,255,255,.04);
  vertical-align: middle;
}
.editor-row-total {
  text-align: right;
  font-variant-numeric: tabular-nums;
  color: var(--text-secondary);
}

/* Inline editable cells */
.editor-input {
  background: transparent;
  border: 1px solid transparent;
  border-radius: 5px;
  color: var(--text-primary);
  font-size: 13px;
  font-family: inherit;
  padding: 4px 7px;
  width: 100%;
  box-sizing: border-box;
}
.editor-input:hover { border-color: rgba(96,165,250,.3); }
.editor-input:focus {
  border-color: #60A5FA;
  background: rgba(96,165,250,.07);
  outline: none;
}

.editor-delete-btn {
  color: var(--text-muted);
  background: none;
  border: none;
  cursor: pointer;
  padding: 0 6px;
  font-size: 16px;
  line-height: 1;
}
.editor-delete-btn:hover { color: #F87171; }
.editor-add-btn {
  font-size: 12px;
  color: var(--accent);
  background: none;
  border: none;
  cursor: pointer;
  padding: 8px 14px;
  display: block;
}
.editor-add-btn:hover { color: #93C5FD; }

/* Assumption tooltip */
.assumption-tooltip {
  position: fixed;
  z-index: 9999;
  background: #111118;
  border: 0.5px solid rgba(255,255,255,.08);
  border-radius: 8px;
  padding: 12px 16px;
  max-width: 320px;
  pointer-events: none;
  box-shadow: 0 8px 24px rgba(0,0,0,.5);
}
.tip-row { margin-bottom: 8px; }
.tip-row:last-child { margin-bottom: 0; }
.tip-assumption {
  font-size: 12px;
  color: #8B8FA3;
  line-height: 1.45;
}
.tip-source {
  font-size: 11px;
  color: #5A7BA8;
  margin-top: 2px;
}
