/* ==========================================================================
   Site report (report.php)
   --------------------------------------------------------------------------
   Loaded after styles.css. The proposal is a fixed A4-width document; this
   report is a wide table, so it uses the full width of the window instead and
   prints landscape.
   ========================================================================== */

/* --------------------------------------------------------------------------
   Full-width sheet
   -------------------------------------------------------------------------- */

.report-body {
  background: var(--desk);
}

.sheet {
  width: 100%;
  max-width: 1600px;      /* stops the table stretching on very wide monitors */
  margin: 0 auto;
  min-height: 100vh;
  background: var(--paper);
  box-shadow: 0 1px 3px rgba(15, 34, 28, 0.10);
}

.sheet__pad {
  padding: clamp(24px, 4vw, 44px) clamp(20px, 4vw, 48px);
}


/* --------------------------------------------------------------------------
   Header
   -------------------------------------------------------------------------- */

.report-head {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 32px;
  flex-wrap: wrap;
  padding-bottom: 20px;
  border-bottom: 1px solid var(--line);
}

.report-head .page-title {
  font-size: clamp(26px, 4vw, 34px);
}

.report-head .appendix__intro {
  max-width: 74ch;
}

.report-back {
  margin-bottom: 10px;
  font-size: 13px;
  font-weight: 700;
}

.report-back a { text-decoration: none; }
.report-back a:hover { text-decoration: underline; }

.report-back--foot {
  margin-top: 24px;
  padding-top: 18px;
  border-top: 1px solid var(--line);
}

.report-head__meta {
  font-size: 12px;
  line-height: 1.7;
  color: var(--sage);
  text-align: right;
}

/* The totals strip spans the full width here */
.sheet .usage {
  margin-top: 20px;
  gap: 16px 40px;
}

.sheet .usage__stat { align-items: flex-start; }


/* --------------------------------------------------------------------------
   Banners
   -------------------------------------------------------------------------- */

.banner {
  margin-top: 16px;
  display: flex;
  align-items: flex-start;
  gap: 10px;
  padding: 12px 16px;
  border-radius: var(--radius);
  font-size: 13.5px;
  border: 1px solid var(--line);
}

.banner .icon { margin-top: 0.15em; }

.banner--info {
  background: var(--surface);
  color: var(--ink);
}

.banner--info .icon { color: var(--green); }

.banner--warn {
  background: #FFF6E8;
  border-color: #F0DCBC;
  color: #7A5312;
}

.banner--warn .icon { color: #B87A17; }

.banner code {
  font-family: ui-monospace, SFMono-Regular, Menlo, monospace;
  font-size: 0.92em;
  background: rgba(15, 34, 28, 0.07);
  padding: 1px 5px;
  border-radius: 4px;
}


/* --------------------------------------------------------------------------
   Nameserver summary
   -------------------------------------------------------------------------- */

.ns-groups {
  margin-top: 14px;
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(min(260px, 100%), 1fr));
  gap: 8px 24px;
}

.ns-groups li {
  display: flex;
  align-items: baseline;
  gap: 10px;
  padding: 7px 0;
  border-bottom: 1px solid var(--line);
  font-size: 13.5px;
}

.ns-groups__name {
  flex: 1 1 auto;
  font-family: ui-monospace, SFMono-Regular, Menlo, monospace;
  font-size: 12.5px;
  overflow-wrap: anywhere;
}

/* DNS at a glance: green when the domain is on our nameservers, amber when
   it is on someone else's and has to be repointed for the migration. */
.tag--ours {
  background: rgba(20, 160, 106, .12);
  color: var(--green-deep);
}

.tag--theirs {
  background: rgba(214, 132, 20, .14);
  color: #8A5410;
}

/* The pills carry the full nameserver list in their tooltip */
.sites__ns .tag { cursor: help; }

.ns-groups__count {
  font-weight: 700;
  font-variant-numeric: tabular-nums;
}


/* --------------------------------------------------------------------------
   The table
   -------------------------------------------------------------------------- */

.sites__ns,
.sites__ip {
  font-family: ui-monospace, SFMono-Regular, Menlo, monospace;
  font-size: 12px;
  color: var(--sage);
  overflow-wrap: anywhere;
}

.sites__none { color: var(--muted); }

/* Where the domain currently resolves */
.tag--point-here      { background: rgba(20, 160, 106, 0.12); color: #0B6B47; }
.tag--point-elsewhere { background: rgba(214, 132, 20, 0.14); color: #8A5410; }
.tag--point-proxied   { background: rgba(20, 110, 200, 0.12); color: #1B5C99; }
.tag--point-unknown   { background: rgba(15, 34, 28, 0.08);   color: var(--sage); }


/* --------------------------------------------------------------------------
   Narrow screens — let the table scroll instead of crushing the columns
   -------------------------------------------------------------------------- */

@media (max-width: 900px) {
  .report-head__meta { text-align: left; }

  .sites {
    display: block;
    overflow-x: auto;
    white-space: nowrap;
  }

  .sites__ns,
  .sites__ip { overflow-wrap: normal; }
}


/* --------------------------------------------------------------------------
   Print — landscape, so all seven columns fit
   -------------------------------------------------------------------------- */

@page {
  size: A4 landscape;
  margin: 10mm;
}

@media print {
  html, body { background: #fff; }

  .sheet {
    max-width: none;
    min-height: 0;
    box-shadow: none;
  }

  .sheet__pad { padding: 0; }

  .banner { display: none; }

  .report-head { padding-bottom: 4mm; }
  .report-head .page-title { font-size: 18pt; }

  .sites { font-size: 7.6pt; }
  .sites td { padding: 1.1mm 3mm 1.1mm 0; }
  .sites__ns,
  .sites__ip { font-size: 7pt; white-space: normal; }

  .sites thead { display: table-header-group; }
  .sites tr { break-inside: avoid; }

  .tag,
  .usage { -webkit-print-color-adjust: exact; print-color-adjust: exact; }
}
