/* reports.css - Premium Analytics & Reporting Styles (Redesign) */

.reports-container {
  display: flex;
  flex-direction: column;
  gap: var(--sp-6);
}

/* ── Filter Header ── */
.reports-filter-bar {
  display: flex;
  justify-content: space-between;
  align-items: center;
  background: var(--surface);
  border: 1px solid var(--border);
  padding: 16px 24px;
  border-radius: var(--radius-xl);
  position: sticky;
  top: calc(var(--topbar-height) + 16px);
  z-index: 10;
  box-shadow: var(--shadow-sm);
  transition: box-shadow var(--transition-base);
}

.reports-filter-bar:hover {
  box-shadow: var(--shadow-md);
}

.filter-left {
  display: flex;
  gap: var(--sp-4);
  align-items: center;
}

.filter-right {
  display: flex;
  gap: var(--sp-4);
  align-items: center;
}

/* Search Input */
.search-input-wrapper {
  position: relative;
  display: flex;
  align-items: center;
}

.search-icon {
  position: absolute;
  left: 14px;
  color: var(--text-tertiary);
  pointer-events: none;
}

.premium-search {
  background: var(--bg-alt);
  border: 1px solid var(--border);
  color: var(--text-primary);
  padding: 8px 16px 8px 38px;
  font-size: 13px;
  font-weight: 500;
  border-radius: var(--radius-full);
  outline: none;
  width: 260px;
  transition: all var(--transition-base);
}

.premium-search::placeholder {
  color: var(--text-tertiary);
  font-weight: 400;
}

.premium-search:hover {
  border-color: var(--primary-light);
  box-shadow: 0 0 0 3px var(--primary-muted);
}

.premium-search:focus {
  border-color: var(--primary);
  box-shadow: 0 0 0 3px var(--primary-muted);
  background: var(--surface);
}

/* Time Pills (Matching native .badge aesthetic) */
.time-filter-group {
  display: flex;
  background: var(--bg-alt);
  padding: 4px;
  border-radius: var(--radius-full);
  border: 1px solid var(--border);
}

.time-pill {
  border: none;
  background: transparent;
  color: var(--text-secondary);
  padding: 6px 16px;
  font-size: 12px;
  font-weight: 600;
  border-radius: var(--radius-full);
  cursor: pointer;
  transition: all var(--transition-fast);
}

.time-pill:hover {
  color: var(--text-primary);
}

.time-pill.active {
  background: var(--surface);
  color: var(--primary);
  box-shadow: var(--shadow-xs);
}

/* Export Button */
.btn-export {
  display: flex;
  align-items: center;
  gap: 6px;
  background: var(--surface);
  border: 1px solid var(--border-strong);
  color: var(--text-primary);
  padding: 8px 16px;
  border-radius: var(--radius-full);
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
  transition: all var(--transition-base);
  box-shadow: var(--shadow-xs);
}

.btn-export:hover {
  border-color: var(--primary);
  color: var(--primary);
  transform: translateY(-1px);
  box-shadow: var(--shadow-sm);
}

/* Report Tabs */
.report-tabs {
  display: flex;
  gap: var(--sp-2);
}

.report-tab {
  background: transparent;
  border: none;
  color: var(--text-secondary);
  font-size: 14px;
  font-weight: 600;
  padding: 8px 16px;
  border-radius: var(--radius-md);
  cursor: pointer;
  position: relative;
  transition: all var(--transition-base);
}

.report-tab:hover {
  color: var(--text-primary);
  background: var(--bg-alt);
}

.report-tab.active {
  color: var(--primary);
  background: var(--primary-subtle);
}

/* ── Report Views ── */
.report-view {
  display: none;
  animation: scaleIn 0.35s var(--transition-spring) forwards;
}

.report-view.active {
  display: block;
}

/* ── Detailed Tables ── */
.detailed-table-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-xl);
  overflow: hidden;
  box-shadow: var(--shadow-xs);
  margin-top: var(--sp-6);
}

.dt-header {
  padding: var(--sp-5) var(--sp-6);
  border-bottom: 1px solid var(--border);
  display: flex;
  justify-content: space-between;
  align-items: center;
  background: var(--surface);
}

.dt-title {
  font-size: 16px;
  font-weight: 700;
  color: var(--text-primary);
}

.dt-table {
  width: 100%;
  border-collapse: collapse;
}

.dt-table th {
  text-align: left;
  padding: 14px 24px;
  font-size: 11px;
  font-weight: 700;
  color: var(--text-secondary);
  text-transform: uppercase;
  letter-spacing: 0.8px;
  border-bottom: 1px solid var(--border);
  background: var(--surface-elevated);
}

.dt-table td {
  padding: 16px 24px;
  font-size: 14px;
  font-weight: 500;
  color: var(--text-primary);
  border-bottom: 1px solid var(--border);
  transition: background var(--transition-fast);
}

.dt-table tr:last-child td {
  border-bottom: none;
}

.dt-table tr:hover td {
  background: var(--bg-alt);
}

.amount-cell {
  font-variant-numeric: tabular-nums;
  font-feature-settings: 'tnum';
  font-weight: 700;
  text-align: right;
  color: var(--text-primary);
}
.dt-table th.amount-col {
  text-align: right;
}

/* ── Summary Glass Box (Light theme adaptation) ── */
.summary-box {
  background: var(--secondary-subtle);
  border: 1px solid rgba(13, 159, 110, 0.2);
  border-radius: var(--radius-lg);
  padding: var(--sp-4) var(--sp-5);
  display: flex;
  gap: var(--sp-4);
  align-items: center;
  margin-bottom: var(--sp-6);
}

.summary-icon {
  width: 44px; height: 44px;
  background: var(--surface);
  border-radius: 50%;
  display: flex; align-items: center; justify-content: center;
  color: var(--secondary);
  box-shadow: var(--shadow-sm);
  flex-shrink: 0;
}

.summary-content h4 {
  font-size: 15px; margin: 0 0 4px 0; font-weight: 700; color: var(--text-primary);
}

.summary-content p {
  font-size: 13px; color: var(--text-secondary); margin: 0; line-height: 1.5; font-weight: 500;
}

/* Bar Chart custom overrides */
.chart-container {
  display: flex;
  align-items: flex-end;
  gap: 8px;
  height: 80px;
  margin-top: auto;
  padding-top: 16px;
  position: relative;
  z-index: 1;
}

.chart-bar {
  flex: 1;
  background: rgba(255, 255, 255, 0.4);
  border-radius: 4px 4px 0 0;
  transition: height 1s cubic-bezier(0.34, 1.56, 0.64, 1), background 0.3s;
  position: relative;
}

.chart-bar:hover {
  background: #ffffff;
}

.chart-bar .tooltip {
  position: absolute;
  top: -34px;
  left: 50%;
  transform: translateX(-50%) scale(0.9);
  background: var(--text-primary);
  color: #fff;
  padding: 4px 8px;
  border-radius: 4px;
  font-size: 11px;
  font-weight: 600;
  opacity: 0;
  pointer-events: none;
  transition: all 0.2s;
  white-space: nowrap;
  box-shadow: var(--shadow-md);
}

.chart-bar:hover .tooltip {
  opacity: 1;
  transform: translateX(-50%) scale(1);
}
