/* ============================================
   UI Components Styles
   Reusable component library
   ============================================ */

/* ====================
   Risk Score Display
   ==================== */
.risk-score {
    padding: 1rem;
    border-radius: var(--r-lg);
    text-align: center;
    font-size: 1.5rem;
    font-weight: bold;
}

.risk-level-critical .risk-score {
    background-color: var(--danger);
    color: var(--on-danger);
}

.risk-level-high .risk-score {
    background-color: var(--warning);
    color: var(--on-warning);
}

.risk-level-medium .risk-score {
    background-color: var(--warning);
    color: var(--on-warning);  /* Uses theme-aware inverse text */
}

.risk-level-low .risk-score {
    background-color: var(--success);  /* Semantic green for low risk */
    color: var(--on-success);
}

/* ====================
   Breadcrumb
   ==================== */
.breadcrumb-nav {
    margin-bottom: var(--spacing-lg);
}

.breadcrumb {
    display: flex;
    flex-wrap: wrap;
    padding: var(--spacing-sm) 0;
    margin: 0;
    list-style: none;
    background: transparent;
}

.breadcrumb-item {
    display: flex;
    align-items: center;
    font-size: 14px;
}

.breadcrumb-item + .breadcrumb-item::before {
    content: '/';
    padding: 0 var(--spacing-sm);
    color: var(--fg-3);
}

.breadcrumb-item a {
    color: var(--fg-2);
    text-decoration: none;
    transition: color var(--t-fast) var(--ease-out);
    display: flex;
    align-items: center;
    gap: 6px;
}

.breadcrumb-item a:hover {
    color: var(--primary);
    text-shadow: 0 0 10px var(--primary-glow), 0 0 20px var(--primary-tint);
}

.breadcrumb-item.active {
    color: var(--fg);
    font-weight: 500;
}

/* ====================
   KPI Card
   ==================== */
.kpi-card {
    background: var(--surface);
    border-radius: var(--r-md);
    padding: var(--spacing-lg);
    box-shadow: var(--shadow-sm);
    display: flex;
    align-items: center;
    gap: var(--spacing-md);
    transition: all var(--t-base) var(--ease-out);
    border-left: 4px solid;
    position: relative;
    overflow: hidden;
}

.kpi-card::after {
    content: '';
    position: absolute;
    top: 0;
    right: 0;
    width: 100px;
    height: 100%;
    background: linear-gradient(90deg, transparent, var(--primary-tint));
    opacity: 0;
    transition: opacity var(--t-base) var(--ease-out);
}

.kpi-card:hover::after {
    opacity: 1;
}

.kpi-card:hover {
    box-shadow: var(--shadow-md), 0 0 20px var(--primary-tint);
    transform: translateY(-2px);
}

.kpi-card-primary {
    border-left-color: var(--primary);
}

.kpi-card-success {
    border-left-color: var(--success);
}

.kpi-card-success:hover {
    box-shadow: var(--shadow-md), 0 0 10px var(--success-glow), 0 0 20px var(--success-glow);
}

.kpi-card-warning {
    border-left-color: var(--warning);
}

.kpi-card-danger {
    border-left-color: var(--danger);
}

.kpi-card-info {
    border-left-color: var(--primary);
}

.kpi-card-info:hover {
    box-shadow: var(--shadow-md), 0 0 10px var(--primary-glow), 0 0 20px var(--primary-tint);
}

.kpi-card-icon {
    width: 56px;
    height: 56px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 24px;
    background: var(--bg);
    color: var(--fg);
    flex-shrink: 0;
}

.kpi-card-primary .kpi-card-icon {
    color: var(--fg);
    background: var(--surface-2);
}

.kpi-card-success .kpi-card-icon {
    color: var(--success);
    background: var(--success-tint);
}

.kpi-card-warning .kpi-card-icon {
    color: var(--warning);
    background: var(--warning-tint);
}

.kpi-card-danger .kpi-card-icon {
    color: var(--danger);
    background: var(--danger-tint);
}

.kpi-card-info .kpi-card-icon {
    color: var(--primary);
    background: var(--primary-tint);
}

.kpi-card-content {
    flex: 1;
}

.kpi-card-label {
    font-size: 13px;
    font-weight: 500;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    color: var(--fg-3);
    margin-bottom: 4px;
}

.kpi-card-value {
    font-size: 32px;
    font-weight: 700;
    color: var(--fg);
    line-height: 1;
    display: flex;
    align-items: baseline;
    gap: 6px;
}

.kpi-card-unit {
    font-size: 16px;
    font-weight: 500;
    color: var(--fg-3);
}

.kpi-card-detail {
    font-size: 11px;
    font-weight: 500;
    color: var(--fg-3);
    margin-top: 6px;
    line-height: 1.4;
    opacity: 0.85;
}

.kpi-card-trend {
    font-size: 13px;
    font-weight: 600;
    margin-top: 6px;
    display: flex;
    align-items: center;
    gap: 4px;
}

.kpi-card-trend.trend-up {
    color: var(--success);
}

.kpi-card-trend.trend-down {
    color: var(--danger);
}

.kpi-card-link {
    width: 32px;
    height: 32px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    background: var(--bg);
    color: var(--fg-3);
    transition: all var(--t-fast) var(--ease-out);
    text-decoration: none;
}

.kpi-card-link:hover {
    background: var(--primary);
    color: var(--on-primary);
}

/* ====================
   Page Header
   ==================== */
.page-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    margin-bottom: var(--spacing-xl);
    gap: var(--spacing-lg);
}

.page-header-content {
    flex: 1;
}

.page-header-title {
    font-size: 32px;
    font-weight: 700;
    color: var(--fg);
    margin: 0 0 var(--spacing-xs) 0;
    display: flex;
    align-items: center;
    gap: var(--spacing-md);
}

.page-header-title i {
    font-size: 28px;
}

.page-header-subtitle {
    font-size: 16px;
    color: var(--fg-2);
    margin: 0;
}

.page-header-actions {
    display: flex;
    gap: var(--spacing-sm);
    flex-shrink: 0;
}

/* Button Group - used in page headers and toolbars */
.button-group {
    display: flex;
    gap: var(--spacing-sm);
    flex-wrap: wrap;
}

/* ====================
   Utility Classes
   ==================== */

/* Text alignment */
.text-center {
    text-align: center;
}

.text-center-p-xl {
    text-align: center;
    padding: var(--spacing-xl);
    color: var(--fg-3);
}

.text-left {
    text-align: left;
}

.text-right {
    text-align: right;
}

/* Display utilities */
.d-none {
    display: none;
}

.d-inline {
    display: inline;
}

.d-block {
    display: block;
}

.d-flex {
    display: flex;
}

.d-grid {
    display: grid;
}

.grid-2-cols {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 2rem;
}

.grid-col-1 {
    grid-template-columns: 1fr;
}

.grid-auto-fit-250 {
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
}

/* Margin utilities */
.mt-xs {
    margin-top: var(--spacing-xs);
}

.mt-sm {
    margin-top: var(--spacing-sm);
}

.mt-md {
    margin-top: var(--spacing-md);
}

.mt-lg {
    margin-top: var(--spacing-lg);
}

.mt-xl {
    margin-top: var(--spacing-xl);
}

.mt-2 {
    margin-top: 2rem;
}

.mt-3 {
    margin-top: 3rem;
}

.mb-xs {
    margin-bottom: var(--spacing-xs);
}

.mb-sm {
    margin-bottom: var(--spacing-sm);
}

.mb-md {
    margin-bottom: var(--spacing-md);
}

.mb-lg {
    margin-bottom: var(--spacing-lg);
}

.mb-xl {
    margin-bottom: var(--spacing-xl);
}

.mb-2 {
    margin-bottom: 2rem;
}

.ml-xs {
    margin-left: var(--spacing-xs);
}

.ml-sm {
    margin-left: var(--spacing-sm);
}

.ml-md {
    margin-left: var(--spacing-md);
}

.ml-lg {
    margin-left: 1.5rem;
}

.mr-xs {
    margin-right: var(--spacing-xs);
}

.mr-sm {
    margin-right: 0.25rem;
}

/* Padding utilities */
.p-sm {
    padding: 0.5rem;
}

.p-md {
    padding: 0.75rem;
}

.p-lg {
    padding: 1rem;
}

.p-xl {
    padding: var(--spacing-xl);
}

.py-xs {
    padding-top: var(--spacing-xs);
    padding-bottom: var(--spacing-xs);
}

/* Gap utilities for flexbox */
.gap-1 {
    gap: 1rem;
}

.gap-2 {
    gap: var(--spacing-sm);
}

/* Font size utilities */
/* Text size utilities removed - use Bootstrap 5 equivalents:
   - .fs-09 (0.9rem) → use .small
   - .fs-1 (1rem) → use .fs-6 (Bootstrap standard)
   - .fs-12 (1.2rem) → use .fs-5 (1.25rem, close enough)
   - .fs-15 (1.5rem) → use .fs-4 (Bootstrap standard)
   See: TEXT_SIZE_GUIDE.md and TEXT_SIZE_MIGRATION_PLAN.md
*/

.fs-15-warning {
    font-size: 1.5rem;
    color: var(--warning);
}

.fs-15-info {
    font-size: 1.5rem;
    color: var(--primary);
}

.fs-15-danger {
    font-size: 1.5rem;
    color: var(--danger);
}

/* .fs-2 removed - already matches Bootstrap 5 .fs-2 (2rem) */

.fs-2-mb-sm {
    font-size: 2rem;
    margin-bottom: var(--spacing-sm);
}

/* .fs-25 removed - use Bootstrap 5 .fs-1 (2.5rem) */

/* Font weight utilities */
.fw-bold {
    font-weight: bold;
}

.fw-700 {
    font-weight: 700;
}

/* Width utilities */
.w-auto {
    width: auto;
}

.w-100 {
    width: 100%;
}

.w-50px {
    width: 50px;
}

.w-100px {
    width: 100px;
}

.w-120px {
    width: 120px;
}

.w-130px {
    width: 130px;
}

.w-150px {
    width: 150px;
}

.w-180px {
    width: 180px;
}

.w-200px {
    width: 200px;
}

.w-250px {
    width: 250px;
}

/* Color utilities (already have text-muted from Bootstrap) */
.text-muted {
    color: var(--fg-3);
}

.text-muted-mt-xs {
    color: var(--fg-3);
    margin-top: var(--spacing-xs);
}

.text-muted-mt-sm {
    color: var(--fg-3);
    margin-top: var(--spacing-sm);
}

.text-muted-mt-xs-mb-md {
    color: var(--fg-3);
    margin-top: var(--spacing-xs);
    margin-bottom: var(--spacing-md);
}

.text-muted-mt-sm-mb-md {
    color: var(--fg-3);
    margin-top: var(--spacing-sm);
    margin-bottom: var(--spacing-md);
}

.text-muted-mb-md {
    color: var(--fg-3);
    margin-bottom: var(--spacing-md);
}

.text-muted-fs-09 {
    color: var(--fg-3);
    font-size: 0.9em;
}

.text-primary {
    color: var(--fg);
}

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

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

.text-warning {
    color: var(--warning);
}

.text-info {
    color: var(--primary);
}

/* Link utilities - using theme colors */
.link-primary {
    color: var(--primary);  /* Cyberpunk cyan */
    text-decoration: none;
}

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

/* List utilities */
.list-unstyled {
    list-style: none;
    padding: 0;
}

.list-item-action {
    padding: var(--spacing-md);
    border-bottom: 1px solid var(--border);
    display: flex;
    justify-content: space-between;
    align-items: center;
}

/* Border utilities */
.border-bottom {
    border-bottom: 1px solid var(--border);
}

.py-xs-border-bottom {
    padding-top: var(--spacing-xs);
    padding-bottom: var(--spacing-xs);
    border-bottom: 1px solid var(--border);
}

.py-xs-text-muted {
    padding-top: var(--spacing-xs);
    padding-bottom: var(--spacing-xs);
    color: var(--fg-3);
}

.border-left-danger {
    border-left: 4px solid var(--danger);
}

.border-left-warning {
    border-left: 4px solid var(--warning);
}

.border-left-info {
    border-left: 4px solid var(--primary);
}

.border-left-secondary {
    border-left: 4px solid var(--primary);
}

/* Table utilities */
.table-cell {
    padding: 0.75rem;
    border: 1px solid var(--border);
}

.table-cell-sm {
    padding: 0.5rem;
    border: 1px solid var(--border);
}

.table-cell-fw-bold {
    padding: 0.5rem;
    font-weight: bold;
}

.table-cell-header {
    padding: 0.5rem;
    border: 1px solid var(--border);
    font-weight: bold;
    background: var(--bg);
}

.table-collapse {
    width: 100%;
    border-collapse: collapse;
}

.table-collapse-mt {
    width: 100%;
    border-collapse: collapse;
    margin-top: 0.5rem;
}

/* Card spacing utility */
.card + .card {
    margin-top: var(--spacing-lg);
}

/* Common semantic classes */
.icon-large {
    font-size: 2.5rem;
}

.icon-xlarge {
    font-size: 4rem;
}

.section-title {
    margin-top: 0;
    color: var(--fg);
}

.small-text {
    font-size: 0.85rem;
}

.small-text-secondary {
    font-size: 0.85rem;
    color: var(--fg-2);
    margin-top: 0.25rem;
}

.text-sm {
    font-size: 0.9rem;
}

.text-sm-secondary {
    font-size: 0.9rem;
    color: var(--fg-2);
}

/* Flexbox utilities */
.flex-center-gap {
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

/* Line height utilities */
.lh-16 {
    line-height: 1.6;
}

/* White space utilities */
.ws-pre-wrap {
    white-space: pre-wrap;
}

.ws-pre-wrap-lh {
    white-space: pre-wrap;
    line-height: 1.6;
}

/* Opacity utilities */
.opacity-90 {
    opacity: 0.9;
}

.opacity-95 {
    opacity: 0.95;
}

/* Background utilities */
.bg-alt {
    background: var(--surface-2);
}

.bg-warning-light {
    background-color: var(--warning-glow);
}

.bg-danger-light-border-left-danger {
    background: var(--danger-glow);
    border-left: 4px solid var(--danger);
}

/* KPI Card components */
.kpi-label {
    font-size: 0.9rem;
    color: var(--fg-2);
}

.kpi-value {
    font-size: 2.5rem;
    font-weight: bold;
}

.kpi-value-primary {
    font-size: 2.5rem;
    font-weight: bold;
    color: var(--fg);
}

.kpi-value-success {
    font-size: 2.5rem;
    font-weight: bold;
    color: var(--success);
}

.kpi-value-info {
    font-size: 2.5rem;
    font-weight: bold;
    color: var(--primary);
}

.kpi-value-warning {
    font-size: 2.5rem;
    font-weight: bold;
    color: var(--warning);
}

.kpi-unit {
    font-size: 1.2rem;
    color: var(--fg-2);
}

/* ====================
   Empty State
   ==================== */
.empty-state {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: var(--spacing-2xl) var(--spacing-xl);
    text-align: center;
    background: var(--bg);
    border-radius: var(--r-md);
    border: 2px dashed var(--border);
    margin: var(--spacing-xl) 0;
}

.empty-state-icon {
    width: 96px;
    height: 96px;
    border-radius: 50%;
    background: var(--surface);
    display: flex;
    align-items: center;
    justify-content: center;
    margin-bottom: var(--spacing-lg);
    box-shadow: var(--shadow-sm);
}

.empty-state-icon i {
    font-size: 48px;
    color: var(--fg-3);
    opacity: 0.5;
}

.empty-state-title {
    font-size: 20px;
    font-weight: 600;
    color: var(--fg);
    margin: 0 0 var(--spacing-sm) 0;
}

.empty-state-description {
    font-size: 15px;
    color: var(--fg-2);
    margin: 0 0 var(--spacing-lg) 0;
    max-width: 400px;
}

/* Dark Mode - Empty State */
[data-theme="dark"] .empty-state {
    background: var(--bg);
    border-color: var(--border);
}

[data-theme="dark"] .empty-state-icon {
    background: var(--surface);
}

[data-theme="dark"] .empty-state-title {
    color: var(--fg);
}

[data-theme="dark"] .empty-state-description {
    color: var(--fg-2);
}

/* ====================
   Floating Toolbar
   ==================== */
.floating-toolbar {
    position: sticky;
    top: 70px;
    z-index: var(--z-sticky);
    background: var(--surface);
    border-radius: var(--r-md);
    box-shadow: var(--shadow-md);
    padding: var(--spacing-md) var(--spacing-lg);
    margin-bottom: var(--spacing-lg);
    animation: slideInDown 0.2s ease;
}

@keyframes slideInDown {
    from {
        opacity: 0;
        transform: translateY(-10px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.floating-toolbar-content {
    display: flex;
    align-items: center;
    gap: var(--spacing-sm);
}

.floating-toolbar .shortcut-hint {
    margin-left: var(--spacing-sm);
    font-size: 11px;
    opacity: 0.7;
}

.floating-toolbar .dropdown-item kbd {
    font-size: 11px;
    padding: 2px 6px;
}

/* Dark Mode - Floating Toolbar */
[data-theme="dark"] .floating-toolbar {
    background: var(--surface);
    border-color: var(--border);
}

/* ====================
   Related Items
   ==================== */
.related-items-card {
    box-shadow: var(--shadow-sm);
}

.related-items-card .card-header h5 {
    margin: 0;
    font-size: 16px;
    font-weight: 600;
    display: flex;
    align-items: center;
    gap: var(--spacing-sm);
}

.related-section {
    padding-bottom: var(--spacing-md);
}

.related-section-title {
    font-size: 14px;
    font-weight: 600;
    color: var(--fg);
    margin-bottom: var(--spacing-sm);
    display: flex;
    align-items: center;
    gap: var(--spacing-sm);
}

.related-section-title i {
    color: var(--fg-3);
}

.related-section-title .badge {
    margin-left: auto;
}

.related-list {
    list-style: none;
    margin: 0;
    padding: 0;
}

.related-list-item {
    padding: var(--spacing-xs) 0;
    border-bottom: 1px solid var(--border);
}

.related-list-item:last-child {
    border-bottom: none;
}

.related-list-item a {
    color: var(--fg);
    text-decoration: none;
    font-size: 14px;
    transition: color var(--t-fast) var(--ease-out);
}

.related-list-item a:hover {
    color: var(--primary);
}

.related-list-item a::before {
    content: '→';
    margin-right: var(--spacing-sm);
    color: var(--fg-3);
}

.related-view-all {
    display: inline-flex;
    align-items: center;
    font-size: 13px;
    color: var(--primary);
    text-decoration: none;
    font-weight: 500;
    margin-top: var(--spacing-sm);
    transition: gap var(--t-fast) var(--ease-out);
}

.related-view-all:hover {
    gap: 6px;
}

.related-empty {
    font-size: 14px;
    color: var(--fg-3);
    font-style: italic;
    margin: 0;
}

/* ====================
   Header Layout
   ==================== */
.header-container {
    display: flex;
    justify-content: space-between;
    align-items: center;
    width: 100%;
}

.header-logo {
    display: flex;
    align-items: center;
    gap: 0.75rem;
}

.header-logo img {
    width: 40px;
    height: 40px;
}

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

/* User Avatar in Header */
.user-avatar-container {
    display: flex;
    align-items: center;
}

/* FA-3 v3.0: .user-avatar wird in app.css (User-Menu-Section) Aurora-styled;
   diese Legacy-Version ist jetzt nur noch Fallback für .user-avatar-container-Kontext. */
.user-avatar-container .user-avatar {
    width: 36px;
    height: 36px;
}

/* ====================
   Audit Status Utilities
   ==================== */
/* Status card backgrounds - using theme-aware light variants */
.bg-audit-planned {
    background: var(--primary-tint);
    border-radius: var(--r-md);
}

.bg-audit-in-progress {
    background: var(--warning-glow);
    border-radius: var(--r-md);
}

.bg-audit-completed {
    background: var(--success-glow);
    border-radius: var(--r-md);
}

.bg-audit-cancelled {
    background: rgb(var(--sev-neutral-rgb), 0.1);  /* slate-400 */
    border-radius: var(--r-md);
}

/* Status icon styles - using theme colors */
.audit-icon-planned {
    font-size: 2rem;
    color: var(--primary);
}

.audit-icon-in-progress {
    font-size: 2rem;
    color: var(--warning);
}

.audit-icon-completed {
    font-size: 2rem;
    color: var(--success);
}

.audit-icon-cancelled {
    font-size: 2rem;
    color: var(--fg-3);
}

/* Status count styles - using theme colors */
.audit-count-planned {
    font-size: 2.5rem;
    font-weight: 700;
    color: var(--primary);
}

.audit-count-in-progress {
    font-size: 2.5rem;
    font-weight: 700;
    color: var(--warning);
}

.audit-count-completed {
    font-size: 2.5rem;
    font-weight: 700;
    color: var(--success);
}

.audit-count-cancelled {
    font-size: 2.5rem;
    font-weight: 700;
    color: var(--fg-3);
}

/* ====================
   Additional Font & Spacing Utilities
   ==================== */
.fs-2-mr-md {
    font-size: 2rem;
    margin-right: var(--spacing-md);
}

.fs-3-text-muted-opacity-50 {
    font-size: 3rem;
    color: var(--fg-3);
    opacity: 0.5;
}

/* ====================
   Table Utilities
   ==================== */
.thead-sticky {
    background: var(--bg);
    position: sticky;
    top: 0;
    z-index: var(--z-sticky);
}

.w-text-right {
    text-align: right;
}

.table-full-collapse {
    width: 100%;
    border-collapse: collapse;
    min-width: 600px;
}

.th-sticky-left {
    padding: 1rem;
    border: 1px solid var(--border);
    text-align: left;
    font-weight: 600;
    position: sticky;
    left: 0;
    background: var(--surface-2);
    z-index: var(--z-sticky);
}

.th-center {
    padding: 1rem;
    border: 1px solid var(--border);
    text-align: center;
    font-weight: 600;
    font-size: 0.9rem;
}

.td-center {
    padding: 1rem;
    border: 1px solid var(--border);
    text-align: center;
}

.td-sticky-left {
    padding: 1rem;
    border: 1px solid var(--border);
    font-weight: 600;
    position: sticky;
    left: 0;
    background: var(--surface);
    z-index: 5; /* local stacking-context: sticky column within table */
}

/* Dark Mode - Sticky Table Cells */
[data-theme="dark"] .td-sticky-left {
    background: var(--surface);
}

.th-left-fs-09 {
    padding: 0.75rem;
    text-align: left;
    font-size: 0.9rem;
}

.td-center-fs-09 {
    padding: 0.75rem;
    text-align: center;
    font-size: 0.9rem;
}

.td-center-p-075 {
    padding: 0.75rem;
    text-align: center;
}

/* ====================
   Compliance/Mapping Utilities
   ==================== */
.mapping-card {
    text-align: center;
    padding: 1rem;
    border-radius: var(--r-lg);
}

.mapping-card-success {
    text-align: center;
    padding: 1rem;
    background: var(--success-glow);
    border-radius: var(--r-lg);
}

.mapping-card-warning {
    text-align: center;
    padding: 1rem;
    background: var(--warning-glow);
    border-radius: var(--r-lg);
}

.mapping-card-alt {
    text-align: center;
    padding: 1rem;
    background: var(--surface-2);
    border-radius: var(--r-lg);
}

.details-padding {
    padding: 0 1.5rem 1.5rem;
    border-top: 1px solid var(--border);
}

.summary-interactive {
    padding: 1.5rem;
    cursor: pointer;
    font-size: 1.2rem;
    font-weight: 600;
    color: var(--fg);
    list-style: none;
}

.card-border-hover {
    padding: 1.5rem;
    border: 2px solid var(--border);
    transition: all 0.2s;
}

.card-border-left-info-lg {
    padding: 1.5rem;
    border-left: 4px solid var(--primary);
}

.card-border-left-success-lg {
    padding: 1.5rem;
    border-left: 4px solid var(--success);
}

.card-border-left-warning-lg {
    padding: 1.5rem;
    border-left: 4px solid var(--warning);
}

/* Card border-left variants (non-lg) */
.card-border-left-primary {
    border-left: 4px solid var(--fg);
}

.card-border-left-secondary {
    border-left: 4px solid var(--primary);
}

.card-border-left-success {
    border-left: 4px solid var(--success);
}

.card-border-left-info {
    border-left: 4px solid var(--primary);
}

.card-border-left-warning {
    border-left: 4px solid var(--warning);
}

.card-border-left-danger {
    border-left: 4px solid var(--danger);
}

.legend-item {
    width: 30px;
    height: 20px;
    border-radius: var(--r-sm);
}

.legend-success {
    width: 30px;
    height: 20px;
    background: var(--success);
    border-radius: var(--r-sm);
}

.legend-warning {
    width: 30px;
    height: 20px;
    background: var(--warning);
    border-radius: var(--r-sm);
}

.legend-danger {
    width: 30px;
    height: 20px;
    background: var(--danger);
    border-radius: var(--r-sm);
}

.text-center-italic-margin {
    text-align: center;
    color: var(--fg-2);
    font-style: italic;
    margin: 1rem 0;
}

.fs-2-fw-bold-success {
    font-size: 2rem;
    font-weight: bold;
    color: var(--success);
}

.fs-095-opacity-09 {
    margin: 0;
    font-size: 0.95rem;
    opacity: 0.9;
}

.fs-15-white-mb {
    color: white; /* design-spec: heading utility for use on colored gradient hero/banner */
    margin-bottom: 1rem;
    font-size: 1.5rem;
}

.overflow-auto {
    overflow-x: auto;
}

.overflow-auto-mb {
    overflow-x: auto;
    margin-bottom: 1.5rem;
}

.mb-border {
    margin-bottom: 1.5rem;
    border: 2px solid var(--border);
}

.mr-xs {
    margin-right: 0.5rem;
}

.fw-600-fs-11-primary {
    font-weight: 600;
    font-size: 1.1rem;
    color: var(--fg);
}

.fw-600-fs-095-secondary-mt {
    font-weight: 600;
    font-size: 0.95rem;
    color: var(--fg-2);
    margin-top: 0.25rem;
}

.fw-600-fs-095-secondary-mb {
    font-weight: 600;
    font-size: 0.95rem;
    color: var(--fg-2);
    margin-bottom: 0.25rem;
}

.fw-600-min-w-45 {
    font-weight: 600;
    min-width: 45px;
}

.fs-2-fw-bold-warning {
    font-size: 2rem;
    font-weight: bold;
    color: var(--warning);
}

.fs-2-fw-bold-secondary {
    font-size: 2rem;
    font-weight: bold;
    color: var(--primary);
}

.fs-2-primary-center-margin {
    font-size: 2rem;
    color: var(--fg);
    text-align: center;
    margin: 0.5rem 0;
}

.fs-11-lh-mb {
    font-size: 1.1rem;
    line-height: 1.6;
    margin-bottom: 2rem;
    opacity: 0.95;
}

.fs-11-lh-mb-sm {
    font-size: 1.1rem;
    line-height: 1.6;
    margin-bottom: 1.5rem;
    opacity: 0.95;
}

.fw-600 {
    font-weight: 600;
}

.lh-18-pl {
    line-height: 1.8;
    color: var(--fg);
    padding-left: 1.5rem;
}

.progress-bar-bg {
    height: 10px;
    border-radius: var(--r-sm);
    background: var(--surface-2);
}

/* Data Reuse Insights Utilities */
.text-center-p-xl-muted {
    text-align: center;
    padding: var(--spacing-xl);
    color: var(--fg-3);
}

.text-center-muted {
    text-align: center;
    color: var(--fg-3);
}

.progress-compact {
    height: 20px;
    width: 100px;
    margin: 0 auto;
}

.grid-col-2 {
    grid-template-columns: 1fr 1fr;
}

.grid-full {
    grid-column: 1 / -1;
}

.fs-11-mb-sm {
    font-size: 1.1rem;
    margin-bottom: var(--spacing-sm);
}

/* Audit Log Statistics Utilities */
.table-stats {
    width: 100%;
    border-collapse: collapse;
    margin-top: 1rem;
}

.tr-header {
    background: var(--bg);
}

/* Dark Mode - Table Headers */
[data-theme="dark"] .tr-header {
    background: var(--bg);
}

.th-stats-left {
    padding: 0.5rem;
    text-align: left;
    border: 1px solid var(--border);
}

.th-stats-right {
    padding: 0.5rem;
    text-align: right;
    border: 1px solid var(--border);
}

.td-stats {
    padding: 0.5rem;
    border: 1px solid var(--border);
}

.td-stats-right {
    padding: 0.5rem;
    text-align: right;
    border: 1px solid var(--border);
}

.grid-2-col-gap-mt {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 2rem;
    margin-top: 2rem;
}

.chart-container {
    margin-top: 1rem;
    position: relative;
    min-height: 300px;
}

/* ===========================================
   HTML Legend for Charts - Theme Adaptive
   =========================================== */
.chart-html-legend {
    margin-top: 0.75rem;
    padding: 0.75rem 1rem;
    background: var(--bg);
    border: 1px solid var(--border);
    border-radius: 0.5rem;
    position: relative;
    z-index: var(--z-sticky); /* local stacking-context */
}

.chart-legend-items {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    gap: 1rem;
}

.chart-legend-item {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    cursor: pointer;
    padding: 0.25rem 0.5rem;
    border-radius: 0.25rem;
    transition: all 0.2s ease;
}

.chart-legend-item:hover {
    background: rgb(0, 0, 0, 0.05); /* design-spec: faint hover tint on chart legend item */
}

.chart-legend-item.legend-hidden {
    opacity: 0.4;
}

.chart-legend-item.legend-hidden .chart-legend-label {
    text-decoration: line-through;
}

.chart-legend-color {
    width: 14px;
    height: 14px;
    border-radius: var(--r-sm);
    flex-shrink: 0;
}

.chart-legend-label {
    color: var(--fg);
    font-size: 0.875rem;
    font-weight: 500;
}

/* Dark mode - dark background with light text and glow */
[data-theme="dark"] .chart-html-legend,
[data-bs-theme="dark"] .chart-html-legend {
    background: rgb(30, 41, 59, 0.95);
    border-color: rgb(255, 255, 255, 0.1);
    backdrop-filter: blur(8px);
}

[data-theme="dark"] .chart-legend-item:hover,
[data-bs-theme="dark"] .chart-legend-item:hover {
    background: rgb(255, 255, 255, 0.1);
}

[data-theme="dark"] .chart-legend-label,
[data-bs-theme="dark"] .chart-legend-label {
    color: var(--fg);
    text-shadow: 0 0 10px rgb(255, 255, 255, 0.3);
}

.w-h-100 {
    width: 100%;
    height: 100%;
}

/* Document By Type Utilities */
.mr-025 {
    margin-right: 0.25rem;
}

.list-unstyled-mt-md {
    list-style: none;
    padding: 0;
    margin-top: var(--spacing-md);
}

.li-border-item {
    padding: var(--spacing-xs) 0;
    border-bottom: 1px solid var(--border);
}

.text-muted-mt-md {
    color: var(--fg-3);
    margin-top: var(--spacing-md);
}

/* Workflow Overdue Utilities */
.alert-danger-border {
    background: var(--danger-glow);
    border-left: 4px solid var(--danger);
}

.alert-warning-border {
    background: var(--warning-glow);
    border-left: 4px solid var(--warning);
}

/* SOA Index Utilities */
.badge-neutral {
    background: var(--bg);
    color: var(--fg-3);
}

/* Dark Mode - Badge Neutral */
[data-theme="dark"] .badge-neutral {
    background: var(--surface-2);
    color: var(--fg-2);
}

.text-center-block-light {
    text-align: center;
    display: block;
    color: var(--fg-3);
}

.justify-end {
    justify-content: flex-end;
}

/* SOA Category Utilities */
.kpi-grid-responsive {
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
}

/* SOA Show Utilities */
.grid-responsive-200 {
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
}

.grid-responsive-250 {
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
}

.bg-light {
    background: var(--surface-2);
}

.badge-neutral-lg {
    background: var(--bg);
    color: var(--fg-3);
    font-size: 1.2rem;
}

/* Dark Mode - Badge Neutral Large */
[data-theme="dark"] .badge-neutral-lg {
    background: var(--surface-2);
    color: var(--fg-2);
}

.progress-lg {
    height: 30px;
}

.text-light {
    color: var(--fg-2);
}

.text-light-mt-sm {
    color: var(--fg-2);
    margin-top: var(--spacing-sm);
}

.text-light-mt-sm-lh {
    color: var(--fg-2);
    margin-top: var(--spacing-sm);
    line-height: 1.6;
}

/* Document Index Modern Utilities - using theme colors */
.color-pdf {
    color: var(--danger);
}

.color-image {
    color: var(--primary);
}

.color-excel {
    color: var(--success);
}

.color-other {
    color: var(--fg-3);
}

.bg-pdf-light {
    background: var(--danger-glow);
    border-radius: var(--r-md);
}

.bg-image-light {
    background: var(--primary-tint);
    border-radius: var(--r-md);
}

.bg-excel-light {
    background: var(--success-glow);
    border-radius: var(--r-md);
}

.bg-other-light {
    background: rgb(var(--sev-neutral-rgb), 0.1);  /* slate-400 */
    border-radius: var(--r-md);
}

.icon-search-empty {
    font-size: 3rem;
    color: var(--fg-3);
    opacity: 0.5;
}

.thead-sticky {
    background: var(--bg);
    position: sticky;
    top: 0;
    z-index: var(--z-sticky);
}

/* Workflow Instance Show Utilities */
.fs-1-mb-sm {
    font-size: 1rem;
    margin-bottom: var(--spacing-sm);
}

.fs-11-mb-xs {
    font-size: 1.1rem;
    margin-bottom: var(--spacing-xs);
}

.card-step {
    margin-bottom: var(--spacing-md);
    padding: var(--spacing-md);
}

.border-left-primary {
    border-left: 4px solid var(--fg);
}

/* Compliance Transitive Utilities */
/* Gradient backgrounds for empty states - Cyberpunk Fairy Theme */
.gradient-purple {
    background: linear-gradient(135deg, var(--accent) 0%, var(--accent-hover) 100%);
    color: var(--on-accent);
    text-align: center;
    padding: 3rem;
    border: none;
}

.gradient-pink {
    background: linear-gradient(135deg, var(--accent) 0%, var(--accent-hover) 100%);
    color: var(--on-accent);
    text-align: center;
    padding: 3rem;
    border: none;
}

/* Info boxes — translucent overlay, used on colored gradient hero/banner */
.info-box-white {
    background: var(--surface-translucent);
    padding: var(--spacing-lg);
    border-radius: var(--r-md);
    margin-bottom: var(--spacing-lg);
}

.info-box-white-no-mb {
    background: var(--surface-translucent);
    padding: var(--spacing-lg);
    border-radius: var(--r-md);
}

/* Colored headings with no top margin */
.h-white-no-mt-mb-sm {
    color: white; /* design-spec: heading utility for use on colored gradient hero/banner */
    margin-top: 0;
    margin-bottom: 0.5rem;
}

.h-info-no-mt {
    color: var(--primary);
    margin-top: 0;
}

.h-success-no-mt {
    color: var(--success);
    margin-top: 0;
}

.h-warning-no-mt {
    color: var(--warning);
    margin-top: 0;
}

/* Flex layouts */
.inline-flex-center-wrap {
    display: inline-flex;
    gap: 1rem;
    justify-content: center;
    flex-wrap: wrap;
}

.btn-light-primary-flex {
    color: var(--accent);  /* Mystical purple aura */
    font-weight: 600;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.flex-center-gap-1 {
    display: flex;
    align-items: center;
    gap: 1rem;
    margin-bottom: 1rem;
}

.flex-1 {
    flex: 1;
}

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

.flex-center-gap-05 {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
}

/* Grid layouts */
.grid-responsive-350 {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(350px, 1fr));
    gap: 1.5rem;
}

.grid-responsive-200-my {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 1rem;
    margin: 1.5rem 0;
}

.grid-gap-15 {
    display: grid;
    gap: 1.5rem;
}

/* Text styles */
.fs-075-text-secondary {
    font-size: 0.75rem;
    color: var(--fg-2);
}

.fs-085-text-secondary {
    font-size: 0.85rem;
    color: var(--fg-2);
}

.text-secondary-mb-15 {
    color: var(--fg-2);
    margin-bottom: 1.5rem;
}

.fs-1-fw-600-muted {
    color: var(--fg-3);
    font-weight: 600;
    font-size: 1rem;
}

.float-right-fs-1-secondary {
    float: right;
    font-size: 1rem;
    color: var(--fg-2);
}

/* Box/Card styles */
.box-bg-alt-p-075-rounded-mb {
    background: var(--surface-2);
    padding: 0.75rem;
    border-radius: var(--r-sm);
    margin-bottom: 1rem;
}

.legend-container {
    display: flex;
    justify-content: center;
    gap: 2rem;
    padding: 1rem;
    background: var(--surface-2);
    border-radius: var(--r-lg);
}

/* Badge/Progress styles */
.badge-matrix-zero {
    display: inline-block;
    padding: 0.5rem 1rem;
    font-size: 1rem;
    font-weight: 700;
    background: var(--bg);
    color: var(--fg-3);
    border-radius: var(--r-sm);
    border: 2px dashed var(--border);
}

.progress-bar-container {
    flex: 1;
    max-width: 100px;
    height: 8px;
    background: var(--surface-2);
    border-radius: var(--r-sm);
    overflow: hidden;
}

/* Borders */
.border-bottom-light {
    border-bottom: 1px solid var(--border);
}

/* Skeleton Component Utilities */
/* Width utilities */
.w-30 {
    width: 30%;
}

.w-40 {
    width: 40%;
}

.w-50 {
    width: 50%;
}

.w-60 {
    width: 60%;
}

.w-70 {
    width: 70%;
}

.w-80 {
    width: 80%;
}

.w-100 {
    width: 100%;
}

.w-80px {
    width: 80px;
}

/* Height utilities */
.h-32px {
    height: 32px;
}

.h-40px {
    height: 40px;
}

/* Spacing utilities */
.mb-8px {
    margin-bottom: 8px;
}

.mb-24px {
    margin-bottom: 24px;
}

.mb-lg {
    margin-bottom: var(--spacing-lg);
}

.mt-md {
    margin-top: var(--spacing-md);
}

.mt-xl {
    margin-top: var(--spacing-xl);
}

/* Width and height combined */
.w-50-h-32 {
    width: 50%;
    height: 32px;
}

.w-30-mb-8 {
    width: 30%;
    margin-bottom: 8px;
}

.w-100-h-40 {
    width: 100%;
    height: 40px;
}

/* Workflow Definitions Utilities */
.text-muted-color {
    color: var(--fg-3);
}

.mr-025 {
    margin-right: 0.25rem;
}

/* Workflow Active Utilities */
.ml-xs {
    margin-left: var(--spacing-xs);
}

.progress-inline {
    height: 20px;
    width: 120px;
    margin: 0 auto;
}

.bg-danger-light {
    background-color: var(--danger-glow);
}

.progress-bar-fs-075 {
    font-size: 0.75rem;
}

/* License Summary Utilities */
.w-150px {
    width: 150px;
}

.w-200px {
    width: 200px;
}

/* Glyph-size utilities — for Bootstrap-Icon font-size in cards/empty-states.
   Renamed from .fa-icon-{sm,md,lg,xl} to avoid collision with the Aurora
   v4 mask-icon base class .fa-icon (spec: .fa-icon + .fa-icon--{name}).
   Avoids inline style="font-size: Nrem" patterns that defeat the design
   system layer. */
.fa-glyph-size-sm { font-size: 1.5rem; }
.fa-glyph-size-md { font-size: 2rem; }
.fa-glyph-size-lg { font-size: 3rem; }
.fa-glyph-size-xl { font-size: 4rem; }

.progress-h-4 {
    height: 4px;
}

.progress-h-5 {
    height: 5px;
}

.progress-h-10 {
    height: 10px;
}

.progress-h-18 {
    height: 18px;
}

.progress-h-20 {
    height: 20px;
}

.progress-h-24 {
    height: 24px;
}

.progress-h-25 {
    height: 25px;
}

.progress-h-30 {
    height: 30px;
}

.progress-h-40 {
    height: 40px;
}

/* Audit Log Utilities */
.filter-container {
    margin: 2rem 0;
    padding: 1rem;
    background: var(--bg);
    border-radius: var(--r-sm);
}

/* Dark Mode - Filter Container */
[data-theme="dark"] .filter-container {
    background: var(--bg);
}

.table-full {
    width: 100%;
    border-collapse: collapse;
}

.bg-gray-f0 {
    background: var(--bg);
}

/* Dark Mode - Background Utilities */
[data-theme="dark"] .bg-gray-f0 {
    background: var(--bg);
}

.mx-1rem {
    margin: 0 1rem;
}

.h3-small {
    font-size: 1rem;
    margin-bottom: var(--spacing-sm);
}

/* Compliance Index Utilities - Cyberpunk Fairy Emerald Gradient */
.alert-gradient-success {
    background: linear-gradient(135deg, var(--success) 0%, var(--success-strong) 100%);  /* Emerald fairy dust */
    color: var(--on-success);
    border: none;
    margin-bottom: var(--spacing-lg);
}

.h3-m0-mb-sm {
    margin: 0 0 var(--spacing-sm) 0;
}

.text-lg-m0 {
    font-size: 1.1rem;
    margin: 0;
}

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

/* BCM Index Utilities */
.bg-gradient-primary {
    background: var(--brand-gradient);
}

.bg-gradient-danger {
    background: linear-gradient(135deg, var(--danger), var(--danger));
}

.bg-gradient-warning {
    background: linear-gradient(135deg, var(--warning), var(--warning));
}

.bg-gradient-success {
    background: linear-gradient(135deg, var(--success), var(--success));
}

.bg-gradient-info {
    background: linear-gradient(135deg, var(--primary), var(--primary-hover));
}

/* Location Form Utilities */
.h3-mt-lg {
    margin-top: var(--spacing-lg);
}

/* Incident Index Utilities */
.progress-h-6 {
    height: 6px;
}

.w-40px {
    width: 40px;
}

/* Dashboard Status Colors - using theme colors */
.status-in-progress {
    color: var(--warning);
}

.status-not-started {
    color: var(--fg-3);
}

/* Training Index Utilities */
.icon-2rem {
    font-size: 2rem;
}

/* SOA Edit Utilities */
.mt-sm-text-light {
    margin-top: var(--spacing-sm);
    color: var(--fg-2);
}

.label-checkbox {
    display: flex;
    align-items: center;
    gap: var(--spacing-sm);
    cursor: pointer;
}

.checkbox-lg {
    width: 20px;
    height: 20px;
}

.small-muted-block {
    color: var(--fg-3);
    margin-top: var(--spacing-xs);
    display: block;
}

.flex-center-gap-md {
    display: flex;
    align-items: center;
    gap: var(--spacing-md);
}

.badge-fs-1-p-sm-md {
    font-size: 1rem;
    padding: var(--spacing-sm) var(--spacing-md);
}

/* Framework Dashboard Utilities */
.version-muted-small {
    color: var(--fg-3);
    font-size: 0.8em;
}

.stat-value-success {
    color: var(--success);
}

.stat-value-danger {
    color: var(--danger);
}

.d-none {
    display: none;
}

.p-xl {
    padding: var(--spacing-xl);
}

.icon-3rem-mb-md {
    font-size: 3rem;
    margin-bottom: var(--spacing-md);
}

.bg-danger {
    background: var(--danger);
}

/* Location Show Utilities */
.ml-sm {
    margin-left: var(--spacing-sm);
}

.text-light-pre-wrap {
    color: var(--fg-2);
    white-space: pre-wrap;
}

.grid-responsive-250 {
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
}

.bg-light {
    background: var(--surface-2);
}

.d-inline {
    display: inline;
}

/* Context Index Modern Utilities */
.icon-15-mr-md {
    font-size: 1.5rem;
    margin-right: var(--spacing-md);
}

.icon-2-opacity-3 {
    font-size: 2rem;
    opacity: 0.3;
}

.icon-3-opacity-3 {
    font-size: 3rem;
    opacity: 0.3;
}

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

/* Person Show Utilities */
.pre-wrap {
    white-space: pre-wrap;
}

/* Base Template Footer Utilities */
.opacity-70 {
    opacity: 0.7;
}

.text-inherit {
    color: inherit;
}

.footer-text-small {
    font-size: 0.9rem;
    margin-top: 0.5rem;
}

/* Asset Index Modern Utilities */
.my-2rem {
    margin: 2rem 0;
}

.progress-h-8 {
    height: 8px;
}

/* Cross Framework Utilities */
.bg-color-success {
    background: var(--success);
}

.bg-color-warning {
    background: var(--warning);
}

.bg-color-secondary {
    background: var(--primary);
}

/* ====================
   Responsive
   ==================== */
@media (max-width: 767.98px) {
    .page-header {
        flex-direction: column;
        align-items: stretch;
    }

    .page-header-actions {
        flex-direction: column;
    }

    .floating-toolbar {
        top: 60px;
        padding: var(--spacing-sm) var(--spacing-md);
    }

    .floating-toolbar-content {
        flex-direction: column;
        align-items: stretch;
    }

    .kpi-card {
        flex-direction: column;
        text-align: center;
    }
}

/* ====================
   Audit Log Badges - Cyberpunk Fairy Theme
   ==================== */
.badge-create {
    background: var(--success);  /* Emerald fairy dust */
    color: var(--on-success);
}

.badge-update {
    background: var(--warning);  /* Amber caution sparkles */
    color: var(--on-warning);  /* Theme-aware dark text on amber */
}

.badge-delete {
    background: var(--danger);  /* Alert flames */
    color: var(--on-danger);
}

.badge-view {
    background: var(--primary);  /* Cyberpunk cyan glow */
    color: var(--on-primary);
}

.badge-export {
    background: var(--fg-2);  /* Slate secondary */
    color: white; /* design-spec: text on fg-2 slate badge, no --on-fg token */
}

.badge-import {
    background: var(--accent);  /* Mystical purple aura */
    color: var(--on-accent);
}

/* Dark Mode - Audit Log Badges */
[data-theme="dark"] .badge-create {
    background: var(--success);
    color: var(--on-success);
    box-shadow: 0 0 8px rgb(var(--success-rgb), 0.3);
}

[data-theme="dark"] .badge-update {
    background: var(--warning);
    color: var(--on-warning);
    box-shadow: 0 0 8px rgb(var(--warning-rgb), 0.3);
}

[data-theme="dark"] .badge-delete {
    background: var(--danger);
    color: var(--on-danger);
    box-shadow: 0 0 8px var(--danger-tint);
}

[data-theme="dark"] .badge-view {
    background: var(--primary);
    color: var(--on-primary);
    box-shadow: 0 0 8px var(--primary-glow);
}

[data-theme="dark"] .badge-export {
    background: var(--fg-2);
    color: white; /* design-spec: text on fg-2 slate dark badge, no --on-fg token */
    box-shadow: 0 0 8px rgb(100, 116, 139, 0.3);
}

[data-theme="dark"] .badge-import {
    background: var(--accent);  /* Mystical purple aura */
    color: var(--on-accent);
    box-shadow: 0 0 8px var(--accent-tint);
}

/* ============================================
   Mobile Responsiveness Enhancements
   ============================================ */

/* ====================
   Responsive Stacked Tables
   Converts tables to card-like layout on mobile
   ==================== */
@media (max-width: 767px) {
    /* Stacked table pattern - opt-in via .table-stacked class */
    .table-stacked thead {
        display: none;  /* Hide table headers on mobile */
    }

    .table-stacked tbody tr {
        display: block;
        margin-bottom: 1rem;
        background: var(--surface);
        border: 1px solid var(--border);
        border-radius: var(--r-md);
        padding: 0.75rem;
        box-shadow: var(--shadow-sm);
    }

    .table-stacked tbody td {
        display: flex;
        justify-content: space-between;
        align-items: flex-start;
        padding: 0.5rem 0;
        border: none;
        border-bottom: 1px solid var(--border);
    }

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

    /* Show data-label as pseudo-element */
    .table-stacked tbody td::before {
        content: attr(data-label);
        font-weight: 600;
        color: var(--fg-3);
        font-size: 0.75rem;
        text-transform: uppercase;
        letter-spacing: 0.05em;
        flex-shrink: 0;
        margin-right: 1rem;
        min-width: 100px;
    }

    /* Action buttons in stacked table */
    .table-stacked tbody td:has(.btn-group),
    .table-stacked tbody td:has([data-label="Aktionen"]) {
        justify-content: flex-end;
        padding-top: 0.75rem;
    }

    .table-stacked tbody td:has(.btn-group)::before,
    .table-stacked tbody td[data-label="Aktionen"]::before {
        display: none;
    }

    /* Dark mode stacked tables */
    [data-theme="dark"] .table-stacked tbody tr {
        background: var(--bg);
        border-color: var(--border);
    }

    [data-theme="dark"] .table-stacked tbody td {
        border-bottom-color: var(--border);
    }
}

/* ====================
   Touch Target — Global Floor (WCAG 2.2 SC 2.5.8)
   24x24 desktop minimum, 44x44 mobile/touch.
   Tokens: --target-min / --target-touch (fairy-aurora.css).
   ==================== */
.btn,
.btn-sm,
.nav-link,
.dropdown-item,
.form-check,
.page-link,
.fa-cyber-btn,
.fa-cyber-btn--sm {
    min-height: var(--target-min);
    min-width:  var(--target-min);
}
.btn-group .btn,
.table .btn,
.action-buttons .btn {
    min-width:  var(--target-min);
    min-height: var(--target-min);
}

@media (max-width: 767px) {
    /* Buttons - ensure minimum touch target */
    .btn {
        min-height: var(--target-touch);
        padding-top: 0.625rem;
        padding-bottom: 0.625rem;
    }

    .btn-sm {
        min-height: var(--target-touch);
        padding: 0.5rem 0.75rem;
    }

    /* Navigation links */
    .nav-link,
    .dropdown-item {
        min-height: var(--target-touch);
        display: flex;
        align-items: center;
    }

    /* Sidebar navigation */
    .app-sidebar .nav-link {
        min-height: var(--target-touch);
        padding: 0.75rem 1rem;
    }

    /* Table action buttons - larger touch targets */
    .btn-group .btn,
    .table .btn,
    .action-buttons .btn {
        min-width: var(--target-touch);
        min-height: var(--target-touch);
        padding: 0.5rem;
    }

    /* Form controls */
    .form-control,
    .form-select {
        min-height: var(--target-touch);
    }

    /* Checkbox and radio - larger clickable area */
    .form-check {
        min-height: var(--target-touch);
        display: flex;
        align-items: center;
    }

    .form-check-input {
        width: 1.25rem;
        height: 1.25rem;
    }

    /* Pagination */
    .page-link {
        min-width: var(--target-touch);
        min-height: var(--target-touch);
        display: flex;
        align-items: center;
        justify-content: center;
    }
}

/* ====================
   Sticky Action Bar for Mobile Forms
   ==================== */
@media (max-width: 767px) {
    /* Sticky bottom bar for form actions */
    .form-actions-sticky {
        position: fixed;
        bottom: 0;
        left: 0;
        right: 0;
        background: var(--surface);
        border-top: 1px solid var(--border);
        padding: 1rem;
        z-index: var(--z-sticky, 100);
        display: flex;
        gap: 0.75rem;
        box-shadow: var(--shadow-up-sm);
    }

    .form-actions-sticky .btn {
        flex: 1;
    }

    .form-actions-sticky .btn-primary {
        order: 1;  /* Primary action on the right */
    }

    .form-actions-sticky .btn-secondary,
    .form-actions-sticky .btn-outline-secondary {
        order: 0;  /* Secondary action on the left */
    }

    /* Dark mode sticky bar */
    [data-theme="dark"] .form-actions-sticky {
        background: var(--bg);
        border-top-color: var(--border);
        box-shadow: var(--shadow-up-md);
    }

    /* Add padding to form content to prevent overlap with sticky bar */
    .form-with-sticky-actions {
        padding-bottom: 80px;
    }
}

/* ====================
   Mobile Card Layout Improvements
   ==================== */
@media (max-width: 767px) {
    /* Cards should use full width on mobile */
    .card {
        margin-bottom: 1rem;
    }

    /* KPI cards - stack properly */
    .kpi-card,
    .stat-card {
        margin-bottom: 0.75rem;
    }

    /* Dashboard grids - single column on small phones */
    .grid-responsive-250,
    .grid-responsive-200 {
        grid-template-columns: 1fr !important;
    }

    /* Charts container - prevent overflow */
    .chart-container {
        max-width: 100%;
        overflow-x: auto;
    }
}

/* ====================
   Mobile Typography Adjustments
   ==================== */
@media (max-width: 767px) {
    /* Slightly smaller headings on mobile */
    h1, .h1 { font-size: 1.75rem; }
    h2, .h2 { font-size: 1.5rem; }
    h3, .h3 { font-size: 1.25rem; }

    /* Page titles */
    .page-title {
        font-size: 1.5rem;
    }

    /* Truncate long text in tables */
    .text-truncate-mobile {
        max-width: 150px;
        overflow: hidden;
        text-overflow: ellipsis;
        white-space: nowrap;
    }
}

/* Policy-Wizard form-guard — visible "what's missing" highlight.
   Set by wizard_form_guard_controller.js when a required field is empty on
   submit, so the user sees exactly which row/field blocks "Weiter". */
.wizard-row-invalid > td,
.wizard-row-invalid > th {
    background: var(--danger-tint, rgba(220, 38, 38, 0.08));
}
.fa-cyber-input__field.is-invalid,
select.is-invalid,
textarea.is-invalid {
    border-color: var(--danger) !important;
    box-shadow: 0 0 0 2px var(--danger-tint, rgba(220, 38, 38, 0.18)) !important;
}
