/* ==========================================================================
   SISTEMA GEAP - DESIGN SYSTEM & STYLESHEET
   Cores Oficiais: Azul GEAP (#15335A), Vermelho GEAP (#C00D0D), Slate & Emerald
   ========================================================================== */

@import url('https://fonts.googleapis.com/css2?family=Plus+Jakarta+Sans:wght@300;400;500;600;700;800&family=JetBrains+Mono:wght@400;500&display=swap');

:root {
    --geap-blue-primary: #15335a;
    --geap-blue-dark: #0d223f;
    --geap-blue-light: #244b80;
    --geap-blue-accent: #2563eb;
    --geap-red-primary: #c00d0d;
    --geap-red-light: #fee2e2;
    --geap-red-dark: #991b1b;
    
    --bg-main: #f8fafc;
    --bg-surface: #ffffff;
    --bg-surface-elevated: #ffffff;
    --bg-subtle: #f1f5f9;
    --bg-active: #e2e8f0;

    --border-color: #e2e8f0;
    --border-subtle: #f1f5f9;
    --border-focus: #15335a;

    --text-primary: #0f172a;
    --text-secondary: #475569;
    --text-muted: #94a3b8;
    --text-inverse: #ffffff;

    --success-bg: #ecfdf5;
    --success-text: #065f46;
    --success-border: #a7f3d0;
    --success-accent: #10b981;

    --warning-bg: #fffbeb;
    --warning-text: #92400e;
    --warning-border: #fde68a;

    --info-bg: #eff6ff;
    --info-text: #1e40af;
    --info-border: #bfdbfe;

    --shadow-sm: 0 1px 2px 0 rgb(0 0 0 / 0.05);
    --shadow-md: 0 4px 6px -1px rgb(0 0 0 / 0.07), 0 2px 4px -2px rgb(0 0 0 / 0.07);
    --shadow-lg: 0 10px 15px -3px rgb(0 0 0 / 0.08), 0 4px 6px -4px rgb(0 0 0 / 0.08);
    --shadow-xl: 0 20px 25px -5px rgb(0 0 0 / 0.1), 0 8px 10px -6px rgb(0 0 0 / 0.1);

    --radius-sm: 6px;
    --radius-md: 10px;
    --radius-lg: 14px;
    --radius-full: 9999px;

    --sidebar-width: 260px;
    --header-height: 72px;
}

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

body {
    font-family: 'Plus Jakarta Sans', -apple-system, BlinkMacSystemFont, sans-serif;
    background-color: var(--bg-main);
    color: var(--text-primary);
    line-height: 1.5;
    font-size: 14px;
    -webkit-font-smoothing: antialiased;
    overflow-x: hidden;
}

/* Typography Helpers */
h1, h2, h3, h4, h5, h6 {
    font-weight: 700;
    color: var(--text-primary);
    letter-spacing: -0.02em;
}

.mono {
    font-family: 'JetBrains Mono', monospace;
}

/* App Container */
.app-layout {
    display: flex;
    min-height: 100vh;
}

/* Sidebar Navigation */
.app-sidebar {
    width: var(--sidebar-width);
    background: var(--geap-blue-dark);
    color: var(--text-inverse);
    display: flex;
    flex-direction: column;
    position: fixed;
    top: 0;
    bottom: 0;
    left: 0;
    z-index: 100;
    box-shadow: var(--shadow-lg);
    transition: all 0.3s ease;
}

.sidebar-brand {
    height: var(--header-height);
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 0 24px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
}

.sidebar-logo {
    height: 38px;
    width: auto;
    filter: brightness(0) invert(1);
}

.brand-badge {
    font-size: 10px;
    font-weight: 700;
    text-transform: uppercase;
    background: rgba(192, 13, 13, 0.9);
    padding: 2px 8px;
    border-radius: var(--radius-full);
    letter-spacing: 0.05em;
}

.sidebar-nav {
    flex: 1;
    padding: 24px 16px;
    display: flex;
    flex-direction: column;
    gap: 6px;
    overflow-y: auto;
}

.nav-section-title {
    font-size: 11px;
    text-transform: uppercase;
    letter-spacing: 0.08em;
    color: rgba(255, 255, 255, 0.4);
    font-weight: 700;
    padding: 12px 12px 6px;
}

.nav-item {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 11px 14px;
    color: rgba(255, 255, 255, 0.75);
    text-decoration: none;
    border-radius: var(--radius-md);
    font-weight: 600;
    font-size: 13.5px;
    transition: all 0.2s ease;
    cursor: pointer;
    border: 1px solid transparent;
}

.nav-item:hover {
    color: var(--text-inverse);
    background: rgba(255, 255, 255, 0.08);
}

.nav-item.active {
    color: var(--text-inverse);
    background: var(--geap-blue-primary);
    border-color: rgba(255, 255, 255, 0.15);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.2);
}

.nav-item svg {
    width: 19px;
    height: 19px;
    flex-shrink: 0;
    opacity: 0.85;
}

.nav-item.active svg {
    opacity: 1;
    color: #60a5fa;
}

.sidebar-footer {
    padding: 16px 20px;
    border-top: 1px solid rgba(255, 255, 255, 0.1);
    background: rgba(0, 0, 0, 0.15);
}

.user-profile-widget {
    display: flex;
    align-items: center;
    gap: 12px;
}

.user-avatar {
    width: 36px;
    height: 36px;
    border-radius: var(--radius-full);
    background: linear-gradient(135deg, var(--geap-blue-light), var(--geap-blue-primary));
    border: 2px solid rgba(255, 255, 255, 0.2);
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 700;
    font-size: 13px;
}

.user-info {
    flex: 1;
    min-width: 0;
}

.user-name {
    font-size: 13px;
    font-weight: 600;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.user-role {
    font-size: 11px;
    color: rgba(255, 255, 255, 0.5);
    text-transform: capitalize;
}

/* Main Content Area */
.app-main {
    flex: 1;
    margin-left: var(--sidebar-width);
    display: flex;
    flex-direction: column;
    min-width: 0;
    min-height: 100vh;
}

/* Top Navigation Bar */
.app-header {
    height: var(--header-height);
    background: var(--bg-surface);
    border-bottom: 1px solid var(--border-color);
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0 32px;
    position: sticky;
    top: 0;
    z-index: 90;
    box-shadow: var(--shadow-sm);
}

.header-title-group {
    display: flex;
    flex-direction: column;
}

.header-title {
    font-size: 18px;
    font-weight: 700;
    color: var(--geap-blue-dark);
}

.header-subtitle {
    font-size: 12px;
    color: var(--text-secondary);
}

.header-actions {
    display: flex;
    align-items: center;
    gap: 14px;
}

.system-status-pill {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 6px 14px;
    background: var(--success-bg);
    border: 1px solid var(--success-border);
    border-radius: var(--radius-full);
    font-size: 12px;
    font-weight: 600;
    color: var(--success-text);
}

.status-dot {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background: var(--success-accent);
    box-shadow: 0 0 0 3px rgba(16, 185, 129, 0.2);
}

/* Page Views Container */
.page-container {
    padding: 28px 32px;
    flex: 1;
}

.view-section {
    display: none;
    animation: fadeIn 0.25s ease-out;
}

.view-section.active {
    display: block;
}

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

/* Card Component */
.card {
    background: var(--bg-surface);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-sm);
    padding: 24px;
    margin-bottom: 24px;
    transition: box-shadow 0.2s ease, border-color 0.2s ease;
}

.card:hover {
    border-color: #cbd5e1;
}

.card-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 20px;
    padding-bottom: 14px;
    border-bottom: 1px solid var(--border-subtle);
}

.card-title {
    font-size: 16px;
    font-weight: 700;
    color: var(--geap-blue-dark);
    display: flex;
    align-items: center;
    gap: 10px;
}

.card-title svg {
    color: var(--geap-blue-primary);
}

/* Search Box & Filters */
.search-hero {
    background: linear-gradient(135deg, var(--geap-blue-dark) 0%, var(--geap-blue-primary) 100%);
    border-radius: var(--radius-lg);
    padding: 28px 32px;
    color: white;
    margin-bottom: 24px;
    box-shadow: var(--shadow-md);
    position: relative;
    overflow: hidden;
}

.search-hero::after {
    content: '';
    position: absolute;
    top: -50%;
    right: -20%;
    width: 350px;
    height: 350px;
    background: radial-gradient(circle, rgba(255,255,255,0.08) 0%, transparent 70%);
    border-radius: 50%;
    pointer-events: none;
}

.search-bar-wrap {
    display: flex;
    gap: 12px;
    margin-top: 18px;
}

.search-input-wrapper {
    flex: 1;
    position: relative;
    display: flex;
    align-items: center;
}

.search-icon {
    position: absolute;
    left: 18px;
    width: 20px;
    height: 20px;
    color: var(--text-muted);
}

.search-main-input {
    width: 100%;
    padding: 14px 18px 14px 50px;
    border-radius: var(--radius-md);
    border: 2px solid transparent;
    font-size: 15px;
    background: white;
    color: var(--text-primary);
    box-shadow: var(--shadow-lg);
    outline: none;
    transition: all 0.2s;
}

.search-main-input:focus {
    border-color: #60a5fa;
    box-shadow: 0 0 0 4px rgba(96, 165, 250, 0.3);
}

/* Filter Grid */
.filters-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
    gap: 14px;
    margin-top: 18px;
}

.filter-group {
    display: flex;
    flex-direction: column;
    gap: 6px;
}

.filter-label {
    font-size: 11.5px;
    font-weight: 700;
    text-transform: uppercase;
    color: var(--text-secondary);
    letter-spacing: 0.04em;
}

.filter-select, .form-input, .form-select, .form-textarea {
    width: 100%;
    padding: 9px 13px;
    border: 1px solid var(--border-color);
    border-radius: var(--radius-sm);
    background: white;
    font-size: 13.5px;
    color: var(--text-primary);
    font-family: inherit;
    outline: none;
    transition: all 0.2s;
}

.filter-select:focus, .form-input:focus, .form-select:focus, .form-textarea:focus {
    border-color: var(--geap-blue-primary);
    box-shadow: 0 0 0 3px rgba(21, 51, 90, 0.12);
}

/* Buttons */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    padding: 10px 18px;
    border-radius: var(--radius-sm);
    font-weight: 600;
    font-size: 13.5px;
    cursor: pointer;
    border: 1px solid transparent;
    transition: all 0.2s ease;
    text-decoration: none;
    white-space: nowrap;
}

.btn-primary {
    background: var(--geap-blue-primary);
    color: white;
    box-shadow: var(--shadow-sm);
}

.btn-primary:hover {
    background: var(--geap-blue-light);
    transform: translateY(-1px);
    box-shadow: var(--shadow-md);
}

.btn-secondary {
    background: var(--bg-surface);
    color: var(--text-secondary);
    border-color: var(--border-color);
}

.btn-secondary:hover {
    background: var(--bg-subtle);
    color: var(--text-primary);
    border-color: #cbd5e1;
}

.btn-danger {
    background: var(--geap-red-primary);
    color: white;
}

.btn-danger:hover {
    background: var(--geap-red-dark);
}

.btn-success {
    background: var(--success-accent);
    color: white;
}

.btn-success:hover {
    background: #059669;
}

.btn-sm {
    padding: 6px 12px;
    font-size: 12px;
}

.btn-icon {
    padding: 8px;
    border-radius: var(--radius-sm);
}

/* Table Styles */
.table-responsive {
    width: 100%;
    overflow-x: auto;
    border-radius: var(--radius-md);
    border: 1px solid var(--border-color);
}

.data-table {
    width: 100%;
    border-collapse: collapse;
    text-align: left;
    background: white;
}

.data-table th {
    background: var(--bg-subtle);
    padding: 12px 16px;
    font-size: 11.5px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    color: var(--text-secondary);
    border-bottom: 1px solid var(--border-color);
    white-space: nowrap;
}

.data-table td {
    padding: 14px 16px;
    border-bottom: 1px solid var(--border-color);
    font-size: 13.5px;
    vertical-align: middle;
}

.data-table tbody tr {
    transition: background-color 0.15s ease;
}

.data-table tbody tr:hover {
    background-color: #f8fafc;
}

.data-table tbody tr:last-child td {
    border-bottom: none;
}

/* Badges */
.badge {
    display: inline-flex;
    align-items: center;
    gap: 5px;
    padding: 4px 10px;
    border-radius: var(--radius-full);
    font-size: 11.5px;
    font-weight: 700;
    letter-spacing: 0.02em;
    white-space: nowrap;
}

.badge-titular {
    background: #e0f2fe;
    color: #0369a1;
    border: 1px solid #bae6fd;
}

.badge-dependente {
    background: #fef3c7;
    color: #b45309;
    border: 1px solid #fde68a;
}

.badge-plano {
    background: #f1f5f9;
    color: var(--geap-blue-primary);
    border: 1px solid #cbd5e1;
    font-family: 'JetBrains Mono', monospace;
    font-weight: 600;
}

/* KPI Dashboard Cards */
.kpi-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(210px, 1fr));
    gap: 18px;
    margin-bottom: 24px;
}

.kpi-card {
    background: white;
    border: 1px solid var(--border-color);
    border-radius: var(--radius-lg);
    padding: 20px;
    box-shadow: var(--shadow-sm);
    display: flex;
    flex-direction: column;
    gap: 8px;
    position: relative;
    overflow: hidden;
}

.kpi-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 4px;
    background: var(--geap-blue-primary);
}

.kpi-card.kpi-red::before {
    background: var(--geap-red-primary);
}

.kpi-card.kpi-green::before {
    background: var(--success-accent);
}

.kpi-card.kpi-blue::before {
    background: #0284c7;
}

.kpi-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.kpi-title {
    font-size: 12px;
    font-weight: 700;
    text-transform: uppercase;
    color: var(--text-secondary);
    letter-spacing: 0.04em;
}

.kpi-icon-wrap {
    width: 36px;
    height: 36px;
    border-radius: var(--radius-md);
    background: var(--bg-subtle);
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--geap-blue-primary);
}

.kpi-value {
    font-size: 26px;
    font-weight: 800;
    color: var(--text-primary);
    line-height: 1.1;
    letter-spacing: -0.03em;
}

.kpi-subtitle {
    font-size: 12px;
    color: var(--text-muted);
}

/* Charts Grid 4 Colunas (1 Linha Acima do Dashboard) */
.charts-grid-4col {
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 16px;
    margin-bottom: 24px;
}

.chart-card-compact {
    padding: 16px 18px 14px 18px;
    background: var(--bg-surface);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-sm);
    display: flex;
    flex-direction: column;
    transition: all var(--transition-normal);
}

.chart-card-compact:hover {
    box-shadow: var(--shadow-md);
    border-color: #cbd5e1;
}

.chart-container-compact {
    position: relative;
    height: 220px;
    width: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
}

/* Charts Grid Tradicional (Fallback) */
.charts-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(420px, 1fr));
    gap: 24px;
    margin-bottom: 24px;
}

.chart-container {
    position: relative;
    height: 280px;
    width: 100%;
}

/* Beneficiary Detail (Ficha 360) Modal */
.modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(15, 23, 42, 0.75);
    backdrop-filter: blur(4px);
    display: none;
    align-items: center;
    justify-content: center;
    z-index: 1000;
    padding: 24px;
}

.modal-overlay.active {
    display: flex;
    animation: modalFadeIn 0.2s ease-out;
}

@keyframes modalFadeIn {
    from { opacity: 0; transform: scale(0.98); }
    to { opacity: 1; transform: scale(1); }
}

.modal-content {
    background: white;
    border-radius: var(--radius-lg);
    width: 100%;
    max-width: 900px;
    max-height: 90vh;
    display: flex;
    flex-direction: column;
    box-shadow: var(--shadow-xl);
    overflow: hidden;
}

.modal-header {
    background: var(--geap-blue-dark);
    color: white;
    padding: 20px 28px;
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.modal-header-info {
    display: flex;
    align-items: center;
    gap: 16px;
}

.modal-avatar {
    width: 48px;
    height: 48px;
    border-radius: var(--radius-full);
    background: var(--geap-blue-light);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 20px;
    font-weight: 800;
    border: 2px solid rgba(255, 255, 255, 0.3);
}

.modal-title {
    font-size: 18px;
    font-weight: 700;
    color: white;
}

.modal-subtitle {
    font-size: 12.5px;
    color: rgba(255, 255, 255, 0.7);
    margin-top: 2px;
}

.modal-close-btn {
    background: rgba(255, 255, 255, 0.1);
    border: none;
    color: white;
    width: 32px;
    height: 32px;
    border-radius: var(--radius-full);
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: background 0.2s;
}

.modal-close-btn:hover {
    background: rgba(255, 255, 255, 0.25);
}

.modal-tabs {
    display: flex;
    background: var(--bg-subtle);
    border-bottom: 1px solid var(--border-color);
    padding: 0 24px;
    gap: 8px;
}

.modal-tab-btn {
    padding: 12px 18px;
    border: none;
    background: none;
    font-size: 13px;
    font-weight: 600;
    color: var(--text-secondary);
    cursor: pointer;
    border-bottom: 2px solid transparent;
    transition: all 0.2s;
}

.modal-tab-btn.active {
    color: var(--geap-blue-primary);
    border-bottom-color: var(--geap-blue-primary);
    font-weight: 700;
    background: white;
}

.modal-body {
    padding: 24px 28px;
    overflow-y: auto;
    flex: 1;
}

.modal-tab-pane {
    display: none;
}

.modal-tab-pane.active {
    display: block;
}

/* Detail Info Grid */
.info-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
    gap: 16px;
}

.info-item {
    background: var(--bg-subtle);
    padding: 12px 16px;
    border-radius: var(--radius-sm);
    border: 1px solid var(--border-subtle);
}

.info-item-label {
    font-size: 11px;
    font-weight: 700;
    text-transform: uppercase;
    color: var(--text-muted);
    letter-spacing: 0.04em;
    margin-bottom: 4px;
}

.info-item-value {
    font-size: 14px;
    font-weight: 600;
    color: var(--text-primary);
    word-break: break-word;
}

/* Family Ties / Dependents Cards */
.family-tree-wrap {
    display: flex;
    flex-direction: column;
    gap: 14px;
}

.family-card {
    background: white;
    border: 1px solid var(--border-color);
    border-radius: var(--radius-md);
    padding: 16px 20px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    transition: all 0.2s;
}

.family-card:hover {
    border-color: var(--geap-blue-primary);
    box-shadow: var(--shadow-sm);
}

.family-card-left {
    display: flex;
    align-items: center;
    gap: 14px;
}

.family-avatar {
    width: 40px;
    height: 40px;
    border-radius: var(--radius-full);
    background: #e0f2fe;
    color: #0369a1;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 700;
    font-size: 13px;
}

/* Action Quick Links */
.action-links {
    display: flex;
    gap: 6px;
}

.action-btn {
    padding: 6px 10px;
    border-radius: var(--radius-sm);
    border: 1px solid var(--border-color);
    background: white;
    color: var(--text-secondary);
    text-decoration: none;
    font-size: 12px;
    font-weight: 600;
    display: inline-flex;
    align-items: center;
    gap: 5px;
    cursor: pointer;
    transition: all 0.15s;
}

.action-btn:hover {
    background: var(--bg-subtle);
    color: var(--geap-blue-primary);
    border-color: #cbd5e1;
}

.action-btn.whatsapp {
    color: #059669;
    border-color: #a7f3d0;
    background: #ecfdf5;
}

.action-btn.whatsapp:hover {
    background: #d1fae5;
}

/* Pagination */
.pagination-wrap {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding-top: 18px;
    margin-top: 14px;
    border-top: 1px solid var(--border-color);
}

.pagination-controls {
    display: flex;
    align-items: center;
    gap: 8px;
}

.page-btn {
    padding: 6px 12px;
    border: 1px solid var(--border-color);
    background: white;
    border-radius: var(--radius-sm);
    font-size: 13px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s;
}

.page-btn:hover:not(:disabled) {
    background: var(--bg-subtle);
    border-color: #cbd5e1;
}

.page-btn:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

/* Toast Notifications */
.toast-container {
    position: fixed;
    bottom: 24px;
    right: 24px;
    display: flex;
    flex-direction: column;
    gap: 10px;
    z-index: 2000;
}

.toast {
    padding: 14px 20px;
    border-radius: var(--radius-md);
    background: #0f172a;
    color: white;
    font-size: 13.5px;
    font-weight: 600;
    box-shadow: var(--shadow-lg);
    display: flex;
    align-items: center;
    gap: 10px;
    animation: toastSlideUp 0.3s ease-out;
}

.toast.toast-success {
    background: #065f46;
    border-left: 4px solid var(--success-accent);
}

.toast.toast-error {
    background: var(--geap-red-dark);
    border-left: 4px solid #f87171;
}

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

/* ==========================================================================
   EFEITOS VISUAIS 3D & HUD PARA MAPAS INTERATIVOS
   ========================================================================== */

.map-wrapper-3d {
    position: relative;
    border-radius: var(--radius-lg);
    overflow: hidden;
    box-shadow: 0 12px 30px -5px rgba(15, 23, 42, 0.15), 0 0 0 1px rgba(15, 23, 42, 0.08);
}

.map-hud-overlay {
    position: absolute;
    top: 16px;
    left: 16px;
    z-index: 1000;
    pointer-events: none;
    max-width: 320px;
    transition: all 0.3s cubic-bezier(0.16, 1, 0.3, 1);
}

.map-hud-card {
    background: rgba(15, 23, 42, 0.88);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    border: 1px solid rgba(255, 255, 255, 0.18);
    border-radius: var(--radius-md);
    padding: 16px 18px;
    color: white;
    box-shadow: 0 20px 25px -5px rgba(0, 0, 0, 0.3), 0 8px 10px -6px rgba(0, 0, 0, 0.3);
    animation: hudSlide 0.3s ease-out;
}

@keyframes hudSlide {
    from { opacity: 0; transform: translateY(-8px) scale(0.96); }
    to { opacity: 1; transform: translateY(0) scale(1); }
}

.hud-title {
    font-size: 15px;
    font-weight: 800;
    color: #ffffff;
    display: flex;
    align-items: center;
    gap: 8px;
    letter-spacing: -0.01em;
}

.hud-stat-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 8px;
    margin-top: 12px;
}

.hud-stat-item {
    background: rgba(255, 255, 255, 0.08);
    padding: 8px 10px;
    border-radius: var(--radius-sm);
    border: 1px solid rgba(255, 255, 255, 0.08);
}

.hud-stat-label {
    font-size: 10px;
    text-transform: uppercase;
    color: rgba(255, 255, 255, 0.6);
    font-weight: 700;
    letter-spacing: 0.04em;
}

.hud-stat-val {
    font-size: 14px;
    font-weight: 800;
    color: #38bdf8;
    margin-top: 2px;
}

/* ==========================================================================
   SISTEMA DE ELEVAÇÃO 3D INTERATIVA (3D PILLAR LIFT & HOVER ELEVATION)
   ========================================================================== */
.marker-pin-3d {
    position: relative;
    cursor: pointer;
    transform-origin: bottom center;
}

.pillar-3d-wrapper {
    position: relative;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: flex-end;
    transform-origin: bottom center;
    transition: transform 0.4s cubic-bezier(0.2, 1.25, 0.4, 1.2), filter 0.3s ease;
    user-select: none;
}

/* Base e Sombra 3D Projetada no Solo */
.pillar-ground-shadow {
    position: absolute;
    bottom: -6px;
    left: 50%;
    transform: translateX(-50%);
    width: 32px;
    height: 12px;
    background: radial-gradient(ellipse at center, rgba(15, 23, 42, 0.8) 0%, rgba(15, 23, 42, 0) 75%);
    border-radius: 50%;
    transition: all 0.4s cubic-bezier(0.2, 1.25, 0.4, 1.2);
    pointer-events: none;
}

.pillar-ground-ring {
    position: absolute;
    bottom: -4px;
    left: 50%;
    transform: translateX(-50%);
    width: 24px;
    height: 8px;
    border: 1.5px solid rgba(56, 189, 248, 0.4);
    border-radius: 50%;
    transition: all 0.4s ease;
    pointer-events: none;
}

/* Coluna / Tronco 3D Extrudado */
.pillar-column-stem {
    width: 6px;
    background: linear-gradient(180deg, rgba(56, 189, 248, 0.95) 0%, rgba(2, 132, 199, 0.7) 60%, rgba(15, 23, 42, 0.4) 100%);
    border-radius: 3px;
    box-shadow: 0 0 10px rgba(56, 189, 248, 0.5), inset 0 0 4px rgba(255, 255, 255, 0.8);
    transition: all 0.4s cubic-bezier(0.2, 1.25, 0.4, 1.2);
    margin-bottom: -2px;
    position: relative;
    z-index: 1;
}

/* Topo 3D / Esfera de Densidade com Reflexo e Profundidade */
.pillar-cap-sphere {
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
    color: #ffffff;
    font-weight: 800;
    font-family: inherit;
    position: relative;
    z-index: 2;
    transition: all 0.35s ease;
    border: 2px solid rgba(255, 255, 255, 0.95);
}

/* Variações de Tamanho por Volume de Vidas */
.pillar-hub-mega .pillar-cap-sphere {
    width: 44px;
    height: 44px;
    background: radial-gradient(circle at 35% 30%, #93c5fd 0%, #2563eb 55%, #0f172a 100%);
    font-size: 13px;
    box-shadow: 0 10px 25px rgba(37, 99, 235, 0.5), inset 0 3px 6px rgba(255, 255, 255, 0.8);
}

.pillar-hub-large .pillar-cap-sphere {
    width: 36px;
    height: 36px;
    background: radial-gradient(circle at 35% 30%, #7dd3fc 0%, #0284c7 55%, #082f49 100%);
    font-size: 11px;
    box-shadow: 0 8px 20px rgba(2, 132, 199, 0.45), inset 0 3px 5px rgba(255, 255, 255, 0.7);
}

.pillar-hub-medium .pillar-cap-sphere {
    width: 30px;
    height: 30px;
    background: radial-gradient(circle at 35% 30%, #99f6e4 0%, #0d9488 55%, #134e4a 100%);
    font-size: 10px;
    box-shadow: 0 6px 15px rgba(13, 148, 136, 0.4);
}

.pillar-normal .pillar-cap-sphere {
    width: 22px;
    height: 22px;
    background: radial-gradient(circle at 35% 30%, #e2e8f0 0%, #64748b 60%, #0f172a 100%);
    font-size: 9px;
    border-color: #f1f5f9;
    box-shadow: 0 4px 10px rgba(0, 0, 0, 0.3);
}

/* Rótulo Flutuante do Município */
.pillar-city-tag {
    margin-top: 4px;
    background: rgba(15, 23, 42, 0.9);
    backdrop-filter: blur(8px);
    -webkit-backdrop-filter: blur(8px);
    color: #f8fafc;
    font-size: 9.5px;
    font-weight: 700;
    padding: 2px 7px;
    border-radius: 10px;
    border: 1px solid rgba(255, 255, 255, 0.22);
    white-space: nowrap;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.35);
    letter-spacing: 0.02em;
    z-index: 2;
    transition: all 0.3s ease;
}

.pillar-normal .pillar-city-tag {
    font-size: 8.5px;
    padding: 1px 5px;
    opacity: 0.88;
}

/* Anel Radar Pulsante */
.pillar-radar-ring {
    position: absolute;
    top: 50%;
    left: 50%;
    width: 56px;
    height: 56px;
    border-radius: 50%;
    border: 2px solid rgba(56, 189, 248, 0.8);
    transform: translate(-50%, -50%);
    animation: pillarRadarPulse 2.2s infinite cubic-bezier(0.215, 0.61, 0.355, 1);
    pointer-events: none;
}

@keyframes pillarRadarPulse {
    0% {
        transform: translate(-50%, -50%) scale(0.4);
        opacity: 1;
    }
    70% {
        opacity: 0.25;
    }
    100% {
        transform: translate(-50%, -50%) scale(1.8);
        opacity: 0;
    }
}

/* ==========================================================================
   ELEVAÇÃO 3D AO PASSAR O MOUSE (HOVER ELEVATION EFFECT)
   ========================================================================== */
.marker-pin-3d:hover .pillar-3d-wrapper,
.pillar-3d-wrapper:hover {
    /* Elevação física no espaço 3D para cima */
    transform: translateY(-24px) scale(1.2);
    z-index: 9999 !important;
}

/* Efeito na sombra projetada durante a elevação */
.marker-pin-3d:hover .pillar-ground-shadow,
.pillar-3d-wrapper:hover .pillar-ground-shadow {
    transform: translateX(-50%) translateY(24px) scale(1.6);
    opacity: 0.35;
    filter: blur(6px);
    width: 44px;
}

.marker-pin-3d:hover .pillar-ground-ring,
.pillar-3d-wrapper:hover .pillar-ground-ring {
    transform: translateX(-50%) translateY(24px) scale(1.5);
    border-color: #38bdf8;
    box-shadow: 0 0 12px rgba(56, 189, 248, 0.8);
}

/* A coluna estica e ganha brilho radiante */
.marker-pin-3d:hover .pillar-column-stem,
.pillar-3d-wrapper:hover .pillar-column-stem {
    width: 8px;
    background: linear-gradient(180deg, #60a5fa 0%, #38bdf8 50%, rgba(56, 189, 248, 0.2) 100%);
    box-shadow: 0 0 20px rgba(56, 189, 248, 0.9), inset 0 0 6px #ffffff;
    filter: brightness(1.25);
}

/* O topo brilha intensamente */
.marker-pin-3d:hover .pillar-cap-sphere,
.pillar-3d-wrapper:hover .pillar-cap-sphere {
    border-color: #ffffff;
    box-shadow: 0 15px 35px rgba(56, 189, 248, 0.8), inset 0 3px 8px #ffffff;
    filter: brightness(1.15);
}

/* O rótulo da cidade ganha destaque com fundo iluminado */
.marker-pin-3d:hover .pillar-city-tag,
.pillar-3d-wrapper:hover .pillar-city-tag {
    background: rgba(15, 23, 42, 0.98);
    border-color: #38bdf8;
    color: #38bdf8;
    box-shadow: 0 8px 20px rgba(56, 189, 248, 0.4);
    transform: scale(1.05);
}

/* Leaflet Popup Customizado Premium */
.leaflet-popup-content-wrapper {
    background: rgba(15, 23, 42, 0.94) !important;
    backdrop-filter: blur(14px) !important;
    -webkit-backdrop-filter: blur(14px) !important;
    color: white !important;
    border-radius: var(--radius-md) !important;
    border: 1px solid rgba(255, 255, 255, 0.15) !important;
    box-shadow: 0 25px 30px -5px rgba(0, 0, 0, 0.4) !important;
    padding: 6px !important;
}

.leaflet-popup-tip {
    background: rgba(15, 23, 42, 0.94) !important;
}

/* ==========================================================================
   MAQUETE 3D BRASIL & CONTROLE DE VISUALIZAÇÃO
   ========================================================================== */
.map-view-toggle {
    display: inline-flex;
    background: #f1f5f9;
    border-radius: 8px;
    padding: 3px;
    gap: 3px;
    border: 1px solid var(--border-color);
}

.btn-map-tab {
    background: transparent;
    border: none;
    padding: 5px 12px;
    font-size: 11.5px;
    font-weight: 700;
    color: var(--text-muted);
    border-radius: 6px;
    cursor: pointer;
    transition: all 0.2s ease;
}

.btn-map-tab:hover {
    color: var(--text-main);
}

.btn-map-tab.active {
    background: #ffffff;
    color: var(--geap-blue-primary);
    box-shadow: 0 1px 3px rgba(0,0,0,0.1);
}

.brasil-3d-viewport {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
    overflow: hidden;
    background: transparent !important;
    display: none;
    z-index: 5;
    border-radius: 12px;
}

.brasil-3d-viewport.active {
    display: block;
}

#brasil-3d-canvas-container {
    width: 100%;
    height: 100%;
    cursor: default;
    background: transparent !important;
}

/* Painel Lateral Esquerdo Dedicado de Informações */
.map-info-sidebar {
    background: #0f172a;
    border: 1px solid rgba(56, 189, 248, 0.2);
    border-radius: 12px;
    padding: 18px;
    display: flex;
    flex-direction: column;
    gap: 14px;
    color: #f8fafc;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.25);
}

.map-info-tag {
    font-size: 11px;
    text-transform: uppercase;
    font-weight: 700;
    letter-spacing: 0.5px;
    color: #38bdf8;
    margin-bottom: 4px;
}

.map-info-title {
    font-size: 18px;
    font-weight: 800;
    color: #ffffff;
    margin: 0;
}

.map-info-badge {
    display: inline-block;
    background: rgba(56, 189, 248, 0.15);
    color: #7dd3fc;
    border: 1px solid rgba(56, 189, 248, 0.3);
    font-size: 11px;
    font-weight: 700;
    padding: 2px 8px;
    border-radius: 12px;
    margin-top: 4px;
}

.map-info-metrics {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 8px;
}

.info-metric-card {
    background: rgba(255, 255, 255, 0.04);
    border: 1px solid rgba(255, 255, 255, 0.08);
    border-radius: 8px;
    padding: 8px 10px;
}

.info-metric-lbl {
    display: block;
    font-size: 10.5px;
    text-transform: uppercase;
    color: #94a3b8;
    font-weight: 600;
}

.info-metric-val {
    display: block;
    font-size: 15px;
    font-weight: 800;
    color: #ffffff;
    margin-top: 2px;
}

.map-info-details {
    background: rgba(255, 255, 255, 0.02);
    border-top: 1px solid rgba(255, 255, 255, 0.08);
    border-bottom: 1px solid rgba(255, 255, 255, 0.08);
    padding: 8px 0;
    display: flex;
    flex-direction: column;
    gap: 4px;
    font-size: 12px;
    color: #cbd5e1;
}

.info-detail-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.map-quick-cities-title {
    font-size: 11.5px;
    text-transform: uppercase;
    font-weight: 700;
    color: #94a3b8;
    letter-spacing: 0.5px;
}

.map-quick-cities-list {
    display: flex;
    flex-direction: column;
    gap: 6px;
    max-height: 170px;
    overflow-y: auto;
    padding-right: 4px;
}

.map-quick-cities-list::-webkit-scrollbar {
    width: 4px;
}
.map-quick-cities-list::-webkit-scrollbar-thumb {
    background: rgba(255, 255, 255, 0.2);
    border-radius: 4px;
}

.quick-city-item {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 6px 10px;
    background: rgba(255, 255, 255, 0.03);
    border: 1px solid rgba(255, 255, 255, 0.05);
    border-radius: 6px;
    font-size: 12px;
    cursor: pointer;
    transition: all 0.2s ease;
}

.quick-city-item:hover, .quick-city-item.active {
    background: rgba(56, 189, 248, 0.15);
    border-color: rgba(56, 189, 248, 0.4);
    transform: translateX(3px);
}

.quick-city-name {
    font-weight: 600;
    color: #e2e8f0;
}

.quick-city-pct {
    font-size: 11px;
    font-weight: 800;
    color: #38bdf8;
    background: rgba(56, 189, 248, 0.1);
    padding: 1px 6px;
    border-radius: 8px;
}

/* ============================================================
   Inteligência Geográfica - Layout Executivo Hierárquico
   ============================================================ */

/* Seletor Interativo de Estados */
.geo-state-selector-wrapper {
    display: flex;
    align-items: center;
    gap: 14px;
    flex-wrap: wrap;
    margin-bottom: 18px;
    padding-bottom: 14px;
    border-bottom: 1px solid var(--border-color, #e2e8f0);
}

.geo-selector-title {
    font-size: 13px;
    font-weight: 700;
    color: var(--text-color, #1e293b);
    white-space: nowrap;
}

.geo-state-pills-bar {
    display: flex;
    gap: 8px;
    flex-wrap: wrap;
}

.geo-state-pill-btn {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 7px 14px;
    background: var(--card-bg, #ffffff);
    border: 1.5px solid var(--border-color, #cbd5e1);
    border-radius: 20px;
    font-size: 12.5px;
    font-weight: 600;
    color: var(--text-color, #334155);
    cursor: pointer;
    transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.04);
}

.geo-state-pill-btn:hover {
    border-color: #0284c7;
    background: #f0f9ff;
    transform: translateY(-1px);
    box-shadow: 0 4px 10px rgba(2, 132, 199, 0.1);
}

.geo-state-pill-btn.active {
    background: #0284c7;
    border-color: #0284c7;
    color: #ffffff;
    box-shadow: 0 4px 12px rgba(2, 132, 199, 0.25);
}

.geo-pill-flag {
    width: 20px;
    height: 14px;
    border-radius: 3px;
    object-fit: cover;
    box-shadow: 0 1px 2px rgba(0, 0, 0, 0.2);
    border: 1px solid rgba(0, 0, 0, 0.1);
    background: #ffffff;
}

.geo-pill-label {
    font-weight: 700;
}

.geo-pill-count {
    font-size: 11px;
    padding: 1px 6px;
    border-radius: 10px;
    background: rgba(0, 0, 0, 0.06);
    color: inherit;
    font-weight: 800;
}

.geo-state-pill-btn.active .geo-pill-count {
    background: rgba(255, 255, 255, 0.25);
    color: #ffffff;
}

/* Barra de Resumo Macro */
.geo-executive-summary {
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap;
    gap: 14px;
    background: linear-gradient(135deg, rgba(2, 132, 199, 0.06) 0%, rgba(16, 185, 129, 0.04) 100%);
    border: 1px solid rgba(2, 132, 199, 0.2);
    border-radius: 12px;
    padding: 14px 18px;
    margin-bottom: 22px;
}

.geo-summary-main {
    display: flex;
    align-items: center;
    gap: 14px;
}

.geo-summary-flag {
    width: 44px;
    height: 30px;
    border-radius: 6px;
    object-fit: cover;
    box-shadow: 0 2px 6px rgba(0, 0, 0, 0.15);
    border: 1px solid rgba(0, 0, 0, 0.08);
    background: #ffffff;
}

.geo-summary-title {
    font-size: 14.5px;
    font-weight: 800;
    color: var(--text-color, #1e293b);
}

.geo-summary-sub {
    font-size: 12px;
    color: var(--text-muted, #64748b);
    margin-top: 2px;
}

.geo-summary-pills {
    display: flex;
    gap: 8px;
    flex-wrap: wrap;
}

.geo-summary-pill {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    background: var(--card-bg, #ffffff);
    border: 1px solid var(--border-color, #e2e8f0);
    padding: 4px 10px;
    border-radius: 20px;
    font-size: 11.5px;
    color: var(--text-color, #334155);
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.03);
}

.geo-summary-pill img {
    width: 18px;
    height: 12px;
    border-radius: 2px;
    object-fit: cover;
}

/* Seção dos Grandes Polos */
.geo-hubs-section {
    margin-bottom: 24px;
}

.geo-section-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 14px;
}

.geo-section-title {
    font-size: 15px;
    font-weight: 800;
    color: var(--text-color, #1e293b);
    margin: 0;
}

.geo-section-desc {
    font-size: 12px;
    color: var(--text-muted, #64748b);
    display: block;
    margin-top: 2px;
}

.geo-hubs-badge {
    font-size: 12px;
    font-weight: 800;
    color: #0369a1;
    background: #e0f2fe;
    padding: 4px 10px;
    border-radius: 12px;
}

.geo-hubs-grid {
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 16px;
}

@media (max-width: 1200px) {
    .geo-hubs-grid {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }
}

@media (max-width: 680px) {
    .geo-hubs-grid {
        grid-template-columns: 1fr;
    }
}

.geo-hub-card {
    background: var(--card-bg, #ffffff);
    border: 1px solid var(--border-color, #e2e8f0);
    border-radius: 12px;
    padding: 16px;
    box-shadow: 0 2px 6px rgba(0, 0, 0, 0.03);
    display: flex;
    flex-direction: column;
    gap: 12px;
    position: relative;
    overflow: hidden;
    transition: transform 0.2s ease, border-color 0.2s ease, box-shadow 0.2s ease;
}

.geo-hub-card:hover {
    transform: translateY(-3px);
    border-color: #0284c7;
    box-shadow: 0 10px 24px rgba(2, 132, 199, 0.08);
}

.geo-hub-top {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 8px;
}

.geo-hub-identity {
    display: flex;
    align-items: center;
    gap: 10px;
    min-width: 0;
}

.geo-hub-flag {
    width: 36px;
    height: 24px;
    border-radius: 4px;
    object-fit: cover;
    box-shadow: 0 1px 4px rgba(0, 0, 0, 0.18);
    border: 1px solid rgba(0, 0, 0, 0.08);
    flex-shrink: 0;
}

.geo-hub-title {
    font-size: 15px;
    font-weight: 800;
    color: var(--text-color, #1e293b);
    margin: 0;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.geo-hub-uf {
    font-size: 11px;
    color: var(--text-muted, #64748b);
    display: block;
    margin-top: 1px;
}

.geo-hub-badge {
    font-size: 12px;
    font-weight: 800;
    padding: 2px 8px;
    border-radius: 10px;
    background: rgba(2, 132, 199, 0.1);
    color: #0284c7;
}

.geo-hub-kpi-row {
    display: flex;
    justify-content: space-between;
    align-items: flex-end;
}

.geo-hub-kpi-main {
    display: flex;
    flex-direction: column;
}

.geo-hub-kpi-val {
    font-size: 24px;
    font-weight: 900;
    color: var(--text-color, #1e293b);
    line-height: 1.1;
    letter-spacing: -0.5px;
}

.geo-hub-kpi-lbl {
    font-size: 11px;
    text-transform: uppercase;
    color: var(--text-muted, #64748b);
    font-weight: 600;
    letter-spacing: 0.3px;
}

.geo-hub-pill-red {
    font-size: 11.5px;
    font-weight: 700;
    color: #dc2626;
    background: #fef2f2;
    border: 1px solid #fee2e2;
    padding: 3px 8px;
    border-radius: 6px;
}

.geo-hub-bar-bg {
    width: 100%;
    height: 5px;
    background: #f1f5f9;
    border-radius: 3px;
    overflow: hidden;
}

.geo-hub-bar-fill {
    height: 100%;
    background: linear-gradient(90deg, #0284c7, #38bdf8);
    border-radius: 3px;
}

.geo-hub-metrics {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 8px;
    background: rgba(0, 0, 0, 0.02);
    padding: 10px 12px;
    border-radius: 8px;
}

.geo-hub-metric-item {
    display: flex;
    flex-direction: column;
}

.geo-m-lbl {
    font-size: 10px;
    color: var(--text-muted, #64748b);
    text-transform: uppercase;
    font-weight: 600;
}

.geo-m-val {
    font-size: 12.5px;
    font-weight: 700;
    color: var(--text-color, #1e293b);
    margin-top: 1px;
}

/* Seção da Tabela Secundária */
.geo-secondary-section {
    background: var(--card-bg, #ffffff);
    border: 1px solid var(--border-color, #e2e8f0);
    border-radius: 12px;
    padding: 18px 20px;
}

.geo-secondary-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap;
    gap: 12px;
    margin-bottom: 16px;
}

.geo-table-controls {
    display: flex;
    gap: 10px;
}

.geo-search-box {
    position: relative;
    display: flex;
    align-items: center;
}

.geo-search-icon {
    position: absolute;
    left: 10px;
    font-size: 12px;
    opacity: 0.6;
    pointer-events: none;
}

.geo-search-input {
    padding: 7px 12px 7px 32px;
    border-radius: 8px;
    border: 1px solid var(--border-color, #cbd5e1);
    font-size: 12.5px;
    background: var(--card-bg, #ffffff);
    color: var(--text-color, #1e293b);
    outline: none;
    transition: border-color 0.2s ease, box-shadow 0.2s ease;
    width: 220px;
}

.geo-search-input:focus {
    border-color: #0284c7;
    box-shadow: 0 0 0 3px rgba(2, 132, 199, 0.12);
}

.geo-table-responsive {
    overflow-x: auto;
}

.geo-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 12.5px;
}

.geo-table th {
    text-align: left;
    padding: 10px 12px;
    background: rgba(0, 0, 0, 0.02);
    color: var(--text-muted, #64748b);
    font-weight: 700;
    font-size: 11px;
    text-transform: uppercase;
    border-bottom: 1px solid var(--border-color, #e2e8f0);
    white-space: nowrap;
}

.geo-table td {
    padding: 11px 12px;
    border-bottom: 1px solid var(--border-color, #f1f5f9);
    color: var(--text-color, #334155);
    vertical-align: middle;
}

.geo-table tr:hover td {
    background: rgba(2, 132, 199, 0.02);
}

.geo-table-flag {
    width: 26px;
    height: 18px;
    border-radius: 3px;
    object-fit: cover;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.15);
    border: 1px solid rgba(0, 0, 0, 0.08);
}

.geo-table-pct {
    font-weight: 700;
    color: #0284c7;
    background: #e0f2fe;
    padding: 2px 6px;
    border-radius: 6px;
    font-size: 11.5px;
}

.geo-clinic-badge {
    color: #dc2626;
    background: #fef2f2;
    padding: 2px 7px;
    border-radius: 6px;
    font-size: 11px;
    font-weight: 600;
}

/* Botões de Ação para Listar Usuários */
.geo-btn-users-banner {
    background: #0284c7;
    color: #ffffff !important;
    font-weight: 700;
    border-radius: 8px;
    padding: 7px 14px;
    border: none;
    box-shadow: 0 2px 6px rgba(2, 132, 199, 0.25);
    cursor: pointer;
    transition: all 0.2s ease;
    display: inline-flex;
    align-items: center;
    gap: 6px;
}

.geo-btn-users-banner:hover {
    background: #0369a1;
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(2, 132, 199, 0.35);
}

.geo-hub-card-footer {
    margin-top: auto;
    padding-top: 8px;
    border-top: 1px solid var(--border-color, #f1f5f9);
}

.geo-btn-users-card {
    width: 100%;
    background: #f0f9ff;
    color: #0284c7;
    border: 1px solid #bae6fd;
    font-weight: 700;
    border-radius: 8px;
    padding: 7px 12px;
    font-size: 12px;
    cursor: pointer;
    transition: all 0.2s ease;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
}

.geo-btn-users-card:hover {
    background: #0284c7;
    color: #ffffff !important;
    border-color: #0284c7;
    transform: translateY(-1px);
    box-shadow: 0 4px 10px rgba(2, 132, 199, 0.2);
}

.geo-btn-users-table {
    background: #f0f9ff;
    color: #0284c7;
    border: 1px solid #bae6fd;
    font-weight: 700;
    border-radius: 6px;
    padding: 4px 10px;
    font-size: 11.5px;
    cursor: pointer;
    transition: all 0.2s ease;
    white-space: nowrap;
    display: inline-flex;
    align-items: center;
    gap: 4px;
}

.geo-btn-users-table:hover {
    background: #0284c7;
    color: #ffffff !important;
    border-color: #0284c7;
}

/* Tooltip 3D Dinâmico Flutuante */
.brasil-3d-floating-tooltip {
    position: absolute;
    pointer-events: none;
    z-index: 999;
    opacity: 0;
    transform: translate(-50%, -115%) scale(0.95);
    transition: opacity 0.15s ease, transform 0.15s cubic-bezier(0.2, 1, 0.3, 1);
    background: rgba(10, 20, 38, 0.95);
    backdrop-filter: blur(14px);
    -webkit-backdrop-filter: blur(14px);
    border: 1.5px solid #38bdf8;
    box-shadow: 0 16px 36px rgba(0, 0, 0, 0.6), 0 0 25px rgba(56, 189, 248, 0.4);
    border-radius: 12px;
    padding: 14px 16px;
    min-width: 250px;
    max-width: 320px;
    color: #ffffff;
    font-family: inherit;
}

.brasil-3d-floating-tooltip.visible {
    opacity: 1;
    transform: translate(-50%, -115%) scale(1);
}

.brasil-3d-floating-tooltip::after {
    content: '';
    position: absolute;
    bottom: -8px;
    left: 50%;
    transform: translateX(-50%);
    border-width: 8px 8px 0;
    border-style: solid;
    border-color: #38bdf8 transparent transparent;
    display: block;
    width: 0;
}

.b3d-title {
    font-size: 14px;
    font-weight: 800;
    color: #38bdf8;
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 8px;
    padding-bottom: 6px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.12);
}

.b3d-badge {
    font-size: 10.5px;
    font-weight: 700;
    padding: 2px 7px;
    border-radius: 10px;
    background: rgba(56, 189, 248, 0.2);
    color: #7dd3fc;
}

.b3d-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 8px;
    margin-top: 6px;
}

.b3d-kpi {
    background: rgba(255, 255, 255, 0.05);
    padding: 6px 8px;
    border-radius: 6px;
    border: 1px solid rgba(255, 255, 255, 0.05);
}

.b3d-kpi-label {
    font-size: 10px;
    text-transform: uppercase;
    color: rgba(255, 255, 255, 0.6);
    font-weight: 600;
}

.b3d-kpi-val {
    font-size: 13px;
    font-weight: 800;
    color: #ffffff;
    margin-top: 1px;
}

.b3d-footer {
    margin-top: 10px;
    padding-top: 8px;
    border-top: 1px solid rgba(255, 255, 255, 0.08);
    font-size: 11px;
    color: #94a3b8;
    line-height: 1.35;
}

/* Responsive adjustments */
@media (max-width: 1400px) {
    .charts-grid-4col {
        grid-template-columns: repeat(2, minmax(0, 1fr));
        gap: 14px;
    }
}

@media (max-width: 1024px) {
    .app-sidebar {
        width: 72px;
    }
    .sidebar-brand span, .nav-section-title, .nav-item span, .user-info {
        display: none;
    }
    .sidebar-brand {
        padding: 0 16px;
        justify-content: center;
    }
    .nav-item {
        justify-content: center;
        padding: 12px;
    }
    .app-main {
        margin-left: 72px;
    }
    .charts-grid {
        grid-template-columns: 1fr;
    }
}

@media (max-width: 768px) {
    .charts-grid-4col {
        grid-template-columns: 1fr;
        gap: 12px;
    }
}

/* ============================================================
   ESTILOS PREMIUM & EXECUTIVOS — TELA DE LOGIN CORPORATIVO
   ============================================================ */

.login-overlay {
    position: fixed;
    inset: 0;
    z-index: 99999;
    display: none;
    align-items: center;
    justify-content: center;
    padding: 24px;
    background: radial-gradient(circle at 50% 20%, #0d2342 0%, #081528 50%, #040914 100%);
    backdrop-filter: blur(16px);
    overflow-y: auto;
}

.login-bg-glow {
    position: absolute;
    border-radius: 50%;
    filter: blur(90px);
    pointer-events: none;
    opacity: 0.45;
}

.login-bg-glow.glow-1 {
    width: 380px;
    height: 380px;
    background: radial-gradient(circle, rgba(2, 132, 199, 0.4) 0%, rgba(2, 132, 199, 0) 70%);
    top: 15%;
    left: 20%;
    animation: floatGlow1 8s ease-in-out infinite alternate;
}

.login-bg-glow.glow-2 {
    width: 340px;
    height: 340px;
    background: radial-gradient(circle, rgba(220, 38, 38, 0.25) 0%, rgba(220, 38, 38, 0) 70%);
    bottom: 15%;
    right: 20%;
    animation: floatGlow2 10s ease-in-out infinite alternate;
}

@keyframes floatGlow1 {
    0% { transform: translate(0, 0) scale(1); }
    100% { transform: translate(30px, 40px) scale(1.1); }
}

@keyframes floatGlow2 {
    0% { transform: translate(0, 0) scale(1); }
    100% { transform: translate(-30px, -30px) scale(1.15); }
}

.login-card {
    position: relative;
    width: 100%;
    max-width: 440px;
    background: #ffffff;
    border-radius: 24px;
    box-shadow: 0 25px 60px -15px rgba(0, 0, 0, 0.6),
                0 0 0 1px rgba(255, 255, 255, 0.15),
                0 10px 25px -5px rgba(15, 23, 42, 0.15);
    overflow: hidden;
    animation: loginCardAppear 0.4s cubic-bezier(0.16, 1, 0.3, 1);
}

@keyframes loginCardAppear {
    0% {
        opacity: 0;
        transform: scale(0.95) translateY(12px);
    }
    100% {
        opacity: 1;
        transform: scale(1) translateY(0);
    }
}

.login-card-header {
    padding: 36px 32px 18px 32px;
    text-align: center;
    background: linear-gradient(180deg, #f8fafc 0%, #ffffff 100%);
    border-bottom: 1px solid #f1f5f9;
}

.login-logo-wrap {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 10px 18px;
    background: #ffffff;
    border-radius: 14px;
    box-shadow: 0 4px 12px -2px rgba(15, 23, 42, 0.06), 0 0 0 1px #e2e8f0;
    margin-bottom: 16px;
}

.login-logo-img {
    height: 38px;
    width: auto;
    object-fit: contain;
}

.login-badge-wrap {
    margin-bottom: 10px;
}

.login-badge {
    display: inline-block;
    font-size: 10.5px;
    font-weight: 700;
    letter-spacing: 0.8px;
    text-transform: uppercase;
    color: #15335a;
    background: rgba(21, 51, 90, 0.08);
    border: 1px solid rgba(21, 51, 90, 0.15);
    padding: 3px 10px;
    border-radius: 20px;
}

.login-card-title {
    font-size: 20px;
    font-weight: 800;
    color: #0f172a;
    letter-spacing: -0.4px;
    margin: 0 0 6px 0;
}

.login-card-desc {
    font-size: 13px;
    color: #64748b;
    line-height: 1.45;
    margin: 0;
    padding: 0 8px;
}

.login-card-body {
    padding: 26px 32px 30px 32px;
}

.login-error-box {
    display: flex;
    align-items: center;
    gap: 10px;
    background: #fef2f2;
    border: 1px solid #fecaca;
    color: #b91c1c;
    padding: 12px 14px;
    border-radius: 12px;
    font-size: 12.5px;
    font-weight: 500;
    margin-bottom: 20px;
    line-height: 1.4;
    animation: shakeError 0.3s ease-in-out;
}

@keyframes shakeError {
    0%, 100% { transform: translateX(0); }
    25% { transform: translateX(-4px); }
    75% { transform: translateX(4px); }
}

.login-form {
    display: flex;
    flex-direction: column;
    gap: 18px;
}

.login-field-group {
    display: flex;
    flex-direction: column;
    gap: 6px;
}

.login-field-label {
    font-size: 12.5px;
    font-weight: 600;
    color: #334155;
    letter-spacing: -0.1px;
}

.login-label-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.login-input-wrapper {
    position: relative;
    display: flex;
    align-items: center;
    width: 100%;
}

.login-input-icon {
    position: absolute;
    left: 14px;
    display: flex;
    align-items: center;
    justify-content: center;
    color: #94a3b8;
    pointer-events: none;
    transition: color 0.15s ease;
}

.login-input {
    width: 100%;
    height: 48px;
    padding: 0 42px 0 42px;
    font-size: 14px;
    font-weight: 500;
    color: #0f172a;
    background: #f8fafc;
    border: 1.5px solid #e2e8f0;
    border-radius: 12px;
    outline: none;
    transition: all 0.2s cubic-bezier(0.16, 1, 0.3, 1);
    box-sizing: border-box;
}

.login-input::placeholder {
    color: #94a3b8;
    font-weight: 400;
}

.login-input:hover {
    background: #ffffff;
    border-color: #cbd5e1;
}

.login-input:focus {
    background: #ffffff;
    border-color: #15335a;
    box-shadow: 0 0 0 4px rgba(21, 51, 90, 0.1);
}

.login-input:focus + .login-input-icon,
.login-input-wrapper:focus-within .login-input-icon {
    color: #15335a;
}

.login-toggle-pass {
    position: absolute;
    right: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    width: 32px;
    height: 32px;
    background: transparent;
    border: none;
    border-radius: 8px;
    color: #94a3b8;
    cursor: pointer;
    transition: all 0.15s ease;
    padding: 0;
}

.login-toggle-pass:hover {
    color: #334155;
    background: #f1f5f9;
}

.login-submit-btn {
    width: 100%;
    height: 48px;
    margin-top: 6px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    font-size: 14px;
    font-weight: 700;
    color: #ffffff;
    background: linear-gradient(135deg, #15335a 0%, #1e3a5f 100%);
    border: none;
    border-radius: 12px;
    cursor: pointer;
    box-shadow: 0 10px 22px -6px rgba(21, 51, 90, 0.4),
                0 2px 4px rgba(0, 0, 0, 0.06);
    transition: all 0.2s cubic-bezier(0.16, 1, 0.3, 1);
}

.login-submit-btn:hover {
    background: linear-gradient(135deg, #102746 0%, #173050 100%);
    box-shadow: 0 14px 26px -6px rgba(21, 51, 90, 0.5),
                0 4px 8px rgba(0, 0, 0, 0.08);
    transform: translateY(-1px);
}

.login-submit-btn:active {
    transform: scale(0.985);
    box-shadow: 0 4px 10px -2px rgba(21, 51, 90, 0.3);
}

.login-footer {
    margin-top: 24px;
    padding-top: 18px;
    border-top: 1px solid #f1f5f9;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
}

.login-partner-badge {
    display: flex;
    align-items: center;
    gap: 6px;
}

.login-partner-badge .partner-txt {
    font-size: 11px;
    font-weight: 500;
    color: #94a3b8;
}

.login-partner-badge .partner-logo {
    height: 14px;
    width: auto;
    opacity: 0.85;
}

.login-security-tag {
    display: flex;
    align-items: center;
    gap: 5px;
    font-size: 11px;
    font-weight: 600;
    color: #059669;
}

@media (max-width: 480px) {
    .login-card {
        border-radius: 20px;
    }
    .login-card-header {
        padding: 28px 20px 14px 20px;
    }
    .login-card-body {
        padding: 20px 20px 24px 20px;
    }
    .login-logo-img {
        height: 32px;
    }
    .login-card-title {
        font-size: 18px;
    }
    .login-footer {
        flex-direction: column;
        gap: 8px;
        align-items: center;
    }
}

/* ============================================================
   RESPONSIVIDADE MOBILE NATIVA (TOP BAR, DRAWER, BOTTOM NAV)
   ============================================================ */

/* Elementos mobile ocultos no Desktop */
.mobile-top-bar,
.mobile-bottom-nav,
.mobile-sidebar-backdrop,
.mobile-sidebar-close-btn {
    display: none;
}

@media (max-width: 768px) {
    /* Barra Superior Mobile */
    .mobile-top-bar {
        display: flex;
        align-items: center;
        justify-content: space-between;
        position: fixed;
        top: 0;
        left: 0;
        right: 0;
        height: 60px;
        padding: 0 16px;
        background: #15335a;
        color: #ffffff;
        z-index: 1000;
        box-shadow: 0 2px 10px rgba(0, 0, 0, 0.2);
        border-bottom: 1px solid rgba(255, 255, 255, 0.1);
    }

    .mobile-menu-btn {
        background: transparent;
        border: none;
        color: #ffffff;
        width: 40px;
        height: 40px;
        border-radius: 8px;
        display: flex;
        align-items: center;
        justify-content: center;
        cursor: pointer;
    }
    .mobile-menu-btn:active {
        background: rgba(255, 255, 255, 0.1);
    }

    .mobile-brand {
        display: flex;
        align-items: center;
        justify-content: center;
    }

    .mobile-logo-img {
        height: 28px;
        width: auto;
        filter: brightness(0) invert(1);
    }

    .mobile-user-trigger {
        cursor: pointer;
    }

    /* Backdrop da Sidebar */
    .mobile-sidebar-backdrop {
        position: fixed;
        inset: 0;
        background: rgba(0, 0, 0, 0.65);
        backdrop-filter: blur(4px);
        z-index: 1100;
        opacity: 0;
        pointer-events: none;
        transition: opacity 0.3s ease;
    }
    .mobile-sidebar-backdrop.active {
        display: block;
        opacity: 1;
        pointer-events: auto;
    }

    /* Sidebar como Drawer Deslizante no Mobile */
    .app-sidebar {
        position: fixed !important;
        top: 0;
        left: 0;
        bottom: 0;
        width: 280px !important;
        z-index: 1200;
        transform: translateX(-100%);
        transition: transform 0.3s cubic-bezier(0.16, 1, 0.3, 1);
        box-shadow: 10px 0 30px rgba(0, 0, 0, 0.5);
    }
    .app-sidebar.active {
        transform: translateX(0);
    }

    .sidebar-brand span, 
    .nav-section-title, 
    .nav-item span, 
    .user-info {
        display: block !important;
    }

    .mobile-sidebar-close-btn {
        display: block;
        background: rgba(255, 255, 255, 0.1);
        border: none;
        color: #ffffff;
        font-size: 16px;
        width: 32px;
        height: 32px;
        border-radius: 8px;
        cursor: pointer;
    }

    /* Área Principal com espaço para Top Bar e Bottom Nav */
    .app-main {
        margin-left: 0 !important;
        padding: 72px 14px 80px 14px !important;
        width: 100% !important;
        min-height: 100vh;
    }

    /* Barra de Navegação Inferior (App Style) */
    .mobile-bottom-nav {
        display: flex;
        align-items: center;
        justify-content: space-around;
        position: fixed;
        bottom: 0;
        left: 0;
        right: 0;
        height: 64px;
        background: #ffffff;
        border-top: 1px solid #e2e8f0;
        box-shadow: 0 -4px 20px rgba(0, 0, 0, 0.08);
        z-index: 999;
        padding-bottom: env(safe-area-inset-bottom, 0);
    }

    .mobile-nav-item {
        display: flex;
        flex-direction: column;
        align-items: center;
        justify-content: center;
        gap: 3px;
        color: #64748b;
        text-decoration: none;
        font-size: 11px;
        font-weight: 600;
        flex: 1;
        height: 100%;
        cursor: pointer;
        transition: all 0.15s ease;
    }

    .mobile-nav-item.active {
        color: #15335a;
    }

    .mobile-nav-item.active .mobile-nav-icon {
        color: #15335a;
        transform: translateY(-2px);
    }

    .mobile-nav-icon {
        display: flex;
        align-items: center;
        justify-content: center;
        transition: transform 0.15s ease;
    }

    /* Headers de Página */
    .header-content {
        flex-direction: column;
        align-items: flex-start;
        gap: 12px;
    }
    .header-actions {
        width: 100%;
        display: flex;
        justify-content: flex-start;
        flex-wrap: wrap;
        gap: 8px;
    }
    .header-actions .btn {
        flex: 1;
        justify-content: center;
    }

    /* Filtros Mobile */
    .filter-grid {
        grid-template-columns: 1fr !important;
        gap: 12px;
    }
    .filter-actions {
        flex-direction: column;
        gap: 8px;
    }
    .filter-actions .btn {
        width: 100%;
        justify-content: center;
    }

    /* Cards e Tabelas */
    .card {
        padding: 16px !important;
        border-radius: 16px !important;
        margin-bottom: 16px !important;
    }

    .table-container {
        overflow-x: auto;
        -webkit-overflow-scrolling: touch;
        border-radius: 12px;
    }

    /* Modais como Bottom Sheet no celular */
    .modal-overlay {
        padding: 0 !important;
        align-items: flex-end !important;
    }

    .modal-card {
        width: 100% !important;
        max-width: 100% !important;
        max-height: 90vh !important;
        border-radius: 24px 24px 0 0 !important;
        margin: 0 !important;
        animation: mobileModalSlideUp 0.3s cubic-bezier(0.16, 1, 0.3, 1) !important;
    }

    @keyframes mobileModalSlideUp {
        0% { transform: translateY(100%); }
        100% { transform: translateY(0); }
    }

    .modal-header {
        padding: 18px 20px !important;
    }

    .modal-body {
        padding: 18px 20px 30px 20px !important;
        max-height: calc(90vh - 80px) !important;
        overflow-y: auto !important;
    }

    /* Gráficos e Painéis BI */
    .charts-grid-4col {
        grid-template-columns: 1fr !important;
    }
    .kpi-grid {
        grid-template-columns: repeat(2, minmax(0, 1fr)) !important;
        gap: 10px !important;
    }
    .kpi-card {
        padding: 14px !important;
    }
    .kpi-value {
        font-size: 20px !important;
    }

    /* Seletor de Estados no BI */
    .geo-state-pills-bar {
        overflow-x: auto;
        -webkit-overflow-scrolling: touch;
        padding-bottom: 6px;
        flex-wrap: nowrap !important;
    }
}

