/* ===================================================================
   REPORTS PAGE — Clean Data Extraction & Export
   =================================================================== */

/* ---------- Toolbar ---------- */
.report-toolbar {
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: var(--r-lg);
  padding: 16px 20px;
  margin-bottom: 20px;
}

.report-filter-row {
  display: flex;
  align-items: flex-end;
  flex-wrap: wrap;
  gap: 12px;
}

.report-filter-group {
  display: flex;
  flex-direction: column;
  gap: 4px;
  flex: 0 0 auto;
}

.report-filter-group:first-child {
  flex: 1 1 220px;
  min-width: 220px;
}

.report-filter-group label {
  font-size: 0.72rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  color: var(--text-muted);
}

.report-filter-group select,
.report-filter-group input[type="date"] {
  height: 40px;
  padding: 0 12px;
  font-size: 0.85rem;
  border: 1px solid var(--border-color);
  border-radius: var(--r-md);
  background: var(--bg-secondary);
  color: var(--text-primary);
  cursor: pointer;
}

.report-filter-group select:focus,
.report-filter-group input[type="date"]:focus {
  outline: none;
  border-color: var(--brand-yellow);
  box-shadow: 0 0 0 2px rgba(255, 229, 0, 0.15);
}

.report-btn-generate {
  height: 40px !important;
  padding: 0 20px !important;
  font-weight: 600 !important;
  display: inline-flex !important;
  align-items: center !important;
  gap: 6px !important;
}

.report-export-group {
  display: flex;
  gap: 8px;
  margin-left: auto;
}

.report-btn-csv,
.report-btn-pdf {
  height: 40px !important;
  padding: 0 16px !important;
  font-size: 0.82rem !important;
  font-weight: 600 !important;
  display: inline-flex !important;
  align-items: center !important;
  gap: 6px !important;
  border-radius: var(--r-md) !important;
  border: none !important;
  cursor: pointer;
  transition: all 0.2s;
}

.report-btn-csv {
  background: #16a34a !important;
  color: white !important;
}
.report-btn-csv:hover:not(:disabled) {
  background: #15803d !important;
  transform: translateY(-1px);
  box-shadow: 0 4px 12px rgba(22, 163, 74, 0.4);
}

.report-btn-pdf {
  background: #dc2626 !important;
  color: white !important;
}
.report-btn-pdf:hover:not(:disabled) {
  background: #b91c1c !important;
  transform: translateY(-1px);
  box-shadow: 0 4px 12px rgba(220, 38, 38, 0.4);
}

.report-btn-csv:disabled,
.report-btn-pdf:disabled {
  opacity: 0.4 !important;
  cursor: not-allowed;
  transform: none !important;
  box-shadow: none !important;
}

/* ---------- Summary Cards ---------- */
.report-summary {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(160px, 1fr));
  gap: 12px;
  margin-bottom: 20px;
}

.report-summary-card {
  display: flex;
  align-items: center;
  gap: 12px;
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: var(--r-lg);
  padding: 14px 18px;
  transition: transform 0.2s, box-shadow 0.2s;
}

.report-summary-card:hover {
  transform: translateY(-2px);
  box-shadow: 0 4px 16px rgba(0, 0, 0, 0.15);
}

.report-card-icon {
  font-size: 28px;
  color: var(--text-muted);
  opacity: 0.7;
}

.report-card-value {
  font-size: 1.4rem;
  font-weight: 700;
  line-height: 1.2;
}

.report-card-label {
  font-size: 0.72rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.3px;
  color: var(--text-muted);
  margin-top: 2px;
}

/* Color variants */
.report-card-success { border-left: 3px solid #22c55e; }
.report-card-success .report-card-icon { color: #22c55e; }
.report-card-success .report-card-value { color: #22c55e; }

.report-card-danger { border-left: 3px solid #ef4444; }
.report-card-danger .report-card-icon { color: #ef4444; }
.report-card-danger .report-card-value { color: #ef4444; }

.report-card-warning { border-left: 3px solid #f59e0b; }
.report-card-warning .report-card-icon { color: #f59e0b; }
.report-card-warning .report-card-value { color: #f59e0b; }

.report-card-info { border-left: 3px solid #3b82f6; }
.report-card-info .report-card-icon { color: #3b82f6; }
.report-card-info .report-card-value { color: #3b82f6; }

/* ---------- Data Table ---------- */
.report-table-wrapper {
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: var(--r-lg);
  overflow: hidden;
}

.report-count {
  padding: 12px 20px;
  font-size: 0.8rem;
  color: var(--text-muted);
  border-bottom: 1px solid var(--border-color);
}

.report-data-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.82rem;
}

.report-data-table thead th {
  position: sticky;
  top: 0;
  background: var(--bg-secondary);
  color: var(--text-secondary);
  font-size: 0.72rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.4px;
  padding: 10px 14px;
  border-bottom: 2px solid var(--border-color);
  white-space: nowrap;
  z-index: 2;
}

.report-data-table tbody td {
  padding: 8px 14px;
  border-bottom: 1px solid var(--border-light, rgba(255,255,255,0.04));
  color: var(--text-primary);
  max-width: 220px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.report-data-table tbody tr:hover {
  background: rgba(255, 229, 0, 0.04);
}

.report-data-table tbody tr.alt {
  background: rgba(255, 255, 255, 0.015);
}
.report-data-table tbody tr.alt:hover {
  background: rgba(255, 229, 0, 0.04);
}

/* Status Badges */
.report-status {
  display: inline-block;
  padding: 3px 10px;
  border-radius: 99px;
  font-size: 0.72rem;
  font-weight: 600;
  white-space: nowrap;
}

.report-status-success {
  background: rgba(34, 197, 94, 0.15);
  color: #22c55e;
}

.report-status-danger {
  background: rgba(239, 68, 68, 0.15);
  color: #ef4444;
}

.report-status-info {
  background: rgba(59, 130, 246, 0.15);
  color: #3b82f6;
}

/* ---------- Responsive ---------- */
@media (max-width: 768px) {
  .report-filter-row { flex-direction: column; align-items: stretch; }
  .report-filter-group { width: 100% !important; }
  .report-filter-group:first-child { min-width: unset; }
  .report-export-group { margin-left: 0; justify-content: stretch; }
  .report-export-group .btn { flex: 1; }
  .report-summary { grid-template-columns: repeat(2, 1fr); }
}

/* ---------- Print (PDF) ---------- */
@media print {
  body.printing-report .sidebar,
  body.printing-report .topbar,
  body.printing-report .report-toolbar,
  body.printing-report .report-summary,
  body.printing-report .modal-overlay,
  body.printing-report #realtime-indicator,
  body.printing-report #toast-container { display: none !important; }

  body.printing-report .main-content { margin: 0 !important; padding: 0 !important; }
  body.printing-report .page-content { padding: 0 !important; overflow: visible !important; }
  body.printing-report #report-print-header { display: flex !important; }

  body.printing-report .report-table-wrapper { 
    border: none; background: white; box-shadow: none; 
  }
  body.printing-report .report-count { display: none; }

  body.printing-report .report-data-table { font-size: 8pt; }
  body.printing-report .report-data-table thead th { 
    background: #eee !important; color: #000 !important;
    border-bottom: 2px solid #333; font-size: 7pt; padding: 6px 8px;
  }
  body.printing-report .report-data-table tbody td { 
    color: #000 !important; border-bottom: 1px solid #ccc; padding: 4px 8px;
    background: transparent !important;
  }
  body.printing-report .report-data-table tbody tr.alt { background: #f9f9f9 !important; }
  body.printing-report .report-data-table tbody tr:hover { background: transparent !important; }

  body.printing-report .report-status { 
    border: 1px solid #999; color: #000 !important; background: transparent !important; 
  }
}
