/*
 * RingCraft Design V1 — Reports
 * Dense operational reporting with semantic color and technical numerals.
 */

.rpt-wrap { max-width: 1480px; margin: 0 auto; color: var(--rc-ink); }
.rpt-header {
  display: flex;
  align-items: end;
  justify-content: space-between;
  gap: 18px;
  margin: 2px 0 16px;
}
.rpt-header h1 { margin: 0; color: var(--rc-ink); font-size: clamp(24px, 2.4vw, 32px); font-weight: 760; letter-spacing: -.04em; }
.rpt-header-sub { margin-top: 5px; color: var(--rc-muted); font-size: 12px; }

.rpt-filter-bar {
  position: sticky;
  top: 0;
  z-index: 5;
  display: flex;
  align-items: center;
  gap: 8px;
  min-height: 48px;
  margin-bottom: 14px;
  padding: 7px;
  overflow-x: auto;
  background: color-mix(in srgb, var(--rc-surface) 96%, transparent);
  border: 1px solid var(--rc-line);
  border-radius: var(--rc-radius-md);
  box-shadow: var(--rc-shadow-sm);
  backdrop-filter: blur(12px);
}
.rpt-preset-group,
.rpt-date-group,
.rpt-caller-group { display: flex; align-items: center; gap: 4px; flex: 0 0 auto; }
.rpt-preset-btn,
.rpt-reset-btn {
  min-height: 32px;
  padding: 6px 10px;
  border: 1px solid transparent;
  border-radius: var(--rc-radius-xs);
  background: transparent;
  color: var(--rc-muted);
  font: 650 11px/1 var(--rc-font-ui);
  cursor: pointer;
}
.rpt-preset-btn:hover,
.rpt-reset-btn:hover { background: var(--rc-surface-muted); color: var(--rc-ink); }
.rpt-preset-btn.active {
  background: var(--rc-blue-soft);
  border-color: color-mix(in srgb, var(--rc-blue) 24%, var(--rc-line));
  color: var(--rc-blue);
}
.rpt-filter-divider { width: 1px; height: 24px; margin: 0 2px; background: var(--rc-line); }
.rpt-date-input,
.rpt-caller-select {
  min-height: 32px;
  padding: 5px 8px;
  background: var(--rc-surface);
  border: 1px solid var(--rc-line);
  border-radius: var(--rc-radius-xs);
  color: var(--rc-ink);
  font: 500 11px/1 var(--rc-font-mono);
}
.rpt-caller-select { font-family: var(--rc-font-ui); }
.rpt-caller-label { color: var(--rc-muted); font-size: 10px; font-weight: 650; white-space: nowrap; }
.rpt-reset-btn { display: grid; width: 32px; padding: 0; place-items: center; border-color: var(--rc-line); }
.rpt-loading,
.rpt-empty { padding: 64px 20px; color: var(--rc-muted); text-align: center; }
.rpt-loading .spinner { margin-bottom: 10px; }

.rpt-section-label,
.rpt-ai-label {
  margin: 18px 0 8px;
  color: var(--rc-muted);
  font-size: 10px;
  font-weight: 760;
  letter-spacing: .105em;
  text-transform: uppercase;
}
.rpt-kpi-grid {
  display: grid;
  grid-template-columns: repeat(6, minmax(0, 1fr));
  gap: 8px;
}
.rpt-kpi-card {
  position: relative;
  min-width: 0;
  min-height: 104px;
  padding: 14px;
  overflow: hidden;
  background: var(--rc-surface);
  border: 1px solid var(--rc-line);
  border-radius: var(--rc-radius-sm);
  box-shadow: var(--rc-shadow-sm);
}
.rpt-kpi-card::before {
  content: "";
  position: absolute;
  inset: 0 auto 0 0;
  width: 2px;
  background: var(--rc-line-strong);
}
.rpt-kpi-card:hover { border-color: color-mix(in srgb, var(--rc-blue) 22%, var(--rc-line)); }
.rpt-kpi-value {
  color: var(--rc-ink) !important;
  font-family: var(--rc-font-mono);
  font-size: clamp(20px, 2vw, 27px);
  font-weight: 650;
  letter-spacing: -.04em;
  line-height: 1.1;
}
.rpt-kpi-label { margin-top: 10px; color: var(--rc-ink); font-size: 11px; font-weight: 680; }
.rpt-kpi-sub { margin-top: 3px; color: var(--rc-muted); font-size: 10px; line-height: 1.35; }

.rpt-charts-grid,
.rpt-ai-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; margin-top: 10px; }
.rpt-card,
.rpt-table-section,
.rpt-health-section {
  min-width: 0;
  padding: 15px;
  background: var(--rc-surface);
  border: 1px solid var(--rc-line);
  border-radius: var(--rc-radius-md);
  box-shadow: var(--rc-shadow-sm);
}
.rpt-card > .rpt-section-label,
.rpt-table-section > .rpt-section-label { margin-top: 0; }
.rpt-empty-msg,
.rpt-objection-empty { padding: 24px 0; color: var(--rc-muted); font-size: 11px; text-align: center; }

.rpt-daily-bars,
.rpt-dow-bars {
  display: flex;
  align-items: end;
  justify-content: space-between;
  gap: 5px;
  min-height: 116px;
  padding-top: 16px;
}
.rpt-daily-col,
.rpt-dow-col { display: flex; flex: 1; min-width: 0; flex-direction: column; align-items: center; }
.rpt-daily-count,
.rpt-dow-count,
.rpt-dow-conv {
  min-height: 14px;
  color: var(--rc-muted);
  font: 500 9px/1 var(--rc-font-mono);
}
.rpt-daily-track,
.rpt-dow-track {
  display: flex;
  width: min(70%, 24px);
  height: 64px;
  align-items: end;
  overflow: hidden;
  background: var(--rc-surface-muted);
  border-radius: 4px 4px 2px 2px;
}
.rpt-daily-bar,
.rpt-dow-bar { width: 100%; background: var(--rc-blue) !important; border-radius: 3px 3px 0 0; }
.rpt-daily-date,
.rpt-dow-label { margin-top: 7px; color: var(--rc-muted) !important; font: 500 9px/1 var(--rc-font-mono); }
.rpt-dow-conv { margin-top: 4px; color: var(--rc-booked) !important; }
.rpt-legend { display: flex; gap: 14px; margin-top: 10px; color: var(--rc-muted); font-size: 10px; }
.rpt-legend span { display: inline-flex; align-items: center; gap: 5px; }
.rpt-legend-dot { width: 7px; height: 7px; border-radius: 2px; }
.rpt-heatmap-summary,
.rpt-dow-summary { margin-top: 12px; color: var(--rc-muted); font-size: 10px; text-align: center; }
.rpt-dow-summary strong { color: var(--rc-booked) !important; }

.rpt-outcome-row { padding: 7px 0; }
.rpt-outcome-header { display: flex; justify-content: space-between; gap: 12px; margin-bottom: 5px; color: var(--rc-ink); font-size: 11px; }
.rpt-outcome-count { font-family: var(--rc-font-mono); }
.rpt-outcome-pct { color: var(--rc-muted); }
.rpt-outcome-track { height: 6px; overflow: hidden; background: var(--rc-surface-muted); border-radius: 99px; }
.rpt-outcome-fill { min-width: 2px; height: 100%; border-radius: inherit; }

.rpt-heatmap-grid { display: grid; grid-template-columns: repeat(12, minmax(22px, 1fr)); gap: 4px; margin-top: 18px; }
.rpt-heatmap-col { min-width: 0; text-align: center; }
.rpt-heatmap-cell {
  display: grid;
  min-height: 42px;
  place-items: center;
  border: 1px solid color-mix(in srgb, var(--rc-blue) 16%, var(--rc-line));
  border-radius: var(--rc-radius-xs);
  font: 600 10px/1 var(--rc-font-mono);
}
.rpt-heatmap-label { margin-top: 5px; color: var(--rc-muted); font: 500 8px/1 var(--rc-font-mono); }

.rpt-ai-section { margin-top: 18px; }
.rpt-ai-label { color: var(--rc-blue); }
.rpt-sentiment-summary { display: flex; justify-content: space-between; gap: 10px; font: 650 18px/1 var(--rc-font-mono); }
.rpt-sentiment-summary span:first-child { color: var(--rc-positive) !important; }
.rpt-sentiment-summary span:last-child { color: var(--rc-danger) !important; }
.rpt-sentiment-bar { display: flex; height: 7px; margin: 14px 0; overflow: hidden; background: var(--rc-surface-muted); border-radius: 99px; }
.rpt-sentiment-fill:first-child { background: var(--rc-positive) !important; }
.rpt-sentiment-fill:nth-child(2) { background: var(--rc-line-strong) !important; }
.rpt-sentiment-fill:last-child { background: var(--rc-danger) !important; }
.rpt-ai-meta { color: var(--rc-muted); font: 500 10px/1.7 var(--rc-font-mono); }
.rpt-objection-item {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  min-height: 36px;
  padding: 8px 0;
  border-bottom: 1px solid var(--rc-line);
  color: var(--rc-ink);
  font-size: 11px;
}
.rpt-objection-item:last-child { border-bottom: 0; }
.rpt-objection-count { color: var(--rc-muted); font-family: var(--rc-font-mono); }

.rpt-table-section { margin-top: 10px; padding: 0; overflow: hidden; }
.rpt-table-section > .rpt-section-label { margin: 0; padding: 14px 15px; border-bottom: 1px solid var(--rc-line); }
.rpt-table-wrap { overflow-x: auto; }
.rpt-table { width: 100%; border-collapse: collapse; font-size: 11px; font-variant-numeric: tabular-nums; }
.rpt-table th {
  padding: 9px 10px;
  background: var(--rc-surface-muted);
  color: var(--rc-muted) !important;
  font-size: 9px;
  letter-spacing: .065em;
  white-space: nowrap;
}
.rpt-table td { padding: 9px 10px; color: var(--rc-ink); white-space: nowrap; }
.rpt-table tbody tr:hover td { background: color-mix(in srgb, var(--rc-blue-soft) 35%, transparent); }
.rpt-table .mono,
.rpt-table td:not(:first-child) { font-family: var(--rc-font-mono); }
.rpt-table td span[style*="#a78bfa"] { color: var(--rc-booked) !important; }
.rpt-table td span[style*="#22c55e"] { color: var(--rc-positive) !important; }
.rpt-table td[style*="#f87171"] { color: var(--rc-danger) !important; }

.rpt-health-section { margin-top: 10px; }
.rpt-health-title { margin: 0 0 12px; color: var(--rc-ink); font-size: 13px; }
.rpt-health-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 8px; }
.rpt-health-card {
  display: grid;
  grid-template-columns: 20px minmax(110px, 1fr) auto;
  align-items: center;
  gap: 8px 10px;
  padding: 12px;
  background: var(--rc-surface-muted);
  border: 1px solid var(--rc-line);
  border-radius: var(--rc-radius-sm);
}
.rpt-health-status { width: 9px; height: 9px; overflow: hidden; border-radius: 50%; background: var(--rc-line-strong); font-size: 0; }
.rpt-health-name { color: var(--rc-ink); font-size: 12px; font-weight: 700; }
.rpt-health-assigned,
.rpt-health-score-label { margin-top: 2px; color: var(--rc-muted); font-size: 9px; }
.rpt-health-score-wrap { text-align: right; }
.rpt-health-score { font: 650 20px/1 var(--rc-font-mono); }
.rpt-health-stats { grid-column: 2 / -1; display: flex; flex-wrap: wrap; gap: 5px; }
.rpt-health-stat {
  padding: 3px 6px;
  background: var(--rc-surface);
  border: 1px solid var(--rc-line);
  border-radius: 4px;
  color: var(--rc-muted);
  font: 500 9px/1 var(--rc-font-mono);
}
.rpt-health-flags { grid-column: 2 / -1; display: flex; flex-wrap: wrap; gap: 5px; }
.rpt-health-flag {
  padding: 3px 6px !important;
  background: var(--rc-danger-soft) !important;
  border: 1px solid color-mix(in srgb, var(--rc-danger) 24%, var(--rc-line)) !important;
  border-radius: 4px;
  color: var(--rc-danger) !important;
  font-size: 9px;
}
.rpt-health-ok { grid-column: 2 / -1; color: var(--rc-positive); font-size: 9px; font-weight: 650; }

@media (max-width: 1180px) {
  .rpt-kpi-grid { grid-template-columns: repeat(3, minmax(0, 1fr)); }
  .rpt-heatmap-grid { grid-template-columns: repeat(6, minmax(28px, 1fr)); row-gap: 10px; }
}
@media (max-width: 820px) {
  .rpt-filter-bar { top: -1px; }
  .rpt-charts-grid,
  .rpt-ai-grid,
  .rpt-health-grid { grid-template-columns: 1fr; }
  .rpt-filter-divider { display: none; }
}
@media (max-width: 560px) {
  .rpt-header h1 { font-size: 25px; }
  .rpt-kpi-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 7px; }
  .rpt-kpi-card { min-height: 98px; padding: 12px; }
  .rpt-kpi-value { font-size: 21px; }
  .rpt-filter-bar { margin-inline: -4px; border-radius: var(--rc-radius-sm); }
  .rpt-date-group,
  .rpt-caller-group { order: 2; }
  .rpt-daily-bars,
  .rpt-dow-bars { gap: 2px; }
  .rpt-daily-date,
  .rpt-dow-label { font-size: 7px; }
}


/* Reports — precision analytics workspace pass 2026-08-06 */
body:has(#nav-reports.active) #content {
  padding: 26px 28px 52px !important;
}

body:has(#nav-reports.active) .rpt-wrap {
  width: 100%;
  max-width: none;
}

body:has(#nav-reports.active) .rpt-header {
  align-items: flex-start;
  min-height: 52px;
  margin: 0 0 16px;
}

body:has(#nav-reports.active) .rpt-header h2 {
  display: flex;
  align-items: center;
  gap: 9px;
  margin: 0;
  color: var(--rc-ink);
  font-size: clamp(22px, 2vw, 28px);
  font-weight: 760;
  letter-spacing: -.035em;
  line-height: 1.15;
}

body:has(#nav-reports.active) .rpt-header h2 svg {
  flex: 0 0 auto;
  color: var(--rc-blue);
}

body:has(#nav-reports.active) .rpt-header-sub {
  margin: 6px 0 0;
  line-height: 1.4;
}

body:has(#nav-reports.active) .rpt-filter-bar {
  top: 8px;
  flex-wrap: wrap;
  min-height: 60px;
  margin-bottom: 20px;
  padding: 10px;
  gap: 8px;
  overflow: visible;
  border-radius: 12px;
  box-shadow: 0 1px 2px rgba(15, 21, 36, .045);
}

body:has(#nav-reports.active) .rpt-preset-group {
  gap: 3px;
  padding: 3px;
  background: var(--rc-surface-muted);
  border: 1px solid color-mix(in srgb, var(--rc-line) 80%, transparent);
  border-radius: 9px;
}

body:has(#nav-reports.active) .rpt-preset-btn {
  min-height: 32px;
  padding-inline: 11px;
  border-radius: 7px;
  white-space: nowrap;
}

body:has(#nav-reports.active) .rpt-preset-btn.active {
  background: var(--rc-surface);
  border-color: var(--rc-line);
  box-shadow: 0 1px 2px rgba(15, 21, 36, .06);
}

body:has(#nav-reports.active) .rpt-date-group,
body:has(#nav-reports.active) .rpt-caller-group {
  min-height: 38px;
  gap: 6px;
}

body:has(#nav-reports.active) .rpt-date-input,
body:has(#nav-reports.active) .rpt-caller-select {
  min-height: 36px;
  padding-inline: 10px;
  border-radius: 8px;
}

body:has(#nav-reports.active) .rpt-caller-select {
  min-width: 150px;
}

body:has(#nav-reports.active) .rpt-filter-bar > .btn-primary {
  min-height: 36px;
  margin-left: auto;
  padding-inline: 16px !important;
  border-radius: 8px !important;
  white-space: nowrap;
}

body:has(#nav-reports.active) :is(
  .rpt-preset-btn,
  .rpt-reset-btn,
  .rpt-date-input,
  .rpt-caller-select,
  .rpt-filter-bar > .btn-primary
):focus-visible {
  outline: 3px solid color-mix(in srgb, var(--rc-blue) 22%, transparent);
  outline-offset: 2px;
}

body:has(#nav-reports.active) .rpt-section-label,
body:has(#nav-reports.active) .rpt-ai-label {
  margin: 22px 0 9px;
  font-size: 9.5px;
  letter-spacing: .09em;
}

body:has(#nav-reports.active) .rpt-kpi-grid {
  grid-template-columns: repeat(8, minmax(120px, 1fr));
  gap: 10px;
}

body:has(#nav-reports.active) .rpt-kpi-card {
  min-height: 112px;
  padding: 17px 15px;
  border-radius: 11px;
  box-shadow: 0 1px 2px rgba(15, 21, 36, .035);
  transition: border-color .16s ease, box-shadow .16s ease, transform .16s ease;
}

body:has(#nav-reports.active) .rpt-kpi-card::before {
  inset: 14px auto 14px 0;
  width: 2px;
  border-radius: 0 2px 2px 0;
  background: color-mix(in srgb, currentColor 54%, var(--rc-line));
}

body:has(#nav-reports.active) .rpt-kpi-card:hover {
  transform: translateY(-1px);
  box-shadow: 0 5px 14px rgba(15, 21, 36, .055);
}

body:has(#nav-reports.active) .rpt-kpi-value {
  font-size: clamp(22px, 1.9vw, 29px);
  font-weight: 670;
  line-height: 1;
}

body:has(#nav-reports.active) .rpt-kpi-label {
  margin-top: 12px;
  font-size: 10.5px;
  line-height: 1.25;
}

body:has(#nav-reports.active) .rpt-kpi-sub {
  min-height: 14px;
  margin-top: 5px;
}

body:has(#nav-reports.active) .rpt-charts-grid,
body:has(#nav-reports.active) .rpt-ai-grid {
  gap: 14px;
  margin-top: 14px;
}

body:has(#nav-reports.active) .rpt-card,
body:has(#nav-reports.active) .rpt-table-section,
body:has(#nav-reports.active) .rpt-health-section {
  padding: 18px;
  border-radius: 13px;
  box-shadow: 0 1px 2px rgba(15, 21, 36, .04);
}

body:has(#nav-reports.active) .rpt-card > .rpt-section-label {
  min-height: 26px;
  margin: 0 0 10px;
  padding-bottom: 10px;
  border-bottom: 1px solid var(--rc-line);
}

body:has(#nav-reports.active) .rpt-daily-bars,
body:has(#nav-reports.active) .rpt-dow-bars {
  min-height: 132px;
  padding: 18px 4px 0;
}

body:has(#nav-reports.active) .rpt-daily-track,
body:has(#nav-reports.active) .rpt-dow-track {
  width: min(62%, 28px);
  height: 76px;
}

body:has(#nav-reports.active) .rpt-outcome-row {
  padding: 8px 0;
}

body:has(#nav-reports.active) .rpt-outcome-track {
  height: 7px;
}

body:has(#nav-reports.active) .rpt-heatmap-grid {
  gap: 5px;
  margin-top: 20px;
}

body:has(#nav-reports.active) .rpt-heatmap-cell {
  min-height: 46px;
  border-radius: 7px;
}

body:has(#nav-reports.active) .rpt-table-section {
  margin-top: 14px;
  padding: 0;
  overflow: hidden;
}

body:has(#nav-reports.active) .rpt-table-section > .rpt-section-label {
  min-height: 58px;
  margin: 0;
  padding: 18px;
  border-bottom: 1px solid var(--rc-line);
}

body:has(#nav-reports.active) .rpt-table-wrap {
  width: 100%;
  overflow: auto;
  scrollbar-gutter: stable;
}

body:has(#nav-reports.active) .rpt-table {
  min-width: 880px;
  border-collapse: separate;
  border-spacing: 0;
}

body:has(#nav-reports.active) .rpt-table th {
  position: sticky;
  top: 0;
  z-index: 2;
  height: 42px;
  padding: 9px 12px;
  background: color-mix(in srgb, var(--rc-surface-muted) 82%, var(--rc-surface));
}

body:has(#nav-reports.active) .rpt-table td {
  height: 54px;
  padding: 10px 12px;
  vertical-align: middle;
}

body:has(#nav-reports.active) .rpt-table tbody tr:last-child td {
  border-bottom: 0;
}

body:has(#nav-reports.active) .rpt-health-section {
  margin-top: 14px;
}

body:has(#nav-reports.active) .rpt-health-title {
  margin-bottom: 15px;
  padding-bottom: 12px;
  border-bottom: 1px solid var(--rc-line);
}

body:has(#nav-reports.active) .rpt-health-grid {
  gap: 10px;
}

body:has(#nav-reports.active) .rpt-health-card {
  min-height: 112px;
  padding: 14px;
  gap: 9px 12px;
  background: color-mix(in srgb, var(--rc-surface-muted) 68%, var(--rc-surface));
  border-radius: 10px;
}

body:has(#nav-reports.active) .rpt-loading,
body:has(#nav-reports.active) .rpt-empty {
  min-height: 260px;
  display: grid;
  align-content: center;
  justify-items: center;
}

:root[data-theme="dark"] body:has(#nav-reports.active) :is(
  .rpt-filter-bar,
  .rpt-kpi-card,
  .rpt-card,
  .rpt-table-section,
  .rpt-health-section
) {
  box-shadow: 0 1px 0 rgba(255, 255, 255, .025);
}

:root[data-theme="dark"] body:has(#nav-reports.active) .rpt-preset-btn.active {
  box-shadow: 0 1px 0 rgba(255, 255, 255, .04);
}

@media (max-width: 1390px) {
  body:has(#nav-reports.active) .rpt-kpi-grid {
    grid-template-columns: repeat(4, minmax(135px, 1fr));
  }
}

@media (max-width: 1020px) {
  body:has(#nav-reports.active) .rpt-filter-divider {
    display: none;
  }

  body:has(#nav-reports.active) .rpt-filter-bar > .btn-primary {
    margin-left: 0;
  }

  body:has(#nav-reports.active) .rpt-heatmap-grid {
    grid-template-columns: repeat(6, minmax(28px, 1fr));
    row-gap: 11px;
  }
}

@media (max-width: 820px) {
  body:has(#nav-reports.active) #content {
    padding: 18px 14px 38px !important;
  }

  body:has(#nav-reports.active) .rpt-filter-bar {
    top: 4px;
  }

  body:has(#nav-reports.active) .rpt-charts-grid,
  body:has(#nav-reports.active) .rpt-ai-grid,
  body:has(#nav-reports.active) .rpt-health-grid {
    grid-template-columns: 1fr;
  }

  body:has(#nav-reports.active) .rpt-preset-group {
    width: 100%;
    overflow-x: auto;
    scrollbar-width: thin;
  }
}

@media (max-width: 560px) {
  body:has(#nav-reports.active) .rpt-header {
    min-height: 46px;
  }

  body:has(#nav-reports.active) .rpt-header h2 {
    font-size: 23px;
  }

  body:has(#nav-reports.active) .rpt-filter-bar {
    align-items: stretch;
    padding: 8px;
  }

  body:has(#nav-reports.active) .rpt-date-group,
  body:has(#nav-reports.active) .rpt-caller-group {
    flex: 1 1 100%;
  }

  body:has(#nav-reports.active) .rpt-date-group .rpt-date-input {
    width: calc(50% - 12px);
  }

  body:has(#nav-reports.active) .rpt-caller-select {
    flex: 1;
    min-width: 0;
  }

  body:has(#nav-reports.active) .rpt-filter-bar > .btn-primary {
    width: 100%;
  }

  body:has(#nav-reports.active) .rpt-kpi-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 8px;
  }

  body:has(#nav-reports.active) .rpt-kpi-card {
    min-height: 100px;
    padding: 14px;
  }

  body:has(#nav-reports.active) .rpt-card {
    padding: 14px;
  }

  body:has(#nav-reports.active) .rpt-heatmap-grid {
    grid-template-columns: repeat(4, minmax(28px, 1fr));
  }
}

@media (prefers-reduced-motion: reduce) {
  body:has(#nav-reports.active) .rpt-kpi-card {
    transition: none;
  }
}
