        /* Enhanced Library Styles with Modern Design */
        :root {
            --primary-color: #8b5cf6;
            --primary-gradient: linear-gradient(135deg, #8b5cf6, #7c3aed);
            --primary-hover: linear-gradient(135deg, #7c3aed, #6d28d9);
            --success-color: #10b981;
            --warning-color: #f59e0b;
            --error-color: #ef4444;
            --info-color: #3b82f6;
            
            --gray-50: #f9fafb;
            --gray-100: #f3f4f6;
            --gray-200: #e5e7eb;
            --gray-300: #d1d5db;
            --gray-400: #9ca3af;
            --gray-500: #6b7280;
            --gray-600: #4b5563;
            --gray-700: #374151;
            --gray-800: #1f2937;
            --gray-900: #111827;
            
            --shadow-sm: 0 1px 2px 0 rgba(0, 0, 0, 0.05);
            --shadow-md: 0 4px 6px -1px rgba(0, 0, 0, 0.1), 0 2px 4px -1px rgba(0, 0, 0, 0.06);
            --shadow-lg: 0 10px 15px -3px rgba(0, 0, 0, 0.1), 0 4px 6px -2px rgba(0, 0, 0, 0.05);
            --shadow-xl: 0 20px 25px -5px rgba(0, 0, 0, 0.1), 0 10px 10px -5px rgba(0, 0, 0, 0.04);
        }

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

        body {
            font-family: 'Inter', -apple-system, BlinkMacSystemFont, sans-serif;
            background: var(--gray-50);
            color: var(--gray-900);
            line-height: 1.6;
            margin: 0;
            padding-top: 0;
        }

        /* Enhanced Main Layout */
        .library-container {
            max-width: 1400px;
            margin: 0 auto;
            padding: 2rem;
            margin-left: 0; /* Allow full width when sidebar is closed */
            transition: margin-left 0.3s ease;
        }

        /* Adjust for sidebar when it's open */
        body.sidebar-open .library-container {
            margin-left: 280px;
        }

        /* Modern Header Section */
        .library-header {
            background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
            border-radius: 16px;
            padding: 3rem 2rem;
            color: white;
            margin-bottom: 2rem;
            position: relative;
            overflow: hidden;
        }

        .library-header::before {
            content: '';
            position: absolute;
            top: 0;
            left: 0;
            right: 0;
            bottom: 0;
            background: url('data:image/svg+xml,<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 100 100"><defs><pattern id="grid" width="10" height="10" patternUnits="userSpaceOnUse"><path d="M 10 0 L 0 0 0 10" fill="none" stroke="rgba(255,255,255,0.1)" stroke-width="1"/></pattern></defs><rect width="100" height="100" fill="url(%23grid)"/></svg>');
            opacity: 0.3;
        }

        .library-header-content {
            position: relative;
            z-index: 1;
        }

        .library-title {
            font-size: 2.5rem;
            font-weight: 800;
            margin-bottom: 0.5rem;
            display: flex;
            align-items: center;
            gap: 1rem;
        }

        .library-subtitle {
            font-size: 1.125rem;
            opacity: 0.9;
            margin-bottom: 1.5rem;
        }

        .library-stats {
            display: grid;
            grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
            gap: 1.5rem;
            margin-top: 2rem;
        }

        .stat-card {
            background: rgba(255, 255, 255, 0.1);
            border-radius: 12px;
            padding: 1.5rem;
            backdrop-filter: blur(10px);
            border: 1px solid rgba(255, 255, 255, 0.2);
            position: relative;
            overflow: hidden;
        }

        .stat-card::before {
            content: '';
            position: absolute;
            top: 0;
            right: 0;
            width: 60px;
            height: 60px;
            background: rgba(255, 255, 255, 0.1);
            border-radius: 50%;
            transform: translate(20px, -20px);
        }

        .stat-number {
            font-size: 2rem;
            font-weight: 700;
            margin-bottom: 0.25rem;
            position: relative;
            z-index: 1;
        }

        .stat-label {
            font-size: 0.875rem;
            opacity: 0.8;
            position: relative;
            z-index: 1;
        }

        /* Enhanced Statistics with Trending */
        .stat-trend {
            font-size: 0.75rem;
            margin-top: 0.5rem;
            display: flex;
            align-items: center;
            gap: 0.25rem;
            position: relative;
            z-index: 1;
        }

        .trend-up { color: #10b981; }
        .trend-down { color: #ef4444; }
        .trend-neutral { color: #cbd5e1; }

        /* Phase 1 Week 2: Compliance Status Indicators */
        .compliance-indicator {
            position: absolute;
            top: 1rem;
            right: 1rem;
            width: 12px;
            height: 12px;
            border-radius: 50%;
            border: 2px solid white;
            box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
            z-index: 2;
        }

        .compliance-current {
            background: var(--success-color);
        }

        .compliance-expiring {
            background: var(--warning-color);
            animation: pulse-warning 2s infinite;
        }

        .compliance-expired {
            background: var(--error-color);
            animation: pulse-warning 2s infinite;
        }

        @keyframes pulse-warning {
            0%, 100% { opacity: 1; }
            50% { opacity: 0.7; }
        }

        /* ===== PHASE 2 WEEK 4: COMPLIANCE ALERT SYSTEM ===== */
        .compliance-alerts {
            background: var(--gray-50);
            border-bottom: 1px solid var(--gray-200);
            padding: 1rem 1.5rem;
        }

        .alert {
            display: flex;
            align-items: flex-start;
            gap: 1rem;
            padding: 1rem;
            border-radius: 12px;
            margin-bottom: 0.75rem;
            border-left: 4px solid;
            background: white;
            box-shadow: var(--shadow-sm);
            animation: slideInDown 0.3s ease-out;
        }

        .alert:last-child {
            margin-bottom: 0;
        }

        .alert-critical {
            border-left-color: var(--error-color);
            background: linear-gradient(90deg, rgba(239, 68, 68, 0.05) 0%, white 20%);
        }

        .alert-warning {
            border-left-color: var(--warning-color);
            background: linear-gradient(90deg, rgba(245, 158, 11, 0.05) 0%, white 20%);
        }

        .alert-info {
            border-left-color: var(--info-color);
            background: linear-gradient(90deg, rgba(59, 130, 246, 0.05) 0%, white 20%);
        }

        .alert-icon {
            font-size: 1.25rem;
            margin-top: 0.125rem;
            flex-shrink: 0;
        }

        .alert-critical .alert-icon {
            color: var(--error-color);
            animation: pulse-critical 2s infinite;
        }

        .alert-warning .alert-icon {
            color: var(--warning-color);
        }

        .alert-info .alert-icon {
            color: var(--info-color);
        }

        .alert-content {
            flex: 1;
        }

        .alert-title {
            font-size: 0.875rem;
            font-weight: 600;
            margin-bottom: 0.25rem;
            color: var(--gray-800);
        }

        .alert-message {
            font-size: 0.8rem;
            color: var(--gray-600);
            line-height: 1.4;
        }

        .alert-actions {
            display: flex;
            gap: 0.5rem;
            margin-top: 0.5rem;
        }

        .alert-btn {
            padding: 0.25rem 0.75rem;
            border-radius: 6px;
            font-size: 0.75rem;
            font-weight: 500;
            border: 1px solid;
            cursor: pointer;
            transition: all 0.2s ease;
        }

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

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

        .alert-btn-secondary {
            background: white;
            color: var(--gray-600);
            border-color: var(--gray-300);
        }

        .alert-btn-secondary:hover {
            background: var(--gray-50);
            border-color: var(--gray-400);
        }

        .alert-dismiss {
            background: none;
            border: none;
            color: var(--gray-400);
            cursor: pointer;
            padding: 0.25rem;
            border-radius: 4px;
            flex-shrink: 0;
        }

        .alert-dismiss:hover {
            background: var(--gray-100);
            color: var(--gray-600);
        }

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

        @keyframes pulse-critical {
            0%, 100% { opacity: 1; }
            50% { opacity: 0.6; }
        }

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

        .alerts-title {
            font-size: 0.875rem;
            font-weight: 600;
            color: var(--gray-700);
            display: flex;
            align-items: center;
            gap: 0.5rem;
        }

        .alerts-count {
            background: var(--error-color);
            color: white;
            padding: 0.125rem 0.5rem;
            border-radius: 12px;
            font-size: 0.75rem;
            font-weight: 500;
        }

        .alerts-toggle {
            background: none;
            border: none;
            color: var(--gray-500);
            cursor: pointer;
            padding: 0.25rem;
            border-radius: 4px;
            font-size: 0.875rem;
        }

        .alerts-toggle:hover {
            background: var(--gray-100);
            color: var(--gray-700);
        }

        /* ===== PHASE 2 WEEK 5: ENHANCED SEARCH & FILTERING ===== */
        .enhanced-search {
            position: relative;
        }

        .search-suggestions {
            position: absolute;
            top: 100%;
            left: 0;
            right: 0;
            background: white;
            border: 2px solid var(--gray-200);
            border-top: none;
            border-radius: 0 0 12px 12px;
            box-shadow: var(--shadow-lg);
            z-index: 1000;
            max-height: 300px;
            overflow-y: auto;
            display: none;
        }

        .search-suggestion {
            padding: 0.75rem 1rem;
            border-bottom: 1px solid var(--gray-100);
            cursor: pointer;
            transition: background 0.2s ease;
        }

        .search-suggestion:hover {
            background: var(--gray-50);
        }

        .search-suggestion:last-child {
            border-bottom: none;
        }

        .suggestion-type {
            font-size: 0.75rem;
            color: var(--gray-500);
            text-transform: uppercase;
            font-weight: 500;
            margin-bottom: 0.25rem;
        }

        .suggestion-title {
            font-size: 0.875rem;
            color: var(--gray-800);
            font-weight: 500;
        }

        .suggestion-details {
            font-size: 0.8rem;
            color: var(--gray-600);
            margin-top: 0.25rem;
        }

        .search-filters {
            display: flex;
            gap: 0.5rem;
            margin-top: 0.75rem;
            flex-wrap: wrap;
        }

        .search-filter-chip {
            display: inline-flex;
            align-items: center;
            gap: 0.25rem;
            padding: 0.25rem 0.75rem;
            background: var(--primary-gradient);
            color: white;
            border-radius: 20px;
            font-size: 0.75rem;
            font-weight: 500;
        }

        .filter-chip-remove {
            background: none;
            border: none;
            color: white;
            cursor: pointer;
            padding: 0;
            margin-left: 0.25rem;
            opacity: 0.8;
        }

        .filter-chip-remove:hover {
            opacity: 1;
        }

        .advanced-search-toggle {
            background: none;
            border: none;
            color: var(--gray-500);
            font-size: 0.8rem;
            cursor: pointer;
            padding: 0.25rem 0.5rem;
            border-radius: 4px;
            margin-left: 0.5rem;
        }

        .advanced-search-toggle:hover {
            background: var(--gray-100);
            color: var(--gray-700);
        }

        .advanced-search-panel {
            position: absolute;
            top: 100%;
            right: 0;
            background: white;
            border: 2px solid var(--gray-200);
            border-radius: 12px;
            box-shadow: var(--shadow-lg);
            z-index: 1000;
            width: 320px;
            padding: 1rem;
            display: none;
        }

        .advanced-search-title {
            font-size: 0.875rem;
            font-weight: 600;
            color: var(--gray-800);
            margin-bottom: 0.75rem;
        }

        .advanced-search-group {
            margin-bottom: 0.75rem;
        }

        .advanced-search-label {
            font-size: 0.75rem;
            color: var(--gray-600);
            margin-bottom: 0.25rem;
            display: block;
        }

        .advanced-search-input {
            width: 100%;
            padding: 0.5rem 0.75rem;
            border: 1px solid var(--gray-300);
            border-radius: 6px;
            font-size: 0.8rem;
        }

        .advanced-search-select {
            width: 100%;
            padding: 0.5rem 0.75rem;
            border: 1px solid var(--gray-300);
            border-radius: 6px;
            font-size: 0.8rem;
            background: white;
        }

        .advanced-search-actions {
            display: flex;
            gap: 0.5rem;
            margin-top: 1rem;
        }

        .advanced-search-apply {
            flex: 1;
            padding: 0.5rem;
            background: var(--primary-gradient);
            color: white;
            border: none;
            border-radius: 6px;
            font-size: 0.8rem;
            font-weight: 500;
            cursor: pointer;
        }

        .advanced-search-clear {
            padding: 0.5rem 0.75rem;
            background: white;
            color: var(--gray-600);
            border: 1px solid var(--gray-300);
            border-radius: 6px;
            font-size: 0.8rem;
            cursor: pointer;
        }




        /* Notification system */
        .notification-center {
            position: fixed;
            top: 80px;
            right: 1rem;
            z-index: 9999;
            max-width: 400px;
        }

        .notification {
            background: white;
            border: 1px solid var(--gray-200);
            border-radius: 12px;
            padding: 1rem;
            margin-bottom: 0.5rem;
            box-shadow: var(--shadow-lg);
            animation: slideInRight 0.3s ease-out;
        }

        .notification-critical {
            border-left: 4px solid var(--error-color);
        }

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

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

        .notification-header {
            display: flex;
            align-items: center;
            justify-content: space-between;
            margin-bottom: 0.5rem;
        }

        .notification-title {
            font-size: 0.875rem;
            font-weight: 600;
            color: var(--gray-800);
        }

        .notification-time {
            font-size: 0.75rem;
            color: var(--gray-500);
        }

        .notification-message {
            font-size: 0.8rem;
            color: var(--gray-600);
            line-height: 1.4;
        }

        .notification-actions {
            display: flex;
            gap: 0.5rem;
            margin-top: 0.75rem;
        }

        .notification-btn {
            padding: 0.25rem 0.75rem;
            border-radius: 6px;
            font-size: 0.75rem;
            font-weight: 500;
            border: 1px solid;
            cursor: pointer;
            transition: all 0.2s ease;
        }

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

        .notification-btn-secondary {
            background: white;
            color: var(--gray-600);
            border-color: var(--gray-300);
        }

        .notification-dismiss {
            background: none;
            border: none;
            color: var(--gray-400);
            cursor: pointer;
            padding: 0.25rem;
        }

        @keyframes slideInRight {
            from {
                opacity: 0;
                transform: translateX(100%);
            }
            to {
                opacity: 1;
                transform: translateX(0);
            }
        }

        /* Priority summary in stats */
        .priority-summary {
            display: grid;
            grid-template-columns: repeat(4, 1fr);
            gap: 0.5rem;
            margin-top: 1rem;
            padding-top: 1rem;
            border-top: 1px solid var(--gray-200);
        }

        .priority-stat {
            text-align: center;
            padding: 0.5rem;
            border-radius: 8px;
            background: var(--gray-50);
        }

        .priority-stat-number {
            font-size: 1.25rem;
            font-weight: 700;
            margin-bottom: 0.25rem;
        }

        .priority-stat-label {
            font-size: 0.7rem;
            text-transform: uppercase;
            font-weight: 500;
        }

        .priority-stat.critical {
            background: linear-gradient(135deg, rgba(239, 68, 68, 0.1), rgba(239, 68, 68, 0.05));
            color: var(--error-color);
        }

        .priority-stat.important {
            background: linear-gradient(135deg, rgba(245, 158, 11, 0.1), rgba(245, 158, 11, 0.05));
            color: var(--warning-color);
        }

        .priority-stat.standard {
            background: linear-gradient(135deg, rgba(107, 114, 128, 0.1), rgba(107, 114, 128, 0.05));
            color: var(--gray-600);
        }

        .priority-stat.low {
            background: linear-gradient(135deg, rgba(59, 130, 246, 0.1), rgba(59, 130, 246, 0.05));
            color: var(--info-color);
        }

        /* ===== PHASE 3 WEEK 7: DOCUMENT AUTOMATION ===== */
        .automation-panel {
            background: white;
            border: 2px solid var(--gray-200);
            border-radius: 16px;
            margin-bottom: 1.5rem;
            overflow: hidden;
            box-shadow: var(--shadow-md);
        }

        .automation-header {
            background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
            color: white;
            padding: 1rem 1.5rem;
            display: flex;
            align-items: center;
            justify-content: space-between;
        }

        .automation-title {
            font-size: 1rem;
            font-weight: 600;
            display: flex;
            align-items: center;
            gap: 0.5rem;
        }

        .automation-toggle {
            background: rgba(255, 255, 255, 0.2);
            border: 1px solid rgba(255, 255, 255, 0.3);
            color: white;
            padding: 0.5rem 1rem;
            border-radius: 8px;
            font-size: 0.8rem;
            cursor: pointer;
            transition: all 0.2s ease;
        }

        .automation-toggle:hover {
            background: rgba(255, 255, 255, 0.3);
        }

        .automation-content {
            padding: 1.5rem;
            display: none;
        }

        .automation-content.active {
            display: block;
        }

        .automation-grid {
            display: grid;
            grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
            gap: 1.5rem;
        }

        .automation-card {
            background: var(--gray-50);
            border: 2px solid var(--gray-200);
            border-radius: 12px;
            padding: 1.5rem;
            transition: all 0.2s ease;
        }

        .automation-card:hover {
            border-color: #8b5cf6;
            box-shadow: var(--shadow-md);
        }

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

        .automation-card-icon {
            width: 40px;
            height: 40px;
            background: var(--primary-gradient);
            border-radius: 10px;
            display: flex;
            align-items: center;
            justify-content: center;
            color: white;
            font-size: 1.1rem;
        }

        .automation-card-title {
            font-size: 1rem;
            font-weight: 600;
            color: var(--gray-800);
        }

        .automation-card-description {
            font-size: 0.875rem;
            color: var(--gray-600);
            margin-bottom: 1rem;
            line-height: 1.5;
        }

        .automation-card-actions {
            display: flex;
            gap: 0.5rem;
        }

        .automation-btn {
            padding: 0.5rem 1rem;
            border-radius: 8px;
            font-size: 0.8rem;
            font-weight: 500;
            border: none;
            cursor: pointer;
            transition: all 0.2s ease;
            flex: 1;
        }

        .automation-btn-primary {
            background: var(--primary-gradient);
            color: white;
        }

        .automation-btn-primary:hover {
            background: var(--primary-hover);
            transform: translateY(-1px);
        }

        .automation-btn-secondary {
            background: white;
            color: var(--gray-700);
            border: 2px solid var(--gray-200);
        }

        .automation-btn-secondary:hover {
            border-color: var(--gray-300);
            background: var(--gray-50);
        }

        /* Duplicate Detection Interface */
        .duplicate-detection {
            background: linear-gradient(135deg, rgba(245, 158, 11, 0.1), rgba(245, 158, 11, 0.05));
            border: 2px solid #f59e0b;
            border-radius: 12px;
            padding: 1rem;
            margin-top: 1rem;
            display: none;
        }

        .duplicate-detection.active {
            display: block;
            animation: slideInDown 0.3s ease-out;
        }

        .duplicate-header {
            display: flex;
            align-items: center;
            gap: 0.5rem;
            margin-bottom: 0.75rem;
        }

        .duplicate-title {
            font-size: 0.875rem;
            font-weight: 600;
            color: #92400e;
        }

        .duplicate-count {
            background: #f59e0b;
            color: white;
            padding: 0.125rem 0.5rem;
            border-radius: 12px;
            font-size: 0.75rem;
            font-weight: 500;
        }

        .duplicate-list {
            max-height: 200px;
            overflow-y: auto;
        }

        .duplicate-item {
            display: flex;
            align-items: center;
            justify-content: between;
            padding: 0.5rem;
            background: white;
            border-radius: 8px;
            margin-bottom: 0.5rem;
            border: 1px solid #fed7aa;
        }

        .duplicate-info {
            flex: 1;
        }

        .duplicate-name {
            font-size: 0.8rem;
            font-weight: 500;
            color: var(--gray-800);
        }

        .duplicate-details {
            font-size: 0.75rem;
            color: var(--gray-600);
        }

        .duplicate-actions {
            display: flex;
            gap: 0.25rem;
        }

        .duplicate-btn {
            padding: 0.25rem 0.5rem;
            border-radius: 4px;
            font-size: 0.7rem;
            font-weight: 500;
            border: 1px solid;
            cursor: pointer;
            transition: all 0.2s ease;
        }

        .duplicate-btn-merge {
            background: var(--success-color);
            color: white;
            border-color: var(--success-color);
        }

        .duplicate-btn-keep {
            background: white;
            color: var(--gray-600);
            border-color: var(--gray-300);
        }

        /* Batch Operations */
        .batch-operations {
            background: var(--gray-50);
            border: 2px solid var(--gray-200);
            border-radius: 12px;
            padding: 1rem;
            margin-bottom: 1rem;
            display: none;
        }

        .batch-operations.active {
            display: block;
            animation: slideInDown 0.3s ease-out;
        }

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

        .batch-title {
            font-size: 0.875rem;
            font-weight: 600;
            color: var(--gray-800);
            display: flex;
            align-items: center;
            gap: 0.5rem;
        }

        .batch-selected {
            background: var(--primary-gradient);
            color: white;
            padding: 0.25rem 0.75rem;
            border-radius: 12px;
            font-size: 0.75rem;
            font-weight: 500;
        }

        .batch-actions {
            display: flex;
            gap: 0.5rem;
            flex-wrap: wrap;
        }

        .batch-btn {
            padding: 0.5rem 1rem;
            border-radius: 8px;
            font-size: 0.8rem;
            font-weight: 500;
            border: none;
            cursor: pointer;
            transition: all 0.2s ease;
            display: flex;
            align-items: center;
            gap: 0.25rem;
        }

        .batch-btn-approve {
            background: var(--success-color);
            color: white;
        }

        .batch-btn-categorize {
            background: var(--info-color);
            color: white;
        }

        .batch-btn-priority {
            background: var(--warning-color);
            color: white;
        }

        .batch-btn-delete {
            background: var(--error-color);
            color: white;
        }

        .batch-btn:hover {
            transform: translateY(-1px);
            box-shadow: var(--shadow-md);
        }

        /* Auto-categorization Progress */
        .auto-categorization {
            background: linear-gradient(135deg, rgba(16, 185, 129, 0.1), rgba(16, 185, 129, 0.05));
            border: 2px solid var(--success-color);
            border-radius: 12px;
            padding: 1rem;
            margin-top: 1rem;
            display: none;
        }

        .auto-categorization.active {
            display: block;
            animation: slideInDown 0.3s ease-out;
        }

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

        .progress-bar {
            flex: 1;
            height: 8px;
            background: rgba(16, 185, 129, 0.2);
            border-radius: 4px;
            overflow: hidden;
        }

        .progress-fill {
            height: 100%;
            background: var(--success-color);
            border-radius: 4px;
            transition: width 0.3s ease;
            width: 0%;
        }

        .progress-text {
            font-size: 0.8rem;
            font-weight: 500;
            color: #065f46;
            white-space: nowrap;
        }

        .categorization-results {
            font-size: 0.8rem;
            color: #065f46;
        }

        /* Document Selection */
        .document-selector {
            position: absolute;
            top: 0.5rem;
            right: 3rem;
            z-index: 3;
        }

        .document-checkbox {
            width: 18px;
            height: 18px;
            border: 2px solid var(--gray-300);
            border-radius: 4px;
            background: white;
            cursor: pointer;
            transition: all 0.2s ease;
        }

        .document-checkbox.checked {
            background: var(--primary-gradient);
            border-color: #8b5cf6;
        }

        .document-checkbox.checked::after {
            content: '✓';
            display: block;
            text-align: center;
            color: white;
            font-size: 12px;
            line-height: 14px;
        }

        .select-all-toggle {
            background: white;
            border: 2px solid var(--gray-200);
            border-radius: 8px;
            padding: 0.5rem 1rem;
            font-size: 0.8rem;
            cursor: pointer;
            transition: all 0.2s ease;
            margin-bottom: 1rem;
        }

        .select-all-toggle:hover {
            border-color: #8b5cf6;
            background: rgba(139, 92, 246, 0.05);
        }

        .select-all-toggle.active {
            background: var(--primary-gradient);
            color: white;
            border-color: #8b5cf6;
        }

        /* ===== PHASE 3 WEEK 8: WORKFLOW MANAGEMENT ===== */
        .workflow-panel {
            background: white;
            border: 2px solid var(--gray-200);
            border-radius: 16px;
            margin-bottom: 1.5rem;
            overflow: hidden;
            box-shadow: var(--shadow-md);
        }

        .workflow-header {
            background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
            color: white;
            padding: 1rem 1.5rem;
            display: flex;
            align-items: center;
            justify-content: space-between;
        }

        .workflow-title {
            font-size: 1rem;
            font-weight: 600;
            display: flex;
            align-items: center;
            gap: 0.5rem;
        }

        .workflow-content {
            padding: 1.5rem;
        }

        .workflow-tabs {
            display: flex;
            background: var(--gray-100);
            border-radius: 12px;
            padding: 0.25rem;
            margin-bottom: 1.5rem;
        }

        .workflow-tab {
            flex: 1;
            padding: 0.75rem 1rem;
            border-radius: 8px;
            text-align: center;
            font-size: 0.875rem;
            font-weight: 500;
            cursor: pointer;
            transition: all 0.2s ease;
            background: transparent;
            border: none;
            color: var(--gray-600);
        }

        .workflow-tab.active {
            background: white;
            color: var(--gray-800);
            box-shadow: var(--shadow-sm);
        }

        .workflow-tab-content {
            display: none;
        }

        .workflow-tab-content.active {
            display: block;
        }

        /* Approval Workflows */
        .approval-workflow {
            background: var(--gray-50);
            border: 2px solid var(--gray-200);
            border-radius: 12px;
            padding: 1.5rem;
            margin-bottom: 1rem;
        }

        .workflow-stage {
            display: flex;
            align-items: center;
            gap: 1rem;
            margin-bottom: 1rem;
            padding: 1rem;
            background: white;
            border-radius: 8px;
            border: 2px solid var(--gray-200);
            position: relative;
        }

        .workflow-stage.active {
            border-color: #8b5cf6;
            background: rgba(139, 92, 246, 0.05);
        }

        .workflow-stage.completed {
            border-color: var(--success-color);
            background: rgba(16, 185, 129, 0.05);
        }

        .stage-icon {
            width: 40px;
            height: 40px;
            border-radius: 50%;
            display: flex;
            align-items: center;
            justify-content: center;
            color: white;
            font-size: 1rem;
            flex-shrink: 0;
        }

        .stage-icon.pending {
            background: var(--gray-400);
        }

        .stage-icon.active {
            background: #8b5cf6;
        }

        .stage-icon.completed {
            background: var(--success-color);
        }

        .stage-content {
            flex: 1;
        }

        .stage-title {
            font-size: 0.875rem;
            font-weight: 600;
            color: var(--gray-800);
            margin-bottom: 0.25rem;
        }

        .stage-description {
            font-size: 0.8rem;
            color: var(--gray-600);
            margin-bottom: 0.5rem;
        }

        .stage-assignee {
            font-size: 0.75rem;
            color: var(--gray-500);
        }

        .stage-actions {
            display: flex;
            gap: 0.5rem;
        }

        .stage-btn {
            padding: 0.5rem 1rem;
            border-radius: 6px;
            font-size: 0.8rem;
            font-weight: 500;
            border: none;
            cursor: pointer;
            transition: all 0.2s ease;
        }

        .stage-btn-approve {
            background: var(--success-color);
            color: white;
        }

        .stage-btn-reject {
            background: var(--error-color);
            color: white;
        }

        .stage-btn-comment {
            background: white;
            color: var(--gray-700);
            border: 2px solid var(--gray-200);
        }

        /* Document Routing */
        .routing-panel {
            background: var(--gray-50);
            border-radius: 12px;
            padding: 1.5rem;
        }

        .routing-rule {
            background: white;
            border: 2px solid var(--gray-200);
            border-radius: 8px;
            padding: 1rem;
            margin-bottom: 1rem;
            display: flex;
            align-items: center;
            justify-content: space-between;
        }

        .rule-condition {
            flex: 1;
        }

        .rule-title {
            font-size: 0.875rem;
            font-weight: 600;
            color: var(--gray-800);
            margin-bottom: 0.25rem;
        }

        .rule-description {
            font-size: 0.8rem;
            color: var(--gray-600);
        }

        .rule-actions {
            display: flex;
            gap: 0.5rem;
        }

        .rule-toggle {
            width: 40px;
            height: 20px;
            background: var(--gray-300);
            border-radius: 10px;
            position: relative;
            cursor: pointer;
            transition: background 0.2s ease;
        }

        .rule-toggle.active {
            background: var(--success-color);
        }

        .rule-toggle::after {
            content: '';
            position: absolute;
            width: 16px;
            height: 16px;
            background: white;
            border-radius: 50%;
            top: 2px;
            left: 2px;
            transition: transform 0.2s ease;
        }

        .rule-toggle.active::after {
            transform: translateX(20px);
        }

        /* Task Management */
        .task-board {
            display: grid;
            grid-template-columns: repeat(3, 1fr);
            gap: 1rem;
        }

        .task-column {
            background: var(--gray-50);
            border-radius: 12px;
            padding: 1rem;
            min-height: 300px;
        }

        .task-column-header {
            font-size: 0.875rem;
            font-weight: 600;
            color: var(--gray-800);
            margin-bottom: 1rem;
            display: flex;
            align-items: center;
            justify-content: space-between;
        }

        .task-count {
            background: var(--gray-200);
            color: var(--gray-600);
            padding: 0.125rem 0.5rem;
            border-radius: 12px;
            font-size: 0.75rem;
            font-weight: 500;
        }

        .task-item {
            background: white;
            border: 2px solid var(--gray-200);
            border-radius: 8px;
            padding: 1rem;
            margin-bottom: 0.75rem;
            cursor: pointer;
            transition: all 0.2s ease;
        }

        .task-item:hover {
            border-color: #8b5cf6;
            box-shadow: var(--shadow-sm);
        }

        .task-priority {
            display: inline-block;
            padding: 0.125rem 0.5rem;
            border-radius: 12px;
            font-size: 0.7rem;
            font-weight: 600;
            text-transform: uppercase;
            margin-bottom: 0.5rem;
        }

        .task-priority.high {
            background: rgba(239, 68, 68, 0.1);
            color: var(--error-color);
        }

        .task-priority.medium {
            background: rgba(245, 158, 11, 0.1);
            color: var(--warning-color);
        }

        .task-priority.low {
            background: rgba(59, 130, 246, 0.1);
            color: var(--info-color);
        }

        .task-title {
            font-size: 0.875rem;
            font-weight: 600;
            color: var(--gray-800);
            margin-bottom: 0.25rem;
        }

        .task-description {
            font-size: 0.8rem;
            color: var(--gray-600);
            margin-bottom: 0.5rem;
        }

        .task-assignee {
            font-size: 0.75rem;
            color: var(--gray-500);
            display: flex;
            align-items: center;
            gap: 0.25rem;
        }

        .task-due-date {
            font-size: 0.75rem;
            color: var(--gray-500);
            margin-top: 0.25rem;
        }

        .add-task-btn {
            width: 100%;
            padding: 0.75rem;
            border: 2px dashed var(--gray-300);
            border-radius: 8px;
            background: transparent;
            color: var(--gray-500);
            font-size: 0.8rem;
            cursor: pointer;
            transition: all 0.2s ease;
        }

        .add-task-btn:hover {
            border-color: #8b5cf6;
            color: #8b5cf6;
            background: rgba(139, 92, 246, 0.05);
        }

        /* Workflow Designer */
        .workflow-designer {
            background: var(--gray-50);
            border-radius: 12px;
            padding: 1.5rem;
            min-height: 400px;
        }

        .workflow-canvas {
            background: white;
            border: 2px dashed var(--gray-300);
            border-radius: 8px;
            min-height: 300px;
            display: flex;
            align-items: center;
            justify-content: center;
            color: var(--gray-500);
        }

        .workflow-tools {
            display: flex;
            gap: 0.5rem;
            margin-bottom: 1rem;
        }

        .workflow-tool {
            padding: 0.5rem 1rem;
            border: 2px solid var(--gray-200);
            border-radius: 8px;
            background: white;
            color: var(--gray-700);
            font-size: 0.8rem;
            cursor: pointer;
            transition: all 0.2s ease;
        }

        .workflow-tool:hover {
            border-color: #8b5cf6;
            background: rgba(139, 92, 246, 0.05);
        }

        /* ===== MISSING FEATURE 1: DOCUMENT RELATIONSHIP MAPPING ===== */
        .relationships-panel {
            background: white;
            border: 2px solid var(--gray-200);
            border-radius: 16px;
            margin-bottom: 1.5rem;
            overflow: hidden;
            box-shadow: var(--shadow-md);
        }

        .relationships-header {
            background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
            color: white;
            padding: 1rem 1.5rem;
            display: flex;
            align-items: center;
            justify-content: space-between;
        }

        .relationships-title {
            font-size: 1rem;
            font-weight: 600;
            display: flex;
            align-items: center;
            gap: 0.5rem;
        }

        .relationships-content {
            padding: 1.5rem;
        }

        /* Document relationship visualization */
        .relationship-map {
            background: var(--gray-50);
            border-radius: 12px;
            padding: 1.5rem;
            margin-bottom: 1rem;
        }

        .relationship-node {
            background: white;
            border: 2px solid var(--gray-200);
            border-radius: 8px;
            padding: 1rem;
            margin-bottom: 1rem;
            position: relative;
            transition: all 0.2s ease;
        }

        .relationship-node:hover {
            border-color: #8b5cf6;
            box-shadow: var(--shadow-md);
        }

        .relationship-node.current {
            border-color: #8b5cf6;
            background: rgba(139, 92, 246, 0.05);
        }

        .relationship-node.superseded {
            border-color: var(--gray-300);
            background: var(--gray-50);
            opacity: 0.7;
        }

        .relationship-connector {
            position: absolute;
            left: 50%;
            top: 100%;
            width: 2px;
            height: 20px;
            background: var(--gray-300);
            transform: translateX(-50%);
        }

        .relationship-connector.active {
            background: #8b5cf6;
        }

        .relationship-arrow {
            position: absolute;
            left: 50%;
            bottom: -8px;
            transform: translateX(-50%);
            width: 0;
            height: 0;
            border-left: 6px solid transparent;
            border-right: 6px solid transparent;
            border-top: 8px solid var(--gray-300);
        }

        .relationship-arrow.active {
            border-top-color: #8b5cf6;
        }

        .relationship-type {
            position: absolute;
            top: -8px;
            right: 1rem;
            background: var(--primary-gradient);
            color: white;
            padding: 0.25rem 0.75rem;
            border-radius: 12px;
            font-size: 0.7rem;
            font-weight: 600;
            text-transform: uppercase;
        }

        .relationship-type.supersedes {
            background: var(--warning-color);
        }

        .relationship-type.implements {
            background: var(--success-color);
        }

        .relationship-type.references {
            background: var(--info-color);
        }

        .relationship-info {
            display: flex;
            align-items: center;
            gap: 1rem;
        }

        .relationship-doc-icon {
            width: 40px;
            height: 40px;
            background: var(--primary-gradient);
            border-radius: 8px;
            display: flex;
            align-items: center;
            justify-content: center;
            color: white;
            font-size: 1.1rem;
            flex-shrink: 0;
        }

        .relationship-doc-details {
            flex: 1;
        }

        .relationship-doc-title {
            font-size: 0.875rem;
            font-weight: 600;
            color: var(--gray-800);
            margin-bottom: 0.25rem;
        }

        .relationship-doc-id {
            font-size: 0.8rem;
            color: var(--gray-600);
            margin-bottom: 0.25rem;
        }

        .relationship-doc-status {
            font-size: 0.75rem;
            color: var(--gray-500);
        }

        .relationship-actions {
            display: flex;
            gap: 0.5rem;
        }

        .relationship-btn {
            padding: 0.5rem 1rem;
            border-radius: 6px;
            font-size: 0.8rem;
            font-weight: 500;
            border: none;
            cursor: pointer;
            transition: all 0.2s ease;
        }

        .relationship-btn-view {
            background: var(--info-color);
            color: white;
        }

        .relationship-btn-add {
            background: var(--success-color);
            color: white;
        }

        .relationship-btn-remove {
            background: var(--error-color);
            color: white;
        }

        /* Relationship search and management */
        .relationship-search {
            background: var(--gray-50);
            border-radius: 8px;
            padding: 1rem;
            margin-bottom: 1rem;
        }

        .relationship-search-input {
            width: 100%;
            padding: 0.75rem 1rem;
            border: 2px solid var(--gray-200);
            border-radius: 8px;
            font-size: 0.875rem;
            margin-bottom: 0.5rem;
        }

        .relationship-search-input:focus {
            outline: none;
            border-color: #8b5cf6;
        }

        .relationship-suggestions {
            max-height: 200px;
            overflow-y: auto;
        }

        .relationship-suggestion {
            background: white;
            border: 1px solid var(--gray-200);
            border-radius: 6px;
            padding: 0.75rem;
            margin-bottom: 0.5rem;
            cursor: pointer;
            transition: all 0.2s ease;
            display: flex;
            align-items: center;
            justify-content: space-between;
        }

        .relationship-suggestion:hover {
            border-color: #8b5cf6;
            background: rgba(139, 92, 246, 0.05);
        }

        .relationship-suggestion-info {
            flex: 1;
        }

        .relationship-suggestion-title {
            font-size: 0.8rem;
            font-weight: 500;
            color: var(--gray-800);
        }

        .relationship-suggestion-id {
            font-size: 0.75rem;
            color: var(--gray-600);
        }

        .relationship-type-selector {
            display: flex;
            gap: 0.5rem;
            margin-top: 1rem;
        }

        .relationship-type-btn {
            padding: 0.5rem 1rem;
            border: 2px solid var(--gray-200);
            border-radius: 6px;
            background: white;
            color: var(--gray-700);
            font-size: 0.8rem;
            font-weight: 500;
            cursor: pointer;
            transition: all 0.2s ease;
        }

        .relationship-type-btn:hover {
            border-color: #8b5cf6;
            background: rgba(139, 92, 246, 0.05);
        }

        .relationship-type-btn.active {
            background: var(--primary-gradient);
            color: white;
            border-color: #8b5cf6;
        }

        /* Version control tracking */
        .version-history {
            background: var(--gray-50);
            border-radius: 8px;
            padding: 1rem;
            margin-top: 1rem;
        }

        .version-history-title {
            font-size: 0.875rem;
            font-weight: 600;
            color: var(--gray-800);
            margin-bottom: 0.75rem;
        }

        .version-item {
            display: flex;
            align-items: center;
            gap: 1rem;
            padding: 0.75rem;
            background: white;
            border-radius: 6px;
            margin-bottom: 0.5rem;
            border: 1px solid var(--gray-200);
        }

        .version-item.current {
            border-color: var(--success-color);
            background: rgba(16, 185, 129, 0.05);
        }

        .version-number {
            background: var(--gray-200);
            color: var(--gray-700);
            padding: 0.25rem 0.5rem;
            border-radius: 4px;
            font-size: 0.75rem;
            font-weight: 600;
            font-family: monospace;
        }

        .version-number.current {
            background: var(--success-color);
            color: white;
        }

        .version-details {
            flex: 1;
        }

        .version-title {
            font-size: 0.8rem;
            font-weight: 500;
            color: var(--gray-800);
        }

        .version-date {
            font-size: 0.75rem;
            color: var(--gray-600);
        }

        /* ===== MISSING FEATURE 2: MOBILE OPTIMIZATION & PWA ===== */
        
        /* Mobile-first responsive design */
        @media (max-width: 768px) {
            /* Layout adjustments */
            .library-container {
                padding: 1rem;
                margin-left: 0 !important;
            }

            /* Header improvements */
            .library-header {
                padding: 2rem 1rem;
                text-align: center;
            }

            .library-header h1 {
                font-size: 1.5rem;
            }

            .library-header p {
                font-size: 0.875rem;
            }

            /* Statistics grid */
            .library-stats {
                grid-template-columns: repeat(2, 1fr);
                gap: 1rem;
            }

            .stat-card {
                padding: 1rem;
            }

            .stat-number {
                font-size: 1.5rem;
            }

            /* Toolbar mobile optimization */
            .library-toolbar {
                padding: 1rem;
            }

            .toolbar-main {
                flex-direction: column;
                gap: 1rem;
                align-items: stretch;
            }

            .toolbar-main-actions {
                flex-direction: column;
                gap: 0.75rem;
            }

            .toolbar-secondary {
                flex-direction: column;
                gap: 1rem;
                align-items: stretch;
                padding-top: 1rem;
            }

            .filter-pills {
                justify-content: center;
                gap: 0.5rem;
            }

            .toolbar-right-actions {
                justify-content: center;
                gap: 0.75rem;
            }

            .search-container {
                max-width: none;
                order: -1;
            }

            .search-input {
                padding: 0.875rem 1rem 0.875rem 3rem;
                font-size: 1rem; /* Prevent zoom on iOS */
            }

            /* Button adjustments */
            .btn {
                padding: 0.875rem 1.5rem;
                font-size: 0.875rem;
                justify-content: center;
            }

            /* Quick actions mobile layout */
            .quick-actions {
                grid-template-columns: repeat(2, 1fr);
                gap: 0.75rem;
            }

            .quick-action {
                padding: 0.75rem;
            }

            .quick-action-title {
                font-size: 0.8rem;
            }

            /* Priority filters mobile layout */
            .priority-filters {
                flex-wrap: wrap;
                gap: 0.5rem;
            }

            .priority-filter-btn {
                font-size: 0.75rem;
                padding: 0.4rem 0.6rem;
            }

            /* Documents grid mobile */
            .documents-grid {
                grid-template-columns: 1fr;
                gap: 1rem;
                padding: 1rem;
            }

            .document-card {
                padding: 1rem;
            }

            /* Panel adjustments */
            .automation-panel,
            .workflow-panel,
            .relationships-panel {
                margin-bottom: 1rem;
            }

            .automation-content,
            .workflow-content,
            .relationships-content {
                padding: 1rem;
            }

            .automation-grid {
                grid-template-columns: 1fr;
                gap: 1rem;
            }

            /* Workflow tabs mobile */
            .workflow-tabs {
                flex-wrap: wrap;
                gap: 0.25rem;
            }

            .workflow-tab {
                font-size: 0.8rem;
                padding: 0.6rem 0.8rem;
            }

            /* Task board mobile */
            .task-board {
                grid-template-columns: 1fr;
                gap: 1rem;
            }

            /* Relationship map mobile */
            .relationship-map {
                padding: 1rem;
            }

            .relationship-node {
                padding: 0.75rem;
            }

            .relationship-info {
                flex-direction: column;
                gap: 0.75rem;
                align-items: flex-start;
            }

            .relationship-actions {
                align-self: stretch;
            }

            .relationship-btn {
                flex: 1;
                font-size: 0.75rem;
            }

            /* Modal adjustments for mobile */
            .modal-content {
                margin: 1rem;
                max-height: calc(100vh - 2rem);
            }

            .modal-body {
                max-height: calc(100vh - 200px);
            }

            /* Form improvements */
            .form-grid {
                grid-template-columns: 1fr;
                gap: 1rem;
            }

            /* Compliance alerts mobile */
            .compliance-alerts {
                padding: 0.75rem 1rem;
            }

            .alert {
                flex-direction: column;
                align-items: flex-start;
                gap: 0.75rem;
            }

            .alert-actions {
                align-self: stretch;
            }

            .alert-btn {
                flex: 1;
            }

            /* Batch operations mobile */
            .batch-operations {
                padding: 0.75rem;
            }

            .batch-header {
                flex-direction: column;
                gap: 0.75rem;
                align-items: stretch;
            }

            .batch-actions {
                grid-template-columns: repeat(2, 1fr);
                gap: 0.5rem;
            }
        }

        /* Tablet specific adjustments */
        @media (min-width: 769px) and (max-width: 1024px) {
            .library-container {
                padding: 1.5rem;
            }

            .library-stats {
                grid-template-columns: repeat(3, 1fr);
            }

            .automation-grid {
                grid-template-columns: repeat(2, 1fr);
            }

            .documents-grid {
                grid-template-columns: repeat(2, 1fr);
            }

            .task-board {
                grid-template-columns: repeat(2, 1fr);
            }
        }

        /* Touch-friendly improvements */
        @media (hover: none) and (pointer: coarse) {
            /* Increase touch targets */
            .btn,
            .library-nav-btn,
            .document-card,
            .quick-action,
            .priority-filter-btn,
            .relationship-btn,
            .workflow-tab {
                min-height: 44px; /* iOS recommended minimum */
            }

            /* Remove hover effects on touch devices */
            .document-card:hover,
            .quick-action:hover,
            .automation-card:hover,
            .relationship-node:hover {
                transform: none;
                box-shadow: var(--shadow-sm);
            }

            /* Touch-friendly spacing */
            .toolbar-main-actions {
                gap: 1rem;
            }

            .batch-actions {
                gap: 0.75rem;
            }
        }

        /* Dark mode support for mobile */
        @media (prefers-color-scheme: dark) {
            :root {
                --gray-50: #1f2937;
                --gray-100: #374151;
                --gray-200: #4b5563;
                --gray-300: #6b7280;
                --gray-800: #f9fafb;
                --gray-900: #ffffff;
            }

            body {
                background: #111827;
                color: #f9fafb;
            }

            .library-content,
            .automation-panel,
            .workflow-panel,
            .relationships-panel {
                background: #1f2937;
                border-color: #374151;
            }

            .document-card,
            .automation-card,
            .relationship-node,
            .task-item {
                background: #374151;
                border-color: #4b5563;
                color: #f9fafb;
            }
        }

        /* PWA specific styles */
        .pwa-install-prompt {
            position: fixed;
            bottom: 1rem;
            left: 1rem;
            right: 1rem;
            background: var(--primary-gradient);
            color: white;
            padding: 1rem;
            border-radius: 12px;
            box-shadow: var(--shadow-lg);
            z-index: 9999;
            display: none;
            animation: slideInUp 0.3s ease-out;
        }

        .pwa-install-content {
            display: flex;
            align-items: center;
            gap: 1rem;
        }

        .pwa-install-icon {
            font-size: 1.5rem;
            flex-shrink: 0;
        }

        .pwa-install-text {
            flex: 1;
        }

        .pwa-install-title {
            font-size: 0.875rem;
            font-weight: 600;
            margin-bottom: 0.25rem;
        }

        .pwa-install-description {
            font-size: 0.8rem;
            opacity: 0.9;
        }

        .pwa-install-actions {
            display: flex;
            gap: 0.5rem;
        }

        .pwa-install-btn {
            padding: 0.5rem 1rem;
            border-radius: 6px;
            font-size: 0.8rem;
            font-weight: 500;
            border: none;
            cursor: pointer;
            transition: all 0.2s ease;
        }

        .pwa-install-btn-primary {
            background: white;
            color: #8b5cf6;
        }

        .pwa-install-btn-secondary {
            background: transparent;
            color: white;
            border: 1px solid rgba(255, 255, 255, 0.3);
        }

        @keyframes slideInUp {
            from {
                opacity: 0;
                transform: translateY(100%);
            }
            to {
                opacity: 1;
                transform: translateY(0);
            }
        }

        /* Offline indicator */
        .offline-indicator {
            position: fixed;
            top: 70px;
            left: 1rem;
            right: 1rem;
            background: var(--warning-color);
            color: white;
            padding: 0.75rem 1rem;
            border-radius: 8px;
            text-align: center;
            font-size: 0.875rem;
            font-weight: 500;
            z-index: 9998;
            display: none;
            animation: slideInDown 0.3s ease-out;
        }

        /* Loading states for mobile */
        .mobile-loading {
            display: flex;
            align-items: center;
            justify-content: center;
            min-height: 200px;
            color: var(--gray-500);
        }

        .mobile-loading-spinner {
            width: 32px;
            height: 32px;
            border: 3px solid var(--gray-200);
            border-top: 3px solid var(--primary-gradient);
            border-radius: 50%;
            animation: spin 1s linear infinite;
            margin-bottom: 1rem;
        }

        @keyframes spin {
            0% { transform: rotate(0deg); }
            100% { transform: rotate(360deg); }
        }

        /* ===== MISSING FEATURE 3: WORK ORDER INTEGRATION ===== */

        .workorder-integration-panel {
            background: white;
            border: 2px solid var(--gray-200);
            border-radius: 16px;
            margin-bottom: 1.5rem;
            overflow: hidden;
            box-shadow: var(--shadow-md);
        }

        .workorder-header {
            background: linear-gradient(135deg, #10b981 0%, #059669 100%);
            color: white;
            padding: 1rem 1.5rem;
            display: flex;
            align-items: center;
            justify-content: space-between;
        }

        .workorder-title {
            font-size: 1rem;
            font-weight: 600;
            display: flex;
            align-items: center;
            gap: 0.5rem;
        }

        .workorder-content {
            padding: 1.5rem;
        }

        .workorder-stats {
            display: grid;
            grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
            gap: 1rem;
            margin-bottom: 1.5rem;
        }

        .workorder-stat-card {
            background: var(--gray-50);
            border-radius: 12px;
            padding: 1.25rem;
            border: 2px solid var(--gray-200);
            transition: all 0.2s ease;
        }

        .workorder-stat-card:hover {
            border-color: #10b981;
            background: rgba(16, 185, 129, 0.05);
        }

        .workorder-stat-number {
            font-size: 1.5rem;
            font-weight: 700;
            color: #10b981;
            margin-bottom: 0.5rem;
        }

        .workorder-stat-label {
            font-size: 0.875rem;
            color: var(--gray-600);
            margin-bottom: 0.25rem;
        }

        .workorder-stat-detail {
            font-size: 0.75rem;
            color: var(--gray-500);
        }

        .active-workorders {
            background: var(--gray-50);
            border-radius: 12px;
            padding: 1.5rem;
            margin-bottom: 1.5rem;
        }

        .active-workorders-title {
            font-size: 1rem;
            font-weight: 600;
            color: var(--gray-800);
            margin-bottom: 1rem;
            display: flex;
            align-items: center;
            gap: 0.5rem;
        }

        .workorder-item {
            background: white;
            border: 1px solid var(--gray-200);
            border-radius: 8px;
            padding: 1rem;
            margin-bottom: 0.75rem;
            transition: all 0.2s ease;
        }

        .workorder-item:hover {
            border-color: #10b981;
            box-shadow: var(--shadow-sm);
        }

        .workorder-item-header {
            display: flex;
            align-items: center;
            justify-content: space-between;
            margin-bottom: 0.75rem;
        }

        .workorder-number {
            font-size: 0.875rem;
            font-weight: 600;
            color: var(--gray-800);
        }

        .workorder-status {
            padding: 0.25rem 0.75rem;
            border-radius: 12px;
            font-size: 0.75rem;
            font-weight: 500;
            text-transform: uppercase;
        }

        .workorder-status.in-progress {
            background: rgba(59, 130, 246, 0.1);
            color: #3b82f6;
        }

        .workorder-status.pending {
            background: rgba(245, 158, 11, 0.1);
            color: #f59e0b;
        }

        .workorder-status.completed {
            background: rgba(16, 185, 129, 0.1);
            color: #10b981;
        }

        .workorder-details {
            display: grid;
            grid-template-columns: 1fr 1fr;
            gap: 1rem;
            margin-bottom: 0.75rem;
        }

        .workorder-detail {
            font-size: 0.8rem;
            color: var(--gray-600);
        }

        .workorder-detail-label {
            font-weight: 500;
            color: var(--gray-700);
        }

        .workorder-documents {
            border-top: 1px solid var(--gray-200);
            padding-top: 0.75rem;
        }

        .workorder-documents-title {
            font-size: 0.8rem;
            font-weight: 500;
            color: var(--gray-700);
            margin-bottom: 0.5rem;
        }

        .workorder-doc-list {
            display: flex;
            flex-wrap: wrap;
            gap: 0.5rem;
        }

        .workorder-doc-tag {
            background: rgba(16, 185, 129, 0.1);
            color: #10b981;
            padding: 0.25rem 0.75rem;
            border-radius: 12px;
            font-size: 0.75rem;
            font-weight: 500;
            border: 1px solid rgba(16, 185, 129, 0.2);
            cursor: pointer;
            transition: all 0.2s ease;
        }

        .workorder-doc-tag:hover {
            background: rgba(16, 185, 129, 0.2);
            border-color: #10b981;
        }

        .workorder-actions {
            display: flex;
            gap: 0.5rem;
            margin-top: 0.75rem;
        }

        .workorder-btn {
            padding: 0.5rem 1rem;
            border-radius: 6px;
            font-size: 0.8rem;
            font-weight: 500;
            border: none;
            cursor: pointer;
            transition: all 0.2s ease;
            text-decoration: none;
            display: inline-flex;
            align-items: center;
            gap: 0.25rem;
        }

        .workorder-btn-primary {
            background: #10b981;
            color: white;
        }

        .workorder-btn-primary:hover {
            background: #059669;
        }

        .workorder-btn-secondary {
            background: var(--gray-200);
            color: var(--gray-700);
        }

        .workorder-btn-secondary:hover {
            background: var(--gray-300);
        }

        .document-usage-tracker {
            background: var(--gray-50);
            border-radius: 12px;
            padding: 1.5rem;
        }

        .usage-tracker-title {
            font-size: 1rem;
            font-weight: 600;
            color: var(--gray-800);
            margin-bottom: 1rem;
            display: flex;
            align-items: center;
            gap: 0.5rem;
        }

        .usage-timeline {
            position: relative;
            padding-left: 2rem;
        }

        .usage-timeline::before {
            content: '';
            position: absolute;
            left: 0.75rem;
            top: 0;
            bottom: 0;
            width: 2px;
            background: var(--gray-300);
        }

        .usage-event {
            position: relative;
            margin-bottom: 1.5rem;
        }

        .usage-event::before {
            content: '';
            position: absolute;
            left: -1.75rem;
            top: 0.25rem;
            width: 12px;
            height: 12px;
            background: #10b981;
            border: 3px solid white;
            border-radius: 50%;
            box-shadow: 0 0 0 2px #10b981;
        }

        .usage-event.current::before {
            background: #3b82f6;
            box-shadow: 0 0 0 2px #3b82f6;
            animation: pulse-blue 2s infinite;
        }

        .usage-event-content {
            background: white;
            border: 1px solid var(--gray-200);
            border-radius: 8px;
            padding: 1rem;
        }

        .usage-event-header {
            display: flex;
            align-items: center;
            justify-content: between;
            margin-bottom: 0.5rem;
        }

        .usage-event-title {
            font-size: 0.875rem;
            font-weight: 600;
            color: var(--gray-800);
        }

        .usage-event-time {
            font-size: 0.75rem;
            color: var(--gray-500);
            margin-left: auto;
        }

        .usage-event-description {
            font-size: 0.8rem;
            color: var(--gray-600);
            margin-bottom: 0.5rem;
        }

        .usage-event-metadata {
            display: flex;
            gap: 1rem;
            font-size: 0.75rem;
            color: var(--gray-500);
        }

        @keyframes pulse-blue {
            0%, 100% { 
                box-shadow: 0 0 0 2px #3b82f6;
            }
            50% { 
                box-shadow: 0 0 0 6px rgba(59, 130, 246, 0.3);
            }
        }

        /* Document integration indicators */
        .document-workorder-indicator {
            position: absolute;
            top: 0.75rem;
            left: 0.75rem;
            background: #10b981;
            color: white;
            padding: 0.25rem 0.5rem;
            border-radius: 12px;
            font-size: 0.65rem;
            font-weight: 600;
            text-transform: uppercase;
            display: flex;
            align-items: center;
            gap: 0.25rem;
            z-index: 2;
        }

        .document-workorder-indicator.multiple {
            background: #3b82f6;
        }

        .document-workorder-count {
            background: rgba(255, 255, 255, 0.3);
            padding: 0.1rem 0.3rem;
            border-radius: 8px;
            font-size: 0.6rem;
        }

        /* ===== PRODUCTION POLISH: VIEW TOGGLE & TABLE VIEW ===== */
        
        .view-toggle {
            display: flex;
            background: var(--gray-100);
            border-radius: 8px;
            padding: 0.25rem;
            gap: 0.25rem;
        }

        .view-toggle-btn {
            width: 36px;
            height: 36px;
            border: none;
            background: transparent;
            border-radius: 6px;
            cursor: pointer;
            font-size: 0.875rem;
            color: var(--gray-600);
            transition: all 0.2s ease;
            display: flex;
            align-items: center;
            justify-content: center;
        }

        .view-toggle-btn.active {
            background: white;
            color: var(--primary-color);
            box-shadow: var(--shadow-sm);
        }

        .view-toggle-btn:hover:not(.active) {
            color: var(--gray-700);
            background: rgba(255, 255, 255, 0.5);
        }

        /* Either/Or View Styles */
        .documents-grid {
            display: grid;
            grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
            gap: 1rem;
            padding: 1.5rem;
            min-height: 400px;
        }

        .documents-grid.hidden {
            display: none !important;
        }

        /* Table view styles */
        .documents-table {
            display: none;
            background: white;
            border-radius: 12px;
            overflow: hidden;
            box-shadow: var(--shadow-sm);
            border: 1px solid var(--gray-200);
        }

        .documents-table.visible {
            display: block;
        }

        .documents-table-header {
            background: var(--gray-50);
            border-bottom: 1px solid var(--gray-200);
            padding: 1rem 1.5rem;
            font-weight: 600;
            color: var(--gray-700);
            display: grid;
            grid-template-columns: 2fr 1fr 1fr 1fr 120px;
            gap: 1rem;
            align-items: center;
        }

        .documents-table-row {
            padding: 1rem 1.5rem;
            border-bottom: 1px solid var(--gray-100);
            display: grid;
            grid-template-columns: 2fr 1fr 1fr 1fr 120px;
            gap: 1rem;
            align-items: center;
            transition: all 0.2s ease;
            cursor: pointer;
        }

        .documents-table-row:hover {
            background: var(--gray-50);
        }

        .documents-table-row:last-child {
            border-bottom: none;
        }

        .table-cell-title {
            font-weight: 600;
            color: var(--gray-800);
            display: flex;
            align-items: center;
            gap: 0.75rem;
        }

        .table-cell-icon {
            width: 32px;
            height: 32px;
            background: var(--primary-gradient);
            border-radius: 6px;
            display: flex;
            align-items: center;
            justify-content: center;
            color: white;
            font-size: 0.875rem;
            flex-shrink: 0;
        }

        .table-cell-content {
            flex: 1;
        }

        .table-cell-title-text {
            font-size: 0.875rem;
            margin-bottom: 0.25rem;
        }

        .table-cell-subtitle {
            font-size: 0.75rem;
            color: var(--gray-500);
        }

        .table-cell-status {
            display: flex;
            align-items: center;
            gap: 0.5rem;
        }

        .table-status-indicator {
            width: 8px;
            height: 8px;
            border-radius: 50%;
        }

        .table-status-indicator.current { background: var(--success-color); }
        .table-status-indicator.expiring { background: var(--warning-color); }
        .table-status-indicator.expired { background: var(--error-color); }

        .table-cell-category {
            padding: 0.25rem 0.75rem;
            background: var(--gray-100);
            border-radius: 12px;
            font-size: 0.75rem;
            color: var(--gray-700);
            text-align: center;
        }



        .table-cell-actions {
            display: flex;
            gap: 0.5rem;
        }

        .table-action-btn {
            padding: 0.375rem;
            border: none;
            background: var(--gray-100);
            border-radius: 4px;
            cursor: pointer;
            color: var(--gray-600);
            transition: all 0.2s ease;
            font-size: 0.75rem;
        }

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

        /* Hide table view by default */
        .documents-table {
            display: none;
        }

        /* Show table view when active */
        body.table-view .documents-grid {
            display: none;
        }

        body.table-view .documents-table {
            display: block;
        }

        /* Enhanced search dropdown */
        .search-container {
            position: relative;
            max-width: 400px;
            flex: 1;
        }

        .search-input {
            width: 100%;
            padding: 0.75rem 1rem 0.75rem 3rem;
            border: 2px solid var(--gray-200);
            border-radius: 8px;
            font-size: 0.875rem;
            background: white;
            transition: all 0.2s ease;
        }

        .search-input:focus {
            outline: none;
            border-color: var(--primary-color);
            box-shadow: 0 0 0 3px rgba(139, 92, 246, 0.1);
        }

        .search-icon {
            position: absolute;
            left: 1rem;
            top: 50%;
            transform: translateY(-50%);
            color: var(--gray-400);
            pointer-events: none;
        }

        .search-suggestions {
            position: absolute;
            top: 100%;
            left: 0;
            right: 0;
            background: white;
            border: 1px solid var(--gray-200);
            border-radius: 8px;
            box-shadow: var(--shadow-lg);
            max-height: 300px;
            overflow-y: auto;
            z-index: 1000;
            margin-top: 0.25rem;
        }

        .search-suggestion {
            padding: 0.75rem 1rem;
            border-bottom: 1px solid var(--gray-100);
            cursor: pointer;
            transition: all 0.2s ease;
        }

        .search-suggestion:hover {
            background: var(--gray-50);
        }

        .search-suggestion:last-child {
            border-bottom: none;
        }

        .suggestion-title {
            font-size: 0.875rem;
            font-weight: 500;
            color: var(--gray-800);
            margin-bottom: 0.25rem;
        }

        .suggestion-meta {
            font-size: 0.75rem;
            color: var(--gray-500);
        }

        /* General production polish */
        .library-toolbar {
            padding: 1.5rem 2rem;
        }

        .quick-actions {
            margin-bottom: 1.5rem;
        }

        .priority-filters {
            margin-bottom: 1rem;
            padding: 0 0.5rem;
        }

        /* Improve button spacing */
        .toolbar-main-actions {
            gap: 1rem;
            align-items: center;
        }

        /* Better focus states for accessibility */
        .btn:focus,
        .view-toggle-btn:focus,
        .search-input:focus {
            outline: 2px solid var(--primary-color);
            outline-offset: 2px;
        }

        /* Improve loading states */
        .loading {
            display: flex;
            align-items: center;
            justify-content: center;
            min-height: 200px;
            color: var(--gray-500);
            flex-direction: column;
            gap: 1rem;
        }

        .loading-spinner {
            width: 32px;
            height: 32px;
            border: 3px solid var(--gray-200);
            border-top: 3px solid var(--primary-color);
            border-radius: 50%;
            animation: spin 1s linear infinite;
        }

        /* Better empty state styling */
        .empty-state {
            text-align: center;
            padding: 3rem 2rem;
            color: var(--gray-500);
        }

        .empty-state h3 {
            color: var(--gray-700);
            margin-bottom: 0.5rem;
        }

        .empty-state p {
            margin-bottom: 1.5rem;
        }

        /* Improve panel transitions */
        .automation-panel,
        .workflow-panel,
        .relationships-panel,
        .workorder-integration-panel {
            transition: all 0.3s ease;
        }

        /* Better responsive spacing */
        @media (max-width: 768px) {
            .library-toolbar {
                padding: 1rem;
            }
            
            .view-toggle {
                order: 2;
                margin-right: 0;
                margin-top: 0.75rem;
                width: 100%;
            }
            
            .view-toggle-btn {
                flex: 1;
                justify-content: center;
            }
        }

        /* Enhanced Dashboard Layout */
        .library-dashboard {
            display: grid;
            grid-template-columns: 280px 1fr;
            gap: 2rem;
            margin-bottom: 2rem;
        }

        /* Modern Sidebar Navigation */
        .library-sidebar {
            background: white;
            border-radius: 16px;
            padding: 1.5rem;
            box-shadow: var(--shadow-md);
            height: fit-content;
            position: sticky;
            top: 2rem;
        }

        .sidebar-header {
            margin-bottom: 1.5rem;
        }

        .sidebar-title {
            font-size: 1.125rem;
            font-weight: 600;
            color: var(--gray-800);
            margin-bottom: 0.5rem;
        }

        .sidebar-subtitle {
            font-size: 0.875rem;
            color: var(--gray-500);
        }

        .library-nav-btn {
            display: flex;
            align-items: center;
            gap: 0.75rem;
            padding: 0.75rem 1rem;
            border-radius: 8px;
            background: transparent;
            border: none;
            width: 100%;
            text-align: left;
            font-size: 0.875rem;
            color: var(--gray-600);
            cursor: pointer;
            transition: all 0.2s ease;
            margin-bottom: 0.25rem;
        }

        .library-nav-btn:hover {
            background: var(--gray-100);
            color: var(--gray-800);
        }

        .library-nav-btn.active {
            background: var(--primary-gradient);
            color: white;
        }

        .library-nav-btn i {
            width: 16px;
            font-size: 0.875rem;
        }

        .category-count {
            margin-left: auto;
            background: var(--gray-200);
            color: var(--gray-600);
            padding: 0.125rem 0.5rem;
            border-radius: 12px;
            font-size: 0.75rem;
            font-weight: 500;
        }

        .library-nav-btn.active .category-count {
            background: rgba(255, 255, 255, 0.2);
            color: white;
        }

        /* Enhanced Content Area */
        .library-content {
            background: white;
            border-radius: 16px;
            box-shadow: var(--shadow-md);
            overflow: hidden;
        }

        /* Modern Toolbar */
        .library-toolbar {
            padding: 1.5rem;
            border-bottom: 1px solid var(--gray-200);
            background: var(--gray-50);
        }

        .toolbar-main {
            display: flex;
            justify-content: space-between;
            align-items: center;
            margin-bottom: 1rem;
        }

        .toolbar-secondary {
            display: flex;
            justify-content: space-between;
            align-items: center;
            padding-top: 1rem;
            border-top: 1px solid var(--gray-100);
        }

        .content-title {
            font-size: 1.5rem;
            font-weight: 600;
            color: var(--gray-800);
        }

        .toolbar-main-actions {
            display: flex;
            gap: 0.75rem;
            align-items: center;
            flex-wrap: wrap;
        }

        /* Filter Pills */
        .filter-pills {
            display: flex;
            gap: 0.5rem;
            flex-wrap: wrap;
        }

        .filter-pill {
            padding: 0.375rem 0.875rem;
            background: var(--gray-100);
            border-radius: 16px;
            font-size: 0.8rem;
            font-weight: 500;
            color: var(--gray-600);
            cursor: pointer;
            transition: all 0.2s ease;
            display: flex;
            align-items: center;
            gap: 0.375rem;
            border: 1px solid transparent;
        }

        .filter-pill:hover {
            background: var(--gray-200);
            color: var(--gray-700);
        }

        .filter-pill.active {
            background: var(--primary-color);
            color: white;
            border-color: var(--primary-color);
        }

        .pill-count {
            background: rgba(255, 255, 255, 0.3);
            color: inherit;
            padding: 0.125rem 0.5rem;
            border-radius: 12px;
            font-size: 0.75rem;
            font-weight: 600;
            min-width: 20px;
            text-align: center;
        }

        .filter-pill.active .pill-count {
            background: rgba(255, 255, 255, 0.3);
            color: white;
        }

        /* Right Actions */
        .toolbar-right-actions {
            display: flex;
            align-items: center;
            gap: 1rem;
        }

        /* AI Tools Dropdown */
        .ai-tools-dropdown {
            position: relative;
        }

        .ai-tools-menu {
            position: absolute;
            top: 100%;
            right: 0;
            background: white;
            border: 1px solid var(--gray-200);
            border-radius: 8px;
            box-shadow: var(--shadow-lg);
            min-width: 200px;
            padding: 0.5rem 0;
            display: none;
            z-index: 1000;
        }

        .ai-tools-menu.show {
            display: block;
        }

        .ai-tool-item {
            width: 100%;
            padding: 0.75rem 1rem;
            background: transparent;
            border: none;
            text-align: left;
            cursor: pointer;
            font-size: 0.875rem;
            color: var(--gray-700);
            transition: all 0.2s ease;
            display: flex;
            align-items: center;
            gap: 0.75rem;
        }

        .ai-tool-item:hover {
            background: var(--gray-50);
            color: var(--gray-900);
        }

        .ai-tool-item i {
            width: 16px;
            text-align: center;
            color: var(--gray-500);
        }

        .ai-tools-divider {
            height: 1px;
            background: var(--gray-200);
            margin: 0.5rem 0;
        }

        /* Enhanced Search */
        .search-container {
            position: relative;
            flex: 1;
            max-width: 400px;
        }

        .search-input {
            width: 100%;
            padding: 0.75rem 1rem 0.75rem 3rem;
            border: 2px solid var(--gray-200);
            border-radius: 12px;
            font-size: 0.875rem;
            transition: all 0.2s ease;
            background: white;
        }

        .search-input:focus {
            outline: none;
            border-color: #8b5cf6;
            box-shadow: 0 0 0 3px rgba(139, 92, 246, 0.1);
        }

        .search-icon {
            position: absolute;
            left: 1rem;
            top: 50%;
            transform: translateY(-50%);
            color: var(--gray-400);
        }

        /* Modern Buttons */
        .btn {
            display: inline-flex;
            align-items: center;
            gap: 0.5rem;
            padding: 0.75rem 1.5rem;
            border-radius: 8px;
            font-size: 0.875rem;
            font-weight: 500;
            text-decoration: none;
            border: none;
            cursor: pointer;
            transition: all 0.2s ease;
        }

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

        .btn-primary:hover {
            background: var(--primary-hover);
            transform: translateY(-1px);
        }

        .btn-secondary {
            background: white;
            color: var(--gray-700);
            border: 2px solid var(--gray-200);
        }

        .btn-secondary:hover {
            border-color: var(--gray-300);
            background: var(--gray-50);
        }

        /* Quick Actions */
        .quick-actions {
            display: flex;
            gap: 1rem;
            margin-bottom: 1.5rem;
        }

        .quick-action {
            background: white;
            border: 2px solid var(--gray-200);
            border-radius: 12px;
            padding: 1rem;
            text-align: center;
            cursor: pointer;
            transition: all 0.2s ease;
            flex: 1;
        }

        .quick-action:hover {
            border-color: #8b5cf6;
            transform: translateY(-2px);
            box-shadow: var(--shadow-md);
        }

        .quick-action-icon {
            font-size: 1.5rem;
            color: #8b5cf6;
            margin-bottom: 0.5rem;
        }

        .quick-action-title {
            font-size: 0.875rem;
            font-weight: 500;
            color: var(--gray-800);
        }

        /* Enhanced Document Grid */
        .documents-grid {
            display: grid;
            grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
            gap: 1rem;
            padding: 1.5rem;
            min-height: 400px;
        }

        .document-card {
            background: white;
            border: 2px solid var(--gray-100);
            border-radius: 12px;
            padding: 1.25rem;
            transition: all 0.2s ease;
            cursor: pointer;
            position: relative;
        }

        .document-card:hover {
            border-color: #8b5cf6;
            transform: translateY(-2px);
            box-shadow: var(--shadow-lg);
        }

        .document-header {
            display: flex;
            align-items: flex-start;
            gap: 1rem;
            margin-bottom: 1rem;
        }

        .document-icon {
            width: 48px;
            height: 48px;
            background: var(--primary-gradient);
            border-radius: 12px;
            display: flex;
            align-items: center;
            justify-content: center;
            color: white;
            font-size: 1.25rem;
        }

        .document-info {
            flex: 1;
        }

        .document-title {
            font-size: 1rem;
            font-weight: 600;
            color: var(--gray-800);
            margin-bottom: 0.25rem;
            line-height: 1.4;
        }

        .document-id {
            font-size: 0.75rem;
            color: var(--gray-500);
            font-family: 'SF Mono', Monaco, monospace;
            background: var(--gray-100);
            padding: 0.125rem 0.5rem;
            border-radius: 4px;
            display: inline-block;
        }

        .document-meta {
            display: flex;
            flex-wrap: wrap;
            gap: 0.5rem;
            margin-bottom: 1rem;
        }

        .meta-tag {
            font-size: 0.75rem;
            padding: 0.25rem 0.5rem;
            border-radius: 12px;
            font-weight: 500;
        }

        .meta-category {
            background: rgba(139, 92, 246, 0.1);
            color: #7c3aed;
        }

        .meta-status {
            background: rgba(16, 185, 129, 0.1);
            color: #059669;
        }

        .meta-status.pending {
            background: rgba(245, 158, 11, 0.1);
            color: #d97706;
        }

        .meta-status.draft {
            background: rgba(107, 114, 128, 0.1);
            color: #4b5563;
        }

        .document-footer {
            display: flex;
            justify-content: space-between;
            align-items: center;
            margin-top: 1rem;
            padding-top: 1rem;
            border-top: 1px solid var(--gray-100);
        }

        .document-date {
            font-size: 0.75rem;
            color: var(--gray-500);
        }

        .document-actions {
            display: flex;
            gap: 0.5rem;
        }

        .action-btn {
            padding: 0.375rem;
            border: none;
            background: var(--gray-100);
            color: var(--gray-600);
            border-radius: 6px;
            cursor: pointer;
            transition: all 0.2s ease;
            font-size: 0.875rem;
        }

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

        /* Priority Indicators */
        .priority-indicator {
            position: absolute;
            top: 1rem;
            right: 1rem;
            width: 8px;
            height: 8px;
            border-radius: 50%;
        }

        .priority-critical {
            background: var(--error-color);
            box-shadow: 0 0 0 3px rgba(239, 68, 68, 0.3);
        }

        .priority-important {
            background: var(--warning-color);
            box-shadow: 0 0 0 3px rgba(245, 158, 11, 0.3);
        }

        /* Enhanced Upload Modal */
        .modal {
            position: fixed;
            top: 0;
            left: 0;
            width: 100%;
            height: 100%;
            background: rgba(0, 0, 0, 0.5);
            display: none;
            align-items: center;
            justify-content: center;
            z-index: 1000;
            backdrop-filter: blur(4px);
        }

        .modal.show {
            display: flex;
        }

        .modal-content {
            background: white;
            border-radius: 16px;
            width: 90%;
            max-width: 800px;
            max-height: 90vh;
            overflow: hidden;
            box-shadow: var(--shadow-xl);
            animation: modalSlideIn 0.3s ease;
        }

        @keyframes modalSlideIn {
            from {
                opacity: 0;
                transform: scale(0.9) translateY(20px);
            }
            to {
                opacity: 1;
                transform: scale(1) translateY(0);
            }
        }

        .modal-header {
            padding: 2rem 2rem 1rem;
            border-bottom: 1px solid var(--gray-200);
            background: var(--gray-50);
        }

        .modal-title {
            font-size: 1.5rem;
            font-weight: 600;
            color: var(--gray-800);
            display: flex;
            align-items: center;
            gap: 0.75rem;
        }

        .modal-body {
            padding: 2rem;
            max-height: 60vh;
            overflow-y: auto;
        }

        .modal-footer {
            padding: 1rem 2rem 2rem;
            display: flex;
            justify-content: space-between;
            align-items: center;
            background: var(--gray-50);
        }

        /* Enhanced Form Styles */
        .form-grid {
            display: grid;
            grid-template-columns: 1fr 1fr;
            gap: 1.5rem;
            margin-bottom: 1.5rem;
        }

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

        .form-group.full-width {
            grid-column: 1 / -1;
        }

        .form-label {
            display: block;
            font-size: 0.875rem;
            font-weight: 500;
            color: var(--gray-700);
            margin-bottom: 0.5rem;
        }

        .form-control {
            width: 100%;
            padding: 0.75rem;
            border: 2px solid var(--gray-200);
            border-radius: 8px;
            font-size: 0.875rem;
            transition: all 0.2s ease;
            background: white;
        }

        .form-control:focus {
            outline: none;
            border-color: #8b5cf6;
            box-shadow: 0 0 0 3px rgba(139, 92, 246, 0.1);
        }

        .form-text {
            font-size: 0.75rem;
            color: var(--gray-500);
            margin-top: 0.25rem;
            display: block;
        }

        /* Aircraft Applicability Section Styles */
        #aircraftApplicabilitySection {
            animation: slideDown 0.3s ease-out;
        }

        @keyframes slideDown {
            from {
                opacity: 0;
                max-height: 0;
                transform: translateY(-10px);
            }
            to {
                opacity: 1;
                max-height: 1000px;
                transform: translateY(0);
            }
        }

        /* Enhanced form styling for aircraft section */
        #aircraftApplicabilitySection .form-control {
            border: 1px solid var(--gray-300);
            transition: all 0.2s ease;
        }

        #aircraftApplicabilitySection .form-control:focus {
            border-color: #8b5cf6;
            box-shadow: 0 0 0 3px rgba(139, 92, 246, 0.1);
        }

        #aircraftApplicabilitySection .form-control:disabled {
            background-color: var(--gray-100);
            color: var(--gray-500);
            cursor: not-allowed;
        }

        /* Enhanced File Upload */
        .file-upload-area {
            border: 2px dashed var(--gray-300);
            border-radius: 12px;
            padding: 3rem 2rem;
            text-align: center;
            background: var(--gray-50);
            transition: all 0.2s ease;
            cursor: pointer;
        }

        .file-upload-area:hover {
            border-color: #8b5cf6;
            background: rgba(139, 92, 246, 0.05);
        }

        .file-upload-area.dragover,
        .file-upload-area.drag-over {
            border-color: #8b5cf6;
            background: rgba(139, 92, 246, 0.1);
        }
        
        /* Tags Input Styling */
        .tags-input-container {
            border: 1px solid var(--gray-300);
            border-radius: 8px;
            padding: 8px;
            background: var(--bg-white);
            min-height: 50px;
            display: flex;
            flex-wrap: wrap;
            gap: 8px;
            align-items: center;
        }
        
        .tags-input-container:focus-within {
            border-color: var(--primary);
            box-shadow: 0 0 0 3px rgba(139, 92, 246, 0.1);
        }
        
        .tags-display {
            display: flex;
            flex-wrap: wrap;
            gap: 6px;
        }
        
        .tag-item {
            background: var(--primary);
            color: white;
            padding: 4px 10px;
            border-radius: 16px;
            font-size: 0.875rem;
            display: inline-flex;
            align-items: center;
            gap: 6px;
        }
        
        .tag-item .remove-tag {
            cursor: pointer;
            font-size: 1rem;
            line-height: 1;
            opacity: 0.8;
            transition: opacity 0.2s;
        }
        
        .tag-item .remove-tag:hover {
            opacity: 1;
        }
        
        .tags-input {
            border: none;
            outline: none;
            flex: 1;
            min-width: 120px;
            font-size: 0.875rem;
            padding: 4px 0;
        }

        .file-upload-icon {
            font-size: 3rem;
            color: #8b5cf6;
            margin-bottom: 1rem;
        }

        .file-upload-text {
            font-size: 1.125rem;
            font-weight: 500;
            color: var(--gray-700);
            margin-bottom: 0.5rem;
        }

        .file-upload-hint {
            font-size: 0.875rem;
            color: var(--gray-500);
        }

        /* Tab Navigation */
        .tab-navigation {
            display: flex;
            gap: 0.5rem;
            margin-bottom: 2rem;
            background: var(--gray-100);
            padding: 0.5rem;
            border-radius: 12px;
        }

        .tab-btn {
            flex: 1;
            padding: 0.75rem 1rem;
            border: none;
            background: transparent;
            border-radius: 8px;
            font-size: 0.875rem;
            font-weight: 500;
            color: var(--gray-600);
            cursor: pointer;
            transition: all 0.2s ease;
            display: flex;
            align-items: center;
            justify-content: center;
            gap: 0.5rem;
        }

        .tab-btn.active {
            background: white;
            color: #8b5cf6;
            box-shadow: var(--shadow-sm);
        }

        .tab-content {
            display: none;
        }

        .tab-content.active {
            display: block;
        }

        /* Custom Toggle Switch */
        .toggle-switch {
            position: relative;
            display: inline-block;
            width: 48px;
            height: 24px;
        }

        .toggle-switch input {
            opacity: 0;
            width: 0;
            height: 0;
        }

        .toggle-slider {
            position: absolute;
            cursor: pointer;
            top: 0;
            left: 0;
            right: 0;
            bottom: 0;
            background-color: var(--gray-300);
            transition: 0.2s;
            border-radius: 24px;
        }

        .toggle-slider:before {
            position: absolute;
            content: "";
            height: 18px;
            width: 18px;
            left: 3px;
            bottom: 3px;
            background-color: white;
            transition: 0.2s;
            border-radius: 50%;
            box-shadow: var(--shadow-sm);
        }

        input:checked + .toggle-slider {
            background: var(--primary-gradient);
        }

        input:checked + .toggle-slider:before {
            transform: translateX(24px);
        }

        /* Empty State */
        .empty-state {
            text-align: center;
            padding: 4rem 2rem;
            color: var(--gray-500);
        }

        .empty-state-icon {
            font-size: 4rem;
            margin-bottom: 1rem;
            color: var(--gray-300);
        }

        .empty-state-title {
            font-size: 1.25rem;
            font-weight: 600;
            color: var(--gray-700);
            margin-bottom: 0.5rem;
        }

        .empty-state-message {
            font-size: 0.875rem;
            margin-bottom: 2rem;
        }

        /* Loading States */
        .loading {
            display: flex;
            align-items: center;
            justify-content: center;
            padding: 4rem;
            color: var(--gray-500);
        }

        .loading-spinner {
            width: 2rem;
            height: 2rem;
            border: 3px solid var(--gray-200);
            border-top: 3px solid #8b5cf6;
            border-radius: 50%;
            animation: spin 1s linear infinite;
            margin-right: 1rem;
        }

        @keyframes spin {
            0% { transform: rotate(0deg); }
            100% { transform: rotate(360deg); }
        }

        /* Responsive Design */
        @media (max-width: 1024px) {
            .library-dashboard {
                grid-template-columns: 1fr;
            }
            
            .library-sidebar {
                position: static;
            }
            
            .form-grid {
                grid-template-columns: 1fr;
            }
        }

        @media (max-width: 768px) {
            .library-container {
                padding: 1rem;
            }
            
            .library-header {
                padding: 2rem 1rem;
            }
            
            .library-title {
                font-size: 2rem;
            }
            
            .library-stats {
                grid-template-columns: repeat(2, 1fr);
            }
            
            .documents-grid {
                grid-template-columns: 1fr;
                padding: 1rem;
            }
            
            .modal-content {
                width: 95%;
                margin: 1rem;
            }
            
            .modal-body {
                padding: 1rem;
            }
        }

        /* ===== COMPREHENSIVE VISUAL UPDATE TO MATCH ENHANCED DESIGN ===== */

        /* Enhanced Header Gradient - Matching the screenshot */
        .library-header {
            background: linear-gradient(135deg, #667eea 0%, #764ba2 100%) !important;
            border-radius: 16px;
            padding: 3rem 2rem;
            color: white;
            margin-bottom: 2rem;
            position: relative;
            overflow: hidden;
        }

        .stat-card {
            background: rgba(255, 255, 255, 0.1) !important;
            border-radius: 12px;
            padding: 1.5rem;
            backdrop-filter: blur(10px);
            border: 1px solid rgba(255, 255, 255, 0.2);
            position: relative;
            overflow: hidden;
        }

        .stat-number {
            font-size: 2rem;
            font-weight: 700;
            margin-bottom: 0.25rem;
            position: relative;
            z-index: 1;
            color: white;
        }

        .stat-label {
            font-size: 0.875rem;
            opacity: 0.8;
            position: relative;
            z-index: 1;
            color: white;
        }

        /* Orange Compliance Alert Bar */
        .compliance-alert-bar {
            background: linear-gradient(135deg, #f59e0b, #d97706);
            border-radius: 12px;
            padding: 1rem 1.5rem;
            margin-bottom: 2rem;
            color: white;
            display: flex;
            align-items: center;
            justify-content: space-between;
            box-shadow: var(--shadow-md);
        }

        .alert-content {
            display: flex;
            align-items: center;
            gap: 1rem;
            flex: 1;
        }

        .alert-icon {
            font-size: 1.5rem;
            animation: pulse-alert 2s infinite;
        }

        @keyframes pulse-alert {
            0%, 100% { opacity: 1; }
            50% { opacity: 0.7; }
        }

        .alert-text {
            font-weight: 600;
            font-size: 1rem;
        }

        .alert-text + div {
            font-size: 0.875rem;
            opacity: 0.9;
        }

        .alert-actions {
            display: flex;
            gap: 0.75rem;
        }

        .alert-btn {
            background: rgba(255, 255, 255, 0.2);
            border: 1px solid rgba(255, 255, 255, 0.3);
            color: white;
            padding: 0.5rem 1rem;
            border-radius: 6px;
            font-size: 0.875rem;
            cursor: pointer;
            transition: all 0.2s ease;
            display: flex;
            align-items: center;
            gap: 0.5rem;
        }

        .alert-btn:hover {
            background: rgba(255, 255, 255, 0.3);
        }

        /* Enhanced Quick Actions Cards */
        .quick-actions-enhanced {
            display: grid;
            grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
            gap: 1rem;
            margin-bottom: 2rem;
        }

        .quick-action-enhanced {
            background: white;
            border: 2px solid var(--gray-200);
            border-radius: 12px;
            padding: 1.5rem;
            cursor: pointer;
            transition: all 0.3s ease;
            position: relative;
            overflow: hidden;
        }

        .quick-action-enhanced:hover {
            border-color: #8b5cf6;
            transform: translateY(-4px);
            box-shadow: var(--shadow-lg);
        }

        .quick-action-enhanced::before {
            content: '';
            position: absolute;
            top: 0;
            left: 0;
            right: 0;
            height: 4px;
            background: var(--primary-gradient);
            transform: scaleX(0);
            transition: transform 0.3s ease;
        }

        .quick-action-enhanced:hover::before {
            transform: scaleX(1);
        }

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

        .quick-action-icon-enhanced {
            width: 48px;
            height: 48px;
            background: var(--primary-gradient);
            border-radius: 12px;
            display: flex;
            align-items: center;
            justify-content: center;
            color: white;
            font-size: 1.25rem;
        }

        .quick-action-content {
            flex: 1;
        }

        .quick-action-title-enhanced {
            font-size: 1rem;
            font-weight: 600;
            color: var(--gray-800);
            margin-bottom: 0.25rem;
        }

        .quick-action-description {
            font-size: 0.875rem;
            color: var(--gray-600);
        }

        .quick-action-metric {
            display: flex;
            align-items: center;
            gap: 0.5rem;
            margin-top: 1rem;
            padding-top: 1rem;
            border-top: 1px solid var(--gray-100);
        }

        .metric-number {
            font-size: 1.5rem;
            font-weight: 700;
            color: var(--gray-800);
        }

        .metric-label {
            font-size: 0.75rem;
            color: var(--gray-500);
        }

        /* Enhanced Sidebar */
        .library-sidebar {
            background: white !important;
            border-radius: 16px;
            padding: 1.5rem;
            box-shadow: var(--shadow-md);
            height: fit-content;
            position: sticky;
            top: 2rem;
            border: 1px solid var(--gray-200);
        }

        .sidebar-section {
            margin-bottom: 2rem;
        }

        .sidebar-section:last-child {
            margin-bottom: 0;
        }

        .sidebar-section-title {
            font-size: 1rem;
            font-weight: 600;
            color: var(--gray-800);
            margin-bottom: 1rem;
            display: flex;
            align-items: center;
            gap: 0.5rem;
        }

        /* Compliance Filters Green Gradient */
        .compliance-filters {
            background: linear-gradient(135deg, #10b981, #059669);
            border-radius: 12px;
            padding: 1rem;
            color: white;
        }

        .compliance-filter-title {
            font-size: 0.875rem;
            font-weight: 600;
            margin-bottom: 0.75rem;
            display: flex;
            align-items: center;
            gap: 0.5rem;
        }

        .compliance-filter {
            display: flex;
            align-items: center;
            gap: 0.5rem;
            padding: 0.5rem 0.75rem;
            border-radius: 6px;
            margin-bottom: 0.5rem;
            cursor: pointer;
            transition: all 0.2s ease;
            font-size: 0.75rem;
            background: rgba(255, 255, 255, 0.1);
        }

        .compliance-filter:hover {
            background: rgba(255, 255, 255, 0.2);
        }

        .compliance-filter.active {
            background: rgba(255, 255, 255, 0.3);
        }

        .compliance-filter:last-child {
            margin-bottom: 0;
        }

        /* Enhanced Document Cards */
        .document-header-enhanced {
            display: flex;
            align-items: flex-start;
            gap: 1rem;
            margin-bottom: 1rem;
        }

        .document-icon-enhanced {
            width: 48px;
            height: 48px;
            background: var(--primary-gradient);
            border-radius: 12px;
            display: flex;
            align-items: center;
            justify-content: center;
            color: white;
            font-size: 1.25rem;
            flex-shrink: 0;
        }

        .document-info-enhanced {
            flex: 1;
        }

        .document-title-enhanced {
            font-size: 1rem;
            font-weight: 600;
            color: var(--gray-800);
            margin-bottom: 0.25rem;
            line-height: 1.4;
        }

        .document-id-enhanced {
            font-size: 0.75rem;
            color: var(--gray-500);
            font-family: 'SF Mono', Monaco, monospace;
            background: var(--gray-100);
            padding: 0.125rem 0.5rem;
            border-radius: 4px;
            display: inline-block;
        }

        /* Document Meta Tags */
        .document-meta-enhanced {
            display: flex;
            flex-wrap: wrap;
            gap: 0.5rem;
            margin-bottom: 1rem;
        }

        .meta-tag-enhanced {
            font-size: 0.75rem;
            padding: 0.25rem 0.5rem;
            border-radius: 12px;
            font-weight: 500;
        }

        .meta-category {
            background: rgba(139, 92, 246, 0.1);
            color: #7c3aed;
        }

        .meta-regulatory {
            background: rgba(239, 68, 68, 0.1);
            color: #dc2626;
        }

        .meta-priority {
            background: rgba(245, 158, 11, 0.1);
            color: #d97706;
        }

        .meta-status {
            background: rgba(16, 185, 129, 0.1);
            color: #059669;
        }

        /* Document Footer */
        .document-footer-enhanced {
            display: flex;
            justify-content: space-between;
            align-items: center;
            margin-top: 1rem;
            padding-top: 1rem;
            border-top: 1px solid var(--gray-100);
        }

        .document-dates {
            display: flex;
            flex-direction: column;
            gap: 0.25rem;
        }

        .document-date {
            font-size: 0.75rem;
            color: var(--gray-500);
        }

        .expiration-warning {
            color: var(--warning-color);
            font-weight: 600;
        }

        /* Action buttons */
        .action-buttons {
            display: flex;
            gap: 0.5rem;
        }

        .action-btn {
            width: 32px;
            height: 32px;
            border-radius: 8px;
            border: 1px solid var(--gray-200);
            background: white;
            display: flex;
            align-items: center;
            justify-content: center;
            cursor: pointer;
            transition: all 0.2s ease;
            color: var(--gray-600);
        }

        .action-btn:hover {
            border-color: var(--primary-color);
            color: var(--primary-color);
            transform: translateY(-1px);
            box-shadow: var(--shadow-sm);
        }

        .action-btn-danger {
            color: var(--error-color);
        }

        .action-btn-danger:hover {
            border-color: var(--error-color);
            background: rgba(239, 68, 68, 0.1);
            color: var(--error-color);
        }

        .table-action-btn-danger {
            color: var(--error-color);
        }

        .table-action-btn-danger:hover {
            background: rgba(239, 68, 68, 0.1);
            color: var(--error-color);
        }

        .action-btn-favorite,
        .table-action-btn-favorite {
            color: var(--gray-400);
        }

        .action-btn-favorite.favorited,
        .table-action-btn-favorite.favorited {
            color: var(--warning-color, #facc15);
        }

        .action-btn-favorite:hover,
        .table-action-btn-favorite:hover {
            color: var(--warning-color, #facc15);
            border-color: var(--warning-color, #facc15);
        }

        /* Notification Styles */
        .notification {
            position: fixed;
            top: 20px;
            right: 20px;
            padding: 1rem 1.5rem;
            background: white;
            border-radius: 8px;
            box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
            display: flex;
            align-items: center;
            gap: 0.75rem;
            font-size: 0.875rem;
            font-weight: 500;
            transform: translateX(400px);
            transition: transform 0.3s ease;
            z-index: 10000;
        }

        .notification.show {
            transform: translateX(0);
        }

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

        .notification-error {
            border-left: 4px solid var(--error-color);
            color: var(--error-color);
        }

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

        .notification i {
            font-size: 1.125rem;
        }

        /* Document Details Modal Styles */
        .document-details-header {
            display: flex;
            justify-content: space-between;
            align-items: start;
            padding: 1.5rem;
            background: var(--gray-50);
            border-radius: 12px;
            margin-bottom: 2rem;
        }

        .details-info h3 {
            font-size: 1.5rem;
            font-weight: 600;
            color: var(--gray-900);
            margin-bottom: 0.5rem;
        }

        .details-metadata {
            display: flex;
            gap: 0.5rem;
            margin-top: 1rem;
        }

        .details-actions {
            display: flex;
            gap: 0.5rem;
        }

        /* Tabs */
        .details-tabs {
            display: flex;
            gap: 1rem;
            border-bottom: 2px solid var(--gray-200);
            margin-bottom: 2rem;
            overflow-x: auto;
        }

        /* Detail Grid */
        .detail-grid {
            display: grid;
            grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
            gap: 1.5rem;
            margin-bottom: 2rem;
        }

        .detail-item label {
            font-size: 0.875rem;
            font-weight: 500;
            color: var(--gray-600);
            margin-bottom: 0.25rem;
            display: block;
        }

        .detail-item p {
            font-size: 1rem;
            color: var(--gray-900);
            margin: 0;
        }

        .detail-section {
            margin: 2rem 0;
        }

        .detail-section h4 {
            font-size: 1.125rem;
            font-weight: 600;
            color: var(--gray-900);
            margin-bottom: 1rem;
        }

        /* Compliance Status */
        .compliance-status-card {
            display: flex;
            align-items: center;
            gap: 1.5rem;
            padding: 1.5rem;
            background: var(--gray-50);
            border-radius: 12px;
            margin: 1rem 0;
        }

        .status-indicator {
            width: 60px;
            height: 60px;
            border-radius: 50%;
            display: flex;
            align-items: center;
            justify-content: center;
            font-size: 2rem;
            background: var(--gray-200);
            color: var(--gray-600);
        }

        .status-indicator.accepted {
            background: rgba(16, 185, 129, 0.1);
            color: var(--success-color);
        }

        .status-indicator.approved {
            background: rgba(139, 92, 246, 0.1);
            color: var(--primary-color);
        }

        .faa-approval-section {
            margin-top: 2rem;
            padding: 1.5rem;
            background: rgba(139, 92, 246, 0.05);
            border: 2px solid rgba(139, 92, 246, 0.2);
            border-radius: 12px;
        }

        .faa-letter-display {
            padding: 1rem;
            background: white;
            border: 2px dashed var(--gray-300);
            border-radius: 8px;
            margin: 1rem 0;
        }

        .pin-verification-section {
            margin-top: 1.5rem;
        }

        /* Change Log */
        .changelog-timeline {
            position: relative;
            padding-left: 2rem;
        }

        .changelog-timeline::before {
            content: '';
            position: absolute;
            left: 0;
            top: 0;
            bottom: 0;
            width: 2px;
            background: var(--gray-200);
        }

        .changelog-entry {
            position: relative;
            margin-bottom: 2rem;
        }

        .changelog-marker {
            position: absolute;
            left: -2.5rem;
            top: 0;
            width: 12px;
            height: 12px;
            border-radius: 50%;
            background: var(--primary-color);
            border: 3px solid white;
            box-shadow: 0 0 0 2px var(--gray-200);
        }

        .changelog-content {
            background: var(--gray-50);
            padding: 1.5rem;
            border-radius: 12px;
        }

        .changelog-header {
            display: flex;
            justify-content: space-between;
            align-items: center;
            margin-bottom: 0.5rem;
        }

        .changelog-header h5 {
            font-size: 1rem;
            font-weight: 600;
            color: var(--gray-900);
            margin: 0;
        }

        .changelog-date {
            font-size: 0.875rem;
            color: var(--gray-600);
        }

        .changelog-user {
            font-size: 0.875rem;
            color: var(--gray-700);
            margin: 0.25rem 0;
        }

        .changelog-changes {
            display: flex;
            gap: 0.5rem;
            margin-top: 0.75rem;
        }

        .change-tag {
            padding: 0.25rem 0.5rem;
            background: white;
            border: 1px solid var(--gray-300);
            border-radius: 4px;
            font-size: 0.75rem;
            color: var(--gray-700);
        }

        /* Audit Trail */
        .audit-filters {
            display: flex;
            gap: 1rem;
            margin-bottom: 1.5rem;
        }

        .audit-log {
            display: flex;
            flex-direction: column;
            gap: 1rem;
        }

        .audit-entry {
            display: flex;
            gap: 1rem;
            padding: 1rem;
            background: var(--gray-50);
            border-radius: 8px;
        }

        .audit-icon {
            width: 40px;
            height: 40px;
            border-radius: 50%;
            display: flex;
            align-items: center;
            justify-content: center;
            flex-shrink: 0;
        }

        .audit-icon.view {
            background: rgba(59, 130, 246, 0.1);
            color: var(--info-color);
        }

        .audit-icon.download {
            background: rgba(16, 185, 129, 0.1);
            color: var(--success-color);
        }

        .audit-header {
            display: flex;
            justify-content: space-between;
            align-items: center;
            margin-bottom: 0.5rem;
        }

        .audit-action {
            font-weight: 600;
            color: var(--gray-900);
        }

        .audit-time {
            font-size: 0.875rem;
            color: var(--gray-600);
        }

        .audit-user {
            font-size: 0.875rem;
            color: var(--gray-700);
            margin: 0.25rem 0;
        }

        .audit-details {
            font-size: 0.75rem;
            color: var(--gray-600);
        }

        /* Tags Container */
        .tag-pill {
            display: inline-block;
            padding: 0.25rem 0.75rem;
            background: rgba(139, 92, 246, 0.1);
            color: var(--primary-color);
            border-radius: 16px;
            font-size: 0.875rem;
            font-weight: 500;
            margin: 0.25rem;
            cursor: pointer;
            transition: all 0.2s ease;
        }

        .tag-pill:hover {
            background: rgba(139, 92, 246, 0.2);
            transform: translateY(-1px);
        }

        .hash-text {
            font-family: monospace;
            font-size: 0.875rem;
            word-break: break-all;
        }

        /* Update Compliance Section */
        .update-compliance-section {
            margin-top: 2rem;
            padding-top: 2rem;
            border-top: 2px solid var(--gray-200);
        }

        /* Tag Filter Section */
        .tag-filter-section {
            padding: 1rem 1.5rem;
            background: var(--gray-50);
            border-radius: 12px;
            margin-bottom: 1.5rem;
        }

        .tag-filter-header {
            display: flex;
            justify-content: space-between;
            align-items: center;
            margin-bottom: 0.75rem;
        }

        .tag-filter-label {
            font-weight: 600;
            color: var(--gray-700);
            font-size: 0.875rem;
        }

        .clear-tags-btn {
            background: none;
            border: none;
            color: var(--gray-600);
            cursor: pointer;
            font-size: 0.875rem;
            padding: 0.25rem 0.5rem;
            border-radius: 4px;
            transition: all 0.2s ease;
        }

        .clear-tags-btn:hover {
            background: var(--gray-200);
            color: var(--gray-900);
        }

        .active-tag-filters {
            display: flex;
            flex-wrap: wrap;
            gap: 0.5rem;
        }

        .active-tag-filter {
            display: inline-flex;
            align-items: center;
            gap: 0.5rem;
            padding: 0.375rem 0.75rem;
            background: var(--primary-color);
            color: white;
            border-radius: 20px;
            font-size: 0.875rem;
            font-weight: 500;
            cursor: pointer;
            transition: all 0.2s ease;
        }

        .active-tag-filter:hover {
            background: var(--primary-hover);
            transform: translateY(-1px);
        }

        .active-tag-filter i {
            font-size: 0.75rem;
            opacity: 0.8;
        }

        .document-tags-section {
            display: flex;
            flex-wrap: wrap;
            gap: 0.375rem;
            margin: 0.75rem 0;
            padding: 0 1rem;
        }

        .document-tag-pill {
            display: inline-block;
            padding: 0.25rem 0.625rem;
            background: rgba(139, 92, 246, 0.1);
            color: var(--primary-color);
            border-radius: 12px;
            font-size: 0.75rem;
            font-weight: 500;
            cursor: pointer;
            transition: all 0.2s ease;
            border: 1px solid transparent;
        }

        .document-tag-pill:hover {
            background: rgba(139, 92, 246, 0.2);
            border-color: var(--primary-color);
            transform: translateY(-1px);
        }
