/**
 * High 5 Connect CRM — V2 Financials + Insurance + Warranty Styles
 */

/* ─── Financials ──────────────────────────────────────────── */
.financials-section {
  padding: var(--s2) 0;
}

.financials-section h4 {
  font-size: var(--text-lg);
  font-weight: 700;
  color: var(--text-primary);
  margin-bottom: var(--s4);
}

.fin-summary {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: var(--s3);
  margin-bottom: var(--s4);
}

.fin-card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--r-md);
  padding: var(--s3);
  text-align: center;
}

.fin-card-label {
  font-size: var(--text-xs);
  text-transform: uppercase;
  font-weight: 700;
  letter-spacing: var(--tracking-wide);
  color: var(--text-label);
  display: block;
  margin-bottom: var(--s1);
}

.fin-card-value {
  font-size: var(--text-xl);
  font-weight: 700;
  color: var(--text-primary);
}

.fin-card-revenue { border-left: 3px solid var(--accent); }
.fin-card-expenses { border-left: 3px solid var(--amber); }
.fin-card-profit { border-left: 3px solid var(--green); }
.fin-card-loss { border-left: 3px solid var(--red); }

.fin-breakdown {
  margin-bottom: var(--s3);
  padding: var(--s4);
}

.fin-breakdown-title {
  font-size: var(--text-sm);
  font-weight: 700;
  text-transform: uppercase;
  color: var(--text-label);
  margin-bottom: var(--s3);
}

.fin-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: var(--s2) 0;
  border-bottom: 1px solid var(--border);
  font-size: var(--text-sm);
  color: var(--text-secondary);
}

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

.fin-row-total {
  font-weight: 700;
  color: var(--text-primary);
  border-top: 2px solid var(--border);
  margin-top: var(--s1);
  padding-top: var(--s3);
}

.fin-positive { color: var(--green); font-weight: 600; }
.fin-negative { color: var(--red); font-weight: 600; }

/* ─── Inline Editable Fields ─────────────────────────────── */
.fin-row-editable { background: var(--bg-page); border-radius: var(--r-sm); padding: var(--s2) var(--s3); margin: 2px 0; }
.fin-inline-edit { display: flex; align-items: center; gap: 4px; }
.fin-inline-input { width: 90px; text-align: right; font-weight: 600; padding: 2px 6px; }
.fin-pct-input { width: 60px; }
.fin-dollar-sign { color: var(--text-label); font-size: var(--text-sm); font-weight: 600; }
.fin-pct-sign { color: var(--text-label); font-size: var(--text-sm); font-weight: 600; }
.fin-calc-result { color: var(--text-secondary); font-size: var(--text-sm); margin-left: 6px; white-space: nowrap; }

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

.fin-breakdown-header .fin-breakdown-title {
  margin-bottom: 0;
}

.fin-row-custom {
  background: var(--bg-page);
  border-radius: var(--r-sm);
  padding: var(--s2) var(--s3);
  margin: var(--s1) 0;
}

.fin-remove-expense {
  border: none;
  background: transparent;
  color: var(--text-label);
  cursor: pointer;
  font-size: var(--text-lg);
  padding: 0 0 0 var(--s2);
  transition: color var(--t-fast);
}

.fin-remove-expense:hover {
  color: var(--red);
}

.fin-progress {
  height: 8px;
  background: var(--bg-input);
  border-radius: var(--r-full);
  overflow: hidden;
  margin-top: var(--s3);
}

.fin-progress-bar {
  height: 100%;
  background: var(--accent);
  border-radius: var(--r-full);
  transition: width var(--t-normal);
}

.fin-progress-label {
  font-size: var(--text-xs);
  color: var(--text-label);
  margin-top: var(--s1);
  display: block;
}

/* ─── Insurance ──────────────────────────────────────────── */
.insurance-section {
  padding: var(--s2) 0;
}

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

.insurance-header h4 {
  font-size: var(--text-lg);
  font-weight: 700;
  color: var(--text-primary);
}

.insurance-status {
  margin-bottom: var(--s3);
}

.insurance-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: var(--s3);
}

.insurance-card {
  padding: var(--s4);
}

.insurance-card h5 {
  font-size: var(--text-sm);
  font-weight: 700;
  text-transform: uppercase;
  color: var(--text-label);
  margin-bottom: var(--s3);
}

.insurance-row {
  display: flex;
  justify-content: space-between;
  padding: var(--s2) 0;
  border-bottom: 1px solid var(--border);
  font-size: var(--text-sm);
}

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

.insurance-label {
  color: var(--text-label);
}

.insurance-value {
  color: var(--text-primary);
  font-weight: 600;
}

.insurance-row-total {
  border-top: 2px solid var(--border);
  margin-top: var(--s1);
  padding-top: var(--s3);
  font-weight: 700;
}

.insurance-notes {
  padding: var(--s4);
  margin-top: var(--s3);
}

.insurance-notes h5 {
  font-size: var(--text-sm);
  font-weight: 700;
  color: var(--text-label);
  margin-bottom: var(--s2);
}

/* ─── Warranty ───────────────────────────────────────────── */
.warranty-section {
  padding: var(--s2) 0;
}

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

.warranty-header h4 {
  font-size: var(--text-lg);
  font-weight: 700;
  color: var(--text-primary);
}

.warranty-card {
  margin-bottom: var(--s3);
  padding: var(--s4);
}

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

.warranty-days {
  font-size: var(--text-xs);
  color: var(--text-secondary);
  margin-left: var(--s2);
}

.warranty-expired {
  color: var(--red);
  font-weight: 700;
}

.warranty-card-body {
  margin-bottom: var(--s2);
}

.warranty-row {
  display: flex;
  justify-content: space-between;
  padding: var(--s2) 0;
  border-bottom: 1px solid var(--border);
  font-size: var(--text-sm);
}

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

.warranty-label {
  color: var(--text-label);
}

.warranty-value {
  color: var(--text-primary);
  font-weight: 600;
}

.warranty-terms {
  font-size: var(--text-sm);
  color: var(--text-secondary);
  padding-top: var(--s2);
  border-top: 1px solid var(--border);
  white-space: pre-wrap;
}

/* ─── Responsive ──────────────────────────────────────────── */
@media (min-width: 641px) {
  .fin-summary {
    grid-template-columns: repeat(4, 1fr);
  }

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

  .insurance-grid > :last-child {
    grid-column: span 2;
  }
}

@media (min-width: 1025px) {
  .insurance-grid {
    grid-template-columns: repeat(3, 1fr);
  }

  .insurance-grid > :last-child {
    grid-column: auto;
  }
}

