#tsc-monthly-report-root,
#tsc-monthly-report-root * {
  box-sizing: border-box;
}

.tsc-report-launcher {
  position: fixed;
  right: 24px;
  bottom: 24px;
  z-index: 60;
  display: inline-flex;
  align-items: center;
  gap: 10px;
  min-height: 48px;
  border: 0;
  border-radius: 14px;
  padding: 12px 18px;
  color: #fff;
  background: #d62828;
  box-shadow: 0 12px 30px rgba(15, 23, 42, .22);
  font: 700 14px/1.2 system-ui, sans-serif;
  cursor: pointer;
}

.tsc-report-launcher:hover { background: #b91c1c; }
.tsc-report-launcher[hidden] { display: none; }

.tsc-report-overlay {
  position: fixed;
  inset: 0;
  z-index: 100;
  display: grid;
  place-items: center;
  padding: 24px;
  background: rgba(15, 23, 42, .72);
  overflow: auto;
}

.tsc-report-overlay[hidden] { display: none; }

.tsc-report-dialog {
  width: min(1180px, 100%);
  max-height: calc(100vh - 48px);
  overflow: auto;
  border-radius: 20px;
  background: #f8fafc;
  box-shadow: 0 30px 80px rgba(0, 0, 0, .35);
  color: #0f172a;
  font-family: system-ui, -apple-system, "Segoe UI", sans-serif;
}

.tsc-report-toolbar {
  position: sticky;
  top: 0;
  z-index: 2;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding: 18px 22px;
  border-bottom: 1px solid #e2e8f0;
  background: rgba(255, 255, 255, .97);
}

.tsc-report-title { margin: 0; font-size: 20px; font-weight: 800; }
.tsc-report-subtitle { margin: 4px 0 0; color: #64748b; font-size: 13px; }
.tsc-report-toolbar-actions { display: flex; flex-wrap: wrap; gap: 10px; align-items: center; }

.tsc-report-month,
.tsc-report-button {
  min-height: 42px;
  border: 1px solid #cbd5e1;
  border-radius: 10px;
  padding: 9px 12px;
  background: #fff;
  color: #0f172a;
  font: 700 13px/1.2 system-ui, sans-serif;
}

.tsc-report-button { cursor: pointer; }
.tsc-report-button:hover { background: #f1f5f9; }
.tsc-report-button-primary { border-color: #1d4ed8; background: #1d4ed8; color: #fff; }
.tsc-report-button-primary:hover { background: #1e40af; }
.tsc-report-close { width: 42px; padding: 0; font-size: 22px; }

.tsc-report-sheet { padding: 28px; background: #fff; }
.tsc-report-brand { display: flex; align-items: center; gap: 16px; padding-bottom: 20px; border-bottom: 3px solid #d62828; }
.tsc-report-logo { width: 78px; height: 78px; object-fit: contain; }
.tsc-report-brand h2 { margin: 0; font-size: 25px; font-weight: 850; color: #0f2744; }
.tsc-report-brand p { margin: 5px 0 0; color: #64748b; font-size: 13px; }

.tsc-report-stats {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 12px;
  margin: 22px 0;
}

.tsc-report-stat { border: 1px solid #e2e8f0; border-radius: 12px; padding: 14px; background: #f8fafc; }
.tsc-report-stat-label { color: #64748b; font-size: 11px; font-weight: 800; text-transform: uppercase; letter-spacing: .05em; }
.tsc-report-stat-value { margin-top: 4px; font-size: 26px; font-weight: 850; color: #0f2744; }

.tsc-report-message { padding: 28px; border: 1px dashed #cbd5e1; border-radius: 12px; text-align: center; color: #64748b; }
.tsc-report-error { color: #b91c1c; background: #fef2f2; border-color: #fecaca; }
.tsc-report-table-wrap { overflow-x: auto; }
.tsc-report-table { width: 100%; border-collapse: collapse; font-size: 12px; }
.tsc-report-table th { padding: 11px 9px; background: #0f2744; color: #fff; text-align: left; white-space: nowrap; }
.tsc-report-table td { padding: 10px 9px; border-bottom: 1px solid #e2e8f0; vertical-align: top; }
.tsc-report-table tbody tr:nth-child(even) { background: #f8fafc; }
.tsc-report-status { display: inline-block; border-radius: 999px; padding: 4px 8px; background: #e2e8f0; font-size: 10px; font-weight: 800; white-space: nowrap; }
.tsc-report-footer-note { margin: 18px 0 0; color: #64748b; font-size: 11px; text-align: right; }

@media (max-width: 760px) {
  .tsc-report-overlay { padding: 0; place-items: stretch; }
  .tsc-report-dialog { max-height: 100vh; border-radius: 0; }
  .tsc-report-toolbar { align-items: flex-start; flex-direction: column; }
  .tsc-report-toolbar-actions { width: 100%; }
  .tsc-report-month { flex: 1; }
  .tsc-report-stats { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .tsc-report-sheet { padding: 18px; }
  .tsc-report-launcher { right: 14px; bottom: 14px; }
}

@media print {
  @page { size: A4 landscape; margin: 10mm; }
  body.tsc-report-printing > *:not(#tsc-monthly-report-root) { display: none !important; }
  body.tsc-report-printing #tsc-monthly-report-root { display: block !important; }
  body.tsc-report-printing .tsc-report-launcher,
  body.tsc-report-printing .tsc-report-toolbar { display: none !important; }
  body.tsc-report-printing .tsc-report-overlay { position: static; display: block; padding: 0; background: #fff; }
  body.tsc-report-printing .tsc-report-dialog { width: 100%; max-height: none; overflow: visible; border-radius: 0; box-shadow: none; }
  body.tsc-report-printing .tsc-report-sheet { padding: 0; }
  body.tsc-report-printing .tsc-report-table-wrap { overflow: visible; }
  body.tsc-report-printing .tsc-report-table { font-size: 9px; }
  body.tsc-report-printing .tsc-report-table th,
  body.tsc-report-printing .tsc-report-table td { padding: 6px 5px; }
  body.tsc-report-printing .tsc-report-stat { break-inside: avoid; }
  body.tsc-report-printing .tsc-report-table tr { break-inside: avoid; }
}
