/* Reset and Base Styles */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    background-color: #f5f7fa;
    color: #333;
    line-height: 1.6;
}

.container {
    display: flex;
    min-height: 100vh;
}

/* Sidebar Styles */
.sidebar {
    width: 280px;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    padding: 0;
    box-shadow: 2px 0 10px rgba(0,0,0,0.1);
    position: fixed;
    height: 100vh;
    overflow-y: auto;
}

.sidebar-header {
    padding: 20px;
    border-bottom: 1px solid rgba(255,255,255,0.1);
    text-align: center;
}

.sidebar-header h2 {
    font-size: 1.5rem;
    font-weight: 600;
}

.nav-menu {
    list-style: none;
    padding: 20px 0;
}

.nav-item {
    margin: 5px 0;
}

.nav-item a {
    display: flex;
    align-items: center;
    padding: 15px 25px;
    color: white;
    text-decoration: none;
    transition: all 0.3s ease;
    border-left: 3px solid transparent;
}

.nav-item a:hover {
    background-color: rgba(255,255,255,0.1);
    border-left-color: #fff;
}

.nav-item.active a {
    background-color: rgba(255,255,255,0.2);
    border-left-color: #fff;
}

.nav-item i {
    margin-right: 15px;
    width: 20px;
    text-align: center;
}

.sidebar-footer {
    padding: 20px;
    border-top: 1px solid rgba(255,255,255,0.1);
    position: absolute;
    bottom: 0;
    width: 100%;
}

/* Main Content Styles */
.main-content {
    flex: 1;
    margin-left: 280px;
    min-height: 100vh;
    overflow-x: hidden; /* Prevent horizontal overflow on main content */
}

.top-header {
    background: white;
    padding: 20px 30px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    box-shadow: 0 2px 10px rgba(0,0,0,0.1);
    position: sticky;
    top: 0;
    z-index: 100;
}

.header-left h1 {
    font-size: 2rem;
    font-weight: 600;
    color: #333;
}

.header-right {
    display: flex;
    align-items: center;
    gap: 15px;
}

.user-avatar {
    width: 40px;
    height: 40px;
    background: #667eea;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
    font-size: 1.2rem;
}

/* Content Container */
.content-container {
    padding: 15px;
}

.page-content {
    display: none;
}

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

/* Dashboard Stats */
.stats-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
    gap: 10px;
    margin-bottom: 15px;
}

/* Keep dashboard KPI cards fixed width and wrap to new rows */
#dashboard .stats-grid {
    grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
    justify-content: start;
    gap: 8px;
}

.stat-card {
    background: white;
    padding: 12px;
    border-radius: 6px;
    box-shadow: 0 1px 4px rgba(0,0,0,0.1);
    display: flex;
    align-items: center;
    transition: transform 0.3s ease;
    min-height: 60px;
}

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

.stat-icon {
    width: 40px;
    height: 40px;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
    font-size: 1.1rem;
    margin-right: 12px;
    flex-shrink: 0;
}

.stat-content h3 {
    font-size: 1.4rem;
    font-weight: 700;
    color: #333;
    margin-bottom: 2px;
    line-height: 1.1;
}

.stat-content p {
    color: #666;
    font-size: 0.75rem;
    line-height: 1.2;
    margin: 0;
}

/* Dashboard Charts */
.dashboard-charts {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(400px, 1fr));
    gap: 15px;
}

.chart-container {
    background: white;
    padding: 25px;
    border-radius: 10px;
    box-shadow: 0 2px 10px rgba(0,0,0,0.1);
}

.chart-container h3 {
    margin-bottom: 20px;
    color: #333;
    font-size: 1.2rem;
}

.chart-placeholder {
    height: 200px;
    background: #f8f9fa;
    border: 2px dashed #dee2e6;
    border-radius: 8px;
    display: flex;
    align-items: center;
    justify-content: center;
    color: #6c757d;
}

/* Page Headers */
.page-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 25px;
    padding-bottom: 15px;
    border-bottom: 2px solid #e9ecef;
}

.page-header h2 {
    font-size: 1.8rem;
    color: #333;
}

.header-actions {
    display: flex;
    gap: 15px;
    align-items: center;
}

/* Buttons */
.btn {
    padding: 10px 20px;
    border: none;
    border-radius: 6px;
    cursor: pointer;
    font-size: 0.9rem;
    font-weight: 500;
    transition: all 0.3s ease;
    display: inline-flex;
    align-items: center;
    gap: 8px;
    text-decoration: none;
}

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

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

.btn-primary:hover {
    background: #0056b3;
}

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

.btn-success:hover {
    background: #1e7e34;
}

.btn-warning {
    background: #ffc107;
    color: #212529;
}

.btn-warning:hover {
    background: #e0a800;
}

.btn-danger {
    background: #dc3545;
    color: white;
}

.btn-danger:hover {
    background: #c82333;
}

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

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

/* Form Elements */
.search-input {
    padding: 10px 15px;
    border: 1px solid #ddd;
    border-radius: 6px;
    font-size: 0.9rem;
    width: 250px;
}

.search-input:focus {
    outline: none;
    border-color: #007bff;
    box-shadow: 0 0 0 3px rgba(0,123,255,0.1);
}

.select-input {
    padding: 10px 15px;
    border: 1px solid #ddd;
    border-radius: 6px;
    font-size: 0.9rem;
    background: white;
    cursor: pointer;
}

.select-input:focus {
    outline: none;
    border-color: #007bff;
}

/* Tables */
.table-container {
    background: white;
    border-radius: 10px;
    box-shadow: 0 2px 10px rgba(0,0,0,0.1);
    overflow-x: auto; /* Make all table containers horizontally scrollable */
    -webkit-overflow-scrolling: touch;
}

.table-container::-webkit-scrollbar {
    height: 8px;
}

.table-container::-webkit-scrollbar-track {
    background: #f1f1f1;
    border-radius: 4px;
}

.table-container::-webkit-scrollbar-thumb {
    background: #888;
    border-radius: 4px;
}

.table-container::-webkit-scrollbar-thumb:hover {
    background: #555;
}

/* Responsive table wrapper - applies to all tables */
.table-responsive {
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
    border-radius: 10px;
}

.table-responsive::-webkit-scrollbar {
    height: 8px;
}

.table-responsive::-webkit-scrollbar-track {
    background: #f1f1f1;
    border-radius: 4px;
}

.table-responsive::-webkit-scrollbar-thumb {
    background: #888;
    border-radius: 4px;
}

.table-responsive::-webkit-scrollbar-thumb:hover {
    background: #555;
}

.data-table {
    width: 100%;
    min-width: 800px; /* Ensure minimum width for readability */
    border-collapse: collapse;
    font-size: 14px;
    table-layout: auto; /* Allow columns to size based on content */
}

.data-table th {
    background: #f8f9fa;
    padding: 12px 8px;
    text-align: left;
    font-weight: 600;
    color: #495057;
    border-bottom: 2px solid #dee2e6;
    font-size: 0.8rem;
    text-transform: uppercase;
    letter-spacing: 0.3px;
    white-space: nowrap; /* Prevent header text wrapping */
    min-width: 100px; /* Ensure minimum column width */
}

.data-table td {
    padding: 10px 8px;
    border-bottom: 1px solid #dee2e6;
    vertical-align: middle;
    white-space: nowrap;
    min-width: 80px; /* Ensure minimum cell width */
}

.data-table tbody tr:hover {
    background-color: #f8f9fa;
}

/* Date Range Filter Styles */
.date-range-filter {
    display: flex;
    align-items: center;
    gap: 10px;
    flex-wrap: wrap;
}

.date-range-filter label {
    font-size: 0.9rem;
    font-weight: 500;
    color: #495057;
    margin: 0;
}

.date-range-filter .date-input {
    padding: 6px 10px;
    border: 1px solid #ddd;
    border-radius: 4px;
    font-size: 0.9rem;
    min-width: 140px;
}

.date-range-filter .btn-sm {
    padding: 6px 12px;
    font-size: 0.85rem;
    border-radius: 4px;
    border: none;
    cursor: pointer;
    transition: background-color 0.2s;
}

.date-range-filter .btn-primary {
    background-color: #007bff;
    color: white;
}

.date-range-filter .btn-primary:hover {
    background-color: #0056b3;
}

.date-range-filter .btn-secondary {
    background-color: #6c757d;
    color: white;
}

.date-range-filter .btn-secondary:hover {
    background-color: #545b62;
}


/* User Activity Table Specific Styles */
#userActivityTable {
    min-width: 1400px; /* Ensure minimum width for all columns */
}

#userActivityTable th:first-child {
    position: sticky;
    left: 0;
    background: #f8f9fa !important;
    z-index: 5;
    min-width: 180px;
    max-width: 250px;
    color: #495057 !important;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.3px;
    font-size: 0.8rem;
}

#userActivityTable td:first-child {
    position: sticky;
    left: 0;
    background-color: white;
    z-index: 5;
    min-width: 180px;
    max-width: 250px;
}

#userActivityTable tr:hover td:first-child {
    background-color: #f8f9fa;
}

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

/* Reassignment Stats */
.reassignment-stats {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 20px;
    margin-bottom: 25px;
}

.stat-box {
    background: white;
    padding: 20px;
    border-radius: 8px;
    box-shadow: 0 2px 8px rgba(0,0,0,0.1);
    text-align: center;
}

.stat-box h4 {
    color: #666;
    font-size: 0.9rem;
    margin-bottom: 10px;
}

.stat-box span {
    font-size: 1.8rem;
    font-weight: 700;
    color: #333;
}

/* Upload Area */
.upload-container {
    background: white;
    padding: 30px;
    border-radius: 10px;
    box-shadow: 0 2px 10px rgba(0,0,0,0.1);
}

.upload-area {
    border: 2px dashed #dee2e6;
    border-radius: 10px;
    padding: 40px;
    text-align: center;
    margin-bottom: 25px;
    cursor: pointer;
    transition: all 0.3s ease;
}

.upload-area:hover {
    border-color: #007bff;
    background-color: #f8f9fa;
}

.upload-area.drag-over {
    border-color: #007bff;
    background-color: #e3f2fd;
    transform: scale(1.02);
}

.upload-area i {
    font-size: 3rem;
    color: #6c757d;
    margin-bottom: 15px;
}

.upload-area h3 {
    color: #333;
    margin-bottom: 10px;
}

.upload-area p {
    color: #666;
}

.upload-info {
    margin-bottom: 25px;
}

.upload-info h4 {
    color: #333;
    margin-bottom: 15px;
}

.upload-info ul {
    list-style: none;
    padding-left: 0;
}

.upload-info li {
    padding: 5px 0;
    color: #666;
    position: relative;
    padding-left: 20px;
}

.upload-info li:before {
    content: "•";
    color: #007bff;
    font-weight: bold;
    position: absolute;
    left: 0;
}

.upload-actions {
    text-align: center;
}

/* Checkbox Group Styles */
.checkbox-group {
    border: 1px solid #ddd;
    border-radius: 8px;
    max-height: 300px;
    overflow-y: auto;
}

.checkbox-header {
    padding: 15px;
    border-bottom: 1px solid #eee;
    background: #f8f9fa;
    border-radius: 8px 8px 0 0;
}

.select-all-checkbox {
    display: flex;
    align-items: center;
    gap: 10px;
    font-weight: 600;
    color: #333;
    cursor: pointer;
}

.select-all-checkbox input[type="checkbox"] {
    width: 18px;
    height: 18px;
    cursor: pointer;
}

.contacts-checkbox-list {
    padding: 15px;
    max-height: 250px;
    overflow-y: auto;
}

.contact-checkbox-item {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 8px 0;
    border-bottom: 1px solid #f0f0f0;
    cursor: pointer;
}

.contact-checkbox-item:last-child {
    border-bottom: none;
}

.contact-checkbox-item:hover {
    background: #f8f9fa;
    border-radius: 4px;
    padding: 8px;
    margin: 0 -8px;
}

.contact-checkbox-item input[type="checkbox"] {
    width: 16px;
    height: 16px;
    cursor: pointer;
}

.contact-info {
    flex: 1;
    display: flex;
    flex-direction: column;
    gap: 2px;
}

.contact-name {
    font-weight: 500;
    color: #333;
}

.contact-details {
    font-size: 0.9em;
    color: #666;
}

/* Settings */
.settings-container {
    background: white;
    padding: 30px;
    border-radius: 10px;
    box-shadow: 0 2px 10px rgba(0,0,0,0.1);
}

.setting-group {
    margin-bottom: 30px;
}

.setting-group h3 {
    color: #333;
    margin-bottom: 20px;
    padding-bottom: 10px;
    border-bottom: 1px solid #e9ecef;
}

.setting-item {
    display: flex;
    align-items: center;
    gap: 15px;
    margin-bottom: 20px;
    padding: 15px;
    background: #f8f9fa;
    border-radius: 8px;
}

.setting-item label {
    min-width: 200px;
    font-weight: 500;
    color: #495057;
}

.setting-input {
    flex: 1;
    max-width: 200px;
    padding: 8px 12px;
    border: 1px solid #ddd;
    border-radius: 6px;
    font-size: 0.9rem;
}

.setting-input:focus {
    outline: none;
    border-color: #007bff;
}

/* Modals */
.modal {
    display: none;
    position: fixed;
    z-index: 1000;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0,0,0,0.5);
}

.modal-content {
    background-color: white;
    margin: 5% auto;
    padding: 0;
    border-radius: 10px;
    width: 90%;
    max-width: 500px;
    box-shadow: 0 4px 20px rgba(0,0,0,0.3);
    animation: modalSlideIn 0.3s ease;
}

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

.modal-header {
    padding: 20px 25px;
    border-bottom: 1px solid #e9ecef;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.modal-header h3 {
    color: #333;
    margin: 0;
}

.close {
    color: #aaa;
    font-size: 28px;
    font-weight: bold;
    cursor: pointer;
    line-height: 1;
}

.close:hover {
    color: #333;
}

.modal-body {
    padding: 25px;
    max-height: 70vh;
    overflow-y: auto;
}

.modal-footer {
    padding: 20px 25px;
    border-top: 1px solid #e9ecef;
    display: flex;
    justify-content: flex-end;
    gap: 15px;
}

/* Form Groups */
.form-group {
    margin-bottom: 20px;
}

.form-group label {
    display: block;
    margin-bottom: 8px;
    font-weight: 500;
    color: #495057;
}

.form-group input,
.form-group select,
.form-group textarea {
    width: 100%;
    padding: 10px 12px;
    border: 1px solid #ddd;
    border-radius: 6px;
    font-size: 0.9rem;
    transition: border-color 0.3s ease;
}

.form-group input:focus,
.form-group select:focus,
.form-group textarea:focus {
    outline: none;
    border-color: #007bff;
    box-shadow: 0 0 0 3px rgba(0,123,255,0.1);
}

.form-group textarea {
    resize: vertical;
    min-height: 80px;
}

/* Pagination Styles */
.pagination-container {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-top: 20px;
    padding: 15px;
    background: white;
    border-radius: 8px;
    box-shadow: 0 2px 4px rgba(0,0,0,0.1);
}

.pagination-info {
    font-size: 14px;
    color: #666;
}

.pagination-controls {
    display: flex;
    align-items: center;
    gap: 15px;
}

.page-info {
    font-weight: 500;
    color: #333;
    min-width: 80px;
    text-align: center;
}

.btn-outline {
    background: transparent;
    border: 1px solid #ddd;
    color: #666;
    transition: all 0.3s ease;
    margin-top: 10px;
}

.btn-outline:hover:not(:disabled) {
    background: #f8f9fa;
    border-color: #007bff;
    color: #007bff;
}

.btn-outline:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

/* Loading Overlay */
.loading-overlay {
    display: none;
    position: fixed;
    z-index: 9999;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0,0,0,0.7);
}

.loading-spinner {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    text-align: center;
    color: white;
}

.loading-spinner i {
    font-size: 3rem;
    margin-bottom: 15px;
}

.loading-spinner p {
    font-size: 1.1rem;
}

/* Report Content */
.report-content {
    background: white;
    padding: 25px;
    border-radius: 10px;
    box-shadow: 0 2px 10px rgba(0,0,0,0.1);
    min-height: 400px;
}

/* File-Based Assignment Styles */
.card {
    background: white;
    border-radius: 8px;
    box-shadow: 0 2px 4px rgba(0,0,0,0.1);
    margin-bottom: 20px;
}

.card-header {
    padding: 20px;
    border-bottom: 1px solid #e0e0e0;
    background: #f8f9fa;
}

.card-header h3 {
    margin: 0;
    color: #333;
    font-size: 1.2em;
}

.card-body {
    padding: 20px;
}

.assignment-step {
    margin-bottom: 30px;
    padding-bottom: 20px;
    border-bottom: 1px solid #e0e0e0;
}

.assignment-step:last-child {
    border-bottom: none;
    margin-bottom: 0;
}

.assignment-step h4 {
    color: #007bff;
    margin-bottom: 15px;
    font-size: 1.1em;
}

.file-info-card {
    background: #f8f9fa;
    padding: 15px;
    border-radius: 6px;
    border: 1px solid #e0e0e0;
}

.file-info-item {
    margin-bottom: 10px;
    display: flex;
    align-items: center;
    gap: 10px;
}

.file-info-item:last-child {
    margin-bottom: 0;
}

.toggle-switch {
    position: relative;
    display: inline-block;
    width: 50px;
    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: #ccc;
    transition: .4s;
    border-radius: 24px;
}

.toggle-slider:before {
    position: absolute;
    content: "";
    height: 18px;
    width: 18px;
    left: 3px;
    bottom: 3px;
    background-color: white;
    transition: .4s;
    border-radius: 50%;
}

input:checked + .toggle-slider {
    background-color: #007bff;
}

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

.selection-container {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 20px;
    margin-top: 15px;
}

.selection-panel, .assignment-panel {
    border: 1px solid #e0e0e0;
    border-radius: 6px;
    background: #f8f9fa;
}

.panel-header {
    padding: 15px;
    border-bottom: 1px solid #e0e0e0;
    background: white;
    border-radius: 6px 6px 0 0;
}

.panel-header h5 {
    margin: 0 0 10px 0;
    color: #333;
}

.selection-controls {
    display: flex;
    gap: 8px;
    align-items: center;
}

.contacts-list {
    max-height: 400px;
    overflow-y: auto;
    padding: 10px;
}

.contact-item {
    display: flex;
    align-items: center;
    padding: 10px;
    margin-bottom: 8px;
    background: white;
    border: 1px solid #e0e0e0;
    border-radius: 4px;
    cursor: pointer;
    transition: all 0.2s;
}

.contact-item:hover {
    background: #e3f2fd;
    border-color: #007bff;
}

.contact-item.selected {
    background: #007bff;
    color: white;
    border-color: #007bff;
}

.contact-item input[type="checkbox"] {
    margin-right: 10px;
}

.contact-info {
    flex: 1;
}

.contact-name {
    font-weight: 500;
    margin-bottom: 2px;
}

.contact-phone {
    font-size: 0.9em;
    color: #666;
}

.contact-item.selected .contact-phone {
    color: #e0e0e0;
}

.selection-summary {
    padding: 15px;
    background: white;
    border-bottom: 1px solid #e0e0e0;
}

.summary-item {
    margin-bottom: 8px;
    font-size: 0.9em;
}

.summary-item:last-child {
    margin-bottom: 0;
}

.assignment-panel .panel-header {
    padding-bottom: 10px;
}

.assignment-panel button {
    width: 100%;
    margin-top: 15px;
}

/* Responsive Design */
@media (max-width: 768px) {
    .sidebar {
        width: 100%;
        position: relative;
        height: auto;
    }
    
    .main-content {
        margin-left: 0;
        overflow-x: hidden;
    }
    
    /* Mobile table styles */
    .table-container {
        border-radius: 5px;
        margin: 0 -10px; /* Extend to screen edges on mobile */
    }
    
    .data-table {
        font-size: 12px;
        min-width: 600px; /* Smaller minimum width for mobile */
    }
    
    .data-table th,
    .data-table td {
        padding: 8px 6px;
        min-width: 60px; /* Smaller minimum cell width for mobile */
    }
    
    /* More compact dashboard stats on mobile */
    .stats-grid {
        grid-template-columns: repeat(auto-fit, minmax(140px, 1fr));
        gap: 8px;
    }
    
    .stat-card {
        padding: 8px;
        min-height: 50px;
    }
    
    .stat-icon {
        width: 32px;
        height: 32px;
        font-size: 0.9rem;
        margin-right: 8px;
    }
    
    .stat-content h3 {
        font-size: 1.2rem;
    }
    
    .stat-content p {
        font-size: 0.7rem;
    }
    
    .dashboard-charts {
        grid-template-columns: 1fr;
    }
    
    .page-header {
        flex-direction: column;
        gap: 15px;
        align-items: flex-start;
    }
    
    .header-actions {
        flex-direction: column;
        width: 100%;
    }
    
    .search-input {
        width: 100%;
    }
    
    .modal-content {
        width: 95%;
        margin: 10% auto;
    }
    
    .setting-item {
        flex-direction: column;
        align-items: flex-start;
        gap: 10px;
    }
    
    .setting-input {
        max-width: 100%;
    }
}

/* Utility Classes */
.hidden {
    display: none !important;
}

.text-success {
    color: #28a745;
}

.text-danger {
    color: #dc3545;
}

.text-warning {
    color: #ffc107;
}

.text-info {
    color: #17a2b8;
}

.badge {
    padding: 4px 8px;
    border-radius: 12px;
    font-size: 0.75rem;
    font-weight: 500;
}

.badge-success {
    background: #d4edda;
    color: #155724;
}

.badge-danger {
    background: #f8d7da;
    color: #721c24;
}

.badge-warning {
    background: #fff3cd;
    color: #856404;
}

.badge-info {
    background: #d1ecf1;
    color: #0c5460;
}

/* User Details Styles */
.page-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 20px;
    flex-wrap: wrap;
}

.header-left, .header-right {
    display: flex;
    align-items: center;
    gap: 10px;
}

.page-header h2 {
    flex: 1;
    text-align: center;
    margin: 0;
}

#downloadUserReportBtn {
    background: #28a745;
    border-color: #28a745;
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 8px 16px;
    font-size: 14px;
    border-radius: 6px;
    transition: all 0.2s;
}

#downloadUserReportBtn:hover {
    background: #218838;
    border-color: #1e7e34;
    transform: translateY(-1px);
}

#downloadUserReportBtn:disabled {
    background: #6c757d;
    border-color: #6c757d;
    cursor: not-allowed;
    transform: none;
}

/* Notes Display Styles */
.notes-cell {
    max-width: 300px;
    padding: 10px !important;
}

.note-item {
    background: #f8f9fa;
    border-left: 3px solid #3498db;
    padding: 8px 12px;
    margin-bottom: 8px;
    border-radius: 4px;
    font-size: 12px;
    line-height: 1.4;
}

.note-item:last-child {
    margin-bottom: 0;
}

.note-item strong {
    color: #2c3e50;
    font-weight: 600;
}

.text-muted {
    color: #6c757d;
    font-style: italic;
}

.user-info-card {
    background: white;
    border-radius: 8px;
    padding: 20px;
    margin-bottom: 20px;
    box-shadow: 0 2px 4px rgba(0,0,0,0.1);
}

.user-basic-info h3 {
    margin: 0 0 10px 0;
    color: #333;
    font-size: 24px;
}

.user-basic-info p {
    margin: 5px 0;
    color: #666;
}

.stats-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 20px;
    margin-bottom: 30px;
}

.stat-card {
    background: white;
    border-radius: 8px;
    padding: 20px;
    text-align: center;
    box-shadow: 0 2px 4px rgba(0,0,0,0.1);
    border-left: 4px solid #007bff;
}

.stat-number {
     font-size: 32px;
    font-weight: bold;
    margin-bottom: 8px;
    margin-right: 10px;
}

.stat-label {
    font-size: 14px;
    color: #666;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.tabs-container {
    margin-bottom: 20px;
}

.tabs {
    display: flex;
    border-bottom: 2px solid #e9ecef;
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
    white-space: nowrap;
    padding-bottom: 5px;
}

.tabs::-webkit-scrollbar {
    height: 4px;
}

.tabs::-webkit-scrollbar-track {
    background: #f1f1f1;
}

.tabs::-webkit-scrollbar-thumb {
    background: #888;
    border-radius: 2px;
}

.tabs::-webkit-scrollbar-thumb:hover {
    background: #555;
}

.tab-btn {
    background: none;
    border: none;
    padding: 12px 24px;
    cursor: pointer;
    font-size: 14px;
    font-weight: 500;
    color: #666;
    border-bottom: 2px solid transparent;
    transition: all 0.3s ease;
}

.tab-btn:hover {
    color: #007bff;
    background: #f8f9fa;
}

.tab-btn.active {
    color: #007bff;
    border-bottom-color: #007bff;
    background: white;
}

.tab-content {
    background: white;
    border-radius: 8px;
    box-shadow: 0 2px 4px rgba(0,0,0,0.1);
}

.user-link {
    color: #007bff;
    text-decoration: none;
    cursor: pointer;
    font-weight: 500;
}

.user-link:hover {
    color: #0056b3;
    text-decoration: underline;
}

/* Contact Tab Styles */
.page-content .tabs-container {
    margin-bottom: 20px;
}

.page-content .tabs {
    border-bottom: 2px solid #e9ecef;
    margin-bottom: 0;
}

.page-content .tab-btn {
    background: none;
    border: none;
    padding: 12px 20px;
    cursor: pointer;
    font-size: 14px;
    font-weight: 500;
    color: #666;
    border-bottom: 2px solid transparent;
    transition: all 0.2s ease;
}

.page-content .tab-btn:hover {
    color: #007bff;
    background: rgba(0, 123, 255, 0.05);
}

.page-content .tab-btn.active {
    color: #007bff;
    border-bottom-color: #007bff;
    background: rgba(0, 123, 255, 0.05);
}

/* Team Management Styles */
.team-overview {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 20px;
    margin-bottom: 30px;
}

.overview-card {
    background: white;
    border-radius: 8px;
    padding: 20px;
    text-align: center;
    box-shadow: 0 2px 4px rgba(0,0,0,0.1);
    border-left: 4px solid #28a745;
}

.overview-card h3 {
    margin: 0 0 10px 0;
    color: #333;
    font-size: 16px;
    font-weight: 500;
}

.overview-card span {
    font-size: 28px;
    font-weight: bold;
    color: #28a745;
}

.teams-container {
    background: white;
    border-radius: 8px;
    padding: 20px;
    box-shadow: 0 2px 4px rgba(0,0,0,0.1);
}

.teams-container h3 {
    margin: 0 0 20px 0;
    color: #333;
    font-size: 18px;
}

.teams-list {
    display: grid;
    gap: 15px;
}

.team-item {
    border: 1px solid #e9ecef;
    border-radius: 6px;
    padding: 15px;
    background: #f8f9fa;
}

.team-header {
    display: flex;
    justify-content: between;
    align-items: center;
    margin-bottom: 10px;
}

.team-lead-info {
    flex: 1;
}

.team-lead-name {
    font-weight: 600;
    color: #333;
    font-size: 16px;
}

.team-lead-email {
    color: #666;
    font-size: 14px;
}

.team-size {
    background: #007bff;
    color: white;
    padding: 4px 8px;
    border-radius: 4px;
    font-size: 12px;
    font-weight: 500;
}

.team-members {
    margin-top: 10px;
}

.team-members-title {
    font-size: 14px;
    font-weight: 500;
    color: #666;
    margin-bottom: 8px;
}

.member-list {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
}

.member-tag {
    background: #e9ecef;
    color: #495057;
    padding: 4px 8px;
    border-radius: 4px;
    font-size: 12px;
    position: relative;
}

.member-tag .remove-member {
    margin-left: 6px;
    color: #dc3545;
    cursor: pointer;
    font-weight: bold;
}

.member-tag .remove-member:hover {
    color: #c82333;
}

.no-members {
    color: #999;
    font-style: italic;
    font-size: 14px;
}

.assign-btn {
    background: #28a745;
    color: white;
    border: none;
    padding: 6px 12px;
    border-radius: 4px;
    font-size: 12px;
    cursor: pointer;
    transition: background-color 0.2s;
}

.assign-btn:hover {
    background: #218838;
}

/* Download Reports Dropdown Styles */
.btn-group {
    position: relative;
    display: inline-block;
}

.dropdown-toggle::after {
    content: " ▼";
    margin-left: 5px;
    font-size: 10px;
}

.dropdown-menu {
    position: absolute;
    top: 100%;
    right: 0;
    background: white;
    border: 1px solid #ddd;
    border-radius: 4px;
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
    min-width: 180px;
    z-index: 1000;
    display: none;
}

.dropdown-menu.show {
    display: block;
}

.dropdown-item {
    display: block;
    padding: 8px 16px;
    color: #333;
    text-decoration: none;
    transition: background-color 0.2s;
}

.dropdown-item:hover {
    background-color: #f8f9fa;
    color: #333;
    text-decoration: none;
}

.dropdown-item i {
    margin-right: 8px;
    width: 16px;
    text-align: center;
}

/* Page header layout */
.page-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 20px;
}

.page-header .header-left,
.page-header .header-right {
    display: flex;
    align-items: center;
    gap: 10px;
}

/* User Activity Section */
.user-activity-section {
    margin-top: 30px;
    background: white;
    border-radius: 8px;
    padding: 20px;
    box-shadow: 0 2px 4px rgba(0,0,0,0.1);
}

.user-activity-section h3 {
    margin-bottom: 20px;
    color: #333;
    font-size: 1.2rem;
    font-weight: 600;
}

#userActivityTable {
    width: 100%;
    border-collapse: collapse;
}

#userActivityTable th {
    background: #667eea;
    color: white;
    padding: 12px;
    text-align: center;
    font-weight: 600;
}

#userActivityTable td {
    padding: 12px;
    border-bottom: 1px solid #eee;
    text-align: center;
}

#userActivityTable tr:hover {
    background-color: #f8f9fa;
}

/* Date Filter Styles */
.section-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 20px;
    flex-wrap: wrap;
    gap: 15px;
}

.date-filter-container {
    display: flex;
    align-items: center;
    gap: 10px;
    background: white;
    padding: 10px 15px;
    border-radius: 8px;
    box-shadow: 0 2px 4px rgba(0,0,0,0.1);
    flex-wrap: wrap;
}

.team-lead-filter {
    display: flex;
    align-items: center;
    gap: 8px;
}

.team-lead-filter label {
    font-weight: 500;
    color: #555;
    white-space: nowrap;
}

/* Searchable Select Component */
.searchable-select-container {
    position: relative;
    min-width: 200px;
}

.searchable-select {
    position: relative;
    width: 100%;
}

.select-display {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 8px 12px;
    border: 2px solid #e1e5e9;
    border-radius: 6px;
    background: white;
    cursor: pointer;
    font-size: 14px;
    transition: border-color 0.3s ease;
}

.select-display:hover {
    border-color: #667eea;
}

.select-display.active {
    border-color: #667eea;
    box-shadow: 0 0 0 3px rgba(102, 126, 234, 0.1);
}

.selected-text {
    flex: 1;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.select-display i {
    margin-left: 8px;
    transition: transform 0.2s;
    color: #666;
}

.select-display.active i {
    transform: rotate(180deg);
}

.select-dropdown {
    position: absolute;
    top: 100%;
    left: 0;
    right: 0;
    background: white;
    border: 2px solid #667eea;
    border-top: none;
    border-radius: 0 0 6px 6px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
    z-index: 1000;
    display: none;
    max-height: 300px;
    overflow: hidden;
}

.select-dropdown.show {
    display: block;
}

.search-box {
    position: relative;
    padding: 8px;
    border-bottom: 1px solid #eee;
}

.search-input {
    width: 100%;
    padding: 8px 32px 8px 12px;
    border: 1px solid #ddd;
    border-radius: 4px;
    font-size: 14px;
    outline: none;
}

.search-input:focus {
    border-color: #667eea;
    box-shadow: 0 0 0 2px rgba(102, 126, 234, 0.25);
}

.search-box i {
    position: absolute;
    right: 16px;
    top: 50%;
    transform: translateY(-50%);
    color: #666;
    pointer-events: none;
}

.options-container {
    max-height: 200px;
    overflow-y: auto;
    margin-left: 10px;
    margin-top: 10px;
}

.option {
    padding: 10px 12px;
    cursor: pointer;
    font-size: 14px;
    border-bottom: 1px solid #f5f5f5;
    transition: background-color 0.2s;
 
}

.option:hover {
    background-color: #f8f9fa;
}

.option.selected {
    background-color: #667eea;
    color: white;
}

.option.hidden {
    display: none;
}

.no-results {
    padding: 12px;
    text-align: center;
    color: #666;
    font-style: italic;
}

/* Pagination controls for select dropdown */
.select-pagination {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 8px 12px;
    border-top: 1px solid #eee;
    background-color: #f8f9fa;
}

.select-pagination-btn {
    background: #007bff;
    color: white;
    border: none;
    padding: 4px 8px;
    border-radius: 3px;
    cursor: pointer;
    font-size: 12px;
}

.select-pagination-btn:hover {
    background: #0056b3;
}

.select-page-info {
    font-size: 12px;
    color: #666;
}

.select-count-info {
    padding: 6px 12px;
    font-size: 11px;
    color: #666;
    background-color: #f8f9fa;
    border-top: 1px solid #eee;
    text-align: center;
}

.team-lead-filter select {
    padding: 8px 12px;
    border: 2px solid #e1e5e9;
    border-radius: 6px;
    font-size: 14px;
    background: white;
    min-width: 150px;
    transition: border-color 0.3s ease;
}

.team-lead-filter select:focus {
    outline: none;
    border-color: #667eea;
    box-shadow: 0 0 0 3px rgba(102, 126, 234, 0.1);
}

.date-filter-container label {
    font-weight: 500;
    color: #555;
    white-space: nowrap;
}

.date-input {
    padding: 8px 12px;
    border: 2px solid #e1e5e9;
    border-radius: 6px;
    font-size: 14px;
    transition: border-color 0.3s ease;
}

.date-input:focus {
    outline: none;
    border-color: #667eea;
    box-shadow: 0 0 0 3px rgba(102, 126, 234, 0.1);
}

.btn-sm {
    padding: 6px 12px;
    font-size: 12px;
}

.btn-secondary {
    background-color: #6c757d;
    color: white;
    border: none;
    border-radius: 4px;
    cursor: pointer;
    transition: background-color 0.3s ease;
}

.btn-secondary:hover {
    background-color: #5a6268;
}

/* Activity Summary Styles */
.activity-summary {
    margin-top: 20px;
    padding: 20px;
    background: linear-gradient(135deg, #f8f9fa 0%, #e9ecef 100%);
    border-radius: 10px;
    border-left: 4px solid #667eea;
}

.summary-stats {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 15px;
}

.summary-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 10px 15px;
    background: white;
    border-radius: 8px;
    box-shadow: 0 2px 4px rgba(0,0,0,0.05);
}

.summary-label {
    font-weight: 500;
    color: #555;
}

.summary-value {
    font-weight: 600;
    color: #667eea;
    font-size: 1.1em;
}

/* Additional responsive styles for date filter */
@media (max-width: 768px) {
    .section-header {
        flex-direction: column;
        align-items: flex-start;
    }
    
    .date-filter-container {
        width: 100%;
        justify-content: space-between;
    }
    
    .summary-stats {
        grid-template-columns: 1fr;
    }
}
