/* Dashboard filters and results. Kept separate from the shared CRM screens. */
.dash-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 16px;
  margin: 0 0 20px;
}
.dash-header > div { min-width: 0; }
.dash-header h2 { margin: 0; font-size: 23px; line-height: 1.35; letter-spacing: -.45px; }
.dash-header p { margin: 7px 0 0; color: var(--muted); font-size: 13px; line-height: 1.6; }
.dash-header > .btn { flex-shrink: 0; min-height: 44px; }

.dash-filters {
  min-width: 0;
  margin: 0 0 18px;
  padding: 22px 24px 16px;
  border: 1px solid #e8e5f0;
  border-radius: 16px;
  background: #fff;
}
.dash-filter-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 18px; }
.dash-access-note { display: flex; flex-direction: column; justify-content: center; gap: 8px; min-width: 0; color: #625b70; font-size: 13px; line-height: 1.5; }
.dash-access-note strong { color: #45404e; font-weight: 500; overflow-wrap: anywhere; }
.dash-filters .field { min-width: 0; gap: 8px; line-height: 1.45; color: #625b70; }
.dash-filters .field select,
.dash-filters .field input {
  box-sizing: border-box;
  width: 100%;
  min-width: 0;
  max-width: 100%;
  min-height: 44px;
  font-family: inherit;
  font-size: 14px;
  color: #45404e;
}
.dash-filters .field select { overflow: hidden; text-overflow: ellipsis; }
.dash-filters .field input[type="date"] { min-inline-size: 0; inline-size: 100%; }
.dash-filters .field input[type="date"]::-webkit-date-and-time-value { text-align: left; }
.dash-filters .field input[aria-invalid="true"] { border-color: var(--red); }
.dash-filters .field :is(select, input):disabled { opacity: .65; cursor: not-allowed; }

.dash-periods { display: flex; flex-wrap: wrap; gap: 8px; margin: 20px 0 0; }
.dash-period {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 44px;
  min-width: 0;
  padding: 10px 15px;
  border: 1px solid #e8e5f0;
  border-radius: 9px;
  background: #fff;
  color: #6d657c;
  font: inherit;
  font-size: 13px;
  font-weight: 500;
  line-height: 1.4;
  text-align: center;
  cursor: pointer;
  transition: color .15s, background-color .15s, border-color .15s;
}
.dash-period:hover { background: #f8f6ff; border-color: #d4cbf8; color: var(--accent); }
.dash-period[aria-pressed="true"] { border-color: #c9bef9; background: var(--accent-soft); color: var(--accent); }
.dash-period:disabled { cursor: not-allowed; opacity: .6; }
.dash-custom { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr) auto; align-items: end; gap: 14px; margin-top: 18px; }
.dash-custom[hidden] { display: none; }
.dash-custom > .btn { min-height: 44px; }
.dash-filters :is(button, input, select, a):focus-visible,
.dash-header .btn:focus-visible,
.dash-chart-scroll:focus-visible {
  outline: 3px solid #a79cff;
  outline-offset: 3px;
}

.dash-summary-row { display: flex; align-items: baseline; justify-content: space-between; flex-wrap: wrap; gap: 8px 24px; min-width: 0; margin-bottom: 16px; }
.dash-context { flex: 1; min-width: 0; margin: 0 0 0 auto; color: #726981; font-size: 13px; line-height: 1.65; overflow-wrap: anywhere; text-align: right; }
.dash-context p { margin: 0; }
.dash-results { min-width: 0; }
.dash-results .crm-panel h2 { line-height: 1.5; margin-bottom: 18px; }
.dash-scope-summary { display: flex; flex: none; flex-wrap: wrap; gap: 6px 22px; margin: 0; color: #726981; font-size: 13px; line-height: 1.65; }
.dash-scope-summary strong { color: #45404e; font-weight: 600; font-variant-numeric: tabular-nums; }
.dash-metrics { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 16px; margin: 0 0 12px; }
.dash-results .dash-metric { padding: 22px 24px; }
.dash-results .dash-metric h2 { margin: 0 0 14px; color: #726981; font-size: 13px; font-weight: 500; }
.dash-metric-value { display: block; color: #2f2c39; font-size: 32px; font-weight: 650; line-height: 1.3; letter-spacing: -.5px; font-variant-numeric: tabular-nums; overflow-wrap: anywhere; }
.dash-metric-note, .dash-secondary-total, .dash-publications .publication-note { margin: 10px 0 0; color: #857b94; font-size: 12px; line-height: 1.55; overflow-wrap: anywhere; }
.dash-secondary-total { color: #625b70; }
.dash-secondary-total strong { font-variant-numeric: tabular-nums; font-weight: 600; }
.dash-publication-counts { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 12px; margin: 0; }
.dash-publication-counts > div { display: flex; flex-direction: column; min-width: 0; gap: 5px; }
.dash-publication-counts dt { order: 1; color: #857b94; font-size: 12px; line-height: 1.5; }
.dash-publication-counts dd { margin: 0; color: #2f2c39; font-size: 32px; font-weight: 650; line-height: 1.3; letter-spacing: -.5px; font-variant-numeric: tabular-nums; overflow-wrap: anywhere; }
.dash-scope-note { margin: 0 0 20px; color: #857b94; font-size: 12px; line-height: 1.6; overflow-wrap: anywhere; }
.dash-workflow { margin: 0 0 16px; }
.dash-panel-heading { display: flex; align-items: baseline; justify-content: space-between; flex-wrap: wrap; gap: 6px 18px; margin-bottom: 18px; }
.dash-results .dash-panel-heading h2 { margin: 0; font-size: 16px; }
.dash-panel-heading > span { color: #857b94; font-size: 12px; line-height: 1.6; }
.dash-panel-heading > span strong { color: #625b70; font-weight: 600; font-variant-numeric: tabular-nums; }
.dash-status-list { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 12px 20px; margin: 0; }
.dash-status-list > div { display: flex; flex-direction: column; min-width: 0; gap: 6px; }
.dash-status-list dt { color: #857b94; font-size: 12px; line-height: 1.5; overflow-wrap: anywhere; }
.dash-status-list dd { margin: auto 0 0; color: #484052; font-size: 22px; font-weight: 600; line-height: 1.3; font-variant-numeric: tabular-nums; overflow-wrap: anywhere; }
.dash-status-list [data-dash-status="review"] dd { color: var(--accent); }
.dash-chart-heading { display: flex; align-items: baseline; justify-content: space-between; flex-wrap: wrap; gap: 6px 20px; margin-bottom: 12px; }
.dash-results .dash-chart-heading h2 { margin: 0; font-size: 16px; }
.dash-chart-period { margin: 0; color: #857b94; font-size: 12px; line-height: 1.6; font-variant-numeric: tabular-nums; overflow-wrap: anywhere; }
.dash-chart-scroll { min-width: 0; max-width: 100%; overflow-x: auto; overscroll-behavior-x: contain; padding: 4px 0 10px; scrollbar-width: thin; scrollbar-color: #cfc7e8 #f8f6fc; border-radius: 5px; }
.dash-chart-scroll .dash-timeline { display: grid; grid-template-columns: repeat(var(--dash-months, 1), minmax(120px, 1fr)); width: 100%; min-width: calc(var(--dash-months, 1) * 120px); height: auto; align-items: start; gap: 0; padding: 0; }
.dash-timeline > .dash-chart-column { display: block; min-width: 0; padding: 0; gap: 0; flex: none; }
.dash-chart-plot { display: flex; flex-direction: column; align-items: center; justify-content: flex-end; box-sizing: border-box; height: 210px; gap: 8px; padding: 0 8px; border-bottom: 1px solid #dcd6e9; }
.dash-chart-plot strong { color: #4a415e; font-size: 13px; line-height: 1.4; font-variant-numeric: tabular-nums; text-align: center; overflow-wrap: anywhere; }
.dash-chart-plot .dash-chart-bar { display: block; flex-shrink: 0; width: 44px; max-width: 50px; border-radius: 6px 6px 0 0; background: var(--accent); }
.dash-timeline .dash-chart-date { display: block; min-height: 50px; box-sizing: border-box; margin: 0; padding: 10px 8px 0; color: #777083; font-size: 12px; line-height: 1.5; text-align: center; white-space: normal; font-variant-numeric: tabular-nums; }
.dash-chart-date time { color: #484052; font-weight: 500; white-space: nowrap; }
.dash-summary { margin: 16px 0 0; color: #7c738b; font-size: 12px; line-height: 1.65; overflow-wrap: anywhere; }
.dash-empty { min-height: 0; margin: 0 0 20px; padding: 20px 24px; border: 1px solid #e8e5f0; border-radius: 12px; background: #fff; color: #726981; font-size: 13px; line-height: 1.65; }
.dash-empty h2, .dash-empty h3 { margin: 0 0 6px; color: #484052; font-size: 16px; line-height: 1.5; }
.dash-empty p { margin: 0; }
.dash-empty .btn, .dash-results .live-state .btn { min-height: 44px; white-space: normal; }
.dash-results .live-state { border: 1px solid #e8e5f0; border-radius: 16px; background: #fff; }

@media (max-width: 700px) {
  .dash-header { gap: 12px; margin-bottom: 18px; }
  .dash-header h2 { font-size: 21px; }
  .dash-header p { font-size: 12px; }
  .dash-header > .btn { padding: 10px 12px; font-size: 12px; }
  .dash-filters { padding: 18px 16px 12px; border-radius: 13px; }
  .dash-filter-grid { grid-template-columns: minmax(0, 1fr); gap: 15px; }
  .dash-filters .field select, .dash-filters .field input { font-size: 16px; min-height: 46px; }
  .dash-periods { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 8px; margin-top: 18px; }
  .dash-period { padding: 10px 8px; font-size: 12px; }
  .dash-period:last-child:nth-child(odd) { grid-column: 1 / -1; }
  .dash-custom { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px; margin-top: 16px; }
  .dash-custom > .btn { grid-column: 1 / -1; }
  .dash-custom .field input { padding-right: 8px; padding-left: 8px; font-size: 16px; }
  .dash-summary-row { gap: 6px 16px; margin-bottom: 14px; }
  .dash-context { flex-basis: 100%; margin: 0; font-size: 12px; text-align: left; }
  .dash-results .crm-panel { padding: 18px 16px; border-radius: 13px; }
  .dash-results .crm-panel h2 { font-size: 16px; margin-bottom: 12px; }
  .dash-scope-summary { gap: 4px 16px; margin: 0; font-size: 12px; }
  .dash-metrics { grid-template-columns: minmax(0, 1fr); gap: 12px; }
  .dash-results .dash-metric h2 { margin-bottom: 10px; font-size: 13px; }
  .dash-metric-value, .dash-publication-counts dd { font-size: 28px; }
  .dash-metric-note, .dash-secondary-total, .dash-publications .publication-note { margin-top: 8px; }
  .dash-scope-note { margin-bottom: 16px; font-size: 11px; }
  .dash-workflow { margin-bottom: 12px; }
  .dash-panel-heading { margin-bottom: 16px; }
  .dash-results .dash-panel-heading h2 { margin-bottom: 0; }
  .dash-status-list { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 18px 16px; }
  .dash-status-list dd { font-size: 21px; }
  .dash-chart-heading { flex-direction: column; align-items: flex-start; gap: 4px; margin-bottom: 8px; }
  .dash-results .dash-chart-heading h2 { margin-bottom: 0; }
  .dash-chart-period { font-size: 11px; }
  .dash-chart-plot { height: 200px; }
  .dash-timeline .dash-chart-date { font-size: 11px; }
  .dash-empty { padding: 17px 16px; margin-bottom: 16px; }
}
@media (max-width: 360px) {
  .dash-header { flex-wrap: wrap; }
  .dash-header > .btn { margin-top: 0; }
  .dash-custom { grid-template-columns: minmax(0, 1fr); }
}
@media (prefers-reduced-motion: reduce) {
  .dash-period { transition: none; }
}

.dash-issued-label{display:block;color:#857b94;font-size:12px;line-height:1.5;margin-bottom:4px}
.dash-deposit-limit{display:grid;gap:8px;margin:14px 0 0;padding-top:12px;border-top:1px solid #f0edf5}
.dash-deposit-limit>div{display:flex;justify-content:space-between;align-items:baseline;gap:12px;min-width:0}
.dash-deposit-limit dt{font-size:12px;color:#857b94;line-height:1.5}
.dash-deposit-limit dd{margin:0;font-size:14px;font-weight:600;color:#484052;line-height:1.5;text-align:right;overflow-wrap:anywhere;font-variant-numeric:tabular-nums}
.dash-deposit-limit .dash-limit-exceeded :is(dt,dd){color:#b3000c}
