/* IT Metrics Platform — Custom Styles */
/* Based on Herotel LANScan reference app (check-ux / check-branding) */

/* ── Base font ───────────────────────────────────────────────────── */
html { font-size: 15px; }

/* ── Barlow font (self-hosted) ──────────────────────────────────── */
@font-face { font-family: 'Barlow'; font-weight: 500; font-style: normal; font-display: swap; src: url('/fonts/barlow-500.woff2') format('woff2'); }
@font-face { font-family: 'Barlow'; font-weight: 600; font-style: normal; font-display: swap; src: url('/fonts/barlow-600.woff2') format('woff2'); }
@font-face { font-family: 'Barlow'; font-weight: 700; font-style: normal; font-display: swap; src: url('/fonts/barlow-700.woff2') format('woff2'); }
@font-face { font-family: 'Barlow'; font-weight: 800; font-style: normal; font-display: swap; src: url('/fonts/barlow-800.woff2') format('woff2'); }

/* ── Herotel brand tokens (theme-independent) ───────────────────── */
:root {
  --herotel-orange: #FF5000;
  --herotel-orange-75: #FC6445;
  --herotel-orange-50: #FD9E80;
  --herotel-orange-25: #FDD2C2;
  --herotel-charcoal: #3D3B34;
  --herotel-charcoal-75: #656359;
  --herotel-charcoal-65: #6D6A63;
  --herotel-charcoal-50: #9B9993;
  --herotel-charcoal-25: #CDCCC9;
  --herotel-teal: #17A2B1;
  --header-height: 72px;
  --sidebar-width: 220px;
  --sidebar-collapsed-width: 56px;
  --sidebar-transition: width 0.2s ease;
}

/* ── Dark mode semantic tokens ──────────────────────────────────── */
[data-bs-theme="dark"] {
  --bg: #18181b;
  --surface: #303036;
  --surface-2: #28282d;
  --surface-hover: #3c3c42;
  --text: #ececea;
  --text-2: #a8a8a8;
  --text-3: #787878;
  --border: #454550;
  --shadow: 0 2px 8px rgba(0,0,0,0.3);
  --shadow-lg: 0 8px 32px rgba(0,0,0,0.45);
  --gradient-warm-1: linear-gradient(135deg, #303036 0%, #3a3230 100%);
  --gradient-warm-2: linear-gradient(135deg, #303036 0%, #2e303a 100%);
  --gradient-warm-3: linear-gradient(135deg, #303036 0%, #303630 100%);
  --gradient-warm-4: linear-gradient(135deg, #303036 0%, #363230 100%);
  --gradient-surface: linear-gradient(135deg, #303036 0%, #343230 100%);
  --row-alt: rgba(255,255,255,0.025);
  --row-hover: rgba(255,255,255,0.055);
}

/* ── Light mode semantic tokens ─────────────────────────────────── */
[data-bs-theme="light"] {
  --bg: #f7f5f2;
  --surface: #ffffff;
  --surface-2: #f0ece6;
  --surface-hover: #f0ece6;
  --text: #3D3B34;
  --text-2: #656359;
  --text-3: #9B9993;
  --border: #CDCCC9;
  --shadow: 0 2px 8px rgba(0,0,0,0.06);
  --shadow-lg: 0 8px 32px rgba(0,0,0,0.12);
  --gradient-warm-1: linear-gradient(135deg, #ffffff 0%, #fef8f4 100%);
  --gradient-warm-2: linear-gradient(135deg, #ffffff 0%, #f4f8fe 100%);
  --gradient-warm-3: linear-gradient(135deg, #ffffff 0%, #f4fef6 100%);
  --gradient-warm-4: linear-gradient(135deg, #ffffff 0%, #fef6f4 100%);
  --gradient-surface: linear-gradient(135deg, #ffffff 0%, #fefcfa 100%);
  --row-alt: rgba(0,0,0,0.02);
  --row-hover: rgba(0,0,0,0.03);
}

/* ── Base ────────────────────────────────────────────────────────── */
body {
  background: var(--bg) !important;
  color: var(--text);
  font-family: Arial, system-ui, sans-serif;
}

/* ── Header ─────────────────────────────────────────────────────── */
header {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  height: var(--header-height);
  z-index: 1050;
  background: var(--herotel-charcoal);
  border-bottom: 3px solid var(--herotel-orange);
  padding: 0 48px;
  display: flex;
  align-items: center;
  gap: 14px;
}

.logo {
  display: flex;
  align-items: center;
  text-decoration: none;
}

.logo-img {
  height: 36px;
  width: auto;
  /* White variant — do NOT apply filter, the white logo is correct as-is */
}

.header-tagline {
  color: rgba(255,255,255,0.75);
  font-size: 13px;
  font-style: italic;
  white-space: nowrap;
}

.theme-btn {
  background: rgba(255,255,255,0.15);
  border: none;
  border-radius: 50%;
  width: 32px;
  height: 32px;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  color: #fff;
  flex-shrink: 0;
  transition: background 0.15s;
  margin-left: auto;
}

.theme-btn:hover {
  background: rgba(255,255,255,0.28);
}

/* Light mode: show moon. Dark mode: show sun. */
.theme-btn .icon-sun { display: none; }
.theme-btn .icon-moon { display: flex; }
[data-bs-theme="dark"] .theme-btn .icon-sun { display: flex; }
[data-bs-theme="dark"] .theme-btn .icon-moon { display: none; }

.user-chip {
  margin-left: 10px;
  display: flex;
  align-items: center;
  gap: 9px;
}

.user-avatar-sm {
  width: 30px;
  height: 30px;
  border-radius: 50%;
  background: rgba(255,255,255,0.25);
  color: #fff;
  font-size: 11px;
  font-weight: 700;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  letter-spacing: 0.5px;
  overflow: hidden;
}

.user-name-sm {
  color: rgba(255,255,255,0.9);
  font-size: 13px;
  font-weight: 500;
  white-space: nowrap;
}

@media (max-width: 599.98px) {
  header { padding: 0 16px; }
  .user-chip { display: none !important; }
}

/* ── Sidebar ─────────────────────────────────────────────────────── */
.sidebar {
  position: fixed;
  top: calc(var(--header-height) + 3px);
  left: 0;
  height: calc(100vh - var(--header-height) - 3px);
  width: var(--sidebar-width);
  min-width: var(--sidebar-width);
  overflow: hidden;
  overflow-y: auto;
  z-index: 1000;
  display: flex;
  flex-direction: column;
  transition: var(--sidebar-transition);
  border-right: 1px solid var(--bs-border-color);
}

.sidebar.collapsed {
  width: var(--sidebar-collapsed-width);
  min-width: var(--sidebar-collapsed-width);
}

[data-bs-theme="dark"] .sidebar {
  background-color: #222228;
  border-right-color: #3a3a42;
}
[data-bs-theme="light"] .sidebar {
  background-color: #f8f9fa;
  border-right-color: #dee2e6;
}

.sidebar .sidebar-brand {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0.75rem 1rem;
  min-height: 56px;
  white-space: nowrap;
  overflow: hidden;
  border-bottom: 1px solid var(--bs-border-color);
  flex-shrink: 0;
}

[data-bs-theme="dark"] .sidebar .sidebar-brand { border-bottom-color: #3a3a42; }
[data-bs-theme="light"] .sidebar .sidebar-brand { border-bottom-color: #dee2e6; }

.sidebar .sidebar-brand .brand-name {
  font-family: 'Barlow', Arial, sans-serif;
  font-size: 1rem;
  font-weight: 700;
  letter-spacing: 0.05em;
  overflow: hidden;
  transition: opacity 0.15s ease, width 0.2s ease;
}

.sidebar.collapsed .brand-name {
  opacity: 0;
  width: 0;
  overflow: hidden;
}

.sidebar .sidebar-toggle {
  background: none;
  border: none;
  color: var(--bs-body-color);
  cursor: pointer;
  padding: 0.25rem;
  flex-shrink: 0;
  line-height: 1;
}

.sidebar .sidebar-toggle:hover {
  color: var(--herotel-orange);
}

.sidebar-nav {
  list-style: none;
  padding: 0.5rem 0;
  margin: 0;
  flex: 1;
  overflow: hidden;
}

.sidebar-nav-item {
  display: flex;
  align-items: center;
  padding: 0.5rem 1rem;
  color: var(--bs-secondary-color);
  text-decoration: none;
  white-space: nowrap;
  overflow: hidden;
  border-radius: 0;
  border-left: 3px solid transparent;
  padding-left: calc(1rem - 3px);
  transition: background-color 0.15s ease, color 0.15s ease, border-color 0.15s ease;
  gap: 0.75rem;
}

.sidebar-nav-item:hover {
  background-color: var(--bs-secondary-bg);
  color: var(--bs-body-color);
  text-decoration: none;
}

/* Active: orange text + 3px left orange border — NO background fill */
.sidebar-nav-item.active {
  background-color: transparent;
  color: var(--herotel-orange);
  border-left-color: var(--herotel-orange);
  font-weight: 600;
}

.sidebar-nav-item .nav-icon {
  flex-shrink: 0;
  width: 1.25rem;
  text-align: center;
  font-size: 0.9rem;
}

.sidebar-nav-item .nav-label {
  overflow: hidden;
  transition: opacity 0.15s ease, width 0.2s ease;
  flex: 1;
}

.sidebar.collapsed .nav-label {
  opacity: 0;
  width: 0;
  overflow: hidden;
}

.sidebar-bottom {
  border-top: 1px solid var(--bs-border-color);
  padding: 0.5rem 0;
  flex-shrink: 0;
}

[data-bs-theme="dark"] .sidebar-bottom { border-top-color: #3a3a42; }
[data-bs-theme="light"] .sidebar-bottom { border-top-color: #dee2e6; }

/* ── Sidebar footer — running version + environment badge (check-app-version) ── */
.sidebar-footer {
  margin-top: auto;
  padding: 8px 12px;
  font-size: 0.75rem;
  color: var(--text-3);
  border-top: 1px solid var(--border);
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 6px;
  flex-shrink: 0;
}

.sidebar-footer .version {
  font-family: var(--bs-font-monospace, monospace);
  white-space: nowrap;
}

.sidebar-footer .env {
  text-transform: uppercase;
  font-weight: 600;
  letter-spacing: 0.04em;
  padding: 2px 6px;
  border-radius: 4px;
  font-size: 0.65rem;
  white-space: nowrap;
}

.sidebar-footer .env--local      { background: var(--surface-2); color: var(--text-2); }
.sidebar-footer .env--pi         { background: #0ea5e9; color: #fff; }
.sidebar-footer .env--linux      { background: #2563eb; color: #fff; }
.sidebar-footer .env--production { background: #FF5000; color: #fff; }
.sidebar-footer .env--unknown    { background: var(--surface-2); color: var(--text-3); }

.sidebar.collapsed .sidebar-footer { justify-content: center; padding: 8px 4px; }
.sidebar.collapsed .sidebar-footer .env { display: none; }
.sidebar.collapsed .sidebar-footer .version { font-size: 0.6rem; }

/* ── Main content ─────────────────────────────────────────────────── */
.main-content {
  margin-left: var(--sidebar-width);
  margin-top: calc(var(--header-height) + 3px);
  min-height: calc(100vh - var(--header-height) - 3px);
  padding: 1.25rem;
  transition: margin-left 0.2s ease;
}

.sidebar.collapsed ~ .main-content,
body.sidebar-collapsed .main-content {
  margin-left: var(--sidebar-collapsed-width);
}

.main-content.no-sidebar {
  margin-left: 0;
}

/* ── Page header ──────────────────────────────────────────────────── */
.page-header {
  margin-bottom: 1rem;
  padding-bottom: 0.5rem;
  border-bottom: none;
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 0.5rem;
}

.page-header h1 {
  margin: 0;
  font-family: 'Barlow', Arial, sans-serif;
  font-size: 1.25rem;
  font-weight: 700;
  letter-spacing: -0.3px;
  color: var(--text);
}

/* ── Cards and surfaces ───────────────────────────────────────────── */
.card {
  background: var(--gradient-surface);
  border-color: var(--border);
  box-shadow: var(--shadow);
  border-radius: 8px;
}

.card-header {
  background: transparent;
  border-bottom-color: var(--border);
  border-left: 3px solid var(--herotel-orange);
  font-size: 9px;
  text-transform: uppercase;
  letter-spacing: 1px;
  font-weight: 700;
  color: var(--herotel-orange);
  padding: 10px 12px;
  font-family: 'Barlow', Arial, sans-serif;
}

.card-body { padding: 12px; }

.surface-card {
  background: var(--gradient-surface);
  border-radius: 8px;
  box-shadow: var(--shadow);
  padding: 12px;
  border: 1px solid var(--border);
  transition: box-shadow 0.15s ease, transform 0.15s ease;
}

/* ── KPI stat cards ───────────────────────────────────────────────── */
.stat-card {
  border-radius: 8px;
  box-shadow: var(--shadow);
  padding: 10px 12px;
  border: 1px solid var(--border);
  text-decoration: none !important;
  display: block;
  color: var(--text) !important;
  transition: box-shadow 0.15s ease, transform 0.15s ease;
}

.stat-card:hover {
  transform: translateY(-1px);
  box-shadow: var(--shadow), 0 4px 12px rgba(0,0,0,0.15);
}

[data-bs-theme="dark"] .stat-card { border-color: transparent; }

.stat-card .stat-number {
  font-family: 'Barlow', Arial, sans-serif;
  font-size: 22px;
  font-weight: 800;
  line-height: 1;
}

.stat-card .stat-label {
  font-size: 9px;
  color: var(--text-2);
  margin-top: 3px;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.stat-card-1 { background: var(--gradient-warm-1); }
.stat-card-2 { background: var(--gradient-warm-2); }
.stat-card-3 { background: var(--gradient-warm-3); }
.stat-card-4 { background: var(--gradient-warm-4); }

/* ── Login page ───────────────────────────────────────────────────── */
.login-card {
  max-width: 420px;
  margin: 80px auto;
  background: var(--gradient-surface);
  border: 1px solid var(--border);
  border-radius: 10px;
  box-shadow: var(--shadow-lg);
  padding: 36px 32px;
  text-align: center;
}

.login-card .login-logo {
  height: 48px;
  width: auto;
  margin-bottom: 20px;
}

.login-card h2 {
  font-family: 'Barlow', Arial, sans-serif;
  font-size: 20px;
  font-weight: 700;
  margin-bottom: 8px;
  color: var(--text);
}

.login-card p {
  color: var(--text-2);
  font-size: 13px;
  margin-bottom: 24px;
}

.btn-login {
  background: var(--herotel-orange);
  color: #fff;
  border: none;
  border-radius: 6px;
  padding: 10px 28px;
  font-size: 14px;
  font-weight: 600;
  text-decoration: none;
  display: inline-block;
  transition: background 0.15s ease, transform 0.15s ease;
}

.btn-login:hover {
  background: #e64800;
  color: #fff;
  transform: scale(1.02);
  text-decoration: none;
}

/* ── Buttons ──────────────────────────────────────────────────────── */
.btn {
  font-size: 0.8rem;
  padding: 0.3rem 0.75rem;
}

.btn-primary {
  background: var(--herotel-orange) !important;
  border-color: var(--herotel-orange) !important;
  color: #fff !important;
  font-size: 0.8rem;
  padding: 0.3rem 0.75rem;
}

.btn-primary:hover {
  background: #e64800 !important;
  border-color: #e64800 !important;
}

.btn-secondary {
  background: transparent;
  border-color: var(--border);
  color: var(--text-2);
}

.btn-secondary:hover {
  background: var(--surface-hover);
  border-color: var(--border);
  color: var(--text);
}

.btn-sm {
  font-size: 0.75rem;
  padding: 0.2rem 0.5rem;
}

/* ── Forms ────────────────────────────────────────────────────────── */
.form-control, .form-select {
  font-size: 0.8rem;
}

.form-control:focus, .form-select:focus {
  border-color: var(--herotel-orange) !important;
  box-shadow: 0 0 0 2px rgba(255,80,0,0.15) !important;
}

/* ── Modals ───────────────────────────────────────────────────────── */
.modal-content {
  background: var(--gradient-surface) !important;
  border: 1px solid var(--border) !important;
  border-radius: 10px !important;
  box-shadow: var(--shadow-lg);
}

.modal-header { border-bottom: 1px solid var(--border); padding: 12px 16px; }
.modal-header .modal-title { font-family: 'Barlow', Arial, sans-serif; font-size: 15px; font-weight: 600; }
.modal-footer { border-top: 1px solid var(--border); padding: 10px 16px; }

[data-bs-theme="dark"] .modal-header .btn-close { filter: invert(1); }

/* ── DataTables 2.x (dt-container) ───────────────────────────────── */

/* Override Bootstrap .row's own --bs-gutter-x so negative margins don't escape the card.
   margin-top: 0 removes the mt-2 Bootstrap class DT adds to toolbar/pagination rows. */
.card > .card-body.p-0 .dt-container .row {
    --bs-gutter-x: 0;
    margin-top: 0 !important;
}
/* 5px side + 5px vertical padding on toolbar/pagination cells */
.card > .card-body.p-0 .dt-container .dt-layout-start {
    padding: 5px 0 5px 5px;
}
.card > .card-body.p-0 .dt-container .dt-layout-end {
    padding: 5px 5px 5px 0;
}
/* Strip the 2px bottom margin DT adds to the pagination ul */
.card > .card-body.p-0 .dt-container .dt-paging ul {
    margin-bottom: 0;
}

/* Container colour */
.dt-container { color: var(--text); }

/* Toolbar label text */
.dt-container .dt-length,
.dt-container .dt-search,
.dt-container .dt-info,
.dt-container .dt-paging {
    color: var(--text-2);
    font-size: 0.8rem;
}

/* Search input + length select theming */
.dt-container .dt-search input,
.dt-container .dt-length select {
    background: var(--surface-2) !important;
    color: var(--text) !important;
    border: 1px solid var(--border) !important;
    border-radius: 6px;
    padding: 4px 8px;
}
[data-bs-theme="light"] .dt-container .dt-search input,
[data-bs-theme="light"] .dt-container .dt-length select {
    background: transparent !important;
}
.dt-container .dt-search input:focus,
.dt-container .dt-length select:focus {
    outline: none;
    border-color: var(--herotel-orange) !important;
    box-shadow: 0 0 0 2px rgba(255,80,0,0.15);
}

/* Right-side toolbar cell — flex so search + refresh + columns are inline, 6px gaps */
.dt-container .dt-layout-end {
    display: flex !important;
    align-items: center;
    gap: 6px;
    flex-wrap: nowrap;
}
/* Override DT's own 1em left-margin on toolbar children */
.dt-container .dt-layout-end > * {
    margin-left: 0 !important;
}

/* Pagination */
.dt-container .pagination .page-link {
    background: var(--surface);
    border-color: var(--border);
    color: var(--text);
    padding: 0.25rem 0.5rem;
    font-size: 0.875rem;
    line-height: 1.5;
}
.dt-container .pagination .page-link:hover { background: var(--surface-hover); }
.dt-container .pagination .page-item.active .page-link {
    background: var(--herotel-orange);
    border-color: var(--herotel-orange);
    color: white;
}

/* Processing indicator */
.dt-container .dt-processing {
    background: var(--surface) !important;
    color: var(--text) !important;
    border: 1px solid var(--border) !important;
    box-shadow: var(--shadow-lg) !important;
}

/* Table cell styles */
table.dataTable thead th,
table.dataTable thead td {
  font-size: 0.7rem !important;
  color: var(--text-3) !important;
  text-transform: uppercase;
  letter-spacing: 0.8px;
  font-weight: 600;
  border-bottom: 2px solid var(--herotel-orange) !important;
  border-top: none !important;
  padding: 8px 10px !important;
  background: transparent !important;
}

table.dataTable tbody tr > td {
  font-size: 0.8rem;
  padding: 7px 10px !important;
  vertical-align: middle;
  border-bottom: 1px solid var(--border) !important;
  color: var(--text);
}

.table-striped > tbody > tr:nth-of-type(odd) > * {
    background-color: var(--row-alt) !important;
    --bs-table-bg-type: var(--row-alt);
}
.table-hover > tbody > tr:hover > * {
    background-color: var(--row-hover) !important;
    --bs-table-bg-type: var(--row-hover);
}

/* Row action buttons */
.btn-row {
    padding: 1px 6px;
    font-size: 0.75rem;
    line-height: 1.5;
    border-radius: 4px;
}

/* Badge sizing */
.badge { font-weight: 600; --bs-badge-font-size: 9px; }

/* ── Nav tabs ─────────────────────────────────────────────────────── */
.nav-tabs .nav-link.active {
  color: var(--herotel-orange);
  border-bottom-color: var(--herotel-orange);
  background: transparent;
}

/* ── Animations ───────────────────────────────────────────────────── */
@keyframes fadeSlideIn {
  from { opacity: 0; transform: translateY(8px); }
  to   { opacity: 1; transform: translateY(0); }
}

.animate-in {
  animation: fadeSlideIn 0.3s ease forwards;
  opacity: 0;
}

.animate-in:nth-child(1) { animation-delay: 0.05s; }
.animate-in:nth-child(2) { animation-delay: 0.10s; }
.animate-in:nth-child(3) { animation-delay: 0.15s; }
.animate-in:nth-child(4) { animation-delay: 0.20s; }
.animate-in:nth-child(5) { animation-delay: 0.25s; }
.animate-in:nth-child(6) { animation-delay: 0.30s; }

/* ── Utilities ────────────────────────────────────────────────────── */
.nobr { white-space: nowrap; }

/* Select2 dark mode overrides */
[data-bs-theme="dark"] .select2-container--bootstrap-5 .select2-selection {
  background-color: var(--surface);
  border-color: var(--border);
  color: var(--text);
}
[data-bs-theme="dark"] .select2-container--bootstrap-5 .select2-selection--single .select2-selection__rendered { color: var(--text); }
[data-bs-theme="dark"] .select2-container--bootstrap-5 .select2-selection__placeholder { color: var(--text-3); }
[data-bs-theme="dark"] .select2-container--bootstrap-5 .select2-dropdown {
  background-color: var(--surface);
  border-color: var(--border);
  color: var(--text);
}
[data-bs-theme="dark"] .select2-container--bootstrap-5 .select2-results__option { color: var(--text); }
[data-bs-theme="dark"] .select2-container--bootstrap-5 .select2-results__option--highlighted {
  background-color: var(--herotel-orange);
  color: white;
}
[data-bs-theme="dark"] .select2-container--bootstrap-5 .select2-search__field {
  background-color: var(--bg);
  color: var(--text);
}

/* ───────────────────────────────────────────────────────────────────────────
   Reports (Device Coverage / Dormant / Unmanaged) — Task 3.4
   Functional accent palette (spec §10.1). Reused by all report pages.
   ─────────────────────────────────────────────────────────────────────────── */
.report-accent--red       { --rpt-accent: #dc3545; }
.report-accent--amber     { --rpt-accent: #ffab00; }
.report-accent--darkamber { --rpt-accent: #d97706; }
.report-accent--green     { --rpt-accent: #198754; }
.report-accent--blue      { --rpt-accent: #0d6efd; }
.report-accent--purple    { --rpt-accent: #6f42c1; }
.report-accent--charcoal  { --rpt-accent: var(--herotel-charcoal-65); }
.report-accent--neutral   { --rpt-accent: var(--herotel-charcoal-50); }

/* Reports index cards */
.report-card { border-left: 4px solid var(--rpt-accent); transition: transform .12s ease, box-shadow .12s ease; }
a:hover > .report-card { transform: translateY(-2px); box-shadow: 0 4px 14px rgba(0,0,0,.18); }
.report-card--disabled { opacity: .72; }
.report-card-icon { color: var(--rpt-accent); font-size: 1.4rem; width: 1.8rem; text-align: center; }
.report-accent--red.report-accent--red, .report-rec.report-accent--red { color: inherit; }
.report-card .report-accent--red, .report-card .report-accent--amber,
.report-card .report-accent--darkamber, .report-card .report-accent--green,
.report-card .report-accent--blue, .report-card .report-accent--purple { color: var(--rpt-accent); }

/* ── Dashboard-hub (Navigation & Hub pass §2) ─────────────────────────────── */
.reports-group-heading {
  font-size: .82rem; font-weight: 700; letter-spacing: .04em; text-transform: uppercase;
  color: var(--herotel-charcoal-50); margin: 0 0 .6rem; padding-bottom: .3rem;
  border-bottom: 1px solid var(--bs-border-color);
}
/* at-a-glance status dot */
.hub-status { width: 11px; height: 11px; border-radius: 50%; flex: 0 0 auto; background: var(--herotel-charcoal-25); }
.hub-status--red    { background: #dc3545; }
.hub-status--amber  { background: #ffab00; }
.hub-status--green  { background: #198754; }
.hub-status--neutral{ background: var(--herotel-charcoal-25); }
/* headline KPI chips */
.hub-tiles { display: flex; flex-wrap: wrap; gap: .4rem; }
.hub-tile { border: 1px solid var(--bs-border-color); border-radius: 6px; padding: .3rem .5rem; min-width: 0; }
.hub-tile-value { font-size: 1.05rem; font-weight: 700; line-height: 1.1; color: var(--bs-body-color); }
.hub-tile-label { font-size: .68rem; color: var(--herotel-charcoal-50); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; max-width: 13ch; }
.hub-tile--red .hub-tile-value    { color: #dc3545; }
.hub-tile--amber .hub-tile-value,
.hub-tile--darkamber .hub-tile-value { color: #d97706; }
.hub-tile--green .hub-tile-value   { color: #198754; }
.hub-tile--blue .hub-tile-value    { color: #0d6efd; }
.hub-tile--purple .hub-tile-value  { color: #6f42c1; }
/* primary-tile sparkline */
.hub-spark svg { display: block; width: 100%; height: 28px; }
/* "as of" freshness widget — sits in the KPI tiles row, pushed to the right and
   aligned with the metric chips; its label + date span the widget's full width. */
.hub-asof {
  margin-left: auto; align-self: stretch;
  display: flex; flex-direction: column; justify-content: center;
  text-align: right;
}
.hub-asof-lbl { display: block; width: 100%; font-size: .6rem; text-transform: uppercase; letter-spacing: .04em; color: var(--herotel-charcoal-50); }
.hub-asof-date { display: block; width: 100%; font-size: .78rem; font-weight: 700; color: var(--bs-body-color); white-space: nowrap; }

/* Header band — charcoal, orange bottom border (spec §3/§10) */
.report-header {
  background: var(--herotel-charcoal);
  color: #fff;
  border-bottom: 3px solid var(--herotel-orange);
  border-radius: .5rem .5rem 0 0;
  padding: 1rem 1.25rem;
  margin-bottom: 1rem;
  display: flex; flex-wrap: wrap; gap: 1rem;
  justify-content: space-between; align-items: flex-start;
}
.report-title { color: #fff; margin: 0 0 .25rem; font-size: 1.4rem; }
.report-subtitle { color: var(--herotel-charcoal-25); }
.report-confidential { color: var(--herotel-orange-50); font-style: italic; }
.report-asof { color: var(--herotel-charcoal-25); margin-top: .35rem; }
.report-asof strong { color: #fff; }
.report-nearest { color: var(--herotel-orange-50); margin-left: .5rem; }
.report-freshness { color: var(--herotel-charcoal-25) !important; margin-top: .25rem; }
.report-fresh-src { margin-right: .9rem; }
.report-header-controls { min-width: 220px; }

/* KPI strip — 6 tiles repeat(6,1fr) */
.report-kpi-strip { display: grid; grid-template-columns: repeat(6, 1fr); gap: .6rem; margin-bottom: 1rem; }
@media (max-width: 1200px) { .report-kpi-strip { grid-template-columns: repeat(3, 1fr); } }
@media (max-width: 640px)  { .report-kpi-strip { grid-template-columns: repeat(2, 1fr); } }
.report-kpi {
  text-align: left; background: var(--surface, var(--bg)); border: 1px solid var(--border-color, rgba(0,0,0,.1));
  border-left: 4px solid var(--rpt-accent); border-radius: .5rem; padding: .6rem .7rem; cursor: pointer;
  transition: box-shadow .12s ease, transform .12s ease;
}
.report-kpi:hover { box-shadow: 0 3px 10px rgba(0,0,0,.15); transform: translateY(-1px); }
.report-kpi-label { font-size: .72rem; text-transform: uppercase; letter-spacing: .03em; color: var(--herotel-charcoal-50); }
.report-kpi-value { font-size: 1.6rem; font-weight: 600; line-height: 1.1; color: var(--rpt-accent); }
.report-kpi-sub { font-size: .68rem; color: var(--herotel-charcoal-50); margin-top: .15rem; min-height: 1.6em; }
.report-kpi-raw { font-size: .65rem; color: var(--herotel-charcoal-65); }
.report-kpi-spark { color: var(--rpt-accent); margin-top: .2rem; height: 26px; }
.report-kpi-spark svg { width: 100%; height: 26px; display: block; }

/* Toolbar */
.report-toolbar { display: flex; flex-wrap: wrap; gap: .5rem; justify-content: space-between; align-items: center; margin-bottom: .75rem; }
.report-toolbar-left, .report-toolbar-right { display: flex; gap: .5rem; align-items: center; flex-wrap: wrap; }
.report-search-group { width: 260px; max-width: 60vw; }

/* Category sections */
.report-cat { border: 1px solid var(--border-color, rgba(0,0,0,.1)); border-left: 4px solid var(--rpt-accent); border-radius: .4rem; margin-bottom: .6rem; overflow: hidden; }
.report-cat-summary { cursor: pointer; list-style: none; padding: .5rem .75rem; display: flex; align-items: center; gap: .55rem; font-weight: 600; }
.report-cat-summary::-webkit-details-marker { display: none; }
.report-cat-toggle { color: var(--rpt-accent); transition: transform .15s ease; }
details[open] > .report-cat-summary .report-cat-toggle { transform: rotate(90deg); }
.report-cat-label { color: var(--rpt-accent); }
.report-cat-count.badge { background: var(--rpt-accent); color: #fff; }
.report-cat-notes { margin-left: auto; color: var(--herotel-charcoal-65); font-weight: 500; font-size: .85rem; }
.report-cat-body { overflow-x: auto; }

/* Tables */
.report-table { font-size: .82rem; }
.report-table thead th { white-space: nowrap; }
.report-th-note, .report-td-note { width: 1.6rem; text-align: center; }
th.report-sortable { cursor: pointer; user-select: none; }
th.report-sortable[data-dir="asc"]::after  { content: " \25B2"; font-size: .7em; }
th.report-sortable[data-dir="desc"]::after { content: " \25BC"; font-size: .7em; }
.report-date.report-week { background: rgba(25,135,84,.12); }

/* Source A/S/I badges */
.report-src { display: inline-block; width: 1.2rem; text-align: center; border-radius: .25rem; font-size: .7rem; font-weight: 700; margin-right: .15rem; color: #fff; }
.report-src--A { background: #0d6efd; }
.report-src--S { background: #198754; }
.report-src--I { background: #6f42c1; }

/* Pills */
.report-pill { display: inline-block; padding: .05rem .4rem; border-radius: 1rem; font-size: .7rem; font-weight: 600; }
.report-pill--ok  { background: rgba(25,135,84,.18); color: #198754; }
.report-pill--off { background: rgba(220,53,69,.18); color: #dc3545; }
.report-rec { font-size: .72rem; font-weight: 600; color: var(--rpt-accent); }

/* Note indicator */
.report-note-ind.has-notes { color: var(--herotel-orange); cursor: help; }
.report-note-ind.is-empty  { color: var(--herotel-charcoal-25); }
.report-note-badge { font-size: .62rem; font-weight: 700; margin-left: .1rem; }

/* Hidden rows */
.report-row-hidden { opacity: .6; }
.report-hidden-tag { font-size: .65rem; color: var(--herotel-charcoal-65); font-style: italic; margin-left: .35rem; }

/* Footer */
.report-footer { border-top: 1px solid var(--border-color, rgba(0,0,0,.1)); padding-top: .75rem; }
.report-confidential-footer { color: var(--herotel-orange); font-weight: 600; margin-top: .25rem; }
