/* ============================================================
   CodeScan — Theme CSS
   Light and dark mode via CSS custom properties on [data-bs-theme]
   ============================================================ */

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

/* ── Herotel Brand Tokens ─────────────────────────────────── */
:root {
    --herotel-orange: #FF5000;
    --herotel-charcoal: #3D3B34;
    --herotel-teal: #17A2B1;
    --header-height: 72px;
    --sidebar-width: 220px;
    --sidebar-collapsed-width: 56px;
    --sidebar-transition: width 0.2s ease;
}

/* ── Design tokens ─────────────────────────────────────────── */
[data-bs-theme="light"] {
    --bg: #f7f5f2;
    --surface: #ffffff;
    --surface-2: #f0ece6;
    --surface-hover: #f0ece6;
    --text: #3D3B34;
    --text-2: #656359;
    --text-3: #9B9993;
    
    --border: #CDCCC9;
    --info: #17A2B1;

    /* Shadows */
    --shadow: 0 2px 8px rgba(0,0,0,0.06);
    --shadow-lg: 0 8px 32px rgba(0,0,0,0.12);

    /* Warm gradient backgrounds for cards */
    --gradient-warm-1: linear-gradient(135deg, #ffffff 0%, #fef8f4 100%);
    --gradient-warm-2: linear-gradient(135deg, #ffffff 0%, #f4f8fe 100%);
    --gradient-warm-3: linear-gradient(135deg, #ffffff 0%, #f4fef6 100%);
    --gradient-warm-4: linear-gradient(135deg, #ffffff 0%, #fef6f4 100%);
    --gradient-surface: linear-gradient(135deg, #ffffff 0%, #fefcfa 100%);

    /* Row alternation */
    --row-alt: rgba(0,0,0,0.02);
    --row-hover: rgba(0,0,0,0.03);
}

[data-bs-theme="dark"] {
    --bg: #18181b;
    --surface: #303036;
    --surface-2: #28282d;
    --surface-hover: #3c3c42;
    --text: #ececea;
    --text-2: #a8a8a8;
    --text-3: #787878;
    
    --border: #454550;
    --info: #17A2B1;

    /* Shadows */
    --shadow: 0 2px 8px rgba(0,0,0,0.3);
    --shadow-lg: 0 8px 32px rgba(0,0,0,0.45);

    /* Warm gradient backgrounds for cards */
    --gradient-warm-1: linear-gradient(135deg, #303036 0%, #3a3230 100%);
    --gradient-warm-2: linear-gradient(135deg, #303036 0%, #2e303a 100%);
    --gradient-warm-3: linear-gradient(135deg, #303036 0%, #303630 100%);
    --gradient-warm-4: linear-gradient(135deg, #303036 0%, #363230 100%);
    --gradient-surface: linear-gradient(135deg, #303036 0%, #343230 100%);

    /* Row alternation */
    --row-alt: rgba(255,255,255,0.025);
    --row-hover: rgba(255,255,255,0.055);
}

/* ── Base ───────────────────────────────────────────────────── */
*,
*::before,
*::after {
    box-sizing: border-box;
}

html {
    font-size: 15px;
}

body {
    font-family: Arial, system-ui, sans-serif;
    background: var(--bg);
    color: var(--text);
    margin: 0;
    min-height: 100vh;
    transition: background 0.2s ease, color 0.2s ease;
}

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

a:hover {
    text-decoration: underline;
}

/* ── Page layout ────────────────────────────────────────────── */
/* ── Main content area ─────────────────────────────────────── */
.main-content {
    margin-left: var(--sidebar-width);
    margin-top: calc(var(--header-height) + 3px);
    min-height: calc(100vh - var(--header-height) - 3px);
    padding: 1.25rem;
    transition: margin-left 0.2s ease;
    overflow-x: auto;
}
.sidebar.collapsed ~ .main-content,
body.sidebar-collapsed .main-content {
    margin-left: var(--sidebar-collapsed-width);
}
.main-content.no-sidebar {
    margin-left: 0;
}

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

.header-logo-img {
    height: 36px;
    width: auto;
    flex-shrink: 0;
}

.header-tagline {
    font-size: 13px;
    font-style: italic;
    color: var(--header-text-muted);
}

.header-btn {
    color: var(--header-text);
    background: transparent;
    border: 1px solid rgba(255,255,255,0.18);
    border-radius: 50%;
    width: 32px;
    height: 32px;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 0;
    transition: background 0.15s ease, border-color 0.15s ease;
}

.header-btn:hover,
.header-btn:focus {
    background: rgba(255,255,255,0.12);
    border-color: rgba(255,255,255,0.35);
    color: var(--header-text);
}

/* Theme toggle button — sun/moon SVG icons */
.header-theme-btn {
    background: rgba(255,255,255,0.15);
    border: none;
    border-radius: 50%;
    width: 32px;
    height: 32px;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    color: #fff;
    flex-shrink: 0;
    transition: background 0.15s;
    margin-left: auto;
}
.header-theme-btn:hover { background: rgba(255,255,255,0.28); }
.header-theme-btn svg { pointer-events: none; }
/* Light mode: show moon (click → go dark). Dark mode: show sun (click → go light). */
.header-theme-btn .icon-sun  { display: none; }
.header-theme-btn .icon-moon { display: flex; }
[data-bs-theme="dark"] .header-theme-btn .icon-sun  { display: flex; }
[data-bs-theme="dark"] .header-theme-btn .icon-moon { display: none; }

.header-user-chip {
    padding: 4px 10px 4px 4px;
    border-radius: 20px;
    background: rgba(255,255,255,0.08);
    border: 1px solid rgba(255,255,255,0.15);
}

.header-avatar {
    width: 28px;
    height: 28px;
    border-radius: 50%;
    background: var(--herotel-orange);
    color: white;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 11px;
    font-weight: 700;
    flex-shrink: 0;
    letter-spacing: 0.5px;
}

.header-username {
    font-size: 13px;
    color: var(--header-text);
    max-width: 160px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

/* ── Sidebar ───────────────────────────────────────────────── */
.sidebar {
    position: fixed;
    top: calc(var(--header-height) + 3px);
    left: 0;
    height: calc(100vh - var(--header-height) - 3px);
    width: var(--sidebar-width);
    min-width: var(--sidebar-width);
    overflow: hidden;
    overflow-y: auto;
    z-index: 1000;
    display: flex;
    flex-direction: column;
    transition: var(--sidebar-transition);
    border-right: 1px solid var(--border);
}
[data-bs-theme="dark"] .sidebar {
    background-color: #222228;
    border-right-color: #3a3a42;
}
[data-bs-theme="light"] .sidebar {
    background-color: #f8f9fa;
    border-right-color: #dee2e6;
}

/* Collapsed state */
.sidebar.collapsed {
    width: var(--sidebar-collapsed-width);
    min-width: var(--sidebar-collapsed-width);
}

/* Sidebar brand header */
.sidebar-brand {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0.75rem 1rem;
    min-height: 56px;
    white-space: nowrap;
    overflow: hidden;
    border-bottom: 1px solid var(--border);
    flex-shrink: 0;
}
.sidebar-brand .brand-name {
    font-family: 'Barlow', Arial, sans-serif;
    font-size: 1rem;
    font-weight: 700;
    letter-spacing: 0.05em;
    overflow: hidden;
    transition: opacity 0.15s ease, width 0.2s ease;
}
.sidebar.collapsed .brand-name {
    opacity: 0;
    width: 0;
    overflow: hidden;
}

/* Sidebar toggle button */
.sidebar-toggle {
    background: transparent;
    border: none;
    color: var(--text-2);
    cursor: pointer;
    padding: 4px;
    flex-shrink: 0;
}
.sidebar-toggle:hover { color: #FF5000; }

/* Sidebar nav fills available space */
.sidebar-nav-main {
    flex: 1;
    padding: 0.5rem 0;
    list-style: none;
    margin: 0;
    overflow: hidden;
}

/* Bottom nav pinned */
.sidebar-nav-bottom {
    border-top: 1px solid var(--border);
    padding: 0.5rem 0;
    flex-shrink: 0;
    list-style: none;
    margin: 0;
}

/* Offcanvas sidebar (mobile) */
.sidebar-offcanvas {
    background: var(--sidebar-bg) !important;
    border-right: 1px solid var(--sidebar-border) !important;
}

.sidebar-offcanvas .offcanvas-header {
    border-bottom: 1px solid var(--border);
    background: var(--sidebar-bg);
    color: var(--text);
}

.sidebar-offcanvas .btn-close {
    filter: var(--close-btn-filter, none);
}

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

/* Sidebar nav items */
.sidebar-link {
    display: flex;
    align-items: center;
    padding: 0.5rem 1rem;
    padding-left: calc(1rem - 3px);
    color: var(--text-2);
    text-decoration: none;
    white-space: nowrap;
    overflow: hidden;
    border-left: 3px solid transparent;
    transition: background-color 0.15s ease, color 0.15s ease, border-color 0.15s ease;
    gap: 0.75rem;
}
.sidebar-link:hover {
    background-color: var(--surface-hover);
    color: var(--text);
    text-decoration: none;
}
.sidebar-link.active {
    background-color: transparent;
    color: #FF5000;
    border-left-color: #FF5000;
    font-weight: 600;
}

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

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

.sidebar-section-divider {
    border-top: 1px solid var(--border);
    margin: 8px 16px;
}

.sidebar-footer {
    margin-top: auto;
    padding: 8px 12px;
    font-size: 0.75rem;
    color: var(--text-3);
    border-top: 1px solid var(--border);
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 6px;
}

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

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

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

.sidebar.collapsed .sidebar-footer { justify-content: center; padding: 8px 4px; }
.sidebar.collapsed .sidebar-footer .env { display: none; }

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

.card-header {
    background: transparent;
    border-bottom: 1px solid var(--border);
    font-weight: 600;
    font-size: 12px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    color: var(--herotel-orange);
    border-left: 3px solid var(--herotel-orange);
}

/* ── KPI cards ──────────────────────────────────────────────── */
.kpi-card {
    transition: transform 0.12s ease, box-shadow 0.12s ease;
    opacity: 0;
    animation: fadeInUp 0.4s ease forwards;
    border-radius: 8px;
}

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

.kpi-card:hover {
    transform: translateY(-2px);
    box-shadow: var(--shadow-lg) !important;
}

/* Staggered fade-in for KPI cards */
.kpi-card:nth-child(1) { animation-delay: 0.05s; }
.kpi-card:nth-child(2) { animation-delay: 0.10s; }
.kpi-card:nth-child(3) { animation-delay: 0.15s; }
.kpi-card:nth-child(4) { animation-delay: 0.20s; }

/* Stagger when inside col wrappers */
.col-sm-6:nth-child(1) .kpi-card { animation-delay: 0.05s; }
.col-sm-6:nth-child(2) .kpi-card { animation-delay: 0.10s; }
.col-sm-6:nth-child(3) .kpi-card { animation-delay: 0.15s; }
.col-sm-6:nth-child(4) .kpi-card { animation-delay: 0.20s; }
.col-sm-6:nth-child(5) .kpi-card { animation-delay: 0.25s; }
.col-sm-6:nth-child(6) .kpi-card { animation-delay: 0.30s; }
.col-sm-6:nth-child(7) .kpi-card { animation-delay: 0.35s; }

@keyframes fadeInUp {
    from {
        opacity: 0;
        transform: translateY(12px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* ── Severity badges ────────────────────────────────────────── */
.badge.severity-critical,
.severity-critical {
    background-color: #dc3545 !important;
    color: #ffffff !important;
}

.badge.severity-high,
.severity-high {
    background-color: #fd7e14 !important;
    color: #ffffff !important;
}

.badge.severity-medium,
.severity-medium {
    background-color: #ffc107 !important;
    color: #212529 !important;
}

.badge.severity-low,
.severity-low {
    background-color: #0d6efd !important;
    color: #ffffff !important;
}

/* ── DataTables 2.x (dt-container) ─────────────────────────── */
/* Override Bootstrap .row's own --bs-gutter-x so negative margins don't escape the card */
.card > .card-body.p-0 .dt-container .row {
    --bs-gutter-x: 0;
    margin-top: 0 !important;
}
/* 5px side + 6px vertical padding on toolbar/pagination cells — dt-layout-full (table) not targeted */
.card > .card-body.p-0 .dt-container .dt-layout-start {
    padding: 5px 0 5px 5px;
}
.card > .card-body.p-0 .dt-container .dt-layout-end {
    padding: 5px 5px 5px 0;
}

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

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

/* Search input + length select theming */
.dt-container .dt-search input,
.dt-container .dt-length select {
    background: var(--surface-2);
    color: var(--text);
    border: 1px solid var(--border);
    border-radius: 6px;
    padding: 4px 8px;
}
/* Light mode: card is white so no background needed on inputs */
[data-bs-theme="light"] .dt-container .dt-search input,
[data-bs-theme="light"] .dt-container .dt-length select {
    background: transparent !important;
}

.dt-container .dt-search input:focus,
.dt-container .dt-length select:focus {
    outline: none;
    border-color: var(--herotel-orange);
    box-shadow: 0 0 0 2px rgba(255,80,0,0.15);
}

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

/* Strip the 2px bottom margin DT adds to the pagination ul */
.card > .card-body.p-0 .dt-container .dt-paging ul {
    margin-bottom: 0;
}

/* Pagination — sized to match btn-sm toolbar buttons */
.dt-container .pagination .page-link {
    background: var(--surface);
    border-color: var(--border);
    color: var(--text);
    padding: 0.25rem 0.5rem;
    font-size: 0.875rem;
    line-height: 1.5;
}

.dt-container .pagination .page-link:hover {
    background: var(--surface-hover);
}

.dt-container .pagination .page-item.active .page-link {
    background: var(--herotel-orange);
    border-color: var(--herotel-orange);
    color: white;
}

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

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

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

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

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

/* ── DataTable row action buttons ───────────────────────────── */
/* btn-row: compact variant of btn-sm for inline table actions */
.btn-row {
    padding: 1px 6px;
    font-size: 0.75rem;
    line-height: 1.5;
    border-radius: 4px;
}

/* Prevent multi-button action groups wrapping inside a cell */
.nobr {
    white-space: nowrap;
}

/* ── Form controls ──────────────────────────────────────────── */
.form-control,
.form-select {
    background-color: var(--surface-2) !important;
    color: var(--text) !important;
    border-color: var(--border) !important;
}

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

.form-control::placeholder {
    color: var(--text-2);
    opacity: 0.7;
}

.form-label {
    color: var(--text);
    font-weight: 500;
    font-size: 14px;
}

/* Boolean toggles (form-switch) */
.form-check-input:checked {
    background-color: var(--herotel-orange) !important;
    border-color: var(--herotel-orange) !important;
}

.form-check-input:focus {
    box-shadow: 0 0 0 0.2rem rgba(255,80,0,0.25) !important;
    border-color: var(--herotel-orange) !important;
}

/* Input group text */
.input-group-text {
    background: var(--surface);
    border-color: var(--border);
    color: var(--text-2);
}

/* ── Buttons ─────────────────────────────────────────────────── */
/* Never use btn-outline-dark or btn-dark — invisible in dark mode */
.btn-primary {
    background-color: var(--herotel-orange) !important;
    border-color: var(--herotel-orange) !important;
    color: #ffffff !important;
}

.btn-primary:hover,
.btn-primary:focus {
    background-color: #e04700 !important;
    border-color: #e04700 !important;
}

.btn-outline-secondary {
    color: var(--text-2) !important;
    border-color: var(--border) !important;
}

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

/* ── Nav tabs ────────────────────────────────────────────────── */
.nav-tabs {
    border-bottom: 2px solid var(--border);
}

.nav-tabs .nav-link {
    color: var(--text-2);
    border: none;
    border-bottom: 2px solid transparent;
    padding: 8px 16px;
    font-size: 14px;
    margin-bottom: -2px;
}

.nav-tabs .nav-link:hover {
    color: var(--text);
    border-bottom-color: var(--border);
}

.nav-tabs .nav-link.active {
    color: var(--herotel-orange);
    background: transparent;
    border-bottom-color: var(--herotel-orange);
    font-weight: 600;
}

.tab-content {
    padding-top: 1.5rem;
}

/* ── Alerts ──────────────────────────────────────────────────── */
.alert {
    border-radius: 8px;
    border: 1px solid var(--border);
}

[data-bs-theme="dark"] .alert-info {
    background-color: #1a3a3d;
    border-color: var(--info);
    color: var(--text);
}

[data-bs-theme="dark"] .alert-warning {
    background-color: #3d3000;
    border-color: #ffc107;
    color: var(--text);
}

[data-bs-theme="dark"] .alert-danger {
    background-color: #3d0f0f;
    border-color: #dc3545;
    color: var(--text);
}

[data-bs-theme="dark"] .alert-success {
    background-color: #0d2d1a;
    border-color: #198754;
    color: var(--text);
}

/* ── Modals ──────────────────────────────────────────────────── */
.modal-content {
    background: var(--bg);
    border: 1px solid var(--border);
    color: var(--text);
    box-shadow: var(--shadow-lg);
}

.modal-header {
    border-bottom: 1px solid var(--border);
}

.modal-footer {
    border-top: 1px solid var(--border);
}

.modal-header .btn-close {
    filter: none;
}

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

/* ── Toasts ──────────────────────────────────────────────────── */
#toast-container {
    z-index: 9999;
}

.toast {
    min-width: 280px;
    border-radius: 8px;
    box-shadow: var(--shadow-lg);
}

/* ── Tables (non-DT) ─────────────────────────────────────────── */
.table {
    color: var(--text) !important;
}

.table th {
    border-color: var(--border) !important;
    color: var(--text-2);
    font-size: 12px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    background: var(--dt-header-bg);
}

.table td {
    border-color: var(--border) !important;
    vertical-align: middle;
}

.table-striped > tbody > tr:nth-of-type(odd) > * {
    background-color: var(--dt-stripe) !important;
    color: var(--text) !important;
}

.table-hover > tbody > tr:hover > * {
    background-color: var(--dt-hover) !important;
    color: var(--text) !important;
}

/* ── Code blocks ─────────────────────────────────────────────── */
pre,
code {
    background: var(--surface);
    color: var(--text);
    border: 1px solid var(--border);
    border-radius: 6px;
    font-size: 13px;
}

pre {
    padding: 1rem;
    overflow-x: auto;
}

code {
    padding: 2px 6px;
}

pre code {
    border: none;
    padding: 0;
    background: transparent;
}

/* ── Dropdowns ───────────────────────────────────────────────── */
.dropdown-menu {
    background: var(--surface);
    border: 1px solid var(--border);
    box-shadow: var(--shadow-lg);
}

.dropdown-item {
    color: var(--text);
    font-size: 14px;
}

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

.dropdown-divider {
    border-color: var(--border);
}

/* ── Breadcrumbs ─────────────────────────────────────────────── */
.breadcrumb {
    font-size: 13px;
}

.breadcrumb-item + .breadcrumb-item::before {
    color: var(--text-2);
}

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

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

/* ── Badges (general) ────────────────────────────────────────── */
.text-secondary {
    font-size: 11px;
}

.badge {
    --bs-badge-font-size: 9px;
    font-weight: 600;
    letter-spacing: 0.3px;
    padding: 4px 8px;
    border-radius: 4px;
    text-transform: uppercase;
}

/* Status badges */
.badge-status-open { background: #dc3545; color: white; }
.badge-status-new { background: #6f42c1; color: white; }
.badge-status-in-progress { background: #fd7e14; color: white; }
.badge-status-acknowledged { background: #6c757d; color: white; }
.badge-status-resolved { background: #198754; color: white; }
.badge-status-ignore-requested { background: #ffc107; color: #212529; }
.badge-status-ignored { background: #6c757d; color: white; }
.badge-status-safe-requested { background: #0dcaf0; color: #000; }
.badge-status-safe { background: #20c997; color: #000; }

/* Risk level badges */
.badge-risk-critical { background: #dc3545; color: white; }
.badge-risk-high { background: #fd7e14; color: white; }
.badge-risk-medium { background: #ffc107; color: #212529; }
.badge-risk-low { background: #0d6efd; color: white; }
.badge-risk-clean { background: #198754; color: white; }
.badge-risk-unaudited { background: #6c757d; color: white; }

/* ── Page headings ───────────────────────────────────────────── */
.page-header {
    margin-bottom: 1.5rem;
    padding-bottom: 1rem;
    border-bottom: 1px solid var(--border);
}

.page-header h1 {
    font-size: 22px;
    font-weight: 700;
    margin: 0;
}

/* ── Loading spinner ─────────────────────────────────────────── */
.spinner-border-sm {
    width: 1rem;
    height: 1rem;
}

/* ── Empty state ─────────────────────────────────────────────── */
.empty-state {
    text-align: center;
    padding: 3rem 1rem;
    color: var(--text-2);
}

.empty-state i {
    font-size: 3rem;
    opacity: 0.3;
    margin-bottom: 1rem;
}

/* ── Utility: theme-aware text ───────────────────────────────── */
.text-muted {
    color: var(--text-2) !important;
}

/* ── Progress bars ───────────────────────────────────────────── */
.progress {
    background-color: var(--border);
    height: 6px;
    border-radius: 3px;
}

.progress-bar {
    background-color: var(--herotel-orange);
}

/* ── Responsive adjustments ──────────────────────────────────── */
@media (max-width: 767.98px) {
    #main-content {
        padding: 1rem !important;
    }

    .page-header h1 {
        font-size: 18px;
    }

    .card-body {
        padding: 0.85rem;
    }
}

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

@media (max-width: 767.98px) {
    #app-header {
        padding: 0 16px;
    }
}

@media (max-width: 375px) {
    #app-header {
        padding-left: 0.75rem !important;
        padding-right: 0.75rem !important;
    }
}

/* @mention highlighting in comment bodies */
.mention {
  color: var(--herotel-orange);
  font-weight: 600;
}

/* @mention autocomplete dropdown */
.mention-dropdown {
  background: var(--bs-body-bg);
  border: 1px solid var(--bs-border-color);
}
.mention-item:first-child { border-radius: 5px 5px 0 0; }
.mention-item:last-child  { border-radius: 0 0 5px 5px; }
.mention-item:only-child  { border-radius: 5px; }
