/* Reset et base */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

html {
    height: 100%;
}

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Arial, sans-serif;
    background-color: #F8F9FA;
    color: #1F2937;
    line-height: 1.6;
    min-height: 100%;
}

/* Un seul scroll : quand le layout GMAO est utilisé, seul .page-content défile */
body:has(.app-container),
body.app-layout {
    overflow: hidden;
    height: 100%;
}

/* ========== Layout GMAO (sidebar + main) ========== */
.app-container {
    display: flex;
    height: 100vh;
    overflow: hidden;
    width: 100%;
}

.app-container .sidebar {
    width: 260px;
    background: white;
    border-right: 1px solid #E5E7EB;
    display: flex;
    flex-direction: column;
    overflow-y: auto;
    flex-shrink: 0;
    z-index: 100;
}

.app-container .sidebar-header {
    padding: 20px;
    border-bottom: 1px solid #E5E7EB;
}

.app-container .sidebar .logo {
    font-size: 24px;
    font-weight: 700;
    color: #16A085;
    margin-bottom: 16px;
    text-decoration: none;
    display: block;
}

.app-container .user-info {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 12px;
    background: #F8F9FA;
    border-radius: 8px;
}

.app-container .avatar {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    background: #16A085;
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
    font-weight: 600;
    font-size: 14px;
}

.app-container .avatar-sm {
    width: 32px;
    height: 32px;
    font-size: 12px;
}

.app-container .user-details h4 {
    font-size: 14px;
    font-weight: 600;
    margin: 0;
}

.app-container .user-details p {
    font-size: 12px;
    color: #6B7280;
    margin: 0;
}

.app-container .sidebar .menu {
    padding: 12px 12px 16px;
    flex: 0 1 auto;
}

.app-container .menu-section {
    margin-bottom: 8px;
}

.app-container .menu-section:last-child {
    margin-bottom: 0;
}

.app-container .menu-section-title {
    font-size: 11px;
    text-transform: uppercase;
    color: #9CA3AF;
    font-weight: 600;
    letter-spacing: 0.5px;
    padding: 6px 12px 2px;
    margin-bottom: 2px;
}

.app-container .menu-item {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 10px 12px;
    border-radius: 6px;
    cursor: pointer;
    transition: all 0.2s;
    font-size: 14px;
    color: #4B5563;
    text-decoration: none;
}

.app-container .menu-item:hover {
    background: #F3F4F6;
}

.app-container .menu-item.active {
    background: #E8F5F2;
    color: #16A085;
    font-weight: 600;
}

.app-container .menu-icon {
    font-size: 18px;
    width: 20px;
    text-align: center;
}

.app-container .main-content {
    flex: 1;
    display: flex;
    flex-direction: column;
    overflow: hidden;
    min-width: 0;
    width: 100%;
    max-width: none;
    margin: 0;
    padding: 0;
}

.app-container .gmao-header {
    background: white;
    border-bottom: 1px solid #E5E7EB;
    padding: 16px 24px;
    display: flex;
    align-items: center;
    gap: 16px;
    flex-shrink: 0;
}

.app-container .gmao-header .breadcrumb {
    font-size: 14px;
    color: #6B7280;
    flex: 1;
}

.app-container .gmao-header .breadcrumb strong {
    color: #1F2937;
}

.app-container .gmao-header .header-actions {
    display: flex;
    align-items: center;
    gap: 16px;
}

.app-container .gmao-header .search-bar {
    position: relative;
}

.app-container .gmao-header .search-bar input {
    width: 260px;
    padding: 8px 12px 8px 36px;
    border: 1px solid #E5E7EB;
    border-radius: 6px;
    font-size: 14px;
    outline: none;
}

.app-container .gmao-header .search-bar input:focus {
    border-color: #16A085;
}

.app-container .gmao-header .search-icon {
    position: absolute;
    left: 12px;
    top: 50%;
    transform: translateY(-50%);
    color: #9CA3AF;
}

.app-container .btn-primary,
.app-container .btn.btn-primary {
    background: #16A085;
    color: white;
    padding: 8px 16px;
    border-radius: 6px;
    border: none;
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    gap: 6px;
    text-decoration: none;
}

.app-container .btn-primary:hover,
.app-container .btn.btn-primary:hover {
    background: #138D75;
}

.app-container .btn-secondary,
.app-container .btn.btn-secondary {
    background: white;
    color: #16A085;
    border: 1px solid #16A085;
}

.app-container .btn-secondary:hover,
.app-container .btn.btn-secondary:hover {
    background: #E8F5F2;
}

.app-container .page-content {
    flex: 1;
    min-height: 0;
    overflow-y: auto;
    overflow-x: hidden;
    padding: 24px;
}

.app-container .page-title,
.app-container .dashboard-content h1,
.app-container .page-content h2.page-title {
    font-size: 28px;
    font-weight: 700;
    color: #1F2937;
    margin-bottom: 24px;
}

.app-container .gmao-menu-toggle {
    display: none;
    background: none;
    border: none;
    font-size: 1.5rem;
    cursor: pointer;
    padding: 0.5rem;
    color: #1F2937;
}

.app-container .gmao-footer {
    display: none;
}

.app-container ~ .gmao-footer {
    display: block;
    background: #333;
    color: white;
    text-align: center;
    padding: 1rem;
    font-size: 0.9rem;
}

/* Stats / KPI dans le layout GMAO */
.app-container .stats-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
    gap: 20px;
    margin-bottom: 24px;
}

.app-container .stat-card {
    background: white;
    border-radius: 10px;
    padding: 20px;
    border-top: 4px solid #16A085;
    box-shadow: 0 1px 3px rgba(0,0,0,0.1);
    color: #1F2937;
}

.app-container .stat-card h3 {
    font-size: 11px;
    text-transform: uppercase;
    color: #9CA3AF;
    font-weight: 600;
    letter-spacing: 0.5px;
    margin-bottom: 8px;
}

.app-container .stat-number {
    font-size: 32px;
    font-weight: 700;
    color: #16A085;
}

.app-container section {
    background: transparent;
    box-shadow: none;
    padding: 0;
    margin-bottom: 0;
}

.app-container .section-header h2 {
    color: #1F2937;
    font-size: 1.25rem;
}

.app-container .data-table thead {
    background: #F9FAFB;
    color: #1F2937;
}

.app-container .data-table th {
    color: #6B7280;
    font-size: 12px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.app-container .data-table th a {
    color: #6B7280;
}

.app-container .data-table th a:hover {
    color: #16A085;
}

.app-container .section-content {
    background: white;
    border-radius: 10px;
    padding: 20px;
    box-shadow: 0 1px 3px rgba(0,0,0,0.1);
    margin-top: 1rem;
}

/* Dashboard : graphiques (maquette) */
.app-container .chart-row {
    display: grid;
    grid-template-columns: 2fr 1fr;
    gap: 20px;
    margin-bottom: 24px;
}

.app-container .chart-card {
    background: white;
    border-radius: 10px;
    padding: 24px;
    box-shadow: 0 1px 3px rgba(0,0,0,0.1);
}

.app-container .chart-header {
    font-size: 16px;
    font-weight: 600;
    color: #1F2937;
    margin-bottom: 16px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    flex-wrap: wrap;
    gap: 12px;
}

.app-container .chart-select {
    padding: 6px 10px;
    border: 1px solid #E5E7EB;
    border-radius: 6px;
    font-size: 13px;
    color: #6B7280;
    background: white;
    outline: none;
}

.app-container .chart-select:focus {
    border-color: #16A085;
}

.app-container .chart-canvas-wrap {
    position: relative;
    height: 200px;
    width: 100%;
}

.app-container .chart-canvas-wrap canvas {
    max-height: 200px;
}

@media (max-width: 992px) {
    .app-container .chart-row {
        grid-template-columns: 1fr;
    }
}

.app-container .filters,
.app-container .filter-form {
    background: white;
    border-radius: 10px;
    padding: 20px;
    margin-bottom: 24px;
    box-shadow: 0 1px 3px rgba(0,0,0,0.1);
}

.app-container .badge-success { background: #D1FAE5; color: #059669; }
.app-container .badge-danger { background: #FEE2E2; color: #DC2626; }
.app-container .badge-warning { background: #FEF3C7; color: #D97706; }
.app-container .badge-info { background: #DBEAFE; color: #2563EB; }
.app-container .badge-primary { background: #E8F5F2; color: #16A085; }
.app-container .badge-secondary { background: #F3F4F6; color: #6B7280; }

/* ========== Page Machines (maquette) ========== */
.app-container .page-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 24px;
}

.app-container .stats-row-machines {
    display: grid;
    grid-template-columns: repeat(5, 1fr);
    gap: 16px;
    margin-bottom: 24px;
}

.app-container .stat-card-machines {
    background: white;
    border-radius: 10px;
    padding: 16px;
    box-shadow: 0 1px 3px rgba(0,0,0,0.1);
    border-left: 4px solid #16A085;
}

.app-container .stat-card-machines.success { border-left-color: #10B981; }
.app-container .stat-card-machines.warning { border-left-color: #F59E0B; }
.app-container .stat-card-machines.danger { border-left-color: #EF4444; }
.app-container .stat-card-machines.info { border-left-color: #3B82F6; }

.app-container .stat-card-machines .stat-label {
    font-size: 12px;
    color: #6B7280;
    margin-bottom: 4px;
}

.app-container .stat-card-machines .stat-value {
    font-size: 24px;
    font-weight: 700;
    color: #1F2937;
}

.app-container .filters-bar {
    background: white;
    border-radius: 10px;
    padding: 20px;
    margin-bottom: 24px;
    box-shadow: 0 1px 3px rgba(0,0,0,0.1);
}

.app-container .filters-title {
    font-size: 14px;
    font-weight: 600;
    color: #1F2937;
    margin-bottom: 12px;
}

.app-container .filters-bar .filters-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 16px;
    align-items: end;
}

.app-container .filters-bar .filter-group {
    display: flex;
    flex-direction: column;
    gap: 6px;
}

.app-container .filters-bar .filter-label {
    font-size: 12px;
    color: #6B7280;
    font-weight: 600;
}

.app-container .filters-bar .filter-input,
.app-container .filters-bar .filter-select {
    padding: 8px 12px;
    border: 1px solid #E5E7EB;
    border-radius: 6px;
    font-size: 14px;
    outline: none;
}

.app-container .filters-bar .filter-input:focus,
.app-container .filters-bar .filter-select:focus {
    border-color: #16A085;
}

.app-container .filters-bar .filter-group-actions {
    display: flex;
    gap: 8px;
    flex-wrap: wrap;
}

.app-container .machines-table {
    background: white;
    border-radius: 10px;
    box-shadow: 0 1px 3px rgba(0,0,0,0.1);
    overflow: hidden;
    margin-bottom: 24px;
}

.app-container .machines-table .table-header {
    padding: 16px 20px;
    border-bottom: 1px solid #E5E7EB;
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.app-container .machines-table .table-title {
    font-size: 16px;
    font-weight: 600;
    color: #1F2937;
    margin: 0;
}

.app-container .machines-table .table-actions {
    display: flex;
    gap: 12px;
}

.app-container .machines-table table {
    width: 100%;
    border-collapse: collapse;
}

.app-container .machines-table thead {
    background: #F9FAFB;
}

.app-container .machines-table th {
    padding: 12px 20px;
    text-align: left;
    font-size: 12px;
    font-weight: 600;
    color: #6B7280;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.app-container .machines-table th a {
    color: #6B7280;
    text-decoration: none;
}

.app-container .machines-table th a:hover {
    color: #16A085;
}

.app-container .machines-table tbody tr {
    border-bottom: 1px solid #F3F4F6;
    transition: background 0.2s;
}

.app-container .machines-table tbody tr:hover {
    background: #F9FAFB;
}

.app-container .machines-table td {
    padding: 16px 20px;
    font-size: 14px;
    color: #1F2937;
}

.app-container .machine-id {
    font-weight: 600;
    color: #16A085;
}

.app-container .machine-site-name {
    font-weight: 600;
    color: #1F2937;
    margin-bottom: 2px;
}

.app-container .machine-site {
    color: #6B7280;
    font-size: 13px;
}

.app-container .machines-table .status-badge {
    display: inline-block;
    padding: 4px 12px;
    border-radius: 12px;
    font-size: 12px;
    font-weight: 600;
}

.app-container .machines-table .status-badge.active {
    background: #D1FAE5;
    color: #059669;
}

.app-container .machines-table .status-badge.maintenance {
    background: #FEF3C7;
    color: #D97706;
}

.app-container .machines-table .status-badge.broken {
    background: #FEE2E2;
    color: #DC2626;
}

.app-container .machines-table .status-badge.inactive {
    background: #F3F4F6;
    color: #6B7280;
}

.app-container .priority-badge {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    font-size: 13px;
}

.app-container .priority-dot {
    width: 8px;
    height: 8px;
    border-radius: 50%;
}

.app-container .priority-dot.high { background: #EF4444; }
.app-container .priority-dot.medium { background: #F59E0B; }
.app-container .priority-dot.low { background: #10B981; }

.app-container .machines-table .action-btn {
    padding: 6px 12px;
    border: 1px solid #E5E7EB;
    border-radius: 4px;
    background: white;
    cursor: pointer;
    font-size: 13px;
    color: #4B5563;
    transition: all 0.2s;
    text-decoration: none;
    display: inline-block;
    margin-right: 6px;
}

.app-container .machines-table .action-btn:hover {
    background: #F9FAFB;
    border-color: #16A085;
    color: #16A085;
}

.app-container .machines-table .action-btn-danger:hover {
    border-color: #DC2626;
    color: #DC2626;
}

.app-container .machines-table .pagination {
    padding: 16px 20px;
    border-top: 1px solid #E5E7EB;
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.app-container .pagination-info {
    font-size: 14px;
    color: #6B7280;
}

.app-container .pagination-controls {
    display: flex;
    gap: 8px;
}

.app-container .page-btn {
    padding: 6px 12px;
    border: 1px solid #E5E7EB;
    border-radius: 4px;
    background: white;
    font-size: 14px;
    color: #4B5563;
}

.app-container .page-btn.active {
    background: #16A085;
    color: white;
    border-color: #16A085;
}

.app-container .machines-map-card {
    background: white;
    border-radius: 10px;
    box-shadow: 0 1px 3px rgba(0,0,0,0.1);
    overflow: hidden;
    margin-bottom: 24px;
}

.app-container .machines-map-card .table-header {
    padding: 16px 20px;
    border-bottom: 1px solid #E5E7EB;
}

.app-container .machines-map-card .table-title {
    font-size: 16px;
    font-weight: 600;
    color: #1F2937;
    margin: 0;
}

.app-container .map-search-bar {
    padding: 16px 20px;
    display: flex;
    gap: 12px;
    flex-wrap: wrap;
    align-items: center;
}

.app-container .map-search-bar label {
    font-size: 12px;
    font-weight: 600;
    color: #6B7280;
}

.app-container .map-search-bar input {
    padding: 8px 12px;
    border: 1px solid #E5E7EB;
    border-radius: 6px;
    font-size: 14px;
    min-width: 200px;
}

.app-container .map-search-results {
    padding: 0 20px 8px;
    font-size: 13px;
    color: #6B7280;
}

.app-container .machines-map-card #map {
    height: 400px;
    margin: 0 20px 20px;
    border-radius: 8px;
}

/* ========== Page Interventions (maquette) ========== */
.app-container .stats-row-interventions {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 16px;
    margin-bottom: 24px;
}

.app-container .stat-card-interventions {
    background: white;
    border-radius: 10px;
    padding: 16px;
    box-shadow: 0 1px 3px rgba(0,0,0,0.1);
    border-left: 4px solid #16A085;
}

.app-container .stat-card-interventions.urgent { border-left-color: #EF4444; }
.app-container .stat-card-interventions.progress { border-left-color: #3B82F6; }
.app-container .stat-card-interventions.pending { border-left-color: #F59E0B; }
.app-container .stat-card-interventions.done { border-left-color: #10B981; }

.app-container .stat-card-interventions .stat-label {
    font-size: 12px;
    color: #6B7280;
    margin-bottom: 4px;
    text-transform: uppercase;
    font-weight: 600;
    letter-spacing: 0.5px;
}

.app-container .stat-card-interventions .stat-value {
    font-size: 24px;
    font-weight: 700;
    color: #1F2937;
}

.app-container .stat-card-interventions .stat-subtitle {
    font-size: 13px;
    color: #6B7280;
    margin-top: 4px;
}

/* Table interventions : réutilise le style machines-table */
.app-container .interventions-table {
    background: white;
    border-radius: 10px;
    box-shadow: 0 1px 3px rgba(0,0,0,0.1);
    margin-bottom: 24px;
}

.app-container .interventions-table .table-header,
.app-container .interventions-table .table-title,
.app-container .interventions-table .table-actions,
.app-container .interventions-table table,
.app-container .interventions-table thead,
.app-container .interventions-table th,
.app-container .interventions-table th a,
.app-container .interventions-table tbody tr,
.app-container .interventions-table td,
.app-container .interventions-table .pagination,
.app-container .interventions-table .pagination-info,
.app-container .interventions-table .pagination-controls,
.app-container .interventions-table .page-btn {
    /* Hérite du style .machines-table */
}
.app-container .interventions-table .table-header {
    padding: 16px 20px;
    border-bottom: 1px solid #E5E7EB;
    display: flex;
    align-items: center;
    justify-content: space-between;
}
.app-container .interventions-table .table-title { font-size: 16px; font-weight: 600; color: #1F2937; margin: 0; }
.app-container .interventions-table .table-actions { display: flex; gap: 12px; }
.app-container .interventions-table table { width: 100%; border-collapse: collapse; }
.app-container .interventions-table thead { background: #F9FAFB; }
.app-container .interventions-table th {
    padding: 12px 20px;
    text-align: left;
    font-size: 12px;
    font-weight: 600;
    color: #6B7280;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}
.app-container .interventions-table th a { color: #6B7280; text-decoration: none; }
.app-container .interventions-table th a:hover { color: #16A085; }
.app-container .interventions-table tbody tr { border-bottom: 1px solid #F3F4F6; transition: background 0.2s; }
.app-container .interventions-table tbody tr:hover { background: #F9FAFB; }
.app-container .interventions-table td { padding: 16px 20px; font-size: 14px; color: #1F2937; }
.app-container .interventions-table .intervention-id { font-weight: 600; color: #16A085; }
.app-container .interventions-table .status-badge {
    display: inline-block;
    padding: 4px 12px;
    border-radius: 12px;
    font-size: 12px;
    font-weight: 600;
}
.app-container .interventions-table .status-badge-done { background: #D1FAE5; color: #059669; }
.app-container .interventions-table .status-badge-progress { background: #DBEAFE; color: #2563EB; }
.app-container .interventions-table .status-badge-pending { background: #FEF3C7; color: #D97706; }
.app-container .interventions-table .status-badge-danger { background: #FEE2E2; color: #DC2626; }
.app-container .interventions-table .status-badge-info { background: #DBEAFE; color: #2563EB; }
.app-container .interventions-table .status-badge-secondary { background: #F3F4F6; color: #6B7280; }
.app-container .interventions-table .action-btn {
    padding: 6px 12px;
    border: 1px solid #E5E7EB;
    border-radius: 4px;
    background: white;
    cursor: pointer;
    font-size: 13px;
    color: #4B5563;
    transition: all 0.2s;
    text-decoration: none;
    display: inline-block;
    margin-right: 6px;
}
.app-container .interventions-table .action-btn:hover { background: #F9FAFB; border-color: #16A085; color: #16A085; }
.app-container .interventions-table .action-btn-danger:hover { border-color: #DC2626; color: #DC2626; }
.app-container .interventions-table .pagination {
    padding: 16px 20px;
    border-top: 1px solid #E5E7EB;
    display: flex;
    align-items: center;
    justify-content: space-between;
}
.app-container .interventions-table .pagination-info { font-size: 14px; color: #6B7280; }
.app-container .interventions-table .pagination-controls { display: flex; gap: 8px; }
.app-container .interventions-table .page-btn {
    padding: 6px 12px;
    border: 1px solid #E5E7EB;
    border-radius: 4px;
    background: white;
    font-size: 14px;
    color: #4B5563;
}
.app-container .interventions-table .page-btn.active { background: #16A085; color: white; border-color: #16A085; }

@media (max-width: 992px) {
    .app-container .stats-row-machines {
        grid-template-columns: repeat(3, 1fr);
    }
    .app-container .stats-row-interventions {
        grid-template-columns: repeat(2, 1fr);
    }
    .app-container .filters-bar .filters-grid {
        grid-template-columns: repeat(2, 1fr);
    }
}

@media (max-width: 768px) {
    .app-container .stats-row-machines {
        grid-template-columns: repeat(2, 1fr);
    }
    .app-container .filters-bar .filters-grid {
        grid-template-columns: 1fr;
    }
    .app-container .machines-table .table-header {
        flex-direction: column;
        align-items: flex-start;
        gap: 12px;
    }
    .app-container .machines-table,
    .app-container .interventions-table {
        overflow-x: auto;
        -webkit-overflow-scrolling: touch;
    }
    .app-container .machines-table .pagination {
        flex-direction: column;
        gap: 12px;
    }
}

/* Responsive sidebar */
@media (max-width: 768px) {
    .app-container .sidebar {
        position: fixed;
        left: 0;
        top: 0;
        height: 100vh;
        transform: translateX(-100%);
        transition: transform 0.3s ease;
    }
    .app-container .sidebar.open {
        transform: translateX(0);
    }
    .app-container .gmao-menu-toggle {
        display: block;
    }
    .app-container .gmao-header .search-bar input {
        width: 160px;
    }
    body.sidebar-open::after {
        content: '';
        position: fixed;
        inset: 0;
        background: rgba(0,0,0,0.4);
        z-index: 99;
    }
}

/* Header (ancien layout) */
header {
    background: #003366;
    color: white;
    padding: 1rem 1.5rem;
    box-shadow: 0 2px 10px rgba(0,0,0,0.1);
    position: relative;
}

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

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

.header-logo img {
    height: 40px;
    width: auto;
    max-width: 150px;
    object-fit: contain;
}

header h1 {
    font-size: 1.5rem;
    margin: 0;
    font-weight: 500;
}

header .header-title-only {
    display: none;
}

/* Bouton hamburger pour mobile */
.menu-toggle {
    display: none;
    background: none;
    border: none;
    color: white;
    font-size: 1.8rem;
    cursor: pointer;
    padding: 0.5rem;
    margin-left: 1rem;
    transition: transform 0.3s;
}

.menu-toggle:hover {
    transform: scale(1.1);
}

.menu-toggle.active {
    transform: rotate(90deg);
}

nav {
    display: flex;
    gap: 1rem;
    flex-wrap: wrap;
}

nav a {
    color: white;
    text-decoration: none;
    padding: 0.5rem 1rem;
    border-radius: 5px;
    transition: background-color 0.3s;
    white-space: nowrap;
}

nav a:hover {
    background-color: rgba(255,255,255,0.2);
}

nav a.active {
    background-color: rgba(255,255,255,0.3);
    font-weight: bold;
}

/* Menu mobile */
.mobile-menu {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100vh;
    background: #003366;
    z-index: 9999;
    padding: 2rem;
    overflow-y: auto;
    transform: translateX(-100%);
    transition: transform 0.3s ease-in-out;
}

.mobile-menu-logo {
    text-align: center;
    margin-bottom: 2rem;
    padding-bottom: 1rem;
    border-bottom: 1px solid rgba(255,255,255,0.3);
}

.mobile-menu-logo img {
    height: 50px;
    width: auto;
    max-width: 200px;
    object-fit: contain;
}

.mobile-menu.active {
    transform: translateX(0);
}

.mobile-menu-header {
    margin-bottom: 2rem;
}

.mobile-menu-header h2 {
    color: white;
    font-size: 1.5rem;
    margin: 0;
    display: none;
}

.mobile-menu-close {
    background: none;
    border: none;
    color: white;
    font-size: 2rem;
    cursor: pointer;
    padding: 0.5rem;
    line-height: 1;
}

.mobile-menu nav {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

.mobile-menu nav a {
    display: block;
    padding: 1rem;
    font-size: 1.1rem;
    border-radius: 8px;
    text-align: left;
    background-color: rgba(255,255,255,0.1);
}

.mobile-menu nav a:hover,
.mobile-menu nav a.active {
    background-color: rgba(255,255,255,0.3);
}

/* Main content */
main {
    max-width: 1400px;
    margin: 2rem auto;
    padding: 0 2rem;
}

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

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

.section-header h2 {
    color: #667eea;
    font-size: 1.5rem;
}

.section-content {
    margin-top: 1.5rem;
}

/* Buttons */
.btn {
    padding: 0.6rem 1.2rem;
    border: none;
    border-radius: 5px;
    cursor: pointer;
    font-size: 0.9rem;
    transition: all 0.3s;
    text-decoration: none;
    display: inline-block;
    text-align: center;
}

.btn-primary {
    background-color: #667eea;
    color: white;
}

.btn-primary:hover {
    background-color: #5568d3;
}

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

.btn-secondary:hover {
    background-color: #5a6268;
}

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

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

.btn-sm {
    padding: 0.4rem 0.8rem;
    font-size: 0.85rem;
}

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

.stat-card {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    padding: 1.5rem;
    border-radius: 8px;
    text-align: center;
    box-shadow: 0 4px 6px rgba(0,0,0,0.1);
}

.stat-card h3 {
    font-size: 0.9rem;
    margin-bottom: 0.5rem;
    opacity: 0.9;
}

.stat-number {
    font-size: 2.5rem;
    font-weight: bold;
}

/* Tables */
.data-table {
    width: 100%;
    border-collapse: collapse;
    margin-top: 1rem;
}

.data-table thead {
    background-color: #667eea;
    color: white;
}

.data-table th {
    padding: 1rem;
    text-align: left;
    font-weight: 600;
}

.data-table th a {
    color: white;
    text-decoration: none;
    display: flex;
    align-items: center;
    gap: 0.5rem;
    transition: opacity 0.2s;
}

.data-table th a:hover {
    opacity: 0.8;
    text-decoration: underline;
}

.data-table th a span {
    font-size: 0.9em;
    font-weight: bold;
}

.data-table td {
    padding: 0.8rem 1rem;
    border-bottom: 1px solid #e0e0e0;
}

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

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

/* Badges */
.badge {
    display: inline-block;
    padding: 0.25rem 0.6rem;
    border-radius: 12px;
    font-size: 0.8rem;
    font-weight: 500;
}

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

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

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

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

.badge-primary {
    background-color: #007bff;
    color: white;
}

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

/* Modal */
.modal {
    display: none;
    position: fixed;
    z-index: 1000;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0,0,0,0.5);
    overflow: auto;
}

.modal-content {
    background-color: white;
    margin: 5% auto;
    padding: 2rem;
    border-radius: 8px;
    width: 90%;
    max-width: 600px;
    box-shadow: 0 4px 20px rgba(0,0,0,0.3);
    position: relative;
}

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

.close {
    color: #aaa;
    float: right;
    font-size: 28px;
    font-weight: bold;
    cursor: pointer;
    position: absolute;
    right: 1rem;
    top: 1rem;
}

.close:hover {
    color: #000;
}

/* Forms */
.form-group {
    margin-bottom: 1.2rem;
}

.form-group label {
    display: block;
    margin-bottom: 0.5rem;
    font-weight: 500;
    color: #555;
}

.form-group input,
.form-group select,
.form-group textarea {
    width: 100%;
    padding: 0.7rem;
    border: 1px solid #ddd;
    border-radius: 5px;
    font-size: 0.9rem;
    font-family: inherit;
}

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

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

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

/* Filters */
.filters {
    background-color: #f8f9fa;
    padding: 1rem;
    border-radius: 5px;
    margin-bottom: 1.5rem;
}

.filter-form {
    display: flex;
    gap: 1rem;
    flex-wrap: wrap;
    align-items: center;
}

.filter-form select,
.filter-form input {
    padding: 0.5rem;
    border: 1px solid #ddd;
    border-radius: 5px;
}

.inline-form {
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.inline-form label {
    margin: 0;
    font-weight: 500;
}

.planning-controls {
    display: flex;
    gap: 1rem;
    flex-wrap: wrap;
    align-items: center;
}

/* Planning */
.planning-grid {
    display: grid;
    grid-template-columns: 200px repeat(7, 1fr);
    gap: 1px;
    background-color: #ddd;
    border: 1px solid #ddd;
    margin-top: 1rem;
    overflow-x: auto;
}

.planning-header {
    display: contents;
}

.planning-col-header {
    background-color: #667eea;
    color: white;
    padding: 1rem;
    text-align: center;
    font-weight: 600;
    position: sticky;
    left: 0;
    z-index: 10;
}

.planning-col-header.today {
    background-color: #764ba2;
}

.day-name {
    font-size: 0.9rem;
    margin-bottom: 0.3rem;
}

.day-date {
    font-size: 1.1rem;
}

.planning-row {
    display: contents;
}

.planning-col-name {
    background-color: #f8f9fa;
    padding: 1rem;
    font-weight: 500;
    position: sticky;
    left: 0;
    z-index: 5;
    border-right: 2px solid #ddd;
}

.planning-col-name strong {
    display: block;
    margin-bottom: 0.3rem;
}

.planning-col-name small {
    color: #666;
    font-size: 0.85rem;
}

.planning-col {
    background-color: white;
    padding: 0.5rem;
    min-height: 100px;
    position: relative;
    transition: background-color 0.2s, border-color 0.2s;
}

.planning-col.today {
    background-color: #fff9e6;
}

.planning-col.drag-over {
    background-color: #e8f5e9;
    border: 2px dashed #4caf50;
    border-radius: 4px;
}

.intervention-card {
    background-color: #e3f2fd;
    border-left: 4px solid #2196f3;
    padding: 0.5rem;
    margin-bottom: 0.5rem;
    border-radius: 4px;
    cursor: move;
    transition: transform 0.2s, opacity 0.2s;
    font-size: 0.85rem;
    user-select: none;
}

.intervention-card:hover {
    transform: scale(1.02);
    box-shadow: 0 2px 4px rgba(0,0,0,0.2);
}

.intervention-card.dragging {
    opacity: 0.5;
    transform: scale(0.95);
    cursor: grabbing;
}

.intervention-card.intervention-curative {
    background-color: #ffebee;
    border-left-color: #f44336;
}

.intervention-card.intervention-preventive {
    background-color: #e3f2fd;
    border-left-color: #2196f3;
}

.intervention-card.intervention-terminee {
    opacity: 0.7;
    background-color: #e8f5e9;
    border-left-color: #4caf50;
}

.intervention-card.intervention-en_cours {
    background-color: #fff3e0;
    border-left-color: #ff9800;
}

.intervention-time {
    font-weight: bold;
    color: #333;
    margin-bottom: 0.2rem;
}

.intervention-machine {
    font-weight: 500;
    color: #555;
    margin-bottom: 0.2rem;
}

.intervention-type {
    font-size: 0.75rem;
    color: #666;
    margin-bottom: 0.2rem;
}

.intervention-status {
    font-size: 0.7rem;
    color: #888;
    font-style: italic;
}

/* Footer */
footer {
    background-color: #333;
    color: white;
    text-align: center;
    padding: 1.5rem;
    margin-top: 3rem;
}

/* Styles pour les cartes Leaflet */
.custom-marker {
    background: transparent;
    border: none;
}

.leaflet-container {
    font-family: inherit;
}

/* Styles pour le bouton d'installation PWA */
.pwa-install-button {
    animation: slideInUp 0.5s ease-out;
}

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

@keyframes slideIn {
    from {
        transform: translateX(100%);
        opacity: 0;
    }
    to {
        transform: translateX(0);
        opacity: 1;
    }
}

@keyframes slideOut {
    from {
        transform: translateX(0);
        opacity: 1;
    }
    to {
        transform: translateX(100%);
        opacity: 0;
    }
}

/* Responsive */
@media (max-width: 768px) {
    header {
        padding: 1rem;
    }
    
    header h1 {
        font-size: 1.2rem;
    }
    
    .header-logo img {
        height: 35px;
        max-width: 120px;
    }
    
    .header-title-only {
        display: block !important;
    }
    
    /* Afficher le bouton hamburger sur mobile */
    .menu-toggle {
        display: block;
    }
    
    /* Masquer le menu desktop sur mobile */
    header nav {
        display: none;
    }
    
    /* Afficher le menu mobile */
    .mobile-menu {
        display: block;
    }
    
    main {
        padding: 0 1rem;
        margin: 1rem auto;
    }
    
    section {
        padding: 1rem;
        margin-bottom: 1rem;
    }
    
    .section-header {
        flex-direction: column;
        align-items: flex-start;
    }
    
    .section-header h2 {
        font-size: 1.2rem;
    }
    
    .stats-grid {
        grid-template-columns: 1fr;
        gap: 1rem;
    }
    
    .stat-card {
        padding: 1rem;
    }
    
    .stat-number {
        font-size: 2rem;
    }
    
    .data-table {
        font-size: 0.75rem;
        display: block;
        overflow-x: auto;
        -webkit-overflow-scrolling: touch;
    }
    
    .data-table thead,
    .data-table tbody,
    .data-table tr {
        display: block;
    }
    
    .data-table thead {
        display: none;
    }
    
    .data-table tr {
        margin-bottom: 1rem;
        border: 1px solid #ddd;
        border-radius: 5px;
        padding: 0.5rem;
        background: white;
    }
    
    .data-table td {
        display: flex;
        justify-content: space-between;
        padding: 0.5rem;
        border: none;
        border-bottom: 1px solid #eee;
    }
    
    .data-table td:last-child {
        border-bottom: none;
    }
    
    .data-table td:before {
        content: attr(data-label);
        font-weight: bold;
        margin-right: 1rem;
        flex: 0 0 40%;
    }
    
    .data-table td.actions-cell {
        flex-direction: column;
        align-items: stretch;
    }
    
    .data-table td.actions-cell:before {
        margin-bottom: 0.5rem;
    }
    
    .actions-buttons {
        display: flex;
        flex-direction: column;
        gap: 0.5rem;
        width: 100%;
    }
    
    .actions-buttons .btn {
        width: 100%;
        margin: 0;
    }
    
    .planning-grid {
        grid-template-columns: 120px repeat(7, 100px);
        font-size: 0.7rem;
        overflow-x: auto;
    }
    
    .planning-col-name {
        padding: 0.5rem;
        font-size: 0.75rem;
    }
    
    .planning-col-header {
        padding: 0.5rem;
        font-size: 0.75rem;
    }
    
    .planning-col {
        min-height: 80px;
        padding: 0.25rem;
    }
    
    .intervention-card {
        font-size: 0.7rem;
        padding: 0.4rem;
    }
    
    .modal-content {
        width: 95%;
        margin: 2% auto;
        padding: 1rem;
        max-height: 95vh;
        overflow-y: auto;
        border-radius: 8px;
    }
    
    .modal-large {
        width: 95%;
    }
    
    .form-row {
        grid-template-columns: 1fr;
        gap: 1rem;
    }
    
    .form-group {
        margin-bottom: 1rem;
    }
    
    .form-group label {
        display: block;
        margin-bottom: 0.5rem;
        font-weight: 600;
        font-size: 0.9rem;
    }
    
    .form-group select,
    .form-group input,
    .form-group textarea {
        width: 100%;
        padding: 0.75rem;
        font-size: 0.9rem;
        box-sizing: border-box;
    }
    
    .form-actions {
        flex-direction: column;
        gap: 0.75rem;
        margin-top: 1.5rem;
    }
    
    .form-actions .btn {
        width: 100%;
        margin: 0;
        padding: 0.85rem;
    }
    
    .btn {
        padding: 0.7rem 1rem;
        font-size: 0.9rem;
        white-space: nowrap;
    }
    
    .btn-sm {
        padding: 0.5rem 0.75rem;
        font-size: 0.85rem;
    }
    
    .filters {
        padding: 1rem;
        background: #f8f9fa;
        border-radius: 5px;
        margin-bottom: 1rem;
    }
    
    .filter-form {
        flex-direction: column;
        gap: 0.75rem;
    }
    
    .filter-form select,
    .filter-form input {
        width: 100%;
        margin-bottom: 0;
        padding: 0.75rem;
        font-size: 0.9rem;
        box-sizing: border-box;
    }
    
    .filter-form .btn {
        width: 100%;
        margin-top: 0.5rem;
    }
    
    .section-header {
        flex-direction: column;
        gap: 1rem;
    }
    
    .section-header .btn {
        width: 100%;
    }
    
    .filter-form {
        flex-direction: column;
        align-items: stretch;
    }
    
    .filter-form select,
    .filter-form input {
        width: 100%;
        margin-bottom: 0.5rem;
    }
    
    #map {
        height: 300px;
    }
    
    #miniMap {
        height: 250px;
    }
    
    .address-search-container {
        flex-direction: column;
    }
    
    .address-search-container button {
        width: 100%;
    }
    
    .pwa-install-button {
        bottom: 10px;
        right: 10px;
        padding: 10px 16px;
        font-size: 12px;
    }
}

@media (max-width: 480px) {
    header h1 {
        font-size: 1rem;
    }
    
    .section-header h2 {
        font-size: 1.1rem;
    }
    
    .stat-number {
        font-size: 1.8rem;
    }
    
    .planning-grid {
        grid-template-columns: 100px repeat(7, 80px);
    }
    
    .modal-content {
        padding: 0.75rem;
        width: 98%;
        margin: 1% auto;
    }
    
    .data-table {
        font-size: 0.7rem;
    }
    
    .data-table td {
        padding: 0.4rem;
        font-size: 0.8rem;
    }
    
    .data-table td:before {
        flex: 0 0 35%;
        font-size: 0.75rem;
    }
    
    .actions-buttons .btn {
        font-size: 0.8rem;
        padding: 0.5rem;
    }
    
    .filter-form select {
        font-size: 0.85rem;
        padding: 0.65rem;
    }
    
    .btn-sm {
        padding: 0.4rem 0.6rem;
        font-size: 0.75rem;
    }
}

/* ========== Page de connexion ========== */
.login-page {
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    background: linear-gradient(135deg, #16A085 0%, #1ABC9C 100%);
    padding: 1rem;
}
.login-box {
    background: white;
    border-radius: 12px;
    box-shadow: 0 10px 40px rgba(0,0,0,0.15);
    padding: 2.5rem;
    width: 100%;
    max-width: 380px;
}
.login-box h1 {
    color: #16A085;
    font-size: 28px;
    text-align: center;
    margin-bottom: 0.5rem;
}
.login-subtitle {
    text-align: center;
    color: #6B7280;
    font-size: 0.9rem;
    margin-bottom: 1.5rem;
}
.login-form .form-group {
    margin-bottom: 1.25rem;
}
.login-form .form-group label {
    display: block;
    margin-bottom: 0.35rem;
    font-weight: 500;
    color: #374151;
}
.login-form input[type="text"],
.login-form input[type="email"],
.login-form input[type="password"] {
    width: 100%;
    padding: 0.75rem 1rem;
    border: 1px solid #E5E7EB;
    border-radius: 8px;
    font-size: 1rem;
}
.login-form input:focus {
    outline: none;
    border-color: #16A085;
    box-shadow: 0 0 0 3px rgba(22, 160, 133, 0.15);
}
.btn-block {
    width: 100%;
    padding: 0.75rem 1rem;
    margin-top: 0.5rem;
    font-size: 1rem;
}
.login-error {
    background: #FEE2E2;
    color: #DC2626;
    padding: 0.75rem;
    border-radius: 8px;
    margin-bottom: 1rem;
    font-size: 0.9rem;
}
.login-success {
    background: #D1FAE5;
    color: #065F46;
    padding: 0.75rem;
    border-radius: 8px;
    margin-bottom: 1rem;
    font-size: 0.9rem;
}
.login-hint {
    margin-top: 1.25rem;
    text-align: center;
    font-size: 0.8rem;
    color: #6B7280;
}
.login-hint strong {
    color: #374151;
}
.login-hint a {
    color: #16A085;
    text-decoration: none;
}
.login-hint a:hover {
    text-decoration: underline;
}

