/* =============================================================================
   app.css -- OSD Accessibility Audit Platform
   Global styles extracted from includes/header.php and includes/footer.php.
   All page-specific CSS files depend on the :root variables defined here
   and must be loaded AFTER this file.
   ============================================================================= */

/* -- OSD Brand Variables ----------------------------------------------------- */
:root {
  --navy:         #223D92;
  --navy-dark:    #172a6b;
  --navy-mid:     #2F5496;
  --orange:       #E8631A;
  --orange-lt:    #fdf0e8;
  --text:         #1a1a1a;   /* 16.75:1 on white */
  --text-muted:   #4a5568;   /* 7.0:1 on white  */
  --border:       #DDE3EC;
  --bg:           #F2F5FA;
  --white:        #ffffff;
  --header-ht:    56px;

  --critical:     #b91c1c;   /* 7.2:1 on #fff5f5 */
  --critical-bg:  #fff5f5;
  --serious:      #c2410c;   /* 5.9:1 on #fff8f0 */
  --serious-bg:   #fff8f0;
  --moderate:     #92400e;   /* 6.1:1 on #fffbeb */
  --moderate-bg:  #fffbeb;
  --minor:        #166534;   /* 7.5:1 on #f0fdf4 */
  --minor-bg:     #f0fdf4;
  --clean:        #1e40af;   /* 7.3:1 on #eff6ff */
  --clean-bg:     #eff6ff;
}

*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

html { scroll-padding-top: calc(var(--header-ht) + 16px); }

body {
  font-family: 'Segoe UI', 'Helvetica Neue', Arial, sans-serif;
  font-size: 15px;
  line-height: 1.5;
  background: var(--bg);
  color: var(--text);
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}

/* -- Print styles ------------------------------------------------------------ */
@media print {
  .site-header,
  .site-footer,
  .back-link,
  .print-hide,
  .flag-btn-wrap,
  .flag-panel,
  .flag-panel-backdrop,
  .print-action-bar,
  .skip-link,
  .breadcrumb-wrap {
    display: none !important;
  }

  body {
    background: #ffffff !important;
    font-size: 12pt;
    color: #000000 !important;
  }

  .main {
    max-width: 100% !important;
    padding: 0 !important;
    margin: 0 !important;
  }

  .report-meta {
    display: flex;
    flex-wrap: wrap;
    gap: 6pt;
    margin-bottom: 14pt;
  }
  .meta-chip {
    border: 1pt solid #aaaaaa !important;
    background: #ffffff !important;
    color: #000000 !important;
  }

  .stat-card {
    border: 1pt solid #cccccc !important;
    background: #ffffff !important;
    break-inside: avoid;
  }
  .stat-value { -webkit-print-color-adjust: exact; print-color-adjust: exact; }

  .page-row { break-inside: avoid; }

  .page-violations { display: block !important; max-height: none !important; }

  .issues-table th {
    background: #223D92 !important;
    color: #ffffff !important;
    -webkit-print-color-adjust: exact;
    print-color-adjust: exact;
  }

  .badge-critical,
  .badge-serious,
  .badge-moderate,
  .badge-minor,
  .badge-clean {
    -webkit-print-color-adjust: exact;
    print-color-adjust: exact;
  }

  .print-header {
    display: flex !important;
    align-items: center;
    justify-content: space-between;
    border-bottom: 3pt solid #223D92;
    padding-bottom: 10pt;
    margin-bottom: 18pt;
  }
  .print-header-title {
    font-size: 10pt;
    color: #223D92;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.5pt;
  }
  .print-header-logo {
    font-size: 9pt;
    color: #44546A;
  }

  @page {
    margin: 15mm 12mm 15mm 12mm;
    size: A4;
  }
  @page :first {
    margin-top: 10mm;
  }
}

/* Print header -- hidden on screen, shown only when printing */
.print-header {
  display: none;
}

/* -- Print action bar (screen only) ----------------------------------------- */
.print-action-bar {
  display: flex;
  align-items: center;
  gap: 10px;
}
.btn-print,
.btn-pdf,
.btn-excel {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  padding: 8px 16px;
  font-size: 13px;
  font-weight: 600;
  border-radius: 6px;
  cursor: pointer;
  text-decoration: none;
  border: none;
  line-height: 1.3;
  transition: background 0.18s, box-shadow 0.18s;
  white-space: nowrap;
}
.btn-print {
  background: var(--white);
  color: var(--navy);
  border: 1.5px solid var(--navy);
}
.btn-print:hover,
.btn-print:focus {
  background: var(--bg);
  box-shadow: 0 0 0 3px rgba(34,61,146,0.15);
  outline: none;
}
.btn-print:focus-visible {
  outline: 2px solid var(--orange);
  outline-offset: 2px;
}
.btn-pdf {
  background: var(--orange);
  color: var(--white);
}
.btn-pdf:hover,
.btn-pdf:focus {
  background: #c9521a;
  box-shadow: 0 0 0 3px rgba(232,99,26,0.20);
  outline: none;
}
.btn-pdf:focus-visible {
  outline: 2px solid var(--navy);
  outline-offset: 2px;
}
.btn-excel {
  background: var(--navy);
  color: var(--white);
}
.btn-excel:hover,
.btn-excel:focus {
  background: var(--navy-dark);
  box-shadow: 0 0 0 3px rgba(34,61,146,0.20);
  outline: none;
}
.btn-excel:focus-visible {
  outline: 2px solid var(--orange);
  outline-offset: 2px;
}
.btn-print svg,
.btn-pdf svg,
.btn-excel svg {
  flex-shrink: 0;
  width: 15px;
  height: 15px;
}

/* -- Skip link --------------------------------------------------------------- */
.skip-link {
  position: absolute;
  left: -9999px;
  top: auto;
  width: 1px;
  height: 1px;
  overflow: hidden;
}
.skip-link:focus {
  position: fixed;
  top: 12px;
  left: 12px;
  width: auto;
  height: auto;
  padding: 10px 18px;
  background: var(--orange);
  color: var(--white);
  font-weight: 700;
  font-size: 14px;
  border-radius: 4px;
  z-index: 9999;
  text-decoration: none;
}

/* -- Site Header ------------------------------------------------------------- */
.site-header {
  background: var(--navy);
  color: var(--white);
  position: sticky;
  top: 0;
  z-index: 200;
  box-shadow: 0 2px 10px rgba(0,0,0,0.28);
}

.header-top {
  display: grid;
  grid-template-columns: 180px 1fr auto;
  align-items: center;
  gap: 16px;
  padding: 0 28px;
  height: var(--header-ht);
  border-bottom: 3px solid var(--orange);
}

.header-logo a {
  display: inline-flex;
  align-items: center;
  text-decoration: none;
  outline-offset: 4px;
}
.header-logo a:focus-visible {
  outline: 2px solid var(--orange);
  border-radius: 2px;
}
.header-logo img {
  height: 34px;
  width: auto;
  display: block;
}

.header-label {
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 1.8px;
  text-transform: uppercase;
  color: var(--white);
  text-align: center;
}

/* -- Header nav -------------------------------------------------------------- */
.header-nav {
  display: flex;
  align-items: center;
  gap: 8px;
}

/* -- Admin nav links --------------------------------------------------------- */
.nav-links {
  display: flex;
  align-items: center;
  gap: 4px;
  margin-right: 4px;
}
.nav-link {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: 12px;
  font-weight: 600;
  color: rgba(255,255,255,0.88);
  text-decoration: none;
  padding: 5px 10px;
  border-radius: 4px;
  white-space: nowrap;
  transition: background 0.15s, color 0.15s;
}
.nav-link:hover,
.nav-link:focus {
  background: rgba(255,255,255,0.14);
  color: var(--white);
  outline: none;
}
.nav-link:focus-visible {
  outline: 2px solid var(--orange);
  outline-offset: 2px;
}
.nav-link.is-active {
  background: rgba(255,255,255,0.18);
  color: var(--white);
}
.nav-link svg { width: 14px; height: 14px; flex-shrink: 0; }

.nav-divider {
  width: 1px;
  height: 20px;
  background: rgba(255,255,255,0.22);
  margin: 0 2px;
}

/* -- Client switcher dropdown ------------------------------------------------ */
.client-switcher {
  position: relative;
}

.switcher-btn {
  display: flex;
  align-items: center;
  gap: 7px;
  font-size: 12px;
  font-weight: 600;
  color: var(--white);
  background: none;
  border: 1.5px solid rgba(255,255,255,0.55);
  padding: 5px 11px 5px 10px;
  border-radius: 4px;
  cursor: pointer;
  white-space: nowrap;
  transition: background 0.2s, border-color 0.2s;
  line-height: 1;
  max-width: 200px;
}
.switcher-btn:hover,
.switcher-btn:focus {
  background: rgba(255,255,255,0.14);
  border-color: rgba(255,255,255,0.9);
  outline: none;
}
.switcher-btn:focus-visible {
  outline: 2px solid var(--orange);
  outline-offset: 2px;
}

.switcher-label {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

/* Shared chevron styles */
.switcher-chevron,
.account-chevron {
  width: 12px;
  height: 12px;
  flex-shrink: 0;
  opacity: 0.8;
}
@media (prefers-reduced-motion: no-preference) {
  .switcher-chevron,
  .account-chevron {
    transition: transform 0.2s;
  }
}
.switcher-btn[aria-expanded="true"] .switcher-chevron,
.account-btn[aria-expanded="true"] .account-chevron {
  transform: rotate(180deg);
}

/* Shared dropdown panel */
.switcher-dropdown,
.account-dropdown {
  display: none;
  position: absolute;
  top: calc(100% + 8px);
  right: 0;
  background: var(--white);
  border: 1px solid var(--border);
  border-radius: 8px;
  box-shadow: 0 8px 32px rgba(34,61,146,0.16);
  overflow: hidden;
  z-index: 300;
}
.switcher-dropdown { min-width: 200px; }
.account-dropdown  { min-width: 190px; }

.switcher-dropdown.is-open,
.account-dropdown.is-open { display: block; }

/* Switcher items */
.switcher-items {
  list-style: none;
  padding: 6px 0;
}
.switcher-items li { margin: 0; }
.switcher-items a {
  display: flex;
  align-items: center;
  gap: 10px;
  width: 100%;
  padding: 9px 16px;
  font-size: 13px;
  font-weight: 500;
  color: var(--text);
  text-decoration: none;
  background: none;
  transition: background 0.15s;
}
.switcher-items a:hover,
.switcher-items a:focus {
  background: var(--bg);
  color: var(--navy);
  outline: none;
}
.switcher-items a:focus-visible {
  outline: 2px solid var(--navy);
  outline-offset: -2px;
}
.switcher-items a.is-current {
  font-weight: 700;
  color: var(--navy);
  background: var(--clean-bg);
}
.switcher-items a.is-current::before {
  content: '';
  display: inline-block;
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: var(--navy);
  flex-shrink: 0;
}

/* -- Account menu ------------------------------------------------------------ */
.account-menu { position: relative; }

.account-btn {
  display: flex;
  align-items: center;
  gap: 7px;
  font-size: 12px;
  font-weight: 600;
  color: var(--white);
  background: none;
  border: 1.5px solid rgba(255,255,255,0.55);
  padding: 5px 12px 5px 10px;
  border-radius: 4px;
  cursor: pointer;
  white-space: nowrap;
  transition: background 0.2s, border-color 0.2s;
  line-height: 1;
}
.account-btn:hover,
.account-btn:focus {
  background: rgba(255,255,255,0.14);
  border-color: rgba(255,255,255,0.9);
  outline: none;
}
.account-btn:focus-visible {
  outline: 2px solid var(--orange);
  outline-offset: 2px;
}

.account-avatar {
  width: 22px;
  height: 22px;
  border-radius: 50%;
  background: var(--orange);
  color: var(--white);
  font-size: 10px;
  font-weight: 800;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  letter-spacing: 0;
}

.account-name {
  max-width: 120px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.account-role-badge {
  font-size: 9px;
  font-weight: 700;
  letter-spacing: 0.5px;
  text-transform: uppercase;
  background: rgba(232,99,26,0.30);
  color: #ffd3b5;
  border-radius: 3px;
  padding: 1px 5px;
  line-height: 1.4;
}
.account-role-osd {
  background: rgba(107,33,168,0.35);
  color: #e9d5ff;
}

/* Dropdown header strip */
.dropdown-header {
  padding: 12px 16px 10px;
  border-bottom: 1px solid var(--border);
  background: var(--bg);
}
.dropdown-header .dh-name {
  font-size: 13px;
  font-weight: 700;
  color: var(--text);
  line-height: 1.3;
}
.dropdown-header .dh-email {
  font-size: 11px;
  color: var(--text-muted);
  margin-top: 1px;
  word-break: break-all;
}
.dropdown-header .dh-role {
  display: inline-block;
  margin-top: 6px;
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 0.6px;
  text-transform: uppercase;
  padding: 2px 7px;
  border-radius: 3px;
  background: var(--clean-bg);
  color: var(--clean);
}
.dropdown-header .dh-role.is-admin {
  background: var(--orange-lt);
  color: #9a3a06;
}
.dropdown-header .dh-role.is-osd-user {
  background: #fdf4ff;
  color: #6b21a8;
}

/* Dropdown items */
.dropdown-items {
  list-style: none;
  padding: 6px 0;
}
.dropdown-items li { margin: 0; }
.dropdown-items a,
.dropdown-items button {
  display: flex;
  align-items: center;
  gap: 10px;
  width: 100%;
  padding: 9px 16px;
  font-size: 13px;
  font-weight: 500;
  color: var(--text);
  text-decoration: none;
  background: none;
  border: none;
  cursor: pointer;
  text-align: left;
  transition: background 0.15s;
}
.dropdown-items a:hover,
.dropdown-items a:focus,
.dropdown-items button:hover,
.dropdown-items button:focus {
  background: var(--bg);
  color: var(--navy);
  outline: none;
}
.dropdown-items a:focus-visible,
.dropdown-items button:focus-visible {
  outline: 2px solid var(--navy);
  outline-offset: -2px;
}
.dropdown-items svg {
  width: 15px;
  height: 15px;
  flex-shrink: 0;
  color: var(--text-muted);
}

.dropdown-divider {
  height: 1px;
  background: var(--border);
  margin: 4px 0;
}

.dropdown-items .item-logout {
  color: var(--critical);
  font-weight: 600;
}
.dropdown-items .item-logout svg { color: var(--critical); }
.dropdown-items .item-logout:hover,
.dropdown-items .item-logout:focus {
  background: var(--critical-bg);
  color: var(--critical);
}

/* -- Header body ------------------------------------------------------------- */
.header-body {
  padding: 10px 28px 12px;
}
.header-body .client-label {
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 1.6px;
  text-transform: uppercase;
  color: rgba(255,255,255,0.85);
  margin-bottom: 2px;
}
.header-body h1 {
  font-size: 20px;
  font-weight: 700;
  color: var(--white);
  margin-bottom: 4px;
}
.header-body .header-sub {
  font-size: 12px;
  color: rgba(255,255,255,0.85);
  display: flex;
  align-items: center;
  gap: 8px;
}
.header-body .header-sub .sep {
  color: var(--orange);
  font-weight: 700;
}

/* -- Breadcrumb -------------------------------------------------------------- */
.breadcrumb-wrap {
  padding: 8px 28px 0;
}
.breadcrumb {
  list-style: none;
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 0;
  margin: 0;
}
.breadcrumb li {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 12px;
}
.breadcrumb li + li::before {
  content: '›';
  color: rgba(255,255,255,0.5);
  font-weight: 700;
  font-size: 14px;
  line-height: 1;
}
.breadcrumb a {
  color: rgba(255,255,255,0.80);
  text-decoration: none;
  font-weight: 600;
}
.breadcrumb a:hover,
.breadcrumb a:focus {
  color: var(--white);
  text-decoration: underline;
  outline: none;
}
.breadcrumb a:focus-visible {
  outline: 2px solid var(--orange);
  border-radius: 2px;
  outline-offset: 2px;
}
.breadcrumb [aria-current="page"] {
  color: rgba(255,255,255,0.65);
  font-weight: 400;
}

/* -- Main content wrapper ---------------------------------------------------- */
.main {
  flex: 1;
  width: 100%;
  max-width: 1120px;
  margin: 0 auto;
  padding: 36px 40px 56px;
}

/* -- Utility ----------------------------------------------------------------- */
.sr-only {
  position: absolute; width: 1px; height: 1px;
  padding: 0; margin: -1px; overflow: hidden;
  clip: rect(0,0,0,0); white-space: nowrap; border: 0;
}

/* -- Login page -------------------------------------------------------------- */
.login-wrap {
  flex: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 40px 20px;
}
.login-card {
  background: var(--white);
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 44px 48px;
  width: 100%;
  max-width: 420px;
  box-shadow: 0 4px 24px rgba(34,61,146,0.08);
}
.login-card h2 {
  font-size: 22px;
  font-weight: 700;
  color: var(--navy);
  margin-bottom: 4px;
}
.login-card .login-sub {
  font-size: 13px;
  color: var(--text-muted);
  margin-bottom: 28px;
}
.form-field { margin-bottom: 18px; }
.form-field label {
  display: block;
  font-size: 13px;
  font-weight: 600;
  color: var(--text);
  margin-bottom: 6px;
}
.form-field input {
  width: 100%;
  padding: 10px 14px;
  font-size: 14px;
  border: 1.5px solid var(--border);
  border-radius: 6px;
  color: var(--text);
  background: var(--white);
  transition: border-color 0.2s, box-shadow 0.2s;
}
.form-field input:focus {
  outline: none;
  border-color: var(--navy);
  box-shadow: 0 0 0 3px rgba(34,61,146,0.14);
}
.form-field input:focus-visible {
  outline: 2px solid var(--navy);
  outline-offset: 0;
}
.btn-primary {
  display: inline-block;
  width: 100%;
  padding: 11px 20px;
  background: var(--navy);
  color: var(--white);
  font-size: 14px;
  font-weight: 700;
  border: none;
  border-radius: 6px;
  cursor: pointer;
  letter-spacing: 0.3px;
  transition: background 0.2s;
  margin-top: 6px;
  text-align: center;
  text-decoration: none;
}
.btn-primary:hover,
.btn-primary:focus {
  background: var(--navy-dark);
  outline: none;
  box-shadow: 0 0 0 3px rgba(34,61,146,0.20);
}
.btn-primary:focus-visible {
  outline: 2px solid var(--orange);
  outline-offset: 2px;
}
.alert {
  padding: 11px 16px;
  border-radius: 6px;
  font-size: 13px;
  margin-bottom: 20px;
  font-weight: 500;
}
.alert-error {
  background: var(--critical-bg);
  border: 1px solid #fca5a5;
  color: var(--critical);
}
.alert-success {
  background: var(--minor-bg);
  border: 1px solid #86efac;
  color: var(--minor);
}

/* -- Dashboard: scan cards --------------------------------------------------- */
.section-header {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  margin-bottom: 24px;
  padding-bottom: 14px;
  border-bottom: 2px solid var(--border);
}
.section-header h2 {
  font-size: 17px;
  font-weight: 700;
  color: var(--navy);
}
.section-meta {
  font-size: 13px;
  color: var(--text-muted);
}

.scan-list { display: flex; flex-direction: column; gap: 16px; }

.scan-card {
  background: var(--white);
  border: 1px solid var(--border);
  border-radius: 8px;
  overflow: hidden;
  transition: box-shadow 0.2s, border-color 0.2s;
}
.scan-card:hover { border-color: var(--navy-mid); box-shadow: 0 4px 18px rgba(34,61,146,0.10); }
.scan-card.is-latest { border-left: 4px solid var(--orange); }

.card-inner {
  display: grid;
  grid-template-columns: 1fr auto;
}
.card-main { padding: 20px 24px; }

.card-top {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 6px;
  flex-wrap: wrap;
}
.badge-latest {
  background: var(--orange);
  color: var(--white);
  font-size: 10px;
  font-weight: 800;
  letter-spacing: 1px;
  text-transform: uppercase;
  padding: 2px 8px;
  border-radius: 3px;
}
.scan-date { font-size: 15px; font-weight: 700; color: var(--text); }
.scan-time { font-size: 12px; color: var(--text-muted); }

.stats-row {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-bottom: 14px;
}
.chip {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 8px 12px;
  border-radius: 6px;
  min-width: 64px;
  text-align: center;
  border: 1px solid transparent;
}
.chip-num {
  font-size: 20px;
  font-weight: 800;
  line-height: 1;
  margin-bottom: 3px;
}
.chip-label {
  font-size: 10px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  line-height: 1.2;
}
.chip-pages   { background:#eef2fb; color: var(--navy);     border-color:#c5d0ea; }
.chip-issues  { background:#f5f5f5; color: var(--text);     border-color:#d1d5db; }
.chip-critical{ background: var(--critical-bg); color: var(--critical); border-color:#fca5a5; }
.chip-serious { background: var(--serious-bg);  color: var(--serious);  border-color:#fdba74; }
.chip-moderate{ background: var(--moderate-bg); color: var(--moderate); border-color:#fcd34d; }
.chip-minor   { background: var(--minor-bg);    color: var(--minor);    border-color:#86efac; }
.chip-clean   { background: var(--clean-bg);    color: var(--clean);    border-color:#93c5fd; }

.health-wrap { display: flex; align-items: center; gap: 10px; }
.health-bar {
  flex: 1;
  height: 6px;
  background: var(--border);
  border-radius: 3px;
  overflow: hidden;
}
.health-fill {
  height: 100%;
  border-radius: 3px;
}
@media (prefers-reduced-motion: no-preference) {
  .health-fill { transition: width 0.4s ease; }
}
.health-pct {
  font-size: 12px;
  font-weight: 700;
  color: var(--text-muted);
  white-space: nowrap;
  min-width: 90px;
  text-align: right;
}

.card-action {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 6px;
  padding: 20px 24px;
  background: var(--bg);
  border-left: 1px solid var(--border);
  text-decoration: none;
  color: var(--navy);
  font-size: 12px;
  font-weight: 700;
  text-align: center;
  min-width: 100px;
  transition: background 0.2s, color 0.2s;
}
.card-action:hover,
.card-action:focus {
  background: var(--navy);
  color: var(--white);
  outline: none;
}
.card-action:focus-visible {
  outline: 2px solid var(--orange);
  outline-offset: -3px;
}
.card-action svg { width: 28px; height: 28px; }

.empty-state {
  text-align: center;
  padding: 60px 40px;
  color: var(--text-muted);
}
.empty-state .empty-icon {
  font-size: 48px;
  margin-bottom: 16px;
  opacity: 0.5;
}
.empty-state p { margin-bottom: 6px; }

/* -- Report + users shared back-link style ----------------------------------- */
.back-link {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: 13px;
  font-weight: 600;
  color: var(--navy);
  text-decoration: none;
  margin-bottom: 24px;
}
.back-link:hover { text-decoration: underline; }
.back-link:focus-visible {
  outline: 2px solid var(--navy);
  border-radius: 3px;
  outline-offset: 2px;
}
.back-link svg { width: 16px; height: 16px; }

/* -- Report meta / summary --------------------------------------------------- */
.report-meta-bar {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  margin-bottom: 28px;
}
.meta-pill {
  background: var(--white);
  border: 1px solid var(--border);
  border-radius: 20px;
  padding: 5px 14px;
  font-size: 12px;
  color: var(--text-muted);
}
.meta-pill strong { color: var(--text); }

.summary-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(140px, 1fr));
  gap: 14px;
  margin-bottom: 36px;
}
.summary-box {
  background: var(--white);
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 18px 16px;
  text-align: center;
}
.summary-box .sb-num {
  font-size: 32px;
  font-weight: 800;
  line-height: 1;
  margin-bottom: 6px;
}
.summary-box .sb-label {
  font-size: 11px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.6px;
  color: var(--text-muted);
}
.sb-critical { color: var(--critical); }
.sb-serious  { color: var(--serious); }
.sb-moderate { color: var(--moderate); }
.sb-minor    { color: var(--minor); }
.sb-pages    { color: var(--navy); }

/* Pages accordion */
.page-accordion { display: flex; flex-direction: column; gap: 10px; }
.acc-item {
  background: var(--white);
  border: 1px solid var(--border);
  border-radius: 8px;
  overflow: hidden;
}
.acc-trigger {
  width: 100%;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 14px 20px;
  background: none;
  border: none;
  cursor: pointer;
  font-size: 14px;
  font-weight: 600;
  color: var(--text, #1a1a1a);
  text-align: left;
  transition: background 0.15s;
}
.acc-trigger:hover  { background: var(--bg); }
.acc-trigger:focus  { outline: 2px solid var(--navy, #223D92); outline-offset: -2px; }
.acc-trigger[aria-expanded="true"] { border-bottom: 1px solid var(--border); }

.acc-trigger-left { display: flex; align-items: center; gap: 10px; flex: 1; min-width: 0; overflow: hidden; }
.acc-url {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  min-width: 0;
  max-width: 100%;
  color: var(--navy, #223D92);
  font-weight: 600;
  font-size: 13px;
  text-decoration: none;
}
.acc-url:hover, .acc-url:focus { text-decoration: underline; }
.acc-url-text {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  min-width: 0;
}
.acc-url-icon { flex-shrink: 0; opacity: 0.75; }
.acc-right { display: flex; align-items: center; gap: 8px; flex-shrink: 0; }
.acc-chevron {
  width: 18px; height: 18px;
  color: var(--text-muted);
  flex-shrink: 0;
}
@media (prefers-reduced-motion: no-preference) {
  .acc-chevron { transition: transform 0.2s; }
}
.acc-trigger[aria-expanded="true"] .acc-chevron { transform: rotate(180deg); }
.acc-body { padding: 16px 20px; }

.violations-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 13px;
}
.violations-table th {
  text-align: left;
  font-size: 11px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  color: var(--text-muted);
  padding: 6px 10px;
  border-bottom: 2px solid var(--border);
}
.violations-table td {
  padding: 9px 10px;
  border-bottom: 1px solid var(--border);
  vertical-align: top;
  color: var(--text);
}
.violations-table tr:last-child td { border-bottom: none; }
.violations-table tr:hover td { background: var(--bg); }

.sev-badge {
  display: inline-block;
  font-size: 10px;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  padding: 2px 8px;
  border-radius: 3px;
  white-space: nowrap;
}
.sev-critical { background: var(--critical-bg); color: var(--critical); }
.sev-serious  { background: var(--serious-bg);  color: var(--serious); }
.sev-moderate { background: var(--moderate-bg); color: var(--moderate); }
.sev-minor    { background: var(--minor-bg);    color: var(--minor); }

.clean-page-note {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 13px;
  color: var(--minor);
  font-weight: 600;
  padding: 10px 0;
}

.top-issues-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 13px;
  background: var(--white);
  border: 1px solid var(--border);
  border-radius: 8px;
  overflow: hidden;
  margin-bottom: 36px;
}
.top-issues-table th {
  background: var(--bg);
  text-align: left;
  font-size: 11px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  color: var(--text-muted);
  padding: 10px 16px;
  border-bottom: 2px solid var(--border);
}
.top-issues-table td {
  padding: 11px 16px;
  border-bottom: 1px solid var(--border);
  color: var(--text);
  vertical-align: top;
}
.top-issues-table tr:last-child td { border-bottom: none; }
.top-issues-table tr:hover td { background: var(--bg); }

/* -- Admin client grid (admin.php) ------------------------------------------- */
.client-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 20px;
}
.client-card {
  background: var(--white);
  border: 1px solid var(--border);
  border-radius: 10px;
  overflow: hidden;
  transition: box-shadow 0.2s, border-color 0.2s;
  display: flex;
  flex-direction: column;
}
.client-card:hover {
  border-color: var(--navy-mid);
  box-shadow: 0 4px 18px rgba(34,61,146,0.10);
}
.client-card-header {
  padding: 18px 20px 12px;
  border-bottom: 1px solid var(--border);
}
.client-card-name {
  font-size: 16px;
  font-weight: 700;
  color: var(--navy);
  margin-bottom: 3px;
}
.client-card-url {
  font-size: 12px;
  color: var(--text-muted);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.client-card-body {
  padding: 14px 20px;
  flex: 1;
}
.client-card-stats {
  display: flex;
  gap: 16px;
  flex-wrap: wrap;
}
.client-stat {
  display: flex;
  flex-direction: column;
}
.client-stat-num {
  font-size: 22px;
  font-weight: 800;
  color: var(--text);
  line-height: 1;
}
.client-stat-label {
  font-size: 10px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  color: var(--text-muted);
  margin-top: 2px;
}
.client-stat-num.has-critical { color: var(--critical); }
.client-card-footer {
  padding: 12px 20px;
  border-top: 1px solid var(--border);
  background: var(--bg);
}
.client-card-link {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: 13px;
  font-weight: 700;
  color: var(--navy);
  text-decoration: none;
}
.client-card-link:hover,
.client-card-link:focus {
  text-decoration: underline;
  outline: none;
}
.client-card-link:focus-visible {
  outline: 2px solid var(--navy);
  border-radius: 3px;
  outline-offset: 2px;
}
.client-card-link svg { width: 14px; height: 14px; }
.client-inactive-badge {
  display: inline-block;
  font-size: 10px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  padding: 2px 7px;
  border-radius: 3px;
  background: #f3f4f6;
  color: #6b7280;
  border: 1px solid #e5e7eb;
  margin-left: 8px;
  vertical-align: middle;
}

/* -- Site footer ------------------------------------------------------------- */
.site-footer {
  background: var(--navy);
  color: rgba(255,255,255,0.75);
  font-size: 12px;
  padding: 18px 40px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: auto;
}
.site-footer a {
  color: rgba(255,255,255,0.90);
  text-decoration: none;
  font-weight: 600;
}
.site-footer a:hover,
.site-footer a:focus {
  color: var(--white);
  text-decoration: underline;
}
.footer-sep {
  color: var(--orange);
  margin: 0 8px;
  font-weight: 700;
}

/* -- Responsive -------------------------------------------------------------- */
@media (max-width: 700px) {
  .header-top { grid-template-columns: 1fr auto; padding: 0 16px; }
  .header-label { display: none; }
  .header-body,
  .breadcrumb-wrap,
  .main { padding-left: 16px; padding-right: 16px; }
  .card-inner { grid-template-columns: 1fr; }
  .card-action {
    flex-direction: row;
    border-left: none;
    border-top: 1px solid var(--border);
    padding: 14px 20px;
    justify-content: flex-start;
    min-width: unset;
  }
  .login-card { padding: 32px 24px; }
  .summary-grid { grid-template-columns: repeat(2, 1fr); }
  .account-name { max-width: 80px; }
  .violations-table thead { display: none; }
  .violations-table tr {
    display: block;
    border-bottom: 1px solid var(--border);
    padding: 10px 0;
  }
  .violations-table tr:last-child { border-bottom: none; }
  .violations-table td {
    display: block;
    padding: 3px 10px;
    border: none;
  }
  .nav-links { display: none; }
  .site-footer { padding: 16px; flex-direction: column; text-align: center; }
}
