        :root {
            --primary: #072b4a;
            --primary-light: #0d4a7a;
            --accent: #4da6ff;
            --accent-light: #66b3ff;
            --success: #2e7d32;
            --warning: #ff9800;
            --danger: #d32f2f;
            --neutral-50: #f9fafb;
            --neutral-100: #f3f4f6;
            --neutral-200: #e5e7eb;
            --neutral-300: #d1d5db;
            --neutral-700: #374151;
            /* Dark mode colors */
            --dm-bg: #1a1a2e;
            --dm-surface: #16213e;
            --dm-surface-light: #1f3460;
            --dm-text: #e8e8e8;
            --dm-text-muted: #a0a0a0;
            --dm-border: #2a3f5f;
        }

        /* ========================================
           🌙 DARK MODE STYLES
           ======================================== */
        body.dark-mode {
            background-color: var(--dm-bg) !important;
            color: var(--dm-text) !important;
        }
        
        body.dark-mode #sigwebHeader {
            background: linear-gradient(135deg, #1a1a2e 0%, #16213e 100%) !important;
        }
        
        body.dark-mode #customLayerPanel,
        body.dark-mode .filter-modal,
        body.dark-mode .modal-content,
        body.dark-mode .panel-content {
            background: var(--dm-surface) !important;
            color: var(--dm-text) !important;
            border-color: var(--dm-border) !important;
        }
        
        body.dark-mode .panel-header,
        body.dark-mode .section-title {
            background: var(--dm-surface-light) !important;
            color: var(--dm-text) !important;
        }
        
        body.dark-mode input,
        body.dark-mode select,
        body.dark-mode textarea {
            background: var(--dm-surface-light) !important;
            color: var(--dm-text) !important;
            border-color: var(--dm-border) !important;
        }
        
        body.dark-mode table {
            background: var(--dm-surface) !important;
        }
        
        body.dark-mode th {
            background: var(--dm-surface-light) !important;
            color: var(--dm-text) !important;
        }
        
        body.dark-mode td {
            color: var(--dm-text) !important;
            border-color: var(--dm-border) !important;
        }
        
        body.dark-mode tr:hover {
            background: var(--dm-surface-light) !important;
        }
        
        /* Dark mode toggle button */
        .dark-mode-toggle {
            background: rgba(255,255,255,0.1);
            border: 1px solid rgba(255,255,255,0.2);
            color: white;
            padding: 6px 10px;
            border-radius: 6px;
            cursor: pointer;
            font-size: 16px;
            transition: all 0.3s ease;
            display: flex;
            align-items: center;
            gap: 4px;
        }
        
        .dark-mode-toggle:hover {
            background: rgba(255,255,255,0.2);
            transform: scale(1.05);
        }

        /* ========================================
           ✨ ANIMATION STYLES
           ======================================== */
        .fade-in {
            animation: fadeIn 0.3s ease forwards;
        }
        
        .slide-in {
            animation: slideIn 0.3s ease forwards;
        }
        
        .slide-down {
            animation: slideDown 0.3s ease forwards;
        }
        
        @keyframes fadeIn {
            from { opacity: 0; }
            to { opacity: 1; }
        }
        
        @keyframes slideIn {
            from { opacity: 0; transform: translateX(-20px); }
            to { opacity: 1; transform: translateX(0); }
        }
        
        @keyframes slideOut {
            from { opacity: 1; transform: translateX(0); }
            to { opacity: 0; transform: translateX(20px); }
        }
        
        @keyframes slideDown {
            from { opacity: 0; transform: translateY(-10px); }
            to { opacity: 1; transform: translateY(0); }
        }
        
        /* Hover effects for buttons */
        .btn-hover-effect {
            transition: all 0.2s ease;
        }
        
        .btn-hover-effect:hover {
            transform: translateY(-2px);
            box-shadow: 0 4px 12px rgba(0,0,0,0.15);
        }
        
        .btn-hover-effect:active {
            transform: translateY(0);
        }

        /* ========================================
           📡 CONNECTION STATUS INDICATOR
           ======================================== */
        .connection-status {
            display: flex;
            align-items: center;
            gap: 6px;
            padding: 4px 10px;
            border-radius: 20px;
            font-size: 11px;
            font-weight: 700;
            text-transform: uppercase;
        }
        
        .connection-status.online {
            background: rgba(46, 125, 50, 0.2);
            color: #4caf50;
        }
        
        .connection-status.offline {
            background: rgba(211, 47, 47, 0.2);
            color: #f44336;
            animation: pulse 1.5s infinite;
        }
        
        .connection-dot {
            width: 8px;
            height: 8px;
            border-radius: 50%;
        }
        
        .connection-status.online .connection-dot {
            background: #4caf50;
        }
        
        .connection-status.offline .connection-dot {
            background: #f44336;
        }
        
        @keyframes pulse {
            0%, 100% { opacity: 1; }
            50% { opacity: 0.5; }
        }

        /* ========================================
           🔍 GLOBAL SEARCH BAR
           ======================================== */
        .global-search-overlay {
            position: fixed;
            top: 0;
            left: 0;
            width: 100%;
            height: 100%;
            background: rgba(0,0,0,0.5);
            backdrop-filter: blur(4px);
            z-index: 99998;
            display: none;
            justify-content: center;
            padding-top: 15vh;
        }
        
        .global-search-overlay.active {
            display: flex;
        }
        
        .global-search-box {
            width: 600px;
            max-width: 90%;
            background: white;
            border-radius: 12px;
            box-shadow: 0 20px 60px rgba(0,0,0,0.3);
            overflow: hidden;
            animation: slideDown 0.2s ease;
        }
        
        body.dark-mode .global-search-box {
            background: var(--dm-surface);
        }
        
        .global-search-input-container {
            display: flex;
            align-items: center;
            padding: 16px 20px;
            border-bottom: 1px solid var(--neutral-200);
            gap: 12px;
        }
        
        body.dark-mode .global-search-input-container {
            border-color: var(--dm-border);
        }
        
        .global-search-input {
            flex: 1;
            border: none;
            outline: none;
            font-size: 18px;
            background: transparent;
        }
        
        .global-search-hint {
            padding: 12px 20px;
            color: #666;
            font-size: 12px;
            background: var(--neutral-50);
        }
        
        body.dark-mode .global-search-hint {
            background: var(--dm-surface-light);
            color: var(--dm-text-muted);
        }

        /* ========================================
           💡 ENHANCED TOOLTIPS
           ======================================== */
        .tooltip-enhanced {
            position: relative;
        }
        
        .tooltip-enhanced::before,
        .tooltip-enhanced::after {
            position: absolute;
            opacity: 0;
            visibility: hidden;
            transition: all 0.2s ease;
            pointer-events: none;
        }
        
        .tooltip-enhanced::before {
            content: attr(data-tooltip);
            bottom: calc(100% + 8px);
            left: 50%;
            transform: translateX(-50%);
            background: #333;
            color: white;
            padding: 6px 12px;
            border-radius: 6px;
            font-size: 12px;
            white-space: nowrap;
            z-index: 99999;
        }
        
        .tooltip-enhanced::after {
            content: '';
            bottom: calc(100% + 2px);
            left: 50%;
            transform: translateX(-50%);
            border: 6px solid transparent;
            border-top-color: #333;
            z-index: 99999;
        }
        
        .tooltip-enhanced:hover::before,
        .tooltip-enhanced:hover::after {
            opacity: 1;
            visibility: visible;
        }
        
        .tooltip-shortcut {
            display: inline-block;
            background: rgba(255,255,255,0.2);
            padding: 2px 6px;
            border-radius: 4px;
            font-size: 10px;
            margin-left: 6px;
        }

        /* ========================================
           🎨 STATUS COLORS FOR TABLE ROWS
           ======================================== */
        .status-regular {
            border-left: 4px solid #4caf50 !important;
            background: rgba(76, 175, 80, 0.05) !important;
        }
        
        .status-pendente {
            border-left: 4px solid #ff9800 !important;
            background: rgba(255, 152, 0, 0.05) !important;
        }
        
        .status-irregular {
            border-left: 4px solid #f44336 !important;
            background: rgba(244, 67, 54, 0.05) !important;
        }
        
        .status-legend {
            display: flex;
            gap: 16px;
            padding: 8px 12px;
            background: var(--neutral-50);
            border-radius: 6px;
            font-size: 11px;
            margin-bottom: 8px;
        }
        
        .status-legend-item {
            display: flex;
            align-items: center;
            gap: 6px;
        }
        
        .status-legend-dot {
            width: 12px;
            height: 12px;
            border-radius: 3px;
        }
        
        .status-legend-dot.regular { background: #4caf50; }
        .status-legend-dot.pendente { background: #ff9800; }
        .status-legend-dot.irregular { background: #f44336; }

        /* ========================================
           📈 MINI DASHBOARD IN HEADER
           ======================================== */
        .mini-dashboard {
            display: flex;
            gap: 12px;
            margin-right: 15px;
        }
        
        .mini-stat {
            display: flex;
            flex-direction: column;
            align-items: center;
            padding: 4px 12px;
            background: rgba(255,255,255,0.1);
            border-radius: 8px;
            min-width: 70px;
        }
        
        .mini-stat-value {
            font-size: 16px;
            font-weight: 700;
            color: white;
        }
        
        .mini-stat-label {
            font-size: 9px;
            color: rgba(255,255,255,0.7);
            text-transform: uppercase;
            letter-spacing: 0.5px;
        }
        
        body.dark-mode .mini-stat {
            background: rgba(255,255,255,0.05);
        }

        /* ========================================
           🛠️ TOOLBAR DE FERRAMENTAS EXTRAS
           ======================================== */
        .extra-tools-panel {
            position: fixed;
            left: 10px;
            top: 50%;
            transform: translateY(-50%);
            background: white;
            border-radius: 8px;
            box-shadow: 0 4px 20px rgba(0,0,0,0.15);
            padding: 8px;
            z-index: 1000;
            display: flex;
            flex-direction: column;
            gap: 4px;
        }
        
        .extra-tool-btn {
            width: 36px;
            height: 36px;
            border: none;
            background: #f5f5f5;
            border-radius: 6px;
            cursor: pointer;
            font-size: 16px;
            display: flex;
            align-items: center;
            justify-content: center;
            transition: all 0.2s ease;
            position: relative;
        }
        
        .extra-tool-btn:hover {
            background: #e3f2fd;
            transform: scale(1.1);
        }
        
        .extra-tool-btn.active {
            background: var(--accent);
            color: white;
        }
        
        .extra-tool-btn[data-tooltip]:hover::after {
            content: attr(data-tooltip);
            position: absolute;
            left: calc(100% + 8px);
            top: 50%;
            transform: translateY(-50%);
            background: #333;
            color: white;
            padding: 4px 8px;
            border-radius: 4px;
            font-size: 11px;
            white-space: nowrap;
            z-index: 10000;
        }
        
        .tool-divider {
            height: 1px;
            background: #e0e0e0;
            margin: 4px 0;
        }

        /* ========================================
           📍 MODAL IR PARA COORDENADAS
           ======================================== */
        .goto-modal {
            position: fixed;
            top: 50%;
            left: 50%;
            transform: translate(-50%, -50%);
            background: white;
            border-radius: 12px;
            padding: 24px;
            box-shadow: 0 20px 60px rgba(0,0,0,0.3);
            z-index: 99999;
            min-width: 350px;
            display: none;
        }
        
        .goto-modal.active {
            display: block;
            animation: slideDown 0.2s ease;
        }
        
        .goto-modal h3 {
            margin: 0 0 16px;
            color: var(--primary);
            display: flex;
            align-items: center;
            gap: 8px;
        }
        
        .goto-modal .input-group {
            margin-bottom: 12px;
        }
        
        .goto-modal label {
            display: block;
            font-size: 12px;
            font-weight: 700;
            color: #666;
            margin-bottom: 4px;
        }
        
        .goto-modal input {
            width: 100%;
            padding: 10px 12px;
            border: 2px solid #e0e0e0;
            border-radius: 8px;
            font-size: 14px;
            box-sizing: border-box;
        }
        
        .goto-modal input:focus {
            border-color: var(--accent);
            outline: none;
        }
        
        .goto-modal .btn-row {
            display: flex;
            gap: 8px;
            margin-top: 16px;
        }
        
        .goto-modal button {
            flex: 1;
            padding: 10px;
            border: none;
            border-radius: 8px;
            font-weight: 700;
            cursor: pointer;
            transition: all 0.2s;
        }
        
        .goto-modal .btn-primary {
            background: var(--accent);
            color: white;
        }
        
        .goto-modal .btn-secondary {
            background: #f0f0f0;
            color: #333;
        }

        /* ========================================
           🎯 MODAL BUFFER/RAIO
           ======================================== */
        .buffer-modal {
            position: fixed;
            top: 50%;
            left: 50%;
            transform: translate(-50%, -50%);
            background: white;
            border-radius: 12px;
            padding: 24px;
            box-shadow: 0 20px 60px rgba(0,0,0,0.3);
            z-index: 99999;
            min-width: 320px;
            display: none;
        }
        
        .buffer-modal.active {
            display: block;
            animation: slideDown 0.2s ease;
        }

        /* ════════════════════════════════════════
           📜 PAINEL DE HISTÓRICO - DESIGN PRO
           ════════════════════════════════════════ */
        .history-panel {
            position: fixed;
            right: -620px;
            top: 70px;
            bottom: 0;
            width: 600px;
            background: #f4f6f9;
            box-shadow: -8px 0 48px rgba(0,0,0,0.18);
            z-index: 8000;
            transition: right 0.35s cubic-bezier(0.4,0,0.2,1);
            display: flex;
            flex-direction: column;
            font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
        }
        .history-panel.active { right: 0; }

        /* HEADER */
        .history-panel-header {
            padding: 14px 18px;
            background: linear-gradient(135deg, #1a237e 0%, #1565C0 55%, #1976D2 100%);
            color: white;
            display: flex;
            justify-content: space-between;
            align-items: center;
            flex-shrink: 0;
            box-shadow: 0 3px 10px rgba(0,0,0,0.2);
        }
        .hp-header-info { display:flex; align-items:center; gap:12px; }
        .hp-header-icon {
            font-size: 22px;
            width: 40px; height: 40px;
            background: rgba(255,255,255,0.15);
            border-radius: 10px;
            display: flex; align-items: center; justify-content: center;
            border: 1px solid rgba(255,255,255,0.2);
        }
        .hp-header-title { font-size:15px; font-weight:700; letter-spacing:0.3px; }
        .hp-header-sub   { font-size:10px; opacity:0.72; margin-top:2px; }
        .hp-header-actions { display:flex; align-items:center; gap:10px; }
        .hp-count-badge {
            background: rgba(255,255,255,0.18);
            border: 1px solid rgba(255,255,255,0.3);
            color: white; padding: 3px 11px;
            border-radius: 20px; font-size:11px; font-weight:600;
            min-width: 64px; text-align:center;
        }
        .hp-close-btn {
            background: rgba(255,255,255,0.15); border: none; color: white;
            font-size: 17px; width: 32px; height: 32px; border-radius: 8px;
            cursor: pointer; display: flex; align-items: center; justify-content: center;
            transition: background 0.2s;
        }
        .hp-close-btn:hover { background: rgba(255,255,255,0.3); }

        /* FILTROS */
        .hp-filters {
            padding: 10px 14px;
            background: white;
            border-bottom: 2px solid #e3e8ef;
            flex-shrink: 0;
            display: flex; flex-direction: column; gap: 8px;
        }
        .hp-filter-row { display:flex; gap:8px; align-items:center; }
        .hp-input-wrap  { position:relative; flex:1; min-width:0; }
        .hp-input-icon  {
            position:absolute; left:8px; top:50%; transform:translateY(-50%);
            font-size:13px; pointer-events:none;
        }
        .hp-input {
            width:100%; padding:6px 8px 6px 28px;
            border:1.5px solid #e0e6ed; border-radius:6px;
            font-size:12px; outline:none;
            background:#fafbfc; box-sizing:border-box;
            transition: border-color 0.2s, background 0.2s;
        }
        .hp-input-date { padding-left: 8px; }
        .hp-select {
            flex:1; min-width:0; padding:6px 8px;
            border:1.5px solid #e0e6ed; border-radius:6px;
            font-size:12px; outline:none; background:#fafbfc;
            transition: border-color 0.2s;
        }
        .hp-input:focus, .hp-select:focus { border-color:#1565C0; background:white; }
        .hp-date-range { display:flex; align-items:center; gap:6px; flex:1; min-width:0; }
        .hp-date-range .hp-input { flex:1; }
        .hp-date-arrow  { color:#bbb; font-size:12px; flex-shrink:0; }
        .hp-filter-actions { display:flex; gap:5px; flex-shrink:0; }
        .hp-btn {
            padding:6px 11px; border:none; border-radius:6px; cursor:pointer;
            font-size:12px; font-weight:600; white-space:nowrap;
            display:inline-flex; align-items:center; gap:4px; transition:all 0.2s;
        }
        .hp-btn-primary { background:#1565C0; color:white; }
        .hp-btn-primary:hover { background:#0d47a1; box-shadow:0 2px 6px rgba(21,101,192,0.35); }
        .hp-btn-gray    { background:#9e9e9e; color:white; font-size:15px; padding:6px 9px; }
        .hp-btn-gray:hover { background:#757575; }
        .hp-btn-green   { background:#388e3c; color:white; font-size:15px; padding:6px 9px; }
        .hp-btn-green:hover { background:#2e7d32; }
        .hp-btn-load    { background:#e3f0ff; color:#1565C0; font-size:11px; padding:4px 10px; }
        .hp-btn-load:hover { background:#bbdefb; }

        /* BARRA DE STATUS */
        .hp-infobar {
            padding: 5px 14px;
            background: #eef2f8;
            border-bottom: 1px solid #dde3eb;
            display: flex; justify-content: space-between; align-items: center;
            flex-shrink: 0;
        }
        .hp-infobar-count { font-size:12px; color:#1565C0; font-weight:600; }
        .hp-infobar-hint  { font-size:10px; color:#aab8c8; }

        /* LISTA */
        .history-list {
            flex: 1 1 0; min-height: 0;
            overflow-y: auto; overflow-x: hidden;
            padding: 10px 10px 6px;
            background: #f4f6f9;
        }
        .history-list::-webkit-scrollbar       { width:6px; }
        .history-list::-webkit-scrollbar-track { background:#e8edf2; }
        .history-list::-webkit-scrollbar-thumb { background:#b0c4d8; border-radius:4px; }
        .history-list::-webkit-scrollbar-thumb:hover { background:#7a9db8; }

        /* CARDS */
        .history-item {
            width: 100%; box-sizing: border-box; overflow: hidden; padding: 8px 10px;
            border: 1px solid #e3e8ef;
            border-radius: 6px;
            margin-bottom: 5px;
            background: white;
            transition: all 0.2s ease;
            box-shadow: 0 1px 3px rgba(0,0,0,0.05);
        }
        .history-item:hover {
            box-shadow: 0 3px 10px rgba(0,0,0,0.10);
            transform: translateX(-2px);
            border-color: #b8cde8;
        }
        .history-item-header   { display:flex; justify-content:space-between; align-items:flex-start; margin-bottom:4px; gap:6px; }
        .history-item-action   { font-weight:700; font-size:11px; color:var(--primary); display:flex; align-items:center; gap:4px; }
        .history-item-time     { font-size:9px; color:#aaa; white-space:nowrap; }
        .history-item-user     { font-size:10px; color:#666; display:flex; align-items:center; gap:3px; margin-bottom:2px; }
        .history-item-table    { font-size:9px; color:#888; background:#eef2f8; padding:1px 6px; border-radius:3px; display:inline-block; margin-right:4px; }
        .history-item-details  { font-size:10px; color:#555; background:#f6f8fb; padding:5px 7px; border-radius:4px; margin-top:4px; line-height:1.35; max-height:70px; overflow-y:auto; }
        .history-item-details::-webkit-scrollbar       { width:4px; }
        .history-item-details::-webkit-scrollbar-thumb { background:#ccc; border-radius:2px; }

        /* Spinner */
        .spinner { border:2px solid #eee; border-top:2px solid #2196F3; border-radius:50%; width:20px; height:20px; animation:spin 1s linear infinite; display:inline-block; margin-right:8px; vertical-align:middle; }
        @keyframes spin { 0%{transform:rotate(0deg)} 100%{transform:rotate(360deg)} }

        /* Bordas coloridas por tipo */
        .history-action-create       { border-left: 3px solid #43a047; }
        .history-action-update       { border-left: 3px solid #1e88e5; }
        .history-action-update_summary { border-left: 3px solid #1565C0; }
        .history-action-delete       { border-left: 3px solid #e53935; }
        .history-action-login        { border-left: 3px solid #fb8c00; }
        .history-action-bci          { border-left: 3px solid #8e24aa; }
        .history-action-report       { border-left: 3px solid #00acc1; }
        .history-action-upload       { border-left: 3px solid #7b1fa2; }
        .history-action-pagamento    { border-left: 3px solid #2e7d32; }
        .history-action-vincular     { border-left: 3px solid #43a047; }
        .history-action-desvincular  { border-left: 3px solid #e53935; }
        .history-action-contribuinte { border-left: 3px solid #78909c; }

        /* Ajustes para inputs do historyPanel (compatibilidade) */
        #historyPanel input[type="text"],
        #historyPanel input[type="date"],
        #historyPanel select {
            padding: 6px 8px !important;
            font-size: 12px !important;
        }
        #historyPanel button { padding: 6px !important; font-size: 12px !important; }

        /* FOOTER */
        .hp-footer {
            padding: 7px 14px;
            background: white;
            border-top: 1.5px solid #e3e8ef;
            display: flex; align-items: center; justify-content: space-between;
            flex-shrink: 0;
            min-height: 34px;
        }
        .hp-footer-brand  { font-size:10px; color:#b0bec5; font-weight:600; letter-spacing:0.3px; }
        .hp-footer-shown  { font-size:10px; color:#90a4ae; }

        /* FOOTER - PADRONIZADO COM LOGIN */
        #sigwebFooter {
            position: fixed;
            bottom: 4px;
            right: 6px;
            font-size: 11px;
            color: #333;
            opacity: 1;
            font-weight: 700;
            letter-spacing: 0px;
            z-index: 99999;
            white-space: nowrap;
            pointer-events: none;
            text-shadow: 0 0 3px rgba(255,255,255, 0.8);
        }

        html, body {
            height: 100%;
            margin: 0;
            padding: 0;
            width: 100%;
            font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;
        }

        /* HEADER PROFISSIONAL */
        #sigwebHeader {
            position: fixed;
            top: 0;
            left: 0;
            right: 0;
            height: 70px;
            background: linear-gradient(135deg, var(--primary) 0%, var(--primary-light) 100%);
            box-shadow: 0 4px 16px rgba(0,0,0,0.12);
            z-index: 7500;
            display: flex;
            align-items: center;
            padding: 0 20px;
            gap: 30px;
        }

        .header-logo {
            display: flex;
            align-items: center;
            gap: 12px;
            color: white;
            font-weight: 800;
            font-size: 18px;
            text-decoration: none;
        }

        .header-logo::before {
            content: "📍";
            font-size: 24px;
        }
        
        /* Esconder ícone do prego quando botão de instalar estiver visível */
        .header-logo.hide-icon::before {
            display: none;
        }

        .header-nav {
            display: flex;
            gap: 20px;
            flex: 1;
            margin-left: 20px;
        }

        .header-nav a {
            color: rgba(255,255,255,0.8);
            text-decoration: none;
            font-size: 14px;
            font-weight: 700;
            transition: color 0.3s ease;
            cursor: pointer;
        }

        .header-nav a:hover {
            color: white;
        }

        /* ====== REURB MODE: header expandido ====== */
        #sigwebHeader.reurb-mode {
            height: auto;
            min-height: 70px;
            padding: 10px 20px;
            flex-wrap: wrap;
        }
        #sigwebHeader.reurb-mode .header-nav {
            flex-wrap: wrap;
            gap: 6px 4px;
            align-items: center;
            margin-left: 16px;
        }
        #sigwebHeader.reurb-mode .header-nav a[data-modulo*="reurb"] {
            background: rgba(255,255,255,0.1);
            border: 1px solid rgba(255,255,255,0.18);
            padding: 5px 12px;
            border-radius: 6px;
            font-size: 12.5px;
            white-space: nowrap;
            transition: all 0.2s;
        }
        #sigwebHeader.reurb-mode .header-nav a[data-modulo*="reurb"]:hover {
            background: rgba(255,255,255,0.22);
            border-color: rgba(255,255,255,0.35);
            color: #fff;
            transform: translateY(-1px);
        }

        .header-right {
            display: flex;
            align-items: center;
            gap: 15px;
            margin-left: auto;
        }

        .header-right > div {
            display: flex;
            align-items: center;
            gap: 8px;
            color: white;
            font-size: 13px;
        }

        /* Sidebar estilo app (escondível/expandível) */
        #leftSidebar {
            position: fixed;
            left: 0;
            top: 70px;
            bottom: 0;
            width: 260px;
            background: linear-gradient(180deg, #f9fafb 0%, #f3f4f6 100%);
            color: var(--primary);
            z-index: 6000;
            transition: transform 0.28s ease, width 0.2s ease;
            box-shadow: 2px 0 12px rgba(0,0,0,0.1);
            overflow: hidden;
            border-right: 1px solid var(--neutral-200);
        }
        /* hide the left sidebar and its toggle (removed by user request) */
        #leftSidebar, #sidebarToggleBtn { display: none !important; }
        #leftSidebar.collapsed { transform: translateX(-100%); }
        #leftSidebar .sidebar-header{ padding:18px 12px; display:flex;align-items:center;gap:8px; border-bottom: 1px solid var(--neutral-200); }
        #leftSidebar .sidebar-nav{ padding:8px 12px; font-size:14px }
        #leftSidebar .sidebar-item{ padding:12px 8px;border-radius:6px;margin-bottom:6px;cursor:pointer; transition: all 0.3s ease; background: transparent; }
        #leftSidebar .sidebar-item:hover { background: rgba(77, 166, 255, 0.1); color: var(--accent); }
        #sidebarToggleBtn{
            position: fixed;
            left: 12px;
            top: 82px;
            z-index: 7000;
            background: white;
            color: var(--primary);
            border-radius: 8px;
            padding: 8px 10px;
            cursor: pointer;
            box-shadow: 0 4px 12px rgba(0,0,0,0.12);
            border: 1px solid var(--neutral-200);
            font-weight: 700;
            transition: all 0.3s ease;
        }

        #sidebarToggleBtn:hover {
            background: var(--accent);
            color: white;
            transform: scale(1.05);
        }

        #map {
            height: calc(100vh - 70px);
            width: 100vw;
            margin: 0;
            border-radius: 0;
            box-shadow: none;
            position: absolute;
            top: 70px;
            left: 0;
        }
        
        /* Controles personalizados */
        .leaflet-control-identify {
            background: white;
            padding: 5px;
            border-radius: 8px;
            box-shadow: 0 4px 12px rgba(0,0,0,0.12);
            transition: all 0.3s ease;
        }
        
        .leaflet-control-identify:hover {
            box-shadow: 0 6px 18px rgba(0,0,0,0.18);
            transform: translateY(-2px);
        }
        
        .leaflet-control-identify.active {
            background: var(--accent);
            color: white;
        }

        /* ========== CONTROLE DE CAMADAS - DESIGN MODERNO ========== */
        /* Esconder o controle padrão do Leaflet */
        .leaflet-control-layers {
            display: none !important;
        }

        /* Painel de Camadas Customizado - REDIMENSIONÁVEL */
        #customLayerPanel {
            position: absolute;
            top: 80px;
            right: 10px;
            z-index: 1000;
            background: linear-gradient(145deg, #ffffff 0%, #f8fafc 100%);
            border-radius: 12px;
            box-shadow: 0 8px 32px rgba(13, 59, 102, 0.15), 0 2px 8px rgba(0,0,0,0.08);
            overflow: hidden;
            min-width: 320px;
            max-width: 520px;
            width: 340px;
            min-height: 150px;
            max-height: 55vh;
            font-family: 'Segoe UI', system-ui, sans-serif;
            resize: both;
            display: flex;
            flex-direction: column;
        }

        /* Alça de redimensionamento */
        #customLayerPanel::after {
            content: '';
            position: absolute;
            bottom: 0;
            right: 0;
            width: 16px;
            height: 16px;
            cursor: nwse-resize;
            background: linear-gradient(135deg, transparent 50%, #cbd5e1 50%, #cbd5e1 60%, transparent 60%, transparent 70%, #cbd5e1 70%, #cbd5e1 80%, transparent 80%);
            border-radius: 0 0 12px 0;
        }

        #customLayerPanel .panel-header {
            background: linear-gradient(135deg, #0d3b66 0%, #1a5a96 100%);
            color: white;
            padding: 10px 14px;
            display: flex;
            align-items: center;
            justify-content: space-between;
            font-weight: 700;
            font-size: 12px;
            letter-spacing: 0.3px;
            flex-shrink: 0;
        }

        #customLayerPanel .panel-header .header-icon {
            font-size: 16px;
            margin-right: 8px;
        }

        #customLayerPanel .panel-header .minimize-btn {
            background: rgba(255,255,255,0.2);
            border: none;
            color: white;
            width: 24px;
            height: 24px;
            border-radius: 6px;
            cursor: pointer;
            display: flex;
            align-items: center;
            justify-content: center;
            transition: background 0.2s;
        }

        #customLayerPanel .panel-header .minimize-btn:hover {
            background: rgba(255,255,255,0.3);
        }

        #customLayerPanel .panel-body {
            padding: 12px;
        }

        /* Seção de Mapas Base */
        #customLayerPanel .section-title {
            font-size: 10px;
            font-weight: 700;
            color: #64748b;
            text-transform: uppercase;
            letter-spacing: 1px;
            margin-bottom: 10px;
            display: flex;
            align-items: center;
            gap: 6px;
        }

        #customLayerPanel .section-title::after {
            content: '';
            flex: 1;
            height: 1px;
            background: linear-gradient(90deg, #e2e8f0, transparent);
        }

        /* Grid de Mapas Base - COMPACTO */
        #customLayerPanel .basemaps-grid {
            display: grid;
            grid-template-columns: repeat(4, 1fr);
            gap: 6px;
            margin-bottom: 12px;
        }

        #customLayerPanel .basemap-btn {
            aspect-ratio: 1;
            border: 2px solid #e2e8f0;
            border-radius: 8px;
            background: #f8fafc;
            cursor: pointer;
            display: flex;
            flex-direction: column;
            align-items: center;
            justify-content: center;
            transition: all 0.2s ease;
            padding: 4px;
            position: relative;
            overflow: hidden;
            min-width: 0;
            max-width: 55px;
        }

        #customLayerPanel .basemap-btn:hover {
            border-color: #4da6ff;
            transform: translateY(-1px);
            box-shadow: 0 3px 8px rgba(77, 166, 255, 0.2);
        }

        #customLayerPanel .basemap-btn.active {
            border-color: #0d3b66;
            background: linear-gradient(135deg, #e8f4fd 0%, #d1e9ff 100%);
            box-shadow: 0 2px 6px rgba(13, 59, 102, 0.2);
        }

        #customLayerPanel .basemap-btn.active::after {
            content: '✓';
            position: absolute;
            top: 2px;
            right: 2px;
            background: #0d3b66;
            color: white;
            width: 12px;
            height: 12px;
            border-radius: 50%;
            font-size: 8px;
            display: flex;
            align-items: center;
            justify-content: center;
        }

        #customLayerPanel .basemap-btn .basemap-icon {
            font-size: 16px;
            margin-bottom: 2px;
        }

        #customLayerPanel .basemap-btn .basemap-label {
            font-size: 8px;
            font-weight: 700;
            color: #475569;
            text-align: center;
            line-height: 1;
        }

        #customLayerPanel .basemap-btn.active .basemap-label {
            color: #0d3b66;
        }

        /* Separador */
        #customLayerPanel .section-divider {
            height: 1px;
            background: linear-gradient(90deg, transparent, #e2e8f0, transparent);
            margin: 8px 0;
        }

        /* Body com scroll */
        #customLayerPanel .panel-body {
            padding: 10px;
            flex: 1;
            overflow-y: auto;
            min-height: 0;
            display: flex;
            flex-direction: column;
        }

        /* Lista de Camadas Overlay */
        #customLayerPanel .overlays-list {
            flex: 1;
            overflow-y: auto;
            padding-right: 4px;
            min-height: 60px;
            max-height: calc(55vh - 200px);
        }

        #customLayerPanel .overlays-list::-webkit-scrollbar {
            width: 5px;
        }

        #customLayerPanel .overlays-list::-webkit-scrollbar-track {
            background: transparent;
        }

        #customLayerPanel .overlays-list::-webkit-scrollbar-thumb {
            background: #cbd5e1;
            border-radius: 3px;
        }

        #customLayerPanel .overlay-item {
            display: flex;
            align-items: center;
            padding: 6px 8px;
            margin: 3px 0;
            background: #f8fafc;
            border-radius: 6px;
            transition: all 0.15s ease;
            border: 1px solid transparent;
            cursor: pointer;
        }

        #customLayerPanel .overlay-item:hover {
            background: #f1f5f9;
            border-color: #e2e8f0;
        }

        #customLayerPanel .overlay-item.active {
            background: linear-gradient(135deg, #e8f4fd 0%, #dbeafe 100%);
            border-color: #93c5fd;
        }

        #customLayerPanel .overlay-item.dragging {
            opacity: 0.5;
            background: #dbeafe;
            border: 2px dashed #3b82f6;
        }

        /* Alça de arrastar */
        #customLayerPanel .drag-handle {
            cursor: grab;
            color: #94a3b8;
            font-size: 12px;
            padding: 0 6px 0 0;
            user-select: none;
            letter-spacing: -2px;
        }

        #customLayerPanel .drag-handle:hover {
            color: #64748b;
        }

        #customLayerPanel .drag-handle:active {
            cursor: grabbing;
        }

        #customLayerPanel .overlay-checkbox {
            width: 16px;
            height: 16px;
            border-radius: 3px;
            border: 2px solid #cbd5e1;
            background: white;
            display: flex;
            align-items: center;
            justify-content: center;
            transition: all 0.15s;
            flex-shrink: 0;
        }

        #customLayerPanel .overlay-item.active .overlay-checkbox {
            background: #0d3b66;
            border-color: #0d3b66;
        }

        #customLayerPanel .overlay-item.active .overlay-checkbox::after {
            content: '✓';
            color: white;
            font-size: 10px;
            font-weight: bold;
        }

        #customLayerPanel .overlay-info {
            flex: 1;
            margin-left: 8px;
            min-width: 0;
        }

        #customLayerPanel .overlay-name {
            font-size: 11px;
            font-weight: 700;
            color: #334155;
            white-space: nowrap;
            overflow: hidden;
            text-overflow: ellipsis;
            min-width: 60px;
        }

        #customLayerPanel .overlay-actions {
            display: flex;
            gap: 3px;
            margin-left: 6px;
            align-items: center;
            flex-shrink: 0;
        }

        #customLayerPanel .overlay-action-btn {
            width: 24px;
            height: 24px;
            border: 1px solid #e2e8f0;
            background: white;
            border-radius: 5px;
            cursor: pointer;
            display: flex;
            align-items: center;
            justify-content: center;
            font-size: 12px;
            transition: all 0.15s;
            color: #64748b;
            box-shadow: 0 1px 2px rgba(0,0,0,0.06);
            padding: 0;
        }

        #customLayerPanel .overlay-action-btn:hover {
            background: #e8f4fd;
            border-color: #4da6ff;
            color: #0d3b66;
            transform: scale(1.08);
        }

        #customLayerPanel .overlay-action-btn.zoom-btn:hover {
            background: #dcfce7;
            border-color: #22c55e;
            color: #166534;
        }

        #customLayerPanel .overlay-action-btn.label-toggle-btn {
            font-size: 12px;
        }

        #customLayerPanel .overlay-action-btn.label-toggle-btn.labels-on {
            background: linear-gradient(135deg, #10b981, #059669);
            border-color: #10b981;
            color: white;
            box-shadow: 0 2px 6px rgba(16, 185, 129, 0.3);
        }

        #customLayerPanel .overlay-action-btn.label-toggle-btn:hover {
            background: #d1fae5;
            border-color: #10b981;
            color: #065f46;
        }

        #customLayerPanel .overlay-action-btn.label-toggle-btn.labels-on:hover {
            background: linear-gradient(135deg, #059669, #047857);
        }

        #customLayerPanel .overlay-action-btn.label-btn:hover {
            background: #fef3c7;
            border-color: #f59e0b;
            color: #92400e;
        }

        /* Slider de opacidade inline */
        #customLayerPanel .opacity-slider {
            width: 45px;
            height: 4px;
            accent-color: #0d3b66;
            cursor: pointer;
            margin: 0 4px;
        }

        /* Botão minimizado */
        #customLayerPanelMinimized {
            position: absolute;
            top: 80px;
            right: 10px;
            z-index: 1000;
            width: 44px;
            height: 44px;
            background: linear-gradient(135deg, #0d3b66 0%, #1a5a96 100%);
            border-radius: 12px;
            border: none;
            cursor: pointer;
            display: none;
            align-items: center;
            justify-content: center;
            font-size: 20px;
            color: white;
            box-shadow: 0 4px 15px rgba(13, 59, 102, 0.3);
            transition: all 0.2s;
        }

        #customLayerPanelMinimized:hover {
            transform: scale(1.05);
            box-shadow: 0 6px 20px rgba(13, 59, 102, 0.4);
        }

        /* ====== MODAL DE CONFIGURAÇÃO DE RÓTULOS - DESIGN MODERNO ====== */
        #labelConfigModal {
            position: fixed;
            left: 0;
            top: 0;
            width: 100vw;
            height: 100vh;
            display: none;
            align-items: center;
            justify-content: center;
            background: rgba(13, 59, 102, 0.4);
            backdrop-filter: blur(4px);
            z-index: 9000;
            animation: fadeIn 0.2s ease;
        }

        @keyframes fadeIn {
            from { opacity: 0; }
            to { opacity: 1; }
        }

        #labelConfigInner {
            width: 480px;
            max-width: 95vw;
            max-height: 75vh;
            background: linear-gradient(145deg, #ffffff 0%, #f8fafc 100%);
            border-radius: 16px;
            padding: 0;
            box-shadow: 0 25px 80px rgba(13, 59, 102, 0.25), 0 10px 30px rgba(0,0,0,0.15);
            overflow: hidden;
            display: flex;
            flex-direction: column;
            animation: slideUp 0.3s ease;
        }

        @keyframes slideUp {
            from { transform: translateY(30px); opacity: 0; }
            to { transform: translateY(0); opacity: 1; }
        }

        #labelConfigInner .modal-header {
            background: linear-gradient(135deg, #0d3b66 0%, #1a5a96 100%);
            color: white;
            padding: 16px 20px;
            display: flex;
            align-items: center;
            justify-content: space-between;
        }

        #labelConfigInner .modal-header h3 {
            margin: 0;
            font-size: 16px;
            font-weight: 700;
            display: flex;
            align-items: center;
            gap: 8px;
        }

        #labelConfigInner .modal-header .layer-name {
            color: #ffd54f;
            font-weight: 700;
        }

        #labelConfigInner .modal-header .close-btn {
            background: rgba(255,255,255,0.15);
            border: none;
            color: white;
            width: 32px;
            height: 32px;
            border-radius: 8px;
            cursor: pointer;
            display: flex;
            align-items: center;
            justify-content: center;
            font-size: 18px;
            transition: all 0.2s;
        }

        #labelConfigInner .modal-header .close-btn:hover {
            background: rgba(255,255,255,0.25);
            transform: scale(1.1);
        }

        /* Tabs do modal */
        .label-config-tabs {
            display: flex;
            background: #f1f5f9;
            border-bottom: 1px solid #e2e8f0;
        }

        .label-config-tab {
            flex: 1;
            padding: 15px 18px;
            border: none;
            background: transparent;
            cursor: pointer;
            font-weight: 700;
            font-size: 13px;
            color: #64748b;
            transition: all 0.2s;
            position: relative;
            display: flex;
            align-items: center;
            justify-content: center;
            gap: 6px;
        }

        .label-config-tab:hover {
            color: #0d3b66;
            background: rgba(13, 59, 102, 0.05);
        }

        .label-config-tab.active {
            color: #0d3b66;
            background: white;
        }

        .label-config-tab.active::after {
            content: '';
            position: absolute;
            bottom: 0;
            left: 0;
            right: 0;
            height: 3px;
            background: linear-gradient(90deg, #0d3b66, #1a5a96);
            border-radius: 3px 3px 0 0;
        }

        /* Conteúdo do modal */
        .label-config-body {
            flex: 1;
            overflow-y: auto;
            padding: 16px 20px;
            max-height: 45vh;
        }

        .label-config-body::-webkit-scrollbar {
            width: 6px;
        }

        .label-config-body::-webkit-scrollbar-track {
            background: transparent;
        }

        .label-config-body::-webkit-scrollbar-thumb {
            background: #cbd5e1;
            border-radius: 3px;
        }

        .label-config-content {
            display: none;
        }

        .label-config-content.active {
            display: block;
        }

        /* Grupos de controles */
        .lc-group {
            margin-bottom: 16px;
        }

        .lc-group label {
            display: block;
            font-weight: 700;
            font-size: 12px;
            color: #475569;
            margin-bottom: 6px;
            text-transform: uppercase;
            letter-spacing: 0.5px;
        }

        .lc-group select,
        .lc-group input[type="text"],
        .lc-group input[type="number"] {
            width: 100%;
            padding: 10px 12px;
            border: 2px solid #e2e8f0;
            border-radius: 8px;
            font-size: 14px;
            transition: all 0.2s;
            background: #fff;
        }

        .lc-group select:focus,
        .lc-group input[type="text"]:focus,
        .lc-group input[type="number"]:focus {
            outline: none;
            border-color: #0d3b66;
            box-shadow: 0 0 0 3px rgba(13, 59, 102, 0.1);
        }

        .lc-hint {
            font-size: 11px;
            color: #94a3b8;
            margin-top: 4px;
        }

        /* Slider com valor */
        .lc-slider-group {
            display: flex;
            align-items: center;
            gap: 10px;
        }

        .lc-slider-group input[type="range"] {
            flex: 1;
            height: 6px;
            border-radius: 3px;
            background: #e2e8f0;
            cursor: pointer;
            accent-color: #0d3b66;
        }

        .lc-slider-value {
            min-width: 50px;
            padding: 6px 10px;
            background: linear-gradient(135deg, #f1f5f9, #e2e8f0);
            border-radius: 6px;
            text-align: center;
            font-weight: 700;
            font-size: 12px;
            color: #0d3b66;
        }

        /* Color picker */
        .lc-color-group {
            display: flex;
            align-items: center;
            gap: 10px;
        }

        .lc-color-group input[type="color"] {
            width: 44px;
            height: 44px;
            border: 2px solid #e2e8f0;
            border-radius: 8px;
            cursor: pointer;
            padding: 2px;
        }

        .lc-color-value {
            flex: 1;
            padding: 10px 12px;
            background: #f8fafc;
            border-radius: 8px;
            font-family: 'Consolas', monospace;
            font-size: 13px;
            color: #475569;
            border: 1px solid #e2e8f0;
        }

        /* Checkbox toggle moderno */
        .lc-toggle {
            display: flex;
            align-items: center;
            gap: 12px;
            padding: 12px 14px;
            background: linear-gradient(135deg, #f0f9ff 0%, #e0f2fe 100%);
            border-radius: 10px;
            cursor: pointer;
            transition: all 0.2s;
            border: 1px solid #bae6fd;
        }

        .lc-toggle:hover {
            background: linear-gradient(135deg, #e0f2fe 0%, #bae6fd 100%);
        }

        .lc-toggle input[type="checkbox"] {
            width: 20px;
            height: 20px;
            accent-color: #0d3b66;
            cursor: pointer;
        }

        .lc-toggle span {
            font-weight: 700;
            font-size: 13px;
            color: #0369a1;
        }

        .lc-toggle.warning {
            background: linear-gradient(135deg, #fffbeb 0%, #fef3c7 100%);
            border-color: #fcd34d;
        }

        .lc-toggle.warning span {
            color: #b45309;
        }

        .lc-toggle.purple {
            background: linear-gradient(135deg, #faf5ff 0%, #f3e8ff 100%);
            border-color: #d8b4fe;
        }

        .lc-toggle.purple span {
            color: #7e22ce;
        }

        /* Info box */
        .lc-info {
            padding: 12px;
            background: linear-gradient(135deg, #fffbeb 0%, #fef3c7 100%);
            border-radius: 10px;
            border-left: 4px solid #f59e0b;
            font-size: 12px;
            color: #92400e;
        }

        .lc-info strong {
            display: block;
            margin-bottom: 4px;
        }

        /* Aviso de erro */
        .lc-warning {
            display: none;
            padding: 10px 12px;
            background: linear-gradient(135deg, #fef2f2 0%, #fee2e2 100%);
            border-radius: 8px;
            border-left: 4px solid #ef4444;
            font-size: 12px;
            color: #b91c1c;
            margin-bottom: 12px;
        }

        /* Tags de colunas */
        .lc-tags {
            display: flex;
            flex-wrap: wrap;
            gap: 6px;
            margin-top: 8px;
        }

        .lc-tag {
            padding: 5px 10px;
            background: #f1f5f9;
            border: 1px solid #e2e8f0;
            border-radius: 6px;
            font-size: 11px;
            color: #475569;
            cursor: pointer;
            transition: all 0.15s;
        }

        .lc-tag:hover {
            background: #e0f2fe;
            border-color: #0d3b66;
            color: #0d3b66;
            transform: scale(1.05);
        }

        /* Footer do modal */
        .label-config-footer {
            padding: 14px 20px;
            background: #f8fafc;
            border-top: 1px solid #e2e8f0;
            display: flex;
            gap: 10px;
            justify-content: flex-end;
        }

        .label-config-footer button {
            padding: 10px 20px;
            border-radius: 8px;
            font-weight: 700;
            font-size: 13px;
            cursor: pointer;
            transition: all 0.2s;
            display: flex;
            align-items: center;
            gap: 6px;
        }

        .label-config-footer .btn-cancel {
            background: white;
            border: 2px solid #cbd5e1;
            color: #64748b;
        }

        .label-config-footer .btn-cancel:hover {
            background: #f1f5f9;
            border-color: #94a3b8;
        }

        .label-config-footer .btn-save {
            background: linear-gradient(135deg, #10b981 0%, #059669 100%);
            border: none;
            color: white;
            box-shadow: 0 4px 12px rgba(16, 185, 129, 0.3);
        }

        .label-config-footer .btn-save:hover {
            transform: translateY(-2px);
            box-shadow: 0 6px 16px rgba(16, 185, 129, 0.4);
        }
        
        /* Painel de atributos no canto inferior direito - ESTILIZADO */
        #atributosPanel {
            position: fixed;
            bottom: 20px;
            right: 20px;
            width: 380px;
            background: linear-gradient(135deg, #ffffff 0%, #f8fafc 100%);
            border-radius: 16px;
            border: none;
            box-shadow: 0 20px 60px rgba(13, 59, 102, 0.15), 0 8px 20px rgba(0,0,0,0.08);
            z-index: 2000;
            display: none;
            max-height: 75vh;
            overflow: hidden;
            color: var(--primary);
            animation: slideInRight 0.3s ease;
        }

        #atributosPanel::before {
            content: '';
            position: absolute;
            top: 0;
            left: 0;
            right: 0;
            height: 4px;
            background: linear-gradient(90deg, #0d3b66 0%, #1a5a96 50%, #4da6ff 100%);
            border-radius: 16px 16px 0 0;
        }

        @keyframes slideInRight {
            from {
                opacity: 0;
                transform: translateX(30px) scale(0.95);
            }
            to {
                opacity: 1;
                transform: translateX(0) scale(1);
            }
        }

        #atributosPanel .panel-header {
            background: linear-gradient(135deg, #0d3b66 0%, #1a5a96 100%);
            padding: 16px 20px;
            display: flex;
            align-items: center;
            justify-content: space-between;
            margin-top: 4px;
        }

        #atributosPanel .panel-header h3 {
            margin: 0;
            color: white;
            font-size: 16px;
            font-weight: 700;
            display: flex;
            align-items: center;
            gap: 10px;
        }

        #atributosPanel .panel-header h3::before {
            content: '📋';
            font-size: 18px;
        }

        #atributosContent {
            padding: 0;
            max-height: calc(75vh - 60px);
            overflow-y: auto;
        }

        #atributosContent::-webkit-scrollbar {
            width: 6px;
        }

        #atributosContent::-webkit-scrollbar-track {
            background: #f1f5f9;
        }

        #atributosContent::-webkit-scrollbar-thumb {
            background: #cbd5e1;
            border-radius: 3px;
        }

        #atributosContent::-webkit-scrollbar-thumb:hover {
            background: #94a3b8;
        }

        .atributos-table {
            width: 100%;
            border-collapse: collapse;
            font-size: 13px;
            color: var(--primary);
        }

        .atributos-table th, .atributos-table td {
            border-bottom: 1px solid #e2e8f0;
            padding: 10px 16px;
            text-align: left;
            vertical-align: middle;
        }

        .atributos-table th {
            background: linear-gradient(135deg, #0d3b66 0%, #1a5a96 100%);
            font-weight: 700;
            color: white;
            font-size: 11px;
            text-transform: uppercase;
            letter-spacing: 0.5px;
            width: 40%;
        }

        .atributos-table td {
            background: white;
            color: #1e40af;
            font-weight: 500;
        }

        .atributos-table tr:hover td {
            background: #f0f9ff;
        }

        .atributos-table tr:nth-child(even) td {
            background: #f8fafc;
        }

        .atributos-table tr:nth-child(even):hover td {
            background: #f0f9ff;
        }
        
        .fechar-painel {
            background: rgba(255,255,255,0.2);
            color: white;
            border: 2px solid rgba(255,255,255,0.3);
            border-radius: 8px;
            width: 32px;
            height: 32px;
            cursor: pointer;
            font-weight: 700;
            font-size: 18px;
            transition: all 0.3s ease;
            display: flex;
            align-items: center;
            justify-content: center;
        }

        .fechar-painel:hover {
            background: rgba(255, 100, 100, 0.9);
            border-color: rgba(255,255,255,0.5);
            transform: rotate(90deg) scale(1.05);
        }

        /* ============================================= */
        /* MODAL MEMORIAL DESCRITIVO */
        /* ============================================= */
        #memorialModal {
            display: none;
            position: fixed;
            top: 0;
            left: 0;
            width: 100%;
            height: 100%;
            background: rgba(0,0,0,0.6);
            z-index: 10000;
            align-items: center;
            justify-content: center;
            backdrop-filter: blur(3px);
        }
        
        #memorialModalContent {
            background: white;
            border-radius: 16px;
            width: 95%;
            max-width: 900px;
            max-height: 90vh;
            box-shadow: 0 20px 60px rgba(13, 59, 102, 0.3);
            overflow: hidden;
            display: flex;
            flex-direction: column;
        }
        
        .memorial-header {
            background: linear-gradient(135deg, #0d3b66 0%, #1a5a96 100%);
            color: white;
            padding: 20px 24px;
            display: flex;
            justify-content: space-between;
            align-items: center;
        }
        
        .memorial-header h2 {
            margin: 0;
            font-size: 22px;
            font-weight: 700;
            display: flex;
            align-items: center;
            gap: 10px;
        }
        
        .memorial-close-btn {
            background: rgba(255,255,255,0.2);
            border: 1px solid rgba(255,255,255,0.3);
            color: white;
            font-size: 26px;
            cursor: pointer;
            padding: 6px 12px;
            border-radius: 8px;
            transition: all 0.3s ease;
            line-height: 1;
        }
        
        .memorial-close-btn:hover {
            background: rgba(255,255,255,0.3);
        }
        
        .memorial-body {
            padding: 24px;
            overflow-y: auto;
            flex: 1;
            background: #f8f9fb;
        }
        
        .memorial-info-box {
            background: linear-gradient(135deg, #e3f2fd 0%, #bbdefb 100%);
            border-left: 4px solid #1976d2;
            padding: 14px 18px;
            border-radius: 8px;
            margin-bottom: 20px;
            display: flex;
            align-items: center;
            gap: 12px;
        }
        
        .memorial-info-box span {
            font-size: 24px;
        }
        
        .memorial-info-box p {
            margin: 0;
            color: #0d3b66;
            font-size: 13px;
            line-height: 1.5;
        }
        
        .memorial-section {
            background: white;
            border-radius: 12px;
            padding: 20px;
            margin-bottom: 20px;
            box-shadow: 0 2px 8px rgba(0,0,0,0.06);
        }
        
        .memorial-section-title {
            font-size: 16px;
            font-weight: 700;
            color: #0d3b66;
            margin: 0 0 16px 0;
            padding-bottom: 10px;
            border-bottom: 2px solid #e3f2fd;
            display: flex;
            align-items: center;
            gap: 8px;
        }
        
        .memorial-grid {
            display: grid;
            grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
            gap: 14px;
        }
        
        .memorial-field {
            display: flex;
            flex-direction: column;
            gap: 4px;
        }
        
        .memorial-field label {
            font-size: 11px;
            font-weight: 700;
            color: #64748b;
            text-transform: uppercase;
            letter-spacing: 0.3px;
        }
        
        .memorial-field input,
        .memorial-field select,
        .memorial-field textarea {
            padding: 10px 12px;
            border: 1px solid #e2e8f0;
            border-radius: 6px;
            font-size: 13px;
            transition: all 0.2s ease;
            background: #f8fafc;
        }
        
        .memorial-field input:focus,
        .memorial-field select:focus,
        .memorial-field textarea:focus {
            outline: none;
            border-color: #1976d2;
            background: white;
            box-shadow: 0 0 0 3px rgba(25, 118, 210, 0.1);
        }
        
        .memorial-field input[readonly] {
            background: #e8f4fd;
            color: #1565c0;
            font-weight: 500;
            cursor: default;
        }
        
        .memorial-field.full-width {
            grid-column: 1 / -1;
        }
        
        .memorial-vertices-table {
            width: 100%;
            border-collapse: collapse;
            font-size: 12px;
            margin-top: 10px;
        }
        
        .memorial-vertices-table th {
            background: #0d3b66;
            color: white;
            padding: 10px 8px;
            text-align: center;
            font-weight: 700;
            font-size: 11px;
        }
        
        .memorial-vertices-table td {
            padding: 8px;
            text-align: center;
            border-bottom: 1px solid #e2e8f0;
        }
        
        .memorial-vertices-table tr:nth-child(even) {
            background: #f8fafc;
        }
        
        .memorial-vertices-table tr:hover {
            background: #e3f2fd;
        }
        
        .memorial-btn {
            padding: 12px 24px;
            border: none;
            border-radius: 8px;
            font-weight: 700;
            font-size: 13px;
            cursor: pointer;
            transition: all 0.3s ease;
            display: inline-flex;
            align-items: center;
            gap: 8px;
        }
        
        .memorial-btn-primary {
            background: linear-gradient(135deg, #1976d2 0%, #1565c0 100%);
            color: white;
            box-shadow: 0 4px 12px rgba(25, 118, 210, 0.3);
        }
        
        .memorial-btn-primary:hover {
            transform: translateY(-2px);
            box-shadow: 0 6px 16px rgba(25, 118, 210, 0.4);
        }
        
        .memorial-btn-secondary {
            background: #e0e0e0;
            color: #333;
        }
        
        .memorial-btn-secondary:hover {
            background: #d0d0d0;
        }
        
        .memorial-btn-success {
            background: linear-gradient(135deg, #2e7d32 0%, #1b5e20 100%);
            color: white;
            box-shadow: 0 4px 12px rgba(46, 125, 50, 0.3);
        }
        
        .memorial-btn-success:hover {
            transform: translateY(-2px);
            box-shadow: 0 6px 16px rgba(46, 125, 50, 0.4);
        }
        
        .memorial-footer {
            padding: 16px 24px;
            background: #f1f5f9;
            border-top: 1px solid #e2e8f0;
            display: flex;
            justify-content: space-between;
            align-items: center;
            gap: 12px;
        }
        
        .memorial-vertice-marker {
            background: #d32f2f;
            color: white;
            width: 24px;
            height: 24px;
            border-radius: 50%;
            display: flex;
            align-items: center;
            justify-content: center;
            font-size: 11px;
            font-weight: 700;
            border: 2px solid white;
            box-shadow: 0 2px 6px rgba(0,0,0,0.3);
        }
        
        /* ============================================= */
        /* MODAL ALVARÁS E LICENÇAS */
        /* ============================================= */
        #alvaraModal {
            display: none;
            position: fixed;
            top: 0; left: 0; right: 0; bottom: 0;
            background: rgba(0,0,0,0.6);
            z-index: 10000;
            align-items: center;
            justify-content: center;
            backdrop-filter: blur(4px);
        }
        #alvaraModalContent {
            background: white;
            border-radius: 16px;
            max-width: 1100px;
            width: 95%;
            max-height: 90vh;
            display: flex;
            flex-direction: column;
            box-shadow: 0 25px 80px rgba(0,0,0,0.4);
            overflow: hidden;
        }
        .alvara-header {
            background: linear-gradient(135deg, #059669 0%, #047857 100%);
            color: white;
            padding: 18px 24px;
            display: flex;
            justify-content: space-between;
            align-items: center;
        }
        .alvara-header h2 { margin: 0; font-size: 20px; font-weight: 600; }
        .alvara-close-btn {
            background: rgba(255,255,255,0.2);
            border: none;
            color: white;
            font-size: 24px;
            cursor: pointer;
            border-radius: 50%;
            width: 36px;
            height: 36px;
            display: flex;
            align-items: center;
            justify-content: center;
            transition: all 0.2s;
        }
        .alvara-close-btn:hover { background: rgba(255,255,255,0.3); }
        .alvara-tabs {
            display: flex;
            background: #f1f5f9;
            border-bottom: 1px solid #e2e8f0;
        }
        .alvara-tab {
            padding: 14px 24px;
            cursor: pointer;
            border: none;
            background: transparent;
            font-size: 14px;
            font-weight: 500;
            color: #64748b;
            border-bottom: 3px solid transparent;
            transition: all 0.2s;
            display: flex;
            align-items: center;
            gap: 8px;
        }
        .alvara-tab:hover { background: #e2e8f0; }
        .alvara-tab.active {
            color: #059669;
            border-bottom-color: #059669;
            background: white;
        }
        .alvara-body {
            flex: 1;
            overflow-y: auto;
            padding: 24px;
        }
        .alvara-tab-content { display: none; }
        .alvara-tab-content.active { display: block; }
        .alvara-section {
            background: #f8fafc;
            border: 1px solid #e2e8f0;
            border-radius: 12px;
            padding: 20px;
            margin-bottom: 20px;
        }
        .alvara-section-title {
            font-weight: 700;
            color: #334155;
            margin-bottom: 16px;
            font-size: 16px;
            display: flex;
            align-items: center;
            gap: 10px;
        }
        .alvara-form-grid {
            display: grid;
            grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
            gap: 16px;
        }
        .alvara-field { display: flex; flex-direction: column; }
        .alvara-field.full-width { grid-column: 1 / -1; }
        .alvara-field label {
            font-size: 12px;
            font-weight: 700;
            color: #64748b;
            margin-bottom: 6px;
            text-transform: uppercase;
            letter-spacing: 0.5px;
        }
        .alvara-field input, .alvara-field select, .alvara-field textarea {
            padding: 12px 14px;
            border: 2px solid #e2e8f0;
            border-radius: 8px;
            font-size: 14px;
            transition: all 0.2s;
        }
        .alvara-field input:focus, .alvara-field select:focus, .alvara-field textarea:focus {
            outline: none;
            border-color: #059669;
            box-shadow: 0 0 0 4px rgba(5, 150, 105, 0.1);
        }
        .alvara-field input[readonly] {
            background: #f0fdf4;
            border-color: #86efac;
        }
        .alvara-btn {
            padding: 12px 24px;
            border: none;
            border-radius: 8px;
            cursor: pointer;
            font-size: 14px;
            font-weight: 700;
            transition: all 0.2s;
            display: inline-flex;
            align-items: center;
            gap: 8px;
        }
        .alvara-btn-primary { background: linear-gradient(135deg, #059669, #047857); color: white; }
        .alvara-btn-primary:hover { transform: translateY(-2px); box-shadow: 0 4px 12px rgba(5,150,105,0.3); }
        .alvara-btn-secondary { background: #e2e8f0; color: #475569; }
        .alvara-btn-secondary:hover { background: #cbd5e1; }
        .alvara-btn-success { background: linear-gradient(135deg, #22c55e, #16a34a); color: white; }
        .alvara-btn-danger { background: linear-gradient(135deg, #ef4444, #dc2626); color: white; }
        .alvara-btn-warning { background: linear-gradient(135deg, #f59e0b, #d97706); color: white; }
        
        /* Dashboard Cards */
        .alvara-dashboard-grid {
            display: grid;
            grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
            gap: 20px;
            margin-bottom: 24px;
        }
        .alvara-stat-card {
            background: white;
            border-radius: 12px;
            padding: 20px;
            border: 1px solid #e2e8f0;
            text-align: center;
            transition: all 0.3s;
        }
        .alvara-stat-card:hover {
            transform: translateY(-4px);
            box-shadow: 0 8px 24px rgba(0,0,0,0.1);
        }
        .alvara-stat-card.vigentes { border-left: 4px solid #22c55e; }
        .alvara-stat-card.vencidos { border-left: 4px solid #ef4444; }
        .alvara-stat-card.vencendo { border-left: 4px solid #f59e0b; }
        .alvara-stat-card.total { border-left: 4px solid #3b82f6; }
        .alvara-stat-number {
            font-size: 36px;
            font-weight: 700;
            margin-bottom: 4px;
        }
        .alvara-stat-card.vigentes .alvara-stat-number { color: #22c55e; }
        .alvara-stat-card.vencidos .alvara-stat-number { color: #ef4444; }
        .alvara-stat-card.vencendo .alvara-stat-number { color: #f59e0b; }
        .alvara-stat-card.total .alvara-stat-number { color: #3b82f6; }
        .alvara-stat-label { font-size: 13px; color: #64748b; }
        
        /* Lista de Alvarás */
        .alvara-lista-item {
            background: white;
            border: 1px solid #e2e8f0;
            border-radius: 10px;
            padding: 16px 20px;
            margin-bottom: 12px;
            display: flex;
            justify-content: space-between;
            align-items: center;
            transition: all 0.2s;
        }
        .alvara-lista-item:hover {
            box-shadow: 0 4px 12px rgba(0,0,0,0.08);
            border-color: #059669;
        }
        .alvara-status {
            padding: 6px 14px;
            border-radius: 20px;
            font-size: 12px;
            font-weight: 700;
            text-transform: uppercase;
        }
        .alvara-status.vigente { background: #dcfce7; color: #166534; }
        .alvara-status.vencido { background: #fee2e2; color: #991b1b; }
        .alvara-status.vencendo { background: #fef3c7; color: #92400e; }
        .alvara-status.pendente { background: #e0e7ff; color: #3730a3; }
        
        /* Alerta destacado */
        .alvara-alerta-item {
            background: linear-gradient(135deg, #fef3c7, #fde68a);
            border: 2px solid #f59e0b;
            border-radius: 10px;
            padding: 16px;
            margin-bottom: 12px;
            cursor: pointer;
            transition: all 0.2s;
        }
        .alvara-alerta-item:hover {
            transform: scale(1.01);
            box-shadow: 0 4px 16px rgba(245,158,11,0.3);
        }
        .alvara-alerta-item.vencido {
            background: linear-gradient(135deg, #fee2e2, #fecaca);
            border-color: #ef4444;
        }
        
        /* Autocomplete */
        .alvara-autocomplete-wrapper { position: relative; }
        .alvara-autocomplete-list {
            position: absolute;
            top: 100%;
            left: 0;
            right: 0;
            background: white;
            border: 1px solid #e2e8f0;
            border-radius: 8px;
            box-shadow: 0 8px 24px rgba(0,0,0,0.15);
            max-height: 280px;
            overflow-y: auto;
            z-index: 1000;
            display: none;
        }
        .alvara-autocomplete-list.show { display: block; }
        .alvara-autocomplete-item {
            padding: 15px 18px;
            cursor: pointer;
            border-bottom: 1px solid #f1f5f9;
            transition: background 0.15s;
        }
        .alvara-autocomplete-item:hover { background: #f0fdf4; }
        .alvara-autocomplete-item:last-child { border-bottom: none; }
        .alvara-autocomplete-item strong { color: #059669; }
        .alvara-autocomplete-item small { color: #94a3b8; display: block; margin-top: 2px; font-size: 11px; }
        
        /* Etapas */
        .alvara-etapa-num {
            background: #059669;
            color: white;
            width: 28px;
            height: 28px;
            border-radius: 50%;
            display: flex;
            align-items: center;
            justify-content: center;
            font-weight: 700;
            font-size: 14px;
        }
        .alvara-progress-bar {
            display: flex;
            justify-content: center;
            gap: 8px;
            padding: 16px;
            background: #f8fafc;
            border-top: 1px solid #e2e8f0;
        }
        .alvara-progress-step {
            font-size: 12px;
            color: #94a3b8;
            padding: 8px 16px;
            border-radius: 20px;
            background: #e2e8f0;
            font-weight: 500;
        }
        .alvara-progress-step.active { background: #059669; color: white; }
        .alvara-progress-step.completed { background: #86efac; color: #166534; }
        
        /* ============================================= */
        /* MODAL OUVIDORIA */
        /* ============================================= */
        #ouvidoriaModal {
            display: none;
            position: fixed;
            top: 0; left: 0; right: 0; bottom: 0;
            background: rgba(0,0,0,0.6);
            z-index: 10000;
            align-items: center;
            justify-content: center;
            backdrop-filter: blur(4px);
        }
        
        /* ============================================= */
        /* ============================================= */
        /* PAINEL IPTU - LATERAL COMPACTO E ARRASTÁVEL */
        /* Interage com mapa principal */
        /* ============================================= */
        
        #iptuModal {
            position: fixed;
            top: 70px;
            right: 10px;
            width: 380px;
            max-height: calc(100vh - 90px);
            background: white;
            border-radius: 12px;
            box-shadow: 0 10px 40px rgba(0,0,0,0.25), 0 0 0 1px rgba(0,0,0,0.1);
            display: none;
            z-index: 2000;
            animation: iptuSlideIn 0.25s ease;
            overflow: hidden;
            cursor: default;
        }
        
        /* Header arrastável */
        .iptu-header {
            cursor: move !important;
            user-select: none;
        }
        
        .iptu-header:active {
            cursor: grabbing !important;
        }
        
        @keyframes iptuSlideIn {
            from { opacity: 0; transform: translateX(30px); }
            to { opacity: 1; transform: translateX(0); }
        }
        
        /* Popup IPTU no mapa - fundo sólido e ACIMA de tudo */
        .leaflet-popup-pane {
            z-index: 99999 !important;
        }
        
        .leaflet-popup {
            z-index: 99999 !important;
        }
        
        .iptu-popup {
            z-index: 100000 !important;
        }
        
        .iptu-popup .leaflet-popup-content-wrapper {
            background: #ffffff !important;
            background-color: #ffffff !important;
            border-radius: 8px !important;
            box-shadow: 0 10px 40px rgba(0,0,0,0.6) !important;
            padding: 0 !important;
            opacity: 1 !important;
            border: 3px solid #0369a1 !important;
            position: relative;
            z-index: 100001 !important;
        }
        
        .iptu-popup .leaflet-popup-tip-container {
            margin-top: -1px;
            z-index: 100001 !important;
        }
        
        .iptu-popup .leaflet-popup-tip {
            background: #ffffff !important;
            background-color: #ffffff !important;
            box-shadow: 0 3px 10px rgba(0,0,0,0.3) !important;
            border: 3px solid #0369a1 !important;
            border-top: none !important;
            border-left: none !important;
        }
        
        /* Todos os popups do Leaflet - fundo branco sólido e ACIMA de tudo */
        .leaflet-popup-content-wrapper {
            background: #ffffff !important;
            background-color: #ffffff !important;
            margin-bottom: 15px;
            opacity: 1 !important;
            box-shadow: 0 8px 30px rgba(0,0,0,0.5) !important;
            z-index: 99999 !important;
        }
        
        .leaflet-popup-tip {
            background: #ffffff !important;
            background-color: #ffffff !important;
        }
        
        .leaflet-popup-content {
            background: #ffffff !important;
            background-color: #ffffff !important;
        }
        
        .iptu-popup .leaflet-popup-content {
            margin: 0 !important;
            padding: 0 !important;
            background: #ffffff !important;
        }
        
        /* Garantir que as camadas do mapa fiquem abaixo do popup */
        .leaflet-overlay-pane {
            z-index: 400 !important;
        }
        
        .leaflet-marker-pane {
            z-index: 600 !important;
        }
        
        .leaflet-tooltip-pane {
            z-index: 650 !important;
        }
        
        /* Cards de Estatísticas Suspensos */
        #iptuStatsFloating {
            position: fixed;
            top: 70px;
            left: 50%;
            transform: translateX(-50%);
            display: none;
            gap: 10px;
            z-index: 1999;
            animation: statsSlideDown 0.3s ease;
        }
        
        @keyframes statsSlideDown {
            from { opacity: 0; transform: translateX(-50%) translateY(-20px); }
            to { opacity: 1; transform: translateX(-50%) translateY(0); }
        }
        
        .iptu-stat-card {
            background: white;
            padding: 10px 18px;
            border-radius: 10px;
            box-shadow: 0 4px 15px rgba(0,0,0,0.15);
            text-align: center;
            min-width: 100px;
        }
        
        .iptu-stat-card .valor {
            font-size: 18px;
            font-weight: 700;
            color: #0d3b66;
        }
        
        .iptu-stat-card .label {
            font-size: 10px;
            color: #64748b;
            text-transform: uppercase;
            letter-spacing: 0.5px;
        }
        
        .iptu-stat-card.destaque {
            background: linear-gradient(135deg, #0d3b66, #1a5a96);
        }
        
        .iptu-stat-card.destaque .valor,
        .iptu-stat-card.destaque .label {
            color: white;
        }
        
        #iptuModalContent {
            display: flex;
            flex-direction: column;
            max-height: calc(100vh - 100px);
        }
        
        .iptu-header {
            background: linear-gradient(135deg, #0d3b66 0%, #1a5a96 100%);
            padding: 10px 15px;
            display: flex;
            justify-content: space-between;
            align-items: center;
        }
        
        .iptu-header h2 {
            margin: 0;
            color: white;
            font-size: 14px;
            font-weight: 700;
            display: flex;
            align-items: center;
            gap: 8px;
        }
        
        .iptu-header h2::before {
            content: '💰';
            font-size: 16px;
        }
        
        .iptu-close-btn {
            background: rgba(255,255,255,0.2);
            border: none;
            color: white;
            width: 28px;
            height: 28px;
            border-radius: 6px;
            font-size: 16px;
            cursor: pointer;
            transition: all 0.2s;
            display: flex;
            align-items: center;
            justify-content: center;
        }
        
        .iptu-close-btn:hover {
            background: rgba(255,255,255,0.3);
        }
        
        .iptu-body {
            flex: 1;
            overflow-y: auto;
            padding: 12px;
            background: #f8fafc;
        }
        
        .iptu-search-section {
            padding: 10px;
            background: white;
            border-radius: 8px;
            margin-bottom: 10px;
            border: 1px solid #e2e8f0;
        }
        
        .iptu-search-section h3 {
            margin: 0 0 10px 0;
            color: #0369a1;
            font-size: 13px;
            font-weight: 700;
            display: flex;
            align-items: center;
            gap: 6px;
        }
        
        .iptu-search-section h3::before {
            content: '🔍';
            font-size: 14px;
        }
        
        .iptu-search-grid {
            display: grid;
            grid-template-columns: 1fr 1fr;
            gap: 8px;
        }
        
        .iptu-search-field {
            display: flex;
            flex-direction: column;
            gap: 2px;
        }
        
        .iptu-search-field.full-width {
            grid-column: span 2;
        }
        
        .iptu-search-field label {
            font-size: 10px;
            color: #64748b;
            font-weight: 700;
            text-transform: uppercase;
            letter-spacing: 0.5px;
        }
        
        .iptu-search-field input,
        .iptu-search-field select {
            padding: 6px 10px;
            border: 1px solid #e2e8f0;
            border-radius: 6px;
            font-size: 12px;
            transition: all 0.2s ease;
            background: white;
        }
        
        .iptu-search-field input:focus,
        .iptu-search-field select:focus {
            border-color: #0ea5e9;
            outline: none;
            box-shadow: 0 0 0 2px rgba(14, 165, 233, 0.15);
        }
        
        .iptu-search-buttons {
            display: flex;
            gap: 8px;
            margin-top: 10px;
        }
        
        .iptu-btn {
            padding: 8px 14px;
            border: none;
            border-radius: 6px;
            font-size: 11px;
            font-weight: 700;
            cursor: pointer;
            transition: all 0.3s ease;
            display: flex;
            align-items: center;
            gap: 6px;
        }
        
        .iptu-btn-primary {
            background: linear-gradient(135deg, #0ea5e9 0%, #0284c7 100%);
            color: white;
            flex: 1;
        }
        
        .iptu-btn-primary:hover {
            background: linear-gradient(135deg, #0284c7 0%, #0369a1 100%);
            transform: translateY(-1px);
            box-shadow: 0 3px 8px rgba(14, 165, 233, 0.4);
        }
        
        .iptu-btn-secondary {
            background: #e2e8f0;
            color: #475569;
        }
        
        .iptu-btn-secondary:hover {
            background: #cbd5e1;
        }
        
        .iptu-btn-success {
            background: linear-gradient(135deg, #22c55e 0%, #16a34a 100%);
            color: white;
        }
        
        .iptu-btn-success:hover {
            background: linear-gradient(135deg, #16a34a 0%, #15803d 100%);
        }
        
        .iptu-btn-warning {
            background: linear-gradient(135deg, #f59e0b 0%, #d97706 100%);
            color: white;
        }
        
        /* Lista de resultados */
        .iptu-results-section {
            flex: 1;
            overflow-y: auto;
            padding: 10px;
        }
        
        .iptu-results-header {
            display: flex;
            justify-content: space-between;
            align-items: center;
            margin-bottom: 12px;
            padding-bottom: 10px;
            border-bottom: 1px solid #e2e8f0;
        }
        
        .iptu-results-header h4 {
            margin: 0;
            color: #334155;
            font-size: 14px;
            font-weight: 700;
        }
        
        .iptu-results-count {
            background: #0ea5e9;
            color: white;
            padding: 4px 10px;
            border-radius: 12px;
            font-size: 12px;
            font-weight: 700;
        }
        
        .iptu-result-card {
            background: white;
            border: 2px solid #e2e8f0;
            border-radius: 12px;
            padding: 15px;
            margin-bottom: 12px;
            cursor: pointer;
            transition: all 0.3s ease;
            position: relative;
            overflow: hidden;
        }
        
        .iptu-result-card::before {
            content: '';
            position: absolute;
            left: 0;
            top: 0;
            bottom: 0;
            width: 5px;
            background: var(--status-color, #6b7280);
        }
        
        .iptu-result-card:hover {
            border-color: #0ea5e9;
            transform: translateX(5px);
            box-shadow: 0 4px 12px rgba(14, 165, 233, 0.15);
        }
        
        .iptu-result-card.selected {
            border-color: #0ea5e9;
            background: #f0f9ff;
        }
        
        .iptu-card-header {
            display: flex;
            justify-content: space-between;
            align-items: flex-start;
            margin-bottom: 10px;
        }
        
        .iptu-card-inscricao {
            font-family: 'Courier New', monospace;
            font-size: 14px;
            font-weight: 700;
            color: #0369a1;
        }
        
        .iptu-card-status {
            padding: 4px 10px;
            border-radius: 20px;
            font-size: 11px;
            font-weight: 700;
            text-transform: uppercase;
            color: white;
        }
        
        .iptu-card-status.pago { background: #22c55e; }
        .iptu-card-status.parcial { background: #eab308; color: #1e293b; }
        .iptu-card-status.pendente { background: #f97316; }
        .iptu-card-status.vencido { background: #ef4444; }
        .iptu-card-status.isento { background: #6b7280; }
        
        .iptu-card-info {
            display: grid;
            grid-template-columns: 1fr 1fr;
            gap: 6px;
            font-size: 12px;
            color: #64748b;
        }
        
        .iptu-card-info span {
            display: flex;
            align-items: center;
            gap: 4px;
        }
        
        .iptu-card-valores {
            display: flex;
            justify-content: space-between;
            margin-top: 10px;
            padding-top: 10px;
            border-top: 1px dashed #e2e8f0;
        }
        
        .iptu-card-valor {
            text-align: center;
        }
        
        .iptu-card-valor-label {
            font-size: 10px;
            color: #94a3b8;
            text-transform: uppercase;
        }
        
        .iptu-card-valor-amount {
            font-size: 14px;
            font-weight: 700;
            color: #0f172a;
        }
        
        .iptu-card-valor-amount.pago { color: #22c55e; }
        .iptu-card-valor-amount.devido { color: #ef4444; }
        
        /* Painel direito - Mapa e Dashboard */
        .iptu-right-panel {
            width: 55%;
            display: flex;
            flex-direction: column;
            background: #f1f5f9;
        }
        
        /* Tabs para alternar Mapa/Dashboard */
        .iptu-tabs {
            display: flex;
            background: white;
            border-bottom: 1px solid #e2e8f0;
        }
        
        .iptu-tab {
            flex: 1;
            padding: 14px 20px;
            background: transparent;
            border: none;
            font-size: 14px;
            font-weight: 700;
            color: #64748b;
            cursor: pointer;
            transition: all 0.3s ease;
            display: flex;
            align-items: center;
            justify-content: center;
            gap: 8px;
            position: relative;
        }
        
        .iptu-tab::after {
            content: '';
            position: absolute;
            bottom: 0;
            left: 0;
            right: 0;
            height: 3px;
            background: transparent;
            transition: all 0.3s ease;
        }
        
        .iptu-tab:hover {
            background: #f8fafc;
            color: #0369a1;
        }
        
        .iptu-tab.active {
            color: #0369a1;
            background: #f0f9ff;
        }
        
        .iptu-tab.active::after {
            background: linear-gradient(90deg, #0ea5e9, #0369a1);
        }
        
        .iptu-tab-content {
            flex: 1;
            display: none;
            overflow: hidden;
        }
        
        .iptu-tab-content.active {
            display: flex;
            flex-direction: column;
        }
        
        /* Mini mapa */
        #iptuMiniMap {
            flex: 1;
            min-height: 300px;
            border-radius: 0;
        }
        
        .iptu-map-legend {
            display: flex;
            justify-content: center;
            gap: 20px;
            padding: 12px;
            background: white;
            border-top: 1px solid #e2e8f0;
        }
        
        .iptu-legend-item {
            display: flex;
            align-items: center;
            gap: 6px;
            font-size: 12px;
            color: #475569;
        }
        
        .iptu-legend-color {
            width: 16px;
            height: 16px;
            border-radius: 4px;
        }
        
        /* Dashboard/Estatísticas */
        .iptu-dashboard {
            padding: 20px;
            overflow-y: auto;
        }
        
        .iptu-stats-grid {
            display: grid;
            grid-template-columns: repeat(4, 1fr);
            gap: 15px;
            margin-bottom: 20px;
        }
        
        .iptu-stat-card {
            background: white;
            border-radius: 12px;
            padding: 18px;
            text-align: center;
            box-shadow: 0 2px 8px rgba(0,0,0,0.06);
            position: relative;
            overflow: hidden;
        }
        
        .iptu-stat-card::before {
            content: '';
            position: absolute;
            top: 0;
            left: 0;
            right: 0;
            height: 4px;
            background: var(--stat-color, #0ea5e9);
        }
        
        .iptu-stat-icon {
            font-size: 28px;
            margin-bottom: 8px;
        }
        
        .iptu-stat-value {
            font-size: 24px;
            font-weight: 800;
            color: #0f172a;
            margin-bottom: 4px;
        }
        
        .iptu-stat-label {
            font-size: 11px;
            color: #64748b;
            text-transform: uppercase;
            letter-spacing: 0.5px;
        }
        
        .iptu-charts-grid {
            display: grid;
            grid-template-columns: 1fr 1fr;
            gap: 20px;
        }
        
        .iptu-chart-card {
            background: white;
            border-radius: 12px;
            padding: 20px;
            box-shadow: 0 2px 8px rgba(0,0,0,0.06);
        }
        
        .iptu-chart-card h4 {
            margin: 0 0 15px 0;
            font-size: 14px;
            color: #334155;
            font-weight: 700;
        }
        
        .iptu-chart-container {
            height: 200px;
            position: relative;
        }
        
        /* Detalhe do imóvel selecionado */
        .iptu-detail-panel {
            background: white;
            border-top: 1px solid #e2e8f0;
            padding: 15px 20px;
            display: none;
        }
        
        .iptu-detail-panel.visible {
            display: block;
        }
        
        .iptu-detail-header {
            display: flex;
            justify-content: space-between;
            align-items: center;
            margin-bottom: 12px;
        }
        
        .iptu-detail-title {
            font-size: 16px;
            font-weight: 700;
            color: #0369a1;
        }
        
        .iptu-detail-actions {
            display: flex;
            gap: 8px;
        }
        
        .iptu-detail-grid {
            display: grid;
            grid-template-columns: repeat(4, 1fr);
            gap: 15px;
        }
        
        .iptu-detail-item {
            text-align: center;
            padding: 10px;
            background: #f8fafc;
            border-radius: 8px;
        }
        
        .iptu-detail-item-label {
            font-size: 10px;
            color: #64748b;
            text-transform: uppercase;
            margin-bottom: 4px;
        }
        
        .iptu-detail-item-value {
            font-size: 14px;
            font-weight: 700;
            color: #0f172a;
        }
        
        /* Loading spinner */
        .iptu-loading {
            display: none;
            position: absolute;
            top: 0;
            left: 0;
            right: 0;
            bottom: 0;
            background: rgba(255,255,255,0.9);
            align-items: center;
            justify-content: center;
            z-index: 10;
        }
        
        .iptu-loading.visible {
            display: flex;
        }
        
        .iptu-spinner {
            width: 50px;
            height: 50px;
            border: 4px solid #e2e8f0;
            border-top-color: #0ea5e9;
            border-radius: 50%;
            animation: iptuSpin 1s linear infinite;
        }
        
        @keyframes iptuSpin {
            to { transform: rotate(360deg); }
        }
        
        /* Responsividade */
        @media (max-width: 1200px) {
            .iptu-body {
                flex-direction: column;
            }
            .iptu-left-panel, .iptu-right-panel {
                width: 100%;
            }
            .iptu-left-panel {
                max-height: 50%;
            }
            .iptu-stats-grid {
                grid-template-columns: repeat(2, 1fr);
            }
        }
        
        /* ============================================= */
        /* FIM DO CSS IPTU */
        /* ============================================= */
        
        /* Botão de identificação no mapa */
        .identify-cursor {
            cursor: crosshair;
        }
        /* Modal do dashboard */
        #dashboardModal {
            position: fixed;
            top: 0;
            left: 0;
            width: 100vw;
            height: 100vh;
            background: rgba(0,0,0,0.6);
            display: none;
            align-items: center;
            justify-content: center;
            z-index: 5000;
            animation: fadeIn 0.3s ease;
        }

        @keyframes fadeIn {
            from { opacity: 0; }
            to { opacity: 1; }
        }

        #dashboardModalContent {
            width: 90%;
            height: 90%;
            background: #fff;
            border-radius: 12px;
            overflow: hidden;
            box-shadow: 0 4px 24px rgba(0,0,0,0.4);
            position: relative;
        }
        #dashboardModal iframe {
            width: 100%;
            height: 100%;
            border: 0;
        }
        #dashboardModalClose {
            position: absolute;
            top: 8px;
            right: 8px;
            z-index: 10;
            background: var(--danger);
            color: #fff;
            border: none;
            padding: 8px 12px;
            border-radius: 6px;
            cursor: pointer;
            font-weight: 700;
            transition: all 0.3s ease;
        }

        #dashboardModalClose:hover {
            background: #c1272d;
            transform: scale(1.05);
        }

        .layer-order-row:hover { background: rgba(77, 166, 255, 0.08); }
        .layer-order-row[draggable] { cursor: grab; }

        /* Theme: sistema de cores global */
        .coords-badge { 
            background: var(--accent); 
            color: #fff; 
            padding: 8px 12px; 
            border-radius: 8px; 
            font-size: 13px; 
            box-shadow: 0 6px 26px rgba(77, 166, 255, 0.3); 
            font-weight: 700; 
            pointer-events: auto;
            transition: all 0.3s ease;
        }

        .coords-badge:hover {
            box-shadow: 0 8px 32px rgba(77, 166, 255, 0.4);
            transform: translateY(-2px);
        }

        .text-highlight { color: var(--primary); font-weight: 700; }
        .btn-accent { 
            background: var(--accent); 
            color: #fff; 
            border: none; 
            padding: 8px 12px; 
            border-radius: 6px;
            transition: all 0.3s ease;
            cursor: pointer;
        }

        .btn-accent:hover {
            background: var(--accent-light);
            box-shadow: 0 6px 20px rgba(77, 166, 255, 0.3);
            transform: translateY(-2px);
        }

        /* Controls: white background, black text for maximum legibility */
        .leaflet-control, .leaflet-control a, .leaflet-control button, .leaflet-bar a, .leaflet-bar button {
            color: var(--primary) !important;
            text-shadow: none !important;
            font-weight: 700;
            background: white !important;
            border-radius: 8px;
            border: 1px solid var(--neutral-200) !important;
            transition: all 0.3s ease;
        }

        .leaflet-control:hover, .leaflet-control a:hover, .leaflet-control button:hover, 
        .leaflet-bar a:hover, .leaflet-bar button:hover {
            box-shadow: 0 4px 12px rgba(0,0,0,0.12) !important;
            transform: translateY(-2px);
        }

        /* Floating layers panel removed - using default Leaflet control with embedded toggle button */
        /* Hide default map counts badge and top-right placeholder toolbar when present */
        .map-counts-badge, #mapCountsBadge, .sigweb-top-toolbar { display: none !important; }

        /* Dark variant for some important tools (white text on dark bg) */
        .sig-tool-dark { 
            background: var(--primary) !important; 
            color: #fff !important; 
            border: 1px solid rgba(0,0,0,0.25) !important; 
        }

        /* Minimap - posicionamento e espaçamento do footer */
        .leaflet-bottom.leaflet-right {
            bottom: 30px !important;
            right: 12px !important;
        }

        .leaflet-minimap-toggle-display {
            margin-bottom: 8px !important;
        }

        /* Improve left vertical control bar visibility: make buttons larger, spaced and with solid bg */
        .leaflet-left .leaflet-control .leaflet-bar { background: transparent !important; }
        
        .leaflet-left .leaflet-control .leaflet-bar a, .leaflet-left .leaflet-control .leaflet-bar button {
            display: flex; 
            align-items: center; 
            justify-content: center;
            width: 40px; 
            height: 40px; 
            margin: 6px; 
            border-radius: 8px;
            background: white !important; 
            color: var(--primary) !important; 
            border: 1px solid var(--neutral-200) !important; 
            box-shadow: 0 4px 12px rgba(0,0,0,0.1) !important;
            font-size: 14px; 
            padding: 2px; 
            text-align: center; 
            line-height: 1;
            overflow: visible;
            transition: all 0.3s ease;
        }

        .leaflet-left .leaflet-control .leaflet-bar a:hover, 
        .leaflet-left .leaflet-control .leaflet-bar button:hover {
            background: var(--accent) !important;
            color: white !important;
            box-shadow: 0 6px 18px rgba(77, 166, 255, 0.3) !important;
            transform: translateY(-2px);
        }

        /* ensure icons inside buttons (SVG or emoji) are visible */
        .leaflet-left .leaflet-control .leaflet-bar a svg, .leaflet-left .leaflet-control .leaflet-bar a img { 
            filter: none !important; 
            opacity: 1 !important; 
        }

        /* Force icon colors and strokes to be visible inside control buttons */
        .leaflet-left .leaflet-control .leaflet-bar a svg * { 
            fill: var(--primary) !important; 
            stroke: var(--primary) !important; 
            opacity: 1 !important; 
        }

        .leaflet-left .leaflet-control .leaflet-bar a svg { 
            width: 20px !important; 
            height: 20px !important; 
        }

        .leaflet-left .leaflet-control .leaflet-bar a img { 
            filter: none !important; 
            opacity: 1 !important; 
        }

        .leaflet-left .leaflet-control .leaflet-bar a::before, .leaflet-left .leaflet-control .leaflet-bar a::after { 
            display: none !important; 
        }

        /* Ensure the small separators or empty items don't render large blank boxes */
        .leaflet-left .leaflet-control .leaflet-bar .leaflet-control-separator { 
            height: 6px; 
            margin: 2px 0; 
        }

        /* hide completely empty control buttons to avoid big blank squares */
        .leaflet-left .leaflet-control .leaflet-bar a:empty, .leaflet-left .leaflet-control .leaflet-bar button:empty { 
            display: none !important; 
        }

        /* limit the vertical controls height and allow scrolling if too long */
        .leaflet-left .leaflet-control .leaflet-bar { 
            max-height: 70vh; 
            overflow-y: auto; 
            padding: 10px;
            background: #f5f7fa;
        }
        .history-list::-webkit-scrollbar{width:5px}
        .history-list::-webkit-scrollbar-track{background:#ececec}
        .history-list::-webkit-scrollbar-thumb{background:#90a4ae;border-radius:4px}
        .history-list::-webkit-scrollbar-thumb:hover{background:#607d8b}

        /* make search control and other small controls use readable styles */
        #nominatimSearch input, #nominatimSearch button { 
            background: white !important; 
            color: var(--primary) !important; 
            border: 1px solid var(--neutral-200) !important;
            border-radius: 8px !important;
            padding: 8px 12px !important;
            transition: all 0.3s ease;
        }

        #nominatimSearch button {
            background: var(--accent) !important;
            color: white !important;
        }

        #nominatimSearch button:hover {
            box-shadow: 0 4px 12px rgba(77, 166, 255, 0.3) !important;
        }

        /* make control tooltips and titles more visible */
        .leaflet-control .leaflet-control-title, .leaflet-control .leaflet-control-label { 
            color: var(--primary); 
            font-weight: 700; 
            text-shadow: 0 1px 0 rgba(255,255,255,0.85); 
        }

        /* improve popup / panel text contrast */
        .leaflet-popup-content, .leaflet-popup-content-wrapper, .atributos-table, #filterModalInner { 
            color: var(--primary); 
            text-shadow: none; 
        }

        /* ensure panel buttons are readable on dark backgrounds */
        button, .btn, input, select, textarea { 
            color: var(--primary);
            font-family: inherit;
        }

        /* Apply accent to common buttons */
        button, .btn { 
            background: transparent; 
            border-radius: 8px;
            transition: all 0.3s ease;
        }

        .btn-primary { 
            background: var(--accent); 
            color: #fff; 
            border: none; 
            padding: 8px 12px;
            box-shadow: 0 4px 12px rgba(77, 166, 255, 0.2);
        }

        .btn-primary:hover {
            background: var(--accent-light);
            box-shadow: 0 6px 18px rgba(77, 166, 255, 0.3);
            transform: translateY(-2px);
        }

        .panel-accent { 
            border-left: 4px solid var(--accent);
            padding-left: 12px;
        }

        /* Search control */
        #nominatimSearch { 
            position: fixed; 
            left: 80px; 
            top: 82px; 
            z-index: 7000; 
            display: flex; 
            gap: 6px; 
            align-items: center;
        }

        #nominatimSearch input { 
            padding: 8px 12px; 
            border-radius: 8px; 
            border: 1px solid var(--neutral-200) !important; 
            background: white; 
            color: var(--primary);
            min-width: 250px;
        }

        #nominatimSearch button { 
            padding: 8px 12px; 
            border-radius: 8px; 
            border: none; 
            background: var(--accent); 
            color: #fff; 
            cursor: pointer;
            font-weight: 700;
            transition: all 0.3s ease;
        }

        #nominatimSearch button:hover {
            background: var(--accent-light);
            box-shadow: 0 4px 12px rgba(77, 166, 255, 0.3);
        }

        /* Area modal */
    /* Feature label style: small, bold, subtle halo for contrast and pointer-events none so labels don't block clicks */
    /* Label marker container (divIcon with text) */
    .sigweb-feature-label-container {
        /* Container para markers com divIcon - deixar estilos dos filhos */
        display: flex !important;
        align-items: center !important;
        justify-content: center !important;
    }
    
    .sigweb-feature-label {
        /* Label content - apenas texto, sem moldura por padrão; estilos visuais de fundo/borda/padding são aplicados pelo HTML inline quando configurados */
        font-weight: 800 !important;
        pointer-events: none !important;
        white-space: nowrap !important;
        text-align: center !important;
        box-sizing: border-box !important;
        /* Preserve map interactivity - visual style (background/border/padding) must be controlled by inline style generated for each label */
    }
    
    /* Leaflet tooltip styling for labels - fallback para tooltips */
    .leaflet-tooltip.sigweb-feature-label {
        background: transparent !important;
        border: none !important;
        box-shadow: none !important;
        padding: 0 !important;
        text-align: center !important;
    }
    
    .leaflet-tooltip.sigweb-feature-label::before {
        display: none !important;
    }
    
    .sigweb-eye-btn { 
        display: inline-flex; 
        align-items: center; 
        justify-content: center; 
        width: 28px; 
        height: 28px; 
        margin-left: 6px; 
        border-radius: 6px; 
        border: none; 
        background: transparent; 
        cursor: pointer; 
        padding: 2px;
        transition: all 0.3s ease;
    }

    .sigweb-eye-btn:hover {
        background: rgba(77, 166, 255, 0.1);
    }

    .sigweb-eye-btn svg { 
        width: 18px; 
        height: 18px; 
        display: block; 
    }

    .sigweb-eye-btn.open svg path { 
        fill: var(--primary); 
    }

    .sigweb-eye-btn.closed svg path { 
        fill: #888; 
    }

    /* Small gear button for label config in layer control */
    .sigweb-label-config-btn { 
        display: inline-flex;
        align-items: center;
        justify-content: center;
        width: 28px;
        height: 28px;
        margin-left: 6px;
        border-radius: 6px;
        border: 1px solid #ccc;
        background: white;
        cursor: pointer;
        padding: 2px;
        transition: all 0.2s ease;
    }
    .sigweb-label-config-btn:hover { box-shadow: 0 2px 8px rgba(0,0,0,0.08); }

    #areaModal { 
        position: fixed; 
        right: 12px; 
        top: 90px; 
        width: 340px; 
        background: linear-gradient(180deg, rgba(7, 43, 74, 0.95) 0%, rgba(13, 74, 122, 0.95) 100%);
        color: #eaf6ff; 
        padding: 16px; 
        border-radius: 12px; 
        box-shadow: 0 12px 40px rgba(0,0,0,0.3); 
        z-index: 8000; 
        display: none;
        border: 1px solid rgba(77, 166, 255, 0.2);
    }

    #areaModal h4 {
        color: white;
        margin: 0 0 16px 0;
        font-size: 15px;
    }

    #areaModal label, #areaModal select, #areaModal input { 
        display: block; 
        width: 100%; 
        margin-bottom: 8px;
        color: rgba(255,255,255,0.8);
        font-weight: 700;
        font-size: 12px;
    }

    #areaModal select, #areaModal input {
        background: rgba(255,255,255,0.1) !important;
        border: 1px solid rgba(77, 166, 255, 0.3) !important;
        color: white !important;
        padding: 8px !important;
        border-radius: 6px !important;
    }

    #areaModal select option {
        background: var(--primary);
        color: white;
    }

    /* ===== MODAL DE ATRIBUTOS ===== */
    #attributesModal {
        position: fixed;
        left: 0;
        top: 0;
        width: 100vw;
        height: 100vh;
        background: rgba(0, 0, 0, 0.5);
        display: none;
        align-items: center;
        justify-content: center;
        z-index: 9000;
    }

    .attributes-modal-content {
        background: white;
        border-radius: 12px;
        box-shadow: 0 10px 40px rgba(0, 0, 0, 0.3);
        width: 90%;
        max-width: 800px;
        max-height: 90vh;
        overflow-y: auto;
        display: flex;
        flex-direction: column;
    }

    .attributes-modal-header {
        display: flex;
        justify-content: space-between;
        align-items: center;
        padding: 20px;
        border-bottom: 2px solid #f0f0f0;
        background: linear-gradient(135deg, var(--primary), var(--primary-light));
        color: white;
        border-radius: 12px 12px 0 0;
    }

    .attributes-modal-header h2 {
        margin: 0;
        font-size: 20px;
    }

    .attributes-modal-close {
        background: none;
        border: none;
        font-size: 28px;
        cursor: pointer;
        color: white;
        padding: 0;
        width: 32px;
        height: 32px;
        display: flex;
        align-items: center;
        justify-content: center;
        transition: transform 0.2s;
    }

    .attributes-modal-close:hover {
        transform: scale(1.2);
    }

    .attributes-modal-body {
        flex: 1;
        overflow-y: auto;
        padding: 20px;
    }

    .form-section {
        margin-bottom: 24px;
        padding-bottom: 20px;
        border-bottom: 1px solid #e0e0e0;
    }

    .form-section:last-child {
        border-bottom: none;
    }

    .form-section-title {
        font-size: 16px;
        font-weight: 700;
        color: var(--primary);
        margin: 0 0 16px 0;
        padding-bottom: 8px;
        border-bottom: 2px solid var(--accent);
        display: flex;
        align-items: center;
        gap: 8px;
    }

    .form-section-title::before {
        font-size: 18px;
    }

    .form-group {
        margin-bottom: 10px;
        display: grid;
        grid-template-columns: 1fr 1fr;
        gap: 12px;
        align-items: flex-start;
    }

    .form-group label {
        font-weight: 700;
        color: #0d3b66;
        font-size: 11px;
        text-transform: uppercase;
        letter-spacing: 0.3px;
        word-break: break-word;
        grid-column: 1 / -1;
        margin-bottom: 2px;
    }

    .form-group input,
    .form-group select,
    .form-group textarea {
        padding: 5px 8px;
        border: 1px solid #d0d0d0;
        border-radius: 4px;
        font-size: 12px;
        font-family: inherit;
        background: white;
        color: #333;
        transition: border-color 0.2s;
        line-height: 1.4;
        width: 100%;
        box-sizing: border-box;
    }

    .form-group input:focus,
    .form-group select:focus,
    .form-group textarea:focus {
        outline: none;
        border-color: var(--accent);
        box-shadow: 0 0 0 3px rgba(77, 166, 255, 0.1);
    }

    .form-group textarea {
        grid-column: 1 / -1;
        min-height: 50px;
        resize: vertical;
        width: 100%;
    }
    
    .form-group-textarea {
        grid-column: 1 / -1;
        min-height: 50px;
        resize: vertical;
    }
    
    .form-group.full-width {
        grid-template-columns: 1fr;
    }
    
    .form-group.full-width input,
    .form-group.full-width select {
        grid-column: 1 / -1;
    }

    .attributes-modal-footer {
        display: flex;
        gap: 12px;
        justify-content: flex-end;
        padding: 20px;
        border-top: 1px solid #f0f0f0;
        background: var(--neutral-50);
        border-radius: 0 0 12px 12px;
    }

    .attributes-modal-footer button {
        padding: 10px 20px;
        border: none;
        border-radius: 6px;
        font-weight: 600;
        cursor: pointer;
        font-size: 13px;
        transition: all 0.3s;
    }

    .attributes-modal-footer .btn-cancel {
        background: var(--neutral-200);
        color: var(--neutral-700);
    }

    .attributes-modal-footer .btn-cancel:hover {
        background: var(--neutral-300);
    }

    .attributes-modal-footer .btn-save {
        background: var(--success);
        color: white;
    }

    .attributes-modal-footer .btn-save:hover {
        background: #1d5e2d;
    }

    /* When the control container has this class, hide the overlays section to appear 'recolhido' */
    .leaflet-control.sigweb-collapsed-layers .leaflet-control-layers-overlays,
    .leaflet-control.sigweb-collapsed-layers .leaflet-control-layers-list { display: none !important; }

    /* small embedded toggle button inside the control */
    .leaflet-control .sigweb-toggle-layers-btn { 
        display: inline-flex; 
        align-items: center; 
        justify-content: center; 
        width: 36px; 
        height: 36px; 
        margin-left: 6px; 
        border-radius: 8px; 
        background: white; 
        color: var(--accent); 
        border: 1px solid var(--neutral-200); 
        cursor: pointer; 
        font-weight: 700; 
        box-shadow: 0 4px 14px rgba(77, 166, 255, 0.1); 
        padding: 4px; 
        transition: all 0.3s ease; 
    }

    .leaflet-control .sigweb-toggle-layers-btn svg { 
        width: 18px; 
        height: 18px; 
        display: block; 
    }

    .leaflet-control .sigweb-toggle-layers-btn:hover { 
        background: var(--accent); 
        color: white; 
        transform: translateY(-2px);
        box-shadow: 0 6px 18px rgba(77, 166, 255, 0.3);
    }

    .leaflet-control .sigweb-toggle-layers-btn:active { 
        transform: translateY(0); 
    }

    /* Scale dinâmica - estilos adicionais se necessário */
    /* Principal CSS é gerado dinamicamente em js/dynamic-scale.js */

    /* ========== BCI MODE - Desabilitar hover/click visual de layers ========== */
    .bci-mode-active * {
        pointer-events: auto !important;  /* Não bloquear cliques */
    }
    
    .bci-mode-active .leaflet-interactive {
        cursor: crosshair !important;  /* Mudar cursor para crosshair */
    }
    
    /* Desabilitar transições de estilo durante BCI para que o destaque apareça sem animação */
    .bci-mode-active .leaflet-interactive * {
        transition: none !important;  /* Sem transições suaves */
    }

    /* Botão Dashboard Especial */
    .dashboard-btn-special {
        background: linear-gradient(135deg, #6366f1 0%, #8b5cf6 100%) !important;
        box-shadow: 0 8px 24px rgba(99, 102, 241, 0.35) !important;
        border: none !important;
        border-radius: 8px !important;
        padding: 12px 18px !important;
        color: white !important;
        font-weight: 700 !important;
        font-size: 14px !important;
        display: inline-flex !important;
        align-items: center !important;
        gap: 8px !important;
        cursor: pointer !important;
        transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1) !important;
        position: relative !important;
        overflow: hidden !important;
    }

    .dashboard-btn-special::before {
        content: '';
        position: absolute;
        top: 50%;
        left: 50%;
        width: 0;
        height: 0;
        border-radius: 50%;
        background: rgba(255, 255, 255, 0.3);
        transform: translate(-50%, -50%);
        transition: width 0.5s, height 0.5s;
    }

    .dashboard-btn-special:hover {
        background: linear-gradient(135deg, #8b5cf6 0%, #a78bfa 100%) !important;
        box-shadow: 0 12px 32px rgba(99, 102, 241, 0.45), 0 0 20px rgba(139, 92, 246, 0.3) !important;
        transform: translateY(-2px) !important;
    }

    .dashboard-btn-special:hover::before {
        width: 300px;
        height: 300px;
    }

    .dashboard-btn-special:active {
        transform: translateY(0) !important;
        box-shadow: 0 4px 12px rgba(99, 102, 241, 0.35) !important;
    }

    /* ========== GoPro MAX 360° Viewer Styles ========== */
    
    /* Pannellum Container */
    #streetViewContent {
        width: 100%;
        height: 100%;
        background: #000;
        border-radius: 0 0 6px 6px;
        overflow: hidden;
    }

    #streetViewContent iframe {
        width: 100%;
        height: 100%;
        border: none;
    }

    /* Timeline Controls */
    #timeSlider {
        cursor: pointer;
        border-radius: 4px;
    }

    #timeSlider:hover {
        opacity: 0.9;
    }

    /* Control Buttons */
    #playBtn:hover, #pauseBtn:hover {
        opacity: 0.85;
        transform: scale(1.02);
    }

    #playBtn:active, #pauseBtn:active {
        transform: scale(0.98);
    }

    /* Telemetry Display */
    .gopro-telemetry-item {
        display: flex;
        justify-content: space-between;
        margin: 4px 0;
        font-family: 'Monaco', 'Courier New', monospace;
        font-size: 11px;
    }

    .gopro-telemetry-label {
        font-weight: bold;
        color: #4da6ff;
    }

    .gopro-telemetry-value {
        color: #fff;
        text-align: right;
    }

    /* Trajectory Line on Map */
    .leaflet-pane.leaflet-overlay-pane svg path {
        stroke-linecap: round;
        stroke-linejoin: round;
    }

    /* Trajectory Markers */
    .leaflet-interactive.trajectory-marker {
        stroke: #fff;
        stroke-width: 2;
        cursor: pointer;
    }

    .leaflet-interactive.trajectory-marker:hover {
        fill-opacity: 1;
        stroke-width: 3;
    }

    /* Pegman Button Styles */
    .pegman-btn {
        background: white;
        border: 2px solid #ccc;
        border-radius: 6px;
        padding: 8px 10px;
        cursor: pointer;
        font-size: 18px;
        transition: all 0.3s ease;
        box-shadow: 0 2px 8px rgba(0,0,0,0.15);
    }

    .pegman-btn:hover {
        background: #f0f0f0;
        border-color: #4da6ff;
        box-shadow: 0 4px 12px rgba(77, 166, 255, 0.3);
        transform: scale(1.05);
    }

    .pegman-btn.active {
        background: #4da6ff;
        color: white;
        border-color: #0d4a7a;
    }

    /* Pannellum CSS Overrides */
    .pnlm-ui {
        font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    }

    .pnlm-controls {
        background: rgba(0,0,0,0.4);
    }

    .pnlm-controls button:hover {
        background: rgba(77, 166, 255, 0.8);
    }

    /* ========== Pegman Style ========== */
    .pegman-btn {
        width: 45px !important;
        height: 45px !important;
        padding: 0 !important;
        background: white !important;
        border: 2px solid #4da6ff !important;
        border-radius: 4px !important;
        font-size: 24px !important;
        cursor: pointer !important;
        display: flex !important;
        align-items: center !important;
        justify-content: center !important;
        line-height: 1 !important;
        transition: all 0.3s ease !important;
        color: initial !important;
    }

    .pegman-btn:hover {
        transform: scale(1.1);
        box-shadow: 0 2px 8px rgba(77, 166, 255, 0.4);
    }

    .pegman-btn.active {
        background: #ff6b6b !important;
        color: white !important;
        border-color: #ff6b6b !important;
    }

    /* ========== End GoPro Styles ========== */
    
    /* ========== Modal Flutuante/Draggable ========== */
    #attributesModal {
        transition: box-shadow 0.3s ease;
        max-width: 95vw;
        max-height: 95vh;
    }
    
    #attributesModal:not([style*="display: none"]) {
        box-shadow: 0 8px 32px rgba(0, 0, 0, 0.2) !important;
    }
    
    #attributesModalHeader {
        cursor: grab;
        transition: all 0.2s ease;
    }
    
    #attributesModalHeader:hover {
        background: linear-gradient(135deg, #0d4a7a 0%, #052140 100%) !important;
    }
    
    #attributesModalHeader:active {
        cursor: grabbing;
    }
    
    #attributesModalNewWindow:hover,
    #attributesModalClose:hover {
        background: rgba(255, 255, 255, 0.25) !important;
    }
    
    /* Estilo das abas - DESIGN MODERNO */
    .attributesTabBtn {
        transition: all 0.2s ease !important;
        position: relative;
    }
    
    .attributesTabBtn:hover {
        background: rgba(77, 166, 255, 0.08) !important;
        color: #0d3b66 !important;
    }
    
    .attributesTabBtn[style*="borderBottomColor: rgb(77, 166, 255)"],
    .attributesTabBtn[style*="border-bottom-color: rgb(77, 166, 255)"] {
        color: #0d3b66 !important;
        background: rgba(77, 166, 255, 0.06) !important;
    }
    
    /* Efeito de sombra ao arrastar */
    #attributesModal.dragging {
        box-shadow: 0 20px 60px rgba(0, 0, 0, 0.3) !important;
    }
    
    /* Botões do Modal - com hover moderno */
    #attributesModalCancel:hover {
        background: #d0d0d0 !important;
        transform: translateY(-1px);
        box-shadow: 0 4px 8px rgba(0,0,0,0.15) !important;
    }
    
    #attributesModalSave:hover {
        transform: translateY(-1px);
        box-shadow: 0 6px 16px rgba(77, 166, 255, 0.4) !important;
    }
    
    #bringBackModalBtn:hover {
        transform: translateY(-2px);
        box-shadow: 0 12px 28px rgba(77, 166, 255, 0.4) !important;
    }
    
    #bringBackModalBtn:active {
        transform: translateY(0);
    }
    
    /* Input focus moderno */
    #attributesFormBody input:focus,
    #attributesFormBody textarea:focus {
        outline: none;
    }
    
    /* Responsivo para telas pequenas */
    @media (max-width: 768px) {
        #attributesModal {
            width: 95vw !important;
            max-width: 95vw !important;
            height: 90vh !important;
            max-height: 90vh !important;
            top: 5vh !important;
            left: 2.5vw !important;
            right: auto !important;
        }
    }

    /* ========================================
       🔄 GLOBAL LOADING SPINNER
       ======================================== */
    #globalLoader {
        position: fixed;
        top: 0;
        left: 0;
        width: 100%;
        height: 100%;
        background: rgba(7, 43, 74, 0.85);
        display: none;
        justify-content: center;
        align-items: center;
        z-index: 99999;
        backdrop-filter: blur(4px);
    }
    
    #globalLoader.active {
        display: flex;
    }
    
    .loader-content {
        text-align: center;
        color: white;
    }
    
    .loader-spinner {
        width: 60px;
        height: 60px;
        border: 4px solid rgba(255,255,255,0.2);
        border-top-color: var(--accent);
        border-radius: 50%;
        animation: spin 1s linear infinite;
        margin: 0 auto 16px;
    }
    
    .loader-text {
        font-size: 16px;
        font-weight: 600;
        opacity: 0.9;
    }
    
    @keyframes spin {
        to { transform: rotate(360deg); }
    }

    /* ========================================
       🔔 TOAST NOTIFICATIONS
       ======================================== */
    #toastContainer {
        position: fixed;
        top: 90px;
        right: 20px;
        z-index: 99998;
        display: flex;
        flex-direction: column;
        gap: 10px;
        pointer-events: none;
    }
    
    .toast {
        min-width: 300px;
        max-width: 450px;
        padding: 14px 20px;
        border-radius: 10px;
        box-shadow: 0 8px 30px rgba(0,0,0,0.25);
        display: flex;
        align-items: center;
        gap: 12px;
        pointer-events: auto;
        animation: toastIn 0.4s ease;
        font-weight: 600;
        font-size: 14px;
    }
    
    .toast.toast-out {
        animation: toastOut 0.3s ease forwards;
    }
    
    .toast-success {
        background: linear-gradient(135deg, #10b981 0%, #059669 100%);
        color: white;
    }
    
    .toast-error {
        background: linear-gradient(135deg, #ef4444 0%, #dc2626 100%);
        color: white;
    }
    
    .toast-warning {
        background: linear-gradient(135deg, #f59e0b 0%, #d97706 100%);
        color: white;
    }
    
    .toast-info {
        background: linear-gradient(135deg, #3b82f6 0%, #2563eb 100%);
        color: white;
    }
    
    .toast-icon {
        font-size: 20px;
    }
    
    .toast-close {
        margin-left: auto;
        background: rgba(255,255,255,0.2);
        border: none;
        color: white;
        width: 24px;
        height: 24px;
        border-radius: 50%;
        cursor: pointer;
        display: flex;
        align-items: center;
        justify-content: center;
        font-size: 12px;
        transition: all 0.2s;
    }
    
    .toast-close:hover {
        background: rgba(255,255,255,0.3);
        transform: scale(1.1);
    }
    
    @keyframes toastIn {
        from {
            transform: translateX(100%);
            opacity: 0;
        }
        to {
            transform: translateX(0);
            opacity: 1;
        }
    }
    
    @keyframes toastOut {
        from {
            transform: translateX(0);
            opacity: 1;
        }
        to {
            transform: translateX(100%);
            opacity: 0;
        }
    }

    /* ========================================
       ⌨️ KEYBOARD SHORTCUTS PANEL
       ======================================== */
    #shortcutsPanel {
        position: fixed;
        top: 50%;
        left: 50%;
        transform: translate(-50%, -50%);
        background: white;
        border-radius: 16px;
        padding: 24px 32px;
        box-shadow: 0 25px 80px rgba(0,0,0,0.3);
        z-index: 99997;
        display: none;
        min-width: 400px;
        max-width: 500px;
    }
    
    #shortcutsPanel.active {
        display: block;
        animation: fadeInScale 0.3s ease;
    }
    
    @keyframes fadeInScale {
        from {
            opacity: 0;
            transform: translate(-50%, -50%) scale(0.9);
        }
        to {
            opacity: 1;
            transform: translate(-50%, -50%) scale(1);
        }
    }
    
    .shortcuts-header {
        display: flex;
        justify-content: space-between;
        align-items: center;
        margin-bottom: 20px;
        padding-bottom: 12px;
        border-bottom: 2px solid var(--neutral-200);
    }
    
    .shortcuts-header h3 {
        margin: 0;
        font-size: 18px;
        color: var(--primary);
        display: flex;
        align-items: center;
        gap: 8px;
    }
    
    .shortcuts-list {
        display: flex;
        flex-direction: column;
        gap: 10px;
    }
    
    .shortcut-item {
        display: flex;
        justify-content: space-between;
        align-items: center;
        padding: 10px 0;
        border-bottom: 1px solid var(--neutral-100);
    }
    
    .shortcut-item:last-child {
        border-bottom: none;
    }
    
    .shortcut-keys {
        display: flex;
        gap: 4px;
    }
    
    .shortcut-key {
        background: linear-gradient(145deg, #f3f4f6 0%, #e5e7eb 100%);
        padding: 6px 10px;
        border-radius: 6px;
        font-family: monospace;
        font-size: 12px;
        font-weight: 700;
        color: var(--primary);
        border: 1px solid var(--neutral-300);
        box-shadow: 0 2px 4px rgba(0,0,0,0.1);
    }
    
    .shortcut-desc {
        color: var(--neutral-700);
        font-size: 14px;
    }

    /* ========================================
       📊 QUICK STATS BADGE (SIDEBAR)
       ======================================== */
    .stats-badge {
        background: linear-gradient(135deg, var(--primary) 0%, var(--primary-light) 100%);
        color: white;
        padding: 12px 16px;
        border-radius: 10px;
        margin: 10px;
        font-size: 12px;
    }
    
    .stats-badge-title {
        font-weight: 800;
        margin-bottom: 8px;
        display: flex;
        align-items: center;
        gap: 6px;
    }
    
    .stats-badge-grid {
        display: grid;
        grid-template-columns: 1fr 1fr;
        gap: 8px;
    }
    
    .stats-badge-item {
        background: rgba(255,255,255,0.1);
        padding: 8px;
        border-radius: 6px;
        text-align: center;
    }
    
    .stats-badge-value {
        font-size: 18px;
        font-weight: 800;
        display: block;
    }
    
    .stats-badge-label {
        font-size: 10px;
        opacity: 0.8;
    }
    
/* ══════ LAYER STYLE EDITOR ══════ */
#layerStyleEditor{position:fixed;z-index:12000;background:#fff;border-radius:12px;box-shadow:0 8px 32px rgba(0,0,0,.25);width:320px;max-height:80vh;overflow-y:auto;display:none;font-family:-apple-system,BlinkMacSystemFont,'Segoe UI',sans-serif;border:1px solid #e2e8f0}
#layerStyleEditor .lse-header{cursor:move;user-select:none;display:flex;align-items:center;justify-content:space-between;padding:12px 16px;background:linear-gradient(135deg,#6366f1,#8b5cf6);color:#fff;border-radius:12px 12px 0 0;font-weight:600;font-size:13px}
#layerStyleEditor .lse-header button{background:0 0;border:none;color:#fff;font-size:18px;cursor:pointer;padding:0 4px}
#layerStyleEditor .lse-body{padding:16px}
#layerStyleEditor .lse-section{margin-bottom:14px}
#layerStyleEditor .lse-st{font-size:11px;font-weight:600;color:#64748b;text-transform:uppercase;letter-spacing:.5px;margin-bottom:6px}
#layerStyleEditor .lse-row{display:flex;align-items:center;gap:8px;margin-bottom:8px}
#layerStyleEditor .lse-lb{font-size:12px;color:#334155;min-width:90px}
#layerStyleEditor .lse-ci{width:36px;height:28px;border:2px solid #e2e8f0;border-radius:6px;cursor:pointer;padding:0}
#layerStyleEditor .lse-rng{flex:1;accent-color:#6366f1}
#layerStyleEditor .lse-rv{font-size:11px;color:#64748b;min-width:32px;text-align:right}
#layerStyleEditor .lse-pats{display:grid;grid-template-columns:repeat(4,1fr);gap:6px}
#layerStyleEditor .lse-pb{width:100%;aspect-ratio:1;border:2px solid #e2e8f0;border-radius:8px;cursor:pointer;background:#fff;display:flex;align-items:center;justify-content:center;transition:all .15s;overflow:hidden}
#layerStyleEditor .lse-pb:hover{border-color:#6366f1;transform:scale(1.05)}
#layerStyleEditor .lse-pb.active{border-color:#6366f1;background:#eef2ff;box-shadow:0 0 0 2px rgba(99,102,241,.3)}
#layerStyleEditor .lse-pb svg{width:32px;height:32px}
#layerStyleEditor .lse-prs{display:flex;gap:6px;flex-wrap:wrap}
#layerStyleEditor .lse-prb{padding:4px 10px;border:1px solid #e2e8f0;border-radius:16px;font-size:11px;cursor:pointer;background:#f8fafc;transition:all .15s;white-space:nowrap}
#layerStyleEditor .lse-prb:hover{background:#6366f1;color:#fff;border-color:#6366f1}
#layerStyleEditor .lse-apb{width:100%;padding:10px;background:linear-gradient(135deg,#6366f1,#8b5cf6);color:#fff;border:none;border-radius:8px;font-weight:600;font-size:13px;cursor:pointer;margin-top:6px}
#layerStyleEditor .lse-apb:hover{transform:translateY(-1px);box-shadow:0 4px 12px rgba(99,102,241,.4)}
#layerStyleEditor .lse-rsb{width:100%;padding:8px;background:#f1f5f9;color:#64748b;border:1px solid #e2e8f0;border-radius:8px;font-size:12px;cursor:pointer;margin-top:6px}
#layerStyleEditor .lse-rsb:hover{background:#e2e8f0}
#layerStyleEditor .lse-prev{width:100%;height:48px;border:1px solid #e2e8f0;border-radius:8px;margin-bottom:12px;overflow:hidden}
.overlay-action-btn.style-btn{font-size:13px}
.overlay-action-btn.style-btn.has-custom-style{background:#eef2ff!important;color:#6366f1!important;border-color:#6366f1!important}


/* ══════════════════════════════════════════════════════════
   OVERRIDES: corrige conflito com edit-panel-new.css
   edit-panel-new.css define .history-list {max-height:140px}
   e .history-item {display:flex} — precisamos anular para o
   painel de auditoria (#historyPanel) com maior especificidade
   ══════════════════════════════════════════════════════════ */
#historyPanel .history-list {
    max-height: none !important;
    flex: 1 1 0 !important;
    min-height: 0 !important;
    overflow-y: auto !important;
    overflow-x: hidden !important;
    background: #f4f6f9 !important;
    padding: 10px 10px 6px !important;
    border-radius: 0 !important;
    border: none !important;
    font-size: inherit !important;
}
#historyPanel .history-item {
    display: block !important;
    padding: unset !important;
    background: white !important;
    border-left: unset !important;
    cursor: default !important;
}
