* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    background-color: #f0f2f5;
}

/* Login */
.login-container {
    max-width: 400px;
    margin: 100px auto;
    background: white;
    padding: 40px;
    border-radius: 10px;
    box-shadow: 0 4px 20px rgba(0,0,0,0.1);
}

.login-container h1 {
    text-align: center;
    color: #F85D10;
    margin-bottom: 30px;
}

.login-container input {
    width: 100%;
    padding: 12px;
    margin-bottom: 15px;
    border: 1px solid #ddd;
    border-radius: 5px;
    font-size: 14px;
}

.login-container button {
    width: 100%;
    padding: 12px;
    background: linear-gradient(135deg, #F85D10 0%, #FF8C42 100%);
    color: white;
    border: none;
    border-radius: 5px;
    font-size: 16px;
    cursor: pointer;
    transition: transform 0.2s;
}

.login-container button:hover {
    transform: translateY(-2px);
}

.error {
    background: #fee;
    color: #c33;
    padding: 10px;
    border-radius: 5px;
    margin-bottom: 15px;
    text-align: center;
}

.hint {
    text-align: center;
    color: #999;
    margin-top: 15px;
    font-size: 12px;
}

/* Admin Panel */
.admin-header {
    background: linear-gradient(135deg, #F85D10 0%, #FF8C42 100%);
    color: white;
    padding: 20px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    box-shadow: 0 2px 10px rgba(0,0,0,0.1);
}

.admin-header h1 {
    font-size: 24px;
}

.admin-container {
    display: flex;
    height: calc(100vh - 80px);
}

.sidebar {
    width: 350px;
    background: white;
    padding: 20px;
    overflow-y: auto;
    box-shadow: 2px 0 10px rgba(0,0,0,0.1);
}

.sidebar h2 {
    color: #F85D10;
    margin-bottom: 20px;
}

.section {
    margin-bottom: 30px;
    padding-bottom: 20px;
    border-bottom: 1px solid #eee;
}

.section h3 {
    color: #333;
    margin-bottom: 10px;
    font-size: 16px;
}

.section p {
    color: #666;
    font-size: 14px;
    line-height: 1.5;
    margin-bottom: 8px;
}

.section label {
    display: block;
    margin-top: 12px;
    margin-bottom: 5px;
    color: #333;
    font-weight: 500;
    font-size: 14px;
}

.section input[type="text"],
.section input[type="color"],
.section textarea {
    width: 100%;
    padding: 10px;
    border: 1px solid #ddd;
    border-radius: 5px;
    font-size: 14px;
    font-family: inherit;
}

.section textarea {
    resize: vertical;
}

.form-actions {
    display: flex;
    gap: 10px;
    margin-top: 15px;
}

.btn-primary {
    flex: 1;
    padding: 12px;
    background: linear-gradient(135deg, #F85D10 0%, #FF8C42 100%);
    color: white;
    border: none;
    border-radius: 5px;
    cursor: pointer;
    font-size: 14px;
    transition: transform 0.2s;
}

.btn-primary:hover {
    transform: translateY(-2px);
}

.btn-secondary {
    padding: 10px 20px;
    background: white;
    color: #F85D10;
    border: 2px solid #F85D10;
    border-radius: 5px;
    text-decoration: none;
    cursor: pointer;
    font-size: 14px;
    transition: all 0.2s;
    display: inline-block;
}

.btn-secondary:hover {
    background: #F85D10;
    color: white;
}

.map-container {
    flex: 1;
}

#admin-map {
    width: 100%;
    height: 100%;
}

/* Areas List */
.area-item {
    background: #f8f9fa;
    padding: 12px;
    margin-bottom: 10px;
    border-radius: 5px;
    border-left: 4px solid #F85D10;
}

.area-item h4 {
    color: #333;
    margin-bottom: 8px;
    font-size: 14px;
}

.area-item p {
    color: #666;
    font-size: 12px;
    margin-bottom: 8px;
}

.area-actions {
    display: flex;
    gap: 8px;
}

.area-actions button {
    flex: 1;
    padding: 6px 12px;
    border: none;
    border-radius: 3px;
    cursor: pointer;
    font-size: 12px;
    transition: all 0.2s;
}

.btn-edit {
    background: #4CAF50;
    color: white;
}

.btn-edit:hover {
    background: #45a049;
}

.btn-delete {
    background: #f44336;
    color: white;
}

.btn-delete:hover {
    background: #da190b;
}

.btn-view {
    background: #2196F3;
    color: white;
}

.btn-view:hover {
    background: #0b7dda;
}

/* Labels das áreas no mapa admin */
.area-label-admin {
    background: rgba(255, 255, 255, 0.95);
    border: 2px solid #F85D10;
    border-radius: 8px;
    padding: 6px 12px;
    font-weight: bold;
    font-size: 13px;
    color: #333;
    box-shadow: 0 2px 8px rgba(0,0,0,0.15);
    text-align: center;
    white-space: nowrap;
}

/* Label para pontos - mais discreto e pequeno */
.area-label-admin-point {
    background: rgba(255, 255, 255, 0.85);
    border: 1px solid #999;
    border-radius: 4px;
    padding: 2px 6px;
    font-weight: 500;
    font-size: 10px;
    color: #333;
    box-shadow: 0 1px 3px rgba(0,0,0,0.2);
    text-align: left;
    white-space: nowrap;
}

.area-label-admin::before,
.area-label-admin-point::before {
    display: none;
}

/* Label ao editar área */
.area-label-editing {
    background: rgba(255, 235, 59, 0.95);
    border: 2px solid #f57c00;
    border-radius: 8px;
    padding: 6px 12px;
    font-weight: bold;
    font-size: 13px;
    color: #333;
    box-shadow: 0 2px 8px rgba(0,0,0,0.2);
    text-align: center;
    white-space: nowrap;
}

.area-label-editing::before {
    display: none;
}

/* Estilos para upload de arquivo KML */
input[type="file"] {
    width: 100%;
    padding: 10px;
    border: 2px dashed #F85D10;
    border-radius: 5px;
    background: #f8f9fa;
    cursor: pointer;
    font-size: 14px;
}

input[type="file"]:hover {
    background: #e9ecef;
    border-color: #FF8C42;
}

#import-status {
    font-size: 13px;
    line-height: 1.5;
}

#import-status p {
    margin: 5px 0;
}

/* Badges */
.badge {
    display: inline-block;
    padding: 3px 8px;
    border-radius: 3px;
    font-size: 11px;
    font-weight: bold;
    margin-left: 5px;
    vertical-align: middle;
}

.badge-polygon {
    background: #4CAF50;
    color: white;
}

.badge-line {
    background: #2196F3;
    color: white;
}

.badge-point {
    background: #FF9800;
    color: white;
}

.badge-imported {
    background: #9C27B0;
    color: white;
}

/* Tabs / Abas */
.tabs {
    display: flex;
    gap: 5px;
    margin-bottom: 15px;
    border-bottom: 2px solid #eee;
}

.tab-btn {
    flex: 1;
    padding: 12px 10px;
    background: #f8f9fa;
    border: none;
    border-bottom: 3px solid transparent;
    cursor: pointer;
    font-size: 14px;
    font-weight: 500;
    color: #666;
    transition: all 0.3s;
}

.tab-btn:hover {
    background: #e9ecef;
    color: #333;
}

.tab-btn.active {
    background: white;
    color: #F85D10;
    border-bottom-color: #F85D10;
}

.tab-content {
    display: none;
    animation: fadeIn 0.3s;
}

.tab-content.active {
    display: block;
}

@keyframes fadeIn {
    from { opacity: 0; }
    to { opacity: 1; }
}

/* Grupos de importação */
.import-group {
    background: #f8f9fa;
    border-left: 4px solid #9C27B0;
    border-radius: 5px;
    margin-bottom: 15px;
    overflow: hidden;
}

.import-group-header {
    padding: 12px 15px;
    background: #f0f0f0;
    cursor: pointer;
    display: flex;
    justify-content: space-between;
    align-items: center;
    transition: background 0.2s;
}

.import-group-header:hover {
    background: #e8e8e8;
}

.import-group-header h4 {
    margin: 0;
    font-size: 14px;
    color: #333;
}

.import-group-header .toggle-icon {
    font-size: 18px;
    transition: transform 0.3s;
}

.import-group-header.collapsed .toggle-icon {
    transform: rotate(-90deg);
}

.import-group-stats {
    font-size: 12px;
    color: #666;
    margin-top: 3px;
}

.import-group-content {
    padding: 10px;
    max-height: 500px;
    overflow-y: auto;
    transition: max-height 0.3s ease-out;
}

.import-group-content.collapsed {
    max-height: 0;
    padding: 0;
    overflow: hidden;
}

.import-group-actions {
    display: flex;
    gap: 5px;
}

.btn-delete-group {
    background: #f44336;
    color: white;
    border: none;
    padding: 5px 10px;
    border-radius: 4px;
    cursor: pointer;
    font-size: 14px;
    transition: all 0.2s;
}

.btn-delete-group:hover {
    background: #d32f2f;
    transform: scale(1.05);
}

.btn-toggle-group {
    background: #2196F3;
    color: white;
}

.btn-toggle-group:hover {
    background: #0b7dda;
}

/* Área item dentro do grupo */
.import-group .area-item {
    margin-bottom: 8px;
    background: white;
}

/* Empty state */
.empty-state {
    text-align: center;
    padding: 30px 20px;
    color: #999;
}

.empty-state-icon {
    font-size: 48px;
    margin-bottom: 10px;
}

/* Marcador de localização do cliente (pulsante) */
.client-location-marker {
    background: transparent;
    border: none;
}

.pulse-marker {
    width: 30px;
    height: 30px;
    border-radius: 50%;
    background: #ff4444;
    border: 3px solid white;
    box-shadow: 0 0 0 0 rgba(255, 68, 68, 0.7);
    animation: pulse 2s infinite;
    position: relative;
}

.pulse-marker::after {
    content: '📍';
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    font-size: 16px;
}

@keyframes pulse {
    0% {
        box-shadow: 0 0 0 0 rgba(255, 68, 68, 0.7);
    }
    70% {
        box-shadow: 0 0 0 15px rgba(255, 68, 68, 0);
    }
    100% {
        box-shadow: 0 0 0 0 rgba(255, 68, 68, 0);
    }
}

/* Estilos para popup de exclusão rápida */
.leaflet-popup-content {
    margin: 13px 19px;
    line-height: 1.4;
    font-size: 13px;
    min-width: 180px;
    max-width: 300px;
    max-height: 400px;
    overflow-y: auto;
}

.leaflet-popup-content button {
    margin-top: 8px;
    width: 100%;
    transition: all 0.2s;
}

.leaflet-popup-content button:hover {
    background: #d32f2f !important;
    transform: translateY(-1px);
    box-shadow: 0 2px 5px rgba(0,0,0,0.2);
}

.leaflet-popup-content button:active {
    transform: translateY(0);
}

/* Estilo para informações adicionais longas */
.leaflet-popup-content small {
    display: block;
    margin-top: 8px;
    margin-bottom: 8px;
    color: #666;
    white-space: pre-wrap;
    word-wrap: break-word;
    line-height: 1.5;
}

/* Scrollbar customizada para o popup */
.leaflet-popup-content::-webkit-scrollbar {
    width: 6px;
}

.leaflet-popup-content::-webkit-scrollbar-track {
    background: #f1f1f1;
    border-radius: 3px;
}

.leaflet-popup-content::-webkit-scrollbar-thumb {
    background: #888;
    border-radius: 3px;
}

.leaflet-popup-content::-webkit-scrollbar-thumb:hover {
    background: #555;
}
