/* =============================================================
   AcreBridge App UI
   Extends theme.css. All tokens (--bg, --accent, etc.) inherited.
   ============================================================= */

/* ---- LANDING: CTA button ---- */
.hero-cta-row {
  margin-bottom: 40px;
}

.hero-btn-primary {
  display: inline-block;
  background: var(--accent);
  color: #0d0f0e;
  font-family: var(--font-display);
  font-weight: 700;
  font-size: 1rem;
  padding: 14px 32px;
  border-radius: 3px;
  text-decoration: none;
  letter-spacing: 0.3px;
  transition: background 0.15s;
}
.hero-btn-primary:hover { background: var(--accent-light); }

/* ---- APP BODY ---- */
.app-body {
  background: var(--bg);
  min-height: 100vh;
}

/* ---- NAV ---- */
.app-nav {
  position: sticky;
  top: 0;
  z-index: 100;
  background: var(--bg);
  border-bottom: 1px solid var(--border);
  padding: 0 40px;
}

.app-nav-inner {
  max-width: 1200px;
  margin: 0 auto;
  display: flex;
  align-items: center;
  gap: 32px;
  height: 60px;
}

.nav-brand {
  font-family: var(--font-display);
  font-size: 1.1rem;
  font-weight: 700;
  color: var(--fg);
  text-decoration: none;
  letter-spacing: 0.3px;
  flex-shrink: 0;
}

.nav-links {
  display: flex;
  gap: 4px;
  flex: 1;
}

.nav-link {
  font-family: var(--font-display);
  font-size: 0.88rem;
  font-weight: 500;
  color: var(--fg-muted);
  text-decoration: none;
  padding: 6px 14px;
  border-radius: 3px;
  transition: color 0.1s, background 0.1s;
}
.nav-link:hover { color: var(--fg); background: var(--surface); }
.nav-link.active { color: var(--accent); }

.nav-cta {
  margin-left: auto;
  flex-shrink: 0;
}

/* ---- MAIN CONTAINER ---- */
.app-main {
  max-width: 1200px;
  margin: 0 auto;
  padding: 40px 40px 80px;
}

/* ---- BUTTONS ---- */
.btn-primary {
  display: inline-block;
  background: var(--accent);
  color: #0d0f0e;
  font-family: var(--font-display);
  font-weight: 700;
  font-size: 0.88rem;
  padding: 9px 20px;
  border-radius: 3px;
  text-decoration: none;
  border: none;
  cursor: pointer;
  letter-spacing: 0.3px;
  transition: background 0.15s;
}
.btn-primary:hover { background: var(--accent-light); }

.btn-ghost {
  display: inline-block;
  background: transparent;
  color: var(--fg-muted);
  font-family: var(--font-display);
  font-weight: 500;
  font-size: 0.88rem;
  padding: 8px 16px;
  border-radius: 3px;
  text-decoration: none;
  border: 1px solid var(--border);
  cursor: pointer;
  transition: color 0.1s, border-color 0.1s;
}
.btn-ghost:hover { color: var(--fg); border-color: var(--fg-muted); }

.btn-danger {
  display: inline-block;
  background: transparent;
  color: #d95c5c;
  font-family: var(--font-display);
  font-weight: 600;
  font-size: 0.88rem;
  padding: 8px 16px;
  border-radius: 3px;
  border: 1px solid rgba(217,92,92,0.4);
  cursor: pointer;
  transition: background 0.1s;
}
.btn-danger:hover { background: rgba(217,92,92,0.1); }

.btn-advance {
  background: var(--green);
  color: var(--fg);
  font-family: var(--font-display);
  font-weight: 600;
  font-size: 0.88rem;
  padding: 8px 18px;
  border-radius: 3px;
  border: none;
  cursor: pointer;
  transition: background 0.15s;
}
.btn-advance:hover { background: var(--green-light); }

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

.page-badge {
  font-family: var(--font-display);
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 2px;
  text-transform: uppercase;
  color: var(--accent);
  margin-bottom: 6px;
}

.page-title {
  font-family: var(--font-display);
  font-size: clamp(1.6rem, 3vw, 2.2rem);
  font-weight: 700;
  color: var(--fg);
  line-height: 1.15;
}

.page-subtitle {
  font-size: 0.95rem;
  color: var(--fg-muted);
  margin-top: 4px;
}

.header-actions {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-shrink: 0;
}

/* ---- ACTION STRIP ---- */
.action-strip {
  background: var(--surface);
  border: 1px solid var(--border);
  border-left: 3px solid var(--green);
  border-radius: 0 4px 4px 0;
  padding: 12px 20px;
  display: flex;
  align-items: center;
  gap: 16px;
  margin-bottom: 28px;
}

.action-strip-label {
  font-size: 0.85rem;
  color: var(--fg-muted);
}

/* ---- STATUS BADGES ---- */
.status-badge {
  display: inline-block;
  font-family: var(--font-display);
  font-size: 0.75rem;
  font-weight: 600;
  letter-spacing: 0.5px;
  padding: 3px 10px;
  border-radius: 2px;
  text-transform: uppercase;
  white-space: nowrap;
}

.status-badge--lg {
  font-size: 0.82rem;
  padding: 5px 14px;
}

.status-lead { background: rgba(154,149,144,0.15); color: var(--fg-muted); }
.status-contract { background: rgba(200,169,110,0.15); color: var(--accent); }
.status-matched { background: rgba(94,154,112,0.2); color: var(--green-light); }
.status-closed { background: rgba(74,124,89,0.3); color: #7ecf96; }

/* ---- PIPELINE STATS (dashboard) ---- */
.pipeline-stats {
  display: flex;
  align-items: center;
  gap: 0;
  margin-bottom: 24px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 4px;
  overflow: hidden;
}

.pstat-card {
  flex: 1;
  text-align: center;
  padding: 28px 16px;
  border-right: 1px solid var(--border);
}
.pstat-card:last-child { border-right: none; }
.pstat-card--accent { background: rgba(74,124,89,0.08); }

.pstat-num {
  font-family: var(--font-display);
  font-size: 2.4rem;
  font-weight: 700;
  color: var(--accent);
  line-height: 1;
  margin-bottom: 6px;
}

.pstat-label {
  font-size: 0.78rem;
  color: var(--fg-muted);
  text-transform: uppercase;
  letter-spacing: 1px;
}

.pstat-arrow {
  padding: 0 12px;
  color: var(--accent-dark);
  font-size: 1.2rem;
  flex-shrink: 0;
}

/* ---- SUMMARY STRIP ---- */
.summary-strip {
  display: flex;
  align-items: center;
  gap: 0;
  background: var(--bg-alt);
  border: 1px solid var(--border);
  border-radius: 4px;
  margin-bottom: 32px;
}

.summary-item {
  flex: 1;
  text-align: center;
  padding: 20px 16px;
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.summary-val {
  font-family: var(--font-display);
  font-size: 1.4rem;
  font-weight: 700;
  color: var(--fg);
}

.summary-key {
  font-size: 0.78rem;
  color: var(--fg-muted);
  text-transform: uppercase;
  letter-spacing: 0.8px;
}

.summary-divider {
  width: 1px;
  height: 48px;
  background: var(--border);
  flex-shrink: 0;
}

/* ---- SECTION CARD ---- */
.section-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 4px;
  overflow: hidden;
}

.section-card-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 20px 24px 16px;
  border-bottom: 1px solid var(--border);
}

.section-title {
  font-family: var(--font-display);
  font-size: 1rem;
  font-weight: 600;
  color: var(--fg);
}

.link-subtle {
  color: var(--fg-muted);
  text-decoration: none;
  font-size: 0.88rem;
  transition: color 0.1s;
}
.link-subtle:hover { color: var(--accent); }

.link-accent {
  color: var(--accent);
  text-decoration: none;
}
.link-accent:hover { color: var(--accent-light); }

/* ---- DATA TABLE ---- */
.data-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.9rem;
}

.data-table th {
  font-family: var(--font-display);
  font-size: 0.75rem;
  font-weight: 600;
  letter-spacing: 1px;
  text-transform: uppercase;
  color: var(--fg-muted);
  padding: 12px 24px;
  text-align: left;
  border-bottom: 1px solid var(--border);
}

.data-table td {
  padding: 14px 24px;
  border-bottom: 1px solid rgba(42,46,44,0.6);
  color: var(--fg);
  vertical-align: middle;
}

.data-table tr:last-child td { border-bottom: none; }
.data-table tr:hover td { background: rgba(255,255,255,0.02); }

.td-primary { color: var(--fg); font-weight: 500; }
.td-primary a { color: inherit; text-decoration: none; }
.td-primary a:hover { color: var(--accent); }
.td-sub { font-size: 0.8rem; color: var(--fg-muted); margin-top: 2px; }
.td-accent { color: var(--accent); font-weight: 600; }

/* ---- FILTER TABS ---- */
.filter-tabs {
  display: flex;
  gap: 4px;
  margin-bottom: 16px;
}

.filter-tab {
  font-family: var(--font-display);
  font-size: 0.82rem;
  font-weight: 500;
  color: var(--fg-muted);
  text-decoration: none;
  padding: 6px 14px;
  border-radius: 3px;
  border: 1px solid transparent;
  transition: all 0.1s;
}
.filter-tab:hover { color: var(--fg); background: var(--surface); }
.filter-tab.active { color: var(--accent); border-color: var(--accent-dark); background: rgba(200,169,110,0.06); }

/* ---- EMPTY STATE ---- */
.empty-state {
  padding: 64px 24px;
  text-align: center;
  color: var(--fg-muted);
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 12px;
}

.empty-icon { font-size: 2.5rem; }
.empty-state p { font-size: 0.95rem; }

.empty-inline {
  color: var(--fg-muted);
  font-size: 0.9rem;
  padding: 4px 0;
}

/* ---- DETAIL LAYOUT ---- */
.detail-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 20px;
  align-items: start;
}

.detail-col {
  display: flex;
  flex-direction: column;
  gap: 20px;
}

.detail-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 4px;
  padding: 24px;
}

.detail-card--accent {
  border-left: 3px solid var(--accent-dark);
}

.detail-card-title {
  font-family: var(--font-display);
  font-size: 0.78rem;
  font-weight: 600;
  letter-spacing: 1.5px;
  text-transform: uppercase;
  color: var(--fg-muted);
  margin-bottom: 16px;
}

.detail-rows { display: flex; flex-direction: column; gap: 10px; }

.detail-row {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  gap: 16px;
  padding-bottom: 10px;
  border-bottom: 1px solid rgba(42,46,44,0.5);
}
.detail-row:last-child { border-bottom: none; padding-bottom: 0; }

.dr-key {
  font-size: 0.82rem;
  color: var(--fg-muted);
  flex-shrink: 0;
}

.dr-val {
  font-size: 0.9rem;
  color: var(--fg);
  text-align: right;
}

.detail-notes {
  font-size: 0.9rem;
  color: var(--fg-muted);
  line-height: 1.65;
  white-space: pre-wrap;
}

/* ---- PRICING DISPLAY ---- */
.price-display {
  display: flex;
  align-items: center;
  gap: 16px;
  flex-wrap: wrap;
}

.price-item {
  flex: 1;
  text-align: center;
  min-width: 80px;
}

.price-val {
  font-family: var(--font-display);
  font-size: 1.4rem;
  font-weight: 700;
  color: var(--fg);
  margin-bottom: 4px;
}

.price-val--accent { color: var(--accent); }
.price-key { font-size: 0.75rem; color: var(--fg-muted); text-transform: uppercase; letter-spacing: 0.8px; }
.price-arrow { color: var(--accent-dark); font-size: 1.1rem; flex-shrink: 0; }
.price-item--highlight { background: rgba(200,169,110,0.06); border-radius: 4px; padding: 8px; }

/* ---- PIPELINE STEP INDICATOR ---- */
.pipeline-steps {
  display: flex;
  align-items: center;
  gap: 0;
}

.pipeline-step-item {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 6px;
}

.step-dot {
  width: 12px;
  height: 12px;
  border-radius: 50%;
  border: 2px solid var(--border);
}

.step-done .step-dot { background: var(--accent); border-color: var(--accent); }
.step-pending .step-dot { background: transparent; border-color: var(--border); }

.step-name {
  font-size: 0.72rem;
  color: var(--fg-muted);
  text-align: center;
  max-width: 70px;
  line-height: 1.3;
}

.step-done .step-name { color: var(--accent); }

.step-connector {
  flex: 1;
  height: 2px;
  margin-bottom: 18px;
}

.connector-done { background: var(--accent); }
.connector-pending { background: var(--border); }

/* ---- BUYER GRID ---- */
.buyer-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
  gap: 16px;
  padding: 24px;
}

.buyer-card {
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: 4px;
  padding: 20px;
  text-decoration: none;
  display: flex;
  flex-direction: column;
  gap: 12px;
  transition: border-color 0.15s, background 0.1s;
}
.buyer-card:hover { border-color: var(--accent-dark); background: var(--bg-alt); }

.buyer-card-top {
  display: flex;
  align-items: center;
  gap: 12px;
}

.buyer-avatar {
  width: 40px;
  height: 40px;
  border-radius: 50%;
  background: var(--accent-dark);
  color: var(--fg);
  font-family: var(--font-display);
  font-weight: 700;
  font-size: 1.1rem;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

.buyer-name {
  font-family: var(--font-display);
  font-weight: 600;
  font-size: 0.95rem;
  color: var(--fg);
}

.buyer-company {
  font-size: 0.8rem;
  color: var(--fg-muted);
  margin-top: 1px;
}

.buyer-deal-count {
  margin-left: auto;
  font-size: 0.75rem;
  color: var(--accent);
  background: rgba(200,169,110,0.1);
  border-radius: 2px;
  padding: 2px 8px;
  white-space: nowrap;
}

.buyer-criteria {
  font-size: 0.84rem;
  color: var(--fg-muted);
  line-height: 1.55;
}

.buyer-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}

.buyer-tag {
  font-size: 0.75rem;
  background: var(--surface);
  color: var(--fg-muted);
  border: 1px solid var(--border);
  border-radius: 2px;
  padding: 2px 8px;
}

/* ---- FORM ---- */
.form-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 4px;
  overflow: hidden;
}

.form-section {
  padding: 28px 32px;
  border-bottom: 1px solid var(--border);
}
.form-section:last-of-type { border-bottom: none; }

.form-section-title {
  font-family: var(--font-display);
  font-size: 0.78rem;
  font-weight: 600;
  letter-spacing: 1.5px;
  text-transform: uppercase;
  color: var(--fg-muted);
  margin-bottom: 20px;
}

.form-row {
  display: flex;
  gap: 16px;
  flex-wrap: wrap;
}

.form-group {
  display: flex;
  flex-direction: column;
  gap: 6px;
  flex: 1;
  min-width: 160px;
}

.form-group--wide { flex: 2; }
.form-group--sm { flex: 0 0 100px; min-width: 80px; }

.form-label {
  font-family: var(--font-display);
  font-size: 0.78rem;
  font-weight: 600;
  color: var(--fg-muted);
  letter-spacing: 0.5px;
}

.form-input {
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: 3px;
  color: var(--fg);
  font-family: var(--font-body);
  font-size: 0.9rem;
  padding: 9px 12px;
  transition: border-color 0.15s;
  width: 100%;
}
.form-input:focus {
  outline: none;
  border-color: var(--accent-dark);
  box-shadow: 0 0 0 2px rgba(200,169,110,0.08);
}
.form-input::placeholder { color: rgba(154,149,144,0.5); }

.form-select { cursor: pointer; }

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

.form-actions {
  padding: 24px 32px;
  display: flex;
  align-items: center;
  gap: 12px;
  background: var(--bg-alt);
  border-top: 1px solid var(--border);
}

.alert-error {
  background: rgba(217,92,92,0.1);
  border: 1px solid rgba(217,92,92,0.3);
  border-radius: 4px;
  color: #e57373;
  padding: 12px 20px;
  font-size: 0.9rem;
  margin-bottom: 20px;
}

/* ---- MOBILE ---- */
@media (max-width: 900px) {
  .app-nav { padding: 0 20px; }
  .app-main { padding: 24px 20px 60px; }
  .detail-grid { grid-template-columns: 1fr; }
  .pipeline-stats { flex-wrap: wrap; }
  .pstat-arrow { display: none; }
  .data-table th, .data-table td { padding: 10px 16px; }
  .form-section { padding: 20px; }
  .form-actions { padding: 16px 20px; }
  .buyer-grid { padding: 16px; grid-template-columns: 1fr; }
}

@media (max-width: 600px) {
  .page-header { flex-direction: column; gap: 12px; }
  .header-actions { flex-wrap: wrap; }
  .summary-strip { flex-direction: column; }
  .summary-divider { width: 100%; height: 1px; }
  .price-display { flex-wrap: wrap; justify-content: center; }
  .filter-tabs { flex-wrap: wrap; }
  .nav-links { display: none; }
}
