/* Financial Reports - Modern Clean Design */
/* Built from scratch for R01-A0111 reports */

/* Modal Overlay and Structure */
.financial-modal-overlay {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background-color: rgba(0, 0, 0, 0.85);
  z-index: 99999;
  overflow-y: auto;
  padding: 20px;
}

.financial-modal-container {
  min-height: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 20px 0;
}

.financial-modal-dialog {
  background: white;
  border-radius: 12px;
  box-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.25);
  width: 100%;
  max-width: 1200px;
  margin: 0 auto;
  display: flex;
  flex-direction: column;
  max-height: 90vh;
}

.financial-modal-header {
  background: linear-gradient(135deg, #1e293b 0%, #334155 100%);
  padding: 20px 30px;
  border-radius: 12px 12px 0 0;
  display: flex;
  align-items: center;
  justify-content: space-between;
  border-bottom: 3px solid #0f172a;
  flex-shrink: 0;
}

.financial-modal-title {
  font-size: 22px;
  font-weight: 700;
  color: white;
  margin: 0;
  display: flex;
  align-items: center;
  gap: 12px;
}

.financial-modal-title i {
  font-size: 24px;
}

.financial-modal-close {
  background: white;
  color: #1e293b;
  padding: 10px 20px;
  border-radius: 8px;
  font-weight: 600;
  border: none;
  cursor: pointer;
  transition: all 0.2s ease;
  box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.1);
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 14px;
}

.financial-modal-close:hover {
  background: #f1f5f9;
  transform: translateY(-2px);
  box-shadow: 0 6px 8px -1px rgba(0, 0, 0, 0.15);
}

.financial-modal-body {
  padding: 30px;
  background: #f8fafc;
  border-radius: 0 0 12px 12px;
  overflow-y: auto;
  flex: 1;
}

/* Main Container */
.financial-report-container {
  max-width: 100%;
  margin: 0 auto;
}

/* Report Header Card */
.report-header-card {
  background: linear-gradient(135deg, #f8fafc 0%, #e2e8f0 100%);
  border: 1px solid #cbd5e1;
  border-radius: 12px;
  padding: 24px;
  margin-bottom: 24px;
}

.report-header-content {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 20px;
}

.report-title-section {
  flex: 1;
}

.report-main-title {
  font-size: 28px;
  font-weight: 700;
  color: #1e293b;
  margin: 0 0 8px 0;
  line-height: 1.2;
}

.report-subtitle {
  font-size: 16px;
  color: #64748b;
  margin: 0;
  font-weight: 500;
}

.report-date-section {
  text-align: right;
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.report-date-label {
  font-size: 12px;
  color: #64748b;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  font-weight: 600;
}

.report-date-value {
  font-size: 18px;
  color: #1e293b;
  font-weight: 700;
}

/* KPI Cards Grid */
.kpi-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
  gap: 20px;
  margin-bottom: 24px;
}

.kpi-card {
  border-radius: 12px;
  padding: 24px;
  color: white;
  position: relative;
  overflow: hidden;
  transition: transform 0.3s ease, box-shadow 0.3s ease;
  box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.1), 0 2px 4px -1px rgba(0, 0, 0, 0.06);
}

.kpi-card:hover {
  transform: translateY(-4px);
  box-shadow: 0 10px 15px -3px rgba(0, 0, 0, 0.1), 0 4px 6px -2px rgba(0, 0, 0, 0.05);
}

.kpi-card-blue {
  background: linear-gradient(135deg, #3b82f6 0%, #2563eb 100%);
}

.kpi-card-green {
  background: linear-gradient(135deg, #10b981 0%, #059669 100%);
}

.kpi-card-purple {
  background: linear-gradient(135deg, #8b5cf6 0%, #7c3aed 100%);
}

.kpi-card-inner {
  display: flex;
  gap: 16px;
  align-items: flex-start;
}

.kpi-icon {
  flex-shrink: 0;
  opacity: 0.9;
}

.kpi-content {
  flex: 1;
}

.kpi-label {
  font-size: 12px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  margin-bottom: 8px;
  opacity: 0.9;
}

.kpi-value {
  font-size: 32px;
  font-weight: 800;
  margin-bottom: 4px;
  line-height: 1;
}

.kpi-description {
  font-size: 13px;
  opacity: 0.85;
}

/* Stats Grid (for details page) */
.stats-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  gap: 16px;
  margin-bottom: 24px;
}

.stat-card {
  border-radius: 12px;
  padding: 20px;
  border-left: 4px solid;
  transition: transform 0.2s ease;
}

.stat-card:hover {
  transform: translateX(4px);
}

.stat-card-blue {
  background: #eff6ff;
  border-left-color: #3b82f6;
}

.stat-card-green {
  background: #f0fdf4;
  border-left-color: #10b981;
}

.stat-card-purple {
  background: #f5f3ff;
  border-left-color: #8b5cf6;
}

.stat-label {
  font-size: 12px;
  font-weight: 600;
  color: #64748b;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  margin-bottom: 8px;
}

.stat-value {
  font-size: 28px;
  font-weight: 800;
  color: #1e293b;
}

/* Table Card */
.table-card {
  background: white;
  border-radius: 12px;
  border: 1px solid #e2e8f0;
  overflow: hidden;
  margin-bottom: 24px;
  box-shadow: 0 1px 3px 0 rgba(0, 0, 0, 0.1), 0 1px 2px 0 rgba(0, 0, 0, 0.06);
}

.table-card-header {
  background: linear-gradient(135deg, #1e293b 0%, #334155 100%);
  padding: 16px 24px;
  border-bottom: 2px solid #0f172a;
}

.table-card-title {
  font-size: 18px;
  font-weight: 700;
  color: white;
  margin: 0;
}

.table-wrapper {
  overflow-x: auto;
}

/* Modern Table */
.modern-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 14px;
}

.modern-table thead {
  background: linear-gradient(135deg, #475569 0%, #64748b 100%);
}

.modern-table thead th {
  padding: 14px 16px;
  font-weight: 600;
  color: white;
  text-transform: uppercase;
  font-size: 11px;
  letter-spacing: 0.5px;
  border-bottom: 2px solid #334155;
}

.modern-table tbody .table-row {
  border-bottom: 1px solid #e2e8f0;
  transition: background-color 0.15s ease;
}

.modern-table tbody .table-row:hover {
  background-color: #f8fafc;
}

.modern-table tbody .row-even {
  background-color: #ffffff;
}

.modern-table tbody .row-odd {
  background-color: #f9fafb;
}

.modern-table tbody .row-odd:hover {
  background-color: #f1f5f9;
}

.modern-table tbody td {
  padding: 12px 16px;
  color: #334155;
}

.modern-table tbody .table-row-total {
  background: linear-gradient(135deg, #f1f5f9 0%, #e2e8f0 100%);
  border-top: 3px solid #3b82f6;
  border-bottom: 3px solid #3b82f6;
  font-weight: 700;
}

.modern-table tbody .table-row-total td {
  padding: 16px;
  font-size: 15px;
  color: #1e293b;
}

/* Percentage Badge */
.percentage-badge {
  display: inline-block;
  background: linear-gradient(135deg, #10b981 0%, #059669 100%);
  color: white;
  padding: 4px 12px;
  border-radius: 999px;
  font-weight: 600;
  font-size: 12px;
  box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
}

/* Info Note */
.info-note {
  background: linear-gradient(135deg, #dbeafe 0%, #bfdbfe 100%);
  border-left: 4px solid #3b82f6;
  padding: 16px 20px;
  border-radius: 8px;
  color: #1e40af;
  font-size: 14px;
  display: flex;
  align-items: flex-start;
  gap: 12px;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.05);
}

.info-note svg {
  flex-shrink: 0;
  margin-top: 2px;
}

.info-note-text {
  flex: 1;
  line-height: 1.5;
}

/* Utility Classes */
.text-left {
  text-align: left;
}

.text-right {
  text-align: right;
}

.font-mono {
  font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, monospace;
}

.font-semibold {
  font-weight: 600;
}

.font-bold {
  font-weight: 700;
}

.text-sm {
  font-size: 14px;
}

/* Responsive Design */
@media (max-width: 768px) {
  .financial-modal-overlay {
    padding: 10px;
  }

  .financial-modal-dialog {
    max-height: 95vh;
  }

  .financial-modal-header {
    padding: 15px 20px;
    flex-wrap: wrap;
    gap: 10px;
  }

  .financial-modal-title {
    font-size: 18px;
  }

  .financial-modal-body {
    padding: 20px;
  }

  .report-header-content {
    flex-direction: column;
    align-items: flex-start;
  }

  .report-date-section {
    text-align: left;
  }

  .report-main-title {
    font-size: 22px;
  }

  .kpi-grid {
    grid-template-columns: 1fr;
  }

  .kpi-value {
    font-size: 24px;
  }

  .stats-grid {
    grid-template-columns: 1fr;
  }

  .modern-table {
    font-size: 12px;
  }

  .modern-table thead th,
  .modern-table tbody td {
    padding: 8px 12px;
  }
}

/* Print Styles */
@media print {
  #closeFinancialReport {
    display: none;
  }

  .kpi-card,
  .table-card {
    page-break-inside: avoid;
    box-shadow: none;
    border: 1px solid #e2e8f0;
  }

  .kpi-card {
    color: #1e293b;
    background: white !important;
  }

  .kpi-value {
    color: #1e293b;
  }
}
