/**
 * ManageMyTrust - Main Stylesheet
 * Version: 1.0.0
 * 
 * This stylesheet contains all custom styles for the ManageMyTrust application.
 * It follows a modular approach with clear sections for different components.
 */

/* ============================================
   1. BASE & LAYOUT
   ============================================ */

html {
    height: 100%;
}

body {
    height: 100%;
    margin: 0 !important;
    padding: 0 !important;
    overflow-x: hidden;
}

div.wrapper {
    min-height: 100vh !important;
    display: flex !important;
    flex-direction: column !important;
}

div.content-wrapper {
    flex: 1 0 auto !important;
}

footer.footer {
    flex-shrink: 0 !important;
    width: 100%;
}

/* ============================================
   2. NAVIGATION
   ============================================ */

/* Logout button in dropdown - styled as dropdown item */
.logout-form {
    display: inline;
    width: 100%;
}

.logout-button {
    border: none;
    background: none;
    cursor: pointer;
    text-align: left;
    width: 100%;
}

/* Language switcher forms */
.language-form {
    display: inline;
}

/* Top navbar for non-authenticated users only */
.navbar .navbar-brand img {
    max-height: 60px;
    width: auto;
    transition: opacity 0.2s ease;
}

.navbar .navbar-brand:hover img {
    opacity: 0.9;
}

.navbar .navbar-brand {
    display: flex !important;
    align-items: center !important;
    text-decoration: none !important;
    padding: 0.25rem 0 !important;
    margin-right: 1rem !important;
}

.navbar {
    padding-top: 0.25rem !important;
    padding-bottom: 0.25rem !important;
}

/* ============================================
   3. FORMS & INPUTS
   ============================================ */

/* Scrollable permission containers */
.permission-container {
    height: 400px !important;
    max-height: 400px !important;
    overflow-y: auto !important;
}

/* Scrollable group selection in user forms */
.group-selection-container {
    max-height: 300px;
    overflow-y: auto;
}

/* Permission items in group forms */
.permission-item {
    cursor: pointer;
    display: flex;
    justify-content: space-between;
    align-items: center;
    transition: background-color 0.2s ease;
    border-left: 3px solid transparent;
}

.permission-item.hidden {
    display: none !important;
}

.permission-item.hidden {
    display: none !important;
}

.permission-item:hover {
    background-color: #f8f9fa;
}

.available-item:hover {
    border-left-color: #28a745;
    background-color: #f0f9f4;
}

.selected-item:hover {
    border-left-color: #dc3545;
    background-color: #fff5f5;
}

/* Hidden checkboxes for permission selection */
.permission-checkbox-hidden {
    display: none !important;
    visibility: hidden !important;
}

/* Dependent dropdown functionality */
.dependent-field-help {
    font-size: 0.70875rem;
    color: #6c757d;
    margin-top: 0.25rem;
}

/* Loading state for dropdowns */
select.loading {
    background-image: url('data:image/svg+xml;charset=utf8,<svg xmlns="http://www.w3.org/2000/svg" width="16" height="16" viewBox="0 0 16 16"><circle cx="8" cy="8" r="7" fill="none" stroke="%23007bff" stroke-width="2" stroke-dasharray="31.416" stroke-dashoffset="31.416"><animate attributeName="stroke-dasharray" dur="2s" values="0 31.416;15.708 15.708;0 31.416" repeatCount="indefinite"/><animate attributeName="stroke-dashoffset" dur="2s" values="0;-15.708;-31.416" repeatCount="indefinite"/></circle></svg>');
    background-repeat: no-repeat;
    background-position: right 0.75rem center;
    background-size: 16px 16px;
}

/* Error state for dropdowns */
select.error {
    border-color: #dc3545;
    background-color: #fff5f5;
}


/* Coming Soon page */
.coming-soon-icon {
    font-size: 4rem;
    color: var(--bs-secondary);
}

/* ============================================
   4. TABLES
   ============================================ */

/* Ensure tables are responsive */
.table-responsive {
    overflow-x: auto;
    border-radius: 0.375rem;
}

/* Number and currency formatting */
.table .number-cell,
.table .currency-cell,
.table .amount-cell,
.table .decimal-cell,
.table .integer-cell {
    text-align: right !important;
    font-family: 'Courier New', Courier, monospace;
    font-variant-numeric: tabular-nums;
    white-space: nowrap;
}

.table .currency-cell {
    font-weight: 600;
}

/* Specific styling for different number types */
.table .percentage-cell {
    text-align: right !important;
    font-variant-numeric: tabular-nums;
}

.table .id-cell,
.table .count-cell {
    text-align: right !important;
    font-variant-numeric: tabular-nums;
    font-weight: 500;
}

/* Enhanced table styling */
.table {
    margin-bottom: 0;
    border-collapse: separate;
    border-spacing: 0;
}

.table th {
    background-color: #f8f9fa;
    border-bottom: 2px solid #dee2e6;
    font-weight: 600;
    font-size: 0.7875rem;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    color: #495057;
    padding: 0.75rem;
    vertical-align: middle;
    position: relative;
}

.table td {
    padding: 0.75rem;
    vertical-align: middle;
    border-bottom: 1px solid #dee2e6;
    transition: background-color 0.2s ease;
}

/* Table hover effects - enhanced */
.table-hover tbody tr:hover {
    background-color: rgba(13, 110, 253, 0.05);
    transition: background-color 0.2s ease;
}

.table-hover tbody tr:hover td {
    background-color: transparent;
}

/* Striped table enhancement */
.table-striped > tbody > tr:nth-of-type(odd) > td {
    background-color: rgba(0, 0, 0, 0.02);
}

/* Table borders */
.table-bordered {
    border: 1px solid #dee2e6;
    border-radius: 0.375rem;
    overflow: hidden;
}

.table-bordered th,
.table-bordered td {
    border: 1px solid #dee2e6;
}

/* Action buttons in tables */
.table .btn-group {
    display: flex;
    gap: 0.25rem;
    white-space: nowrap;
}

.table .btn-sm,
.table td .btn-sm,
.table-responsive .table .btn-sm {
    font-size: 0.675rem;
    padding: 0.375rem 0.5rem !important;
    border-radius: 0.25rem;
    transition: all 0.2s ease;
    white-space: nowrap;
    line-height: 1;
    min-width: auto;
    width: auto;
}

/* Icon-only buttons in tables - compact size */
.table .btn-sm i,
.table .btn-sm .bi,
.table td .btn-sm i,
.table td .btn-sm .bi {
    font-size: 1rem;
    line-height: 1;
    display: block;
}

/* Icon-only outline buttons - extra compact */
.table .btn-outline-info,
.table .btn-outline-warning,
.table .btn-outline-danger,
.table td .btn-outline-info,
.table td .btn-outline-warning,
.table td .btn-outline-danger {
    padding: 0.375rem 0.5rem !important;
    min-width: auto;
    width: auto;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border-width: 1px !important;
    border-style: solid !important;
    background-color: transparent !important;
}

/* Outline button colors */
.table .btn-outline-info,
.table td .btn-outline-info {
    color: #0dcaf0 !important;
    border-color: #0dcaf0 !important;
}

.table .btn-outline-info:hover,
.table td .btn-outline-info:hover {
    color: #fff !important;
    background-color: #0dcaf0 !important;
    border-color: #0dcaf0 !important;
}

.table .btn-outline-warning,
.table td .btn-outline-warning {
    color: #ffc107 !important;
    border-color: #ffc107 !important;
}

.table .btn-outline-warning:hover,
.table td .btn-outline-warning:hover {
    color: #000 !important;
    background-color: #ffc107 !important;
    border-color: #ffc107 !important;
}

.table .btn-outline-danger,
.table td .btn-outline-danger {
    color: #dc3545 !important;
    border-color: #dc3545 !important;
}

.table .btn-outline-danger:hover,
.table td .btn-outline-danger:hover {
    color: #fff !important;
    background-color: #dc3545 !important;
    border-color: #dc3545 !important;
}

/* Ensure action column cells never wrap */
.table td:last-child,
.table th:last-child {
    white-space: nowrap !important;
}

/* Column width classes for better table layout */
.table .col-wide {
    min-width: 200px;
    max-width: 320px;
}

.table .col-medium {
    min-width: 150px;
    max-width: 250px;
}

.table .col-narrow {
    min-width: 100px;
    max-width: 150px;
}

/* ============================================
   4.1. TABLE ENHANCEMENTS
   ============================================ */

/* Enhanced table container */
.enhanced-table-container {
    background: #fff;
    border-radius: 0.5rem;
    box-shadow: 0 0.125rem 0.25rem rgba(0, 0, 0, 0.075);
    overflow: hidden;
}

/* Table filter section */
.table-filter-section {
    background-color: #f8f9fa;
    border-bottom: 1px solid #dee2e6;
    padding: 1rem;
}

.table-filter-form {
    display: flex;
    flex-wrap: wrap;
    gap: 1rem;
    align-items: end;
}

.table-filter-group {
    display: flex;
    flex-direction: column;
    min-width: 200px;
    flex: 1;
}

.table-filter-group label {
    font-size: 0.7875rem;
    font-weight: 600;
    color: #495057;
    margin-bottom: 0.25rem;
}

.table-filter-group .form-control,
.table-filter-group .form-select {
    font-size: 0.7875rem;
    padding: 0.375rem 0.75rem;
    border-radius: 0.375rem;
    transition: all 0.2s ease;
}

.table-filter-group .form-control:focus,
.table-filter-group .form-select:focus {
    border-color: #0d6efd;
    box-shadow: 0 0 0 0.2rem rgba(13, 110, 253, 0.25);
}

.table-search-input {
    position: relative;
}

.table-search-input .form-control {
    padding-left: 2.5rem;
}

.table-search-input::before {
    content: "🔍";
    position: absolute;
    left: 0.75rem;
    top: 50%;
    transform: translateY(-50%);
    color: #6c757d;
    z-index: 2;
    pointer-events: none;
}

.table-filter-actions {
    display: flex;
    gap: 0.5rem;
    align-items: end;
}

.table-filter-actions .btn {
    font-size: 0.7875rem;
    padding: 0.375rem 0.75rem;
    white-space: nowrap;
}

/* Active filters display */
.active-filters {
    margin-top: 1rem;
    padding-top: 1rem;
    border-top: 1px solid #dee2e6;
}

.active-filters-list {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
    margin-bottom: 0;
}

/* Date range filtering styles */
.date-filter-group {
    border: 1px solid #dee2e6;
    border-radius: 0.375rem;
    padding: 0.75rem;
    background-color: #f8f9fa;
    margin-bottom: 0.5rem;
}

.date-preset-select {
    margin-bottom: 0.5rem;
}

.date-range-inputs {
    transition: all 0.3s ease;
}

.date-range-inputs input[type="date"] {
    font-size: 0.875rem;
}

.date-range-inputs input[type="date"]:focus {
    border-color: #0d6efd;
    box-shadow: 0 0 0 0.2rem rgba(13, 110, 253, 0.25);
}

.date-range-inputs input[type="date"].is-invalid {
    border-color: #dc3545;
    box-shadow: 0 0 0 0.2rem rgba(220, 53, 69, 0.25);
}

.date-filter-error {
    font-size: 0.75rem;
    color: #dc3545;
    margin-top: 0.25rem;
    display: none;
}

/* Date filter badges in active filters */
.badge.bg-info {
    background-color: #0dcaf0 !important;
}

.badge a {
    text-decoration: none;
}

.badge a:hover {
    opacity: 0.8;
}

/* Mobile responsive date filters */
@media (max-width: 768px) {
    .date-filter-group {
        margin-bottom: 1rem;
    }
    
    .date-range-inputs .col-6 {
        margin-bottom: 0.5rem;
    }
    
    .date-preset-select {
        font-size: 0.875rem;
    }
}

.filter-tag {
    display: inline-flex;
    align-items: center;
    background-color: #e7f3ff;
    color: #0d6efd;
    padding: 0.25rem 0.5rem;
    border-radius: 1rem;
    font-size: 0.675rem;
    font-weight: 500;
    border: 1px solid #b8daff;
}

.filter-tag .filter-remove {
    background: none;
    border: none;
    color: #0d6efd;
    margin-left: 0.25rem;
    padding: 0;
    font-size: 0.75rem;
    cursor: pointer;
    border-radius: 50%;
    width: 1rem;
    height: 1rem;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s ease;
}

.filter-tag .filter-remove:hover {
    background-color: #0d6efd;
    color: white;
}

/* Sortable table headers */
.sortable-header {
    cursor: pointer;
    user-select: none;
    position: relative;
    padding-right: 1.5rem !important;
    transition: all 0.2s ease;
}

.sortable-header .sort-link {
    color: inherit;
    display: flex;
    align-items: center;
    justify-content: between;
    width: 100%;
    padding: 0.5rem;
    margin: -0.5rem;
    text-decoration: none;
}

.sortable-header .sort-link:hover {
    background-color: rgba(0, 0, 0, 0.05);
    border-radius: 0.25rem;
    color: inherit;
    text-decoration: none;
}

.sortable-header .sort-indicators {
    font-size: 0.875rem;
    min-width: 1rem;
    text-align: center;
}

.sortable-header:hover .sort-indicators .opacity-50 {
    opacity: 1 !important;
}

.sortable-header:hover {
    background-color: rgba(13, 110, 253, 0.1);
    color: #0d6efd;
}

.sortable-header.active {
    background-color: rgba(13, 110, 253, 0.15);
    color: #0d6efd;
    font-weight: 600;
}

.sort-indicator {
    position: absolute;
    right: 0.5rem;
    top: 50%;
    transform: translateY(-50%);
    font-size: 0.75rem;
    opacity: 0.6;
    transition: all 0.2s ease;
}

.sortable-header:hover .sort-indicator {
    opacity: 1;
}

.sortable-header.active .sort-indicator {
    opacity: 1;
    color: #0d6efd;
}

.sort-indicator.asc::before {
    content: "▲";
}

.sort-indicator.desc::before {
    content: "▼";
}

.sort-indicator.none::before {
    content: "⇅";
}

/* Enhanced pagination */
.table-pagination-wrapper {
    background-color: #f8f9fa;
    border-top: 1px solid #dee2e6;
    padding: 1rem;
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap;
    gap: 1rem;
}

.table-info {
    font-size: 0.7875rem;
    color: #6c757d;
    margin: 0;
}

.table-info strong {
    color: #495057;
    font-weight: 600;
}

.pagination-controls {
    display: flex;
    align-items: center;
    gap: 1rem;
}

.page-size-selector {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    font-size: 0.7875rem;
    color: #6c757d;
}

.page-size-selector select {
    font-size: 0.7875rem;
    padding: 0.25rem 0.5rem;
    border-radius: 0.25rem;
    border: 1px solid #ced4da;
    background-color: white;
}

/* Enhanced pagination navigation */
.pagination {
    margin: 0;
    font-size: 0.7875rem;
}

.pagination .page-link {
    padding: 0.375rem 0.75rem;
    border-radius: 0.375rem;
    margin: 0 0.125rem;
    transition: all 0.2s ease;
    border: 1px solid #dee2e6;
    color: #6c757d;
}

.pagination .page-link:hover {
    background-color: #e9ecef;
    border-color: #adb5bd;
    color: #495057;
    transform: translateY(-1px);
}

.pagination .page-item.active .page-link {
    background-color: #0d6efd;
    border-color: #0d6efd;
    color: white;
    font-weight: 600;
}

.pagination .page-item.disabled .page-link {
    opacity: 0.5;
    cursor: not-allowed;
    transform: none;
}

/* Date range filter styling */
.date-range-filter {
    display: flex;
    gap: 0.5rem;
    align-items: center;
}

.date-range-filter input[type="date"] {
    font-size: 0.7875rem;
    padding: 0.375rem 0.5rem;
    border-radius: 0.375rem;
    border: 1px solid #ced4da;
    width: 140px;
}

.date-range-presets {
    display: flex;
    gap: 0.25rem;
    margin-top: 0.5rem;
}

.date-preset-btn {
    font-size: 0.675rem;
    padding: 0.25rem 0.5rem;
    border: 1px solid #dee2e6;
    background-color: white;
    color: #6c757d;
    border-radius: 0.25rem;
    cursor: pointer;
    transition: all 0.2s ease;
}

.date-preset-btn:hover {
    background-color: #e9ecef;
    border-color: #adb5bd;
    color: #495057;
}

.date-preset-btn.active {
    background-color: #0d6efd;
    border-color: #0d6efd;
    color: white;
}

/* ============================================
   ENHANCED MOBILE RESPONSIVENESS & TOUCH SUPPORT
   ============================================ */

/* Mobile responsive table enhancements */
@media (max-width: 768px) {
    /* CRITICAL FIX: Disable Bootstrap 5's responsive table flex mode completely */
    /* Bootstrap 5 applies display:flex to table elements on mobile - we need to override this */
    
    /* Target all possible Bootstrap table combinations with maximum specificity */
    .table-responsive table,
    .table-responsive .table,
    .table-responsive table.table,
    .table-responsive table.table-striped,
    .table-responsive table.table-hover,
    .table-responsive table.table-bordered,
    div.table-responsive table,
    div.table-responsive .table,
    div.table-responsive table.table,
    div.table-responsive table.table-striped,
    div.table-responsive table.table-hover {
        display: table !important;
        width: 100% !important;
    }
    
    .table-responsive table thead,
    .table-responsive .table thead,
    .table-responsive table.table thead,
    div.table-responsive table thead,
    div.table-responsive .table thead {
        display: table-header-group !important;
    }
    
    .table-responsive table tbody,
    .table-responsive .table tbody,
    .table-responsive table.table tbody,
    div.table-responsive table tbody,
    div.table-responsive .table tbody {
        display: table-row-group !important;
    }
    
    .table-responsive table tr,
    .table-responsive .table tr,
    .table-responsive table.table tr,
    .table-responsive table thead tr,
    .table-responsive table tbody tr,
    .table-responsive .table thead tr,
    .table-responsive .table tbody tr,
    div.table-responsive table tr,
    div.table-responsive .table tr {
        display: table-row !important;
    }
    
    /* MOST IMPORTANT: Force table-cell display on th and td */
    .table-responsive table th,
    .table-responsive table td,
    .table-responsive .table th,
    .table-responsive .table td,
    .table-responsive table.table th,
    .table-responsive table.table td,
    .table-responsive table.table-striped th,
    .table-responsive table.table-striped td,
    .table-responsive table.table-hover th,
    .table-responsive table.table-hover td,
    .table-responsive table thead th,
    .table-responsive table tbody td,
    .table-responsive .table thead th,
    .table-responsive .table tbody td,
    div.table-responsive table th,
    div.table-responsive table td,
    div.table-responsive .table th,
    div.table-responsive .table td {
        display: table-cell !important;
        /* Explicitly unset all flex properties */
        flex: none !important;
        flex-direction: unset !important;
        flex-wrap: unset !important;
        flex-basis: unset !important;
        flex-grow: unset !important;
        flex-shrink: unset !important;
    }
    
    .enhanced-table-container {
        margin: 0 -0.75rem;
        border-radius: 0;
        box-shadow: none;
        border-left: none;
        border-right: none;
    }
    
    .table-filter-section {
        padding: 0.75rem;
        background-color: #f8f9fa;
        border-bottom: 1px solid #dee2e6;
        position: sticky;
        top: 0;
        z-index: 10;
    }
    
    /* Collapsible filter components for mobile */
    .table-filter-form {
        flex-direction: column;
        gap: 0.75rem;
    }
    
    .table-filter-group {
        min-width: auto;
        width: 100%;
    }
    
    .table-filter-actions {
        width: 100%;
        justify-content: stretch;
        gap: 0.5rem;
    }
    
    .table-filter-actions .btn {
        flex: 1;
        min-height: 44px; /* Touch-friendly minimum height */
        font-size: 0.875rem;
        font-weight: 500;
    }
    
    /* Collapsible filter toggle */
    .mobile-filter-toggle {
        display: block;
        width: 100%;
        background: linear-gradient(135deg, #0d6efd, #0b5ed7);
        color: white;
        border: none;
        padding: 0.75rem 1rem;
        border-radius: 0.5rem;
        font-size: 0.875rem;
        font-weight: 600;
        margin-bottom: 1rem;
        transition: all 0.3s ease;
        box-shadow: 0 0.125rem 0.25rem rgba(13, 110, 253, 0.25);
        min-height: 48px; /* Touch-friendly */
        display: flex;
        align-items: center;
        justify-content: space-between;
    }
    
    .mobile-filter-toggle:hover {
        background: linear-gradient(135deg, #0b5ed7, #0a58ca);
        transform: translateY(-1px);
        box-shadow: 0 0.25rem 0.5rem rgba(13, 110, 253, 0.3);
    }
    
    .mobile-filter-toggle:active {
        transform: translateY(0);
    }
    
    .mobile-filter-toggle .toggle-icon {
        transition: transform 0.3s ease;
        font-size: 1rem;
    }
    
    .mobile-filter-toggle.collapsed .toggle-icon {
        transform: rotate(180deg);
    }
    
    .mobile-filter-content {
        transition: all 0.3s ease;
        overflow: hidden;
    }
    
    .mobile-filter-content.collapsed {
        max-height: 0;
        opacity: 0;
        margin-bottom: 0;
    }
    
    .mobile-filter-content:not(.collapsed) {
        max-height: 500px;
        opacity: 1;
        margin-bottom: 1rem;
    }
    
    .active-filters-list {
        justify-content: flex-start;
        gap: 0.5rem;
        margin-top: 1rem;
    }
    
    /* CRITICAL: Force standard table layout on mobile - override Bootstrap flex */
    /* Use extremely high specificity to override Bootstrap 5 responsive tables */
    .table-responsive,
    div.table-responsive {
        border-radius: 0;
        border-left: 0;
        border-right: 0;
        position: relative;
        overflow-x: auto !important;
        -webkit-overflow-scrolling: touch;
        scrollbar-width: thin;
        scrollbar-color: rgba(13, 110, 253, 0.3) transparent;
        display: block !important;
    }
    
    /* Force table display - maximum specificity */
    .table-responsive > table,
    .table-responsive > .table,
    .table-responsive > table.table,
    .table-responsive > table.table-striped,
    .table-responsive > table.table-hover,
    div.table-responsive > table,
    div.table-responsive > .table,
    div.table-responsive > table.table,
    div.table-responsive > table.table-striped,
    div.table-responsive > table.table-hover {
        display: table !important;
        width: 100% !important;
        table-layout: auto !important;
        border-collapse: separate !important;
    }
    
    /* Force thead display */
    .table-responsive > table > thead,
    .table-responsive > .table > thead,
    .table-responsive > table.table > thead,
    .table-responsive > table.table-striped > thead,
    .table-responsive > table.table-hover > thead,
    div.table-responsive > table > thead,
    div.table-responsive > .table > thead,
    div.table-responsive > table.table > thead {
        display: table-header-group !important;
    }
    
    /* Force tbody display */
    .table-responsive > table > tbody,
    .table-responsive > .table > tbody,
    .table-responsive > table.table > tbody,
    .table-responsive > table.table-striped > tbody,
    .table-responsive > table.table-hover > tbody,
    div.table-responsive > table > tbody,
    div.table-responsive > .table > tbody,
    div.table-responsive > table.table > tbody {
        display: table-row-group !important;
    }
    
    /* Force tr display */
    .table-responsive > table > thead > tr,
    .table-responsive > table > tbody > tr,
    .table-responsive > .table > thead > tr,
    .table-responsive > .table > tbody > tr,
    .table-responsive > table.table > thead > tr,
    .table-responsive > table.table > tbody > tr,
    .table-responsive > table.table-striped > thead > tr,
    .table-responsive > table.table-striped > tbody > tr,
    .table-responsive > table.table-hover > thead > tr,
    .table-responsive > table.table-hover > tbody > tr,
    div.table-responsive > table > thead > tr,
    div.table-responsive > table > tbody > tr,
    div.table-responsive > .table > thead > tr,
    div.table-responsive > .table > tbody > tr {
        display: table-row !important;
    }
    
    /* CRITICAL: Force th and td to be table-cell, NOT flex */
    .table-responsive > table > thead > tr > th,
    .table-responsive > table > tbody > tr > td,
    .table-responsive > .table > thead > tr > th,
    .table-responsive > .table > tbody > tr > td,
    .table-responsive > table.table > thead > tr > th,
    .table-responsive > table.table > tbody > tr > td,
    .table-responsive > table.table-striped > thead > tr > th,
    .table-responsive > table.table-striped > tbody > tr > td,
    .table-responsive > table.table-hover > thead > tr > th,
    .table-responsive > table.table-hover > tbody > tr > td,
    div.table-responsive > table > thead > tr > th,
    div.table-responsive > table > tbody > tr > td,
    div.table-responsive > .table > thead > tr > th,
    div.table-responsive > .table > tbody > tr > td,
    div.table-responsive > table.table > thead > tr > th,
    div.table-responsive > table.table > tbody > tr > td {
        display: table-cell !important;
        flex-direction: unset !important;
        flex-wrap: unset !important;
        flex: unset !important;
    }
    
    .table-responsive::-webkit-scrollbar {
        height: 8px;
    }
    
    .table-responsive::-webkit-scrollbar-track {
        background: rgba(0, 0, 0, 0.05);
        border-radius: 4px;
    }
    
    .table-responsive::-webkit-scrollbar-thumb {
        background: rgba(13, 110, 253, 0.3);
        border-radius: 4px;
    }
    
    .table-responsive::-webkit-scrollbar-thumb:hover {
        background: rgba(13, 110, 253, 0.5);
    }
    
    .table-responsive .table {
        font-size: 0.75rem;
        margin-bottom: 0;
        min-width: 600px; /* Ensure horizontal scrolling */
        table-layout: auto;
    }
    
    .table-responsive .table th,
    .table-responsive .table td {
        padding: 0.75rem 0.5rem;
        white-space: nowrap;
        vertical-align: middle;
        min-width: 80px; /* Minimum width for each column */
    }
    
    .table-responsive .table th,
    .table-responsive > table > thead > tr > th,
    .table-responsive > .table > thead > tr > th,
    .table-responsive > table.table > thead > tr > th,
    .table-responsive > table.table-striped > thead > tr > th,
    .table-responsive > table.table-hover > thead > tr > th,
    div.table-responsive > table > thead > tr > th,
    div.table-responsive > .table > thead > tr > th,
    div.table-responsive > table.table > thead > tr > th {
        font-size: 0.7rem !important;
        text-transform: uppercase !important;
        letter-spacing: 0.3px !important;
        white-space: nowrap !important;
        overflow: hidden !important;
        text-overflow: ellipsis !important;
        writing-mode: horizontal-tb !important;
        text-orientation: mixed !important;
        display: table-cell !important;
        vertical-align: middle !important;
        flex-direction: unset !important;
        flex: unset !important;
        flex-wrap: unset !important;
    }
    
    /* Ensure action buttons stay in single line */
    .table-responsive .table td:last-child {
        white-space: nowrap !important;
        min-width: 110px;
    }
    
    .table-responsive .table td .btn,
    .table-responsive .table td .btn-sm {
        display: inline-flex !important;
        align-items: center;
        justify-content: center;
        margin: 0 0.125rem;
        white-space: nowrap;
        padding: 0.375rem 0.5rem !important;
        line-height: 1;
        min-width: auto;
        width: auto;
    }
    
    .table-responsive .table td .btn i,
    .table-responsive .table td .btn .bi,
    .table-responsive .table td .btn-sm i,
    .table-responsive .table td .btn-sm .bi {
        font-size: 1rem;
        line-height: 1;
        display: block;
    }
    
    /* Specific outline button sizing */
    .table-responsive .table .btn-outline-info,
    .table-responsive .table .btn-outline-warning,
    .table-responsive .table .btn-outline-danger,
    .table-responsive .table td .btn-outline-info,
    .table-responsive .table td .btn-outline-warning,
    .table-responsive .table td .btn-outline-danger {
        padding: 0.375rem 0.5rem !important;
        min-width: auto;
        width: auto;
        border-width: 1px !important;
        border-style: solid !important;
        background-color: transparent !important;
    }
    
    /* Outline button colors for mobile */
    .table-responsive .table .btn-outline-info,
    .table-responsive .table td .btn-outline-info {
        color: #0dcaf0 !important;
        border-color: #0dcaf0 !important;
    }
    
    .table-responsive .table .btn-outline-info:hover,
    .table-responsive .table td .btn-outline-info:hover {
        color: #fff !important;
        background-color: #0dcaf0 !important;
    }
    
    .table-responsive .table .btn-outline-warning,
    .table-responsive .table td .btn-outline-warning {
        color: #ffc107 !important;
        border-color: #ffc107 !important;
    }
    
    .table-responsive .table .btn-outline-warning:hover,
    .table-responsive .table td .btn-outline-warning:hover {
        color: #000 !important;
        background-color: #ffc107 !important;
    }
    
    .table-responsive .table .btn-outline-danger,
    .table-responsive .table td .btn-outline-danger {
        color: #dc3545 !important;
        border-color: #dc3545 !important;
    }
    
    .table-responsive .table .btn-outline-danger:hover,
    .table-responsive .table td .btn-outline-danger:hover {
        color: #fff !important;
        background-color: #dc3545 !important;
    }
    
    /* Sticky first column for better navigation */
    .table-responsive .table th:first-child,
    .table-responsive .table td:first-child {
        position: sticky;
        left: 0;
        background-color: white;
        border-right: 2px solid #dee2e6;
        z-index: 2;
        box-shadow: 2px 0 4px rgba(0, 0, 0, 0.1);
        min-width: 120px;
        max-width: 150px;
        overflow: hidden;
        text-overflow: ellipsis;
    }
    
    .table-responsive .table th:first-child {
        background-color: #f8f9fa;
        font-weight: 600;
    }
    
    /* Sticky action column */
    .table-responsive .table .actions-column {
        position: sticky;
        right: 0;
        background-color: white;
        border-left: 2px solid #dee2e6;
        z-index: 2;
        min-width: 140px;
        box-shadow: -2px 0 4px rgba(0, 0, 0, 0.1);
        white-space: nowrap !important;
    }
    
    .table-responsive .table .actions-column.th {
        background-color: #f8f9fa;
    }
    
    .table-responsive .table .actions-column .btn,
    .table-responsive .table .actions-column .btn-sm {
        font-size: 0.75rem;
        padding: 0.375rem 0.5rem !important;
        margin: 0.125rem;
        display: inline-flex !important;
        align-items: center;
        justify-content: center;
        min-width: auto;
        width: auto;
        min-height: 36px; /* Touch-friendly */
        border-radius: 0.25rem;
        transition: all 0.2s ease;
        white-space: nowrap;
        line-height: 1;
    }
    
    .table-responsive .table .actions-column .btn i,
    .table-responsive .table .actions-column .btn .bi,
    .table-responsive .table .actions-column .btn-sm i,
    .table-responsive .table .actions-column .btn-sm .bi {
        font-size: 1rem;
        line-height: 1;
        display: block;
    }
    
    .table-responsive .table .actions-column .btn:hover {
        transform: translateY(-1px);
        box-shadow: 0 0.125rem 0.25rem rgba(0, 0, 0, 0.15);
    }
    
    .table-responsive .table .actions-column .btn:active {
        transform: translateY(0);
    }
    
    /* Mobile pagination enhancements */
    .table-pagination-wrapper {
        flex-direction: column;
        text-align: center;
        gap: 1rem;
        padding: 1rem 0.75rem;
        background-color: #f8f9fa;
        border-top: 1px solid #dee2e6;
        position: sticky;
        bottom: 0;
        z-index: 5;
    }
    
    .pagination-controls {
        flex-direction: column;
        gap: 1rem;
        width: 100%;
    }
    
    .pagination {
        justify-content: center;
        flex-wrap: wrap;
        gap: 0.25rem;
    }
    
    .pagination .page-link {
        padding: 0.75rem 1rem;
        margin: 0;
        min-width: 44px; /* Touch-friendly minimum */
        min-height: 44px;
        text-align: center;
        display: flex;
        align-items: center;
        justify-content: center;
        border-radius: 0.5rem;
        font-weight: 500;
        transition: all 0.2s ease;
    }
    
    .pagination .page-link:hover {
        transform: translateY(-1px);
        box-shadow: 0 0.125rem 0.25rem rgba(0, 0, 0, 0.15);
    }
    
    .pagination .page-link:active {
        transform: translateY(0);
    }
    
    /* Compact pagination for very small screens */
    .pagination-compact {
        display: flex;
        align-items: center;
        justify-content: space-between;
        gap: 1rem;
    }
    
    .pagination-compact .page-info {
        font-size: 0.875rem;
        color: #6c757d;
        font-weight: 500;
    }
    
    .pagination-compact .page-nav {
        display: flex;
        gap: 0.5rem;
    }
    
    .pagination-compact .page-nav .btn {
        min-width: 44px;
        min-height: 44px;
        padding: 0.75rem;
        border-radius: 0.5rem;
        display: flex;
        align-items: center;
        justify-content: center;
    }
    
    /* Enhanced mobile sort headers */
    .sortable-header {
        font-size: 0.7rem;
        padding: 0.75rem 0.5rem !important;
        min-height: 48px; /* Touch-friendly */
        display: table-cell;
        align-items: center;
        position: relative;
        white-space: nowrap;
        vertical-align: middle;
    }
    
    .sortable-header .sort-link {
        min-height: 44px;
        padding: 0.5rem;
        border-radius: 0.375rem;
        transition: all 0.2s ease;
        display: inline-flex;
        align-items: center;
        white-space: nowrap;
    }
    
    .sortable-header .sort-link:hover {
        background-color: rgba(13, 110, 253, 0.1);
        transform: scale(1.02);
    }
    
    .sortable-header .sort-link:active {
        transform: scale(0.98);
    }
    
    .sort-indicator {
        right: 0.5rem;
        font-size: 0.875rem;
        min-width: 20px;
        min-height: 20px;
        display: flex;
        align-items: center;
        justify-content: center;
    }
    
    /* Enhanced mobile date filters */
    .date-range-filter {
        flex-direction: column;
        align-items: stretch;
        gap: 0.75rem;
    }
    
    .date-range-filter input[type="date"] {
        width: 100%;
        min-height: 44px; /* Touch-friendly */
        padding: 0.75rem;
        font-size: 0.875rem;
        border-radius: 0.5rem;
        border: 2px solid #dee2e6;
        transition: all 0.2s ease;
    }
    
    .date-range-filter input[type="date"]:focus {
        border-color: #0d6efd;
        box-shadow: 0 0 0 0.25rem rgba(13, 110, 253, 0.25);
        transform: scale(1.02);
    }
    
    .date-range-presets {
        justify-content: center;
        flex-wrap: wrap;
        gap: 0.5rem;
    }
    
    .date-preset-btn {
        min-height: 40px;
        padding: 0.5rem 1rem;
        font-size: 0.875rem;
        border-radius: 0.5rem;
        transition: all 0.2s ease;
        border: 2px solid #dee2e6;
        background-color: white;
        color: #495057;
        font-weight: 500;
    }
    
    .date-preset-btn:hover {
        border-color: #0d6efd;
        background-color: #e7f3ff;
        color: #0d6efd;
        transform: translateY(-1px);
    }
    
    .date-preset-btn:active {
        transform: translateY(0);
    }
    
    .date-preset-btn.active {
        background-color: #0d6efd;
        border-color: #0d6efd;
        color: white;
        box-shadow: 0 0.125rem 0.25rem rgba(13, 110, 253, 0.25);
    }
    
    /* Mobile search input enhancements */
    .table-search-input .form-control {
        min-height: 44px;
        padding: 0.75rem 0.75rem 0.75rem 3rem;
        font-size: 0.875rem;
        border-radius: 0.5rem;
        border: 2px solid #dee2e6;
        transition: all 0.2s ease;
    }
    
    .table-search-input .form-control:focus {
        border-color: #0d6efd;
        box-shadow: 0 0 0 0.25rem rgba(13, 110, 253, 0.25);
        transform: scale(1.02);
    }
    
    .table-search-input::before {
        font-size: 1.125rem;
        left: 1rem;
        z-index: 3;
    }
    
    /* Mobile filter tags */
    .filter-tag {
        padding: 0.5rem 0.75rem;
        font-size: 0.875rem;
        border-radius: 1.5rem;
        margin: 0.25rem;
        display: inline-flex;
        align-items: center;
        gap: 0.5rem;
        min-height: 36px;
    }
    
    .filter-tag .filter-remove {
        min-width: 24px;
        min-height: 24px;
        border-radius: 50%;
        display: flex;
        align-items: center;
        justify-content: center;
        font-size: 0.875rem;
        transition: all 0.2s ease;
    }
    
    .filter-tag .filter-remove:hover {
        transform: scale(1.1);
    }
    
    .filter-tag .filter-remove:active {
        transform: scale(0.9);
    }
}

/* Tablet responsive adjustments */
@media (min-width: 769px) and (max-width: 1024px) {
    .enhanced-table-container {
        border-radius: 0.5rem;
        margin: 0 -0.5rem;
    }
    
    .table-filter-form {
        gap: 1rem;
    }
    
    .table-filter-group {
        min-width: 180px;
        flex: 1;
    }
    
    .table-filter-actions .btn {
        min-height: 40px;
        padding: 0.5rem 1rem;
    }
    
    .pagination .page-link {
        padding: 0.5rem 0.75rem;
        font-size: 0.875rem;
        min-height: 40px;
        min-width: 40px;
    }
    
    .sortable-header {
        font-size: 0.875rem;
        min-height: 44px;
    }
    
    .table-responsive .table th,
    .table-responsive .table td {
        padding: 0.75rem 0.5rem;
    }
    
    /* Tablet sticky columns */
    .table-responsive .table .actions-column {
        min-width: 160px;
    }
    
    .table-responsive .table .actions-column .btn {
        font-size: 0.875rem;
        padding: 0.375rem 0.75rem;
        min-height: 36px;
    }
}

/* Touch-friendly enhancements for all touch devices */
@media (hover: none) and (pointer: coarse) {
    /* Ensure all interactive elements meet minimum touch target size */
    .sortable-header {
        min-height: 44px;
        display: flex;
        align-items: center;
        touch-action: manipulation;
    }
    
    .sortable-header .sort-link {
        min-height: 44px;
        min-width: 44px;
        display: flex;
        align-items: center;
        justify-content: space-between;
        padding: 0.75rem;
        border-radius: 0.5rem;
        transition: all 0.2s ease;
    }
    
    .sortable-header .sort-link:active {
        background-color: rgba(13, 110, 253, 0.2);
        transform: scale(0.98);
    }
    
    .pagination .page-link {
        min-height: 44px;
        min-width: 44px;
        display: flex;
        align-items: center;
        justify-content: center;
        touch-action: manipulation;
        border-radius: 0.5rem;
        transition: all 0.2s ease;
    }
    
    .pagination .page-link:active {
        transform: scale(0.95);
        background-color: rgba(13, 110, 253, 0.2);
    }
    
    .filter-tag .filter-remove {
        min-width: 32px;
        min-height: 32px;
        border-radius: 50%;
        touch-action: manipulation;
    }
    
    .filter-tag .filter-remove:active {
        transform: scale(0.9);
        background-color: rgba(220, 53, 69, 0.2);
    }
    
    .date-preset-btn {
        min-height: 44px;
        padding: 0.75rem 1rem;
        touch-action: manipulation;
        border-radius: 0.5rem;
    }
    
    .date-preset-btn:active {
        transform: scale(0.98);
    }
    
    /* Enhanced touch scrolling */
    .table-responsive {
        -webkit-overflow-scrolling: touch;
        scroll-behavior: smooth;
        overscroll-behavior-x: contain;
    }
    
    /* Touch-friendly form controls */
    .table-filter-group .form-control,
    .table-filter-group .form-select {
        min-height: 44px;
        padding: 0.75rem;
        font-size: 16px; /* Prevents zoom on iOS */
        touch-action: manipulation;
    }
    
    .table-filter-actions .btn {
        min-height: 44px;
        min-width: 44px;
        padding: 0.75rem 1rem;
        touch-action: manipulation;
        border-radius: 0.5rem;
    }
    
    .table-filter-actions .btn:active {
        transform: scale(0.98);
    }
    
    /* Touch-friendly table actions */
    .table .btn {
        min-height: 36px;
        min-width: 60px;
        touch-action: manipulation;
        border-radius: 0.375rem;
    }
    
    .table .btn:active {
        transform: scale(0.95);
    }
    
    /* Improved touch feedback for interactive elements */
    .sortable-header:active,
    .pagination .page-link:active,
    .filter-tag:active,
    .date-preset-btn:active,
    .table-filter-actions .btn:active {
        transition: transform 0.1s ease;
    }
}

/* High contrast mode support */
@media (prefers-contrast: high) {
    .sortable-header:hover,
    .sortable-header.active {
        background-color: #000;
        color: #fff;
    }
    
    .filter-tag {
        border: 2px solid #000;
        background-color: #fff;
        color: #000;
    }
    
    .pagination .page-item.active .page-link {
        background-color: #000;
        border-color: #000;
        color: #fff;
    }
}

/* Reduced motion support */
@media (prefers-reduced-motion: reduce) {
    .sortable-header,
    .sort-indicator,
    .pagination .page-link,
    .filter-tag .filter-remove,
    .date-preset-btn {
        transition: none;
    }
    
    .pagination .page-link:hover {
        transform: none;
    }
}

/* Print styles for tables */
@media print {
    .table-filter-section,
    .table-pagination-wrapper {
        display: none !important;
    }
    
    .enhanced-table-container {
        box-shadow: none;
        border: 1px solid #000;
    }
    
    .table {
        font-size: 8pt;
    }
    
    .table th,
    .table td {
        padding: 0.25rem;
        border: 1px solid #000;
    }
    
    .sortable-header .sort-indicator {
        display: none;
    }
}

/* Loading states for table enhancements */
.table-loading {
    position: relative;
    opacity: 0.7;
    pointer-events: none;
}

.table-loading::after {
    content: "";
    position: absolute;
    top: 50%;
    left: 50%;
    width: 2rem;
    height: 2rem;
    margin: -1rem 0 0 -1rem;
    border: 0.25rem solid #f3f3f3;
    border-top: 0.25rem solid #0d6efd;
    border-radius: 50%;
    animation: table-spinner 1s linear infinite;
    z-index: 1000;
}

@keyframes table-spinner {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

/* Empty state for filtered tables */
.table-empty-state {
    text-align: center;
    padding: 3rem 1rem;
    color: #6c757d;
}

.table-empty-state .empty-icon {
    font-size: 3rem;
    margin-bottom: 1rem;
    opacity: 0.5;
}

.table-empty-state h5 {
    color: #495057;
    margin-bottom: 0.5rem;
}

.table-empty-state p {
    margin-bottom: 1rem;
    font-size: 0.7875rem;
}

.table-empty-state .btn {
    font-size: 0.7875rem;
}

/* ============================================
   5. CARDS & PANELS
   ============================================ */

/* Card styling consistency */
.card {
    border-radius: 0.5rem;
    box-shadow: 0 0.125rem 0.25rem rgba(0, 0, 0, 0.075);
}

.card-header {
    background-color: #f8f9fa;
    border-bottom: 1px solid rgba(0, 0, 0, 0.125);
    font-weight: 600;
}

/* ============================================
   6. BUTTONS
   ============================================ */

/* Button spacing in action columns */
.btn-sm {
    margin-right: 0.25rem;
}

.btn-sm:last-child {
    margin-right: 0;
}

/* Button group spacing */
.btn-group .btn {
    margin-right: 0;
}

/* ============================================
   7. BADGES & LABELS
   ============================================ */

/* Badge spacing */
.badge {
    margin-right: 0.25rem;
}

.badge:last-child {
    margin-right: 0;
}

.badge.bg-purple {
    background-color: #7C3AED !important;
    color: #fff;
}

.text-prewrap {
    white-space: pre-wrap;
}

/* ============================================
   8. ALERTS & MESSAGES
   ============================================ */

/* Alert positioning and animation */
.alert {
    animation: slideDown 0.3s ease-out;
}

@keyframes slideDown {
    from {
        opacity: 0;
        transform: translateY(-10px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* ============================================
   9. EMPTY STATES
   ============================================ */

/* Empty state styling for lists */
.empty-state {
    text-align: center;
    padding: 3rem 1rem;
    color: #6c757d;
}

.empty-state-icon {
    font-size: 2.43rem;
    margin-bottom: 1rem;
}

/* Empty message in permission selector */
.empty-message {
    text-align: center;
    padding: 3rem 1rem;
    color: #6c757d;
}

.empty-message i {
    font-size: 2.43rem;
}

/* Card header search inputs */
.card-header input.form-control {
    background-color: rgba(255, 255, 255, 0.9);
}

/* ============================================
   10. UTILITY CLASSES
   ============================================ */

/* Visibility utilities */
.hidden {
    display: none !important;
}

/* Text utilities */
.text-truncate-2 {
    display: -webkit-box;
    -webkit-line-clamp: 2;
    line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

/* Currency and number formatting utilities */
.currency-cell,
.number-cell,
.amount-cell,
.decimal-cell,
.integer-cell {
    text-align: right;
    font-family: 'Courier New', Courier, monospace;
    font-variant-numeric: tabular-nums;
    white-space: nowrap;
}

.currency-cell {
    font-weight: 600;
}

.percentage-cell {
    text-align: right;
    font-variant-numeric: tabular-nums;
}

/* Spacing utilities */
.mt-6 {
    margin-top: 4rem;
}

.mb-6 {
    margin-bottom: 4rem;
}

/* ============================================
   11. RESPONSIVE ADJUSTMENTS
   ============================================ */

/* Sticky page header */
.page-header {
    position: sticky;
    top: 0;
    z-index: 100;
    background-color: #fff;
    padding-top: 1rem;
    padding-bottom: 1rem;
    margin-top: -1rem;
    margin-left: -1rem;
    margin-right: -1rem;
    margin-bottom: 1.5rem !important;
    padding-left: 1rem;
    padding-right: 1rem;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.05);
}

/* Enhanced shadow when scrolled (optional - can be added via JS) */
.page-header.scrolled {
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.1);
}

/* Mobile page header fix */
@media (max-width: 768px) {
    .page-header {
        flex-wrap: wrap;
        gap: 0.5rem;
        align-items: flex-start;
        top: 0;
        /* Match Bootstrap container's 0.75rem padding exactly — prevents 4px
           horizontal overflow caused by the default -1rem negative margins. */
        margin-left: -0.75rem;
        margin-right: -0.75rem;
        padding-left: 0.75rem;
        padding-right: 0.75rem;
    }

    /* Title+breadcrumb takes full row; action buttons wrap to the line below.
       min-width: 0 prevents the flex item from expanding beyond the container,
       allowing long subtitle text to wrap instead of overflowing. */
    .page-header > div:first-child {
        flex: 1 1 100%;
        min-width: 0;
    }
    
    .page-header h2 {
        margin-left: 70px; /* Space for hamburger menu */
        flex: 1 1 auto;
        font-size: 1.25rem;
        white-space: normal; /* Allow wrapping */
        overflow: visible;
        word-wrap: break-word;
    }
    
    /* Align breadcrumb with title - only for direct children */
    .page-header > div:first-child .breadcrumb {
        margin-left: 70px; /* Align breadcrumb with title */
        padding-left: 0;
    }
    
    /* Align paragraphs and other elements under title */
    .page-header > div:first-child > p,
    .page-header > div:first-child > div:not(:first-child) {
        margin-left: 70px; /* Align with title */
    }
    
    .page-header .btn {
        flex: 0 0 auto;
        width: auto;
        white-space: nowrap;
    }
    
    /* Keep buttons in a single line and prevent stretching.
       :not(:first-child) ensures this only targets the buttons div (second child),
       not a lone div that is both first and last child (e.g. pages with no action buttons). */
    .page-header > div:last-child:not(:first-child),
    .page-header > a {
        display: flex;
        flex-wrap: nowrap;
        gap: 0.25rem;
        flex: 0 0 auto;
        width: auto;
    }

    .page-header > div:last-child:not(:first-child) .btn,
    .page-header > a.btn {
        font-size: 0.75rem;
        padding: 0.375rem 0.5rem;
        flex: 0 0 auto;
        width: auto;
    }
}

/* Ensure breadcrumb appears below title on all screen sizes */
.page-header > div:first-child {
    display: flex;
    flex-direction: column;
    align-items: flex-start;
}

/* Mobile optimizations */
@media (max-width: 768px) {
    /* Card footer buttons should stay inline and not stretch */
    .card-footer .btn-sm,
    .card-footer .btn {
        display: inline-block !important;
        width: auto !important;
        margin: 0.125rem;
    }
    
    /* Buttons in flex containers should not stretch */
    .d-flex .btn,
    .d-inline-flex .btn {
        flex: 0 0 auto !important;
        width: auto !important;
    }
    
    /* Button groups should display inline */
    .btn-group .btn {
        display: inline-block !important;
        width: auto !important;
    }
    
    /* Table action buttons should stay inline and compact - HIGHEST PRIORITY */
    .table .btn-sm,
    .table td .btn-sm,
    .table .btn,
    .table td .btn,
    .table-responsive .btn-sm,
    .table-responsive td .btn-sm,
    .table-responsive .btn,
    .table-responsive td .btn,
    td .btn-sm,
    td .btn {
        display: inline-block !important;
        width: auto !important;
        margin: 0.125rem !important;
        padding: 0.375rem 0.5rem !important;
        flex: 0 0 auto !important;
    }
    
    /* Adjust table font size */
    .table {
        font-size: 0.70875rem;
    }
    
    /* Reduce permission container height on mobile */
    .permission-container {
        height: 300px;
    }
    
    .group-selection-container {
        max-height: 200px;
    }
}

/* Tablet adjustments */
@media (min-width: 769px) and (max-width: 1024px) {
    .container {
        max-width: 95%;
    }
}

/* ============================================
   12. PRINT STYLES
   ============================================ */

@media print {
    /* Hide navigation and footer when printing */
    .navbar,
    .footer,
    .btn,
    .alert {
        display: none !important;
    }
    
    /* Ensure tables print properly */
    .table {
        border-collapse: collapse !important;
    }
    
    .table td,
    .table th {
        border: 1px solid #dee2e6 !important;
    }
}

/* ============================================
   13. ACCESSIBILITY ENHANCEMENTS
   ============================================ */

/* Focus styles for keyboard navigation */
a:focus,
button:focus,
input:focus,
select:focus,
textarea:focus {
    outline: 2px solid #0d6efd;
    outline-offset: 2px;
}

/* Skip to main content link (for screen readers) */
.skip-to-main {
    position: absolute;
    left: -9999px;
    z-index: 999;
}

.skip-to-main:focus {
    left: 50%;
    transform: translateX(-50%);
    top: 10px;
    background: #0d6efd;
    color: white;
    padding: 0.5rem 1rem;
    text-decoration: none;
    border-radius: 0.25rem;
}

/* ============================================
   14. LOADING STATES
   ============================================ */

/* Loading spinner */
.spinner-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(255, 255, 255, 0.8);
    display: flex;
    justify-content: center;
    align-items: center;
    z-index: 9999;
}

/* ============================================
   15. CUSTOM COMPONENTS
   ============================================ */

/* Document Upload Integration */
.document-upload-section {
    margin-bottom: 1rem;
}

.document-upload-section .current-document {
    background-color: #f8fff9;
    border: 1px solid #d1e7dd;
    border-radius: 0.375rem;
    padding: 1rem;
}

.document-upload-section .no-document {
    padding: 0.5rem 0;
}

/* Document management buttons */
.document-actions .btn {
    transition: all 0.2s ease;
}

.document-actions .btn:hover {
    transform: translateY(-1px);
}

/* File type indicators */
.file-type-pdf { color: #dc3545; }
.file-type-doc, .file-type-docx { color: #0d6efd; }
.file-type-image { color: #198754; }

/* Document status badges */
.document-status .badge {
    margin-right: 0.25rem;
    margin-bottom: 0.25rem;
}

/* Dashboard welcome section */
.dashboard-welcome {
    text-align: center;
    padding: 3rem 1rem;
}

/* Admin panel cards */
.admin-card {
    transition: transform 0.2s ease, box-shadow 0.2s ease;
}

/* Video gallery components */
.video-thumbnail-preview {
    max-height: 300px;
    object-fit: cover;
    border-radius: 0.375rem;
}

.video-icon-large {
    font-size: 3rem;
}


.admin-card:hover {
    transform: translateY(-2px);
    box-shadow: 0 0.5rem 1rem rgba(0, 0, 0, 0.15);
}

/* Footer links */
.footer a {
    color: #6c757d;
    transition: color 0.2s ease;
}

.footer a:hover {
    color: #0d6efd;
}

/* Cookie consent banner */
.cookie-consent {
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    padding: 1.5rem;
    box-shadow: 0 -2px 10px rgba(0, 0, 0, 0.1);
    z-index: 1050;
}

.cookie-consent.hidden {
    display: none !important;
}

.cookie-consent:not(.hidden) {
    animation: slideUp 0.5s ease-out;
}

.cookie-consent-content {
    max-width: 1200px;
    margin: 0 auto;
    display: flex;
    flex-direction: column;
    align-items: center;
    text-align: center;
}

.cookie-consent p {
    margin: 0;
    color: white;
}

.cookie-consent strong {
    font-size: 0.891rem;
}

.cookie-consent .btn {
    min-width: 150px;
}

@keyframes slideUp {
    from {
        transform: translateY(100%);
        opacity: 0;
    }
    to {
        transform: translateY(0);
        opacity: 1;
    }
}

/* Responsive cookie consent */
@media (min-width: 768px) {
    .cookie-consent-content {
        flex-direction: row;
        justify-content: space-between;
        align-items: center;
        text-align: left;
    }
    
    .cookie-consent-content > div {
        flex: 1;
        margin-right: 2rem;
    }
    
    .cookie-consent .btn {
        flex-shrink: 0;
    }
}

/* ============================================
   16. DOCUMENT VIEWER MODAL
   ============================================ */

/* Document viewer modal styling */
#documentViewerModal .modal-dialog {
    max-width: 90vw;
    width: 90vw;
    height: 90vh;
    margin: 1rem auto;
}

#documentViewerModal .modal-content {
    height: 100%;
    display: flex;
    flex-direction: column;
}

#documentViewerModal .modal-body {
    flex: 1;
    overflow: hidden;
    display: flex;
    flex-direction: column;
    padding: 1rem;
}

/* Loading state */
.document-viewer-loading {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    min-height: 300px;
    text-align: center;
    padding: 2rem;
}

.document-viewer-loading .spinner-border {
    width: 3rem;
    height: 3rem;
    margin-bottom: 1rem;
}

.document-viewer-loading .progress {
    margin-top: 1rem;
}

/* Enhanced error state */
.document-viewer-error {
    display: flex;
    align-items: center;
    justify-content: center;
    min-height: 300px;
    padding: 2rem;
}

.document-viewer-error .alert {
    margin: 0;
    max-width: 500px;
    text-align: center;
}

.document-viewer-error .alert i {
    font-size: 1.215rem;
    margin-bottom: 0.5rem;
}

/* Warning state for file size warnings */
.document-viewer-warning {
    padding: 2rem;
    display: flex;
    align-items: center;
    justify-content: center;
    min-height: 200px;
}

.document-viewer-warning .alert {
    margin: 0;
    max-width: 500px;
    text-align: center;
    border-color: #ffc107;
    background-color: #fff3cd;
}

/* Modal loading animation */
.modal.loading .modal-content {
    position: relative;
}

.modal.loading .modal-content::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 3px;
    background: linear-gradient(90deg, transparent, #007bff, transparent);
    animation: loading-bar 2s infinite;
    z-index: 1000;
}

@keyframes loading-bar {
    0% { transform: translateX(-100%); }
    100% { transform: translateX(100%); }
}

/* Error state modal styling */
.modal.error-state .modal-header {
    border-bottom-color: #dc3545;
}

.modal.error-state .modal-title {
    color: #dc3545;
}

/* PDF loading placeholder */
.pdf-loading-placeholder {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    min-height: 400px;
    background-color: #f8f9fa;
    border: 2px dashed #dee2e6;
    border-radius: 0.375rem;
}

/* Image loading state */
.image-loading-state {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    min-height: 300px;
    background-color: #f8f9fa;
    border: 2px dashed #dee2e6;
    border-radius: 0.375rem;
}

/* Text loading state */
.text-loading {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 2rem;
    background-color: #f8f9fa;
    border: 1px solid #dee2e6;
    border-radius: 0.375rem;
}

/* Progress bar enhancements */
.progress-bar {
    transition: width 0.3s ease;
    font-size: 0.6075rem;
    font-weight: 600;
}

/* Retry button countdown styling */
.btn:disabled {
    opacity: 0.6;
    cursor: not-allowed;
}

/* Network status indicator */
.network-status {
    position: fixed;
    top: 10px;
    right: 10px;
    z-index: 9999;
    padding: 0.5rem 1rem;
    border-radius: 0.375rem;
    font-size: 0.7875rem;
    font-weight: 600;
}

.network-status.offline {
    background-color: #dc3545;
    color: white;
}

.network-status.online {
    background-color: #198754;
    color: white;
}

/* Content area */
.document-viewer-content {
    flex: 1;
    overflow: auto;
    display: flex;
    flex-direction: column;
}

/* PDF viewer */
.document-viewer-pdf {
    flex: 1;
    display: flex;
    flex-direction: column;
}

.document-viewer-pdf iframe {
    flex: 1;
    min-height: 600px;
    border: 1px solid #dee2e6;
    border-radius: 0.375rem;
}

/* Image viewer */
.document-viewer-image {
    display: flex;
    justify-content: center;
    align-items: center;
    min-height: 400px;
    background-color: #f8f9fa;
    border-radius: 0.375rem;
    padding: 1rem;
}

.document-viewer-image img {
    max-height: 70vh;
    box-shadow: 0 0.125rem 0.25rem rgba(0, 0, 0, 0.075);
    border-radius: 0.375rem;
}

/* Text viewer */
.document-viewer-text {
    flex: 1;
}

.document-viewer-text pre {
    font-family: 'Courier New', Courier, monospace;
    font-size: 0.70875rem;
    line-height: 1.4;
    white-space: pre-wrap;
    word-wrap: break-word;
}

/* Document info */
.document-viewer-info {
    border-top: 1px solid #dee2e6;
    padding-top: 1rem;
    margin-top: 1rem;
}

.document-viewer-info .card {
    background-color: #f8f9fa;
    border: 1px solid #e9ecef;
}

.document-viewer-info dl {
    margin-bottom: 0;
}

.document-viewer-info dt {
    font-weight: 600;
    color: #495057;
}

.document-viewer-info dd {
    color: #6c757d;
}

/* Fullscreen styles */
.document-viewer-content:fullscreen {
    background: white;
    padding: 1rem;
}

.document-viewer-content:-webkit-full-screen {
    background: white;
    padding: 1rem;
}

.document-viewer-content:-moz-full-screen {
    background: white;
    padding: 1rem;
}

/* Responsive adjustments for document viewer */
@media (max-width: 768px) {
    #documentViewerModal .modal-dialog {
        max-width: 98vw;
        width: 98vw;
        height: 98vh;
        margin: 1vh auto;
    }
    
    #documentViewerModal .modal-body {
        padding: 0.75rem;
    }
    
    #documentViewerModal .modal-header {
        padding: 0.75rem;
        flex-wrap: wrap;
    }
    
    #documentViewerModal .modal-footer {
        padding: 0.75rem;
        flex-wrap: wrap;
        gap: 0.5rem;
    }
    
    #documentViewerModal .modal-title {
        font-size: 0.81rem;
        flex: 1;
        min-width: 0;
        overflow: hidden;
        text-overflow: ellipsis;
        white-space: nowrap;
    }
    
    .document-viewer-pdf iframe {
        min-height: 400px;
    }
    
    .document-viewer-image {
        min-height: 300px;
    }
    
    .document-viewer-image img {
        max-height: 50vh;
    }
    
    .document-viewer-info dt,
    .document-viewer-info dd {
        font-size: 0.70875rem;
    }
    
    /* Mobile-optimized controls */
    .document-viewer-image .image-controls {
        flex-wrap: wrap;
        justify-content: center;
        gap: 0.25rem;
    }
    
    .document-viewer-image .image-controls .btn {
        min-width: 2.75rem;
        padding: 0.5rem;
    }
    
    .document-viewer-text .text-controls,
    .document-viewer-csv .text-controls,
    .document-viewer-json .text-controls,
    .document-viewer-markup .text-controls {
        flex-wrap: wrap;
        gap: 0.25rem;
    }
}

/* Tablet adjustments */
@media (min-width: 769px) and (max-width: 1024px) {
    #documentViewerModal .modal-dialog {
        max-width: 95vw;
        width: 95vw;
        height: 95vh;
        margin: 2.5vh auto;
    }
    
    .document-viewer-image img {
        max-height: 65vh;
    }
    
    .document-viewer-pdf iframe {
        min-height: 500px;
    }
}

/* Large screen optimizations */
@media (min-width: 1200px) {
    #documentViewerModal .modal-dialog {
        max-width: 85vw;
        width: 85vw;
        height: 85vh;
    }
    
    .document-viewer-image img {
        max-height: 75vh;
    }
    
    .document-viewer-pdf iframe {
        min-height: 700px;
    }
}

/* Ultra-wide screen adjustments */
@media (min-width: 1600px) {
    #documentViewerModal .modal-dialog {
        max-width: 80vw;
        width: 80vw;
    }
}

/* Touch device optimizations */
@media (hover: none) and (pointer: coarse) {
    .document-viewer-image img {
        /* Enable pinch-to-zoom on touch devices */
        touch-action: pinch-zoom;
    }
    
    .document-viewer-text pre {
        /* Better scrolling on touch devices */
        -webkit-overflow-scrolling: touch;
    }
    
    /* Larger touch targets for mobile */
    .document-viewer-image .image-controls .btn,
    .document-viewer-text .text-controls .btn,
    .document-viewer-csv .text-controls .btn,
    .document-viewer-json .text-controls .btn,
    .document-viewer-markup .text-controls .btn {
        min-height: 44px;
        min-width: 44px;
        padding: 0.75rem;
    }
    
    /* Touch-friendly scrollbars */
    .document-viewer-content {
        scrollbar-width: thick;
    }
    
    .document-viewer-content::-webkit-scrollbar {
        width: 12px;
        height: 12px;
    }
    
    .document-viewer-content::-webkit-scrollbar-thumb {
        background-color: rgba(0, 0, 0, 0.3);
        border-radius: 6px;
    }
    
    .document-viewer-content::-webkit-scrollbar-track {
        background-color: rgba(0, 0, 0, 0.1);
    }
    
    /* Improve touch interaction for image panning */
    .document-viewer-image .image-container {
        touch-action: pan-x pan-y pinch-zoom;
        user-select: none;
        -webkit-user-select: none;
        -moz-user-select: none;
        -ms-user-select: none;
    }
    
    /* Better touch feedback */
    .btn:active {
        transform: scale(0.95);
        transition: transform 0.1s ease;
    }
}

/* High contrast mode support */
@media (prefers-contrast: high) {
    .document-viewer-loading,
    .document-viewer-error {
        background-color: white;
        color: black;
    }
    
    .document-viewer-image {
        background-color: white;
        border: 2px solid black;
    }
    
    .document-viewer-text pre {
        background-color: white;
        border: 2px solid black;
        color: black;
    }
}

/* Reduced motion support */
@media (prefers-reduced-motion: reduce) {
    .document-viewer-loading .spinner-border {
        animation: none;
    }
    
    .progress-bar-animated {
        animation: none;
    }
}

/* ============================================
   17. FILE TYPE HANDLER STYLES
   ============================================ */

/* PDF Handler Styles */
.document-viewer-pdf {
    width: 100%;
    height: 100%;
    display: flex;
    flex-direction: column;
}

.document-viewer-pdf .pdf-iframe {
    width: 100%;
    min-height: 600px;
    height: 70vh; /* Use viewport height for better sizing */
    border: none;
    border-radius: 0.375rem;
    background-color: #f8f9fa; /* Light background to show iframe boundaries */
    flex: 1; /* Take up available space */
}

.document-viewer-pdf .pdf-loading-placeholder {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    min-height: 400px;
    text-align: center;
}

/* Ensure modal content has proper height for PDF viewing */
#documentViewerModal .modal-body {
    min-height: 70vh;
    padding: 1rem;
}

#documentViewerModal .modal-dialog {
    max-width: 90vw;
    width: 90vw;
    height: 90vh;
    max-height: 90vh;
}

#documentViewerModal .modal-content {
    height: 100%;
    display: flex;
    flex-direction: column;
}

#documentViewerModal .modal-body {
    flex: 1;
    overflow: hidden;
    display: flex;
    flex-direction: column;
}

/* Image Handler Styles */
.document-viewer-image {
    position: relative;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 1rem;
}

.document-viewer-image .image-container {
    position: relative;
    overflow: hidden;
    border-radius: 0.375rem;
    box-shadow: 0 0.125rem 0.25rem rgba(0, 0, 0, 0.075);
    max-height: 70vh;
    max-width: 100%;
    display: flex;
    justify-content: center;
    align-items: center;
    background-color: #f8f9fa;
    touch-action: pan-x pan-y pinch-zoom;
    user-select: none;
    -webkit-user-select: none;
    -moz-user-select: none;
    -ms-user-select: none;
}

.document-viewer-image .viewer-image {
    max-width: 100%;
    max-height: 100%;
    transition: transform 0.2s ease;
    cursor: default;
    touch-action: none;
}

.document-viewer-image .image-container[style*="cursor: grab"] .viewer-image {
    cursor: grab;
}

.document-viewer-image .image-container[style*="cursor: grabbing"] .viewer-image {
    cursor: grabbing;
}

.document-viewer-image .image-controls {
    display: flex;
    gap: 0.5rem;
    padding: 0.5rem;
    background-color: rgba(0, 0, 0, 0.05);
    border-radius: 0.375rem;
    flex-wrap: wrap;
    justify-content: center;
}

.document-viewer-image .image-controls .btn {
    min-width: 2.5rem;
    transition: all 0.2s ease;
}

.document-viewer-image .image-controls .btn:active {
    transform: scale(0.95);
}

/* Text Handler Styles */
.document-viewer-text,
.document-viewer-csv,
.document-viewer-json,
.document-viewer-markup {
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

.document-viewer-text .text-controls,
.document-viewer-csv .text-controls,
.document-viewer-json .text-controls,
.document-viewer-markup .text-controls {
    display: flex;
    gap: 0.5rem;
    align-items: center;
    flex-wrap: wrap;
}

.document-viewer-text .text-controls .btn,
.document-viewer-csv .text-controls .btn,
.document-viewer-json .text-controls .btn,
.document-viewer-markup .text-controls .btn {
    transition: all 0.2s ease;
}

.document-viewer-text .text-controls .btn:active,
.document-viewer-csv .text-controls .btn:active,
.document-viewer-json .text-controls .btn:active,
.document-viewer-markup .text-controls .btn:active {
    transform: scale(0.95);
}

.document-viewer-text .text-content,
.document-viewer-json .json-content,
.document-viewer-markup .markup-content {
    background-color: #f8f9fa;
    border: 1px solid #dee2e6;
    border-radius: 0.375rem;
    padding: 1rem;
    font-family: 'Courier New', Courier, monospace;
    font-size: 0.70875rem;
    line-height: 1.5;
    max-height: 600px;
    overflow: auto;
    white-space: pre;
    margin: 0;
    -webkit-overflow-scrolling: touch;
    touch-action: pan-x pan-y pinch-zoom;
}

.document-viewer-text .text-content.text-wrap {
    white-space: pre-wrap;
    word-wrap: break-word;
}

.document-viewer-csv .table-responsive {
    max-height: 600px;
    overflow: auto;
    border: 1px solid #dee2e6;
    border-radius: 0.375rem;
}

.document-viewer-csv .table {
    margin-bottom: 0;
    font-size: 0.70875rem;
}

.document-viewer-csv .table th {
    position: sticky;
    top: 0;
    z-index: 10;
    background-color: #212529 !important;
}

.text-loading {
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 2rem;
    color: #6c757d;
}

/* Fallback Handler Styles */
.document-viewer-fallback {
    display: flex;
    flex-direction: column;
    gap: 1.5rem;
    padding: 1rem;
}

.document-viewer-fallback .file-type-info {
    background-color: #f8f9fa;
    border: 1px solid #dee2e6;
    border-radius: 0.375rem;
    padding: 1.5rem;
}

.document-viewer-fallback .file-type-info h6 {
    color: #495057;
    margin-bottom: 1rem;
    font-weight: 600;
}

.document-viewer-fallback .file-type-info dl {
    margin-bottom: 0;
}

.document-viewer-fallback .file-type-info dt {
    font-weight: 600;
    color: #495057;
}

.document-viewer-fallback .file-type-info dd {
    color: #6c757d;
}

.document-viewer-fallback .supported-formats {
    background-color: #e7f3ff;
    border: 1px solid #b8daff;
    border-radius: 0.375rem;
    padding: 1.5rem;
}

.document-viewer-fallback .supported-formats h6 {
    color: #004085;
    margin-bottom: 1rem;
    font-weight: 600;
}

.document-viewer-fallback .supported-formats ul {
    margin-bottom: 0;
    color: #004085;
}

/* Responsive adjustments for file type handlers */
@media (max-width: 768px) {
    .document-viewer-image .image-container {
        max-height: 50vh;
    }
    
    .document-viewer-image .image-controls {
        justify-content: center;
    }
    
    .document-viewer-text .text-content,
    .document-viewer-json .json-content,
    .document-viewer-markup .markup-content {
        font-size: 0.6075rem;
        max-height: 400px;
    }
    
    .document-viewer-csv .table-responsive {
        max-height: 400px;
    }
    
    .document-viewer-fallback .file-type-info,
    .document-viewer-fallback .supported-formats {
        padding: 1rem;
    }
}

/* Touch device optimizations for handlers */
@media (hover: none) and (pointer: coarse) {
    .document-viewer-image .viewer-image {
        touch-action: pinch-zoom;
    }
    
    .document-viewer-text .text-content,
    .document-viewer-json .json-content,
    .document-viewer-markup .markup-content {
        -webkit-overflow-scrolling: touch;
    }
    
    .document-viewer-csv .table-responsive {
        -webkit-overflow-scrolling: touch;
    }
}

/* High contrast mode support for handlers */
@media (prefers-contrast: high) {
    .document-viewer-text .text-content,
    .document-viewer-json .json-content,
    .document-viewer-markup .markup-content {
        background-color: white;
        border: 2px solid black;
        color: black;
    }
    
    .document-viewer-fallback .file-type-info,
    .document-viewer-fallback .supported-formats {
        background-color: white;
        border: 2px solid black;
        color: black;
    }
}

/* Print styles for document viewer */
@media print {
    #documentViewerModal {
        display: none !important;
    }
}

/* ============================================
   17. PASSWORD TOGGLE WITH BOOTSTRAP INPUT-GROUP
   ============================================ */

/* Password toggle button styling */
.password-toggle-btn {
    border-left: 0 !important;
    background: transparent !important;
    border-color: #ced4da !important;
    color: #6c757d !important;
    padding: 0.375rem 0.75rem;
    display: flex;
    align-items: center;
    justify-content: center;
}

.password-toggle-btn:hover {
    background: rgba(0, 0, 0, 0.05) !important;
    border-color: #ced4da !important;
    color: #495057 !important;
}

.password-toggle-btn:focus {
    background: rgba(13, 110, 253, 0.1) !important;
    border-color: #86b7fe !important;
    color: #0d6efd !important;
    box-shadow: 0 0 0 0.25rem rgba(13, 110, 253, 0.25) !important;
}

.password-toggle-btn:active {
    background: rgba(13, 110, 253, 0.2) !important;
    border-color: #86b7fe !important;
    color: #0d6efd !important;
}

/* Material Icons styling for password toggle */
.password-toggle-btn .material-symbols-outlined {
    font-family: 'Material Symbols Outlined';
    font-weight: normal;
    font-style: normal;
    font-size: 14.58px;
    line-height: 1;
    letter-spacing: normal;
    text-transform: none;
    display: inline-block;
    white-space: nowrap;
    word-wrap: normal;
    direction: ltr;
    -webkit-font-feature-settings: 'liga';
    -webkit-font-smoothing: antialiased;
    color: inherit;
}

/* Ensure input-group has proper focus states */
.input-group:focus-within .password-toggle-btn {
    border-color: #86b7fe !important;
}

/* ============================================
   18. DEPENDENT DROPDOWN FUNCTIONALITY
   ============================================ */

/* Loading state for dropdowns */
select.loading {
    background-image: url("data:image/svg+xml,%3csvg width='16' height='16' viewBox='0 0 16 16' xmlns='http://www.w3.org/2000/svg'%3e%3cpath d='M8 0a8 8 0 1 1 0 16A8 8 0 0 1 8 0zM8 2a6 6 0 1 0 0 12A6 6 0 0 0 8 2z' fill='%236c757d'/%3e%3cpath d='M8 2a6 6 0 0 1 6 6h-2a4 4 0 0 0-4-4V2z' fill='%230d6efd'%3e%3canimateTransform attributeName='transform' type='rotate' values='0 8 8;360 8 8' dur='1s' repeatCount='indefinite'/%3e%3c/path%3e%3c/svg%3e");
    background-repeat: no-repeat;
    background-position: right 0.75rem center;
    background-size: 16px;
    padding-right: 2.5rem !important;
}

/* Error state for dropdowns */
select.error {
    border-color: #dc3545 !important;
    background-color: #f8d7da !important;
}

select.error:focus {
    border-color: #dc3545 !important;
    box-shadow: 0 0 0 0.25rem rgba(220, 53, 69, 0.25) !important;
}

/* Disabled state styling */
select:disabled {
    background-color: #e9ecef !important;
    opacity: 1 !important;
}

/* Country-State form group styling */
.country-state-group {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 1rem;
}

@media (max-width: 576px) {
    .country-state-group {
        grid-template-columns: 1fr;
    }
}

/* Help text for dependent fields */
.dependent-field-help {
    font-size: 0.70875rem;
    color: #6c757d;
    margin-top: 0.25rem;
}

/* Loading indicator for AJAX requests */
.dropdown-loading {
    position: relative;
}

.dropdown-loading::after {
    content: '';
    position: absolute;
    right: 2rem;
    top: 50%;
    transform: translateY(-50%);
    width: 16px;
    height: 16px;
    border: 2px solid #f3f3f3;
    border-top: 2px solid #0d6efd;
    border-radius: 50%;
    animation: spin 1s linear infinite;
}

@keyframes spin {
    0% { transform: translateY(-50%) rotate(0deg); }
    100% { transform: translateY(-50%) rotate(360deg); }
}

/* Accessibility improvements */
select[aria-busy="true"] {
    cursor: wait;
}

select[aria-invalid="true"] {
    border-color: #dc3545 !important;
}

/* Focus management for dependent dropdowns */
.form-control:focus + .dependent-field-help {
    color: #0d6efd;
}

/* Form fieldset styling */
fieldset {
    border: none;
    padding: 0;
    margin: 0;
}

fieldset legend {
    font-weight: 600;
    font-size: 0.81rem;
    margin-bottom: 0.75rem;
    padding-bottom: 0.5rem;
    border-bottom: 1px solid #dee2e6;
    width: 100%;
}

/* Form section spacing */
.card-body fieldset + fieldset {
    margin-top: 2rem;
}

/* ============================================
   19. DOCUMENT VIEWER CONTROLS
   ============================================ */

/* Viewer controls layout */
.viewer-controls {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    flex-wrap: wrap;
}

.viewer-controls .btn-group {
    flex-shrink: 0;
}

.viewer-controls .btn {
    transition: all 0.2s ease;
}

.viewer-controls .btn:hover:not(:disabled) {
    transform: translateY(-1px);
}

.viewer-controls .btn:active:not(:disabled) {
    transform: translateY(0);
}

.viewer-controls .btn:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

/* Page navigation info */
#pageInfo {
    font-family: 'Courier New', Courier, monospace;
    font-size: 0.70875rem;
    font-weight: 600;
    min-width: 80px;
    text-align: center;
    cursor: default;
}

/* Action buttons layout */
.action-buttons {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    margin-left: auto;
}

/* Modal footer responsive layout */
#documentViewerModal .modal-footer {
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap;
    gap: 1rem;
    padding: 1rem;
}

/* Responsive adjustments for viewer controls */
@media (max-width: 768px) {
    #documentViewerModal .modal-footer {
        flex-direction: column;
        align-items: stretch;
        gap: 0.75rem;
    }
    
    .viewer-controls {
        justify-content: center;
        order: 1;
    }
    
    .action-buttons {
        justify-content: center;
        margin-left: 0;
        order: 2;
    }
    
    .viewer-controls .btn-group {
        margin-bottom: 0.25rem;
    }
    
    .viewer-controls .btn {
        min-width: 2.5rem;
        padding: 0.5rem;
    }
    
    .action-buttons .btn {
        flex: 1;
        min-width: 0;
    }
    
    #pageInfo {
        min-width: 70px;
        font-size: 0.6075rem;
    }
}

/* Tablet adjustments */
@media (min-width: 769px) and (max-width: 1024px) {
    .viewer-controls .btn {
        padding: 0.375rem 0.5rem;
        font-size: 0.70875rem;
    }
    
    #pageInfo {
        min-width: 75px;
        font-size: 0.658125rem;
    }
}

/* Touch device optimizations for controls */
@media (hover: none) and (pointer: coarse) {
    .viewer-controls .btn,
    .action-buttons .btn {
        min-height: 44px;
        min-width: 44px;
        padding: 0.75rem;
    }
    
    .viewer-controls .btn-group .btn {
        border-radius: 0.375rem !important;
        margin-right: 0.25rem;
    }
    
    .viewer-controls .btn-group .btn:last-child {
        margin-right: 0;
    }
    
    #pageInfo {
        min-height: 44px;
        display: flex;
        align-items: center;
        justify-content: center;
        padding: 0.75rem 0.5rem;
    }
}

/* High contrast mode support for controls */
@media (prefers-contrast: high) {
    .viewer-controls .btn,
    .action-buttons .btn {
        border: 2px solid;
    }
    
    .viewer-controls .btn:disabled,
    .action-buttons .btn:disabled {
        opacity: 0.7;
        background-color: #f8f9fa;
        color: #6c757d;
        border-color: #6c757d;
    }
}

/* Reduced motion support for controls */
@media (prefers-reduced-motion: reduce) {
    .viewer-controls .btn,
    .action-buttons .btn {
        transition: none;
    }
    
    .viewer-controls .btn:hover:not(:disabled) {
        transform: none;
    }
}

/* Focus styles for keyboard navigation */
.viewer-controls .btn:focus,
.action-buttons .btn:focus {
    outline: 2px solid #0d6efd;
    outline-offset: 2px;
    z-index: 1;
}

/* Button group focus management */
.viewer-controls .btn-group .btn:focus {
    z-index: 2;
}

/* Info toggle button states */
#documentInfoToggle.active {
    background-color: #0d6efd;
    border-color: #0d6efd;
    color: white;
}

/* Fullscreen button enhancement */
#documentViewerFullscreen {
    position: relative;
}

#documentViewerFullscreen::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: linear-gradient(45deg, transparent 30%, rgba(255,255,255,0.1) 50%, transparent 70%);
    opacity: 0;
    transition: opacity 0.3s ease;
}

#documentViewerFullscreen:hover::before {
    opacity: 1;
}

/* Control tooltips enhancement */
.viewer-controls .btn[title],
.action-buttons .btn[title] {
    position: relative;
}

/* Print styles for controls */
@media print {
    .viewer-controls,
    .action-buttons,
    #documentViewerModal .modal-footer {
        display: none !important;
    }
}

/* Performance Optimization Styles */

/* Network Status Indicator */
.network-status {
    position: fixed;
    top: 20px;
    right: 20px;
    z-index: 9999;
    padding: 0.5rem 1rem;
    border-radius: 0.375rem;
    color: white;
    font-size: 0.70875rem;
    font-weight: 500;
    box-shadow: 0 0.125rem 0.25rem rgba(0, 0, 0, 0.075);
    transition: all 0.3s ease;
}

.network-status.online {
    background-color: #198754;
}

.network-status.offline {
    background-color: #dc3545;
}

/* Progressive Loading Indicators */
.progressive-loading-indicator {
    position: absolute;
    top: 10px;
    right: 10px;
    background: rgba(0, 0, 0, 0.8);
    color: white;
    padding: 0.25rem 0.5rem;
    border-radius: 0.25rem;
    font-size: 0.675rem;
    z-index: 10;
}

/* Cache Status Indicator */
.cache-status {
    position: absolute;
    top: 10px;
    left: 10px;
    background: rgba(40, 167, 69, 0.9);
    color: white;
    padding: 0.25rem 0.5rem;
    border-radius: 0.25rem;
    font-size: 0.675rem;
    z-index: 10;
}

/* Memory Usage Warning */
.memory-warning {
    position: fixed;
    bottom: 20px;
    left: 20px;
    background: rgba(255, 193, 7, 0.95);
    color: #212529;
    padding: 0.5rem 1rem;
    border-radius: 0.375rem;
    font-size: 0.7875rem;
    z-index: 9998;
    max-width: 300px;
}

/* Loading Animation Enhancements */
.modal.loading .modal-content {
    position: relative;
    overflow: hidden;
}

.modal.loading .modal-content::before {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 2px;
    background: linear-gradient(90deg, transparent, #007bff, transparent);
    animation: loading-shimmer 2s infinite;
    z-index: 1000;
}

@keyframes loading-shimmer {
    0% { left: -100%; }
    100% { left: 100%; }
}

/* Error State Styling */
.modal.error-state .modal-header {
    background-color: #f8d7da;
    border-bottom-color: #f5c6cb;
}

.modal.error-state .modal-title {
    color: #721c24;
}

/* Performance Metrics Display (for debugging) */
.performance-metrics {
    position: fixed;
    bottom: 10px;
    right: 10px;
    background: rgba(0, 0, 0, 0.8);
    color: white;
    padding: 0.5rem;
    border-radius: 0.25rem;
    font-size: 0.675rem;
    font-family: monospace;
    z-index: 9997;
    display: none; /* Hidden by default, can be shown for debugging */
}

.performance-metrics.show {
    display: block;
}

/* Lazy Loading Placeholder */
.document-lazy-placeholder {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    min-height: 200px;
    background: #f8f9fa;
    border: 2px dashed #dee2e6;
    border-radius: 0.375rem;
    color: #6c757d;
    font-size: 0.7875rem;
}

.document-lazy-placeholder i {
    font-size: 1.8rem;
    margin-bottom: 0.5rem;
}

/* Progressive Loading Progress Bar Enhancement */
.progress-bar.progressive {
    background: linear-gradient(45deg, #007bff 25%, transparent 25%, transparent 50%, #007bff 50%, #007bff 75%, transparent 75%, transparent);
    background-size: 1rem 1rem;
    animation: progress-bar-stripes 1s linear infinite;
}

@keyframes progress-bar-stripes {
    0% { background-position: 1rem 0; }
    100% { background-position: 0 0; }
}

/* Mobile Performance Optimizations */
@media (max-width: 768px) {
    .network-status {
        top: 10px;
        right: 10px;
        font-size: 0.675rem;
        padding: 0.25rem 0.5rem;
    }
    
    .progressive-loading-indicator,
    .cache-status {
        font-size: 0.5625rem;
        padding: 0.125rem 0.25rem;
    }
    
    .memory-warning {
        bottom: 10px;
        left: 10px;
        font-size: 0.675rem;
        padding: 0.25rem 0.5rem;
        max-width: 250px;
    }
}

/* ============================================
   20. ENHANCED DOCUMENT VIEWER UI POLISH
   ============================================ */

/* Smooth transitions for all interactive elements */
.document-viewer-btn,
.document-viewer-link {
    transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
    position: relative;
    overflow: hidden;
}

.document-viewer-btn:hover,
.document-viewer-link:hover {
    transform: translateY(-1px);
    box-shadow: 0 0.25rem 0.5rem rgba(0, 0, 0, 0.15);
}

.document-viewer-btn:active,
.document-viewer-link:active {
    transform: translateY(0);
    transition-duration: 0.1s;
}

/* Ripple effect for buttons */
.document-viewer-btn::before {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    width: 0;
    height: 0;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.3);
    transform: translate(-50%, -50%);
    transition: width 0.3s ease, height 0.3s ease;
    pointer-events: none;
}

.document-viewer-btn:active::before {
    width: 300px;
    height: 300px;
}

/* Enhanced loading animations */
.document-viewer-loading {
    background: linear-gradient(135deg, #f8f9fa 0%, #e9ecef 100%);
    position: relative;
}

.document-viewer-loading::before {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.4), transparent);
    animation: shimmer 2s infinite;
}

@keyframes shimmer {
    0% { left: -100%; }
    100% { left: 100%; }
}

/* Pulse animation for loading states */
.document-viewer-loading .spinner-border {
    animation: pulse-scale 1.5s ease-in-out infinite alternate;
}

@keyframes pulse-scale {
    0% { transform: scale(1); opacity: 1; }
    100% { transform: scale(1.1); opacity: 0.7; }
}

/* Enhanced progress bar with gradient */
.document-viewer-progress .progress-bar {
    background: linear-gradient(45deg, #007bff, #0056b3);
    position: relative;
    overflow: hidden;
}

.document-viewer-progress .progress-bar::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: linear-gradient(45deg, transparent 30%, rgba(255, 255, 255, 0.2) 50%, transparent 70%);
    animation: progress-shine 2s infinite;
}

@keyframes progress-shine {
    0% { transform: translateX(-100%); }
    100% { transform: translateX(100%); }
}

/* Modal entrance animations */
#documentViewerModal.fade .modal-dialog {
    transform: scale(0.9) translateY(-50px);
    transition: all 0.3s cubic-bezier(0.34, 1.56, 0.64, 1);
}

#documentViewerModal.show .modal-dialog {
    transform: scale(1) translateY(0);
}

/* Content fade-in animation */
.document-viewer-content {
    opacity: 0;
    animation: fadeInUp 0.5s ease-out forwards;
}

@keyframes fadeInUp {
    from {
        opacity: 0;
        transform: translateY(20px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* Enhanced error state with icon animation */
.document-viewer-error .alert i {
    animation: errorPulse 2s ease-in-out infinite;
}

@keyframes errorPulse {
    0%, 100% { transform: scale(1); }
    50% { transform: scale(1.1); }
}

/* Success state animation */
.document-viewer-success {
    animation: successSlide 0.5s ease-out;
}

@keyframes successSlide {
    from {
        opacity: 0;
        transform: translateX(-20px);
    }
    to {
        opacity: 1;
        transform: translateX(0);
    }
}

/* Interactive hover states for document cards */
.document-card {
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    border-radius: 0.5rem;
    overflow: hidden;
    position: relative;
}

.document-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: linear-gradient(135deg, rgba(13, 110, 253, 0.05) 0%, rgba(13, 110, 253, 0.1) 100%);
    opacity: 0;
    transition: opacity 0.3s ease;
    pointer-events: none;
}

.document-card:hover {
    transform: translateY(-2px);
    box-shadow: 0 0.5rem 1rem rgba(0, 0, 0, 0.15);
}

.document-card:hover::before {
    opacity: 1;
}

/* Enhanced file type icons with animations */
.file-type-icon {
    transition: all 0.3s ease;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 2rem;
    height: 2rem;
    border-radius: 0.375rem;
    margin-right: 0.5rem;
}

.file-type-icon:hover {
    transform: rotate(5deg) scale(1.1);
}

.file-type-pdf .file-type-icon {
    background: linear-gradient(135deg, #dc3545, #c82333);
    color: white;
}

.file-type-image .file-type-icon {
    background: linear-gradient(135deg, #198754, #157347);
    color: white;
}

.file-type-doc .file-type-icon,
.file-type-docx .file-type-icon {
    background: linear-gradient(135deg, #0d6efd, #0b5ed7);
    color: white;
}

.file-type-text .file-type-icon {
    background: linear-gradient(135deg, #6c757d, #5c636a);
    color: white;
}

/* Enhanced zoom controls with better feedback */
.zoom-controls {
    background: rgba(0, 0, 0, 0.8);
    border-radius: 0.5rem;
    padding: 0.5rem;
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
}

.zoom-controls .btn {
    background: rgba(255, 255, 255, 0.1);
    border: 1px solid rgba(255, 255, 255, 0.2);
    color: white;
    transition: all 0.2s ease;
}

.zoom-controls .btn:hover {
    background: rgba(255, 255, 255, 0.2);
    border-color: rgba(255, 255, 255, 0.3);
    transform: scale(1.05);
}

.zoom-controls .btn:active {
    transform: scale(0.95);
}

/* Enhanced fullscreen transition */
.document-viewer-content.entering-fullscreen {
    animation: enterFullscreen 0.3s ease-out;
}

.document-viewer-content.exiting-fullscreen {
    animation: exitFullscreen 0.3s ease-out;
}

@keyframes enterFullscreen {
    from {
        transform: scale(0.95);
        opacity: 0.8;
    }
    to {
        transform: scale(1);
        opacity: 1;
    }
}

@keyframes exitFullscreen {
    from {
        transform: scale(1.05);
        opacity: 0.8;
    }
    to {
        transform: scale(1);
        opacity: 1;
    }
}

/* Enhanced responsive breakpoints */
@media (max-width: 480px) {
    #documentViewerModal .modal-dialog {
        margin: 0.5rem;
        max-width: calc(100vw - 1rem);
        height: calc(100vh - 1rem);
    }
    
    .document-viewer-content {
        padding: 0.5rem;
    }
    
    .zoom-controls {
        padding: 0.25rem;
    }
    
    .zoom-controls .btn {
        min-width: 2rem;
        min-height: 2rem;
        padding: 0.25rem;
        font-size: 0.675rem;
    }
}

@media (min-width: 481px) and (max-width: 768px) {
    #documentViewerModal .modal-dialog {
        margin: 1rem;
        max-width: calc(100vw - 2rem);
        height: calc(100vh - 2rem);
    }
}

@media (min-width: 1400px) {
    #documentViewerModal .modal-dialog {
        max-width: 75vw;
        width: 75vw;
    }
}

/* Enhanced accessibility features */
@media (prefers-reduced-motion: reduce) {
    .document-viewer-btn,
    .document-viewer-link,
    .document-card,
    .file-type-icon,
    .zoom-controls .btn {
        transition: none;
        animation: none;
    }
    
    .document-viewer-btn:hover,
    .document-viewer-link:hover,
    .document-card:hover,
    .file-type-icon:hover,
    .zoom-controls .btn:hover {
        transform: none;
    }
    
    .document-viewer-loading::before,
    .document-viewer-progress .progress-bar::before {
        animation: none;
    }
}

/* High contrast mode enhancements */
@media (prefers-contrast: high) {
    .document-card {
        border: 2px solid;
    }
    
    .zoom-controls {
        background: black;
        border: 2px solid white;
    }
    
    .zoom-controls .btn {
        background: white;
        color: black;
        border: 1px solid black;
    }
    
    .file-type-icon {
        border: 2px solid;
    }
}

/* Dark mode support (if implemented) */
@media (prefers-color-scheme: dark) {
    .document-viewer-loading {
        background: linear-gradient(135deg, #343a40 0%, #495057 100%);
    }
    
    .document-card::before {
        background: linear-gradient(135deg, rgba(255, 255, 255, 0.05) 0%, rgba(255, 255, 255, 0.1) 100%);
    }
    
    .document-viewer-content {
        background-color: #212529;
        color: #f8f9fa;
    }
}

/* Enhanced focus indicators for better accessibility */
.document-viewer-btn:focus-visible,
.document-viewer-link:focus-visible {
    outline: 3px solid #0d6efd;
    outline-offset: 2px;
    box-shadow: 0 0 0 0.25rem rgba(13, 110, 253, 0.25);
}

.zoom-controls .btn:focus-visible {
    outline: 2px solid white;
    outline-offset: 2px;
}

/* Loading skeleton for better perceived performance */
.document-skeleton {
    background: linear-gradient(90deg, #f0f0f0 25%, #e0e0e0 50%, #f0f0f0 75%);
    background-size: 200% 100%;
    animation: skeleton-loading 1.5s infinite;
    border-radius: 0.375rem;
}

@keyframes skeleton-loading {
    0% { background-position: 200% 0; }
    100% { background-position: -200% 0; }
}

.document-skeleton.skeleton-text {
    height: 1rem;
    margin-bottom: 0.5rem;
}

.document-skeleton.skeleton-text:last-child {
    width: 60%;
}

.document-skeleton.skeleton-image {
    height: 200px;
    width: 100%;
}

/* Enhanced tooltip styling */
.tooltip {
    font-size: 0.675rem;
}

.tooltip-inner {
    background-color: rgba(0, 0, 0, 0.9);
    border-radius: 0.375rem;
    padding: 0.5rem 0.75rem;
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
}

/* Performance indicator styling */
.performance-indicator {
    position: absolute;
    top: 0.5rem;
    right: 0.5rem;
    background: rgba(0, 0, 0, 0.7);
    color: white;
    padding: 0.25rem 0.5rem;
    border-radius: 0.25rem;
    font-size: 0.5625rem;
    font-family: monospace;
    z-index: 10;
}

.performance-indicator.good {
    background: rgba(25, 135, 84, 0.8);
}

.performance-indicator.warning {
    background: rgba(255, 193, 7, 0.8);
    color: #212529;
}

.performance-indicator.poor {
    background: rgba(220, 53, 69, 0.8);
}

/* Enhanced print styles */
@media print {
    .document-viewer-content {
        background: white !important;
        color: black !important;
        box-shadow: none !important;
    }
    
    .document-viewer-image img {
        max-width: 100% !important;
        height: auto !important;
    }
    
    .document-viewer-text pre {
        white-space: pre-wrap !important;
        font-size: 9pt !important;
        line-height: 1.2 !important;
    }
}

/* ============================================
   21. DOCUMENT CARD COMPONENT STYLES
   ============================================ */

/* Document card base styles */
.document-card .card {
    border: 1px solid #dee2e6;
    border-radius: 0.5rem;
    transition: all 0.2s ease;
    position: relative;
}

.document-card .card:hover {
    box-shadow: 0 0.25rem 0.5rem rgba(0, 0, 0, 0.1);
    border-color: #0d6efd;
}

/* Document info styles */
.document-info .document-title {
    color: #495057;
    font-weight: 600;
}

.document-info .document-filename {
    font-weight: 500;
    color: #212529;
    word-break: break-word;
}

.document-info .document-meta {
    margin-top: 0.25rem;
}

/* Document actions */
.document-actions .btn {
    transition: all 0.2s ease;
}

.document-actions .btn:hover {
    transform: translateY(-1px);
}

/* Document status badges */
.document-status .badge {
    margin-right: 0.25rem;
    margin-bottom: 0.25rem;
    animation: fadeInUp 0.3s ease-out;
}

/* Loading state for document cards */
.document-card.loading {
    opacity: 0.7;
    pointer-events: none;
    position: relative;
}

.document-card.loading::after {
    content: "";
    position: absolute;
    top: 50%;
    left: 50%;
    width: 1.5rem;
    height: 1.5rem;
    margin: -0.75rem 0 0 -0.75rem;
    border: 0.2rem solid #f3f3f3;
    border-top: 0.2rem solid #0d6efd;
    border-radius: 50%;
    animation: spin 1s linear infinite;
    z-index: 1000;
}

/* Responsive adjustments for document cards */
@media (max-width: 768px) {
    .document-card .row {
        text-align: center;
    }
    
    .document-card .col-auto:first-child {
        margin-bottom: 1rem;
    }
    
    .document-actions {
        margin-top: 1rem;
    }
    
    .document-actions .btn {
        margin-bottom: 0.25rem;
    }
}

/* ============================================
   22. DOCUMENT GALLERY COMPONENT STYLES
   ============================================ */

/* Document gallery grid layout */
.document-gallery {
    width: 100%;
    max-width: 100%;
    overflow-x: hidden;
}

.document-gallery-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(240px, 1fr));
    gap: 1rem;
    width: 100%;
    max-width: 100%;
}

.document-gallery-item .card {
    transition: all 0.2s ease;
    height: 100%;
}

.document-gallery-item .card:hover {
    transform: translateY(-2px);
    box-shadow: 0 0.5rem 1rem rgba(0, 0, 0, 0.15);
}

/* Empty-state card with dashed border */
.document-gallery-item .card.border-dashed {
    border-style: dashed !important;
    border-color: #dee2e6 !important;
    background-color: #fafafa;
}

.document-gallery-item .card.border-dashed:hover {
    border-color: #adb5bd !important;
    transform: translateY(-2px);
    box-shadow: 0 0.25rem 0.5rem rgba(0, 0, 0, 0.06);
}

/* Document card typography */
.doc-card-label {
    font-size: 0.9rem;
    font-weight: 600;
    color: #212529;
    line-height: 1.3;
}

.doc-card-filename {
    font-size: 0.75rem;
    line-height: 1.3;
    max-width: 100%;
    color: #6c757d;
}

/* Square icon-only buttons (Replace / Delete) */
.doc-icon-btn {
    width: 2rem !important;
    height: 2rem !important;
    padding: 0 !important;
    flex-shrink: 0;
    display: inline-flex !important;
    align-items: center !important;
    justify-content: center !important;
    line-height: 1;
}

/* Empty-state upload icon */
.doc-empty-icon {
    font-size: 2rem;
    opacity: 0.35;
    color: #6c757d;
}

/* Document preview styles */
.document-preview {
    height: 120px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 0.375rem;
    overflow: hidden;
}

.image-preview {
    width: 100%;
    height: 100%;
    background-size: cover;
    background-position: center;
    background-repeat: no-repeat;
    border-radius: 0.375rem;
    cursor: pointer;
    position: relative;
    transition: transform 0.2s ease;
}

.image-preview:hover {
    transform: scale(1.05);
}

.image-overlay {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.5);
    display: flex;
    align-items: center;
    justify-content: center;
    opacity: 0;
    transition: opacity 0.2s ease;
    color: white;
    font-size: 1.35rem;
}

.image-preview:hover .image-overlay {
    opacity: 1;
}

.file-preview {
    width: 100%;
    height: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 2.7rem;
    color: white;
    border-radius: 0.375rem;
}

.file-preview.file-type-pdf { 
    background: linear-gradient(135deg, #dc3545, #c82333); 
}

.file-preview.file-type-doc, 
.file-preview.file-type-docx { 
    background: linear-gradient(135deg, #0d6efd, #0b5ed7); 
}

.file-preview.file-type-default { 
    background: linear-gradient(135deg, #6c757d, #5c636a); 
}

.empty-document-preview {
    height: 120px;
    display: flex;
    align-items: center;
    justify-content: center;
    background-color: #f8f9fa;
    border: 2px dashed #dee2e6;
    border-radius: 0.375rem;
    font-size: 1.8rem;
    color: #6c757d;
    transition: all 0.2s ease;
}

.empty-document-preview:hover {
    border-color: #0d6efd;
    color: #0d6efd;
}

/* Gallery item animations */
.document-gallery-item {
    animation: fadeInUp 0.3s ease-out;
}

/* View toggle animations */
.document-gallery-grid.fade-out,
.document-gallery-list.fade-out {
    opacity: 0;
    transform: translateY(10px);
    transition: all 0.2s ease;
}

.document-gallery-grid.fade-in,
.document-gallery-list.fade-in {
    opacity: 1;
    transform: translateY(0);
    transition: all 0.2s ease;
}

/* Responsive adjustments for document gallery */
@media (max-width: 768px) {
    .document-gallery-grid {
        grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
        width: 100%;
        max-width: 100%;
    }
    
    .document-preview {
        height: 100px;
    }
    
    .empty-document-preview {
        height: 100px;
        font-size: 1.35rem;
    }
}

@media (max-width: 576px) {
    .document-gallery-grid {
        grid-template-columns: 1fr;
        width: 100%;
        max-width: 100%;
    }
}

/* ============================================
   23. SIDEBAR NAVIGATION STYLES
   ============================================ */

/* Sidebar container */
.sidebar {
    position: fixed;
    top: 0;
    left: 0;
    height: 100vh;
    height: 100dvh; /* dynamic viewport: tracks visible area as browser chrome shows/hides */
    width: 190px;
    background-color: var(--sidebar-bg);
    border-right: 1px solid var(--sidebar-border);
    box-shadow: 0 0.125rem 0.25rem var(--sidebar-shadow);
    z-index: 1040;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    display: flex;
    flex-direction: column;
    overflow: hidden;
}

/* Collapsed sidebar state */
.sidebar.collapsed {
    width: 80px;
}

/* Sidebar header */
.sidebar-header {
    padding: 0.625rem 0.75rem;
    border-bottom: 1px solid var(--sidebar-header-border);
    background-color: var(--sidebar-header-bg);
    display: flex;
    align-items: center;
    justify-content: flex-start;
    gap: 0.5rem;
    min-height: 52px;
    flex-shrink: 0;
}

.sidebar-header .navbar-brand {
    display: flex;
    align-items: center;
    text-decoration: none;
    color: var(--sidebar-text);
    font-weight: 600;
    font-size: 1.0125rem;
    margin: 0;
    padding: 0;
    transition: opacity 0.3s ease;
}

.sidebar-header .navbar-brand img {
    max-height: 30px;
    width: auto;
    margin-right: 0.5rem;
    transition: margin 0.3s ease;
}

/* Logo visibility control */
.sidebar-header .navbar-brand .logo-full {
    display: block;
}

.sidebar-header .navbar-brand .logo-icon {
    display: none;
    max-height: 32px;
    width: 32px;
}

.sidebar.collapsed .sidebar-header .navbar-brand .logo-full {
    display: none;
}

.sidebar.collapsed .sidebar-header .navbar-brand .logo-icon {
    display: block;
    margin-right: 0;
}

.sidebar.collapsed .sidebar-header .navbar-brand span {
    opacity: 0;
    width: 0;
    overflow: hidden;
    transition: all 0.3s ease;
}

.sidebar.collapsed .sidebar-header .navbar-brand img {
    margin-right: 0;
}

/* Sidebar toggle button */
.sidebar-toggle {
    background: none;
    border: none;
    color: var(--sidebar-toggle-color);
    font-size: 1rem;
    padding: 0.25rem;
    border-radius: 0.25rem;
    transition: all 0.2s ease;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    width: 2rem;
    height: 2rem;
}

/* Mobile menu toggle - hidden on desktop */
.mobile-menu-toggle {
    display: none;
}

.sidebar-toggle:hover {
    background-color: var(--sidebar-toggle-hover-bg);
    color: var(--sidebar-toggle-hover-color);
}

.sidebar-toggle:focus {
    outline: 2px solid #0d6efd;
    outline-offset: 2px;
}

/* Collapsed sidebar toggle button positioning */
.sidebar.collapsed .sidebar-header {
    padding: 0.625rem 0.5rem;
    justify-content: flex-start;
    position: relative;
}

.sidebar.collapsed .sidebar-header .navbar-brand {
    margin-right: auto;
    padding-left: 0.25rem;
}

.sidebar.collapsed .sidebar-toggle {
    position: absolute;
    top: 50%;
    right: 0.5rem;
    transform: translateY(-50%);
    width: 2rem;
    height: 2rem;
    padding: 0.25rem;
    font-size: 0.9rem;
    background-color: var(--sidebar-toggle-collapsed-bg);
    border-radius: 0.25rem;
    border: 1px solid var(--sidebar-toggle-collapsed-border);
}

.sidebar.collapsed .sidebar-toggle:hover {
    background-color: var(--sidebar-toggle-hover-bg);
    border-color: var(--sidebar-toggle-collapsed-border);
    color: var(--sidebar-toggle-hover-color);
}

.sidebar.collapsed .sidebar-toggle:focus {
    background-color: rgba(77, 171, 247, 0.1);
    border-color: var(--sidebar-link-active-border);
    color: var(--sidebar-text-hover);
}

/* Sidebar search */
.sidebar-search {
    padding: 0.5rem 0.625rem;
    border-bottom: 1px solid var(--sidebar-header-border);
    flex-shrink: 0;
}

.sidebar-search-wrap {
    position: relative;
    display: flex;
    align-items: center;
}

.sidebar-search-icon {
    position: absolute;
    left: 0.5rem;
    font-size: 0.75rem;
    color: var(--sidebar-text);
    opacity: 0.5;
    pointer-events: none;
}

.sidebar-search-input {
    width: 100%;
    background: rgba(255, 255, 255, 0.08);
    border: 1px solid rgba(255, 255, 255, 0.12);
    border-radius: 0.3rem;
    color: var(--sidebar-text);
    font-family: 'Plus Jakarta Sans', system-ui, sans-serif;
    font-size: 0.75rem;
    padding: 0.3rem 1.75rem 0.3rem 1.75rem;
    outline: none;
    transition: background 0.2s ease, border-color 0.2s ease;
}

.sidebar-search-input::placeholder {
    color: var(--sidebar-text);
    opacity: 0.45;
}

.sidebar-search-input:focus {
    background: rgba(255, 255, 255, 0.13);
    border-color: rgba(255, 255, 255, 0.28);
}

.sidebar-search-clear {
    position: absolute;
    right: 0.375rem;
    background: none;
    border: none;
    color: var(--sidebar-text);
    opacity: 0.55;
    font-size: 0.85rem;
    padding: 0;
    line-height: 1;
    cursor: pointer;
    display: flex;
    align-items: center;
}

.sidebar-search-clear:hover {
    opacity: 1;
}

/* Hide search in collapsed sidebar */
.sidebar.collapsed .sidebar-search {
    display: none;
}

/* No-results message */
.sidebar-search-empty {
    padding: 0.5rem 0.75rem;
    font-size: 0.75rem;
    color: var(--sidebar-text);
    opacity: 0.5;
    display: none;
}

/* Sidebar navigation */
.sidebar-nav {
    flex: 1;
    min-height: 0;
    overflow-y: auto;
    overflow-x: hidden;
    padding: 0.375rem 0;
    font-family: 'Plus Jakarta Sans', system-ui, sans-serif;
}

.sidebar-nav ul {
    list-style: none;
    margin: 0;
    padding: 0;
}

.sidebar-nav li {
    margin-bottom: 1px;
}

.sidebar-nav a {
    display: flex;
    align-items: center;
    padding: 0.3rem 0.75rem;
    color: var(--sidebar-text);
    text-decoration: none;
    transition: all 0.2s ease;
    border-radius: 0;
    position: relative;
    white-space: nowrap;
    font-size: 0.8125rem;
}

.sidebar-nav a:hover {
    background-color: var(--sidebar-link-hover-bg);
    color: var(--sidebar-text-hover);
    text-decoration: none;
}

.sidebar-nav a:focus {
    outline: 2px solid #0d6efd;
    outline-offset: -2px;
    background-color: var(--sidebar-link-hover-bg);
    color: var(--sidebar-text-hover);
    text-decoration: none;
}

.sidebar-nav a.active {
    background-color: var(--sidebar-link-active-bg);
    color: var(--sidebar-text-hover);
    border-right: 3px solid var(--sidebar-link-active-border);
    font-weight: 500;
}

.sidebar-nav a.active:hover {
    background-color: var(--sidebar-link-active-bg);
    opacity: 0.9;
}

.sidebar-nav a i {
    width: 1.125rem;
    height: 1.125rem;
    display: flex;
    align-items: center;
    justify-content: center;
    margin-right: 0.5rem;
    font-size: 0.875rem;
    flex-shrink: 0;
    transition: all 0.3s ease;
}

.sidebar.collapsed .sidebar-nav a {
    padding: 0.5rem;
    justify-content: center;
    position: relative;
}

.sidebar.collapsed .sidebar-nav a i {
    margin-right: 0;
    font-size: 1.125rem; /* Slightly larger icons when collapsed */
}

.sidebar.collapsed .sidebar-nav a span {
    opacity: 0;
    flex: 0 0 0;
    min-width: 0;
    width: 0;
    overflow: hidden;
    padding: 0;
    transition: opacity 0.3s ease, flex-basis 0.3s ease;
}

/* Tooltip for collapsed sidebar */
.sidebar.collapsed .sidebar-nav a {
    position: relative;
}

.sidebar.collapsed .sidebar-nav a:hover::after {
    content: attr(title);
    position: absolute;
    left: 100%;
    top: 50%;
    transform: translateY(-50%);
    background-color: var(--sidebar-tooltip-bg);
    color: var(--sidebar-tooltip-text);
    padding: 0.5rem 0.75rem;
    border-radius: 0.375rem;
    font-size: 0.7875rem;
    white-space: nowrap;
    z-index: 1050;
    margin-left: 0.5rem;
    opacity: 0;
    animation: tooltipFadeIn 0.2s ease forwards;
    pointer-events: none;
}

.sidebar.collapsed .sidebar-nav a:hover::before {
    content: '';
    position: absolute;
    left: 100%;
    top: 50%;
    transform: translateY(-50%);
    border: 5px solid transparent;
    border-right-color: var(--sidebar-tooltip-bg);
    z-index: 1050;
    margin-left: 0.25rem;
    opacity: 0;
    animation: tooltipFadeIn 0.2s ease forwards;
    pointer-events: none;
}

@keyframes tooltipFadeIn {
    from {
        opacity: 0;
        transform: translateY(-50%) translateX(-5px);
    }
    to {
        opacity: 1;
        transform: translateY(-50%) translateX(0);
    }
}

/* Icon consistency across states */
.sidebar-nav a i.bi-speedometer2,
.sidebar-nav a i.bi-building,
.sidebar-nav a i.bi-people,
.sidebar-nav a i.bi-gear {
    font-size: 0.875rem;
}

.sidebar.collapsed .sidebar-nav a i.bi-speedometer2,
.sidebar.collapsed .sidebar-nav a i.bi-building,
.sidebar.collapsed .sidebar-nav a i.bi-people,
.sidebar.collapsed .sidebar-nav a i.bi-gear {
    font-size: 1rem;
}

/* Active state enhancements */
.sidebar-nav a.active i {
    color: var(--sidebar-text-hover);
}

.sidebar.collapsed .sidebar-nav a.active {
    border-right: none;
    border-left: none;
    box-shadow: inset 3px 0 0 var(--sidebar-link-active-border);
}

/* Accessibility improvements */
@media (prefers-reduced-motion: reduce) {
    .sidebar-nav a,
    .sidebar-nav a i,
    .sidebar.collapsed .sidebar-nav a span {
        transition: none;
    }
    
    .sidebar.collapsed .sidebar-nav a:hover::after,
    .sidebar.collapsed .sidebar-nav a:hover::before {
        animation: none;
        opacity: 1;
        transform: translateY(-50%) translateX(0);
    }
}

/* High contrast mode support */
@media (prefers-contrast: high) {
    .sidebar-nav a {
        border: 1px solid transparent;
    }
    
    .sidebar-nav a:hover,
    .sidebar-nav a:focus {
        border-color: currentColor;
    }
    
    .sidebar-nav a.active {
        border: 2px solid currentColor;
    }
}

/* Sidebar user section */
.sidebar-user {
    border-top: 1px solid var(--sidebar-user-border);
    padding: 0.5rem 0.625rem;
    padding-bottom: max(0.5rem, env(safe-area-inset-bottom, 0.5rem));
    background-color: var(--sidebar-user-bg);
    flex-shrink: 0;
    font-family: 'Plus Jakarta Sans', system-ui, sans-serif;
}

.sidebar-user .dropdown {
    width: 100%;
}

.sidebar-user .dropdown-toggle {
    display: flex;
    align-items: center;
    width: 100%;
    padding: 0.3rem 0.375rem;
    background: none;
    border: none;
    color: var(--sidebar-text);
    text-align: left;
    border-radius: 0.375rem;
    transition: all 0.2s ease;
    text-decoration: none;
    font-size: 0.8125rem;
}

.sidebar-user .user-info {
    overflow: hidden;
    min-width: 0;
}

.sidebar-user .user-info .fw-semibold {
    font-size: 0.8125rem;
    line-height: 1.3;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.sidebar-user .user-info small {
    font-size: 0.7rem;
    line-height: 1.2;
    display: block;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.sidebar-user .dropdown-toggle:hover {
    background-color: var(--sidebar-user-hover-bg);
}

.sidebar-user .dropdown-toggle::after {
    margin-left: auto;
}

.sidebar-user .user-avatar {
    width: 1.625rem;
    height: 1.625rem;
    background-color: var(--sidebar-link-active-border);
    color: white;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    margin-right: 0.5rem;
    font-weight: 600;
    font-size: 0.75rem;
    flex-shrink: 0;
    transition: margin 0.3s ease;
}

.sidebar.collapsed .sidebar-user .dropdown-toggle {
    justify-content: center;
    padding: 0.375rem 0.5rem;
}

.sidebar.collapsed .sidebar-user .user-avatar {
    margin-right: 0;
}

.sidebar.collapsed .sidebar-user .user-info {
    opacity: 0;
    width: 0;
    overflow: hidden;
    transition: all 0.3s ease;
}

.sidebar.collapsed .sidebar-user .dropdown-toggle::after {
    display: none;
}

/* Ensure the fixed-position dropup menu appears above the sidebar */
.sidebar-user .dropdown-menu {
    z-index: 1060 !important;
    font-size: 0.8125rem;
    min-width: 170px;
    padding: 0.25rem 0;
}

.sidebar-user .dropdown-item {
    padding: 0.35rem 0.75rem;
    font-size: 0.8125rem;
    display: flex;
    align-items: center;
}

.sidebar-user .dropdown-item i {
    font-size: 0.8125rem;
    width: 1rem;
    margin-right: 0.5rem;
    flex-shrink: 0;
}

.sidebar-user .dropdown-divider {
    margin: 0.2rem 0;
}

.sidebar-user .logout-form .dropdown-item,
.sidebar-user .language-form .dropdown-item {
    padding: 0.35rem 0.75rem;
    font-size: 0.8125rem;
    display: flex;
    align-items: center;
    width: 100%;
}

/* Fix dropdown positioning in collapsed state */
.sidebar.collapsed .sidebar-user .dropdown-menu {
    position: fixed !important;
    left: 80px !important;
    bottom: 1rem !important;
    top: auto !important;
    right: auto !important;
    transform: none !important;
    z-index: 1060 !important;
    min-width: 200px !important;
    margin: 0 !important;
}

/* Ensure collapsed dropdown items align left */
.sidebar.collapsed .dropdown-item {
    text-align: left !important;
    justify-content: flex-start !important;
}

.sidebar.collapsed .dropdown-item button,
.sidebar.collapsed .language-form button {
    text-align: left !important;
    justify-content: flex-start !important;
    display: flex !important;
    align-items: center !important;
}

/* ============================================
   Sidebar grouped navigation
   ============================================ */

/* Group toggle - the parent collapsible item */
.sidebar-group-toggle {
    cursor: pointer;
    user-select: none;
}

/* Open state: keep highlight so the user knows which group is open */
.sidebar-group-toggle:not(.collapsed) {
    background-color: var(--sidebar-link-hover-bg);
    color: var(--sidebar-text-hover);
}

/* Chevron icon */
.sidebar-chevron {
    width: auto !important;
    height: auto !important;
    margin-right: 0 !important;
    margin-left: auto !important;
    font-size: 0.7rem !important;
    transition: transform 0.25s ease;
    flex-shrink: 0 !important;
    opacity: 0.7;
}

.sidebar-group-toggle:not(.collapsed) .sidebar-chevron {
    transform: rotate(180deg);
    opacity: 1;
}

/* Active group: tint the icon to signal something inside is selected */
.sidebar-group-toggle.group-has-active > i:first-child {
    color: var(--sidebar-link-active-border);
}

/* Submenu container */
.sidebar-submenu {
    padding: 0.125rem 0;
    margin: 0;
    background-color: rgba(0, 0, 0, 0.10);
    border-left: 2px solid rgba(255, 255, 255, 0.08);
    list-style: none;
}

/* Sub-link: slightly indented and smaller */
.sidebar-sublink {
    padding-left: 2rem !important;
    font-size: 0.7875rem;
}

.sidebar-sublink i {
    font-size: 0.7875rem !important;
}

/* Collapsed sidebar: hide chevron.
   margin-left must be 0 (not auto) so justify-content:center still centres
   the icon — without this the chevron's auto-margin left-aligns group icons. */
.sidebar.collapsed .sidebar-chevron {
    opacity: 0;
    flex: 0 0 0;
    min-width: 0;
    width: 0;
    overflow: hidden;
    margin: 0 !important;
    padding: 0;
    transition: opacity 0.3s ease, flex-basis 0.3s ease;
}

/* ── Collapsed sidebar: flyout submenus ────────────────────────────────────
   The sidebar and .sidebar-nav both have overflow:hidden, so absolutely-
   positioned children are clipped.  We use position:fixed + JS to calculate
   the vertical offset of each group at mouse-enter time.
   JS adds/removes .sidebar-flyout-active on the <ul> element.              */

/* Hide Bootstrap's normal inline collapse in icon-only mode */
.sidebar.collapsed .sidebar-submenu,
.sidebar.collapsed .sidebar-submenu.show {
    display: none !important;
}

/* ── Flyout panel (class toggled by JS) ──
   Selector is scoped under .sidebar.collapsed so its specificity (0,4,0)
   beats the hide rule above (0,3,0) even though both use !important.        */
.sidebar.collapsed .sidebar-submenu.sidebar-flyout-active {
    display: block !important;
    position: fixed !important;
    left: 80px !important;
    /* top is set inline by JS */
    width: 220px !important;
    background-color: var(--sidebar-bg) !important;
    border: 1px solid var(--sidebar-border) !important;
    border-radius: 0 0.5rem 0.5rem 0 !important;
    padding: 0.5rem 0 !important;
    margin: 0 !important;
    z-index: 1300 !important;
    box-shadow: 6px 4px 24px rgba(0, 0, 0, 0.45) !important;
    list-style: none !important;
    overflow: visible !important;
}

/* Flyout header label drawn from data-group-label attribute */
.sidebar.collapsed .sidebar-submenu.sidebar-flyout-active::before {
    content: attr(data-group-label);
    display: block;
    padding: 0.5rem 1rem 0.35rem;
    font-size: 0.68rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.1em;
    color: var(--sidebar-text-muted, #8B93B5);
    border-bottom: 1px solid var(--sidebar-border);
    margin-bottom: 0.25rem;
    white-space: nowrap;
}

/* Flyout sub-links: readable full-width layout */
.sidebar.collapsed .sidebar-submenu.sidebar-flyout-active .sidebar-sublink {
    padding: 0.45rem 1rem !important;
    justify-content: flex-start !important;
    font-size: 0.875rem !important;
    white-space: nowrap !important;
}

.sidebar.collapsed .sidebar-submenu.sidebar-flyout-active .sidebar-sublink span {
    opacity: 1 !important;
    width: auto !important;
    overflow: visible !important;
}

.sidebar.collapsed .sidebar-submenu.sidebar-flyout-active .sidebar-sublink i {
    font-size: 0.875rem !important;
    margin-right: 0.5rem !important;
    min-width: 1.1rem !important;
}

/* Suppress the icon tooltip on group toggles (flyout replaces it) */
.sidebar.collapsed .sidebar-group-toggle:hover::after,
.sidebar.collapsed .sidebar-group-toggle:hover::before {
    display: none !important;
}

/* Ensure all sidebar dropdown menus have proper z-index */
.sidebar .dropdown-menu {
    position: fixed !important;
    z-index: 10000 !important;
}

/* Fix submenu positioning */
.sidebar .dropdown-submenu .dropdown-menu {
    position: fixed !important;
    z-index: 10001 !important;
}

/* Main content wrapper adjustments */
.main-wrapper {
    margin-left: 190px;
    transition: margin-left 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    min-height: 100vh;
    display: flex;
    flex-direction: column;
}

.main-wrapper.sidebar-collapsed {
    margin-left: 80px;
}

/* No sidebar case (for non-authenticated users) */
.main-wrapper.no-sidebar {
    margin-left: 0;
}

/* Mobile responsive behavior */
@media (max-width: 768px) {
    /* Mobile menu toggle button - always visible */
    .mobile-menu-toggle {
        position: fixed;
        top: 1rem;
        left: 1rem;
        z-index: 1041;
        background-color: #0d6efd;
        color: white;
        border: none;
        border-radius: 0.375rem;
        width: 3rem;
        height: 3rem;
        display: flex;
        align-items: center;
        justify-content: center;
        font-size: 1.5rem;
        box-shadow: 0 0.25rem 0.5rem rgba(0, 0, 0, 0.15);
        cursor: pointer;
        transition: all 0.2s ease;
    }
    
    .mobile-menu-toggle:hover {
        background-color: #0b5ed7;
        box-shadow: 0 0.375rem 0.75rem rgba(0, 0, 0, 0.2);
    }
    
    .mobile-menu-toggle:active {
        transform: scale(0.95);
    }
    
    .sidebar {
        transform: translateX(-100%);
        width: 350px; /* Set to 350px as requested */
        box-shadow: none;
    }
    
    /* Mobile sidebar header - hamburger on left, logo on right */
    .sidebar-header {
        display: flex;
        align-items: center;
        justify-content: flex-start;
        gap: 0.75rem;
        padding: 1rem;
    }
    
    .sidebar-header .sidebar-toggle {
        order: 1;
        flex-shrink: 0;
    }
    
    .sidebar-header .navbar-brand {
        order: 2;
        flex: 1;
    }
    
    .sidebar-header .navbar-brand .logo-full {
        max-width: 100%;
        height: auto;
    }
    
    .sidebar.show {
        transform: translateX(0);
        box-shadow: 0.5rem 0 1rem rgba(0, 0, 0, 0.15);
    }
    
    .sidebar.collapsed {
        width: 350px; /* Set to 350px as requested */
        transform: translateX(-100%);
    }
    
    .sidebar.collapsed.show {
        transform: translateX(0);
    }
    
    .main-wrapper {
        margin-left: 0;
    }
    
    .main-wrapper.sidebar-collapsed {
        margin-left: 0;
    }
    
    .main-wrapper.no-sidebar {
        margin-left: 0;
    }
    
    /* Mobile backdrop */
    .sidebar-backdrop {
        position: fixed;
        top: 0;
        left: 0;
        width: 100vw;
        height: 100vh;
        background-color: var(--sidebar-backdrop);
        z-index: 1039;
        opacity: 0;
        visibility: hidden;
        transition: all 0.3s ease;
    }
    
    .sidebar-backdrop.show {
        opacity: 1;
        visibility: visible;
    }
}

/* Tablet adjustments */
@media (min-width: 769px) and (max-width: 1024px) {
    .sidebar {
        width: 230px;
    }
    
    .sidebar.collapsed {
        width: 75px;
    }
    
    .main-wrapper {
        margin-left: 230px;
    }
    
    .main-wrapper.sidebar-collapsed {
        margin-left: 75px;
    }
    
    .main-wrapper.no-sidebar {
        margin-left: 0;
    }
}

/* Large screen optimizations */
@media (min-width: 1200px) {
    .sidebar {
        width: 270px;
    }
    
    .main-wrapper {
        margin-left: 270px;
    }
    
    .main-wrapper.no-sidebar {
        margin-left: 0;
    }
}

/* Sidebar animations */
@keyframes slideInLeft {
    from {
        transform: translateX(-100%);
    }
    to {
        transform: translateX(0);
    }
}

@keyframes slideOutLeft {
    from {
        transform: translateX(0);
    }
    to {
        transform: translateX(-100%);
    }
}

/* Accessibility enhancements */
.sidebar-nav a:focus {
    outline: 2px solid #0d6efd;
    outline-offset: -2px;
    background-color: #e7f3ff;
}

.sidebar-user .dropdown-toggle:focus {
    outline: 2px solid #0d6efd;
    outline-offset: -2px;
    background-color: #e9ecef;
}

/* High contrast mode support */
@media (prefers-contrast: high) {
    .sidebar {
        border-right: 2px solid #000;
    }
    
    .sidebar-nav a.active {
        border-right: 4px solid #000;
        background-color: #fff;
        color: #000;
    }
    
    .sidebar-header,
    .sidebar-user {
        border-color: #000;
    }
}

/* Reduced motion support */
@media (prefers-reduced-motion: reduce) {
    .sidebar,
    .main-wrapper,
    .sidebar-nav a,
    .sidebar-toggle,
    .sidebar-user .dropdown-toggle,
    .sidebar-backdrop {
        transition: none;
    }
    
    .sidebar-nav a i,
    .sidebar-nav a span,
    .sidebar-user .user-avatar,
    .sidebar-user .user-info {
        transition: none;
    }
}

/* Print styles */
@media print {
    .sidebar {
        display: none !important;
    }
    
    .main-wrapper {
        margin-left: 0 !important;
    }
}

/* Dropdown submenu styles for language switcher */
.dropdown-submenu {
    position: relative;
}

.dropdown-submenu .dropdown-menu {
    top: 0;
    left: 100%;
    margin-top: -1px;
    border-radius: 0.375rem;
}

.dropdown-submenu:hover .dropdown-menu {
    display: block;
}

.dropdown-submenu .dropdown-toggle::after {
    transform: rotate(-90deg);
    float: right;
    margin-top: 0.5rem;
}

/* Mobile dropdown submenu adjustments */
@media (max-width: 768px) {
    .dropdown-submenu .dropdown-menu {
        position: static;
        float: none;
        width: auto;
        margin-top: 0;
        background-color: transparent;
        border: 0;
        box-shadow: none;
    }
    
    .dropdown-submenu .dropdown-item {
        padding-left: 2rem;
    }
}

/* ============================================
   24. DARK MODE SIDEBAR (PERMANENT)
   ============================================ */

/* CSS Custom Properties for dark sidebar */
:root {
    /* Sidebar — soft deep-slate theme (pleasing, not harsh)
       Base: Tailwind slate-800 (#1e293b) with blue-tinted accents            */
    --sidebar-bg: #1e293b;
    --sidebar-border: #2e3f55;
    --sidebar-shadow: rgba(0, 0, 0, 0.15);
    --sidebar-header-bg: #1a2438;
    --sidebar-header-border: #2e3f55;
    --sidebar-text: #94a3b8;          /* slate-400 — readable but not glaring  */
    --sidebar-text-hover: #e2e8f0;    /* slate-200 — crisp on hover            */
    --sidebar-text-muted: #64748b;    /* slate-500                             */
    --sidebar-link-hover-bg: #273548;
    --sidebar-link-active-bg: rgba(45, 91, 255, 0.14);
    --sidebar-link-active-border: #4d7fff;
    --sidebar-toggle-color: #64748b;
    --sidebar-toggle-hover-bg: #2e3f55;
    --sidebar-toggle-hover-color: #e2e8f0;
    --sidebar-toggle-collapsed-bg: rgba(100, 116, 139, 0.12);
    --sidebar-toggle-collapsed-border: rgba(100, 116, 139, 0.25);
    --sidebar-user-bg: #182334;
    --sidebar-user-border: #2e3f55;
    --sidebar-user-hover-bg: #273548;
    --sidebar-tooltip-bg: #334155;    /* slate-700 tooltip — stays dark-themed */
    --sidebar-tooltip-text: #e2e8f0;
    --sidebar-backdrop: rgba(0, 0, 0, 0.5);
}

/* Apply CSS variables to sidebar components */
.sidebar {
    background-color: var(--sidebar-bg);
    border-right-color: var(--sidebar-border);
    box-shadow: 0 0.125rem 0.25rem var(--sidebar-shadow);
}

.sidebar-header {
    background-color: var(--sidebar-header-bg);
    border-bottom-color: var(--sidebar-header-border);
}

.sidebar-header .navbar-brand {
    color: var(--sidebar-text);
}

.sidebar-toggle {
    color: var(--sidebar-toggle-color);
}

.sidebar-toggle:hover {
    background-color: var(--sidebar-toggle-hover-bg);
    color: var(--sidebar-toggle-hover-color);
}

.sidebar.collapsed .sidebar-toggle {
    background-color: var(--sidebar-toggle-collapsed-bg);
    border-color: var(--sidebar-toggle-collapsed-border);
}

.sidebar.collapsed .sidebar-toggle:hover {
    background-color: var(--sidebar-toggle-hover-bg);
    border-color: var(--sidebar-toggle-collapsed-border);
    color: var(--sidebar-toggle-hover-color);
}

.sidebar.collapsed .sidebar-toggle:focus {
    background-color: rgba(77, 171, 247, 0.1);
    border-color: var(--sidebar-link-active-border);
    color: var(--sidebar-text-hover);
}

.sidebar-nav a {
    color: var(--sidebar-text);
}

.sidebar-nav a:hover {
    background-color: var(--sidebar-link-hover-bg);
    color: var(--sidebar-text-hover);
}

.sidebar-nav a:focus {
    background-color: var(--sidebar-link-hover-bg);
    color: var(--sidebar-text-hover);
}

.sidebar-nav a.active {
    background-color: var(--sidebar-link-active-bg);
    color: var(--sidebar-text-hover);
    border-right-color: var(--sidebar-link-active-border);
}

.sidebar-nav a.active:hover {
    background-color: var(--sidebar-link-active-bg);
    opacity: 0.9;
}

.sidebar.collapsed .sidebar-nav a.active {
    box-shadow: inset 3px 0 0 var(--sidebar-link-active-border);
}

.sidebar.collapsed .sidebar-nav a:hover::after {
    background-color: var(--sidebar-tooltip-bg);
    color: var(--sidebar-tooltip-text);
}

.sidebar.collapsed .sidebar-nav a:hover::before {
    border-right-color: var(--sidebar-tooltip-bg);
}

.sidebar-user {
    background-color: var(--sidebar-user-bg);
    border-top-color: var(--sidebar-user-border);
}

.sidebar-user .dropdown-toggle {
    color: var(--sidebar-text);
}

.sidebar-user .dropdown-toggle:hover {
    background-color: var(--sidebar-user-hover-bg);
}

.sidebar-backdrop {
    background-color: var(--sidebar-backdrop);
}

/* Dark mode specific adjustments */
.sidebar-nav a.active i {
    color: var(--sidebar-text-hover);
}

.sidebar-user .user-avatar {
    background-color: var(--sidebar-link-active-border);
}

/* Ensure dropdown menus also follow dark theme */
.sidebar .dropdown-menu {
    background-color: var(--sidebar-header-bg);
    border-color: var(--sidebar-border);
}

.sidebar .dropdown-item {
    color: var(--sidebar-text);
    text-align: left !important;
}

.sidebar .dropdown-item:hover,
.sidebar .dropdown-item:focus {
    background-color: var(--sidebar-link-hover-bg);
    color: var(--sidebar-text-hover);
}

/* Ensure dropdown form buttons align left */
.sidebar .dropdown-item button,
.sidebar .language-form button {
    text-align: left !important;
    width: 100%;
    border: none;
    background: none;
    padding: 0.375rem 1rem;
}

.sidebar .dropdown-divider {
    border-color: var(--sidebar-border);
}

/* Smooth transitions for sidebar elements */
.sidebar,
.sidebar-header,
.sidebar-nav a,
.sidebar-toggle,
.sidebar-user,
.sidebar-user .dropdown-toggle {
    transition: background-color 0.3s ease, color 0.3s ease, border-color 0.3s ease;
}

/* Override Bootstrap text-muted class in sidebar for dark theme */
.sidebar .text-muted {
    color: #a0a0a0 !important;
}

.sidebar .user-info small.text-muted {
    color: #a0a0a0 !important;
    font-size: 0.75rem;
    display: block;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    max-width: 150px;
}

/* Print mode - force light theme for readability */
@media print {
    .sidebar {
        background-color: #ffffff !important;
        color: #000000 !important;
        border-color: #000000 !important;
    }
    
    .sidebar * {
        background-color: transparent !important;
        color: #000000 !important;
    }
}

/* ============================================
   16. FORM VALIDATION STYLES
   ============================================ */

/* Import form validation styles */
@import url("form-validation.8c04c0c8ebf8.css");

/* Additional form validation styles specific to main.css */
.form-validation-enhanced {
    /* Enhanced form validation container */
    position: relative;
}

.form-validation-enhanced .form-control,
.form-validation-enhanced .form-select {
    transition: border-color 0.15s ease-in-out, box-shadow 0.15s ease-in-out;
}

.form-validation-enhanced .form-control:focus,
.form-validation-enhanced .form-select:focus {
    border-color: #86b7fe;
    outline: 0;
    box-shadow: 0 0 0 0.25rem rgba(13, 110, 253, 0.25);
}

/* Form validation summary styling */
.form-validation-summary {
    background-color: #fff3cd;
    border: 1px solid #ffeaa7;
    border-radius: 0.375rem;
    padding: 1rem;
    margin-bottom: 1.5rem;
}

.form-validation-summary .alert-heading {
    color: #856404;
    font-weight: 600;
    margin-bottom: 0.5rem;
}

.form-validation-summary ul {
    margin-bottom: 0;
    padding-left: 1.5rem;
}

.form-validation-summary li {
    color: #856404;
    margin-bottom: 0.25rem;
}

/* Fieldset error highlighting */
fieldset.has-validation-errors {
    border-left: 4px solid #dc3545;
    padding-left: 15px;
    background-color: rgba(248, 215, 218, 0.1);
    margin-bottom: 1.5rem;
}

fieldset.has-validation-errors legend {
    color: #dc3545;
    font-weight: 600;
}

fieldset.has-validation-errors legend .error-icon {
    color: #dc3545;
    margin-right: 0.5rem;
}

/* Real-time validation feedback */
.form-control.validating {
    border-color: #ffc107;
    box-shadow: 0 0 0 0.2rem rgba(255, 193, 7, 0.25);
}

.form-control.validation-success {
    border-color: #198754;
    box-shadow: 0 0 0 0.2rem rgba(25, 135, 84, 0.25);
}

.form-control.validation-error {
    border-color: #dc3545;
    box-shadow: 0 0 0 0.2rem rgba(220, 53, 69, 0.25);
}

/* Placeholder enhancement */
.form-control.has-placeholder-warning {
    border-color: #ffc107 !important;
    box-shadow: 0 0 0 0.2rem rgba(255, 193, 7, 0.25) !important;
}

.form-control.has-placeholder-warning::after {
    content: "⚠️";
    position: absolute;
    right: 10px;
    top: 50%;
    transform: translateY(-50%);
    color: #ffc107;
}

/* Conditional field animations */
.conditional-field {
    transition: opacity 0.3s ease, transform 0.3s ease, height 0.3s ease;
}

.conditional-field.hiding {
    opacity: 0;
    transform: translateY(-10px);
    height: 0;
    overflow: hidden;
}

.conditional-field.showing {
    opacity: 1;
    transform: translateY(0);
    height: auto;
}

/* Form field group styling for better organization */
.form-field-group {
    background-color: #f8f9fa;
    border: 1px solid #dee2e6;
    border-radius: 0.375rem;
    padding: 1.5rem;
    margin-bottom: 1.5rem;
}

.form-field-group .form-field-group-title {
    font-weight: 600;
    color: #495057;
    margin-bottom: 1rem;
    padding-bottom: 0.5rem;
    border-bottom: 1px solid #dee2e6;
}

/* Enhanced error message styling */
.field-error-message {
    display: block;
    width: 100%;
    margin-top: 0.25rem;
    font-size: 0.7875rem;
    color: #dc3545;
    font-weight: 500;
}

.field-error-message::before {
    content: "⚠️ ";
    margin-right: 0.25rem;
}

/* Success message styling */
.field-success-message {
    display: block;
    width: 100%;
    margin-top: 0.25rem;
    font-size: 0.7875rem;
    color: #198754;
    font-weight: 500;
}

.field-success-message::before {
    content: "✓ ";
    margin-right: 0.25rem;
}

/* Form validation loading states */
.form-field-loading {
    position: relative;
}

.form-field-loading::after {
    content: "";
    position: absolute;
    right: 10px;
    top: 50%;
    transform: translateY(-50%);
    width: 16px;
    height: 16px;
    border: 2px solid #f3f3f3;
    border-top: 2px solid #007bff;
    border-radius: 50%;
    animation: spin 1s linear infinite;
}

@keyframes spin {
    0% { transform: translateY(-50%) rotate(0deg); }
    100% { transform: translateY(-50%) rotate(360deg); }
}

/* Enhanced accessibility for form validation */
.form-validation-live-region {
    position: absolute;
    left: -10000px;
    width: 1px;
    height: 1px;
    overflow: hidden;
}

/* Form validation tooltip styling */
.form-validation-tooltip {
    position: absolute;
    z-index: 1070;
    display: block;
    margin: 0;
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
    font-style: normal;
    font-weight: 400;
    line-height: 1.5;
    text-align: left;
    text-decoration: none;
    text-shadow: none;
    text-transform: none;
    letter-spacing: normal;
    word-break: normal;
    word-spacing: normal;
    white-space: normal;
    line-break: auto;
    font-size: 0.7875rem;
    word-wrap: break-word;
    opacity: 0.9;
}

.form-validation-tooltip .tooltip-inner {
    max-width: 200px;
    padding: 0.25rem 0.5rem;
    color: #fff;
    text-align: center;
    background-color: #dc3545;
    border-radius: 0.25rem;
}

/* Form validation progress indicator */
.form-validation-progress {
    height: 4px;
    background-color: #e9ecef;
    border-radius: 2px;
    overflow: hidden;
    margin-bottom: 1rem;
}

.form-validation-progress-bar {
    height: 100%;
    background-color: #007bff;
    transition: width 0.3s ease;
}

.form-validation-progress-bar.success {
    background-color: #198754;
}

.form-validation-progress-bar.error {
    background-color: #dc3545;
}

/* Mobile-specific form validation styles */
@media (max-width: 767.98px) {
    .form-validation-enhanced .form-control,
    .form-validation-enhanced .form-select {
        font-size: 14.4px; /* Prevent zoom on iOS */
    }
    
    .form-validation-tooltip {
        font-size: 0.72rem;
    }
    
    .form-validation-tooltip .tooltip-inner {
        max-width: 150px;
        padding: 0.2rem 0.4rem;
    }
    
    .form-field-group {
        padding: 1rem;
        margin-bottom: 1rem;
    }
}

/* Print styles for forms */
@media print {
    .form-validation-enhanced .form-control,
    .form-validation-enhanced .form-select {
        border: 1px solid #000 !important;
        box-shadow: none !important;
    }
    
    .form-validation-enhanced .is-invalid {
        border-color: #000 !important;
    }
    
    .form-validation-enhanced .is-valid {
        border-color: #000 !important;
    }
    
    .field-error-message,
    .field-success-message {
        color: #000 !important;
    }
    
    .form-validation-tooltip {
        display: none !important;
    }
}

/* Enhanced accessibility for keyboard navigation */
@media (hover: hover) and (pointer: fine) {
    .sortable-header:focus-within {
        outline: 2px solid #0d6efd;
        outline-offset: 2px;
        border-radius: 0.375rem;
    }
    
    .pagination .page-link:focus {
        outline: 2px solid #0d6efd;
        outline-offset: 2px;
        z-index: 3;
    }
    
    .filter-tag .filter-remove:focus {
        outline: 2px solid #0d6efd;
        outline-offset: 2px;
    }
    
    .date-preset-btn:focus {
        outline: 2px solid #0d6efd;
        outline-offset: 2px;
    }
    
    .table-filter-actions .btn:focus {
        outline: 2px solid #0d6efd;
        outline-offset: 2px;
    }
}

/* Small mobile devices (phones in portrait) */
@media (max-width: 480px) {
    .enhanced-table-container {
        margin: 0 -1rem;
        border-radius: 0;
    }
    
    .table-filter-section {
        padding: 0.5rem;
    }
    
    .mobile-filter-toggle {
        font-size: 0.875rem;
        padding: 0.75rem;
        margin-bottom: 0.75rem;
    }
    
    .table-filter-group .form-control,
    .table-filter-group .form-select {
        font-size: 16px; /* Prevents zoom on iOS */
        padding: 0.75rem 0.5rem;
    }
    
    .table-responsive .table {
        min-width: 500px;
        font-size: 0.75rem;
    }
    
    .table-responsive .table th:first-child,
    .table-responsive .table td:first-child {
        min-width: 100px;
        max-width: 120px;
    }
    
    .table-responsive .table .actions-column {
        min-width: 120px;
    }
    
    .table-responsive .table .actions-column .btn {
        font-size: 0.75rem;
        padding: 0.375rem 0.5rem;
        margin: 0.125rem;
        min-width: 50px;
        min-height: 32px;
    }
    
    .pagination .page-link {
        padding: 0.5rem;
        font-size: 0.875rem;
        min-width: 40px;
        min-height: 40px;
    }
    
    .pagination-compact .page-nav .btn {
        min-width: 40px;
        min-height: 40px;
        padding: 0.5rem;
    }
    
    .filter-tag {
        font-size: 0.75rem;
        padding: 0.375rem 0.5rem;
        margin: 0.125rem;
    }
    
    .filter-tag .filter-remove {
        min-width: 20px;
        min-height: 20px;
        font-size: 0.75rem;
    }
}

/* Large tablets and small desktops */
@media (min-width: 1025px) and (max-width: 1199px) {
    .enhanced-table-container {
        border-radius: 0.5rem;
    }
    
    .table-filter-section {
        padding: 1rem;
    }
    
    .table-filter-form {
        gap: 1rem;
    }
    
    .table-filter-group {
        min-width: 200px;
    }
    
    .pagination .page-link {
        padding: 0.5rem 0.75rem;
        min-height: 38px;
        min-width: 38px;
    }
    
    .sortable-header {
        min-height: 40px;
    }
}

/* Ultra-wide screens */
@media (min-width: 1400px) {
    .enhanced-table-container {
        border-radius: 0.75rem;
        box-shadow: 0 0.25rem 0.5rem rgba(0, 0, 0, 0.1);
    }
    
    .table-filter-section {
        padding: 1.5rem;
    }
    
    .table-filter-form {
        gap: 1.5rem;
    }
    
    .table-filter-group {
        min-width: 250px;
    }
    
    .table-responsive .table {
        font-size: 0.875rem;
    }
    
    .table-responsive .table th,
    .table-responsive .table td {
        padding: 1rem 0.75rem;
    }
    
    .pagination .page-link {
        padding: 0.75rem 1rem;
        font-size: 0.875rem;
    }
}

/* Mobile filter toggle JavaScript support */
.mobile-filter-toggle {
    display: none; /* Hidden by default, shown via JavaScript on mobile */
}

@media (max-width: 768px) {
    .mobile-filter-toggle {
        display: block;
    }
}

/* Enhanced mobile table scrolling indicators */
@media (max-width: 768px) {
    .table-responsive::before,
    .table-responsive::after {
        content: '';
        position: absolute;
        top: 0;
        bottom: 0;
        width: 20px;
        pointer-events: none;
        z-index: 1;
        transition: opacity 0.3s ease;
    }
    
    .table-responsive::before {
        left: 0;
        background: linear-gradient(to right, rgba(248, 249, 250, 0.8), transparent);
        opacity: 0;
    }
    
    .table-responsive::after {
        right: 0;
        background: linear-gradient(to left, rgba(248, 249, 250, 0.8), transparent);
        opacity: 1;
    }
    
    .table-responsive.scrolled-left::before {
        opacity: 1;
    }
    
    .table-responsive.scrolled-right::after {
        opacity: 0;
    }
}

/* Performance optimizations for mobile */
@media (max-width: 768px) {
    .table-responsive .table {
        will-change: scroll-position;
    }
    
    .sortable-header .sort-link,
    .pagination .page-link,
    .filter-tag .filter-remove {
        will-change: transform;
    }
}

/* Reduced motion support for mobile enhancements */
@media (prefers-reduced-motion: reduce) {
    .mobile-filter-content {
        transition: none;
    }
    
    .mobile-filter-toggle .toggle-icon {
        transition: none;
    }
    
    .sortable-header .sort-link:active,
    .pagination .page-link:active,
    .filter-tag .filter-remove:active,
    .date-preset-btn:active,
    .table-filter-actions .btn:active {
        transform: none;
        transition: none;
    }
}

/* ============================================
   16. RECEIPT MANAGEMENT STYLES
   ============================================ */

/* Receipt Form Layout Enhancements */
.conditional-required {
    display: none;
}

/* Ensure proper spacing for fieldsets */
fieldset {
    border: none;
    padding: 0;
    margin: 0;
}

fieldset legend {
    font-weight: 600;
    color: #6c757d;
    margin-bottom: 1rem;
}

/* Enhanced conditional field animations */
[data-conditional="true"] {
    transition: opacity 300ms ease, transform 300ms ease;
}

[data-conditional="true"].hiding {
    opacity: 0;
    transform: translateY(-10px);
}

/* 80G conditional section styling */
#tax-info-section {
    background-color: #f8f9fa;
    border: 1px solid #dee2e6;
    border-radius: 0.375rem;
    padding: 1.5rem;
    margin-top: 1rem;
    transition: all 0.3s ease;
}

#tax-info-section.show {
    display: block !important;
}

#tax-info-section h5 {
    color: #495057;
    margin-bottom: 1rem;
    font-weight: 600;
}

/* Void section styling */
#void-section {
    background-color: #fff5f5;
    border: 1px solid #fecaca;
    border-radius: 0.375rem;
    padding: 1.5rem;
    margin-top: 1rem;
    transition: all 0.3s ease;
}

#void-section.show {
    display: block !important;
}

#void-section h5 {
    color: #dc2626;
    margin-bottom: 1rem;
    font-weight: 600;
}

/* Status badge styling */
.status-badge {
    font-size: 0.875rem;
    padding: 0.375rem 0.75rem;
    border-radius: 0.25rem;
    font-weight: 500;
}

.status-draft {
    background-color: #e9ecef;
    color: #495057;
}

.status-issued {
    background-color: #d1ecf1;
    color: #0c5460;
}

.status-sent {
    background-color: #d4edda;
    color: #155724;
}

.status-void {
    background-color: #f8d7da;
    color: #721c24;
}

/* Receipt type badge styling */
.receipt-type-badge {
    font-size: 0.875rem;
    padding: 0.375rem 0.75rem;
    border-radius: 0.25rem;
    font-weight: 500;
}

.receipt-type-80g {
    background-color: #d1ecf1;
    color: #0c5460;
}

.receipt-type-non80g {
    background-color: #e2e3e5;
    color: #383d41;
}

/* Receipt form responsive adjustments */
@media (max-width: 767.98px) {
    .receipt-form .col-md-6 {
        margin-bottom: 1rem;
    }
    
    /* Stack form elements vertically on mobile */
    .receipt-form .row > .col-md-6:not(:last-child) {
        margin-bottom: 1.5rem;
    }
}

/* Receipt list enhancements */
.receipt-list-filters {
    background-color: #f8f9fa;
    border-radius: 0.375rem;
    padding: 1rem;
    margin-bottom: 1.5rem;
}

.receipt-summary-stats {
    background-color: #e7f3ff;
    border-left: 4px solid #0d6efd;
    padding: 1rem;
    margin-bottom: 1rem;
}

/* Receipt detail view enhancements */
.receipt-detail-section {
    margin-bottom: 2rem;
}

.receipt-detail-section .card-header {
    background-color: #f8f9fa;
    border-bottom: 1px solid #dee2e6;
}

.receipt-detail-section .card-header h5 {
    margin-bottom: 0;
    color: #495057;
    font-weight: 600;
}

/* Receipt confirmation dialog enhancements */
.receipt-delete-warning {
    border-left: 4px solid #dc3545;
    background-color: #f8d7da;
    padding: 1rem;
    margin-bottom: 1rem;
}

.receipt-delete-info {
    border-left: 4px solid #0dcaf0;
    background-color: #cff4fc;
    padding: 1rem;
    margin-bottom: 1rem;
}

/* ============================================
   20. CLIPBOARD FUNCTIONALITY
   ============================================ */

/* Copy button states and transitions */
.copy-url-btn {
    transition: all 0.3s ease;
    position: relative;
    overflow: hidden;
}

.copy-url-btn:disabled {
    opacity: 0.6;
    cursor: not-allowed;
}

.copy-url-btn.btn-success {
    animation: copySuccess 0.3s ease;
}

@keyframes copySuccess {
    0% { transform: scale(1); }
    50% { transform: scale(1.05); }
    100% { transform: scale(1); }
}

/* Copy status messages */
.copy-status {
    min-height: 1.5rem;
    transition: all 0.3s ease;
}

.copy-status .alert-sm {
    padding: 0.5rem 0.75rem;
    margin-bottom: 0;
    font-size: 0.70875rem;
    border-radius: 0.25rem;
}

/* URL input field enhancements */
.print-url-input {
    font-family: 'Courier New', Courier, monospace;
    font-size: 0.70875rem;
    background-color: #f8f9fa;
    border-color: #dee2e6;
    cursor: text;
}

.print-url-input:focus {
    background-color: #fff;
    border-color: #86b7fe;
    box-shadow: 0 0 0 0.25rem rgba(13, 110, 253, 0.25);
}

.print-url-input:read-only {
    background-color: #e9ecef;
    cursor: default;
}

/* Input group focus states */
.input-group:focus-within .copy-url-btn {
    border-color: #86b7fe;
}

/* Accessibility enhancements */
.copy-url-btn:focus {
    outline: 2px solid #0d6efd;
    outline-offset: 2px;
    z-index: 3;
}

/* Keyboard navigation indicators */
.copy-url-btn[aria-pressed="true"] {
    background-color: #0d6efd;
    border-color: #0d6efd;
    color: white;
}

/* Manual copy instructions styling */
.manual-copy-instructions {
    background-color: #fff3cd;
    border: 1px solid #ffeaa7;
    border-radius: 0.375rem;
    padding: 0.75rem;
    margin-top: 0.5rem;
    font-size: 0.70875rem;
}

.manual-copy-instructions kbd {
    background-color: #212529;
    color: #fff;
    padding: 0.1875rem 0.375rem;
    border-radius: 0.25rem;
    font-size: 0.6075rem;
    font-family: 'Courier New', Courier, monospace;
}

/* Copy feedback animations */
.copy-feedback-enter {
    opacity: 0;
    transform: translateY(-10px);
    animation: copyFeedbackEnter 0.3s ease forwards;
}

@keyframes copyFeedbackEnter {
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.copy-feedback-exit {
    animation: copyFeedbackExit 0.3s ease forwards;
}

@keyframes copyFeedbackExit {
    to {
        opacity: 0;
        transform: translateY(-10px);
    }
}

/* URL selection highlighting */
.print-url-input::selection {
    background-color: #0d6efd;
    color: white;
}

.print-url-input::-moz-selection {
    background-color: #0d6efd;
    color: white;
}

/* Responsive adjustments for clipboard functionality */
@media (max-width: 768px) {
    .print-url-input {
        font-size: 0.6075rem;
    }
    
    .copy-status .alert-sm {
        font-size: 0.658125rem;
        padding: 0.375rem 0.5rem;
    }
    
    .manual-copy-instructions {
        font-size: 0.658125rem;
        padding: 0.5rem;
    }
    
    .manual-copy-instructions kbd {
        font-size: 0.5625rem;
        padding: 0.125rem 0.25rem;
    }
    
    .copy-url-btn {
        min-width: 60px;
        padding: 0.375rem 0.5rem;
        font-size: 0.70875rem;
    }
}

/* Touch device optimizations */
@media (hover: none) and (pointer: coarse) {
    .copy-url-btn {
        min-height: 44px;
        min-width: 44px;
        padding: 0.75rem;
    }
    
    .print-url-input {
        min-height: 44px;
        padding: 0.75rem;
        font-size: 16px; /* Prevent zoom on iOS */
    }
    
    /* Better touch feedback */
    .copy-url-btn:active {
        transform: scale(0.95);
        transition: transform 0.1s ease;
    }
}

/* High contrast mode support */
@media (prefers-contrast: high) {
    .print-url-input {
        background-color: white;
        border: 2px solid black;
        color: black;
    }
    
    .copy-url-btn {
        border: 2px solid black;
        background-color: white;
        color: black;
    }
    
    .copy-url-btn:hover {
        background-color: black;
        color: white;
    }
    
    .manual-copy-instructions {
        background-color: white;
        border: 2px solid black;
        color: black;
    }
    
    .manual-copy-instructions kbd {
        background-color: black;
        color: white;
        border: 1px solid white;
    }
}

/* Reduced motion support */
@media (prefers-reduced-motion: reduce) {
    .copy-url-btn,
    .copy-status,
    .copy-feedback-enter,
    .copy-feedback-exit {
        animation: none;
        transition: none;
    }
    
    .copy-url-btn:active {
        transform: none;
    }
}

/* Print styles - hide clipboard functionality */
@media print {
    .input-group,
    .copy-status,
    .manual-copy-instructions {
        display: none !important;
    }
}

/* Focus management for screen readers */
.copy-url-btn[aria-describedby] {
    position: relative;
}

/* Status message live region */
.copy-status[role="status"] {
    position: relative;
}

/* Clipboard API not supported fallback styling */
.clipboard-not-supported .copy-url-btn {
    background-color: #ffc107;
    border-color: #ffc107;
    color: #000;
}

.clipboard-not-supported .copy-url-btn:hover {
    background-color: #ffca2c;
    border-color: #ffc720;
}

/* Success state persistence */
.copy-success-persistent {
    background-color: #d1e7dd !important;
    border-color: #badbcc !important;
    color: #0f5132 !important;
}

/* Error state styling */
.copy-error {
    background-color: #f8d7da !important;
    border-color: #f5c2c7 !important;
    color: #842029 !important;
}

/* Loading state for URL generation */
.url-generating .print-url-input {
    background-image: url("data:image/svg+xml,%3csvg width='16' height='16' viewBox='0 0 16 16' xmlns='http://www.w3.org/2000/svg'%3e%3cpath d='M8 0a8 8 0 1 1 0 16A8 8 0 0 1 8 0zM8 2a6 6 0 1 0 0 12A6 6 0 0 0 8 2z' fill='%236c757d'/%3e%3cpath d='M8 2a6 6 0 0 1 6 6h-2a4 4 0 0 0-4-4V2z' fill='%230d6efd'%3e%3canimateTransform attributeName='transform' type='rotate' values='0 8 8;360 8 8' dur='1s' repeatCount='indefinite'/%3e%3c/path%3e%3c/svg%3e");
    background-repeat: no-repeat;
    background-position: right 0.75rem center;
    background-size: 16px;
    padding-right: 2.5rem !important;
}

/* URL ready state */
.url-ready .print-url-input {
    background-color: #d1e7dd;
    border-color: #badbcc;
}

/* Copy button icon transitions */
.copy-url-btn .bi {
    transition: transform 0.2s ease;
}

.copy-url-btn:hover .bi {
    transform: scale(1.1);
}

.copy-url-btn:active .bi {
    transform: scale(0.9);
}

/* ============================================
   20. LOGO RESIZE TOOL STYLES
   ============================================ */

/* Logo resize tool container */
.logo-resize-tool {
    background-color: #f8f9fa;
    border: 1px solid #dee2e6;
    border-radius: 0.375rem;
    padding: 1.5rem;
    margin-top: 1rem;
}

/* Resize workspace */
.resize-workspace {
    background-color: white;
    border-radius: 0.375rem;
    padding: 1rem;
    border: 1px solid #e9ecef;
}

/* Canvas container */
.canvas-container {
    position: relative;
    display: inline-block;
    border: 2px solid #dee2e6;
    border-radius: 0.375rem;
    background-color: #f8f9fa;
    margin-bottom: 1rem;
}

.resize-canvas {
    display: block;
    max-width: 100%;
    height: auto;
    cursor: crosshair;
}

/* Resize handles */
.resize-handles {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    pointer-events: none;
}

.resize-handle {
    position: absolute;
    width: 12px;
    height: 12px;
    background-color: #007bff;
    border: 2px solid white;
    border-radius: 50%;
    pointer-events: all;
    cursor: pointer;
    z-index: 10;
    transform: translate(-50%, -50%);
}

.resize-handle.nw {
    top: 0;
    left: 0;
    cursor: nw-resize;
}

.resize-handle.ne {
    top: 0;
    right: 0;
    cursor: ne-resize;
}

.resize-handle.sw {
    bottom: 0;
    left: 0;
    cursor: sw-resize;
}

.resize-handle.se {
    bottom: 0;
    right: 0;
    cursor: se-resize;
}

.resize-handle:hover {
    background-color: #0056b3;
    transform: translate(-50%, -50%) scale(1.2);
}

/* Resize controls */
.resize-controls .form-control {
    font-family: 'Courier New', Courier, monospace;
    font-size: 0.875rem;
}

.resize-controls .form-check {
    margin-top: 0.75rem;
}

/* Receipt preview */
.receipt-preview {
    background-color: white;
    border-radius: 0.375rem;
    padding: 1rem;
    border: 1px solid #e9ecef;
}

.receipt-mockup {
    background-color: white;
    border: 1px solid #dee2e6;
    border-radius: 0.375rem;
    padding: 1rem;
    box-shadow: 0 0.125rem 0.25rem rgba(0, 0, 0, 0.075);
    max-width: 300px;
    margin: 0 auto;
}

.receipt-header {
    display: flex;
    align-items: center;
    gap: 1rem;
    padding-bottom: 1rem;
    border-bottom: 1px solid #dee2e6;
    margin-bottom: 1rem;
}

.preview-canvas {
    border: 1px solid #dee2e6;
    border-radius: 0.25rem;
    background-color: #f8f9fa;
    max-width: 100px;
    max-height: 50px;
}

.organization-name {
    font-weight: 600;
    color: #495057;
    font-size: 1rem;
}

.receipt-body {
    font-size: 0.875rem;
    color: #6c757d;
}

.receipt-body hr {
    margin: 0.75rem 0;
    border-color: #dee2e6;
}

/* Resize actions */
.resize-actions {
    display: flex;
    gap: 0.75rem;
    justify-content: center;
    flex-wrap: wrap;
    padding-top: 1rem;
    border-top: 1px solid #dee2e6;
}

.resize-actions .btn {
    min-width: 120px;
    transition: all 0.2s ease;
}

.resize-actions .btn:hover {
    transform: translateY(-1px);
}

/* Loading states */
.logo-resize-tool.loading {
    opacity: 0.7;
    pointer-events: none;
}

.logo-resize-tool.loading::after {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: 40px;
    height: 40px;
    border: 4px solid #f3f3f3;
    border-top: 4px solid #007bff;
    border-radius: 50%;
    animation: spin 1s linear infinite;
    z-index: 1000;
}

/* Success/error states */
.logo-resize-success {
    background-color: #d4edda;
    border-color: #c3e6cb;
    color: #155724;
    padding: 0.75rem 1rem;
    border-radius: 0.375rem;
    margin-top: 1rem;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.logo-resize-error {
    background-color: #f8d7da;
    border-color: #f5c6cb;
    color: #721c24;
    padding: 0.75rem 1rem;
    border-radius: 0.375rem;
    margin-top: 1rem;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

/* Responsive adjustments */
@media (max-width: 768px) {
    .logo-resize-tool {
        padding: 1rem;
    }
    
    .logo-resize-tool .row {
        flex-direction: column;
    }
    
    .resize-workspace,
    .receipt-preview {
        margin-bottom: 1.5rem;
    }
    
    .canvas-container {
        max-width: 100%;
        overflow-x: auto;
    }
    
    .resize-canvas {
        min-width: 300px;
    }
    
    .receipt-mockup {
        max-width: 250px;
    }
    
    .resize-actions {
        flex-direction: column;
        align-items: stretch;
    }
    
    .resize-actions .btn {
        min-width: auto;
        width: 100%;
        margin-bottom: 0.5rem;
    }
    
    .resize-controls .row {
        flex-direction: column;
    }
    
    .resize-controls .col-md-6 {
        margin-bottom: 1rem;
    }
}

/* Touch device optimizations */
@media (hover: none) and (pointer: coarse) {
    .resize-handle {
        width: 20px;
        height: 20px;
        border-width: 3px;
    }
    
    .resize-canvas {
        cursor: default;
    }
    
    .resize-actions .btn {
        min-height: 44px;
        padding: 0.75rem 1rem;
    }
}

/* High contrast mode support */
@media (prefers-contrast: high) {
    .logo-resize-tool {
        border: 2px solid #000;
    }
    
    .resize-handle {
        background-color: #000;
        border-color: #fff;
    }
    
    .canvas-container {
        border-color: #000;
    }
    
    .receipt-mockup {
        border-color: #000;
    }
}

/* Reduced motion support */
@media (prefers-reduced-motion: reduce) {
    .resize-handle {
        transition: none;
    }
    
    .resize-handle:hover {
        transform: translate(-50%, -50%);
    }
    
    .resize-actions .btn:hover {
        transform: none;
    }
    
    .logo-resize-tool.loading::after {
        animation: none;
    }
}

/* Print styles */
@media print {
    .logo-resize-tool {
        display: none !important;
    }
}

/* ============================================
   LOGO LAZY LOADING STYLES
   ============================================ */

/* Logo lazy loading placeholders */
.logo-loading-placeholder {
    background: rgba(248, 249, 250, 0.9);
    border-radius: inherit;
}

.logo-error-placeholder {
    background: rgba(248, 249, 250, 0.95);
    border: 1px dashed #dc3545;
    border-radius: inherit;
    cursor: pointer;
    transition: background-color 0.2s ease;
}

.logo-error-placeholder:hover {
    background: rgba(220, 53, 69, 0.1);
}

.logo-loaded {
    transition: opacity 0.3s ease;
}

/* Logo container positioning for placeholders */
.logo-container {
    position: relative;
}

.organization-logo-thumbnail {
    position: relative;
}

/* Loading spinner for logo placeholders */
.logo-loading-placeholder .spinner-border-sm {
    width: 1rem;
    height: 1rem;
}

/* Fade-in animation for loaded logos */
.logo-thumbnail.logo-loaded,
.organization-logo.logo-loaded {
    animation: logoFadeIn 0.3s ease-in-out;
}

@keyframes logoFadeIn {
    from {
        opacity: 0;
        transform: scale(0.95);
    }
    to {
        opacity: 1;
        transform: scale(1);
    }
}

/* Error state styling */
.logo-error-placeholder small {
    font-size: 0.6rem;
    line-height: 1;
}

.logo-error-placeholder i {
    font-size: 0.8rem;
}

/* Responsive adjustments for lazy loading */
@media (max-width: 767.98px) {
    .logo-loading-placeholder .spinner-border-sm {
        width: 0.8rem;
        height: 0.8rem;
    }
    
    .logo-error-placeholder i {
        font-size: 0.7rem;
    }
    
    .logo-error-placeholder small {
        font-size: 0.5rem;
    }
}


/* ============================================
   16. VIDEO PLAYER STYLES
   ============================================ */

/* Video player element styling */
.video-player-element {
    background-color: #000;
    width: 100%;
    height: auto;
    display: block;
}

/* Video player card - 50% smaller */
.video-player-card {
    max-width: 50%;
    margin-left: auto;
    margin-right: auto;
}

/* Video placeholder container for loading/error states */
.video-placeholder-container {
    background-color: #000;
    width: 100%;
    height: 400px;
    display: flex;
    align-items: center;
    justify-content: center;
}

/* Video placeholder icon sizing */
.video-placeholder-container .bi {
    font-size: 3rem;
}

/* Responsive video player height on mobile */
@media (max-width: 767.98px) {
    .video-player-card {
        max-width: 100%;
    }
    
    .video-placeholder-container {
        height: 250px;
    }
    
    .video-placeholder-container .bi {
        font-size: 2rem;
    }
}


/* ============================================
   20. GALLERY DESCRIPTION POPOVER
   ============================================ */

/* Description popover styling */
.description-popover {
    max-width: 400px;
}

.description-popover .popover-body {
    max-height: 300px;
    overflow-y: auto;
    font-size: 0.875rem;
    line-height: 1.5;
}

/* More link styling */
.description-more {
    cursor: pointer;
    white-space: nowrap;
}

.description-more:hover {
    text-decoration: underline !important;
}

/* Responsive popover */
@media (max-width: 576px) {
    .description-popover {
        max-width: 280px;
    }
    
    .description-popover .popover-body {
        max-height: 200px;
    }
}


/* ============================================
   CRITICAL MOBILE TABLE FIX - MUST BE LAST
   Override Bootstrap 5 responsive table flex display
   ============================================ */
@media (max-width: 768px) {
    /* Nuclear option: Force table display with maximum specificity */
    .table-responsive table[class*="table"],
    .table-responsive > table,
    div[class*="table-responsive"] > table,
    div[class*="table-responsive"] table[class*="table"] {
        display: table !important;
    }
    
    .table-responsive table[class*="table"] thead,
    .table-responsive > table > thead,
    div[class*="table-responsive"] > table > thead {
        display: table-header-group !important;
    }
    
    .table-responsive table[class*="table"] tbody,
    .table-responsive > table > tbody,
    div[class*="table-responsive"] > table > tbody {
        display: table-row-group !important;
    }
    
    .table-responsive table[class*="table"] tr,
    .table-responsive > table > thead > tr,
    .table-responsive > table > tbody > tr,
    div[class*="table-responsive"] > table > thead > tr,
    div[class*="table-responsive"] > table > tbody > tr {
        display: table-row !important;
    }
    
    /* MOST CRITICAL: th and td MUST be table-cell */
    .table-responsive table[class*="table"] th,
    .table-responsive table[class*="table"] td,
    .table-responsive > table > thead > tr > th,
    .table-responsive > table > tbody > tr > td,
    div[class*="table-responsive"] > table > thead > tr > th,
    div[class*="table-responsive"] > table > tbody > tr > td,
    .table-responsive table.table th,
    .table-responsive table.table td,
    .table-responsive table.table-striped th,
    .table-responsive table.table-striped td,
    .table-responsive table.table-hover th,
    .table-responsive table.table-hover td {
        display: table-cell !important;
        flex: none !important;
        flex-direction: unset !important;
        flex-wrap: unset !important;
        flex-basis: unset !important;
        align-items: unset !important;
        justify-content: unset !important;
    }
}


/* ============================================
   20. RECEIPT PUBLIC ERROR PAGE
   ============================================ */

/* Error page card styling */
.receipt-error-card {
    box-shadow: 0 0.5rem 1rem rgba(0, 0, 0, 0.15);
    border: none;
}

/* Error icon animation */
.error-icon {
    font-size: 4rem;
    animation: pulse 2s infinite;
}

@keyframes pulse {
    0% {
        transform: scale(1);
    }
    50% {
        transform: scale(1.05);
    }
    100% {
        transform: scale(1);
    }
}

/* Print styles - hide error page when printing */
@media print {
    .receipt-error-page {
        display: none;
    }
}

/* Reduced motion support */
@media (prefers-reduced-motion: reduce) {
    .error-icon {
        animation: none;
    }
}


/* ============================================
   AI ASSISTANT MODAL
   ============================================ */

/* Suggested title panel — sits between modal header and body */
.ai-title-panel {
    padding: 0.75rem 1rem;
    background-color: var(--bs-info-bg-subtle, #cff4fc);
    border-bottom: 1px solid var(--bs-border-color, #dee2e6);
    font-size: 0.9rem;
}

.ai-title-panel-label {
    font-weight: 600;
    color: var(--bs-emphasis-color, #212529);
}

.ai-title-panel-value {
    font-style: italic;
}

/* Scrollable chat history */
.ai-chat-body {
    max-height: 360px;
    overflow-y: auto;
    padding: 1rem;
}

/* Individual chat message bubbles */
.ai-message {
    display: flex;
    margin-bottom: 0.75rem;
}

.ai-message-user {
    justify-content: flex-end;
}

.ai-message-assistant {
    justify-content: flex-start;
}

.ai-message-bubble {
    max-width: 85%;
    padding: 0.6rem 0.9rem;
    border-radius: 1rem;
    font-size: 0.875rem;
    white-space: pre-wrap;
    word-break: break-word;
}

.ai-message-user .ai-message-bubble {
    background-color: var(--bs-primary, #0d6efd);
    color: #fff;
    border-bottom-right-radius: 0.2rem;
}

.ai-message-assistant .ai-message-bubble {
    background-color: var(--bs-light, #f8f9fa);
    color: var(--bs-body-color, #212529);
    border: 1px solid var(--bs-border-color, #dee2e6);
    border-bottom-left-radius: 0.2rem;
}

/* Textarea in modal footer */
.ai-input-textarea {
    resize: none;
}

/* Send button — fixed width so it doesn't shrink */
.ai-send-btn {
    white-space: nowrap;
}

/* ============================================
   DONOR TAGS
   ============================================ */

/* Tag badges on the donor detail page */
.donor-tags {
    display: flex;
    flex-wrap: wrap;
    gap: 0.4rem;
}

.donor-tag-badge {
    font-size: 0.82rem;
    font-weight: 500;
    padding: 0.3em 0.65em;
}

/* Tom Select overrides — ensure it fits within Bootstrap card layout */
.donor-tags-select + .ts-wrapper {
    max-width: 100%;
}

.ts-wrapper.multi .ts-control {
    min-height: 38px;
}

/* Align the Tom Select "create" option styling */
.ts-dropdown .create {
    color: var(--bs-primary);
}

/* ============================================
   21. PUBLIC SITE
   ============================================ */

/* ---- Public site body ---- */
body.public-site {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;
    color: #1a1f36;
    background: #fff;
    height: auto;
    min-height: 100vh;
}

/* ---- Public Navbar ---- */
.public-navbar {
    background: rgba(255, 255, 255, 0.97);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    border-bottom: 1px solid rgba(0, 0, 0, 0.06);
    padding-top: 0.6rem;
    padding-bottom: 0.6rem;
    transition: box-shadow 0.2s ease;
}

.public-navbar.scrolled {
    box-shadow: 0 2px 20px rgba(0, 0, 0, 0.08);
}

.public-nav-link {
    font-weight: 500;
    font-size: 0.9rem;
    color: #374151 !important;
    padding: 0.45rem 0.75rem !important;
    border-radius: 6px;
    transition: color 0.15s, background 0.15s;
    position: relative;
}

.public-nav-link:hover {
    color: #0d6efd !important;
    background: rgba(13, 110, 253, 0.06);
}

.public-nav-link.active {
    color: #0d6efd !important;
    font-weight: 600;
}

/* ---- Public Footer ---- */
.public-footer {
    background: #0f172a;
    color: #94a3b8;
    padding-top: 4rem;
}

.public-footer-logo {
    opacity: 0.92;
}

.public-footer-tagline {
    color: #64748b;
    font-size: 0.875rem;
    line-height: 1.6;
}

.public-footer-heading {
    color: #f1f5f9;
    font-size: 0.8rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.08em;
    margin-bottom: 1rem;
}

.public-footer-links {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

.public-footer-links a {
    color: #64748b;
    text-decoration: none;
    font-size: 0.875rem;
    transition: color 0.15s;
}

.public-footer-links a:hover {
    color: #f1f5f9;
}

.public-footer-bottom {
    border-top: 1px solid #1e293b;
    padding: 1.5rem 0;
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 1rem;
    flex-wrap: wrap;
    color: #94a3b8;
}

/* ---- Typography ---- */
.public-section-heading {
    font-size: clamp(1.6rem, 4vw, 2.4rem);
    font-weight: 700;
    letter-spacing: -0.02em;
    line-height: 1.2;
    color: #0f172a;
}

.public-section-subtext {
    font-size: 1.05rem;
    color: #64748b;
    line-height: 1.7;
    max-width: 560px;
    margin-left: auto;
    margin-right: auto;
}

/* ---- Section backgrounds ---- */
.section-white {
    background: #ffffff;
}

.section-light {
    background: #f8fafc;
}

.public-hero-gradient {
    background: linear-gradient(135deg, #f8fafc 0%, #eef2ff 60%, #f0fdf4 100%);
}

/* ---- Scroll animations ---- */
@keyframes fadeUp {
    from {
        opacity: 0;
        transform: translateY(24px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.animate-fade-up {
    opacity: 0;
    transform: translateY(24px);
    transition: opacity 0.5s ease, transform 0.5s ease;
}

.animate-fade-up.visible {
    opacity: 1;
    transform: translateY(0);
}

.stagger-1 { transition-delay: 0.05s; }
.stagger-2 { transition-delay: 0.1s; }
.stagger-3 { transition-delay: 0.15s; }
.stagger-4 { transition-delay: 0.2s; }
.stagger-5 { transition-delay: 0.25s; }
.stagger-6 { transition-delay: 0.3s; }

/* ---- Benefit cards ---- */
.benefit-card {
    border: 1px solid #e2e8f0;
    border-radius: 16px;
    padding: 1.75rem;
    background: #fff;
    transition: border-color 0.2s, box-shadow 0.2s, transform 0.2s;
    height: 100%;
}

.benefit-card:hover {
    border-color: #0d6efd;
    box-shadow: 0 4px 24px rgba(13, 110, 253, 0.1);
    transform: translateY(-2px);
}

.benefit-card-icon {
    width: 48px;
    height: 48px;
    border-radius: 12px;
    background: linear-gradient(135deg, #eef2ff 0%, #e0e7ff 100%);
    display: flex;
    align-items: center;
    justify-content: center;
    margin-bottom: 1rem;
    font-size: 1.4rem;
    color: #4f46e5;
}

/* ---- Social proof strip ---- */
.social-proof-strip {
    background: linear-gradient(90deg, #4f46e5 0%, #7c3aed 100%);
    color: #fff;
    padding: 1.5rem 0;
}

.social-proof-stat {
    text-align: center;
    padding: 0.5rem 1rem;
}

.social-proof-stat .stat-number {
    font-size: 1.75rem;
    font-weight: 700;
    letter-spacing: -0.02em;
    display: block;
}

.social-proof-stat .stat-label {
    font-size: 0.85rem;
    opacity: 0.85;
}

/* ---- Blog cards ---- */
.blog-card {
    border: 1px solid #e2e8f0;
    border-radius: 16px;
    overflow: hidden;
    background: #fff;
    transition: transform 0.2s ease, box-shadow 0.2s ease;
    height: 100%;
    display: flex;
    flex-direction: column;
}

.blog-card:hover {
    transform: translateY(-4px);
    box-shadow: 0 12px 32px rgba(0, 0, 0, 0.1);
}

.blog-card-img-wrap {
    overflow: hidden;
    aspect-ratio: 16 / 9;
    background: #f1f5f9;
    flex-shrink: 0;
}

.blog-card-img-wrap img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.35s ease;
}

.blog-card:hover .blog-card-img-wrap img {
    transform: scale(1.05);
}

.blog-card-placeholder {
    width: 100%;
    height: 100%;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    background: linear-gradient(135deg, #f1f5f9 0%, #e2e8f0 100%);
    color: #94a3b8;
}

.blog-card-body {
    padding: 1.25rem 1.5rem 1.5rem;
    display: flex;
    flex-direction: column;
    flex: 1;
}

.blog-card-title {
    font-size: 1rem;
    font-weight: 600;
    color: #0f172a;
    line-height: 1.4;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
    margin-bottom: 0.5rem;
    text-decoration: none;
}

.blog-card-title:hover {
    color: #0d6efd;
}

.blog-card-excerpt {
    font-size: 0.875rem;
    color: #64748b;
    line-height: 1.6;
    display: -webkit-box;
    -webkit-line-clamp: 3;
    -webkit-box-orient: vertical;
    overflow: hidden;
    flex: 1;
}

.blog-card-footer {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-top: 1rem;
    padding-top: 1rem;
    border-top: 1px solid #f1f5f9;
    font-size: 0.8rem;
    color: #94a3b8;
}

/* ---- Category pill ---- */
.cat-pill {
    display: inline-block;
    font-size: 0.72rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    padding: 0.2rem 0.65rem;
    border-radius: 999px;
    background: #eef2ff;
    color: #4f46e5;
    text-decoration: none;
    margin-bottom: 0.65rem;
    transition: background 0.15s;
}

.cat-pill:hover {
    background: #e0e7ff;
    color: #4338ca;
}

/* ---- Version badge ---- */
.version-badge {
    display: inline-block;
    background: #eef2ff;
    color: #4f46e5;
    font-size: 0.72rem;
    font-weight: 700;
    border-radius: 999px;
    padding: 0.2rem 0.7rem;
    letter-spacing: 0.03em;
}

.release-card {
    border-left: 3px solid #4f46e5 !important;
}

/* ---- Pill filter tabs ---- */
.pill-tabs {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
    justify-content: center;
    margin-bottom: 2.5rem;
}

.pill-tab {
    border-radius: 999px;
    padding: 0.4rem 1.1rem;
    font-size: 0.875rem;
    font-weight: 500;
    border: 1.5px solid #e2e8f0;
    color: #475569;
    background: #fff;
    text-decoration: none;
    transition: background 0.15s, color 0.15s, border-color 0.15s;
    white-space: nowrap;
}

.pill-tab:hover {
    border-color: #0d6efd;
    color: #0d6efd;
    background: #eff6ff;
}

.pill-tab.active {
    background: #0d6efd;
    color: #fff !important;
    border-color: #0d6efd;
}

/* ---- Blog detail ---- */
.blog-hero {
    position: relative;
    max-height: 480px;
    overflow: hidden;
    background: #0f172a;
}

.blog-hero-img {
    width: 100%;
    max-height: 480px;
    object-fit: cover;
    display: block;
    opacity: 0.85;
}

.blog-hero-gradient {
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    height: 50%;
    background: linear-gradient(to bottom, transparent, rgba(15, 23, 42, 0.7));
}

.blog-hero-placeholder {
    height: 320px;
    background: linear-gradient(135deg, #eef2ff 0%, #e0e7ff 100%);
    display: flex;
    align-items: center;
    justify-content: center;
}

.blog-body {
    font-size: 1.05rem;
    line-height: 1.8;
    color: #1e293b;
    max-width: 720px;
}

.blog-body h2, .blog-body h3, .blog-body h4 {
    margin-top: 2rem;
    margin-bottom: 0.75rem;
    font-weight: 700;
    color: #0f172a;
}

.blog-body blockquote {
    border-left: 4px solid #0d6efd;
    padding-left: 1.25rem;
    font-style: italic;
    color: #64748b;
    margin: 1.5rem 0;
    background: #f8faff;
    border-radius: 0 8px 8px 0;
    padding-top: 0.75rem;
    padding-bottom: 0.75rem;
    padding-right: 1rem;
}

.blog-body pre {
    background: #f8f9fa;
    padding: 1rem 1.25rem;
    border-radius: 8px;
    overflow-x: auto;
    font-size: 0.9rem;
}

.blog-body img {
    max-width: 100%;
    height: auto;
    border-radius: 10px;
    margin: 1rem 0;
}

.blog-body table {
    width: 100%;
    margin-bottom: 1.5rem;
    border-collapse: collapse;
}

.blog-body table th, .blog-body table td {
    border: 1px solid #e2e8f0;
    padding: 0.5rem 0.75rem;
}

.blog-body table th {
    background: #f8fafc;
    font-weight: 600;
}

/* ---- TOC Sidebar ---- */
.blog-sidebar-sticky {
    position: sticky;
    top: 80px;
    max-height: calc(100vh - 100px);
    overflow-y: auto;
}

.toc-sidebar {
    padding: 1.25rem;
    background: #f8fafc;
    border-radius: 12px;
    border: 1px solid #e2e8f0;
}

.toc-sidebar-title {
    font-size: 0.75rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.08em;
    color: #94a3b8;
    margin-bottom: 0.75rem;
}

.toc-list {
    list-style: none;
    padding: 0;
    margin: 0;
}

.toc-list li a {
    display: block;
    padding: 0.3rem 0.5rem;
    font-size: 0.85rem;
    color: #64748b;
    text-decoration: none;
    border-radius: 6px;
    border-left: 2px solid transparent;
    transition: color 0.15s, border-color 0.15s, background 0.15s;
    line-height: 1.4;
}

.toc-list li a:hover,
.toc-list li a.toc-active {
    color: #0d6efd;
    border-left-color: #0d6efd;
    background: rgba(13, 110, 253, 0.05);
}

.toc-list .toc-h3 a {
    padding-left: 1.25rem;
    font-size: 0.8rem;
}

/* ---- Blog CTA widget (self-assessment) ---- */
.blog-cta-widget {
    margin-bottom: 1.25rem;
    padding: 1.5rem;
    border-radius: 12px;
    background: linear-gradient(135deg, #0f172a 0%, #1e3a5f 100%);
    color: #fff;
}

.blog-cta-widget .blog-cta-icon {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 40px;
    height: 40px;
    border-radius: 10px;
    background: rgba(255,255,255,0.15);
    margin-bottom: 0.75rem;
    font-size: 1.1rem;
}

.blog-cta-widget .blog-cta-label {
    font-size: 0.65rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.1em;
    color: rgba(255,255,255,0.6);
    margin-bottom: 0.4rem;
}

.blog-cta-widget h5 {
    font-size: 1rem;
    font-weight: 700;
    line-height: 1.3;
    margin-bottom: 0.6rem;
}

.blog-cta-widget p {
    font-size: 0.8rem;
    color: rgba(255,255,255,0.75);
    line-height: 1.5;
    margin-bottom: 1rem;
}

.blog-cta-widget .blog-cta-btn {
    display: block;
    text-align: center;
    background: #fff;
    color: #0f172a;
    font-size: 0.85rem;
    font-weight: 700;
    padding: 0.6rem 1rem;
    border-radius: 8px;
    text-decoration: none;
    transition: background 0.15s, color 0.15s;
}

.blog-cta-widget .blog-cta-btn:hover {
    background: #e8f0fe;
    color: #0d47a1;
}

.blog-cta-widget .blog-cta-pills {
    display: flex;
    flex-wrap: wrap;
    gap: 0.4rem;
    margin-bottom: 1rem;
}

.blog-cta-widget .blog-cta-pill {
    font-size: 0.7rem;
    color: rgba(255,255,255,0.8);
    background: rgba(255,255,255,0.1);
    border-radius: 20px;
    padding: 0.2rem 0.55rem;
}

/* ---- Share buttons ---- */
.share-row {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    flex-wrap: wrap;
}

.share-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 36px;
    height: 36px;
    border-radius: 50%;
    border: 1px solid #e2e8f0;
    color: #475569;
    text-decoration: none;
    transition: background 0.15s, color 0.15s, border-color 0.15s;
}

.share-btn:hover {
    background: #0d6efd;
    color: #fff;
    border-color: #0d6efd;
}

/* ---- Contact page ---- */
.contact-page-bg {
    background: linear-gradient(135deg, #f8fafc 0%, #eef2ff 100%);
    min-height: calc(100vh - 70px);
    padding: 4rem 0;
}

.contact-trust-card {
    background: linear-gradient(135deg, #fff 0%, #f0f4ff 100%);
    border-radius: 16px;
    border: 1px solid #e0e7ff;
    padding: 2rem;
}

.contact-abstract-shape {
    margin-top: 1.5rem;
    border-radius: 16px;
    background: linear-gradient(135deg, #818cf8 0%, #6366f1 40%, #8b5cf6 100%);
    height: 120px;
    opacity: 0.15;
}

/* ---- Stakeholder / "Who it's for" cards ---- */
.stakeholder-card {
    border: 1px solid #e2e8f0;
    border-radius: 16px;
    padding: 2rem 1.5rem;
    text-align: center;
    background: #fff;
    transition: transform 0.2s, box-shadow 0.2s;
    height: 100%;
}

.stakeholder-card:hover {
    transform: translateY(-3px);
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.08);
}

.stakeholder-icon {
    width: 64px;
    height: 64px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    margin: 0 auto 1.25rem;
    font-size: 1.6rem;
    background: linear-gradient(135deg, #eef2ff 0%, #e0e7ff 100%);
    color: #4f46e5;
}

/* ---- How It Works step ---- */
.hiw-step {
    display: flex;
    gap: 1.5rem;
    align-items: flex-start;
    padding: 1.5rem;
    border-radius: 12px;
    background: #fff;
    border: 1px solid #e2e8f0;
    margin-bottom: 1rem;
    transition: box-shadow 0.2s;
}

.hiw-step:hover {
    box-shadow: 0 4px 16px rgba(0, 0, 0, 0.06);
}

.hiw-step-number {
    flex-shrink: 0;
    width: 40px;
    height: 40px;
    border-radius: 50%;
    background: linear-gradient(135deg, #4f46e5 0%, #7c3aed 100%);
    color: #fff;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 700;
    font-size: 0.95rem;
}

.hiw-callout {
    background: linear-gradient(135deg, #1e1b4b 0%, #312e81 100%);
    color: #fff;
    border-radius: 16px;
    padding: 2.5rem;
    text-align: center;
    margin: 3rem 0;
}

/* ---- Feature grid card ---- */
.feature-card {
    border: 1px solid #e2e8f0;
    border-radius: 16px;
    padding: 1.75rem;
    background: #fff;
    transition: border-color 0.2s, box-shadow 0.2s, transform 0.2s;
    height: 100%;
}

.feature-card:hover {
    border-color: #0d6efd;
    box-shadow: 0 4px 20px rgba(13, 110, 253, 0.1);
    transform: translateY(-2px);
}

.feature-card-icon {
    width: 52px;
    height: 52px;
    border-radius: 14px;
    display: flex;
    align-items: center;
    justify-content: center;
    margin-bottom: 1.1rem;
    font-size: 1.5rem;
    background: linear-gradient(135deg, #eef2ff 0%, #e0e7ff 100%);
    color: #4f46e5;
}

/* ---- CTA banner ---- */
.public-cta-banner {
    background: linear-gradient(135deg, #1e3a8a 0%, #1d4ed8 50%, #2563eb 100%);
    color: #fff;
    padding: 5rem 0;
    text-align: center;
}

.public-cta-banner h2 {
    font-size: clamp(1.5rem, 3.5vw, 2.25rem);
    font-weight: 700;
    letter-spacing: -0.02em;
    margin-bottom: 0.75rem;
}

/* ---- Divider line ---- */
.section-divider {
    border: none;
    height: 1px;
    background: linear-gradient(90deg, transparent, #e2e8f0, transparent);
    margin: 0;
}

/* ---- About page ---- */
.about-mission-block {
    background: linear-gradient(135deg, #0f172a 0%, #1e1b4b 100%);
    color: #fff;
    border-radius: 20px;
    padding: 3rem;
}

/* ---- Registration page wrapping ---- */
.public-form-wrapper {
    max-width: 700px;
    margin: 0 auto;
    padding: 2rem 0 4rem;
}

/* ---- FAQ page ---- */
.faq-accordion .accordion-button:not(.collapsed) {
    background: #eef2ff;
    color: #4f46e5;
    box-shadow: none;
}

.faq-accordion .accordion-button:focus {
    box-shadow: none;
}

/* ---- Responsive ---- */
@media (max-width: 767px) {
    .public-footer-bottom {
        flex-direction: column;
        text-align: center;
    }

    .toc-sidebar {
        display: none;
    }

    .blog-hero {
        max-height: 240px;
    }

    .contact-page-bg {
        padding: 2rem 0;
    }
}

/* ============================================
   22. HOME PAGE — EDITORIAL DESIGN
   ============================================ */

/* --- Typography helpers --- */
.hp-font-display { font-family: 'Playfair Display', Georgia, serif; }

/* --- Hero --- */
.hp-hero {
    background: #06101F;
    position: relative;
    overflow: hidden;
    min-height: 88vh;
    display: flex;
    flex-direction: column;
    justify-content: center;
    padding: 7rem 0 0;
}

.hp-hero::before {
    content: '';
    position: absolute;
    top: -200px;
    right: -50px;
    width: 650px;
    height: 650px;
    background: radial-gradient(ellipse at center, rgba(75, 158, 255, 0.1) 0%, transparent 65%);
    border-radius: 50%;
    pointer-events: none;
}

.hp-hero::after {
    content: '';
    position: absolute;
    bottom: 80px;
    left: -120px;
    width: 500px;
    height: 500px;
    background: radial-gradient(ellipse at center, rgba(201, 146, 74, 0.08) 0%, transparent 65%);
    border-radius: 50%;
    pointer-events: none;
}

.hp-hero-eyebrow {
    font-family: 'DM Sans', system-ui, sans-serif;
    font-size: 0.75rem;
    font-weight: 600;
    letter-spacing: 0.14em;
    text-transform: uppercase;
    color: #C9924A;
    display: flex;
    align-items: center;
    gap: 0.75rem;
    margin-bottom: 1.5rem;
}

.hp-hero-eyebrow::before {
    content: '';
    display: inline-block;
    width: 28px;
    height: 1.5px;
    background: #C9924A;
    flex-shrink: 0;
}

.hp-hero-heading {
    font-family: 'Playfair Display', Georgia, serif;
    font-size: clamp(2.6rem, 5.5vw, 4.5rem);
    font-weight: 700;
    line-height: 1.08;
    letter-spacing: -0.025em;
    color: #F4F1EC;
    margin-bottom: 1.5rem;
}

.hp-hero-heading em {
    font-style: italic;
    color: #C9924A;
}

.hp-hero-sub {
    font-family: 'DM Sans', system-ui, sans-serif;
    font-size: 1.05rem;
    line-height: 1.8;
    color: #6B7D96;
    max-width: 460px;
    margin-bottom: 2.75rem;
}

.hp-hero-cta-primary {
    background: #C9924A;
    color: #06101F;
    border: none;
    font-family: 'DM Sans', system-ui, sans-serif;
    font-weight: 600;
    font-size: 0.925rem;
    padding: 0.875rem 2rem;
    border-radius: 7px;
    text-decoration: none;
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    transition: background 0.2s, transform 0.15s;
    letter-spacing: 0.01em;
}

.hp-hero-cta-primary:hover {
    background: #B07E3A;
    color: #06101F;
    transform: translateY(-2px);
}

.hp-hero-cta-secondary {
    color: #6B7D96;
    border: 1px solid rgba(255, 255, 255, 0.12);
    font-family: 'DM Sans', system-ui, sans-serif;
    font-weight: 500;
    font-size: 0.925rem;
    padding: 0.875rem 2rem;
    border-radius: 7px;
    text-decoration: none;
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    transition: border-color 0.2s, color 0.2s;
}

.hp-hero-cta-secondary:hover {
    border-color: rgba(255, 255, 255, 0.3);
    color: #C8D8EC;
}

.hp-hero-image-wrap {
    position: relative;
}

.hp-hero-image-glow {
    position: absolute;
    inset: -1px;
    border-radius: 16px;
    background: linear-gradient(
        135deg,
        rgba(75, 158, 255, 0.25) 0%,
        rgba(201, 146, 74, 0.15) 50%,
        transparent 80%
    );
    z-index: 1;
    pointer-events: none;
}

.hp-hero-image-wrap img {
    border-radius: 14px;
    width: 100%;
    display: block;
    position: relative;
    z-index: 0;
}

/* --- Ticker --- */
.hp-ticker {
    background: rgba(255, 255, 255, 0.03);
    border-top: 1px solid rgba(255, 255, 255, 0.07);
    margin-top: 4rem;
    padding: 0.9rem 0;
    overflow: hidden;
    flex-shrink: 0;
}

.hp-ticker-track {
    display: flex;
    white-space: nowrap;
    animation: hp-ticker-scroll 35s linear infinite;
    font-family: 'DM Sans', system-ui, sans-serif;
    font-size: 0.72rem;
    letter-spacing: 0.12em;
    text-transform: uppercase;
    color: #3A4E65;
    will-change: transform;
}

.hp-ticker-track span {
    padding: 0 2.5rem;
    flex-shrink: 0;
}

.hp-ticker-dot {
    color: #C9924A !important;
    padding: 0 !important;
    font-size: 0.65rem !important;
}

@keyframes hp-ticker-scroll {
    0% { transform: translateX(0); }
    100% { transform: translateX(-50%); }
}

/* --- Stats --- */
.hp-stats {
    background: #0A1829;
    border-top: 1px solid rgba(255, 255, 255, 0.05);
    border-bottom: 1px solid rgba(255, 255, 255, 0.05);
    padding: 3.5rem 0;
}

.hp-stat-item {
    text-align: center;
    padding: 1rem 1.5rem;
    border-right: 1px solid rgba(255, 255, 255, 0.07);
}

.hp-stat-item:last-child {
    border-right: none;
}

.hp-stat-num {
    font-family: 'Playfair Display', Georgia, serif;
    font-size: clamp(2rem, 3.5vw, 3rem);
    font-weight: 700;
    color: #C9924A;
    line-height: 1;
    display: block;
    margin-bottom: 0.5rem;
    letter-spacing: -0.02em;
}

.hp-stat-label {
    font-family: 'DM Sans', system-ui, sans-serif;
    font-size: 0.72rem;
    text-transform: uppercase;
    letter-spacing: 0.12em;
    color: #3A4E65;
}

/* --- Section labels + headings (shared) --- */
.hp-section-label {
    font-family: 'DM Sans', system-ui, sans-serif;
    font-size: 0.72rem;
    font-weight: 600;
    letter-spacing: 0.14em;
    text-transform: uppercase;
    color: #C9924A;
    display: flex;
    align-items: center;
    gap: 0.75rem;
    margin-bottom: 0.75rem;
}

.hp-section-label::before {
    content: '';
    display: inline-block;
    width: 24px;
    height: 1.5px;
    background: #C9924A;
    flex-shrink: 0;
}

.hp-section-title {
    font-family: 'Playfair Display', Georgia, serif;
    font-size: clamp(1.8rem, 3.5vw, 2.75rem);
    font-weight: 700;
    line-height: 1.15;
    letter-spacing: -0.02em;
    color: #06101F;
}

.hp-section-sub {
    font-family: 'DM Sans', system-ui, sans-serif;
    font-size: 1rem;
    line-height: 1.75;
    color: #6B7A8D;
}

/* --- Pillars --- */
.hp-pillars {
    background: #FAFAF8;
    padding: 6rem 0;
}

.hp-pillar-card {
    border: 1px solid #EAE6DF;
    border-radius: 12px;
    padding: 2rem;
    background: #fff;
    height: 100%;
    transition: border-color 0.2s, box-shadow 0.2s, transform 0.2s;
    position: relative;
    overflow: hidden;
}

.hp-pillar-card::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    height: 2px;
    background: linear-gradient(90deg, #C9924A, #E8A95C);
    transform: scaleX(0);
    transform-origin: left;
    transition: transform 0.3s ease;
}

.hp-pillar-card:hover {
    border-color: rgba(201, 146, 74, 0.4);
    box-shadow: 0 8px 32px rgba(201, 146, 74, 0.1);
    transform: translateY(-3px);
}

.hp-pillar-card:hover::after {
    transform: scaleX(1);
}

.hp-pillar-num {
    font-family: 'Playfair Display', Georgia, serif;
    font-size: 2.75rem;
    font-weight: 700;
    color: #EAE0D5;
    line-height: 1;
    margin-bottom: 1.25rem;
    letter-spacing: -0.04em;
    display: block;
}

.hp-pillar-title {
    font-family: 'DM Sans', system-ui, sans-serif;
    font-size: 0.975rem;
    font-weight: 600;
    color: #0E1A35;
    margin-bottom: 0.6rem;
}

.hp-pillar-body {
    font-family: 'DM Sans', system-ui, sans-serif;
    font-size: 0.875rem;
    line-height: 1.7;
    color: #6B7A8D;
    margin-bottom: 0;
}

/* --- Audience --- */
.hp-audience {
    background: #fff;
    padding: 6rem 0;
    border-top: 1px solid #F0ECE8;
}

.hp-audience-card {
    border: 1px solid #EAE6DF;
    border-radius: 12px;
    padding: 2rem 1.75rem;
    height: 100%;
    background: #FAFAF8;
    transition: background 0.25s, border-color 0.25s, box-shadow 0.25s;
}

.hp-audience-card:hover {
    background: #06101F;
    border-color: #06101F;
    box-shadow: 0 12px 40px rgba(6, 16, 31, 0.25);
}

.hp-audience-card:hover .hp-audience-role {
    color: #F4F1EC;
}

.hp-audience-card:hover .hp-audience-desc {
    color: #5A7088;
}

.hp-audience-card:hover .hp-audience-icon {
    background: rgba(201, 146, 74, 0.15);
    color: #C9924A;
}

.hp-audience-icon {
    width: 44px;
    height: 44px;
    border-radius: 10px;
    background: rgba(6, 16, 31, 0.07);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.1rem;
    color: #0E1A35;
    margin-bottom: 1.25rem;
    transition: background 0.25s, color 0.25s;
}

.hp-audience-role {
    font-family: 'Playfair Display', Georgia, serif;
    font-size: 1.1rem;
    font-weight: 700;
    color: #06101F;
    margin-bottom: 0.65rem;
    transition: color 0.25s;
}

.hp-audience-desc {
    font-family: 'DM Sans', system-ui, sans-serif;
    font-size: 0.875rem;
    line-height: 1.7;
    color: #6B7A8D;
    margin-bottom: 0;
    transition: color 0.25s;
}

/* --- Blog editorial --- */
.hp-blog {
    background: #FAFAF8;
    padding: 6rem 0;
    border-top: 1px solid #F0ECE8;
}

.hp-blog-feature-card {
    border-radius: 14px;
    overflow: hidden;
    background: #fff;
    border: 1px solid #EAE6DF;
    height: 100%;
    display: flex;
    flex-direction: column;
    transition: box-shadow 0.25s, transform 0.25s;
}

.hp-blog-feature-card:hover {
    box-shadow: 0 16px 48px rgba(6, 16, 31, 0.1);
    transform: translateY(-4px);
}

.hp-blog-feature-img {
    aspect-ratio: 16/9;
    overflow: hidden;
    background: #EAE6DF;
    flex-shrink: 0;
}

.hp-blog-feature-img img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.4s ease;
}

.hp-blog-feature-card:hover .hp-blog-feature-img img {
    transform: scale(1.04);
}

.hp-blog-feature-placeholder {
    width: 100%;
    height: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
    background: linear-gradient(135deg, #EAE6DF, #D8D0C8);
    color: #A89880;
    font-size: 2rem;
}

.hp-blog-feature-body {
    padding: 1.5rem 1.75rem 1.75rem;
    display: flex;
    flex-direction: column;
    flex: 1;
}

.hp-blog-feature-title {
    font-family: 'Playfair Display', Georgia, serif;
    font-size: 1.2rem;
    font-weight: 700;
    color: #06101F;
    line-height: 1.35;
    text-decoration: none;
    display: block;
    margin-bottom: 0.6rem;
    transition: color 0.15s;
}

.hp-blog-feature-title:hover {
    color: #C9924A;
}

.hp-blog-feature-excerpt {
    font-family: 'DM Sans', system-ui, sans-serif;
    font-size: 0.875rem;
    line-height: 1.65;
    color: #6B7A8D;
    flex: 1;
    display: -webkit-box;
    -webkit-line-clamp: 3;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.hp-blog-mini-card {
    display: flex;
    gap: 1rem;
    padding: 1.125rem;
    border-radius: 10px;
    background: #fff;
    border: 1px solid #EAE6DF;
    text-decoration: none;
    transition: box-shadow 0.2s, transform 0.2s;
    align-items: flex-start;
}

.hp-blog-mini-card:hover {
    box-shadow: 0 8px 24px rgba(6, 16, 31, 0.08);
    transform: translateY(-2px);
}

.hp-blog-mini-thumb {
    width: 76px;
    height: 60px;
    border-radius: 6px;
    overflow: hidden;
    background: #EAE6DF;
    flex-shrink: 0;
}

.hp-blog-mini-thumb img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.hp-blog-mini-placeholder {
    width: 100%;
    height: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
    background: linear-gradient(135deg, #EAE6DF, #D8D0C8);
    color: #A89880;
}

.hp-blog-mini-title {
    font-family: 'Playfair Display', Georgia, serif;
    font-size: 0.9rem;
    font-weight: 600;
    color: #06101F;
    line-height: 1.35;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
    margin-bottom: 0.35rem;
    transition: color 0.15s;
}

.hp-blog-mini-card:hover .hp-blog-mini-title {
    color: #C9924A;
}

.hp-blog-mini-meta {
    font-family: 'DM Sans', system-ui, sans-serif;
    font-size: 0.72rem;
    color: #A89880;
}

/* --- Release Notes (dark strip) --- */
.hp-releases {
    background: #06101F;
    padding: 5rem 0;
}

.hp-releases-heading {
    font-family: 'Playfair Display', Georgia, serif;
    font-size: clamp(1.6rem, 3vw, 2.25rem);
    font-weight: 700;
    color: #F4F1EC;
    letter-spacing: -0.02em;
}

.hp-releases-sub {
    font-family: 'DM Sans', system-ui, sans-serif;
    font-size: 0.9rem;
    color: #3A4E65;
}

.hp-release-item {
    display: flex;
    align-items: flex-start;
    gap: 1rem;
    padding: 1.25rem 1.5rem;
    border-radius: 10px;
    border: 1px solid rgba(255, 255, 255, 0.07);
    background: rgba(255, 255, 255, 0.025);
    text-decoration: none;
    transition: background 0.2s, border-color 0.2s;
    height: 100%;
}

.hp-release-item:hover {
    background: rgba(201, 146, 74, 0.07);
    border-color: rgba(201, 146, 74, 0.3);
}

.hp-release-version {
    font-family: 'DM Mono', 'Fira Code', 'Courier New', monospace;
    font-size: 0.68rem;
    font-weight: 700;
    padding: 0.2rem 0.6rem;
    border-radius: 4px;
    background: rgba(201, 146, 74, 0.12);
    color: #C9924A;
    white-space: nowrap;
    flex-shrink: 0;
    letter-spacing: 0.04em;
    border: 1px solid rgba(201, 146, 74, 0.2);
    line-height: 1.6;
}

.hp-release-title {
    font-family: 'DM Sans', system-ui, sans-serif;
    font-size: 0.875rem;
    font-weight: 500;
    color: #A8BDD4;
    line-height: 1.45;
    margin-bottom: 0.25rem;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.hp-release-date {
    font-family: 'DM Sans', system-ui, sans-serif;
    font-size: 0.7rem;
    color: #2E3F54;
}

/* --- CTA dark --- */
.hp-cta {
    background: #06101F;
    position: relative;
    overflow: hidden;
    padding: 7rem 0;
    text-align: center;
    border-top: 1px solid rgba(255, 255, 255, 0.05);
}

.hp-cta::before {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: 800px;
    height: 400px;
    background: radial-gradient(ellipse at center, rgba(201, 146, 74, 0.1) 0%, transparent 65%);
    pointer-events: none;
}

.hp-cta-heading {
    font-family: 'Playfair Display', Georgia, serif;
    font-size: clamp(2rem, 4.5vw, 3.5rem);
    font-weight: 700;
    line-height: 1.12;
    letter-spacing: -0.025em;
    color: #F4F1EC;
    margin-bottom: 1.25rem;
    position: relative;
}

.hp-cta-heading em {
    font-style: italic;
    color: #C9924A;
}

.hp-cta-sub {
    font-family: 'DM Sans', system-ui, sans-serif;
    font-size: 1rem;
    color: #3A4E65;
    max-width: 460px;
    margin: 0 auto 2.75rem;
    line-height: 1.75;
    position: relative;
}

.hp-cta-btn {
    background: #C9924A;
    color: #06101F;
    border: none;
    font-family: 'DM Sans', system-ui, sans-serif;
    font-weight: 600;
    font-size: 0.95rem;
    padding: 1rem 2.5rem;
    border-radius: 7px;
    text-decoration: none;
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    transition: background 0.2s, transform 0.15s;
    letter-spacing: 0.01em;
    position: relative;
}

.hp-cta-btn:hover {
    background: #B07E3A;
    color: #06101F;
    transform: translateY(-2px);
}

/* --- HP Meta divider --- */
.hp-divider {
    border: none;
    height: 1px;
    background: #F0ECE8;
    margin: 0;
}

.hp-divider-dark {
    border: none;
    height: 1px;
    background: rgba(255, 255, 255, 0.05);
    margin: 0;
}

/* --- HP blog cat pill --- */
.hp-cat-pill {
    display: inline-block;
    font-family: 'DM Sans', system-ui, sans-serif;
    font-size: 0.68rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.08em;
    padding: 0.18rem 0.6rem;
    border-radius: 4px;
    background: rgba(201, 146, 74, 0.1);
    color: #A0712E;
    text-decoration: none;
    margin-bottom: 0.6rem;
    transition: background 0.15s;
}

.hp-cat-pill:hover {
    background: rgba(201, 146, 74, 0.2);
    color: #8A5E22;
}

.hp-blog-meta {
    font-family: 'DM Sans', system-ui, sans-serif;
    font-size: 0.75rem;
    color: #A89880;
    display: flex;
    align-items: center;
    gap: 0.75rem;
    margin-top: auto;
    padding-top: 1rem;
    border-top: 1px solid #F5F2EE;
}

/* --- HP explore link --- */
.hp-explore-link {
    font-family: 'DM Sans', system-ui, sans-serif;
    font-size: 0.875rem;
    font-weight: 600;
    color: #C9924A;
    text-decoration: none;
    display: inline-flex;
    align-items: center;
    gap: 0.4rem;
    letter-spacing: 0.01em;
    transition: gap 0.2s;
}

.hp-explore-link:hover {
    color: #B07E3A;
    gap: 0.7rem;
}

/* --- HP Responsive --- */
@media (max-width: 991px) {
    .hp-hero {
        min-height: auto;
        padding: 5rem 0 0;
    }

    .hp-stat-item {
        border-right: none;
        border-bottom: 1px solid rgba(255, 255, 255, 0.06);
        padding: 1.5rem 1rem;
    }

    .hp-stat-item:last-child {
        border-bottom: none;
    }
}

@media (max-width: 767px) {
    .hp-pillars,
    .hp-audience,
    .hp-blog,
    .hp-releases {
        padding: 4rem 0;
    }

    .hp-cta {
        padding: 4.5rem 0;
    }

    .hp-hero-sub {
        max-width: 100%;
    }
}

/* ============================================
   23. PUBLIC NAVBAR — REDESIGNED
   ============================================ */

.pnav {
    background: #fff;
    border-bottom: 1px solid #EEE9E3;
    padding: 0.75rem 0;
    transition: box-shadow 0.25s ease;
    min-height: 80px;
}

.pnav.scrolled {
    box-shadow: 0 2px 28px rgba(0, 0, 0, 0.07);
}

/* Logo */
.pnav-brand {
    display: flex;
    align-items: center;
    text-decoration: none;
    padding: 0;
    margin-right: 0;
    flex-shrink: 0;
}

.pnav-logo {
    height: 48px;
    width: auto;
    display: block;
    transition: opacity 0.2s;
}

.pnav-brand:hover .pnav-logo {
    opacity: 0.82;
}

/* Collapse wrapper */
.pnav .navbar-collapse {
    align-items: center;
}

/* Nav links list */
.pnav-links {
    display: flex;
    align-items: center;
    list-style: none;
    margin: 0;
    padding: 0;
    gap: 0.25rem;
}

/* Individual nav link */
.pnav-link {
    display: inline-block;
    font-size: 1.125rem;
    font-weight: 600;
    color: #374151;
    text-decoration: none;
    padding: 0.5rem 1.1rem;
    position: relative;
    letter-spacing: -0.01em;
    transition: color 0.15s;
    white-space: nowrap;
}

/* Animated underline */
.pnav-link::after {
    content: '';
    position: absolute;
    bottom: -1px;
    left: 1rem;
    right: 1rem;
    height: 2px;
    background: #0f172a;
    border-radius: 2px;
    transform: scaleX(0);
    transform-origin: center;
    transition: transform 0.22s ease;
}

.pnav-link:hover {
    color: #111827;
}

.pnav-link:hover::after {
    transform: scaleX(0.6);
}

.pnav-link.pnav-link--active {
    color: #111827;
    font-weight: 700;
}

.pnav-link.pnav-link--active::after {
    transform: scaleX(1);
}

/* Right-side action cluster */
.pnav-actions {
    display: flex;
    align-items: center;
    gap: 0.6rem;
    flex-shrink: 0;
}

/* Thin vertical divider */
.pnav-sep {
    width: 1px;
    height: 18px;
    background: #E2E8F0;
    flex-shrink: 0;
    margin: 0 0.25rem;
}

/* Subtle language switcher */
.pnav-lang-subtle {
    display: flex;
    align-items: center;
    gap: 0.1rem;
    margin-right: 0.25rem;
}

.pnav-lang-subtle-btn {
    background: none;
    border: none;
    font-size: 0.72rem;
    font-weight: 500;
    letter-spacing: 0.04em;
    color: #B0BBCF;
    padding: 0.2rem 0.3rem;
    cursor: pointer;
    transition: color 0.15s;
    line-height: 1;
}

.pnav-lang-subtle-btn:hover {
    color: #5A6478;
}

.pnav-lang-subtle-btn.active {
    color: #374151;
    font-weight: 600;
}

.pnav-lang-subtle-sep {
    font-size: 0.65rem;
    color: #D1D8E8;
    line-height: 1;
    user-select: none;
}

/* Language toggle — segmented pill */
.pnav-lang {
    display: flex;
    align-items: stretch;
    border: 1px solid #E2E8F0;
    border-radius: 7px;
    overflow: hidden;
    height: 32px;
}

.pnav-lang-form {
    display: inline;
    margin: 0;
}

.pnav-lang-btn {
    background: transparent;
    border: none;
    font-size: 0.72rem;
    font-weight: 700;
    letter-spacing: 0.06em;
    color: #94A3B8;
    padding: 0 0.6rem;
    cursor: pointer;
    transition: background 0.15s, color 0.15s;
    line-height: 1;
    height: 100%;
    display: flex;
    align-items: center;
}

.pnav-lang-btn:hover {
    color: #0f172a;
    background: #F8FAFC;
}

.pnav-lang-btn.pnav-lang-active {
    background: #0f172a;
    color: #fff;
}

.pnav-lang-divider {
    width: 1px;
    background: #E2E8F0;
    flex-shrink: 0;
    align-self: stretch;
}

/* Log In — text link style */
.pnav-login {
    font-size: 0.875rem;
    font-weight: 500;
    color: #475569;
    text-decoration: none;
    padding: 0.45rem 0.75rem;
    border-radius: 7px;
    transition: color 0.15s, background 0.15s;
    white-space: nowrap;
    display: inline-flex;
    align-items: center;
    gap: 0.35rem;
}

.pnav-login:hover {
    color: #0f172a;
    background: #F8FAFC;
}

/* Log In / CTA button */
.pnav-cta {
    background: #0f172a;
    color: #fff;
    font-size: 1.125rem;
    font-weight: 600;
    padding: 0.65rem 1.5rem;
    border-radius: 10px;
    text-decoration: none;
    display: inline-flex;
    align-items: center;
    gap: 0.35rem;
    transition: background 0.15s, transform 0.15s;
    letter-spacing: 0.01em;
    white-space: nowrap;
}

.pnav-cta:hover {
    background: #1e293b;
    color: #fff;
    transform: translateY(-1px);
}

/* Dashboard variant — indigo */
.pnav-cta--dashboard {
    background: #4f46e5;
}

.pnav-cta--dashboard:hover {
    background: #4338ca;
    color: #fff;
}

/* Custom hamburger — three clean bars */
.navbar-toggler.pnav-toggler {
    background: none;
    border: none;
    padding: 0.4rem 0.5rem;
    cursor: pointer;
    flex-direction: column;
    justify-content: center;
    gap: 5px;
    border-radius: 6px;
    transition: background 0.15s;
}

.navbar-toggler.pnav-toggler:focus {
    outline: none;
    box-shadow: none;
    background: #F1F5F9;
}

/* Only flex on mobile — Bootstrap handles display:none on desktop */
@media (max-width: 991.98px) {
    .navbar-toggler.pnav-toggler {
        display: flex;
    }
}

.pnav-bar {
    display: block;
    width: 22px;
    height: 2px;
    background: #334155;
    border-radius: 2px;
    transition: all 0.25s ease;
}

/* ---- Responsive ---- */
@media (max-width: 991px) {
    .pnav {
        min-height: 60px;
    }

    .pnav-links {
        flex-direction: column;
        align-items: flex-start;
        padding: 0.75rem 0;
        gap: 0;
        width: 100%;
    }

    .pnav-link {
        width: 100%;
        padding: 0.65rem 0;
        border-radius: 0;
    }

    .pnav-link::after {
        display: none;
    }

    .pnav-link.pnav-link--active {
        color: #4f46e5;
    }

    .pnav-actions {
        padding: 0.75rem 0 0.25rem;
        border-top: 1px solid #F1F5F9;
        width: 100%;
        gap: 0.5rem;
        flex-wrap: wrap;
        margin-top: 0.25rem;
    }

    .pnav-sep {
        display: none;
    }

    .pnav-login {
        padding: 0.5rem 0;
    }

    .pnav-cta {
        flex: 1;
        justify-content: center;
    }
}

/* ============================================
   24. HOME PAGE — EXSIT-INSPIRED REDESIGN
   ============================================ */

/* --- Palette variables --- */
:root {
    --ex-blue:    #2D5BFF;
    --ex-blue-dk: #1d47e8;
    --ex-navy:    #0D1221;
    --ex-tint:    #F0F2FF;
    --ex-border:  #E4E7FF;
    --ex-muted:   #8B93B5;
    --ex-body:    #3D4B63;
}

/* --- Font utility --- */
.ex-font { font-family: 'Plus Jakarta Sans', system-ui, sans-serif; }

/* --- Background utilities --- */
.ex-bg-tint  { background: var(--ex-tint); }
.ex-bg-white { background: #fff; }
.ex-bg-navy  { background: var(--ex-navy); }

/* --- Typography --- */

/* Exsit measured values: DM Sans, body=18px/500, h3=30px/500, h2=48px/600, h1=80px/600 */

.ex-heading-xl {
    font-family: 'Plus Jakarta Sans', system-ui, sans-serif;
    font-size: clamp(2rem, 3.5vw, 3rem);
    font-weight: 600;
    line-height: 1.25;
    letter-spacing: -0.03em;
    color: var(--ex-navy);
}

.ex-heading-lg {
    font-family: 'Plus Jakarta Sans', system-ui, sans-serif;
    font-size: clamp(1.85rem, 3.5vw, 2.75rem);
    font-weight: 600;
    line-height: 1.2;
    letter-spacing: -0.025em;
    color: var(--ex-navy);
}

.ex-accent { color: var(--ex-blue); }

/* Body text: 18px / weight 500 — matches Exsit exactly */
.ex-body {
    font-family: 'Plus Jakarta Sans', system-ui, sans-serif;
    font-size: 1.125rem;
    font-weight: 400;
    line-height: 1.75;
    color: #3D4B63;
}

.ex-section-tag {
    display: inline-block;
    font-family: 'Plus Jakarta Sans', system-ui, sans-serif;
    font-size: 0.8rem;
    font-weight: 600;
    letter-spacing: 0.09em;
    text-transform: uppercase;
    color: var(--ex-blue);
    margin-bottom: 0.6rem;
}

/* --- Announcement pill --- */
.ex-announce-pill {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    background: #fff;
    border: 1px solid var(--ex-border);
    border-radius: 999px;
    padding: 0.3rem 1rem 0.3rem 0.45rem;
    font-family: 'Plus Jakarta Sans', system-ui, sans-serif;
    font-size: 0.78rem;
    font-weight: 500;
    color: var(--ex-body);
    margin-bottom: 1.5rem;
    box-shadow: 0 2px 10px rgba(45, 91, 255, 0.08);
}

.ex-announce-dot {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background: var(--ex-blue);
    flex-shrink: 0;
    display: inline-block;
}

/* --- Hero --- */
.ex-hero {
    background: var(--ex-tint);
    padding: 5rem 0;
    position: relative;
    overflow: hidden;
}

.ex-hero::before {
    content: '';
    position: absolute;
    top: -120px;
    right: -180px;
    width: 580px;
    height: 580px;
    background: radial-gradient(ellipse, rgba(45, 91, 255, 0.07) 0%, transparent 68%);
    pointer-events: none;
}

.ex-hero::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: -120px;
    width: 400px;
    height: 400px;
    background: radial-gradient(ellipse, rgba(45, 91, 255, 0.04) 0%, transparent 65%);
    pointer-events: none;
}

/* Hero image container */
.ex-hero-img-wrap {
    position: relative;
}

.ex-hero-img-wrap img {
    width: 100%;
    display: block;
    border-radius: 20px;
    box-shadow: 0 24px 64px rgba(10, 15, 44, 0.14);
}

/* Floating stat card */
.ex-float-card {
    position: absolute;
    top: 1.25rem;
    left: 1.5rem;
    background: #fff;
    border-radius: 14px;
    padding: 0.85rem 1.1rem;
    box-shadow: 0 8px 32px rgba(10, 15, 44, 0.14);
    display: flex;
    align-items: center;
    gap: 0.85rem;
    z-index: 3;
    min-width: 160px;
}

.ex-float-card-icon {
    width: 38px;
    height: 38px;
    background: var(--ex-tint);
    border-radius: 10px;
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--ex-blue);
    font-size: 1rem;
    flex-shrink: 0;
}

.ex-float-num {
    font-family: 'Plus Jakarta Sans', system-ui, sans-serif;
    font-size: 1.3rem;
    font-weight: 800;
    color: var(--ex-navy);
    line-height: 1;
    display: block;
}

.ex-float-label {
    font-family: 'Plus Jakarta Sans', system-ui, sans-serif;
    font-size: 0.68rem;
    color: var(--ex-muted);
    line-height: 1.3;
    display: block;
}

/* Floating feature pills */
.ex-hero-pills {
    position: absolute;
    bottom: 1.5rem;
    left: 1.5rem;
    right: 1.5rem;
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
    z-index: 3;
}

.ex-hero-pill {
    background: rgba(255, 255, 255, 0.92);
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    border-radius: 999px;
    padding: 0.3rem 0.85rem;
    font-family: 'Plus Jakarta Sans', system-ui, sans-serif;
    font-size: 0.72rem;
    font-weight: 500;
    color: var(--ex-navy);
    border: 1px solid rgba(255, 255, 255, 0.7);
}

/* Social proof row */
.ex-social-row {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    margin-top: 1.75rem;
}

.ex-avatar-stack {
    display: flex;
}

.ex-avatar {
    width: 32px;
    height: 32px;
    border-radius: 50%;
    border: 2px solid var(--ex-tint);
    background: var(--ex-blue);
    display: flex;
    align-items: center;
    justify-content: center;
    font-family: 'Plus Jakarta Sans', system-ui, sans-serif;
    font-size: 0.62rem;
    font-weight: 700;
    color: #fff;
    margin-left: -8px;
    flex-shrink: 0;
}

.ex-avatar:first-child { margin-left: 0; }
.ex-avatar:nth-child(2) { background: #4169FF; }
.ex-avatar:nth-child(3) { background: #6B8BFF; }

.ex-social-text {
    font-family: 'Plus Jakarta Sans', system-ui, sans-serif;
    font-size: 0.8rem;
    color: var(--ex-body);
    line-height: 1.4;
}

.ex-social-text strong { color: var(--ex-navy); font-weight: 700; }

/* --- CTA buttons --- */
.ex-btn-primary {
    background: var(--ex-blue);
    color: #fff;
    font-family: 'Plus Jakarta Sans', system-ui, sans-serif;
    font-weight: 600;
    font-size: 0.9rem;
    padding: 0.8rem 1.5rem;
    border-radius: 10px;
    text-decoration: none;
    display: inline-flex;
    align-items: center;
    gap: 0.45rem;
    transition: background 0.18s, transform 0.15s;
    letter-spacing: 0.01em;
    white-space: nowrap;
}

.ex-btn-primary:hover {
    background: var(--ex-blue-dk);
    color: #fff;
    transform: translateY(-1px);
}

.ex-btn-outline {
    background: transparent;
    color: var(--ex-blue);
    border: 2px solid var(--ex-blue);
    font-family: 'Plus Jakarta Sans', system-ui, sans-serif;
    font-weight: 600;
    font-size: 0.9rem;
    padding: calc(0.8rem - 2px) 1.5rem;
    border-radius: 10px;
    text-decoration: none;
    display: inline-flex;
    align-items: center;
    gap: 0.45rem;
    transition: background 0.18s, color 0.18s, transform 0.15s;
    letter-spacing: 0.01em;
    white-space: nowrap;
}

.ex-btn-outline:hover {
    background: var(--ex-blue);
    color: #fff;
    transform: translateY(-1px);
}

/* White button — for use on dark/gradient hero backgrounds */
.ex-btn-white {
    background: #ffffff;
    color: var(--ex-navy);
    font-family: 'Plus Jakarta Sans', system-ui, sans-serif;
    font-weight: 700;
    font-size: 1rem;
    padding: 0.9rem 2rem;
    border-radius: 10px;
    text-decoration: none;
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    box-shadow: 0 4px 24px rgba(0,0,0,0.18);
    transition: background 0.18s, box-shadow 0.18s, transform 0.15s;
    letter-spacing: 0.01em;
    white-space: nowrap;
}

.ex-btn-white:hover {
    background: #f0f4ff;
    color: var(--ex-navy);
    box-shadow: 0 6px 32px rgba(0,0,0,0.24);
    transform: translateY(-2px);
}

.ex-btn-dark {
    background: var(--ex-navy);
    color: #fff;
    font-family: 'Plus Jakarta Sans', system-ui, sans-serif;
    font-weight: 600;
    font-size: 0.9rem;
    padding: 0.8rem 1.5rem;
    border-radius: 10px;
    text-decoration: none;
    display: inline-flex;
    align-items: center;
    gap: 0.45rem;
    transition: background 0.18s, transform 0.15s;
    white-space: nowrap;
}

.ex-btn-dark:hover {
    background: #1a2040;
    color: #fff;
    transform: translateY(-1px);
}

/* --- Trust strip --- */
.ex-trust-strip {
    background: #fff;
    padding: 3rem 0;
    border-bottom: 1px solid var(--ex-border);
}

.ex-trust-label {
    font-family: 'Plus Jakarta Sans', system-ui, sans-serif;
    font-size: 0.75rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.1em;
    color: var(--ex-muted);
    text-align: center;
    margin-bottom: 1.5rem;
}

.ex-trust-logos {
    display: flex;
    justify-content: center;
    align-items: center;
    flex-wrap: wrap;
    gap: 0.75rem 1.25rem;
}

.ex-trust-tag {
    background: #F7F8FF;
    border: 1px solid var(--ex-border);
    border-radius: 8px;
    padding: 0.45rem 1.1rem;
    font-family: 'Plus Jakarta Sans', system-ui, sans-serif;
    font-size: 0.78rem;
    font-weight: 600;
    color: #5A6490;
    letter-spacing: 0.02em;
}

/* --- Stats cards --- */
.ex-stats {
    background: var(--ex-tint);
    padding: 5rem 0;
}

.ex-stat-card {
    background: #fff;
    border-radius: 20px;
    padding: 2.5rem 2rem;
    border: 1px solid var(--ex-border);
    height: 100%;
    text-align: center;
    transition: box-shadow 0.2s, transform 0.2s;
}

.ex-stat-card:hover {
    box-shadow: 0 16px 48px rgba(45, 91, 255, 0.12);
    transform: translateY(-5px);
}

.ex-stat-icon {
    width: 68px;
    height: 68px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.5rem;
    color: #fff;
    margin: 0 auto 1.5rem;
    transition: transform 0.22s;
}

.ex-stat-card:hover .ex-stat-icon {
    transform: scale(1.08);
}

.ex-stat-icon--green {
    background: linear-gradient(135deg, #22C76E 0%, #16A85B 100%);
    box-shadow: 0 8px 24px rgba(22, 168, 91, 0.28);
}

.ex-stat-icon--blue {
    background: linear-gradient(135deg, #4B8EFF 0%, #2D5BFF 100%);
    box-shadow: 0 8px 24px rgba(45, 91, 255, 0.28);
}

.ex-stat-icon--purple {
    background: linear-gradient(135deg, #9B6DFF 0%, #7C3AED 100%);
    box-shadow: 0 8px 24px rgba(124, 58, 237, 0.28);
}

.ex-stat-number {
    font-family: 'Plus Jakarta Sans', system-ui, sans-serif;
    font-size: 2.75rem;
    font-weight: 700;
    color: var(--ex-navy);
    line-height: 1;
    margin-bottom: 0.5rem;
    letter-spacing: -0.03em;
    display: block;
}

.ex-stat-desc {
    font-family: 'Plus Jakarta Sans', system-ui, sans-serif;
    font-size: 1.1rem;
    font-weight: 600;
    color: #3D4566;
    margin-bottom: 0.2rem;
}

.ex-stat-sub {
    font-family: 'Plus Jakarta Sans', system-ui, sans-serif;
    font-size: 0.9rem;
    font-weight: 400;
    color: #7A8599;
    line-height: 1.6;
}

/* --- Feature split --- */
.ex-feature-split {
    background: #fff;
    padding: 6rem 0;
}

.ex-checklist {
    display: flex;
    flex-wrap: wrap;
    gap: 0.6rem;
    margin-top: 1.75rem;
    margin-bottom: 2rem;
}

.ex-check-pill {
    display: inline-flex;
    align-items: center;
    gap: 0.4rem;
    background: var(--ex-tint);
    border: 1px solid var(--ex-border);
    border-radius: 999px;
    padding: 0.4rem 1rem 0.4rem 0.7rem;
    font-family: 'Plus Jakarta Sans', system-ui, sans-serif;
    font-size: 0.875rem;
    font-weight: 500;
    color: #3D4B63;
    transition: background 0.15s, border-color 0.15s;
}

.ex-check-pill:hover {
    background: #E4E7FF;
    border-color: #C5CCFF;
}

.ex-check-pill i {
    color: var(--ex-blue);
    font-size: 0.72rem;
}

.ex-feature-img-wrap {
    border-radius: 20px;
    overflow: hidden;
    box-shadow: 0 16px 48px rgba(10, 15, 44, 0.1);
}

.ex-feature-img-wrap img {
    width: 100%;
    display: block;
}

/* --- Audience cards --- */
.ex-audience {
    background: var(--ex-tint);
    padding: 6rem 0;
}

.ex-audience-card {
    background: #fff;
    border-radius: 20px;
    padding: 2.5rem 2rem;
    border: 1px solid var(--ex-border);
    height: 100%;
    text-align: center;
    transition: box-shadow 0.22s, transform 0.22s;
}

.ex-audience-card:hover {
    box-shadow: 0 16px 48px rgba(45, 91, 255, 0.13);
    transform: translateY(-5px);
}

/* Icon — large circle, colored per card via modifier classes */
.ex-aud-icon {
    width: 72px;
    height: 72px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.6rem;
    color: #fff;
    margin: 0 auto 1.5rem;
    transition: transform 0.22s;
}

.ex-audience-card:hover .ex-aud-icon {
    transform: scale(1.08);
}

/* Color variants */
.ex-aud-icon--orange {
    background: linear-gradient(135deg, #FF8C42 0%, #FF5F1F 100%);
    box-shadow: 0 8px 24px rgba(255, 95, 31, 0.28);
}

.ex-aud-icon--teal {
    background: linear-gradient(135deg, #0ECAD4 0%, #0BA8C2 100%);
    box-shadow: 0 8px 24px rgba(11, 168, 194, 0.28);
}

.ex-aud-icon--blue {
    background: linear-gradient(135deg, #4B8EFF 0%, #2D5BFF 100%);
    box-shadow: 0 8px 24px rgba(45, 91, 255, 0.28);
}

/* Exsit h3 = 30px / weight 500 */
.ex-aud-role {
    font-family: 'Plus Jakarta Sans', system-ui, sans-serif;
    font-size: 1.35rem;
    font-weight: 600;
    color: var(--ex-navy);
    margin-bottom: 0.75rem;
    line-height: 1.3;
}

/* Exsit p = 18px / weight 500 / dark */
.ex-aud-desc {
    font-family: 'Plus Jakarta Sans', system-ui, sans-serif;
    font-size: 1rem;
    font-weight: 400;
    line-height: 1.7;
    color: #5A6478;
    margin-bottom: 0;
}

/* --- Blog cards --- */
.ex-blog-section {
    background: #fff;
    padding: 6rem 0;
    border-top: 1px solid var(--ex-border);
}

.ex-blog-card {
    border-radius: 16px;
    overflow: hidden;
    background: #fff;
    border: 1px solid #E8ECF4;
    height: 100%;
    display: flex;
    flex-direction: column;
    transition: box-shadow 0.2s, transform 0.2s;
    text-decoration: none;
    color: inherit;
    box-shadow: 0 2px 12px rgba(26, 31, 54, 0.06);
}

.ex-blog-card:hover {
    box-shadow: 0 16px 48px rgba(45, 91, 255, 0.12);
    transform: translateY(-5px);
    color: inherit;
    text-decoration: none;
}

.ex-blog-img {
    aspect-ratio: 4/3;
    overflow: hidden;
    background: #EEF1FF;
    flex-shrink: 0;
}

.ex-blog-img img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.4s;
}

.ex-blog-card:hover .ex-blog-img img { transform: scale(1.04); }

.ex-blog-placeholder {
    width: 100%;
    height: 100%;
    background: linear-gradient(135deg, #C7D2FE 0%, #A5B4FC 50%, #818CF8 100%);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 2.5rem;
    color: rgba(255,255,255,0.7);
}

.ex-blog-body {
    padding: 1.25rem 1.5rem 1.5rem;
    display: flex;
    flex-direction: column;
    flex: 1;
}

.ex-blog-meta {
    display: flex;
    align-items: center;
    gap: 0.4rem;
    font-family: 'Plus Jakarta Sans', system-ui, sans-serif;
    font-size: 0.72rem;
    color: var(--ex-muted);
    margin-bottom: 0.75rem;
}

.ex-blog-cat-tag {
    background: linear-gradient(135deg, var(--ex-blue) 0%, #7C3AED 100%);
    color: #fff;
    font-family: 'Plus Jakarta Sans', system-ui, sans-serif;
    font-size: 0.72rem;
    font-weight: 600;
    padding: 0.3rem 0.85rem;
    border-radius: 999px;
    text-decoration: none;
    letter-spacing: 0.01em;
}

.ex-blog-title {
    font-family: 'Plus Jakarta Sans', system-ui, sans-serif;
    font-size: 1.05rem;
    font-weight: 700;
    color: var(--ex-navy);
    line-height: 1.45;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
    margin-bottom: 0.6rem;
    flex: 1;
}

.ex-blog-excerpt {
    font-family: 'Plus Jakarta Sans', system-ui, sans-serif;
    font-size: 0.875rem;
    color: var(--ex-body);
    line-height: 1.65;
    display: -webkit-box;
    -webkit-line-clamp: 3;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.ex-blog-author-row {
    display: flex;
    align-items: center;
    gap: 0.55rem;
    margin-top: 1rem;
    padding-top: 1rem;
    border-top: 1px solid var(--ex-tint);
}

.ex-blog-avatar {
    width: 28px;
    height: 28px;
    border-radius: 50%;
    background: var(--ex-blue);
    display: flex;
    align-items: center;
    justify-content: center;
    font-family: 'Plus Jakarta Sans', system-ui, sans-serif;
    font-size: 0.6rem;
    font-weight: 800;
    color: #fff;
    flex-shrink: 0;
}

.ex-blog-author-name {
    font-family: 'Plus Jakarta Sans', system-ui, sans-serif;
    font-size: 0.78rem;
    font-weight: 600;
    color: var(--ex-body);
}

/* --- "View all" link --- */
.ex-viewall {
    font-family: 'Plus Jakarta Sans', system-ui, sans-serif;
    font-size: 0.875rem;
    font-weight: 600;
    color: var(--ex-blue);
    text-decoration: none;
    display: inline-flex;
    align-items: center;
    gap: 0.35rem;
    transition: gap 0.2s;
}

.ex-viewall:hover {
    color: var(--ex-blue-dk);
    gap: 0.55rem;
}

/* --- Release notes dark strip --- */
.ex-releases {
    background: var(--ex-navy);
    padding: 4.5rem 0;
}

.ex-release-card {
    display: flex;
    align-items: flex-start;
    gap: 1rem;
    padding: 1.25rem 1.5rem;
    border-radius: 12px;
    border: 1px solid rgba(255, 255, 255, 0.07);
    background: rgba(255, 255, 255, 0.03);
    text-decoration: none;
    transition: background 0.2s, border-color 0.2s;
    height: 100%;
}

.ex-release-card:hover {
    background: rgba(45, 91, 255, 0.08);
    border-color: rgba(45, 91, 255, 0.3);
}

.ex-release-version {
    font-family: 'Plus Jakarta Sans', system-ui, sans-serif;
    font-size: 0.68rem;
    font-weight: 700;
    padding: 0.2rem 0.6rem;
    border-radius: 4px;
    background: rgba(45, 91, 255, 0.15);
    color: #8AABFF;
    white-space: nowrap;
    flex-shrink: 0;
    border: 1px solid rgba(45, 91, 255, 0.2);
    letter-spacing: 0.03em;
}

.ex-release-title {
    font-family: 'Plus Jakarta Sans', system-ui, sans-serif;
    font-size: 0.875rem;
    font-weight: 500;
    color: #A8C0E0;
    line-height: 1.45;
    margin-bottom: 0.25rem;
}

.ex-release-date {
    font-family: 'Plus Jakarta Sans', system-ui, sans-serif;
    font-size: 0.7rem;
    color: #3A4E65;
}

/* --- CTA banner --- */
.ex-cta-section {
    background: var(--ex-navy);
    padding: 7rem 0;
    text-align: center;
    position: relative;
    overflow: hidden;
}

.ex-cta-section::before {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: 800px;
    height: 400px;
    background: radial-gradient(ellipse, rgba(45, 91, 255, 0.18) 0%, transparent 65%);
    pointer-events: none;
}

.ex-cta-title {
    font-family: 'Plus Jakarta Sans', system-ui, sans-serif;
    font-size: clamp(1.75rem, 4vw, 3rem);
    font-weight: 800;
    color: #fff;
    letter-spacing: -0.025em;
    margin-bottom: 1rem;
    position: relative;
}

.ex-cta-sub {
    font-family: 'Plus Jakarta Sans', system-ui, sans-serif;
    font-size: 1rem;
    color: #5A6BA0;
    max-width: 480px;
    margin: 0 auto 2.5rem;
    line-height: 1.75;
    position: relative;
}

/* --- Responsive --- */
@media (max-width: 991px) {
    .ex-hero { padding: 4rem 0 0; }
    .ex-feature-split, .ex-audience, .ex-blog-section { padding: 4rem 0; }
    .ex-cta-section { padding: 4.5rem 0; }
}

@media (max-width: 767px) {
    .ex-float-card  { display: none; }
    .ex-hero-pills  { display: none; }
    .ex-stats       { padding: 3rem 0; }
}

/* ============================================
   22. INNER PUBLIC PAGES (features, how-it-works, about, blog)
   ============================================ */

/* Centred page hero (inner pages) */
.ex-page-hero {
    background: var(--ex-tint);
    padding: 5rem 0 4rem;
    text-align: center;
    position: relative;
    overflow: hidden;
}

/* Image background hero variant */
.ex-page-hero--img {
    background-size: cover;
    background-position: center;
    background-repeat: no-repeat;
}

/* How It Works page hero background */
.ex-page-hero--hiw {
    background-image: url('/static/images/HomePageHeroImage-MMT.png');
}

.ex-page-hero--img::after {
    content: '';
    position: absolute;
    inset: 0;
    background: linear-gradient(
        135deg,
        rgba(240, 242, 255, 0.93) 0%,
        rgba(224, 231, 255, 0.88) 50%,
        rgba(200, 215, 255, 0.82) 100%
    );
    z-index: 0;
}

.ex-page-hero--img .container {
    position: relative;
    z-index: 1;
}

.ex-page-hero::before {
    content: '';
    position: absolute;
    top: -80px; right: -80px;
    width: 320px; height: 320px;
    border-radius: 50%;
    background: radial-gradient(circle, rgba(45,91,255,.10) 0%, transparent 70%);
    pointer-events: none;
}

/* Deep gradient hero variant — used on Features page */
.ex-page-hero--deep {
    background: linear-gradient(150deg, #1e3a8a 0%, #2D5BFF 55%, #6366f1 100%);
    padding: 6rem 0 5rem;
}
.ex-page-hero--deep .ex-section-tag { color: rgba(255,255,255,0.70); }
.ex-page-hero--deep h1,
.ex-page-hero--deep .ex-heading-lg { color: #ffffff; }
.ex-page-hero--deep .ex-page-hero-sub { color: rgba(255,255,255,0.82); }
.ex-page-hero--deep::before {
    background: radial-gradient(circle, rgba(255,255,255,.12) 0%, transparent 70%);
    top: -60px; right: -60px;
    width: 400px; height: 400px;
}

.ex-page-hero-sub {
    font-size: 1.1rem;
    color: var(--ex-body);
    max-width: 600px;
    margin: 0 auto;
    line-height: 1.75;
}

/* Section divider */
.ex-section-divider {
    border: none;
    border-top: 1px solid var(--ex-border);
    margin: 0;
}

/* White section */
.ex-section-white {
    background: #fff;
    padding: 5rem 0;
}

/* Tint section */
.ex-section-tint {
    background: var(--ex-tint);
    padding: 5rem 0;
}

/* Dark section (same as ex-releases) */
.ex-section-dark {
    background: var(--ex-navy);
    padding: 5rem 0;
}

/* Feature card */
.ex-feature-card {
    background: #fff;
    border: 1px solid var(--ex-border);
    border-radius: 16px;
    padding: 2rem;
    height: 100%;
    transition: border-color .2s, box-shadow .2s, transform .2s;
}

.ex-feature-card:hover {
    border-color: var(--ex-blue);
    box-shadow: 0 6px 24px rgba(45,91,255,.10);
    transform: translateY(-3px);
}

.ex-feature-icon {
    width: 52px; height: 52px;
    border-radius: 14px;
    display: flex; align-items: center; justify-content: center;
    font-size: 1.35rem;
    margin-bottom: 1.1rem;
    transition: transform .2s;
}

.ex-feature-card:hover .ex-feature-icon { transform: scale(1.1); }

.ex-feature-icon--indigo { background: #EEF2FF; color: #4F46E5; }
.ex-feature-icon--blue   { background: #EFF6FF; color: #2563EB; }
.ex-feature-icon--green  { background: #ECFDF5; color: #059669; }
.ex-feature-icon--amber  { background: #FFFBEB; color: #D97706; }
.ex-feature-icon--rose   { background: #FFF1F2; color: #E11D48; }
.ex-feature-icon--teal   { background: #F0FDFA; color: #0D9488; }
.ex-feature-icon--purple { background: #FAF5FF; color: #7C3AED; }
.ex-feature-icon--cyan   { background: #ECFEFF; color: #0891B2; }

.ex-feature-name {
    font-size: 1rem;
    font-weight: 700;
    color: var(--ex-navy);
    margin-bottom: .5rem;
}

.ex-feature-desc {
    font-size: .875rem;
    color: var(--ex-body);
    line-height: 1.7;
    margin: 0;
}

/* How-It-Works step grid */
.ex-step-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 1.25rem;
    position: relative;
}

/* Connector line between cards in the same row */
.ex-step-card {
    background: #fff;
    border: 1.5px solid var(--ex-border);
    border-radius: 18px;
    padding: 1.75rem 1.5rem 1.5rem;
    position: relative;
    transition: border-color .2s, box-shadow .2s, transform .2s;
}

.ex-step-card:hover {
    border-color: var(--ex-blue);
    box-shadow: 0 8px 32px rgba(45, 91, 255, .12);
    transform: translateY(-3px);
}

/* Connector arrow between cards in a row */
.ex-step-card:not(:nth-child(3n))::after {
    content: '';
    position: absolute;
    top: 50%;
    right: -1.15rem;
    transform: translateY(-50%);
    width: 1.05rem;
    height: 2px;
    background: linear-gradient(90deg, var(--ex-border), var(--ex-blue));
    z-index: 1;
}

/* Arrow head */
.ex-step-card:not(:nth-child(3n))::before {
    content: '';
    position: absolute;
    top: 50%;
    right: -1.35rem;
    transform: translateY(-50%);
    border-top: 5px solid transparent;
    border-bottom: 5px solid transparent;
    border-left: 6px solid var(--ex-blue);
    z-index: 2;
}

.ex-step-badge {
    width: 36px; height: 36px;
    border-radius: 50%;
    background: var(--ex-blue);
    color: #fff;
    font-size: .8rem;
    font-weight: 800;
    display: flex; align-items: center; justify-content: center;
    margin-bottom: 1rem;
    font-family: 'Plus Jakarta Sans', system-ui, sans-serif;
    box-shadow: 0 4px 12px rgba(45, 91, 255, .3);
    flex-shrink: 0;
}

.ex-step-title {
    font-size: 1.35rem;
    font-weight: 600;
    color: var(--ex-navy);
    margin-bottom: .75rem;
    line-height: 1.3;
}

.ex-step-desc {
    font-size: 1rem;
    color: #5A6478;
    line-height: 1.7;
    margin: 0;
}

@media (max-width: 991px) {
    .ex-step-grid { grid-template-columns: repeat(2, 1fr); }
    .ex-step-card:not(:nth-child(3n))::after,
    .ex-step-card:not(:nth-child(3n))::before { display: none; }
    .ex-step-card:not(:nth-child(2n))::after {
        content: '';
        position: absolute;
        top: 50%; right: -1.15rem;
        transform: translateY(-50%);
        width: 1.05rem; height: 2px;
        background: linear-gradient(90deg, var(--ex-border), var(--ex-blue));
        display: block;
    }
    .ex-step-card:not(:nth-child(2n))::before {
        content: '';
        position: absolute;
        top: 50%; right: -1.35rem;
        transform: translateY(-50%);
        border-top: 5px solid transparent;
        border-bottom: 5px solid transparent;
        border-left: 6px solid var(--ex-blue);
        display: block;
    }
}

@media (max-width: 575px) {
    .ex-step-grid { grid-template-columns: 1fr; }
    .ex-step-card::after,
    .ex-step-card::before { display: none !important; }
}

/* Callout box */
.ex-callout {
    background: linear-gradient(135deg, var(--ex-navy) 0%, #1a2a6c 100%);
    border-radius: 20px;
    padding: 3rem 2.5rem;
    color: #fff;
    text-align: center;
    margin: 3rem 0;
}

.ex-callout h3 {
    font-size: 1.6rem;
    font-weight: 800;
    color: #fff;
    margin-bottom: .75rem;
    letter-spacing: -.02em;
}

.ex-callout p {
    color: rgba(255,255,255,.7);
    margin: 0;
    font-size: 1rem;
}

/* FAQ accordion */
.ex-faq .accordion-item {
    border: 1px solid var(--ex-border);
    border-radius: 12px !important;
    margin-bottom: .75rem;
    overflow: hidden;
}

.ex-faq .accordion-button {
    font-weight: 600;
    font-size: .95rem;
    color: var(--ex-navy);
    background: #fff;
    border-radius: 12px !important;
    box-shadow: none !important;
}

.ex-faq .accordion-button:not(.collapsed) {
    color: var(--ex-blue);
    background: var(--ex-tint);
}

.ex-faq .accordion-button::after {
    filter: none;
}

.ex-faq .accordion-body {
    font-size: .9rem;
    color: var(--ex-body);
    line-height: 1.75;
    background: #fff;
}

/* About mission block */
.ex-mission-block {
    background: linear-gradient(135deg, var(--ex-navy) 0%, #1a2a6c 100%);
    border-radius: 20px;
    padding: 2.5rem;
}

/* Blog list pill tabs */
.ex-pill-tabs {
    display: flex;
    flex-wrap: wrap;
    gap: .5rem;
    margin-bottom: 2.5rem;
}

.ex-pill-tab {
    padding: .45rem 1.1rem;
    border-radius: 999px;
    font-size: .875rem;
    font-weight: 500;
    color: var(--ex-body);
    background: #fff;
    border: 1px solid var(--ex-border);
    text-decoration: none;
    transition: background .15s, color .15s, border-color .15s;
}

.ex-pill-tab:hover {
    background: var(--ex-tint);
    color: var(--ex-blue);
    border-color: var(--ex-blue);
}

.ex-pill-tab.active {
    background: var(--ex-blue);
    color: #fff;
    border-color: var(--ex-blue);
}

/* Mission block list text */
.ex-mission-block li span { color: #cbd5e1; }

/* Empty state heading */
.ex-empty-heading { color: var(--ex-navy); font-weight: 700; }

/* Audience card purple variant */
.ex-aud-icon--purple {
    background: linear-gradient(135deg, #A78BFA 0%, #7C3AED 100%);
    box-shadow: 0 8px 24px rgba(124, 58, 237, 0.28);
}

.ex-aud-icon--green {
    background: linear-gradient(135deg, #34D399 0%, #059669 100%);
    box-shadow: 0 8px 24px rgba(5, 150, 105, 0.28);
}

.ex-aud-icon--rose {
    background: linear-gradient(135deg, #FB7185 0%, #E11D48 100%);
    box-shadow: 0 8px 24px rgba(225, 29, 72, 0.28);
}

.ex-aud-icon--amber {
    background: linear-gradient(135deg, #FCD34D 0%, #D97706 100%);
    box-shadow: 0 8px 24px rgba(217, 119, 6, 0.28);
}

.ex-aud-icon--cyan {
    background: linear-gradient(135deg, #22D3EE 0%, #0891B2 100%);
    box-shadow: 0 8px 24px rgba(8, 145, 178, 0.28);
}

.ex-aud-icon--indigo {
    background: linear-gradient(135deg, #818CF8 0%, #4F46E5 100%);
    box-shadow: 0 8px 24px rgba(79, 70, 229, 0.28);
}

/* Large icon variant (empty states) */
.ex-feature-icon--lg { width: 64px; height: 64px; font-size: 1.75rem; }

/* Release version badge on light background */
.ex-release-version--light {
    background: #EEF2FF;
    color: #4F46E5;
    border-color: #C7D2FE;
}

/* Mission block headings */
.ex-mission-block h4 { color: #fff; }

/* Inner page responsive */
@media (max-width: 767px) {
    .ex-page-hero { padding: 3.5rem 0 3rem; }
    .ex-section-white, .ex-section-tint, .ex-section-dark { padding: 3.5rem 0; }
    .ex-callout { padding: 2rem 1.5rem; }
}

/* ============================================
   23. LOGIN PAGE
   ============================================ */

.ex-login-card {
    background: #fff;
    border: 1px solid var(--ex-border);
    border-radius: 20px;
    padding: 2.5rem;
    box-shadow: 0 4px 24px rgba(45, 91, 255, .07);
    color-scheme: light;
}
.ex-login-card .form-control {
    background-color: #fff;
    color: #212529;
}

.ex-login-label {
    font-size: 1rem;
    font-weight: 600;
    color: var(--ex-navy);
    display: block;
    margin-bottom: .4rem;
}

.ex-login-input {
    border: 1.5px solid #B8C0D8;
    border-radius: 10px;
    padding: .65rem 1rem;
    font-size: 1rem;
    color: var(--ex-navy);
    transition: border-color .15s, box-shadow .15s;
}

.ex-login-input:focus {
    border-color: var(--ex-blue);
    box-shadow: 0 0 0 3px rgba(45, 91, 255, .12);
    outline: none;
}

.ex-login-toggle {
    border: 1.5px solid #B8C0D8;
    border-left: none;
    border-radius: 0 10px 10px 0;
    background: #fff;
    padding: 0 .85rem;
    color: var(--ex-muted);
    cursor: pointer;
    transition: color .15s;
}

.ex-login-toggle:hover { color: var(--ex-blue); }

.ex-login-forgot {
    font-size: 1rem;
    color: var(--ex-blue);
    text-decoration: none;
    transition: color .15s;
}

.ex-login-forgot:hover { color: var(--ex-blue-dk); text-decoration: underline; }

.ex-login-error {
    background: #FFF1F2;
    border: 1px solid #FECDD3;
    color: #BE123C;
    border-radius: 10px;
    padding: .75rem 1rem;
    font-size: 1rem;
    margin-bottom: 1.25rem;
}

.ex-login-divider {
    border-color: var(--ex-border);
    margin: 1.5rem 0;
}

.ex-login-or-divider {
    display: flex;
    align-items: center;
    gap: .75rem;
    margin: 1.5rem 0 1.25rem;
    color: var(--ex-muted);
    font-size: .85rem;
}
.ex-login-or-divider::before,
.ex-login-or-divider::after {
    content: '';
    flex: 1;
    height: 1px;
    background: var(--ex-border);
}

.ex-login-providers {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: .75rem;
}

.ex-login-provider-btn {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: .5rem;
    padding: .6rem 1rem;
    border: 1.5px solid #B8C0D8;
    border-radius: 10px;
    background: #fff;
    color: var(--ex-navy);
    font-size: .95rem;
    font-weight: 500;
    text-decoration: none;
    transition: border-color .15s, box-shadow .15s, background .15s;
    white-space: nowrap;
}
.ex-login-provider-btn:hover {
    border-color: var(--ex-blue);
    box-shadow: 0 0 0 3px rgba(45, 91, 255, .10);
    color: var(--ex-navy);
    background: #F5F7FF;
    text-decoration: none;
}

/* Code entry input (verify-code page) */
.ex-code-input {
    letter-spacing: 0.5em;
    font-size: 1.6rem !important;
    font-weight: 700;
    text-align: center;
    padding: .75rem 1rem !important;
    color: var(--ex-navy);
}

.ex-login-info {
    background: #EFF6FF;
    border: 1px solid #BFDBFE;
    color: #1D4ED8;
    border-radius: 10px;
    padding: .75rem 1rem;
    font-size: 1rem;
}

.ex-login-section {
    min-height: calc(100vh - 72px);
    display: flex;
    align-items: flex-start;
    padding-top: 8vh;
}

/* FAQ detail body (rich text from Summernote) */
.ex-faq-body {
    font-size: 1.05rem;
    line-height: 1.8;
    color: var(--ex-body);
}

.ex-faq-body h2, .ex-faq-body h3, .ex-faq-body h4 {
    color: var(--ex-navy);
    font-weight: 700;
    margin-top: 2rem;
    margin-bottom: .75rem;
}

.ex-faq-body p { margin-bottom: 1rem; }

.ex-faq-body ul, .ex-faq-body ol {
    padding-left: 1.5rem;
    margin-bottom: 1rem;
}

.ex-faq-body li { margin-bottom: .4rem; }

.ex-faq-body blockquote {
    border-left: 4px solid var(--ex-blue);
    padding-left: 1rem;
    color: var(--ex-muted);
    font-style: italic;
    margin: 1.5rem 0;
}

.ex-faq-body img {
    max-width: 100%;
    height: auto;
    border-radius: 12px;
    margin: 1rem 0;
}

.ex-faq-body pre {
    background: var(--ex-tint);
    border: 1px solid var(--ex-border);
    border-radius: 10px;
    padding: 1rem;
    overflow-x: auto;
    font-size: .875rem;
}


/* Contact page email icon (smaller variant of ex-aud-icon) */
.ex-contact-icon { width: 44px; height: 44px; font-size: 1.1rem; flex-shrink: 0; }

/* Registration form sections */
.ex-reg-section-title {
    font-size: 1rem;
    font-weight: 700;
    color: var(--ex-navy);
    margin-bottom: 1.25rem;
}
.ex-required-star { color: #dc3545; }
.ex-login-input.form-control { border-color: #B8C0D8; } .ex-login-input.form-control:focus { border-color: var(--ex-blue); box-shadow: 0 0 0 3px rgba(45,91,255,.12); }

/* ============================================
   25. APP SITE — LOGGED-IN CONTENT STYLES
   Applies Plus Jakarta Sans + the public-site colour tokens
   to all authenticated pages. Scoped to body.app-site so
   the public site and home page are unaffected.
   ============================================ */

/* ---- Base: font, colour, background ---- */
body.app-site {
    font-family: 'Plus Jakarta Sans', system-ui, sans-serif;
    background-color: #F5F7FA;
    color: #3D4B63;
    color-scheme: light;
}

body.app-site .main-wrapper {
    background-color: #F5F7FA;
}

/* ---- Headings ---- */
body.app-site h1, body.app-site h2, body.app-site h3,
body.app-site h4, body.app-site h5, body.app-site h6,
body.app-site .h1, body.app-site .h2, body.app-site .h3,
body.app-site .h4, body.app-site .h5, body.app-site .h6 {
    font-family: 'Plus Jakarta Sans', system-ui, sans-serif;
    font-weight: 600;
    color: #0D1221;
    line-height: 1.3;
}

body.app-site h1 { font-size: clamp(1.5rem, 2.5vw, 2rem); letter-spacing: -0.02em; }
body.app-site h2 { font-size: clamp(1.25rem, 2vw, 1.6rem); letter-spacing: -0.015em; }
body.app-site h3 { font-size: 1.2rem; }
body.app-site h4 { font-size: 1.0625rem; }
body.app-site h5 { font-size: 0.9375rem; }
body.app-site h6 { font-size: 0.875rem; }

/* ---- Cards ---- */
body.app-site .card {
    border: 1px solid #E4E7FF;
    border-radius: 0.75rem;
    box-shadow: 0 1px 6px rgba(13, 18, 33, 0.04);
    background: #ffffff;
}

body.app-site .card-header {
    background-color: #F0F2FF;
    border-bottom: 1px solid #E4E7FF;
    font-family: 'Plus Jakarta Sans', system-ui, sans-serif;
    font-weight: 600;
    font-size: 0.9375rem;
    color: #0D1221;
    padding: 0.875rem 1.25rem;
    border-radius: 0.75rem 0.75rem 0 0 !important;
}

body.app-site .card-body { padding: 1.25rem; color: #3D4B63; }

body.app-site dt { color: #6B7A99; font-weight: 600; }
body.app-site dd { color: #0D1221; }

body.app-site .card-title {
    font-weight: 600;
    color: #0D1221;
}

body.app-site .card-subtitle {
    color: #8B93B5;
    font-size: 0.875rem;
}

body.app-site .card-footer {
    background-color: #FAFBFF;
    border-top: 1px solid #E4E7FF;
    border-radius: 0 0 0.75rem 0.75rem !important;
}

/* ---- Tables ---- */
body.app-site .table {
    color: #3D4B63;
    font-size: 0.9rem;
}

body.app-site .table thead th,
body.app-site .table thead td {
    background-color: #F0F2FF;
    color: #0D1221;
    font-family: 'Plus Jakarta Sans', system-ui, sans-serif;
    font-weight: 700;
    font-size: 0.72rem;
    text-transform: uppercase;
    letter-spacing: 0.07em;
    border-bottom: 2px solid #D8DCFF;
    padding: 0.75rem 0.875rem;
    white-space: nowrap;
}

body.app-site .table tbody td {
    vertical-align: middle;
    padding: 0.6875rem 0.875rem;
    border-color: #F0F2FF;
}

body.app-site .table tbody tr { border-color: #F0F2FF; }

body.app-site .table-bordered,
body.app-site .table-bordered th,
body.app-site .table-bordered td { border-color: #E4E7FF; }

body.app-site .table-hover tbody tr:hover { background-color: rgba(45, 91, 255, 0.03); }
body.app-site .table-hover tbody tr:hover td { color: #0D1221; }

body.app-site .table-striped > tbody > tr:nth-of-type(odd) > td {
    background-color: rgba(240, 242, 255, 0.5);
}

/* ---- Form labels ---- */
body.app-site .form-label {
    font-family: 'Plus Jakarta Sans', system-ui, sans-serif;
    font-weight: 600;
    font-size: 0.8125rem;
    color: #0D1221;
    letter-spacing: 0.01em;
    margin-bottom: 0.375rem;
}

/* ---- Form controls ---- */
body.app-site .form-control,
body.app-site .form-select {
    font-family: 'Plus Jakarta Sans', system-ui, sans-serif;
    font-size: 0.9375rem;
    border-color: #D1D9EE;
    background-color: #fff;
    color: #3D4B63;
    border-radius: 0.5rem;
}

body.app-site .form-control:focus,
body.app-site .form-select:focus {
    border-color: #2D5BFF;
    box-shadow: 0 0 0 3px rgba(45, 91, 255, 0.12);
    color: #0D1221;
}

body.app-site .form-control::placeholder { color: #8B93B5; font-weight: 400; }
body.app-site .form-text { color: #8B93B5; font-size: 0.8rem; }

body.app-site .input-group-text {
    background-color: #F0F2FF;
    border-color: #D1D9EE;
    color: #8B93B5;
    font-size: 0.875rem;
    border-radius: 0.5rem;
}

/* ---- Buttons ---- */
body.app-site .btn {
    font-family: 'Plus Jakarta Sans', system-ui, sans-serif;
    font-weight: 600;
    border-radius: 0.5rem;
    letter-spacing: 0.01em;
}

body.app-site .btn-primary {
    background-color: #2D5BFF;
    border-color: #2D5BFF;
}

body.app-site .btn-primary:hover,
body.app-site .btn-primary:focus {
    background-color: #1d47e8;
    border-color: #1d47e8;
}

body.app-site .btn-outline-primary {
    color: #2D5BFF;
    border-color: #2D5BFF;
}

body.app-site .btn-outline-primary:hover {
    background-color: #2D5BFF;
    border-color: #2D5BFF;
}

/* ---- Utility colours ---- */
body.app-site .text-muted { color: #8B93B5 !important; }

body.app-site small,
body.app-site .small {
    font-family: 'Plus Jakarta Sans', system-ui, sans-serif;
    font-size: 0.8125rem;
}

/* ---- Badges ---- */
body.app-site .badge {
    font-family: 'Plus Jakarta Sans', system-ui, sans-serif;
    font-weight: 600;
    font-size: 0.7rem;
    letter-spacing: 0.02em;
    border-radius: 0.375rem;
    padding: 0.3em 0.6em;
}

/* ---- Alerts ---- */
body.app-site .alert {
    font-family: 'Plus Jakarta Sans', system-ui, sans-serif;
    border-radius: 0.625rem;
    font-size: 0.9rem;
    border: none;
    padding: 0.875rem 1.125rem;
}

body.app-site .alert-primary  { background-color: rgba(45, 91, 255, 0.08);  color: #1d47e8; }
body.app-site .alert-success  { background-color: rgba(25, 135, 84, 0.09);  color: #0f7048; }
body.app-site .alert-warning  { background-color: rgba(255, 193, 7, 0.12);  color: #8a6400; }
body.app-site .alert-danger   { background-color: rgba(220, 53, 69, 0.08);  color: #b02a37; }
body.app-site .alert-info     { background-color: rgba(13, 202, 240, 0.09); color: #0a7fa8; }

/* ---- Nav tabs ---- */
body.app-site .nav-tabs { border-bottom-color: #E4E7FF; }

body.app-site .nav-tabs .nav-link {
    font-family: 'Plus Jakarta Sans', system-ui, sans-serif;
    font-weight: 500;
    font-size: 0.875rem;
    color: #8B93B5;
    border-radius: 0.375rem 0.375rem 0 0;
}

body.app-site .nav-tabs .nav-link.active {
    color: #2D5BFF;
    font-weight: 600;
    border-bottom-color: #fff;
}

/* Mobile tab dropdown — replaces the tab strip on small screens.
   No bottom border so it connects flush with the card below (which has border-top-0). */
body.app-site .org-tab-select {
    border-color: #E4E7FF;
    border-bottom: none;
    border-radius: 0.375rem 0.375rem 0 0;
    font-family: 'Plus Jakarta Sans', system-ui, sans-serif;
    font-weight: 600;
    font-size: 0.875rem;
    color: #2D5BFF;
    background-color: #fff;
    box-shadow: none;
}

/* ---- Modals ---- */
body.app-site .modal-content {
    border-radius: 0.875rem;
    border: 1px solid #E4E7FF;
    box-shadow: 0 20px 60px rgba(13, 18, 33, 0.15);
}

body.app-site .modal-header {
    background-color: #F0F2FF;
    border-bottom: 1px solid #E4E7FF;
    border-radius: 0.875rem 0.875rem 0 0;
    padding: 1rem 1.25rem;
}

body.app-site .modal-title {
    font-family: 'Plus Jakarta Sans', system-ui, sans-serif;
    font-weight: 600;
    font-size: 1rem;
    color: #0D1221;
}

body.app-site .modal-footer { border-top: 1px solid #E4E7FF; }

/* ---- Dropdown menus (outside sidebar) ---- */
body.app-site .main-wrapper .dropdown-menu {
    font-family: 'Plus Jakarta Sans', system-ui, sans-serif;
    border: 1px solid #E4E7FF;
    border-radius: 0.625rem;
    box-shadow: 0 8px 24px rgba(13, 18, 33, 0.1);
    padding: 0.375rem;
}

body.app-site .main-wrapper .dropdown-item {
    font-size: 0.875rem;
    color: #3D4B63;
    border-radius: 0.375rem;
    padding: 0.5rem 0.875rem;
    font-weight: 500;
}

body.app-site .main-wrapper .dropdown-item:hover,
body.app-site .main-wrapper .dropdown-item:focus {
    background-color: #F0F2FF;
    color: #0D1221;
}

/* ---- Pagination ---- */
body.app-site .pagination .page-link {
    font-family: 'Plus Jakarta Sans', system-ui, sans-serif;
    font-size: 0.875rem;
    color: #2D5BFF;
    border-color: #E4E7FF;
    border-radius: 0.375rem;
}

body.app-site .pagination .page-item.active .page-link {
    background-color: #2D5BFF;
    border-color: #2D5BFF;
}

body.app-site .pagination .page-link:hover {
    background-color: #F0F2FF;
    color: #1d47e8;
    border-color: #D8DCFF;
}

/* ---- Breadcrumbs ---- */
body.app-site .breadcrumb {
    font-family: 'Plus Jakarta Sans', system-ui, sans-serif;
    font-size: 0.8125rem;
}

body.app-site .breadcrumb-item a { color: #2D5BFF; }
body.app-site .breadcrumb-item.active { color: #8B93B5; }
body.app-site .breadcrumb-item + .breadcrumb-item::before { color: #C0C7E0; }

/* ---- Links (content area only) ---- */
body.app-site .main-wrapper a:not(.btn):not(.nav-link):not(.dropdown-item):not(.sidebar-link):not(.navbar-brand):not([class*="ex-"]):not([class*="badge"]) {
    color: #2D5BFF;
}

body.app-site .main-wrapper a:not(.btn):not(.nav-link):not(.dropdown-item):not(.sidebar-link):not(.navbar-brand):not([class*="ex-"]):not([class*="badge"]):hover {
    color: #1d47e8;
}

/* ---- Footer ---- */
body.app-site footer.footer {
    background-color: #ffffff !important;
    border-top: 1px solid #E4E7FF !important;
    font-family: 'Plus Jakarta Sans', system-ui, sans-serif;
    font-size: 0.75rem;
    color: #8B93B5;
}

body.app-site footer.footer a { color: #8B93B5; }
body.app-site footer.footer a:hover { color: #2D5BFF; }

/* ── Help Centre page ─────────────────────────────────────────────────────── */

/* Hero banner — bleeds to full width of the content container */
.help-hero {
    background: linear-gradient(135deg, #0f1f3d 0%, #1a3670 55%, #2D5BFF 100%);
    color: #fff;
    padding: 3.5rem 2rem 3rem;
    margin: -1.5rem -0.75rem 2.5rem;
    text-align: center;
}
body.app-site .help-hero h1,
body.app-site .help-hero h2,
body.app-site .help-hero h3,
body.app-site .help-hero h4,
body.app-site .help-hero h5,
body.app-site .help-hero h6 {
    color: #fff;
}
.help-hero-title {
    font-size: 2rem;
    font-weight: 800;
    letter-spacing: -0.025em;
    margin-bottom: 0.6rem;
}
.help-hero-subtitle {
    font-size: 1.05rem;
    opacity: 0.82;
    margin-bottom: 1.75rem;
}
.help-search-wrap {
    max-width: 520px;
    margin: 0 auto;
}
.help-search-wrap .form-control {
    border: none;
    border-radius: 0.625rem 0 0 0.625rem;
    padding: 0.75rem 1rem;
    font-size: 1rem;
}
.help-search-wrap .btn-search {
    border-radius: 0 0.625rem 0.625rem 0;
    padding-left: 1.25rem;
    padding-right: 1.25rem;
    background: #fff;
    color: #2D5BFF;
    border: none;
    font-size: 1rem;
}
.help-search-wrap .btn-search:hover {
    background: #f0f2ff;
}

/* Category cards */
.help-cat-card {
    border: 1.5px solid var(--ex-border, #E4E7FF) !important;
    border-radius: 1rem !important;
    text-decoration: none;
    color: inherit;
    display: flex;
    flex-direction: column;
    transition: box-shadow 0.2s ease, border-color 0.2s ease, transform 0.2s ease;
    background: #fff;
}
.help-cat-card:hover {
    transform: translateY(-3px);
    box-shadow: 0 8px 28px rgba(45, 91, 255, 0.12);
    border-color: #2D5BFF !important;
    color: inherit;
    text-decoration: none;
}
.help-cat-icon {
    width: 64px;
    height: 64px;
    border-radius: 0.875rem;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.75rem;
    margin-bottom: 1.1rem;
    flex-shrink: 0;
}
.help-cat-title {
    font-size: 1.05rem;
    font-weight: 700;
    color: #0D1221;
    margin-bottom: 0.4rem;
}
.help-cat-desc {
    font-size: 0.875rem;
    color: #6B7280;
    line-height: 1.6;
    margin-bottom: 0;
    flex: 1;
}
.help-cat-footer {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding-top: 0.9rem;
    margin-top: 1rem;
    border-top: 1px solid #F0F2FF;
}
.help-cat-count {
    font-size: 0.8rem;
    color: #94a3b8;
}
.help-cat-arrow {
    font-size: 1.15rem;
    color: #2D5BFF;
    opacity: 0;
    transition: opacity 0.2s ease, transform 0.2s ease;
    transform: translateX(-4px);
}
.help-cat-card:hover .help-cat-arrow {
    opacity: 1;
    transform: translateX(0);
}

/* Contact support banner */
.help-contact-banner {
    background: linear-gradient(135deg, #f0f4ff 0%, #e8eeff 100%);
    border: 1.5px solid #d1d9ff;
    border-radius: 1rem;
    padding: 2.5rem 2rem;
    text-align: center;
}
.help-contact-banner h5 {
    font-size: 1.15rem;
    font-weight: 700;
    color: #0D1221;
    margin-bottom: 0.4rem;
}
.help-contact-banner p {
    color: #64748b;
    margin-bottom: 1.25rem;
    font-size: 0.9375rem;
}

/* Search result cards */
.help-result-card {
    border: 1.5px solid var(--ex-border, #E4E7FF) !important;
    border-radius: 0.75rem !important;
    text-decoration: none;
    color: inherit;
    display: block;
    transition: box-shadow 0.15s ease, border-color 0.15s ease;
}
.help-result-card:hover {
    box-shadow: 0 4px 16px rgba(45, 91, 255, 0.1);
    border-color: #2D5BFF !important;
    color: inherit;
    text-decoration: none;
}

/* ── File Vault ─────────────────────────────────────────────────────────────── */

/* Filter bar */
.vault-filter-bar .vault-type-select {
    flex: 0 0 180px;
    width: 180px;
}

/* Table */
.vault-table th {
    font-size: 0.78rem;
    text-transform: uppercase;
    letter-spacing: 0.04em;
    color: #6c757d;
    white-space: nowrap;
}

/* File name cell */
.vault-filename-cell {
    max-width: 240px;
}
.vault-file-icon {
    font-size: 1.1rem;
    margin-right: 0.4rem;
    vertical-align: middle;
}
.vault-filename {
    vertical-align: middle;
    word-break: break-all;
}

/* Folder rows in table */
.vault-folder-row td {
    background: #fafafa;
}
.vault-folder-row:hover td {
    background: #f0f4ff;
    cursor: pointer;
}
.vault-folder-divider td {
    padding: 0;
    height: 2px;
    background: #dee2e6;
}

/* ============================================================
   45. Beneficiary / Training shared utilities
   ============================================================ */

/* Circular avatar — small (list rows) */
.avatar-sm {
    width: 36px;
    height: 36px;
    object-fit: cover;
    font-size: 14px;
}

/* Circular avatar — large (detail header) */
.avatar-lg {
    width: 80px;
    height: 80px;
    object-fit: cover;
    font-size: 2rem;
}

/* Photo thumbnail in edit form */
.photo-preview-sm {
    max-height: 80px;
}

/* Linked-albums panel — album thumbnail card */
.album-thumb-wrap {
    height: 100px;
    overflow: hidden;
}
.album-thumb-img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

/* Drag-to-reorder handle */
.drag-handle {
    cursor: grab;
}
.drag-handle:active {
    cursor: grabbing;
}

/* Narrow icon/checkbox column in tables */
.col-icon {
    width: 2rem;
}

/* Narrow action-checkbox column in tables */
.col-checkbox {
    width: 2.5rem;
}

/* Fixed-width attendance status columns */
.col-attendance-primary {
    width: 9rem;
}
.col-attendance-secondary {
    width: 7rem;
}

/* Constrained card for confirmation pages */
.confirm-card {
    max-width: 540px;
}

/* ============================================
   ORG SWITCH BANNER (superuser admin mode)
   ============================================ */

.org-switch-banner {
    background-color: #fff3cd;
    border: 1px solid #ffc107;
    border-radius: 0.375rem;
    padding: 0.5rem 0.875rem;
    font-size: 0.875rem;
    color: #664d03;
}




/* ============================================
   JS TOAST NOTIFICATIONS (floats above modals)
   ============================================ */

/* Colour variants mirroring Bootstrap's contextual colours */
.toast-success { background-color: #198754; color: #fff; }
.toast-danger  { background-color: #dc3545; color: #fff; }
.toast-warning { background-color: #ffc107; color: #000; }
.toast-info    { background-color: #0dcaf0; color: #000; }

.toast-success .btn-close,
.toast-danger  .btn-close { filter: invert(1) grayscale(100%) brightness(200%); }

/* ============================================
   ORG INFO NARRATIVE FIELDS (Detail tab)
   ============================================ */

.org-narrative {
    line-height: 1.7;
}


/* ============================================
   USER PROFILE AVATAR
   ============================================ */

.profile-avatar {
    width: 80px;
    height: 80px;
    object-fit: cover;
    border-radius: 50%;
    border: 2px solid var(--bs-border-color);
}

.profile-avatar-placeholder {
    width: 80px;
    height: 80px;
    border-radius: 50%;
    background-color: var(--bs-secondary-bg);
    border: 2px solid var(--bs-border-color);
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}

/* ---- Profile image uploader (edit form) ---- */

.profile-uploader {
    display: flex;
    align-items: center;
    gap: 1.5rem;
    padding: 1rem 1.25rem;
    background: var(--bs-tertiary-bg);
    border-radius: 0.5rem;
    border: 1px solid var(--bs-border-color);
    margin-bottom: 1.5rem;
}

.profile-uploader-avatar {
    position: relative;
    flex-shrink: 0;
    cursor: pointer;
}

.profile-uploader-img,
.profile-uploader-placeholder {
    width: 96px;
    height: 96px;
    border-radius: 50%;
    border: 3px solid var(--bs-border-color);
    display: block;
    object-fit: cover;
    transition: opacity 0.2s;
}

.profile-uploader-placeholder {
    background-color: var(--bs-secondary-bg);
    display: flex;
    align-items: center;
    justify-content: center;
}

.profile-uploader-placeholder .material-symbols-outlined {
    font-size: 44px;
    color: var(--bs-secondary-color);
}

.profile-uploader-avatar:hover .profile-uploader-img,
.profile-uploader-avatar:hover .profile-uploader-placeholder {
    opacity: 0.75;
}

.profile-uploader-edit-btn {
    position: absolute;
    bottom: 2px;
    right: 2px;
    width: 28px;
    height: 28px;
    border-radius: 50%;
    background-color: var(--bs-primary);
    color: #fff;
    border: 2px solid #fff;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    pointer-events: none;
}

.profile-uploader-edit-btn .material-symbols-outlined {
    font-size: 14px;
}

.profile-uploader-meta {
    flex: 1;
    min-width: 0;
}

.profile-uploader-hint {
    font-size: 0.8125rem;
    color: var(--bs-secondary-color);
    margin-bottom: 0.5rem;
}

.profile-uploader-filename {
    font-size: 0.8125rem;
    color: var(--bs-success);
    margin-top: 0.35rem;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.profile-uploader-input {
    display: none;
}

/* Enquiry detail — preserve line breaks in message body */
.enquiry-message {
    white-space: pre-wrap;
}

/* Maps — suppress default iframe border on embed maps */
.map-embed-frame {
    border: 0;
}

/* Subsite dashboard — bare icon copy-URL buttons */
.subsite-url-copy-btn {
    background: none;
    border: none;
    padding: 0;
    line-height: 1;
    cursor: pointer;
}
.subsite-url-copy-btn:hover i {
    color: var(--bs-secondary) !important;
}

/* Email change wizard — step indicator and success icon */
.ec-step-circle {
    width: 2rem;
    height: 2rem;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 0.85rem;
    font-weight: 600;
    background-color: var(--bs-gray-200);
    color: var(--bs-gray-600);
    flex-shrink: 0;
}
.ec-step-circle.ec-step-active {
    background-color: var(--bs-primary);
    color: #fff;
}
.ec-step-circle.ec-step-done {
    background-color: var(--bs-success);
    color: #fff;
}
.ec-step-line {
    width: 3rem;
    height: 2px;
    background-color: var(--bs-gray-300);
}
.ec-success-icon {
    font-size: 2.5rem;
}

/* ============================================
   PDF COMPRESSION OPTION CHOOSER
   ============================================ */

.compression-option {
    cursor: pointer;
}

.compression-hint {
    font-size: 0.75rem;
}

/* ============================================
   EVENTS — FORM CARD MAX-WIDTH
   ============================================ */

.mmt-form-card {
    max-width: 640px;
}

/* ============================================
   EVENTS — TAB CARD (desktop-only top-edge join)
   ============================================ */

/* On mobile the desktop nav-tabs are hidden, so restore the card top border/radius */
.event-tab-card {
    border-top-left-radius: var(--bs-card-inner-border-radius);
    border-top-right-radius: var(--bs-card-inner-border-radius);
}

@media (min-width: 768px) {
    .event-tab-card {
        border-top: 0;
        border-top-left-radius: 0;
        border-top-right-radius: 0;
    }
}

/* ============================================
   IMAGE VAULT PICKER — shared modal grid used by
   the event form cover photo picker and the
   newsletter editor header/footer picker.
   ============================================ */

.vault-picker-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(150px, 1fr));
    gap: 0.6rem;
}

.vault-picker-item {
    position: relative;
    border-radius: 7px;
    overflow: hidden;
    border: 2px solid transparent;
    cursor: pointer;
    transition: border-color 0.15s, transform 0.12s, box-shadow 0.15s;
}

.vault-picker-item:hover {
    border-color: #2D5BFF;
    transform: scale(1.03);
    box-shadow: 0 4px 14px rgba(45,91,255,0.25);
}

.vault-picker-thumb {
    display: block;
    width: 100%;
    aspect-ratio: 16/9;
    object-fit: cover;
}

.vault-picker-overlay {
    position: absolute;
    inset: 0;
    background: rgba(45,91,255,0.55);
    display: flex;
    align-items: center;
    justify-content: center;
    opacity: 0;
    transition: opacity 0.15s;
    pointer-events: none;
}

.vault-picker-item:hover .vault-picker-overlay { opacity: 1; }

.vault-picker-overlay span {
    color: #fff;
    font-size: 0.78rem;
    font-weight: 700;
    letter-spacing: 0.03em;
}

/* ============================================
   EVENT DETAIL — OVERVIEW TAB
   ============================================ */

.event-cover-img {
    max-height: 320px;
    object-fit: cover;
}

.event-section-title {
    font-weight: 600;
    color: var(--bs-body-color);
    padding-bottom: 0.5rem;
    border-bottom: 2px solid var(--bs-border-color);
    margin-bottom: 1rem;
}

.event-info-card {
    background: var(--bs-tertiary-bg, #f8f9fa);
    border: 1px solid var(--bs-border-color);
    border-radius: 0.5rem;
    padding: 0.875rem 1rem;
}

.event-info-card-label {
    font-size: 0.72rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.06em;
    color: var(--bs-secondary-color);
    margin-bottom: 0.35rem;
}

.event-info-card-value {
    font-size: 0.95rem;
    line-height: 1.4;
}

.lineup-member-card {
    border: 1px solid var(--bs-border-color);
    border-radius: 0.5rem;
    padding: 1rem;
    height: 100%;
    transition: box-shadow 0.15s;
}

.lineup-member-card:hover {
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.08);
}

.lineup-avatar {
    width: 56px;
    height: 56px;
    object-fit: cover;
    display: block;
}

.lineup-avatar-initial {
    width: 56px;
    height: 56px;
    background: var(--bs-secondary);
    color: #fff;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.2rem;
    font-weight: 600;
    flex-shrink: 0;
}

/* Extra-small button variant (Bootstrap 5 removed btn-xs) */
.btn-xs {
    --bs-btn-padding-y: 0.2rem;
    --bs-btn-padding-x: 0.4rem;
    --bs-btn-font-size: 0.72rem;
    --bs-btn-border-radius: 0.25rem;
}

/* Mobile: show event meta sidebar (date/time/location) before main content */
@media (max-width: 767.98px) {
    .event-overview-main  { order: 2; }
    .event-overview-aside { order: 1; }
}

/* ============================================================
   Section XX — Compliance Self-Assessment CTA (homepage band)
   ============================================================ */

.ex-compliance-cta {
    background: #EEF8F4;
    padding: 72px 0;
    border-top: 1px solid #D1FADF;
    border-bottom: 1px solid #D1FADF;
}

.ex-compliance-stats {
    display: flex;
    flex-wrap: wrap;
    gap: 16px;
}

.ex-comp-stat {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    font-size: 14px;
    font-weight: 500;
    color: #2D6A4F;
    background: #D1FADF;
    padding: 4px 12px;
    border-radius: 99px;
}

.ex-comp-stat i {
    font-size: 14px;
}

.ex-compliance-note {
    font-size: 13px;
    color: #6B7280;
}

.ex-comp-icon-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 12px;
}

.ex-comp-icon-item {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    background: #fff;
    border: 1px solid #D1FADF;
    border-radius: 10px;
    padding: 16px 8px;
    text-align: center;
    gap: 8px;
    transition: box-shadow 0.2s;
}

.ex-comp-icon-item:hover {
    box-shadow: 0 2px 8px rgba(45,106,79,.12);
}

.ex-comp-icon-item i {
    font-size: 24px;
    color: #2D6A4F;
}

.ex-comp-icon-item span {
    font-size: 11px;
    font-weight: 600;
    color: #374151;
}

@media (max-width: 991.98px) {
    .ex-comp-icon-grid {
        grid-template-columns: repeat(4, 1fr);
    }
}

@media (max-width: 575.98px) {
    .ex-compliance-cta {
        padding: 48px 0;
    }

    .ex-comp-icon-grid {
        grid-template-columns: repeat(4, 1fr);
        gap: 8px;
    }

    .ex-comp-icon-item {
        padding: 12px 4px;
    }

    .ex-comp-icon-item i {
        font-size: 20px;
    }
}
