@layer pages {
  .reports-tools-page {
    display: grid;
    gap: 16px;
    padding-bottom: 8px;
  }

  .reports-tools-page .owner-section {
    border-radius: 18px;
    border: 1px solid rgba(148, 163, 184, 0.2);
    background: linear-gradient(160deg, rgba(255, 255, 255, 0.76), rgba(248, 250, 252, 0.92));
    box-shadow: 0 8px 28px rgba(15, 23, 42, 0.08);
    padding: 14px;
  }

  .reports-tools-page .owner-section-head {
    margin-bottom: 12px;
  }

  .reports-tools-page .owner-section-head h3 {
    margin: 0 0 4px;
    font-size: 16px;
    font-weight: 700;
    color: #0f172a;
  }

  .reports-owner-kpis {
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 10px;
  }

  .owner-kpi-card {
    border-radius: 14px;
    border: 1px solid rgba(148, 163, 184, 0.2);
    background: linear-gradient(165deg, rgba(15, 23, 42, 0.92), rgba(30, 41, 59, 0.82));
    color: #e2e8f0;
    padding: 10px 12px;
  }

  .owner-kpi-card--online .owner-kpi-value {
    color: #86efac;
  }

  .owner-kpi-card--offline .owner-kpi-value {
    color: #fca5a5;
  }

  .owner-kpi-label {
    font-size: 10px;
    font-weight: 700;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    color: #94a3b8;
  }

  .owner-kpi-value {
    margin-top: 6px;
    font-size: 18px;
    font-weight: 800;
    line-height: 1.1;
    font-variant-numeric: tabular-nums;
    font-feature-settings: "tnum";
  }

  .reports-export-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 10px;
  }

  .reports-export-card {
    border: 1px solid rgba(148, 163, 184, 0.18);
    border-radius: 14px;
    padding: 12px;
    display: grid;
    grid-template-columns: auto 1fr;
    gap: 10px;
    background: rgba(248, 250, 252, 0.78);
  }

  .reports-export-icon {
    width: 34px;
    height: 34px;
    border-radius: 10px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    background: rgba(15, 23, 42, 0.08);
    font-size: 18px;
  }

  .reports-export-meta h4 {
    margin: 0;
    font-size: 14px;
    color: #0f172a;
  }

  .reports-export-meta p {
    margin: 4px 0 0;
    font-size: 12px;
    color: #64748b;
    line-height: 1.35;
  }

  .reports-export-foot {
    grid-column: 1 / -1;
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 8px;
    font-size: 11px;
    color: #64748b;
    margin-top: 2px;
  }

  .reports-export-foot .export-status {
    border-radius: 999px;
    border: 1px solid rgba(148, 163, 184, 0.3);
    padding: 2px 8px;
    font-weight: 700;
  }

  .reports-export-foot .export-status.ok {
    color: #166534;
    background: rgba(22, 163, 74, 0.12);
    border-color: rgba(22, 163, 74, 0.28);
  }

  .reports-export-foot .export-last {
    font-variant-numeric: tabular-nums;
    font-feature-settings: "tnum";
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
  }

  .reports-export-card .btn {
    grid-column: 1 / -1;
    margin-top: 2px;
    justify-self: start;
  }

  .owner-backup-summary {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 10px;
    margin-bottom: 10px;
  }

  .owner-backup-summary > div {
    border: 1px solid rgba(148, 163, 184, 0.16);
    border-radius: 12px;
    padding: 8px 10px;
    display: grid;
    gap: 4px;
    min-width: 0;
  }

  .owner-backup-summary strong,
  .owner-backup-summary code {
    font-size: 12.5px;
    color: #0f172a;
    line-height: 1.35;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
  }

  .owner-backup-summary code {
    display: block;
    border-radius: 8px;
    background: rgba(15, 23, 42, 0.06);
    padding: 3px 6px;
  }

  .reports-tools-page .owner-toolbar {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin-bottom: 10px;
  }

  .reports-tools-page .owner-toolbar--audit input,
  .reports-tools-page .owner-toolbar--audit select {
    min-height: 33px;
  }

  .reports-table-wrap {
    max-height: 340px;
    border-radius: 12px;
    border: 1px solid rgba(148, 163, 184, 0.18);
  }

  .reports-backup-table,
  .reports-audit-table {
    width: 100%;
    border-collapse: separate;
    border-spacing: 0;
    table-layout: fixed;
  }

  .reports-backup-table thead th,
  .reports-audit-table thead th {
    position: sticky;
    top: 0;
    background: #f1f5f9;
    z-index: 2;
    font-size: 11px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.04em;
    color: #64748b;
    border-bottom: 1px solid rgba(148, 163, 184, 0.22);
  }

  .reports-backup-table th,
  .reports-backup-table td,
  .reports-audit-table th,
  .reports-audit-table td {
    padding: 8px 10px;
    border-bottom: 1px solid rgba(148, 163, 184, 0.12);
    vertical-align: middle;
  }

  .reports-backup-table tbody td,
  .reports-audit-table tbody td {
    font-size: 12.5px;
    color: #0f172a;
  }

  .reports-backup-table .actions,
  .reports-backup-table .num,
  .reports-audit-table .num {
    font-variant-numeric: tabular-nums;
    font-feature-settings: "tnum";
    white-space: nowrap;
  }

  .reports-audit-table .audit-detail-cell {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 8px;
  }

  .reports-audit-table .audit-note {
    display: block;
    max-width: 100%;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    color: #64748b;
  }

  .reports-audit-table tbody tr:hover td,
  .reports-backup-table tbody tr:hover td {
    background: #f8fafc;
  }

  .reports-tools-page .btn.subtle {
    opacity: 0.9;
  }

  @media (max-width: 1280px) {
    .reports-owner-kpis {
      grid-template-columns: repeat(2, minmax(0, 1fr));
    }
  }

  @media (max-width: 1080px) {
    .reports-export-grid,
    .owner-backup-summary {
      grid-template-columns: 1fr;
    }
  }
}

.audit-detail-json--split {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
}

.audit-detail-json--split .audit-json-col {
  border-radius: 12px;
  border: 1px solid rgba(148, 163, 184, 0.25);
  overflow: hidden;
  min-width: 0;
}

.audit-detail-json--split .audit-json-col header {
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  padding: 7px 10px;
}

.audit-detail-json--split .audit-json-col--before header {
  background: rgba(239, 68, 68, 0.12);
  color: #b91c1c;
}

.audit-detail-json--split .audit-json-col--after header {
  background: rgba(34, 197, 94, 0.12);
  color: #166534;
}

.audit-detail-json--split .audit-json-col pre {
  margin: 0;
  padding: 10px;
  max-height: 44vh;
  overflow: auto;
  white-space: pre-wrap;
  text-align: left;
  font-size: 12px;
  line-height: 1.45;
}

@media (max-width: 860px) {
  .audit-detail-json--split {
    grid-template-columns: 1fr;
  }
}
