body {
  background-color: #f8f9fa;
  font-size: 0.9rem;
}

.form-text {
  font-size: 0.78rem;
}

.navbar {
  padding-top: 0.4rem;
  padding-bottom: 0.4rem;
}

h4 {
  font-size: 1.3rem;
}

h5 {
  font-size: 1.1rem;
}

/* ── Mobile responsiveness ─────────────────────────────────── */

/* Dashboard monitor list: card layout on small screens */
@media (max-width: 767.98px) {
  /* Hide the table header on mobile */
  .monitor-table thead {
    display: none;
  }

  .monitor-table tbody tr {
    display: block;
    border: 1px solid #dee2e6;
    border-radius: 0.375rem;
    margin-bottom: 0.5rem;
    padding: 0.6rem 0.75rem;
    background: #fff;
  }

  .monitor-table tbody tr.table-light {
    background: #f8f9fa;
  }

  .monitor-table tbody tr td {
    display: inline;
    border: none;
    padding: 0;
  }

  /* Status badge */
  .monitor-table td.mon-status {
    display: inline;
    margin-right: 0.4rem;
  }

  /* Name + external link */
  .monitor-table td.mon-name {
    display: inline;
    font-weight: 500;
  }

  /* Target URL on its own line, truncated */
  .monitor-table td.mon-target {
    display: block;
    max-width: 100% !important;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    margin-top: 0.15rem;
  }

  /* Last check + response on a second row */
  .monitor-table td.mon-lastcheck,
  .monitor-table td.mon-response {
    display: inline;
    font-size: 0.8rem;
  }

  .monitor-table td.mon-lastcheck {
    margin-top: 0.25rem;
    display: inline-block;
  }

  .monitor-table td.mon-lastcheck::before {
    content: "Checked: ";
    color: #6c757d;
    font-size: 0.75rem;
  }

  .monitor-table td.mon-response::before {
    content: " · ";
    color: #6c757d;
  }

  /* Expiry columns: show on a third row */
  .monitor-table td.mon-ssl,
  .monitor-table td.mon-domain,
  .monitor-table td.mon-hosting {
    display: inline;
    font-size: 0.8rem;
  }

  .monitor-table td.mon-ssl::before {
    content: "SSL: ";
    color: #6c757d;
    font-size: 0.75rem;
  }

  .monitor-table td.mon-domain::before {
    content: " · Domain: ";
    color: #6c757d;
    font-size: 0.75rem;
  }

  .monitor-table td.mon-hosting::before {
    content: " · Hosting: ";
    color: #6c757d;
    font-size: 0.75rem;
  }

  /* Navbar: stack links */
  .navbar .d-flex.gap-3 {
    gap: 0.4rem !important;
    flex-wrap: wrap;
    font-size: 0.8rem;
  }

  /* Dashboard header: stack title and buttons */
  .dash-header {
    flex-direction: column;
    align-items: flex-start !important;
    gap: 0.5rem;
  }

  /* Monitor detail: stack header and buttons */
  .detail-header {
    flex-direction: column;
    align-items: flex-start !important;
    gap: 0.5rem;
  }

  .detail-header .d-flex.gap-2 {
    flex-wrap: wrap;
  }

  /* Detail page: target URL wraps */
  .detail-header .text-muted.mb-1 {
    word-break: break-all;
  }

  /* Diagnostics table: stack label and detail */
  .diag-table td {
    display: block;
    padding: 0.15rem 0.5rem;
  }

  .diag-table td.diag-icon {
    display: inline;
    padding-right: 0.3rem;
    width: auto !important;
  }

  .diag-table td.diag-label {
    display: inline;
    width: auto !important;
  }

  .diag-table td.diag-detail {
    display: block;
    padding-left: 1.5rem;
    padding-bottom: 0.4rem;
    font-size: 0.82rem;
  }

  .diag-table tr {
    display: block;
    border-bottom: 1px solid #dee2e6;
  }

  /* Summary cards: use smaller text */
  .summary-cards .fs-4 {
    font-size: 1.2rem !important;
  }

  /* Uptime bars: reduce minimum width so they all fit */
  .uptime-bar {
    min-width: 8px !important;
  }
}
