/* Gold Machine - Styles CSS */

/* Checkbox groups */
.checkbox-group {
    display: flex;
    flex-wrap: wrap;
    gap: 15px;
    margin: 10px 0;
}

.checkbox-label {
    display: flex;
    align-items: center;
    gap: 8px;
    font-weight: normal;
    cursor: pointer;
    padding: 8px 12px;
    border: 1px solid #ddd;
    border-radius: 6px;
    background: #fff;
    transition: all 0.2s ease;
}

.checkbox-label:hover {
    background: #f8f9fa;
    border-color: #007bff;
}

.checkbox-label input[type="checkbox"] {
    margin: 0;
    cursor: pointer;
}
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

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

.container {
    max-width: 1400px;
    margin: 0 auto;
    padding: 0 20px;
}

/* Header */
.header {
    background: linear-gradient(135deg, #2c3e50, #3498db);
    color: white;
    padding: 20px 0;
    box-shadow: 0 2px 10px rgba(0,0,0,0.1);
}

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

.logo h1 {
    font-size: 2em;
    margin-bottom: 5px;
}

.logo p {
    opacity: 0.9;
    font-size: 0.9em;
}

/* Navigation */
.nav-tabs {
    display: flex;
    gap: 10px;
    flex-wrap: wrap;
}

.nav-tab {
    padding: 12px 20px;
    background: rgba(255,255,255,0.1);
    color: white;
    text-decoration: none;
    border-radius: 25px;
    transition: all 0.3s ease;
    font-weight: 500;
}

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

.nav-tab.active {
    background: white;
    color: #2c3e50;
}

/* Main content */
.main {
    padding: 30px 0;
    min-height: calc(100vh - 200px);
}

/* Page header */
.page-header {
    text-align: center;
    margin-bottom: 40px;
    padding: 30px;
    background: white;
    border-radius: 15px;
    box-shadow: 0 5px 15px rgba(0,0,0,0.1);
}

.page-header h2 {
    font-size: 2.5em;
    color: #2c3e50;
    margin-bottom: 10px;
}

.page-header p {
    color: #666;
    font-size: 1.1em;
}

/* Alerts */
.alert {
    padding: 15px 20px;
    margin-bottom: 20px;
    border-radius: 8px;
    border-left: 4px solid;
}

.alert-success {
    background: #d4edda;
    color: #155724;
    border-left-color: #28a745;
}

.alert-error {
    background: #f8d7da;
    color: #721c24;
    border-left-color: #dc3545;
}

.alert-info {
    background: #d1ecf1;
    color: #0c5460;
    border-left-color: #17a2b8;
}

/* Sections */
.section {
    background: white;
    border-radius: 15px;
    padding: 30px;
    margin-bottom: 30px;
    box-shadow: 0 5px 15px rgba(0,0,0,0.1);
}

.section h3 {
    color: #2c3e50;
    margin-bottom: 20px;
    font-size: 1.5em;
    border-bottom: 2px solid #ecf0f1;
    padding-bottom: 10px;
}

/* Filters */
.filters-section {
    background: white;
    border-radius: 15px;
    padding: 25px;
    margin-bottom: 30px;
    box-shadow: 0 5px 15px rgba(0,0,0,0.1);
}

.filters-form .filter-row {
    display: flex;
    gap: 20px;
    margin-bottom: 20px;
    flex-wrap: wrap;
    align-items: end;
}

.filter-group {
    display: flex;
    flex-direction: column;
    min-width: 150px;
}

.filter-group label {
    margin-bottom: 8px;
    font-weight: 600;
    color: #2c3e50;
}

.filter-group input,
.filter-group select {
    padding: 12px;
    border: 2px solid #e9ecef;
    border-radius: 8px;
    font-size: 14px;
    transition: border-color 0.3s ease;
}

.filter-group input:focus,
.filter-group select:focus {
    outline: none;
    border-color: #3498db;
    box-shadow: 0 0 0 3px rgba(52, 152, 219, 0.1);
}

/* Checkboxes */
.checkbox-group {
    display: flex;
    gap: 15px;
    flex-wrap: wrap;
}

.checkbox-label {
    display: flex;
    align-items: center;
    gap: 8px;
    cursor: pointer;
    font-weight: normal;
}

.checkbox-label input[type="checkbox"] {
    width: 18px;
    height: 18px;
}

/* Buttons */
.btn {
    padding: 12px 24px;
    border: none;
    border-radius: 8px;
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
    text-decoration: none;
    display: inline-block;
    transition: all 0.3s ease;
    text-align: center;
}

.btn-primary {
    background: #3498db;
    color: white;
}

.btn-primary:hover {
    background: #2980b9;
    transform: translateY(-2px);
    box-shadow: 0 5px 15px rgba(52, 152, 219, 0.3);
}

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

.btn-secondary:hover {
    background: #5a6268;
    transform: translateY(-2px);
}

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

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

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

/* Tables */
.table-container {
    overflow-x: auto;
    margin: 20px 0;
    border-radius: 10px;
    box-shadow: 0 3px 10px rgba(0,0,0,0.1);
}

.data-table {
    width: 100%;
    border-collapse: collapse;
    background: white;
}

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

.data-table th {
    background: #f8f9fa;
    font-weight: 600;
    color: #2c3e50;
    position: sticky;
    top: 0;
    z-index: 10;
}

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

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

/* Status badges */
.status-badge {
    padding: 4px 12px;
    border-radius: 20px;
    font-size: 12px;
    font-weight: 600;
    text-transform: uppercase;
}

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

.status-validated {
    background: #d1ecf1;
    color: #0c5460;
}

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

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

.status-exhausted {
    background: #ffebee;
    color: #c62828;
}

.status-low {
    background: #fff3e0;
    color: #ef6c00;
}

.status-order {
    background: #e8f5e8;
    color: #2e7d32;
}

.status-confirm {
    background: #e3f2fd;
    color: #1565c0;
}

/* Results info */
.results-section {
    background: white;
    border-radius: 15px;
    overflow: hidden;
    box-shadow: 0 5px 15px rgba(0,0,0,0.1);
}

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

.results-count {
    font-size: 1.1em;
    color: #2c3e50;
}

.total-amount {
    font-size: 1.3em;
    font-weight: bold;
    color: #28a745;
}

/* No data */
.no-data {
    text-align: center;
    padding: 60px 20px;
    color: #666;
}

.no-data h3 {
    margin-bottom: 10px;
    color: #2c3e50;
}

/* Pagination */
.pagination-container {
    padding: 20px;
    text-align: center;
    background: #f8f9fa;
}

.pagination {
    display: inline-flex;
    gap: 5px;
    align-items: center;
}

.page-btn {
    padding: 8px 12px;
    border: 1px solid #dee2e6;
    background: white;
    color: #495057;
    text-decoration: none;
    border-radius: 5px;
    transition: all 0.3s ease;
}

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

.page-btn.active {
    background: #3498db;
    color: white;
    border-color: #3498db;
}

.page-ellipsis {
    padding: 8px 4px;
    color: #6c757d;
}

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

.kpi-card {
    background: white;
    padding: 25px;
    border-radius: 15px;
    box-shadow: 0 5px 15px rgba(0,0,0,0.1);
    display: flex;
    align-items: center;
    gap: 20px;
    transition: transform 0.3s ease;
}

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

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

.kpi-content h3 {
    color: #2c3e50;
    margin-bottom: 5px;
    font-size: 1em;
}

.kpi-value {
    font-size: 2em;
    font-weight: bold;
    color: #3498db;
}

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

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

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

.stat-value {
    font-size: 2em;
    font-weight: bold;
    color: #2c3e50;
}

/* Forms */
.upload-form,
.matching-form,
.settings-form {
    background: white;
    padding: 25px;
    border-radius: 10px;
    box-shadow: 0 3px 10px rgba(0,0,0,0.1);
}

.form-group {
    margin-bottom: 20px;
}

.form-group label {
    display: block;
    margin-bottom: 8px;
    font-weight: 600;
    color: #2c3e50;
}

.form-group input,
.form-group select,
.form-group textarea {
    width: 100%;
    padding: 12px;
    border: 2px solid #e9ecef;
    border-radius: 8px;
    font-size: 14px;
    transition: border-color 0.3s ease;
}

.form-group input:focus,
.form-group select:focus,
.form-group textarea:focus {
    outline: none;
    border-color: #3498db;
    box-shadow: 0 0 0 3px rgba(52, 152, 219, 0.1);
}

.form-group small {
    display: block;
    margin-top: 5px;
    color: #666;
    font-size: 12px;
}

.form-row {
    display: flex;
    gap: 20px;
    flex-wrap: wrap;
}

.form-row .form-group {
    flex: 1;
    min-width: 200px;
}

/* Admin sections */
.admin-sections .section {
    margin-bottom: 30px;
}

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

.info-item {
    display: flex;
    justify-content: space-between;
    padding: 15px;
    background: #f8f9fa;
    border-radius: 8px;
}

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

.status-error {
    color: #dc3545;
}

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

.data-actions {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 20px;
}

.action-group {
    padding: 20px;
    background: #f8f9fa;
    border-radius: 10px;
}

.action-group h4 {
    color: #2c3e50;
    margin-bottom: 10px;
}

.test-results {
    background: #f8f9fa;
    padding: 20px;
    border-radius: 10px;
    margin-top: 15px;
}

/* Charts */
.chart-container {
    margin: 20px 0;
    padding: 20px;
    background: white;
    border-radius: 10px;
    box-shadow: 0 3px 10px rgba(0,0,0,0.1);
}

.stats-overview {
    margin-bottom: 30px;
}

.status-summary {
    margin-top: 20px;
    padding: 20px;
    background: #f8f9fa;
    border-radius: 10px;
}

.status-summary h4 {
    color: #2c3e50;
    margin-bottom: 15px;
}

.status-summary ul {
    list-style: none;
}

.status-summary li {
    padding: 5px 0;
    border-bottom: 1px solid #e9ecef;
}

.evolution.positive {
    color: #28a745;
}

.evolution.negative {
    color: #dc3545;
}

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

/* Mapping des colonnes CSV */
.mapping-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 15px;
    margin: 20px 0;
}

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

.mapping-item label {
    display: block;
    font-weight: 600;
    margin-bottom: 8px;
    color: #495057;
}

.mapping-item select {
    width: 100%;
    padding: 8px 12px;
    border: 1px solid #ced4da;
    border-radius: 4px;
    background: white;
    font-size: 14px;
}

.mapping-item select:focus {
    border-color: #007bff;
    outline: none;
    box-shadow: 0 0 0 2px rgba(0,123,255,0.25);
}

.preview-section {
    margin-top: 20px;
    padding: 15px;
    background: #e9ecef;
    border-radius: 8px;
}

.preview-section h5 {
    margin-bottom: 10px;
    color: #495057;
}

#dataPreview {
    background: white;
    border: 1px solid #dee2e6;
    border-radius: 4px;
    padding: 10px;
    max-height: 200px;
    overflow-y: auto;
    font-family: monospace;
    font-size: 12px;
}

.preview-table {
    width: 100%;
    border-collapse: collapse;
}

.preview-table th,
.preview-table td {
    padding: 5px 8px;
    border: 1px solid #dee2e6;
    text-align: left;
}

.preview-table th {
    background: #f8f9fa;
    font-weight: 600;
}

/* Import options layout */
.import-options {
    display: flex;
    gap: 20px;
    margin-bottom: 20px;
}

.import-option {
    flex: 1;
    padding: 20px;
    border: 2px solid #e0e0e0;
    border-radius: 8px;
    background: #f9f9f9;
}

.import-option.recommended {
    border-color: #28a745;
    background: #f8fff9;
}

.import-option.advanced {
    border-color: #007bff;
    background: #f8f9ff;
}

.import-option h4 {
    margin-top: 0;
    color: #333;
}

.import-option.recommended h4 {
    color: #28a745;
}

.import-option.advanced h4 {
    color: #007bff;
}

.import-option p {
    margin: 0 0 15px 0;
    font-size: 14px;
}

/* Matching parameters styling */
.matching-params {
    background: #f8f9fa;
    padding: 15px;
    border-radius: 6px;
    border: 1px solid #dee2e6;
    margin-top: 10px;
}

.param-group {
    margin-bottom: 15px;
}

.param-group:last-child {
    margin-bottom: 0;
}

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

.param-group input[type="checkbox"] {
    margin-right: 8px;
}

.param-group input[type="date"],
.param-group input[type="number"] {
    width: 100%;
    max-width: 200px;
}

.form-text {
    color: #6c757d;
    font-size: 0.875em;
    margin-top: 3px;
}

/* Responsive */
@media (max-width: 768px) {
    .header-content {
        text-align: center;
    }
    
    .nav-tabs {
        justify-content: center;
        flex-wrap: wrap;
    }
    
    .form-row {
        flex-direction: column;
    }
    
    .table-container {
        overflow-x: auto;
    }
    
    .stats-grid {
        grid-template-columns: 1fr;
    }
    
    .mapping-grid {
        grid-template-columns: 1fr;
    }
    
    .import-options {
        grid-template-columns: 1fr;
    }
}
