/* GeoGenie Chantier Pro - Styles */

:root {
    --primary-color: #2563eb;
    --primary-dark: #1e40af;
    --secondary-color: #64748b;
    --success-color: #10b981;
    --danger-color: #ef4444;
    --warning-color: #f59e0b;
    --bg-color: #f8fafc;
    --card-bg: #ffffff;
    --border-color: #e2e8f0;
    --text-primary: #1e293b;
    --text-secondary: #64748b;
    --shadow: 0 1px 3px rgba(0,0,0,0.1);
    --shadow-lg: 0 10px 15px -3px rgba(0,0,0,0.1);
}

* {
    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-color);
    color: var(--text-primary);
    line-height: 1.6;
}

/* Reset button and link styles */
button, a {
    font-family: inherit;
    font-size: inherit;
    line-height: inherit;
}

/* Heading styles */
h1, h2, h3, h4, h5, h6 {
    font-family: inherit;
    font-weight: 600;
    line-height: 1.2;
    margin: 0.5rem 0;
}

h1 {
    font-size: 2rem;
}

h2 {
    font-size: 1.5rem;
}

h3 {
    font-size: 1.25rem;
}

/* Header */
.app-header {
    background: linear-gradient(135deg, var(--primary-color), var(--primary-dark));
    color: white;
    padding: 1rem;
    box-shadow: var(--shadow-lg);
    position: sticky;
    top: 0;
    z-index: 100;
}

.header-content {
    max-width: 1200px;
    margin: 0 auto;
    display: flex;
    align-items: center;
    gap: 1rem;
}

.logo {
    height: 50px;
    width: auto;
    background: white;
    padding: 0.25rem;
    border-radius: 8px;
}

.header-logo-title {
    display: flex;
    align-items: center;
    gap: 0.75rem;
}

.header-logo {
    height: 45px;
    width: auto;
    background: white;
    padding: 4px;
    border-radius: 8px;
}

.app-header h1 {
    font-size: 1.5rem;
    flex: 1;
}

.sync-btn {
    background: rgba(255,255,255,0.2);
    border: 1px solid rgba(255,255,255,0.3);
    color: white;
    padding: 0.5rem 1rem;
    border-radius: 8px;
    cursor: pointer;
    display: flex;
    align-items: center;
    gap: 0.5rem;
    font-size: 0.9rem;
    transition: all 0.3s;
}

.sync-btn:hover {
    background: rgba(255,255,255,0.3);
}

.sync-icon {
    font-size: 1.2rem;
}

.sync-status {
    font-size: 0.85rem;
}

/* Navigation */
.main-nav {
    background: var(--card-bg);
    border-bottom: 1px solid var(--border-color);
    display: flex;
    justify-content: flex-start;
    padding: 0.5rem;
    position: sticky;
    top: 82px;
    z-index: 100;
    box-shadow: var(--shadow);
    overflow: visible;
    gap: 0.5rem;
}

.main-nav::-webkit-scrollbar {
    height: 4px;
}
.main-nav::-webkit-scrollbar-thumb {
    background: var(--border-color);
    border-radius: 4px;
}

/* Navigation menu for external pages */
.nav-menu {
    background: var(--card-bg);
    border-bottom: 1px solid var(--border-color);
    display: flex;
    justify-content: flex-start;
    padding: 0.5rem;
    position: sticky;
    top: 82px;
    z-index: 90;
    box-shadow: var(--shadow);
    overflow-x: auto;
    overflow-y: hidden;
    -webkit-overflow-scrolling: touch;
    gap: 0.5rem;
}

.nav-menu::-webkit-scrollbar {
    height: 4px;
}

.nav-menu::-webkit-scrollbar-thumb {
    background: var(--border-color);
    border-radius: 4px;
}

.nav-btn {
    background: none;
    border: none;
    padding: 0.75rem 1rem;
    cursor: pointer;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 0.25rem;
    color: var(--text-secondary);
    transition: all 0.3s;
    border-radius: 8px;
    flex-shrink: 0;
    min-width: 80px;
    white-space: nowrap;
    text-decoration: none;
    font-size: inherit;
}

.nav-btn:hover {
    background: var(--bg-color);
    color: var(--primary-color);
    transform: translateY(-2px);
}

/* ==========================================
   MODERN NAVIGATION WITH DROPDOWNS
   ========================================== */

.modern-nav {
    display: flex;
    align-items: center;
    gap: 0.25rem;
    padding: 0.5rem 1rem;
    background: linear-gradient(to bottom, #ffffff, #f8fafc);
    overflow: visible;
}

@media (max-width: 768px) {
    .main-nav.modern-nav {
        overflow-x: auto !important;
        overflow-y: visible !important;
        -webkit-overflow-scrolling: touch;
        padding: 0.5rem;
    }
}

.nav-dropdown {
    position: relative;
    display: inline-block;
}

.dropdown-toggle {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    flex-direction: row;
    min-width: auto;
}

.dropdown-menu {
    display: none;
    position: absolute;
    top: 100%;
    left: 0;
    min-width: 240px;
    background: white;
    border-radius: 12px;
    box-shadow: 0 10px 40px rgba(0,0,0,0.15);
    border: 1px solid var(--border-color);
    padding: 0.5rem 0;
    z-index: 10001;
    opacity: 0;
    transform: translateY(-10px);
    transition: opacity 0.2s ease, transform 0.2s ease;
}

.dropdown-menu-right {
    left: auto;
    right: 0;
}

.nav-dropdown.open .dropdown-menu {
    display: block !important;
    opacity: 1 !important;
    transform: translateY(0) !important;
    visibility: visible !important;
    position: fixed !important;
    max-height: 70vh;
    overflow-y: auto;
}

/* Sur mobile, ajustements supplémentaires */
@media (max-width: 768px) {
    .nav-dropdown.open .dropdown-menu {
        max-height: 50vh;
        -webkit-overflow-scrolling: touch;
        overscroll-behavior: contain;
        touch-action: pan-y;
    }
    
    /* Bloquer le scroll de la page quand on touche le menu */
    .nav-dropdown.open .dropdown-item {
        touch-action: manipulation;
    }
}

/* Menu s'ouvre uniquement avec la classe .open (via clic) */

.dropdown-item {
    display: block;
    width: 100%;
    padding: 0.75rem 1rem;
    text-align: left;
    background: none;
    border: none;
    color: var(--text-primary);
    cursor: pointer;
    transition: all 0.2s ease;
    font-size: 0.9rem;
}

.dropdown-item:hover {
    background: linear-gradient(to right, var(--primary-color), var(--primary-dark));
    color: white;
    padding-left: 1.5rem;
}

.dropdown-divider {
    height: 1px;
    background: var(--border-color);
    margin: 0.5rem 0;
}

/* ==========================================
   DASHBOARD CARDS
   ========================================== */

.dashboard-container {
    padding: 1.5rem;
    max-width: 1400px;
    margin: 0 auto;
}

.dashboard-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 2rem;
}

.dashboard-greeting h2 {
    font-size: 1.75rem;
    color: var(--text-primary);
    margin-bottom: 0.25rem;
}

.dashboard-greeting p {
    color: var(--text-secondary);
}

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

.stat-card {
    background: white;
    border-radius: 16px;
    padding: 1.5rem;
    box-shadow: 0 4px 20px rgba(0,0,0,0.08);
    display: flex;
    align-items: center;
    gap: 1rem;
    transition: all 0.3s ease;
    border: 1px solid transparent;
}

.stat-card:hover {
    transform: translateY(-4px);
    box-shadow: 0 8px 30px rgba(0,0,0,0.12);
    border-color: var(--primary-color);
}

.stat-icon {
    width: 56px;
    height: 56px;
    border-radius: 14px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.75rem;
}

.stat-icon.blue { background: linear-gradient(135deg, #3b82f6, #2563eb); }
.stat-icon.orange { background: linear-gradient(135deg, #f97316, #ea580c); }
.stat-icon.green { background: linear-gradient(135deg, #22c55e, #16a34a); }
.stat-icon.purple { background: linear-gradient(135deg, #a855f7, #9333ea); }
.stat-icon.red { background: linear-gradient(135deg, #ef4444, #dc2626); }

.stat-content h3 {
    font-size: 1.75rem;
    font-weight: 700;
    color: var(--text-primary);
    line-height: 1;
}

.stat-content p {
    font-size: 0.85rem;
    color: var(--text-secondary);
    margin-top: 0.25rem;
}

/* Quick Actions */
.quick-actions {
    margin-bottom: 2rem;
}

.quick-actions h3 {
    font-size: 1.1rem;
    color: var(--text-secondary);
    margin-bottom: 1rem;
}

.quick-actions-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
    gap: 1rem;
}

.quick-action-btn {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding: 1rem 1.25rem;
    background: white;
    border: 2px solid var(--border-color);
    border-radius: 12px;
    cursor: pointer;
    transition: all 0.3s ease;
    font-size: 0.95rem;
    color: var(--text-primary);
}

.quick-action-btn:hover {
    border-color: var(--primary-color);
    background: linear-gradient(135deg, #eff6ff, #dbeafe);
    transform: translateY(-2px);
}

.quick-action-btn span:first-child {
    font-size: 1.5rem;
}

/* Alerts Section */
.alerts-section {
    background: white;
    border-radius: 16px;
    padding: 1.5rem;
    box-shadow: 0 4px 20px rgba(0,0,0,0.08);
}

.alerts-section h3 {
    font-size: 1.1rem;
    color: var(--text-primary);
    margin-bottom: 1rem;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.alert-item {
    display: flex;
    align-items: center;
    gap: 1rem;
    padding: 0.75rem;
    border-radius: 8px;
    margin-bottom: 0.5rem;
    background: #fef3c7;
    border-left: 4px solid #f59e0b;
}

.alert-item.danger {
    background: #fee2e2;
    border-left-color: #ef4444;
}

.alert-item.info {
    background: #dbeafe;
    border-left-color: #3b82f6;
}

/* ==========================================
   EQUIPMENTS PAGE - UNIFIED VIEW
   ========================================== */

.equipements-container {
    padding: 1.5rem;
    max-width: 1400px;
    margin: 0 auto;
}

.equipements-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 1.5rem;
    flex-wrap: wrap;
    gap: 0.5rem;
}

.equipements-header h2 {
    flex-shrink: 0;
}

.equipements-header > div {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    flex: 1;
    justify-content: flex-end;
    min-width: 0;
}

.equipements-header .local-search-input {
    flex: 1;
    min-width: 120px;
    max-width: 300px;
}

@media (max-width: 480px) {
    .equipements-header {
        flex-direction: row;
        flex-wrap: nowrap;
    }
    
    .equipements-header h2 {
        font-size: 1.1rem;
        flex: 0 0 auto;
    }
    
    .equipements-header .local-search-input {
        max-width: 140px;
        min-width: 100px;
        font-size: 0.8rem;
        padding: 0.4rem 0.6rem;
    }
}

.equipements-tabs {
    display: flex;
    gap: 0.5rem;
    margin-bottom: 1.5rem;
    flex-wrap: wrap;
}

.equip-tab {
    display: flex;
    flex-direction: column;
    align-items: center;
    padding: 1rem 1.5rem;
    background: white;
    border: 2px solid var(--border-color);
    border-radius: 12px;
    cursor: pointer;
    transition: all 0.3s ease;
    min-width: 100px;
}

.equip-tab:hover {
    border-color: var(--primary-color);
    transform: translateY(-2px);
}

.equip-tab.active {
    background: linear-gradient(135deg, var(--primary-color), var(--primary-dark));
    color: white;
    border-color: transparent;
}

.equip-tab-icon {
    font-size: 1.75rem;
    margin-bottom: 0.25rem;
}

.equip-tab-count {
    font-size: 1.25rem;
    font-weight: 700;
}

.equip-tab-label {
    font-size: 0.8rem;
    opacity: 0.9;
}

.equipements-summary {
    display: flex;
    gap: 1rem;
    margin-bottom: 1.5rem;
    flex-wrap: wrap;
}

.summary-badge {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.5rem 1rem;
    background: white;
    border-radius: 20px;
    font-size: 0.85rem;
    box-shadow: 0 2px 8px rgba(0,0,0,0.08);
}

/* ==========================================
   ANIMATIONS & TRANSITIONS
   ========================================== */

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

@keyframes slideIn {
    from { opacity: 0; transform: translateX(-20px); }
    to { opacity: 1; transform: translateX(0); }
}

/* Animations désactivées pour éviter le clignotement */
.page-transition {
    /* animation: fadeIn 0.3s ease-out; */
}

.card-animation {
    /* animation: slideIn 0.4s ease-out; */
}

/* Button hover effects */
.btn {
    transition: all 0.3s ease;
}

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

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

/* Cards hover effect */
.card, .form-section, .materiau-section {
    transition: all 0.3s ease;
}

.card:hover, .form-section:hover {
    box-shadow: 0 8px 30px rgba(0,0,0,0.1);
}

.nav-btn.active {
    color: var(--primary-color);
    background: var(--bg-color);
    font-weight: 600;
}

/* Navigation links for external pages */
.nav-link {
    background: none;
    border: none;
    padding: 0.75rem 1rem;
    cursor: pointer;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 0.25rem;
    color: var(--text-secondary);
    transition: all 0.3s;
    border-radius: 8px;
    flex-shrink: 0;
    min-width: 80px;
    white-space: nowrap;
    text-decoration: none;
    font-size: inherit;
}

.nav-link:hover {
    background: var(--bg-color);
    color: var(--primary-color);
}

.nav-link.active {
    color: var(--primary-color);
    background: var(--bg-color);
    font-weight: 600;
}

.nav-icon {
    font-size: 1.5rem;
}

.nav-label {
    font-size: 0.85rem;
}

/* Main Content */
.main-content {
    max-width: 1200px;
    margin: 0 auto;
    padding: 1.5rem;
}

.page {
    display: none;
}

.page.active {
    display: block;
}

.page-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 1.5rem;
}

.page-header h2 {
    color: var(--text-primary);
}

/* Buttons */
.btn {
    padding: 0.75rem 1.5rem;
    border: none;
    border-radius: 8px;
    cursor: pointer;
    font-size: 1rem;
    font-weight: 500;
    transition: all 0.3s;
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
}

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

.btn-primary:hover {
    background: var(--primary-dark);
    transform: translateY(-2px);
    box-shadow: var(--shadow-lg);
}

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

.btn-secondary:hover {
    background: #475569;
}

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

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

/* Gestion Grid */
.gestion-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(250px, 1fr));
    gap: 1.5rem;
}

.gestion-card {
    background: var(--card-bg);
    border: 1px solid var(--border-color);
    border-radius: 12px;
    padding: 1.5rem;
    text-align: center;
    transition: all 0.3s;
    cursor: pointer;
}

.gestion-card:hover {
    transform: translateY(-4px);
    box-shadow: var(--shadow-lg);
    border-color: var(--primary-color);
}

.card-icon {
    font-size: 3rem;
    margin-bottom: 1rem;
}

.gestion-card h3 {
    font-size: 1.25rem;
    margin-bottom: 0.5rem;
    color: var(--text-primary);
}

.card-count {
    color: var(--text-secondary);
    margin-bottom: 1rem;
    font-size: 0.9rem;
}

/* Empty State */
.empty-state {
    text-align: center;
    padding: 3rem 1rem;
    color: var(--text-secondary);
}

.empty-state p {
    font-size: 1.1rem;
}

/* Rapports List */
.rapports-list {
    display: grid;
    gap: 1rem;
}

.rapport-card {
    background: var(--card-bg);
    border: 1px solid var(--border-color);
    border-radius: 12px;
    padding: 1.5rem;
    cursor: pointer;
    transition: all 0.3s;
}

.rapport-card:hover {
    box-shadow: var(--shadow-lg);
    border-color: var(--primary-color);
}

.rapport-header {
    display: flex;
    justify-content: space-between;
    align-items: start;
    margin-bottom: 1rem;
}

.rapport-date {
    font-size: 1.25rem;
    font-weight: 600;
    color: var(--primary-color);
}

.rapport-status {
    padding: 0.25rem 0.75rem;
    border-radius: 20px;
    font-size: 0.85rem;
    font-weight: 500;
}

.status-draft {
    background: #fef3c7;
    color: #92400e;
}

.status-completed {
    background: #d1fae5;
    color: #065f46;
}

.rapport-info {
    display: grid;
    gap: 0.5rem;
    color: var(--text-secondary);
    font-size: 0.95rem;
}

/* Filters */
.filters {
    display: flex;
    gap: 1rem;
    margin-bottom: 1.5rem;
    flex-wrap: wrap;
}

.filter-input {
    padding: 0.75rem;
    border: 1px solid var(--border-color);
    border-radius: 8px;
    font-size: 1rem;
    flex: 1;
    min-width: 200px;
}

/* Consultation Tabs */
.consultation-tabs {
    display: flex;
    gap: 0.5rem;
    margin-bottom: 1.5rem;
    border-bottom: 2px solid var(--border-color);
}

.tab-btn {
    background: none;
    border: none;
    padding: 1rem 1.5rem;
    cursor: pointer;
    font-size: 1rem;
    color: var(--text-secondary);
    border-bottom: 3px solid transparent;
    transition: all 0.3s;
}

.tab-btn:hover {
    color: var(--primary-color);
}

.tab-btn.active {
    color: var(--primary-color);
    border-bottom-color: var(--primary-color);
    font-weight: 600;
}

/* Modal */
.modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0,0,0,0.5);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 1000;
    padding: 1rem;
}

.modal {
    background: var(--card-bg);
    border-radius: 12px;
    max-width: 800px;
    width: 100%;
    max-height: 90vh;
    overflow-y: auto;
    box-shadow: 0 25px 50px -12px rgba(0,0,0,0.25);
}

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

.modal-title {
    font-size: 1.5rem;
    font-weight: 600;
}

.modal-close {
    background: transparent;
    border: none;
    font-size: 1.5rem;
    cursor: pointer;
    color: #666;
    width: 32px;
    height: 32px;
    min-width: 32px;
    min-height: 32px;
    transition: all 0.2s;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    line-height: 1;
}

.modal-close:hover {
    color: #333;
    transform: scale(1.1);
}

.modal-body {
    padding: 1.5rem;
}

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

/* Form */
.form-group {
    margin-bottom: 1.5rem;
}

.form-label {
    display: block;
    margin-bottom: 0.5rem;
    font-weight: 500;
    color: var(--text-primary);
}

.form-input,
.form-select,
.form-textarea {
    width: 100%;
    padding: 0.75rem;
    border: 1px solid var(--border-color);
    border-radius: 8px;
    font-size: 1rem;
    font-family: inherit;
    transition: all 0.3s;
    color: var(--text-primary);
    background-color: var(--card-bg);
    min-height: 2.5rem;
    appearance: none;
}

.form-input:focus,
.form-select:focus,
.form-textarea:focus {
    outline: none;
    border-color: var(--primary-color);
    box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.1);
}

select {
    height: auto;
    line-height: 1.5;
}

input[type="number"],
input[type="text"],
input[type="date"] {
    height: auto;
    line-height: 1.5;
}

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

.form-row {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 1rem;
}

@media (max-width: 600px) {
    .form-row {
        grid-template-columns: 1fr;
    }
}

/* Badge */
.badge {
    display: inline-block;
    padding: 0.25rem 0.75rem;
    border-radius: 20px;
    font-size: 0.85rem;
    font-weight: 500;
}

.badge-societe {
    background: #dbeafe;
    color: #1e40af;
}

.badge-location {
    background: #fef3c7;
    color: #92400e;
}

.badge-interim {
    background: #fce7f3;
    color: #9f1239;
}

/* Responsive */
@media (max-width: 768px) {
    .app-header {
        padding: 0.75rem;
        width: 100%;
        max-width: 100vw;
        overflow-x: hidden;
    }
    
    .header-content {
        flex-wrap: wrap;
        width: 100%;
        max-width: 100%;
    }
    
    .app-header h1 {
        font-size: 1.2rem;
        flex: 1;
        min-width: 0;
        overflow: hidden;
        text-overflow: ellipsis;
        white-space: nowrap;
    }
    
    .logo {
        height: 40px;
    }
    
    .main-nav {
        top: 70px;
        padding: 0.25rem;
        width: 100%;
        max-width: 100vw;
        overflow-x: auto;
        overflow-y: visible;
        -webkit-overflow-scrolling: touch;
    }
    
    .nav-btn {
        padding: 0.5rem 0.75rem;
        min-width: 70px;
    }
    
    .nav-label {
        font-size: 0.7rem;
    }
    
    .nav-icon {
        font-size: 1.2rem;
    }
    
    .main-content,
    #content {
        padding: 0.75rem;
        width: 100%;
        max-width: 100vw;
        overflow-x: hidden;
    }
    
    .page-header {
        flex-direction: column;
        align-items: stretch;
        gap: 1rem;
    }
    
    .gestion-grid {
        grid-template-columns: repeat(auto-fill, minmax(150px, 1fr));
    }
    
    .filters {
        flex-direction: column;
    }
    
    .filter-input {
        min-width: 100%;
    }
    
    .consultation-tabs {
        overflow-x: auto;
    }
    
    .tab-btn {
        white-space: nowrap;
    }
}

/* Animations */
@keyframes fadeIn {
    from {
        opacity: 0;
        transform: translateY(10px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.fade-in {
    animation: fadeIn 0.3s ease-out;
}

@keyframes spin {
    from {
        transform: rotate(0deg);
    }
    to {
        transform: rotate(360deg);
    }
}

.spinning {
    animation: spin 1s linear infinite;
}


/* Form Sections */
.form-section {
    margin-bottom: 2rem;
    padding: 1.5rem;
    background: var(--bg-color);
    border-radius: 8px;
    border: 1px solid var(--border-color);
}

.form-section-title {
    font-size: 1.1rem;
    color: var(--primary-color);
    margin-bottom: 1rem;
    padding-bottom: 0.5rem;
    border-bottom: 2px solid var(--primary-color);
}

.form-section .form-row:last-child {
    margin-bottom: 0;
}

/* Login Screen */
.login-overlay {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: linear-gradient(135deg, var(--primary-color), var(--primary-dark));
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 10000;
}

.login-container {
    background: white;
    border-radius: 16px;
    padding: 2rem;
    width: 90%;
    max-width: 400px;
    box-shadow: 0 20px 60px rgba(0,0,0,0.3);
}

.login-header {
    text-align: center;
    margin-bottom: 2rem;
}

.login-logo {
    width: 55vw;
    max-width: 220px;
    height: auto;
    margin-bottom: 0.5rem;
    background: white;
    padding: 10px;
    border-radius: 14px;
    box-shadow: 0 10px 30px rgba(0,0,0,0.3);
}

.login-header h1 {
    font-size: 1.5rem;
    color: var(--primary-color);
    margin-bottom: 0.5rem;
}

.login-header p {
    color: var(--text-secondary);
    font-size: 0.9rem;
}

.login-form .form-group {
    margin-bottom: 1.5rem;
}

.login-form label {
    display: block;
    margin-bottom: 0.5rem;
    color: var(--text-primary);
    font-weight: 500;
}

.login-form input {
    width: 100%;
    padding: 0.75rem;
    border: 2px solid var(--border-color);
    border-radius: 8px;
    font-size: 1rem;
    transition: border-color 0.3s;
}

.login-form input:focus {
    outline: none;
    border-color: var(--primary-color);
}

.login-error {
    background: #fee;
    color: var(--danger-color);
    padding: 0.75rem;
    border-radius: 8px;
    margin-bottom: 1rem;
    font-size: 0.9rem;
}

.btn-login {
    width: 100%;
    padding: 1rem;
    font-size: 1rem;
    font-weight: 600;
}

/* Logout Button */
.logout-btn {
    background: rgba(255, 255, 255, 0.2);
    color: white;
    border: 1px solid rgba(255, 255, 255, 0.3);
    padding: 0.5rem 1rem;
    border-radius: 8px;
    cursor: pointer;
    font-size: 0.9rem;
    transition: all 0.3s;
    margin-left: auto;
}

.logout-btn:hover {
    background: rgba(255, 255, 255, 0.3);
    transform: translateY(-1px);
}

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

/* Styles pour les nouvelles sections */
.page {
    display: none;
}

.page.active {
    display: block;
}

/* Styles pour Stock, Métré, Plans, Réunions, Notes */
#page-stock, #page-metre, #page-plans, #page-reunions, #page-notes {
    padding: 20px;
}

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

.section-header h2 {
    margin: 0;
}

.item-list {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
    gap: 20px;
}

.item-card {
    background-color: #fff;
    border-radius: 8px;
    padding: 15px;
    box-shadow: 0 2px 4px rgba(0,0,0,0.1);
}

.item-card h3 {
    margin-top: 0;
}



/* Notifications */
.notification {
    position: fixed;
    top: 20px;
    right: 20px;
    background: white;
    padding: 1rem 1.5rem;
    border-radius: 8px;
    box-shadow: var(--shadow-lg);
    z-index: 10000;
    transform: translateX(400px);
    transition: transform 0.3s ease-out;
    max-width: 300px;
}

.notification.show {
    transform: translateX(0);
}

.notification-info {
    border-left: 4px solid var(--primary-color);
}

.notification-success {
    border-left: 4px solid var(--success-color);
}

.notification-error {
    border-left: 4px solid var(--danger-color);
}

.notification-warning {
    border-left: 4px solid var(--warning-color);
}

/* Modal Confirm */
.modal-confirm {
    max-width: 400px;
}

.modal-confirm .modal-body {
    padding: 2rem;
    text-align: center;
}

.modal-confirm .modal-body p {
    font-size: 1.1rem;
    margin: 0;
}

/* Items List */
.items-list {
    display: flex;
    flex-direction: column;
    gap: 1rem;
    max-height: 60vh;
    overflow-y: auto;
}

.item-card {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 1rem;
    background: var(--bg-color);
    border: 1px solid var(--border-color);
    border-radius: 8px;
    transition: all 0.3s;
}

.item-card:hover {
    box-shadow: var(--shadow);
    border-color: var(--primary-color);
}

.item-card-content h4 {
    margin: 0 0 0.25rem 0;
    color: var(--text-primary);
}

.item-card-content p {
    margin: 0;
    color: var(--text-secondary);
    font-size: 0.9rem;
}

.item-card-actions {
    display: flex;
    gap: 0.5rem;
}

.btn-sm {
    padding: 0.5rem 1rem;
    font-size: 0.9rem;
}

/* Modal Large */
.modal-large {
    max-width: 1000px;
}

/* Rapport Container */
.rapport-container {
    max-width: 1200px;
    margin: 0 auto;
}

.rapport-header-section {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 2rem;
    padding-bottom: 1rem;
    border-bottom: 2px solid var(--border-color);
}

.rapport-header-section h2 {
    margin: 0;
}

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

.rapport-infos-generales,
.rapport-chantiers-section,
.rapport-camions-generaux,
.rapport-recapitulatif,
.rapport-observations,
.rapport-documents-section,
.rapport-signature {
    background: var(--card-bg);
    border: 1px solid var(--border-color);
    border-radius: 12px;
    padding: 1.5rem;
    margin-bottom: 1.5rem;
}

.rapport-infos-generales h3,
.rapport-chantiers-section h3,
.rapport-camions-generaux h3,
.rapport-recapitulatif h3,
.rapport-observations h3,
.rapport-documents-section h3,
.rapport-signature h3 {
    margin: 0 0 1rem 0;
    color: var(--primary-color);
    font-size: 1.25rem;
}

/* Documents scannés section */
.documents-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(180px, 1fr));
    gap: 1rem;
}

.document-card {
    background: var(--bg-color);
    border: 1px solid var(--border-color);
    border-radius: 10px;
    overflow: hidden;
    transition: transform 0.2s, box-shadow 0.2s;
}

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

.document-preview {
    position: relative;
    aspect-ratio: 4/3;
    cursor: pointer;
    overflow: hidden;
    background: #f1f5f9;
}

.document-preview img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.3s;
}

.document-preview:hover img {
    transform: scale(1.05);
}

.document-overlay {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.4);
    display: flex;
    align-items: center;
    justify-content: center;
    opacity: 0;
    transition: opacity 0.2s;
}

.document-preview:hover .document-overlay {
    opacity: 1;
}

.zoom-icon {
    font-size: 2rem;
    color: white;
}

.document-info {
    padding: 0.75rem;
    display: flex;
    flex-direction: column;
    gap: 0.25rem;
}

.document-type {
    font-weight: 600;
    color: var(--primary-color);
    font-size: 0.85rem;
}

.document-camion {
    font-size: 0.8rem;
    color: var(--text-secondary);
}

.document-materiau {
    font-size: 0.75rem;
    color: var(--text-secondary);
    font-style: italic;
}

.document-date {
    font-size: 0.7rem;
    color: var(--text-secondary);
}

.documents-empty,
.documents-error,
.documents-loading {
    grid-column: 1 / -1;
    text-align: center;
    padding: 2rem;
    color: var(--text-secondary);
    font-style: italic;
}

.documents-error {
    color: var(--danger-color);
}

/* Chantier Card */
.chantier-card {
    background: var(--bg-color);
    border: 1px solid var(--border-color);
    border-radius: 8px;
    padding: 1.5rem;
    margin-bottom: 1rem;
}

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

.chantier-header h4 {
    margin: 0;
    color: var(--text-primary);
}

.chantier-taches {
    margin-bottom: 1.5rem;
}

.chantier-taches h5 {
    margin: 0 0 1rem 0;
    color: var(--text-secondary);
}

.chantier-recapitulatif h5 {
    margin: 0 0 1rem 0;
    color: var(--text-secondary);
}

/* Tache Card */
.tache-card {
    background: white;
    border: 1px solid var(--border-color);
    border-radius: 8px;
    padding: 1rem;
    margin-bottom: 1rem;
}

.tache-header {
    display: flex;
    justify-content: space-between;
    align-items: start;
    margin-bottom: 1rem;
}

.tache-header h6 {
    margin: 0 0 0.5rem 0;
    font-size: 1.2rem;
    font-weight: 700;
    color: var(--primary-color);
    background: linear-gradient(135deg, #e3f2fd 0%, #bbdefb 100%);
    padding: 0.5rem 1rem;
    border-radius: 6px;
    border-left: 4px solid var(--primary-color);
}

.tache-sections {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
    margin-bottom: 1rem;
}

.tache-recap {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
    gap: 1rem;
    padding: 1rem;
    background: var(--bg-color);
    border-radius: 8px;
}

.recap-item {
    display: flex;
    flex-direction: column;
    gap: 0.25rem;
}

.recap-item span {
    color: var(--text-secondary);
    font-size: 0.9rem;
}

.recap-item strong {
    font-size: 1.1rem;
    color: var(--text-primary);
}

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

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

.recap-item-large {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
    padding: 1.5rem;
    background: var(--bg-color);
    border-radius: 8px;
    border: 1px solid var(--border-color);
}

.recap-item-large span {
    color: var(--text-secondary);
    font-size: 1rem;
}

.recap-item-large strong {
    font-size: 1.5rem;
    color: var(--text-primary);
}

.text-large {
    font-size: 1.75rem !important;
}

.text-success {
    color: var(--success-color) !important;
}

.text-danger {
    color: var(--danger-color) !important;
}

/* Signature Canvas */
#signatureCanvas {
    border: 2px solid var(--border-color);
    border-radius: 8px;
    cursor: crosshair;
    display: block;
    margin-bottom: 1rem;
    background: white;
}

/* Camions List */
.camions-list {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

.camion-card {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 1rem;
    background: var(--bg-color);
    border: 1px solid var(--border-color);
    border-radius: 8px;
}

/* Badge Styles */
.badge-primary {
    background: #dbeafe;
    color: #1e40af;
}

.badge-secondary {
    background: #f1f5f9;
    color: #475569;
}

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

/* Auth Container */
#auth-container {
    display: flex;
    align-items: center;
    gap: 1rem;
}

#username-display {
    color: white;
    font-weight: 500;
}

#logout-button {
    background: rgba(255, 255, 255, 0.2);
    border: 1px solid rgba(255, 255, 255, 0.3);
    color: white;
    padding: 0.5rem 1rem;
    border-radius: 8px;
    cursor: pointer;
    font-size: 0.9rem;
    transition: all 0.3s;
}

#logout-button:hover {
    background: rgba(255, 255, 255, 0.3);
}

/* Login Screen */
#login-screen {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: linear-gradient(135deg, var(--primary-color), var(--primary-dark));
    display: none;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    z-index: 10000;
    padding: 1rem;
    overflow-y: auto;
}

.login-content-wrapper {
    display: flex;
    flex-direction: column;
    align-items: center;
    width: 100%;
    max-width: 400px;
    margin: auto;
}

#login-form-container {
    display: flex;
    flex-direction: column;
    align-items: center;
    width: 100%;
}

#login-screen h2 {
    color: white;
    margin-bottom: 2rem;
    font-size: 2rem;
}

.login-logo-container {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 0;
    margin-bottom: 0.5rem;
    width: 100%;
}

.login-logo {
    width: 55vw;
    max-width: 220px;
    height: auto;
    display: block;
    background: white;
    padding: 10px;
    border-radius: 14px;
    box-shadow: 0 10px 30px rgba(0,0,0,0.3);
}

#login-screen input {
    width: 100%;
    max-width: 300px;
    padding: 1rem;
    margin-bottom: 1rem;
    border: none;
    border-radius: 8px;
    font-size: 1rem;
}

#login-screen button {
    width: 100%;
    max-width: 300px;
    padding: 1rem;
    background: white;
    color: var(--primary-color);
    border: none;
    border-radius: 8px;
    font-size: 1rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s;
}

#login-screen button:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(0,0,0,0.2);
}

#login-screen .error {
    color: #fee;
    background: rgba(239, 68, 68, 0.2);
    padding: 0.75rem;
    border-radius: 8px;
    margin-top: 1rem;
    max-width: 300px;
}

/* Responsive adjustments */
@media (max-width: 768px) {
    .rapport-header-section {
        flex-direction: column;
        align-items: stretch;
    }
    
    .rapport-actions {
        flex-direction: column;
    }
    
    .tache-sections {
        flex-direction: column;
    }
    
    .recap-global-grid {
        grid-template-columns: 1fr;
    }
    
    #signatureCanvas {
        width: 100%;
        height: 150px;
    }
}


/* Profile Page Styles */
.profile-container {
    max-width: 900px;
    margin: 0 auto;
    padding: 20px;
}

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

.profile-section h3 {
    color: #2c3e50;
    margin-bottom: 15px;
    padding-bottom: 10px;
    border-bottom: 2px solid #3498db;
}

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

.info-row {
    display: flex;
    justify-content: space-between;
    padding: 10px 0;
    border-bottom: 1px solid #e0e0e0;
}

.info-row:last-child {
    border-bottom: none;
}

.info-label {
    font-weight: 600;
    color: #555;
}

.info-value {
    color: #2c3e50;
}

.form-card {
    background: #f8f9fa;
    border-radius: 6px;
    padding: 20px;
}

.form-card .form-group {
    margin-bottom: 15px;
}

.form-card label {
    display: block;
    margin-bottom: 5px;
    font-weight: 600;
    color: #555;
}

.form-card .form-input,
.form-card .form-select {
    width: 100%;
    padding: 10px;
    border: 1px solid #ddd;
    border-radius: 4px;
    font-size: 14px;
}

.form-card .form-input:focus,
.form-card .form-select:focus {
    outline: none;
    border-color: #3498db;
}

.error-message {
    background: #fee;
    color: #c33;
    padding: 10px;
    border-radius: 4px;
    margin: 10px 0;
    border-left: 4px solid #c33;
}

.admin-section {
    border: 2px solid #f39c12;
    background: linear-gradient(135deg, #fff9e6 0%, #ffffff 100%);
}

.users-list {
    margin-top: 15px;
}

.data-table {
    width: 100%;
    border-collapse: collapse;
    margin-top: 10px;
}

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

.data-table th {
    background: #3498db;
    color: white;
    font-weight: 600;
}

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

.btn-icon {
    background: var(--bg-color);
    border: 1px solid var(--border-color);
    font-size: 20px;
    cursor: pointer;
    padding: 6px 10px;
    border-radius: 6px;
    transition: all 0.2s;
    display: inline-block;
    margin: 0 2px;
}

.btn-icon:hover {
    transform: scale(1.1);
    background: var(--primary-color);
    border-color: var(--primary-color);
    box-shadow: 0 2px 4px rgba(0,0,0,0.2);
}

.add-user-form {
    background: #f0f8ff;
    border-radius: 6px;
    padding: 20px;
    margin-top: 15px;
    border: 2px solid #3498db;
}

.add-user-form h4 {
    color: #2c3e50;
    margin-bottom: 15px;
}

.info-card ol {
    margin-left: 20px;
    line-height: 1.8;
}

.info-card code {
    background: #2c3e50;
    color: #fff;
    padding: 2px 8px;
    border-radius: 3px;
    font-family: 'Courier New', monospace;
}

.info-card em {
    color: #7f8c8d;
    font-size: 14px;
}

/* Responsive */
@media (max-width: 768px) {
    .profile-container {
        padding: 10px;
    }
    
    .info-row {
        flex-direction: column;
        gap: 5px;
    }
    
    .data-table {
        font-size: 12px;
    }
    
    .data-table th,
    .data-table td {
        padding: 8px;
    }
}

/* Stock Management Styles */
.stock-container {
    padding: 20px;
}

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

.stock-tabs {
    display: flex;
    gap: 10px;
    margin-bottom: 20px;
}

.tab-btn {
    flex: 1;
    padding: 12px 20px;
    border: 2px solid #ddd;
    background: white;
    border-radius: 8px;
    font-size: 16px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s;
}

.tab-btn:hover {
    border-color: #3498db;
    background: #f0f8ff;
}

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

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

.stock-section .section-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 20px;
    padding-bottom: 10px;
    border-bottom: 2px solid #3498db;
}

.stock-table-container {
    overflow-x: auto;
}

.stock-table {
    width: 100%;
    border-collapse: collapse;
    margin-top: 10px;
}

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

.stock-table th {
    background: #3498db;
    color: white;
    font-weight: 600;
    position: sticky;
    top: 0;
}

.stock-table tbody tr:hover {
    background: #f5f5f5;
}

.stock-row.alerte {
    background: #fff3cd !important;
}

.stock-row.alerte:hover {
    background: #ffe69c !important;
}

.total-row {
    background: #e8f4f8 !important;
    font-weight: bold;
}

.total-row td {
    border-top: 2px solid #3498db;
    padding: 15px 12px;
}

.empty-row {
    text-align: center;
    padding: 40px 20px !important;
    color: #999;
    font-style: italic;
}

.actions-cell {
    white-space: nowrap;
    text-align: center;
    padding: 8px !important;
}

.empty-state {
    text-align: center;
    padding: 60px 20px;
    background: white;
    border-radius: 8px;
    margin-top: 20px;
}

.empty-state p {
    font-size: 16px;
    color: #666;
}

/* Mouvements History */
tr.entree {
    background: #d4edda;
}

tr.sortie {
    background: #f8d7da;
}

tr.entree:hover {
    background: #c3e6cb !important;
}

tr.sortie:hover {
    background: #f5c6cb !important;
}

/* Responsive */
@media (max-width: 768px) {
    .stock-tabs {
        flex-direction: column;
    }
    
    .stock-table {
        font-size: 12px;
    }
    
    .stock-table th,
    .stock-table td {
        padding: 8px 4px;
    }
    
    .section-header {
        flex-direction: column;
        gap: 10px;
        align-items: flex-start !important;
    }
    
    .header-actions {
        display: flex;
        gap: 10px;
        width: 100%;
    }
    
    .header-actions button {
        flex: 1;
        font-size: 12px;
    }
}

/* Bordereau Management Styles */
.bordereau-container {
    padding: 20px;
}

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

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

.bordereau-section .section-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 20px;
    padding-bottom: 10px;
    border-bottom: 2px solid #3498db;
}

.category-section {
    margin-bottom: 30px;
}

.category-title {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    padding: 10px 15px;
    border-radius: 6px;
    margin-bottom: 10px;
    font-size: 16px;
}

.bordereau-table {
    width: 100%;
    border-collapse: collapse;
    margin-top: 10px;
}

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

.bordereau-table th {
    background: #3498db;
    color: white;
    font-weight: 600;
    position: sticky;
    top: 0;
}

.bordereau-table tbody tr:hover {
    background: #f5f5f5;
}

.total-section {
    margin-top: 20px;
}

.form-row {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 15px;
}

.info-display {
    background: #e8f4f8;
    padding: 12px;
    border-radius: 4px;
    font-size: 18px;
    font-weight: bold;
    color: #2c3e50;
    text-align: center;
}

/* Responsive */
@media (max-width: 768px) {
    .bordereau-table {
        font-size: 12px;
    }
    
    .bordereau-table th,
    .bordereau-table td {
        padding: 8px 4px;
    }
    
    .form-row {
        grid-template-columns: 1fr;
    }
    
    .section-header {
        flex-direction: column;
        gap: 10px;
        align-items: flex-start !important;
    }
    
    .header-actions {
        display: flex;
        flex-direction: column;
        gap: 10px;
        width: 100%;
    }
}

/* Code Badge Style */
.code-badge {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    padding: 4px 10px;
    border-radius: 4px;
    font-family: 'Courier New', monospace;
    font-weight: bold;
    font-size: 13px;
    display: inline-block;
}

/* Ouvriers List Styles */
.ouvriers-list-container {
    max-height: 400px;
    overflow-y: auto;
    border: 1px solid #ddd;
    border-radius: 6px;
    padding: 15px;
    background: #f9f9f9;
}

.ouvriers-checkboxes {
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.checkbox-label {
    display: flex;
    align-items: center;
    padding: 10px;
    background: white;
    border: 2px solid #e0e0e0;
    border-radius: 6px;
    cursor: pointer;
    transition: all 0.3s;
}

.checkbox-label:hover {
    border-color: #3498db;
    background: #f0f8ff;
}

.checkbox-label input[type="checkbox"] {
    margin-right: 10px;
    width: 18px;
    height: 18px;
    cursor: pointer;
}

.checkbox-label span {
    flex: 1;
    font-weight: 500;
}

.checkbox-label.has-conflict {
    border-color: #ff9800;
    background: #fff8e1;
}

.checkbox-label.has-conflict:hover {
    background: #ffecb3;
}

.warning-badge {
    background: #ff9800;
    color: white;
    padding: 3px 8px;
    border-radius: 4px;
    font-size: 11px;
    font-weight: bold;
    margin-left: 10px;
    white-space: nowrap;
}

.info-box {
    background: #e3f2fd;
    border-left: 4px solid #2196f3;
    padding: 12px;
    margin-top: 15px;
    border-radius: 4px;
    font-size: 14px;
    line-height: 1.6;
}

.info-box strong {
    color: #1976d2;
}

/* Responsive */
@media (max-width: 768px) {
    .ouvriers-list-container {
        max-height: 300px;
    }
    
    .checkbox-label {
        flex-wrap: wrap;
        gap: 5px;
    }
    
    .warning-badge {
        margin-left: 0;
        margin-top: 5px;
    }
}

/* Liste Matériaux Styles */
.liste-materiaux-container {
    padding: 20px;
}

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

.materiaux-table {
    width: 100%;
    border-collapse: collapse;
    margin-top: 10px;
}

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

.materiaux-table th {
    background: #3498db;
    color: white;
    font-weight: 600;
    position: sticky;
    top: 0;
}

.materiaux-table tbody tr:hover {
    background: #f5f5f5;
}

.materiaux-table td.actions-cell {
    white-space: nowrap;
    text-align: center;
    padding: 8px !important;
}

/* Responsive */
@media (max-width: 768px) {
    .materiaux-table {
        font-size: 12px;
    }
    
    .materiaux-table th,
    .materiaux-table td {
        padding: 8px 4px;
    }
}

/* Signature Canvas */
#signatureCanvas {
    border: 2px solid var(--border-color);
    border-radius: 8px;
    background: white;
    cursor: crosshair;
    display: block;
    max-width: 100%;
    height: auto;
    touch-action: none;
}

.signature-section {
    margin-top: 2rem;
}

.signature-section h3 {
    margin-bottom: 1rem;
}

#clearSignatureBtn {
    margin-top: 0.5rem;
}

@media (max-width: 768px) {
    #signatureCanvas {
        width: 100%;
        height: 150px;
    }
}


/* Stock Container Modal */
.stock-container-modal {
    padding: 0;
}

.stock-container-modal .stock-tabs {
    display: flex;
    gap: 0.5rem;
    margin-bottom: 1rem;
    border-bottom: 2px solid var(--border-color);
}

.stock-container-modal .tab-btn {
    padding: 0.75rem 1.5rem;
    background: none;
    border: none;
    border-bottom: 3px solid transparent;
    cursor: pointer;
    font-size: 1rem;
    font-weight: 500;
    color: var(--text-secondary);
    transition: all 0.3s;
}

.stock-container-modal .tab-btn:hover {
    color: var(--primary-color);
    background: var(--bg-color);
}

.stock-container-modal .tab-btn.active {
    color: var(--primary-color);
    border-bottom-color: var(--primary-color);
}

.stock-container-modal .stock-content {
    max-height: 60vh;
    overflow-y: auto;
}

/* Item Card Actions with Stock Button */
.item-card-actions {
    display: flex;
    gap: 0.5rem;
    flex-wrap: wrap;
}

.item-card-actions .btn-sm {
    white-space: nowrap;
}

/* Modal Large for Stock */
.modal-large .modal-body {
    /* Le défilement est géré par le style général de .modal-body */
}



/* Bordereau Container Modal */
.bordereau-container-modal {
    padding: 0;
}

.bordereau-container-modal .bordereau-content {
    max-height: 60vh;
    overflow-y: auto;
}



/* Progress Bar for Avancement */
.progress-bar-container {
    width: 100%;
    height: 20px;
    background-color: #e5e7eb;
    border-radius: 10px;
    overflow: hidden;
    position: relative;
}

.progress-bar {
    height: 100%;
    background-color: #3b82f6;
    transition: width 0.3s ease, background-color 0.3s ease;
    border-radius: 10px;
}

.info-display {
    padding: 10px;
    background: #f3f4f6;
    border-radius: 6px;
    border: 1px solid var(--border-color);
}



/* Avancement Styles */
.avancement-container {
    padding: 1rem;
}

.avancement-global-card {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    padding: 2rem;
    border-radius: 12px;
    box-shadow: 0 4px 6px rgba(0,0,0,0.1);
    margin-bottom: 2rem;
}

.avancement-global-card h4 {
    margin: 0 0 1rem 0;
    font-size: 1.3em;
}

.avancement-tasks {
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

.avancement-task-card {
    background: white;
    border: 1px solid var(--border-color);
    border-radius: 8px;
    padding: 1.5rem;
    box-shadow: 0 2px 4px rgba(0,0,0,0.05);
    transition: box-shadow 0.3s;
}

.avancement-task-card:hover {
    box-shadow: 0 4px 8px rgba(0,0,0,0.1);
}

.task-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    margin-bottom: 1rem;
}

.task-header > div:first-child {
    flex: 1;
}

.task-percentage {
    margin-left: 1rem;
}

.task-details {
    margin-top: 1rem;
    padding-top: 1rem;
    border-top: 1px solid var(--border-color);
}

.btn-success {
    background-color: #10b981;
    color: white;
}

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

@media (max-width: 768px) {
    .avancement-task-card {
        padding: 1rem;
    }
    
    .task-header {
        flex-direction: column;
    }
    
    .task-percentage {
        margin-left: 0;
        margin-top: 0.5rem;
    }
    
    .form-row {
        flex-direction: column;
    }
    
    .form-row > div {
        width: 100% !important;
    }
}

/* Styles pour les actions de tâche */
.tache-header-actions {
    display: flex;
    gap: 0.5rem;
    align-items: center;
}

.tache-header-actions .btn {
    white-space: nowrap;
}


/* ===== BROUILLON ET SAUVEGARDE AUTOMATIQUE ===== */

.rapport-header-section {
    display: flex !important;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 20px;
    flex-wrap: wrap;
    gap: 15px;
    padding: 15px;
    background: #f8f9fa;
    border-radius: 8px;
    border: 1px solid #e0e0e0;
}

.rapport-actions {
    display: flex !important;
    gap: 10px;
    flex-wrap: wrap;
}

.rapport-actions .btn {
    min-width: 120px;
    padding: 10px 20px;
}

.rapport-status {
    display: flex;
    align-items: center;
    gap: 15px;
}

.brouillon-badge {
    background: #ff9800;
    color: white;
    padding: 8px 16px;
    border-radius: 20px;
    font-size: 14px;
    font-weight: 500;
    display: inline-flex;
    align-items: center;
    gap: 5px;
}

.auto-save-indicator {
    font-size: 14px;
    color: #4caf50;
    font-weight: 500;
    display: inline-flex;
    align-items: center;
    gap: 5px;
    transition: all 0.3s ease;
}

.brouillon-card {
    background: #fff3cd;
    border: 2px solid #ff9800;
    border-radius: 8px;
    padding: 20px;
    margin-bottom: 20px;
}

.brouillon-card h3 {
    color: #ff9800;
    margin-top: 0;
    display: flex;
    align-items: center;
    gap: 10px;
}

.brouillon-info {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-top: 15px;
}

.brouillon-meta {
    font-size: 14px;
    color: #666;
}

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

.brouillon-actions .btn {
    padding: 8px 16px;
    font-size: 14px;
}


/* Plans et Réunions dans la modale chantier */
.plans-grid, .reunions-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
    gap: 20px;
    margin-top: 20px;
}

.plan-card, .reunion-card {
    background: white;
    border: 1px solid #ddd;
    border-radius: 8px;
    padding: 15px;
    transition: box-shadow 0.3s ease;
}

.plan-card:hover, .reunion-card:hover {
    box-shadow: 0 4px 12px rgba(0,0,0,0.1);
}

.plan-header, .reunion-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 10px;
    padding-bottom: 10px;
    border-bottom: 1px solid #eee;
}

.plan-header h4, .reunion-header h4 {
    margin: 0;
    font-size: 16px;
    color: #333;
}

.plan-version {
    background: #2196f3;
    color: white;
    padding: 4px 8px;
    border-radius: 12px;
    font-size: 12px;
}

.reunion-date {
    background: #ff9800;
    color: white;
    padding: 4px 8px;
    border-radius: 12px;
    font-size: 12px;
}

.plan-info, .reunion-info {
    margin: 10px 0;
    font-size: 14px;
    color: #666;
}

.plan-actions, .reunion-actions {
    display: flex;
    gap: 8px;
    margin-top: 10px;
}

.plans-chantier-container, .reunions-chantier-container {
    padding: 10px;
}



/* Tabs pour dessin */
.tabs-container {
    margin-top: 10px;
}

.tabs {
    display: flex;
    gap: 5px;
    border-bottom: 2px solid var(--border-color);
    margin-bottom: 15px;
}

.tab-btn {
    background: transparent;
    border: none;
    padding: 10px 20px;
    cursor: pointer;
    font-size: 14px;
    color: var(--text-secondary);
    border-bottom: 3px solid transparent;
    transition: all 0.3s;
}

.tab-btn:hover {
    color: var(--primary-color);
    background: var(--bg-color);
}

.tab-btn.active {
    color: var(--primary-color);
    border-bottom-color: var(--primary-color);
    font-weight: 600;
}

.tab-content {
    display: none;
}

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

/* Canvas toolbar */
.canvas-toolbar {
    display: flex;
    gap: 10px;
    align-items: center;
    padding: 10px;
    background: var(--bg-color);
    border: 1px solid var(--border-color);
    border-radius: 8px;
    margin-bottom: 10px;
    flex-wrap: wrap;
}

.btn-tool {
    background: white;
    border: 2px solid var(--border-color);
    padding: 8px 12px;
    border-radius: 6px;
    cursor: pointer;
    font-size: 18px;
    transition: all 0.3s;
    min-width: 40px;
}

.btn-tool:hover {
    border-color: var(--primary-color);
    background: var(--bg-color);
}

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

#colorPicker-ordre,
#colorPicker-cr,
#colorPicker-note {
    width: 50px;
    height: 40px;
    border: 2px solid var(--border-color);
    border-radius: 6px;
    cursor: pointer;
}

#sizePicker-ordre,
#sizePicker-cr,
#sizePicker-note {
    width: 120px;
    cursor: pointer;
}

canvas {
    display: block;
    border-radius: 8px;
    background: white;
    box-shadow: var(--shadow);
    cursor: crosshair;
}

/* Textarea agrandis */
textarea[rows="8"],
textarea[rows="10"],
textarea[rows="15"] {
    width: 100%;
    padding: 12px;
    border: 1px solid var(--border-color);
    border-radius: 8px;
    font-family: inherit;
    font-size: 14px;
    line-height: 1.6;
    resize: vertical;
}

textarea:focus {
    outline: none;
    border-color: var(--primary-color);
    box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.1);
}

/* Responsive canvas */
@media (max-width: 768px) {
    canvas {
        width: 100%;
        height: auto;
    }
    
    .canvas-toolbar {
        justify-content: space-between;
    }
    
    .btn-tool {
        padding: 6px 10px;
        font-size: 16px;
        min-width: 35px;
    }
    
    #sizePicker-ordre,
    #sizePicker-cr,
    #sizePicker-note {
        width: 80px;
    }
}

/* Styles pour la comparaison de coûts dans le métré */
.cout-comparison {
    background: #f8f9fa;
    border-left: 4px solid #007bff;
    padding: 1rem;
    margin: 1rem 0;
    border-radius: 4px;
    display: flex;
    flex-wrap: wrap;
    gap: 1rem;
    align-items: center;
}

.cout-label {
    font-size: 0.9rem;
    color: #495057;
    padding: 0.25rem 0.5rem;
    background: white;
    border-radius: 4px;
    border: 1px solid #dee2e6;
}

.badge-green {
    background: #28a745 !important;
    color: white !important;
    font-weight: bold;
    padding: 0.5rem 1rem;
    border-radius: 4px;
    font-size: 1rem;
}

.badge-red {
    background: #dc3545 !important;
    color: white !important;
    font-weight: bold;
    padding: 0.5rem 1rem;
    border-radius: 4px;
    font-size: 1rem;
}

.ecart-quantite {
    font-size: 0.9rem;
    color: #6c757d;
    font-style: italic;
}

/* Responsive pour mobile */
@media (max-width: 768px) {
    .cout-comparison {
        flex-direction: column;
        align-items: flex-start;
        gap: 0.5rem;
    }
    
    .cout-label,
    .badge-green,
    .badge-red,
    .ecart-quantite {
        width: 100%;
        text-align: left;
    }
}



/* Styles pour l'affichage de la semaine et des horaires */
.semaine-display {
    margin-top: 0.5rem;
    padding: 0.5rem;
    background: #e3f2fd;
    border-left: 4px solid #2196f3;
    border-radius: 4px;
    font-size: 0.9rem;
    color: #1565c0;
}

.horaires-travail {
    margin-top: 1.5rem;
    padding: 1rem;
    background: #f8f9fa;
    border-radius: 8px;
    border: 1px solid #dee2e6;
}

.horaires-travail h4 {
    margin: 0 0 1rem 0;
    color: #495057;
    font-size: 1.1rem;
}

.horaires-travail .form-row {
    gap: 1rem;
}

.horaires-travail input[type="time"] {
    font-size: 1rem;
    padding: 0.5rem;
}

/* Responsive pour mobile */
@media (max-width: 768px) {
    .horaires-travail .form-row {
        flex-direction: column;
    }
    
    .horaires-travail .form-group {
        width: 100%;
    }
}



/* Styles pour les alertes */
.alert {
    padding: 1rem;
    margin: 1rem 0;
    border-radius: 8px;
    border-left: 4px solid;
}

.alert-warning {
    background: #fff3cd;
    border-color: #ffc107;
    color: #856404;
}

.alert p {
    margin: 0.5rem 0;
}

.alert strong {
    color: #000;
}

.form-help {
    display: block;
    margin-top: 0.25rem;
    font-size: 0.875rem;
    color: #6c757d;
}



/* Styles pour le récapitulatif ouvriers */
.rapport-recapitulatif-ouvriers {
    margin: 2rem 0;
    padding: 1.5rem;
    background: #f8f9fa;
    border-radius: 12px;
    border: 2px solid #dee2e6;
}

.ouvriers-recap-list {
    display: flex;
    flex-direction: column;
    gap: 1.5rem;
}

.ouvrier-recap-card {
    background: white;
    border-radius: 8px;
    padding: 1.5rem;
    border: 2px solid #28a745;
    box-shadow: 0 2px 4px rgba(0,0,0,0.1);
}

.ouvrier-recap-card.has-depassement {
    border-color: #ffc107;
    background: #fffbf0;
}

.ouvrier-recap-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 1rem;
    padding-bottom: 1rem;
    border-bottom: 2px solid #e9ecef;
}

.ouvrier-recap-header h4 {
    margin: 0 0 0.5rem 0;
    color: #2563eb;
    font-size: 1.2rem;
}

.ouvrier-recap-total {
    text-align: right;
}

.ouvrier-recap-total span {
    display: block;
    color: #666;
    font-size: 0.9rem;
    margin-bottom: 0.25rem;
}

.ouvrier-recap-total strong {
    font-size: 1.5rem;
    color: #000;
}

.ouvrier-recap-details {
    margin: 1rem 0;
}

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

.details-table th {
    background: #f8f9fa;
    padding: 0.75rem;
    text-align: left;
    font-weight: 600;
    border-bottom: 2px solid #dee2e6;
}

.details-table td {
    padding: 0.75rem;
    border-bottom: 1px solid #e9ecef;
}

.details-table .total-row {
    background: #f8f9fa;
    font-weight: bold;
}

.details-table .total-row td {
    border-top: 2px solid #dee2e6;
    border-bottom: none;
}

.ouvrier-recap-calcul {
    margin-top: 1rem;
    padding-top: 1rem;
    border-top: 1px solid #e9ecef;
}

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

.badge-warning {
    background: #ffc107;
    color: #000;
}

/* Responsive */
@media (max-width: 768px) {
    .ouvrier-recap-header {
        flex-direction: column;
        align-items: flex-start;
        gap: 1rem;
    }
    
    .ouvrier-recap-total {
        text-align: left;
        width: 100%;
    }
    
    .details-table {
        font-size: 0.9rem;
    }
    
    .details-table th,
    .details-table td {
        padding: 0.5rem;
    }
}



/* Styles pour les rapports hebdomadaire et mensuel */
.rapport-hebdo-container,
.rapport-mensuel-container {
    padding: 2rem;
}

.rapport-hebdo-header,
.rapport-mensuel-header {
    margin-bottom: 2rem;
}

.rapport-hebdo-header h2,
.rapport-mensuel-header h2 {
    margin-bottom: 1rem;
}

.rapport-hebdo-controls,
.rapport-mensuel-controls {
    display: flex;
    gap: 1rem;
    align-items: flex-end;
    flex-wrap: wrap;
}

.rapport-hebdo-info,
.rapport-mensuel-info {
    background: #e3f2fd;
    padding: 1.5rem;
    border-radius: 8px;
    margin-bottom: 2rem;
    border-left: 4px solid #2196f3;
}

.rapport-hebdo-info h3,
.rapport-mensuel-info h3 {
    margin: 0 0 0.5rem 0;
    color: #1565c0;
}

.rapport-hebdo-info p,
.rapport-mensuel-info p {
    margin: 0.25rem 0;
    color: #424242;
}

.alert-info {
    background: #d1ecf1;
    border-color: #bee5eb;
    color: #0c5460;
    padding: 1rem;
    border-radius: 4px;
    border-left: 4px solid #17a2b8;
    margin-top: 1rem;
}

.alert-danger {
    background: #f8d7da;
    border-color: #f5c6cb;
    color: #721c24;
    padding: 1rem;
    border-radius: 4px;
    border-left: 4px solid #dc3545;
}

.ouvriers-hebdo-list,
.ouvriers-mensuel-list {
    display: flex;
    flex-direction: column;
    gap: 1.5rem;
}

.ouvrier-hebdo-card,
.ouvrier-mensuel-card {
    background: white;
    border-radius: 8px;
    padding: 1.5rem;
    border: 2px solid #28a745;
    box-shadow: 0 2px 4px rgba(0,0,0,0.1);
}

.ouvrier-hebdo-card.has-depassement-hebdo {
    border-color: #dc3545;
    background: #fff5f5;
}

.ouvrier-hebdo-header,
.ouvrier-mensuel-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 1rem;
    padding-bottom: 1rem;
    border-bottom: 2px solid #e9ecef;
}

.ouvrier-hebdo-header h4,
.ouvrier-mensuel-header h4 {
    margin: 0;
    color: #2563eb;
    font-size: 1.2rem;
}

.ouvrier-mensuel-badges {
    display: flex;
    gap: 0.5rem;
}

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

.badge-info {
    background: #17a2b8;
    color: white;
}

.ouvrier-hebdo-details,
.ouvrier-mensuel-stats {
    margin: 1rem 0;
}

.ouvrier-mensuel-stats {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
    gap: 1rem;
}

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

.stat-card.stat-warning {
    background: #fff3cd;
    border-color: #ffc107;
}

.stat-card.stat-total {
    background: #e3f2fd;
    border-color: #2196f3;
}

.stat-label {
    font-size: 0.875rem;
    color: #666;
    margin-bottom: 0.5rem;
}

.stat-value {
    font-size: 1.5rem;
    font-weight: bold;
    color: #000;
}

.ouvrier-mensuel-moyenne {
    margin-top: 1rem;
    padding-top: 1rem;
    border-top: 1px solid #e9ecef;
    text-align: center;
    color: #666;
}

.ouvrier-mensuel-moyenne strong {
    color: #000;
    font-size: 1.1rem;
    margin-left: 0.5rem;
}

.loading,
.empty-state,
.error-state {
    text-align: center;
    padding: 3rem;
    color: #666;
    font-size: 1.1rem;
}

.error-state {
    color: #dc3545;
}

/* Responsive */
@media (max-width: 768px) {
    .rapport-hebdo-controls,
    .rapport-mensuel-controls {
        flex-direction: column;
        align-items: stretch;
    }
    
    .rapport-hebdo-controls .form-group,
    .rapport-mensuel-controls .form-group {
        width: 100%;
    }
    
    .ouvrier-hebdo-header,
    .ouvrier-mensuel-header {
        flex-direction: column;
        align-items: flex-start;
        gap: 1rem;
    }
    
    .ouvrier-mensuel-stats {
        grid-template-columns: repeat(2, 1fr);
    }
}



/* Styles pour la section heures ouvrier */
.heures-ouvrier-container {
    padding: 1rem;
}

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

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

.heures-card.has-depassement {
    border-color: #dc3545;
    background: #fff5f5;
}

.heures-card h3 {
    margin: 0 0 1rem 0;
    color: #2563eb;
    font-size: 1.1rem;
}

.heures-stats {
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
}

.stat-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 0.5rem;
    background: #f8f9fa;
    border-radius: 4px;
}

.stat-label {
    color: #666;
    font-size: 0.9rem;
}

.stat-value {
    font-size: 1.2rem;
    font-weight: bold;
    color: #000;
}

.stat-value.text-danger {
    color: #dc3545;
}

.stat-value.text-warning {
    color: #ffc107;
}

.heures-actions {
    display: flex;
    gap: 1rem;
    justify-content: center;
    flex-wrap: wrap;
}

@media (max-width: 768px) {
    .heures-summary {
        grid-template-columns: 1fr;
    }
    
    .heures-actions {
        flex-direction: column;
    }
}



/* Styles pour les options d'export PDF */
.export-options {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 1.5rem;
    margin: 1rem 0;
}

.export-section {
    background: #f8f9fa;
    padding: 1rem;
    border-radius: 8px;
    border: 1px solid #dee2e6;
}

.export-section h4 {
    margin: 0 0 1rem 0;
    color: #2563eb;
    font-size: 1rem;
    padding-bottom: 0.5rem;
    border-bottom: 2px solid #e9ecef;
}

.checkbox-label {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.5rem;
    margin: 0.25rem 0;
    cursor: pointer;
    border-radius: 4px;
    transition: background 0.2s;
}

.checkbox-label:hover {
    background: white;
}

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

.checkbox-label span {
    flex: 1;
    font-size: 0.9rem;
    color: #333;
}

.export-presets {
    margin-top: 1.5rem;
    padding-top: 1.5rem;
    border-top: 1px solid #dee2e6;
}

.export-presets p {
    font-weight: bold;
    margin-bottom: 0.5rem;
    color: #666;
}

@media (max-width: 768px) {
    .export-options {
        grid-template-columns: 1fr;
    }
}



/* Styles pour les rapports journaliers par chantier */
.rapports-chantier-container {
    padding: 1rem;
}

.rapports-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap;
    gap: 1rem;
    margin-bottom: 1.5rem;
}

.rapports-list {
    display: grid;
    gap: 1rem;
}

.rapport-card {
    background: white;
    border: 1px solid #dee2e6;
    border-radius: 8px;
    padding: 1.5rem;
    box-shadow: 0 2px 4px rgba(0,0,0,0.05);
    transition: box-shadow 0.2s;
}

.rapport-card:hover {
    box-shadow: 0 4px 8px rgba(0,0,0,0.1);
}

.rapport-card-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 1rem;
    padding-bottom: 1rem;
    border-bottom: 2px solid #e9ecef;
}

.rapport-card-header h4 {
    margin: 0;
    color: #2563eb;
    font-size: 1.1rem;
}

.rapport-card-body {
    margin-bottom: 1rem;
}

.rapport-stats {
    display: flex;
    gap: 2rem;
    margin: 1rem 0;
}

.rapport-stats .stat {
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.rapport-stats .stat-icon {
    font-size: 1.5rem;
}

.rapport-stats .stat-value {
    font-size: 1.5rem;
    font-weight: bold;
    color: #2563eb;
}

.rapport-stats .stat-label {
    color: #666;
    font-size: 0.9rem;
}

.rapport-card-actions {
    display: flex;
    gap: 0.5rem;
    flex-wrap: wrap;
}

.rapport-view {
    padding: 1rem;
}

.rapport-info-section {
    background: #f8f9fa;
    padding: 1.5rem;
    border-radius: 8px;
    margin-bottom: 2rem;
}

.rapport-info-section h4 {
    margin: 0 0 1rem 0;
    color: #2563eb;
}

.rapport-info-section p {
    margin: 0.5rem 0;
    color: #333;
}

.rapport-chantier-section {
    margin-bottom: 2rem;
}

.rapport-tache {
    background: white;
    border: 1px solid #dee2e6;
    border-radius: 8px;
    padding: 1.5rem;
    margin-bottom: 1rem;
}

.rapport-tache h5 {
    margin: 0 0 1rem 0;
    color: #2563eb;
    font-size: 1.1rem;
}

.rapport-subsection {
    margin: 1rem 0;
    padding: 1rem;
    background: #f8f9fa;
    border-radius: 4px;
}

.rapport-subsection h6 {
    margin: 0 0 0.5rem 0;
    color: #666;
    font-size: 0.95rem;
    font-weight: bold;
}

.rapport-subsection ul {
    margin: 0;
    padding-left: 1.5rem;
}

.rapport-subsection li {
    margin: 0.25rem 0;
    color: #333;
}

@media (max-width: 768px) {
    .rapports-header {
        flex-direction: column;
        align-items: stretch;
    }
    
    .rapport-card-header {
        flex-direction: column;
        align-items: flex-start;
        gap: 0.5rem;
    }
    
    .rapport-stats {
        flex-direction: column;
        gap: 1rem;
    }
}



/* Informations détaillées des ouvriers */
.ouvrier-info-details {
    display: flex;
    gap: 0.5rem;
    align-items: center;
    margin-top: 0.5rem;
    flex-wrap: wrap;
}

.ouvrier-numero {
    display: inline-block;
    padding: 0.2rem 0.6rem;
    background: #f1f5f9;
    color: #475569;
    border-radius: 4px;
    font-size: 0.85rem;
    font-weight: 500;
}

.ouvrier-type {
    display: inline-block;
    padding: 0.2rem 0.6rem;
    border-radius: 4px;
    font-size: 0.85rem;
    font-weight: 500;
}

.ouvrier-type.badge-info {
    background: #dbeafe;
    color: #1e40af;
}

/* Responsive pour les informations ouvriers */
@media (max-width: 768px) {
    .ouvrier-info-details {
        flex-direction: column;
        align-items: flex-start;
        gap: 0.3rem;
    }
}



/* Prévisualisation email */
.email-preview {
    background: #f8f9fa;
    padding: 1.5rem;
    border-radius: 8px;
    margin: 1rem 0;
}

.email-preview .form-group {
    margin-bottom: 1rem;
}

.email-preview label {
    display: block;
    margin-bottom: 0.5rem;
    color: #495057;
}

.email-preview p {
    background: white;
    padding: 0.75rem;
    border-radius: 4px;
    border: 1px solid #dee2e6;
    margin: 0;
}

.email-preview .form-textarea {
    width: 100%;
    font-family: monospace;
    font-size: 0.9rem;
    line-height: 1.5;
}

.modal-actions {
    display: flex;
    gap: 0.5rem;
    justify-content: flex-end;
    margin-top: 1rem;
}

/* Bouton succès */
.btn-success {
    background: var(--success-color);
    color: white;
    border: none;
    padding: 0.75rem 1.5rem;
    border-radius: 8px;
    cursor: pointer;
    font-size: 1rem;
    transition: all 0.3s;
}

.btn-success:hover {
    background: #059669;
    transform: translateY(-2px);
    box-shadow: 0 4px 6px rgba(0,0,0,0.1);
}

/* Texte informatif */
.info-text {
    color: #6c757d;
    font-size: 0.95rem;
    margin-bottom: 1rem;
    line-height: 1.5;
}



/* Interface de répartition bordereau */
.modal-xlarge {
    width: 95%;
    max-width: 1400px;
    max-height: 90vh;
    overflow-y: auto;
}

.repartition-summary {
    background: #f0f9ff;
    padding: 1.5rem;
    border-radius: 8px;
    margin-bottom: 2rem;
    border-left: 4px solid var(--primary-color);
}

.repartition-summary h4 {
    color: var(--primary-color);
    margin-bottom: 1rem;
}

.ressources-summary {
    display: flex;
    flex-wrap: wrap;
    gap: 1rem;
}

.ressources-summary span {
    background: white;
    padding: 0.5rem 1rem;
    border-radius: 6px;
    font-size: 0.9rem;
    box-shadow: var(--shadow);
}

.position-repartition-card {
    background: white;
    border: 2px solid var(--border-color);
    border-radius: 8px;
    padding: 1.5rem;
    margin-bottom: 1.5rem;
}

.position-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 1.5rem;
    padding-bottom: 1rem;
    border-bottom: 2px solid var(--border-color);
}

.position-header h5 {
    color: var(--primary-color);
    font-size: 1.1rem;
}

.ressources-repartition {
    background: #f9fafb;
    padding: 1rem;
    border-radius: 6px;
    margin-bottom: 1rem;
}

.ressources-repartition h6 {
    margin-bottom: 0.75rem;
    color: var(--text-primary);
    font-size: 0.95rem;
}

.ressource-item {
    display: flex;
    align-items: center;
    gap: 1rem;
    padding: 0.75rem;
    background: white;
    border-radius: 4px;
    margin-bottom: 0.5rem;
}

.ressource-item label {
    flex: 1;
    font-size: 0.9rem;
    color: var(--text-secondary);
}

.form-input-sm {
    width: 100px;
    padding: 0.4rem;
    border: 1px solid var(--border-color);
    border-radius: 4px;
    font-size: 0.9rem;
}

.cout-label {
    min-width: 100px;
    text-align: right;
    font-weight: 500;
    color: var(--success-color);
}

.position-cout-total {
    margin-top: 1.5rem;
    padding-top: 1rem;
    border-top: 2px solid var(--border-color);
    text-align: right;
    font-size: 1.1rem;
    color: var(--primary-color);
}

.validation-summary {
    background: #fffbeb;
    border: 2px solid var(--warning-color);
    border-radius: 8px;
    padding: 1.5rem;
}

.validation-summary h4 {
    color: var(--warning-color);
    margin-bottom: 1rem;
}

.validation-section {
    margin-bottom: 1rem;
}

.validation-section h6 {
    margin-bottom: 0.5rem;
    color: var(--text-primary);
}

.validation-section div {
    padding: 0.25rem 0;
    font-size: 0.9rem;
}

.validation-total {
    margin-top: 1rem;
    padding-top: 1rem;
    border-top: 2px solid var(--warning-color);
    font-size: 1.1rem;
}

.unit-label {
    margin-left: 0.5rem;
    color: var(--text-secondary);
    font-size: 0.9rem;
}



/* ========================================
   Section Dégâts
   ======================================== */

.degats-section {
    margin-top: 1.5rem;
    padding: 1rem;
    background-color: #fff5f5;
    border-left: 4px solid #ef4444;
    border-radius: 4px;
}

.degats-section h5 {
    color: #dc2626;
    margin-bottom: 1rem;
    font-size: 1.1rem;
    font-weight: 600;
}

.degats-empty {
    text-align: center;
    padding: 2rem;
    color: #9ca3af;
    font-style: italic;
}

/* Carte Dégât */
.degat-card {
    background-color: white;
    border: 1px solid #e5e7eb;
    border-radius: 8px;
    padding: 1rem;
    margin-bottom: 0.75rem;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
    transition: box-shadow 0.2s;
}

.degat-card:hover {
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
}

.degat-card.degat-alert {
    border-color: #ef4444;
    border-width: 2px;
    background-color: #fef2f2;
}

/* En-tête Dégât */
.degat-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 0.75rem;
    padding-bottom: 0.5rem;
    border-bottom: 1px solid #e5e7eb;
}

.degat-type {
    font-weight: 600;
    font-size: 1rem;
    color: #374151;
}

.degat-statut {
    padding: 0.25rem 0.75rem;
    border-radius: 12px;
    font-size: 0.875rem;
    font-weight: 500;
}

.badge-warning {
    background-color: #fef3c7;
    color: #92400e;
}

.badge-danger {
    background-color: #fee2e2;
    color: #991b1b;
}

.badge-success {
    background-color: #d1fae5;
    color: #065f46;
}

.badge-info {
    background-color: #dbeafe;
    color: #1e40af;
}

/* Corps Dégât */
.degat-body {
    margin-bottom: 0.75rem;
}

.degat-body p {
    margin: 0.25rem 0;
    font-size: 0.875rem;
    color: #6b7280;
}

.degat-body strong {
    color: #374151;
    font-weight: 600;
}

.alert-text {
    color: #dc2626 !important;
    font-weight: 600 !important;
    margin-top: 0.5rem !important;
    padding: 0.5rem;
    background-color: #fee2e2;
    border-radius: 4px;
}

/* Actions Dégât */
.degat-actions {
    display: flex;
    gap: 0.5rem;
    justify-content: flex-end;
    padding-top: 0.5rem;
    border-top: 1px solid #e5e7eb;
}

/* Récapitulatif Pertes */
.recap-pertes {
    color: #dc2626;
    font-weight: 600;
    padding: 0.5rem;
    background-color: #fee2e2;
    border-radius: 4px;
    margin-top: 0.5rem;
}

.recap-pertes-detail {
    display: flex;
    justify-content: space-between;
    margin-top: 0.25rem;
    font-size: 0.875rem;
}

/* Responsive */
@media (max-width: 768px) {
    .degat-header {
        flex-direction: column;
        align-items: flex-start;
        gap: 0.5rem;
    }
    
    .degat-actions {
        justify-content: flex-start;
    }
}



/* Styles pour les tableaux d'historique des heures */
.heures-section {
    background: white;
    border-radius: 8px;
    padding: 1.5rem;
    box-shadow: 0 1px 3px rgba(0,0,0,0.1);
}

.heures-section h3 {
    margin: 0 0 1rem 0;
    color: #2563eb;
    font-size: 1.2rem;
}

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

.table-heures thead {
    background-color: #f8fafc;
}

.table-heures th {
    padding: 0.75rem;
    text-align: left;
    font-weight: 600;
    color: #475569;
    border-bottom: 2px solid #e2e8f0;
}

.table-heures td {
    padding: 0.75rem;
    border-bottom: 1px solid #e2e8f0;
}

.table-heures tbody tr:hover {
    background-color: #f8fafc;
}

.table-heures tbody tr:last-child td {
    border-bottom: none;
}

@media (max-width: 768px) {
    .heures-section {
        padding: 1rem;
    }
    
    .table-heures {
        font-size: 0.9rem;
    }
    
    .table-heures th,
    .table-heures td {
        padding: 0.5rem 0.25rem;
    }
}



/* Secondary Modal Styles for Category Management */
#categoryModalContainer {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: 1000; /* Higher than main modal */
    display: none;
}

.modal-backdrop-secondary {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.4); /* Slightly lighter backdrop */
}

.modal-content-secondary {
    background-color: var(--card-bg);
    margin: 10% auto; /* 10% from the top and centered */
    padding: 20px;
    border-radius: 12px;
    box-shadow: var(--shadow-lg);
    position: relative;
    z-index: 1001;
    max-width: 500px;
    width: 90%;
}

/* Ensure the modal content inside is styled like a regular modal */
.modal-content-secondary .modal-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    border-bottom: 1px solid var(--border-color);
    padding-bottom: 10px;
    margin-bottom: 15px;
}

.modal-content-secondary .modal-body {
    padding: 15px 0;
}

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


/* ==========================================
   SYSTÈME DE POINTAGE
   ========================================== */

.pointage-container {
    max-width: 800px;
    margin: 0 auto;
    padding: 1.5rem;
}

.pointage-header {
    text-align: center;
    margin-bottom: 2rem;
}

.pointage-header {
    position: relative;
}

.btn-close-page {
    position: absolute;
    top: 0;
    right: 0;
    width: 28px;
    height: 28px;
    border: none;
    background: #f0f0f0;
    color: #666;
    font-size: 1rem;
    border-radius: 50%;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 2px 6px rgba(0,0,0,0.15);
    transition: all 0.2s;
    z-index: 50;
    -webkit-tap-highlight-color: transparent;
}

.btn-close-page:hover {
    background: #e0e0e0;
    transform: scale(1.1);
}

.pointage-header h2 {
    font-size: 1.75rem;
    color: var(--primary-color);
    margin-bottom: 0.5rem;
}

.date-today {
    color: var(--text-secondary);
    font-size: 1rem;
}

.pointage-tabs {
    display: flex;
    gap: 0.5rem;
    margin-bottom: 1.5rem;
    border-bottom: 2px solid var(--border-color);
    padding-bottom: 0.5rem;
    overflow-x: auto;
}

.pointage-tab {
    padding: 0.75rem 1.5rem;
    border: none;
    background: none;
    color: var(--text-secondary);
    font-size: 1rem;
    cursor: pointer;
    border-radius: 8px 8px 0 0;
    transition: all 0.2s;
    white-space: nowrap;
}

.pointage-tab:hover {
    background: var(--bg-color);
}

.pointage-tab.active {
    background: var(--primary-color);
    color: white;
}

.tab-panel {
    animation: fadeIn 0.3s ease;
}

/* Scanner QR */
.scanner-section {
    text-align: center;
}

.scanner-info {
    margin-bottom: 1.5rem;
}

.scanner-info h3 {
    margin-bottom: 0.5rem;
}

.qr-reader {
    width: 100%;
    max-width: 400px;
    margin: 0 auto 1.5rem;
    border-radius: 12px;
    overflow: hidden;
    background: #000;
    min-height: 300px;
}

.scanner-actions {
    margin-bottom: 1rem;
}

.btn-large {
    padding: 1rem 2rem;
    font-size: 1.1rem;
}

.scan-status {
    margin-top: 1rem;
}

.scan-status .info {
    color: var(--primary-color);
}

.scan-status .error {
    color: var(--danger-color);
}

/* Code PIN */
.pin-section {
    text-align: center;
    max-width: 350px;
    margin: 0 auto;
}

.pin-input-container {
    margin: 1.5rem 0;
}

.pin-input {
    width: 100%;
    padding: 1.5rem;
    font-size: 2rem;
    text-align: center;
    letter-spacing: 0.5rem;
    border: 2px solid var(--border-color);
    border-radius: 12px;
    background: var(--card-bg);
}

.pin-input:focus {
    border-color: var(--primary-color);
    outline: none;
}

.pin-keypad {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 0.75rem;
    max-width: 300px;
    margin: 0 auto;
}

.keypad-btn {
    padding: 1.25rem;
    font-size: 1.5rem;
    border: 1px solid var(--border-color);
    border-radius: 12px;
    background: var(--card-bg);
    cursor: pointer;
    transition: all 0.2s;
}

.keypad-btn:hover {
    background: var(--bg-color);
}

.keypad-btn:active {
    transform: scale(0.95);
}

.keypad-clear {
    background: #fee2e2;
    color: var(--danger-color);
}

.keypad-submit {
    background: var(--success-color);
    color: white;
}

/* Résultat pointage */
.pointage-result {
    background: var(--card-bg);
    border-radius: 16px;
    padding: 2rem;
    margin-top: 1.5rem;
    text-align: center;
    box-shadow: var(--shadow-lg);
    animation: slideIn 0.3s ease;
}

.ouvrier-identified {
    margin-bottom: 1.5rem;
}

.ouvrier-avatar {
    font-size: 4rem;
    margin-bottom: 0.5rem;
}

.ouvrier-identified h3 {
    font-size: 1.5rem;
    margin-bottom: 0.25rem;
}

.qualification {
    color: var(--text-secondary);
}

.pointage-status {
    padding: 1rem;
    border-radius: 8px;
    margin-bottom: 1.5rem;
}

.pointage-status.en-cours {
    background: #fef3c7;
    color: #92400e;
}

.pointage-status.nouveau {
    background: var(--bg-color);
}

.chantier-selection {
    margin-bottom: 1.5rem;
    text-align: left;
}

.chantier-selection label {
    display: block;
    margin-bottom: 0.5rem;
    font-weight: 500;
}

.pointage-actions {
    margin-bottom: 1rem;
}

.result-message {
    padding: 1.5rem;
    border-radius: 12px;
    margin-bottom: 1.5rem;
    font-size: 1.1rem;
}

.result-message.success {
    background: #d1fae5;
    color: #065f46;
}

.result-message.error {
    background: #fee2e2;
    color: #991b1b;
}

/* Gestion des pointages */
.gestion-section {
    max-width: 100%;
}

.gestion-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 1rem;
    flex-wrap: wrap;
    gap: 1rem;
}

.filter-bar {
    display: flex;
    gap: 0.75rem;
    margin-bottom: 1rem;
    flex-wrap: wrap;
}

.filter-bar .form-control {
    flex: 1;
    min-width: 150px;
}

.pointages-list {
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
    margin-bottom: 1.5rem;
    max-height: 400px;
    overflow-y: auto;
}

.pointage-card {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 1rem;
    background: var(--card-bg);
    border-radius: 12px;
    border-left: 4px solid var(--success-color);
    box-shadow: var(--shadow);
    flex-wrap: wrap;
    gap: 0.75rem;
}

.pointage-card.en-cours {
    border-left-color: var(--warning-color);
}

.pointage-ouvrier {
    display: flex;
    flex-direction: column;
}

.ouvrier-nom {
    font-weight: 600;
}

.chantier-nom {
    font-size: 0.85rem;
    color: var(--text-secondary);
}

.pointage-horaires {
    display: flex;
    gap: 1rem;
}

.pointage-horaires span {
    font-family: monospace;
}

.pointage-meta {
    display: flex;
    gap: 0.5rem;
    align-items: center;
}

.badge {
    padding: 0.25rem 0.75rem;
    border-radius: 20px;
    font-size: 0.8rem;
    font-weight: 500;
}

.badge.termine {
    background: #d1fae5;
    color: #065f46;
}

.badge.en-cours {
    background: #fef3c7;
    color: #92400e;
}

.badge.retard {
    background: #fee2e2;
    color: #991b1b;
}

.gestion-stats {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 1rem;
}

.stat-card {
    background: var(--card-bg);
    padding: 1rem;
    border-radius: 12px;
    text-align: center;
    box-shadow: var(--shadow);
}

.stat-value {
    display: block;
    font-size: 2rem;
    font-weight: 700;
    color: var(--primary-color);
}

.stat-label {
    color: var(--text-secondary);
    font-size: 0.9rem;
}

.empty, .loading {
    text-align: center;
    padding: 2rem;
    color: var(--text-secondary);
}

.config-section {
    padding: 1rem 0;
}

.config-card {
    background: var(--card-bg);
    border-radius: 12px;
    padding: 1.5rem;
    margin-bottom: 1rem;
    box-shadow: var(--shadow);
}

.config-card h4 {
    margin: 0 0 0.5rem 0;
    color: var(--text-primary);
}

.config-help {
    color: var(--text-secondary);
    font-size: 0.9rem;
    margin-bottom: 1rem;
}

.config-actions {
    margin-top: 1.5rem;
    text-align: center;
}

.checkbox-label {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    cursor: pointer;
}

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

.form-row {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 1rem;
}

.btn-small {
    padding: 0.4rem 0.8rem;
    font-size: 0.9rem;
}

.distance-badge {
    display: inline-flex;
    align-items: center;
    gap: 0.25rem;
    padding: 0.2rem 0.5rem;
    border-radius: 20px;
    font-size: 0.8rem;
    font-weight: 500;
}

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

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

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

.pointage-distance {
    font-size: 0.85rem;
    color: var(--text-secondary);
    margin-top: 0.25rem;
}

@media (max-width: 768px) {
    .form-row {
        grid-template-columns: 1fr;
    }
    
    .pointage-container {
        padding: 1rem;
    }
    
    .pointage-tabs {
        flex-wrap: nowrap;
        justify-content: flex-start;
    }
    
    .pointage-tab {
        padding: 0.5rem 1rem;
        font-size: 0.9rem;
    }
    
    .gestion-stats {
        grid-template-columns: repeat(3, 1fr);
        gap: 0.5rem;
    }
    
    .stat-card {
        padding: 0.75rem 0.5rem;
    }
    
    .stat-value {
        font-size: 1.5rem;
    }
    
    .pointage-card {
        flex-direction: column;
        align-items: flex-start;
    }
}

/* ===== Planning Camions Styles ===== */
.planning-camions-page {
    padding: 1rem;
}

.planning-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 1.5rem;
    flex-wrap: wrap;
    gap: 1rem;
}

.planning-navigation {
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.planning-date-label {
    font-size: 1.1rem;
    font-weight: 600;
    min-width: 200px;
    text-align: center;
}

.planning-view-toggle {
    display: flex;
    gap: 0.5rem;
}

/* Planning Jour Grid */
.planning-jour-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
    gap: 1rem;
}

.camion-planning-card {
    background: var(--card-bg);
    border-radius: 10px;
    box-shadow: var(--shadow);
    overflow: hidden;
}

.camion-header {
    padding: 0.75rem 1rem;
    display: flex;
    justify-content: space-between;
    align-items: center;
    color: white;
}

.camion-header.interne {
    background: linear-gradient(135deg, #10b981, #059669);
}

.camion-header.location {
    background: linear-gradient(135deg, #f59e0b, #d97706);
}

.camion-info {
    display: flex;
    flex-direction: column;
    gap: 0.25rem;
}

.chauffeur-info {
    font-size: 0.9rem;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.btn-call {
    background: rgba(255,255,255,0.2);
    padding: 0.25rem 0.5rem;
    border-radius: 4px;
    text-decoration: none;
    color: white;
}

.camion-transports {
    padding: 0.75rem;
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

.no-transport {
    text-align: center;
    color: var(--text-secondary);
    padding: 1rem;
    font-style: italic;
}

/* Transport Card */
.transport-card {
    display: flex;
    gap: 0.75rem;
    padding: 0.75rem;
    background: #f8fafc;
    border-radius: 8px;
    border-left: 4px solid #ddd;
    cursor: pointer;
    transition: all 0.2s;
}

.transport-card:hover {
    background: #f1f5f9;
    transform: translateX(2px);
}

.transport-card.status-planifie {
    border-left-color: #6b7280;
}

.transport-card.status-en-cours {
    border-left-color: #f59e0b;
    background: #fffbeb;
}

.transport-card.status-termine {
    border-left-color: #10b981;
    background: #ecfdf5;
}

.transport-card.status-annule {
    border-left-color: #ef4444;
    background: #fef2f2;
    opacity: 0.7;
}

.transport-time {
    font-weight: 700;
    font-size: 1rem;
    color: var(--primary-color);
    min-width: 50px;
}

.transport-content {
    flex: 1;
}

.transport-mission {
    font-weight: 600;
    margin-bottom: 0.25rem;
}

.transport-mission span {
    font-weight: normal;
    color: var(--text-secondary);
    margin-left: 0.5rem;
}

.transport-destination,
.transport-quantity {
    font-size: 0.85rem;
    color: var(--text-secondary);
}

.transport-status {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 0.25rem;
    font-size: 1.2rem;
}

.docs-badge {
    font-size: 0.75rem;
    background: var(--primary-color);
    color: white;
    padding: 0.1rem 0.4rem;
    border-radius: 10px;
}

/* Planning Semaine Grid */
.planning-semaine-grid {
    background: var(--card-bg);
    border-radius: 10px;
    box-shadow: var(--shadow);
    overflow: auto;
}

.semaine-header, .semaine-row {
    display: grid;
    grid-template-columns: 150px repeat(7, 1fr);
    border-bottom: 1px solid var(--border-color);
}

.semaine-header {
    background: #f1f5f9;
    font-weight: 600;
}

.semaine-header .day-col,
.semaine-header .camion-col {
    padding: 0.75rem;
    text-align: center;
}

.semaine-row .camion-col {
    padding: 0.75rem;
    background: #fafafa;
    font-weight: 500;
    border-right: 1px solid var(--border-color);
}

.semaine-row .day-col {
    padding: 0.5rem;
    text-align: center;
    cursor: pointer;
    transition: background 0.2s;
}

.semaine-row .day-col:hover {
    background: #f1f5f9;
}

.semaine-row .day-col.has-transports {
    background: #ecfdf5;
}

/* Summary Stats */
.planning-summary {
    margin-top: 1.5rem;
}

.summary-stats {
    display: flex;
    flex-wrap: wrap;
    gap: 1rem;
    background: var(--card-bg);
    padding: 1rem;
    border-radius: 10px;
    box-shadow: var(--shadow);
}

.stat-item {
    flex: 1;
    min-width: 120px;
    text-align: center;
    padding: 0.5rem;
}

.stat-label {
    font-size: 0.85rem;
    color: var(--text-secondary);
}

.stat-value {
    font-size: 1.5rem;
    font-weight: 700;
    color: var(--text-primary);
}

.stat-value.text-success { color: var(--success-color); }
.stat-value.text-warning { color: var(--warning-color); }
.stat-value.text-info { color: var(--primary-color); }

/* Stats Grid */
.stats-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(150px, 1fr));
    gap: 1rem;
}

.stat-card {
    background: var(--card-bg);
    padding: 1.5rem;
    border-radius: 10px;
    box-shadow: var(--shadow);
    text-align: center;
    border-top: 4px solid var(--border-color);
}

.stat-card.success { border-top-color: var(--success-color); }
.stat-card.warning { border-top-color: var(--warning-color); }
.stat-card.info { border-top-color: #3b82f6; }
.stat-card.primary { border-top-color: var(--primary-color); }

.stat-card .stat-icon {
    font-size: 2rem;
    margin-bottom: 0.5rem;
}

.stat-card .stat-value {
    font-size: 1.75rem;
    font-weight: 700;
}

.stat-card .stat-label {
    font-size: 0.9rem;
    color: var(--text-secondary);
}

/* Demandes et Materiaux */
.demande-card, .materiau-provisoire-card {
    background: var(--card-bg);
    padding: 1rem;
    border-radius: 8px;
    box-shadow: var(--shadow);
    margin-bottom: 1rem;
    border-left: 4px solid var(--warning-color);
}

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

.demande-actions, .materiau-actions {
    margin-top: 0.75rem;
    display: flex;
    gap: 0.5rem;
    flex-wrap: wrap;
    align-items: center;
}

/* Categories & Materiaux */
.categorie-section {
    margin-bottom: 1.5rem;
}

.categorie-section h4 {
    margin-bottom: 0.5rem;
    color: var(--text-primary);
}

.materiaux-chips {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
}

.chip {
    background: #e2e8f0;
    padding: 0.35rem 0.75rem;
    border-radius: 20px;
    font-size: 0.85rem;
}

/* Transport Details Modal */
.transport-details p {
    margin-bottom: 0.5rem;
    padding: 0.5rem 0;
    border-bottom: 1px solid var(--border-color);
}

.transport-details p:last-child {
    border-bottom: none;
}

/* Lieux Cards List */
.lieux-cards-list {
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
}

.lieu-card {
    background: var(--card-bg);
    border: 1px solid var(--border-color);
    border-radius: 10px;
    padding: 1rem;
    transition: box-shadow 0.2s;
}

.lieu-card:hover {
    box-shadow: var(--shadow);
}

.lieu-card.lieu-inactif {
    background: #f8fafc;
    opacity: 0.7;
}

.lieu-card-main {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 1rem;
}

.lieu-info {
    display: flex;
    flex-direction: column;
    gap: 0.25rem;
}

.lieu-nom {
    font-size: 1rem;
    color: var(--text-primary);
}

.lieu-type {
    font-size: 0.85rem;
    color: var(--text-secondary);
}

.lieu-status {
    font-size: 0.85rem;
    white-space: nowrap;
}

.lieu-status.status-actif {
    color: var(--success-color);
}

.lieu-status.status-inactif {
    color: var(--text-secondary);
}

.lieu-card-actions {
    display: flex;
    gap: 0.5rem;
    margin-top: 0.75rem;
    flex-wrap: wrap;
}

.lieu-card-info {
    margin-top: 0.5rem;
}

/* Responsive */
@media (max-width: 768px) {
    .planning-header {
        flex-direction: column;
        align-items: stretch;
    }
    
    .planning-navigation {
        justify-content: center;
    }
    
    .planning-view-toggle {
        justify-content: center;
    }
    
    .planning-jour-grid {
        grid-template-columns: 1fr;
    }
    
    .semaine-header, .semaine-row {
        grid-template-columns: 100px repeat(7, 1fr);
    }
    
    .summary-stats {
        flex-direction: column;
    }
    
    .lieu-card-main {
        flex-direction: column;
        align-items: flex-start;
    }
    
    .lieu-card-actions {
        width: 100%;
    }
    
    .lieu-card-actions .btn {
        flex: 1;
    }
}


/* Landscape orientation warning */
#landscape-warning {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: linear-gradient(135deg, #1e3a5f 0%, #2563eb 100%);
    z-index: 99999;
    justify-content: center;
    align-items: center;
}

.landscape-content {
    text-align: center;
    color: white;
    padding: 40px;
}

.rotate-icon {
    font-size: 80px;
    animation: rotate-phone 2s ease-in-out infinite;
    display: inline-block;
}

.landscape-content p {
    font-size: 20px;
    margin-top: 20px;
    font-weight: 500;
}

@keyframes rotate-phone {
    0%, 100% { transform: rotate(0deg); }
    25% { transform: rotate(-90deg); }
    50% { transform: rotate(-90deg); }
    75% { transform: rotate(0deg); }
}

@media screen and (orientation: landscape) and (max-height: 500px) {
    #landscape-warning {
        display: flex;
    }
    
    #app {
        display: none !important;
    }
}

/* ==================== Rappels Personnels ==================== */

.rappels-container {
    padding: 15px;
}

.rappels-header {
    margin-bottom: 20px;
}

.rappel-card {
    background: var(--card-bg);
    border-radius: 10px;
    padding: 15px;
    margin-bottom: 12px;
    box-shadow: var(--shadow);
}

.rappel-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 8px;
}

.rappel-priorite {
    font-size: 1rem;
}

.rappel-date {
    font-size: 0.85rem;
    color: var(--text-secondary);
    font-weight: 500;
}

.rappel-titre {
    font-size: 1.1rem;
    font-weight: 600;
    margin-bottom: 6px;
}

.rappel-description {
    font-size: 0.9rem;
    color: var(--text-secondary);
    margin-bottom: 8px;
}

.rappel-lien {
    display: inline-block;
    background: #f0f9ff;
    color: var(--primary-color);
    padding: 4px 10px;
    border-radius: 20px;
    font-size: 0.8rem;
    margin-bottom: 10px;
}

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

/* ===========================================
   ABSENCES MODULE STYLES
   =========================================== */

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

.absences-header {
    display: flex;
    align-items: center;
    gap: 15px;
    margin-bottom: 20px;
    padding-bottom: 15px;
    border-bottom: 2px solid var(--primary-color);
}

.absences-header h2 {
    margin: 0;
    font-size: 1.5rem;
    color: var(--primary-color);
}

.absences-tabs {
    display: flex;
    gap: 10px;
    margin-bottom: 20px;
    flex-wrap: wrap;
}

.absences-tab {
    padding: 10px 20px;
    border: none;
    background: var(--card-bg);
    border-radius: 8px;
    cursor: pointer;
    font-size: 0.95rem;
    transition: all 0.2s;
    box-shadow: var(--shadow);
}

.absences-tab:hover {
    background: #e3f2fd;
}

.absences-tab.active {
    background: var(--primary-color);
    color: white;
}

.absences-content {
    background: var(--card-bg);
    border-radius: 12px;
    padding: 20px;
    box-shadow: var(--shadow);
}

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

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

.absence-card {
    background: white;
    border-radius: 10px;
    padding: 15px;
    box-shadow: 0 2px 4px rgba(0,0,0,0.1);
    transition: transform 0.2s, box-shadow 0.2s;
}

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

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

.absence-type {
    padding: 4px 10px;
    border-radius: 20px;
    font-size: 0.85rem;
    font-weight: 500;
}

.absence-duree {
    font-size: 0.85rem;
    color: var(--text-secondary);
}

.absence-ouvrier {
    font-size: 1.1rem;
    margin-bottom: 8px;
}

.absence-dates {
    font-size: 0.9rem;
    color: var(--text-secondary);
    margin-bottom: 8px;
}

.absence-notes {
    font-size: 0.85rem;
    color: #666;
    background: #f5f5f5;
    padding: 8px;
    border-radius: 6px;
    margin-bottom: 10px;
}

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

/* Calendrier absences */
.calendrier-navigation {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 20px;
}

.calendrier-navigation h3 {
    margin: 0;
    text-transform: capitalize;
}

.calendrier-grid {
    background: white;
    border-radius: 10px;
    overflow: hidden;
}

.calendrier-header {
    display: grid;
    grid-template-columns: repeat(7, 1fr);
    background: var(--primary-color);
    color: white;
    text-align: center;
    font-weight: 600;
}

.calendrier-header > div {
    padding: 10px;
}

.calendrier-body {
    display: grid;
    grid-template-columns: repeat(7, 1fr);
}

.calendrier-jour {
    min-height: 100px;
    border: 1px solid #eee;
    padding: 5px;
    position: relative;
}

.calendrier-jour.empty {
    background: #f9f9f9;
}

.calendrier-jour.has-absences {
    background: #fff3e0;
}

.jour-numero {
    font-weight: 600;
    font-size: 0.9rem;
    color: var(--text-secondary);
    display: block;
    margin-bottom: 5px;
}

.absence-mini {
    font-size: 0.7rem;
    padding: 2px 5px;
    border-radius: 4px;
    margin-bottom: 2px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.absence-more {
    font-size: 0.7rem;
    color: var(--text-secondary);
    font-style: italic;
}

/* Stats absences */
.stats-container h3,
.stats-container h4 {
    margin: 0 0 15px 0;
}

.stats-summary {
    display: flex;
    gap: 20px;
    margin-bottom: 25px;
    flex-wrap: wrap;
}

.stats-by-type {
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.stat-type-row {
    display: flex;
    align-items: center;
    gap: 15px;
}

.stat-type-label {
    width: 150px;
    font-size: 0.9rem;
}

.stat-type-bar {
    flex: 1;
    height: 20px;
    background: #eee;
    border-radius: 10px;
    overflow: hidden;
}

.stat-type-fill {
    height: 100%;
    border-radius: 10px;
    transition: width 0.3s;
}

.stat-type-value {
    width: 100px;
    font-size: 0.85rem;
    color: var(--text-secondary);
    text-align: right;
}

/* Alerte non pointé */
.alerte-non-pointe {
    background: #fff3e0;
    border-left: 4px solid #ff9800;
    padding: 12px;
    border-radius: 8px;
    margin-bottom: 10px;
}

.alerte-non-pointe-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 8px;
}

.alerte-non-pointe-ouvrier {
    font-weight: 600;
}

.alerte-non-pointe-chantier {
    font-size: 0.85rem;
    color: #666;
}

.alerte-non-pointe-actions {
    display: flex;
    gap: 8px;
}

@media (max-width: 768px) {
    .calendrier-jour {
        min-height: 60px;
    }
    
    .absence-mini {
        font-size: 0.6rem;
    }
    
    .stat-type-row {
        flex-direction: column;
        align-items: flex-start;
    }
    
    .stat-type-label,
    .stat-type-value {
        width: auto;
    }
}

/* =========================================
   ABSENCES DANS RAPPORT JOURNALIER
   ========================================= */

.rapport-absences-jour {
    background: var(--card-background);
    border-radius: 12px;
    padding: 20px;
    margin-bottom: 20px;
    box-shadow: var(--shadow-soft);
}

.rapport-absences-jour h3 {
    margin: 0 0 15px 0;
    font-size: 1.2rem;
    color: var(--text-primary);
}

.absences-jour-container {
    min-height: 60px;
}

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

.absence-jour-card {
    background: white;
    border-radius: 10px;
    padding: 15px;
    box-shadow: 0 2px 6px rgba(0,0,0,0.08);
}

.absence-jour-header {
    display: flex;
    align-items: center;
    gap: 10px;
    margin-bottom: 10px;
}

.absence-jour-icone {
    font-size: 1.5rem;
}

.absence-jour-nom {
    font-size: 1rem;
    color: var(--text-primary);
}

.absence-jour-type {
    display: inline-block;
    padding: 4px 10px;
    border-radius: 20px;
    font-size: 0.85rem;
    font-weight: 500;
    margin-bottom: 8px;
}

.absence-jour-motif {
    font-size: 0.9rem;
    color: var(--text-secondary);
    font-style: italic;
    margin-bottom: 5px;
}

.absence-jour-dates {
    font-size: 0.8rem;
    color: var(--text-secondary);
}

@media (max-width: 768px) {
    .absences-jour-grid {
        grid-template-columns: 1fr;
    }
}
