/**
 * GRIP — Branded Styles met Liquid Glass Design
 * Tenant-agnostisch: brand-tokens leveren de huisstijl. Defaults hieronder
 * zijn de white-label GRIP-look (paars/fuchsia/oranje, gelijk aan
 * BrandTokens.grip in de mobile app). Per-tenant overrides komen via
 * /api/tenant-theme.php (B-4) — die is de enige weg om af te wijken.
 */

:root {
    /* Brand tokens — GRIP white-label defaults. Palette volgt het logo:
       paarse cirkel → fuchsia accent → oranje pijl. Tenants overriden
       primary/accent via organizations.brand_* + tenant-theme.php. */
    --brand-primary: #7C3AED;
    --brand-primary-rgb: 124, 58, 237;          /* voor rgba()-gebruik */
    --brand-primary-light: #A375F2;
    --brand-primary-dark: #632EBE;
    --brand-gradient: linear-gradient(135deg, #7C3AED 0%, #D946EF 50%, #F97316 100%);
    --brand-gradient-hover: linear-gradient(135deg, #632EBE 0%, #B83AC9 50%, #D45C0F 100%);
    --brand-name: 'GRIP';

    /* Glass Effect Colors */
    --glass-bg: rgba(255, 255, 255, 0.7);
    --glass-bg-strong: rgba(255, 255, 255, 0.85);
    --glass-border: rgba(255, 255, 255, 0.3);
    --glass-shadow: 0 8px 32px rgba(var(--brand-primary-rgb), 0.15);
    --glass-blur: blur(20px);
    
    /* Sidebar */
    --sidebar-width: 260px;
    --sidebar-bg: linear-gradient(180deg, #1a1a2e 0%, #16213e 100%);
    --sidebar-text: #fff;
    
    /* Layout */
    --header-height: 70px;
    --border-radius: 16px;
    --border-radius-sm: 10px;
    
    /* Transitions */
    --transition-fast: 0.2s ease;
    --transition-smooth: 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

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

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;
    font-size: 14px;
    background: linear-gradient(135deg, #fdf2f8 0%, #fce7f3 50%, #fbcfe8 100%);
    min-height: 100vh;
}

.skip-link {
    position: absolute;
    top: -48px;
    left: 12px;
    z-index: 2000;
    padding: 8px 12px;
    border-radius: 8px;
    background: #111827;
    color: #ffffff;
    text-decoration: none;
    font-weight: 600;
}

.skip-link:focus {
    top: 12px;
}

a:focus-visible,
button:focus-visible,
input:focus-visible,
select:focus-visible,
textarea:focus-visible,
[role="button"]:focus-visible,
.nav-item:focus-visible {
    outline: 3px solid #111827;
    outline-offset: 2px;
}

/* ============================================
   LOGIN SCREEN - Liquid Glass Design
   ============================================ */
.login-container {
    display: flex;
    align-items: center;
    justify-content: center;
    min-height: 100vh;
    background: var(--brand-gradient);
    background-size: 400% 400%;
    animation: gradientShift 15s ease infinite;
    position: relative;
    overflow: hidden;
}

.login-container::before {
    content: '';
    position: absolute;
    top: -50%;
    left: -50%;
    width: 200%;
    height: 200%;
    background: radial-gradient(circle, rgba(255,255,255,0.1) 0%, transparent 50%);
    animation: pulse 8s ease-in-out infinite;
}

@keyframes gradientShift {
    0%, 100% { background-position: 0% 50%; }
    50% { background-position: 100% 50%; }
}

@keyframes pulse {
    0%, 100% { transform: scale(1); opacity: 0.5; }
    50% { transform: scale(1.1); opacity: 0.3; }
}

.login-box {
    background: var(--glass-bg-strong);
    backdrop-filter: var(--glass-blur);
    -webkit-backdrop-filter: var(--glass-blur);
    padding: 2.5rem;
    border-radius: var(--border-radius);
    box-shadow: 
        0 8px 32px rgba(0, 0, 0, 0.1),
        inset 0 0 0 1px rgba(255, 255, 255, 0.5);
    border: 1px solid var(--glass-border);
    width: 100%;
    max-width: 420px;
    position: relative;
    z-index: 1;
}

.login-logo {
    width: 180px;
    height: auto;
    margin-bottom: 0.5rem;
}

.login-box h1 {
    background: var(--brand-gradient);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    font-weight: 800;
    font-size: 2rem;
}

.login-subtitle {
    color: #6b7280;
    font-size: 0.95rem;
}

/* ============================================
   SIDEBAR - Modern Glass Navigation
   ============================================ */
.sidebar {
    position: fixed;
    top: 0;
    left: 0;
    width: var(--sidebar-width);
    height: 100vh;
    background: var(--sidebar-bg);
    color: var(--sidebar-text);
    overflow-y: auto;
    z-index: 1000;
    display: flex;
    flex-direction: column;
    box-shadow: 4px 0 24px rgba(0, 0, 0, 0.15);
}

.sidebar-header {
    padding: 1.5rem;
    border-bottom: 1px solid rgba(255, 255, 255, 0.08);
    display: flex;
    align-items: center;
    gap: 12px;
}

.sidebar-logo {
    width: 40px;
    height: 40px;
    object-fit: contain;
}

.sidebar-header h4 {
    margin: 0;
    font-size: 1.4rem;
    font-weight: 700;
    background: var(--brand-gradient);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.sidebar-header p {
    margin: 0;
    font-size: 0.75rem;
    color: white;
}

.sidebar-header .text-muted {
    color: #fff !important;
}

.sidebar-nav {
    flex: 1;
    padding: 1rem 0;
}

.nav-item {
    display: flex;
    align-items: center;
    padding: 0.85rem 1.5rem;
    color: rgba(255, 255, 255, 0.65);
    text-decoration: none;
    transition: var(--transition-smooth);
    margin: 2px 8px;
    border-radius: var(--border-radius-sm);
    font-weight: 500;
}

.nav-group-toggle {
    background: none;
    border: 0;
    width: calc(100% - 16px);
    cursor: pointer;
    text-align: left;
}

.nav-group-indicator {
    margin-left: auto;
    font-size: 0.85rem;
    opacity: 0.6;
    transition: var(--transition-smooth);
}

.nav-group.expanded .nav-group-indicator {
    transform: rotate(180deg);
    opacity: 1;
}

.nav-children {
    display: none;
    padding-bottom: 0.25rem;
}

.nav-group.expanded .nav-children {
    display: block;
}

.nav-child {
    padding-left: 2.5rem;
    font-size: 0.95rem;
}

.nav-item:hover {
    background: rgba(255, 255, 255, 0.08);
    color: white;
    transform: translateX(4px);
}

.nav-item.active {
    background: var(--brand-gradient);
    color: white;
    box-shadow: 0 4px 15px rgba(var(--brand-primary-rgb), 0.4);
}

.nav-item i {
    margin-right: 0.85rem;
    font-size: 1.15rem;
    width: 24px;
    text-align: center;
}

.sidebar-footer {
    padding: 1.25rem 1.5rem;
    border-top: 1px solid rgba(255, 255, 255, 0.08);
    background: rgba(0, 0, 0, 0.2);
}

.user-info {
    margin-bottom: 0.75rem;
}

.user-name {
    font-weight: 600;
    font-size: 0.95rem;
}

.user-role {
    font-size: 0.8rem;
    color: rgba(255, 255, 255, 0.5);
}

.sidebar-footer .btn {
    background: rgba(255, 255, 255, 0.1);
    border: 1px solid rgba(255, 255, 255, 0.2);
    color: white;
    transition: var(--transition-smooth);
}

.sidebar-footer .btn:hover {
    background: rgba(255, 255, 255, 0.2);
    border-color: rgba(255, 255, 255, 0.3);
    color: white;
}

.admin-compact-table .admin-row.hidden {
    display: none;
}

.admin-compact-table .admin-clickable-row {
    cursor: pointer;
}

.admin-compact-table .admin-clickable-row:hover td {
    background: rgba(var(--brand-primary-rgb), 0.06);
}

.admin-compact-table .admin-clickable-row:focus-visible {
    outline: 2px solid rgba(var(--brand-primary-rgb), 0.45);
    outline-offset: -2px;
}

.admin-compact-table .table {
    margin-bottom: 0;
}

.admin-table-footer {
    display: flex;
    justify-content: flex-end;
    margin-top: 0.5rem;
}

.admin-dashboard .stat-card .card-body {
    align-items: flex-start;
}

.admin-stat-value {
    font-size: 1.7rem;
    font-weight: 800;
    color: #1f2937;
    line-height: 1;
}

.admin-stat-date {
    font-size: 1rem;
    font-weight: 700;
    color: #1f2937;
}

.admin-stat-time {
    font-size: 1.35rem;
    font-weight: 800;
    color: #1f2937;
    line-height: 1.1;
}

.admin-stat-meta {
    margin-top: 0.35rem;
    font-size: 0.85rem;
    color: #6b7280;
    display: flex;
    gap: 0.4rem;
    align-items: center;
    flex-wrap: wrap;
}

.admin-activity .admin-stack {
    display: grid;
    gap: 1rem;
}

.admin-subsection-title {
    margin: 1rem 0 0.5rem;
    font-size: 0.82rem;
    letter-spacing: 0.03em;
    text-transform: uppercase;
    color: #6b7280;
    font-weight: 700;
}

.admin-issues {
    display: grid;
    gap: 0.65rem;
}

.admin-issue {
    width: 100%;
    text-align: left;
    border: 1px solid rgba(148, 163, 184, 0.3);
    background: rgba(255, 255, 255, 0.6);
    border-radius: 12px;
    padding: 0.75rem 1rem;
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    gap: 1rem;
    transition: var(--transition-fast);
}

.admin-issue:hover {
    background: rgba(var(--brand-primary-rgb), 0.06);
    border-color: rgba(var(--brand-primary-rgb), 0.25);
}

.admin-issue-main {
    flex: 1;
    min-width: 0;
}

.admin-issue-title {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    flex-wrap: wrap;
    font-size: 0.95rem;
}

.admin-issue-message {
    font-size: 0.85rem;
    color: #6b7280;
    margin-top: 0.25rem;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.admin-issue-meta {
    text-align: right;
    font-size: 0.8rem;
    color: #6b7280;
    min-width: 140px;
}

.admin-issue-action {
    margin-top: 0.35rem;
    font-weight: 600;
    color: var(--brand-primary);
}

.admin-issue-detail {
    display: grid;
    gap: 0.5rem;
}

.admin-issue-detail-header {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    flex-wrap: wrap;
}

.admin-issue-detail-message {
    font-size: 0.95rem;
    color: #374151;
}

.admin-issue-detail-meta {
    font-size: 0.85rem;
    color: #6b7280;
}

/* Security-overzicht extensies (taak-20260508-001) */
.admin-issue-token {
    display: inline-block;
    padding: 0.1rem 0.4rem;
    margin-right: 0.35rem;
    border-radius: 0.25rem;
    font-size: 0.7rem;
    font-weight: 700;
    letter-spacing: 0.04em;
    vertical-align: middle;
}
.admin-issue-token-high { background: #fee2e2; color: #b91c1c; }
.admin-issue-token-medium { background: #fef3c7; color: #92400e; }
.admin-issue-token-low { background: #e5e7eb; color: #374151; }

.admin-issue-suffix {
    color: #6b7280;
    font-weight: 400;
    font-size: 0.9em;
}

.admin-issue.admin-issue-seen {
    opacity: 0.65;
    background: #f9fafb;
}
.admin-issue.admin-issue-seen .admin-issue-title strong {
    font-weight: 500;
}

.admin-issue-seen-label {
    font-size: 0.75rem;
    color: #6b7280;
}

.admin-issue-block {
    margin-top: 0.75rem;
    padding-top: 0.5rem;
    border-top: 1px dashed #e5e7eb;
}
.admin-issue-block:first-of-type {
    border-top: none;
    padding-top: 0;
}
.admin-issue-block-label {
    font-size: 0.7rem;
    text-transform: uppercase;
    letter-spacing: 0.06em;
    color: #6b7280;
    font-weight: 700;
    margin-bottom: 0.25rem;
}
.admin-issue-block-body {
    font-size: 0.92rem;
    color: #1f2937;
}
.admin-issue-block-body code {
    background: #f3f4f6;
    padding: 0.05rem 0.3rem;
    border-radius: 0.2rem;
    font-size: 0.88em;
}

.admin-stat-card-clickable {
    cursor: pointer;
    background: var(--bs-body-bg, #fff);
    transition: transform 0.15s ease, box-shadow 0.15s ease;
}
.admin-stat-card-clickable:hover {
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(0,0,0,0.08);
}
.admin-stat-card-clickable:focus {
    outline: 2px solid #6366f1;
    outline-offset: 2px;
}

.admin-json-wrap {
    margin-top: 0.75rem;
}

.admin-json-title {
    font-size: 0.8rem;
    text-transform: uppercase;
    color: #6b7280;
    margin-bottom: 0.35rem;
    font-weight: 700;
}

.admin-json-block {
    background: rgba(15, 23, 42, 0.95);
    color: #e2e8f0;
    border-radius: 10px;
    padding: 0.75rem;
    font-size: 0.78rem;
    max-height: 220px;
    overflow: auto;
    margin-bottom: 0;
}

.admin-org-monitor-wrap {
    display: grid;
    gap: 1rem;
}

.admin-org-monitor-card {
    border: 1px solid rgba(148, 163, 184, 0.3);
    border-radius: 12px;
    padding: 0.85rem;
    background: rgba(255, 255, 255, 0.65);
}

.admin-org-monitor-head {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 0.75rem;
    margin-bottom: 0.6rem;
}

.admin-org-monitor-title {
    font-size: 1rem;
    font-weight: 700;
    color: #111827;
}

.admin-org-monitor-subtitle {
    font-size: 0.84rem;
    color: #6b7280;
}

.admin-org-monitor-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
    gap: 0.8rem;
    margin-bottom: 0.6rem;
}

.admin-org-monitor-cell {
    background: rgba(255, 255, 255, 0.8);
    border: 1px solid rgba(var(--brand-primary-rgb), 0.12);
    border-radius: 10px;
    padding: 0.6rem 0.7rem;
}

.admin-org-monitor-label {
    font-size: 0.76rem;
    text-transform: uppercase;
    letter-spacing: 0.04em;
    color: #6b7280;
    margin-bottom: 0.35rem;
    font-weight: 700;
}

.admin-org-monitor-meta {
    font-size: 0.83rem;
    color: #374151;
}

.admin-org-monitor-alerts {
    display: flex;
    gap: 0.45rem;
    flex-wrap: wrap;
    margin-bottom: 0.6rem;
}

/* ============================================
   MAIN CONTENT AREA
   ============================================ */
.main-content {
    margin-left: var(--sidebar-width);
    min-height: 100vh;
    background: linear-gradient(180deg, #fdf2f8 0%, #fff 100%);
}

.main-header {
    height: var(--header-height);
    background: var(--glass-bg-strong);
    backdrop-filter: var(--glass-blur);
    -webkit-backdrop-filter: var(--glass-blur);
    border-bottom: 1px solid rgba(var(--brand-primary-rgb), 0.1);
    padding: 0 2rem;
    display: flex;
    align-items: center;
    justify-content: space-between;
    position: sticky;
    top: 0;
    z-index: 999;
    box-shadow: 0 4px 20px rgba(var(--brand-primary-rgb), 0.05);
}

.main-header h2 {
    margin: 0;
    font-size: 1.5rem;
    font-weight: 700;
    color: #1f2937;
}

.header-left {
    display: flex;
    align-items: center;
    gap: 1rem;
}

.sidebar-toggle {
    display: none;
    background: none;
    border: none;
    color: var(--brand-primary);
    font-size: 1.5rem;
    cursor: pointer;
    padding: 0.5rem;
    border-radius: 8px;
    transition: var(--transition-fast);
}

.sidebar-toggle:hover {
    background: rgba(var(--brand-primary-rgb), 0.1);
}

.header-right {
    color: #6b7280;
    font-weight: 500;
    display: flex;
    align-items: center;
    gap: 0.65rem;
}

.header-center {
    flex: 1 1 auto;
    display: flex;
    justify-content: center;
    padding: 0 1rem;
    min-width: 0;
}

.scan-quick-search {
    position: relative;
    width: 100%;
    max-width: 360px;
}

.scan-quick-search .input-group-text {
    background: transparent;
    border-right: none;
    color: #6b7280;
}

.scan-quick-search .form-control {
    border-left: none;
}

.scan-quick-search .form-control:focus {
    box-shadow: 0 0 0 0.15rem rgba(var(--brand-primary-rgb), 0.15);
    border-color: var(--brand-primary);
}

.scan-quick-search-results {
    position: absolute;
    top: calc(100% + 4px);
    left: 0;
    right: 0;
    max-height: 400px;
    overflow-y: auto;
    background: #fff;
    border: 1px solid rgba(0, 0, 0, 0.08);
    border-radius: 8px;
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.12);
    z-index: 1050;
}

.scan-quick-search-item {
    display: block;
    width: 100%;
    text-align: left;
    padding: 0.5rem 0.75rem;
    background: #fff;
    border: none;
    border-bottom: 1px solid rgba(0, 0, 0, 0.05);
    cursor: pointer;
    transition: background 0.1s ease;
}

.scan-quick-search-item:last-child {
    border-bottom: none;
}

.scan-quick-search-item:hover,
.scan-quick-search-item.is-highlighted {
    background: rgba(var(--brand-primary-rgb), 0.08);
}

.scan-quick-search-meta {
    font-size: 0.75rem;
    color: #6b7280;
    margin-top: 0.1rem;
}

@media (max-width: 991px) {
    .header-center {
        display: none;
    }
}

.school-context {
    display: flex;
    flex-direction: column;
    align-items: flex-end;
    gap: 0.1rem;
    min-width: 180px;
}

.school-context-label {
    font-size: 0.64rem;
    text-transform: uppercase;
    letter-spacing: 0.08em;
    color: #9ca3af;
}

.school-context-select {
    min-width: 180px;
    max-width: 220px;
    min-height: 32px;
    padding-top: 0.1rem;
    padding-bottom: 0.1rem;
    padding-left: 0.8rem;
    border-radius: 999px;
    border-color: rgba(148, 163, 184, 0.28);
    background-color: rgba(255, 255, 255, 0.68);
    box-shadow: none;
    font-size: 0.78rem;
    font-weight: 500;
    color: #475569;
    line-height: 1.2;
}

.school-context-select:focus {
    border-color: rgba(148, 163, 184, 0.45);
    box-shadow: 0 0 0 0.12rem rgba(148, 163, 184, 0.12);
}

.help-faq-toggle {
    width: 34px;
    height: 34px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 0;
    border-radius: 999px;
}

.help-faq-drawer {
    width: min(760px, 96vw);
}

.help-faq-tabs {
    display: flex;
    flex-wrap: wrap;
    gap: 0.4rem;
}

.help-faq-item .card-body {
    padding: 1rem 1rem 0.9rem;
}

.help-faq-item ul {
    padding-left: 1.1rem;
}

.help-faq-item li {
    margin-bottom: 0.25rem;
}

.help-faq-screenshot {
    border: 1px dashed rgba(15, 23, 42, 0.2);
    border-radius: 10px;
    padding: 0.75rem;
    background: #fafafa;
}

.help-faq-screenshot img {
    width: 100%;
    height: auto;
    border-radius: 8px;
    border: 1px solid rgba(15, 23, 42, 0.08);
    display: block;
}

.help-faq-screenshot-caption {
    font-size: 0.82rem;
    color: #6b7280;
    margin-top: 0.5rem;
}

.help-faq-screenshot--placeholder {
    display: flex;
    align-items: center;
    gap: 0.6rem;
}

.help-faq-placeholder-icon {
    width: 32px;
    height: 32px;
    border-radius: 8px;
    background: #eef2ff;
    color: #4f46e5;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    flex: 0 0 32px;
}

.page-content {
    padding: 2rem;
}

/* ============================================
   GLASS CARDS - Liquid Glass Effect
   ============================================ */
.card {
    background: var(--glass-bg-strong);
    backdrop-filter: var(--glass-blur);
    -webkit-backdrop-filter: var(--glass-blur);
    border: 1px solid rgba(255, 255, 255, 0.5);
    border-radius: var(--border-radius);
    box-shadow: var(--glass-shadow);
    margin-bottom: 1.5rem;
    transition: var(--transition-smooth);
    overflow: hidden;
}

.card:hover {
    transform: translateY(-2px);
    box-shadow: 0 12px 40px rgba(var(--brand-primary-rgb), 0.2);
}

.card-header {
    background: linear-gradient(180deg, rgba(255,255,255,0.9) 0%, rgba(255,255,255,0.7) 100%);
    border-bottom: 1px solid rgba(var(--brand-primary-rgb), 0.1);
    padding: 1.25rem 1.5rem;
}

.card-title {
    font-weight: 700;
    color: #1f2937;
    margin: 0;
}

.card-body {
    padding: 1.5rem;
}

/* Allow dropdowns to overflow cards */
.card.filter-card {
    position: relative;
    z-index: 200;
    overflow: visible;
}

.card.filter-card .card-body {
    overflow: visible;
}

.card.filter-card .dropdown-menu {
    z-index: 300;
}

/* Ensure modal stays above filters */
body.modal-open .card.filter-card {
    z-index: 1;
}

.card.filter-card .dropdown-menu .form-select {
    min-width: 220px;
    max-width: 280px;
}

/* Filter chips (devices page — herbruikbaar) */
.devices-filter-chips .btn i.bi {
    margin-right: 0.35rem;
}
.devices-filter-chips .chip-value {
    font-weight: 700;
}
.devices-filter-chips .chip-x {
    margin-left: 0.45rem;
    margin-right: -0.15rem;
    opacity: 0.85;
    cursor: pointer;
    font-size: 0.95em;
}
.devices-filter-chips .chip-x:hover {
    opacity: 1;
}
.devices-filter-chips .chip-more-count {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 1.35rem;
    height: 1.35rem;
    padding: 0 0.4rem;
    background: #fff;
    color: var(--brand-primary);
    border-radius: 999px;
    font-size: 0.75rem;
    font-weight: 700;
    margin-left: 0.25rem;
}
.devices-filter-chips .filter-clear-all {
    font-weight: 500;
    text-decoration: none;
}
.devices-filter-chips .filter-clear-all:hover {
    color: var(--brand-primary) !important;
}

/* Searchable dropdown (Type, School) */
.card.filter-card .dropdown-menu.filter-search-dd {
    min-width: 280px;
    max-width: 340px;
    padding: 0;
    border: 1px solid #e9ecef;
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.08);
}
.filter-search-dd .filter-search-input {
    font-size: 0.88rem;
}
.filter-search-dd .filter-search-list {
    max-height: 280px;
    overflow-y: auto;
    padding: 0.35rem;
}

/* List dropdown (Status, Compliance etc.) */
.card.filter-card .dropdown-menu.filter-list-dd {
    min-width: 220px;
    border: 1px solid #e9ecef;
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.08);
}

/* Items binnen beide dropdown-types */
.filter-search-item {
    display: block;
    width: 100%;
    text-align: left;
    padding: 0.45rem 0.65rem;
    border: none;
    background: transparent;
    border-radius: 6px;
    font-size: 0.88rem;
    color: #495057;
    cursor: pointer;
}
.filter-search-item:hover {
    background: #f6f7f9;
    color: var(--brand-primary);
}
.filter-search-item.active {
    background: linear-gradient(135deg, #C94B7C, #E8737C);
    color: #fff;
    font-weight: 600;
}
.filter-search-item.filter-search-hidden {
    display: none;
}

/* "Meer" dropdown (formulier-stijl) */
.card.filter-card .dropdown-menu.filter-more-dd {
    min-width: 260px;
    border: 1px solid #e9ecef;
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.08);
}

/* Status legend + icons */
.status-legend .legend-label {
    font-size: 0.75rem;
    color: #6b7280;
    margin-right: 0.5rem;
}

.status-icons {
    display: inline-flex;
    gap: 6px;
    align-items: center;
    flex-wrap: wrap;
    min-width: 80px;
}

.table .btn-group.btn-group-sm {
    gap: 4px;
}

.table .btn-group.btn-group-sm .btn {
    padding: 0.25rem 0.45rem;
}

.status-icon {
    width: 24px;
    height: 24px;
    border-radius: 999px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-size: 0.8rem;
    box-shadow: 0 2px 6px rgba(0,0,0,0.08);
}

.status-icon--green { background: #10b9811a; color: #10b981; }
.status-icon--orange { background: #f59e0b1a; color: #f59e0b; }
.status-icon--red { background: #ef44441a; color: #ef4444; }
.status-icon--blue { background: #3b82f61a; color: #3b82f6; }
.status-icon--yellow { background: #facc151a; color: #f59e0b; }
.status-icon--gray { background: #6b72801a; color: #6b7280; }

/* ============================================
   STAT CARDS - Dashboard Statistics
   ============================================ */
.stat-card {
    background: var(--glass-bg-strong);
    backdrop-filter: var(--glass-blur);
    -webkit-backdrop-filter: var(--glass-blur);
    border: none;
    border-radius: var(--border-radius);
    box-shadow: var(--glass-shadow);
    transition: var(--transition-smooth);
    overflow: hidden;
    position: relative;
}

.stat-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 4px;
    background: var(--brand-gradient);
}

.stat-card:hover {
    transform: translateY(-4px);
    box-shadow: 0 16px 48px rgba(var(--brand-primary-rgb), 0.25);
}

.stat-card .card-body {
    display: flex;
    align-items: center;
    padding: 1.5rem;
}

.stat-icon {
    width: 64px;
    height: 64px;
    border-radius: 16px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.5rem;
    color: white;
    margin-right: 1.25rem;
    background: var(--brand-gradient);
    box-shadow: 0 8px 20px rgba(var(--brand-primary-rgb), 0.35);
}

.stat-content {
    flex: 1;
}

.stat-label {
    font-size: 0.85rem;
    color: #6b7280;
    margin-bottom: 0.35rem;
    font-weight: 500;
}

.stat-value {
    font-size: 1.85rem;
    font-weight: 800;
    color: #1f2937;
    line-height: 1;
}

/* Alternative stat icon colors */
.stat-icon.bg-success {
    background: linear-gradient(135deg, #10b981 0%, #34d399 100%) !important;
    box-shadow: 0 8px 20px rgba(16, 185, 129, 0.35);
}

.stat-icon.bg-warning {
    background: linear-gradient(135deg, #f59e0b 0%, #fbbf24 100%) !important;
    box-shadow: 0 8px 20px rgba(245, 158, 11, 0.35);
}

.stat-icon.bg-info {
    background: linear-gradient(135deg, #3b82f6 0%, #60a5fa 100%) !important;
    box-shadow: 0 8px 20px rgba(59, 130, 246, 0.35);
}

.stat-icon.bg-primary {
    background: var(--brand-gradient) !important;
    box-shadow: 0 8px 20px rgba(var(--brand-primary-rgb), 0.35);
}

/* ============================================
   TABLES - Glass Design
   ============================================ */
.table {
    margin-bottom: 0;
}

.table thead th {
    border-top: none;
    border-bottom: 2px solid rgba(var(--brand-primary-rgb), 0.15);
    font-weight: 700;
    text-transform: uppercase;
    font-size: 0.7rem;
    color: #6b7280;
    letter-spacing: 0.75px;
    padding: 1rem;
    background: rgba(255, 255, 255, 0.5);
}

.table thead th .th-label {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    white-space: nowrap;
}

.table thead th .th-label i {
    font-size: 0.75rem;
    line-height: 1;
}

.table tbody tr {
    transition: var(--transition-fast);
}

.table tbody tr:hover {
    background: rgba(var(--brand-primary-rgb), 0.04);
}

.table td {
    padding: 1rem;
    vertical-align: middle;
    border-color: rgba(var(--brand-primary-rgb), 0.08);
}

/* Keep wide tables usable even when Bootstrap table-responsive is unavailable */
.table-responsive {
    width: 100%;
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
}

/* Jamf devices-modal: de rij-acties-dropdown ("Bekijk details" e.d.) viel bij
   de laatste rijen weg achter de overflow van .table-responsive. Tijdens een
   geopend menu niet clippen, zodat het volledig zichtbaar is. Scoped op de
   Jamf-tabel + alleen bij een open menu, zodat horizontaal scrollen verder
   intact blijft. */
.table-responsive:has(.jamf-devices-table .dropdown-menu.show) {
    overflow: visible;
}

/* Unified in-panel table scrolling with sticky headers */
.data-grid-scroll {
    width: 100%;
    overflow: auto;
    max-height: min(68vh, 760px);
    scrollbar-gutter: stable both-edges;
    -webkit-overflow-scrolling: touch;
}

.data-grid-scroll .table {
    min-width: max-content;
}

.data-grid-scroll .table thead th {
    position: sticky;
    top: 0;
    z-index: 3;
    background: rgba(255, 255, 255, 0.94);
}

.devices-grid-scroll .table {
    min-width: 1320px;
}

/* Resizable Devices-tabel mag onder de algemene min-width zakken: de tabel-
   breedte volgt strikt de kolombreedtes (anders herverdeling-bug bij resize). */
.devices-grid-scroll .devices-overview-table {
    min-width: 0;
}

.software-usage-table {
    min-width: 1180px;
}

.software-register-table {
    min-width: 1660px;
}

/* Generiek voor alle software-tabellen (usage, register, parties).
   Klassen zijn al specifiek genoeg om alleen op resizable software-tabellen
   te werken — geen tabel-prefix nodig. */
thead th.software-resizable-col {
    position: sticky;
    user-select: none;
}

.software-col-resizer {
    position: absolute;
    right: -5px;
    top: 0;
    width: 10px;
    height: 100%;
    cursor: col-resize;
    z-index: 5;
}

.software-col-resizer::after {
    content: '';
    position: absolute;
    right: 4px;
    top: 20%;
    width: 2px;
    height: 60%;
    background: rgba(59, 63, 96, 0.25);
    border-radius: 1px;
}

.software-col-resizer:hover::after {
    background: rgba(13, 110, 253, 0.6);
    width: 3px;
}

.software-usage-table .usage-system-link {
    white-space: normal;
    line-height: 1.3;
}

body.software-resize-active {
    cursor: col-resize;
    user-select: none;
}

/* Devices-overzicht: resizable kolommen (zelfde pattern als software-usage).
   width: max-content + table-layout: fixed zorgt dat tabel exact de som van
   kolombreedtes is — geen herverdeling van extra ruimte over de kolommen.
   Zonder dit groeit een versmallende kolom visueel doordat ze een groter
   proportioneel deel van de extras krijgt. */
.devices-overview-table {
    table-layout: fixed;
    width: max-content;
}
.devices-overview-table th,
.devices-overview-table td {
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}
.devices-overview-table td:last-child {
    overflow: visible;
}
.devices-overview-table thead th.devices-resizable-col {
    position: sticky;
    user-select: none;
}
.devices-overview-table .devices-col-resizer {
    position: absolute;
    right: -5px;
    top: 0;
    width: 10px;
    height: 100%;
    cursor: col-resize;
    z-index: 5;
}
.devices-overview-table .devices-col-resizer::after {
    content: '';
    position: absolute;
    right: 4px;
    top: 20%;
    width: 2px;
    height: 60%;
    background: rgba(59, 63, 96, 0.25);
    border-radius: 1px;
}
body.devices-resize-active {
    cursor: col-resize;
    user-select: none;
}

.intune-review-table {
    /* min-width omhoog van 860 → 960 voor extra Type-kolom (min 92px breed).
       Daaronder schakelt CSS in deze file Suggesties/User/Type weg via @media. */
    min-width: 960px;
    table-layout: fixed;
}

/* Totaal van %-kolommen = 100. Bij wijzigen één breedte, herverdeel rest. */
.intune-review-table .col-select { width: 44px; }
.intune-review-table .col-device { width: 20%; }
.intune-review-table .col-type { width: 9%; min-width: 92px; }
.intune-review-table .col-serial { width: 13%; }
.intune-review-table .col-model { width: 14%; }
.intune-review-table .col-user { width: 11%; }
.intune-review-table .col-suggestions { width: 11%; }
.intune-review-table .col-school { width: 10%; }
.intune-review-table .col-action { width: 12%; min-width: 130px; }

/* Type-badge mag niet doorbreken (icoon + label op één regel) */
.intune-review-table .col-type .badge {
    white-space: nowrap;
    display: inline-block;
}

/* "Suggesties"-header niet kapot afbreken in tweekoppige header */
.intune-review-table th.col-suggestions {
    white-space: nowrap;
}

.intune-review-table td {
    overflow-wrap: anywhere;
    word-break: break-word;
    padding: 0.65rem 0.55rem;
}

.intune-review-table th {
    padding: 0.65rem 0.55rem;
}

.intune-review-table .col-action .btn {
    white-space: nowrap;
    padding: 0.35rem 0.55rem;
    font-size: 0.8rem;
}

.intune-review-table .col-action .d-flex {
    justify-content: flex-start;
}

.intune-review-table .intune-device-id {
    word-break: break-all;
    font-size: 0.75rem;
}

.intune-review-table .intune-school-select {
    min-width: 130px;
    max-width: 180px;
}

.intune-review-summary .badge {
    font-size: 0.8rem;
    padding: 0.45rem 0.65rem;
}

@media (max-width: 1440px) {
    .intune-review-table .col-suggestions {
        display: none;
    }
}

@media (max-width: 1260px) {
    .intune-review-table .col-user {
        display: none;
    }
}

@media (max-width: 1100px) {
    .intune-review-table .col-type {
        display: none;
    }
}

/* Sortable columns */
.table th.sortable {
    cursor: pointer;
    user-select: none;
}

.table th.sortable:hover {
    background: rgba(var(--brand-primary-rgb), 0.08);
}

/* ============================================
   BUTTONS - Branded (tenant-thema via CSS-variabelen)
   ============================================ */
.btn {
    border-radius: var(--border-radius-sm);
    font-weight: 600;
    padding: 0.6rem 1.25rem;
    transition: var(--transition-smooth);
    border: none;
}

.btn-primary {
    background: var(--brand-gradient);
    color: white;
    box-shadow: 0 4px 15px rgba(var(--brand-primary-rgb), 0.3);
}

.btn-primary:hover {
    background: var(--brand-gradient-hover);
    transform: translateY(-1px);
    box-shadow: 0 6px 20px rgba(var(--brand-primary-rgb), 0.4);
    color: white;
}

.btn-primary:active {
    transform: translateY(0);
}

.btn-outline-primary {
    border: 2px solid var(--brand-primary);
    color: var(--brand-primary);
    background: transparent;
}

.btn-outline-primary:hover {
    background: var(--brand-gradient);
    border-color: transparent;
    color: white;
}

.btn-sm {
    padding: 0.35rem 0.85rem;
    font-size: 0.85rem;
    border-radius: 8px;
}

.btn-light {
    background: var(--glass-bg);
    border: 1px solid rgba(var(--brand-primary-rgb), 0.2);
    color: #374151;
}

.btn-light:hover {
    background: var(--glass-bg-strong);
    border-color: rgba(var(--brand-primary-rgb), 0.3);
}

/* ============================================
   FORMS - Glass Style
   ============================================ */
.form-control, .form-select {
    border-radius: var(--border-radius-sm);
    border: 1px solid rgba(var(--brand-primary-rgb), 0.2);
    padding: 0.7rem 1rem;
    transition: var(--transition-fast);
    background: var(--glass-bg);
}

.form-control:focus, .form-select:focus {
    border-color: var(--brand-primary);
    box-shadow: 0 0 0 3px rgba(var(--brand-primary-rgb), 0.15);
    background: white;
}

.form-label {
    font-weight: 600;
    margin-bottom: 0.5rem;
    color: #374151;
}

/* ============================================
   BADGES - Status Indicators
   ============================================ */
.badge {
    font-weight: 600;
    padding: 0.45em 0.85em;
    border-radius: 20px;
    font-size: 0.75rem;
}

.badge.bg-success {
    background: linear-gradient(135deg, #10b981 0%, #34d399 100%) !important;
}

.badge.bg-warning {
    background: linear-gradient(135deg, #f59e0b 0%, #fbbf24 100%) !important;
    color: #1f2937 !important;
}

.badge.bg-danger {
    background: linear-gradient(135deg, #ef4444 0%, #f87171 100%) !important;
}

.badge.bg-info {
    background: linear-gradient(135deg, #3b82f6 0%, #60a5fa 100%) !important;
}

.badge.bg-primary {
    background: var(--brand-gradient) !important;
}

/* ============================================
   MODALS - Glass Design
   ============================================ */
.modal-content {
    background: #ffffff;
    border: 1px solid rgba(var(--brand-primary-rgb), 0.2);
    border-radius: var(--border-radius);
    box-shadow: 0 25px 50px rgba(0, 0, 0, 0.25);
}

.modal-header {
    border-bottom: 1px solid rgba(var(--brand-primary-rgb), 0.15);
    padding: 1rem 1.25rem;
    background: #fafafa;
}

.modal-title {
    font-weight: 700;
    color: #1f2937;
    font-size: 1.1rem;
}

.modal-body {
    padding: 1.25rem;
    background: #ffffff;
}

#deviceDetailModal .modal-body {
    padding-top: 0.4rem !important;
}

#deviceDetailModal .modal-body .nav-tabs {
    margin-top: 0 !important;
    padding-top: 0 !important;
}

.modal-footer {
    border-top: 1px solid rgba(var(--brand-primary-rgb), 0.15);
    padding: 0.85rem 1.25rem;
    background: #fafafa;
}

/* Device Details Modal - Compact Layout */
#deviceDetailModal .modal-body dl {
    margin-bottom: 0.75rem;
}

#deviceDetailModal .modal-body dt {
    font-weight: 600;
    color: #6b7280;
    font-size: 0.85rem;
    margin-bottom: 0.15rem;
    margin-top: 0.5rem;
}

#deviceDetailModal .modal-body dt:first-child {
    margin-top: 0;
}

#deviceDetailModal .modal-body dd {
    color: #1f2937;
    margin-bottom: 0;
    font-size: 0.95rem;
    padding-bottom: 0.35rem;
    border-bottom: 1px solid #f3f4f6;
}

#deviceDetailModal .modal-body h6 {
    font-size: 1rem;
    font-weight: 700;
    color: var(--brand-primary);
    margin-top: 0.75rem;
    margin-bottom: 0.5rem;
    padding-bottom: 0.35rem;
    border-bottom: 2px solid rgba(var(--brand-primary-rgb), 0.15);
}

#deviceDetailModal .modal-body h6:first-child {
    margin-top: 0;
}

#deviceDetailModal .modal-body .row > div {
    padding-bottom: 0.5rem;
}

/* Device Form Modal - Compact */
#deviceFormModal .form-label {
    font-size: 0.9rem;
    margin-bottom: 0.35rem;
    font-weight: 600;
}

#deviceFormModal .form-control,
#deviceFormModal .form-select {
    font-size: 0.9rem;
    padding: 0.5rem 0.75rem;
}

#deviceFormModal .row.g-3 {
    row-gap: 0.75rem !important;
}

#deviceFormModal .device-form-step {
    border-left: 3px solid var(--brand-primary);
    padding-left: 0.75rem;
}

/* Nav Tabs in Modals */
.modal-body .nav-tabs {
    margin-bottom: 1rem;
    border-bottom: 2px solid #e5e7eb;
}

.modal-body .nav-tabs .nav-link {
    color: #6b7280;
    font-weight: 500;
    padding: 0.6rem 1rem;
    border: none;
    border-bottom: 2px solid transparent;
    margin-bottom: -2px;
}

.modal-body .nav-tabs .nav-link:hover {
    color: var(--brand-primary);
    border-color: transparent;
}

.modal-body .nav-tabs .nav-link.active {
    color: var(--brand-primary);
    border-bottom-color: var(--brand-primary);
    background: transparent;
}

/* Accessories tables aligned */
.accessories-table {
    table-layout: fixed;
    width: 100%;
}

.accessories-table th:nth-child(1),
.accessories-table td:nth-child(1) {
    width: 40%;
}

.accessories-table th:nth-child(2),
.accessories-table td:nth-child(2) {
    width: 14%;
}

.accessories-table th:nth-child(3),
.accessories-table td:nth-child(3) {
    width: 18%;
}

.accessories-table th:nth-child(4),
.accessories-table td:nth-child(4) {
    width: 12%;
}

.accessories-table th:nth-child(5),
.accessories-table td:nth-child(5) {
    width: 16%;
    text-align: right;
    white-space: nowrap;
}

.accessories-table th {
    vertical-align: middle;
}

.accessories-table td {
    vertical-align: middle;
}

/* Compact Alert in Modals */
.modal-body .alert {
    padding: 0.75rem;
    margin-bottom: 0.75rem;
    font-size: 0.9rem;
}

/* Responsive Modal Adjustments */
@media (max-width: 768px) {
    .modal-dialog {
        margin: 0.5rem;
    }

    .modal-xl,
    .modal-lg {
        max-width: 100%;
    }

    #deviceDetailModal .modal-body h6 {
        font-size: 0.95rem;
        margin-top: 1rem;
    }

    #deviceDetailModal .modal-body dt {
        font-size: 0.8rem;
    }

    #deviceDetailModal .modal-body dd {
        font-size: 0.9rem;
    }

    .modal-header {
        padding: 0.85rem 1rem;
    }

    .modal-title {
        font-size: 1rem;
    }

    .modal-body {
        padding: 1rem;
    }

    .modal-footer {
        padding: 0.75rem 1rem;
    }

    .modal-footer .btn {
        padding: 0.45rem 0.85rem;
        font-size: 0.85rem;
    }
}

@media (max-width: 576px) {
    .modal-dialog {
        margin: 0.25rem;
    }

    #deviceDetailModal .col-md-6 {
        margin-bottom: 0.5rem;
    }

    .modal-body .nav-tabs .nav-link {
        padding: 0.5rem 0.65rem;
        font-size: 0.85rem;
    }
}

/* ============================================
   TOAST NOTIFICATIONS
   ============================================ */
.toast {
    background: var(--glass-bg-strong);
    backdrop-filter: var(--glass-blur);
    -webkit-backdrop-filter: var(--glass-blur);
    border: 1px solid rgba(255, 255, 255, 0.5);
    border-radius: var(--border-radius-sm);
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.15);
    min-width: 320px;
}

.toast.bg-success {
    border-left: 4px solid #10b981;
}

.toast.bg-danger {
    border-left: 4px solid #ef4444;
}

.toast.bg-warning {
    border-left: 4px solid #f59e0b;
}

/* ============================================
   LOADING OVERLAY
   ============================================ */
.loading-overlay {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(255, 255, 255, 0.8);
    backdrop-filter: blur(8px);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 9999;
}

.loading-overlay .spinner-border {
    width: 3rem;
    height: 3rem;
    color: var(--brand-primary);
}

/* ============================================
   SSO / DIVIDER
   ============================================ */
.divider {
    display: flex;
    align-items: center;
    text-align: center;
}

.divider::before,
.divider::after {
    content: '';
    flex: 1;
    border-bottom: 1px solid rgba(var(--brand-primary-rgb), 0.2);
}

.divider-text {
    padding: 0 1rem;
    color: #9ca3af;
    font-size: 0.85rem;
    font-weight: 500;
}

/* Microsoft Login Button */
.btn-microsoft {
    background: white;
    border: 1px solid #e5e7eb;
    color: #374151;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 12px;
    padding: 12px 20px;
    font-weight: 600;
    font-size: 0.95rem;
    transition: var(--transition-smooth);
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.06);
}

.btn-microsoft:hover {
    background: #f9fafb;
    border-color: #d1d5db;
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
    color: #1f2937;
}

.btn-microsoft svg {
    flex-shrink: 0;
}

/* ============================================
   ALERTS
   ============================================ */
.alert {
    border: none;
    border-radius: var(--border-radius-sm);
    padding: 1rem 1.25rem;
}

.alert-danger {
    background: rgba(239, 68, 68, 0.1);
    color: #dc2626;
    border-left: 4px solid #ef4444;
}

.alert-success {
    background: rgba(16, 185, 129, 0.1);
    color: #059669;
    border-left: 4px solid #10b981;
}

.alert-warning {
    background: rgba(245, 158, 11, 0.1);
    color: #d97706;
    border-left: 4px solid #f59e0b;
}

.alert-info {
    background: rgba(59, 130, 246, 0.1);
    color: #2563eb;
    border-left: 4px solid #3b82f6;
}

/* Compacte introductiebalken bovenaan pagina's */
.page-content > .alert.alert-info.mb-4:not(.d-flex) {
    padding: 0.75rem 1rem;
}

.page-content > .alert.alert-info.mb-4:not(.d-flex) > .alert-heading {
    margin-bottom: 0.25rem;
    font-size: 1.05rem;
    line-height: 1.25;
}

.page-content > .alert.alert-info.mb-4:not(.d-flex) > p.mb-0 {
    margin-bottom: 0;
    font-size: 0.9rem;
    line-height: 1.35;
    opacity: 0.95;
}

@media (min-width: 992px) {
    .page-content > .alert.alert-info.mb-4:not(.d-flex) {
        display: flex;
        align-items: baseline;
        gap: 0.9rem;
    }

    .page-content > .alert.alert-info.mb-4:not(.d-flex) > .alert-heading {
        margin-bottom: 0;
        flex: 0 0 auto;
    }

    .page-content > .alert.alert-info.mb-4:not(.d-flex) > p.mb-0 {
        flex: 1 1 auto;
    }
}

/* ============================================
   UTILITIES
   ============================================ */
.text-muted-light {
    color: rgba(255, 255, 255, 0.6) !important;
}

.bg-gradient-primary {
    background: var(--brand-gradient) !important;
}

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

/* Glass panel utility */
.glass-panel {
    background: var(--glass-bg);
    backdrop-filter: var(--glass-blur);
    -webkit-backdrop-filter: var(--glass-blur);
    border: 1px solid rgba(255, 255, 255, 0.5);
    border-radius: var(--border-radius);
}

/* ============================================
   RESPONSIVE DESIGN
   ============================================ */
@media (max-width: 1024px) {
    :root {
        --sidebar-width: 220px;
    }
    
    .stat-card .card-body {
        padding: 1.25rem;
    }
    
    .stat-value {
        font-size: 1.5rem;
    }
    
    .stat-icon {
        width: 56px;
        height: 56px;
        font-size: 1.3rem;
    }
}

@media (max-width: 768px) {
    .sidebar {
        position: fixed;
        transform: translateX(-100%);
        transition: transform var(--transition-smooth);
        width: 280px;
        z-index: 1050;
    }
    
    .sidebar.active {
        transform: translateX(0);
    }
    
    .main-content {
        margin-left: 0;
    }
    
    .main-header {
        padding: 0 1rem;
    }

    .help-faq-drawer {
        width: 100vw;
    }
    
    .sidebar-toggle {
        display: block;
    }
    
    .page-content {
        padding: 1rem;
    }
    
    .stat-card {
        margin-bottom: 1rem;
    }
    
    .stat-card .card-body {
        padding: 1rem;
        flex-direction: column;
        text-align: center;
    }
    
    .stat-icon {
        margin-right: 0;
        margin-bottom: 0.75rem;
    }

    .admin-issue {
        flex-direction: column;
        align-items: flex-start;
    }

    .admin-issue-meta {
        text-align: left;
        min-width: 0;
    }

    .admin-issue-message {
        white-space: normal;
    }
    
    .stat-value {
        font-size: 1.35rem;
    }
    
    .card {
        margin-bottom: 1rem;
    }
    
    .login-box {
        margin: 1rem;
        padding: 2rem;
    }
    
    .login-logo {
        width: 140px;
    }
}

@media (max-width: 576px) {
    :root {
        --header-height: 56px;
        --border-radius: 12px;
        --border-radius-sm: 8px;
    }
    
    .main-header h2 {
        font-size: 1.15rem;
    }

    .school-context {
        min-width: 140px;
    }

    .school-context-label {
        display: none;
    }

    .school-context-select {
        min-width: 140px;
        max-width: 160px;
        min-height: 30px;
        font-size: 0.74rem;
    }
    
    .page-content {
        padding: 0.75rem;
    }
    
    .stat-label {
        font-size: 0.75rem;
    }
    
    .stat-value {
        font-size: 1.15rem;
    }
    
    .stat-icon {
        width: 48px;
        height: 48px;
        font-size: 1.1rem;
    }
    
    .alert {
        padding: 0.75rem;
        font-size: 0.875rem;
    }
    
    .card-header {
        padding: 0.85rem 1rem;
    }
    
    .card-body {
        padding: 1rem;
    }
    
    .table {
        font-size: 0.8rem;
    }
    
    .table td, .table th {
        padding: 0.65rem;
    }
    
    .btn {
        padding: 0.5rem 1rem;
        font-size: 0.85rem;
    }
    
    .modal-content {
        margin: 0.5rem;
    }
}

.cursor-pointer { cursor: pointer; }

/* ============================================
   SCROLLBAR STYLING
   ============================================ */
::-webkit-scrollbar {
    width: 8px;
    height: 8px;
}

::-webkit-scrollbar-track {
    background: rgba(var(--brand-primary-rgb), 0.05);
}

::-webkit-scrollbar-thumb {
    background: rgba(var(--brand-primary-rgb), 0.2);
    border-radius: 4px;
}

::-webkit-scrollbar-thumb:hover {
    background: rgba(var(--brand-primary-rgb), 0.35);
}

/* Sidebar scrollbar */
.sidebar::-webkit-scrollbar {
    width: 4px;
}

.sidebar::-webkit-scrollbar-thumb {
    background: rgba(255, 255, 255, 0.2);
}

/* ============================================
   ANIMATIONS
   ============================================ */
@keyframes fadeIn {
    from { opacity: 0; transform: translateY(10px); }
    to { opacity: 1; transform: translateY(0); }
}

.card, .stat-card {
    animation: fadeIn 0.3s ease-out;
}

/* Quick action links */
.list-group-item-action {
    border: none;
    border-radius: var(--border-radius-sm);
    margin-bottom: 0.5rem;
    transition: var(--transition-fast);
    color: #374151;
}

.list-group-item-action:hover {
    background: rgba(var(--brand-primary-rgb), 0.08);
    color: var(--brand-primary);
    transform: translateX(4px);
}

.list-group-item-action i {
    color: var(--brand-primary);
}

/* Software request match list alignment */
.req-system-match-row {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 0.75rem;
}

.req-system-match-main {
    flex: 1 1 auto;
    min-width: 0;
}

.req-system-match-name {
    white-space: normal;
    line-height: 1.3;
    text-align: left;
}

.req-system-match-meta {
    display: flex;
    align-items: center;
    justify-content: flex-end;
    gap: 0.5rem;
    flex: 0 0 auto;
    min-width: 245px;
}

.req-system-match-status,
.req-system-match-state,
.req-system-match-add {
    white-space: nowrap;
}

.req-system-match-add {
    min-width: 190px;
}

@media (max-width: 576px) {
    .req-system-match-row {
        flex-direction: column;
        align-items: stretch;
    }

    .req-system-match-meta {
        min-width: 0;
        justify-content: flex-start;
        flex-wrap: wrap;
    }
}

/* Devices KPI overview responsiveness */
.devices-kpi-col {
    min-width: 0;
}

.devices-kpi-item {
    min-width: 0;
    height: 100%;
}

.devices-kpi-content {
    min-width: 0;
}

.devices-kpi-year-breakdown {
    overflow-wrap: anywhere;
}

.devices-kpi-action {
    flex-shrink: 0;
    white-space: nowrap;
}

.devices-kpi-item--replacement {
    display: grid;
    grid-template-columns: auto minmax(0, 1fr) auto;
    align-items: center;
    column-gap: 0.5rem;
}

@media (max-width: 1599.98px) {
    .devices-kpi-item--replacement {
        grid-template-columns: auto minmax(0, 1fr);
        align-items: start;
    }

    .devices-kpi-item--replacement .devices-kpi-action {
        grid-column: 2;
        justify-self: start;
        margin-top: 0.35rem;
    }
}

/* ============================================
   Lifecycle pill-badges + nav-counter (taak 20260430-001)
   ============================================ */
.lifecycle-pill {
    display: inline-block;
    padding: 0.15rem 0.55rem;
    border-radius: 999px;
    font-size: 0.78rem;
    font-weight: 600;
    line-height: 1.4;
    border: 1px solid transparent;
    white-space: nowrap;
}
.lifecycle-pill--actief {
    background: #d1fae5;
    color: #065f46;
    border-color: #6ee7b7;
}
.lifecycle-pill--reserve {
    background: #dbeafe;
    color: #1e40af;
    border-color: #93c5fd;
}
.lifecycle-pill--uit_gebruik {
    background: #fef3c7;
    color: #92400e;
    border-color: #fcd34d;
}
.lifecycle-pill--afgevoerd {
    background: #e5e7eb;
    color: #374151;
    border-color: #9ca3af;
}

.nav-counter {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 1.5em;
    margin-left: auto;
    padding: 0.1em 0.4em;
    background: rgba(255, 255, 255, 0.18);
    color: rgba(255, 255, 255, 0.85);
    border-radius: 999px;
    font-size: 0.72rem;
    font-weight: 600;
}
.nav-counter:empty {
    display: none;
}

/* Intune review-queue banner */
.intune-review-banner {
    background: linear-gradient(135deg, #fef3c7 0%, #fed7aa 100%);
    border: 1px solid #fcd34d;
    border-radius: var(--border-radius-sm, 10px);
    padding: 0.85rem 1rem;
    margin-bottom: 1rem;
    display: flex;
    align-items: center;
    gap: 0.75rem;
    color: #78350f;
}
.intune-review-banner .bi {
    font-size: 1.4rem;
}
.intune-review-banner .review-banner-actions {
    margin-left: auto;
    display: flex;
    gap: 0.5rem;
}

/* Empty-state Reserve-pagina */
.reserve-empty-state {
    text-align: center;
    padding: 3rem 1.5rem;
    color: var(--bs-body-color, #4b5563);
    max-width: 540px;
    margin: 2rem auto;
}
.reserve-empty-state .bi {
    font-size: 2.5rem;
    color: #9ca3af;
    display: block;
    margin-bottom: 0.75rem;
}

/* Lifecycle undo-toast — GRIP-gradient + lopende progress-bar (30s). */
.lcm-toast-wrap {
    position: fixed;
    bottom: 1.5rem;
    right: 1.5rem;
    z-index: 1090;
    pointer-events: none;
    animation: lcmToastIn 220ms ease-out;
}
.lcm-toast-wrap.lcm-toast-hide {
    animation: lcmToastOut 220ms ease-in forwards;
}
.lcm-toast {
    pointer-events: auto;
    min-width: 320px;
    max-width: 420px;
    background: var(--brand-gradient);
    color: #fff;
    border-radius: 12px;
    box-shadow: 0 10px 30px rgba(var(--brand-primary-rgb), 0.35);
    overflow: hidden;
}
.lcm-toast-body {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding: 0.85rem 1rem;
}
.lcm-toast-message {
    flex: 1;
    font-weight: 500;
    line-height: 1.3;
}
.lcm-toast-undo {
    background: rgba(255, 255, 255, 0.18);
    color: #fff;
    border: 1px solid rgba(255, 255, 255, 0.35);
    border-radius: 8px;
    padding: 0.35rem 0.7rem;
    font-size: 0.85rem;
    font-weight: 600;
    cursor: pointer;
    transition: background 120ms ease;
    white-space: nowrap;
}
.lcm-toast-undo:hover:not(:disabled) {
    background: rgba(255, 255, 255, 0.32);
}
.lcm-toast-undo:disabled {
    opacity: 0.7;
    cursor: wait;
}
.lcm-toast-close {
    background: transparent;
    border: none;
    color: rgba(255, 255, 255, 0.85);
    cursor: pointer;
    padding: 0.25rem;
    border-radius: 6px;
    transition: background 120ms ease;
}
.lcm-toast-close:hover {
    background: rgba(255, 255, 255, 0.18);
    color: #fff;
}
.lcm-toast-progress {
    height: 3px;
    background: rgba(255, 255, 255, 0.2);
}
.lcm-toast-progress-bar {
    height: 100%;
    width: 100%;
    background: rgba(255, 255, 255, 0.85);
    transform-origin: left center;
    animation-name: lcmToastProgress;
    animation-timing-function: linear;
    animation-fill-mode: forwards;
}
@keyframes lcmToastIn {
    from { opacity: 0; transform: translateY(10px); }
    to   { opacity: 1; transform: translateY(0); }
}
@keyframes lcmToastOut {
    from { opacity: 1; transform: translateY(0); }
    to   { opacity: 0; transform: translateY(10px); }
}
@keyframes lcmToastProgress {
    from { transform: scaleX(1); }
    to   { transform: scaleX(0); }
}

/* ====================================================================
 * Software & Keten — v2 UI (feature-flag `software_v2`)
 * KPI-tegels gebruiken het bestaande .stat-card patroon (zie admin-dashboard)
 * voor visuele consistentie.
 * ==================================================================== */
#softwareViewSwitcherV2 .btn.active {
    box-shadow: inset 0 -2px 0 currentColor;
}

/* Moderne v2-tabel: card-wrap, geen stripes, subtiele rij-separator, hover-state */
.v2-table-card {
    border: 1px solid var(--bs-border-color, #e5e7eb);
    border-radius: 0.75rem;
    overflow: hidden;
    background: var(--bs-card-bg, #fff);
}
.v2-table-card .table-responsive {
    margin: 0;
}
.v2-modern-table {
    margin-bottom: 0;
    background: transparent;
}
.v2-modern-table > thead > tr > th {
    background: var(--bs-tertiary-bg, #f8f9fa);
    color: var(--bs-secondary-color, #6c757d);
    font-size: 0.72rem;
    text-transform: uppercase;
    letter-spacing: 0.06em;
    font-weight: 600;
    border-bottom: 1px solid var(--bs-border-color, #e5e7eb);
    padding: 0.65rem 0.9rem;
    white-space: nowrap;
}
.v2-modern-table > tbody > tr {
    transition: background-color 0.12s ease;
}
.v2-modern-table > tbody > tr > td {
    padding: 0.7rem 0.9rem;
    border-bottom: 1px solid rgba(0,0,0,0.05);
    vertical-align: middle;
}
.v2-modern-table > tbody > tr:last-child > td {
    border-bottom: 0;
}
.v2-modern-table > tbody > tr:hover {
    background-color: rgba(13,110,253,0.04);
}
.v2-modern-table .btn-link {
    text-decoration: none;
    color: var(--bs-body-color, #212529);
    font-weight: 500;
}
.v2-modern-table .btn-link:hover {
    color: var(--bs-primary, #0d6efd);
    text-decoration: underline;
}

/* Sticky-header in v2-tabel binnen scroll-container */
.v2-table-card .data-grid-scroll {
    max-height: min(68vh, 760px);
}
.v2-table-card .data-grid-scroll .v2-modern-table thead th {
    position: sticky;
    top: 0;
    z-index: 3;
    background: var(--bs-tertiary-bg, #f8f9fa);
}

/* Moderne system-detail modal — v2 stijl */
.system-detail-v2 .detail-hero {
    background: linear-gradient(135deg, rgba(13,110,253,0.06), rgba(99,102,241,0.04));
    border-radius: 0.75rem;
    padding: 1rem 1.25rem;
    margin-bottom: 1rem;
    border: 1px solid var(--bs-border-color, #e5e7eb);
}
.system-detail-v2 .detail-hero h4 {
    margin-bottom: 0.25rem;
    font-weight: 700;
}
.system-detail-v2 .detail-hero .badge {
    font-weight: 500;
    padding: 0.4em 0.7em;
}
.system-detail-v2 .info-card {
    border: 1px solid var(--bs-border-color, #e5e7eb);
    border-radius: 0.625rem;
    padding: 0.85rem 1rem;
    height: 100%;
    background: var(--bs-card-bg, #fff);
}
.system-detail-v2 .info-card .info-label {
    font-size: 0.72rem;
    text-transform: uppercase;
    letter-spacing: 0.06em;
    color: var(--bs-secondary-color, #6c757d);
    font-weight: 600;
    margin-bottom: 0.15rem;
}
.system-detail-v2 .info-card .info-value {
    font-size: 0.95rem;
    color: var(--bs-body-color, #212529);
}
.system-detail-v2 .info-card .info-value .btn-link {
    padding: 0;
    text-decoration: none;
    font-weight: 600;
}
.system-detail-v2 .section-heading {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    font-size: 0.8rem;
    text-transform: uppercase;
    letter-spacing: 0.08em;
    color: var(--bs-secondary-color, #6c757d);
    font-weight: 600;
    margin: 1.25rem 0 0.5rem 0;
}
.system-detail-v2 .section-heading i {
    color: var(--bs-primary, #0d6efd);
}

/* Beheer-offcanvas — breed paneel met side-nav + content */
.software-beheer-offcanvas-v2 {
    width: min(1200px, 96vw) !important;
}
.software-beheer-offcanvas-v2 .offcanvas-body {
    overflow: hidden; /* #softwareBeheerContent scrolt zelf */
}
.software-beheer-nav-v2 {
    min-width: 300px;
    max-width: 300px;
    background-color: var(--bs-tertiary-bg, #f8f9fa);
    overflow-y: auto;
}
.software-beheer-nav-v2 .beheer-nav-link {
    color: var(--bs-body-color);
    border-radius: 0.5rem;
    padding: 0.55rem 0.7rem;
    margin-bottom: 0.2rem;
    transition: background-color 0.12s ease;
    white-space: normal; /* sta wrap toe binnen knop */
}
.software-beheer-nav-v2 .beheer-nav-link:hover {
    background-color: rgba(13,110,253,0.08);
}
.software-beheer-nav-v2 .beheer-nav-link.active {
    background-color: var(--bs-primary);
    color: #fff;
}
.software-beheer-nav-v2 .beheer-nav-link.active .opacity-75 {
    opacity: 0.9 !important;
}
.software-beheer-nav-v2 .min-width-0 { min-width: 0; }
.software-beheer-nav-v2 .beheer-nav-title {
    line-height: 1.2;
    word-break: normal;
    overflow-wrap: anywhere;
}
.software-beheer-nav-v2 .beheer-nav-subtitle {
    line-height: 1.2;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
    text-overflow: ellipsis;
}
#softwareBeheerContent .table-responsive {
    overflow-x: auto;
}
#softwareBeheerContent .table {
    font-size: 0.875rem;
}
#softwareBeheerContent .table > :not(caption) > * > * {
    padding-top: 0.4rem;
    padding-bottom: 0.4rem;
}
#softwareBeheerContent h5 {
    margin-bottom: 0.25rem;
}

@media (max-width: 992px) {
    .software-beheer-offcanvas-v2 { width: 100% !important; }
    .software-beheer-offcanvas-v2 .offcanvas-body { flex-direction: column !important; }
    .software-beheer-nav-v2 {
        min-width: 0 !important;
        max-width: none !important;
        border-right: 0 !important;
        border-bottom: 1px solid var(--bs-border-color);
    }
    .software-beheer-nav-v2 .nav-pills {
        flex-direction: row !important;
        flex-wrap: wrap;
    }
    .software-beheer-nav-v2 .nav-item {
        flex: 1 1 auto;
    }
}

/* ============================================
   A11Y — Kompas koppeling-badges & dekking-toestanden (WCAG AA)
   Concept (Pixel, 2026-06-07). Presentatie-only; geen logica.
   Doel:
   - Tekstkleur/achtergrond comfortabel >= 4.5:1 (Bootstrap text-bg-*
     defaults halen 4.53:1 = AA maar zonder marge; hier verstevigd).
   - Betekenis NOOIT alleen via kleur (B3): elke toestand heeft tekst +
     vorm-onderscheidend icoon (aria-hidden) + een niet-kleur rand-hook
     (data-coverage-level), zodat kleurenblinden/SR's de toestand
     onderscheiden. Iconen zijn decoratief; aria-label/tekst draagt de
     betekenis.
   ============================================ */

/* Verstevig het contrast van de gekleurde koppeling-badges.
   Scoped op .grip-a11y-badge zodat overige badges ongemoeid blijven. */
.badge.grip-a11y-badge.text-bg-success {
    background-color: #146c43 !important; /* #fff -> 6.45:1 */
    color: #fff !important;
}
.badge.grip-a11y-badge.text-bg-danger {
    background-color: #b02a37 !important; /* #fff -> 6.50:1 */
    color: #fff !important;
}
.badge.grip-a11y-badge.text-bg-secondary {
    background-color: #5c636a !important; /* #fff -> 6.09:1 */
    color: #fff !important;
}
/* warning blijft #000 op #ffc107 (12.88:1) — al ruim AA. */
.badge.grip-a11y-badge.text-bg-warning {
    color: #000 !important;
}
/* Link-badge (Bewerk in Kompas) houdt witte tekst, ook bij :hover/:focus. */
a.badge.grip-a11y-badge.text-bg-secondary:hover,
a.badge.grip-a11y-badge.text-bg-secondary:focus {
    background-color: #4a5057 !important;
    color: #fff !important;
}
/* Zichtbare toetsenbord-focus op de doorklik-badge. */
a.badge.grip-a11y-badge:focus-visible {
    outline: 2px solid #052c65;
    outline-offset: 2px;
}

/* Niet-kleur-onderscheid voor de drie dekking-toestanden (B3):
   een linkerrand-accent per toestand, naast tekst + vorm-icoon.
   Zo is de toestand ook zonder kleurperceptie af te lezen. */
.badge.grip-coverage-badge {
    border-left: 4px solid rgba(255, 255, 255, 0.85);
}
.badge.grip-coverage-badge[data-coverage-level="arranged"] {
    border-left-style: solid;
}
.badge.grip-coverage-badge[data-coverage-level="arranged_unverified"] {
    border-left-style: dotted;
}
.badge.grip-coverage-badge[data-coverage-level="at_publisher"] {
    border-left-style: dashed;
    border-left-color: rgba(0, 0, 0, 0.55);
}
.badge.grip-coverage-badge[data-coverage-level="none"] {
    border-left-style: double;
    border-left-width: 5px;
}

/* Bevroren-notice: GRIP's globale .alert-warning tekstkleur (#d97706)
   haalt slechts ~2.95:1 op de tint — onder AA. Verhoog naar Bootstrap's
   warning-text-emphasis (#664d03 -> 7.39:1) voor deze notice. */
.alert.grip-a11y-alert-warning {
    color: #664d03;
}
.alert.grip-a11y-alert-warning .small {
    color: #664d03;
}

/* Print/PDF-export (o.a. gespreksoverzicht + aanbestedingssignaal): browsers
   printen achtergrondkleuren standaard niet, waardoor badges met witte tekst op
   een gekleurde achtergrond onleesbaar worden en kleur-gecodeerde rijen hun
   betekenis verliezen. Forceer leesbare, kleur-onafhankelijke weergave (WCAG +
   zwart-wit-print). */
@media print {
    .badge {
        background: transparent !important;
        color: #000 !important;
        border: 1px solid #000 !important;
        box-shadow: none !important;
    }
    /* Markeer overschrijding-rijen met een rand i.p.v. een achtergrondkleur. */
    .table-danger,
    .table-danger > td,
    .table-danger > th {
        background: transparent !important;
    }
    .table-danger > td:first-child {
        border-left: 4px solid #000 !important;
    }
    /* Actie-/navigatieknoppen horen niet in een afdruk. */
    .btn {
        display: none !important;
    }
}
