/* Team Portal Plugin - Main CSS File */
/* This file imports all modular CSS files for better organization */

/* Import all CSS modules */
@import url('css/layout.css');
@import url('css/controls.css');
@import url('css/cards.css');
@import url('css/filters.css');
@import url('css/tables.css');
@import url('css/animations.css');
@import url('css/tabs.css');
@import url('css/stats.css');
@import url('css/utilities.css');
@import url('css/tab-selection-cards.css');

/* Any additional custom styles can be added here */
/* Tasks table grouping */
#Tasks .group-header { background: #f3f4f6; }
#Tasks .group-header .group-title { font-weight: 700; color: #1f2937; padding: 8px 10px; }

/* ===== Google Drive Archive Tab Styles ===== */
.archive-layout {
    padding: 20px;
    max-width: 1200px;
    margin: 0 auto;
}

.auth-section {
    margin-bottom: 30px;
}

.auth-card {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    border-radius: 16px;
    padding: 30px;
    color: white;
    text-align: center;
    box-shadow: 0 10px 25px rgba(102, 126, 234, 0.3);
    position: relative;
    overflow: hidden;
}

.auth-card::before {
    content: '';
    position: absolute;
    top: -50%;
    left: -50%;
    width: 200%;
    height: 200%;
    background: radial-gradient(circle, rgba(255,255,255,0.1) 0%, transparent 50%);
    animation: shimmer 3s linear infinite;
}

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

.auth-icon {
    font-size: 4rem;
    margin-bottom: 20px;
    opacity: 0.9;
}

.auth-content h4 {
    margin: 0 0 10px 0;
    font-size: 1.8rem;
    font-weight: 600;
}

.auth-content p {
    margin: 0 0 25px 0;
    font-size: 1rem;
    opacity: 0.9;
    line-height: 1.6;
}

.auth-actions {
    display: flex;
    gap: 15px;
    justify-content: center;
    flex-wrap: wrap;
}

.auth-btn {
    padding: 12px 24px;
    border: 2px solid rgba(255,255,255,0.3);
    border-radius: 8px;
    background: rgba(255,255,255,0.1);
    color: white;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    display: inline-flex;
    align-items: center;
    gap: 8px;
    backdrop-filter: blur(10px);
}

.auth-btn:hover {
    background: rgba(255,255,255,0.2);
    border-color: rgba(255,255,255,0.5);
    transform: translateY(-2px);
}

.auth-btn.signout {
    background: rgba(244, 67, 54, 0.2);
    border-color: rgba(244, 67, 54, 0.3);
}

.auth-btn.signout:hover {
    background: rgba(244, 67, 54, 0.3);
}

.drive-content {
    background: white;
    border-radius: 12px;
    box-shadow: 0 4px 6px rgba(0,0,0,0.07);
    overflow: hidden;
}

.drive-toolbar {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 20px;
    background: #f8f9fa;
    border-bottom: 1px solid #e9ecef;
    flex-wrap: wrap;
    gap: 15px;
}

.toolbar-left, .toolbar-right {
    display: flex;
    align-items: center;
    gap: 12px;
    flex-wrap: wrap;
}

.drive-btn {
    padding: 10px 16px;
    border: none;
    border-radius: 8px;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.2s ease;
    display: inline-flex;
    align-items: center;
    gap: 8px;
    text-decoration: none;
}

.drive-btn.primary {
    background: #007cba;
    color: white;
}

.drive-btn.primary:hover {
    background: #005a87;
}

.drive-btn.secondary {
    background: #6c757d;
    color: white;
}

.drive-btn.secondary:hover {
    background: #545b62;
}

.view-toggle {
    display: flex;
    border: 1px solid #dee2e6;
    border-radius: 6px;
    overflow: hidden;
}

.view-btn {
    padding: 8px 12px;
    border: none;
    background: white;
    cursor: pointer;
    transition: all 0.2s ease;
}

.view-btn:hover {
    background: #f8f9fa;
}

.view-btn.active {
    background: #007cba;
    color: white;
}

.search-box {
    position: relative;
}

.search-box input {
    padding: 8px 35px 8px 12px;
    border: 1px solid #dee2e6;
    border-radius: 6px;
    width: 250px;
    font-size: 14px;
}

.search-box i {
    position: absolute;
    right: 12px;
    top: 50%;
    transform: translateY(-50%);
    color: #6c757d;
}

.drive-stats {
    display: flex;
    gap: 30px;
    padding: 15px 20px;
    background: #f8f9fa;
    border-bottom: 1px solid #e9ecef;
    flex-wrap: wrap;
}

.stat-item {
    display: flex;
    align-items: center;
    gap: 8px;
}

.stat-label {
    color: #6c757d;
    font-size: 14px;
}

.stat-value {
    font-weight: 600;
    color: #495057;
}

.loading-indicator {
    text-align: center;
    padding: 40px 20px;
}

.spinner {
    width: 40px;
    height: 40px;
    border: 4px solid #f3f3f3;
    border-top: 4px solid #007cba;
    border-radius: 50%;
    animation: spin 1s linear infinite;
    margin: 0 auto 15px;
}

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

/* Grid layout for drive files */
#drive-files,
.file-grid,
.drive-files {
    display: grid !important;
    grid-template-columns: repeat(5, 1fr) !important;
    gap: 20px !important;
    padding: 20px !important;
    width: 100% !important;
}

/* Grid view specific styling */
#drive-files.grid-view,
.file-grid.grid-view,
.drive-files.grid-view {
    display: grid !important;
    grid-template-columns: repeat(5, 1fr) !important;
}

/* List view styling */
#drive-files.list-view,
.file-grid.list-view,
.drive-files.list-view {
    display: flex !important;
    flex-direction: column !important;
    grid-template-columns: none !important;
}

/* Responsive grid */
@media (max-width: 1400px) {
    #drive-files,
    .file-grid,
    .drive-files {
        grid-template-columns: repeat(4, 1fr) !important;
    }
}

@media (max-width: 1024px) {
    #drive-files,
    .file-grid,
    .drive-files {
        grid-template-columns: repeat(3, 1fr) !important;
    }
}

@media (max-width: 768px) {
    #drive-files,
    .file-grid,
    .drive-files {
        grid-template-columns: repeat(2, 1fr) !important;
    }
}

@media (max-width: 480px) {
    #drive-files,
    .file-grid,
    .drive-files {
        grid-template-columns: 1fr !important;
    }
}

.file-list {
    display: flex;
    flex-direction: column;
    padding: 20px;
}

.file-item {
    background: white;
    border: 1px solid #e9ecef;
    border-radius: 8px;
    padding: 15px;
    transition: all 0.2s ease;
    cursor: pointer;
    min-height: 160px;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
}

.file-item:hover {
    border-color: #007cba;
    box-shadow: 0 2px 8px rgba(0,124,186,0.15);
    transform: translateY(-2px);
}

.grid-view .file-item {
    text-align: center;
}

.grid-view .file-icon {
    font-size: 2.5rem;
    margin-bottom: 12px;
}

.grid-view .file-name {
    font-size: 0.9rem;
    line-height: 1.3;
    margin-bottom: 8px;
    word-break: break-word;
    overflow: hidden;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    line-clamp: 2;
    -webkit-box-orient: vertical;
}

.grid-view .file-details {
    font-size: 0.8rem;
    color: #6c757d;
    margin-bottom: 10px;
}

.grid-view .file-actions {
    justify-content: center;
    gap: 6px;
}

.file-list .file-item {
    display: flex;
    align-items: center;
    gap: 15px;
    margin-bottom: 8px;
    padding: 12px 15px;
}

.file-icon {
    font-size: 2rem;
    text-align: center;
    margin-bottom: 10px;
}

.file-list .file-icon {
    font-size: 1.5rem;
    margin: 0;
    min-width: 40px;
}

.file-info {
    flex: 1;
}

.file-name {
    font-weight: 600;
    color: #495057;
    margin-bottom: 5px;
    word-break: break-word;
}

.file-details {
    display: flex;
    flex-direction: column;
    gap: 2px;
    font-size: 13px;
    color: #6c757d;
}

.file-list .file-details {
    flex-direction: row;
    gap: 15px;
}

.file-actions {
    display: flex;
    gap: 8px;
    margin-top: 10px;
    justify-content: center;
}

.file-list .file-actions {
    margin: 0;
}

.file-btn {
    padding: 6px 8px;
    border: 1px solid #dee2e6;
    border-radius: 4px;
    background: white;
    cursor: pointer;
    transition: all 0.2s ease;
    font-size: 12px;
}

.file-btn:hover {
    background: #f8f9fa;
    border-color: #007cba;
    color: #007cba;
}

.empty-state {
    text-align: center;
    padding: 60px 20px;
    color: #6c757d;
}

.empty-icon {
    font-size: 4rem;
    margin-bottom: 20px;
    opacity: 0.5;
}

.empty-state h3 {
    margin: 0 0 10px 0;
    color: #495057;
}

.empty-state p {
    margin: 0 0 25px 0;
}

/* Color classes for file icons */
.text-red-500 { color: #dc3545; }
.text-green-500 { color: #28a745; }
.text-blue-500 { color: #007bff; }
.text-purple-500 { color: #6f42c1; }
.text-orange-500 { color: #fd7e14; }
.text-yellow-500 { color: #ffc107; }
.text-gray-500 { color: #6c757d; }

/* Force grid layout - highest priority */
div[id="drive-files"] {
    display: grid !important;
    grid-template-columns: repeat(5, 1fr) !important;
    gap: 20px !important;
    padding: 20px !important;
    width: 100% !important;
}

/* Archive tab specific grid forcing */
#Archive #drive-files,
#Archive .file-grid,
#Archive .drive-files {
    display: grid !important;
    grid-template-columns: repeat(5, 1fr) !important;
    gap: 20px !important;
    padding: 20px !important;
    width: 100% !important;
    flex-direction: initial !important;
}

/* Folder Navigation Styles */
.folder-navigation {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 15px 20px;
    background: #f8f9fa;
    border-bottom: 1px solid #e9ecef;
    margin-bottom: 0;
}

.breadcrumb {
    display: flex;
    align-items: center;
    gap: 5px;
    flex: 1;
    overflow-x: auto;
    white-space: nowrap;
}

.breadcrumb-item {
    background: none;
    border: none;
    color: #007cba;
    cursor: pointer;
    padding: 5px 10px;
    border-radius: 4px;
    transition: all 0.2s ease;
    text-decoration: none;
    display: flex;
    align-items: center;
    gap: 5px;
    font-size: 14px;
}

.breadcrumb-item:hover {
    background: rgba(0, 124, 186, 0.1);
    color: #005a87;
}

.breadcrumb-item.home {
    color: #28a745;
    font-weight: 600;
}

.breadcrumb-item.home:hover {
    background: rgba(40, 167, 69, 0.1);
}

.breadcrumb-separator {
    color: #6c757d;
    font-size: 12px;
    margin: 0 2px;
}

.breadcrumb-current {
    color: #495057;
    font-weight: 600;
    padding: 5px 10px;
    background: #e9ecef;
    border-radius: 4px;
    display: flex;
    align-items: center;
    gap: 5px;
    font-size: 14px;
}

.nav-btn {
    background: #6c757d;
    color: white;
    border: none;
    padding: 8px 16px;
    border-radius: 6px;
    cursor: pointer;
    transition: all 0.2s ease;
    display: flex;
    align-items: center;
    gap: 6px;
    font-size: 14px;
}

.nav-btn:hover {
    background: #545b62;
    transform: translateY(-1px);
}

/* Folder Icons and Styling */
/* ===== Windows-style Folder Styling ===== */
.file-item.folder {
    background: linear-gradient(145deg, #fff8e1 0%, #fff3c4 100%);
    border: 2px solid #ffca28;
    position: relative;
    overflow: visible;
    box-shadow: 0 4px 12px rgba(255, 183, 77, 0.2);
}

.file-item.folder::before {
    content: '';
    position: absolute;
    top: -3px;
    left: 20%;
    width: 25%;
    height: 10px;
    background: linear-gradient(145deg, #ffb300 0%, #ffc107 50%, #ffca28 100%);
    border-radius: 6px 6px 0 0;
    border: 1px solid #ff8f00;
    border-bottom: none;
    box-shadow: 0 -2px 4px rgba(255, 143, 0, 0.3);
}

.file-item.folder:hover {
    background: linear-gradient(145deg, #fff176 0%, #ffeb3b 100%);
    border-color: #ff8f00;
    transform: translateY(-4px);
    box-shadow: 0 8px 25px rgba(255, 183, 77, 0.4);
}

.file-item.folder .file-icon {
    font-size: 3.8rem !important;
    margin-bottom: 10px !important;
    position: relative;
}

.file-item.folder .file-icon i {
    color: #ffb300 !important;
    text-shadow: 
        0 2px 4px rgba(255, 143, 0, 0.4),
        0 0 10px rgba(255, 193, 7, 0.3);
    filter: drop-shadow(0 3px 6px rgba(255, 152, 0, 0.5));
}

.file-item.folder .file-name {
    color: #e65100;
    font-weight: 700;
    text-shadow: 0 1px 3px rgba(0,0,0,0.15);
}

/* ===== Enhanced File Icons ===== */
.file-icon {
    position: relative;
}

.file-icon i.fa-file-pdf {
    color: #dc3545 !important;
    text-shadow: 0 2px 4px rgba(220, 53, 69, 0.3);
}

.file-icon i.fa-file-word {
    color: #2b579a !important;
    text-shadow: 0 2px 4px rgba(43, 87, 154, 0.3);
}

.file-icon i.fa-file-excel {
    color: #1d6f42 !important;
    text-shadow: 0 2px 4px rgba(29, 111, 66, 0.3);
}

.file-icon i.fa-file-powerpoint {
    color: #d04423 !important;
    text-shadow: 0 2px 4px rgba(208, 68, 35, 0.3);
}

.file-icon i.fa-file-image {
    color: #17a2b8 !important;
    text-shadow: 0 2px 4px rgba(23, 162, 184, 0.3);
}

.file-icon i.fa-file-video {
    color: #fd7e14 !important;
    text-shadow: 0 2px 4px rgba(253, 126, 20, 0.3);
}

.file-icon i.fa-database {
    color: #6f42c1 !important;
    text-shadow: 0 2px 4px rgba(111, 66, 193, 0.3);
}

.file-icon i.fa-file-archive {
    color: #6c757d !important;
    text-shadow: 0 2px 4px rgba(108, 117, 125, 0.3);
}

/* ===== Enhanced Windows 11 Style Folder Icons ===== */
.file-icon i.fa-folder {
    color: #0078d4 !important;
    font-size: 2.5rem;
    position: relative;
    filter: drop-shadow(0 2px 6px rgba(0, 120, 212, 0.25));
}

.file-icon i.fa-folder::before {
    background: linear-gradient(145deg, #0078d4 0%, #106ebe 50%, #005a9e 100%);
    background-clip: text;
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
}

/* Folder container styling */
.file-grid > div[onclick*="openDemoFolder"] {
    background: linear-gradient(145deg, #f8f9fa 0%, #e9ecef 100%);
    border: 1px solid #dee2e6;
    border-radius: 12px;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    cursor: pointer;
    position: relative;
    overflow: hidden;
}

.file-grid > div[onclick*="openDemoFolder"]:hover {
    transform: translateY(-2px);
    box-shadow: 
        0 8px 25px rgba(0, 120, 212, 0.15),
        0 3px 10px rgba(0, 0, 0, 0.1);
    border-color: #0078d4;
    background: linear-gradient(145deg, #ffffff 0%, #f0f8ff 100%);
}

.file-grid > div[onclick*="openDemoFolder"]:hover .fa-folder {
    transform: scale(1.1);
    color: #106ebe !important;
}

/* File name styling for folders */
.file-grid > div[onclick*="openDemoFolder"] .file-name {
    font-family: 'Segoe UI', 'Cairo', -apple-system, BlinkMacSystemFont, sans-serif !important;
    font-weight: 600 !important;
    color: #323130 !important;
    font-size: 0.9rem !important;
    text-align: center;
    line-height: 1.3;
}

.file-grid > div[onclick*="openDemoFolder"]:hover .file-name {
    color: #0078d4 !important;
}

/* File size styling for folders */
.file-grid > div[onclick*="openDemoFolder"] .file-size {
    font-family: 'Segoe UI', 'Cairo', sans-serif !important;
    font-size: 0.75rem !important;
    color: #605e5c !important;
    font-weight: 500;
}

/* Modern file item styling */
.file-grid > div {
    background: white;
    border: 1px solid #e1e1e1;
    border-radius: 8px;
    padding: 16px;
    text-align: center;
    transition: all 0.2s ease;
    min-height: 180px;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    position: relative;
}

.file-grid > div:hover {
    border-color: #0078d4;
    box-shadow: 0 4px 12px rgba(0, 120, 212, 0.15);
    transform: translateY(-1px);
}

/* Enhanced file names for all files */
.file-grid .file-name {
    font-family: 'Segoe UI', 'Cairo', -apple-system, BlinkMacSystemFont, sans-serif;
    font-weight: 500;
    font-size: 0.85rem;
    color: #323130;
    line-height: 1.2;
    margin-bottom: 8px;
}

.file-grid .file-size {
    font-family: 'Segoe UI', 'Cairo', sans-serif;
    font-size: 0.7rem;
    color: #605e5c;
    font-weight: 400;
}

/* Info button styling */
.file-info-btn {
    position: absolute;
    top: 8px;
    right: 8px;
    width: 24px;
    height: 24px;
    background: rgba(0, 124, 186, 0.9);
    color: white;
    border: none;
    border-radius: 50%;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 0.8rem;
    opacity: 0;
    transition: all 0.3s ease;
    z-index: 2;
}

.file-item:hover .file-info-btn {
    opacity: 1;
    transform: scale(1.1);
}

.file-info-btn:hover {
    background: #005a87;
    transform: scale(1.2);
}

/* File items in grid */
#Archive .file-item,
#drive-files .file-item {
    background: white !important;
    border: 1px solid #e9ecef !important;
    border-radius: 8px !important;
    padding: 15px !important;
    text-align: center !important;
    min-height: 180px !important;
    display: flex !important;
    flex-direction: column !important;
    justify-content: space-between !important;
}

/* Back button initially hidden */
#backButton {
    display: none;
}

/* Show back button when in subfolder */
.in-subfolder #backButton {
    display: flex !important;
}

/* ===== File Info Modal Styles ===== */
.file-modal {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: 10000;
    display: flex;
    align-items: center;
    justify-content: center;
    animation: modalFadeIn 0.3s ease-out;
}

.modal-overlay {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.7);
    backdrop-filter: blur(8px);
}

.modal-content {
    position: relative;
    background: white;
    border-radius: 16px;
    max-width: 500px;
    width: 90%;
    max-height: 80vh;
    overflow: hidden;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.3);
    animation: modalSlideUp 0.3s ease-out;
}

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

.modal-header h3 {
    margin: 0;
    font-size: 1.2rem;
    font-weight: 600;
}

.modal-close {
    background: none;
    border: none;
    color: white;
    font-size: 1.2rem;
    cursor: pointer;
    padding: 5px;
    border-radius: 4px;
    transition: all 0.2s ease;
}

.modal-close:hover {
    background: rgba(255, 255, 255, 0.2);
}

.modal-body {
    padding: 25px;
}

.file-preview {
    display: flex;
    gap: 20px;
    align-items: flex-start;
}

.preview-icon {
    font-size: 4rem;
    color: #667eea;
    min-width: 80px;
    text-align: center;
}

.file-details-container {
    flex: 1;
}

.detail-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 12px 0;
    border-bottom: 1px solid #f0f0f0;
}

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

.detail-label {
    font-weight: 600;
    color: #495057;
    min-width: 100px;
}

.detail-value {
    color: #6c757d;
    text-align: right;
    word-break: break-word;
}

.modal-footer {
    display: flex;
    gap: 12px;
    padding: 20px 25px;
    background: #f8f9fa;
    justify-content: flex-end;
}

.modal-btn {
    padding: 10px 20px;
    border: none;
    border-radius: 8px;
    cursor: pointer;
    transition: all 0.2s ease;
    font-weight: 500;
    display: flex;
    align-items: center;
    gap: 8px;
}

.modal-btn.primary {
    background: #007cba;
    color: white;
}

.modal-btn.primary:hover {
    background: #005a87;
    transform: translateY(-1px);
}

.modal-btn.secondary {
    background: #28a745;
    color: white;
}

.modal-btn.secondary:hover {
    background: #1e7e34;
    transform: translateY(-1px);
}

.modal-btn:not(.primary):not(.secondary) {
    background: #6c757d;
    color: white;
}

.modal-btn:not(.primary):not(.secondary):hover {
    background: #545b62;
}

@keyframes modalFadeIn {
    from { opacity: 0; }
    to { opacity: 1; }
}

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

/* Responsive design for archive tab */
@media (max-width: 768px) {
    .drive-toolbar {
        flex-direction: column;
        align-items: stretch;
        gap: 15px;
    }
    
    .toolbar-left, .toolbar-right {
        justify-content: center;
    }
    
    .search-box input {
        width: 100%;
    }
    
    .file-grid {
        grid-template-columns: 1fr;
        padding: 15px;
    }
    
    .drive-stats {
        flex-direction: column;
        gap: 10px;
    }
    
    .folder-navigation {
        flex-direction: column;
        gap: 10px;
        align-items: stretch;
    }
    
    .breadcrumb {
        justify-content: center;
    }
}

/* ===== File Info Button Styling ===== */
.files-grid > div:hover .file-info-btn {
    opacity: 1 !important;
}

.file-info-btn:hover {
    background: rgba(0, 124, 186, 1) !important;
    transform: scale(1.1) !important;
    box-shadow: 0 2px 8px rgba(0, 124, 186, 0.3) !important;
}

/* ===== Archive Controls Styling ===== */
.archive-controls {
    background: linear-gradient(135deg, #f8f9fa 0%, #e9ecef 100%);
    border: 1px solid #dee2e6;
    border-radius: 12px;
    padding: 20px;
    margin: 20px 0;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.05);
    transition: all 0.3s ease;
}

.archive-controls:hover {
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.1);
    transform: translateY(-1px);
}

.archive-controls .form-label {
    font-weight: 600;
    color: #495057;
    margin-bottom: 8px;
    font-size: 0.9rem;
}

.archive-controls .form-select,
.archive-controls .form-control {
    border-radius: 8px;
    border: 1px solid #ced4da;
    padding: 8px 12px;
    font-size: 0.9rem;
    transition: all 0.3s ease;
}

.archive-controls .form-select:focus,
.archive-controls .form-control:focus {
    border-color: #007cba;
    box-shadow: 0 0 0 0.2rem rgba(0, 124, 186, 0.25);
    outline: none;
}

.archive-controls .btn {
    border-radius: 8px;
    padding: 8px 16px;
    font-size: 0.9rem;
    font-weight: 500;
    transition: all 0.3s ease;
}

.archive-controls .btn-primary {
    background: linear-gradient(135deg, #007cba 0%, #005a8b 100%);
    border: none;
    color: white;
}

.archive-controls .btn-primary:hover {
    background: linear-gradient(135deg, #005a8b 0%, #003d61 100%);
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(0, 124, 186, 0.3);
}

.archive-controls .btn-outline-secondary {
    border-color: #6c757d;
    color: #6c757d;
}

.archive-controls .btn-outline-secondary:hover {
    background-color: #6c757d;
    border-color: #6c757d;
    color: white;
    transform: translateY(-1px);
}

/* Empty state styling */
.archive-controls + #drive-files[style*="grid-column: 1 / -1"] {
    background: linear-gradient(135deg, #f8f9fa 0%, #e9ecef 100%);
    border-radius: 12px;
    margin: 20px 0;
    padding: 40px;
    text-align: center;
}

.archive-controls + #drive-files h5 {
    color: #495057;
    margin-bottom: 10px;
    font-weight: 600;
}

.archive-controls + #drive-files p {
    color: #6c757d;
    margin-bottom: 0;
}

/* Responsive adjustments for archive controls */
@media (max-width: 768px) {
    .archive-controls .row > div {
        margin-bottom: 15px;
    }
    
    .archive-controls .col-md-3,
    .archive-controls .col-md-2,
    .archive-controls .col-md-4 {
        width: 100%;
        max-width: 100%;
    }
    
    .file-grid {
        grid-template-columns: repeat(3, 1fr) !important;
    }
}

@media (max-width: 576px) {
    .archive-controls {
        padding: 15px;
        margin: 15px 0;
    }
    
    .archive-controls .btn {
        width: 100%;
        margin-bottom: 10px;
    }
    
    .file-grid {
        grid-template-columns: repeat(2, 1fr) !important;
        gap: 15px !important;
    }
}

/* Enhanced breadcrumb styling */
.breadcrumb-item {
    background: none;
    border: none;
    color: #0078d4;
    text-decoration: none;
    font-weight: 500;
    padding: 4px 8px;
    border-radius: 4px;
    transition: all 0.2s ease;
    font-family: 'Segoe UI', 'Cairo', sans-serif;
}

.breadcrumb-item:hover {
    background-color: rgba(0, 120, 212, 0.1);
    color: #106ebe;
}

.breadcrumb-item.home {
    color: #605e5c;
}

.breadcrumb-separator {
    color: #605e5c;
    margin: 0 8px;
}

.breadcrumb-current {
    color: #323130;
    font-weight: 600;
}

/* ===== Dynamic Info Bar ===== */
.dynamic-info-bar {
    background: linear-gradient(135deg, #2c3e50 0%, #34495e 100%);
    color: white;
    padding: 8px 0;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
    position: relative;
    z-index: 10;
    border-bottom: 3px solid #3498db;
    margin-top: 60px;
    margin-bottom: 0;
    overflow: visible;
    clear: both;
}

.dynamic-info-bar .container {
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap;
    gap: 10px 15px;
    max-width: 100%;
    margin: 0 auto;
    padding: 0 15px;
    position: relative;
    overflow: visible;
}

.info-item {
    display: flex;
    align-items: center;
    gap: 6px;
    font-size: 0.85rem;
    font-weight: 500;
    font-family: 'Cairo', 'Segoe UI', sans-serif;
    animation: fadeInUp 0.6s ease-out;
    flex-shrink: 1;
    min-width: 0;
}

.info-item i {
    color: #3498db;
    font-size: 1rem;
    width: 18px;
    text-align: center;
    flex-shrink: 0;
}

.info-label {
    color: #bdc3c7;
    font-weight: 400;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.info-value {
    color: #ffffff;
    font-weight: 600;
    font-size: 0.95rem;
    min-width: 35px;
    text-align: center;
    background: rgba(52, 152, 219, 0.2);
    padding: 3px 8px;
    border-radius: 12px;
    border: 1px solid rgba(52, 152, 219, 0.3);
    transition: all 0.3s ease;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
    flex-shrink: 0;
}

.info-value:hover {
    background: rgba(52, 152, 219, 0.3);
    transform: scale(1.05);
}

/* Completion rate color coding */
.info-value.low {
    background: rgba(231, 76, 60, 0.2);
    border-color: rgba(231, 76, 60, 0.3);
    color: #e74c3c;
}

.info-value.medium {
    background: rgba(241, 196, 15, 0.2);
    border-color: rgba(241, 196, 15, 0.3);
    color: #f1c40f;
}

.info-value.high {
    background: rgba(39, 174, 96, 0.2);
    border-color: rgba(39, 174, 96, 0.3);
    color: #27ae60;
}

.info-value.low:hover {
    background: rgba(231, 76, 60, 0.3);
}

.info-value.medium:hover {
    background: rgba(241, 196, 15, 0.3);
}

.info-value.high:hover {
    background: rgba(39, 174, 96, 0.3);
}

/* Loading animation for info values */
.info-value.loading {
    background: linear-gradient(90deg, rgba(52, 152, 219, 0.2) 0%, rgba(52, 152, 219, 0.4) 50%, rgba(52, 152, 219, 0.2) 100%);
    background-size: 200% 100%;
    animation: shimmer 1.5s infinite;
}

@keyframes shimmer {
    0% {
        background-position: -200% 0;
    }
    100% {
        background-position: 200% 0;
    }
}

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

/* Chart.js Tooltip Override - Make it appear above everything */
.chartjs-tooltip {
    position: absolute !important;
    z-index: 9999 !important;
    pointer-events: none !important;
}

/* Canvas container should not clip tooltip */
.info-item canvas {
    position: relative;
    z-index: 1;
}

.info-item {
    position: relative;
    overflow: visible !important;
}

/* Responsive adjustments for info bar - ensure single line display */
@media (max-width: 768px) {
    .dynamic-info-bar {
        margin-top: 50px;
        z-index: 1;
        padding: 6px 0;
    }
    
    .dynamic-info-bar .container {
        gap: 8px 10px;
        justify-content: space-between;
        flex-wrap: wrap;
        padding: 0 10px;
    }
    
    .info-item {
        font-size: 0.75rem;
        gap: 4px;
        flex-shrink: 1;
    }
    
    .info-item i {
        font-size: 0.9rem;
        width: 16px;
    }
    
    .info-label {
        font-size: 0.7rem;
    }
    
    .info-value {
        font-size: 0.8rem;
        padding: 2px 6px;
        min-width: 30px;
    }
}

/* Tasks table specific styles */
#tasks-table .client-cell {
    display: flex;
    align-items: center;
    gap: 8px;
}

#tasks-table .open-profile-modal {
    background: #3498db;
    color: white;
    border: none;
    padding: 4px 8px;
    border-radius: 4px;
    cursor: pointer;
    font-size: 12px;
}

#tasks-table .open-profile-modal:hover {
    background: #2980b9;
}

#tasks-table .type-chip,
#tasks-table .status-badge {
    padding: 3px 8px;
    border-radius: 12px;
    font-size: 11px;
    font-weight: 500;
    white-space: nowrap;
}

#tasks-table .type-chip {
    background: #e3f2fd;
    color: #1565c0;
    border: 1px solid #bbdefb;
}

#tasks-table .status-badge {
    background: #f3e5f5;
    color: #7b1fa2;
    border: 1px solid #e1bee7;
}

#tasks-table .status-badge.status-completed {
    background: #e8f5e8;
    color: #2e7d32;
    border: 1px solid #c8e6c9;
}

#tasks-table .status-badge.status-pending {
    background: #fff3e0;
    color: #f57c00;
    border: 1px solid #ffcc02;
}

@media (max-width: 576px) {
    .dynamic-info-bar {
        padding: 8px 0;
        margin-top: 40px;
        /* Keep below header on very small screens */
        z-index: 1;
    }
    
    .dynamic-info-bar .container {
        gap: 10px;
        padding: 0 10px;
    }
    
    .info-item {
        font-size: 0.7rem;
        gap: 4px;
        flex-shrink: 1;
    }
    
    .info-item i {
        font-size: 0.9rem;
        width: 14px;
    }
    
    .info-label {
        display: none; /* Hide labels on very small screens to save space */
    }
    
    .info-value {
        font-size: 0.75rem;
        padding: 2px 6px;
        min-width: 25px;
    }
}

/* ===== AI Features Section ===== */
.ai-features-section {
    display: none;
}

.ai-features-section {
    margin: 20px 0 30px 0;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    border-radius: 20px;
    padding: 25px;
    box-shadow: 0 10px 30px rgba(102, 126, 234, 0.3);
    position: relative;
    overflow: hidden;
}

.ai-features-section::before {
    content: '';
    position: absolute;
    top: -50%;
    right: -50%;
    width: 100%;
    height: 100%;
    background: radial-gradient(circle, rgba(255,255,255,0.1) 0%, transparent 70%);
    pointer-events: none;
}

.ai-section-title {
    display: flex;
    align-items: center;
    gap: 10px;
    color: white;
    font-size: 1.3rem;
    font-weight: 700;
    margin-bottom: 20px;
    text-shadow: 0 2px 4px rgba(0,0,0,0.2);
}

.ai-section-title i {
    font-size: 1.5rem;
    background: rgba(255,255,255,0.2);
    padding: 8px;
    border-radius: 12px;
    backdrop-filter: blur(10px);
}

.ai-features-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    gap: 16px;
}

.ai-feature-card {
    background: rgba(255, 255, 255, 0.95);
    border-radius: 16px;
    padding: 20px;
    cursor: pointer;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    position: relative;
    overflow: hidden;
    backdrop-filter: blur(10px);
    border: 1px solid rgba(255, 255, 255, 0.2);
}

.ai-feature-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(255,255,255,0.4), transparent);
    transition: left 0.6s;
}

.ai-feature-card:hover::before {
    left: 100%;
}

.ai-feature-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 15px 35px rgba(0, 0, 0, 0.15);
    background: rgba(255, 255, 255, 1);
}

.ai-feature-icon {
    width: 50px;
    height: 50px;
    background: linear-gradient(135deg, #667eea, #764ba2);
    border-radius: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    margin-bottom: 15px;
    transition: transform 0.3s ease;
}

.ai-feature-card:hover .ai-feature-icon {
    transform: scale(1.1) rotate(5deg);
}

.ai-feature-icon i {
    color: white;
    font-size: 1.4rem;
}

.ai-feature-content h4 {
    margin: 0 0 8px 0;
    color: #1f2937;
    font-size: 1.1rem;
    font-weight: 600;
}

.ai-feature-content p {
    margin: 0;
    color: #6b7280;
    font-size: 0.9rem;
    line-height: 1.4;
}

.ai-feature-badge {
    position: absolute;
    top: 15px;
    left: 15px;
    background: linear-gradient(135deg, #f59e0b, #d97706);
    color: white;
    padding: 4px 10px;
    border-radius: 20px;
    font-size: 0.75rem;
    font-weight: 600;
    box-shadow: 0 2px 8px rgba(245, 158, 11, 0.3);
    animation: pulse 2s infinite;
}

@keyframes pulse {
    0%, 100% {
        transform: scale(1);
        box-shadow: 0 2px 8px rgba(245, 158, 11, 0.3);
    }
    50% {
        transform: scale(1.05);
        box-shadow: 0 4px 16px rgba(245, 158, 11, 0.5);
    }
}

/* Dark mode support */
[data-theme="dark"] .ai-feature-card {
    background: rgba(31, 41, 55, 0.9);
    border: 1px solid rgba(75, 85, 99, 0.3);
}

[data-theme="dark"] .ai-feature-card:hover {
    background: rgba(31, 41, 55, 1);
    box-shadow: 0 15px 35px rgba(0, 0, 0, 0.4);
}

[data-theme="dark"] .ai-feature-content h4 {
    color: #f9fafb;
}

[data-theme="dark"] .ai-feature-content p {
    color: #9ca3af;
}

/* Responsive design */
@media (max-width: 768px) {
    .ai-features-section {
        margin: 15px 0 20px 0;
        padding: 20px 15px;
        border-radius: 16px;
    }
    
    .ai-section-title {
        font-size: 1.1rem;
        margin-bottom: 15px;
    }
    
    .ai-features-grid {
        grid-template-columns: 1fr;
        gap: 12px;
    }
    
    .ai-feature-card {
        padding: 16px;
    }
    
    .ai-feature-icon {
        width: 45px;
        height: 45px;
        margin-bottom: 12px;
    }
    
    .ai-feature-icon i {
        font-size: 1.2rem;
    }
    
    .ai-feature-content h4 {
        font-size: 1rem;
    }
    
    .ai-feature-content p {
        font-size: 0.85rem;
    }
}

@media (max-width: 480px) {
    .ai-features-grid {
        grid-template-columns: repeat(2, 1fr);
    }
    
    .ai-feature-card {
        padding: 12px;
        text-align: center;
    }
    
    .ai-feature-content h4 {
        font-size: 0.9rem;
        margin-bottom: 4px;
    }
    
    .ai-feature-content p {
        font-size: 0.8rem;
        display: none; /* Hide description on very small screens */
    }
    
    .ai-feature-badge {
        position: static;
        display: inline-block;
        margin-top: 8px;
        font-size: 0.7rem;
        padding: 2px 8px;
    }
}

/* ============================================
   Table Controls (Print, Export, Refresh)
   ============================================ */

.table-controls-wrapper {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 20px;
    padding: 22px 28px;
    border-radius: 24px;
    margin-bottom: 22px;
    background: linear-gradient(135deg, rgba(15, 23, 42, 0.96) 0%, rgba(30, 64, 175, 0.95) 45%, rgba(37, 99, 235, 0.85) 100%);
    border: 1px solid rgba(148, 163, 184, 0.35);
    box-shadow: 0 28px 70px rgba(15, 23, 42, 0.32);
    color: #f8fafc;
    position: relative;
    overflow: hidden;
}

.table-controls-wrapper::before {
    content: '';
    position: absolute;
    inset: 0;
    background: radial-gradient(circle at top left, rgba(59, 130, 246, 0.42), transparent 55%),
                radial-gradient(circle at bottom right, rgba(56, 189, 248, 0.35), transparent 50%);
    inset-inline-start: 4px; /* No change */
    pointer-events: none;
    z-index: 0;
}

.table-controls-left,
.table-controls-right {
    display: flex;
    align-items: center;
    gap: 16px;
    position: relative;
    z-index: 1;
}

.table-title {
[dir="rtl"] .table-control-btn.dasht-btn .toggle-indicator::after,
.table-control-btn.dasht-btn[dir="rtl"] .toggle-indicator::after {
    right: auto;
    left: 4px;
}

[dir="ltr"] .table-control-btn.dasht-btn .toggle-indicator::after,
.table-control-btn.dasht-btn[dir="ltr"] .toggle-indicator::after {
    left: auto;
    right: 4px;
}

[dir="rtl"] .table-control-btn.dasht-btn[data-show-dasht="true"] .toggle-indicator::after,
.table-control-btn.dasht-btn[data-show-dasht="true"][dir="rtl"] .toggle-indicator::after {
    right: auto;
    left: 22px;
}

[dir="ltr"] .table-control-btn.dasht-btn[data-show-dasht="true"] .toggle-indicator::after,
.table-control-btn.dasht-btn[data-show-dasht="true"][dir="ltr"] .toggle-indicator::after {
    left: auto;
    right: 22px;
}
    margin: 0;
    font-size: 22px;
    font-weight: 800;
    color: #f8fafc;
    display: flex;
    align-items: center;
    gap: 12px;
    text-shadow: 0 10px 30px rgba(15, 23, 42, 0.35);
}

.table-title i {
    color: #93c5fd;
    font-size: 24px;
    background: rgba(15, 23, 42, 0.32);
    border-radius: 14px;
    padding: 10px;
    box-shadow: 0 14px 32px rgba(15, 23, 42, 0.38);
}

.table-control-btn {
    display: inline-flex;
    align-items: center;
    gap: 10px;
    padding: 11px 22px;
    border-radius: 14px;
    border: 1px solid rgba(226, 232, 240, 0.22);
    background: rgba(248, 250, 252, 0.14);
    color: #f8fafc;
    font-size: 14px;
    font-weight: 700;
    font-family: 'Cairo', 'Tajawal', sans-serif;
    cursor: pointer;
    transition: transform 0.25s ease, box-shadow 0.25s ease, background 0.25s ease;
    box-shadow: 0 18px 40px rgba(15, 23, 42, 0.32);
    backdrop-filter: blur(6px);
}

.table-control-btn i {
    font-size: 16px;
    transition: transform 0.3s ease;
}

.table-control-btn:hover {
    transform: translateY(-3px);
    background: rgba(248, 250, 252, 0.22);
    box-shadow: 0 24px 48px rgba(37, 99, 235, 0.32);
}

.table-control-btn:active {
    transform: translateY(-1px) scale(0.99);
}

.table-control-btn.clear-filters-btn {
    background: linear-gradient(135deg, rgba(248, 113, 113, 0.32), rgba(239, 68, 68, 0.48));
    border-color: rgba(248, 113, 113, 0.6);
    box-shadow: 0 24px 52px rgba(239, 68, 68, 0.28);
}

.table-control-btn.clear-filters-btn:hover {
    background: linear-gradient(135deg, rgba(254, 215, 170, 0.4), rgba(248, 113, 113, 0.6));
    box-shadow: 0 28px 60px rgba(248, 113, 113, 0.38);
}

.table-control-btn.clear-filters-btn:focus-visible {
    outline: 3px solid rgba(248, 113, 113, 0.45);
    outline-offset: 3px;
}

/* Refresh Button */

.table-control-btn.refresh-btn {
    background: linear-gradient(135deg, #38bdf8 0%, #2563eb 55%, #1d4ed8 100%);
    border-color: rgba(96, 165, 250, 0.55);
    box-shadow: 0 24px 52px rgba(37, 99, 235, 0.42);
}

.table-control-btn.refresh-btn:hover {
    background: linear-gradient(135deg, #60a5fa 0%, #2563eb 60%, #1d4ed8 100%);
    box-shadow: 0 28px 58px rgba(37, 99, 235, 0.48);
}

.table-control-btn.refresh-btn i {
    animation: none;
}

.table-control-btn.refresh-btn:hover i {
    animation: rotate 0.6s ease-in-out;
}

@keyframes rotate {
    from { transform: rotate(0deg); }
    to { transform: rotate(360deg); }
}

/* Print Button */
.table-control-btn.print-btn {
    background: rgba(248, 250, 252, 0.18);
}

.table-control-btn.print-btn:hover {
    background: rgba(248, 250, 252, 0.3);
    border-color: rgba(226, 232, 240, 0.45);
    color: #0f172a;
}

/* Excel Button */
.table-control-btn.excel-btn {
    background: linear-gradient(135deg, #34d399 0%, #059669 60%, #047857 100%);
    border-color: rgba(16, 185, 129, 0.55);
    box-shadow: 0 24px 52px rgba(16, 185, 129, 0.36);
}

.table-control-btn.excel-btn:hover {
    background: linear-gradient(135deg, #6ee7b7 0%, #10b981 45%, #047857 100%);
    box-shadow: 0 28px 60px rgba(16, 185, 129, 0.42);
}

/* PDF Button */
.table-control-btn.pdf-btn {
    background: linear-gradient(135deg, #f87171 0%, #ef4444 55%, #dc2626 100%);
    border-color: rgba(248, 113, 113, 0.6);
    box-shadow: 0 24px 52px rgba(239, 68, 68, 0.36);
}

.table-control-btn.pdf-btn:hover {
    background: linear-gradient(135deg, #fca5a5 0%, #ef4444 50%, #b91c1c 100%);
    box-shadow: 0 28px 60px rgba(239, 68, 68, 0.42);
}

/* Loading state for refresh button */
.table-control-btn.refresh-btn.loading i {
    animation: rotate 1s linear infinite;
}

.table-control-btn.refresh-btn.loading {
    opacity: 0.7;
    cursor: not-allowed;
}

/* Responsive */
@media (max-width: 768px) {
    .table-controls-wrapper {
        flex-direction: column;
        align-items: stretch;
        gap: 18px;
        padding: 18px 16px;
    }

    .table-controls-left,
    .table-controls-right {
        width: 100%;
        justify-content: space-between;
        flex-wrap: wrap;
    }

    .table-control-btn {
        flex: 1 1 calc(50% - 10px);
        min-width: 140px;
        justify-content: center;
        font-size: 13px;
        padding: 10px 16px;
    }

    .table-control-btn span {
        display: none;
    }

    .table-control-btn i {
        font-size: 18px;
    }

    .table-title {
        font-size: 20px;
        justify-content: center;
    }
}

@media (max-width: 480px) {
    .table-control-btn {
        flex: 1 1 100%;
        min-width: 0;
        padding: 10px 14px;
    }
}

/* ===== Documents Tab Styles ===== */
.documents-container {
    padding: 20px;
}

.documents-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 20px;
    padding-bottom: 15px;
    border-bottom: 2px solid #e2e8f0;
}

.documents-header h3 {
    display: flex;
    align-items: center;
    gap: 8px;
    margin: 0;
    color: #2d3748;
}

.documents-count {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    padding: 4px 10px;
    border-radius: 12px;
    font-size: 12px;
    font-weight: 600;
}

.refresh-documents-btn {
    padding: 8px 16px;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    border: none;
    border-radius: 6px;
    cursor: pointer;
    display: flex;
    align-items: center;
    gap: 6px;
    transition: all 0.3s ease;
    font-weight: 500;
}

.refresh-documents-btn:hover {
    background: linear-gradient(135deg, #5568d3 0%, #6b3f8f 100%);
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(102, 126, 234, 0.3);
}

.refresh-documents-btn i {
    transition: transform 0.3s ease;
}

.refresh-documents-btn:hover i {
    transform: rotate(90deg);
}

.documents-loading {
    text-align: center;
    padding: 40px;
}

.documents-loading i {
    font-size: 32px;
    color: #667eea;
    animation: spin 1s linear infinite;
}

@keyframes spin {
    from { transform: rotate(0deg); }
    to { transform: rotate(360deg); }
}

.documents-loading p {
    margin-top: 15px;
    color: #718096;
    font-size: 14px;
}

.documents-empty {
    text-align: center;
    padding: 60px 20px;
    background: linear-gradient(135deg, #f7fafc 0%, #edf2f7 100%);
    border-radius: 12px;
    border: 2px dashed #cbd5e0;
}

.documents-empty i {
    font-size: 64px;
    color: #cbd5e0;
    margin-bottom: 16px;
}

.documents-empty h4 {
    color: #4a5568;
    margin: 0 0 8px 0;
    font-size: 18px;
}

.documents-empty p {
    color: #718096;
    margin: 0;
    font-size: 14px;
}

.documents-list {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    gap: 16px;
}

.document-card {
    background: white;
    border: 1px solid #e2e8f0;
    border-radius: 8px;
    padding: 16px;
    transition: all 0.3s ease;
}

.document-card:hover {
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
    transform: translateY(-2px);
}

.document-card.expired {
    background: #fef2f2 !important;
    border-color: #fca5a5 !important;
}

.document-card.expired .document-icon {
    background: linear-gradient(135deg, #ef4444 0%, #dc2626 100%) !important;
}

.status-badge {
    padding: 2px 8px;
    border-radius: 12px;
    font-size: 11px;
    font-weight: 600;
    white-space: nowrap;
}

.document-icon {
    flex-shrink: 0;
    width: 48px;
    height: 48px;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    border-radius: 8px;
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
    font-size: 24px;
}

.document-title {
    margin: 0 0 6px 0;
    font-size: 14px;
    font-weight: 600;
    color: #2d3748;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.document-meta {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    font-size: 12px;
    color: #718096;
    margin-bottom: 8px;
}

.document-meta span {
    display: flex;
    align-items: center;
}

.document-notes {
    margin: 8px 0 0 0;
    font-size: 12px;
    color: #4a5568;
    line-height: 1.5;
}

.document-actions {
    margin-top: 12px;
    padding-top: 12px;
    border-top: 1px solid #e2e8f0;
    display: flex;
    gap: 8px;
}

.btn-view-doc,
.btn-download-doc {
    flex: 1;
    padding: 6px 12px;
    text-align: center;
    border-radius: 4px;
    text-decoration: none;
    font-size: 13px;
    transition: all 0.2s ease;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
}

.btn-view-doc {
    background: #667eea;
    color: white;
}

.btn-view-doc:hover {
    background: #5568d3;
}

.btn-download-doc {
    background: #48bb78;
    color: white;
}

.btn-download-doc:hover {
    background: #38a169;
}

@media (max-width: 768px) {
    .documents-list {
        grid-template-columns: 1fr;
    }
    
    .documents-header {
        flex-direction: column;
        align-items: flex-start;
        gap: 12px;
    }
    
    .refresh-documents-btn {
        width: 100%;
        justify-content: center;
    }
}

/* Counters badges in client name cell - HIDDEN to avoid duplication */
.client-counters-top {
    display: none !important; /* إخفاء الشارات العلوية لتجنب التكرار */
}

.counter-badge {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    padding: 4px 10px;
    border-radius: 12px;
    font-size: 11px;
    font-weight: 600;
    white-space: nowrap;
    transition: all 0.3s ease;
}

.counter-badge:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.15);
}

.appeals-counter {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
}

.tasks-counter {
    background: linear-gradient(135deg, #f093fb 0%, #f5576c 100%);
    color: white;
}

.documents-counter {
    background: linear-gradient(135deg, #4facfe 0%, #00f2fe 100%);
    color: white;
}

.expiring-soon-counter {
    background: linear-gradient(135deg, #f59e0b 0%, #fb923c 100%);
    color: white;
    animation: pulse-warning-soft 2s infinite;
}

@keyframes pulse-warning-soft {
    0%, 100% {
        box-shadow: 0 0 0 0 rgba(251, 146, 60, 0.5);
    }
    50% {
        box-shadow: 0 0 0 4px rgba(251, 146, 60, 0);
    }
}

.expired-docs-counter {
    background: linear-gradient(135deg, #fa709a 0%, #fee140 100%);
    color: #fff;
    animation: pulse-warning 2s infinite;
}

@keyframes pulse-warning {
    0%, 100% {
        box-shadow: 0 0 0 0 rgba(250, 112, 154, 0.7);
    }
    50% {
        box-shadow: 0 0 0 6px rgba(250, 112, 154, 0);
    }
}

.counter-text {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    padding: 3px 8px;
    font-size: 11px;
    color: #94a3b8;
    white-space: nowrap;
}

.counter-text.no-data {
    opacity: 0.6;
}

/* ============================================
   Table Controls (Print, Export, Refresh)
   ============================================ */

.table-controls-wrapper {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 20px;
    padding: 22px 28px;
    border-radius: 24px;
    margin-bottom: 22px;
    background: linear-gradient(135deg, rgba(15, 23, 42, 0.96) 0%, rgba(30, 64, 175, 0.95) 45%, rgba(37, 99, 235, 0.85) 100%);
    border: 1px solid rgba(148, 163, 184, 0.35);
    box-shadow: 0 28px 70px rgba(15, 23, 42, 0.32);
    color: #f8fafc;
    position: relative;
    overflow: hidden;
}

.table-controls-wrapper::before {
    content: '';
    position: absolute;
    inset: 0;
    background: radial-gradient(circle at top left, rgba(59, 130, 246, 0.42), transparent 55%),
                radial-gradient(circle at bottom right, rgba(56, 189, 248, 0.35), transparent 50%);
    opacity: 0.65;
    pointer-events: none;
    z-index: 0;
}

.table-controls-left,
.table-controls-right {
    display: flex;
    align-items: center;
    gap: 16px;
    position: relative;
    z-index: 1;
}

.table-title {
    margin: 0;
    font-size: 22px;
    font-weight: 800;
    color: #f8fafc;
    display: flex;
    align-items: center;
    gap: 12px;
    text-shadow: 0 10px 30px rgba(15, 23, 42, 0.35);
}

.table-title i {
    color: #93c5fd;
    font-size: 24px;
    background: rgba(15, 23, 42, 0.32);
    border-radius: 14px;
    padding: 10px;
    box-shadow: 0 14px 32px rgba(15, 23, 42, 0.38);
}

.table-controls-right {
    gap: 14px;
}

.table-control-btn {
    display: inline-flex;
    align-items: center;
    gap: 10px;
    padding: 11px 22px;
    border-radius: 14px;
    border: 1px solid rgba(226, 232, 240, 0.22);
    background: rgba(248, 250, 252, 0.14);
    color: #f8fafc;
    font-size: 14px;
    font-weight: 700;
    font-family: 'Cairo', 'Tajawal', sans-serif;
    cursor: pointer;
    transition: transform 0.25s ease, box-shadow 0.25s ease, background 0.25s ease;
    box-shadow: 0 18px 40px rgba(15, 23, 42, 0.32);
    backdrop-filter: blur(6px);
}

.table-control-btn i {
    font-size: 16px;
    transition: transform 0.3s ease;
}

.table-control-btn:hover {
    transform: translateY(-3px);
    background: rgba(248, 250, 252, 0.22);
    box-shadow: 0 24px 48px rgba(37, 99, 235, 0.32);
}

.table-control-btn:active {
    transform: translateY(-1px) scale(0.99);
}

.table-control-btn.clear-filters-btn {
    background: linear-gradient(135deg, rgba(248, 113, 113, 0.32), rgba(239, 68, 68, 0.48));
    border-color: rgba(248, 113, 113, 0.6);
    box-shadow: 0 24px 52px rgba(239, 68, 68, 0.28);
}

.table-control-btn.clear-filters-btn:hover {
    background: linear-gradient(135deg, rgba(254, 215, 170, 0.4), rgba(248, 113, 113, 0.6));
    box-shadow: 0 28px 60px rgba(248, 113, 113, 0.38);
}

.table-control-btn.clear-filters-btn:focus-visible {
    outline: 3px solid rgba(248, 113, 113, 0.45);
    outline-offset: 3px;
}

/* Refresh Button */
.table-control-btn.refresh-btn {
    background: linear-gradient(135deg, #38bdf8 0%, #2563eb 55%, #1d4ed8 100%);
    border-color: rgba(96, 165, 250, 0.55);
    box-shadow: 0 24px 52px rgba(37, 99, 235, 0.42);
}

.table-control-btn.refresh-btn:hover {
    background: linear-gradient(135deg, #60a5fa 0%, #2563eb 60%, #1d4ed8 100%);
    box-shadow: 0 28px 58px rgba(37, 99, 235, 0.48);
}

.table-control-btn.refresh-btn i {
    /* Print Button */
    .table-control-btn.print-btn {
        background: rgba(248, 250, 252, 0.18);
    }

    .table-control-btn.print-btn:hover {
        background: rgba(248, 250, 252, 0.3);
        border-color: rgba(226, 232, 240, 0.45);
        color: #0f172a;
    }

    /* Excel Button */
    .table-control-btn.excel-btn {
        background: linear-gradient(135deg, #34d399 0%, #059669 60%, #047857 100%);
        border-color: rgba(16, 185, 129, 0.55);
        box-shadow: 0 24px 52px rgba(16, 185, 129, 0.36);
    }

    .table-control-btn.excel-btn:hover {
        background: linear-gradient(135deg, #6ee7b7 0%, #10b981 45%, #047857 100%);
        box-shadow: 0 28px 60px rgba(16, 185, 129, 0.42);
    }

    /* PDF Button */
    .table-control-btn.pdf-btn {
        background: linear-gradient(135deg, #f87171 0%, #ef4444 55%, #dc2626 100%);
        border-color: rgba(248, 113, 113, 0.6);
        box-shadow: 0 24px 52px rgba(239, 68, 68, 0.36);
    }

    .table-control-btn.pdf-btn:hover {
        background: linear-gradient(135deg, #fca5a5 0%, #ef4444 50%, #b91c1c 100%);
        box-shadow: 0 28px 60px rgba(239, 68, 68, 0.42);
    }
        transition: all 0.3s ease;
        box-shadow: inset 0 1px 6px rgba(15, 23, 42, 0.24);
    }

    .table-control-btn.dasht-btn .toggle-indicator::after {
        content: '';
        position: absolute;
        top: 3px;
        inset-inline-start: 4px;
        width: 14px;
        height: 14px;
        border-radius: 50%;
        background: rgba(15, 23, 42, 0.65);
        box-shadow: 0 2px 6px rgba(15, 23, 42, 0.4);
        transition: all 0.3s ease;
    }

    .table-control-btn.dasht-btn[data-show-dasht="true"] .toggle-indicator {
        background: rgba(250, 204, 21, 0.35);
    }

    .table-control-btn.dasht-btn[data-show-dasht="true"] .toggle-indicator::after {
        inset-inline-start: 22px;
        background: #f59e0b;
        box-shadow: 0 2px 8px rgba(245, 158, 11, 0.45);
    }
/* PDF Button */
.table-control-btn.pdf-btn {
    background: linear-gradient(135deg, #ef4444 0%, #dc2626 100%);
    color: #ffffff;
    border-color: #ef4444;
}

.table-control-btn.pdf-btn:hover {
    background: linear-gradient(135deg, #dc2626 0%, #b91c1c 100%);
    box-shadow: 0 4px 12px rgba(239, 68, 68, 0.4);
}

/* Loading state for refresh button */
.table-control-btn.refresh-btn.loading i {
    animation: rotate 1s linear infinite;
}

.table-control-btn.refresh-btn.loading {
    opacity: 0.7;
    cursor: not-allowed;
}

/* Responsive */
@media (max-width: 768px) {
    .table-controls-wrapper {
        flex-direction: column;
        align-items: stretch;
        gap: 18px;
        padding: 18px 16px;
    }

    .table-controls-left,
    .table-controls-right {
        justify-content: space-between;
        flex-wrap: wrap;
    }

    .table-controls-right {
        gap: 12px;
    }

    .table-control-btn {
        flex: 1 1 calc(50% - 12px);
        min-width: 140px;
        justify-content: center;
        padding: 10px 16px;
        font-size: 13px;
    }

    .table-control-btn span {
        display: none;
    }

    .table-control-btn i {
        font-size: 18px;
    }

    .table-title {
        font-size: 20px;
        justify-content: center;
    }
}

@media (max-width: 480px) {
    .table-control-btn {
        flex: 1 1 100%;
        min-width: 0;
        padding: 10px 14px;
    }
}


/* ===== Overview Tab Styles ===== */
.overview-container { font-family: 'Cairo', 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif; }
.overview-item { animation: fadeInUp 0.5s ease-out; }
@keyframes fadeInUp { from { opacity: 0; transform: translateY(20px); } to { opacity: 1; transform: translateY(0); } }
.overview-highlight { font-weight: 700; color: #1f2937; padding: 2px 8px; background: rgba(59, 130, 246, 0.1); border-radius: 6px; display: inline-block; margin: 0 4px; transition: all 0.3s; }
.overview-highlight:hover { background: rgba(59, 130, 246, 0.2); transform: translateY(-1px); }
.overview-highlight.client-name { background: linear-gradient(135deg, rgba(59, 130, 246, 0.15), rgba(147, 51, 234, 0.15)); color: #667eea; font-size: 1.05em; }
.overview-highlight.file-number { background: rgba(245, 158, 11, 0.15); color: #f59e0b; font-family: 'Courier New', monospace; }
.overview-highlight.national-id { background: rgba(8, 145, 178, 0.15); color: #0891b2; font-family: 'Courier New', monospace; }
.overview-highlight.warning { background: rgba(239, 68, 68, 0.15); color: #dc2626; font-weight: 800; }
.overview-link { color: #3b82f6; text-decoration: none; font-weight: 700; padding: 4px 10px; background: rgba(59, 130, 246, 0.1); border-radius: 8px; display: inline-flex; align-items: center; gap: 6px; transition: all 0.3s; margin: 0 4px; }
.overview-link:hover { background: rgba(59, 130, 246, 0.2); transform: translateY(-2px); box-shadow: 0 4px 12px rgba(59, 130, 246, 0.3); }
.overview-link i { font-size: 0.9em; }
.overview-text { word-wrap: break-word; overflow-wrap: break-word; }
@media (max-width: 768px) { .overview-item { flex-direction: column; padding: 16px; } .overview-icon { width: 40px !important; height: 40px !important; min-width: 40px !important; font-size: 20px !important; } .overview-text { font-size: 14px !important; } .overview-highlight { font-size: 0.95em; } }


/* ===== Image Upload Container Styles ===== */
.image-upload-container {
    position: relative;
    overflow: hidden;
}

.image-upload-container:hover {
    border-color: #94a3b8 !important;
    background: #f1f5f9 !important;
}

.image-upload-container .upload-trigger-btn {
    transition: all 0.3s ease;
}

.image-upload-container .current-image-preview {
    animation: slideDown 0.3s ease-out;
}

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

.image-upload-container .current-image-preview img {
    transition: transform 0.3s ease;
}

.image-upload-container .current-image-preview img:hover {
    transform: scale(1.02);
}

.image-upload-container .remove-image-btn:hover {
    background: #fca5a5 !important;
    transform: translateY(-1px);
    box-shadow: 0 2px 8px rgba(220, 38, 38, 0.3);
}

.image-upload-container input[type="file"] {
    position: absolute;
    opacity: 0;
    pointer-events: none;
}

/* Loading animation for image upload */
@keyframes spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

.fa-spinner.fa-spin {
    animation: spin 1s linear infinite;
}

