/* ============================================================
   CMS CROWD Operações — relatório de horas (tela + impressão/PDF)
   ============================================================ */

.report-page #app { display: flex; flex-direction: column; height: 100vh; }
.report-wrap { display: grid; grid-template-columns: 300px minmax(0, 1fr); flex: 1; min-height: 0; }

/* ---------- Filtros ---------- */
.filters {
  background: var(--bg-elevated); border-right: 1px solid var(--border);
  padding: 18px; overflow-y: auto;
}
.filters h2 { margin: 0 0 14px; font-size: 12px; letter-spacing: 0.08em; text-transform: uppercase; color: var(--text-dim); }
.filters .field { margin-bottom: 12px; }
.presets { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 4px; }
.chip {
  background: var(--surface); border: 1px solid var(--border); color: var(--text-dim);
  border-radius: 20px; padding: 5px 11px; font-size: 12px; cursor: pointer;
}
.chip:hover, .chip.active { border-color: var(--brand); color: var(--brand); }

/* ---------- Área da folha ---------- */
.sheet-area { overflow-y: auto; padding: 26px; background: #0b0d11; }
.sheet {
  background: #ffffff; color: #14161b; max-width: 900px; margin: 0 auto;
  padding: 42px 46px 34px; border-radius: 6px; box-shadow: 0 10px 40px rgba(0, 0, 0, 0.5);
  font-size: 12.5px; line-height: 1.5;
}
.sheet .pane-empty { color: #6b7280; }

.sheet-head { display: flex; align-items: flex-start; justify-content: space-between; gap: 20px; border-bottom: 3px solid #14161b; padding-bottom: 14px; }
/* Versão preta do logo (logo-crowd-preto.png): imprime e sai no PDF sem depender de filtro CSS. */
.sheet-logo { height: 30px; width: auto; display: block; }
.sheet-wordmark { font-size: 26px; font-weight: 800; letter-spacing: -0.6px; color: #14161b; line-height: 1; }
.sheet-wordmark em { font-style: normal; color: #d9b400; }

.person { display: inline-flex; align-items: center; gap: 8px; }
.person-photo {
  width: 22px; height: 22px; border-radius: 50%; object-fit: cover; display: inline-flex;
  align-items: center; justify-content: center; flex-shrink: 0;
  background: #eceef1; color: #6b7280; font-size: 9px; font-weight: 800;
}
.sheet-head .sheet-sub { font-size: 11px; color: #6b7280; margin-top: 4px; letter-spacing: 0.04em; text-transform: uppercase; }
.sheet-head-right { text-align: right; font-size: 11.5px; color: #4b5563; }
.sheet-head-right strong { display: block; font-size: 15px; color: #14161b; margin-bottom: 3px; }

.sheet-title { margin: 22px 0 4px; font-size: 19px; }
.sheet-meta { color: #4b5563; font-size: 12px; margin-bottom: 18px; }
.sheet-meta strong { color: #14161b; }

.summary { display: flex; gap: 12px; margin: 18px 0 22px; flex-wrap: wrap; }
.summary-card { flex: 1; min-width: 130px; border: 1px solid #e3e6ea; border-left: 3px solid #14161b; border-radius: 4px; padding: 10px 14px; }
.summary-card span { display: block; font-size: 10.5px; text-transform: uppercase; letter-spacing: 0.06em; color: #6b7280; }
.summary-card strong { font-size: 19px; font-variant-numeric: tabular-nums; }
.summary-card.total { border-left-color: #d9b400; background: #fffbe8; }

.sheet table { width: 100%; border-collapse: collapse; margin-bottom: 18px; }
.sheet th {
  text-align: left; font-size: 10px; text-transform: uppercase; letter-spacing: 0.06em;
  color: #6b7280; border-bottom: 1.5px solid #14161b; padding: 7px 8px;
}
.sheet td { padding: 7px 8px; border-bottom: 1px solid #eceef1; vertical-align: top; }
.sheet td.num, .sheet th.num { text-align: right; font-variant-numeric: tabular-nums; white-space: nowrap; }
.sheet tr.group-row td { background: #f5f6f8; font-weight: 700; border-bottom: 1px solid #dfe3e8; }
.sheet tr.subtotal td { font-weight: 700; border-top: 1px solid #dfe3e8; border-bottom: 2px solid #14161b; }
.sheet tr.total-row td { font-weight: 800; font-size: 14px; border-top: 2px solid #14161b; border-bottom: none; padding-top: 10px; }
.sheet .muted { color: #6b7280; }
.sheet .status-tag { font-size: 10px; text-transform: uppercase; letter-spacing: 0.04em; color: #6b7280; }

.sheet-foot { margin-top: 26px; padding-top: 12px; border-top: 1px solid #e3e6ea; font-size: 10.5px; color: #6b7280; display: flex; justify-content: space-between; gap: 20px; }
.sheet-note { margin-top: 18px; padding: 10px 12px; background: #f7f8fa; border-left: 3px solid #d9b400; font-size: 11.5px; color: #374151; white-space: pre-wrap; }

/* ---------- Impressão / PDF ---------- */
@media print {
  @page { size: A4; margin: 14mm 12mm; }
  html, body { height: auto; overflow: visible; background: #fff; }
  .no-print, .topbar, .filters, #toast { display: none !important; }
  .report-page #app { height: auto; display: block; }
  .report-wrap { display: block; }
  .sheet-area { padding: 0; background: #fff; overflow: visible; }
  .sheet {
    box-shadow: none; border-radius: 0; max-width: none; padding: 0;
    font-size: 10.5pt; color: #000;
    -webkit-print-color-adjust: exact; print-color-adjust: exact;
  }
  .sheet table { page-break-inside: auto; }
  .sheet tr { page-break-inside: avoid; page-break-after: auto; }
  .sheet thead { display: table-header-group; }
  .sheet tr.total-row { page-break-inside: avoid; }
  .summary-card { break-inside: avoid; }
  .sheet-logo, .person-photo { -webkit-print-color-adjust: exact; print-color-adjust: exact; }
}

/* Badge do topo com foto (mesma regra do módulo de Operações) */
.user-badge { overflow: hidden; padding: 0; }
.user-badge img { width: 100%; height: 100%; object-fit: cover; display: block; }


/* ---------- Filtros: opções de exibição ---------- */
.check-row.tight { margin: 4px 0; }
.desc-limit { display: flex; align-items: center; gap: 8px; margin: 0 0 6px 24px; font-size: 12px; color: var(--text-faint); }
.desc-limit select { background: var(--surface); border: 1px solid var(--border); color: var(--text); padding: 4px 6px; border-radius: 6px; font-size: 12px; }
.desc-limit.hidden { display: none; }
.field-hint { font-size: 11px; color: var(--text-faint); font-weight: 400; }

/* ---------- Detalhes na folha ---------- */
.sheet .task-name { font-weight: 600; }
.sheet .task-desc {
  margin-top: 4px; font-size: 11px; color: #4b5563; line-height: 1.45; white-space: pre-line;
  border-left: 2px solid #e3e6ea; padding-left: 8px;
}
.sheet .entry-list { list-style: none; margin: 6px 0 0; padding: 0; }
.sheet .entry-list li { font-size: 11px; color: #374151; line-height: 1.45; padding: 2px 0 2px 10px; position: relative; }
.sheet .entry-list li::before { content: ""; position: absolute; left: 0; top: 8px; width: 4px; height: 4px; border-radius: 50%; background: #d9b400; }
.sheet .el-date { color: #6b7280; font-variant-numeric: tabular-nums; margin-right: 4px; }
.sheet .el-who { color: #14161b; font-weight: 600; margin-right: 4px; }
.sheet .el-min { font-weight: 700; font-variant-numeric: tabular-nums; margin-right: 2px; }
.sheet .el-note { color: #374151; white-space: pre-line; }
.sheet .entry-note { margin-top: 4px; font-size: 11px; color: #374151; white-space: pre-line; }
.sheet .day-line { font-size: 11px; color: #374151; margin-top: 3px; line-height: 1.4; }
.sheet tr.person-row td { background: #f7f8fa; font-weight: 700; }
.sheet tr.sub-task td:first-child { padding-left: 38px; }
.sheet .nowrap { white-space: nowrap; }
.sheet .small { font-size: 10.5px; }

/* ---------- Geração do PDF (cópia fora da tela, largura A4) ---------- */
.pdf-holder { position: fixed; left: -12000px; top: 0; width: 720px; background: #fff; pointer-events: none; }
.sheet.pdf-render { width: 720px; max-width: none; margin: 0; padding: 0; border-radius: 0; box-shadow: none; }

/* ---------- Modal de envio ---------- */
.send-attach {
  display: flex; align-items: center; gap: 8px; padding: 9px 12px; font-size: 12.5px;
  background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius-sm);
}
.send-attach #s-file { flex: 1; color: var(--text); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.modal.wide { max-width: 720px; }
.notice {
  margin: 0 0 4px; padding: 10px 12px; border-radius: var(--radius-sm); font-size: 12.5px; line-height: 1.5;
  background: rgba(245, 177, 61, .1); border: 1px solid rgba(245, 177, 61, .35); color: #f3d59a;
}
#btn-send:disabled { opacity: .45; cursor: not-allowed; }
