/* Beacon35 Reports & Analytics Styles */

/* KPI Cards Grid */
.report-kpi-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 16px; margin-bottom: 24px; }
.report-kpi-card { background: var(--bg-card); border-radius: 10px; padding: 20px; text-align: center; border: 1px solid var(--border-color); box-shadow: var(--shadow-sm); }
.report-kpi-value { font-size: 32px; font-weight: 700; line-height: 1.1; }
.report-kpi-label { font-size: 12px; color: var(--text-muted); margin-top: 6px; text-transform: uppercase; letter-spacing: 0.5px; }
.report-kpi-sub { font-size: 11px; color: var(--text-light); margin-top: 4px; }
.report-kpi-change { font-size: 11px; margin-top: 4px; font-weight: 600; }
.report-kpi-change.positive { color: #16a34a; }
.report-kpi-change.negative { color: #dc2626; }
.report-kpi-change.neutral { color: var(--text-muted); }

/* Chart Grid */
.report-chart-grid { display: grid; grid-template-columns: repeat(2, 1fr); gap: 20px; margin-bottom: 24px; }
.report-chart-card { background: var(--bg-card); border: 1px solid var(--border-color); border-radius: var(--radius); padding: 20px; box-shadow: var(--shadow-sm); }
.report-chart-title { font-size: 14px; font-weight: 600; color: var(--text-primary); margin-bottom: 4px; }
.report-chart-subtitle { font-size: 12px; color: var(--text-muted); margin-bottom: 12px; }
.report-chart-full { grid-column: span 2; }
.report-chart-container { position: relative; width: 100%; min-height: 250px; }

/* Tab bar */
.report-tabs { display: flex; gap: 4px; border-bottom: 2px solid var(--border-color); margin-bottom: 24px; overflow-x: auto; -webkit-overflow-scrolling: touch; padding-bottom: 0; }
.report-tab { padding: 10px 16px; font-size: 13px; font-weight: 500; color: var(--text-muted); cursor: pointer; border: none; background: none; border-bottom: 2px solid transparent; margin-bottom: -2px; white-space: nowrap; min-height: 44px; transition: color .15s, border-color .15s; }
.report-tab:hover { color: var(--text-primary); }
.report-tab.active { color: var(--accent-primary); border-bottom-color: var(--accent-primary); font-weight: 600; }

/* Date range picker */
.report-date-bar { display: flex; align-items: center; gap: 12px; margin-bottom: 20px; flex-wrap: wrap; }
.report-date-bar select { padding: 8px 12px; border-radius: 6px; border: 1px solid var(--border-color); background: var(--bg-input); color: var(--text-primary); font-size: 13px; min-height: 40px; }
.report-date-bar input[type="date"] { padding: 8px 12px; border-radius: 6px; border: 1px solid var(--border-color); background: var(--bg-input); color: var(--text-primary); font-size: 13px; min-height: 40px; }

/* Data Tables */
.report-table-wrapper { overflow-x: auto; border: 1px solid var(--border-color); border-radius: var(--radius); margin-bottom: 24px; }
.report-table { width: 100%; border-collapse: collapse; font-size: 13px; }
.report-table th { background: var(--bg-section); padding: 12px 14px; text-align: left; font-weight: 600; color: var(--text-secondary); border-bottom: 2px solid var(--border-color); white-space: nowrap; position: sticky; top: 0; z-index: 1; }
.report-table td { padding: 10px 14px; border-bottom: 1px solid var(--border-color); color: var(--text-primary); }
.report-table tr:last-child td { border-bottom: none; }
.report-table tr:hover td { background: var(--bg-hover); }
.report-table .text-right { text-align: right; }
.report-table .text-center { text-align: center; }
.report-table .text-muted { color: var(--text-muted); }

/* Status badges */
.report-badge { display: inline-block; padding: 3px 10px; border-radius: 12px; font-size: 11px; font-weight: 600; }
.report-badge-green { background: #dcfce7; color: #16a34a; }
.report-badge-yellow { background: #fef9c3; color: #a16207; }
.report-badge-red { background: #fee2e2; color: #dc2626; }
.report-badge-blue { background: #dbeafe; color: #2563eb; }
.report-badge-gray { background: var(--bg-section); color: var(--text-muted); }
[data-theme="dark"] .report-badge-green { background: #052e16; color: #4ade80; }
[data-theme="dark"] .report-badge-yellow { background: #422006; color: #facc15; }
[data-theme="dark"] .report-badge-red { background: #450a0a; color: #f87171; }
[data-theme="dark"] .report-badge-blue { background: #172554; color: #60a5fa; }

/* ISO Scorecard */
.report-scorecard { display: grid; grid-template-columns: repeat(3, 1fr); gap: 16px; margin-bottom: 24px; }
.report-score-item { background: var(--bg-card); border: 1px solid var(--border-color); border-radius: var(--radius); padding: 16px; text-align: center; }
.report-score-indicator { width: 48px; height: 48px; border-radius: 50%; margin: 0 auto 10px; display: flex; align-items: center; justify-content: center; font-weight: 700; font-size: 14px; color: white; }
.report-score-indicator.green { background: #16a34a; }
.report-score-indicator.yellow { background: #ca8a04; }
.report-score-indicator.red { background: #dc2626; }
.report-score-label { font-size: 13px; font-weight: 600; color: var(--text-primary); margin-bottom: 4px; }
.report-score-value { font-size: 12px; color: var(--text-muted); }

/* Section headers */
.report-section-header { font-size: 16px; font-weight: 600; color: var(--text-primary); margin: 24px 0 12px; padding-bottom: 8px; border-bottom: 1px solid var(--border-color); }
.report-section-header:first-child { margin-top: 0; }

/* Empty state */
.report-empty { text-align: center; padding: 48px 20px; color: var(--text-muted); }
.report-empty-icon { width: 48px; height: 48px; margin: 0 auto 12px; color: var(--text-light); }
.report-empty-title { font-size: 16px; font-weight: 600; margin-bottom: 4px; color: var(--text-secondary); }
.report-empty-text { font-size: 13px; }

/* Loading skeleton */
.report-loading { padding: 0; }
@keyframes reportShimmer {
    0% { background-position: -400px 0; }
    100% { background-position: 400px 0; }
}
.report-skeleton {
    background: var(--bg-section);
    background-image: linear-gradient(90deg, var(--bg-section) 0%, var(--bg-hover) 40%, var(--bg-section) 80%);
    background-size: 400px 100%;
    animation: reportShimmer 1.4s ease-in-out infinite;
    border-radius: var(--radius);
}
.report-skeleton-kpi { height: 88px; }
.report-skeleton-chart { height: 280px; }
.report-skeleton-table { height: 160px; }

/* Export dropdown */
.report-export-dropdown { position: relative; display: inline-block; }
.report-export-menu { position: absolute; right: 0; top: 100%; margin-top: 4px; background: var(--bg-card); border: 1px solid var(--border-color); border-radius: var(--radius); box-shadow: var(--shadow-lg); z-index: 100; min-width: 180px; display: none; }
.report-export-menu.show { display: block; }
.report-export-menu button { display: flex; align-items: center; gap: 8px; width: 100%; padding: 10px 16px; border: none; background: none; cursor: pointer; font-size: 13px; color: var(--text-primary); text-align: left; min-height: 40px; }
.report-export-menu button:hover { background: var(--bg-hover); }

/* Progress bar */
.report-progress-bar { width: 100%; height: 8px; background: var(--bg-section); border-radius: 4px; overflow: hidden; margin: 8px 0; }
.report-progress-fill { height: 100%; border-radius: 4px; transition: width 0.5s ease; }

/* Responsive */
@media (max-width: 900px) {
    .report-kpi-grid { grid-template-columns: repeat(2, 1fr); }
    .report-scorecard { grid-template-columns: repeat(2, 1fr); }
}
@media (max-width: 768px) {
    .report-chart-grid { grid-template-columns: 1fr; }
    .report-chart-full { grid-column: span 1; }
    .report-kpi-value { font-size: 24px; }
    .report-date-bar { flex-direction: column; align-items: stretch; }
}
@media (max-width: 480px) {
    .report-kpi-grid { grid-template-columns: 1fr 1fr; gap: 10px; }
    .report-kpi-card { padding: 14px; }
    .report-scorecard { grid-template-columns: 1fr; }
}

/* Print styles */
@media print {
    body { background: white !important; color: black !important; }
    .btn, .report-tabs, .report-date-bar, .report-export-dropdown, .app-footer, .header-left .btn { display: none !important; }
    .report-chart-card { break-inside: avoid; page-break-inside: avoid; border: 1px solid #ccc; box-shadow: none; }
    .report-kpi-card { break-inside: avoid; border: 1px solid #ccc; box-shadow: none; }
    .report-table-wrapper { border: 1px solid #ccc; }
    .card { box-shadow: none !important; border: 1px solid #ccc; }
    .container { max-width: 100%; padding: 0; }
    .report-kpi-value { color: black !important; }
    .report-chart-grid { gap: 12px; }
}
