@import url('https://fonts.googleapis.com/css2?family=Roboto&display=swap');

/* Root Theme Variables - Dark Mode (Flat Black Theme) */
:root {
  /* Primary palette - Muted grey-blue accent */
  --color-primary: #6b7280;
  --color-primary-hover: #9ca3af;
  --color-primary-dark: #4b5563;

  /* Secondary palette - Greys */
  --color-secondary: #52525b;
  --color-secondary-hover: #71717a;
  --color-secondary-light: #a1a1aa;

  /* Status colors - PRESERVED */
  --color-danger: #e53e3e;
  --color-success: #4CAF50;
  --color-warning: #ffc107;
  --color-muted: #71717a;

  /* Badge colors - PRESERVED for status */
  --badge-approved: #7dd777;
  --badge-rejected: #f85868;
  --badge-pending: #52525b;
  --badge-validating: #ecdc7d;
  --badge-amendment: #ffbb66;

  /* Text colors for badges */
  --text-approved: #166534;
  --text-rejected: #7f1d1d;
  --text-pending: #e5e7eb;
  --text-amendment: #78350f;
  --text-validating: #1f2937;

  /* Background colors - Pure black/dark grey theme */
  --bg-body: #262624;
  --bg-card: #30302e;
  --bg-card-secondary: #1f1f1f;
  --bg-input: #1f1f1f;
  --bg-sidebar: #252523;
  --bg-navbar: #0a0a0a;
  --bg-hover: #2a2a2a;
  --bg-table-header: #1a1a1a;
  --bg-table-row-alt: #30302e;
  --bg-table-row-hover: #252525;

  /* Text colors */
  --text-primary: #f5f5f5;
  --text-secondary: #a3a3a3;
  --text-muted: #737373;
  --text-heading: #e5e5e5;
  --text-link: #a3a3a3;
  --text-link-hover: #d4d4d4;
  --action-link: #a7c4f4;
  --action-link-hover: #d4e2ff;

  /* Border colors */
  --border-color: #30302e9e;
  --border-light: #3f3f3f;
  --border-focus: #525252;

  /* Shadow - Removed for flat design */
  --shadow-sm: none;
  --shadow-md: none;
  --shadow-lg: none;

  --border-radius: 8px;
  --font-family: 'Roboto', sans-serif;
}

/* Themed scrollbars — a subtle dark bar that matches the UI instead of the
   default bright OS scrollbar. Uses theme vars so it follows light/dark.
   Component-specific scrollbar rules (live-roi, orgx, …) have higher
   specificity and still win where they're defined. */
html {
  scrollbar-width: thin;                              /* Firefox */
  scrollbar-color: var(--border-light) transparent;
}
*::-webkit-scrollbar {                                /* Chrome, Edge, Safari */
  width: 10px;
  height: 10px;
}
*::-webkit-scrollbar-track {
  background: transparent;
}
*::-webkit-scrollbar-thumb {
  background: var(--border-light);
  border-radius: 6px;
  border: 2px solid transparent;
  background-clip: content-box;
}
*::-webkit-scrollbar-thumb:hover {
  background: var(--color-secondary-hover);
  background-clip: content-box;
}

/* Custom navbar brand styling */
.navbar-brand-custom {
  font-size: 2rem;
  font-family: Verdana, sans-serif;
  color: var(--text-primary);
  flex-shrink: 0;
}

/* Logout button styling */
.btn-logout {
  width: 10rem;
  margin-left: 1rem;
}

body {
  font-family: var(--font-family);
  background-color: var(--bg-body) !important;
  color: var(--text-primary);
  margin: 0;
  padding: 0;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}

.bg-dark {
  background-color: var(--text-amendment) !important;
}

.card {
  border-radius: 12px;
  padding: 1rem;
  box-shadow: var(--shadow-md);
  background-color: var(--bg-card) !important;
  color: var(--text-primary) !important;
  border: 1px solid var(--border-color);
}

/* Custom wide card for larger screens */
.wide-card {
  width: 100%;
  max-width: 100%;
  margin: 0 0 1rem 0;
  padding: 1rem 2rem;
  background: var(--bg-card);
  border-radius: 8px;
  box-shadow: var(--shadow-md);
  overflow-x: auto;
  border: 1px solid var(--border-color);
}

h2 {
  text-align: center;
  margin-bottom: 1.5rem;
  color: var(--text-heading);
}

table {
  width: 100%;
  color: var(--text-primary);
}

form label {
  display: block;
  font-weight: bold;
  color: var(--text-secondary);
}

form input {
  width: 100%;
  padding: 0.5rem;
  border: 1px solid var(--border-color);
  border-radius: 6px;
  box-sizing: border-box;
  background-color: var(--bg-input);
  color: var(--text-primary);
}

form input:focus {
  border-color: var(--border-focus);
  outline: none;
}

form select {
  width: 30rem;
  padding: 0.5rem;
  margin-top: 0.3rem;
  border: 1px solid var(--border-color);
  border-radius: 6px;
  box-sizing: border-box;
  background-color: var(--bg-input);
  color: var(--text-primary);
}

form select:focus {
  border-color: var(--border-focus);
  outline: none;
}

.fadeable-banner {
  transition: opacity 0.5s ease;
}

.fadeable-banner.fade-out {
  opacity: 0;
}


button {
  width: 100%;
  padding: 0.75rem;
  margin-top: 1.5rem;
  background-color: var(--color-primary);
  color: var(--accent-ink);
  border: none;
  border-radius: 6px;
  cursor: pointer;
  font-weight: bold;
  transition: background-color 0.2s ease;
  }

button:hover {
  background-color: var(--color-primary-hover);
}

a {
  color: var(--text-link);
  text-decoration: none;
}

a:hover {
  text-decoration: underline;
  color: var(--text-link-hover);
}

p {
  text-align: center;
  margin-top: 1rem;
  color: var(--text-secondary);
}

.container {
  display: grid;
  grid-template-columns: 3fr 3fr;
  width: 100%;
  max-width: 100%;
  padding: 1rem 2rem;
  margin: 0;
}

.container,
.wide-card {
  container-type: inline-size;
}

/* Same side gutter as GRC (.orgx .page): .layout-content already supplies 24px. */
.layout-content > .container {
  padding-left: 4px;
  padding-right: 4px;
}

/* Flash messages */
.alert {
  padding: 1rem;
  border-radius: var(--border-radius);
  margin-bottom: 1rem;
}

.alert-success {
  background-color: rgba(22, 101, 52, 0.35);
  color: #86efac;
  border: 1px solid rgba(74, 222, 128, 0.5);
}

.alert-error {
  background-color: rgba(153, 27, 27, 0.4);
  color: #fca5a5;
  border: 1px solid rgba(239, 68, 68, 0.6);
}

.alert-info {
  background-color: rgba(30, 64, 175, 0.3);
  color: #93c5fd;
  border: 1px solid rgba(96, 165, 250, 0.4);
}

.alert-warning {
  background-color: rgba(120, 53, 15, 0.5);
  color: #fde68a;
  border: 1px solid rgba(245, 158, 11, 0.7);
  border-left: 4px solid #f59e0b;
}

/* Buttons */
.btn {
  display: inline-block;
  padding: 0.5rem 1rem;
  border-radius: var(--border-radius);
  font-weight: 600;
  font-size: 0.9rem;
  text-align: center;
}

.btn-primary {
  background-color: var(--color-primary);
  color: var(--text-primary);
  border: none;
}

.btn-primary:hover,
.btn-primary:focus {
  background-color: var(--color-primary-hover);
  color: var(--text-primary);
}

.btn-secondary {
  background-color: var(--color-secondary);
  color: var(--text-primary);
  border: none;
}

.btn-secondary:hover,
.btn-secondary:focus {
  background-color: var(--color-secondary-hover);
  color: var(--text-primary);
}

.btn-danger {
  background-color: var(--color-danger);
  color: var(--text-primary);
}

.btn-danger:hover,
.btn-danger:focus {
  background-color: #c53030;
}

.btn-success {
  background-color: var(--color-success);
  color: var(--text-primary);
}

.btn-success:hover,
.btn-success:focus {
  background-color: #3d9140;
}

.btn-muted {
  background-color: var(--color-muted);
  color: var(--text-primary);
}

.btn-muted:hover,
.btn-muted:focus {
  background-color: var(--bg-hover);
}

/* --color-muted: #6c757d; */

/* Badge styles */
.badge {
  display: inline-block;
  padding: 0.3rem 0.75rem;
  border-radius: 999px;
  font-size: 0.85rem;
  font-weight: 500;
}

.badge-approved {
  background-color: var(--badge-approved) !important;
  color: var(--text-approved) !important;
}

.badge-rejected {
  background-color: var(--badge-rejected) !important;
  color: var(--text-rejected) !important;
}

.badge-pending {
  background-color: var(--badge-pending) !important;
  color: var(--text-pending) !important;
}

.badge-amendment {
  background-color: var(--badge-amendment) !important;
  color: var(--text-amendment) !important;
}

.badge-validating {
  background-color: var(--badge-validating) !important;
  color: black !important;
}

/* Utility */
.text-center {
  text-align: center;
}

.hidden {
  display: none;
}

/* Error / Info messages */
.error {
  color: #f87171;
  font-size: 0.85rem;
  margin-top: 0.25rem;
}

.info {
  color: var(--text-muted);
  font-size: 0.9rem;
  margin-top: 0.5rem;
}

.form-group {
  margin-bottom: 1.5rem;
}

.form-group .form-field {
  margin-bottom: 1rem;
}

label {
  font-weight: 500;
  display: block;
  margin-bottom: 0.25rem;
  color: var(--text-secondary);
}

.two-factor-setup-container {
  display: grid;
  grid-template-columns: 1fr;
  max-width: 800px;
  margin: 2rem auto;
  gap: 2rem;
  padding: 2rem;
  background-color: var(--bg-card);
  border-radius: 1rem;
  box-shadow: var(--shadow-md);
  border: 1px solid var(--border-color);
}

.two-factor-setup-container h1 {
  font-size: 2rem;
  font-weight: 600;
  margin-bottom: 1rem;
  color: var(--text-heading);
}

.two-factor-heading {
  font-size: 2rem;
  font-weight: 600;
  margin-bottom: 1rem;
}

.qr-code-container {
  display: flex;
  justify-content: center;
  margin: 1rem 0;
}

img.qr-code {
  background: var(--text-primary);
  padding: 1rem;
  border-radius: 0.5rem;
  box-shadow: var(--shadow-sm);
  display: block;
  margin: 1rem auto;
}

/* Reports list card */
.reports-list-card {
  background-color: var(--bg-card-secondary);
}

/* Uniform table cell padding and alignment */
table.table td,
table.table th {
  vertical-align: middle !important;
  padding: 0.75rem 1rem;
  text-align: center;
  color: var(--text-primary);
}

table.table thead th {
  background-color: var(--bg-table-header);
  color: var(--text-heading);
  border-bottom: 2px solid var(--border-color);
}

/* Optional hover effect for better UX */
table.table-hover tbody tr:hover {
  background-color: var(--bg-table-row-hover);
}

/* Badge clarity */
.badge {
  font-size: 0.8rem;
  padding: 0.4em 0.65em;
  border-radius: 0.6rem;
  font-weight: 500;
}

/* Tighter dropdown alignment */
.form-select-sm {
  padding: 0.25rem 0.5rem;
  font-size: 0.85rem;
}

/* Sidebar Styles */
/* ── Sidebar ─────────────────────────────────────────────────────── */
.sidebar {
  width: 260px;
  flex-shrink: 0;
  background-color: var(--bg-sidebar);
  border-right: 1px solid var(--border-color);
  display: flex;
  flex-direction: column;
  overflow-y: auto;
  overflow-x: hidden;
}

/* Backdrop behind the off-canvas sidebar on small screens — see the
   max-width: 900px block below. Hidden/inert until .is-visible is toggled. */
.sidebar-backdrop {
  display: none;
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.5);
  z-index: 1150;
}
.sidebar-backdrop.is-visible {
  display: block;
}

/* Below 900px there isn't room for a fixed 260px sidebar alongside real
   content (this is what was breaking the RoI header into one word per line —
   see live-roi.css's header-card comments). Slide it off-canvas and open it
   on demand via #sidebarMenuToggle instead of shrinking it in place. */
@media (max-width: 900px) {
  .sidebar {
    position: fixed;
    top: 0;
    left: 0;
    height: 100vh;
    z-index: 1200;
    transform: translateX(-100%);
    transition: transform 0.25s ease;
    box-shadow: 4px 0 24px rgba(0, 0, 0, 0.35);
  }
  .sidebar.sidebar--open {
    transform: translateX(0);
  }
}

/* Logo */
.sidebar__logo {

  padding-top: 5px;
  padding-bottom: 5px;
  display: flex;
  justify-content: center;
  border-bottom: 1px solid var(--border-color);
  flex-shrink: 0;
}

.sidebar__logo a {
  display: flex;
  pointer-events: none;
}

.sidebar__logo img {
  height: 75px;
  width: auto;
  margin: auto;
}

/* Scrollable nav area */
.sidebar__nav {
  flex: 1;
  padding: 16px 12px 8px;
  overflow-y: auto;
}

/* Section labels */
.sidebar__section-label {
  font-size: 0.7rem;
  font-weight: 600;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--text-muted);
  padding: 0 8px;
  margin: 16px 0 4px;
  text-align: left;
}

.sidebar__section-label:first-child {
  margin-top: 0;
}

/* Logout footer */
.sidebar__footer {
  padding: 10px 12px 14px;
  border-top: 1px solid var(--border-color);
  flex-shrink: 0;
  min-height: 104px;
  display: flex;
  flex-direction: column;
  gap: 8px;
  background-color: var(--bg-sidebar);
}

.sidebar__logout-btn {
  display: flex;
  align-items: center;
  gap: 10px;
  width: 100%;
  padding: 9px 14px;
  background-color: var(--bg-hover);
  color: var(--text-secondary);
  border: 1px solid var(--border-light);
  border-radius: 8px;
  font-size: 0.875rem;
  font-weight: 500;
  cursor: pointer;
  transition: background-color 0.15s, color 0.15s;
}

.sidebar__logout-btn:hover {
  background-color: var(--color-danger);
  color: #fff;
  border-color: var(--color-danger);
}


/* ── Page layout ─────────────────────────────────────────────────── */
/* Full-height row: sidebar | right column */
.layout-body {
  display: flex;
  height: 100vh;
  overflow: hidden;
}

/* Right column: navbar stacked above content */
.layout-right {
  display: flex;
  flex-direction: column;
  flex: 1;
  min-width: 0;
  overflow: hidden;
}

/* Scrollable page content */
.layout-content {
  flex: 1;
  min-height: 0;
  overflow-y: auto;
  padding: 24px;
  background-color: var(--bg-body);
  display: flex;
  flex-direction: column;
}
/* Page content keeps its natural height; footer auto-pushes to bottom
   on short pages and sits flush below content on tall pages. */
.layout-content > * { flex-shrink: 0; }
.layout-content > .site-footer { margin-top: auto; }



/* Button styling (can be customized further) */
.btn.btn-primary {
  background-color: var(--color-primary);
  color: var(--text-primary);
  border: none;
  padding: 8px 14px;
  font-weight: 600;
  border-radius: 4px;
  cursor: pointer;
}

.btn.btn-primary:hover {
  background-color: var(--color-primary-hover);
}

/* Notification bell */
.notification-bell {
  position: relative;
  font-size: 18px;
  cursor: pointer;
}

.notification-count {
  position: absolute;
  top: -6px;
  right: -10px;
  background: var(--color-danger);
  color: var(--text-primary);
  font-size: 12px;
  padding: 2px 6px;
  border-radius: 50%;
}

/* User dropdown (placeholder for now) */
.user-dropdown {
  display: flex;
  align-items: center;
  gap: 10px;
  font-weight: 500;
  color: var(--text-secondary);
}


/* Dashboard Layout */
.dashboard-container {
  padding: 20px;
}

#summary-report-status {
  font-size: 1.1rem;
}

.stats-cards {
  display: flex;
  gap: 20px;
  margin-bottom: 20px;
}

.pending-yellow {
  background-color: var(--badge-validating);
}

.stat-card {
  background: var(--bg-card-secondary);
  padding: 15px 20px;
  border-radius: 8px;
  font-weight: 600;
  flex: 1;
  text-align: center;
  color: var(--text-primary);
}

.stat-card.submitted { border-left: 4px solid #6b7280; }
.stat-card.approved { border-left: 4px solid #28a745; }
.stat-card.rejected { border-left: 4px solid #dc3545; }
.stat-card.needs-amendment { border-left: 4px solid #ffc107; }

.search-filter-form {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin-bottom: 20px;
}

.search-filter-form input,
.search-filter-form select,
.search-filter-form button {
  padding: 8px;
  font-size: 14px;
}

.report-table {
  width: 100%;
  border-collapse: collapse;
  margin-bottom: 20px;
}

.report-table th,
.report-table td {
  border: 1px solid var(--border-color);
  padding: 10px;
  text-align: left;
  color: var(--text-primary);
}

.report-table th {
  background-color: var(--bg-table-header);
}

.status-badge {
  padding: 4px 8px;
  border-radius: 5px;
  font-size: 0.9em;
}

.status-submitted { background: #52525b; color: white; }
.status-approved { background: #28a745; color: white; }
.status-rejected { background: #dc3545; color: white; }
.status-needs-amendment { background: #ffc107; color: black; }

.pagination {
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.notification-bell {
  position: relative;
  display: inline-block;
}

.notification-count {
  position: absolute;
  top: -8px;
  right: -8px;
  background: red;
  color: white;
  border-radius: 50%;
  padding: 2px 6px;
  font-size: 12px;
}

.dot {
  font-size: 1rem;
  margin-right: 5px;
  vertical-align: middle;
}

.unread td {
  font-weight: bold;
}

#resources{
  padding-top: 15px;
}

.helpful-resources{
  display: grid;
  grid-template-columns: 1fr 1fr 1fr;
}

.helpful-resources-li {
  padding: 10px 0px;
}

.helpful-resources-li a {
  color: var(--text-link);
}

.helpful-resources-li::marker {
  visibility: hidden;
}

.faq-answer {
  display: none;
  padding: 0 0 1rem;
  font-size: 0.85rem;
  color: var(--text-muted);
  line-height: 1.65;
}
.faq-answer.open { display: block; }
.faq-answer p { margin: 0; color: var(--text-muted); }
.faq-item.active .faq-answer { display: block; }

.faq-question {
  width: 100%; background: none; border: none; cursor: pointer;
  display: flex; align-items: center; justify-content: space-between; gap: 1rem;
  padding: 1rem 0;
  font-size: 0.875rem; font-weight: 600; color: var(--text-primary);
  text-align: left; transition: color 0.15s;
}
.faq-question:hover { color: var(--color-primary); }

.faq-search {
  padding: 11px 14px 11px 38px;
  width: 100%;
  border: 1px solid var(--border-color);
  border-radius: 10px;
  background-color: var(--bg-card);
  color: var(--text-primary);
  font-size: 0.9rem;
  outline: none;
}
.faq-search:focus { border-color: var(--color-primary); }

footer {
  background-color: var(--bg-body);
}

/* ── Site footer ─────────────────────────────────────── */
.site-footer {
  --sf-bg:        #0d0d0e;
  --sf-line:      #2c2c30;
  --sf-line-2:    #35353a;
  --sf-panel:     #1a1a1c;
  --sf-text:      #ececee;
  --sf-text-2:    #a0a0a6;
  --sf-text-3:    #6c6c72;
  --sf-accent:    var(--accent);
  --sf-accent-soft: var(--accent-soft);
  --sf-accent-line: var(--accent-line);

  border-top: 1px solid var(--sf-line);
  background: var(--sf-bg);
  color: var(--sf-text-2);
  padding: 22px 28px 26px;
  margin: 0 -24px -24px;
  font-family: 'Plus Jakarta Sans', 'Inter', 'Roboto', system-ui, sans-serif;
}

/* Drop the in-page spacer above the footer — the design's gap matched the
   dark page bg; on our lighter bg it shows as a visible band. */
.liveroi .footer-spacer { display: none; }

.sf-inner {
  max-width: 1500px;
  margin: 0 auto;
  display: flex;
  align-items: center;
  gap: 24px;
  flex-wrap: wrap;
}

.sf-copy {
  font-size: 12px;
  color: var(--sf-text-3);
  line-height: 1.6;
  margin: 0;
}

.sf-copy b {
  color: var(--sf-text-2);
  font-weight: 600;
}

.sf-copy .reg,
.sf-powered .reg {
  font-family: 'JetBrains Mono', ui-monospace, monospace;
  color: var(--sf-accent);
  vertical-align: top;
  margin-left: 1px;
}

.sf-copy .reg { font-size: 10px; }
.sf-powered .reg { font-size: 9.5px; }

.sf-links {
  display: flex;
  align-items: center;
  gap: 4px;
  font-size: 12px;
  list-style: none;
  padding: 0;
  margin: 0;
}

.sf-link {
  color: var(--sf-text-2);
  text-decoration: none;
  padding: 6px 3px;
  border-radius: 6px;
  transition: background .12s, color .12s;
}

.sf-link:hover {
  color: var(--sf-text);
  background: var(--sf-panel);
  text-decoration: none;
}

.sf-powered a {
  color: var(--sf-text-2);
  text-decoration: none;
  transition: color .12s;
}
.sf-powered a:hover { color: var(--sf-text); }

.sf-dot {
  width: 3px;
  height: 3px;
  border-radius: 50%;
  background: var(--sf-line-2);
}

.sf-spacer {
  flex: 1;
  min-width: 12px;
}

.sf-social {
  display: flex;
  align-items: center;
  gap: 6px;
}

.sf-social-btn {
  width: 30px;
  height: 30px;
  border-radius: 8px;
  border: 1px solid var(--sf-line);
  background: transparent;
  color: var(--sf-text-2);
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: 13px;
  text-decoration: none;
  transition: color .12s, border-color .12s, background .12s;
}

.sf-social-btn:hover {
  color: var(--sf-accent);
  border-color: var(--sf-accent-line);
  background: var(--sf-accent-soft);
}

.sf-powered {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 6px 12px;
  border-left: 1px solid var(--sf-line);
  font-size: 11.5px;
  color: var(--sf-text-3);
  margin-left: 4px;
}

.sf-powered b {
  color: var(--sf-text-2);
  font-weight: 600;
}

@media (max-width: 900px) {
  .sf-inner { gap: 16px; }
  .sf-spacer { flex-basis: 100%; height: 0; }
  .sf-powered {
    border-left: 0;
    padding-left: 0;
    margin-left: 0;
  }
}


/* Responsive tip: You can add media queries later to hide sidebar on small screens */



/* ====================== 📱 RESPONSIVE DESIGN ====================== */

/* 🎯 375px: Mobile phones */
/* @media (min-width: 315px) {
  body {
    font-size: 4px;
    padding: 10px;
    flex-direction: column;
    align-items: stretch;
  }

  .card,
  .wide-card,
  .container,
  .two-factor-setup-container {
    font-size: 35px;
    width: 100%;
    padding: 1rem;
    box-sizing: border-box;
  }

  h1, h2 {
    font-size: 1.3rem;
  }

  button, .btn {
    font-size: 0.85rem;
    padding: 10px;
  }

  .table {
    font-size: 0.75rem;
    overflow-x: auto;
    display: block;
  }

  .badge {
    font-size: 0.7rem;
  }
} */

/* 🎯 768px: Tablets */
/* @media (min-width: 767px) {
  .container {
    grid-template-columns: 1fr !important;
    width: 100%;
    padding: 1rem;
  }

  .two-factor-setup-container {
    grid-template-columns: 1fr;
    padding: 1.5rem;
  }

  .card {
    padding: 1.5rem;
  }

  h1, h2 {
    font-size: 1.5rem;
  }

  .btn {
    width: 100%;
    font-size: 0.9rem;
    margin-bottom: 0.5rem;
  }

  table.table {
    font-size: 0.8rem;
    display: block;
    overflow-x: auto;
    white-space: nowrap;
  }

  .badge {
    font-size: 0.75rem;
    padding: 0.3em 0.6em;
  }

  .form-select-sm {
    width: 100%;
  }
} */

/* 🎯 1024px: Medium Laptops */
/* @media (min-width: 1024px) {
  .container {
    width: 100%;
    grid-template-columns: 1fr 1fr;
    padding: 1rem;
  }

  .wide-card {
    padding: 1.5rem;
  }

  h2 {
    font-size: 1.7rem;
  }

  .btn {
    font-size: 0.95rem;
  }
} */

/* 🎯 1440px: Desktops & Large Laptops */
/* @media (min-width: 1440px) {
  .wide-card {
    max-width: 1200px;
  }

  .container {
    max-width: 1200px;
  }
} */

/* 🎯 2560px: 4K displays */
/* @media (min-width: 1841px) and (max-width: 2560px) {
  body {
    font-size: 16px;
  }

  .wide-card {
    max-width: 1400px;
  }

  h2 {
    font-size: 2rem;
  }

  .btn {
    font-size: 1rem;
  }
} */

@container (min-width: 400px) {
  .card h2 {
    font-size: 1.4rem;
  }

  .badge {
    font-size: 0.8rem;
  }
}

@container (min-width: 700px) {
  .card h2 {
    font-size: 1.6rem;
  }

  .btn {
    font-size: 1rem;
    padding: 0.6rem 1.2rem;
  }
}

@container (min-width: 1000px) {
  .container {
    grid-template-columns: repeat(2, 1fr);
  }
}

/* Form Validation Styles */
.required-field::after {
  content: " *";
  color: red;
  font-weight: bold;
}

.errorlist {
  color: #f87171;
  list-style: none;
  padding: 0;
  margin: 5px 0;
  font-size: 0.9em;
}

.errorlist li {
  margin: 2px 0;
}

.form-field {
  margin-bottom: 1rem;
}

.form-field label {
  display: block;
  margin-bottom: 0.25rem;
  font-weight: 500;
  color: var(--text-secondary);
}

.form-field input,
.form-field select {
  width: 100%;
  padding: 0.5rem;
  border: 1px solid var(--border-color);
  border-radius: 4px;
  background-color: var(--bg-input);
  color: var(--text-primary);
}

.form-field input:focus,
.form-field select:focus {
  border-color: var(--border-focus);
  outline: none;
}

.form-field input.error,
.form-field select.error {
  border-color: var(--color-danger);
}

/* ====================== BOOTSTRAP DARK MODE OVERRIDES ====================== */

/* Navbar overrides */
.navbar-dark {
  border-bottom: 1px solid var(--border-color);
}

.navbar-dark .navbar-brand {
  color: var(--text-primary) !important;
}

/* ── Sidebar nav lists ───────────────────────────────────────────── */
.sidebar-root,
.sidebar-children {
  list-style: none;
  padding: 0;
  margin: 0;
}

.sidebar-nav li {
  margin-bottom: 1px;
}

/* Every nav row */
.sidebar-nav a,
.sidebar-nav .sidebar-toggle {
  display: flex;
  align-items: center;
  gap: 10px;
  width: 100%;
  padding: 9px 12px;
  font-size: 0.875rem;
  font-weight: 500;
  color: var(--text-secondary);
  background: none;
  border: none;
  border-radius: 8px;
  text-decoration: none;
  cursor: pointer;
  transition: background-color 0.15s, color 0.15s;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

/* Icon */
.sidebar-nav a > i:first-child,
.sidebar-nav .sidebar-toggle > i:first-child {
  width: 16px;
  text-align: center;
  flex-shrink: 0;
  font-size: 0.85rem;
}

/* Hover */
.sidebar-nav a:hover,
.sidebar-nav .sidebar-toggle:hover {
  background-color: var(--bg-hover);
  color: var(--text-primary);
}

/* Active — sits on the steel accent in both themes, so text/icons must use
   the on-accent ink (white). --text-primary flips to near-black in light mode,
   which was rendering the active row unreadable. */
.sidebar-nav li.active > a,
.sidebar-nav li.active > a .sidebar-chevron {
  background-color: var(--color-primary);
  color: var(--accent-ink);
}

/* Chevron */
.sidebar-chevron {
  margin-left: auto;
  flex-shrink: 0;
  font-size: 0.65rem;
  transition: transform 0.2s;
  color: var(--text-muted);
}

.sidebar-toggle:not(.collapsed) .sidebar-chevron {
  transform: rotate(90deg);
}

/* Indentation. Each level steps 16px further in, except l2->l3, which steps 18:
   .sidebar-l2 also carries margin-left:10px further down this file, so its row
   starts at 34px, not 24. Without counting that margin, l3's old 36px left its
   children two pixels from their parent and the two levels read as one column
   -- New / Under Review / My Reports looked like siblings of Major Incident
   Report rather than items inside it. */
.sidebar-root > li > a,
.sidebar-root > li > .sidebar-toggle { padding-left: 12px; }
.sidebar-l2                           { padding-left: 24px !important; }  /* +10px margin = 34 */
.sidebar-l3                           { padding-left: 52px !important; }
.sidebar-l4                           { padding-left: 68px !important; }
.sidebar-l5                           { padding-left: 84px !important; }

/* Disabled */
.sidebar-disabled            { pointer-events: none; }
.sidebar-link-disabled       { opacity: 0.35 !important; }

/* ── Hub page ────────────────────────────────────────────────────── */
.hub-page {
  position: relative;
  min-height: calc(100vh - 57px);
  padding: 2rem 4px;

  /* One content width for every band on the page. The product stack and the
     subscription summary used to cap themselves at 1180px and 1400px, which
     matched only while the viewport was narrower than both: zoom out past
     1180px and the two blocks stopped sharing a left and right edge. */
  --hub-width: 1180px;
}

.hub-header {
  margin-bottom: 2rem;
  text-align: center;
}

.hub-title {
  font-size: 2rem;
  font-weight: 600;
  color: var(--text-primary);
  margin: 0 0 0.25rem;
  line-height: 1.2;
}

/* "the" and "hub" echo the flowing signature script in the giixi logo */
.hub-title__script {
  font-family: 'Herr Von Muellerhoff', cursive;
  font-weight: 400;
  font-size: 1.9em;
}

/* "giixi" wordmark — Verdana (per brand), bold and lightly tracked */
.hub-title__brand {
  font-family: Verdana, Geneva, Tahoma, sans-serif;
  font-weight: 700;
  letter-spacing: 0.06em;
}

.hub-subtitle {
  color: var(--text-muted);
  font-size: 0.95rem;
  margin: 0;
}

/* Two categories side by side: Reporting (wider) and GRC. Wraps to a stack
   on narrow viewports via flex-wrap + the flex-basis on each section. */
/* An explicit 3-up grid (DORA Reporting / GRC / Tools), not wrapping flex:
   with flex-basis the fourth category only fits when the viewport happens to
   be wide enough, and otherwise drops to its own row and stretches across the
   full width on its own. A fixed column count keeps all three equal and side
   by side, then steps down deliberately. minmax(0, 1fr) rather than 1fr so a
   long service name can't push a column past its share.

   A fourth category — the Regulatory Reporting column, which appears only once
   a regulator beyond DORA exists — wraps onto a second row rather than
   squeezing the three. */
/* Categories stack as full-width bands rather than sitting side by side in
   fixed columns: a column layout sized every band to the tallest one, so the
   single Tools card left a column of dead space and GRC's nine framework
   cards had nowhere to go but underneath. */
.hub-stack {
  display: flex;
  flex-direction: column;
  gap: 1.75rem;
  margin-inline: auto;
}

.hub-section {
  min-width: 0;  /* allow the inner buttons to shrink instead of overflowing */
}

.hub-section__title {
  font-size: 0.75rem;
  font-weight: 600;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--text-muted);
  margin: 0 0 0.75rem;
  padding-bottom: 0.5rem;
  border-bottom: 1px solid var(--border-color);
}

/* The default: product containers stacked as full-width rows. */
.hub-grid {
  display: flex;
  flex-direction: column;
  gap: 0.6rem;
}

/* The split row reads as three columns: DORA Reporting's two products take the
   first two and Tools' converter the third, which is why the bands are sized
   2fr to 1fr rather than evenly. `align-items: start` keeps the shorter band
   its own height rather than padding it out to match its neighbour. */
.hub-split {
  display: grid;
  grid-template-columns: minmax(0, 2fr) minmax(0, 1fr);
  gap: 1.5rem;
  align-items: start;
}

/* Placed explicitly, not by source order: Regulatory Reporting is a third band
   that only appears once a regulator beyond DORA exists, and flow order would
   then push Tools out of its column. Tools stays top-right either way, and the
   extra band lands under DORA. */
.hub-split > .hub-section--dora,
.hub-split > .hub-section--reporting { grid-column: 1; }

.hub-split > .hub-section--tools {
  grid-column: 2;
  grid-row: 1;
}

/* DORA's two products are the first two of the row's three columns, so this
   band alone overrides the stacked .hub-grid default. */
.hub-section--dora .hub-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  align-items: stretch;
}

/* 700px, not the 900px the sidebar uses: at 900 the split collapsed on exactly
   the screens it was meant for -- a laptop at browser zoom reports well under
   1000px wide and was getting three full-width bands stacked. */
@media (max-width: 700px) {
  .hub-split { grid-template-columns: minmax(0, 1fr); }
  .hub-split > .hub-section--dora,
  .hub-split > .hub-section--reporting,
  .hub-split > .hub-section--tools { grid-column: 1; grid-row: auto; }
  .hub-section--dora .hub-grid { grid-template-columns: minmax(0, 1fr); }
}

.hub-grid--tiles {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
  gap: 0.7rem;
  align-items: stretch;
}

/* The GRC catalogue is the opposite case: nine cards on fixed tracks, so the
   row that ends with one card leaves that card tile-sized rather than
   stretching it across the band. auto-fill keeps the empty tracks for that. */
.hub-grid--compact {
  grid-template-columns: repeat(auto-fill, minmax(230px, 1fr));
  /* Every tile the same size, not just every tile in its own row: the rows
     that hold a "View pricing" nudge are taller than the ones that don't, so
     equal rows alone still left the catalogue stepping down the page. */
  grid-auto-rows: 1fr;
}

@media (max-width: 620px) {
  .hub-grid--tiles,
  .hub-grid--compact { grid-template-columns: minmax(0, 1fr); }
}

/* Compact tiles: nine framework products are a catalogue, not nine headline
   services, so the GRC band shrinks every part of the card — a framework is
   recognised by its name and standard number, and the blurb is support, not
   the point. Scoped to --compact so the DORA/Tools bands keep full-size
   cards on the same track width. */
.hub-grid--compact .hub-btn {
  gap: 0.6rem;
  padding: 0.7rem 0.8rem 0.75rem 0.95rem;
}

.hub-grid--compact .hub-btn__head { gap: 0.4rem; }
.hub-grid--compact .hub-btn__name { font-size: 0.88rem; }
.hub-grid--compact .hub-btn__meta { font-size: 0.64rem; }

/* Two lines, always — a ragged tile grid is the thing that stops this reading
   as a formal catalogue. */
.hub-grid--compact .hub-btn__desc {
  font-size: 0.72rem;
  line-height: 1.35;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.hub-grid--compact .hub-btn__badge,
.hub-grid--compact .hub-btn__tag {
  font-size: 0.55rem;
  padding: 1px 6px;
}

.hub-grid--compact .hub-btn__upsell { font-size: 0.68rem; }
.hub-grid--compact .hub-btn__arrow { font-size: 0.72rem; }

/* ── Equal-height cards within a row ────────────────────────────────────── */

/* The bands above stretch their containers to the tallest card in the row
   (align-items: stretch), which only equalises the container — the parts
   inside still have to decide which one absorbs the extra height, or the card
   grows with its content floating at the top. Two cases:

   1. A product with a detail panel (DORA's RoI has one sub-item, Incident
      Reporting three): the header link keeps its natural height so both
      headers stay on the same baseline, and the panel takes the slack.
   2. A card that is nothing but its header link (every GRC tile): the link
      itself takes the slack, so a row of tiles ends level and the "View
      pricing" nudge sits on the bottom edge rather than wherever a two- or
      three-line description happens to leave it. */
.hub-section--dora .hub-grid > .hub-service > .hub-btn,
.hub-grid--tiles > .hub-service > .hub-btn { flex: 0 0 auto; }

.hub-section--dora .hub-grid > .hub-service > .hub-detail,
.hub-grid--tiles > .hub-service > .hub-detail { flex: 1 1 auto; }

.hub-section--dora .hub-grid > .hub-service > .hub-btn:only-child,
.hub-grid--tiles > .hub-service > .hub-btn:only-child {
  flex: 1 1 auto;
  /* stretch, not centre: the body must fill the link for margin-top:auto on
     the upsell to have anything to push against. */
  align-items: stretch;
}

/* The arrow is the one part that should stay put when the link stretches. */
.hub-section--dora .hub-grid > .hub-service > .hub-btn:only-child > .hub-btn__arrow,
.hub-grid--tiles > .hub-service > .hub-btn:only-child > .hub-btn__arrow { align-self: center; }

.hub-grid--tiles > .hub-service > .hub-btn:only-child .hub-btn__upsell { margin-top: auto; }

/* ── Subscription summary (below the service columns) ───────────────────── */

.hub-subs {
  margin: 2.5rem auto 0;
  padding-top: 1.75rem;
  border-top: 1px solid var(--border-color);
}

.hub-subs__title {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 1rem;
  font-size: 0.75rem;
  font-weight: 600;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--text-muted);
  margin: 0 0 1rem;
}

.hub-subs__manage {
  font-size: 0.72rem;
  font-weight: 600;
  letter-spacing: 0.04em;
  color: var(--color-primary);
  text-decoration: none;
}

.hub-subs__manage:hover { text-decoration: none; filter: brightness(1.35); }
.hub-subs__manage i { font-size: 0.65rem; margin-left: 0.2rem; }

.hub-subs__grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(330px, 1fr));
  gap: 1rem;
}

.hub-subs__card {
  position: relative;
  display: flex;
  flex-direction: column;
  gap: 0.9rem;
  padding: 1.1rem 1.2rem;
  background-color: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: 12px;
  overflow: hidden;
}

/* A hairline along the top edge, tinted by how much term is left — the one
   at-a-glance signal that a subscription needs attention. */
.hub-subs__card::before {
  content: "";
  position: absolute;
  inset: 0 0 auto 0;
  height: 2px;
  background-color: #4ade80;
}

.hub-subs__card--soon::before { background-color: #fbbf24; }
.hub-subs__card--over::before { background-color: #f87171; }

.hub-subs__top {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 1rem;
}

.hub-subs__id { display: flex; flex-direction: column; gap: 0.15rem; min-width: 0; }

.hub-subs__line {
  font-size: 0.65rem;
  font-weight: 700;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--text-muted);
}

.hub-subs__plan {
  font-size: 1.15rem;
  font-weight: 600;
  color: var(--text-primary);
  line-height: 1.2;
}

.hub-subs__status {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  font-size: 0.62rem;
  font-weight: 700;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  padding: 3px 9px;
  border-radius: 20px;
  white-space: nowrap;
}

.hub-subs__status-dot {
  width: 5px;
  height: 5px;
  border-radius: 50%;
  background-color: currentColor;
}

.hub-subs__status--active {
  background-color: rgba(74, 222, 128, 0.12);
  color: #4ade80;
  border: 1px solid rgba(74, 222, 128, 0.25);
}

.hub-subs__status--suspended {
  background-color: rgba(248, 113, 113, 0.12);
  color: #f87171;
  border: 1px solid rgba(248, 113, 113, 0.25);
}

.hub-subs__meta {
  display: flex;
  flex-wrap: wrap;
  gap: 0.75rem 1.5rem;
}

.hub-subs__field { display: flex; flex-direction: column; gap: 0.15rem; }
.hub-subs__field--right { margin-left: auto; text-align: right; }

.hub-subs__label {
  font-size: 0.6rem;
  font-weight: 600;
  letter-spacing: 0.09em;
  text-transform: uppercase;
  color: var(--text-muted);
}

.hub-subs__value {
  font-size: 0.85rem;
  font-weight: 600;
  color: var(--text-primary);
  white-space: nowrap;
}

.hub-subs__card--soon .hub-subs__value--left { color: #fbbf24; }
.hub-subs__card--over .hub-subs__value--left { color: #f87171; }

.hub-subs__bar {
  height: 4px;
  border-radius: 4px;
  background-color: var(--bg-card-secondary);
  overflow: hidden;
}

.hub-subs__bar-fill {
  display: block;
  height: 100%;
  border-radius: 4px;
  background-color: #4ade80;
}

.hub-subs__card--soon .hub-subs__bar-fill { background-color: #fbbf24; }
.hub-subs__card--over .hub-subs__bar-fill { background-color: #f87171; }

.hub-subs__included { display: flex; flex-direction: column; gap: 0.4rem; }

.hub-subs__chips { display: flex; flex-wrap: wrap; gap: 0.35rem; }

.hub-subs__chip {
  font-size: 0.72rem;
  font-weight: 500;
  color: var(--text-secondary);
  background-color: var(--bg-card-secondary);
  border: 1px solid var(--border-color);
  border-radius: 6px;
  padding: 3px 9px;
}

.hub-subs__chip--empty { color: var(--text-muted); font-style: italic; }

/* ── Product containers ─────────────────────────────────────────────────── */

/* One product = one container. The header link and the product's own detail
   (the pages inside it) share a single bordered card, so hovering anywhere on
   the card lifts the whole product rather than just the row under the cursor.
   The border lives here, not on .hub-btn, for exactly that reason. */
.hub-service {
  position: relative;
  display: flex;
  flex-direction: column;
  background-color: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: 12px;
  overflow: hidden;
  transition: border-color 0.18s, transform 0.18s, box-shadow 0.18s, background-color 0.18s;
}

/* The accent rail down the left edge of the whole container — the one piece of
   colour that separates an owned product from a locked one at a glance. */
.hub-service::before {
  content: "";
  position: absolute;
  top: 0;
  left: 0;
  bottom: 0;
  width: 3px;
  background-color: var(--color-primary);
  transition: width 0.18s, background-color 0.18s;
}

.hub-service--on:hover,
.hub-service--on:focus-within {
  border-color: var(--color-primary);
  transform: translateY(-2px);
  box-shadow: 0 10px 24px rgba(0, 0, 0, 0.28);
}

.hub-service--on:hover::before,
.hub-service--on:focus-within::before { width: 5px; }

/* Locked: reads as disabled, still a real container of real links to pricing.
   Dimmed through its own parts rather than `opacity` on the whole card, so the
   "View pricing" nudge stays legible instead of fading out with everything. */
.hub-service--off {
  background-color: transparent;
  border-style: dashed;
}

.hub-service--off::before { background-color: var(--border-color); }

.hub-service--off:hover,
.hub-service--off:focus-within {
  border-style: solid;
  border-color: var(--border-light);
  transform: translateY(-1px);
  box-shadow: 0 6px 18px rgba(0, 0, 0, 0.2);
}

.hub-service--off:hover::before,
.hub-service--off:focus-within::before {
  width: 5px;
  background-color: var(--text-muted);
}

/* ── Product header (the link that opens the product) ───────────────────── */

.hub-btn {
  position: relative;
  display: flex;
  align-items: center;
  gap: 0.85rem;
  width: 100%;
  padding: 0.9rem 1rem 0.9rem 1.15rem;
  background-color: transparent;
  border: 0;
  text-decoration: none;
  text-align: left;
  transition: background-color 0.15s;
}

.hub-btn:hover { text-decoration: none; }

/* Kept as an empty hook: the rail now belongs to the container, which the
   detail panel sits inside too. */
.hub-btn__mark { display: none; }

.hub-btn__body {
  display: flex;
  flex-direction: column;
  gap: 0.2rem;
  flex: 1 1 auto;
  min-width: 0;
}

.hub-btn__head {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  flex-wrap: wrap;
}

.hub-btn__name {
  font-size: 0.98rem;
  font-weight: 600;
  letter-spacing: -0.01em;
  color: var(--text-primary);
}

/* The formal identifier under the short name — e.g. "ISO/IEC 27001:2022"
   under "ISO 27001". */
.hub-btn__meta {
  font-size: 0.7rem;
  font-weight: 500;
  letter-spacing: 0.02em;
  color: var(--text-secondary);
  opacity: 0.85;
}

.hub-btn__desc {
  font-size: 0.78rem;
  line-height: 1.4;
  color: var(--text-muted);
}

.hub-btn__badge {
  font-size: 0.6rem;
  font-weight: 700;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  padding: 2px 7px;
  border-radius: 20px;
  white-space: nowrap;
}

.hub-btn__badge--active {
  background-color: rgba(74, 222, 128, 0.12);
  color: #4ade80;
  border: 1px solid rgba(74, 222, 128, 0.25);
}

.hub-btn__badge--locked {
  background-color: rgba(163, 163, 163, 0.1);
  color: var(--text-muted);
  border: 1px solid var(--border-color);
}

/* Category chip — says what kind of product this is without a second line. */
.hub-btn__tag {
  font-size: 0.6rem;
  font-weight: 600;
  letter-spacing: 0.05em;
  text-transform: uppercase;
  padding: 2px 7px;
  border-radius: 4px;
  white-space: nowrap;
  color: var(--text-muted);
  background-color: rgba(255, 255, 255, 0.04);
  border: 1px solid var(--border-color);
}

.hub-btn__arrow {
  flex: 0 0 auto;
  color: var(--color-primary);
  font-size: 0.8rem;
  opacity: 0;
  transform: translateX(-3px);
  transition: opacity 0.15s, transform 0.15s;
}

.hub-service--on:hover .hub-btn--enabled,
.hub-btn--enabled:focus-visible { background-color: var(--bg-hover); }

.hub-service--on:hover .hub-btn__arrow,
.hub-btn--enabled:focus-visible .hub-btn__arrow {
  opacity: 1;
  transform: translateX(0);
}

.hub-btn--locked .hub-btn__name { color: var(--text-muted); }
.hub-btn--locked .hub-btn__desc { opacity: 0.7; }
.hub-btn--locked .hub-btn__arrow { color: var(--text-muted); }

.hub-btn__upsell {
  margin-top: 0.15rem;
  font-size: 0.72rem;
  font-weight: 600;
  color: var(--color-primary);
  opacity: 0.85;
}

.hub-service--off:hover .hub-btn--locked { background-color: var(--bg-hover); }
.hub-service--off:hover .hub-btn__name { color: var(--text-primary); }
.hub-service--off:hover .hub-btn__arrow { opacity: 1; transform: translateX(0); }
.hub-service--off:hover .hub-btn__upsell { opacity: 1; }

/* ── Product detail (the pages inside the product) ──────────────────────── */

/* Inside the card, separated from the header by a rule rather than by a gap:
   the detail belongs to this product, it is not a list floating beneath it. */
.hub-detail {
  padding: 0.6rem 0.9rem 0.75rem 1.15rem;
  border-top: 1px solid var(--border-color);
  background-color: rgba(255, 255, 255, 0.02);
}

.hub-detail__label {
  display: block;
  font-size: 0.58rem;
  font-weight: 700;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--text-muted);
  opacity: 0.75;
  margin-bottom: 0.35rem;
}

.hub-items {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.hub-item__link {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.32rem 0.5rem;
  border-radius: 6px;
  text-decoration: none;
  font-size: 0.78rem;
  transition: background-color 0.12s, color 0.12s, transform 0.12s;
}

.hub-item__link:hover {
  text-decoration: none;
  background-color: var(--bg-hover);
  transform: translateX(2px);
}

.hub-item__dot {
  flex: 0 0 auto;
  width: 5px;
  height: 5px;
  border-radius: 50%;
  transition: box-shadow 0.12s;
}

.hub-item__name { flex: 1 1 auto; min-width: 0; }

.hub-item--on .hub-item__dot { background-color: #4ade80; }
.hub-item--on .hub-item__name { color: var(--text-secondary); }
.hub-item--on .hub-item__link:hover .hub-item__name { color: var(--text-primary); }
.hub-item--on .hub-item__link:hover .hub-item__dot {
  box-shadow: 0 0 0 3px rgba(74, 222, 128, 0.18);
}

/* The chevron only appears on the row being pointed at, so a resting card
   stays a clean list rather than a column of arrows. */
.hub-item__chev {
  flex: 0 0 auto;
  font-size: 0.55rem;
  color: var(--color-primary);
  opacity: 0;
  transform: translateX(-3px);
  transition: opacity 0.12s, transform 0.12s;
}

.hub-item__link:hover .hub-item__chev,
.hub-item__link:focus-visible .hub-item__chev {
  opacity: 1;
  transform: translateX(0);
}

.hub-item--off .hub-item__dot {
  background-color: transparent;
  border: 1px solid var(--border-light);
}

.hub-item--off .hub-item__name { color: var(--text-muted); }

.hub-item__lock {
  font-size: 0.6rem;
  color: var(--text-muted);
  opacity: 0.8;
}

.hub-item--off .hub-item__link:hover .hub-item__name,
.hub-item--off .hub-item__link:hover .hub-item__lock {
  color: var(--color-primary);
  opacity: 1;
}

@media (max-width: 720px) {
  .hub-subs__field--right { margin-left: 0; text-align: left; }
}

.hub-version {
  color: var(--text-muted);
  font-family: 'JetBrains Mono', monospace;
  font-size: 0.8rem;
  font-weight: 500;
  letter-spacing: 0;
  padding: 0.45rem 0.75rem;
  border: 1px solid var(--border-color);
  border-radius: 8px;
  background: color-mix(in oklab, var(--bg-body) 88%, transparent);
}

.hub-version:not(.hub-version--sidebar) {
  position: fixed;
  right: 1.75rem;
  bottom: 1.5rem;
  z-index: 5;
}

.hub-version--sidebar {
  width: 100%;
  text-align: center;
  font-size: 0.72rem;
  padding: 0.35rem 0.5rem;
  background: color-mix(in oklab, var(--bg-sidebar) 80%, var(--bg-hover));
}

@media (max-width: 768px) {
  .hub-version:not(.hub-version--sidebar) {
    right: 1rem;
    bottom: 1rem;
  }
}

/* ── Reports List page ───────────────────────────────────────────── */
.rl-page {
  padding: 1.75rem 4px;
  width: 100%;
  display: flex;
  flex-direction: column;
  gap: 1.5rem;
}

/* Header */
.rl-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 1rem;
}
.rl-title {
  font-size: 1.5rem;
  font-weight: 700;
  color: var(--text-primary);
  margin: 0;
}
.rl-subtitle {
  font-size: 0.82rem;
  color: var(--text-muted);
  margin: 0;
}

/* KPI row — a wrapping flex row, not a fixed 7-column grid. The grid was
   sized for reports/list.html's seven statuses, so every other page that
   reuses it (3 cards on the reclassified list, 4 on IR/notifications, 1 on
   SCT) got cards a seventh of the width: labels wrapped to two lines, the
   numbers under them stopped lining up, and the row ended well short of the
   page. `flex: 1 1 190px` lets whatever cards are present share the full
   width evenly and wrap only when they would go under 190px. */
.rl-kpi-row {
  display: flex;
  flex-wrap: wrap;
  gap: 0.75rem;
}

.rl-kpi {
  flex: 1 1 190px;
  min-width: 0;
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: 12px;
  padding: 1.1rem 1.25rem;
  display: flex;
  align-items: center;
  gap: 1rem;
}

/* A lone KPI (the SCT lists) would otherwise stretch across the whole page. */
.rl-kpi:only-child { flex: 0 1 320px; }

/* The label/value stack: keeps a long label from pushing the number out of
   line with its neighbours' and from overflowing the card. */
.rl-kpi > div:not(.rl-kpi__icon) {
  min-width: 0;
  display: flex;
  flex-direction: column;
  justify-content: center;
  text-align: left;
}
.rl-kpi__icon {
  width: 42px;
  height: 42px;
  border-radius: 10px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.1rem;
  flex-shrink: 0;
}
.rl-kpi__icon--total      { background: rgba(107,114,128,.18); color: #9ca3af; }
.rl-kpi__icon--pending    { background: rgba(96,165,250,.12);  color: #60a5fa; }
.rl-kpi__icon--approved   { background: rgba(74,222,128,.12);  color: #4ade80; }
.rl-kpi__icon--amendment  { background: rgba(255,187,102,.12); color: #ffbb66; }
.rl-kpi__icon--rejected   { background: rgba(248,88,104,.12);  color: #f85868; }
.rl-kpi__icon--validating { background: rgba(167,139,250,.12); color: #a78bfa; }
.rl-kpi__icon--superseded { background: rgba(107,114,128,.12); color: #6b7280; }

.rl-kpi__label {
  font-size: 0.7rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--text-muted);
  margin: 0 0 2px;
}
.rl-kpi__value {
  font-size: 1.6rem;
  font-weight: 700;
  color: var(--text-primary);
  margin: 0;
  line-height: 1;
}

/* Table section card */
.rl-table-section {
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: 12px;
  overflow: hidden;
  padding: 1rem 1rem 0;
}

/* Toolbar */
/* ── Filters wrapper ── */
.rl-filters-wrap {
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
  margin-bottom: 0.75rem;
}

/* ── Refine bar: date range + submitted by ── */
.rl-refine-bar {
  display: flex !important;
  align-items: center;
  flex-wrap: wrap;
  gap: 0.5rem;
  width: auto;
}

.rl-refine-group {
  display: flex;
  align-items: center;
  gap: 0.35rem;
}

.rl-refine-label {
  font-size: 0.72rem;
  font-weight: 600;
  color: var(--text-muted);
  white-space: nowrap;
}

.rl-refine-bar .rl-refine-input {
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: 6px;
  color: var(--text-primary);
  font-size: 0.78rem;
  padding: 4px 8px;
  height: 28px;
  width: auto;
  margin-top: 0;
  outline: none;
  transition: border-color 0.15s;
}
.rl-refine-bar .rl-refine-input:focus { border-color: var(--color-primary); }

.rl-refine-bar .rl-refine-apply {
  height: 28px;
  padding: 0 12px;
  margin-top: 0;
  border-radius: 6px;
  background: var(--color-secondary);
  border: none;
  color: var(--text-primary);
  font-size: 0.78rem;
  font-weight: 600;
  cursor: pointer;
  transition: background 0.15s;
  white-space: nowrap;
  width: auto;
  flex-shrink: 0;
}
.rl-refine-bar .rl-refine-apply:hover { background: var(--color-secondary-hover); }

.rl-refine-clear {
  font-size: 0.75rem;
  color: var(--text-muted);
  text-decoration: none;
  padding: 0 4px;
}
.rl-refine-clear:hover { color: var(--text-primary); text-decoration: underline; }

/* ── Filter bar: status tabs + search ── */
.rl-filterbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  flex-wrap: wrap;
  margin-bottom: 0.75rem;
}

.rl-status-tabs {
  display: flex;
  align-items: center;
  gap: 0.25rem;
  flex-wrap: wrap;
}

.rl-status-tab {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  padding: 6px 14px;
  border-radius: 999px;
  font-size: 0.8rem;
  font-weight: 500;
  color: var(--text-muted);
  text-decoration: none;
  border: 1px solid transparent;
  transition: background-color 0.15s, color 0.15s, border-color 0.15s;
  white-space: nowrap;
}

.rl-status-tab:hover {
  background-color: var(--bg-hover);
  color: var(--text-primary);
  text-decoration: none;
}

.rl-status-tab--active {
  background-color: var(--bg-card);
  border-color: var(--border-color);
  color: var(--text-primary);
  font-weight: 600;
}

.rl-status-tab__count {
  font-size: 0.72rem;
  font-weight: 700;
  background: var(--bg-hover);
  color: var(--text-muted);
  padding: 1px 6px;
  border-radius: 999px;
  min-width: 20px;
  text-align: center;
}

.rl-status-tab--active .rl-status-tab__count {
  background: var(--color-secondary);
  color: var(--text-primary);
}

.rl-filterbar__search {
  display: flex;
  align-items: center;
  position: relative;
  flex-shrink: 0;
}

.rl-toolbar {
  padding: 1rem 1.25rem;
  border-bottom: 1px solid var(--border-color);
}
.rl-toolbar__left { display: flex; align-items: flex-start; gap: 0.75rem; flex-wrap: wrap; }

/* Filters */
.rl-filters { display: flex; align-items: center; gap: 0.75rem; flex-wrap: wrap; width: 100%; }
.rl-filter-group { display: flex; flex-direction: column; gap: 0.5rem; }
.rl-filter-toggle {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 7px 14px;
  background: var(--bg-card-secondary);
  border: 1px solid var(--border-color);
  border-radius: 8px;
  font-size: 0.82rem;
  font-weight: 500;
  color: var(--text-secondary);
  cursor: pointer;
  position: relative;
  transition: background 0.15s;
}
.rl-filter-toggle:hover { background: var(--bg-hover); color: var(--text-primary); }
.rl-filter-dot {
  width: 6px; height: 6px;
  background: var(--color-primary-hover);
  border-radius: 50%;
  position: absolute;
  top: 6px; right: 6px;
}
.rl-filter-panel {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  align-items: center;
  padding: 0.75rem;
  background: var(--bg-card-secondary);
  border: 1px solid var(--border-color);
  border-radius: 8px;
}
.rl-select, .rl-input {
  padding: 6px 10px;
  background: var(--bg-input);
  border: 1px solid var(--border-color);
  border-radius: 7px;
  font-size: 0.82rem;
  color: var(--text-secondary);
  outline: none;
}
.rl-select:focus, .rl-input:focus {
  border-color: var(--color-primary);
  color: var(--text-primary);
}

/* ── Filter Drawer ───────────────────────────────────────────────── */
.rl-drawer-overlay {
  display: none;
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.5);
  z-index: 1040;
}
.rl-drawer-overlay--visible { display: block; }

.rl-drawer {
  position: fixed;
  top: 0;
  right: 0;
  width: 340px;
  height: 100vh;
  background: var(--bg-card);
  border-left: 1px solid var(--border-light);
  z-index: 1050;
  display: flex;
  flex-direction: column;
  transform: translateX(100%);
  transition: transform 0.25s ease;
}
.rl-drawer--open { transform: translateX(0); }

.rl-drawer__header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 1.25rem 1.5rem;
  border-bottom: 1px solid var(--border-light);
  flex-shrink: 0;
}
.rl-drawer__title {
  font-size: 1.1rem;
  font-weight: 600;
  color: var(--text-primary);
  margin: 0;
}
.rl-drawer__close {
  background: none;
  border: none;
  color: var(--text-muted);
  font-size: 1.1rem;
  cursor: pointer;
  padding: 4px 6px;
  border-radius: 6px;
  line-height: 1;
  transition: color 0.15s, background 0.15s;
}
.rl-drawer__close:hover { color: var(--text-primary); background: var(--bg-hover); }

.rl-drawer__body {
  flex: 1;
  overflow-y: hidden;
  padding: 1.5rem;
  display: flex;
  flex-direction: column;
  gap: 1.5rem;
}

.rl-drawer__field {
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
}
.rl-drawer__label {
  font-size: 0.875rem;
  font-weight: 500;
  color: var(--text-primary);
}
.rl-drawer__select {
  width: 100%;
  padding: 9px 12px;
  background: var(--bg-input);
  border: 1px solid var(--border-light);
  border-radius: 8px;
  font-size: 0.875rem;
  color: var(--text-secondary);
  outline: none;
  appearance: auto;
  transition: border-color 0.15s;
}
.rl-drawer__select:focus {
  border-color: var(--color-primary);
  color: var(--text-primary);
}
.rl-drawer__date-row {
  display: flex;
  align-items: center;
  gap: 0.5rem;
}
.rl-drawer__date-sep {
  color: var(--text-muted);
  flex-shrink: 0;
}

.rl-drawer__footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 1rem 1.5rem;
  border-top: 1px solid var(--border-light);
  flex-shrink: 0;
}
.rl-drawer__footer .rl-btn-primary {
  padding: 7px 20px;
  font-size: 0.82rem;
}

/* Search */
.rl-search-wrap {
  position: relative;
  margin-left: auto;
}
.rl-search-icon {
  position: absolute;
  left: 10px;
  top: 50%;
  transform: translateY(-50%);
  color: var(--text-muted);
  font-size: 0.8rem;
}
.rl-search-input {
  padding: 7px 12px 7px 32px;
  background: var(--bg-card-secondary);
  border: 1px solid var(--border-color);
  border-radius: 8px;
  font-size: 0.82rem;
  color: var(--text-secondary);
  width: 220px;
  outline: none;
  transition: border-color 0.15s;
}
.rl-search-input:focus {
  border-color: var(--color-primary);
  color: var(--text-primary);
}

/* Bulk bar */
.rl-bulk-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0.6rem 1.25rem;
  background: rgba(107,114,128,.08);
  border-bottom: 1px solid var(--border-color);
  gap: 1rem;
}
.rl-bulk-bar__count { font-size: 0.82rem; color: var(--text-secondary); }
.rl-bulk-bar__actions { display: flex; gap: 0.5rem; }

/* Table */
.rl-table-wrap { overflow-x: auto; }
.rl-table {
  width: 100%;
  border-collapse: separate;
  border-spacing: 0;
  font-size: 0.85rem;
}
.rl-table thead tr {
  background: var(--bg-table-header);
}
.rl-table th {
  padding: 0.65rem 1rem;
  font-size: 0.7rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--text-muted);
  border-bottom: 1px solid var(--border-color);
  white-space: nowrap;
}
.rl-th-check { width: 40px; }

.rl-table th {
  text-align: left;
}

.rl-table td {
  text-align: left;
}

/* Keep checkbox, status and actions centred */
.rl-table th.rl-th-check,
.rl-table td.rl-th-check,
.rl-table th.rl-col-status,
.rl-table td.rl-col-status,
.rl-table th.rl-col-actions,
.rl-table td.rl-col-actions {
  text-align: center;
}

.rl-row td {
  padding: 0.85rem 1rem;
  border-bottom: 1px solid var(--border-color);
  vertical-align: middle;
  color: var(--text-secondary);
}
.rl-row:last-child td { border-bottom: none; }
.rl-row:hover td { background: var(--bg-hover); }

.rl-td-name { font-weight: 500; color: var(--text-primary); max-width: 260px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.rl-td-muted { color: var(--text-muted); }

/* Status badges */
.rl-badge {
  display: inline-flex;
  align-items: center;
  padding: 3px 10px;
  border-radius: 20px;
  font-size: 0.7rem;
  font-weight: 700;
  white-space: nowrap;
}
.rl-badge--approved   { background: rgba(74,222,128,.12);  color: #4ade80;  border: 1px solid rgba(74,222,128,.25); }
.rl-badge--rejected   { background: rgba(248,88,104,.12);  color: #f85868;  border: 1px solid rgba(248,88,104,.25); }
.rl-badge--amendment  { background: rgba(255,187,102,.12); color: #ffbb66;  border: 1px solid rgba(255,187,102,.25); }
.rl-badge--validating { background: rgba(96,165,250,.12);  color: #60a5fa;  border: 1px solid rgba(96,165,250,.25); }
.rl-badge--pending    { background: rgba(163,163,163,.1);  color: #a3a3a3;  border: 1px solid var(--border-color); }
.rl-badge--superseded { background: rgba(107,114,128,.12); color: #6b7280;  border: 1px solid rgba(107,114,128,.25); text-decoration: line-through; }

/* Action buttons */
.rl-actions { display: flex; align-items: center; justify-content: flex-end; gap: 4px; }
.rl-action-btn {
  width: 30px; height: 30px;
  display: inline-flex; align-items: center; justify-content: center;
  border-radius: 6px;
  border: none;
  background: none;
  color: var(--text-muted);
  font-size: 0.8rem;
  cursor: pointer;
  text-decoration: none;
  transition: background 0.15s, color 0.15s;
}
.rl-action-btn:hover { background: var(--bg-hover); color: var(--text-primary); }
.rl-action-btn--danger:hover { background: rgba(248,88,104,.12); color: #f85868; }
.rl-action-btn--disabled { opacity: 0.3; cursor: not-allowed; }

/* Checkbox */
.rl-checkbox { accent-color: var(--color-primary); width: 15px; height: 15px; cursor: pointer; }

/* Pagination */
.rl-pagination {
  display: grid;
  grid-template-columns: 1fr auto 1fr;
  align-items: center;
  padding: 1rem 1.5rem;
  border-top: 1px solid var(--border-color);
  gap: 1rem;
  background: var(--bg-card);
  border-radius: 0 0 10px 10px;
}
.rl-pagination > *:last-child { justify-self: end; }

.rl-page-btn {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 7px 18px;
  background: var(--bg-card-secondary);
  border: 1px solid var(--border-color);
  border-radius: 8px;
  font-size: 0.82rem;
  font-weight: 600;
  color: var(--text-secondary);
  text-decoration: none;
  cursor: pointer;
  transition: background 0.15s, color 0.15s, border-color 0.15s, box-shadow 0.15s;
  white-space: nowrap;
  line-height: 1.5;
  letter-spacing: 0.01em;
}
.rl-page-btn:hover:not([disabled]) {
  background: var(--bg-hover);
  color: var(--text-primary);
  border-color: var(--color-primary);
  box-shadow: 0 0 0 2px var(--accent-soft);
  text-decoration: none;
}
.rl-page-btn[disabled] {
  opacity: 0.35;
  cursor: not-allowed;
  pointer-events: none;
}

.rl-page-info {
  font-size: 0.82rem;
  color: var(--text-muted);
  white-space: nowrap;
  text-align: center;
  background: var(--bg-hover);
  padding: 5px 14px;
  border-radius: 20px;
  border: 1px solid var(--border-color);
}

/* Empty state */
.rl-empty {
  display: flex; flex-direction: column; align-items: center;
  padding: 4rem 2rem; text-align: center; gap: 0.75rem;
}
.rl-empty__icon  { font-size: 2.5rem; color: var(--text-muted); opacity: 0.35; }
.rl-empty__title { font-size: 1.1rem; font-weight: 600; color: var(--text-primary); margin: 0; }
.rl-empty__text  { font-size: 0.85rem; color: var(--text-muted); margin: 0; }

/* Shared buttons */
.rl-btn-primary {
  display: inline-flex; align-items: center; gap: 7px;
  padding: 8px 18px;
  background: var(--color-primary);
  color: var(--text-primary);
  border: none; border-radius: 8px;
  font-size: 0.875rem; font-weight: 500;
  text-decoration: none; cursor: pointer;
  transition: background 0.15s;
}
.rl-btn-primary:hover { background: var(--color-primary-hover); color: var(--text-primary); text-decoration: none; }

.rl-btn-secondary {
  display: inline-flex; align-items: center; gap: 6px;
  padding: 6px 14px;
  background: var(--bg-card-secondary);
  border: 1px solid var(--border-color);
  border-radius: 8px;
  font-size: 0.82rem; font-weight: 500;
  color: var(--text-secondary); cursor: pointer;
  text-decoration: none;
  transition: background 0.15s;
}
.rl-btn-secondary:hover { background: var(--bg-hover); color: var(--text-primary); }

.rl-btn-ghost {
  display: inline-flex; align-items: center;
  padding: 6px 12px;
  background: none; border: none;
  font-size: 0.82rem; color: var(--text-muted);
  cursor: pointer; text-decoration: none;
  border-radius: 8px;
  transition: color 0.15s;
}
.rl-btn-ghost:hover { color: var(--text-primary); text-decoration: none; }

.rl-btn-danger {
  display: inline-flex; align-items: center; gap: 6px;
  padding: 6px 14px;
  background: rgba(248,88,104,.1);
  border: 1px solid rgba(248,88,104,.25);
  border-radius: 8px;
  font-size: 0.82rem; font-weight: 500;
  color: #f85868; cursor: pointer;
  transition: background 0.15s;
}
.rl-btn-danger:hover { background: rgba(248,88,104,.2); }

/* ── Dashboard page ─────────────────────────────────────────────── */
.db-page {
  padding: 2rem 1.75rem 3rem;

  display: flex;
  flex-direction: column;
  /* Sections, not cards, are the unit of rhythm here: a wide gap between
     products and a tight one inside each is what makes the grouping read at a
     glance rather than as one long run of boxes. */
  gap: 2.25rem;
}

.db-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 1rem;
  margin-bottom: -0.75rem;
}

.db-title {
  font-size: 1.75rem;
  font-weight: 700;
  letter-spacing: -0.02em;
  color: var(--text-primary);
  margin: 0;
}

.db-subtitle {
  font-size: 0.85rem;
  color: var(--text-muted);
  margin: 0;
}

.btn-upload-new {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 8px 18px;
  background-color: var(--color-primary);
  color: var(--text-primary);
  border-radius: 8px;
  font-size: 0.875rem;
  font-weight: 500;
  text-decoration: none;
  transition: background-color 0.15s;
}
.btn-upload-new:hover {
  background-color: var(--color-primary-hover);
  color: var(--text-primary);
  text-decoration: none;
}

/* ── Summary strip ── */
/* auto-fit, not a fixed 3, so a section with one or two summary cards fills
   its row instead of leaving a ragged hole where the third would have been. */
.db-summary-strip {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(270px, 1fr));
  gap: 0.85rem;
}

.db-summary-card {
  display: flex;
  flex-direction: column;
  gap: 0;
  background-color: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: 14px;
  padding: 1rem 1.15rem 1.1rem;
  transition: border-color 0.15s, transform 0.12s, box-shadow 0.15s;
}

.db-summary-card:hover {
  border-color: var(--border-light);
  transform: translateY(-1px);
  box-shadow: 0 6px 20px rgba(0, 0, 0, 0.22);
}

.db-summary-card__icon {
  width: 34px;
  height: 34px;
  border-radius: 10px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 0.9rem;
  flex-shrink: 0;
}

.db-summary-card__row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem;
  width: 100%;
}

.db-summary-card__head {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  min-width: 0;
}

.db-summary-card__title {
  font-size: 0.9rem;
  font-weight: 600;
  color: var(--text-primary);
  line-height: 1.25;
}

.db-summary-card__divider {
  width: 100%;
  border: none;
  border-top: 1px solid var(--border-color);
  margin: 0.9rem 0 0.75rem;
}

/* The figures are the point of a summary card, so they are read as a row of
   value-over-label pairs rather than a sentence of small grey text. The dots
   that used to separate that sentence are redundant once each figure is its
   own block, so they are dropped rather than restyled. */
.db-summary-card__stats {
  display: flex;
  align-items: flex-start;
  flex-wrap: wrap;
  gap: 0.35rem 1.5rem;
  font-size: 0.68rem;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: var(--text-muted);
}

/* `<strong>2</strong> total` — the bare label is an anonymous flex item, so
   plain `column` stacks the figure over its label without touching markup. */
.db-summary-card__stats > span {
  display: flex;
  flex-direction: column;
  gap: 0.1rem;
  line-height: 1.2;
}

.db-summary-card__stats strong {
  font-size: 1.4rem;
  font-weight: 700;
  letter-spacing: -0.02em;
  color: var(--text-primary);
}

.db-summary-card__dot { display: none; }

.db-summary-stat--approved  strong { color: #4ade80; }
.db-summary-stat--pending   strong { color: #fbbf24; }
.db-summary-stat--amendment strong { color: #ffbb66; }

.db-summary-card__link,
.db-card__link {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  box-sizing: border-box;
  min-width: 76px;
  min-height: 30px;
  padding: 0.38rem 0.85rem;
  font-family: 'Plus Jakarta Sans', 'Inter', 'Roboto', system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  font-size: 0.86rem;
  font-weight: 600;
  line-height: 1;
  text-align: center;
  letter-spacing: 0;
  color: #d7e4fb;
  background: rgba(148, 163, 184, 0.1);
  border: 1px solid rgba(148, 163, 184, 0.35);
  border-radius: 7px;
  text-decoration: none;
  white-space: nowrap;
  vertical-align: middle;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
  transition: background-color 0.15s ease, border-color 0.15s ease, color 0.15s ease;
}

.db-summary-card__link {
  flex-shrink: 0;
  width: 30px;
  height: 30px;
  min-width: 30px;
  min-height: 30px;
  padding: 0;
  font-size: 0.85rem;
}

.db-summary-card__link:hover,
.db-card__link:hover {
  color: #f4f7ff;
  background: rgba(148, 163, 184, 0.16);
  border-color: rgba(190, 205, 228, 0.48);
  text-decoration: none;
}

.db-summary-card__link:focus-visible,
.db-card__link:focus-visible {
  outline: 2px solid rgba(190, 205, 228, 0.72);
  outline-offset: 2px;
}

/* ── Stat row ── */
.db-stats {
  display: grid;
  grid-template-columns: repeat(6, 1fr);
  gap: 0.75rem;
}

@media (max-width: 1100px) { .db-stats { grid-template-columns: repeat(3, 1fr); } }
@media (max-width: 700px)  { .db-stats { grid-template-columns: repeat(2, 1fr); } }

.db-stat {
  background-color: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: 10px;
  padding: 1rem 1.1rem;
  display: flex;
  align-items: center;
  gap: 0.85rem;
}

.db-stat__icon {
  width: 38px;
  height: 38px;
  border-radius: 8px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1rem;
  flex-shrink: 0;
}
.db-stat__icon--total      { background: rgba(107,114,128,.18); color: #9ca3af; }
.db-stat__icon--approved   { background: rgba(74,222,128,.12);  color: #4ade80; }
.db-stat__icon--pending    { background: rgba(251,191,36,.12);  color: #fbbf24; }
.db-stat__icon--rejected   { background: rgba(248,88,104,.12);  color: #f85868; }
.db-stat__icon--amendment  { background: rgba(255,187,102,.12); color: #ffbb66; }
.db-stat__icon--validating { background: rgba(96,165,250,.12);  color: #60a5fa; }

.db-stat__value {
  font-size: 1.5rem;
  font-weight: 700;
  color: var(--text-primary);
  line-height: 1;
}
.db-stat__label {
  font-size: 0.75rem;
  color: var(--text-muted);
  margin-top: 2px;
}

/* ── Two-column grid ── */
.db-grid-2 {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(340px, 1fr));
  gap: 0.85rem;
}


/* ── Two-column grid ── */
.db-grid-3 {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 1rem;
}
@media (max-width: 991px) { .db-grid-3 { grid-template-columns: repeat(2, 1fr); } }

/* ── Card ── */
.db-card {
  background-color: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: 14px;
  overflow: hidden;
  display: flex;
  flex-direction: column;
  min-height: 230px;
  transition: border-color 0.15s, box-shadow 0.15s;
}

.db-card:hover {
  border-color: var(--border-light);
  box-shadow: 0 6px 20px rgba(0, 0, 0, 0.22);
}

.db-card--full { width: 100%; }

/* The head is a label, not a title: small, tracked and quiet, so the content
   below it carries the weight. */
.db-card__head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem;
  padding: 0.9rem 1.15rem;
  border-bottom: 1px solid var(--border-color);
  font-size: 0.72rem;
  font-weight: 700;
  letter-spacing: 0.07em;
  text-transform: uppercase;
  color: var(--text-secondary);
}
.db-card__link--push {
  margin-left: auto;
}

.db-card__body {
  padding: 1.1rem 1.15rem 1.6rem;
  flex: 1;
}

.db-widget {
  position: relative;
}

.db-widget__remove {
  position: static;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex: 0 0 auto;
  width: 30px;
  height: 30px;
  margin: 0;
  padding: 0;
  color: rgba(245, 245, 245, 0.46);
  background: rgba(148, 163, 184, 0.06);
  border: 1px solid rgba(148, 163, 184, 0.16);
  border-radius: 7px;
  font-size: 0.74rem;
  line-height: 1;
  cursor: pointer;
  opacity: 1;
  transition: background-color 0.15s ease, border-color 0.15s ease, color 0.15s ease;
}

.db-widget__remove:hover,
.db-widget__remove:focus-visible {
  color: #f85868;
  background: rgba(248, 88, 104, 0.1);
  border-color: rgba(248, 88, 104, 0.22);
  outline: none;
}

.db-widget__remove:focus-visible {
  box-shadow: 0 0 0 2px rgba(248, 88, 104, 0.25);
}

.db-widget__handle {
  position: static;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex: 0 0 auto;
  width: 30px;
  height: 30px;
  margin: 0;
  padding: 0;
  color: rgba(245, 245, 245, 0.46);
  background: rgba(148, 163, 184, 0.06);
  border: 1px solid rgba(148, 163, 184, 0.16);
  border-radius: 7px;
  font-size: 0.74rem;
  line-height: 1;
  cursor: grab;
  touch-action: none;
  transition: background-color 0.15s ease, border-color 0.15s ease, color 0.15s ease;
}

.db-widget__handle:hover,
.db-widget__handle:focus-visible {
  color: #d7e4fb;
  background: rgba(148, 163, 184, 0.16);
  border-color: rgba(190, 205, 228, 0.42);
  outline: none;
}

.db-widget__handle:focus-visible {
  box-shadow: 0 0 0 2px rgba(190, 205, 228, 0.35);
}

.db-widget__handle:active {
  cursor: grabbing;
}

/* SortableJS drag states */
.db-widget.db-widget--ghost {
  opacity: 0.45;
  outline: 2px dashed rgba(96, 165, 250, 0.6);
  outline-offset: 2px;
}

.db-widget.db-widget--chosen {
  cursor: grabbing;
}

.db-widget.db-widget--drag {
  opacity: 0.95;
}

/* Reveal drop zones (esp. an emptied row) while a drag is in progress. */
[data-dashboard-widgets].is-reordering [data-widget-group] {
  min-height: 64px;
  outline: 2px dashed rgba(148, 163, 184, 0.28);
  outline-offset: 4px;
  border-radius: 10px;
}

.db-summary-card.db-widget {
  display: flex;
  flex-direction: column;
  align-items: stretch;
}

.db-widget__actions {
  display: inline-flex;
  align-items: center;
  justify-content: flex-end;
  gap: 0.45rem;
  min-width: max-content;
}

.db-card.db-widget .db-card__head {
  gap: 1rem;
}

.db-card.db-widget .db-card__head > span {
  flex: 1 1 auto;
  min-width: 0;
}


.db-widget-empty {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 1rem;
  min-height: 260px;
  padding: 3rem 2rem;
  color: var(--text-muted);
  text-align: center;
}

.db-widget-empty[hidden] {
  display: none;
}

/* ── Badges ── */
.db-badge {
  display: inline-flex;
  align-items: center;
  flex-shrink: 0;
  font-size: 0.7rem;
  font-weight: 600;
  padding: 2px 7px;
  border-radius: 20px;
  white-space: nowrap;
}
.db-badge--approved   { background: rgba(74,222,128,.12);  color: #4ade80;  border: 1px solid rgba(74,222,128,.25); }
.db-badge--rejected   { background: rgba(248,88,104,.12);  color: #f85868;  border: 1px solid rgba(248,88,104,.25); }
.db-badge--amendment  { background: rgba(255,187,102,.12); color: #ffbb66;  border: 1px solid rgba(255,187,102,.25); }
.db-badge--validating { background: rgba(96,165,250,.12);  color: #60a5fa;  border: 1px solid rgba(96,165,250,.25); }
.db-badge--pending    { background: rgba(163,163,163,.1);  color: #a3a3a3;  border: 1px solid var(--border-color); }

/* ── Notifications list ── */
.db-notif-list {
  list-style: none;
  padding: 0;
  margin: 0;
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
}
.db-notif-item { border-radius: 8px; overflow: hidden; }
.db-notif-item--unread { background-color: rgba(96,165,250,.05); }

.db-notif-link {
  display: flex;
  align-items: flex-start;
  gap: 0.75rem;
  padding: 0.6rem 0.75rem;
  text-decoration: none;
  border-radius: 8px;
  transition: background-color 0.15s;
}
.db-notif-link:hover { background-color: var(--bg-hover); text-decoration: none; }

.db-notif-icon { color: #60a5fa; margin-top: 2px; flex-shrink: 0; }
.db-notif-title { font-size: 0.85rem; font-weight: 600; color: var(--text-primary); overflow-wrap: anywhere; }
.db-notif-meta  { font-size: 0.78rem; color: var(--text-muted); overflow-wrap: anywhere; }
.db-notif-time  { font-size: 0.72rem; color: var(--text-muted); margin-top: 2px; }

/* Status badge on a .db-notif-link row (Latest Activity widget) — pins to
   the right of the icon+text block instead of stacking under it. */
.db-activity-badge { margin-left: auto; align-self: center; flex-shrink: 0; }

/* ── Activity table ── */
.db-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.85rem;
}
.db-table th {
  text-align: left;
  padding: 0.5rem 0.75rem;
  color: var(--text-muted);
  font-weight: 600;
  font-size: 0.75rem;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  border-bottom: 1px solid var(--border-color);
}
.db-table td {
  padding: 0.6rem 0.75rem;
  color: var(--text-secondary);
  border-bottom: 1px solid var(--border-color);
}
.db-table tr:last-child td { border-bottom: none; }
.db-table tr:hover td { background-color: var(--bg-hover); }

/* ── Empty state ── */
.db-empty {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 4rem 2rem;
  text-align: center;
  gap: 1rem;
}
.db-empty__icon  { font-size: 3rem; color: var(--text-muted); opacity: 0.4; }
.db-empty__title { font-size: 1.2rem; font-weight: 600; color: var(--text-primary); margin: 0; }
.db-empty__text  { color: var(--text-muted); font-size: 0.9rem; margin: 0; }
.db-empty-text   { color: var(--text-muted); font-size: 0.85rem; padding: 1rem 0; margin: 0; }
.db-report__table .db-empty-text {
  flex: 1 1 auto;
  display: flex;
  align-items: center;
  justify-content: center;
}

/* IR / SCT card helpers */
.db-report__table .db-ir-empty { flex: 1 1 auto; justify-content: center; }

.db-ir-empty {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.4rem;
  padding: 2rem 1rem;
  text-align: center;
  color: var(--text-muted);
}
.db-ir-empty i { font-size: 1.6rem; opacity: 0.3; }
.db-ir-empty p { margin: 0; font-size: 0.85rem; }

.db-ir-phase {
  display: inline-block;
  font-size: 0.68rem;
  font-weight: 600;
  padding: 1px 6px;
  border-radius: 999px;
  margin-right: 3px;
}
.db-ir-phase--draft     { background: rgba(107,114,128,.18); color: #9ca3af; }
.db-ir-phase--submitted { background: rgba(74,222,128,.12);  color: #4ade80; }
.db-ir-phase--expired   { background: rgba(248,88,104,.12);  color: #f85868; }

/* ── Table overrides ─────────────────────────────────────────────── */
/* Table overrides */
.table {
  color: var(--text-primary);
  --bs-table-bg: transparent;
  --bs-table-color: var(--text-primary);
}

.table > thead {
  background-color: var(--bg-table-header);
}

.table > thead th {
  background-color: var(--bg-table-header);
  color: var(--text-heading);
  border-bottom: 2px solid var(--border-color);
}

.table > tbody > tr {
  border-color: var(--border-color);
}

.table > tbody > tr:nth-of-type(odd) {
  background-color: var(--bg-card);
}

.table > tbody > tr:nth-of-type(even) {
  background-color: var(--bg-table-row-alt);
}

.table-hover > tbody > tr:hover {
  background-color: var(--bg-table-row-hover) !important;
  --bs-table-hover-bg: var(--bg-table-row-hover);
}

.table-bordered > :not(caption) > * > * {
  border-color: var(--border-color);
}

/* Card overrides */
.card.shadow,
.shadow,
.shadow-sm {
  box-shadow: var(--shadow-md) !important;
}

/* Dropdown overrides */
.dropdown-menu {
  background-color: var(--bg-card);
  border: 1px solid var(--border-light);
  border-radius: 14px;
  box-shadow: 0 12px 32px -8px rgba(0, 0, 0, 0.35), 0 2px 8px rgba(0, 0, 0, 0.15);
  padding: 6px;
}

.dropdown-item {
  color: var(--text-primary);
  border-radius: 9px;
  padding: 9px 12px;
  transition: background-color 0.13s ease, color 0.13s ease;
}

.dropdown-item:hover,
.dropdown-item:focus {
  background-color: var(--bg-hover);
  color: var(--text-primary);
}

.dropdown-divider {
  border-color: var(--border-color);
  margin: 6px 4px;
}

/* Form control overrides */
.form-control,
.form-select {
  background-color: var(--bg-input);
  border-color: var(--border-color);
  color: var(--text-primary);
}

/* Bootstrap's .form-select pairs appearance:none with its own chevron
   background-image. Windows Chrome/Edge reuse a custom-appearance select's
   background as the native popup's listbox background and tile it across
   every option row — the same quirk documented at length in orgx.css. The
   only reliable fix is to hand the browser no custom background at all, so
   drop the image and restore the platform's own arrow. */
.form-select {
  -webkit-appearance: auto;
  -moz-appearance: auto;
  appearance: auto;
  background-image: none;
  padding-right: 0.75rem;
}

.form-control:focus,
.form-select:focus {
  background-color: var(--bg-input);
  border-color: var(--border-focus);
  color: var(--text-primary);
  box-shadow: none;
}

.form-control::placeholder {
  color: var(--text-muted);
}

/* Button outline variants */
.btn-outline-secondary {
  color: var(--text-secondary);
  border-color: var(--border-color);
}

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

/* Pagination */
.page-link {
  background-color: var(--bg-card);
  border-color: var(--border-color);
  color: var(--text-link);
}

.page-link:hover {
  background-color: var(--bg-hover);
  border-color: var(--border-color);
  color: var(--text-link-hover);
}

.page-item.active .page-link {
  background-color: var(--color-primary);
  border-color: var(--color-primary);
}

.page-item.disabled .page-link {
  background-color: var(--bg-card-secondary);
  border-color: var(--border-color);
  color: var(--text-muted);
}

/* Modal overrides */
.modal-content {
  background-color: var(--bg-card);
  border: 1px solid var(--border-color);
}

.modal-header {
  border-bottom-color: var(--border-color);
}

.modal-footer {
  border-top-color: var(--border-color);
}

/* Content area */
.content-area {
  background-color: var(--bg-body);
}

/* Headings */
h1, h3, h4, h5, h6 {
  color: var(--text-heading);
}

/* Card title */
.card-title {
  color: var(--text-heading);
}

/* Alert warning override for dark mode */
.alert-warning {
  background-color: rgba(120, 53, 15, 0.5);
  color: #fde68a;
  border: 1px solid rgba(245, 158, 11, 0.7);
  border-left: 4px solid #f59e0b;
}

.alert-warning a,
.alert-warning .alert-link {
  color: #fbbf24;
  font-weight: 700;
  text-decoration: underline;
}

/* Input group */
.input-group-text {
  background-color: var(--bg-card-secondary);
  border-color: var(--border-color);
  color: var(--text-secondary);
}

/* Readonly inputs */
.readonly-input,
input[readonly],
.form-control[readonly] {
  background-color: var(--bg-card-secondary) !important;
  color: var(--text-muted) !important;
  cursor: not-allowed;
}

input:disabled,
select:disabled,
textarea:disabled,
.form-control:disabled,
.form-select:disabled {
  background-color: #3a3a3a !important;
  color: #9ca3af !important;
  border-color: #4b5563 !important;
  cursor: not-allowed;
  opacity: 1;
}

/* List group dark mode */
.list-group-item {
  background-color: var(--bg-card);
  color: var(--text-primary);
  border-color: var(--border-color);
}

.list-group-item:hover {
  background-color: var(--bg-hover);
}

/* Breadcrumb dark mode */
.breadcrumb {
  background-color: transparent;
}

.breadcrumb-item a {
  color: var(--text-link);
}

.breadcrumb-item.active {
  color: var(--text-muted);
}

/* Progress bar dark mode */
.progress {
  background-color: var(--bg-card-secondary);
}

/* Accordion dark mode */
.accordion-item {
  background-color: var(--bg-card);
  border-color: var(--border-color);
}

.accordion-button {
  background-color: var(--bg-card);
  color: var(--text-primary);
}

.accordion-button:not(.collapsed) {
  background-color: var(--bg-card-secondary);
  color: var(--text-primary);
}

.accordion-button::after {
  filter: invert(1);
}

.accordion-body {
  background-color: var(--bg-card);
  color: var(--text-primary);
}



/* ── Top Navbar ──────────────────────────────────────────────────── */
.top-navbar {
  width: 100%;
  height: 64px;
  border-bottom: 1px solid var(--border-color);
  flex-shrink: 0;
  display: flex;
  align-items: center;
}

.top-navbar__inner {
  display: flex;
  align-items: center;
  width: 100%;
  height: 100%;
  padding: 0 1.5rem;
  gap: 1rem;
}

/* Right-side group */
.top-navbar__actions {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-left: auto;
}

/* Submit Report button */
.top-navbar__submit-btn {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  width: auto;
  margin-top: 0;
  background-color: var(--accent);
  color: var(--accent-ink);
  border: none;
  border-radius: 9px;
  padding: 8px 18px;
  font-size: 0.875rem;
  font-weight: 600;
  white-space: nowrap;
  text-decoration: none;
  box-shadow: 0 1px 2px rgba(0, 0, 0, 0.12);
  transition: background-color 0.15s, box-shadow 0.15s;
  cursor: pointer;
}

.top-navbar__submit-btn:hover {
  background-color: var(--accent-hi);
  color: var(--accent-ink);
  box-shadow: 0 2px 8px -1px var(--accent-line);
}

.top-navbar__qa-chevron {
  font-size: 0.68rem;
  margin-left: 2px;
  opacity: 0.7;
}

.top-navbar__qa-menu {
  min-width: 256px;
}

.dashboard-widget-menu {
  min-width: 320px;
  max-height: min(520px, calc(100vh - 96px));
  overflow-y: auto;
  overscroll-behavior: contain;
}

.top-navbar__qa-menu .dropdown-header {
  font-size: 0.68rem;
  font-weight: 700;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--text-muted);
  padding: 10px 12px 6px;
}

.top-navbar__qa-menu .dropdown-item {
  display: flex;
  align-items: center;
  gap: 11px;
  width: 100%;
  margin-top: 0;
  font-size: 0.875rem;
  font-weight: 500;
  padding: 8px 10px;
  text-align: left;
  background: transparent;
  border: 0;
}

.dashboard-widget-menu__item {
  justify-content: space-between;
}

.dashboard-widget-menu__label {
  flex: 1 1 auto;
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.dashboard-widget-menu__status {
  flex-shrink: 0;
  margin-left: auto;
  color: var(--text-muted);
  font-size: 0.72rem;
  font-weight: 600;
}

.dashboard-widget-menu__item[disabled] {
  color: var(--text-secondary);
  cursor: default;
  opacity: 0.58;
}

.dashboard-widget-menu__item[disabled]:hover {
  background: transparent;
}

.dashboard-widget-menu__empty {
  padding: 0.8rem 0.9rem;
  color: var(--text-muted);
  font-size: 0.82rem;
  text-align: center;
}

/* Icon chips — brand amber, fill on hover */
.top-navbar__qa-menu .dropdown-item i {
  width: 30px;
  height: 30px;
  margin: 0;
  flex-shrink: 0;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border-radius: 8px;
  background: var(--accent-soft);
  color: var(--accent);
  font-size: 0.85rem;
  opacity: 1;
  transition: background-color 0.13s ease, color 0.13s ease;
}

.top-navbar__qa-menu .dropdown-item:hover i {
  background: var(--accent);
  color: var(--accent-ink);
}

/* Bell icon button */
.top-navbar__icon-btn {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 38px;
  height: 38px;
  background-color: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: 8px;
  color: var(--text-secondary);
  font-size: 1rem;
  cursor: pointer;
  position: relative;
  transition: background-color 0.15s, color 0.15s;
}

.top-navbar__icon-btn:hover {
  background-color: var(--bg-hover);
  color: var(--text-primary);
}

/* GRC search box in the top bar (base.html) */
.top-search { position: relative; display: flex; align-items: center; margin: 0; }
.top-search__icon { position: absolute; left: 11px; color: var(--text-muted); font-size: 0.85rem; pointer-events: none; }
.top-search__input {
  width: 240px; height: 38px; padding: 0 12px 0 32px;
  background-color: var(--bg-card); border: 1px solid var(--border-color); border-radius: 8px;
  color: var(--text-primary); font-size: 0.875rem; outline: none;
}
.top-search__input:focus { border-color: var(--border-focus); }
.top-search__results {
  position: absolute; top: 44px; right: 0; width: 380px; max-height: 420px; overflow-y: auto; z-index: 1050;
  background-color: var(--bg-card); border: 1px solid var(--border-color); border-radius: 8px;
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.35);
}
.top-search__item { display: block; padding: 8px 12px; color: var(--text-primary); text-decoration: none; border-bottom: 1px solid var(--border-color); }
.top-search__item:last-child { border-bottom: none; }
.top-search__item:hover, .top-search__item.is-active { background-color: var(--bg-hover); color: var(--text-primary); }
.top-search__type { font-size: 0.72rem; color: var(--text-muted); }
.top-search__msg { padding: 10px 12px; font-size: 0.85rem; color: var(--text-muted); }
@media (max-width: 900px) { .top-search { display: none; } }

/* Sidebar toggle — same look as the other navbar icon buttons, but only
   shown below the 900px breakpoint where the sidebar goes off-canvas. */
.top-navbar__menu-btn {
  display: none;
  align-items: center;
  justify-content: center;
  width: 38px;
  height: 38px;
  flex-shrink: 0;
  background-color: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: 8px;
  color: var(--text-secondary);
  font-size: 1rem;
  cursor: pointer;
  transition: background-color 0.15s, color 0.15s;
}
.top-navbar__menu-btn:hover {
  background-color: var(--bg-hover);
  color: var(--text-primary);
}
@media (max-width: 900px) {
  .top-navbar__menu-btn {
    display: flex;
  }
}

/* Stands in for the sidebar toggle on the guest (no-sidebar) pricing page a
   fresh signup lands on before picking a plan — see base.html's
   onboarding_pending branch. */
.top-navbar__almost-there {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 6px 12px;
  border-radius: 999px;
  font-size: 0.8125rem;
  font-weight: 600;
  background: color-mix(in oklab, var(--color-primary) 15%, transparent);
  border: 1px solid color-mix(in oklab, var(--color-primary) 30%, transparent);
  color: var(--color-primary);
  white-space: nowrap;
}

.top-navbar__badge {
  position: absolute;
  top: 4px;
  right: 4px;
  background: var(--color-danger);
  color: #fff;
  font-size: 0.6rem;
  font-weight: 700;
  min-width: 14px;
  height: 14px;
  border-radius: 7px;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 0 3px;
  line-height: 1;
}

/* User button */
.top-navbar__user-btn {
  display: flex;
  align-items: center;
  gap: 10px;
  background: none;
  border: none;
  padding: 4px 6px;
  border-radius: 8px;
  cursor: pointer;
  transition: background-color 0.15s;
}

.top-navbar__user-btn:hover {
  background-color: var(--bg-hover);
}

/* Avatar circle */
.top-navbar__avatar {
  width: 38px;
  height: 38px;
  border-radius: 50%;
  flex-shrink: 0;
  background-color: var(--color-secondary);
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--text-primary);
  font-size: 1rem;
  overflow: hidden;
}

/* Name + location */
.top-navbar__user-info {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  line-height: 1.25;
}

.top-navbar__user-name {
  font-size: 0.875rem;
  font-weight: 600;
  color: var(--text-primary);
  white-space: nowrap;
}

.top-navbar__user-location {
  font-size: 0.72rem;
  color: var(--text-muted);
  white-space: nowrap;
}




/* ── My Account Page ─────────────────────────────────────────────── */
.acct-page {

  padding: 8px 0 32px;
}

.acct-page__title {
  font-size: 1.5rem;
  font-weight: 600;
  color: var(--text-heading);
  margin-bottom: 20px;
}

/* Tab bar */
.acct-tabs {
  display: flex;
  border-bottom: 1px solid var(--border-color);
  margin-bottom: 24px;
}

.acct-tab {
  padding: 10px 20px;
  font-size: 0.875rem;
  font-weight: 500;
  color: var(--text-secondary);
  text-decoration: none;
  border-bottom: 2px solid transparent;
  margin-bottom: -1px;
  transition: color 0.15s, border-color 0.15s;
}

.acct-tab:hover {
  color: var(--text-primary);
}

.acct-tab--active {
  color: var(--text-primary);
  border-bottom-color: var(--text-primary);
}

/* Profile card */
.acct-card {
  background-color: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: 12px;
  padding: 20px 24px;
  margin-bottom: 20px;
}

.acct-card__section-title {
  font-size: 1.1rem;
  font-weight: 600;
  color: var(--text-heading);
  margin-bottom: 20px;
}

.acct-card__header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 4px;
}

.acct-card__identity {
  display: flex;
  align-items: center;
  gap: 14px;
}

.acct-card__avatar {
  width: 48px;
  height: 48px;
  border-radius: 50%;
  background-color: var(--color-secondary);
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--text-primary);
  font-size: 1.2rem;
  flex-shrink: 0;
}

.acct-card__name {
  font-size: 1.15rem;
  font-weight: 600;
  color: var(--text-heading);
}

.acct-card__edit-btn {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  width: auto;
  background: none;
  border: 1px solid var(--border-light);
  border-radius: 8px;
  padding: 7px 14px;
  font-size: 0.8rem;
  font-weight: 500;
  color: var(--text-secondary);
  cursor: pointer;
  transition: background-color 0.15s, color 0.15s;
}

.acct-card__edit-btn:hover {
  background-color: var(--bg-hover);
  color: var(--text-primary);
}

.acct-card__divider {
  border-color: var(--border-color);
  margin: 16px 0;
}

.acct-card__fields {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 16px 24px;
}

.acct-card__field {
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.acct-card__field-label {
  font-size: 0.75rem;
  font-weight: 500;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.04em;
}

.acct-card__field-value {
  font-size: 0.875rem;
  color: var(--text-primary);
}

.acct-verified {
  color: var(--color-success);
  font-weight: 500;
}

.acct-unverified {
  color: var(--color-warning);
  font-weight: 500;
  text-decoration: none;
}

.acct-unverified:hover {
  text-decoration: underline;
}

.acct-form .form-label {
  font-size: 0.8rem;
  color: var(--text-secondary);
  margin-bottom: 4px;
}

/* ── Password change card ─────────────────────────────────────────── */
.pwd-card { padding: 20px 24px; }

.pwd-form {
  display: flex;
  flex-direction: column;
  gap: 20px;
}

/* Top row: current password (left) + buttons (right) */
.pwd-row-top {
  display: flex;
  align-items: flex-end;
  gap: 16px;
}

.pwd-row-top > .pwd-field {
  flex: 0 0 340px;
}

/* Bottom row: new + confirm side by side */
.pwd-row-bottom {
  display: flex;
  gap: 16px;
}

.pwd-row-bottom > .pwd-field {
  flex: 1;
  min-width: 0;
}

.pwd-label {
  display: block;
  font-size: 0.8rem;
  font-weight: 500;
  color: var(--text-secondary);
  margin-bottom: 6px;
}

/* Input + eye button side-by-side, eye overlaid on the right */
.pwd-input-group {
  position: relative;
  display: block;
}

.pwd-input-group > input.form-control {
  display: block !important;
  width: 100% !important;
  padding-right: 2.5rem !important;
  box-sizing: border-box;
}

.pwd-eye-btn {
  position: absolute;
  top: 50%;
  right: 10px;
  transform: translateY(-50%);
  background: transparent;
  border: none;
  padding: 0;
  margin: 0;
  color: var(--text-muted);
  cursor: pointer;
  font-size: 0.875rem;
  line-height: 1;
  z-index: 3;
}

.pwd-eye-btn:hover { color: var(--text-secondary); }
.pwd-eye-btn:focus { outline: none; }

.pwd-error {
  font-size: 0.75rem;
  color: #f87171;
  margin-top: 4px;
}

/* Buttons aligned right, vertically centred with the input */
.pwd-actions {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-left: auto;
  flex-shrink: 0;
}

.pwd-btn-submit {
  background-color: #4b5563;
  color: #fff;
  border: none;
  border-radius: 8px;
  padding: 8px 18px;
  font-size: 0.875rem;
  font-weight: 500;
  cursor: pointer;
  white-space: nowrap;
  transition: background-color 0.15s;
}

.pwd-btn-submit:hover { background-color: #374151; }

.pwd-btn-cancel {
  font-size: 0.875rem;
  font-weight: 500;
  color: var(--text-secondary);
  text-decoration: none;
  white-space: nowrap;
}

.pwd-btn-cancel:hover { color: var(--text-primary); }

/* Password rules list */
.pwd-rules {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  flex-wrap: wrap;
  gap: 8px 24px;
}

.pwd-rule {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 0.8rem;
  color: var(--text-muted);
  transition: color 0.15s;
}

.pwd-rule__icon {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  flex-shrink: 0;
  display: inline-block;
}

.pwd-rule__icon--fail { background-color: #f87171; }
.pwd-rule__icon--pass { background-color: #4ade80; }

.pwd-rule--met  { color: #4ade80; }
.pwd-rule--unmet { color: var(--text-muted); }

@media (max-width: 768px) {
  .pwd-row-top  { flex-direction: column; align-items: stretch; }
  .pwd-row-top > .pwd-field { flex: none; width: 100%; }
  .pwd-actions  { margin-left: 0; }
  .pwd-row-bottom { flex-direction: column; }
}

@media (max-width: 768px) {
  .acct-card__fields { grid-template-columns: repeat(2, 1fr); }
}

@media (max-width: 480px) {
  .acct-card__fields { grid-template-columns: 1fr; }
}

/* ── Unauthenticated pages (login, password reset, etc.) ─────────── */
.unauth-wrapper {
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  background-color: var(--bg-body);
  padding: 2rem;
}


/* ── Login Page ──────────────────────────────────────────────────── */
.login-page {
  display: flex;
  min-height: 100vh;
}

/* ── Left panel ── */
.login-panel--form {
  width: 600px;
  flex-shrink: 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  padding: 48px 52px;
  background-color: var(--bg-body);
}

.login-logo {
  margin-bottom: 28px;
}

.login-logo img {
  height: 88px;
  width: auto;
}

.login-title {
  font-size: 1.4rem;
  font-weight: 700;
  color: var(--text-heading);
  text-align: center;
  margin-bottom: 6px;
}

.login-subtitle {
  font-size: 0.85rem;
  color: var(--text-muted);
  text-align: center;
  margin-bottom: 28px;
}

/* Form */
.login-form {
  width: 100%;
  display: flex;
  flex-direction: column;
}

/* Field wrapper */
.login-field {
  margin-bottom: 16px;
}

.login-field__label {
  display: block;
  font-size: 0.8rem;
  font-weight: 600;
  color: var(--text-secondary);
  margin-bottom: 6px;
}

/* Input wrapper (for eye toggle) */
.login-field__input-wrap {
  position: relative;
}

.login-field__input-wrap input {
  display: block;
  width: 100%;
  background-color: var(--bg-input) !important;
  border: 1.5px solid var(--border-light) !important;
  border-radius: 8px !important;
  padding: 10px 14px !important;
  font-size: 0.875rem !important;
  color: var(--text-primary) !important;
  -webkit-text-fill-color: var(--text-primary) !important;
  outline: none !important;
  box-shadow: none !important;
  transition: border-color 0.15s;
}

/* Kill browser autofill grey highlight */
.login-field__input-wrap input:-webkit-autofill,
.login-field__input-wrap input:-webkit-autofill:hover,
.login-field__input-wrap input:-webkit-autofill:focus {
  -webkit-box-shadow: 0 0 0 1000px var(--bg-input) inset !important;
  -webkit-text-fill-color: var(--text-primary) !important;
  border-color: var(--border-light) !important;
  caret-color: var(--text-primary);
}

.login-field__input-wrap input:focus {
  border-color: var(--border-focus) !important;
  box-shadow: none !important;
}

.login-field__input-wrap input::placeholder {
  color: var(--text-muted) !important;
  -webkit-text-fill-color: var(--text-muted) !important;
}

/* Red border on error */
.login-field--error .login-field__input-wrap input {
  border-color: var(--color-danger) !important;
}

/* Password wrap: room for eye icon */
.login-field__input-wrap--password {
  position: relative;
}

.login-field__input-wrap--password input {
  padding-right: 44px !important;
}

.login-field__eye {
  position: absolute;
  right: 12px;
  top: 50%;
  transform: translateY(-50%);
  background: none;
  border: none;
  color: var(--text-muted);
  cursor: pointer;
  padding: 0;
  font-size: 0.9rem;
  line-height: 1;
}

.login-field__eye:hover {
  color: var(--text-secondary);
}

/* Field-level error (below input) */
.login-field__error {
  display: flex;
  align-items: center;
  gap: 5px;
  margin-top: 5px;
  font-size: 0.78rem;
  color: var(--color-danger);
  line-height: 1.3;
}

.login-field__error i {
  font-size: 0.8rem;
  flex-shrink: 0;
}

/* Non-field error banner (wrong credentials) */
.login-form__error-banner {
  display: flex;
  align-items: center;
  gap: 8px;
  background-color: rgba(239, 68, 68, 0.1);
  border: 1px solid var(--color-danger);
  border-radius: 8px;
  padding: 10px 14px;
  margin-bottom: 16px;
  font-size: 0.82rem;
  color: var(--color-danger);
}

/* Remember + forgot row */
.login-form__footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 20px;
  margin-top: 4px;
}

.login-remember {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 0.82rem;
  color: var(--text-secondary);
  cursor: pointer;
  user-select: none;
}

.login-remember input[type="checkbox"] {
  width: 15px;
  height: 15px;
  border-radius: 3px !important;
  border: 1.5px solid var(--border-light) !important;
  background-color: var(--bg-input) !important;
  accent-color: var(--color-secondary);
  cursor: pointer;
  flex-shrink: 0;
  margin: 0 !important;
  padding: 0 !important;
}

.login-forgot {
  font-size: 0.82rem;
  color: var(--text-secondary);
  text-decoration: none;
  white-space: nowrap;
}

.login-forgot:hover {
  color: var(--text-primary);
}

/* Login button */
.login-btn {
  width: 100%;
  padding: 12px;
  background-color: var(--color-secondary);
  color: var(--text-primary);
  border: none;
  border-radius: 8px;
  font-size: 0.9rem;
  font-weight: 600;
  cursor: pointer;
  transition: background-color 0.15s;
  letter-spacing: 0.01em;
  text-align: center;
  text-decoration: none;
  display: block;
  box-sizing: border-box;
}

.login-btn:hover {
  background-color: var(--color-secondary-hover);
}

/* Secondary CTA (e.g. "Create an organization" below the primary Login button) */
.login-btn--secondary {
  margin-top: 10px;
  background-color: transparent;
  color: var(--text-primary);
  border: 1.5px solid var(--border-light);
}

.login-btn--secondary:hover {
  background-color: var(--bg-input);
  border-color: var(--border-focus);
}

/* Copyright */
.login-copyright {
  margin-top: auto;
  padding-top: 32px;
  font-size: 0.75rem;
  color: var(--text-muted);
  text-align: center;
}

/* ── Right panel ── */
.login-panel--hero {
  flex: 1;
  background-color: #444444;
  display: flex;
  flex-direction: column;
  align-items: center;
  /* Mark + copy read as one centered block. `space-between` used to pin the
     copy to the bottom edge, leaving a gap under the mark. */
  justify-content: center;
  padding: 48px 40px 40px;
  border-radius: 16px;
  margin: 16px 16px 16px 0;
  overflow: hidden;
}

.login-hero__image {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 100%;
}

.login-hero__image img {
  max-width: 100%;
  max-height: 400px;
  object-fit: contain;
}

/* Hero mark — the giixi logo stands in for the old illustration. It is the
   panel's focal point, so it scales with the panel instead of sitting at a
   fixed size, capped so it never outgrows the copy beneath it. */
.login-hero__image img.login-hero__logo {
  width: min(72%, 460px);
  max-width: 460px;
  max-height: 460px;
  height: auto;
}

.login-hero__text {
  text-align: center;
  padding-top: 24px;
}

.login-hero__text h2 {
  font-size: 1.35rem;
  font-weight: 700;
  color: var(--text-heading);
  margin-bottom: 10px;
}

.login-hero__text p {
  font-size: 0.82rem;
  color: var(--text-secondary);
  max-width: 400px;
  margin: 0 auto 16px;
  line-height: 1.65;
  /* Justified body copy, with the short last line centred so it still reads as
     part of the centred hero block. */
  text-align: justify;
  text-align-last: center;
}

/* Wider left panel for the register flow (multi-step org+team form vs. the
   plain login form) — keeps the same two-panel login layout/design language. */
.login-panel--register {
  width: 860px;
  align-items: stretch;
}

.login-panel--register .login-title,
.login-panel--register .login-subtitle {
  align-self: center;
}

@media (max-width: 768px) {
  .login-panel--hero { display: none; }
  .login-panel--form { width: 100%; padding: 32px 24px; }
}

/* Back to login link */
.login-back {
  margin-top: 20px;
  text-align: center;
}

.login-back a {
  font-size: 0.82rem;
  color: var(--text-muted);
  text-decoration: none;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  transition: color 0.15s;
}

.login-back a:hover {
  color: var(--text-primary);
}

/* Register page: "Already have an account?" rendered as a full secondary
   button, not the muted inline link every other .login-back page uses. */
.login-back a.ox-btn {
  font-size: inherit;
  color: inherit;
}

/* Confirm/success icon circle */
.login-confirm-icon {
  width: 56px;
  height: 56px;
  border-radius: 50%;
  background-color: rgba(107,114,128,0.15);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.4rem;
  color: var(--text-secondary);
  margin: 0 auto 20px;
}

.login-confirm-icon--success {
  background-color: rgba(74,222,128,0.12);
  color: #4ade80;
}

/* ── Phone widget ────────────────────────────────────────────────── */
.phone-input-wrap {
  display: flex;
  gap: 8px;
}

.phone-prefix-select {
  width: 90px !important;
  flex-shrink: 0;
  background-color: var(--bg-input) !important;
  border: 1px solid var(--border-light) !important;
  border-radius: 8px !important;
  padding: 8px 10px !important;
  font-size: 0.875rem !important;
  color: var(--text-primary) !important;
  cursor: pointer;
  appearance: auto;
}

.phone-number-input {
  flex: 1;
  background-color: var(--bg-input) !important;
  border: 1px solid var(--border-light) !important;
  border-radius: 8px !important;
  padding: 8px 12px !important;
  font-size: 0.875rem !important;
  color: var(--text-primary) !important;
  outline: none !important;
  box-shadow: none !important;
}

.phone-number-input:focus {
  border-color: var(--border-focus) !important;
}

.phone-number-input::placeholder {
  color: var(--text-muted) !important;
}

/* ── Edit Profile Modal ──────────────────────────────────────────── */
.edit-modal {
  max-width: 520px;
}

.edit-modal__content {
  background-color: var(--bg-card) !important;
  border: 1px solid var(--border-color) !important;
  border-radius: 14px !important;
  overflow: hidden;
  position: relative;
}

.edit-modal__header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 20px 56px 16px 24px;
  border-bottom: 1px solid var(--border-color);
}

.edit-modal__header-left {
  display: flex;
  align-items: center;
  gap: 12px;
}

.edit-modal__avatar {
  width: 44px;
  height: 44px;
  font-size: 1rem;
  flex-shrink: 0;
}

.edit-modal__title {
  font-size: 1rem;
  font-weight: 600;
  color: var(--text-heading);
  margin: 0 0 2px;
}

.edit-modal__subtitle {
  font-size: 0.75rem;
  color: var(--text-muted);
  margin: 0;
}

.edit-modal__close {
  position: absolute;
  top: 16px;
  right: 18px;
  z-index: 2;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 28px;
  height: 28px;
  background: none;
  border: none;
  color: var(--text-muted);
  font-size: 1rem;
  cursor: pointer;
  padding: 0;
  border-radius: 6px;
  transition: background-color 0.15s, color 0.15s;
  line-height: 1;
}

.edit-modal__close:hover {
  background-color: var(--bg-hover);
  color: var(--text-primary);
}

.edit-modal__body {
  padding: 20px 24px;
  display: flex;
  flex-direction: column;
  gap: 16px;
}

.edit-modal__row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
}

.edit-modal__field {
  display: flex;
  flex-direction: column;
  gap: 5px;
}

.edit-modal__label {
  font-size: 0.78rem;
  font-weight: 600;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.04em;
}

/* Inputs inside modal */
.edit-modal__body input[type="text"],
.edit-modal__body input[type="email"] {
  background-color: var(--bg-input) !important;
  border: 1px solid var(--border-light) !important;
  border-radius: 8px !important;
  padding: 9px 12px !important;
  font-size: 0.875rem !important;
  color: var(--text-primary) !important;
  outline: none !important;
  box-shadow: none !important;
  width: 100%;
  transition: border-color 0.15s;
}

.edit-modal__body input:focus {
  border-color: var(--border-focus) !important;
}

.edit-modal__error {
  font-size: 0.75rem;
  color: var(--color-danger);
  margin: 0;
}

.edit-modal__footer {
  display: flex;
  justify-content: flex-end;
  gap: 10px;
  padding: 16px 24px;
  border-top: 1px solid var(--border-color);
}

.edit-modal__cancel {
  background: none;
  border: 1px solid var(--border-light);
  border-radius: 8px;
  padding: 8px 18px;
  font-size: 0.875rem;
  color: var(--text-secondary);
  cursor: pointer;
  transition: background-color 0.15s;
}

.edit-modal__cancel:hover {
  background-color: var(--bg-hover);
}

.edit-modal__save {
  background-color: var(--color-primary);
  border: none;
  border-radius: 8px;
  padding: 8px 20px;
  font-size: 0.875rem;
  font-weight: 600;
  color: var(--text-primary);
  cursor: pointer;
  transition: background-color 0.15s;
}

.edit-modal__save:hover {
  background-color: var(--color-primary-hover);
}


/* ── Upload / Submit Report Page ─────────────────────────────────── */
.upload-page {
  width: 100%;
  padding-bottom: 40px;
}

.upload-page__title {
  font-size: 1.5rem;
  font-weight: 700;
  color: var(--text-heading);
  margin-bottom: 4px;
}

.upload-page__subtitle {
  font-size: 0.875rem;
  color: var(--text-muted);
  margin: 0 0 12px;
  text-align: left;
}

.upload-page__divider {
  border-color: var(--border-color);
  margin: 0 0 20px;
}

/* ── Controls row ── */
.upload-controls {
  display: flex;
  align-items: flex-end;
  gap: 12px;
  margin-bottom: 16px;
}

.upload-controls__field {
  display: flex;
  flex-direction: column;
  gap: 5px;
  flex: 1;
  min-width: 0;
}

.upload-controls__btn-wrap {
  display: flex;
  flex-direction: column;
  gap: 5px;
  flex-shrink: 0;
}

.upload-controls__label {
  font-size: 0.78rem;
  font-weight: 600;
  color: var(--text-secondary);
  white-space: nowrap;
}

/* Select wrapper */
.upload-select-wrap {
  position: relative;
}

.upload-select,
.upload-select-wrap select {
  width: 100%;
  appearance: none;
  -webkit-appearance: none;
  background-color: var(--bg-card) !important;
  border: 1px solid var(--border-color) !important;
  border-radius: 8px !important;
  padding: 9px 36px 9px 12px !important;
  font-size: 0.875rem !important;
  color: var(--text-primary) !important;
  cursor: pointer;
  outline: none !important;
  box-shadow: none !important;
  transition: border-color 0.15s;
  height: 40px;
}

.upload-select:focus,
.upload-select-wrap select:focus {
  border-color: var(--border-focus) !important;
}

.upload-select-wrap__icon {
  position: absolute;
  right: 11px;
  top: 50%;
  transform: translateY(-50%);
  color: var(--text-muted);
  font-size: 0.7rem;
  pointer-events: none;
}

/* Download Template button */
.upload-template-btn {
  height: 40px;
  background-color: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: 8px;
  padding: 0 18px;
  font-size: 0.875rem;
  font-weight: 500;
  color: var(--text-secondary);
  cursor: not-allowed;
  white-space: nowrap;
  opacity: 0.75;
}

/* ── Main two-column ── */
.upload-main {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
  margin-bottom: 16px;
}

/* Requirements panel */
.upload-requirements {
  background-color: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: 10px;
  padding: 18px 20px;
}

.upload-requirements__title {
  font-size: 0.9rem;
  font-weight: 600;
  color: var(--text-heading);
  margin-bottom: 12px;
}

.upload-requirements__list {
  padding-left: 16px;
  margin: 0;
  display: flex;
  flex-direction: column;
  gap: 7px;
}

.upload-requirements__list li {
  font-size: 0.8rem;
  color: var(--text-secondary);
  line-height: 1.5;
}

.upload-requirements__list li strong {
  color: var(--text-primary);
  font-weight: 600;
}

/* Drop zone */
.upload-dropzone {
  background-color: var(--bg-card);
  border: 1.5px dashed var(--border-light);
  border-radius: 10px;
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 220px;
  cursor: pointer;
  transition: border-color 0.15s, background-color 0.15s;
  position: relative;
  overflow: hidden;
}

.upload-dropzone--drag {
  border-color: var(--color-primary);
  background-color: var(--bg-hover);
}

.upload-dropzone__input {
  display: none;
}

/* Idle state */
.upload-dropzone__idle {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 6px;
  padding: 24px;
  text-align: center;
  pointer-events: none;
}

.upload-dropzone__icon {
  width: 52px;
  height: 52px;
  border: 1.5px solid var(--border-light);
  border-radius: 10px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.3rem;
  color: var(--text-secondary);
  margin-bottom: 4px;
}

.upload-dropzone__drag-text {
  font-size: 0.85rem;
  color: var(--text-secondary);
  margin: 0;
}

.upload-dropzone__or {
  font-size: 0.72rem;
  color: var(--text-muted);
  margin: 2px 0;
}

.upload-dropzone__browse {
  background: none;
  border: none;
  font-size: 1rem;
  font-weight: 700;
  color: var(--text-primary);
  text-decoration: underline;
  cursor: pointer;
  padding: 0;
  pointer-events: all;
}

/* Selected state inside dropzone */
.upload-dropzone__selected {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 20px;
  width: 100%;
}

.upload-dropzone__sel-icon {
  font-size: 1.4rem;
  color: var(--text-secondary);
  flex-shrink: 0;
}

.upload-dropzone__sel-name {
  flex: 1;
  font-size: 0.875rem;
  color: var(--text-primary);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  min-width: 0;
}

.upload-dropzone__sel-clear {
  flex-shrink: 0;
  width: 28px;
  height: 28px;
  background: none;
  border: none;
  color: var(--text-muted);
  font-size: 0.9rem;
  cursor: pointer;
  border-radius: 4px;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: color 0.15s;
  padding: 0;
}

.upload-dropzone__sel-clear:hover {
  color: var(--color-danger);
}

/* ── Upload queue ── */
.upload-queue {
  margin-bottom: 16px;
}

.upload-queue__title {
  font-size: 0.9rem;
  font-weight: 600;
  color: var(--text-heading);
  margin-bottom: 10px;
}

.upload-queue__item {
  display: flex;
  align-items: center;
  gap: 12px;
  background-color: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: 8px;
  padding: 12px 14px;
}

.upload-queue__icon {
  font-size: 1.2rem;
  color: var(--text-secondary);
  flex-shrink: 0;
  width: 20px;
  text-align: center;
}

.upload-queue__body {
  flex: 1;
  min-width: 0;
  display: flex;
  flex-direction: column;
  gap: 7px;
}

.upload-queue__name {
  font-size: 0.82rem;
  color: var(--text-primary);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.upload-queue__bar-track {
  height: 4px;
  background-color: var(--bg-hover);
  border-radius: 2px;
  overflow: hidden;
  width: 100%;
}

.upload-queue__bar {
  height: 100%;
  background-color: var(--color-secondary);
  border-radius: 2px;
  width: 0%;
  transition: width 0.6s ease;
}

.upload-queue__x {
  flex-shrink: 0;
  width: 28px;
  height: 28px;
  background: none;
  border: none;
  color: var(--text-muted);
  font-size: 0.9rem;
  cursor: pointer;
  border-radius: 4px;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 0;
  transition: color 0.15s;
}

.upload-queue__x:hover {
  color: var(--color-danger);
}

/* ── Error states ── */
.upload-field-error {
  font-size: 0.78rem;
  color: var(--color-danger);
  margin: 4px 0 0;
  display: flex;
  align-items: center;
  gap: 4px;
}

.upload-error-banner {
  display: flex;
  align-items: center;
  gap: 8px;
  background-color: rgba(239,68,68,0.1);
  border: 1px solid var(--color-danger);
  border-radius: 8px;
  padding: 10px 14px;
  margin-bottom: 14px;
  font-size: 0.82rem;
  color: var(--color-danger);
}

/* ── Footer ── */
.upload-footer {
  display: flex;
  justify-content: flex-end;
  align-items: center;
  gap: 10px;
}

.upload-footer__cancel {
  font-size: 0.875rem;
  color: var(--text-secondary);
  text-decoration: none;
  padding: 9px 20px;
  border-radius: 8px;
  transition: color 0.15s;
}

.upload-footer__cancel:hover {
  color: var(--text-primary);
}

.upload-footer__submit {
  background-color: var(--color-secondary);
  color: var(--text-primary);
  border: none;
  width: 10rem;
  border-radius: 8px;
  padding: 9px 22px;
  font-size: 0.875rem;
  font-weight: 600;
  cursor: pointer;
  transition: background-color 0.15s;
  white-space: nowrap;
}

.upload-footer__submit:hover {
  background-color: var(--color-secondary-hover);
}

.upload-footer__submit:disabled {
  opacity: 0.6;
  cursor: not-allowed;
}

@media (max-width: 768px) {
  .upload-main     { grid-template-columns: 1fr; }
  .upload-controls { flex-wrap: wrap; }
}

.upload-select--error,
.upload-select--error.upload-select {
  border-color: var(--color-danger) !important;
}


/* ── Organization creation stepper ─────────────────────────────────────── */

.stepper {
  display: flex;
  align-items: flex-start;
  gap: 0;
  margin-bottom: 2.5rem;
  position: relative;
}

/* Connecting line behind the circles */
.stepper::before {
  content: '';
  position: absolute;
  top: 18px;
  left: 18px;
  right: 18px;
  height: 2px;
  background: var(--border-light);
  z-index: 0;
}

.stepper__step {
  display: flex;
  flex-direction: column;
  align-items: center;
  flex: 1;
  position: relative;
  z-index: 1;
}

.stepper__circle {
  width: 36px;
  height: 36px;
  border-radius: 50%;
  border: 2px solid var(--border-light);
  background: var(--bg-card);
  color: var(--text-muted);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 0.8rem;
  font-weight: 600;
  transition: background 0.2s, border-color 0.2s, color 0.2s;
  flex-shrink: 0;
}

.stepper__step--active .stepper__circle {
  background: var(--color-primary);
  border-color: var(--color-primary);
  color: var(--text-primary);
}

.stepper__step--done .stepper__circle {
  background: var(--badge-approved);
  border-color: var(--badge-approved);
  color: #166534;
}

.stepper__label {
  margin-top: 0.5rem;
  font-size: 0.72rem;
  font-weight: 500;
  color: var(--text-muted);
  text-align: center;
  white-space: nowrap;
}

.stepper__step--active .stepper__label {
  color: var(--text-primary);
}

.stepper__step--done .stepper__label {
  color: var(--text-secondary);
}

/* Service cards in step 3 */
.service-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
  gap: 1rem;
}

.service-card {
  border: 2px solid var(--border-color);
  border-radius: 8px;
  padding: 1.25rem;
  background: var(--bg-card-secondary);
  cursor: pointer;
  transition: border-color 0.15s, background 0.15s;
  position: relative;
  user-select: none;
}

.service-card:hover:not(.service-card--disabled) {
  border-color: var(--color-primary);
  background: var(--bg-hover);
}

.service-card--selected {
  border-color: var(--badge-approved) !important;
  background: rgba(125, 215, 119, 0.06) !important;
}

.service-card--disabled {
  opacity: 0.45;
  cursor: not-allowed;
}

.service-card__check {
  position: absolute;
  top: 0.75rem;
  right: 0.75rem;
  width: 18px;
  height: 18px;
  border-radius: 50%;
  border: 2px solid var(--border-light);
  background: transparent;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 0.65rem;
  transition: background 0.15s, border-color 0.15s;
}

.service-card--selected .service-card__check {
  background: var(--badge-approved);
  border-color: var(--badge-approved);
  color: #166534;
}

.service-card__icon {
  font-size: 1.5rem;
  margin-bottom: 0.6rem;
  color: var(--text-secondary);
}

.service-card--selected .service-card__icon {
  color: var(--badge-approved);
}

.service-card__name {
  font-weight: 600;
  font-size: 0.9rem;
  color: var(--text-primary);
  margin-bottom: 0.2rem;
}

.service-card__desc {
  font-size: 0.75rem;
  color: var(--text-muted);
}

.service-card__badge {
  display: inline-block;
  margin-top: 0.5rem;
  font-size: 0.65rem;
  padding: 0.15rem 0.45rem;
  border-radius: 999px;
  background: var(--badge-pending);
  color: var(--text-pending);
  font-weight: 600;
  letter-spacing: 0.03em;
}

/* Pending approvals banner */
.rl-pending-approvals {
  border: 1px solid color-mix(in oklab, #f59e0b 35%, transparent);
  border-radius: 12px; overflow: hidden;
  background: color-mix(in oklab, #f59e0b 5%, var(--bg-card));
}
.rl-pending-approvals--clickable {
  color: inherit;
  transition: border-color 0.15s, background 0.15s;
}
.rl-pending-approvals--clickable:hover {
  border-color: color-mix(in oklab, #f59e0b 55%, transparent);
  background: color-mix(in oklab, #f59e0b 8%, var(--bg-card));
}
.request-chip {
  display: inline-flex;
  align-items: center;
  gap: 0.25rem;
  background: color-mix(in oklab, #f59e0b 14%, transparent);
  color: #f59e0b;
  font-size: 0.72rem;
  font-weight: 700;
  padding: 0.2rem 0.6rem;
  border-radius: 999px;
}
.request-chip--purple {
  background: color-mix(in oklab, #a78bfa 14%, transparent);
  color: #a78bfa;
}
.request-chip--blue {
  background: color-mix(in oklab, #60a5fa 14%, transparent);
  color: #60a5fa;
}
.request-chip--red {
  background: color-mix(in oklab, #f87171 14%, transparent);
  color: #f87171;
}
.rl-pending-approvals__head {
  display: flex; align-items: center; gap: 0.6rem;
  padding: 0.75rem 1.25rem;
  background: color-mix(in oklab, #f59e0b 10%, transparent);
  border-bottom: 1px solid color-mix(in oklab, #f59e0b 25%, transparent);
  font-size: 0.82rem; font-weight: 700; color: #f59e0b;
}
.rl-pending-approvals__list { display: flex; flex-direction: column; }
.rl-pending-item {
  display: flex; align-items: center; justify-content: space-between; gap: 1rem;
  padding: 0.85rem 1.25rem;
  border-bottom: 1px solid var(--border-color);
  text-decoration: none; color: var(--text-secondary);
  transition: background 0.15s;
}
.rl-pending-item:last-child { border-bottom: none; }
.rl-pending-item:hover { background: var(--bg-hover); text-decoration: none; }
.rl-pending-item__info { display: flex; flex-direction: column; gap: 2px; }
.rl-pending-item__type { font-size: 0.875rem; font-weight: 600; color: var(--text-primary); }
.rl-pending-item__user { font-size: 0.78rem; color: var(--text-muted); }
.rl-pending-item__meta { display: flex; align-items: center; gap: 1rem; flex-shrink: 0; }
.rl-pending-item__date { font-size: 0.78rem; color: var(--text-muted); }
.rl-pending-item__action { font-size: 0.78rem; font-weight: 600; color: #f59e0b; display: flex; align-items: center; gap: 4px; }

/* ============================================================
   Light theme — fixes for hardcoded literals that bypass the token
   system (core chrome itself flips via ir-tokens.css). Covers the main
   shell, auth pages and footer. ponytail: per-module light tuning
   (orgx, live-roi, report-viewer, IR status chips) is deferred.
   ============================================================ */

/* Dark theme inverts Bootstrap's dark chevron; light wants it as-is. */
:root[data-bs-theme="light"] .accordion-button::after { filter: none; }

/* Sidebar hover/active pill: in light mode the plain hover/active background
   tokens (--bg-hover/--color-primary) render icon+label in dark ink on a
   medium/gray fill — force white so both stay legible, matching how they
   already render in dark mode (where --text-primary is already near-white). */
/* --color-secondary (#52525b, a fixed medium-dark gray) is never redefined
   under light mode, but --text-primary correctly flips to dark ink there —
   dark-on-dark-gray for these two labels. Force white in light mode. */
:root[data-bs-theme="light"] .rl-status-tab--active .rl-status-tab__count,
:root[data-bs-theme="light"] .rl-refine-bar .rl-refine-apply {
  color: #fff;
}

/* Same issue for the "New Incident" / "New SCST report" primary buttons
   (.rl-btn-primary): --color-primary is the accent, never redefined under
   light, so dark ink from --text-primary reads dark-on-slate. */
:root[data-bs-theme="light"] .rl-btn-primary,
:root[data-bs-theme="light"] .rl-btn-primary:hover {
  color: #fff;
}

/* Same again for the plain Bootstrap .btn-primary (e.g. "Manage Two-Factor
   Settings"). Hardcoded + !important, matching the upload-page file-name
   fix — the var(--text-primary) chain should already resolve to white here
   in theory, but something in the cascade keeps winning regardless. */
:root[data-bs-theme="light"] .btn-primary,
:root[data-bs-theme="light"] .btn-primary:hover,
:root[data-bs-theme="light"] .btn-primary:focus {
  color: #fff !important;
}

:root[data-bs-theme="light"] .sidebar-nav a:hover,
:root[data-bs-theme="light"] .sidebar-nav .sidebar-toggle:hover,
:root[data-bs-theme="light"] .sidebar-nav li.active > a {
  background-color: var(--accent);
  color: var(--accent-ink);
}

/* Dashboard widget action buttons (View all / eye / X / drag handle) are
   near-white on a near-transparent background — tuned for the dark card,
   invisible on a light one. */
:root[data-bs-theme="light"] .db-summary-card__link,
:root[data-bs-theme="light"] .db-card__link {
  color: #334155;
  background: rgba(100, 116, 139, 0.08);
  border-color: rgba(100, 116, 139, 0.3);
}
:root[data-bs-theme="light"] .db-summary-card__link:hover,
:root[data-bs-theme="light"] .db-card__link:hover {
  color: #0f172a;
  background: rgba(100, 116, 139, 0.16);
  border-color: rgba(71, 85, 105, 0.45);
}
:root[data-bs-theme="light"] .db-widget__remove,
:root[data-bs-theme="light"] .db-widget__handle {
  color: #475569;
  background: rgba(100, 116, 139, 0.08);
  border-color: rgba(100, 116, 139, 0.28);
}
:root[data-bs-theme="light"] .db-widget__handle:hover,
:root[data-bs-theme="light"] .db-widget__handle:focus-visible {
  color: #0f172a;
  background: rgba(100, 116, 139, 0.16);
  border-color: rgba(71, 85, 105, 0.4);
}
:root[data-bs-theme="light"] .db-widget__remove:hover,
:root[data-bs-theme="light"] .db-widget__remove:focus-visible {
  color: #dc2626;
  background: rgba(220, 38, 38, 0.08);
  border-color: rgba(220, 38, 38, 0.3);
}

:root[data-bs-theme="light"] input:disabled,
:root[data-bs-theme="light"] select:disabled,
:root[data-bs-theme="light"] textarea:disabled,
:root[data-bs-theme="light"] .form-control:disabled,
:root[data-bs-theme="light"] .form-select:disabled {
  background-color: #e9ecef !important;
  color: #6b7280 !important;
  border-color: #ced4da !important;
}

/* Footer ships its own private dark palette — relight its vars. */
:root[data-bs-theme="light"] .site-footer {
  --sf-bg: #f7f7f8;
  --sf-line: #e4e4e7;
  --sf-line-2: #d4d4d8;
  --sf-panel: #ffffff;
  --sf-text: #18181b;
  --sf-text-2: #52525b;
  --sf-text-3: #71717a;
}



.sidebar-group-label {
  margin-left: 25px !important;
    font-size: 11px !important;
    font-weight: bold !important;
}

.sidebar-l2 {
  margin-left:10px !important;
  font-size:13px !important;
  font-weight: bold !important;
}

.req-dot {
  color: #b53434 !important;
}


.inp{
  width: 100% !important;
}

/* Logo art is white-on-transparent — invisible on white. brightness(0)
   renders it solid black. ponytail: swap for a real dark-ink asset when
   design provides one. */
:root[data-bs-theme="light"] .sidebar__logo img,
:root[data-bs-theme="light"] .login-hero__logo,
:root[data-bs-theme="light"] .login-logo img { filter: brightness(0); }

/* Auth pages need their own light treatment. The default hero is deliberately
   dark for dark mode; without this override light mode renders dark text on
   that same dark panel. */
:root[data-bs-theme="light"] .login-page {
  background: #f4f4f5;
}

:root[data-bs-theme="light"] .login-panel--form {
  background: #f4f4f5;
}

:root[data-bs-theme="light"] .login-title {
  color: #18181b;
}

:root[data-bs-theme="light"] .login-subtitle,
:root[data-bs-theme="light"] .login-copyright {
  color: #71717a;
}

:root[data-bs-theme="light"] .login-field__label,
:root[data-bs-theme="light"] .login-remember,
:root[data-bs-theme="light"] .login-forgot,
:root[data-bs-theme="light"] .login-back a {
  color: #52525b;
}

:root[data-bs-theme="light"] .login-field__input-wrap input {
  background-color: #ffffff !important;
  border-color: #d4d4d8 !important;
  color: #18181b !important;
  -webkit-text-fill-color: #18181b !important;
}

:root[data-bs-theme="light"] .login-field__input-wrap input:-webkit-autofill,
:root[data-bs-theme="light"] .login-field__input-wrap input:-webkit-autofill:hover,
:root[data-bs-theme="light"] .login-field__input-wrap input:-webkit-autofill:focus {
  -webkit-box-shadow: 0 0 0 1000px #ffffff inset !important;
  -webkit-text-fill-color: #18181b !important;
  border-color: #d4d4d8 !important;
  caret-color: #18181b;
}

:root[data-bs-theme="light"] .login-field__input-wrap input:focus {
  border-color: #52525b !important;
}

:root[data-bs-theme="light"] .login-remember input[type="checkbox"] {
  background-color: #ffffff !important;
  border-color: #d4d4d8 !important;
  accent-color: #52525b;
}

:root[data-bs-theme="light"] .login-btn {
  background-color: #3f3f46;
  color: #ffffff;
}

:root[data-bs-theme="light"] .login-btn:hover,
:root[data-bs-theme="light"] .login-btn:focus {
  background-color: #27272a;
  color: #ffffff;
}

:root[data-bs-theme="light"] .login-panel--hero {
  background: linear-gradient(135deg, #ffffff 0%, #f7f7f8 100%);
  border: 1px solid #e4e4e7;
  box-shadow: 0 18px 48px -30px rgba(24, 24, 27, 0.35);
}

:root[data-bs-theme="light"] .login-hero__text h2 {
  color: #18181b;
}

:root[data-bs-theme="light"] .login-hero__text p {
  color: #52525b;
}

/* Deep-linked pricing card (hub's ?focus=<package code>) — a brief ring so it
   is obvious which card the link meant, then back to normal. */
.pricing-card--focused {
  animation: pricing-card-focus 2.4s ease-out 1;
}

@keyframes pricing-card-focus {
  0%, 60% { box-shadow: 0 0 0 2px var(--color-primary), 0 8px 28px rgba(0, 0, 0, 0.35); }
  100%    { box-shadow: 0 0 0 0 transparent, 0 0 0 transparent; }
}

/* ── Dashboard: one section per purchased product ───────────────────────── */

/* Each product is a full-width band of its own, stacked one per row: a
   surface, its own header, and its widgets inside. The band is what separates
   DORA from Reporting at a glance — without it the two run together into one
   column of boxes, which is what a header alone could not fix. */
.db-section {
  display: flex;
  flex-direction: column;
  gap: 1rem;
  width: 100%;
  padding: 1.25rem 1.35rem 1.4rem;
  border-radius: 18px;
  border: 1px solid var(--border-color);
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.022), rgba(255, 255, 255, 0) 120px),
    var(--bg-card-secondary);
  position: relative;
}

/* Product heading: a status dot, the name, and a one-line reminder of what the
   section covers, with a rule that runs out to the right edge. The dot is the
   only per-product colour left on the page — the band's coloured top hairline
   was removed on request. */
.db-section__head {
  display: flex;
  align-items: center;
  gap: 0.65rem;
  padding-bottom: 0.8rem;
  border-bottom: 1px solid var(--border-color);
}

.db-section__accent {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background-color: var(--text-muted);
  flex: 0 0 auto;
}

/* A soft halo rather than a flat dot, so the accent reads as a status light
   at the head of the band instead of a stray bullet. */
.db-section--dora      .db-section__accent { background-color: #60a5fa; box-shadow: 0 0 10px rgba(96, 165, 250, 0.55); }
.db-section--platform  .db-section__accent { background-color: #2f7fd1; box-shadow: 0 0 10px rgba(47, 127, 209, 0.55); }
.db-section--reporting .db-section__accent { background-color: #fbbf24; box-shadow: 0 0 10px rgba(251, 191, 36, 0.55); }
.db-section--grc       .db-section__accent { background-color: #4ade80; box-shadow: 0 0 10px rgba(74, 222, 128, 0.55); }
.db-section--tools     .db-section__accent { background-color: #a78bfa; box-shadow: 0 0 10px rgba(167, 139, 250, 0.55); }


.db-section__title {
  font-size: 0.85rem;
  font-weight: 700;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--text-primary);
  margin: 0;
}

.db-section__meta {
  font-size: 0.74rem;
  color: var(--text-muted);
  margin-left: auto;
  text-align: right;
}

.db-widget { position: relative; }

@media (max-width: 700px) {
  .db-section__meta { display: none; }
}


/* ── Dashboard status donuts ────────────────────────────────────────────── */

/* Status palette, validated with the dataviz validator against this card
   surface (#30302e, dark mode):
     node scripts/validate_palette.js "#149e63,#d97706,#d12a66" \
          --mode dark --surface "#30302e"   →  ALL CHECKS PASS
   Two results constrain the design and must not be undone:
   - amber↔green sits at CVD ΔE 7.4, inside the 6–8 floor band, which is legal
     only with secondary encoding — hence the 2px surface gaps between arcs
     and the labelled legend under every ring.
   - the critical step is 2.67:1 on this surface, a contrast WARN that
     obligates visible labels. The legend carries them; never drop it.
   The ring is a donut rather than a pie because the hole is doing real work:
   it holds the headline figure, so the count and its split read as one mark. */
.db-chart {
  --db-good: #149e63;
  --db-warning: #d97706;
  --db-critical: #d12a66;
  /* The remainder on a progress ring. A neutral, deliberately NOT a fourth
     status step — "not finished yet" is not a warning. */
  --db-rest: #6b7280;

  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.75rem;
  margin-top: 1rem;
}

/* The plot is the positioning context for both the hole and the tooltip. */
.db-chart__plot {
  position: relative;
  width: 128px;
  height: 128px;
  flex: 0 0 auto;
}

/* Rotated so the first arc starts at twelve o'clock. Rotating the <svg>
   rather than each arc keeps the hole upright — it is an HTML overlay, not
   an SVG child, so it never inherits the rotation. */
.db-donut {
  width: 100%;
  height: 100%;
  transform: rotate(-90deg);
  overflow: visible;
}

.db-donut__track {
  fill: none;
  stroke: var(--bg-card-secondary);
  stroke-width: 18;
}

.db-donut--empty .db-donut__track { opacity: 0.6; }

.db-donut__seg {
  fill: none;
  stroke-width: 18;
  stroke-linecap: butt;
  stroke-dasharray: var(--db-dash) var(--db-gap);
  transition: stroke-width 0.18s ease, opacity 0.18s ease;
  cursor: default;
}

.db-donut__seg--good     { stroke: var(--db-good); }
.db-donut__seg--warning  { stroke: var(--db-warning); }
.db-donut__seg--critical { stroke: var(--db-critical); }
.db-donut__seg--rest     { stroke: var(--db-rest); }

/* Hover grows the arc outward rather than brightening it: a thin ring is a
   poor hit target, and the growth is what confirms which arc is being read. */
.db-donut__seg--active { stroke-width: 24; }

/* Everything else recedes while one arc is held, so a 3% sliver is legible. */
.db-chart--focused .db-donut__seg:not(.db-donut__seg--active) { opacity: 0.32; }

/* ── Hole: the figure the card leads with ── */
.db-donut__hole {
  position: absolute;
  inset: 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 0.1rem;
  pointer-events: none;
}

.db-chart__value {
  font-size: 1.85rem;
  font-weight: 700;
  line-height: 1;
  letter-spacing: -0.03em;
  color: var(--text-primary);
  font-variant-numeric: tabular-nums;
}

.db-chart__unit {
  font-size: 0.62rem;
  font-weight: 600;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--text-muted);
  text-align: center;
}

/* ── Hover tooltip ── */
.db-chart__tip {
  position: absolute;
  z-index: 6;
  padding: 4px 9px;
  border-radius: 6px;
  background-color: var(--bg-body);
  border: 1px solid var(--border-light);
  color: var(--text-primary);
  font-size: 0.7rem;
  font-weight: 600;
  white-space: nowrap;
  pointer-events: none;
  transform: translate(-50%, calc(-100% - 10px));
  box-shadow: 0 4px 14px rgba(0, 0, 0, 0.3);
}

.db-chart__tip[hidden] { display: none; }

/* The legend is the identity channel — required here, see the note above. */
.db-chart__legend {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 0.3rem 1.1rem;
  list-style: none;
  margin: 0;
  padding: 0;
}

.db-chart__key {
  display: flex;
  align-items: center;
  gap: 0.35rem;
  font-size: 0.72rem;
  border-radius: 4px;
  padding: 1px 4px;
  transition: background-color 0.15s ease;
  cursor: default;
}

.db-chart__key--active { background-color: var(--bg-hover); }

.db-chart__swatch {
  width: 8px;
  height: 8px;
  border-radius: 2px;
  flex: 0 0 auto;
}

.db-chart__swatch--good     { background-color: var(--db-good); }
.db-chart__swatch--warning  { background-color: var(--db-warning); }
.db-chart__swatch--critical { background-color: var(--db-critical); }
.db-chart__swatch--rest     { background-color: var(--db-rest); }

/* Values and labels wear text tokens, never the series colour. */
.db-chart__key-value {
  font-weight: 700;
  color: var(--text-primary);
  font-variant-numeric: tabular-nums;
}

.db-chart__key-name { color: var(--text-muted); }

.db-chart__note,
.db-chart__none {
  margin: 0;
  font-size: 0.72rem;
  color: var(--text-muted);
  text-align: center;
}

/* The way into the audit the ring is counting. */
.db-chart__actions {
  display: flex;
  justify-content: center;
  margin-top: 0.6rem;
}

/* The ring must not be clipped by the card, or the tooltip above it is cut. */
.db-summary-card { overflow: visible; }


/* ── Dashboard tables: the five latest actions in a section ─────────────── */

/* The body of a table card loses the generous bottom padding a card of loose
   content wants — a table brings its own rhythm and would otherwise float. */
.db-card__body--table { padding: 0; }

.db-table-wrap {
  width: 100%;
  overflow-x: auto;
}

.db-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.8rem;
}

.db-table thead th {
  position: sticky;
  top: 0;
  padding: 0.6rem 1.15rem;
  text-align: left;
  font-size: 0.64rem;
  font-weight: 700;
  letter-spacing: 0.07em;
  text-transform: uppercase;
  color: var(--text-muted);
  background-color: var(--bg-card);
  border-bottom: 1px solid var(--border-color);
  white-space: nowrap;
}

.db-table td {
  padding: 0.65rem 1.15rem;
  border-bottom: 1px solid var(--border-color);
  vertical-align: middle;
}

.db-table tbody tr:last-child td { border-bottom: none; }

/* A row lifts on hover with a coloured edge rather than a fill, so the status
   badges inside it keep the contrast they were validated at. */
.db-table__row {
  transition: background-color 0.15s ease, box-shadow 0.15s ease;
}

.db-table__row:hover {
  background-color: var(--bg-hover);
  box-shadow: inset 2px 0 0 var(--color-primary);
}

.db-table__main {
  display: flex;
  flex-direction: column;
  gap: 0.15rem;
  max-width: 22rem;
}

.db-table__link {
  font-weight: 600;
  color: var(--text-primary);
  text-decoration: none;
  overflow-wrap: anywhere;
}

.db-table__link:hover { color: var(--color-primary); text-decoration: underline; }

.db-table__sub {
  font-size: 0.72rem;
  color: var(--text-muted);
}

.db-table__muted {
  color: var(--text-muted);
  overflow-wrap: anywhere;
}

.db-table__num {
  text-align: right;
  white-space: nowrap;
  font-variant-numeric: tabular-nums;
}


/* ── GRC: one panel per claimed framework ───────────────────────────────── */

.db-fw-stack {
  display: flex;
  flex-direction: column;
  gap: 0.85rem;
}

.db-fw-panel {
  background-color: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: 14px;
  overflow: hidden;
  transition: border-color 0.15s ease, box-shadow 0.15s ease, transform 0.15s ease;
}

.db-fw-panel:hover {
  border-color: var(--border-light);
  transform: translateY(-2px);
  box-shadow: 0 10px 28px rgba(0, 0, 0, 0.26);
}

.db-fw-panel__head {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  padding: 0.85rem 1.15rem;
  border-bottom: 1px solid var(--border-color);
}

.db-fw-panel__identity {
  display: flex;
  flex-direction: column;
  gap: 0.1rem;
  min-width: 0;
}

.db-fw-panel__name {
  font-size: 0.9rem;
  font-weight: 700;
  color: var(--text-primary);
  overflow-wrap: anywhere;
}

.db-fw-panel__category {
  font-size: 0.68rem;
  font-weight: 600;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--text-muted);
}

.db-fw-panel__head .db-widget__actions { margin-left: auto; }

/* Three columns that each own one question — how far along, what to do next,
   what moved last. The ring column is fixed because a donut has one good size;
   the journey and the table share what is left, with the table taking more
   since it carries five rows of text. */
.db-fw-panel__body {
  display: grid;
  grid-template-columns: 200px minmax(240px, 1fr) minmax(300px, 1.4fr);
  /* One shared label row, then the content row. The columns take their rows
     from this grid (subgrid below), so a label that wraps — "ISO 27001
     requirements assessed" does, in a 200px column, while "DORA requirements
     assessed" doesn't — still leaves all three columns starting their content
     on the same line instead of one sitting a line lower than its neighbours.
     Row gap is 0: the label's own margin-bottom is the gap, and the same
     0.55rem then separates every label from its content. */
  grid-template-rows: auto 1fr;
  gap: 0 1.1rem;
  padding: 1.1rem 1.15rem 1.2rem;
}

.db-fw-panel__col {
  min-width: 0;
  display: grid;
  grid-template-rows: subgrid;
  grid-row: span 2;
}

/* The table drops to a full-width row of its own under the other two, so it
   leaves the shared label row to the pair that is still side by side. Its own
   margin puts back the vertical gap that row-gap: 0 above gave up. */
@media (max-width: 1100px) {
  .db-fw-panel__body { grid-template-columns: 200px 1fr; }
  .db-fw-panel__col--reqs {
    grid-column: 1 / -1;
    grid-row: auto;
    display: block;
    margin-top: 1.1rem;
  }
}

/* Stacked one per row: no column sits beside another, so there is nothing to
   line up and each column goes back to a plain block with the row gap back. */
@media (max-width: 720px) {
  .db-fw-panel__body { grid-template-columns: 1fr; grid-template-rows: auto; row-gap: 1.1rem; }
  .db-fw-panel__col { display: block; grid-row: auto; }
  .db-fw-panel__col--reqs { grid-column: auto; margin-top: 0; }
}

.db-fw-panel__label {
  margin: 0 0 0.5rem;
  font-size: 0.64rem;
  font-weight: 700;
  letter-spacing: 0.07em;
  text-transform: uppercase;
  color: var(--text-muted);
}

.db-fw-panel__col--chart .db-chart { margin-top: 0.3rem; }

/* A column waiting on the GRC vendor, and one whose fetch failed. Both stay
   inside their own column: the rest of the panel is already on screen. */
/* `text-align: left` is not redundant: this file carries a global
   `p { text-align: center }` from the marketing-style pages, and every line a
   column writes is a <p>. Centred, the message drifts into the middle of its
   column, away from the accent bar on its own left edge and out of line with
   the label above it — and it drifts further the wider the column, so the
   three columns never line up with each other. */
.db-fw-panel__loading {
  margin: 0;
  font-size: 0.78rem;
  color: var(--text-muted);
  text-align: left;
}

.db-fw-panel__fail {
  margin: 0;
  font-size: 0.78rem;
  color: var(--text-muted);
  border-left: 2px solid var(--db-critical, #d12a66);
  padding-left: 0.6rem;
  text-align: left;
}

/* Same global `p` rule, for the journey column's "Journey not started." and
   "No guided journey for this framework yet.". */
.db-fw-panel .db-empty-text { text-align: left; }

/* The requirement table sits inside a column, not a card, so it carries its
   own hairline instead of the card edge it would normally lean on. */
.db-fw-panel__col--reqs .db-table-wrap {
  border: 1px solid var(--border-color);
  border-radius: 10px;
  overflow: hidden;
}

.db-fw-panel__col--reqs .db-table thead th,
.db-fw-panel__col--reqs .db-table td { padding-left: 0.75rem; padding-right: 0.75rem; }


/* ── GRC: the guided journey strip ──────────────────────────────────────── */

.db-journey {
  display: flex;
  flex-direction: column;
  gap: 0.7rem;
}

.db-journey__meter {
  display: flex;
  flex-direction: column;
  gap: 0.3rem;
}

.db-journey__track {
  height: 6px;
  border-radius: 3px;
  background-color: var(--bg-card-secondary);
  overflow: hidden;
}

.db-journey__fill {
  display: block;
  height: 100%;
  width: var(--db-pct, 0%);
  border-radius: 3px;
  background-color: var(--db-good, #149e63);
}

.db-journey__count {
  font-size: 0.72rem;
  color: var(--text-muted);
  font-variant-numeric: tabular-nums;
}

.db-journey__step {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.4rem;
}

.db-journey__label {
  font-size: 0.62rem;
  font-weight: 700;
  letter-spacing: 0.07em;
  text-transform: uppercase;
  color: var(--text-muted);
  flex: 0 0 100%;
}

.db-journey__title {
  font-size: 0.82rem;
  font-weight: 600;
  color: var(--text-primary);
  overflow-wrap: anywhere;
}

.db-journey__title--none { font-weight: 500; color: var(--text-muted); }

/* Why "Next step" points at the audit once every journey step is done. */
.db-journey__hint {
  flex: 0 0 100%;
  font-size: 0.72rem;
  line-height: 1.45;
  color: var(--text-muted);
}

/* The two journey actions are a matched pair — same height, same line,
   sized to their labels — so neither reads as the more important one. They
   wrap to a second line only when the column is genuinely too narrow. */
.db-journey__actions {
  display: flex;
  flex-wrap: wrap;
  align-items: stretch;
  gap: 0.45rem;
  margin-top: 0.4rem;
}

.db-journey__actions .db-btn {
  flex: 0 1 auto;
  min-height: 32px;
  white-space: nowrap;
}

/* Small action buttons, local to the dashboard — the orgx button tokens live
   in the GRC stylesheet, which this page does not load. */
.db-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.35rem;
  /* style.css ships a bare `button { width:100%; padding:.75rem; margin-top:1.5rem }`
     rule (see the global form styles near the top of this file). Without
     these three resets a <button class="db-btn"> stretches to the full column
     while an <a class="db-btn"> beside it stays its natural size — which is
     exactly how "Complete step" ended up a full-width slab above a small
     "Go to next step" link. */
  width: auto;
  margin: 0;
  padding: 0.35rem 0.75rem;
  border-radius: 7px;
  border: 1px solid transparent;
  font-size: 0.74rem;
  font-weight: 600;
  text-decoration: none;
  cursor: pointer;
  transition: transform 0.12s ease, filter 0.15s ease, background-color 0.15s ease;
}

.db-btn:hover { transform: translateY(-1px); text-decoration: none; }
.db-btn:active { transform: translateY(0); }
.db-btn:disabled { opacity: 0.6; cursor: default; transform: none; }

.db-btn--primary {
  background-color: var(--color-primary);
  color: #fff;
}

.db-btn--primary:hover { filter: brightness(1.1); color: #fff; }

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

.db-btn--ghost:hover { background-color: var(--bg-hover); color: var(--text-primary); }

.db-btn i { font-size: 0.62rem; }


/* ── Motion ─────────────────────────────────────────────────────────────── */

/* The .db-reveal class is applied by js/dashboard-charts.js, never in the
   template: that way a dashboard whose JS failed to load has no hidden cards
   to un-hide — nothing is ever opacity:0 unless something is there to reveal
   it. The observer adds --in as each card scrolls into view. */
.db-reveal {
  opacity: 0;
  transform: translateY(10px);
}

.db-reveal--in {
  animation: db-card-in 0.5s cubic-bezier(0.22, 1, 0.36, 1) forwards;
  animation-delay: calc(var(--db-stagger, 0) * 55ms);
}

@keyframes db-card-in {
  to { opacity: 1; transform: none; }
}

/* Each arc sweeps from nothing to its own length. The ring circumference is
   handed in as --db-ring so the "from" frame is a full empty ring rather than
   a hardcoded number that would drift if the radius ever changed. */
.db-reveal--in .db-donut__seg {
  animation: db-donut-draw 0.9s cubic-bezier(0.22, 1, 0.36, 1) backwards;
  animation-delay: calc(var(--db-delay, 0) * 0.12s + 0.1s);
}

@keyframes db-donut-draw {
  from { stroke-dasharray: 0 var(--db-ring); }
  to   { stroke-dasharray: var(--db-dash) var(--db-gap); }
}

/* Rows arrive in reading order, fast enough that five of them are settled
   before the eye has finished the first. */
.db-reveal--in .db-table__row {
  animation: db-row-in 0.38s ease backwards;
  animation-delay: calc(var(--db-row, 0) * 45ms + 0.12s);
}

@keyframes db-row-in {
  from { opacity: 0; transform: translateX(-6px); }
  to   { opacity: 1; transform: none; }
}

.db-reveal--in .db-journey__fill {
  animation: db-fill-in 0.8s cubic-bezier(0.22, 1, 0.36, 1) backwards;
  animation-delay: 0.15s;
}

@keyframes db-fill-in {
  from { width: 0; }
  to   { width: var(--db-pct, 0%); }
}

/* A reader who asked for less motion still gets the whole chart — the final
   frame, immediately, never a blank card. */
@media (prefers-reduced-motion: reduce) {
  .db-reveal,
  .db-reveal--in {
    opacity: 1;
    transform: none;
  }

  .db-reveal--in,
  .db-reveal--in .db-donut__seg,
  .db-reveal--in .db-table__row,
  .db-reveal--in .db-journey__fill {
    animation: none;
  }

  .db-btn:hover,
  .db-fw-panel:hover,
  .db-summary-card:hover { transform: none; }
}


/* ── Dashboard: one block per report type ───────────────────────────────── */

/* The unit of this page is a report type, not a widget. A block carries its
   own name, what it is, its status ring, its headline figures and its five
   latest rows — so no chart on the page is ever separated from the label that
   says what it counts. Two blocks fit a wide screen; below ~1120px a single
   column is more readable than two squeezed ones. */
.db-report-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(520px, 1fr));
  gap: 0.85rem;
  /* Blocks side by side rarely hold the same number of rows -- three RoI
     reports next to five cyber threats left one card short and the row
     ragged. Stretch makes every block in a row as tall as the tallest, and
     the table inside takes up the slack (see .db-report__table below). */
  align-items: stretch;
}

@media (max-width: 1120px) {
  .db-report-grid { grid-template-columns: 1fr; }
}

.db-report {
  display: flex;
  flex-direction: column;
  height: 100%;
  background-color: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: 14px;
  overflow: hidden;
  transition: border-color 0.15s ease, box-shadow 0.15s ease, transform 0.15s ease;
}

.db-report:hover {
  border-color: var(--border-light);
  transform: translateY(-2px);
  box-shadow: 0 10px 28px rgba(0, 0, 0, 0.26);
}

/* ── Block header: icon, name, what it is, actions ── */
.db-report__head {
  display: flex;
  align-items: center;
  gap: 0.7rem;
  padding: 0.85rem 1.05rem;
  border-bottom: 1px solid var(--border-color);
}

.db-report__icon {
  width: 34px;
  height: 34px;
  border-radius: 10px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: 0.85rem;
  flex: 0 0 auto;
}

.db-report__titles {
  display: flex;
  flex-direction: column;
  gap: 0.05rem;
  min-width: 0;
}

/* The block's name is the page's main label — a real heading, not a chart
   caption, so it is what a screen reader lands on when jumping by heading. */
.db-report__title {
  margin: 0;
  font-size: 0.92rem;
  font-weight: 700;
  line-height: 1.25;
  color: var(--text-primary);
  overflow-wrap: anywhere;
}

/* The one line that says which report this is, in the words the regulation
   uses — "RoI · DORA", not a second copy of the title. */
.db-report__kind {
  font-size: 0.7rem;
  color: var(--text-muted);
  overflow-wrap: anywhere;
}

.db-report__actions {
  display: flex;
  align-items: center;
  gap: 0.4rem;
  margin-left: auto;
  flex-shrink: 0;
}

/* Actions wrap under the title on a narrow card rather than crushing the
   name into two characters and an ellipsis. */
@media (max-width: 560px) {
  .db-report__head { flex-wrap: wrap; }
  .db-report__actions { margin-left: 0; width: 100%; }
}

/* ── Ring + figures, side by side ── */
.db-report__panels {
  display: grid;
  grid-template-columns: minmax(0, 1.1fr) minmax(0, 1fr);
  gap: 1.1rem;
  padding: 1rem 1.05rem 0.2rem;
}

@media (max-width: 680px) {
  .db-report__panels { grid-template-columns: 1fr; }
}

.db-report__panel { min-width: 0; }

/* Every panel and every table says what it is. This is the label that was
   missing when a ring sat alone in a card. */
.db-report__label {
  margin: 0 0 0.55rem 0;
  font-size: 0.63rem;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--text-muted);
}

/* ── At-a-glance figures ── */
/* Deliberately NOT a repeat of the ring's statuses: the ring and its legend
   already carry the per-status split, so these are the numbers that split
   cannot answer — how much is waiting on someone, and when anything last
   happened. */
.db-facts {
  margin: 0;
  display: flex;
  flex-direction: column;
  gap: 0.3rem;
}

.db-fact {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 0.75rem;
  padding: 0.4rem 0.6rem;
  border-radius: 8px;
  background-color: var(--bg-card-secondary);
}

.db-fact dt {
  margin: 0;
  font-size: 0.74rem;
  font-weight: 400;
  color: var(--text-muted);
}

.db-fact dd {
  margin: 0;
  font-size: 0.84rem;
  font-weight: 700;
  color: var(--text-primary);
  font-variant-numeric: tabular-nums;
  white-space: nowrap;
}

/* ── The block's own latest-five table ── */
.db-report__table {
  padding: 0.9rem 1.05rem 1.05rem;
  margin-top: 0.5rem;
  border-top: 1px solid var(--border-color);
  /* Head and panels are fixed; whatever height the row gained goes here. */
  display: flex;
  flex-direction: column;
  flex: 1 1 auto;
  min-height: 0;
}

/* A block that is only a table (activity, notifications) has no panels above
   it, so it carries no rule — there is nothing to divide it from. */
.db-report__table--only {
  margin-top: 0;
  border-top: none;
  padding-top: 1rem;
}

/* The table bleeds to the block's edges; the label above it keeps the inset. */
.db-report__table .db-table-wrap {
  margin: 0 -1.05rem -1.05rem;
  width: auto;
  flex: 1 1 auto;
  min-height: 0;
}

/* A short table grows its rows to the block's height rather than leaving a
   gap under the last one, so three rows read as deliberate, not truncated. */
.db-report__table .db-table { height: 100%; }

.db-report__table .db-table thead th { background-color: var(--bg-card); }

.db-report__table--only .db-notif-list { margin: 0; }


/* ── Small action buttons in a block header ─────────────────────────────── */
.db-btn--xs {
  padding: 0.3rem 0.62rem;
  font-size: 0.7rem;
  border-radius: 7px;
}

.db-btn--xs i { font-size: 0.58rem; }


/* ── Chart variants used inside a report block ──────────────────────────── */

/* Row layout: the ring is one column of a card, not the card itself, so the
   legend sits beside it as a readout rather than under it as a colour key. */
.db-chart--row {
  flex-direction: row;
  align-items: center;
  gap: 1rem;
  margin-top: 0;
}

.db-chart--row .db-chart__legend {
  flex-direction: column;
  flex-wrap: nowrap;
  justify-content: center;
  align-items: stretch;
  gap: 0.22rem;
  flex: 1 1 auto;
  min-width: 0;
}

/* Swatch, name, count, share — four columns so the numbers line up down the
   card instead of drifting with the length of each status name. */
.db-chart--row .db-chart__key {
  display: grid;
  grid-template-columns: 8px minmax(0, 1fr) auto auto;
  align-items: center;
  gap: 0.45rem;
  padding: 2px 5px;
}

.db-chart--row .db-chart__key-name {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.db-chart__key-pct {
  font-size: 0.68rem;
  color: var(--text-muted);
  font-variant-numeric: tabular-nums;
  min-width: 2.4em;
  text-align: right;
}

/* Small ring: 104px reads clearly at four segments and leaves the legend the
   room it needs. The viewBox is unchanged, so every arc the view computed
   still lands exactly where it did. */
.db-chart--sm .db-chart__plot {
  width: 104px;
  height: 104px;
}

.db-chart--sm .db-chart__value { font-size: 1.5rem; }
.db-chart--sm .db-chart__unit  { font-size: 0.56rem; }

.db-chart--row.db-chart--sm .db-chart__plot { flex: 0 0 104px; }

/* A block's empty ring still needs its "nothing yet" line beside it, not
   centred under a full-width card. */
.db-chart--row .db-chart__none { text-align: left; }


/* ── Dashboard: collapsing a product band ───────────────────────────────── */

/* The toggle lives in the band's own heading, after the one-line summary, so
   the thing that collapses the band is the thing that brings it back. */
.db-section__toggle {
  width: 28px;
  height: 28px;
  margin: 0;
  padding: 0;
  flex: 0 0 auto;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border-radius: 7px;
  border: 1px solid var(--border-color);
  background-color: transparent;
  color: var(--text-muted);
  font-size: 0.7rem;
  cursor: pointer;
  transition: background-color 0.15s ease, color 0.15s ease, border-color 0.15s ease;
}

/* .db-section__meta carries margin-left:auto, which pushes this to the right
   edge after it. When the meta line is hidden on a narrow screen the toggle
   has to take over that job itself. */
.db-section__head > .db-section__toggle:nth-child(3) { margin-left: auto; }

.db-section__toggle:hover,
.db-section__toggle:focus-visible {
  background-color: var(--bg-hover);
  border-color: var(--border-light);
  color: var(--text-primary);
}

.db-section__toggle i {
  transition: transform 0.25s cubic-bezier(0.22, 1, 0.36, 1);
}

.db-section--collapsed .db-section__toggle i { transform: rotate(180deg); }

/* A collapsed band keeps its heading and loses its rule — there is nothing
   below it left to divide. */
.db-section--collapsed .db-section__head {
  padding-bottom: 0;
  border-bottom: none;
}

.db-section--collapsed { gap: 0; }

/* The 1fr -> 0fr grid row is what makes the height animate: a plain
   max-height transition needs a hardcoded ceiling, and these bands vary from
   one card to six. The child clips so the rows actually disappear as the
   track closes rather than spilling out of it. */
.db-section__body {
  display: grid;
  grid-template-rows: 1fr;
  transition: grid-template-rows 0.3s cubic-bezier(0.22, 1, 0.36, 1),
              opacity 0.2s ease;
}

.db-section__body > * { min-height: 0; }

.db-section--collapsed .db-section__body {
  grid-template-rows: 0fr;
  opacity: 0;
  pointer-events: none;
}

.db-section--collapsed .db-section__body > * { overflow: hidden; }

@media (prefers-reduced-motion: reduce) {
  .db-section__body,
  .db-section__toggle i { transition: none; }
}


/* ── Superadmin platform band ────────────────────────────────────────────── */
/* Three blocks above the product sections: what came in, what is subscribed,
   what needs attention next. See templates/accounts/_db_platform.html.

   The one new hue here is --db-series, the collected-revenue bars. It is a
   single-series accent, so it carries no identity against another colour and
   needs no legend — the heading names it. Chosen by running the palette
   validator rather than by eye: #2f7fd1 sits inside the L 0.48–0.67 band and
   clears 3:1 against this surface in both modes, where the first blue tried
   (#4b9fe1) failed the lightness band at 0.679. */
.db-kpi-row {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
  gap: 0.6rem;
  padding: 1rem 1.05rem 0.2rem;
}

.db-kpi {
  display: flex;
  flex-direction: column;
  gap: 0.2rem;
  padding: 0.7rem 0.8rem;
  border-radius: 10px;
  background-color: var(--bg-card-secondary);
  border: 1px solid var(--border-color);
  min-width: 0;
}

/* The hero figure is the one a platform owner opens the page for, so it gets
   the accent rule and the larger step. Everything else stays quiet. */
.db-kpi--hero {
  border-left: 3px solid #2f7fd1;
}

.db-kpi__label {
  font-size: 0.63rem;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--text-muted);
}

.db-kpi__value {
  font-size: 1.25rem;
  font-weight: 700;
  color: var(--text-primary);
  font-variant-numeric: tabular-nums;
  line-height: 1.15;
  overflow-wrap: anywhere;
}

.db-kpi--hero .db-kpi__value { font-size: 1.5rem; }

.db-kpi__note {
  font-size: 0.7rem;
  color: var(--text-muted);
}

/* ── Collected-per-month bars ───────────────────────────────────────────── */
/* Thin marks, rounded data-end, anchored to a shared baseline. The track is
   drawn so an empty month still reads as a month rather than vanishing — the
   gap between "nothing came in" and "this month does not exist" is the whole
   point of a six-month strip. */
.db-bars {
  display: flex;
  align-items: flex-end;
  gap: 0.5rem;
  padding: 0.3rem 0 0;
  min-height: 150px;
}

.db-bars__col {
  position: relative;
  flex: 1 1 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.3rem;
  min-width: 0;
  border-radius: 8px;
  outline: none;
}

.db-bars__col:focus-visible {
  box-shadow: 0 0 0 2px var(--border-light);
}

/* Only non-zero months are labelled: a column of zeros repeated six times is
   noise, and the tooltip still carries the exact figure for every bar. */
.db-bars__value {
  font-size: 0.68rem;
  font-weight: 700;
  color: var(--text-secondary);
  font-variant-numeric: tabular-nums;
  min-height: 1em;
  white-space: nowrap;
}

.db-bars__track {
  position: relative;
  width: 100%;
  max-width: 44px;
  height: 92px;
  border-radius: 6px;
  background-color: var(--bg-card-secondary);
  display: flex;
  align-items: flex-end;
  overflow: hidden;
}

.db-bars__fill {
  width: 100%;
  height: var(--db-bar, 0%);
  min-height: 3px;
  border-radius: 4px 4px 0 0;
  background-color: #2f7fd1;
  transition: height 0.5s cubic-bezier(0.22, 1, 0.36, 1);
}

.db-bars__label {
  font-size: 0.68rem;
  color: var(--text-muted);
}

/* Tooltip is CSS-only: these are real-size targets with a visible label
   already, so the hover layer adds the full month and exact amount rather
   than being the only way to read the chart. Keyboard reaches it too. */
.db-bars__col[data-tip]::after {
  content: attr(data-tip);
  position: absolute;
  bottom: calc(100% - 1.4rem);
  left: 50%;
  transform: translateX(-50%);
  padding: 0.3rem 0.5rem;
  border-radius: 7px;
  background-color: var(--bg-card);
  border: 1px solid var(--border-light);
  color: var(--text-primary);
  font-size: 0.7rem;
  white-space: nowrap;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.12s ease;
  z-index: 5;
}

.db-bars__col[data-tip]:hover::after,
.db-bars__col[data-tip]:focus-visible::after { opacity: 1; }

/* ── Caveats and list headers ───────────────────────────────────────────── */
/* A number that excludes rows says so on the page, not in a comment: a
   run-rate that silently drops custom-tier contracts is a wrong number. */
.db-report__caveat {
  display: flex;
  align-items: flex-start;
  gap: 0.45rem;
  margin: 0.85rem 0 0;
  font-size: 0.72rem;
  line-height: 1.45;
  color: var(--text-muted);
}

.db-report__caveat--warn { color: var(--db-warning, #d97706); }

.db-report__label--spaced { margin-top: 1.4rem; }

/* The dot repeats the status the badges in each table already carry — the
   colour is never the only thing saying which list this is, the heading is. */
.db-dot {
  display: inline-block;
  width: 7px;
  height: 7px;
  border-radius: 50%;
  margin-right: 0.35rem;
  vertical-align: middle;
}

.db-dot--warning  { background-color: var(--db-warning, #d97706); }
.db-dot--critical { background-color: var(--db-critical, #d12a66); }

@media (max-width: 680px) {
  .db-kpi-row { grid-template-columns: repeat(auto-fit, minmax(130px, 1fr)); }
  .db-bars__track { height: 76px; }
}

/* ── Non Major: initial reports still open to reclassification ─────────── */

.nm-recl__head {
  display: flex;
  align-items: flex-start;
  gap: 1rem;
  margin-bottom: 1rem;
}

.nm-recl__title {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  margin: 0;
  font-size: 0.95rem;
  font-weight: 700;
  color: var(--text-heading);
}

.nm-recl__title i { color: #60a5fa; font-size: 0.85rem; }

.nm-recl__hint {
  margin: 0.3rem 0 0;
  font-size: 0.78rem;
  line-height: 1.45;
  color: var(--text-muted);
}

.nm-recl__count {
  margin-left: auto;
  flex-shrink: 0;
  background: color-mix(in oklab, #60a5fa 15%, transparent);
  color: #60a5fa;
  font-size: 0.72rem;
  font-weight: 700;
  padding: 0.2rem 0.6rem;
  border-radius: 999px;
}

.nm-recl__btn {
  padding: 6px 14px;
  font-size: 0.78rem;
  gap: 6px;
  white-space: nowrap;
}

/* ── Non Major: identity cell, readiness, and the reclassify confirm panel ── */

/* One-line gloss under a KPI number, so the card says what it counts without
   the reader having to match it against a table further down the page. */
.rl-kpi__sub {
  margin: 0.15rem 0 0;
  font-size: 0.72rem;
  line-height: 1.3;
  color: var(--text-muted);
}

.rl-kpi--link { cursor: pointer; transition: border-color .15s ease, background .15s ease; }
.rl-kpi--link:hover,
.rl-kpi--link:focus-visible { border-color: #60a5fa; background: var(--bg-hover); outline: none; }

.nm-recl__table td { vertical-align: top; }

.nm-recl__ref {
  display: block;
  font-weight: 650;
  color: var(--text-primary);
}

.nm-recl__desc {
  display: block;
  margin-top: 0.15rem;
  font-size: 0.78rem;
  line-height: 1.35;
  color: var(--text-muted);
}

.nm-recl__desc--empty { font-style: italic; opacity: 0.75; }

.nm-recl__id {
  display: block;
  margin-top: 0.2rem;
  font-size: 0.68rem;
  letter-spacing: 0.02em;
  color: var(--text-muted);
  opacity: 0.7;
}

/* A draft that cannot pass validation yet still opens the panel — it is the
   only place that lists what is missing — so it reads as available, not
   disabled, just visibly not the happy path. */
.nm-recl__btn--blocked { opacity: 0.75; }

.nm-modal {
  position: fixed;
  inset: 0;
  z-index: 1200;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 1.25rem;
}

.nm-modal[hidden] { display: none; }

.nm-modal__backdrop {
  position: absolute;
  inset: 0;
  background: rgba(0, 0, 0, 0.55);
}

.nm-modal__box {
  position: relative;
  width: min(560px, 100%);
  max-height: 88vh;
  overflow-y: auto;
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: 14px;
  padding: 1.4rem 1.5rem;
  box-shadow: 0 24px 60px rgba(0, 0, 0, 0.45);
}

/* Undo the legacy global `button { width:100%; margin-top:1.5rem }` and
   `p { text-align:center }` rules at the top of this file (the IR forms do
   the same under .ir-module) — otherwise the close button stretches across
   the header, Cancel and Reclassify each fill a row, and the lead/help lines
   centre themselves. */
.nm-modal__box button { width: auto; margin-top: 0; }
.nm-modal__box p { text-align: left; }

.nm-modal__head {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  margin-bottom: 1rem;
}

.nm-modal__title {
  margin: 0;
  font-size: 1rem;
  font-weight: 700;
  color: var(--text-heading);
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.nm-modal__title i { color: #60a5fa; font-size: 0.9rem; }

.nm-modal__x {
  margin-left: auto;
  background: none;
  border: none;
  color: var(--text-muted);
  font-size: 1rem;
  cursor: pointer;
  padding: 0.2rem 0.4rem;
  border-radius: 6px;
}

.nm-modal__x:hover { color: var(--text-primary); background: var(--bg-hover); }

.nm-modal__lead {
  margin: 0 0 0.6rem;
  font-size: 0.8rem;
  font-weight: 600;
  color: var(--text-muted);
}

.nm-modal__facts {
  margin: 0 0 1.1rem;
  border: 1px solid var(--border-color);
  border-radius: 10px;
  overflow: hidden;
}

.nm-modal__facts > div {
  display: grid;
  grid-template-columns: 110px 1fr;
  gap: 0.75rem;
  padding: 0.55rem 0.85rem;
  border-bottom: 1px solid var(--border-color);
}

.nm-modal__facts > div:last-child { border-bottom: none; }

.nm-modal__facts dt {
  margin: 0;
  font-size: 0.74rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  color: var(--text-muted);
}

.nm-modal__facts dd {
  margin: 0;
  font-size: 0.83rem;
  line-height: 1.4;
  color: var(--text-primary);
  overflow-wrap: anywhere;
}

.nm-modal__label {
  display: block;
  margin-bottom: 0.4rem;
  font-size: 0.82rem;
  font-weight: 600;
  color: var(--text-heading);
}

.nm-modal__req {
  margin-left: 0.35rem;
  font-size: 0.68rem;
  font-weight: 700;
  text-transform: uppercase;
  color: #f85868;
}

.nm-modal__textarea {
  width: 100%;
  resize: vertical;
  padding: 0.65rem 0.8rem;
  font: inherit;
  font-size: 0.85rem;
  color: var(--text-primary);
  background: var(--bg-hover);
  border: 1px solid var(--border-color);
  border-radius: 8px;
}

.nm-modal__textarea:focus { outline: none; border-color: #60a5fa; }

.nm-modal__help {
  margin: 0.4rem 0 0;
  font-size: 0.75rem;
  color: var(--text-muted);
}

.nm-modal__warn {
  display: flex;
  align-items: flex-start;
  gap: 0.5rem;
  margin: 0.8rem 0 0.5rem;
  font-size: 0.78rem;
  line-height: 1.45;
  color: #ffbb66;
}

.nm-modal__warn--soft { color: var(--text-muted); }

.nm-modal__missing {
  margin: 0.4rem 0 0;
  padding-left: 1.1rem;
  font-size: 0.78rem;
  line-height: 1.6;
  color: var(--text-primary);
}

.nm-modal__error {
  margin: 0.8rem 0 0;
  font-size: 0.78rem;
  color: #f85868;
}

.nm-modal__actions {
  display: flex;
  justify-content: flex-end;
  gap: 0.6rem;
  margin-top: 1.25rem;
  flex-wrap: wrap;
}

@media (max-width: 560px) {
  .nm-modal__facts > div { grid-template-columns: 1fr; gap: 0.15rem; }
  .nm-modal__actions > * { flex: 1 1 auto; justify-content: center; text-align: center; }
}
