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

/* Improve touch scrolling on mobile */
* {
    -webkit-tap-highlight-color: rgba(102, 126, 234, 0.2);
}

/* Smooth scrolling for the whole page */
html {
    scroll-behavior: smooth;
}

body {
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    min-height: 100vh;
    padding: 20px;
    color: #333;
    font-size: 16px; /* Minimum 16px for mobile readability */
}

/* Mobile-first: smaller padding on very small screens */
@media (max-width: 480px) {
    body {
        padding: 10px;
    }
}

.container {
    max-width: 1200px;
    margin: 0 auto;
    background: white;
    border-radius: 20px;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.3);
    overflow: hidden;
}

/* Prevent horizontal overflow on mobile */
@media (max-width: 768px) {
    .container {
        overflow-x: hidden;
    }
}

header {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    padding: 40px 30px;
    text-align: center;
    position: relative;
}

/* Responsive header for mobile */
@media (max-width: 768px) {
    header {
        padding: 25px 60px 25px 20px; /* Extra right padding for hamburger button */
    }
    
    /* Show mobile menu toggle */
    .mobile-menu-toggle {
        display: flex;
        align-items: center;
        justify-content: center;
    }
    
    /* Hide title icon on mobile */
    .title-icon {
        display: none;
    }
    
    /* Center header content on mobile since user info is in menu */
    header > div {
        justify-content: center !important;
        align-items: center !important;
    }
    
    header #user-info {
        display: none !important;
    }
}

@media (max-width: 480px) {
    header {
        padding: 20px 55px 20px 15px; /* Extra right padding for hamburger button */
    }
    
    .mobile-menu-toggle {
        top: 15px;
        right: 15px;
        padding: 8px 12px;
    }
    
    .hamburger-icon {
        font-size: 22px;
    }
}

header h1 {
    font-size: 2.5em;
    margin-bottom: 10px;
    text-shadow: 2px 2px 4px rgba(0, 0, 0, 0.2);
}

/* Responsive header title */
@media (max-width: 768px) {
    header h1 {
        font-size: 1.8em;
    }
}

@media (max-width: 480px) {
    header h1 {
        font-size: 1.5em;
    }
}

.subtitle {
    font-size: 1.1em;
    opacity: 0.9;
}

@media (max-width: 768px) {
    .subtitle {
        font-size: 1em;
    }
}

@media (max-width: 480px) {
    .subtitle {
        font-size: 0.9em;
    }
}

/* Mobile Menu User Section - Hidden on desktop */
.mobile-menu-user-section {
    display: none;
}

.mobile-logout-btn {
    display: none;
}

/* Mobile Menu Toggle Button - Hidden on desktop */
.mobile-menu-toggle {
    display: none;
    position: absolute;
    top: 20px;
    right: 20px;
    z-index: 10;
    background: rgba(255, 255, 255, 0.25);
    color: white;
    border: 2px solid rgba(255, 255, 255, 0.5);
    border-radius: 8px;
    padding: 10px 14px;
    cursor: pointer;
    backdrop-filter: blur(10px);
    min-width: 48px;
    min-height: 48px;
    transition: all 0.3s;
}

.mobile-menu-toggle:hover {
    background: rgba(255, 255, 255, 0.35);
    border-color: rgba(255, 255, 255, 0.7);
    transform: scale(1.05);
}

.mobile-menu-toggle:active {
    transform: scale(0.95);
}

.hamburger-icon {
    font-size: 24px;
    line-height: 1;
    display: block;
}

/* Mobile Menu Overlay - Hidden by default */
.mobile-menu-overlay {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.5);
    z-index: 999;
    opacity: 0;
    transition: opacity 0.3s ease;
}

.mobile-menu-overlay.active {
    opacity: 1;
}

.tabs {
    display: flex;
    background: linear-gradient(135deg, #f8f9fa 0%, #e9ecef 100%);
    border-bottom: 2px solid #e9ecef;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.05);
    position: relative;
    overflow: hidden;
    gap: 4px;
    padding: 4px;
}

/* Tabs list wrapper - transparent on desktop */
.tabs-list {
    display: flex;
    gap: 4px;
    width: 100%;
}

.tab-btn {
    flex: 1;
    padding: 20px 24px;
    background: transparent;
    border: none;
    cursor: pointer;
    font-size: 1.05em;
    font-weight: 600;
    color: #6c757d;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    border-bottom: 3px solid transparent;
    position: relative;
    overflow: hidden;
    text-align: center;
    border-radius: 8px 8px 0 0;
    margin: 0 2px;
}

.tab-btn::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: linear-gradient(135deg, rgba(102, 126, 234, 0.05) 0%, rgba(118, 75, 162, 0.05) 100%);
    opacity: 0;
    transition: opacity 0.3s ease;
}

.tab-btn:hover {
    color: #667eea;
    background: rgba(102, 126, 234, 0.08);
    transform: translateY(-2px);
}

.tab-btn:hover::before {
    opacity: 1;
}

.tab-btn.active {
    background: white;
    color: #667eea;
    border-bottom-color: #667eea;
    box-shadow: 0 -2px 8px rgba(102, 126, 234, 0.15);
    position: relative;
    z-index: 1;
    margin-bottom: -2px;
}

.tab-btn.active::after {
    content: '';
    position: absolute;
    bottom: -2px;
    left: 0;
    right: 0;
    height: 3px;
    background: linear-gradient(90deg, #667eea 0%, #764ba2 100%);
    animation: slideIn 0.3s ease-out;
}

@keyframes slideIn {
    from {
        transform: scaleX(0);
        transform-origin: center;
    }
    to {
        transform: scaleX(1);
        transform-origin: center;
    }
}

.tab-btn:active {
    transform: translateY(0);
    transition: transform 0.1s ease;
}

.tab-content {
    display: none;
    padding: 40px 30px;
    min-height: 400px;
    opacity: 0;
    transform: translateY(10px);
    transition: opacity 0.3s ease-in-out, transform 0.3s ease-in-out;
}

.tab-content.active {
    display: block;
    opacity: 1;
    transform: translateY(0);
    animation: fadeInTab 0.4s ease-in-out;
}

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

/* Unified Search Container */
.unified-search-container {
    display: flex;
    flex-direction: column;
    gap: 25px;
}

/* Filters Section */
.filters-section {
    background: linear-gradient(135deg, #f8f9fa 0%, #e9ecef 100%);
    padding: 25px;
    border-radius: 12px;
    border: 2px solid #dee2e6;
}

.filters-section h3 {
    color: #667eea;
    margin-bottom: 15px;
    font-size: 1.2em;
}

.filters-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 15px;
    margin-bottom: 15px;
}

.filter-group {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.filter-group label {
    font-weight: 600;
    color: #495057;
    font-size: 0.95em;
}

.filter-group input,
.filter-group select {
    padding: 12px 15px;
    border: 2px solid #dee2e6;
    border-radius: 8px;
    font-size: 1em;
    transition: all 0.3s;
    background: white;
    font-family: inherit;
    cursor: pointer;
    width: 100%;
    /* Minimum touch target */
    min-height: 44px;
}

/* Mobile form inputs */
@media (max-width: 768px) {
    .filter-group input,
    .filter-group select {
        font-size: 16px; /* Prevents zoom on iOS */
        padding: 12px;
    }
}

.filter-group select {
    padding-right: 40px;
    appearance: none;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 12 12'%3E%3Cpath fill='%23495057' d='M6 9L1 4h10z'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 15px center;
    background-size: 12px;
}

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

.filter-group select:hover {
    border-color: #adb5bd;
}

.btn-clear-filters {
    padding: 10px 20px;
    background: white;
    color: #6c757d;
    border: 2px solid #dee2e6;
    border-radius: 8px;
    cursor: pointer;
    font-size: 0.95em;
    font-weight: 600;
    transition: all 0.3s;
    box-shadow: none;
}

.btn-clear-filters:hover {
    background: #f8f9fa;
    border-color: #adb5bd;
    color: #495057;
    transform: none;
}

/* Search Section */
.search-section {
    background: white;
    padding: 25px;
    border-radius: 12px;
    box-shadow: 0 2px 8px rgba(0,0,0,0.1);
}

.search-section h3 {
    color: #667eea;
    margin-bottom: 10px;
    font-size: 1.2em;
}

.search-hint {
    color: #6c757d;
    font-size: 0.9em;
    margin-bottom: 15px;
    font-style: italic;
}

.search-section textarea {
    width: 100%;
    padding: 15px;
    border: 2px solid #dee2e6;
    border-radius: 8px;
    font-size: 1.05em;
    font-family: inherit;
    resize: vertical;
    transition: all 0.3s;
    margin-bottom: 15px;
    min-height: 150px;
}

/* Mobile textarea */
@media (max-width: 768px) {
    .search-section textarea {
        font-size: 16px; /* Prevents zoom on iOS */
        padding: 12px;
        min-height: 120px;
    }
}

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

.search-actions {
    display: flex;
    gap: 10px;
}

.btn-search {
    flex: 1;
    padding: 15px 30px;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    border: none;
    border-radius: 10px;
    font-size: 1.1em;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s;
    box-shadow: 0 4px 15px rgba(102, 126, 234, 0.3);
}

.btn-search:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(102, 126, 234, 0.4);
}

.btn-search:active {
    transform: translateY(0);
}

.search-box {
    margin-bottom: 30px;
}

.search-box input[type="text"],
.search-box textarea {
    width: 100%;
    padding: 15px 20px;
    font-size: 1.1em;
    border: 2px solid #e9ecef;
    border-radius: 10px;
    margin-bottom: 15px;
    transition: all 0.3s;
    font-family: inherit;
}

.search-box input[type="text"]:focus,
.search-box textarea:focus {
    outline: none;
    border-color: #667eea;
    box-shadow: 0 0 0 3px rgba(102, 126, 234, 0.1);
}

.search-box textarea {
    resize: vertical;
    min-height: 150px;
}

button {
    padding: 15px 40px;
    font-size: 1.1em;
    font-weight: 600;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    border: none;
    border-radius: 10px;
    cursor: pointer;
    transition: all 0.3s;
    box-shadow: 0 4px 15px rgba(102, 126, 234, 0.4);
    /* Minimum touch target size */
    min-height: 44px;
    min-width: 44px;
}

/* Responsive buttons */
@media (max-width: 768px) {
    button {
        padding: 12px 30px;
        font-size: 1em;
    }
}

@media (max-width: 480px) {
    button {
        padding: 12px 20px;
        font-size: 0.95em;
    }
}

button:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(102, 126, 234, 0.6);
}

/* Disable hover effects on touch devices for better performance */
@media (hover: none) and (pointer: coarse) {
    button:hover {
        transform: none;
        box-shadow: 0 4px 15px rgba(102, 126, 234, 0.4);
    }
    
    .tab-btn:hover {
        transform: none;
    }
}

button:active {
    transform: translateY(0);
}

.btn-secondary {
    background: #6c757d;
    box-shadow: 0 4px 15px rgba(108, 117, 125, 0.4);
}

.btn-secondary:hover {
    box-shadow: 0 6px 20px rgba(108, 117, 125, 0.6);
}

.button-group {
    display: flex;
    gap: 10px;
}

.button-group button {
    flex: 1;
}

/* Results */
.results {
    margin-top: 20px;
}

.results-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 20px;
    flex-wrap: wrap;
    gap: 15px;
}

.results-header h2 {
    color: #667eea;
    margin: 0;
}

.results-actions {
    display: flex;
    gap: 10px;
    flex-wrap: wrap;
}

.btn-action {
    padding: 10px 20px;
    font-size: 0.95em;
    font-weight: 600;
    background: linear-gradient(135deg, #28a745 0%, #20c997 100%);
    color: white;
    border: none;
    border-radius: 8px;
    cursor: pointer;
    transition: all 0.3s;
    box-shadow: 0 2px 8px rgba(40, 167, 69, 0.3);
}

.btn-action:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(40, 167, 69, 0.5);
}

/* Table Styles */
.table-container {
    overflow-x: auto;
    background: white;
    border-radius: 12px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
}

.results-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 1em;
}

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

.results-table th {
    padding: 15px 12px;
    text-align: right;
    font-weight: 600;
    font-size: 1.05em;
    border-bottom: 2px solid #e9ecef;
}

.results-table td {
    padding: 12px;
    text-align: right;
    border-bottom: 1px solid #e9ecef;
}

.results-table tbody tr {
    transition: all 0.2s;
}

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

.results-table tbody tr.not-found-row {
    background: #fff3cd;
    color: #856404;
}

.results-table tbody tr.not-found-row:hover {
    background: #ffe8a1;
}

.results-table tbody tr.not-found-row td {
    font-style: italic;
}

.results-table tbody tr.not-found-row .checkbox-col input {
    cursor: not-allowed;
    opacity: 0.5;
}

.results-table tbody tr.selected {
    background: #e7f3ff;
    border-right: 4px solid #667eea;
}

.checkbox-col {
    width: 50px;
    text-align: center !important;
}

.row-checkbox {
    width: 18px;
    height: 18px;
    cursor: pointer;
    /* Better touch target for mobile */
    min-width: 20px;
    min-height: 20px;
}

.selectable-row {
    cursor: pointer;
}

/* Old card styles (kept for backward compatibility) */
.result-card {
    background: #f8f9fa;
    border: 2px solid #e9ecef;
    border-radius: 12px;
    padding: 20px;
    margin-bottom: 15px;
    transition: all 0.3s;
    position: relative;
}

.result-card:hover {
    border-color: #667eea;
    box-shadow: 0 4px 15px rgba(102, 126, 234, 0.1);
    transform: translateY(-2px);
}

.result-card h3 {
    color: #667eea;
    margin-bottom: 12px;
    font-size: 1.3em;
}

.result-field {
    display: flex;
    margin-bottom: 8px;
    font-size: 1.05em;
}

.result-field strong {
    min-width: 130px;
    color: #495057;
}

.result-field span {
    color: #212529;
}

.score-badge {
    position: absolute;
    top: 15px;
    left: 15px;
    background: linear-gradient(135deg, #28a745 0%, #20c997 100%);
    color: white;
    padding: 5px 12px;
    border-radius: 20px;
    font-size: 0.85em;
    font-weight: 600;
}

/* Bulk Results */
.bulk-group {
    margin-bottom: 30px;
    border: 2px solid #e9ecef;
    border-radius: 12px;
    overflow: hidden;
}

.bulk-group-header {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    padding: 15px 20px;
    font-weight: 600;
    font-size: 1.1em;
}

.bulk-group-content {
    padding: 15px;
}

.bulk-group-content .result-card {
    margin-bottom: 10px;
}

/* Statistics */
.stats {
    background: linear-gradient(135deg, #28a745 0%, #20c997 100%);
    color: white;
    padding: 20px;
    border-radius: 12px;
    margin-bottom: 20px;
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 15px;
    text-align: center;
}

.stat-item {
    padding: 10px;
}

.stat-value {
    font-size: 2em;
    font-weight: 700;
    display: block;
    margin-bottom: 5px;
}

.stat-label {
    font-size: 0.95em;
    opacity: 0.9;
}

.stats-bar {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    padding: 12px 30px;
    text-align: center;
    color: white;
    font-size: 1em;
    font-weight: 600;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
    position: sticky;
    top: 0;
    z-index: 100;
    /* Better text wrapping on mobile */
    word-wrap: break-word;
    overflow-wrap: break-word;
}

.stats-bar #total-stats {
    color: white;
    text-shadow: 0 1px 2px rgba(0, 0, 0, 0.2);
}

.stats-bar #total-stats strong {
    font-size: 1.15em;
    color: #ffd700;
    text-shadow: 0 1px 3px rgba(0, 0, 0, 0.3);
}

.stats-footer {
    background: #f8f9fa;
    padding: 20px;
    text-align: center;
    border-top: 2px solid #e9ecef;
    font-size: 1.1em;
    color: #495057;
    display: none; /* Hidden since we moved stats to top */
}

/* Loading State */
.loading {
    text-align: center;
    padding: 40px;
    font-size: 1.2em;
    color: #667eea;
}

.loading::after {
    content: '...';
    animation: dots 1.5s infinite;
}

@keyframes dots {
    0%, 20% { content: '.'; }
    40% { content: '..'; }
    60%, 100% { content: '...'; }
}

/* Error Message */
.error {
    background: #f8d7da;
    color: #721c24;
    padding: 20px;
    border-radius: 12px;
    border: 2px solid #f5c6cb;
    margin-bottom: 20px;
}

/* Empty State */
.empty-state {
    text-align: center;
    padding: 60px 20px;
    color: #6c757d;
    background: white;
    border-radius: 12px;
    margin-top: 20px;
    box-shadow: 0 2px 8px rgba(0,0,0,0.05);
}

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

.empty-state-text {
    font-size: 1.3em;
    font-weight: 500;
    margin-bottom: 10px;
}

.empty-state-hint {
    font-size: 1em;
    color: #adb5bd;
    margin-top: 10px;
}

/* ============================================
   RESPONSIVE TYPOGRAPHY
   ============================================ */

/* Base typography is already mobile-friendly at 16px */

/* Responsive headings and text */
@media (max-width: 768px) {
    /* Results header */
    .results-header h2 {
        font-size: 1.3em;
    }
    
    /* Empty state */
    .empty-state-text {
        font-size: 1.2em;
    }
    
    .empty-state-hint {
        font-size: 0.95em;
    }
    
    /* Stats bar */
    .stats-bar {
        font-size: 0.95em;
        padding: 10px 20px;
    }
    
    /* Filter labels */
    .filter-group label {
        font-size: 0.9em;
    }
    
    /* Search hint */
    .search-hint {
        font-size: 0.85em;
    }
}

@media (max-width: 480px) {
    /* Further reduce font sizes for very small screens */
    .results-header h2 {
        font-size: 1.2em;
    }
    
    .empty-state-icon {
        font-size: 3em;
    }
    
    .empty-state-text {
        font-size: 1.1em;
    }
    
    .stats-bar {
        font-size: 0.9em;
        padding: 8px 15px;
    }
    
    .filter-group label,
    .form-group label {
        font-size: 0.85em;
    }
}

/* ============================================
   RESPONSIVE DESIGN - MOBILE FIRST APPROACH
   ============================================ */

/* Tablet and below (768px) */
@media (max-width: 768px) {
    .container {
        border-radius: 15px;
    }
    
    /* Show mobile menu toggle */
    .mobile-menu-toggle {
        display: flex;
        align-items: center;
        justify-content: center;
    }
    
    /* Show overlay when menu is active */
    .mobile-menu-overlay.active {
        display: block;
    }
    
    /* Transform tabs into side menu */
    .tabs {
        position: fixed;
        top: 0;
        right: -300px; /* Hidden off-screen */
        width: 280px;
        height: 100vh;
        background: white;
        flex-direction: column;
        gap: 0;
        padding: 80px 20px 20px 20px;
        box-shadow: -4px 0 20px rgba(0, 0, 0, 0.2);
        z-index: 1000;
        transition: right 0.3s ease;
        overflow-y: auto;
        border-bottom: none;
    }
    
    /* Hide user info in mobile menu */
    .mobile-menu-user-section {
        display: none;
    }
    
    /* Tabs list wrapper - vertical on mobile */
    .tabs-list {
        flex-direction: column;
        gap: 0;
        flex: 1;
        width: 100%;
    }
    
    /* Show logout button in mobile menu */
    .mobile-logout-btn {
        display: flex;
        align-items: center;
        justify-content: center;
        gap: 10px;
        width: 100%;
        padding: 16px 20px;
        margin-top: 20px;
        background: linear-gradient(135deg, #dc3545 0%, #c82333 100%);
        color: white;
        border: none;
        border-radius: 12px;
        font-size: 1.05em;
        font-weight: 600;
        cursor: pointer;
        transition: all 0.3s;
        box-shadow: 0 4px 12px rgba(220, 53, 69, 0.3);
        min-height: 52px;
    }
    
    .mobile-logout-btn:hover {
        transform: translateY(-2px);
        box-shadow: 0 6px 16px rgba(220, 53, 69, 0.5);
    }
    
    .mobile-logout-btn:active {
        transform: translateY(0);
    }
    
    .logout-icon {
        font-size: 20px;
    }
    
    /* Hide desktop user info on mobile */
    header #user-info {
        display: none !important;
    }
    
    /* Show side menu when active */
    .tabs.mobile-menu-active {
        right: 0;
    }
    
    .tab-btn {
        flex: none;
        width: 100%;
        padding: 18px 20px;
        font-size: 1.05em;
        min-height: 56px;
        text-align: right;
        border-radius: 12px;
        margin-bottom: 8px;
        background: white;
        border: 2px solid #e9ecef;
        box-shadow: none;
    }
    
    .tab-btn:hover {
        background: #f8f9fa;
        border-color: #667eea;
    }
    
    .tab-btn.active {
        background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
        color: white;
        border-color: #667eea;
        box-shadow: 0 4px 12px rgba(102, 126, 234, 0.3);
    }
    
    .tab-btn.active::after {
        display: none;
    }
    
    /* Add close button to mobile menu */
    .tabs::before {
        content: '✕';
        position: absolute;
        top: 20px;
        left: 20px;
        font-size: 28px;
        color: #667eea;
        cursor: pointer;
        width: 44px;
        height: 44px;
        display: flex;
        align-items: center;
        justify-content: center;
        border-radius: 8px;
        background: #f8f9fa;
        transition: all 0.3s;
    }
    
    .tabs::before:hover {
        background: #e9ecef;
        transform: rotate(90deg);
    }
    
    .filters-section {
        padding: 20px;
    }
    
    .filters-grid {
        grid-template-columns: 1fr;
        gap: 12px;
    }
    
    .search-section {
        padding: 20px;
    }
    
    .search-actions {
        flex-direction: column;
    }
    
    .btn-search,
    .btn-secondary {
        width: 100%;
    }
    
    .button-group {
        flex-direction: column;
    }
    
    .stats {
        grid-template-columns: 1fr;
    }
    
    .results-header {
        flex-direction: column;
        align-items: flex-start;
    }
    
    .results-actions {
        width: 100%;
        flex-direction: column;
    }
    
    .btn-action {
        width: 100%;
        min-height: 44px;
    }
    
    /* Mobile-friendly tables */
    .table-container {
        overflow-x: auto;
        -webkit-overflow-scrolling: touch;
        /* Add scrollbar styling for better UX */
        scrollbar-width: thin;
        scrollbar-color: #667eea #f1f1f1;
    }
    
    .table-container::-webkit-scrollbar {
        height: 8px;
    }
    
    .table-container::-webkit-scrollbar-track {
        background: #f1f1f1;
        border-radius: 4px;
    }
    
    .table-container::-webkit-scrollbar-thumb {
        background: #667eea;
        border-radius: 4px;
    }
    
    .table-container::-webkit-scrollbar-thumb:hover {
        background: #764ba2;
    }
    
    .results-table {
        font-size: 0.85em;
        min-width: 600px; /* Ensure horizontal scroll on small screens */
    }
    
    .results-table th,
    .results-table td {
        padding: 10px 8px;
        white-space: nowrap;
    }
    
    /* Better spacing for tab content */
    .tab-content {
        padding: 25px 20px;
    }
}

/* Mobile phones (480px and below) */
@media (max-width: 480px) {
    .container {
        border-radius: 10px;
    }
    
    /* Mobile menu adjustments for small screens */
    .tabs {
        width: 260px;
        right: -280px;
        padding: 65px 15px 15px 15px;
    }
    
    
    .mobile-logout-btn {
        padding: 14px 16px;
        font-size: 1em;
        min-height: 50px;
        margin-top: 16px;
    }
    
    .tab-btn {
        padding: 16px 15px;
        font-size: 1em;
        min-height: 52px;
    }
    
    
    .tabs::before {
        width: 40px;
        height: 40px;
        font-size: 24px;
        top: 15px;
        left: 15px;
    }
    
    .tab-content {
        padding: 20px 15px;
    }
    
    .filters-section,
    .search-section {
        padding: 15px;
    }
    
    .results-table {
        font-size: 0.8em;
    }
    
    .results-table th,
    .results-table td {
        padding: 8px 6px;
        font-size: 0.85em;
    }
    
    /* Stack action buttons vertically */
    .results-actions button {
        margin-bottom: 8px;
    }
    
    /* Improve readability */
    h2 {
        font-size: 1.3em;
    }
    
    h3 {
        font-size: 1.1em;
    }
}

/* Very small phones (320px) */
@media (max-width: 320px) {
    /* Mobile menu for very small screens */
    .tabs {
        width: 240px;
        right: -260px;
        padding: 60px 12px 12px 12px;
    }
    
    
    .mobile-logout-btn {
        padding: 12px 14px;
        font-size: 0.95em;
        min-height: 48px;
        margin-top: 12px;
    }
    
    .logout-icon {
        font-size: 18px;
    }
    
    .tab-btn {
        font-size: 0.95em;
        padding: 14px 12px;
        min-height: 50px;
    }
    
    header {
        padding: 18px 50px 18px 12px; /* Adjust padding for very small screens */
    }
    
    .mobile-menu-toggle {
        top: 12px;
        right: 12px;
        padding: 7px 11px;
        min-width: 44px;
        min-height: 44px;
    }
    
    .hamburger-icon {
        font-size: 20px;
    }
    
    .tabs::before {
        width: 36px;
        height: 36px;
        font-size: 22px;
        top: 12px;
        left: 12px;
    }
    
    .results-table {
        font-size: 0.75em;
    }
    
    /* Further adjustments for very small screens */
    button {
        font-size: 0.9em;
        padding: 12px 15px;
    }
    
    h2 {
        font-size: 1.1em;
    }
    
    h3 {
        font-size: 1em;
    }
}

/* Tablet landscape and larger (1024px+) */
@media (min-width: 1024px) {
    .container {
        max-width: 1400px;
    }
    
    /* Better use of space on larger screens */
    .filters-grid {
        grid-template-columns: repeat(3, 1fr);
    }
    
    .form-grid {
        grid-template-columns: repeat(3, 1fr);
    }
    
    .results-table {
        font-size: 1em;
    }
}

/* Extra large desktops (1440px+) */
@media (min-width: 1440px) {
    .container {
        max-width: 1600px;
    }
    
    body {
        padding: 30px;
    }
}

/* Import Tab Styles */
.import-container {
    width: 100%;
}

.import-container h2 {
    color: #667eea;
    margin-bottom: 10px;
}

.import-description {
    color: #6c757d;
    margin-bottom: 20px;
    font-size: 1.05em;
}

/* Mobile import section */
@media (max-width: 768px) {
    .import-container h2 {
        font-size: 1.5em;
    }
    
    .import-description {
        font-size: 1em;
    }
}

@media (max-width: 480px) {
    .import-container h2 {
        font-size: 1.3em;
    }
    
    .import-description {
        font-size: 0.95em;
    }
}

.template-download {
    background: linear-gradient(135deg, #fff5e6 0%, #ffe6cc 100%);
    border: 2px solid #ffc966;
    border-radius: 12px;
    padding: 20px;
    text-align: center;
    margin-bottom: 25px;
}

.btn-template {
    padding: 15px 40px;
    background: linear-gradient(135deg, #ff9800 0%, #ff6f00 100%);
    color: white;
    border: none;
    border-radius: 10px;
    font-size: 1.15em;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s;
    box-shadow: 0 4px 15px rgba(255, 152, 0, 0.3);
}

.btn-template:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(255, 152, 0, 0.5);
}

.template-info {
    margin-top: 10px;
    color: #663d00;
    font-size: 0.95em;
}

.import-box {
    background: #f8f9fa;
    border: 2px solid #e9ecef;
    border-radius: 12px;
    padding: 30px;
    margin-bottom: 30px;
}

.file-upload-area {
    border: 3px dashed #667eea;
    border-radius: 12px;
    padding: 50px 20px;
    text-align: center;
    background: white;
    cursor: pointer;
    transition: all 0.3s;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 15px;
}

.file-upload-area:hover,
.file-upload-area.drag-over {
    background: #f0f4ff;
    border-color: #764ba2;
}

.upload-icon {
    font-size: 4em;
    margin-bottom: 10px;
}

.upload-text {
    font-size: 1.2em;
    color: #495057;
    margin-bottom: 10px;
}

.btn-select {
    padding: 12px 30px;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    border: none;
    border-radius: 8px;
    font-size: 1.1em;
    cursor: pointer;
    transition: all 0.3s;
}

.btn-select:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(102, 126, 234, 0.4);
}

.file-info {
    display: flex;
    justify-content: space-between;
    align-items: center;
    background: white;
    padding: 20px;
    border-radius: 12px;
    margin-bottom: 20px;
}

.file-details {
    display: flex;
    flex-direction: column;
    gap: 5px;
}

.file-name {
    font-weight: 600;
    color: #212529;
    font-size: 1.1em;
}

.file-size {
    color: #6c757d;
}

.btn-clear {
    background: #dc3545;
    color: white;
    border: none;
    border-radius: 50%;
    width: 36px;
    height: 36px;
    cursor: pointer;
    font-size: 1.3em;
    font-weight: 700;
    transition: all 0.3s;
    box-shadow: 0 2px 8px rgba(220, 53, 69, 0.3);
    display: flex;
    align-items: center;
    justify-content: center;
    line-height: 1;
    padding: 0;
    flex-shrink: 0;
}

.btn-clear:hover {
    background: #c82333;
    transform: scale(1.1) rotate(90deg);
    box-shadow: 0 4px 12px rgba(220, 53, 69, 0.5);
}

.btn-clear:active {
    transform: scale(0.95) rotate(90deg);
}

.import-options {
    margin: 20px 0;
    display: flex;
    flex-direction: column;
    gap: 20px;
}

.import-mode {
    background: #f8f9fa;
    padding: 15px;
    border-radius: 8px;
    border: 1px solid #dee2e6;
}

.mode-label {
    display: block;
    font-size: 1.1em;
    font-weight: 600;
    color: #495057;
    margin-bottom: 12px;
}

.radio-group {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.radio-label {
    display: flex;
    align-items: flex-start;
    gap: 10px;
    padding: 12px;
    background: white;
    border: 2px solid #e9ecef;
    border-radius: 8px;
    cursor: pointer;
    transition: all 0.3s;
}

.radio-label:hover {
    border-color: #667eea;
    background: #f8f9ff;
}

.radio-label input[type="radio"] {
    margin-top: 3px;
    cursor: pointer;
    width: 18px;
    height: 18px;
    flex-shrink: 0;
}

.radio-label input[type="radio"]:checked {
    accent-color: #667eea;
}

.radio-label span {
    display: flex;
    flex-direction: column;
    gap: 4px;
    flex: 1;
}

.radio-label strong {
    color: #495057;
    font-size: 1em;
}

.radio-label input[type="radio"]:checked ~ span strong {
    color: #667eea;
}

.radio-label small {
    color: #6c757d;
    font-size: 0.85em;
    font-weight: normal;
}

.checkbox-label {
    display: flex;
    align-items: center;
    gap: 10px;
    font-size: 1.05em;
    cursor: pointer;
    padding: 10px;
    background: #f8f9fa;
    border-radius: 8px;
}

.checkbox-label input[type="checkbox"] {
    width: 20px;
    height: 20px;
    cursor: pointer;
    /* Better touch target for mobile */
    min-width: 24px;
    min-height: 24px;
}

.import-actions {
    display: flex;
    gap: 15px;
    margin: 20px 0;
}

/* Mobile import actions */
@media (max-width: 768px) {
    .import-actions {
        flex-direction: column;
    }
    
    .btn-import,
    .btn-sync {
        width: 100%;
        min-height: 48px;
    }
}

.btn-import {
    flex: 2;
    padding: 15px 30px;
    background: linear-gradient(135deg, #28a745 0%, #20c997 100%);
    color: white;
    border: none;
    border-radius: 10px;
    font-size: 1.1em;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s;
}

.btn-import:hover:not(:disabled) {
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(40, 167, 69, 0.4);
}

.btn-import:disabled {
    background: #6c757d;
    cursor: not-allowed;
    opacity: 0.5;
}

.btn-sync {
    flex: 1;
    padding: 15px 20px;
    background: linear-gradient(135deg, #17a2b8 0%, #138496 100%);
    color: white;
    border: none;
    border-radius: 10px;
    font-size: 1em;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s;
}

.btn-sync:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(23, 162, 184, 0.4);
}

.import-progress {
    margin: 20px 0;
}

.progress-bar {
    width: 100%;
    height: 30px;
    background: #e9ecef;
    border-radius: 15px;
    overflow: hidden;
    margin-bottom: 10px;
}

.progress-fill {
    height: 100%;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    width: 100%;
    animation: progress 2s ease-in-out infinite;
}

@keyframes progress {
    0% { width: 0%; }
    50% { width: 100%; }
    100% { width: 0%; }
}

.progress-text {
    text-align: center;
    color: #667eea;
    font-weight: 600;
}

.import-result {
    margin: 20px 0;
}

.success-message {
    background: #d4edda;
    border: 2px solid #c3e6cb;
    color: #155724;
    padding: 20px;
    border-radius: 12px;
    font-size: 1.05em;
    line-height: 1.8;
}

.error-message {
    background: #f8d7da;
    border: 2px solid #f5c6cb;
    color: #721c24;
    padding: 20px;
    border-radius: 12px;
    font-size: 1.05em;
}

.import-info {
    background: white;
    border: 2px solid #e9ecef;
    border-radius: 12px;
    padding: 25px;
}

.import-info h3 {
    color: #667eea;
    margin-bottom: 15px;
}

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

.import-info ul li {
    padding: 8px 0;
    padding-right: 25px;
    position: relative;
}

.import-info ul li:before {
    content: "•";
    color: #667eea;
    font-weight: bold;
    position: absolute;
    right: 0;
}

.columns-table {
    width: 100%;
    border-collapse: collapse;
    margin: 15px 0;
    background: white;
    border-radius: 8px;
    overflow: hidden;
}

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

.columns-table th,
.columns-table td {
    padding: 12px 15px;
    text-align: right;
    border-bottom: 1px solid #e9ecef;
}

.columns-table th {
    font-weight: 600;
    font-size: 1em;
}

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

.columns-table code {
    background: #f8f9fa;
    padding: 3px 8px;
    border-radius: 4px;
    font-family: 'Courier New', monospace;
    color: #667eea;
    font-weight: 600;
}

/* Responsive columns table */
@media (max-width: 768px) {
    .columns-table {
        font-size: 0.9em;
    }
    
    .columns-table th,
    .columns-table td {
        padding: 10px 12px;
    }
}

@media (max-width: 480px) {
    .columns-table {
        font-size: 0.85em;
        display: block;
        overflow-x: auto;
    }
    
    .columns-table thead,
    .columns-table tbody,
    .columns-table tr,
    .columns-table th,
    .columns-table td {
        display: block;
    }
    
    .columns-table thead {
        display: none;
    }
    
    .columns-table tr {
        margin-bottom: 15px;
        border: 2px solid #e9ecef;
        border-radius: 8px;
        padding: 10px;
    }
    
    .columns-table td {
        text-align: right;
        padding: 8px 10px;
        position: relative;
        border: none;
    }
    
    .columns-table td:before {
        content: attr(data-label);
        font-weight: 600;
        color: #667eea;
        display: block;
        margin-bottom: 5px;
    }
}

/* RTL Support */
[dir="rtl"] .score-badge {
    left: auto;
    right: 15px;
}

/* ============================================
   REFERRALS STYLES
   ============================================ */

.referrals-container {
    width: 100%;
}

.referrals-container h2 {
    color: #667eea;
    margin-bottom: 10px;
    font-size: 2em;
}

.referrals-description {
    color: #6c757d;
    margin-bottom: 30px;
    font-size: 1.05em;
}

.referral-form {
    background: #f8f9fa;
    border: 2px solid #e9ecef;
    border-radius: 12px;
    padding: 30px;
    margin-bottom: 40px;
}

.form-section {
    background: white;
    border: 2px solid #e9ecef;
    border-radius: 12px;
    padding: 25px;
    margin-bottom: 20px;
}

.form-section h3 {
    color: #667eea;
    margin-bottom: 20px;
    font-size: 1.3em;
}

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

.form-group {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.form-group label {
    font-weight: 600;
    color: #495057;
    font-size: 1em;
    display: flex;
    align-items: center;
    gap: 5px;
    margin-bottom: 8px;
}

.form-group .required {
    color: #dc3545;
}

.form-group input,
.form-group select {
    padding: 12px 15px;
    border: 2px solid #dee2e6;
    border-radius: 8px;
    font-size: 1em;
    transition: all 0.3s;
    background: white;
    font-family: inherit;
    width: 100%;
    cursor: pointer;
    /* Minimum touch target */
    min-height: 44px;
}

/* Mobile form inputs */
@media (max-width: 768px) {
    .form-group input,
    .form-group select {
        font-size: 16px; /* Prevents zoom on iOS */
        padding: 12px;
    }
}

.form-group select {
    padding-right: 40px;
    appearance: none;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 12 12'%3E%3Cpath fill='%23495057' d='M6 9L1 4h10z'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 15px center;
    background-size: 12px;
}

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

.form-group input[readonly] {
    background: #e9ecef;
    cursor: not-allowed;
    color: #495057;
}

.form-group select:hover {
    border-color: #adb5bd;
}

/* Input validation error styling */
.input-error {
    border-color: #dc3545 !important;
    background-color: #fff5f5 !important;
}

.input-error:focus {
    border-color: #dc3545 !important;
    box-shadow: 0 0 0 3px rgba(220, 53, 69, 0.1) !important;
}

/* Input loading state styling */
.input-loading {
    border-color: #007bff !important;
    background-color: #f8f9ff !important;
    position: relative;
}

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

.input-loading::after {
    content: '';
    position: absolute;
    right: 10px;
    top: 50%;
    transform: translateY(-50%);
    width: 16px;
    height: 16px;
    border: 2px solid #007bff;
    border-top: 2px solid transparent;
    border-radius: 50%;
    animation: spin 1s linear infinite;
}

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

/* Input hint animations */
@keyframes hintSlideIn {
    from {
        opacity: 0;
        transform: translateY(-10px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

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

/* Toast notification animations */
@keyframes toastSlideIn {
    from {
        opacity: 0;
        transform: translateY(-20px) scale(0.95);
    }
    to {
        opacity: 1;
        transform: translateY(0) scale(1);
    }
}

@keyframes toastSlideOut {
    from {
        opacity: 1;
        transform: translateY(0) scale(1);
    }
    to {
        opacity: 0;
        transform: translateY(-20px) scale(0.95);
    }
}

/* Toast container responsive */
@media (max-width: 768px) {
    #toast-container {
        top: 10px !important;
        max-width: 95% !important;
    }
}

.input-hint {
    font-weight: 500;
    white-space: nowrap;
}

.input-hint-error {
    background: #dc3545 !important;
}

.input-hint-warning {
    background: #ffc107 !important;
    color: #000 !important;
}

/* Info tooltip styling */
.info-tip {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 16px;
    height: 16px;
    background: transparent;
    color: #9ca3af;
    border: 1.5px solid #d1d5db;
    border-radius: 50%;
    font-size: 10px;
    font-weight: bold;
    cursor: help;
    margin-right: 5px;
    position: relative;
    transition: all 0.2s;
    flex-shrink: 0;
}

.info-tip:hover {
    color: #6b7280;
    border-color: #9ca3af;
    background: rgba(156, 163, 175, 0.05);
    transform: scale(1.15);
}

.info-tip::after {
    content: attr(data-tooltip);
    position: absolute;
    bottom: calc(100% + 10px);
    right: 50%;
    transform: translateX(50%);
    background: #374151;
    color: #f9fafb;
    padding: 10px 14px;
    border-radius: 8px;
    font-size: 12px;
    font-weight: 400;
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.2s, transform 0.2s;
    box-shadow: 0 10px 15px -3px rgba(0, 0, 0, 0.1), 0 4px 6px -2px rgba(0, 0, 0, 0.05);
    z-index: 1000;
    min-width: 200px;
    max-width: 280px;
    width: max-content;
    text-align: right;
    line-height: 1.6;
    white-space: normal;
    word-wrap: break-word;
    border: 1px solid #4b5563;
}

.info-tip::before {
    content: '';
    position: absolute;
    bottom: calc(100% + 2px);
    right: 50%;
    transform: translateX(50%);
    border: 6px solid transparent;
    border-top-color: #374151;
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.2s;
    z-index: 1001;
}

.info-tip:hover::after,
.info-tip:hover::before {
    opacity: 1;
}

/* Mobile tooltip adjustments */
@media (max-width: 768px) {
    .info-tip::after {
        right: auto;
        left: 50%;
        transform: translateX(-50%);
        min-width: 180px;
        max-width: 240px;
        font-size: 11px;
    }
    
    .info-tip::before {
        right: auto;
        left: 50%;
        transform: translateX(-50%);
    }
}

/* Edit Modal Styles */
.modal {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.5);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 10000;
    backdrop-filter: blur(2px);
}

.modal-content {
    background: white;
    border-radius: 12px;
    max-width: 800px;
    width: 90%;
    max-height: 90vh;
    overflow: hidden;
    box-shadow: 0 20px 25px -5px rgba(0, 0, 0, 0.1), 0 10px 10px -5px rgba(0, 0, 0, 0.04);
    animation: modalSlideIn 0.3s ease;
}

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

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

.modal-header h3 {
    margin: 0;
    font-size: 1.25em;
    color: #1f2937;
}

.modal-close {
    background: transparent;
    border: none;
    font-size: 28px;
    color: #9ca3af;
    cursor: pointer;
    padding: 0;
    width: 32px;
    height: 32px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 6px;
    transition: all 0.2s;
}

.modal-close:hover {
    background: #e5e7eb;
    color: #1f2937;
}

.modal-body {
    padding: 24px;
    max-height: calc(90vh - 180px);
    overflow-y: auto;
}

.modal-actions {
    display: flex;
    gap: 12px;
    justify-content: flex-end;
    margin-top: 24px;
    padding-top: 20px;
    border-top: 1px solid #e5e7eb;
}

.btn-save {
    background: #10b981;
    color: white;
    border: none;
    padding: 10px 20px;
    border-radius: 8px;
    font-size: 1em;
    cursor: pointer;
    transition: all 0.2s;
    font-weight: 500;
}

.btn-save:hover {
    background: #059669;
    transform: translateY(-1px);
    box-shadow: 0 4px 6px rgba(16, 185, 129, 0.2);
}

.btn-cancel {
    background: #f3f4f6;
    color: #4b5563;
    border: 1px solid #d1d5db;
    padding: 10px 20px;
    border-radius: 8px;
    font-size: 1em;
    cursor: pointer;
    transition: all 0.2s;
    font-weight: 500;
}

.btn-cancel:hover {
    background: #e5e7eb;
    color: #1f2937;
}

.btn-edit {
    background: transparent !important;
    border: none !important;
    box-shadow: none !important;
    color: #667eea;
    padding: 8px;
    border-radius: 8px;
    cursor: pointer;
    transition: all 0.2s ease;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    margin-left: 5px;
    min-width: 38px;
    min-height: 38px;
}

.btn-edit svg {
    transition: all 0.2s ease;
}

.btn-edit:hover {
    color: #4c51bf;
    background: rgba(102, 126, 234, 0.1) !important;
    box-shadow: none !important;
}

.btn-edit:hover svg {
    stroke: #4c51bf;
}

.btn-edit:active {
    transform: scale(0.95);
    box-shadow: none !important;
}

.btn-delete {
    background: transparent !important;
    border: none !important;
    box-shadow: none !important;
    color: #ef4444;
    padding: 8px;
    border-radius: 8px;
    cursor: pointer;
    transition: all 0.2s ease;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    margin-left: 5px;
    min-width: 38px;
    min-height: 38px;
}

.btn-delete svg {
    transition: all 0.2s ease;
}

.btn-delete:hover {
    color: #dc2626;
    background: rgba(239, 68, 68, 0.1) !important;
    box-shadow: none !important;
}

.btn-delete:hover svg {
    stroke: #dc2626;
}

.btn-delete:active {
    transform: scale(0.95);
    box-shadow: none !important;
}

.action-cell {
    text-align: center;
    white-space: nowrap;
    padding: 12px 8px;
}

/* Confirmation Modal Styles */
.confirm-modal-overlay {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.6);
    backdrop-filter: blur(4px);
    z-index: 10000;
    animation: fadeIn 0.2s ease;
}

.confirm-modal-overlay.active {
    display: flex;
    justify-content: center;
    align-items: center;
}

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

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

.confirm-modal {
    background: white;
    border-radius: 16px;
    padding: 0;
    max-width: 450px;
    width: 90%;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.3);
    animation: slideUp 0.3s ease;
    overflow: hidden;
}

.confirm-modal-header {
    background: linear-gradient(135deg, #f093fb 0%, #f5576c 100%);
    padding: 24px;
    text-align: center;
}

.confirm-modal-icon {
    font-size: 48px;
    margin-bottom: 12px;
    animation: pulse 1s infinite;
}

@keyframes pulse {
    0%, 100% {
        transform: scale(1);
    }
    50% {
        transform: scale(1.1);
    }
}

.confirm-modal-title {
    color: white;
    font-size: 24px;
    font-weight: bold;
    margin: 0;
}

.confirm-modal-body {
    padding: 24px;
    text-align: center;
}

.confirm-modal-message {
    font-size: 16px;
    color: #374151;
    line-height: 1.6;
    margin: 0 0 8px 0;
}

.confirm-modal-submessage {
    font-size: 14px;
    color: #6b7280;
    margin: 0;
}

.confirm-modal-footer {
    padding: 0 24px 24px 24px;
    display: flex;
    gap: 12px;
    justify-content: center;
}

.confirm-modal-btn {
    flex: 1;
    padding: 12px 24px;
    border: none;
    border-radius: 8px;
    font-size: 16px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s ease;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
}

.confirm-modal-btn-cancel {
    background: #f3f4f6;
    color: #374151;
}

.confirm-modal-btn-cancel:hover {
    background: #e5e7eb;
    transform: translateY(-1px);
}

.confirm-modal-btn-delete {
    background: linear-gradient(135deg, #f093fb 0%, #f5576c 100%);
    color: white;
}

.confirm-modal-btn-delete:hover {
    background: linear-gradient(135deg, #f5576c 0%, #f093fb 100%);
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(245, 87, 108, 0.3);
}

.confirm-modal-btn:active {
    transform: translateY(0);
}

/* Responsive styles for action buttons */
@media (max-width: 768px) {
    .btn-edit, .btn-delete {
        padding: 6px;
        min-width: 34px;
        min-height: 34px;
    }
    
    .btn-edit svg, .btn-delete svg {
        width: 18px;
        height: 18px;
    }
    
    .action-cell {
        padding: 8px 4px;
    }
    
    .confirm-modal {
        max-width: 90%;
        margin: 16px;
    }
    
    .confirm-modal-header {
        padding: 20px;
    }
    
    .confirm-modal-icon {
        font-size: 36px;
    }
    
    .confirm-modal-title {
        font-size: 20px;
    }
    
    .confirm-modal-footer {
        flex-direction: column-reverse;
    }
    
    .confirm-modal-btn {
        width: 100%;
    }
}

/* Mobile adjustments */
@media (max-width: 768px) {
    .modal-content {
        width: 95%;
        max-height: 95vh;
    }
    
    .modal-header {
        padding: 16px;
    }
    
    .modal-body {
        padding: 16px;
        max-height: calc(95vh - 160px);
    }
    
    .modal-actions {
        flex-direction: column-reverse;
    }
    
    .btn-save,
    .btn-cancel {
        width: 100%;
    }
}

.form-actions {
    display: flex;
    gap: 15px;
    justify-content: flex-start;
}

.btn-validate {
    padding: 12px 30px;
    background: linear-gradient(135deg, #17a2b8 0%, #138496 100%);
    color: white;
    border: none;
    border-radius: 8px;
    font-size: 1em;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s;
    box-shadow: 0 4px 15px rgba(23, 162, 184, 0.3);
}

.btn-validate:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(23, 162, 184, 0.5);
}

.btn-submit {
    padding: 15px 40px;
    background: linear-gradient(135deg, #28a745 0%, #20c997 100%);
    color: white;
    border: none;
    border-radius: 10px;
    font-size: 1.1em;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s;
    box-shadow: 0 4px 15px rgba(40, 167, 69, 0.3);
}

.btn-submit:hover:not(:disabled) {
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(40, 167, 69, 0.5);
}

.btn-submit:disabled {
    background: #6c757d;
    cursor: not-allowed;
    opacity: 0.5;
}

.validation-result {
    margin: 20px 0;
}

.validation-result .success {
    background: #d4edda;
    border: 2px solid #c3e6cb;
    color: #155724;
    padding: 20px;
    border-radius: 12px;
    font-size: 1.05em;
    line-height: 1.8;
    font-weight: 500;
}

.validation-result .error {
    background: #f8d7da;
    border: 2px solid #f5c6cb;
    color: #721c24;
    padding: 20px;
    border-radius: 12px;
    font-size: 1.05em;
    line-height: 1.8;
    font-weight: 500;
}

.referral-result {
    margin: 20px 0;
}

.referral-result .success {
    background: #d4edda;
    border: 2px solid #c3e6cb;
    color: #155724;
    padding: 20px;
    border-radius: 12px;
    font-size: 1.05em;
    line-height: 1.8;
}

.referral-result .error {
    background: #f8d7da;
    border: 2px solid #f5c6cb;
    color: #721c24;
    padding: 20px;
    border-radius: 12px;
    font-size: 1.05em;
}

.referrals-list {
    margin-top: 40px;
}

.referrals-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 20px;
    flex-wrap: wrap;
    gap: 15px;
}

.referrals-header h3 {
    color: #667eea;
    font-size: 1.5em;
    margin: 0;
}

.referrals-header-actions {
    display: flex;
    gap: 10px;
    flex-wrap: wrap;
}

.btn-export-attended {
    padding: 10px 20px;
    background: linear-gradient(135deg, #28a745 0%, #20c997 100%);
    color: white;
    border: none;
    border-radius: 8px;
    font-size: 0.95em;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s;
    box-shadow: 0 2px 8px rgba(40, 167, 69, 0.3);
}

.btn-export-attended:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(40, 167, 69, 0.5);
}

.btn-export-not-attended {
    padding: 10px 20px;
    background: linear-gradient(135deg, #dc3545 0%, #c82333 100%);
    color: white;
    border: none;
    border-radius: 8px;
    font-size: 0.95em;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s;
    box-shadow: 0 2px 8px rgba(220, 53, 69, 0.3);
}

.btn-export-not-attended:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(220, 53, 69, 0.5);
}

.btn-export-all {
    padding: 10px 20px;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    border: none;
    border-radius: 8px;
    font-size: 0.95em;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s;
    box-shadow: 0 2px 8px rgba(102, 126, 234, 0.3);
}

.btn-export-all:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(102, 126, 234, 0.5);
}

.btn-refresh {
    padding: 10px 20px;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    border: none;
    border-radius: 8px;
    font-size: 0.95em;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s;
    box-shadow: 0 2px 8px rgba(102, 126, 234, 0.3);
}

.btn-refresh:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(102, 126, 234, 0.5);
}

.referrals-stats {
    background: linear-gradient(135deg, #e7f3ff 0%, #d5e7ff 100%);
    padding: 15px 20px;
    border-radius: 8px;
    margin-bottom: 15px;
    text-align: center;
}

.referrals-stats p {
    margin: 0;
    color: #495057;
    font-size: 1.1em;
}

.referrals-stats strong {
    color: #667eea;
    font-size: 1.3em;
}

/* Pagination Controls */
.pagination-controls {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 8px;
    margin: 20px 0;
    flex-wrap: wrap;
}

.pagination-btn {
    padding: 8px 15px;
    border: 2px solid #667eea;
    background: white;
    color: #667eea;
    border-radius: 6px;
    cursor: pointer;
    font-size: 0.95em;
    font-weight: 500;
    transition: all 0.3s ease;
    min-width: 40px;
}

.pagination-btn:hover:not(:disabled) {
    background: #667eea;
    color: white;
    transform: translateY(-2px);
    box-shadow: 0 4px 8px rgba(102, 126, 234, 0.3);
}

.pagination-btn.active {
    background: #667eea;
    color: white;
    font-weight: 600;
    cursor: default;
}

.pagination-btn:disabled {
    opacity: 0.4;
    cursor: not-allowed;
    border-color: #ccc;
    color: #999;
}

/* Responsive pagination */
@media (max-width: 768px) {
    .pagination-controls {
        gap: 5px;
    }
    
    .pagination-btn {
        padding: 6px 10px;
        font-size: 0.85em;
        min-width: 35px;
    }
}

/* ============================================
   UNIFIED SEARCH & FILTER SECTION
   ============================================ */

.unified-search-filter-section {
    background: linear-gradient(135deg, #ffffff 0%, #f8f9fa 100%);
    border-radius: 16px;
    padding: 30px;
    margin-bottom: 25px;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.08);
    border: 1px solid #e0e6ed;
}

/* Section Header */
.section-header {
    text-align: center;
    margin-bottom: 30px;
    padding-bottom: 20px;
    border-bottom: 2px solid #e0e6ed;
}

.section-header h3 {
    color: #2c3e50;
    font-size: 1.6em;
    font-weight: 700;
    margin: 0 0 10px 0;
}

.section-description {
    color: #7f8c8d;
    font-size: 0.95em;
    margin: 0;
}

/* Main Container */
.search-filter-container {
    background: white;
    border-radius: 12px;
    padding: 25px;
    margin-bottom: 20px;
    border: 1px solid #e8ecf0;
}

/* Subsections */
.subsection {
    padding: 15px;
    margin-bottom: 20px;
}

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

.subsection h4 {
    color: #34495e;
    font-size: 1.2em;
    font-weight: 600;
    margin: 0 0 20px 0;
    padding-bottom: 10px;
    border-bottom: 2px solid #667eea;
    display: inline-block;
}

/* Fields Grid */
.fields-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 20px;
}

/* Field Group */
.field-group {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.field-group label {
    font-weight: 600;
    color: #2c3e50;
    font-size: 0.95em;
    display: flex;
    align-items: center;
    gap: 8px;
}

.label-icon {
    font-size: 1.1em;
}

/* Input Fields */
.field-group input,
.field-group select {
    padding: 12px 16px;
    border: 2px solid #e0e6ed;
    border-radius: 8px;
    font-size: 1em;
    font-family: inherit;
    transition: all 0.3s ease;
    background: white;
}

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

.field-group input::placeholder {
    color: #bdc3c7;
    font-style: italic;
}

.field-group select {
    cursor: pointer;
    appearance: none;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 12 12'%3E%3Cpath fill='%23667eea' d='M6 9L1 4h10z'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: left 12px center;
    padding-left: 40px;
}

/* Section Divider */
.section-divider {
    height: 1px;
    background: linear-gradient(90deg, 
        transparent 0%, 
        #e0e6ed 20%, 
        #e0e6ed 80%, 
        transparent 100%
    );
    margin: 30px 0;
    position: relative;
}

.section-divider::after {
    content: "•••";
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    background: white;
    padding: 0 15px;
    color: #bdc3c7;
    font-size: 1.2em;
    letter-spacing: 5px;
}

/* Action Buttons */
.action-buttons {
    display: flex;
    gap: 15px;
    justify-content: center;
    flex-wrap: wrap;
    margin-bottom: 10px;
}

.btn-primary,
.btn-secondary {
    padding: 14px 32px;
    border: none;
    border-radius: 10px;
    font-size: 1.05em;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
    gap: 10px;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
}

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

.btn-primary:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(102, 126, 234, 0.4);
}

.btn-secondary {
    background: linear-gradient(135deg, #f5f7fa 0%, #e8ecf0 100%);
    color: #2c3e50;
    border: 2px solid #e0e6ed;
}

.btn-secondary:hover {
    background: linear-gradient(135deg, #e8ecf0 0%, #dce1e7 100%);
    transform: translateY(-2px);
}

.btn-icon {
    font-size: 1.2em;
}

/* Responsive Design */
@media (max-width: 768px) {
    .unified-search-filter-section {
        padding: 20px;
    }
    
    .search-filter-container {
        padding: 20px;
    }
    
    .fields-grid {
        grid-template-columns: 1fr;
        gap: 15px;
    }
    
    .action-buttons {
        flex-direction: column;
    }
    
    .btn-primary,
    .btn-secondary {
        width: 100%;
        justify-content: center;
    }
    
    .section-header h3 {
        font-size: 1.3em;
    }
}

/* Loading State */
.field-group input:disabled,
.field-group select:disabled {
    background: #f8f9fa;
    cursor: not-allowed;
    opacity: 0.6;
}

/* Focus Within Effect */
.field-group:focus-within label {
    color: #667eea;
}

/* Match Selection Cards */
.matches-selection {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
    gap: 15px;
    margin-top: 20px;
}

.match-card {
    background: white;
    border: 3px solid #dee2e6;
    border-radius: 12px;
    padding: 20px;
    cursor: pointer;
    transition: all 0.3s;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
}

.match-card:hover {
    border-color: #667eea;
    box-shadow: 0 4px 15px rgba(102, 126, 234, 0.3);
    transform: translateY(-3px);
    background: linear-gradient(135deg, #f8f9ff 0%, #ffffff 100%);
}

.match-card:active {
    transform: translateY(0);
}

.match-card-header {
    color: #667eea;
    font-size: 1.15em;
    margin-bottom: 15px;
    padding-bottom: 10px;
    border-bottom: 2px solid #e9ecef;
}

.match-card-body {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.match-info {
    font-size: 0.95em;
    color: #495057;
    line-height: 1.6;
}

.match-info strong {
    color: #212529;
    font-weight: 600;
}

/* Attendance Toggle Styles */
.attendance-cell {
    text-align: center !important;
}

.attendance-toggle {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    cursor: pointer;
    user-select: none;
}

.attendance-checkbox {
    width: 20px;
    height: 20px;
    cursor: pointer;
    accent-color: #28a745;
    /* Better touch target for mobile */
    min-width: 24px;
    min-height: 24px;
}

.attendance-checkbox.disabled-checkbox,
.attendance-checkbox:disabled {
    cursor: not-allowed;
    opacity: 0.5;
    filter: grayscale(50%);
}

.attendance-toggle:has(.attendance-checkbox:disabled) {
    opacity: 0.7;
}

.attendance-toggle:has(.attendance-checkbox:disabled) .attendance-label {
    color: #999;
}

.attendance-label {
    font-weight: 600;
    font-size: 0.95em;
}

.attendance-toggle input:checked + .attendance-label {
    color: #28a745;
}

.attendance-toggle input:not(:checked) + .attendance-label {
    color: #dc3545;
}

/* Attended Row Styling */
.results-table tbody tr.attended-row {
    background: #d4edda !important;
    border-left: 4px solid #28a745;
}

.results-table tbody tr.attended-row:hover {
    background: #c3e6cb !important;
}

/* ============================================
   DASHBOARD STYLES
   ============================================ */

.dashboard-container {
    width: 100%;
}

.dashboard-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    margin-bottom: 30px;
    flex-wrap: wrap;
    gap: 20px;
}

.dashboard-header h2 {
    color: #667eea;
    margin-bottom: 10px;
    font-size: 2em;
}

.dashboard-description {
    color: #6c757d;
    font-size: 1.05em;
    margin: 0;
}

.dashboard-export-actions {
    display: flex;
    gap: 10px;
    flex-wrap: wrap;
}

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

.summary-card {
    background: white;
    border: 2px solid #e9ecef;
    border-radius: 12px;
    padding: 25px;
    display: flex;
    align-items: center;
    gap: 20px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
    transition: all 0.3s;
}

.summary-card:hover {
    transform: translateY(-3px);
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.15);
}

.summary-card.success {
    border-color: #28a745;
    background: linear-gradient(135deg, #d4edda 0%, #ffffff 100%);
}

.summary-card.danger {
    border-color: #dc3545;
    background: linear-gradient(135deg, #f8d7da 0%, #ffffff 100%);
}

.summary-card.info {
    border-color: #17a2b8;
    background: linear-gradient(135deg, #d1ecf1 0%, #ffffff 100%);
}

.summary-icon {
    font-size: 3em;
    opacity: 0.8;
}

.summary-content {
    flex: 1;
}

.summary-label {
    font-size: 0.9em;
    color: #6c757d;
    margin-bottom: 8px;
    font-weight: 500;
}

.summary-value {
    font-size: 2.2em;
    font-weight: 700;
    color: #212529;
}

.summary-card.success .summary-value {
    color: #28a745;
}

.summary-card.danger .summary-value {
    color: #dc3545;
}

.summary-card.info .summary-value {
    color: #17a2b8;
}

.dashboard-districts {
    margin-bottom: 40px;
}

.dashboard-districts h3 {
    color: #667eea;
    margin-bottom: 20px;
    font-size: 1.4em;
}

.district-cards-row {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
    gap: 15px;
}

.district-card {
    background: white;
    border: 2px solid #e9ecef;
    border-radius: 12px;
    padding: 20px;
    text-align: center;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
    transition: all 0.3s;
}

.district-card:hover {
    transform: translateY(-3px);
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.15);
    border-color: #667eea;
}

.district-name {
    font-size: 1em;
    color: #495057;
    margin-bottom: 12px;
    font-weight: 600;
    min-height: 40px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.district-count {
    font-size: 2.5em;
    font-weight: 700;
    color: #667eea;
    margin-bottom: 10px;
}

.district-ratio {
    margin-bottom: 10px;
    padding: 8px;
    background: #f8f9fa;
    border-radius: 8px;
    font-size: 0.85em;
}

.ratio-label {
    display: block;
    color: #6c757d;
    margin-bottom: 4px;
    font-size: 0.9em;
}

.ratio-value {
    font-weight: 700;
    color: #495057;
    font-size: 1.1em;
}

.ratio-percentage {
    color: #667eea;
    font-weight: 600;
    margin-right: 5px;
}

.district-attendance {
    display: flex;
    justify-content: center;
    gap: 15px;
    font-size: 0.9em;
    margin-top: 10px;
}

.attended-mini {
    color: #28a745;
    font-weight: 600;
}

.not-attended-mini {
    color: #dc3545;
    font-weight: 600;
}

.dashboard-tables {
    display: flex;
    flex-direction: column;
    gap: 30px;
}

.dashboard-table-section {
    background: white;
    border: 2px solid #e9ecef;
    border-radius: 12px;
    padding: 25px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
}

.dashboard-table-section-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 15px;
    flex-wrap: wrap;
    gap: 10px;
}

.dashboard-table-section h3 {
    color: #667eea;
    margin: 0;
    font-size: 1.4em;
}

.dashboard-sort-hint {
    font-size: 0.85em;
    color: #6c757d;
    font-style: italic;
    display: flex;
    align-items: center;
    gap: 5px;
}

.dashboard-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 1em;
}

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

.dashboard-table th {
    padding: 15px 12px;
    text-align: right;
    font-weight: 600;
    font-size: 1.05em;
    border-bottom: 2px solid #e9ecef;
}

.dashboard-table th.sortable {
    cursor: pointer;
    user-select: none;
    position: relative;
    transition: all 0.2s;
    padding-right: 25px;
}

.dashboard-table th.sortable::after {
    content: ' ↕';
    position: absolute;
    right: 8px;
    opacity: 0.6;
    font-size: 0.85em;
    transition: opacity 0.2s;
}

.dashboard-table th.sortable:hover {
    background-color: rgba(255, 255, 255, 0.25);
}

.dashboard-table th.sortable:hover::after {
    opacity: 1;
}

.dashboard-table th.sortable .sort-indicator {
    display: inline-block;
    margin-right: 5px;
    opacity: 0;
    transition: opacity 0.2s;
    font-size: 0.9em;
    color: rgba(255, 255, 255, 0.9);
    font-weight: bold;
}

.dashboard-table th.sortable:hover .sort-indicator {
    opacity: 0.7;
}

.dashboard-table th.sortable[data-current-sort] .sort-indicator {
    opacity: 1;
}

.dashboard-table th.sortable[data-current-sort]::after {
    opacity: 0;
}

.dashboard-table td {
    padding: 12px;
    text-align: right;
    border-bottom: 1px solid #e9ecef;
}

.dashboard-table tbody tr {
    transition: all 0.2s;
}

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

.dashboard-table .success-text {
    color: #28a745;
    font-weight: 600;
}

.dashboard-table .danger-text {
    color: #dc3545;
    font-weight: 600;
}

/* ============================================
   RESPONSIVE - REFERRALS & DASHBOARD
   ============================================ */

@media (max-width: 768px) {
    /* Referrals form */
    .form-grid {
        grid-template-columns: 1fr;
    }
    
    .form-actions {
        flex-direction: column;
    }
    
    .form-actions button {
        width: 100%;
        min-height: 48px;
    }
    
    .referrals-header {
        flex-direction: column;
        align-items: flex-start;
        gap: 15px;
    }
    
    .referrals-header h3 {
        font-size: 1.3em;
    }
    
    .referrals-header-actions {
        width: 100%;
        flex-direction: column;
    }
    
    .referrals-header-actions button {
        width: 100%;
        min-height: 48px;
    }
    
    .matches-selection {
        grid-template-columns: 1fr;
    }
    
    .match-card {
        padding: 15px;
    }
    
    /* Dashboard */
    .dashboard-summary {
        grid-template-columns: 1fr;
    }
    
    .dashboard-table {
        font-size: 0.85em;
        min-width: 600px; /* Horizontal scroll */
    }
    
    .dashboard-table th,
    .dashboard-table td {
        padding: 10px 8px;
        white-space: nowrap;
    }
    
    .district-cards-row {
        grid-template-columns: repeat(auto-fill, minmax(150px, 1fr));
        gap: 12px;
    }
    
    .district-count {
        font-size: 2em;
    }
    
    .district-name {
        font-size: 0.9em;
        min-height: 35px;
    }
    
    .dashboard-header {
        flex-direction: column;
        align-items: flex-start;
    }
    
    .dashboard-header h2 {
        font-size: 1.5em;
    }
    
    .dashboard-export-actions {
        width: 100%;
        flex-direction: column;
    }
    
    .dashboard-export-actions button {
        width: 100%;
        min-height: 48px;
    }
    
    .referrals-container h2 {
        font-size: 1.5em;
    }
}

@media (max-width: 480px) {
    .referrals-header h3 {
        font-size: 1.2em;
    }
    
    .dashboard-header h2,
    .referrals-container h2 {
        font-size: 1.3em;
    }
    
    .district-cards-row {
        grid-template-columns: 1fr;
    }
    
    .dashboard-table {
        font-size: 0.8em;
    }
    
    .dashboard-table th,
    .dashboard-table td {
        padding: 8px 6px;
        font-size: 0.85em;
    }
    
    .summary-value {
        font-size: 1.8em;
    }
    
    .summary-icon {
        font-size: 2.5em;
    }
}

/* Pagination Controls */
.pagination-controls {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 8px;
    margin-top: 30px;
    padding: 20px;
    background: linear-gradient(135deg, #f8f9fa 0%, #e9ecef 100%);
    border-radius: 12px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.05);
    flex-wrap: wrap;
    direction: rtl; /* RTL for Arabic */
}

.pagination-btn {
    min-width: 44px;
    height: 44px;
    padding: 10px 16px;
    font-size: 0.95em;
    font-weight: 600;
    color: #495057;
    background: white;
    border: 2px solid #dee2e6;
    border-radius: 8px;
    cursor: pointer;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.05);
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
}

.pagination-btn:hover:not(:disabled) {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    border-color: #667eea;
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(102, 126, 234, 0.4);
}

.pagination-btn:active:not(:disabled) {
    transform: translateY(0);
    box-shadow: 0 2px 4px rgba(102, 126, 234, 0.3);
}

.pagination-btn:disabled {
    opacity: 0.5;
    cursor: not-allowed;
    background: #f8f9fa;
    color: #adb5bd;
}

.pagination-btn.active {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    border-color: #667eea;
    box-shadow: 0 4px 12px rgba(102, 126, 234, 0.4);
    font-weight: 700;
}

.pagination-btn.active:hover {
    background: linear-gradient(135deg, #764ba2 0%, #667eea 100%);
    transform: translateY(-2px);
    box-shadow: 0 6px 16px rgba(102, 126, 234, 0.5);
}

.pagination-numbers {
    display: flex;
    gap: 6px;
    align-items: center;
    flex-wrap: wrap;
    direction: rtl;
}

.pagination-prev,
.pagination-next {
    min-width: auto;
    padding: 10px 20px;
    font-weight: 600;
    display: flex;
    align-items: center;
    gap: 6px;
}

.pagination-prev {
    margin-left: 12px;
}

.pagination-next {
    margin-right: 12px;
}

.pagination-ellipsis {
    padding: 0 8px;
    color: #6c757d;
    font-weight: 600;
    display: flex;
    align-items: center;
}

/* Responsive pagination */
@media (max-width: 768px) {
    .pagination-controls {
        padding: 15px;
        gap: 6px;
    }
    
    .pagination-btn {
        min-width: 40px;
        height: 40px;
        padding: 8px 12px;
        font-size: 0.9em;
    }
    
    .pagination-numbers {
        gap: 4px;
    }
    
    .pagination-prev,
    .pagination-next {
        padding: 8px 16px;
        font-size: 0.85em;
    }
    
    .pagination-prev {
        margin-left: 8px;
    }
    
    .pagination-next {
        margin-right: 8px;
    }
}

@media (max-width: 480px) {
    .pagination-controls {
        flex-direction: column;
        gap: 12px;
    }
    
    .pagination-numbers {
        justify-content: center;
        width: 100%;
    }
    
    .pagination-prev,
    .pagination-next {
        width: 100%;
        justify-content: center;
        margin: 0;
    }
}

/* ============================================ */
/* AUTOCOMPLETE DROPDOWN STYLES */
/* ============================================ */

.autocomplete-dropdown {
    position: absolute;
    top: 100%;
    left: 0;
    right: 0;
    background: white;
    border: 1px solid #ddd;
    border-top: none;
    border-radius: 0 0 8px 8px;
    max-height: 300px;
    overflow-y: auto;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
    z-index: 1000;
    margin-top: -1px;
}

.autocomplete-item {
    padding: 12px 16px;
    cursor: pointer;
    border-bottom: 1px solid #f0f0f0;
    transition: background-color 0.2s ease;
}

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

.autocomplete-item:hover,
.autocomplete-item.focused {
    background-color: #f8f9fa;
}

.autocomplete-school {
    font-weight: 600;
    color: #333;
    margin-bottom: 4px;
    font-size: 15px;
}

.autocomplete-address {
    font-size: 13px;
    color: #666;
    font-style: italic;
}

/* Scrollbar styling for autocomplete dropdown */
.autocomplete-dropdown::-webkit-scrollbar {
    width: 8px;
}

.autocomplete-dropdown::-webkit-scrollbar-track {
    background: #f1f1f1;
    border-radius: 0 0 8px 0;
}

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

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

/* Mobile responsive */
@media (max-width: 768px) {
    .autocomplete-dropdown {
        max-height: 200px;
    }

    .autocomplete-item {
        padding: 10px 12px;
    }

    .autocomplete-school {
        font-size: 14px;
    }

    .autocomplete-address {
        font-size: 12px;
    }
}

/* Ensure parent has relative positioning */
.form-group {
    position: relative;
}

/* ============================================
   SETTINGS PAGE STYLES
   ============================================ */

.settings-container {
    width: 100%;
    padding: 30px;
}

.settings-container h2 {
    font-size: 2em;
    color: #2c3e50;
    margin-bottom: 10px;
}

.settings-description {
    color: #6c757d;
    margin-bottom: 30px;
    font-size: 1.1em;
}

.settings-section {
    background: white;
    border-radius: 12px;
    padding: 30px;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.08);
    margin-bottom: 25px;
}

.settings-section h3 {
    font-size: 1.5em;
    color: #2c3e50;
    margin-bottom: 25px;
    padding-bottom: 15px;
    border-bottom: 2px solid #e9ecef;
}

.settings-form {
    display: flex;
    flex-direction: column;
    gap: 25px;
}

.setting-item {
    background: #f8f9fa;
    border-radius: 10px;
    padding: 20px;
    border: 1px solid #e9ecef;
    transition: all 0.3s ease;
}

.setting-item:hover {
    border-color: #4CAF50;
    box-shadow: 0 2px 8px rgba(76, 175, 80, 0.15);
}

.setting-header {
    margin-bottom: 8px;
}

.setting-label {
    display: flex;
    align-items: center;
    gap: 12px;
    cursor: pointer;
    user-select: none;
}

.setting-title {
    font-size: 1.1em;
    font-weight: 600;
    color: #2c3e50;
}

.setting-checkbox {
    width: 20px;
    height: 20px;
    cursor: pointer;
    accent-color: #4CAF50;
}

.setting-description {
    color: #6c757d;
    font-size: 0.95em;
    margin: 8px 0 0 0;
    padding-right: 32px;
}

.setting-options {
    display: flex;
    flex-direction: column;
    gap: 15px;
    margin-top: 15px;
}

.radio-option {
    display: flex;
    align-items: flex-start;
    gap: 12px;
    padding: 15px;
    background: white;
    border: 2px solid #e9ecef;
    border-radius: 8px;
    cursor: pointer;
    transition: all 0.3s ease;
}

.radio-option:hover {
    border-color: #4CAF50;
    background: #f0f9f0;
}

.radio-option input[type="radio"] {
    width: 18px;
    height: 18px;
    margin-top: 3px;
    cursor: pointer;
    accent-color: #4CAF50;
}

.radio-option input[type="radio"]:checked + .radio-label {
    color: #2c3e50;
}

.radio-label {
    display: flex;
    flex-direction: column;
    gap: 5px;
    flex: 1;
}

.radio-label strong {
    font-size: 1.05em;
    color: #2c3e50;
}

.radio-label small {
    color: #6c757d;
    font-size: 0.9em;
}

.settings-actions {
    display: flex;
    gap: 15px;
    margin-top: 10px;
    padding-top: 20px;
    border-top: 1px solid #e9ecef;
}

.btn-save-settings,
.btn-refresh-settings {
    padding: 12px 30px;
    font-size: 1.1em;
    border: none;
    border-radius: 8px;
    cursor: pointer;
    font-weight: 600;
    transition: all 0.3s ease;
}

.btn-save-settings {
    background: linear-gradient(135deg, #4CAF50 0%, #45a049 100%);
    color: white;
    flex: 1;
}

.btn-save-settings:hover {
    background: linear-gradient(135deg, #45a049 0%, #3d8b40 100%);
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(76, 175, 80, 0.3);
}

.btn-refresh-settings {
    background: #f8f9fa;
    color: #495057;
    border: 2px solid #dee2e6;
    padding: 10px 25px;
}

.btn-refresh-settings:hover {
    background: #e9ecef;
    border-color: #adb5bd;
}

.settings-status {
    margin-top: 20px;
    padding: 15px 20px;
    border-radius: 8px;
    font-size: 1em;
    font-weight: 500;
    text-align: center;
}

.settings-status.success {
    background: #d4edda;
    color: #155724;
    border: 1px solid #c3e6cb;
}

.settings-status.error {
    background: #f8d7da;
    color: #721c24;
    border: 1px solid #f5c6cb;
}

/* Mobile responsive */
@media (max-width: 768px) {
    .settings-container {
        padding: 20px 15px;
    }

    .settings-section {
        padding: 20px;
    }

    .settings-container h2 {
        font-size: 1.6em;
    }

    .setting-item {
        padding: 15px;
    }

    .settings-actions {
        flex-direction: column;
    }

    .btn-save-settings,
    .btn-refresh-settings {
        width: 100%;
    }

    .radio-option {
        padding: 12px;
    }

    .setting-description {
        padding-right: 0;
        font-size: 0.9em;
    }
}

/* Print Cards Styles */
.print-cards-container {
    padding: 30px;
}

.print-cards-container h2 {
    color: #667eea;
    text-align: center;
    margin-bottom: 10px;
    font-size: 2em;
}

.print-cards-description {
    text-align: center;
    color: #6c757d;
    margin-bottom: 30px;
    font-size: 1.1em;
}

.print-filters-section,
.print-options-section,
.print-actions-section {
    background: #f8f9fa;
    border-radius: 15px;
    padding: 25px;
    margin-bottom: 25px;
    border: 2px solid #e9ecef;
}

.print-filters-section h3,
.print-options-section h3,
.print-actions-section h3 {
    color: #495057;
    margin-bottom: 20px;
    font-size: 1.3em;
    font-weight: 600;
}

.print-filters-grid,
.print-options-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 20px;
    margin-bottom: 20px;
}

.filter-group,
.print-option-group {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.filter-group label,
.print-option-group label {
    font-weight: 600;
    color: #495057;
    font-size: 0.95em;
}

.filter-group select,
.print-option-group select {
    padding: 10px 12px;
    border: 2px solid #dee2e6;
    border-radius: 8px;
    font-size: 1em;
    transition: all 0.3s;
    background: white;
}

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

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

.btn-load-print-data,
.btn-clear-print-filters {
    padding: 12px 25px;
    border: none;
    border-radius: 10px;
    font-size: 1em;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s;
    box-shadow: 0 4px 15px rgba(102, 126, 234, 0.3);
}

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

.btn-clear-print-filters {
    background: #6c757d;
    color: white;
}

.btn-load-print-data:hover,
.btn-clear-print-filters:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(102, 126, 234, 0.4);
}

.print-actions-section {
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap;
    gap: 20px;
}

.print-stats {
    font-size: 1.1em;
    font-weight: 600;
    color: #495057;
}

.print-buttons {
    display: flex;
    gap: 15px;
    flex-wrap: wrap;
}

.btn-preview-cards,
.btn-print-cards {
    padding: 15px 25px;
    border: none;
    border-radius: 10px;
    font-size: 1em;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s;
    box-shadow: 0 4px 15px rgba(102, 126, 234, 0.3);
}

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

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

.btn-preview-cards:hover,
.btn-print-cards:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(102, 126, 234, 0.4);
}

.btn-preview-cards:disabled,
.btn-print-cards:disabled {
    opacity: 0.6;
    cursor: not-allowed;
    transform: none;
    box-shadow: 0 2px 10px rgba(102, 126, 234, 0.2);
}

.cards-preview-container {
    background: #f8f9fa;
    border-radius: 15px;
    padding: 25px;
    margin-top: 25px;
    border: 2px solid #e9ecef;
}

.cards-preview-container h3 {
    color: #495057;
    margin-bottom: 20px;
    font-size: 1.3em;
    text-align: center;
}

.cards-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(350px, 1fr));
    gap: 20px;
    margin-top: 20px;
}

.referral-card {
    background: white;
    border: 2px solid #dee2e6;
    border-radius: 12px;
    padding: 20px;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.1);
    break-inside: avoid;
    page-break-inside: avoid;
}

.card-header {
    text-align: center;
    margin-bottom: 15px;
    padding-bottom: 10px;
    border-bottom: 2px solid #667eea;
}

.card-title {
    color: #667eea;
    font-size: 1.2em;
    font-weight: bold;
    margin: 0;
}

.card-content {
    display: grid;
    gap: 8px;
}

.card-field {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 5px 0;
    border-bottom: 1px solid #f1f3f4;
}

.card-field:last-child {
    border-bottom: none;
}

.card-label {
    font-weight: 600;
    color: #495057;
    font-size: 0.9em;
}

.card-value {
    color: #212529;
    font-size: 0.95em;
    text-align: right;
    flex: 1;
    margin-left: 10px;
}

.print-status {
    text-align: center;
    padding: 20px;
    background: #e9ecef;
    border-radius: 10px;
    margin-top: 20px;
}

/* Print Styles */
@media print {
    body {
        background: white !important;
        padding: 0 !important;
    }

    .container,
    header,
    .tabs,
    .print-cards-container h2,
    .print-cards-description,
    .print-filters-section,
    .print-options-section,
    .print-actions-section,
    .print-status {
        display: none !important;
    }

    .cards-grid {
        display: grid;
        grid-template-columns: repeat(2, 1fr);
        gap: 15px;
        margin: 0;
        padding: 0;
    }

    .referral-card {
        border: 1px solid #333 !important;
        box-shadow: none !important;
        margin: 0;
        page-break-inside: avoid;
        break-inside: avoid;
    }

    .card-field {
        border-bottom: 1px solid #ccc !important;
    }

    /* Landscape print optimizations */
    @page {
        size: A4 landscape;
        margin: 1cm;
    }
}

/* Single Card Generation Styles */
.single-card-section {
    background: #f8f9fa;
    border: 1px solid #e9ecef;
    border-radius: 12px;
    padding: 24px;
    margin-bottom: 30px;
}

.single-card-section h3 {
    color: #2c3e50;
    margin-bottom: 8px;
    font-size: 1.2em;
    font-weight: 600;
}

.single-card-description {
    color: #6c757d;
    margin-bottom: 20px;
    font-size: 0.95em;
    line-height: 1.5;
}

.single-card-input-group {
    display: flex;
    gap: 15px;
    align-items: end;
}

.single-card-input-container {
    flex: 1;
}

.single-card-input-container label {
    display: block;
    margin-bottom: 8px;
    font-weight: 500;
    color: #495057;
    font-size: 0.9em;
}

.single-card-input-container input {
    width: 100%;
    padding: 12px 16px;
    border: 2px solid #dee2e6;
    border-radius: 8px;
    font-size: 16px;
    transition: border-color 0.2s, box-shadow 0.2s;
}

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

.btn-generate-single-card {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    border: none;
    padding: 12px 24px;
    border-radius: 8px;
    cursor: pointer;
    font-weight: 500;
    font-size: 0.95em;
    transition: all 0.2s;
    white-space: nowrap;
    display: flex;
    align-items: center;
    gap: 8px;
}

.btn-generate-single-card:hover:not(:disabled) {
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(102, 126, 234, 0.3);
}

.btn-generate-single-card:disabled {
    opacity: 0.7;
    cursor: not-allowed;
    transform: none;
}

.single-card-status {
    margin-top: 15px;
    padding: 12px 16px;
    border-radius: 8px;
    font-weight: 500;
    font-size: 0.9em;
    display: none;
}

.single-card-status.success {
    background-color: #d4edda;
    color: #155724;
    border: 1px solid #c3e6cb;
}

.single-card-status.error {
    background-color: #f8d7da;
    color: #721c24;
    border: 1px solid #f5c6cb;
}

.single-card-status.info {
    background-color: #cce7ff;
    color: #004085;
    border: 1px solid #b3d7ff;
}

.section-divider {
    height: 1px;
    background: linear-gradient(90deg, transparent, #dee2e6, transparent);
    margin: 20px 0;
}

/* Column Visibility - Legacy styles kept for compatibility */
/* These styles are no longer used since we moved to modal-based column visibility */

/* Hidden Columns */
.hidden-column {
    display: none !important;
}

/* Table Column Classes */
.col-name,
.col-national_id,
.col-comitte_num,
.col-serial,
.col-attended {
    /* Essential columns - always visible */
}

.col-phone,
.col-supervisor,
.col-school,
.col-govern,
.col-attend_at {
    /* Toggleable columns */
}

/* Page Header Layout */
.page-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 16px;
    flex-wrap: wrap;
    gap: 16px;
}

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

.page-actions {
    display: flex;
    gap: 12px;
    flex-wrap: wrap;
}

/* Column Visibility Modal */
.column-visibility-modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.5);
    display: none;
    justify-content: center;
    align-items: center;
    z-index: 1000;
}

.column-visibility-modal {
    background: white;
    border-radius: 12px;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.3);
    max-width: 500px;
    width: 90%;
    max-height: 80vh;
    overflow-y: auto;
}

.column-visibility-modal-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 20px 24px;
    border-bottom: 1px solid #dee2e6;
    background: #f8f9fa;
    border-radius: 12px 12px 0 0;
}

.column-visibility-modal-header h3 {
    margin: 0;
    color: #2c3e50;
    font-size: 1.2em;
}

.modal-close {
    background: none;
    border: none;
    font-size: 24px;
    cursor: pointer;
    color: #6c757d;
    padding: 0;
    width: 32px;
    height: 32px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
    transition: all 0.2s ease;
}

.modal-close:hover {
    background: #e9ecef;
    color: #dc3545;
}

.column-visibility-modal-body {
    padding: 24px;
}

.column-visibility-description {
    color: #6c757d;
    margin-bottom: 20px;
    font-size: 0.95em;
    line-height: 1.5;
}

.column-visibility-options {
    display: flex;
    flex-direction: column;
    gap: 24px;
}

.column-group {
    border: 1px solid #e9ecef;
    border-radius: 8px;
    padding: 16px;
    background: #f8f9fa;
}

.column-group h4 {
    margin: 0 0 12px 0;
    color: #495057;
    font-size: 1em;
    font-weight: 600;
}

.column-option {
    display: flex;
    align-items: center;
    margin-bottom: 8px;
    gap: 10px;
}

.column-option:last-child {
    margin-bottom: 0;
}

.column-option input[type="checkbox"] {
    width: 18px;
    height: 18px;
    accent-color: #667eea;
}

.column-option label {
    cursor: pointer;
    font-weight: 500;
    color: #495057;
    flex: 1;
}

.column-option input:disabled {
    opacity: 0.6;
    cursor: not-allowed;
}

.column-option input:disabled + label {
    cursor: not-allowed;
    color: #6c757d;
}

.column-visibility-actions {
    display: flex;
    gap: 12px;
    margin-top: 24px;
    flex-wrap: wrap;
}

.btn-column-visibility,
.btn-show-all,
.btn-hide-all,
.btn-reset {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    border: none;
    padding: 10px 16px;
    border-radius: 8px;
    cursor: pointer;
    font-weight: 500;
    font-size: 0.9em;
    transition: all 0.2s ease;
    white-space: nowrap;
}

.btn-column-visibility:hover,
.btn-show-all:hover,
.btn-hide-all:hover,
.btn-reset:hover {
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(102, 126, 234, 0.3);
}

.btn-hide-all {
    background: linear-gradient(135deg, #dc3545 0%, #c82333 100%);
}

.btn-hide-all:hover {
    box-shadow: 0 4px 12px rgba(220, 53, 69, 0.3);
}

.btn-reset {
    background: linear-gradient(135deg, #6c757d 0%, #5a6268 100%);
}

.btn-reset:hover {
    box-shadow: 0 4px 12px rgba(108, 117, 125, 0.3);
}

/* Collapsible Box */
.collapsible-box {
    border: 1px solid #e9ecef;
    border-radius: 12px;
    background: #f8f9fa;
    margin-bottom: 20px;
    overflow: hidden;
}

.collapsible-box .section-description,
.collapsible-box .search-filter-container,
.collapsible-box .action-buttons {
    transition: all 0.4s cubic-bezier(0.4, 0, 0.2, 1);
    overflow: hidden;
}

.collapsible-box.collapsed .section-description,
.collapsible-box.collapsed .search-filter-container,
.collapsible-box.collapsed .action-buttons {
    max-height: 0;
    opacity: 0;
    transform: scaleY(0);
    transform-origin: top;
    padding-top: 0;
    padding-bottom: 0;
    margin-top: 0;
    margin-bottom: 0;
}

.collapsible-box:not(.collapsed) .section-description {
    max-height: 60px;
    opacity: 1;
    transform: scaleY(1);
    padding: 8px 24px 16px 24px;
}

.collapsible-box:not(.collapsed) .search-filter-container {
    max-height: 1000px; /* Adjust based on content */
    opacity: 1;
    transform: scaleY(1);
    padding: 0 24px;
}

.collapsible-box:not(.collapsed) .action-buttons {
    max-height: 80px;
    opacity: 1;
    transform: scaleY(1);
    padding: 16px 24px 24px 24px;
}

.collapsible-box .section-header {
    cursor: pointer;
    user-select: none;
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 20px 24px;
    margin-bottom: 0;
    background: white;
    border-bottom: 1px solid #dee2e6;
    transition: all 0.2s ease;
}

.collapsible-box .section-header:hover {
    background: #f8f9ff;
    border-bottom-color: #667eea;
}

.collapsible-box .section-header h3 {
    margin: 0;
    color: #2c3e50;
}

.collapsible-box .toggle-icon {
    font-size: 1em;
    transition: transform 0.3s ease, color 0.2s ease;
    color: #6c757d;
    margin-left: 12px;
}

.collapsible-box.collapsed .toggle-icon {
    transform: rotate(-90deg);
}

.collapsible-box .section-header:hover .toggle-icon {
    color: #667eea;
}

/* Mobile responsiveness for print cards */
@media (max-width: 768px) {
    .print-cards-container {
        padding: 20px;
    }

    .print-cards-container h2 {
        font-size: 1.6em;
    }

    .print-filters-grid,
    .print-options-grid {
        grid-template-columns: 1fr;
    }

    .print-actions-section {
        flex-direction: column;
        align-items: stretch;
    }

    .print-buttons {
        justify-content: center;
    }

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

    .btn-load-print-data,
    .btn-clear-print-filters,
    .btn-preview-cards,
    .btn-print-cards {
        width: 100%;
        margin-bottom: 10px;
    }

    /* Single card mobile styles */
    .single-card-input-group {
        flex-direction: column;
        gap: 12px;
    }

    .single-card-section {
        padding: 20px;
    }

    .btn-generate-single-card {
        width: 100%;
        justify-content: center;
    }

    /* Collapsible box mobile styles */
    .collapsible-box {
        margin-bottom: 15px;
    }

    .collapsible-box .section-header {
        padding: 16px 20px;
    }

    .collapsible-box .section-header h3 {
        font-size: 1.1em;
    }

    .collapsible-box .toggle-icon {
        font-size: 1.2em;
    }

    .collapsible-box:not(.collapsed) .section-description,
    .collapsible-box:not(.collapsed) .search-filter-container,
    .collapsible-box:not(.collapsed) .action-buttons {
        padding-left: 20px;
        padding-right: 20px;
    }

    /* Column visibility mobile */
    .column-header {
        position: relative;
        min-height: 44px; /* Touch target size */
    }

    .column-visibility-icon {
        opacity: 0.5; /* More visible on mobile */
    }

    .column-header:hover .column-visibility-icon {
        opacity: 1;
    }

    /* Page header mobile */
    .page-header {
        flex-direction: column;
        align-items: flex-start;
        gap: 12px;
    }

    .page-header h2 {
        font-size: 1.5em;
    }

    .page-actions {
        width: 100%;
        justify-content: center;
    }

    .page-actions button {
        flex: 1;
        min-width: 120px;
        font-size: 0.85em;
        padding: 8px 12px;
    }

    /* Column visibility modal mobile */
    .column-visibility-modal {
        width: 95%;
        margin: 20px;
    }

    .column-visibility-modal-header {
        padding: 16px 20px;
    }

    .column-visibility-modal-body {
        padding: 20px;
    }

    .column-visibility-actions {
        flex-direction: column;
    }

    .column-visibility-actions button {
        width: 100%;
        margin-bottom: 8px;
    }

    .column-visibility-actions button:last-child {
        margin-bottom: 0;
    }
}


