
/* ============ FILES ============ */
.files-screen .upload-zone {
  background: var(--bg-glass);
  backdrop-filter: blur(40px) saturate(200%);
  -webkit-backdrop-filter: blur(40px) saturate(200%);
  border: 2px dashed rgba(200, 16, 46, 0.28);
  border-radius: 24px;
  padding: 48px 32px;
  text-align: center;
  cursor: pointer;
  transition: all 250ms cubic-bezier(0.32, 0.72, 0, 1);
  position: relative;
  overflow: hidden;
  margin-bottom: 28px;
}
.upload-zone:hover, .upload-zone.dragging {
  border-color: var(--kw-red);
  background: var(--bg-glass-strong, var(--bg-glass));
  transform: scale(1.005);
  box-shadow: 0 12px 32px -12px rgba(200,16,46,0.2);
}
.upload-zone.dragging::before {
  content: '';
  position: absolute; inset: 0;
  background: radial-gradient(ellipse at center, rgba(200,16,46,0.08), transparent 70%);
  pointer-events: none;
  animation: mm-pulse 1.5s ease-in-out infinite;
}
.upload-icon { font-size: 40px; margin-bottom: 12px; line-height: 1; }
.upload-title { font-size: 18px; font-weight: 600; letter-spacing: -0.015em; margin-bottom: 4px; }
.upload-sub { font-size: 14px; color: var(--text-secondary); margin-bottom: 14px; }
.upload-types { font-size: 12px; color: var(--text-tertiary); }

.files-section-h {
  font-size: 18px; font-weight: 600; letter-spacing: -0.015em;
  margin: 8px 0 14px;
}

.files-list { display: flex; flex-direction: column; gap: 8px; }

.file-row {
  display: flex; align-items: center; gap: 14px;
  text-align: left;
  background: var(--bg-glass);
  backdrop-filter: blur(40px) saturate(200%);
  -webkit-backdrop-filter: blur(40px) saturate(200%);
  border: 1px solid var(--separator);
  border-radius: 14px;
  padding: 14px 16px;
  transition: all 220ms cubic-bezier(0.32, 0.72, 0, 1);
  opacity: 0;
  animation: tv3-cardIn 380ms cubic-bezier(0.32, 0.72, 0, 1) forwards;
}
.file-row:hover {
  transform: translateY(-1px);
  border-color: var(--kw-red);
  box-shadow: 0 8px 22px -10px rgba(200,16,46,0.2);
}
.file-row-icon {
  flex-shrink: 0;
  width: 38px; height: 38px;
  border-radius: 10px;
  background: var(--bg-tinted);
  display: flex; align-items: center; justify-content: center;
  font-size: 18px;
}
.file-row-body { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 3px; }
.file-row-name { font-size: 14.5px; font-weight: 600; letter-spacing: -0.01em; }
.file-row-meta { font-size: 12px; color: var(--text-secondary); display: inline-flex; gap: 6px; align-items: center; flex-wrap: wrap; }
.file-row-chev { color: var(--text-tertiary); flex-shrink: 0; }
.file-row:hover .file-row-chev { color: var(--kw-red); }

.status-pill {
  display: inline-flex; align-items: center; gap: 6px;
  padding: 4px 10px;
  border-radius: 999px;
  font-size: 11.5px; font-weight: 500;
  flex-shrink: 0;
}
.status-pill .status-icon { font-size: 11px; }
.status-pill.analyzed { background: rgba(52,199,89,0.12); color: #34C759; }
.status-pill.parsed   { background: rgba(0,122,255,0.12); color: #007AFF; }
.status-pill.uploaded { background: var(--bg-tinted); color: var(--text-secondary); }
.status-pill.error    { background: rgba(200,16,46,0.12); color: var(--kw-red); }
.status-pill.pulse    { animation: mm-pulse 1.6s ease-in-out infinite; }

.file-insp-icon {
  width: 56px; height: 56px;
  border-radius: 16px;
  background: var(--bg-tinted);
  display: flex; align-items: center; justify-content: center;
  font-size: 28px;
}
.file-insp-name { font-size: 22px; word-break: break-word; }
.file-insp-metrics { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 6px; }
.file-insp-metrics li {
  display: flex; align-items: center; gap: 10px;
  padding: 8px 12px;
  background: var(--bg-tinted);
  border-radius: 10px;
  font-size: 13px;
}
.file-insp-metric-key { flex: 1; color: var(--text-secondary); }
.file-insp-metric-val { font-weight: 600; color: var(--text-primary); }
.file-insp-metric-period { font-size: 11px; color: var(--text-tertiary); min-width: 56px; text-align: right; }
.file-insp-note { font-size: 13.5px; line-height: 1.55; color: var(--text-primary); padding: 12px 14px; background: var(--bg-tinted); border-radius: 12px; }
.file-insp-pending { display: inline-flex; align-items: center; gap: 10px; font-size: 13.5px; color: var(--text-secondary); }
.file-insp-error { font-size: 13.5px; color: var(--kw-red); padding: 12px 14px; background: rgba(200,16,46,0.08); border-radius: 12px; }
.file-insp-foot { display: flex; gap: 8px; align-items: center; }
.file-insp-action {
  flex-shrink: 0;
  font-size: 12.5px; font-weight: 500;
  padding: 10px 14px; border-radius: 10px;
  background: var(--bg-tinted); color: var(--text-primary);
  transition: all 160ms;
}
.file-insp-action:hover { background: var(--separator); }
.file-insp-action.danger { color: var(--kw-red); }
.file-insp-action.danger:hover { background: rgba(200,16,46,0.12); }
.file-insp-primary { flex: 1; padding: 12px 14px; font-size: 13.5px; }

/* ============ ANALYTICS ============ */
.chart-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
  gap: 16px;
}
.chart-card {
  background: var(--bg-glass);
  backdrop-filter: blur(40px) saturate(200%);
  -webkit-backdrop-filter: blur(40px) saturate(200%);
  border: 1px solid rgba(255,255,255,0.4);
  border-radius: 20px;
  padding: 22px 22px 14px;
  transition: all 250ms cubic-bezier(0.32, 0.72, 0, 1);
  opacity: 0;
  animation: tv3-cardIn 420ms cubic-bezier(0.32, 0.72, 0, 1) forwards;
  box-shadow: 0 8px 24px -10px rgba(0,0,0,0.06), inset 0 1px 0 rgba(255,255,255,0.6);
}
[data-theme="dark"] .chart-card { border-color: rgba(255,255,255,0.06); box-shadow: 0 8px 24px -10px rgba(0,0,0,0.4), inset 0 1px 0 rgba(255,255,255,0.04); }
.chart-card:hover { transform: translateY(-2px); box-shadow: 0 16px 40px -16px rgba(0,0,0,0.14); }
.chart-label { font-size: 11px; font-weight: 600; text-transform: uppercase; letter-spacing: 0.06em; color: var(--text-tertiary); }
.chart-value { font-size: 32px; font-weight: 600; letter-spacing: -0.025em; margin: 6px 0 4px; display: flex; align-items: baseline; gap: 8px; line-height: 1.05; }
.chart-trend-arrow { font-size: 18px; }
.chart-trend-arrow.up { color: #34C759; }
.chart-trend-arrow.down { color: var(--kw-red); }
.chart-trend { font-size: 12.5px; color: var(--text-secondary); }
.chart-trend.up { color: #34C759; }
.chart-trend.down { color: var(--kw-red); }
.chart-svg-wrap { margin-top: 14px; position: relative; }
.chart-x-axis { display: flex; justify-content: space-between; margin-top: 6px; font-size: 10.5px; color: var(--text-tertiary); }

.chart-placeholder {
  display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 10px;
  border: 2px dashed var(--separator);
  border-radius: 20px;
  padding: 32px;
  color: var(--text-tertiary);
  font-size: 12.5px;
  line-height: 1.4;
  text-align: center;
  min-height: 220px;
  opacity: 0;
  animation: tv3-cardIn 420ms cubic-bezier(0.32, 0.72, 0, 1) forwards;
}

.insights-feed { display: flex; flex-direction: column; gap: 10px; }
.insight-card {
  background: var(--bg-glass);
  backdrop-filter: blur(40px) saturate(200%);
  -webkit-backdrop-filter: blur(40px) saturate(200%);
  border: 1px solid var(--separator);
  border-radius: 18px;
  padding: 20px 24px;
  opacity: 0;
  animation: tv3-cardIn 420ms cubic-bezier(0.32, 0.72, 0, 1) forwards;
}
.insight-meta { font-size: 11.5px; color: var(--text-tertiary); margin-bottom: 8px; }
.insight-file { color: var(--text-secondary); font-weight: 500; }
.insight-summary { font-size: 14.5px; line-height: 1.55; color: var(--text-primary); margin-bottom: 10px; }
.insight-highlights { padding-left: 16px; margin: 8px 0 12px; }
.insight-highlights li { font-size: 13px; color: var(--text-secondary); margin: 4px 0; line-height: 1.5; }
.insight-actions { display: flex; gap: 8px; flex-wrap: wrap; }
.insight-btn {
  display: inline-flex; align-items: center; gap: 6px;
  font-size: 12.5px; font-weight: 500;
  padding: 8px 14px; border-radius: 10px;
  background: var(--bg-tinted); color: var(--text-primary);
  transition: all 160ms;
}
.insight-btn:hover { background: var(--separator); }
.insight-btn.primary {
  background: linear-gradient(135deg, var(--kw-red) 0%, var(--kw-red-soft) 100%);
  color: #fff;
  box-shadow: 0 4px 12px -3px rgba(200,16,46,0.4);
}
.insight-btn.primary:hover { transform: translateY(-1px); filter: brightness(1.05); }
