/* ============================================================
   adtec-reports.css
   Shared styles for all AdTec printable reports
   ============================================================ */

/* ── PAGE & BODY ─────────────────────────────────────────── */

@page {
  size: auto;
  margin: 8mm 10mm 8mm 10mm;
}

html, body {
  font-family: Arial, sans-serif;
  font-size: 13px;
  margin: 0;
  padding: 16px 10px 10px 10px;
  background: #fff;
  color: #000;
  overflow-y: auto;
  overflow-x: hidden;
}

/* ── REPORT HEADER BLOCK ─────────────────────────────────── */
/*
   Layout:
     [logo ~200px, floated right        ]
     [report-org-name                   ]
     [report-title                      ]
     [report-ben                        ]
     [── cranberry table header ────────]
*/

.report-header {
  overflow: hidden; /* clearfix for floated logo */
  margin-bottom: 20px;
}

.report-header img.report-logo {
  float: right;
  width: 200px;
  padding: 0 0 10px 20px;
}

.report-org-name {
  font-size: 19px;
  font-weight: bold;
  color: #000;
  margin: 4px 0 2px 0;
}

.report-title {
  font-size: 13px;
  font-weight: bold;
  color: #444;
  margin: 0 0 4px 0;
}

.report-ben {
  font-size: 13px;
  color: #333;
  margin: 0;
}

/* ── TABLES ──────────────────────────────────────────────── */

table {
  border-collapse: collapse;
  width: 100%;
}

th {
  background-color: #a10d0d;
  color: #fff;
  font-weight: bold;
  padding: 5px 4px;
  text-align: left;
}

td {
  padding: 5px 4px;
  text-align: left;
  word-wrap: break-word;
}

/* Zebra striping — entity list only */
.entity-table tbody tr:nth-child(even) { background: #ebebeb; }
.entity-table tbody tr:nth-child(odd)  { background: #ffffff; }

/* Subtotal / summary rows */
tr.summary td {
  background-color: #f2f2f2;
  font-weight: bold;
}

/* Org name banner — full-width cranberry cell (multiyear) */
th.org-name-banner {
  text-align: center;
  font-size: 18px;
  font-weight: bold;
  text-transform: uppercase;
  background-color: #a10d0d;
  color: #fff;
  padding: 12px 4px;
}

/* Alignment helpers */
.col-right  { text-align: right; }
.col-center { text-align: center; }
.col-left   { text-align: left; }

/* Exception state in money cells (Pending, Cancelled, Denied) */
.status-exception {
  font-style: italic;
  color: #000;
}

/* Annex row indentation (entity list) */
tr.indent-annex td:first-child {
  padding-left: 28px;
}

/* ── SUMMARY COUNTS (entity list) ────────────────────────── */

.report-summary {
  margin-top: 16px;
  font-size: 13px;
}

.report-summary ul {
  list-style: none;
  padding: 0;
  margin: 0;
}

.report-summary li {
  display: inline;
  margin-right: 24px;
}

/* ── FOOTER ──────────────────────────────────────────────── */

.report-footer {
  margin-top: 24px;
  padding-top: 8px;
  border-top: 1px solid #ddd;
  font-size: 11px;
  color: #666;
  text-align: center;
}

.report-footer p {
  margin: 2px 0;
}

/* ── C2 BUDGET LINE ──────────────────────────────────────── */

.c2-budget-line {
  font-size: 13px;
  margin: 0 0 16px 0;
}

/* ── MULTIYEAR FUNDING SUMMARY ───────────────────────────── */

/* Table font matches other reports */
.multiyear-table {
  font-size: 12px;
}

/* Default: all cells right-aligned */
.multiyear-table th,
.multiyear-table td {
  padding: 4px 8px;
  text-align: right;
}

/* Cols 1, 2, 3 (FRN, Nickname, Provider) — left aligned */
.multiyear-table th:nth-child(1),
.multiyear-table td:nth-child(1),
.multiyear-table th:nth-child(2),
.multiyear-table td:nth-child(2),
.multiyear-table th:nth-child(3),
.multiyear-table td:nth-child(3) {
  text-align: left;
}

.multiyear-nickname,
.multiyear-provider {
  max-width: 10em;
  overflow: hidden;
  white-space: nowrap;
  text-overflow: ellipsis;
}

/* Status exception cell spans cols 8+9, right-aligned, truncated by JS */
.multiyear-table td.multiyear-status-cell {
  text-align: right;
}

/* Year subhead row and grand total row — slightly darker than subtotal */
tr.year-subhead td,
tr.grand-total td {
  background-color: #d8d8d8;
  font-weight: bold;
  font-size: 12px;
  padding: 4px;
}

/* Year subhead text left-aligned */
tr.year-subhead td {
  text-align: left !important;
}

/* ── CONSULTANT PLANNING REPORT ──────────────────────────── */

/* FRN block — space between records, page-break protection handled in print CSS */
.frn-block {
  margin-bottom: 28px;
}

/* FRN heading — full-width cranberry banner, white text */
.frn-heading {
  font-size: 13px;
  font-weight: bold;
  color: #fff;
  background-color: #a10d0d;
  padding: 5px 8px;
  margin: 0 0 0 0;
}

/* FRN summary table — two-column label/value layout */
.frn-table {
  width: 100%;
  border-collapse: collapse;
  margin-bottom: 0;
  font-size: 13px;
}

.frn-table td {
  padding: 3px 4px;
  border-bottom: 1px solid #e0e0e0;
  vertical-align: top;
}

.frn-table .frn-label {
  width: 30%;
}

/* Line items container — indented, light background to separate from summary */
.line-items-container {
  margin: 6px 0 0 20px;
  padding: 6px 6px 2px 6px;
  background: #f5f5f5;
  border-left: 3px solid #ddd;
}

/* Line items detail table */
.line-items-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 13px;
}

.line-items-table th {
  background-color: #555;
  color: #fff;
  padding: 4px;
  font-weight: bold;
}

.line-items-table td {
  padding: 3px 4px;
  border-bottom: 1px solid #e0e0e0;
  vertical-align: top;
}

/* ── LOADING / ERROR STATES ──────────────────────────────── */

.report-loading {
  font-style: italic;
  color: #777;
  margin-top: 10px;
}

.report-error {
  color: red;
  font-style: italic;
}

/* ── PRINT ───────────────────────────────────────────────── */

@media print {

  /* Ensure cranberry backgrounds print */
  * {
    -webkit-print-color-adjust: exact;
    print-color-adjust: exact;
  }

  /* Hide anything screen-only */
  .screen-only {
    display: none !important;
  }

  /* Avoid breaking inside FRN blocks or summary rows */
  .frn-block, tr.summary {
    page-break-inside: avoid;
  }

  /* Keep table headers visible on each page */
  thead {
    display: table-header-group;
  }

  /* No extra padding on body when printing */
  body {
    padding: 0;
  }

  /* Footer sits at bottom of last page in normal flow */
  .report-footer {
    margin-top: 32px;
  }

  /* Keep each year group together — avoid breaking mid-section */
  tbody.year-group {
    page-break-inside: avoid;
  }

}
