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

:root {
    --primary: #2c3e50;
    --secondary: #3498db;
    --success: #27ae60;
    --warning: #f39c12;
    --danger: #e74c3c;
    --light: #ecf0f1;
    --dark: #34495e;
    --white: #ffffff;
    --gray: #95a5a6;
    --border-radius: 8px;
    --transition: all 0.3s ease;
}

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;
    background-color: #f5f6fa;
    color: var(--dark);
    line-height: 1.6;
}

/* Layout */
.app-container {
    display: flex;
    height: 100vh;
    overflow: hidden;
}

/* Sidebar */
.sidebar {
    width: 260px;
    background: var(--primary);
    color: var(--white);
    transition: var(--transition);
    overflow-y: auto;
    box-shadow: 2px 0 10px rgba(0,0,0,0.1);
}

.sidebar.collapsed {
    width: 70px;
 
}

.sidebar-header {
    padding: 20px;
    background: rgba(0,0,0,0.2);
    text-align: center;
    border-bottom: 1px solid rgba(255,255,255,0.1);
}

.logo {
    font-size: 24px;
    font-weight: bold;
    color: var(--secondary);
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
}

.sidebar.collapsed .logo  {
    height: 25px;
 
}

.sidebar.collapsed .logo img {
    height: 50px !important;
    width: 60px !important;
 
}


.nav-menu {
    padding: 20px 0;
}

.nav-item {
    padding: 15px 20px;
    cursor: pointer;
    transition: var(--transition);
    display: flex;
    align-items: center;
    gap: 15px;
    position: relative;
    color: rgba(255,255,255,0.8);
    text-decoration: none;
}

.nav-item:hover {
    background: rgba(255,255,255,0.1);
    color: var(--white);
}

.nav-item.active {
    background: var(--secondary);
    color: var(--white);
}

.nav-item i {
    font-size: 20px;
    width: 25px;
    text-align: center;
}

.sidebar.collapsed .nav-item span {
    display: none;
}

.sidebar.collapsed .nav-item {
    justify-content: center;
    padding: 15px;
}

/* Main Content */
.main-content {
    flex: 1;
    display: flex;
    flex-direction: column;
    overflow: hidden;
}

/* Header */
.header {
    background: var(--white);
    padding: 15px 30px;
    box-shadow: 0 2px 10px rgba(0,0,0,0.05);
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.header-left {
    display: flex;
    align-items: center;
    gap: 20px;
}

.toggle-sidebar {
    background: none;
    border: none;
    font-size: 24px;
    cursor: pointer;
    color: var(--dark);
    transition: var(--transition);
}

.toggle-sidebar:hover {
    color: var(--secondary);
}

.search-bar {
    position: relative;
    width: 300px;
}

.search-bar input {
    width: 100%;
    padding: 10px 40px 10px 15px;
    border: 1px solid #ddd;
    border-radius: var(--border-radius);
    font-size: 14px;
    transition: var(--transition);
}

.search-bar input:focus {
    outline: none;
    border-color: var(--secondary);
    box-shadow: 0 0 0 3px rgba(52, 152, 219, 0.1);
}

.search-bar i {
    position: absolute;
    right: 15px;
    top: 50%;
    transform: translateY(-50%);
    color: var(--gray);
}

.header-right {
    display: flex;
    align-items: center;
    gap: 25px;
}

.header-btn {
    background: none;
    border: none;
    font-size: 20px;
    cursor: pointer;
    color: var(--dark);
    position: relative;
    transition: var(--transition);
}

.header-btn:hover {
    color: var(--secondary);
}

.notification-badge {
    position: absolute;
    top: -5px;
    right: -5px;
    background: var(--danger);
    color: var(--white);
    font-size: 11px;
    padding: 2px 6px;
    border-radius: 10px;
    font-weight: bold;
    display: none;
}

.notification-badge.active {
    display: block;
}

.user-profile {
    display: flex;
    align-items: center;
    gap: 10px;
    cursor: pointer;
    padding: 8px 15px;
    border-radius: var(--border-radius);
    transition: var(--transition);
}

.user-profile:hover {
    background: var(--light);
}

.user-avatar {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    background: var(--secondary);
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--white);
    font-weight: bold;
}

/* Content Area */
.content {
    flex: 1;
    padding: 30px;
    overflow-y: auto;
    background: #f5f6fa;
}

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

.stat-card {
    background: var(--white);
    padding: 25px;
    border-radius: var(--border-radius);
    box-shadow: 0 2px 10px rgba(0,0,0,0.05);
    transition: var(--transition);
    border-left: 4px solid transparent;
    cursor: pointer;
}

.stat-card:hover {
    transform: translateY(-2px);
    box-shadow: 0 5px 20px rgba(0,0,0,0.1);
}

.stat-card.primary { border-left-color: var(--secondary); }
.stat-card.success { border-left-color: var(--success); }
.stat-card.warning { border-left-color: var(--warning); }
.stat-card.danger { border-left-color: var(--danger); }

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

.stat-icon {
    font-size: 28px;
    opacity: 0.8;
}

.stat-value {
    font-size: 32px;
    font-weight: bold;
    margin-bottom: 5px;
}

.stat-label {
    color: var(--gray);
    font-size: 14px;
}

.stat-trend {
    display: flex;
    align-items: center;
    gap: 5px;
    font-size: 14px;
    margin-top: 10px;
}

.trend-up { color: var(--success); }
.trend-down { color: var(--danger); }

/* Weather Widget */
.weather-widget {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: var(--white);
    padding: 20px;
    border-radius: var(--border-radius);
    display: flex;
    align-items: center;
    gap: 20px;
    margin-bottom: 30px;
}

.weather-icon {
    font-size: 48px;
}

.weather-info h3 {
    font-size: 28px;
    margin-bottom: 5px;
}

.weather-details {
    display: flex;
    gap: 15px;
    font-size: 14px;
    opacity: 0.9;
}

.weather-forecast {
    display: flex;
    gap: 20px;
    margin-top: 20px;
    padding-top: 20px;
    border-top: 1px solid rgba(255,255,255,0.3);
}

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

.forecast-day .day {
    font-size: 12px;
    opacity: 0.8;
    margin-bottom: 5px;
}

.forecast-day .temp {
    font-weight: bold;
}

/* Tables */
.table-container {
    background: var(--white);
    padding: 25px;
    border-radius: var(--border-radius);
    box-shadow: 0 2px 10px rgba(0,0,0,0.05);
    overflow-x: auto;
}

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

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

th {
    background: #f8f9fa;
    font-weight: 600;
    color: var(--dark);
    white-space: nowrap;
}

tr:hover {
    background: #f8f9fa;
}

.status-badge {
    padding: 5px 12px;
    border-radius: 20px;
    font-size: 12px;
    font-weight: 500;
    display: inline-block;
}

.status-confirmed { background: #d4edda; color: #155724; }
.status-pending { background: #fff3cd; color: #856404; }
.status-completed { background: #cce5ff; color: #004085; }
.status-cancelled { background: #f8d7da; color: #721c24; }
.status-paid { background: #d4edda; color: #155724; }
.status-unpaid { background: #f8d7da; color: #721c24; }

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

label {
    display: block;
    margin-bottom: 8px;
    font-weight: 500;
    color: var(--dark);
}

input, select, textarea {
    width: 100%;
    padding: 10px 15px;
    border: 1px solid #ddd;
    border-radius: var(--border-radius);
    font-size: 14px;
    transition: var(--transition);
    font-family: inherit;
}

input:focus, select:focus, textarea:focus {
    outline: none;
    border-color: var(--secondary);
    box-shadow: 0 0 0 3px rgba(52, 152, 219, 0.1);
}

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

/* Checkboxes */
.checkbox-group {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
    gap: 10px;
    margin-top: 10px;
}

.checkbox-item {
    display: flex;
    align-items: center;
    gap: 8px;
    cursor: pointer;
}

.checkbox-item input[type="checkbox"] {
    width: auto;
    margin: 0;
    cursor: pointer;
}

/* Buttons */
.btn {
    padding: 10px 20px;
    border: none;
    border-radius: var(--border-radius);
    font-size: 14px;
    font-weight: 500;
    cursor: pointer;
    transition: var(--transition);
    display: inline-flex;
    align-items: center;
    gap: 8px;
    text-decoration: none;
}

.btn:disabled {
    opacity: 0.6;
    cursor: not-allowed;
}

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

.btn-primary:hover:not(:disabled) {
    background: #2980b9;
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(52, 152, 219, 0.3);
}

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

.btn-success:hover:not(:disabled) {
    background: #229954;
}

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

.btn-danger:hover:not(:disabled) {
    background: #c0392b;
}

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

.btn-warning:hover:not(:disabled) {
    background: #e67e22;
}

.btn-outline {
    background: transparent;
    border: 1px solid var(--secondary);
    color: var(--secondary);
}

.btn-outline:hover:not(:disabled) {
    background: var(--secondary);
    color: var(--white);
}

/* Action Buttons */
.action-btn {
    padding: 8px;
    border: 1px solid #ddd;
    background: var(--white);
    border-radius: var(--border-radius);
    cursor: pointer;
    transition: var(--transition);
    font-size: 13px;
    display: inline-flex;
    align-items: center;
    gap: 6px;
}

.action-btn:hover {
    background: var(--light);
    border-color: var(--secondary);
    color: var(--secondary);
}

/* Modals */
.modal {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0,0,0,0.5);
    z-index: 1000;
    align-items: center;
    justify-content: center;
}

.modal.active {
    display: flex;
}

.modal-content {
    background: var(--white);
    padding: 30px;
    border-radius: var(--border-radius);
    max-width: 600px;
    width: 90%;
    max-height: 90vh;
    overflow-y: auto;
    box-shadow: 0 10px 40px rgba(0,0,0,0.2);
    animation: modalSlideIn 0.3s ease;
}

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

@keyframes modalSlideIn {
    from {
        transform: translateY(-50px);
        opacity: 0;
    }
    to {
        transform: translateY(0);
        opacity: 1;
    }
}

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

.modal-title {
    font-size: 24px;
    font-weight: 600;
    color: var(--dark);
}

.close-modal {
    background: none;
    border: none;
    font-size: 28px;
    cursor: pointer;
    color: var(--gray);
    transition: var(--transition);
    line-height: 1;
}

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

/* Section Headers */
.section-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 25px;
}

.tilte-n-legend{
    display : flex;
    width:100%;
    flex-direction:row;
    justify-content:space-between;
}

.section-title {
    font-size: 24px;
    font-weight: 600;
    color: var(--dark);
}

/* Quick Actions */
.quick-actions {
    display: flex;
    gap: 10px;
    flex-wrap: wrap;
}

/* Form Sections */
.form-section {
    background: #f8f9fa;
    padding: 20px;
    border-radius: var(--border-radius);
    margin-bottom: 20px;
}

.form-section h3 {
    margin-bottom: 15px;
    color: var(--dark);
    font-size: 18px;
}

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

/* Tabs */
.tabs {
    display: flex;
    gap: 10px;
    margin-bottom: 20px;
    border-bottom: 2px solid #eee;
}

.tab {
    padding: 10px 20px;
    cursor: pointer;
    border: none;
    background: none;
    font-size: 14px;
    font-weight: 500;
    color: var(--gray);
    transition: var(--transition);
    position: relative;
}

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

.tab.active {
    color: var(--secondary);
}

.tab.active::after {
    content: '';
    position: absolute;
    bottom: -2px;
    left: 0;
    width: 100%;
    height: 2px;
    background: var(--secondary);
}

/* Calendar Specific */
.calendar-container {

    background: var(--white);
    padding: 25px;
    border-radius: var(--border-radius);
    box-shadow: 0 2px 10px rgba(0,0,0,0.05);
    margin-bottom: 30px;
}

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



.filter-view {

    margin-bottom: 20px;
    display: flex;
    gap: 10px;
    align-items: center;
}


@media (max-width: 768px) {
    .filter-view {
        flex-direction: column;
        align-items: stretch;
        gap: 15px;
    }
    
    .filter-view label {
        text-align: center;
        font-weight: bold;
    }
    
    .filter-view input[type="date"] {
        width: 90%;
        padding: 12px;
    }
    
    .filter-view span {
        text-align: center;
        font-weight: bold;
    }
    
    .filter-view .btn {
        width: 100%;
        justify-content: center;
    }
    
    .status-legend{
        display:none !important;
    }
}

@media (max-width: 480px) {
    
    .status-legend{
        display:none !important;
    }
    .filter-view {
        gap: 12px;
    }
    
    .filter-view input[type="date"] {
        font-size: 16px;  
    }
}
/* Responsive pour la vue mois */
@media (max-width: 768px) {
    .month-grid {
        min-width: unset;
        grid-template-columns: repeat(7, 1fr);
        font-size: 12px;
    }
    
    .month-day {
        min-height: 80px;
        padding: 4px;
    }
    
    .month-day-number {
        font-size: 12px;
    }
    
    .month-intervention {
        font-size: 9px;
        padding: 1px 2px;
    }
}

@media (max-width: 768px) {
    .calendar-header {
        flex-direction: column;
        gap: 15px;
        align-items: stretch;
    }
    
    .calendar-nav {
        justify-content: center;
    }
    
    /* Pour la navigation des vues (Jour, Semaine, etc.) */
    .calendar-nav:last-child {
        display: grid;
        grid-template-columns: repeat(4, 1fr);
        gap: 5px;
    }
    
    .calendar-nav:last-child .calendar-btn {
        padding: 10px 8px;
        font-size: 12px;
        text-align: center;
    }
}

@media (max-width: 480px) {
    .calendar-nav h3 {
        font-size: 14px;
    }
    
    .calendar-btn {
        font-size: 12px;
        padding: 6px 10px;
    }
    
    /* Boutons de navigation encore plus compacts */
    .calendar-nav:last-child .calendar-btn {
        padding: 8px 4px;
        font-size: 11px;
    }
}

.calendar-nav {
    display: flex;
    gap: 10px;
}

.calendar-btn {
    padding: 8px 15px;
    border: 1px solid #ddd;
    background: var(--white);
    border-radius: var(--border-radius);
    cursor: pointer;
    transition: var(--transition);
}

.calendar-btn:hover {
    background: var(--light);
}

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

/* Loading */
.loading {
    display: inline-block;
    width: 20px;
    height: 20px;
    border: 3px solid #f3f3f3;
    border-top: 3px solid var(--secondary);
    border-radius: 50%;
    animation: spin 1s linear infinite;
}

@keyframes spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

/* Notifications */
.notification {
    position: fixed;
    top: 20px;
    right: 20px;
    padding: 15px 20px;
    border-radius: var(--border-radius);
    box-shadow: 0 5px 15px rgba(0,0,0,0.2);
    z-index: 2000;
    animation: slideInRight 0.3s ease;
    min-width: 300px;
    display: flex;
    align-items: center;
    gap: 10px;
}

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

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

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

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

/* Settings Grid */
.settings-grid {
    display: grid;
    grid-template-columns: 250px 1fr;
    gap: 30px;
}

.settings-nav {
    background: var(--white);
    padding: 20px;
    border-radius: var(--border-radius);
    height: fit-content;
}

.settings-nav-item {
    display: block;
    padding: 12px 16px;
    margin-bottom: 5px;
    border-radius: 6px;
    cursor: pointer;
    transition: var(--transition);
    color: var(--dark);
    text-decoration: none;
}

.settings-nav-item:hover {
    background: var(--light);
}

.settings-nav-item.active {
    background: var(--secondary);
    color: var(--white);
}

.settings-content {
    background: var(--white);
    padding: 30px;
    border-radius: var(--border-radius);
}

/* Reminder specific */
.remise-group {
    display: flex;
    gap: 10px;
    align-items: center;
}

.remise-group input {
    width: 100px;
}

.remise-group select {
    width: 120px;
}

/* Print Styles */
@media print {
    .sidebar, .header, .btn, .action-btn {
        display: none !important;
    }
    
    .main-content {
        margin: 0;
    }
    
    .content {
        padding: 20px;
    }
}

/* Responsive */
@media (max-width: 768px) {
    .sidebar {
        position: fixed;
        left: -260px;
        z-index: 999;
        height: 100vh;
    }

    .sidebar.active {
        left: 0;
    }

    .main-content {
        margin-left: 0;
    }

    .header {
        padding: 15px;
    }

    .search-bar {
        display: none;
    }

    .content {
        padding: 20px;
    }

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

    .modal-content {
        padding: 20px;
    }
    
    .settings-grid {
        grid-template-columns: 1fr;
    }
    
    .form-row {
        grid-template-columns: 1fr;
    }
}

/* Animations */
@keyframes slideInRight {
    from {
        transform: translateX(100%);
        opacity: 0;
    }
    to {
        transform: translateX(0);
        opacity: 1;
    }
}

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



/* Status badges */
.status-badge {
    display: inline-block;
    padding: 4px 8px;
    border-radius: 4px;
    font-size: 12px;
    font-weight: bold;
    text-transform: uppercase;
    color: white;
}

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

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

.status-warning {
    background-color: #ffc107;
    color: #212529;
}

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

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

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

/* Badges pour les types */
.badge {
    display: inline-block;
    padding: 4px 8px;
    border-radius: 4px;
    font-size: 11px;
    font-weight: bold;
    text-transform: uppercase;
}

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

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

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

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

.status-badge.status-success {
    background-color: #8bc34a;
    color: white;
}

.status-legend {
    display: flex;
    gap: 20px;
    align-items: center;
    flex-wrap: wrap;
    padding: 10px;
    background: #f8f9fa;

}

.legend-item {
    display: flex;
    align-items: center;
    gap: 6px;
}

.legend-color {
    width: 12px;
    height: 12px;
    border-radius: 3px;
    flex-shrink: 0;
}

.legend-text {
    font-size: 10px;
    color: #333;
}

.status-warning {
    background-color: #ffc107; /* jaune */
    color: #212529;
}