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

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

/* Header */
.header {
    background: #2c3e50;
    color: white;
    padding: 12px 24px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    box-shadow: 0 2px 8px rgba(0,0,0,0.15);
    z-index: 1000;
    position: relative;
}

.header h1 {
    font-size: 1.3rem;
    font-weight: 600;
}

.header-stats {
    display: flex;
    gap: 20px;
    font-size: 0.85rem;
}

.header-stats .stat {
    display: flex;
    align-items: center;
    gap: 6px;
}

.stat-badge {
    display: inline-block;
    padding: 2px 10px;
    border-radius: 12px;
    font-weight: 600;
    font-size: 0.8rem;
}

.stat-badge.total { background: #3498db; color: white; }
.stat-badge.reserved { background: #e74c3c; color: white; }
.stat-badge.free { background: #27ae60; color: white; }

/* Layout */
.container {
    display: flex;
    height: calc(100vh - 52px);
}

/* Map */
#map {
    flex: 1;
    z-index: 1;
}

/* Sidebar */
.sidebar {
    width: 380px;
    background: white;
    border-left: 1px solid #ddd;
    display: flex;
    flex-direction: column;
    z-index: 2;
    box-shadow: -2px 0 8px rgba(0,0,0,0.08);
}

.sidebar-header {
    padding: 16px;
    border-bottom: 1px solid #eee;
    background: #fafafa;
}

.sidebar-header h2 {
    font-size: 1rem;
    margin-bottom: 10px;
    color: #2c3e50;
}

.search-box {
    width: 100%;
    padding: 8px 12px;
    border: 1px solid #ddd;
    border-radius: 6px;
    font-size: 0.9rem;
    outline: none;
    transition: border-color 0.2s;
}

.search-box:focus {
    border-color: #3498db;
}

/* Liste des emplacements */
.emplacement-list {
    flex: 1;
    overflow-y: auto;
    padding: 8px;
}

.emplacement-card {
    background: #fff;
    border: 1px solid #e8e8e8;
    border-radius: 8px;
    padding: 12px;
    margin-bottom: 8px;
    cursor: pointer;
    transition: all 0.2s;
}

.emplacement-card:hover {
    border-color: #3498db;
    box-shadow: 0 2px 8px rgba(52,152,219,0.15);
}

.emplacement-card.reserved {
    border-left: 4px solid #e74c3c;
}

.emplacement-card.free {
    border-left: 4px solid #27ae60;
}

.emplacement-card .card-top {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 6px;
}

.emplacement-card .numero {
    font-weight: 700;
    font-size: 1rem;
    color: #2c3e50;
}

.emplacement-card .metres {
    font-size: 0.8rem;
    color: #7f8c8d;
    background: #ecf0f1;
    padding: 2px 8px;
    border-radius: 10px;
}

.emplacement-card .exposant {
    font-size: 0.85rem;
    color: #555;
    margin-top: 4px;
}

.emplacement-card .exposant strong {
    color: #2c3e50;
}

.emplacement-card .card-actions {
    display: flex;
    gap: 6px;
    margin-top: 8px;
}

/* Boutons */
.btn {
    padding: 6px 12px;
    border: none;
    border-radius: 5px;
    font-size: 0.78rem;
    cursor: pointer;
    font-weight: 500;
    transition: opacity 0.2s;
}

.btn:hover {
    opacity: 0.85;
}

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

.btn-edit {
    background: #f39c12;
    color: white;
}

.btn-delete {
    background: #e74c3c;
    color: white;
}

.btn-liberer {
    background: #95a5a6;
    color: white;
}

.btn-primary {
    background: #2c3e50;
    color: white;
    padding: 10px 20px;
    font-size: 0.9rem;
}

.btn-cancel {
    background: #ecf0f1;
    color: #333;
    padding: 10px 20px;
    font-size: 0.9rem;
}

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

.modal-overlay.active {
    display: flex;
}

.modal {
    background: white;
    border-radius: 12px;
    padding: 24px;
    width: 420px;
    max-width: 90vw;
    box-shadow: 0 20px 60px rgba(0,0,0,0.3);
}

.modal h3 {
    font-size: 1.1rem;
    margin-bottom: 16px;
    color: #2c3e50;
}

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

.form-group label {
    display: block;
    font-size: 0.85rem;
    font-weight: 600;
    color: #555;
    margin-bottom: 4px;
}

.form-group input,
.form-group textarea {
    width: 100%;
    padding: 8px 12px;
    border: 1px solid #ddd;
    border-radius: 6px;
    font-size: 0.9rem;
    outline: none;
    transition: border-color 0.2s;
}

.form-group input:focus,
.form-group textarea:focus {
    border-color: #3498db;
}

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

.modal-actions {
    display: flex;
    gap: 10px;
    justify-content: flex-end;
    margin-top: 20px;
}

/* Barre de recherche ville sur la carte */
.city-search {
    position: absolute;
    top: 12px;
    right: 12px;
    z-index: 10000;
    display: flex;
    flex-wrap: wrap;
    box-shadow: 0 2px 8px rgba(0,0,0,0.2);
    border-radius: 6px;
    background: white;
}

.city-search-icon {
    padding: 8px 10px 8px 12px;
    background: white;
    font-size: 0.9rem;
    display: flex;
    align-items: center;
    border-radius: 6px 0 0 0;
}

.city-search input {
    padding: 8px 14px 8px 0;
    border: none;
    font-size: 0.9rem;
    width: 260px;
    outline: none;
    border-radius: 0 6px 0 0;
}

.city-suggestions {
    width: 100%;
    background: white;
    border-radius: 0 0 6px 6px;
    box-shadow: 0 4px 12px rgba(0,0,0,0.15);
    max-height: 200px;
    overflow-y: auto;
}

.city-suggestions div {
    padding: 8px 14px;
    font-size: 0.85rem;
    cursor: pointer;
    border-top: 1px solid #eee;
}

.city-suggestions div:hover {
    background: #f0f4f8;
}

/* Tooltip mesure en temps réel */
.measure-tooltip {
    position: absolute;
    z-index: 1000;
    background: #2c3e50;
    color: white;
    padding: 4px 10px;
    border-radius: 4px;
    font-size: 0.85rem;
    font-weight: 600;
    pointer-events: none;
    white-space: nowrap;
    box-shadow: 0 2px 6px rgba(0,0,0,0.3);
}

/* Leaflet draw toolbar tweaks */
.leaflet-draw-toolbar a {
    font-size: 14px;
}

/* Info popup on map */
.leaflet-popup-content {
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    font-size: 0.85rem;
    line-height: 1.5;
}

.popup-title {
    font-weight: 700;
    font-size: 1rem;
    color: #2c3e50;
    margin-bottom: 4px;
}

.popup-status {
    display: inline-block;
    padding: 2px 8px;
    border-radius: 10px;
    font-size: 0.75rem;
    font-weight: 600;
    margin-bottom: 6px;
}

.popup-status.reserved { background: #fde8e8; color: #e74c3c; }
.popup-status.free { background: #e8f8ef; color: #27ae60; }

/* Toast notifications */
.toast {
    position: fixed;
    bottom: 24px;
    left: 50%;
    transform: translateX(-50%) translateY(100px);
    background: #2c3e50;
    color: white;
    padding: 12px 24px;
    border-radius: 8px;
    font-size: 0.9rem;
    z-index: 20000;
    transition: transform 0.3s ease;
    box-shadow: 0 4px 16px rgba(0,0,0,0.2);
}

.toast.show {
    transform: translateX(-50%) translateY(0);
}

/* Responsive */
@media (max-width: 768px) {
    .container {
        flex-direction: column;
    }

    #map {
        height: 50vh;
    }

    .sidebar {
        width: 100%;
        height: 50vh;
        border-left: none;
        border-top: 1px solid #ddd;
    }
}
