.parcel-label.leaflet-tooltip {
    background: none !important;
    border: none !important;
    box-shadow: none !important;
    color: #222;
    font-size: 8px;
    padding: 0 !important;
    margin: 0 !important;
}
/* Parcel label trên bản đồ */
.parcel-label {

    pointer-events: none;
    font-size:10px;
    color: #ccc;
    text-align: center;   
    white-space: normal;

}
/* Reset và base styles */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

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

.container {
    display: flex;
    flex-direction: column;
    height: 100vh;
}

/* Header */
.header {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    padding: 0.75rem 1.5rem;
    display: flex;
    justify-content: space-between;
    align-items: center;
    box-shadow: 0 2px 10px rgba(0,0,0,0.1);
}

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

.header-controls {
    display: flex;
    gap: 1rem;
}

/* Buttons */
.btn {
    padding: 0.5rem 1rem;
    border: none;
    border-radius: 6px;
    cursor: pointer;
    font-size: 0.9rem;
    font-weight: 500;
    transition: all 0.3s ease;
    text-decoration: none;
    display: inline-block;
}

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

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

.btn-primary:hover {
    background-color: #0056b3;
}

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

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

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

.btn-info:hover {
    background-color: #117a8b;
}

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

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

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

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

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

.btn-secondary:hover {
    background-color: #545b62;
}

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

/* Sidebar */
.sidebar {
    width: 350px;
    background: white;
    border-right: 1px solid #e0e0e0;
    display: flex;
    flex-direction: column;
    box-shadow: 2px 0 10px rgba(0,0,0,0.1);
}

.sidebar-header {
    padding: 1.5rem;
    border-bottom: 1px solid #e0e0e0;
    background: #f8f9fa;
}

.sidebar-header h3 {
    margin-bottom: 1rem;
    color: #495057;
    font-size: 1.2rem;
}

.toggle-filters-btn {
    background: #007bff;
    color: white;
    border: none;
    padding: 0.5rem 1rem;
    border-radius: 6px;
    cursor: pointer;
    font-size: 0.9rem;
    margin-bottom: 1rem;
    display: flex;
    align-items: center;
    gap: 0.5rem;
    transition: all 0.3s ease;
}

.toggle-filters-btn:hover {
    background: #0056b3;
}

.toggle-icon {
    font-size: 0.8rem;
    transition: transform 0.3s ease;
}

.toggle-icon.rotated {
    transform: rotate(180deg);
}

.filter-controls {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
    transition: all 0.3s ease;
}

.filter-controls.hidden {
    max-height: 0;
    overflow: hidden;
    opacity: 0;
}

.filter-select {
    padding: 0.5rem;
    border: 1px solid #ced4da;
    border-radius: 4px;
    font-size: 0.9rem;
    background: white;
}

.parcels-list {
    flex: 1;
    overflow-y: auto;
    padding: 1rem;
}

.parcel-item {
    background: white;
    border: 1px solid #e0e0e0;
    border-radius: 8px;
    padding: 1rem;
    margin-bottom: 1rem;
    cursor: pointer;
    transition: all 0.3s ease;
    box-shadow: 0 2px 4px rgba(0,0,0,0.05);
}

.parcel-item:hover {
    border-color: #007bff;
    box-shadow: 0 4px 12px rgba(0,0,0,0.1);
    transform: translateY(-2px);
}

.parcel-item.selected {
    border-color: #007bff;
    background-color: #f8f9ff;
}

.parcel-title {
    font-weight: 600;
    color: #495057;
    margin-bottom: 0.5rem;
    font-size: 1rem;
}

.parcel-info {
    font-size: 0.85rem;
    color: #6c757d;
    margin-bottom: 0.25rem;
}

.parcel-status {
    display: inline-block;
    padding: 0.25rem 0.5rem;
    border-radius: 12px;
    font-size: 0.75rem;
    font-weight: 500;
    margin-top: 0.5rem;
}

.status-legal {
    background-color: #e3f2fd;
    color: #1976d2;
}

.status-clearance {
    background-color: #f3e5f5;
    color: #7b1fa2;
}

/* Map Container */
.map-container {
    flex: 1;
    position: relative;
}

#map {
    width: 100%;
    height: 100%;
}

.drawing-controls {
    position: absolute;
    top: 1rem;
    right: 1rem;
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
    z-index: 1000;
}

/* Modal */
.modal {
    display: none;
    position: fixed;
    z-index: 2000;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0,0,0,0.5);
    backdrop-filter: blur(5px);
}

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

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

.modal-header {
    padding: 1.5rem 2rem;
    border-bottom: 1px solid #e0e0e0;
    background: #f8f9fa;
    border-radius: 12px 12px 0 0;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.modal-header h2 {
    color: #495057;
    font-size: 1.4rem;
    font-weight: 600;
}

.close {
    color: #aaa;
    font-size: 28px;
    font-weight: bold;
    cursor: pointer;
    transition: color 0.3s ease;
}

.close:hover {
    color: #000;
}

.modal-body {
    padding: 2rem;
}

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

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

.form-group input,
.form-group select,
.form-group textarea {
    width: 100%;
    padding: 0.75rem;
    border: 1px solid #ced4da;
    border-radius: 6px;
    font-size: 0.95rem;
    transition: border-color 0.3s ease;
}

.form-group input:focus,
.form-group select:focus,
.form-group textarea:focus {
    outline: none;
    border-color: #007bff;
    box-shadow: 0 0 0 3px rgba(0,123,255,0.1);
}

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

.current-file {
    margin-top: 0.5rem;
    padding: 0.5rem;
    background: #f8f9fa;
    border-radius: 4px;
    font-size: 0.85rem;
    color: #6c757d;
}

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

.attachment-item .file-icon {
    width: 24px;
    height: 24px;
    background: #007bff;
    border-radius: 4px;
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
    font-size: 12px;
}

.attachment-item .file-info {
    flex: 1;
}

.attachment-item .file-name {
    font-weight: 500;
    color: #495057;
}

.attachment-item .file-size {
    font-size: 0.75rem;
    color: #6c757d;
}

.attachment-item .file-actions {
    display: flex;
    gap: 0.25rem;
}

.attachment-item .file-actions .btn {
    padding: 0.25rem 0.5rem;
    font-size: 0.75rem;
}

.form-group small {
    color: #6c757d;
    font-size: 0.8rem;
    margin-top: 0.25rem;
    display: block;
}

/* Color Picker Styles */
.color-picker-container {
    display: flex;
    align-items: center;
    gap: 1rem;
    margin-top: 0.5rem;
}

.color-picker-container input[type="color"] {
    width: 60px;
    height: 40px;
    border: none;
    border-radius: 6px;
    cursor: pointer;
    padding: 0;
}

.color-preview {
    width: 40px;
    height: 40px;
    border-radius: 6px;
    border: 2px solid #e0e0e0;
    background-color: #3388ff;
}

.color-value {
    font-family: 'Courier New', monospace;
    font-weight: 600;
    color: #495057;
    font-size: 1rem;
    min-width: 80px;
}

.form-actions {
    display: flex;
    gap: 1rem;
    justify-content: flex-end;
    margin-top: 2rem;
    padding-top: 1.5rem;
    border-top: 1px solid #e0e0e0;
}

/* Responsive Design */
@media (max-width: 768px) {
    .header {
        flex-direction: row;
        justify-content: space-between;
        align-items: center;
        padding: 0.5rem 1rem;
        gap: 0.5rem;
    }
    
    .header h1 {
        font-size: 1.1rem;
        margin: 0;
        flex: 1;
    }
    
    .header-controls {
        flex-direction: row;
        gap: 0.5rem;
        flex-shrink: 0;
    }
    
    .header-controls .btn {
        font-size: 0.75rem;
        padding: 0.3rem 0.6rem;
        min-width: auto;
    }
    
    .header h1 {
        font-size: 1.1rem;
        margin: 0;
        flex: 1;
        text-align: left;
    }
    
    .main-content {
        flex-direction: column;
    }
    
    .sidebar {
        width: 100%;
        height: auto;
        max-height: 60px; /* Start collapsed on mobile */
        border-right: none;
        border-bottom: 1px solid #e0e0e0;
        order: 2;
        position: relative;
        overflow: hidden;
        transition: max-height 0.3s ease;
    }
    
    .sidebar.expanded {
        max-height: 400px; /* Expanded height to show all content */
    }
    
    .sidebar-toggle {
        position: absolute;
        top: 0.5rem;
        right: 0.5rem;
        background: #007bff;
        color: white;
        border: none;
        border-radius: 4px;
        padding: 0.25rem 0.5rem;
        font-size: 0.8rem;
        cursor: pointer;
        z-index: 10;
        transition: transform 0.3s ease;
    }
    
    .sidebar.expanded .sidebar-toggle {
        transform: rotate(180deg);
    }
    
    .sidebar-toggle:hover {
        background: #0056b3;
    }
    
    .map-container {
        order: 1;
        height: calc(100vh - 120px);
        min-height: 400px;
    }
    
    .drawing-controls {
        position: relative;
        top: auto;
        right: auto;
        flex-direction: row;
        justify-content: center;
        margin: 0.5rem;
        gap: 0.25rem;
    }
    
    .drawing-controls .btn {
        font-size: 0.75rem;
        padding: 0.3rem 0.6rem;
    }
    
    .modal-content {
        width: 95%;
        margin: 5% auto;
        max-height: 95vh;
    }
    
    .modal-body {
        padding: 1rem;
    }
    
    .form-actions {
        flex-direction: column;
        gap: 0.5rem;
    }
    
    .form-actions .btn {
        width: 100%;
    }
    
    .sidebar-header {
        padding: 1rem;
        padding-right: 3rem;
        background: #f8f9fa;
        border-bottom: 1px solid #e0e0e0;
    }
    
    .parcels-list {
        padding: 0.5rem;
        max-height: 200px;
        overflow-y: auto;
        background: white;
    }
    
    .parcel-item {
        padding: 0.75rem;
        margin-bottom: 0.75rem;
    }
    
    /* Show filters by default when sidebar is expanded */
    .filter-controls {
        max-height: 0;
        overflow: hidden;
        opacity: 0;
        transition: all 0.3s ease;
        background: #f8f9fa;
        border-bottom: 1px solid #e0e0e0;
    }
    
    .sidebar.expanded .filter-controls {
        max-height: 200px;
        opacity: 1;
        padding: 1rem;
    }
    
    /* Toggle filters button - always visible on mobile */
    .toggle-filters-btn {
        display: block;
        width: 100%;
        text-align: left;
        background: none;
        border: none;
        padding: 0.5rem 0;
        color: #007bff;
        font-size: 0.9rem;
        cursor: pointer;
        border-bottom: 1px solid #e0e0e0;
    }
    
    .toggle-filters-btn:hover {
        background: #e9ecef;
    }
    
    .toggle-filters-btn .toggle-icon {
        display: inline-block;
        transition: transform 0.3s ease;
    }
    
    .filter-controls.show .toggle-icon {
        transform: rotate(180deg);
    }
}

/* Desktop - Ẩn nút toggle filters */
@media (min-width: 769px) {
    .toggle-filters-btn {
        display: none;
    }
    
    .filter-controls {
        max-height: none !important;
        opacity: 1 !important;
        overflow: visible !important;
    }
}

/* Leaflet Custom Styles */
.leaflet-popup-content {
    margin: 1rem;
    min-width: 200px;
}

.leaflet-popup-content h3 {
    margin-bottom: 0.5rem;
    color: #495057;
}

.leaflet-popup-content p {
    margin-bottom: 0.25rem;
    font-size: 0.9rem;
}

.leaflet-popup-content .popup-actions {
    margin-top: 1rem;
    display: flex;
    gap: 0.5rem;
}

.leaflet-popup-content .popup-actions .btn {
    padding: 0.5rem 0.75rem;
    font-size: 0.8rem;
}

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

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

/* Status Colors */
.status-legal-Chưa\ có { background-color: #fff3cd; color: #856404; }
.status-legal-Đang\ xin { background-color: #d1ecf1; color: #0c5460; }
.status-legal-Đã\ xong { background-color: #d4edda; color: #155724; }

.status-clearance-Chưa\ GP { background-color: #f8d7da; color: #721c24; }
.status-clearance-Đang\ GP { background-color: #fff3cd; color: #856404; }
.status-clearance-Đã\ xong { background-color: #d4edda; color: #155724; } 