/* HIV Data Collection Portal - Excel-Style Interface */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    min-height: 100vh;
}

.app-container {
    max-width: 100%;
    margin: 0 auto;
    background: white;
    min-height: 100vh;
    display: flex;
    flex-direction: row; /* Changed to horizontal layout */
}

/* Left Sidebar Layout */
.app-sidebar {
    width: 320px;
    background: linear-gradient(135deg, #2c5aa0 0%, #4a90e2 100%);
    color: white;
    display: flex;
    flex-direction: column;
    box-shadow: 2px 0 10px rgba(0,0,0,0.1);
    position: fixed;
    left: 0;
    top: 0;
    height: 100vh;
    z-index: 1000;
    overflow-y: auto;
}

/* Header in Sidebar */
.app-header {
    background: transparent;
    color: white;
    padding: 1.5rem 1rem;
    border-bottom: 1px solid rgba(255,255,255,0.2);
}

.header-content {
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

.header-content h1 {
    font-size: 1.2rem;
    font-weight: 600;
    text-align: center;
    line-height: 1.3;
    margin-bottom: 1rem;
}

.header-controls {
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

.header-controls select,
.header-controls input,
.save-btn {
    padding: 0.5rem 1rem;
    border: none;
    border-radius: 6px;
    font-size: 0.9rem;
    background: white;
    color: #333;
    width: 100%;
}

.save-btn {
    background: #28a745;
    color: white;
    cursor: pointer;
    font-weight: 500;
    transition: all 0.3s ease;
}

.save-btn:hover {
    background: #218838;
    transform: translateY(-1px);
}

/* Navigation in Sidebar */
.app-nav {
    background: transparent;
    padding: 0;
    border-bottom: none;
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
    padding: 1rem;
    border-bottom: 1px solid rgba(255,255,255,0.2);
}

.nav-btn {
    padding: 1rem;
    border: none;
    background: rgba(255,255,255,0.1);
    cursor: pointer;
    font-size: 0.9rem;
    font-weight: 500;
    color: white;
    border-radius: 8px;
    transition: all 0.3s ease;
    text-align: left;
    width: 100%;
}

.nav-btn:hover {
    background: rgba(255,255,255,0.2);
    transform: translateX(-2px);
}

.nav-btn.active {
    background: rgba(255,255,255,0.3);
    box-shadow: 0 2px 10px rgba(0,0,0,0.2);
    transform: translateX(-2px);
}

/* Main Content - Adjusted for left sidebar */
.app-main {
    flex: 1;
    padding: 2rem;
    padding-left: 340px; /* Account for sidebar width + padding */
    overflow-x: auto;
    min-height: 100vh;
}

.content-section {
    display: none;
}

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

.section-header {
    margin-bottom: 2rem;
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    flex-wrap: wrap;
}

.section-header h2 {
    color: #2c5aa0;
    font-size: 1.8rem;
    font-weight: 600;
    flex: 1;
}

.status-bar {
    display: flex;
    gap: 1rem;
    font-size: 0.9rem;
    color: #6c757d;
}

/* Excel-Style Data Tables */
.data-form {
    background: white;
    border-radius: 8px;
    box-shadow: 0 2px 10px rgba(0,0,0,0.1);
    margin-bottom: 2rem;
    overflow: hidden;
}

.data-form h3 {
    background: #f8f9fa;
    padding: 1rem 1.5rem;
    margin: 0;
    color: #495057;
    font-size: 1.1rem;
    border-bottom: 1px solid #dee2e6;
}

.table-container {
    overflow-x: auto;
    max-height: 600px;
    overflow-y: auto;
}

.data-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 0.85rem;
    background: white;
}

.data-table th {
    background: linear-gradient(135deg, #e9ecef 0%, #f8f9fa 100%);
    color: #495057;
    padding: 0.5rem 0.3rem;
    text-align: center;
    font-weight: 600;
    border: 1px solid #dee2e6;
    position: sticky;
    top: 0;
    z-index: 10;
    font-size: 0.8rem;
    line-height: 1.2;
    min-width: 120px;
    vertical-align: top;
    height: auto;
}

.data-table td {
    padding: 0;
    border: 1px solid #dee2e6;
    text-align: center;
    position: relative;
    min-width: 80px; /* Consistent minimum width */
}

.data-table .week-cell {
    background: #f8f9fa;
    font-weight: 500;
    color: #495057;
    padding: 0.5rem;
    white-space: nowrap;
}

/* Excel-Style Cell Input */
.cell-input {
    width: 100%;
    height: 100%;
    border: none;
    background: transparent;
    text-align: center;
    font-size: 0.9rem;
    padding: 0.6rem 0.4rem;
    outline: none;
    min-width: 80px; /* Increased for better data entry */
}

.cell-input:focus {
    background: #e3f2fd;
    border: 2px solid #2196f3;
    box-shadow: inset 0 0 0 1px #2196f3;
}

.cell-input:hover:not(:focus) {
    background: #f5f5f5;
}

/* Data cell states */
.data-table td.editing {
    background: #e3f2fd;
    border: 2px solid #2196f3;
}

.data-table td.has-value {
    background: #e8f5e8;
}

.data-table td.invalid {
    background: #ffebee;
    border-color: #f44336;
}

/* Dashboard Styles */
.dashboard-controls {
    display: flex;
    gap: 1rem;
    align-items: center;
}

.dashboard-controls select {
    padding: 0.5rem 1rem;
    border: 1px solid #dee2e6;
    border-radius: 6px;
    font-size: 0.9rem;
}

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

.kpi-card {
    background: white;
    border-radius: 8px;
    padding: 1.5rem;
    box-shadow: 0 2px 10px rgba(0,0,0,0.1);
    display: flex;
    align-items: center;
    gap: 1rem;
    transition: transform 0.3s ease;
}

.kpi-card:hover {
    transform: translateY(-2px);
}

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

.kpi-content {
    flex: 1;
}

.kpi-title {
    font-size: 0.9rem;
    color: #6c757d;
    margin-bottom: 0.5rem;
}

.kpi-value {
    font-size: 1.8rem;
    font-weight: 700;
    color: #2c5aa0;
    margin-bottom: 0.25rem;
}

.kpi-trend {
    font-size: 0.8rem;
    color: #28a745;
}

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

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

.chart-container.wide {
    grid-column: 1 / -1;
    height: 500px;
}

.chart-container h3 {
    margin-bottom: 1rem;
    color: #495057;
    font-size: 1.1rem;
    text-align: center;
}

.chart-container canvas {
    max-height: calc(100% - 3rem);
}

/* Reports Section */
.reports-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 2rem;
}

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

.report-card h3 {
    color: #2c5aa0;
    margin-bottom: 1rem;
}

.report-card p {
    color: #6c757d;
    margin-bottom: 1.5rem;
}

.export-btn {
    background: #28a745;
    color: white;
    border: none;
    padding: 0.75rem 1.5rem;
    border-radius: 6px;
    cursor: pointer;
    font-weight: 500;
    transition: all 0.3s ease;
}

.export-btn:hover {
    background: #218838;
    transform: translateY(-1px);
}

/* Mobile Responsiveness */
@media (max-width: 1024px) {
    .app-sidebar {
        width: 280px;
    }
    
    .app-main {
        padding-left: 300px;
    }
}

@media (max-width: 768px) {
    .app-container {
        flex-direction: column;
    }
    
    .app-sidebar {
        position: relative;
        width: 100%;
        height: auto;
        order: -1;
    }
    
    .app-main {
        padding: 1rem;
        padding-left: 1rem;
    }
    
    .header-content h1 {
        font-size: 1rem;
    }
    
    .nav-btn {
        padding: 0.75rem;
        font-size: 0.8rem;
    }
    
    .data-table {
        font-size: 0.75rem;
    }
    
    .data-table th,
    .data-table td {
        padding: 0.25rem;
    }
    
    .charts-grid {
        grid-template-columns: 1fr;
    }
    
    .chart-container {
        height: 300px;
    }
    
    .kpi-grid {
        grid-template-columns: 1fr;
    }
}

/* Print Styles */
@media print {
    .app-sidebar {
        display: none;
    }
    
    .app-main {
        padding: 0;
        padding-left: 0;
    }
    
    .chart-container {
        break-inside: avoid;
    }
}

/* Accessibility */
.cell-input:focus {
    outline: 2px solid #2196f3;
    outline-offset: -2px;
}

@media (prefers-reduced-motion: reduce) {
    .nav-btn,
    .save-btn,
    .export-btn,
    .kpi-card {
        transition: none;
    }
}

/* Loading States */
.loading {
    opacity: 0.6;
    pointer-events: none;
}

.loading::after {
    content: " Chargement...";
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    background: rgba(255,255,255,0.9);
    padding: 1rem 2rem;
    border-radius: 6px;
    font-weight: 500;
}

/* Success/Error States */
.success-message {
    background: #d4edda;
    color: #155724;
    padding: 0.75rem 1rem;
    border-radius: 6px;
    border: 1px solid #c3e6cb;
    margin-bottom: 1rem;
}

.error-message {
    background: #f8d7da;
    color: #721c24;
    padding: 0.75rem 1rem;
    border-radius: 6px;
    border: 1px solid #f5c6cb;
    margin-bottom: 1rem;
}

/* Form Selection Interface */
.form-selection-container {
    background: white;
    border-radius: 8px;
    box-shadow: 0 2px 10px rgba(0,0,0,0.1);
    margin-bottom: 1rem;
    padding: 1rem;
}

.form-selection-container h3 {
    color: #2c5aa0;
    font-size: 1rem;
    margin-bottom: 0.8rem;
    text-align: center;
}

.form-selection-buttons {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 1rem;
    max-width: 800px;
    margin: 0 auto;
}

.form-selection-btn {
    display: flex;
    align-items: center;
    gap: 0.8rem;
    padding: 0.8rem 1rem;
    border: 2px solid #dee2e6;
    border-radius: 8px;
    background: white;
    cursor: pointer;
    transition: all 0.3s ease;
    text-align: left;
    font-family: inherit;
}

.form-selection-btn:hover {
    border-color: #2c5aa0;
    transform: translateY(-2px);
    box-shadow: 0 4px 15px rgba(44, 90, 160, 0.15);
}

.form-selection-btn.active {
    border-color: #2c5aa0;
    background: #f8fbff;
    box-shadow: 0 4px 15px rgba(44, 90, 160, 0.2);
}

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

.form-selection-btn.active .form-btn-icon {
    background: linear-gradient(135deg, #2c5aa0 0%, #4a90e2 100%);
}

.form-btn-content {
    flex: 1;
}

.form-btn-title {
    font-size: 1rem;
    font-weight: 600;
    color: #333;
    margin-bottom: 0.5rem;
}

.form-btn-desc {
    font-size: 0.9rem;
    color: #6c757d;
    line-height: 1.4;
}

.form-selection-btn.active .form-btn-title {
    color: #2c5aa0;
}

/* Form Container Visibility */
.data-form {
    display: none;
}

.data-form.active {
    display: block;
}

/* Calculated Fields Styling */
.cell-input.calculated-field {
    background-color: #f0f8ff !important;
    border: 1px solid #87ceeb !important;
    color: #2c5aa0 !important;
    font-weight: 500;
    cursor: not-allowed;
}

.cell-input.calculated-field:hover {
    background-color: #e6f3ff !important;
}

.cell-input.calculated-field:focus {
    background-color: #f0f8ff !important;
    border: 2px solid #4169e1 !important;
    outline: none;
}

/* Mobile responsiveness for form selection */
@media (max-width: 768px) {
    .form-selection-buttons {
        grid-template-columns: 1fr;
        gap: 1rem;
    }
    
    .form-selection-btn {
        padding: 0.8rem;
    }
    
    .form-btn-icon {
        width: 35px;
        height: 35px;
        font-size: 1.5rem;
    }
    
    .form-btn-title {
        font-size: 1rem;
    }
    
    .form-btn-desc {
        font-size: 0.8rem;
    }
}

/* Form Save Section */
.form-save-section {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 1rem;
    padding: 1rem;
    background: linear-gradient(135deg, #e3f2fd, #f8f9fa);
    border-radius: 8px;
    margin: 1rem 0;
    border: 1px solid #e0e0e0;
}

.auto-save-indicator {
    font-size: 0.85rem;
    color: #28a745;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.auto-save-indicator::before {
    content: "✅";
    font-size: 1rem;
}

/* Form Selector in Sidebar */
.form-selector {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

.form-selector label {
    font-weight: 600;
    color: white;
    font-size: 0.9rem;
}

.form-selector .form-select {
    width: 100%;
    font-size: 0.8rem;
}

/* Validation Section */
.validation-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 1.5rem;
    margin-bottom: 2rem;
}

.validation-card {
    background: white;
    border-radius: 8px;
    padding: 1.5rem;
    box-shadow: 0 2px 10px rgba(0,0,0,0.1);
    border-left: 4px solid #ddd;
}

.validation-card.complete {
    border-left-color: #28a745;
}

.validation-card.partial {
    border-left-color: #ffc107;
}

.validation-card.error {
    border-left-color: #dc3545;
}

.validation-card.summary {
    border-left-color: #17a2b8;
}

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

.card-header h3 {
    margin: 0;
    color: #495057;
}

.metric-count {
    font-size: 2rem;
    font-weight: bold;
    color: #2c5aa0;
}

.site-list {
    margin-top: 0.5rem;
    font-size: 0.9rem;
    color: #6c757d;
}

.summary-stats {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

.stat-item {
    display: flex;
    justify-content: space-between;
}

.stat-item label {
    font-weight: 600;
}

/* Validation Table */
.validation-table-container {
    background: white;
    border-radius: 8px;
    padding: 1.5rem;
    box-shadow: 0 2px 10px rgba(0,0,0,0.1);
}

.validation-table {
    width: 100%;
    border-collapse: collapse;
    margin-top: 1rem;
}

.validation-table th,
.validation-table td {
    padding: 0.75rem;
    text-align: left;
    border-bottom: 1px solid #dee2e6;
}

.validation-table th {
    background: #f8f9fa;
    font-weight: 600;
    color: #495057;
}

.validation-controls {
    display: flex;
    gap: 1rem;
}

.btn-primary {
    background: #2c5aa0;
    color: white;
    border: none;
    padding: 0.5rem 1rem;
    border-radius: 4px;
    cursor: pointer;
    font-size: 0.9rem;
}

.btn-primary:hover {
    background: #1e3d72;
}

/* Site Item Styling */
.site-item {
    background: #f8f9fa;
    border: 1px solid #dee2e6;
    border-radius: 6px;
    padding: 0.75rem;
    margin-bottom: 0.5rem;
}

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

.site-dept {
    font-size: 0.8rem;
    color: #6c757d;
    background: #e9ecef;
    padding: 0.25rem 0.5rem;
    border-radius: 4px;
}

.site-details {
    font-size: 0.85rem;
    color: #495057;
}

.empty-state {
    color: #6c757d;
    font-style: italic;
    text-align: center;
    padding: 1rem;
}

/* Progress Bar */
.progress-bar {
    position: relative;
    background: #e9ecef;
    border-radius: 4px;
    height: 20px;
    width: 100px;
    overflow: hidden;
}

.progress-fill {
    height: 100%;
    background: linear-gradient(135deg, #28a745 0%, #20c997 100%);
    transition: width 0.3s ease;
    border-radius: 4px;
}

.progress-bar span {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    font-size: 0.75rem;
    font-weight: 600;
    color: #495057;
    z-index: 1;
}

/* Status Badges */
.status-badge {
    display: inline-block;
    padding: 0.25rem 0.5rem;
    border-radius: 4px;
    font-size: 0.75rem;
    font-weight: 600;
    text-transform: uppercase;
}

.status-complete {
    background: #d4edda;
    color: #155724;
}

.status-partial {
    background: #fff3cd;
    color: #856404;
}

.status-error {
    background: #f8d7da;
    color: #721c24;
}

/* Validation Table Row Styling */
.validation-table tr.status-complete {
    background: rgba(40, 167, 69, 0.05);
}

.validation-table tr.status-partial {
    background: rgba(255, 193, 7, 0.05);
}

.validation-table tr.status-error {
    background: rgba(220, 53, 69, 0.05);
}

.missing-cols, .inconsistencies {
    font-size: 0.8rem;
    max-width: 200px;
    word-wrap: break-word;
}

/* Focus highlighting for cursor positioning */
.cursor-highlight {
    animation: highlight-flash 3s ease-out;
}

@keyframes highlight-flash {
    0% {
        background-color: #fff3cd;
        border-color: #ffc107;
    }
    50% {
        background-color: #fff8dc;
        border-color: #f0ad4e;
    }
    100% {
        background-color: transparent;
        border-color: #dee2e6;
    }
}

/* Validation Error Styling */
.validation-error {
    background-color: #f8d7da !important;
    border-color: #dc3545 !important;
    border-width: 2px !important;
}

.validation-warning {
    background-color: #fff3cd !important;
    border-color: #ffc107 !important;
    border-width: 2px !important;
}

/* Column Numbers Styling - Separate Line Above Header Names */
.column-header {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    text-align: center;
    min-height: 80px;
    padding: 0.3rem;
    gap: 0.4rem;
}

.column-number {
    background: #2c5aa0;
    color: white;
    font-size: 0.75rem;
    font-weight: 700;
    padding: 0.25rem 0.5rem;
    border-radius: 12px;
    min-width: 22px;
    display: block;
    line-height: 1;
    margin: 0 auto;
    text-align: center;
    width: fit-content;
}

.column-name {
    font-size: 0.75rem;
    line-height: 1.2;
    font-weight: 600;
    color: #495057;
    text-align: center;
    word-wrap: break-word;
    hyphens: auto;
    margin-top: 0.2rem;
    padding: 0 0.2rem;
}

/* Ensure proper spacing between number and name */
.column-header .column-number + .column-name {
    margin-top: 0.3rem;
}

/* Responsive column numbering */
@media (max-width: 768px) {
    .column-number {
        font-size: 0.7rem;
        padding: 0.2rem 0.4rem;
        min-width: 18px;
    }
    
    .column-header {
        min-height: 70px;
        padding: 0.25rem;
        gap: 0.3rem;
    }
    
    .column-name {
        font-size: 0.7rem;
        line-height: 1.1;
    }
    
    .column-header .column-number + .column-name {
        margin-top: 0.25rem;
    }
}

/* Disabled form state when no facility selected */
.cell-input:disabled {
    background-color: #f8f9fa !important;
    color: #6c757d !important;
    cursor: not-allowed !important;
    opacity: 0.5 !important;
    border-color: #dee2e6 !important;
}

.cell-input:disabled:hover {
    background-color: #f8f9fa !important;
}

.cell-input:disabled:focus {
    background-color: #f8f9fa !important;
    border-color: #dee2e6 !important;
    box-shadow: none !important;
    outline: none !important;
}

/* Disabled save button */
.save-btn:disabled {
    background-color: #6c757d !important;
    cursor: not-allowed !important;
    opacity: 0.5 !important;
}

.save-btn:disabled:hover {
    background-color: #6c757d !important;
    transform: none !important;
}

/* Facility selector highlight when required */
.facility-required {
    border: 3px solid #ffc107 !important;
    box-shadow: 0 0 10px rgba(255, 193, 7, 0.5) !important;
    animation: pulse-warning 2s infinite;
}

@keyframes pulse-warning {
    0% {
        box-shadow: 0 0 10px rgba(255, 193, 7, 0.5);
    }
    50% {
        box-shadow: 0 0 20px rgba(255, 193, 7, 0.8);
    }
    100% {
        box-shadow: 0 0 10px rgba(255, 193, 7, 0.5);
    }
}

/* Sidebar Status Display */
.sidebar-status {
    padding: 1rem;
    border-top: 1px solid rgba(255,255,255,0.2);
    margin-top: auto;
}

.sidebar-status .status-bar {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
    font-size: 0.8rem;
    color: rgba(255,255,255,0.9);
}

.sidebar-status .status-bar span {
    background: rgba(255,255,255,0.1);
    padding: 0.5rem;
    border-radius: 4px;
    text-align: center;
}

/* Wider tables for better data entry */
.data-table {
    width: 100%;
    min-width: 1200px; /* Ensure minimum width for comfortable data entry */
}

.table-container {
    overflow-x: auto;
    max-height: 70vh; /* Increased height */
    overflow-y: auto;
}

/* Import Section Styles */
.import-mode-selection {
    margin-bottom: 2rem;
}

.mode-tabs {
    display: flex;
    gap: 1rem;
    border-bottom: 1px solid #e0e0e0;
}

.mode-tab {
    padding: 1rem 2rem;
    background: none;
    border: none;
    cursor: pointer;
    font-size: 1rem;
    font-weight: 500;
    color: #666;
    border-bottom: 3px solid transparent;
    transition: all 0.3s ease;
}

.mode-tab.active {
    color: #2c5aa0;
    border-bottom-color: #2c5aa0;
    background: #f8f9fa;
}

.mode-tab:hover {
    background: #f8f9fa;
    color: #2c5aa0;
}

.import-mode {
    display: none;
}

.import-mode.active {
    display: block;
}

.import-card {
    background: white;
    padding: 2rem;
    border-radius: 12px;
    box-shadow: 0 4px 6px rgba(0,0,0,0.1);
    border: 1px solid #e0e0e0;
}

.import-card h3 {
    color: #2c5aa0;
    margin-bottom: 0.5rem;
}

.import-card p {
    color: #666;
    margin-bottom: 2rem;
}

.import-form {
    display: flex;
    flex-direction: column;
    gap: 1.5rem;
}

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

.form-group {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

.form-group label {
    font-weight: 500;
    color: #333;
}

.form-select, .form-input {
    padding: 0.75rem;
    border: 1px solid #ddd;
    border-radius: 6px;
    font-size: 1rem;
    transition: border-color 0.3s ease;
}

.form-select:focus, .form-input:focus {
    outline: none;
    border-color: #2c5aa0;
    box-shadow: 0 0 0 3px rgba(44, 90, 160, 0.1);
}

.file-upload {
    position: relative;
}

.file-input {
    padding: 1rem;
    border: 2px dashed #ddd;
    border-radius: 8px;
    background: #f8f9fa;
    cursor: pointer;
    transition: all 0.3s ease;
}

.file-input:hover {
    border-color: #2c5aa0;
    background: #f0f4f8;
}

.file-info {
    margin-top: 0.5rem;
    padding: 0.5rem;
    background: #e8f4f8;
    border-radius: 4px;
    font-size: 0.9rem;
    color: #2c5aa0;
}

.import-actions {
    display: flex;
    gap: 1rem;
    justify-content: flex-start;
    margin-top: 1rem;
}

.import-btn, .preview-btn, .bulk-btn {
    padding: 0.75rem 1.5rem;
    border: none;
    border-radius: 6px;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.3s ease;
    font-size: 1rem;
}

.import-btn.primary {
    background: #2c5aa0;
    color: white;
}

.import-btn.primary:hover {
    background: #1e3f73;
    transform: translateY(-2px);
}

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

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

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

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

/* Bulk Import Styles */
.bulk-import-controls {
    display: flex;
    flex-direction: column;
    gap: 2rem;
}

.bulk-site-selection h4 {
    color: #2c5aa0;
    margin-bottom: 1rem;
}

.site-config-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 1rem;
    margin-bottom: 2rem;
}

.site-config-item {
    background: #f8f9fa;
    border: 1px solid #e0e0e0;
    border-radius: 8px;
    padding: 1rem;
    transition: all 0.3s ease;
}

.site-config-item.selected {
    border-color: #2c5aa0;
    background: #f0f4f8;
}

.site-config-header {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    margin-bottom: 1rem;
}

.site-checkbox {
    width: 18px;
    height: 18px;
    cursor: pointer;
}

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

.site-file-upload {
    opacity: 0.5;
    transition: opacity 0.3s ease;
}

.site-config-item.selected .site-file-upload {
    opacity: 1;
}

.bulk-actions {
    display: flex;
    gap: 1rem;
    flex-wrap: wrap;
}

/* Progress Styles */
.import-progress, .import-results {
    background: white;
    padding: 2rem;
    border-radius: 12px;
    box-shadow: 0 4px 6px rgba(0,0,0,0.1);
    border: 1px solid #e0e0e0;
    margin-top: 2rem;
}

.import-progress.hidden, .import-results.hidden {
    display: none;
}

.progress-bar {
    width: 100%;
    height: 20px;
    background: #e0e0e0;
    border-radius: 10px;
    overflow: hidden;
    margin: 1rem 0;
}

.progress-fill {
    height: 100%;
    background: linear-gradient(90deg, #28a745, #20c997);
    width: 0%;
    transition: width 0.3s ease;
}

.progress-text {
    text-align: center;
    color: #666;
    font-weight: 500;
}

.import-log {
    margin-top: 1rem;
    max-height: 200px;
    overflow-y: auto;
    background: #f8f9fa;
    border: 1px solid #e0e0e0;
    border-radius: 6px;
    padding: 1rem;
    font-family: 'Courier New', monospace;
    font-size: 0.9rem;
}

.log-entry {
    margin-bottom: 0.5rem;
    padding: 0.25rem 0;
}

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

.log-error {
    color: #dc3545;
}

.log-warning {
    color: #ffc107;
}

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

/* Results Styles */
.results-summary {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 1rem;
    margin-bottom: 2rem;
}

.result-card {
    background: #f8f9fa;
    border: 1px solid #e0e0e0;
    border-radius: 8px;
    padding: 1rem;
    text-align: center;
}

.result-number {
    font-size: 2rem;
    font-weight: bold;
    color: #2c5aa0;
}

.result-label {
    color: #666;
    font-size: 0.9rem;
    margin-top: 0.5rem;
}

.results-details {
    background: #f8f9fa;
    border: 1px solid #e0e0e0;
    border-radius: 8px;
    padding: 1rem;
    max-height: 300px;
    overflow-y: auto;
}

/* Import Preview Modal Styles */
.import-modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.7);
    display: flex;
    justify-content: center;
    align-items: center;
    z-index: 10000;
}

.import-modal {
    background: white;
    border-radius: 12px;
    max-width: 90vw;
    max-height: 90vh;
    width: 800px;
    display: flex;
    flex-direction: column;
    box-shadow: 0 10px 30px rgba(0,0,0,0.3);
}

.modal-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 1.5rem 2rem;
    border-bottom: 1px solid #e0e0e0;
    background: #f8f9fa;
    border-radius: 12px 12px 0 0;
}

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

.modal-close {
    background: none;
    border: none;
    font-size: 1.5rem;
    cursor: pointer;
    color: #666;
    width: 30px;
    height: 30px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
    transition: background-color 0.3s ease;
}

.modal-close:hover {
    background: #e0e0e0;
}

.modal-content {
    padding: 2rem;
    overflow-y: auto;
    flex: 1;
}

.preview-summary {
    background: #f8f9fa;
    border-radius: 8px;
    padding: 1.5rem;
    margin-bottom: 2rem;
    border: 1px solid #e0e0e0;
}

.summary-item {
    margin-bottom: 0.75rem;
    padding: 0.5rem 0;
    border-bottom: 1px solid #e8e9ea;
}

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

.header-line {
    color: #666;
    font-size: 0.9em;
}

.preview-data h4 {
    color: #2c5aa0;
    margin-bottom: 1rem;
    border-bottom: 1px solid #e0e0e0;
    padding-bottom: 0.5rem;
}

.data-sample {
    margin-bottom: 2rem;
}

.sample-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 0.9rem;
}

.sample-table th,
.sample-table td {
    padding: 0.75rem;
    text-align: left;
    border: 1px solid #e0e0e0;
}

.sample-table th {
    background: #f8f9fa;
    font-weight: 600;
    color: #333;
}

.sample-table tr:nth-child(even) {
    background: #f9f9f9;
}

.sample-value {
    font-family: 'Courier New', monospace;
    max-width: 200px;
    word-break: break-word;
}

.data-type {
    font-size: 0.8em;
    color: #666;
    font-style: italic;
}

.more-fields {
    text-align: center;
    color: #666;
    font-style: italic;
}

.weeks-list {
    margin-top: 2rem;
}

.weeks-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 0.5rem;
    margin-top: 1rem;
}

.week-item {
    background: #f0f4f8;
    border: 1px solid #d1ecf1;
    border-radius: 6px;
    padding: 0.75rem;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.week-date {
    font-weight: 500;
    color: #2c5aa0;
}

.week-count {
    font-size: 0.8em;
    color: #666;
    background: white;
    padding: 0.25rem 0.5rem;
    border-radius: 4px;
}

.modal-actions {
    display: flex;
    gap: 1rem;
    padding: 1.5rem 2rem;
    border-top: 1px solid #e0e0e0;
    background: #f8f9fa;
    border-radius: 0 0 12px 12px;
    justify-content: flex-end;
}

.btn-primary, .btn-secondary {
    padding: 0.75rem 1.5rem;
    border: none;
    border-radius: 6px;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.3s ease;
    font-size: 1rem;
}

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

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

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

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

/* Responsive Design */
@media (max-width: 768px) {
    .form-row {
        grid-template-columns: 1fr;
    }
    
    .site-config-grid {
        grid-template-columns: 1fr;
    }
    
    .import-actions, .bulk-actions {
        flex-direction: column;
    }
    
    .mode-tabs {
        flex-direction: column;
    }
    
    .results-summary {
        grid-template-columns: 1fr;
    }
    
    .import-modal {
        width: 95vw;
        height: 95vh;
    }
    
    .modal-content {
        padding: 1rem;
    }
    
    .modal-actions {
        flex-direction: column;
    }
    
    .weeks-grid {
        grid-template-columns: 1fr;
    }
    
    .sample-table {
        font-size: 0.8rem;
    }
}