:root {
    --cor-primaria: #367C2B;
    --cor-primaria-hover: #2E6B24;
    --cor-acao: #45a049;
    --cor-acao-hover: #3d8b40;
    --cor-secundaria: #4A4A4A;
    --cor-destaque: #F9A825;
    --cor-fundo: #F5F6F7;
    --cor-painel: #FFFFFF;
    --cor-borda: #E0E0E0;
    --texto-primario: #333333;
    --texto-secundario: #7A7A7A;
    --cor-sucesso: #367C2B;
    --cor-alerta: #f9a825;
    --cor-perigo: #D32F2F;
    --header-bg: #1A1D1C;
    --header-divider: #2D3331;
    --header-text: #E0E0E0;
    --header-hover: #0c0f0e;
    --nav-header-bg: #1F3D2B;

}

.dark {
    --cor-fundo: #121212;
    --cor-painel: #1E1E1E;
    --cor-borda: #333333;
    --texto-primario: #E0E0E0;
    --texto-secundario: #A0A0A0;
    --cor-primaria: #4CAF50;
    --cor-primaria-hover: #388E3C;
}

html,
body {
    font-family: "Roboto", system-ui, sans-serif;
    height: 100%;
    overflow: hidden;
    background-color: var(--cor-fundo);
    margin: 0;
}

.form-input {
    border-bottom: 0.0625rem solid #000;
}

.main-content-grid {
    position: relative;
    display: flex;
}

main#conteudo {
    flex-grow: 1;
    overflow-y: auto;
}

@media (min-width: 48rem) {

    #sidebar {
        grid-column: 1 / 2;
        grid-row: 1 / 3;
    }
}

@media (max-width: 48rem) {}

#map-sidebar {
    position: absolute;
    top: 1rem;
    right: 1rem;
    bottom: 1rem;
    z-index: 1002;
    width: 30rem;
    background-color: var(--cor-painel);
    box-shadow: 0 0.75rem 0.75rem rgba(0, 0, 0, 0.15);
    border-radius: 10px;
    display: flex;
    flex-direction: column;
    transform: translateX(calc(100% + 1rem));
    transition: transform 0.3s ease-in-out;

}

#map-sidebar.visible {
    transform: translateX(0);
}

.sidebar-header {
    color: #000;

    padding: 0.75rem 1.25rem;
    display: flex;
    align-items: center;
    justify-content: space-between;
    flex-shrink: 0;
}

.sidebar-header h4 {
    font-size: 1rem;
    font-weight: 600;
    color: #000;
    margin: 0;
}

.sidebar-header .close-btn {
    background: none;
    border: none;
    font-size: 1.5rem;
    color: #E0E0E0;
    cursor: pointer;
    line-height: 1;
    transition: color 0.2s;
}

.sidebar-header .close-btn:hover {
    color: #ff253a;
}

.sidebar-header .back-btn {
    background: none;
    border: none;
    color: #000;
    cursor: pointer;
    font-weight: 500;
}

.sidebar-body {
    flex-grow: 1;
    overflow-y: auto;
    padding: 0.5rem;
}

@media (max-width: 47.9375rem) {
    #map-sidebar {
        top: auto;
        right: 0;
        bottom: 0;
        left: 0;
        width: 100%;
        max-width: 100%;
        max-height: 100%;
        border-radius: 0;
        border-left: none;
        border-right: none;
        border-bottom: none;
        transform: translateY(100%);
    }

    #map-sidebar.visible {
        transform: translateY(0);
    }
}

#sidebar .nav-tooltip {
    visibility: hidden;
    opacity: 0;
    transition: opacity 0.2s;
    position: absolute;
    left: 100%;
    top: 50%;
    transform: translateY(-50%);
    white-space: nowrap;
    pointer-events: none;
}

#sidebar li:hover .nav-tooltip {
    visibility: visible;
    opacity: 1;
}

#lista-talhoes {
    list-style: none;
    padding: 0;
    margin: 0;
}

#lista-talhoes li {
    padding: 0.625rem 0.75rem;
    border-bottom: 1px solid var(--cor-borda);
    cursor: pointer;
    transition: background-color 0.2s;
    font-size: 0.9rem;
    color: var(--texto-secundario);
    border-radius: 0;
    margin-bottom: 0;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

#lista-talhoes li:last-child {
    border-bottom: none;
}

#lista-talhoes li:hover {
    background-color: var(--cor-fundo);
}

#lista-talhoes li.selected {
    background-color: #c9c9c9;
    color: #367C2B;
    font-weight: 600;
    border-radius: 10px;
    ;
}

/* Talhão list item — layout interno */
.talhao-list-info {
    flex: 1;
    min-width: 0;
    cursor: pointer;
}

.talhao-list-top {
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.talhao-list-nome {
    font-weight: 600;
    font-size: 0.85rem;
    color: var(--texto-primario);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}



.talhao-list-ha {
    flex-shrink: 0;
    font-size: 0.65rem;
    font-weight: 700;
    color: var(--cor-primaria);
    background-color: rgba(54, 124, 43, 0.08);
    padding: 0.125rem 0.375rem;
    border-radius: 4px;
    white-space: nowrap;
}



.talhao-list-fazenda {
    display: block;
    font-size: 0.7rem;
    color: var(--texto-secundario);
    margin-top: 0.125rem;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}


.talhao-list-edit-btn {
    flex-shrink: 0;
    width: 1.75rem;
    height: 1.75rem;
    display: flex;
    align-items: center;
    justify-content: center;
    border: none;
    background: transparent;
    color: var(--texto-secundario);
    border-radius: 6px;
    cursor: pointer;
    opacity: 0;
    transition: all 0.2s;
    font-size: 0.7rem;
}

#lista-talhoes li:hover .talhao-list-edit-btn {
    opacity: 1;
}

.talhao-list-edit-btn:hover {
    background-color: rgba(54, 124, 43, 0.1);
    color: var(--cor-primaria);
}

#lista-talhoes li.selected .talhao-list-edit-btn {
    color: rgba(255, 255, 255, 0.6);
}

#lista-talhoes li.selected .talhao-list-edit-btn:hover {
    color: white;
    background-color: rgba(255, 255, 255, 0.15);
}

/* Talhão list item — inline edit actions (Save/Cancel) */
#lista-talhoes li.editing {
    background-color: var(--cor-primaria);
    border-left: 3px solid #4CAF50;
}

.talhao-list-actions {
    flex-shrink: 0;
    display: flex;
    align-items: center;
    gap: 0.25rem;
}

.talhao-list-action-btn {
    width: 2rem;
    height: 2rem;
    display: flex;
    align-items: center;
    justify-content: center;
    border: none;
    border-radius: 6px;
    cursor: pointer;
    font-size: 0.8rem;
    transition: all 0.2s;
}

.talhao-list-action-btn.save {
    background-color: rgba(255, 255, 255, 0.2);
    color: #6ee7b7;
}

.talhao-list-action-btn.save:hover {
    background-color: #22c55e;
    color: white;
}

.talhao-list-action-btn.cancel {
    background-color: rgba(255, 255, 255, 0.1);
    color: rgba(255, 255, 255, 0.6);
}

.talhao-list-action-btn.cancel:hover {
    background-color: #ef4444;
    color: white;
}

.criar-talhao-footer {
    flex-shrink: 0;
    padding: 0.75rem;
    border-top: 1px solid var(--cor-borda);
}

#detalhes-talhao-container {
    padding: 0.75rem;
}

.panel-main-title {
    font-size: 1.125rem;
    font-weight: 700;
    color: #1e293b;
}

.dark .panel-main-title {
    color: #f1f5f9;
}

.panel-subtitle {
    font-size: 0.875rem;
    color: #64748b;
    margin-bottom: 1rem;
}

.section-title {
    font-size: 0.75rem;
    font-weight: 600;
    color: #94a3b8;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    margin-top: 1.5rem;
    margin-bottom: 0.5rem;
    border-bottom: 0.0625rem solid #e2e8f0;
    padding-bottom: 0.25rem;
}

.dark .section-title {
    border-color: #475569;
}



.alerta-modern {
    display: flex;
    align-items: flex-start;
    gap: 0.75rem;
    padding: 3px;
    border-radius: 0;
    margin-bottom: 0.5rem;
    border-left-width: 0.25rem;
    font-size: 0.875rem;
}

.alerta-modern svg {
    width: 1.25rem;
    height: 1.25rem;
    flex-shrink: 0;
    margin-top: 0.125rem;
}

.alerta-modern.bom {
    background-color: #f0fdf4;
    border-color: #22c55e;
    color: #15803d;
}

.dark .alerta-modern.bom {
    background-color: #162a1d;
    border-color: #4ade80;
    color: #bbf7d0;
}

.alerta-modern.atencao {
    background-color: #fffbeb;
    border-color: #f59e0b;
    color: #b45309;
}

.dark .alerta-modern.atencao {
    background-color: #2a210d;
    border-color: #facc15;
    color: #fef08a;
}

.alerta-modern.ruim {
    background-color: #fef2f2;
    border-color: #ef4444;
    color: #b91c1c;
}

.dark .alerta-modern.ruim {
    background-color: #2a1212;
    border-color: #f87171;
    color: #fecaca;
}

.status-alert {
    margin-top: 1.25rem;
    padding: 0.75rem;
    border-radius: 0;
    font-size: 0.8rem;
    display: flex;
    align-items: flex-start;
    gap: 0.75rem;
    line-height: 1.4;
    background: rgba(0, 0, 0, 0.15);
    border: 0.0625rem solid rgba(255, 255, 255, 0.2);
}

.dark .status-alert {
    background: rgba(0, 0, 0, 0.25);
}

.status-alert svg {
    width: 1.5rem;
    height: 1.5rem;
    flex-shrink: 0;
}

.status-alert.atencao {
    color: #fef08a;
}

.status-alert.ruim {
    color: #fecaca;
}

.status-alert.bom {
    color: #dcfce7;
}

#detalhes-talhao-container button {
    width: 100%;
    padding: 0.75rem;
    border: none;
    color: white;
    font-weight: 600;
    cursor: pointer;
    margin-top: 0.5rem;
    transition: all 0.2s;
    font-size: 0.9rem;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
}

#show-chart-btn,
#show-hourly-chart-btn,
#show-historic-btn {
    background-color: var(--cor-acao);
}

#show-chart-btn:hover,
#show-hourly-chart-btn:hover,
#show-historic-btn:hover {
    background-color: var(--cor-acao-hover);
}

#clear-selection-btn {
    background-color: var(--cor-destaque);
}

#clear-selection-btn:hover {
    background-color: #c2410c;
}

/* ==========================================================================
   SISTEMA DE BOTÕES PADRONIZADO (VigiaSafra UI)
   ========================================================================== */

.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    font-weight: 600;
    font-size: 0.875rem;
    padding: 0.5rem 1rem;
    border-radius: 6px;
    transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
    cursor: pointer;
    border: 1px solid transparent;
    line-height: 1.25rem;
    user-select: none;
    outline: none;
}

.btn:active {
    transform: scale(0.96);
}

.btn:disabled {
    opacity: 0.5;
    cursor: not-allowed;
    pointer-events: none;
}

/* Tamanhos */
.btn-xs {
    padding: 0.25rem 0.5rem;
    font-size: 0.75rem;
}

.btn-sm {
    padding: 0.375rem 0.75rem;
    font-size: 0.8125rem;
}

.btn-md {
    padding: 0.5rem 1rem;
    font-size: 0.875rem;
}

.btn-lg {
    padding: 0.75rem 1.5rem;
    font-size: 1rem;
}

/* Variantes de Cores */
.btn-primary {
    background-color: var(--cor-primaria);
    color: white;
}

.btn-primary:hover {
    background-color: var(--cor-primaria-hover);
    box-shadow: 0 4px 6px -1px rgba(54, 124, 43, 0.2);
}

.btn-secondary {
    background-color: #f1f5f9;
    color: #475569;
    border-color: #e2e8f0;
}

.btn-secondary:hover {
    background-color: #e2e8f0;
    color: #1e293b;
}

.btn-danger {
    background-color: var(--cor-perigo);
    color: white;
}

.btn-danger:hover {
    background-color: #b91c1c;
    box-shadow: 0 4px 6px -1px rgba(211, 47, 47, 0.2);
}

.btn-dark {
    background-color: #0F172A;
    color: white;
}

.btn-dark:hover {
    background-color: #1e293b;
    box-shadow: 0 4px 6px -1px rgba(211, 47, 47, 0.2);
}


.btn-warning {
    background-color: var(--cor-alerta);
    color: #92400e;
}

.btn-warning:hover {
    background-color: #ea580c;
    color: white;
}

.btn-info {
    background-color: #3b82f6;
    color: white;
}

.btn-info:hover {
    background-color: #2563eb;
}

.btn-ghost {
    background-color: transparent;
    color: var(--texto-secundario);
}

.btn-ghost:hover {
    background-color: rgba(0, 0, 0, 0.05);
    color: var(--texto-primario);
}

.btn-outline {
    background-color: transparent;
    border-color: var(--cor-borda);
    color: var(--texto-secundario);
}

.btn-outline:hover {
    border-color: var(--cor-primaria);
    color: var(--cor-primaria);
    background-color: rgba(54, 124, 43, 0.04);
}

/* Botões de Ícone */
.btn-icon {
    padding: 0.5rem;
    aspect-ratio: 1 / 1;
}

.btn-icon.btn-xs {
    padding: 0.25rem;
}

.btn-icon.btn-sm {
    padding: 0.375rem;
}

/* Dark Mode Overrides */
.dark .btn-secondary {
    background-color: #334155;
    color: #f1f5f9;
    border-color: #475569;
}

.dark .btn-secondary:hover {
    background-color: #475569;
}

.dark .btn-ghost:hover {
    background-color: rgba(255, 255, 255, 0.05);
}

#map-container {
    position: relative;
    z-index: 10;
    height: 100%;
    width: 100%;
    flex: 1;
}

#map {
    height: 100%;
    width: 100%;
    z-index: 0;
}

/* ==========================================================================
   GLASS PANEL — Dark translucent controls for map overlay
   ========================================================================== */

.map-glass-panel {
    background: rgba(255, 255, 255, 0.85);
    /* Light glass */
    backdrop-filter: blur(15px);
    -webkit-backdrop-filter: blur(15px);
    border: 1px solid rgba(255, 255, 255, 0.4);
    border-radius: 12px;
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.08), 0 1px 2px rgba(0, 0, 0, 0.04);
}

/* Botões dentro dos painéis glass */
.map-glass-panel .map-ctrl-btn {
    width: 36px;
    height: 36px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 10px;
    color: #475569;
    /* Darker text for light theme */
    background: transparent;
    border: none;
    cursor: pointer;
    transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
    position: relative;
}

.map-glass-panel .map-ctrl-btn:hover {
    color: #1e293b;
    background: rgba(0, 0, 0, 0.05);
    /* Subtle dark hover */
}

.map-glass-panel .map-ctrl-btn.active {
    color: #fff;
    background: #367C2B;
    box-shadow: 0 4px 12px rgba(54, 124, 43, 0.25);
}

.map-glass-panel .map-ctrl-btn.danger:hover {
    color: #ef4444;
    background: rgba(239, 68, 68, 0.08);
}

/* Map Type Collapsible Pill */

/* Separador leve dentro dos painéis glass */
.map-glass-divider {
    width: 20px;
    height: 1px;
    background: rgba(0, 0, 0, 0.08);
    margin: 4px auto;
}

/* Sub-menu colapsável */
.map-submenu {
    display: flex;
    flex-direction: row;
    /* Horizontal */
    align-items: center;
    gap: 4px;
    width: 0;
    height: 40px;
    /* Standard button height + padding */
    overflow: hidden;
    opacity: 0;
    transition: width 0.3s cubic-bezier(0.4, 0, 0.2, 1),
        opacity 0.2s ease,
        left 0.3s ease;
    position: absolute;
    left: 40px;
    /* Start near the toggle button */
    top: 50%;
    transform: translateY(-50%);
    background: rgba(255, 255, 255, 0.9);
    backdrop-filter: blur(15px);
    -webkit-backdrop-filter: blur(15px);
    border-radius: 20px;
    pointer-events: none;
    z-index: 10;
    white-space: nowrap;
    padding: 0;
    border: 1px solid rgba(0, 0, 0, 0.05);
}

.map-submenu.expanded {
    width: auto;
    max-width: 400px;
    /* Safety limit */
    opacity: 1;
    left: 54px;
    /* Move slightly to the right with gap */
    padding: 2px 8px;
    border: 1px solid rgba(0, 0, 0, 0.1);
    pointer-events: auto;
}

/* Tooltip para botões do painel glass */
.map-ctrl-tooltip {
    position: absolute;
    right: calc(100% + 10px);
    top: 50%;
    transform: translateY(-50%);
    background: rgba(255, 255, 255, 0.98);
    backdrop-filter: blur(8px);
    color: #1e293b;
    font-size: 10px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.04em;
    padding: 4px 10px;
    border-radius: 6px;
    white-space: nowrap;
    pointer-events: none;
    opacity: 0;
    transition: opacity 0.2s;
    z-index: 50;
    border: 1px solid rgba(0, 0, 0, 0.1);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
}

.map-ctrl-btn:hover .map-ctrl-tooltip {
    opacity: 1;
}

/* Tooltip esquerdo (para botões do lado esquerdo) */
.map-ctrl-tooltip.tooltip-right {
    right: auto;
    left: calc(100% + 10px);
}

/* Status bar content (inside HUD stack) */
.map-status-bar {
    background: transparent !important;
    backdrop-filter: none !important;
    -webkit-backdrop-filter: none !important;
    border: none !important;
    box-shadow: none !important;
    color: #1e293b !important;
    /* Pure white for contrast */
    width: 100% !important;
    min-width: 0 !important;
    max-width: none !important;
    padding: 2px 0 !important;
    opacity: 1 !important;
}

.map-status-bar i,
.map-status-bar span {
    color: #1e293b !important;
    opacity: 1 !important;
}

.map-status-bar .status-divider {
    width: 1px;
    height: 10px;
    background: rgba(0, 0, 0, 0.1);
}

/* Sidebar colapsada no mapa */
body.sidebar-collapsed #sidebar {
    width: 60px !important;
}

body.sidebar-collapsed #sidebar .sidebar-menu-text,
body.sidebar-collapsed #sidebar .sidebar-submenu,
body.sidebar-collapsed #sidebar .sidebar-section-title,
body.sidebar-collapsed #sidebar .sidebar-footer-links,
body.sidebar-collapsed #sidebar #collapse-text,
body.sidebar-collapsed #sidebar .fa-chevron-down {
    display: none !important;
}

body.sidebar-collapsed #sidebar nav>ul>li>a,
body.sidebar-collapsed #sidebar nav>ul>li>button {
    justify-content: center;
    padding-left: 0 !important;
    padding-right: 0 !important;
}

body.sidebar-collapsed #sidebar nav>ul>li>a .flex.items-center.gap-4,
body.sidebar-collapsed #sidebar nav>ul>li>button .flex.items-center.gap-4 {
    justify-content: center;
}

body.sidebar-collapsed #sidebar nav>ul>li>a i,
body.sidebar-collapsed #sidebar nav>ul>li>button>.flex>i {
    margin: 0;
    width: auto;
}

@media (max-width: 47.9375rem) {
    body.sidebar-collapsed #sidebar {
        width: 0 !important;
        transform: translateX(-100%) !important;
    }

    .sidebar-collapsed+main,
    body.sidebar-map-collapsed main#main-content {
        left: 0 !important;
        padding-left: 0;
    }
}

#loader-overlay {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(255, 255, 255, 0.9);
    z-index: 2000;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    color: white;
}

#loader {
    border-style: solid;
    border-color: #f3f3f3;
    border-width: 0.5rem;
    border-top-color: var(--cor-primaria);
    border-radius: 50%;
    width: 3.75rem;
    height: 3.75rem;
    animation: spin 1s linear infinite;
    margin-bottom: 1rem;
}

.loader-modal {
    border-style: solid;
    border-color: #f3f3f3;
    border-width: 0.25rem;
    border-top-color: var(--cor-primaria);
    border-radius: 50%;
    width: 2.5rem;
    height: 2.5rem;
    animation: spin 1s linear infinite;
    margin: 0 auto;
}

#area-display {
    position: absolute;
    top: 5rem;
    left: 50%;
    transform: translateX(-50%);
    background-color: rgba(0, 0, 0, 0.75);
    color: white;
    padding: 0.5rem 0.9375rem;
    border-radius: 0;
    font-size: 1rem;
    font-weight: bold;
    z-index: 1100;
    display: none;
}



/* ==========================================================================
   FULLSCREEN DETAIL PANEL (Painel Detalhes do Talhão)
   ========================================================================== */

.detail-fs-backdrop {
    position: fixed;
    inset: 0;
    z-index: 1500;
    background: rgba(0, 0, 0, 0.45);
    backdrop-filter: blur(8px);
    -webkit-backdrop-filter: blur(8px);
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.35s ease, visibility 0.35s ease;
}

.detail-fs-backdrop.visible {
    opacity: 1;
    visibility: visible;
}

.detail-fs-panel {
    position: fixed;
    inset: 0;
    z-index: 1501;
    display: flex;
    align-items: center;
    justify-content: center;
    pointer-events: none;
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.35s ease, visibility 0.35s ease;
}

.detail-fs-panel.visible {
    opacity: 1;
    visibility: visible;
    pointer-events: auto;
}

.detail-fs-inner {
    width: 92vw;
    max-width: 1400px;
    height: 88vh;
    max-height: 900px;
    background: var(--cor-painel);
    border-radius: 16px;
    box-shadow: 0 25px 60px rgba(0, 0, 0, 0.25), 0 0 0 1px rgba(255, 255, 255, 0.1);
    display: flex;
    flex-direction: column;
    overflow: hidden;
    transform: scale(0.92) translateY(20px);
    transition: transform 0.4s cubic-bezier(0.16, 1, 0.3, 1);
}

.detail-fs-panel.visible .detail-fs-inner {
    transform: scale(1) translateY(0);
}

/* Header */
.detail-fs-header {
    flex-shrink: 0;
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 1rem 1.5rem;
    border-bottom: 1px solid #e2e8f0;
    background: linear-gradient(to right, rgba(54, 124, 43, 0.03), transparent);
    gap: 1rem;
}

.dark .detail-fs-header {
    border-color: #334155;
    background: linear-gradient(to right, rgba(54, 124, 43, 0.06), transparent);
}

/* Body — 2 colunas */
.detail-fs-body {
    flex: 1;
    display: flex;
    min-height: 0;
    overflow: hidden;
}

/* Coluna Esquerda */
.detail-fs-col-left {
    width: 38%;
    min-width: 320px;
    display: flex;
    flex-direction: column;
    border-right: 1px solid #e2e8f0;
    overflow: hidden;
}

.dark .detail-fs-col-left {
    border-color: #334155;
}

/* Mini Mapa */
.detail-fs-minimap {
    flex-shrink: 0;
    height: 200px;
    background: #0f172a;
    position: relative;
}

.detail-fs-minimap .leaflet-container {
    height: 100%;
    width: 100%;
    border-radius: 0;
}

/* Meta (scroll) */
.detail-fs-meta {
    flex: 1;
    overflow-y: auto;
    padding: 1.25rem;
}

/* Coluna Direita */
.detail-fs-col-right {
    flex: 1;
    display: flex;
    flex-direction: column;
    min-width: 0;
    overflow: hidden;
}

/* Tabs dos Gráficos */
.detail-fs-chart-tabs {
    flex-shrink: 0;
    display: flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.75rem 1.5rem;
    border-bottom: 1px solid #f1f5f9;
    background: #fafbfc;
}

.dark .detail-fs-chart-tabs {
    background: #0f172a;
    border-color: #1e293b;
}

.detail-fs-tab {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.5rem 1rem;
    font-size: 0.75rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.06em;
    border-radius: 8px;
    border: 1px solid transparent;
    background: transparent;
    color: #64748b;
    cursor: pointer;
    transition: all 0.2s ease;
    white-space: nowrap;
}

.detail-fs-tab:hover {
    background: rgba(0, 0, 0, 0.04);
    color: #334155;
}

.detail-fs-tab.active {
    background: var(--cor-primaria);
    color: white;
    box-shadow: 0 2px 8px rgba(54, 124, 43, 0.25);
}

.detail-fs-tab i {
    font-size: 0.7rem;
}

/* Chart Area */
.detail-fs-chart-area {
    flex: 1;
    position: relative;
    padding: 1rem 1.5rem 1.5rem;
    min-height: 0;
    display: flex;
    flex-direction: column;
}

/* Download button in tabs area */
.detail-fs-tabs-actions {
    margin-left: auto;
    display: flex;
    align-items: center;
    gap: 0.25rem;
}

/* Loader dentro do chart area */
.detail-fs-chart-loader {
    position: absolute;
    inset: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    background: rgba(255, 255, 255, 0.85);
    z-index: 10;
    border-radius: 0;
}

/* Timeline content (para Pluviometria e Caderno de Campo) */
.detail-fs-timeline {
    flex: 1;
    overflow-y: auto;
    padding: 1.25rem 1.5rem;
}

/* Histório form dentro do chart area */
.detail-fs-historic-form {
    padding: 2rem;
    max-width: 500px;
    margin: 0 auto;
}

/* ── Responsive Mobile ── */
@media (max-width: 47.9375rem) {
    .detail-fs-inner {
        width: 100%;
        height: 100%;
        max-height: 100%;
        border-radius: 0;
    }

    .detail-fs-body {
        flex-direction: column;
    }

    .detail-fs-col-left {
        width: 100%;
        min-width: unset;
        border-right: none;
        border-bottom: 1px solid #e2e8f0;
        max-height: 45%;
    }

    .detail-fs-minimap {
        height: 140px;
    }

    .detail-fs-col-right {
        flex: 1;
        min-height: 0;
    }

    .detail-fs-header {
        padding: 0.75rem 1rem;
    }

    .detail-fs-chart-tabs {
        padding: 0.5rem 1rem;
        overflow-x: auto;
        -webkit-overflow-scrolling: touch;
        scrollbar-width: none;
    }

    .detail-fs-chart-tabs::-webkit-scrollbar {
        display: none;
    }

    .detail-fs-chart-area {
        padding: 0.75rem;
    }
}


@media (max-width: 47.9375rem) {
    #floating-button-container {
        top: auto !important;
        bottom: 56px !important;
        left: 1rem !important;
        right: auto !important;
    }

    #floating-button-save {
        position: absolute;
        top: auto !important;
        left: 50% !important;
    }
}

.leaflet-bar,
.leaflet-control-layers,
.leaflet-control-zoom,
#floating-button-container button,
.floating-controls-toggle {
    border-radius: 0.5rem !important;
    box-shadow: 0 10px 15px -3px rgba(0, 0, 0, 0.1), 0 4px 6px -4px rgba(0, 0, 0, 0.1) !important;
    border: none !important;
}

.leaflet-bar a {
    width: 30px !important;
    height: 30px !important;
    line-height: 30px !important;
    border-radius: 0 !important;
    transition: background-color 0.2s;
}

.leaflet-bar a:first-child {
    border-top-left-radius: 0.5rem !important;
    border-top-right-radius: 0.5rem !important;
}

.leaflet-bar a:last-child {
    border-bottom-left-radius: 0.5rem !important;
    border-bottom-right-radius: 0.5rem !important;
    border-bottom: none !important;
}

.leaflet-bar a:hover,
.leaflet-control-layers-toggle:hover {
    background-color: #f8fafc !important;
    color: #0f766e !important;
}

.dark .leaflet-bar,
.dark .leaflet-control-layers,
.dark .leaflet-bar a {
    background-color: #1e293b !important;
    color: #f1f5f9 !important;
    border-color: #334155 !important;
}

.dark .leaflet-bar a:hover {
    background-color: #334155 !important;
}

.leaflet-top.leaflet-left,
.leaflet-top.leaflet-right {
    padding: 0.625rem;
    top: 0 !important;
    /* Reset top padding since bar moved to bottom */
}

.leaflet-bottom.leaflet-left,
.leaflet-bottom.leaflet-right {
    padding: 0.625rem;
    bottom: 44px !important;
    /* Safe distance above the custom toolbar */
}

@media (max-width: 47.9375rem) {
    .leaflet-top.leaflet-right {
        left: auto;
        right: 0;
    }

    .leaflet-top.leaflet-left {
        left: 0;
    }

    .leaflet-control-container .leaflet-top.leaflet-right .leaflet-control,
    .leaflet-control-container .leaflet-top.leaflet-left .leaflet-control {
        margin: 0.625rem;
    }

    .leaflet-bottom.leaflet-right {
        display: none;
    }
}

.leaflet-control-geosearch.bar {
    border: 0.0625rem solid #ddd;
    box-shadow: 0 0.0625rem 0.3125rem rgba(0, 0, 0, 0.2);
    border-radius: 0.5rem;
    transition: all 0.2s ease-in-out;
}

.leaflet-control-geosearch.bar form {
    border: none;
    border-radius: 0.5rem;
}

.leaflet-control-geosearch.bar form input {
    border-radius: 0.5rem 0 0 0.5rem;
    padding: 0 0.75rem;
    height: 2.5rem;
    font-size: 0.875rem;
    border: none;
    background-color: #f8f9fa;
}

.leaflet-control-geosearch.bar form input:focus {
    background-color: #ffffff;
}

.leaflet-control-geosearch.bar .reset {
    display: none;
}

.leaflet-control-geosearch .results {
    border-radius: 0.5rem;
    margin-top: 0.5rem;
    box-shadow: 0 0.25rem 0.9375rem rgba(0, 0, 0, 0.15);
    border: 0.0625rem solid #eee;
}

.leaflet-control-geosearch .results>* {
    padding: 0.625rem 0.75rem;
    border-bottom: 0.0625rem solid #f0f0f0;
    font-size: 0.875rem;
}

.leaflet-control-geosearch .results>*:hover,
.leaflet-control-geosearch .results>.active {
    background-color: #198754;
    color: #fff;
}

.leaflet-control-geosearch a.glass {
    width: 2.5rem;
    height: 2.5rem;
    line-height: 2.5rem !important;
    border-radius: 0.5rem;
    border: none;
    background-color: #ffffff;
}

.leaflet-control-layers-toggle {
    width: 1.875rem !important;
    height: 1.875rem !important;
}

.leaflet-tooltip.custom-leaflet-tooltip {
    background: transparent;
    border: none;
    box-shadow: none;
    padding: 0;
}

.leaflet-tooltip-top.custom-leaflet-tooltip:before,
.leaflet-tooltip-bottom.custom-leaflet-tooltip:before,
.leaflet-tooltip-left.custom-leaflet-tooltip:before,
.leaflet-tooltip-right.custom-leaflet-tooltip:before {
    display: none;
}

.leaflet-popup-content-wrapper {
    border-radius: 0 !important;
    box-shadow: 0 4px 10px rgba(0, 0, 0, 0.15) !important;
}

.leaflet-popup-tip {
    border-radius: 0 !important;
}

.dropdown-content {
    position: absolute;
    top: 100%;
    right: 0;
    margin-top: 0.5rem;
    min-width: 12rem;
    background-color: var(--cor-painel);
    border: 0.0625rem solid var(--cor-borda);
    border-radius: 0.5rem;
    box-shadow: 0 0.25rem 0.375rem rgba(0, 0, 0, 0.1);
    z-index: 1010;
    opacity: 0;
    visibility: hidden;
    transform: translateY(-0.625rem);
    transition: opacity 0.2s ease-out, transform 0.2s ease-out, visibility 0.2s ease-out;
}

.dropdown-content.visible {
    opacity: 1;
    visibility: visible;
    transform: translateY(0);
}

.dropdown-content a {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding: 0.75rem 1rem;
    color: var(--texto-secundario);
    font-size: 0.9rem;
    font-weight: 500;
    transition: background-color 0.15s;
}

.dropdown-content a:hover {
    background-color: var(--cor-fundo);
}

.toast-enter {
    opacity: 0;
    transform: translateY(1.25rem);
}

.toast-show {
    opacity: 1;
    transform: translateY(0);
    transition: all 0.3s ease;
}

.toast-exit {
    opacity: 0;
    transform: translateY(1.25rem);
    transition: all 0.3s ease;
}

.agro-toggle:checked+.agro-toggle-bg {
    background-color: #10b981 !important;
    border-color: #10b981 !important;
}

.agro-toggle:checked+.agro-toggle-bg:after {
    transform: translateX(100%);
    border-color: white;
}

.precip-label {
    color: #fff;
    font-weight: bold;
    font-size: 0.9rem;
    text-align: center;
}

@keyframes spin {
    0% {
        transform: rotate(0deg);
    }

    100% {
        transform: rotate(360deg);
    }
}

@keyframes wind-flow-anim {
    0% {
        opacity: 0;
        transform: translateY(12px) scale(0.85);
    }

    20% {
        opacity: 1;
        transform: translateY(4px) scale(1);
    }

    80% {
        opacity: 1;
        transform: translateY(-4px) scale(1);
    }

    100% {
        opacity: 0;
        transform: translateY(-12px) scale(0.85);
    }
}

.flow-vector-indicator {
    background: none !important;
    border: none !important;
    display: flex;
    align-items: center;
    justify-content: center;
    opacity: 0.9;
    transition: all 0.5s ease-out;
    pointer-events: none;
}

.wind-arrow-wrapper {
    width: 100%;
    height: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
    animation: wind-flow-anim 3s cubic-bezier(0.4, 0, 0.2, 1) infinite;
    filter: drop-shadow(0 2px 4px rgba(0, 0, 0, 0.5));
    transform-origin: center center;
}

.wind-arrow-svg {
    width: 100%;
    height: 100%;
    transform-origin: center center;
}

/* Legend Styles - Inside Unified HUD Stack */
.info-legend.horizontal-legend {
    position: relative !important;
    bottom: auto !important;
    right: auto !important;
    left: auto !important;
    top: auto !important;
    transform: none !important;
    background: transparent !important;
    backdrop-filter: none !important;
    -webkit-backdrop-filter: none !important;
    padding: 12px 16px !important;
    border-radius: 0 !important;
    box-shadow: none !important;
    border: none !important;
    font-family: inherit;
    color: rgba(255, 255, 255, 0.9) !important;
    width: 100% !important;
    min-width: 0 !important;
    max-width: none !important;
    box-sizing: border-box !important;
    margin: 0 !important;
    z-index: 1 !important;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
}

.legend-header {
    margin: 0;
    font-size: 0.65rem;
    display: flex;
    align-items: center;
    gap: 4px;
    white-space: nowrap;
}

.legend-header strong {
    color: rgba(255, 255, 255, 0.8);
    font-weight: 700;
}

.legend-header span {
    color: rgba(255, 255, 255, 0.5) !important;
    font-size: 0.6rem;
}

.legend-range {
    display: none;
    /* Hidden to save space and keep it discreet */
}

.legend-scale-container {
    display: flex;
    flex-direction: column;
    justify-content: center;
    flex: 1;
    /* Take up remaining horizontal space */
    padding-top: 2px;
}

.legend-bar-row {
    display: flex;
    height: 6px;
    /* Very thin bar */
    width: 100%;
    border-radius: 3px;
    overflow: hidden;
}

.legend-labels-row {
    display: flex;
    width: 100%;
    margin-top: 1px;
}

.legend-tick {
    flex: 1;
    display: flex;
    flex-direction: column;
    align-items: center;
    position: relative;
    /* Hide empty ticks so only numbers show */
}

.tick-mark {
    display: none;
    /* Hide pipe character */
}

.tick-label {
    font-size: 7px;
    margin-top: 0;
    color: rgba(44, 44, 44, 0.5);
    font-weight: 700;
}


/* Crosshair e Coordenadas do Mapa */
.crosshair {
    position: absolute;
    background-color: rgba(255, 255, 255, 0.5);
    pointer-events: none;
    z-index: 800;
    display: none;
}

.crosshair.visible {
    display: block;
}

#crosshair-h {
    height: 1px;
    width: 100%;
    left: 0;
}

#crosshair-v {
    width: 1px;
    height: 100%;
    top: 0;
}



/* Cursor Hiding logic */
.leaflet-container.hide-mouse-cursor {
    cursor: none !important;
}

.leaflet-container.hide-mouse-cursor .leaflet-control,
.leaflet-container.hide-mouse-cursor .leaflet-control * {
    cursor: auto !important;
}

.leaflet-container.hide-mouse-cursor .leaflet-interactive {
    cursor: pointer;
}

/* =====================================================
   PAGE LOADER ANIMATIONS
   ===================================================== */

@keyframes spin {
    0% {
        transform: rotate(0deg);
    }

    100% {
        transform: rotate(360deg);
    }
}

@keyframes progress-indeterminate {
    0% {
        width: 0%;
        margin-left: 0%;
    }

    50% {
        width: 40%;
        margin-left: 30%;
    }

    100% {
        width: 0%;
        margin-left: 100%;
    }
}

.animate-progress-indeterminate {
    animation: progress-indeterminate 1.5s ease-in-out infinite;
}

/* =====================================================
   SIDEBAR COLLAPSED STATE
   ===================================================== */
@media (min-width: 48rem) {
    body.sidebar-collapsed #sidebar {
        width: 80px !important;
        overflow: visible !important;
    }

    body.sidebar-collapsed main {
        padding-left: 80px !important;
    }

    body.sidebar-collapsed #vigiamind-chat-container {
        left: 80px !important;
    }

    body.sidebar-collapsed #sidebar h3 {
        display: none;
    }

    /* Container adjustments for collapsed state */
    body.sidebar-collapsed #sidebar ul li a.group,
    body.sidebar-collapsed #sidebar ul li button.group,
    body.sidebar-collapsed #sidebar-toggle-btn {
        flex-direction: column !important;
        justify-content: center !important;
        align-items: center !important;
        gap: 4px !important;
        padding: 12px 4px !important;
        text-align: center;
    }

    /* Fix inner wrappers that cause flex-row side-by-side issues */
    body.sidebar-collapsed #sidebar ul li a.group>div,
    body.sidebar-collapsed #sidebar ul li button.group>div {
        flex-direction: column !important;
        justify-content: center !important;
        align-items: center !important;
        gap: 4px !important;
        width: 100% !important;
    }

    /* Align nested flex columns to center */
    body.sidebar-collapsed #sidebar ul li a.group>div>div,
    body.sidebar-collapsed #sidebar ul li button.group>div>div {
        align-items: center !important;
    }

    /* Icons */
    body.sidebar-collapsed #sidebar ul li a.group i:not(.fa-chevron-down),
    body.sidebar-collapsed #sidebar ul li button.group i:not(.fa-chevron-down),
    body.sidebar-collapsed #sidebar-toggle-btn i {
        margin: 0 !important;
        width: auto !important;
        font-size: 1.25rem !important;
        transition: transform 0.3s ease;
    }

    /* Hide chevrons and subtexts in parent menus */
    body.sidebar-collapsed #sidebar ul li a.group .text-xs,
    body.sidebar-collapsed #sidebar ul li button.group .text-xs,
    body.sidebar-collapsed #sidebar ul li button.group .fa-chevron-down {
        display: none !important;
    }

    /* Parent menu texts */
    body.sidebar-collapsed #sidebar ul li a.group .text-sm,
    body.sidebar-collapsed #sidebar ul li button.group .text-sm,
    body.sidebar-collapsed #sidebar-toggle-btn .text-sm {
        font-size: 10px !important;
        white-space: normal !important;
        line-height: 1.1 !important;
        margin-top: 4px;
        text-align: center !important;
    }

    /* Submenus as Hover Flyouts (Tooltips) on Collapse */
    body.sidebar-collapsed #sidebar nav>ul>li {
        position: relative !important;
    }

    body.sidebar-collapsed #sidebar nav>ul>li>ul {
        display: none !important;
        position: absolute !important;
        left: 80px !important;
        top: 0 !important;
        width: 250px !important;
        background-color: #ffffff !important;
        border: 1px solid #E7E7E7 !important;
        border-left: none !important;
        box-shadow: 4px 4px 15px rgba(0, 0, 0, 0.08) !important;
        flex-direction: column !important;
        z-index: 1050 !important;

        padding: 8px 0 !important;
    }

    body.sidebar-collapsed #sidebar nav>ul>li:hover>ul {
        display: flex !important;
    }

    /* Reset submenu item formatting for flyout */
    body.sidebar-collapsed #sidebar nav>ul>li>ul li a.group {
        flex-direction: row !important;
        justify-content: flex-start !important;
        align-items: center !important;
        padding: 10px 24px !important;
        text-align: left !important;
        width: 100% !important;
    }

    body.sidebar-collapsed #sidebar nav>ul>li>ul li a.group i {
        margin-right: 12px !important;
        margin-bottom: 0 !important;
        font-size: 14px !important;
        width: 20px !important;
        text-align: center !important;
    }

    body.sidebar-collapsed #sidebar nav>ul>li>ul li a.group span {
        display: block !important;
        font-size: 13px !important;
        white-space: nowrap !important;
    }

    /* Footer adjustments */
    body.sidebar-collapsed #sidebar .mt-auto>div {
        padding: 16px 4px !important;
    }

    body.sidebar-collapsed #sidebar .mt-auto .text-\[10px\] {
        display: none !important;
    }
}

/* ==========================================================================
   MODAL PREMIUM & CUSTOM SCROLLBAR (VigiaSafra UI)
   ========================================================================== */
.modal-scrollbar::-webkit-scrollbar {
    width: 6px;
    height: 6px;
}

.modal-scrollbar::-webkit-scrollbar-track {
    background: transparent;
}

.modal-scrollbar::-webkit-scrollbar-thumb {
    background: #e2e8f0;
    border-radius: 10px;
    transition: background 0.2s;
}

.dark .modal-scrollbar::-webkit-scrollbar-thumb {
    background: #334155;
}

.modal-scrollbar::-webkit-scrollbar-thumb:hover {
    background: #cbd5e1;
}

.dark .modal-scrollbar::-webkit-scrollbar-thumb:hover {
    background: #475569;
}

/* Ajustes para conteúdo dentro do modal */
#modal-content {
    scrollbar-width: thin;
    scrollbar-color: #e2e8f0 transparent;
}

.dark #modal-content {
    scrollbar-color: #334155 transparent;
}

#modal-content>* {
    animation: modal-content-fade 0.4s ease-out forwards;
}

@keyframes modal-content-fade {
    from {
        opacity: 0;
        transform: translateY(10px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* ==========================================================================
   SISTEMA DE DESENHO E EDIÇÃO DE TALHÕES (Draw Manager)
   ========================================================================== */

/* ── Cursor de Precisão (Modo Desenho) ─────────────────────────── */
body.drawing-mode,
body.drawing-mode .leaflet-container {
    cursor: crosshair !important;
}

body.drawing-mode .leaflet-interactive {
    cursor: crosshair !important;
}

/* ── Botão '+ Novo Talhão' na lista lateral ────────────────────── */
.new-talhao-btn-item {
    padding: 0.5rem 0.75rem !important;
    border-bottom: 1px solid var(--cor-borda) !important;
    cursor: default !important;
}

.new-talhao-btn-item:hover {
    background-color: transparent !important;
}

.new-talhao-btn {
    width: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    padding: 0.625rem 1rem;
    border: 2px dashed rgba(54, 124, 43, 0.3);
    border-radius: 8px;
    background: rgba(54, 124, 43, 0.04);
    color: var(--cor-primaria);
    font-size: 0.8rem;
    font-weight: 700;
    cursor: pointer;
    transition: all 0.25s cubic-bezier(0.4, 0, 0.2, 1);
    text-transform: uppercase;
    letter-spacing: 0.03em;
}

.new-talhao-btn:hover {
    background: rgba(54, 124, 43, 0.1);
    border-color: var(--cor-primaria);
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(54, 124, 43, 0.15);
}

.new-talhao-btn:active {
    transform: translateY(0) scale(0.98);
}

.new-talhao-btn i {
    font-size: 0.9rem;
}

/* ── Barra Flutuante de Ações ──────────────────────────────────── */
.draw-bar {
    display: flex;
    align-items: center;
    gap: 0;
    padding: 0.5rem 0.75rem;
    animation: draw-bar-slide-up 0.3s cubic-bezier(0.16, 1, 0.3, 1) forwards;
}

@keyframes draw-bar-slide-up {
    from {
        opacity: 0;
        transform: translateY(12px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.draw-bar-section {
    display: flex;
    align-items: center;
    gap: 0.375rem;
    padding: 0 0.5rem;
}

.draw-bar-divider {
    width: 1px;
    height: 24px;
    background: rgba(0, 0, 0, 0.1);
    flex-shrink: 0;
}

/* Indicador de modo */
.draw-bar-indicator {
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.draw-bar-pulse {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background: #ef4444;
    animation: draw-pulse 1.5s ease-in-out infinite;
}

.draw-bar-pulse-edit {
    background: #f59e0b;
}

@keyframes draw-pulse {

    0%,
    100% {
        opacity: 1;
        transform: scale(1);
    }

    50% {
        opacity: 0.5;
        transform: scale(1.3);
    }
}

.draw-bar-indicator-success i {
    color: #22c55e;
    font-size: 0.875rem;
}

.draw-bar-indicator-edit i {
    color: #f59e0b;
}

.draw-bar-mode {
    font-size: 0.7rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    color: #475569;
    white-space: nowrap;
}

/* Área display */
.draw-bar-area {
    font-size: 0.75rem;
    font-weight: 700;
    color: #1e293b;
    white-space: nowrap;
    display: flex;
    align-items: center;
    gap: 0.375rem;
    background: rgba(0, 0, 0, 0.04);
    padding: 0.25rem 0.625rem;
    border-radius: 6px;
}

.draw-bar-area i {
    font-size: 0.65rem;
    color: var(--cor-primaria);
}

/* Botões da barra */
.draw-bar-actions {
    gap: 0.375rem;
}

.draw-bar-btn {
    display: inline-flex;
    align-items: center;
    gap: 0.375rem;
    padding: 0.375rem 0.75rem;
    border-radius: 8px;
    font-size: 0.7rem;
    font-weight: 700;
    cursor: pointer;
    border: none;
    transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
    text-transform: uppercase;
    letter-spacing: 0.02em;
    white-space: nowrap;
}

.draw-bar-btn i {
    font-size: 0.65rem;
}

.draw-bar-btn-primary {
    background: var(--cor-primaria);
    color: #fff;
}

.draw-bar-btn-primary:hover {
    background: var(--cor-primaria-hover);
    box-shadow: 0 4px 12px rgba(54, 124, 43, 0.3);
    transform: translateY(-1px);
}

.draw-bar-btn-danger {
    background: rgba(239, 68, 68, 0.08);
    color: #ef4444;
}

.draw-bar-btn-danger:hover {
    background: #ef4444;
    color: #fff;
}

.draw-bar-btn-ghost {
    background: rgba(0, 0, 0, 0.04);
    color: #64748b;
}

.draw-bar-btn-ghost:hover {
    background: rgba(0, 0, 0, 0.08);
    color: #1e293b;
}

/* ── Snap Indicator (ponto magnético) ──────────────────────────── */
.snap-indicator {
    animation: snap-glow 0.8s ease-in-out infinite alternate;
}

@keyframes snap-glow {
    from {
        filter: drop-shadow(0 0 3px #FACC15);
    }

    to {
        filter: drop-shadow(0 0 8px #FACC15);
    }
}

/* ── Vértices de Desenho (Leaflet.Draw override) ───────────────── */
.draw-vertex-icon {
    background: #FFFFFF !important;
    border: 2px solid #367C2B !important;
    border-radius: 50% !important;
    width: 10px !important;
    height: 10px !important;
    margin-left: -5px !important;
    margin-top: -5px !important;
    box-shadow: 0 2px 6px rgba(0, 0, 0, 0.2);
    cursor: pointer !important;
}

/* Leaflet.Draw editing vertex handles override */
.leaflet-editing-icon {
    background: #FFFFFF !important;
    border: 2px solid #367C2B !important;
    border-radius: 50% !important;
    width: 12px !important;
    height: 12px !important;
    margin-left: -6px !important;
    margin-top: -6px !important;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.2);
    cursor: grab !important;
    /* SEM transition aqui — causa delay no arraste dos vértices */
}

.leaflet-editing-icon:hover {
    box-shadow: 0 3px 12px rgba(54, 124, 43, 0.3);
    border-color: #2E6B24 !important;
    width: 14px !important;
    height: 14px !important;
    margin-left: -7px !important;
    margin-top: -7px !important;
}

.leaflet-editing-icon:active {
    cursor: grabbing !important;
    border-color: #367C2B !important;
    width: 12px !important;
    height: 12px !important;
    margin-left: -6px !important;
    margin-top: -6px !important;
}

/* ── Leaflet.Draw toolbar hide (controlamos via JS) ────────────── */
.leaflet-draw-toolbar,
.leaflet-draw-actions {
    display: none !important;
}

/* ── Responsivo: barra flutuante em mobile ─────────────────────── */
@media (max-width: 640px) {
    .draw-bar {
        flex-wrap: wrap;
        justify-content: center;
        gap: 0.25rem;
        padding: 0.5rem;
    }

    .draw-bar-divider {
        display: none;
    }

    .draw-bar-section {
        padding: 0.25rem;
    }

    .draw-bar-btn span {
        display: none;
    }
}