/* 10_report.css — Weekly report page (/Reporte): picker, chips, quota, subs */

.reporte-page {
  max-width: 860px;
  margin: 0 auto;
  padding: 32px 20px 64px;
}

.reporte-page h1 {
  color: var(--text-primary);
  margin-bottom: 0.25rem;
}

.report-subtitle {
  color: var(--text-muted);
  font-size: var(--fs-md);
  margin: 0 0 20px;
}

/* ---- quota meter ---- */
.report-quota-wrap { margin-bottom: 20px; }

.report-quota {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 8px 14px;
  border-radius: var(--radius-pill);
  font-size: var(--fs-sm);
  border: 1px solid var(--border-medium);
  color: var(--text-secondary);
  background: var(--bg-card);
}

.report-quota.ok { color: var(--success-text); border-color: rgb(var(--success-rgb) / 0.35); }
.report-quota.unlimited { color: var(--success-text); border-color: rgb(var(--success-rgb) / 0.35); }
.report-quota.limit {
  color: var(--error-text);
  border-color: rgb(var(--error-rgb) / 0.4);
  background: color-mix(in srgb, var(--error) 6%, var(--bg-card));
}

.report-quota-link {
  color: var(--brand-green-text) !important;
  font-weight: var(--fw-semibold);
  text-decoration: none;
}

/* ---- picker card ---- */
.report-picker-card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  padding: 20px;
}

.report-dataset-row {
  display: flex;
  align-items: center;
  gap: 16px;
  margin-bottom: 14px;
  flex-wrap: wrap;
}

.report-dataset-label { margin: 0; }

.report-dataset-radio { display: flex; gap: 10px; }

.report-dataset-opt {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 6px 14px;
  border-radius: var(--radius-pill);
  border: 1px solid var(--border-medium);
  font-weight: var(--fw-semibold);
  cursor: pointer;
  color: var(--text-secondary);
  transition: background-color var(--dur-fast) var(--ease-standard), color var(--dur-fast) var(--ease-standard), border-color var(--dur-fast) var(--ease-standard);
}

.report-dataset-opt:has(input:checked) {
  background: var(--brand-green-fill);
  border-color: var(--brand-green);
  color: var(--on-fill);
}

.report-dataset-input { accent-color: var(--brand-green); }

/* ---- search + results (combobox) ---- */
.report-search-wrap { position: relative; }

.report-search-input {
  width: 100%;
  box-sizing: border-box;
}

.report-results {
  position: absolute;
  top: calc(100% + 4px);
  left: 0;
  right: 0;
  z-index: 50;
  background: var(--bg-card);
  border: 1px solid var(--border-medium);
  border-radius: var(--radius-md);
  box-shadow: var(--shadow-4);
  max-height: 340px;
  overflow-y: auto;
  padding: 6px;
}

.report-results.empty {
  border: none;
  box-shadow: none;
  padding: 6px 2px;
  color: var(--text-muted);
  font-size: var(--fs-sm);
  position: static;
}

.report-results.error { color: var(--error-text); }

.report-result-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 10px 12px;
  border-radius: var(--radius-sm);
  cursor: pointer;
  min-height: 48px;
}

.report-result-row:hover,
.report-result-row:focus-within { background: var(--bg-hover); }

.report-result-name {
  font-weight: var(--fw-medium);
  color: var(--text-primary);
  word-break: break-word;
}

.report-result-meta {
  display: flex;
  align-items: center;
  gap: 6px;
  flex-wrap: wrap;
  margin-top: 2px;
  font-size: var(--fs-xs);
  color: var(--text-secondary);
}

.report-result-badge {
  background: var(--bg-green-light);
  color: var(--brand-green-text);
  border-radius: var(--radius-pill);
  padding: 1px 8px;
  font-weight: var(--fw-semibold);
}

.report-result-sub {
  color: var(--text-muted);
  border: 1px solid var(--border-medium);
  border-radius: var(--radius-pill);
  padding: 1px 8px;
}

.report-add-btn {
  min-width: 44px;
  min-height: 44px;
  border-radius: var(--radius-pill);
  border: 1.5px solid var(--brand-green);
  background: transparent;
  color: var(--brand-green-text);
  font-size: var(--fs-2xl);
  font-weight: var(--fw-bold);
  cursor: pointer;
  flex-shrink: 0;
  display: inline-flex;
  align-items: center;
  justify-content: center;
}

.report-add-btn:hover { background: var(--brand-green-fill); color: var(--on-fill); }

.report-add-btn.added {
  border-color: var(--border-medium);
  color: var(--text-muted);
  background: transparent;
  cursor: default;
  font-size: var(--fs-2xs);
  font-weight: var(--fw-semibold);
  padding: 0 10px;
  min-width: auto;
}

/* sheet handle — visible on mobile only */
.report-sheet-handle { display: none; }

/* ---- quick-adds (top 10) ---- */
.report-top10 { margin-top: 16px; }

.report-section-caption {
  font-size: var(--fs-2xs);
  text-transform: uppercase;
  letter-spacing: 0.04em;
  color: var(--text-muted);
  margin: 14px 0 8px;
}

.report-top-chips { display: flex; flex-wrap: wrap; gap: 8px; }

.report-top-chip {
  border: 1px solid var(--border-medium);
  background: var(--bg-page);
  color: var(--text-secondary);
  border-radius: var(--radius-pill);
  padding: 7px 14px;
  font-size: var(--fs-sm);
  cursor: pointer;
  min-height: 40px;
  transition: color var(--dur-fast) var(--ease-standard), border-color var(--dur-fast) var(--ease-standard), background-color var(--dur-fast) var(--ease-standard);
}

.report-top-chip:hover {
  border-color: var(--brand-green);
  color: var(--brand-green-text);
}

/* ---- selected chips ---- */
.report-selected { margin-top: 6px; }

.report-chips-wrap {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 6px;
}

.report-chip {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  background: var(--bg-green-light);
  color: var(--text-primary);
  border-radius: var(--radius-pill);
  padding: 4px 4px 4px 12px;
  font-size: var(--fs-sm);
  max-width: 100%;
}

.report-chip-label {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  max-width: 280px;
}

.report-chip-remove {
  min-width: 36px;
  min-height: 36px;
  border: none;
  border-radius: var(--radius-pill);
  background: transparent;
  color: var(--brand-green-text);
  font-size: var(--fs-lg);
  font-weight: var(--fw-bold);
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  justify-content: center;
}

.report-chip-remove:hover { background: rgb(var(--brand-green-rgb) / 0.15); }

.report-count {
  margin: 8px 0 0;
  font-size: var(--fs-xs);
  color: var(--text-muted);
}

.report-empty-hint {
  color: var(--text-muted);
  font-size: var(--fs-sm);
}

/* ---- subscriptions ---- */
.report-sub-heading {
  color: var(--text-primary);
  font-size: var(--fs-3xl);
  margin-top: 8px;
}

.report-subs-list { display: flex; flex-direction: column; gap: 10px; }

.report-sub-card {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  flex-wrap: wrap;
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  padding: 14px 16px;
}

.report-sub-card.paused { opacity: 0.6; }

.report-sub-info {
  display: flex;
  flex-direction: column;
  gap: 4px;
  min-width: 0;
}

.report-sub-ds {
  font-size: var(--fs-3xs);
  font-weight: var(--fw-bold);
  letter-spacing: 0.05em;
  color: var(--brand-green-text);
}

.report-sub-funds { color: var(--text-primary); font-weight: var(--fw-medium); }

.report-sub-last { color: var(--text-muted); font-size: var(--fs-xs); }

.report-sub-actions { display: flex; gap: 8px; }

.report-sub-btn { min-height: 40px; }

.btn-danger {
  border: 1px solid rgb(var(--error-rgb) / 0.5);
  background: transparent;
  color: var(--error-text);
  border-radius: var(--radius-sm);
  padding: 8px 14px;
  cursor: pointer;
  font-size: var(--fs-sm);
}

.btn-danger:hover { background: var(--error-text); color: var(--on-fill); }

/* ---- deliveries ---- */
.report-deliveries { margin-top: 18px; }

.report-delivery-row {
  display: flex;
  gap: 12px;
  align-items: center;
  padding: 6px 0;
  font-size: var(--fs-sm);
  color: var(--text-secondary);
  border-bottom: 1px solid var(--border);
}

.deliv-week { font-weight: var(--fw-semibold); color: var(--text-primary); }
.deliv-status.ok { color: var(--success-text); }
.deliv-status.failed { color: var(--error-text); }
.deliv-status.skipped { color: var(--text-muted); }
.deliv-sent { color: var(--text-muted); margin-left: auto; }

/* ---- feedback ---- */
.report-feedback-wrap { margin-top: 14px; }

.report-feedback {
  padding: 10px 14px;
  border-radius: var(--radius-sm);
  font-size: var(--fs-sm);
  background: var(--success-light);
  color: var(--success-text);
}

.report-feedback.error {
  background: color-mix(in srgb, var(--error) 8%, var(--bg-card));
  color: var(--error-text);
}

/* ---- dashboard follow button ---- */
.report-follow-btn { margin-top: 12px; }

.report-follow-feedback { margin-top: 8px; font-size: var(--fs-sm); }
.report-follow-feedback .ok { color: var(--success-text); }
.report-follow-feedback .error { color: var(--error-text); }

/* ---- mobile: results as bottom sheet ---- */
@media (max-width: 480px) {
  .report-results {
    position: fixed;
    left: 0;
    right: 0;
    bottom: 0;
    top: auto;
    max-height: 60vh;
    border-radius: var(--radius-md) var(--radius-md) 0 0;
    border: none;
    border-top: 1px solid var(--border-medium);
    box-shadow: 0 -8px 24px rgba(0, 0, 0, 0.15); /* upward: sheet rises from the screen edge — deliberate exception to --shadow-* */
    padding: 10px;
    z-index: 100;
  }

  .report-sheet-handle {
    display: block;
    width: 40px;
    height: 4px;
    border-radius: var(--radius-pill);
    background: var(--text-gray);
    margin: 8px auto 0;
    opacity: 0.5;
  }

  .report-chip-label { max-width: 200px; }
}
