/* ===========================
   VARIABLES & RESET
   =========================== */
:root {
    --primary-color: #2E7D32;
    --secondary-color: #1976D2;
    --danger-color: #D32F2F;
    --warning-color: #F57C00;
    --success-color: #388E3C;
    --bg-light: #F5F5F5;
    --bg-white: #FFFFFF;
    --text-dark: #212121;
    --text-light: #757575;
    --border-color: #E0E0E0;
    --shadow-sm: 0 2px 4px rgba(0,0,0,0.1);
    --shadow-md: 0 4px 8px rgba(0,0,0,0.12);
    --shadow-lg: 0 8px 16px rgba(0,0,0,0.15);
    --radius: 8px;
}

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

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen, Ubuntu, Cantarell, sans-serif;
    background-color: var(--bg-light);
    color: var(--text-dark);
    line-height: 1.6;
}

/* ===========================
   CONTAINER & LAYOUT
   =========================== */
.container {
    max-width: 1400px;
    margin: 0 auto;
    padding: 0;
}

/* ===========================
   HEADER
   =========================== */
.header {
    background: linear-gradient(135deg, var(--primary-color) 0%, var(--secondary-color) 100%);
    color: white;
    padding: 40px 20px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    box-shadow: var(--shadow-md);
    margin-bottom: 30px;
}

.header-content h1 {
    font-size: 32px;
    font-weight: 700;
    margin-bottom: 5px;
}

.subtitle {
    font-size: 14px;
    opacity: 0.95;
    font-weight: 500;
}

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

/* ===========================
   BUTTONS
   =========================== */
.btn {
    padding: 12px 24px;
    border: none;
    border-radius: var(--radius);
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    display: inline-flex;
    align-items: center;
    gap: 8px;
}

.btn-primary {
    background-color: var(--primary-color);
    color: white;
}

.btn-primary:hover {
    background-color: #1B5E20;
    box-shadow: var(--shadow-md);
    transform: translateY(-2px);
}

.btn-secondary {
    background-color: var(--secondary-color);
    color: white;
}

.btn-secondary:hover {
    background-color: #1565C0;
    box-shadow: var(--shadow-md);
}

.btn-danger {
    background-color: var(--danger-color);
    color: white;
}

.btn-danger:hover {
    background-color: #B71C1C;
}

.btn-success {
    background-color: var(--success-color);
    color: white;
    font-weight: 600;
}

.btn-success:hover {
    background-color: #2E7D32;
}

.btn-warning {
    background-color: var(--warning-color);
    color: white;
}

.btn-warning:hover {
    background-color: #E65100;
}

.btn-info {
    background-color: #0288D1;
    color: white;
}

.btn-info:hover {
    background-color: #01579B;
}

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

.btn-icon {
    padding: 8px 12px;
    border-radius: 50%;
    width: 40px;
    height: 40px;
    display: flex;
    align-items: center;
    justify-content: center;
}

/* ===========================
   FILTERS & SEARCH
   =========================== */
.filters-section {
    background: white;
    padding: 20px;
    border-radius: var(--radius);
    box-shadow: var(--shadow-sm);
    display: flex;
    gap: 15px;
    margin: 0 20px 30px 20px;
    flex-wrap: wrap;
    align-items: center;
}

.search-input,
.filter-select {
    padding: 10px 15px;
    border: 1px solid var(--border-color);
    border-radius: var(--radius);
    font-size: 14px;
    background-color: var(--bg-white);
    color: var(--text-dark);
    transition: all 0.3s ease;
}

.search-input {
    flex: 1;
    min-width: 200px;
}

.search-input:focus,
.filter-select:focus {
    outline: none;
    border-color: var(--primary-color);
    box-shadow: 0 0 0 3px rgba(46, 125, 50, 0.1);
}

.filter-select {
    min-width: 150px;
    cursor: pointer;
}

/* ===========================
   CABINES GRID
   =========================== */
.cabines-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(350px, 1fr));
    gap: 25px;
    padding: 0 20px 40px 20px;
}

/* ===========================
   CABINE CARD
   =========================== */
.cabine-card {
    background: white;
    border-radius: var(--radius);
    box-shadow: var(--shadow-sm);
    padding: 20px;
    transition: all 0.3s ease;
    border-top: 4px solid var(--primary-color);
    cursor: pointer;
}

.cabine-card:hover {
    box-shadow: var(--shadow-lg);
    transform: translateY(-4px);
}

.cabine-card-header {
    display: flex;
    justify-content: space-between;
    align-items: start;
    margin-bottom: 15px;
}

.cabine-number {
    font-size: 20px;
    font-weight: 700;
    color: var(--primary-color);
}

.cabine-type {
    font-size: 12px;
    color: var(--text-light);
    background-color: var(--bg-light);
    padding: 4px 8px;
    border-radius: 4px;
    margin-top: 5px;
}

.status-badge {
    display: inline-block;
    padding: 6px 12px;
    border-radius: 20px;
    font-size: 12px;
    font-weight: 600;
    text-transform: uppercase;
}

.status-EnCours {
    background-color: #FFF3E0;
    color: var(--warning-color);
}

.status-in-progress {
    background-color: #E3F2FD;
    color: var(--secondary-color);
}

.status-Termine {
    background-color: #E8F5E9;
    color: var(--success-color);
}

.cabine-info {
    margin-bottom: 15px;
    font-size: 13px;
}

.info-item {
    display: flex;
    gap: 8px;
    margin-bottom: 8px;
}

.info-label {
    font-weight: 600;
    color: var(--text-light);
    min-width: 100px;
}

/* ===========================
   PROGRESS BAR
   =========================== */
.progress-container {
    margin-bottom: 15px;
}

.progress-label {
    font-size: 12px;
    font-weight: 600;
    margin-bottom: 8px;
    display: flex;
    justify-content: space-between;
}

.progress-bar {
    width: 100%;
    height: 8px;
    background-color: var(--border-color);
    border-radius: 4px;
    overflow: hidden;
}

.progress-fill {
    height: 100%;
    background: linear-gradient(90deg, var(--primary-color), var(--success-color));
    width: 0%;
    transition: width 0.3s ease;
}

.cabine-card-footer {
    display: flex;
    gap: 10px;
    border-top: 1px solid var(--border-color);
    padding-top: 15px;
}

.cabine-card-footer button {
    flex: 1;
    padding: 10px;
    font-size: 12px;
}

/* ===========================
   MODAL
   =========================== */
.modal {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.5);
    z-index: 1000;
    align-items: center;
    justify-content: center;
    animation: fadeIn 0.3s ease;
}

.modal.active {
    display: flex;
}

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

.modal-content {
    background: white;
    border-radius: var(--radius);
    width: 90%;
    max-width: 500px;
    box-shadow: var(--shadow-lg);
    animation: slideUp 0.3s ease;
}

.modal-content.modal-large {
    max-width: 900px;
}

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

.modal-header {
    padding: 20px;
    border-bottom: 1px solid var(--border-color);
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.modal-header h2 {
    font-size: 20px;
    color: var(--text-dark);
}

.close-btn {
    background: none;
    border: none;
    font-size: 28px;
    cursor: pointer;
    color: var(--text-light);
    transition: color 0.3s ease;
}

.close-btn:hover {
    color: var(--text-dark);
}

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

.modal-footer {
    padding: 20px;
    border-top: 1px solid var(--border-color);
    display: flex;
    gap: 10px;
    justify-content: flex-end;
}

/* ===========================
   FORM
   =========================== */
.form-group {
    margin-bottom: 20px;
}

.form-group label {
    display: block;
    font-weight: 600;
    margin-bottom: 8px;
    color: var(--text-dark);
    font-size: 14px;
}

.form-group input,
.form-group textarea,
.form-group select {
    width: 100%;
    padding: 10px 12px;
    border: 1px solid var(--border-color);
    border-radius: var(--radius);
    font-size: 14px;
    font-family: inherit;
    background-color: var(--bg-white);
    color: var(--text-dark);
    transition: all 0.3s ease;
}

.form-group input:focus,
.form-group textarea:focus,
.form-group select:focus {
    outline: none;
    border-color: var(--primary-color);
    box-shadow: 0 0 0 3px rgba(46, 125, 50, 0.1);
}

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

/* ===========================
   CHECKLIST
   =========================== */
.checklist-section {
    margin-bottom: 30px;
}

.checklist-title {
    font-size: 16px;
    font-weight: 700;
    margin-bottom: 15px;
    color: var(--primary-color);
    display: flex;
    align-items: center;
    gap: 8px;
}

.task-item {
    display: flex;
    align-items: flex-start;
    gap: 12px;
    padding: 12px;
    background-color: var(--bg-light);
    border-radius: var(--radius);
    margin-bottom: 10px;
    border-left: 3px solid var(--border-color);
    transition: all 0.3s ease;
}

.task-item.Terminee {
    background-color: #E8F5E9;
    border-left-color: var(--success-color);
}

.task-item.in-progress {
    background-color: #E3F2FD;
    border-left-color: var(--secondary-color);
}

.task-checkbox {
    width: 20px;
    height: 20px;
    margin-top: 2px;
    cursor: pointer;
    accent-color: var(--primary-color);
}

.task-content {
    flex: 1;
}

.task-name {
    font-weight: 600;
    color: var(--text-dark);
    margin-bottom: 5px;
}

.task-meta {
    font-size: 12px;
    color: var(--text-light);
    display: flex;
    gap: 15px;
    flex-wrap: wrap;
}

.task-meta span {
    display: flex;
    align-items: center;
    gap: 4px;
}

.task-actions {
    display: flex;
    gap: 8px;
}

/* ===========================
   PHOTO UPLOAD
   =========================== */
.photo-upload {
    margin-top: 10px;
}

.photo-upload label {
    display: flex;
    align-items: center;
    gap: 8px;
    cursor: pointer;
    font-size: 13px;
    color: var(--secondary-color);
    font-weight: 600;
}

.photo-upload input[type="file"] {
    display: none;
}

.photo-preview {
    margin-top: 10px;
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(80px, 1fr));
    gap: 10px;
}

.photo-item {
    position: relative;
    border-radius: var(--radius);
    overflow: hidden;
}

.photo-item img {
    width: 100%;
    height: 80px;
    object-fit: cover;
}

.photo-delete {
    position: absolute;
    top: 4px;
    right: 4px;
    background: var(--danger-color);
    color: white;
    border: none;
    border-radius: 50%;
    width: 24px;
    height: 24px;
    cursor: pointer;
    font-size: 16px;
    display: flex;
    align-items: center;
    justify-content: center;
}

/* ===========================
   TIMELINE / HISTORIQUE
   =========================== */
.timeline {
    position: relative;
    padding: 20px 0;
}

.timeline-item {
    display: flex;
    gap: 20px;
    margin-bottom: 30px;
    padding-bottom: 20px;
    border-bottom: 1px solid var(--border-color);
}

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

.timeline-dot {
    width: 12px;
    height: 12px;
    border-radius: 50%;
    background-color: var(--success-color);
    margin-top: 8px;
    flex-shrink: 0;
}

.timeline-content {
    flex: 1;
}

.timeline-time {
    font-size: 12px;
    color: var(--text-light);
    font-weight: 600;
}

.timeline-title {
    font-weight: 700;
    color: var(--text-dark);
    margin-bottom: 5px;
}

.timeline-description {
    font-size: 13px;
    color: var(--text-light);
}

/* ===========================
   ALERT / BADGE
   =========================== */
.alert {
    padding: 15px;
    border-radius: var(--radius);
    margin-bottom: 15px;
    border-left: 4px solid;
}

.alert-warning {
    background-color: #FFF3E0;
    border-left-color: var(--warning-color);
    color: #E65100;
}

.alert-success {
    background-color: #E8F5E9;
    border-left-color: var(--success-color);
    color: #1B5E20;
}

.alert-danger {
    background-color: #FFEBEE;
    border-left-color: var(--danger-color);
    color: #B71C1C;
}

/* ===========================
   INCIDENTS
   =========================== */
.incident-item {
    background-color: #FFF3E0;
    border-left: 4px solid var(--warning-color);
    padding: 15px;
    margin-bottom: 15px;
    border-radius: var(--radius);
}

.incident-header {
    display: flex;
    justify-content: space-between;
    align-items: start;
    margin-bottom: 10px;
}

.incident-time {
    font-size: 12px;
    color: var(--text-light);
    font-weight: 600;
}

.incident-description {
    font-size: 14px;
    color: var(--text-dark);
    margin-bottom: 8px;
}

.incident-reporter {
    font-size: 12px;
    color: var(--text-light);
}

/* ===========================
   STATS
   =========================== */
.stats-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
    gap: 15px;
    margin-bottom: 30px;
}

.stat-card {
    background: white;
    padding: 15px;
    border-radius: var(--radius);
    box-shadow: var(--shadow-sm);
    text-align: center;
}

.stat-number {
    font-size: 24px;
    font-weight: 700;
    color: var(--primary-color);
}

.stat-label {
    font-size: 12px;
    color: var(--text-light);
    margin-top: 5px;
    text-transform: uppercase;
}
.btn-disabled {
    opacity: 0.5;
    cursor: not-allowed;
}
/* ===========================
   RESPONSIVE
   =========================== */
@media (max-width: 768px) {
    .header {
        flex-direction: column;
        gap: 20px;
        text-align: center;
        padding: 25px 20px;
    }

    .header h1 {
        font-size: 24px;
    }

    .header-actions {
        width: 100%;
        flex-direction: column;
    }

    .header-actions button {
        width: 100%;
    }

    .filters-section {
        flex-direction: column;
    }

    .search-input,
    .filter-select {
        width: 100%;
    }

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

    .modal-content {
        width: 95%;
        max-width: 100%;
    }

    .modal-content.modal-large {
        max-width: 100%;
    }

    .modal-body {
        max-height: 80vh;
    }

    .stats-grid {
        grid-template-columns: repeat(2, 1fr);
    }
}

@media (max-width: 480px) {
    .cabine-card-header {
        flex-direction: column;
    }

    .status-badge {
        margin-top: 10px;
    }

    .task-meta {
        flex-direction: column;
    }

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