/**
 * financials-tab.css — Financials tab inside property card
 * Fusion Property Management — FB-09c
 * 2026-06-18
 */

/* ── Tab wrapper ────────────────────────────────────────────────── */
.fin-tab-wrap {
  display: flex;
  flex-direction: column;
  gap: 28px;
  padding: 4px 0 24px;
}

/* ── Section blocks ─────────────────────────────────────────────── */
.fin-tab-section {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.fin-section-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 4px;
}

.fin-section-title {
  font-size: 11px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: #8ea0b8;
}

/* ── Monthly Summary — Metric cards ────────────────────────────── */
.fin-metric-row {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 14px;
  margin-bottom: 20px;
}

@media (max-width: 640px) {
  .fin-metric-row {
    grid-template-columns: 1fr;
  }
}

.fin-metric-card {
  background: rgba(13, 30, 53, 0.6);
  border: 1px solid rgba(67, 112, 151, 0.25);
  border-radius: 12px;
  padding: 16px 20px;
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.fin-metric-card--profit {
  background: rgba(16, 72, 44, 0.35);
  border-color: rgba(29, 158, 117, 0.4);
}

.fin-metric-card--loss {
  background: rgba(72, 16, 16, 0.35);
  border-color: rgba(216, 90, 48, 0.4);
}

.fin-metric-label {
  font-size: 11px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: #8ea0b8;
}

.fin-metric-value {
  font-size: 22px;
  font-weight: 800;
  color: #f6f8ff;
  letter-spacing: -0.02em;
  font-variant-numeric: tabular-nums;
}

.fin-metric-value--income  { color: #37cf8d; }
.fin-metric-value--expense { color: #f34b45; }
.fin-metric-value--profit  { color: #37cf8d; }
.fin-metric-value--loss    { color: #f34b45; }

/* ── Expense breakdown table ────────────────────────────────────── */
.fin-breakdown-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 13px;
}

.fin-breakdown-table th {
  background: rgba(5, 18, 35, 0.9);
  color: #8ea0b8;
  font-size: 10px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.07em;
  padding: 8px 12px;
  text-align: left;
  border-bottom: 1px solid rgba(67, 112, 151, 0.2);
}

.fin-breakdown-table th:last-child { text-align: right; }

.fin-breakdown-table td {
  padding: 9px 12px;
  color: #ccd8e8;
  border-bottom: 1px solid rgba(67, 112, 151, 0.08);
  vertical-align: middle;
}

.fin-breakdown-table td:last-child {
  text-align: right;
  font-variant-numeric: tabular-nums;
  font-weight: 600;
  color: #f6f8ff;
}

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

.fin-breakdown-label-auto {
  font-size: 11px;
  color: #8ea0b8;
  margin-left: 4px;
}

/* ── Recurring Expenses table ───────────────────────────────────── */
.fin-expense-note {
  font-size: 12px;
  color: #8ea0b8;
  margin: 0 0 8px;
  font-style: italic;
}

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

.fin-expenses-table th {
  background: rgba(5, 18, 35, 0.9);
  color: #8ea0b8;
  font-size: 10px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.07em;
  padding: 8px 10px;
  text-align: left;
  border-bottom: 1px solid rgba(67, 112, 151, 0.2);
}

.fin-expenses-table td {
  padding: 7px 10px;
  border-bottom: 1px solid rgba(67, 112, 151, 0.08);
  vertical-align: middle;
}

.fin-expenses-table tr:last-child td { border-bottom: none; }
.fin-expenses-table tr.fin-expense-new-row td { background: rgba(255, 192, 34, 0.03); }

.fin-cell-input {
  width: 100%;
  background: rgba(13, 30, 53, 0.7);
  border: 1px solid rgba(67, 112, 151, 0.3);
  border-radius: 6px;
  color: #f6f8ff;
  font-size: 13px;
  padding: 5px 8px;
  outline: none;
  transition: border-color 0.15s;
  box-sizing: border-box;
}

.fin-cell-input:focus {
  border-color: rgba(255, 192, 34, 0.55);
  box-shadow: 0 0 0 2px rgba(255, 192, 34, 0.08);
}

.fin-cell-input--amount {
  width: 120px;
  text-align: right;
}

.fin-cell-select {
  background: rgba(13, 30, 53, 0.7);
  border: 1px solid rgba(67, 112, 151, 0.3);
  border-radius: 6px;
  color: #f6f8ff;
  font-size: 13px;
  padding: 5px 8px;
  outline: none;
  cursor: pointer;
  width: 100%;
  box-sizing: border-box;
}

.fin-cell-select:focus {
  border-color: rgba(255, 192, 34, 0.55);
}

.fin-cell-delete-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 28px;
  height: 28px;
  border-radius: 6px;
  border: 1px solid rgba(243, 75, 69, 0.3);
  background: rgba(243, 75, 69, 0.08);
  color: #f34b45;
  cursor: pointer;
  font-size: 14px;
  transition: background 0.15s;
}

.fin-cell-delete-btn:hover {
  background: rgba(243, 75, 69, 0.18);
}

.fin-cell-save-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  height: 28px;
  padding: 0 12px;
  border-radius: 6px;
  border: none;
  background: linear-gradient(180deg, #ffd253, #ffb51c);
  color: #09131f;
  font-size: 12px;
  font-weight: 800;
  cursor: pointer;
}

.fin-cell-cancel-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  height: 28px;
  padding: 0 12px;
  border-radius: 6px;
  border: 1px solid rgba(67, 112, 151, 0.3);
  background: transparent;
  color: #8ea0b8;
  font-size: 12px;
  cursor: pointer;
  margin-left: 4px;
}

.fin-expense-empty {
  text-align: center;
  padding: 20px;
  color: #5b7899;
  font-size: 13px;
}

/* ── View History panel ─────────────────────────────────────────── */
.fin-history-panel {
  background: rgba(5, 18, 35, 0.5);
  border: 1px solid rgba(67, 112, 151, 0.2);
  border-radius: 12px;
  padding: 20px 20px 24px;
  margin-top: 16px;
}

.fin-history-panel-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 16px;
}

.fin-history-title {
  font-size: 12px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.07em;
  color: #8ea0b8;
}

/* History month-by-month table */
.fin-history-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 13px;
  margin-bottom: 24px;
}

.fin-history-table th {
  background: rgba(5, 18, 35, 0.9);
  color: #8ea0b8;
  font-size: 10px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.07em;
  padding: 8px 12px;
  text-align: left;
  border-bottom: 1px solid rgba(67, 112, 151, 0.2);
}

.fin-history-table th:not(:first-child) { text-align: right; }

.fin-history-table td {
  padding: 9px 12px;
  color: #ccd8e8;
  border-bottom: 1px solid rgba(67, 112, 151, 0.08);
  vertical-align: middle;
  font-variant-numeric: tabular-nums;
}

.fin-history-table td:not(:first-child) {
  text-align: right;
  font-weight: 600;
}

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

.fin-history-table .fin-net-profit  { color: #37cf8d; }
.fin-history-table .fin-net-loss    { color: #f34b45; }

/* Chart wrapper */
.fin-chart-wrap {
  position: relative;
  width: 100%;
  min-height: 260px;
}

/* ── View History button ────────────────────────────────────────── */
.fin-view-history-btn {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  height: 36px;
  padding: 0 18px;
  border-radius: 8px;
  border: 1px solid rgba(67, 112, 151, 0.4);
  background: rgba(67, 112, 151, 0.1);
  color: #b6c3d5;
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
  transition: background 0.15s, color 0.15s;
}

.fin-view-history-btn:hover {
  background: rgba(67, 112, 151, 0.2);
  color: #f6f8ff;
}
