:root {
  --bg: #f8fafc;
  --card: #ffffff;
  --text: #0f172a;
  --text-muted: #64748b;
  --border: #e2e8f0;
  --primary: #06b6d4;        /* Cyan primary */
  --primary-dark: #0891b2;
  --primary-light: #cffafe;
  --success: #10b981;
  --warning: #f59e0b;
  --danger: #ef4444;
  --shadow: 0 4px 6px -1px rgba(0,0,0,0.08), 0 2px 4px -2px rgba(0,0,0,0.05);
  --radius: 12px;
}

* { box-sizing: border-box; margin: 0; padding: 0; }
body {
  background: var(--bg);
  color: var(--text);
  font-family: system-ui, -apple-system, 'Segoe UI', sans-serif;
  line-height: 1.5;
}

.dashboard-container { max-width: 1200px; margin: 0 auto; }
.dashboard-header { 
  text-align: center; 
  margin-bottom: 2rem; 
  padding-bottom: 1rem;
  border-bottom: 2px solid var(--primary-light);
}
.dashboard-header h1 { 
  font-size: 1.8rem; 
  margin-bottom: 0.25rem;
  color: var(--primary-dark);
}
.dashboard-header p { color: var(--text-muted); }

/* KPI Grid */
/* 📈 KPI Header Styling */
.kpi-container {
  margin-bottom: 2rem;
}
.kpi-header {
  font-size: 1.25rem;
  color: var(--primary-dark);
  margin-bottom: 1rem;
  display: flex;
  align-items: center;
  gap: 0.5rem;
  border-bottom: 2px solid var(--primary-light);
  padding-bottom: 0.5rem;
}
.kpi-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  gap: 1.25rem;
  margin-bottom: 2rem;
}
.kpi-card {
  background: var(--card);
  padding: 1.5rem;
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  text-align: center;
  border-left: 4px solid var(--primary);
  transition: transform 0.2s ease;
}
.kpi-card:hover { transform: translateY(-2px); }
.kpi-card h3 {
  font-size: 0.85rem;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.5px;
  margin-bottom: 0.5rem;
}
.kpi-value { font-size: 1.75rem; font-weight: 700; color: var(--primary-dark); }

/* Chart */
.chart-section {
  background: var(--card);
  padding: 1.5rem;
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  margin-bottom: 2rem;
  height: 400px;
  border-top: 4px solid var(--primary);
}

/* ===== 📋 Cyan Table Theme ===== */
.table-section {
  background: var(--card);
  padding: 1.5rem;
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  border-top: 4px solid var(--primary);
}
.table-section h2 {
  margin-bottom: 1rem;
  font-size: 1.1rem;
  color: var(--primary-dark);
  display: flex;
  align-items: center;
  gap: 0.5rem;
}
.table-responsive {
  overflow-x: auto;
  border-radius: 8px;
  border: 1px solid var(--primary-light);
}
/* ✅ Right-align all table headers */
.table-section th {
  padding: 1rem 1.25rem;
  text-align: right;
  font-weight: 600;
  font-size: 0.8rem;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  white-space: nowrap;
}

/* 📊 Sales Table Total Row */
.table-section tbody tr.sales-total-row {
  background: #e0f7fa;
  border-top: 2px solid var(--primary);
  border-bottom: none;
}
.table-section tbody tr.sales-total-row td {
  padding: 1rem 1.25rem;
  color: var(--primary-dark);
  font-size: 0.95rem;
}
.table-section tbody tr.sales-total-row td:first-child {
  border-right: 1px solid var(--primary);
}

/* Disable hover animation on the totals row */
.table-section tbody tr.sales-total-row:hover {
  background: #e0f7fa !important;
  transform: none !important;
  box-shadow: none !important;
}
/* ✅ Exception: Keep "Month" header left-aligned */
.table-section th:first-child {
  text-align: left;
}
table {
  width: 100%;
  border-collapse: collapse;
  background: #fff;
}
thead {
  background: linear-gradient(135deg, var(--primary), var(--primary-dark));
  color: white;
}
th {
  padding: 1rem 1.25rem;
  text-align: left;
  font-weight: 600;
  font-size: 0.8rem;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  white-space: nowrap;
}
tbody tr {
  border-bottom: 1px solid #f0fdff;
  transition: background 0.2s ease, transform 0.1s ease;
}
tbody tr:nth-child(even) { background: #f8fdff; }
tbody tr:nth-child(odd) { background: #ffffff; }
tbody tr:hover {
  background: linear-gradient(90deg, #ecfeff, var(--primary-light));
  transform: translateX(4px);
  box-shadow: 2px 0 0 var(--primary);
  cursor: default;
}
td {
  padding: 0.9rem 1.25rem;
  font-size: 0.95rem;
  color: var(--text);
}
td:first-child {
  font-weight: 600;
  color: var(--primary-dark);
  border-right: 1px solid #f0fdff;
}
td:nth-child(2),
td:nth-child(3),
td:nth-child(4),
td:nth-child(5) {
  text-align: right;
  font-variant-numeric: tabular-nums;
}
td:nth-child(5) { font-weight: 600; padding-right: 1.5rem; }
td:nth-child(4) { font-weight: 500; }

.status-good { color: var(--success); }
.status-warn { color: var(--warning); }

/* 📦 Dashboard Group Containers */
.dashboard-group {
  background: #ffffff;
  padding: 1.5rem;
  margin-bottom: 2rem;
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  border: 1px solid var(--primary-light);
}

/* Group Headers */
.group-header {
  font-size: 1.35rem;
  color: var(--primary-dark);
  margin: 0 0 1.5rem 0;
  padding-bottom: 0.5rem;
  border-bottom: 3px solid var(--primary);
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

/* Section Sub-Headers (KPI, Table, Chart) */
.section-header {
  font-size: 1.1rem;
  color: var(--primary-dark);
  margin-bottom: 1rem;
  display: flex;
  align-items: center;
  gap: 0.4rem;
}

/* Consistent Spacing Inside Groups */
.dashboard-group .kpi-container,
.dashboard-group .loan-table-section,
.dashboard-group .chart-section,
.dashboard-group .table-section {
  margin-bottom: 1.75rem;
}
.dashboard-group > :last-child {
  margin-bottom: 0;
}

/* Group-Specific Subtle Tints (Optional but recommended) */
.budget-group {
  background: linear-gradient(135deg, #ffffff 0%, #f0fdff 100%);
}
.actual-group {
  background: linear-gradient(135deg, #ffffff 0%, #f8fafc 100%);
}

/* 📅 Projection Table Q4 Total Row */
.proj-table-section tbody tr.proj-total-row {
  background: #e0f7fa;
  border-top: 2px solid var(--primary);
  border-bottom: none;
}
.proj-table-section tbody tr.proj-total-row td {
  padding: 1rem 1.25rem;
  color: var(--primary-dark);
  font-size: 0.95rem;
}
.proj-table-section tbody tr.proj-total-row td:first-child {
  border-right: 1px solid var(--primary);
}

/* Disable hover on total row */
.proj-table-section tbody tr.proj-total-row:hover {
  background: #e0f7fa !important;
  transform: none !important;
  box-shadow: none !important;
}


/* Responsive */
@media (max-width: 768px) {
  body { padding: 1rem; }
  .chart-section { height: 320px; padding: 1rem; }
  th, td { padding: 0.75rem 1rem; font-size: 0.85rem; }
  .loan-table-section { padding: 1rem; }
  .loan-table-section th, .loan-table-section td { padding: 0.7rem 0.6rem; font-size: 0.8rem; }
  .dashboard-group { padding: 1rem; }
  .group-header { font-size: 1.2rem; }
  .section-header { font-size: 1rem; }
}
@media (max-width: 640px) {
  .kpi-grid { grid-template-columns: 1fr 1fr; }
  .kpi-value { font-size: 1.4rem; }
}

/*UPLOAD SOLA EXCEL CSS */
/* Validation Styling */
.validation-error {
  background-color: #ffebee !important;
  border-left: 4px solid #f44336;
}

.validation-warning {
  background-color: #fff3e0 !important;
  border-left: 4px solid #ff9800;
}

/* Tooltip for validation errors */
td[data-validation-error] {
  position: relative;
  cursor: help;
}

td[data-validation-error]:hover::after {
  content: attr(data-validation-error);
  position: absolute;
  bottom: 100%;
  left: 50%;
  transform: translateX(-50%);
  background: #333;
  color: #fff;
  padding: 5px 10px;
  border-radius: 4px;
  font-size: 11px;
  white-space: nowrap;
  z-index: 1000;
  max-width: 450px;
}

/* Disabled button styling */
#btn-uploadbranchcenter:disabled {
  opacity: 0.6;
  cursor: not-allowed;
  pointer-events: none;
}

/* Validation summary badge */
.validation-summary {
  font-size: 12px;
  padding: 8px 12px;
  border-radius: 4px;
  margin-bottom: 10px;
}

.validation-summary.error {
  background-color: #ffebee;
  color: #c62828;
  border: 1px solid #ef9a9a;
}

.validation-summary.success {
  background-color: #e8f5e9;
  color: #2e7d32;
  border: 1px solid #a5d6a7;
}

/* Filename info box */
.filename-info-box {
  background: #e3f2fd;
  border: 1px solid #90caf9;
  border-radius: 4px;
  padding: 10px 15px;
  margin-bottom: 15px;
  font-size: 13px;
}

.filename-info-box strong {
  color: #1565c0;
}

.filename-info-box.mismatch {
  background: #ffebee;
  border-color: #ef9a9a;
}

.filename-info-box.mismatch strong {
  color: #c62828;
}

/* Badge for validation errors */
.badge-validation-error {
  background-color: #f44336;
  color: white;
  padding: 2px 8px;
  border-radius: 3px;
  font-size: 10px;
  margin-left: 8px;
}

/* Allowed values hint */
.allowed-values-hint {
  font-size: 11px;
  color: #666;
  font-style: italic;
}

/* Column Alignment Classes */

/* CLIENT_LOAN_CYCLE - Center Aligned */
#tblBranchUploadView td.col-client-cycle {
  text-align: center !important;
  vertical-align: middle;
}

/* ✅ LOAN_AMOUNT & PREVIOUS_LOAN - Right Aligned (Plain Styling) */
#tblBranchUploadView td.col-loan-amount,
#tblBranchUploadView td.col-previous-loan {
  text-align: right !important;
  vertical-align: middle;
  padding-right: 12px;
}

/* Header alignment */
#tblBranchUploadView th.text-center {
  text-align: center !important;
}

#tblBranchUploadView th.text-end {
  text-align: right !important;
}

/* Validation Styling (applies to all columns equally) */
.validation-error {
  background-color: #ffebee !important;
  border-left: 4px solid #f44336;
}

.validation-warning {
  background-color: #fff3e0 !important;
  border-left: 4px solid #ff9800;
}
/* Filename mismatch alert */
.filename-mismatch-alert {
  background: linear-gradient(135deg, #ffebee 0%, #ffcdd2 100%);
  border: 2px solid #f44336;
  border-radius: 8px;
  padding: 15px;
  margin-bottom: 15px;
  display: none;
}

.filename-mismatch-alert.show {
  display: block;
  animation: shake 0.5s ease-in-out;
}

/* 🏦 Loan Table Section */
.loan-table-section {
  background: var(--card);
  padding: 1.5rem;
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  border-top: 4px solid var(--primary);
  margin-bottom: 2rem;
}
.loan-table-section h2 {
  margin-bottom: 1rem;
  font-size: 1.1rem;
  color: var(--primary-dark);
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

/* Table Base */
.loan-table-section .table-responsive {
  overflow-x: auto;
  border-radius: 8px;
  border: 1px solid var(--primary-light);
  -webkit-overflow-scrolling: touch; /* Smooth iOS scroll */
}
.loan-table-section table {
  width: 100%;
  min-width: 900px; /* Ensures columns don't crush on mobile */
  border-collapse: collapse;
  background: #fff;
}

/* Header */
.loan-table-section thead {
  background: linear-gradient(135deg, var(--primary), var(--primary-dark));
  color: white;
}
.loan-table-section th {
  padding: 0.9rem 0.8rem;
  text-align: right;
  font-weight: 600;
  font-size: 0.75rem;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  white-space: nowrap;
}
.loan-table-section th:first-child { text-align: left; min-width: 150px; }

/* Body */
.loan-table-section tbody tr {
  border-bottom: 1px solid #f0fdff;
  transition: background 0.2s ease, transform 0.1s ease;
}
.loan-table-section tbody tr:nth-child(even) { background: #f8fdff; }
.loan-table-section tbody tr:hover {
  background: linear-gradient(90deg, #ecfeff, var(--primary-light));
  transform: translateX(4px);
  box-shadow: 2px 0 0 var(--primary);
  cursor: default;
}
.loan-table-section td {
  padding: 0.8rem;
  font-size: 0.85rem;
  text-align: right;
  font-variant-numeric: tabular-nums;
  white-space: nowrap;
}
.loan-table-section td:first-child {
  text-align: left;
  font-weight: 600;
  color: var(--primary-dark);
  border-right: 1px solid #f0fdff;
}

/* Footer / Totals Row */
.loan-table-section tfoot td {
  background: #e0f7fa;
  border-top: 2px solid var(--primary);
  font-weight: 700;
  color: var(--primary-dark);
  padding: 1rem 0.8rem;
  font-size: 0.9rem;
}
.loan-table-section tfoot td:first-child {
  background: #e0f7fa;
  border-right-color: var(--primary);
}

/* 📄 Export Button */
.export-btn {
  background: linear-gradient(135deg, var(--primary), var(--primary-dark));
  color: white;
  border: none;
  padding: 0.6rem 1.25rem;
  border-radius: 8px;
  font-weight: 600;
  font-size: 0.9rem;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  box-shadow: 0 2px 4px rgba(6, 182, 212, 0.3);
  transition: all 0.2s ease;
}
.export-btn:hover {
  transform: translateY(-2px);
  box-shadow: 0 4px 8px rgba(6, 182, 212, 0.4);
}
.export-btn:active {
  transform: translateY(0);
}

/* 📦 Export Header Layout */
.export-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 1rem;
  flex-wrap: wrap;
  gap: 1rem;
}

.export-actions {
  display: flex;
  gap: 0.75rem;
}

/* 📄 PDF Button (Cyan) */
.pdf-btn {
  background: linear-gradient(135deg, var(--primary), var(--primary-dark));
  box-shadow: 0 2px 4px rgba(6, 182, 212, 0.3);
}
.pdf-btn:hover {
  box-shadow: 0 4px 8px rgba(6, 182, 212, 0.4);
}

/* 📊 Excel Button (Green) */
.excel-btn {
  background: linear-gradient(135deg, #10b981, #059669);
  box-shadow: 0 2px 4px rgba(16, 185, 129, 0.3);
}
.excel-btn:hover {
  box-shadow: 0 4px 8px rgba(16, 185, 129, 0.4);
}

/* Common Button Styles */
.export-btn {
  color: white;
  border: none;
  padding: 0.6rem 1.25rem;
  border-radius: 8px;
  font-weight: 600;
  font-size: 0.9rem;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  transition: all 0.2s ease;
}
.export-btn:active { transform: translateY(0); }

/* PUH Dashboard Specific Overrides */

/* PO Selector Dropdown */
.po-selector {
  margin-top: 1rem;
  display: flex;
  align-items: center;
  gap: 0.75rem;
  justify-content: center;
  flex-wrap: wrap;
}

.po-selector select {
  padding: 0.5rem 1rem;
  border: 2px solid var(--primary-light);
  border-radius: 8px;
  background: white;
  font-size: 0.95rem;
  color: var(--text);
  min-width: 280px;
  cursor: pointer;
  transition: border-color 0.2s;
}

.po-selector select:focus {
  outline: none;
  border-color: var(--primary);
  box-shadow: 0 0 0 3px var(--primary-light);
}

/* PO Summary Table */
.po-summary-section tbody tr:hover {
  background: linear-gradient(90deg, #f0fdfa, #ecfeff);
  transform: translateX(4px);
}

.po-summary-section td:last-child {
  text-align: center;
}

/* Footer */
.dashboard-footer {
  text-align: center;
  padding: 1.5rem;
  color: var(--text-muted);
  font-size: 0.85rem;
  border-top: 1px solid var(--border);
  margin-top: 2rem;
}

/* Responsive Adjustments */
@media (max-width: 768px) {
  .po-selector {
    flex-direction: column;
    align-items: stretch;
  }
  .po-selector select {
    min-width: auto;
    width: 100%;
  }
  
  .kpi-grid {
    grid-template-columns: repeat(2, 1fr);
  }
  
  .loan-table-section table,
  .po-summary-section table {
    min-width: 700px;
  }
}

@media (max-width: 480px) {
  .kpi-grid {
    grid-template-columns: 1fr;
  }
  
  .kpi-value {
    font-size: 1.5rem;
  }
  
  .dashboard-header h1 {
    font-size: 1.5rem;
  }
  
  .dashboard-header h2 {
    font-size: 1rem;
  }
}

/* Mobile Responsive */
@media (max-width: 640px) {
  .export-header { flex-direction: column; align-items: flex-start; }
  .export-actions { width: 100%; }
  .export-btn { flex: 1; justify-content: center; }
}

/* 📅 Projection Table - 3 Column Layout */
.proj-table-section th:nth-child(2),
.proj-table-section td:nth-child(2) {
  text-align: center; /* Center-align client counts */
}
.proj-table-section th:nth-child(3),
.proj-table-section td:nth-child(3) {
  text-align: right; /* Right-align currency values */
}

/* 📊 Charts Row - 2 Column Layout */
.charts-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 1.5rem;
  margin-bottom: 2rem;
}

.chart-card {
  background: var(--card);
  padding: 1.5rem;
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  border-top: 4px solid var(--primary);
  display: flex;
  flex-direction: column;
}

.chart-title {
  font-size: 1.1rem;
  color: var(--primary-dark);
  margin-bottom: 1rem;
  display: flex;
  align-items: center;
  gap: 0.4rem;
  font-weight: 600;
}

.chart-wrapper {
  flex: 1;
  min-height: 320px;
  position: relative;
}

/* Mobile: Stack charts vertically */
@media (max-width: 1024px) {
  .charts-row {
    grid-template-columns: 1fr;
    gap: 1.25rem;
  }
  .chart-wrapper {
    min-height: 280px;
  }
}

/* Mobile: Stack columns on very small screens */
@media (max-width: 480px) {
  .proj-table-section th,
  .proj-table-section td {
    font-size: 0.8rem;
    padding: 0.6rem 0.5rem;
  .chart-card { padding: 1rem; }
  .chart-title { font-size: 1rem; }
  .chart-wrapper { min-height: 240px; }
  }
}

/* 🏢 Center Budget Chart Section */
.center-chart-section {
  background: var(--card);
  padding: 1.5rem;
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  border-top: 4px solid var(--primary);
  margin-bottom: 2rem;
}

.center-select {
  padding: 0.5rem 1rem;
  border: 1px solid var(--border);
  border-radius: 8px;
  background: white;
  color: var(--text);
  font-size: 0.9rem;
  min-width: 220px;
  cursor: pointer;
  transition: border-color 0.2s ease;
}
.center-select:focus {
  outline: none;
  border-color: var(--primary);
  box-shadow: 0 0 0 3px rgba(6, 182, 212, 0.1);
}

.center-chart-section .chart-wrapper {
  min-height: 350px;
  position: relative;
}

.center-stats { margin-top: 1rem; }
.stat-mini {
  background: #f8fdff;
  padding: 0.75rem 1rem;
  border-radius: 8px;
  text-align: center;
  border-left: 3px solid var(--primary);
}
.stat-label {
  display: block;
  font-size: 0.8rem;
  color: var(--text-muted);
  margin-bottom: 0.25rem;
}
.stat-value {
  font-size: 1.25rem;
  font-weight: 700;
  color: var(--primary-dark);
}

/* 📋 Transposed Projection Table (No Averages) */
#proj-transposed-table {
  min-width: 850px;
  border-collapse: separate;
  border-spacing: 0;
  background: #fff;
}

.sticky-col { position: sticky; left: 0; background: #fff; z-index: 10; border-right: 2px solid var(--primary-light) !important; box-shadow: 2px 0 5px rgba(0,0,0,0.05); }
.sticky-col.po-code { left: 0; z-index: 12; min-width: 85px; background: linear-gradient(90deg, #ffffff 95%, transparent); }
.sticky-col.po-name { left: 85px; z-index: 11; min-width: 130px; background: linear-gradient(90deg, #ffffff 95%, transparent); }

.period-header { text-align: center; font-weight: 700; font-size: 0.85rem; text-transform: uppercase; letter-spacing: 0.5px; padding: 0.5rem !important; border-bottom: 2px solid var(--border); }
.sep-header { background: linear-gradient(135deg, #fef3c7 0%, #fde68a 100%); color: #92400e; border: 1px solid #f59e0b; }
.q4-header { background: linear-gradient(135deg, #dbeafe 0%, #bfdbfe 100%); color: #1e40af; border: 1px solid #3b82f6; }
.total-header { background: linear-gradient(135deg, #dcfce7 0%, #bbf7d0 100%); color: #166534; border: 1px solid #22c55e; }

.sub-header { font-weight: 600; font-size: 0.75rem; text-align: right; padding: 0.6rem 0.5rem !important; background: #f8fafc; border-bottom: 1px solid var(--border); white-space: nowrap; }
.sub-header.total-col { background: #f0fdf4; font-weight: 700; }

.sep-col { background: #fffbeb; }
.q4-col { background: #eff6ff; }
.total-col { background: #f0fdf4; font-weight: 600; }

#proj-transposed-table td, #proj-transposed-table th { padding: 0.65rem 0.5rem; font-size: 0.85rem; border-bottom: 1px solid var(--border); border-right: 1px solid #f1f5f9; }
#proj-transposed-table td.text-right, #proj-transposed-table th.text-right { text-align: right !important; font-variant-numeric: tabular-nums; }
#proj-transposed-table td.bold { font-weight: 700; }
.text-dash { color: var(--text-muted); font-style: italic; font-size: 0.8rem; }

.grand-total-row { background: linear-gradient(135deg, #f0f9ff 0%, #e0f2fe 100%) !important; border-top: 3px solid var(--primary); border-bottom: none; }
.grand-total-row td { padding: 0.85rem 0.5rem !important; font-size: 0.9rem; color: var(--primary-dark); }
.grand-total-row .sticky-col { background: linear-gradient(90deg, #e0f2fe 95%, transparent) !important; }

#proj-transposed-table tbody tr:hover { background: linear-gradient(90deg, #f8fafc, #f0fdff) !important; transform: translateX(4px); transition: all 0.15s ease; }
#proj-transposed-table tbody tr:hover .sticky-col { background: linear-gradient(90deg, #f0fdff 95%, transparent) !important; }

/* Summary Cards (3 cards now) */
.proj-summary-cards { display: grid; grid-template-columns: repeat(3, 1fr); gap: 0.75rem; margin: 1rem 0 1.25rem; }
@media (max-width: 640px) { .proj-summary-cards { grid-template-columns: 1fr; } }

/* Mobile Optimization */
@media (max-width: 768px) {
  .center-select { min-width: 100%; }
  .center-chart-section { padding: 1rem; }
  .center-chart-section .chart-wrapper { min-height: 280px; }
}

/* Q4 Total Row (inherits from previous setup) */
.proj-table-section tbody tr.proj-total-row {
  background: #e0f7fa;
  border-top: 2px solid var(--primary);
}
.proj-table-section tbody tr.proj-total-row td {
  padding: 1rem 1.25rem;
  color: var(--primary-dark);
  font-weight: 700;
}
.proj-table-section tbody tr.proj-total-row:hover {
  background: #e0f7fa !important;
  transform: none !important;
  box-shadow: none !important;
}

@keyframes shake {
  0%, 100% { transform: translateX(0); }
  25% { transform: translateX(-5px); }
  75% { transform: translateX(5px); }
}

/* PUH Dashboard 

/* 📋 Enhanced Header Styling for Q4 Projection Table */

/* Sticky Column Headers */
.sticky-col.po-code-header,
.sticky-col.po-name-header {
  position: sticky;
  left: 0;
  background: linear-gradient(135deg, #f8fafc 0%, #f1f5f9 100%);
  z-index: 15;
  border-right: 2px solid var(--primary) !important;
  font-weight: 700;
  text-transform: uppercase;
  font-size: 0.75rem;
  letter-spacing: 0.5px;
  color: var(--primary-dark);
  padding: 0.7rem 0.5rem !important;
  text-align: left;
}

.sticky-col.po-code-header {
  left: 0;
  z-index: 16;
  min-width: 80px;
  background: linear-gradient(90deg, #f8fafc 95%, transparent);
}

.sticky-col.po-name-header {
  left: 80px;
  z-index: 15;
  min-width: 120px;
  background: linear-gradient(90deg, #f8fafc 95%, transparent);
}

/* Period Group Headers (Row 1) */
.period-header {
  text-align: center;
  font-weight: 700;
  font-size: 0.8rem;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  padding: 0.6rem 0.5rem !important;
  border-bottom: 2px solid var(--border);
  white-space: nowrap;
}

.sep-header {
  background: linear-gradient(135deg, #fef3c7 0%, #fde68a 100%);
  color: #92400e;
  border: 1px solid #f59e0b;
}

.q4-header {
  background: linear-gradient(135deg, #dbeafe 0%, #bfdbfe 100%);
  color: #1e40af;
  border: 1px solid #3b82f6;
}

.total-header {
  background: linear-gradient(135deg, #dcfce7 0%, #bbf7d0 100%);
  color: #166534;
  border: 1px solid #22c55e;
}

/* Sub-headers (Row 2) */
.sub-header {
  font-weight: 600;
  font-size: 0.7rem;
  text-align: center;
  padding: 0.5rem 0.4rem !important;
  background: #f8fafc;
  border-bottom: 1px solid var(--border);
  white-space: nowrap;
  color: var(--text-muted);
}

.sep-sub { background: #fffbeb; color: #92400e; }
.q4-sub { background: #eff6ff; color: #1e40af; }
.total-sub { background: #f0fdf4; color: #166534; font-weight: 700; }

/* Column Backgrounds for Data Rows */
.sep-col { background: #fffbeb; }
.q4-col { background: #eff6ff; }
.total-col { background: #f0fdf4; font-weight: 600; }

/* Table Base Styles */
#proj-transposed-table {
  min-width: 750px;
  border-collapse: separate;
  border-spacing: 0;
  background: #fff;
}

#proj-transposed-table th,
#proj-transposed-table td {
  padding: 0.6rem 0.5rem;
  font-size: 0.85rem;
  border-bottom: 1px solid var(--border);
  border-right: 1px solid #f1f5f9;
}

#proj-transposed-table td.text-right {
  text-align: right !important;
  font-variant-numeric: tabular-nums;
}

#proj-transposed-table td.bold {
  font-weight: 700;
}

.text-dash {
  color: var(--text-muted);
  font-style: italic;
  font-size: 0.8rem;
}

/* Grand Total Row */
.grand-total-row {
  background: linear-gradient(135deg, #f0f9ff 0%, #e0f2fe 100%) !important;
  border-top: 3px solid var(--primary);
  border-bottom: none;
}

.grand-total-row td {
  padding: 0.8rem 0.5rem !important;
  font-size: 0.9rem;
  color: var(--primary-dark);
}

.grand-total-row .sticky-col {
  background: linear-gradient(90deg, #e0f2fe 95%, transparent) !important;
}

/* Row Hover Effects */
#proj-transposed-table tbody tr:hover {
  background: linear-gradient(90deg, #f8fafc, #f0fdff) !important;
  transform: translateX(4px);
  transition: all 0.15s ease;
}

#proj-transposed-table tbody tr:hover .sticky-col {
  background: linear-gradient(90deg, #f0fdff 95%, transparent) !important;
}

/* Responsive Adjustments */
@media (max-width: 768px) {
  #proj-transposed-table {
    min-width: 650px;
  }
  
  .period-header {
    font-size: 0.75rem;
    padding: 0.5rem 0.4rem !important;
  }
  
  .sub-header {
    font-size: 0.65rem;
    padding: 0.4rem 0.3rem !important;
  }
  
  .sticky-col.po-code-header,
  .sticky-col.po-name-header {
    font-size: 0.7rem;
    padding: 0.6rem 0.4rem !important;
  }
  
  .sticky-col.po-name-header {
    min-width: 100px;
  }
}

/* 🔧 FIX: Force dark text for sticky PO headers inside thead */
#proj-transposed-table thead th.sticky-col {
  color: #0f172a !important;           /* Dark slate text */
  background: linear-gradient(135deg, #f8fafc 0%, #e2e8f0 100%) !important;
  text-shadow: none !important;
  font-weight: 700;
}

/* Ensure PO Code column has extra z-index */
#proj-transposed-table thead th.sticky-col:nth-child(1) {
  z-index: 20 !important;
  left: 0 !important;
}

/* Ensure PO Name column stays visible */
#proj-transposed-table thead th.sticky-col:nth-child(2) {
  z-index: 19 !important;
  left: 80px !important;
}

@media (max-width: 480px) {
  #proj-transposed-table {
    min-width: 550px;
  }
  
  .period-header,
  .sub-header {
    font-size: 0.65rem;
  }
}

/* 🏦 Standard Loan Table Styling */
.loan-table-section .table-responsive {
  overflow-x: auto;
  border-radius: 8px;
  border: 1px solid var(--primary-light);
}
.loan-table-section table {
  width: 100%;
  border-collapse: collapse;
  background: #fff;
}
.loan-table-section thead {
  background: linear-gradient(135deg, var(--primary), var(--primary-dark));
  color: white;
}
.loan-table-section th {
  padding: 0.9rem 0.8rem;
  text-align: right;
  font-weight: 600;
  font-size: 0.75rem;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  white-space: nowrap;
}
.loan-table-section th:first-child { text-align: left; min-width: 160px; }
.loan-table-section tbody tr {
  border-bottom: 1px solid #f0fdff;
  transition: background 0.2s ease, transform 0.1s ease;
}
.loan-table-section tbody tr:nth-child(even) { background: #f8fdff; }
.loan-table-section tbody tr:hover {
  background: linear-gradient(90deg, #ecfeff, var(--primary-light));
  transform: translateX(4px);
}
.loan-table-section td {
  padding: 0.8rem;
  font-size: 0.85rem;
  text-align: right;
  font-variant-numeric: tabular-nums;
  white-space: nowrap;
}
.loan-table-section td:first-child {
  text-align: left;
  font-weight: 600;
  color: var(--primary-dark);
}
.loan-table-section tfoot td {
  background: #e0f7fa;
  border-top: 2px solid var(--primary);
  font-weight: 700;
  color: var(--primary-dark);
  padding: 1rem 0.8rem;
  font-size: 0.9rem;
}
.loan-table-section tfoot td:first-child {
  background: #e0f7fa;
  border-right-color: var(--primary);
}


/* 📊 Enhanced KPI Card Styling with Expandable Details */

.kpi-container {
  margin-bottom: 2rem;
}

.kpi-controls {
  display: flex;
  gap: 0.75rem;
  margin-bottom: 1rem;
  justify-content: flex-end;
}

.toggle-all-kpi-btn {
  background: linear-gradient(135deg, var(--primary), var(--primary-dark));
  color: white;
  border: none;
  padding: 0.4rem 0.9rem;
  border-radius: 6px;
  font-size: 0.8rem;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.2s ease;
}

.toggle-all-kpi-btn:hover {
  transform: translateY(-2px);
  box-shadow: 0 4px 12px rgba(6, 182, 212, 0.3);
}

.kpi-toggle-hint {
  font-size: 0.8rem;
  color: var(--text-muted);
  font-weight: 400;
  margin-left: 0.5rem;
}

/* KPI Card Base */
.kpi-card {
  background: var(--card);
  padding: 1.25rem;
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  text-align: center;
  border-left: 4px solid var(--primary);
  transition: all 0.2s ease;
  cursor: pointer;
  position: relative;
  overflow: hidden;
}

.kpi-card:hover {
  transform: translateY(-3px);
  box-shadow: 0 8px 20px rgba(0,0,0,0.12);
  border-left-color: var(--primary-dark);
}

.kpi-card.expanded {
  border-left-color: var(--success);
  box-shadow: 0 0 0 2px var(--primary-light), var(--shadow);
}

.kpi-header {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  margin-bottom: 0.75rem;
}

.kpi-icon {
  font-size: 1.2rem;
}

.kpi-card h3 {
  font-size: 0.85rem;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.5px;
  margin: 0;
  line-height: 1.3;
}

.kpi-value {
  font-size: 1.75rem;
  font-weight: 700;
  color: var(--primary-dark);
  margin: 0.25rem 0;
  line-height: 1.2;
}

.kpi-subtitle {
  font-size: 0.8rem;
  color: var(--text-muted);
  margin: 0;
}

/* KPI Detail Panel */
.kpi-detail-panel {
  margin-top: 1rem;
  padding-top: 1rem;
  border-top: 1px solid var(--border);
  background: linear-gradient(135deg, #f8fafc 0%, #f1f5f9 100%);
  border-radius: 0 0 var(--radius) var(--radius);
  max-height: 300px;
  overflow-y: auto;
  transition: all 0.3s ease;
}

.kpi-detail-panel.hidden {
  display: none;
}

.kpi-detail-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 0.5rem 0.75rem;
  background: var(--primary-light);
  border-radius: 6px;
  margin-bottom: 0.75rem;
}

.kpi-detail-header span {
  font-weight: 600;
  color: var(--primary-dark);
  font-size: 0.85rem;
}

.kpi-close-btn {
  background: none;
  border: none;
  color: var(--text-muted);
  font-size: 1.2rem;
  cursor: pointer;
  padding: 0 0.25rem;
  line-height: 1;
  transition: color 0.2s;
}

.kpi-close-btn:hover {
  color: var(--danger);
}

/* KPI Detail List Items */
.kpi-detail-list {
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
}

.kpi-detail-item {
  display: grid;
  grid-template-columns: 60px 1fr auto;
  gap: 0.5rem;
  align-items: center;
  padding: 0.5rem 0.75rem;
  background: white;
  border-radius: 6px;
  border: 1px solid var(--border);
  font-size: 0.85rem;
}

.kpi-detail-item .po-code {
  font-weight: 700;
  color: var(--primary-dark);
  text-align: left;
}

.kpi-detail-item .po-name {
  color: var(--text);
  text-align: left;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.kpi-detail-item .po-value {
  font-weight: 600;
  color: var(--primary-dark);
  text-align: right;
  font-variant-numeric: tabular-nums;
}

.kpi-detail-item .po-loantypes {
  color: var(--text-muted);
  text-align: right;
  font-size: 0.8rem;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  max-width: 120px;
}

/* Scrollbar Styling for Detail Panels */
.kpi-detail-panel::-webkit-scrollbar {
  width: 6px;
}
.kpi-detail-panel::-webkit-scrollbar-track {
  background: var(--primary-light);
  border-radius: 3px;
}
.kpi-detail-panel::-webkit-scrollbar-thumb {
  background: var(--primary);
  border-radius: 3px;
}
.kpi-detail-panel::-webkit-scrollbar-thumb:hover {
  background: var(--primary-dark);
}

/* Responsive Adjustments */
@media (max-width: 768px) {
  .kpi-grid {
    grid-template-columns: repeat(2, 1fr);
  }
  
  .kpi-detail-item {
    grid-template-columns: 50px 1fr auto;
    font-size: 0.8rem;
    padding: 0.4rem 0.6rem;
  }
  
  .kpi-value {
    font-size: 1.5rem;
  }
  
  .kpi-controls {
    justify-content: center;
  }
}

@media (max-width: 480px) {
  .kpi-grid {
    grid-template-columns: 1fr;
  }
  
  .kpi-detail-item {
    grid-template-columns: 1fr;
    grid-template-areas:
      "code name"
      "value value";
    text-align: center;
  }
  
  .kpi-detail-item .po-code { grid-area: code; }
  .kpi-detail-item .po-name { grid-area: name; }
  .kpi-detail-item .po-value,
  .kpi-detail-item .po-loantypes { grid-area: value; }
  
  .kpi-value {
    font-size: 1.4rem;
  }
}

/* 📋 Hierarchical Loan Table Styling */

/* Sticky PO Hierarchy Column */
.sticky-col.po-hierarchy {
  position: sticky;
  left: 0;
  background: #fff;
  z-index: 10;
  border-right: 2px solid var(--primary-light) !important;
  min-width: 220px;
  padding: 0.8rem 0.6rem !important;
}

/* Loan Type Header Row */
.loan-type-header {
  background: linear-gradient(135deg, #f0fdff 0%, #e0f7fa 100%);
  border-bottom: 2px solid var(--primary);
  cursor: pointer;
  transition: background 0.2s ease;
}

.loan-type-header:hover {
  background: linear-gradient(135deg, #e0f7fa 0%, #cffafe 100%);
}

.loan-type-cell {
  font-weight: 700;
  color: var(--primary-dark);
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.toggle-icon {
  font-size: 1rem;
  transition: transform 0.2s ease;
  display: inline-block;
}

.loan-code {
  color: var(--text-muted);
  font-weight: 400;
  margin-left: 0.25rem;
}

/* PO Detail Rows */
.po-detail-row {
  background: #fff;
  border-bottom: 1px solid #f1f5f9;
  transition: background 0.2s ease;
}

.po-detail-row.hidden {
  display: none;
}

.po-detail-row:hover {
  background: #f8fdff;
}

.po-cell {
  padding-left: 2.5rem !important;
  color: var(--text);
}

.po-indent {
  font-weight: 600;
  color: var(--primary-dark);
}

.po-name {
  display: block;
  font-size: 0.8rem;
  color: var(--text-muted);
  margin-top: 0.1rem;
}

/* Numeric Column Styling */
#unit-loan-budg-tbody td.text-right {
  text-align: right !important;
  font-variant-numeric: tabular-nums;
  font-size: 0.9rem;
}

#unit-loan-budg-tbody td.bold {
  font-weight: 700;
  color: var(--primary-dark);
}

/* Table Controls */
.table-controls {
  display: flex;
  gap: 1rem;
  align-items: center;
  margin-top: 1rem;
  padding: 0.75rem 1rem;
  background: #f8fafc;
  border-radius: 8px;
  border: 1px solid var(--primary-light);
}

.toggle-all-btn {
  background: linear-gradient(135deg, var(--primary), var(--primary-dark));
  color: white;
  border: none;
  padding: 0.5rem 1rem;
  border-radius: 6px;
  font-size: 0.85rem;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.2s ease;
}

.toggle-all-btn:hover {
  transform: translateY(-2px);
  box-shadow: 0 4px 12px rgba(6, 182, 212, 0.3);
}

.table-note {
  margin-left: auto;
  color: var(--text-muted);
  font-size: 0.85rem;
}

/* Grand Total Row */
.loan-table-section tfoot td {
  background: linear-gradient(135deg, #f0f9ff 0%, #e0f2fe 100%);
  border-top: 3px solid var(--primary);
  font-weight: 700;
  color: var(--primary-dark);
  padding: 1rem 0.8rem !important;
  font-size: 0.95rem;
}

.loan-table-section tfoot td:first-child {
  background: linear-gradient(90deg, #e0f2fe 95%, transparent);
}

/* Responsive Adjustments */
@media (max-width: 1024px) {
  .sticky-col.po-hierarchy {
    min-width: 180px;
    font-size: 0.85rem;
  }
  
  .po-cell {
    padding-left: 2rem !important;
  }
}

@media (max-width: 768px) {
  .table-controls {
    flex-direction: column;
    align-items: flex-start;
    gap: 0.5rem;
  }
  
  .table-note {
    margin-left: 0;
  }
  
  .sticky-col.po-hierarchy {
    min-width: 150px;
    font-size: 0.8rem;
  }
  
  #unit-loan-budg-tbody td {
    padding: 0.6rem 0.5rem !important;
    font-size: 0.85rem;
  }
}

@media (max-width: 480px) {
  .sticky-col.po-hierarchy {
    min-width: 120px;
  }
  
  .loan-code, .po-name {
    display: none;
  }
}

/* 📋 Monthly Breakdown Table - Ensure Visibility */
#sales-tbody tr {
  display: table-row !important;
  opacity: 1 !important;
}

#sales-tbody td {
  padding: 0.8rem 1rem;
  font-size: 0.9rem;
}

/* Ensure TOTAL row stands out */
#sales-tfoot tr.sales-total-row {
  background: linear-gradient(135deg, #f0f9ff 0%, #e0f2fe 100%) !important;
  border-top: 3px solid var(--primary);
  font-weight: 700;
}

#sales-tfoot tr.sales-total-row td {
  padding: 1rem !important;
  color: var(--primary-dark);
}

/* Status badge colors */
.status-good { color: #10b981; font-weight: 600; }
.status-warn { color: #f59e0b; font-weight: 600; }
.status-danger { color: #ef4444; font-weight: 600; }

/* 📈 Ensure Chart Visibility */
.chart-section {
  min-height: 350px !important;
  position: relative;
}

#salesChart {
  width: 100% !important;
  height: 100% !important;
  display: block !important;
}

/* Ensure table rows are visible */
#sales-tbody tr {
  display: table-row !important;
  opacity: 1 !important;
  visibility: visible !important;
}

#sales-tbody td {
  padding: 0.75rem 1rem !important;
}

/* 📊 PO Summary Table TOTAL Row */
.po-summary-section tfoot {
  border-top: 3px solid var(--primary);
}

.po-summary-total-row {
  background: linear-gradient(135deg, #f0f9ff 0%, #e0f2fe 100%) !important;
  font-weight: 700;
  color: var(--primary-dark);
}

.po-summary-total-row td {
  padding: 1rem 0.8rem !important;
  border-top: 2px solid var(--primary);
}

.po-summary-total-row td:first-child {
  background: linear-gradient(90deg, #e0f2fe 95%, transparent);
  border-right: 1px solid var(--primary-light);
}

/* Ensure PO Summary table has proper spacing */
.po-summary-section .table-responsive {
  overflow-x: auto;
  border-radius: 8px;
  border: 1px solid var(--primary-light);
}

.po-summary-section table {
  width: 100%;
  border-collapse: collapse;
  background: #fff;
  min-width: 800px;
}

.po-summary-section th {
  padding: 0.9rem 0.8rem;
  text-align: right;
  font-weight: 600;
  font-size: 0.75rem;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  white-space: nowrap;
  background: linear-gradient(135deg, var(--primary), var(--primary-dark));
  color: white;
}

.po-summary-section th:first-child {
  text-align: left;
  min-width: 100px;
}

.po-summary-section td {
  padding: 0.8rem;
  font-size: 0.9rem;
  border-bottom: 1px solid #f1f5f9;
}

.po-summary-section td:first-child {
  text-align: left;
  font-weight: 600;
  color: var(--primary-dark);
  border-right: 1px solid #f1f5f9;
}

.po-summary-section td.text-right {
  text-align: right !important;
  font-variant-numeric: tabular-nums;
}

.po-summary-section td.text-center {
  text-align: center !important;
}

/* Status badge alignment */
.po-summary-section .status-badge {
  display: inline-block;
  padding: 0.25rem 0.75rem;
  border-radius: 20px;
  font-size: 0.75rem;
  font-weight: 600;
}

/* Responsive adjustments */
@media (max-width: 768px) {
  .po-summary-section th,
  .po-summary-section td {
    padding: 0.6rem 0.5rem;
    font-size: 0.8rem;
  }
  
  .po-summary-section .status-badge {
    padding: 0.2rem 0.5rem;
    font-size: 0.7rem;
  }
}

/* 📅 Monthly Budget Allocation Table */
.monthly-budget-section .table-responsive {
  overflow-x: auto;
  border-radius: 8px;
  border: 1px solid var(--primary-light);
}

#monthly-budget-table {
  min-width: 1300px;
  border-collapse: separate;
  border-spacing: 0;
  background: #fff;
}

#monthly-budget-table th,
#monthly-budget-table td {
  padding: 0.6rem 0.5rem;
  font-size: 0.85rem;
  border-bottom: 1px solid var(--border);
  border-right: 1px solid #f1f5f9;
  text-align: center;
  transition: background 0.2s ease;
}

/* ============================================================ */
/* 🎨 ALTERNATING CYAN SHADES FOR MONTH COLUMNS                 */
/* Columns 3-14 = Jan through Dec                               */
/* ============================================================ */

/* Light Cyan (odd month columns: Jan, Mar, May, Jul, Sep, Nov) */
#monthly-budget-table thead th:nth-child(n+3):nth-child(-n+14):nth-child(odd),
#monthly-budget-table tbody td:nth-child(n+3):nth-child(-n+14):nth-child(odd),
#monthly-budget-table tfoot td:nth-child(n+3):nth-child(-n+14):nth-child(odd) {
  background: #f0fdff; /* Lightest cyan */
}

/* Slightly Darker Cyan (even month columns: Feb, Apr, Jun, Aug, Oct, Dec) */
#monthly-budget-table thead th:nth-child(n+3):nth-child(-n+14):nth-child(even),
#monthly-budget-table tbody td:nth-child(n+3):nth-child(-n+14):nth-child(even),
#monthly-budget-table tfoot td:nth-child(n+3):nth-child(-n+14):nth-child(even) {
  background: #e0f7fa; /* Slightly darker cyan */
}

/* Header gets a gradient overlay for visual distinction */
#monthly-budget-table thead th:nth-child(n+3):nth-child(-n+14) {
  color: var(--primary-dark);
  font-weight: 700;
  background-blend-mode: overlay;
  border-bottom: 2px solid var(--primary);
}

/* ============================================================ */
/* 📌 STICKY COLUMNS (PO Code & PO Name)                        */
/* ============================================================ */
.sticky-col.po-code {
  position: sticky;
  left: 0;
  z-index: 16;
  min-width: 80px;
  background: #ffffff !important;
  border-right: 2px solid var(--primary) !important;
  font-weight: 700;
  color: var(--primary-dark);
}

.sticky-col.po-name {
  position: sticky;
  left: 80px;
  z-index: 15;
  min-width: 120px;
  text-align: left !important;
  background: #ffffff !important;
  border-right: 2px solid var(--primary-light) !important;
  box-shadow: 2px 0 5px rgba(0,0,0,0.05);
}

/* Grand total row: keep sticky cols distinct */
.grand-total-row .sticky-col.po-code {
  background: linear-gradient(90deg, #e0f2fe 95%, transparent) !important;
}
.grand-total-row .sticky-col.po-name {
  background: linear-gradient(90deg, #e0f2fe 95%, transparent) !important;
}

/* ============================================================ */
/* 💰 TOTAL COLUMN (rightmost)                                  */
/* ============================================================ */
#monthly-budget-table th.total-col,
#monthly-budget-table td.total-col {
  background: linear-gradient(135deg, #dcfce7 0%, #bbf7d0 100%) !important;
  color: #166534;
  font-weight: 700;
  min-width: 110px;
  border-left: 2px solid var(--primary) !important;
}

#monthly-budget-table thead th.total-col {
  background: linear-gradient(135deg, #10b981 0%, #059669 100%) !important;
  color: white;
}

/* ============================================================ */
/* 📊 GRAND TOTAL ROW                                           */
/* ============================================================ */
.grand-total-row {
  border-top: 3px solid var(--primary);
}

.grand-total-row td {
  padding: 0.8rem 0.5rem !important;
  font-size: 0.9rem;
  color: var(--primary-dark);
}

/* ============================================================ */
/* 💎 MONTH CELL METRICS                                        */
/* ============================================================ */
.month-cell {
  min-width: 90px;
  vertical-align: top;
}

.budget-metric {
  display: flex;
  align-items: center;
  gap: 0.4rem;
  padding: 0.25rem 0;
  font-size: 0.8rem;
  justify-content: flex-end;
}

.budget-metric.client {
  color: var(--text);
  border-bottom: 1px dashed #e2e8f0;
}

.budget-metric.loan {
  color: var(--primary-dark);
  font-weight: 600;
}

/* ============================================================ */
/* ✨ HOVER EFFECT (overrides alternating for better UX)        */
/* ============================================================ */
#monthly-budget-table tbody tr:hover td {
  background: linear-gradient(135deg, #cffafe 0%, #a5f3fc 100%) !important;
  transition: background 0.15s ease;
}

#monthly-budget-table tbody tr:hover .sticky-col.po-code,
#monthly-budget-table tbody tr:hover .sticky-col.po-name {
  background: linear-gradient(135deg, #cffafe 0%, #a5f3fc 100%) !important;
}

#monthly-budget-table tbody tr:hover td.total-col {
  background: linear-gradient(135deg, #86efac 0%, #4ade80 100%) !important;
}

/* ============================================================ */
/* 📱 RESPONSIVE                                                */
/* ============================================================ */
@media (max-width: 768px) {
  #monthly-budget-table th,
  #monthly-budget-table td {
    padding: 0.5rem 0.4rem;
    font-size: 0.8rem;
  }
  
  .month-cell { min-width: 80px; }
  .budget-metric { font-size: 0.75rem; }
}