/* ==========================================================================
   CSS DESIGN SYSTEM — TODA SC (DESBRAVANDO A TERRA)
   Aventureiro • Moderno • Premium • Responsivo • Mobile-First
   ========================================================================== */

:root {
    /* Cores de Fundo e Superfície */
    --bg-main: #060913;
    --bg-secondary: #0b1120;
    --bg-card: rgba(15, 23, 42, 0.88);
    --bg-card-hover: rgba(30, 41, 59, 0.95);
    --bg-glass: rgba(15, 23, 42, 0.75);
    --border-color: rgba(255, 255, 255, 0.08);
    --border-highlight: rgba(234, 88, 12, 0.4);

    /* Tipografia */
    --text-primary: #f8fafc;
    --text-secondary: #94a3b8;
    --text-muted: #64748b;
    --text-inverted: #0f172a;

    /* Acentos e Status */
    --accent-orange: #ea580c;
    --accent-orange-light: #fb923c;
    --accent-gold: #f59e0b;
    --accent-gold-light: #fbbf24;
    --accent-emerald: #10b981;
    --accent-emerald-light: #34d399;
    --accent-blue: #2563eb;
    --accent-cyan: #06b6d4;
    --accent-purple: #8b5cf6;
    --accent-red: #ef4444;

    /* Gradientes */
    --gradient-hero: linear-gradient(135deg, #ea580c 0%, #f59e0b 100%);
    --gradient-emerald: linear-gradient(135deg, #059669 0%, #10b981 100%);
    --gradient-blue: linear-gradient(135deg, #1d4ed8 0%, #38bdf8 100%);
    --gradient-card: linear-gradient(180deg, rgba(30, 41, 59, 0.6) 0%, rgba(15, 23, 42, 0.9) 100%);

    /* Fontes */
    --font-titles: 'Outfit', sans-serif;
    --font-text: 'Plus Jakarta Sans', sans-serif;
    --font-mono: 'JetBrains Mono', monospace;

    /* Raios e Sombras */
    --radius-sm: 8px;
    --radius-md: 12px;
    --radius-lg: 20px;
    --radius-xl: 28px;
    --shadow-subtle: 0 4px 20px rgba(0, 0, 0, 0.4);
    --shadow-glow-orange: 0 0 25px rgba(234, 88, 12, 0.35);
    --shadow-glow-emerald: 0 0 25px rgba(16, 185, 129, 0.35);
    --shadow-glow-gold: 0 0 25px rgba(245, 158, 11, 0.35);

    /* Dimensões */
    --header-height: 68px;
    --sidebar-width: 460px;
    --mobile-nav-height: 64px;

    --transition-fast: all 0.15s ease;
    --transition-smooth: all 0.28s cubic-bezier(0.4, 0, 0.2, 1);
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    -webkit-tap-highlight-color: transparent;
}

body.app-body {
    background-color: var(--bg-main);
    color: var(--text-primary);
    font-family: var(--font-text);
    height: 100vh;
    width: 100vw;
    overflow: hidden;
    display: flex;
    flex-direction: column;
}

/* Scrollbars personalizadas */
::-webkit-scrollbar {
    width: 6px;
    height: 6px;
}
::-webkit-scrollbar-track {
    background: transparent;
}
::-webkit-scrollbar-thumb {
    background: rgba(255, 255, 255, 0.12);
    border-radius: 999px;
}
::-webkit-scrollbar-thumb:hover {
    background: rgba(255, 255, 255, 0.25);
}

/* ==========================================================================
   APP HEADER
   ========================================================================== */
.app-header {
    height: var(--header-height);
    background: rgba(6, 9, 19, 0.94);
    backdrop-filter: blur(16px);
    -webkit-backdrop-filter: blur(16px);
    border-bottom: 1px solid var(--border-color);
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0 1.25rem;
    z-index: 1000;
    flex-shrink: 0;
    gap: 1rem;
}

.header-left {
    display: flex;
    align-items: center;
    gap: 1rem;
    flex-shrink: 0;
}

.brand-link {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    text-decoration: none;
    color: inherit;
    transition: var(--transition-fast);
}
.brand-link:hover .brand-icon {
    transform: rotate(45deg);
}

.brand-icon {
    width: 40px;
    height: 40px;
    background: var(--gradient-hero);
    border-radius: var(--radius-sm);
    display: flex;
    align-items: center;
    justify-content: center;
    color: #fff;
    box-shadow: 0 4px 15px rgba(234, 88, 12, 0.4);
    transition: transform 0.4s cubic-bezier(0.34, 1.56, 0.64, 1);
    flex-shrink: 0;
}
.brand-icon i {
    width: 22px;
    height: 22px;
}

.brand-info {
    display: flex;
    flex-direction: column;
}
.brand-sub {
    font-size: 0.65rem;
    font-weight: 700;
    letter-spacing: 1.2px;
    color: var(--accent-orange);
    text-transform: uppercase;
    white-space: nowrap;
}
.brand-title {
    font-family: var(--font-titles);
    font-size: 1.4rem;
    font-weight: 800;
    line-height: 1.1;
    background: linear-gradient(135deg, #ffffff 40%, #cbd5e1 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    white-space: nowrap;
}

.badge-expedicao {
    display: inline-flex;
    align-items: center;
    gap: 0.45rem;
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid var(--border-color);
    padding: 0.35rem 0.75rem;
    border-radius: 999px;
    font-size: 0.75rem;
    color: var(--text-secondary);
    white-space: nowrap;
}
.badge-expedicao strong {
    color: var(--accent-gold);
}

.pulse-dot {
    width: 7px;
    height: 7px;
    background-color: var(--accent-emerald);
    border-radius: 50%;
    box-shadow: 0 0 8px var(--accent-emerald);
    animation: pulse 2s infinite;
}
@keyframes pulse {
    0% { transform: scale(0.95); box-shadow: 0 0 0 0 rgba(16, 185, 129, 0.7); }
    70% { transform: scale(1); box-shadow: 0 0 0 6px rgba(16, 185, 129, 0); }
    100% { transform: scale(0.95); box-shadow: 0 0 0 0 rgba(16, 185, 129, 0); }
}

/* Header Progress Strip (Desktop) */
.header-progress {
    flex: 1;
    max-width: 360px;
    display: flex;
    flex-direction: column;
    gap: 0.3rem;
}
.progress-info-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    font-size: 0.75rem;
}
.progress-label {
    display: inline-flex;
    align-items: center;
    gap: 0.35rem;
    color: var(--text-secondary);
}
.progress-label i {
    width: 13px;
    height: 13px;
    color: var(--accent-orange);
}
.progress-percent {
    font-family: var(--font-mono);
    font-weight: 700;
    color: var(--accent-emerald);
    font-size: 0.85rem;
}
.progress-counts {
    color: var(--text-muted);
    font-size: 0.72rem;
}
.progress-bar-track {
    width: 100%;
    height: 6px;
    background: rgba(255, 255, 255, 0.08);
    border-radius: 999px;
    overflow: hidden;
    position: relative;
}
.progress-bar-fill {
    height: 100%;
    background: var(--gradient-emerald);
    border-radius: 999px;
    transition: width 0.6s cubic-bezier(0.34, 1.56, 0.64, 1);
    box-shadow: 0 0 10px rgba(16, 185, 129, 0.6);
}

/* Header Actions */
.header-actions {
    display: flex;
    align-items: center;
    gap: 0.6rem;
    flex-shrink: 0;
}
.btn-action {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.45rem;
    padding: 0.55rem 0.95rem;
    border-radius: var(--radius-md);
    font-size: 0.82rem;
    font-weight: 600;
    cursor: pointer;
    border: none;
    transition: var(--transition-smooth);
    white-space: nowrap;
    position: relative;
}
.btn-action i {
    width: 16px;
    height: 16px;
}
.btn-action.btn-gold {
    background: var(--gradient-hero);
    color: #fff;
    box-shadow: 0 4px 15px rgba(234, 88, 12, 0.3);
}
.btn-action.btn-gold:hover {
    transform: translateY(-1px);
    box-shadow: 0 6px 20px rgba(234, 88, 12, 0.45);
}
.btn-action.btn-outline {
    background: rgba(255, 255, 255, 0.04);
    border: 1px solid var(--border-color);
    color: var(--text-primary);
}
.btn-action.btn-outline:hover {
    background: rgba(255, 255, 255, 0.08);
    border-color: rgba(255, 255, 255, 0.2);
}
.btn-action.btn-outline-danger {
    background: rgba(239, 68, 68, 0.1);
    border: 1px solid rgba(239, 68, 68, 0.3);
    color: var(--accent-red);
}
.btn-action.btn-outline-danger:hover {
    background: rgba(239, 68, 68, 0.2);
}
.btn-action.btn-sm {
    padding: 0.4rem 0.75rem;
    font-size: 0.75rem;
}
.badge-count {
    background: var(--accent-gold);
    color: #000;
    font-size: 0.68rem;
    font-weight: 800;
    padding: 0.1rem 0.4rem;
    border-radius: 999px;
    margin-left: 0.2rem;
}

/* ==========================================================================
   APP MAIN LAYOUT (SIDEBAR + MAP)
   ========================================================================== */
.app-main {
    flex: 1;
    display: flex;
    overflow: hidden;
    position: relative;
}

/* ==========================================================================
   SIDEBAR
   ========================================================================== */
.app-sidebar {
    width: var(--sidebar-width);
    background: var(--bg-secondary);
    border-right: 1px solid var(--border-color);
    display: flex;
    flex-direction: column;
    z-index: 500;
    flex-shrink: 0;
    position: relative;
    transition: transform 0.3s ease;
}

/* Drawer Handle (Mobile Only) */
.drawer-handle-bar {
    display: none;
    width: 100%;
    padding: 0.75rem 0 0.35rem 0;
    align-items: center;
    justify-content: center;
    cursor: grab;
    background: var(--bg-secondary);
    touch-action: none;
}
.drawer-handle-pill {
    width: 44px;
    height: 5px;
    background: rgba(255, 255, 255, 0.2);
    border-radius: 999px;
}

/* Sidebar Navigation Tabs */
.sidebar-tabs {
    display: flex;
    border-bottom: 1px solid var(--border-color);
    background: rgba(11, 17, 32, 0.98);
    padding: 0.35rem 0.4rem 0 0.4rem;
    gap: 0.25rem;
    flex-shrink: 0;
}
.tab-btn {
    flex: 1;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.3rem;
    padding: 0.65rem 0.35rem;
    background: transparent;
    border: none;
    color: var(--text-muted);
    font-size: 0.78rem;
    font-weight: 600;
    cursor: pointer;
    border-bottom: 2px solid transparent;
    transition: var(--transition-fast);
    border-radius: var(--radius-sm) var(--radius-sm) 0 0;
    white-space: nowrap;
}
.tab-btn i {
    width: 14px;
    height: 14px;
    flex-shrink: 0;
}
.tab-btn:hover {
    color: var(--text-primary);
    background: rgba(255, 255, 255, 0.03);
}
.tab-btn.active {
    color: var(--accent-orange);
    border-bottom-color: var(--accent-orange);
    background: rgba(234, 88, 12, 0.06);
}
.tab-counter {
    background: rgba(255, 255, 255, 0.08);
    color: var(--text-secondary);
    font-size: 0.65rem;
    font-weight: 700;
    padding: 0.05rem 0.35rem;
    border-radius: 999px;
}
.tab-btn.active .tab-counter {
    background: var(--accent-orange);
    color: #fff;
}

/* Sidebar Scrollable Content */
.sidebar-content {
    flex: 1;
    overflow-y: auto;
    overflow-x: hidden;
    display: flex;
    flex-direction: column;
}

.tab-pane {
    display: none;
    flex-direction: column;
    padding: 1.25rem;
    gap: 1.15rem;
}
.tab-pane.active {
    display: flex;
}

/* Pane Header */
.pane-header {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 0.75rem;
}
.pane-title-group {
    display: flex;
    flex-direction: column;
    min-width: 0;
}
.pane-title {
    font-family: var(--font-titles);
    font-size: 1.25rem;
    font-weight: 700;
    color: #fff;
    white-space: nowrap;
}
.pane-subtitle {
    font-size: 0.78rem;
    color: var(--text-secondary);
    margin-top: 0.15rem;
}
.pane-controls {
    display: flex;
    align-items: center;
    gap: 0.4rem;
    flex-shrink: 0;
}
.btn-tool {
    display: inline-flex;
    align-items: center;
    gap: 0.35rem;
    padding: 0.45rem 0.75rem;
    border-radius: var(--radius-sm);
    font-size: 0.75rem;
    font-weight: 600;
    cursor: pointer;
    border: none;
    transition: var(--transition-fast);
}
.btn-tool i {
    width: 14px;
    height: 14px;
}
.btn-tool-primary {
    background: rgba(234, 88, 12, 0.15);
    border: 1px solid rgba(234, 88, 12, 0.4);
    color: var(--accent-orange);
}
.btn-tool-primary:hover {
    background: var(--accent-orange);
    color: #fff;
}
.btn-tool-danger {
    background: rgba(239, 68, 68, 0.1);
    border: 1px solid rgba(239, 68, 68, 0.3);
    color: var(--accent-red);
}
.btn-tool-danger:hover {
    background: var(--accent-red);
    color: #fff;
}

/* Route Summary Card */
.route-summary-card {
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-md);
    padding: 0.85rem 1.25rem;
    display: flex;
    align-items: center;
    justify-content: space-around;
    backdrop-filter: blur(12px);
    box-shadow: var(--shadow-subtle);
}
.summary-metric {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 0.15rem;
}
.summary-metric .metric-val {
    font-family: var(--font-titles);
    font-size: 1.15rem;
    font-weight: 800;
    color: var(--text-primary);
}
.summary-metric .metric-label {
    font-size: 0.68rem;
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: 0.5px;
}
.summary-divider {
    width: 1px;
    height: 28px;
    background: var(--border-color);
}
.geo-disclaimer {
    display: flex;
    align-items: flex-start;
    gap: 0.45rem;
    font-size: 0.7rem;
    color: var(--text-muted);
    background: rgba(255, 255, 255, 0.02);
    padding: 0.45rem 0.75rem;
    border-radius: var(--radius-sm);
    line-height: 1.35;
}
.geo-disclaimer i {
    width: 14px;
    height: 14px;
    flex-shrink: 0;
    margin-top: 1px;
}

/* ==========================================================================
   ITINERARY LIST (SORTABLE)
   ========================================================================== */
.itinerary-list {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
    min-height: 80px;
}

.itinerary-item {
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-md);
    padding: 0.65rem 0.85rem;
    display: flex;
    align-items: center;
    gap: 0.75rem;
    transition: var(--transition-fast);
    position: relative;
    user-select: none;
}
.itinerary-item:hover {
    border-color: rgba(255, 255, 255, 0.18);
    background: var(--bg-card-hover);
}
.itinerary-item.visited {
    border-left: 3px solid var(--accent-emerald);
}
.itinerary-item.planned {
    border-left: 3px solid var(--accent-gold);
}

.item-drag-handle {
    cursor: grab;
    color: var(--text-muted);
    padding: 0.2rem;
    display: flex;
    align-items: center;
    transition: color 0.15s;
}
.item-drag-handle:hover {
    color: var(--text-primary);
}
.item-drag-handle i {
    width: 16px;
    height: 16px;
}

.item-step-num {
    width: 24px;
    height: 24px;
    background: rgba(255, 255, 255, 0.08);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 0.7rem;
    font-weight: 700;
    font-family: var(--font-mono);
    color: var(--text-secondary);
    flex-shrink: 0;
}
.itinerary-item.visited .item-step-num {
    background: var(--accent-emerald);
    color: #fff;
}
.itinerary-item.planned .item-step-num {
    background: var(--accent-gold);
    color: #000;
}

.item-info {
    flex: 1;
    display: flex;
    flex-direction: column;
    min-width: 0;
    cursor: pointer;
}
.item-city-name {
    font-size: 0.88rem;
    font-weight: 700;
    color: var(--text-primary);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}
.item-meta {
    display: flex;
    align-items: center;
    gap: 0.45rem;
    font-size: 0.7rem;
    color: var(--text-muted);
}
.item-region-pill {
    background: rgba(255, 255, 255, 0.05);
    padding: 0.05rem 0.35rem;
    border-radius: 4px;
    font-size: 0.65rem;
}
.item-dist-badge {
    color: var(--accent-orange);
    font-family: var(--font-mono);
}

.item-actions {
    display: flex;
    align-items: center;
    gap: 0.25rem;
}
.btn-item-action {
    width: 26px;
    height: 26px;
    border-radius: var(--radius-sm);
    background: transparent;
    border: none;
    color: var(--text-muted);
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: var(--transition-fast);
}
.btn-item-action:hover {
    background: rgba(255, 255, 255, 0.08);
    color: var(--text-primary);
}
.btn-item-action.btn-del:hover {
    background: rgba(239, 68, 68, 0.2);
    color: var(--accent-red);
}
.btn-item-action i {
    width: 14px;
    height: 14px;
}

/* Empty State */
.empty-state {
    display: flex;
    flex-direction: column;
    align-items: center;
    text-align: center;
    padding: 2.5rem 1.5rem;
    background: var(--bg-card);
    border: 1px dashed var(--border-color);
    border-radius: var(--radius-lg);
    gap: 0.85rem;
}
.empty-icon {
    width: 56px;
    height: 56px;
    border-radius: 50%;
    background: rgba(234, 88, 12, 0.1);
    color: var(--accent-orange);
    display: flex;
    align-items: center;
    justify-content: center;
    margin-bottom: 0.25rem;
}
.empty-icon i {
    width: 28px;
    height: 28px;
}
.empty-state h3 {
    font-family: var(--font-titles);
    font-size: 1.15rem;
    color: #fff;
}
.empty-state p {
    font-size: 0.82rem;
    color: var(--text-secondary);
    line-height: 1.45;
    max-width: 320px;
}
.empty-actions {
    display: flex;
    flex-direction: column;
    gap: 0.6rem;
    width: 100%;
    max-width: 280px;
    margin-top: 0.5rem;
}

/* ==========================================================================
   TAB 2: EXPLORADOR DE CIDADES & FILTROS
   ========================================================================== */
.search-box-wrapper {
    position: relative;
    display: flex;
    align-items: center;
    width: 100%;
}
.search-icon {
    position: absolute;
    left: 1rem;
    width: 18px;
    height: 18px;
    color: var(--text-muted);
    pointer-events: none;
}
#city-search-input {
    width: 100%;
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-md);
    padding: 0.75rem 2.5rem 0.75rem 2.6rem;
    color: var(--text-primary);
    font-size: 0.85rem;
    font-family: inherit;
    outline: none;
    transition: var(--transition-fast);
}
#city-search-input:focus {
    border-color: var(--accent-orange);
    box-shadow: 0 0 15px rgba(234, 88, 12, 0.2);
}
.btn-icon-clear {
    position: absolute;
    right: 0.75rem;
    background: transparent;
    border: none;
    color: var(--text-muted);
    cursor: pointer;
    padding: 0.2rem;
}
.btn-icon-clear i {
    width: 16px;
    height: 16px;
}

/* Filters */
.filters-panel {
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
    background: rgba(15, 23, 42, 0.5);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-md);
    padding: 0.85rem;
}
.filter-group {
    display: flex;
    flex-direction: column;
    gap: 0.35rem;
}
.filter-title {
    font-size: 0.7rem;
    font-weight: 700;
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: 0.5px;
}
.filter-chips {
    display: flex;
    flex-wrap: wrap;
    gap: 0.35rem;
}
.filter-chip {
    background: rgba(255, 255, 255, 0.04);
    border: 1px solid var(--border-color);
    color: var(--text-secondary);
    padding: 0.3rem 0.65rem;
    border-radius: 999px;
    font-size: 0.72rem;
    font-weight: 500;
    cursor: pointer;
    transition: var(--transition-fast);
}
.filter-chip:hover {
    background: rgba(255, 255, 255, 0.08);
    color: var(--text-primary);
}
.filter-chip.active {
    background: var(--accent-orange);
    border-color: var(--accent-orange);
    color: #fff;
    font-weight: 600;
}
.filter-chip.chip-visited.active {
    background: var(--accent-emerald);
    border-color: var(--accent-emerald);
}
.filter-chip.chip-planned.active {
    background: var(--accent-gold);
    border-color: var(--accent-gold);
    color: #000;
}

.filter-sort-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding-top: 0.45rem;
    border-top: 1px solid var(--border-color);
    font-size: 0.75rem;
}
.sort-label {
    color: var(--text-muted);
}
.sort-select {
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid var(--border-color);
    color: var(--text-primary);
    padding: 0.25rem 0.5rem;
    border-radius: var(--radius-sm);
    font-size: 0.75rem;
    outline: none;
}
.results-counter {
    color: var(--text-muted);
    font-family: var(--font-mono);
    font-size: 0.7rem;
}

/* Cities Catalog List */
.cities-catalog-list {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}
.catalog-city-card {
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-md);
    padding: 0.75rem 0.95rem;
    display: flex;
    align-items: center;
    justify-content: space-between;
    transition: var(--transition-fast);
    cursor: pointer;
}
.catalog-city-card:hover {
    border-color: rgba(255, 255, 255, 0.2);
    background: var(--bg-card-hover);
    transform: translateX(2px);
}
.catalog-city-card.status-visited {
    border-left: 3px solid var(--accent-emerald);
}
.catalog-city-card.status-planned {
    border-left: 3px solid var(--accent-gold);
}

.catalog-card-left {
    display: flex;
    flex-direction: column;
    gap: 0.15rem;
}
.catalog-card-title {
    font-size: 0.9rem;
    font-weight: 700;
    color: var(--text-primary);
}
.catalog-card-meta {
    display: flex;
    align-items: center;
    gap: 0.45rem;
    font-size: 0.7rem;
    color: var(--text-muted);
}

.catalog-card-actions {
    display: flex;
    align-items: center;
    gap: 0.35rem;
}
.btn-card-toggle {
    padding: 0.35rem 0.65rem;
    border-radius: var(--radius-sm);
    font-size: 0.7rem;
    font-weight: 600;
    border: 1px solid var(--border-color);
    background: rgba(255, 255, 255, 0.04);
    color: var(--text-secondary);
    cursor: pointer;
    transition: var(--transition-fast);
    display: inline-flex;
    align-items: center;
    gap: 0.25rem;
}
.btn-card-toggle:hover {
    background: rgba(255, 255, 255, 0.1);
    color: var(--text-primary);
}
.btn-card-toggle.in-route {
    background: rgba(245, 158, 11, 0.15);
    border-color: rgba(245, 158, 11, 0.4);
    color: var(--accent-gold);
}
.btn-card-toggle.is-visited {
    background: rgba(16, 185, 129, 0.15);
    border-color: rgba(16, 185, 129, 0.4);
    color: var(--accent-emerald);
}

/* ==========================================================================
   TAB 3: MINHA EXPEDIÇÃO & ESTATÍSTICAS
   ========================================================================== */
.expedition-hero-card {
    background: var(--gradient-card);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-lg);
    padding: 1.5rem;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 1.25rem;
    box-shadow: var(--shadow-subtle);
    position: relative;
    overflow: hidden;
}
.expedition-hero-card::before {
    content: '';
    position: absolute;
    top: -50px;
    right: -50px;
    width: 140px;
    height: 140px;
    background: radial-gradient(circle, rgba(234, 88, 12, 0.2) 0%, transparent 70%);
    border-radius: 50%;
}

.hero-progress-ring-container {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
}
.hero-percent-large {
    font-family: var(--font-titles);
    font-size: 3rem;
    font-weight: 900;
    line-height: 1;
    background: linear-gradient(135deg, #10b981 0%, #34d399 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
}
.hero-percent-caption {
    font-size: 0.8rem;
    font-weight: 600;
    letter-spacing: 1px;
    text-transform: uppercase;
    color: var(--text-secondary);
    margin-top: 0.2rem;
}

.hero-stats-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 0.6rem;
    width: 100%;
}
.hero-stat-box {
    background: rgba(255, 255, 255, 0.03);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-md);
    padding: 0.75rem 0.5rem;
    display: flex;
    flex-direction: column;
    align-items: center;
    text-align: center;
    gap: 0.15rem;
}
.hero-stat-box .stat-number {
    font-family: var(--font-titles);
    font-size: 1.2rem;
    font-weight: 800;
}
.hero-stat-box .stat-name {
    font-size: 0.65rem;
    color: var(--text-muted);
    text-transform: uppercase;
}
.hero-stat-box.stat-green .stat-number { color: var(--accent-emerald); }
.hero-stat-box.stat-gold .stat-number { color: var(--accent-gold); }
.hero-stat-box.stat-slate .stat-number { color: var(--text-secondary); }
.hero-stat-box.stat-blue .stat-number { color: var(--accent-cyan); }

/* Section Cards */
.section-card {
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-lg);
    padding: 1.25rem;
    display: flex;
    flex-direction: column;
    gap: 0.85rem;
}
.section-card-header {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    color: var(--accent-orange);
}
.section-card-header i {
    width: 18px;
    height: 18px;
}
.section-card-header h3 {
    font-family: var(--font-titles);
    font-size: 1.05rem;
    font-weight: 700;
    color: #fff;
}
.card-desc {
    font-size: 0.78rem;
    color: var(--text-secondary);
    line-height: 1.4;
}

/* Region Progress List */
.region-progress-list {
    display: flex;
    flex-direction: column;
    gap: 0.65rem;
}
.region-row {
    display: flex;
    flex-direction: column;
    gap: 0.25rem;
}
.region-row-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    font-size: 0.75rem;
}
.region-row-title {
    font-weight: 600;
    color: var(--text-primary);
}
.region-row-counts {
    font-size: 0.7rem;
    color: var(--text-muted);
    font-family: var(--font-mono);
}
.region-track {
    width: 100%;
    height: 5px;
    background: rgba(255, 255, 255, 0.06);
    border-radius: 999px;
    overflow: hidden;
}
.region-fill {
    height: 100%;
    background: var(--accent-emerald);
    border-radius: 999px;
    transition: width 0.5s ease;
}

/* Milestones */
.milestones-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 0.75rem;
}
.milestone-item {
    background: rgba(255, 255, 255, 0.02);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-md);
    padding: 0.75rem;
    display: flex;
    align-items: center;
    gap: 0.65rem;
}
.milestone-icon {
    font-size: 1.4rem;
}
.milestone-info {
    display: flex;
    flex-direction: column;
}
.milestone-title {
    font-size: 0.68rem;
    color: var(--text-muted);
}
.milestone-val {
    font-size: 0.85rem;
    font-weight: 700;
    color: var(--text-primary);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    max-width: 120px;
}

.backup-buttons {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
}

/* ==========================================================================
   TAB 4: CIRCUITOS REGIONAIS SUGERIDOS
   ========================================================================== */
.circuits-grid {
    display: flex;
    flex-direction: column;
    gap: 0.85rem;
}
.circuit-card {
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-lg);
    padding: 1.15rem;
    display: flex;
    flex-direction: column;
    gap: 0.65rem;
    transition: var(--transition-fast);
}
.circuit-card:hover {
    border-color: var(--border-highlight);
    background: var(--bg-card-hover);
}
.circuit-header {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 0.5rem;
}
.circuit-title {
    font-family: var(--font-titles);
    font-size: 1.05rem;
    font-weight: 700;
    color: #fff;
}
.circuit-badge {
    background: rgba(234, 88, 12, 0.15);
    color: var(--accent-orange);
    padding: 0.15rem 0.5rem;
    border-radius: 999px;
    font-size: 0.68rem;
    font-weight: 700;
    white-space: nowrap;
}
.circuit-desc {
    font-size: 0.78rem;
    color: var(--text-secondary);
    line-height: 1.4;
}
.circuit-cities-preview {
    display: flex;
    flex-wrap: wrap;
    gap: 0.35rem;
}
.circuit-city-tag {
    background: rgba(255, 255, 255, 0.05);
    padding: 0.15rem 0.45rem;
    border-radius: 4px;
    font-size: 0.68rem;
    color: var(--text-muted);
}
.circuit-footer {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding-top: 0.5rem;
    border-top: 1px solid var(--border-color);
}
.circuit-stats {
    font-size: 0.72rem;
    color: var(--text-muted);
}

/* ==========================================================================
   MAP VIEWPORT
   ========================================================================== */
.map-viewport {
    flex: 1;
    height: 100%;
    position: relative;
    background: #020617;
}

.leaflet-map-container {
    width: 100%;
    height: 100%;
    background: #020617;
    z-index: 100;
}

/* Leaflet Customizations for Dark Theme */
.leaflet-container {
    background: #060913 !important;
    font-family: var(--font-text) !important;
}
.leaflet-bar {
    border: none !important;
    box-shadow: var(--shadow-subtle) !important;
}
.leaflet-bar a {
    background-color: rgba(15, 23, 42, 0.9) !important;
    color: var(--text-primary) !important;
    border-bottom: 1px solid var(--border-color) !important;
    backdrop-filter: blur(8px);
}
.leaflet-bar a:hover {
    background-color: rgba(30, 41, 59, 0.95) !important;
    color: var(--accent-orange) !important;
}

/* Floating Controls Over Map */
.map-overlay-controls {
    position: absolute;
    top: 1.25rem;
    right: 1.25rem;
    z-index: 400;
    display: flex;
    align-items: center;
    gap: 0.6rem;
}
.map-btn-floating {
    display: inline-flex;
    align-items: center;
    gap: 0.45rem;
    background: rgba(15, 23, 42, 0.92);
    border: 1px solid var(--border-color);
    color: var(--text-primary);
    padding: 0.5rem 0.85rem;
    border-radius: var(--radius-md);
    font-size: 0.78rem;
    font-weight: 600;
    cursor: pointer;
    backdrop-filter: blur(12px);
    box-shadow: var(--shadow-subtle);
    transition: var(--transition-fast);
}
.map-btn-floating:hover {
    background: rgba(30, 41, 59, 0.98);
    border-color: rgba(255, 255, 255, 0.2);
    transform: translateY(-1px);
}
.map-btn-floating i {
    width: 15px;
    height: 15px;
    color: var(--accent-orange);
}

.map-layer-toggles {
    display: flex;
    background: rgba(15, 23, 42, 0.92);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-md);
    padding: 0.25rem;
    backdrop-filter: blur(12px);
    box-shadow: var(--shadow-subtle);
}
.map-toggle-pill {
    display: inline-flex;
    align-items: center;
    gap: 0.35rem;
    background: transparent;
    border: none;
    color: var(--text-muted);
    padding: 0.35rem 0.65rem;
    border-radius: var(--radius-sm);
    font-size: 0.72rem;
    font-weight: 600;
    cursor: pointer;
    transition: var(--transition-fast);
}
.map-toggle-pill:hover {
    color: var(--text-primary);
}
.map-toggle-pill.active {
    background: rgba(255, 255, 255, 0.08);
    color: var(--text-primary);
}
.map-toggle-pill i {
    width: 13px;
    height: 13px;
}

/* Map Legend */
.map-legend {
    position: absolute;
    bottom: 1.5rem;
    right: 1.5rem;
    z-index: 400;
    background: rgba(15, 23, 42, 0.88);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-md);
    padding: 0.5rem 0.85rem;
    display: flex;
    align-items: center;
    gap: 1rem;
    backdrop-filter: blur(12px);
    box-shadow: var(--shadow-subtle);
    font-size: 0.72rem;
    color: var(--text-secondary);
}
.legend-item {
    display: flex;
    align-items: center;
    gap: 0.35rem;
}
.legend-dot {
    width: 9px;
    height: 9px;
    border-radius: 50%;
}
.dot-visited {
    background-color: var(--accent-emerald);
    box-shadow: 0 0 6px var(--accent-emerald);
}
.dot-planned {
    background-color: var(--accent-gold);
    box-shadow: 0 0 6px var(--accent-gold);
}
.dot-unvisited {
    background-color: #334155;
    border: 1px solid #64748b;
}

/* Map Hover Card */
.map-hover-card {
    position: absolute;
    bottom: 1.5rem;
    left: 1.5rem;
    z-index: 400;
    background: rgba(15, 23, 42, 0.95);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-md);
    padding: 0.85rem 1.15rem;
    backdrop-filter: blur(16px);
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.6);
    display: flex;
    flex-direction: column;
    gap: 0.25rem;
    min-width: 220px;
    pointer-events: none;
    transition: opacity 0.15s ease;
}
.hover-card-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 0.5rem;
}
.hover-city-name {
    font-family: var(--font-titles);
    font-size: 1.05rem;
    font-weight: 700;
    color: #fff;
}
.hover-status-badge {
    font-size: 0.68rem;
    font-weight: 600;
    padding: 0.1rem 0.4rem;
    border-radius: 4px;
}
.hover-card-meta {
    font-size: 0.72rem;
    color: var(--text-secondary);
    display: flex;
    align-items: center;
    gap: 0.35rem;
}
.meta-separator {
    color: var(--text-muted);
}
.hover-card-footer {
    font-size: 0.65rem;
    color: var(--accent-orange);
    margin-top: 0.2rem;
}

/* Custom Marker Pins on Leaflet */
.custom-route-pin {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 28px !important;
    height: 28px !important;
    border-radius: 50% !important;
    background: var(--accent-gold);
    color: #000;
    font-family: var(--font-mono);
    font-size: 0.75rem;
    font-weight: 800;
    border: 2px solid #fff;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.5), 0 0 12px rgba(245, 158, 11, 0.6);
    cursor: pointer;
    transition: transform 0.15s ease;
}
.custom-route-pin.pin-visited {
    background: var(--accent-emerald);
    color: #fff;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.5), 0 0 12px rgba(16, 185, 129, 0.6);
}
.custom-route-pin:hover {
    transform: scale(1.25);
    z-index: 1000 !important;
}

/* ==========================================================================
   MODAIS & BACKDROPS
   ========================================================================== */
.modal-backdrop {
    position: fixed;
    inset: 0;
    background: rgba(2, 6, 23, 0.75);
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    z-index: 2000;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 1rem;
    animation: fadeIn 0.2s ease;
}
@keyframes fadeIn {
    from { opacity: 0; }
    to { opacity: 1; }
}

.city-detail-modal,
.share-modal,
.badges-modal {
    background: var(--bg-secondary);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-xl);
    width: 100%;
    max-width: 520px;
    padding: 2rem;
    position: relative;
    box-shadow: 0 25px 60px rgba(0, 0, 0, 0.8), 0 0 40px rgba(234, 88, 12, 0.1);
    display: flex;
    flex-direction: column;
    gap: 1.25rem;
    max-height: 90vh;
    overflow-y: auto;
    animation: scaleUp 0.25s cubic-bezier(0.34, 1.56, 0.64, 1);
}
@keyframes scaleUp {
    from { transform: scale(0.92); opacity: 0; }
    to { transform: scale(1); opacity: 1; }
}

.modal-close-btn {
    position: absolute;
    top: 1.25rem;
    right: 1.25rem;
    width: 36px;
    height: 36px;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.06);
    border: 1px solid var(--border-color);
    color: var(--text-secondary);
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: var(--transition-fast);
}
.modal-close-btn:hover {
    background: rgba(255, 255, 255, 0.12);
    color: #fff;
}
.modal-close-btn i {
    width: 18px;
    height: 18px;
}

/* City Modal Specifics */
.city-modal-header {
    display: flex;
    flex-direction: column;
    gap: 0.25rem;
}
.city-region-badge {
    align-self: flex-start;
    background: rgba(234, 88, 12, 0.15);
    color: var(--accent-orange);
    padding: 0.2rem 0.65rem;
    border-radius: 999px;
    font-size: 0.72rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}
.city-modal-title {
    font-family: var(--font-titles);
    font-size: 1.8rem;
    font-weight: 800;
    color: #fff;
    line-height: 1.1;
}
.city-coords-sub {
    font-size: 0.72rem;
    color: var(--text-muted);
    font-family: var(--font-mono);
}

.city-metrics-row {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 0.5rem;
}
.city-metric-box {
    background: rgba(255, 255, 255, 0.03);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-md);
    padding: 0.65rem 0.4rem;
    display: flex;
    flex-direction: column;
    align-items: center;
    text-align: center;
    gap: 0.15rem;
}
.city-metric-box .metric-icon {
    color: var(--accent-orange);
    margin-bottom: 0.1rem;
}
.city-metric-box .metric-icon i {
    width: 16px;
    height: 16px;
}
.city-metric-box .metric-value {
    font-family: var(--font-titles);
    font-size: 0.95rem;
    font-weight: 700;
    color: #fff;
}
.city-metric-box .metric-title {
    font-size: 0.62rem;
    color: var(--text-muted);
    text-transform: uppercase;
}

.section-subheading {
    font-size: 0.82rem;
    font-weight: 700;
    color: var(--text-secondary);
    display: flex;
    align-items: center;
    gap: 0.35rem;
    margin-bottom: 0.5rem;
}
.section-subheading i {
    width: 15px;
    height: 15px;
    color: var(--accent-orange);
}

/* Status Selector Pills */
.status-selector-pills {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 0.5rem;
}
.status-pill {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.4rem;
    padding: 0.65rem 0.5rem;
    border-radius: var(--radius-md);
    background: rgba(255, 255, 255, 0.04);
    border: 1px solid var(--border-color);
    color: var(--text-secondary);
    font-size: 0.78rem;
    font-weight: 600;
    cursor: pointer;
    transition: var(--transition-fast);
}
.status-pill:hover {
    background: rgba(255, 255, 255, 0.08);
    color: #fff;
}
.status-pill.active-unvisited {
    background: rgba(100, 116, 139, 0.2);
    border-color: #64748b;
    color: #fff;
}
.status-pill.active-planned {
    background: rgba(245, 158, 11, 0.2);
    border-color: var(--accent-gold);
    color: var(--accent-gold);
}
.status-pill.active-visited {
    background: rgba(16, 185, 129, 0.2);
    border-color: var(--accent-emerald);
    color: var(--accent-emerald);
}
.pill-dot {
    width: 8px;
    height: 8px;
    border-radius: 50%;
}

/* Journal Section */
.city-journal-section {
    background: rgba(15, 23, 42, 0.5);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-lg);
    padding: 1rem;
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
}
.journal-field-row {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 0.75rem;
}
.journal-input-group {
    display: flex;
    flex-direction: column;
    gap: 0.25rem;
}
.journal-input-group label {
    font-size: 0.7rem;
    color: var(--text-muted);
}
.form-input, .form-textarea {
    width: 100%;
    background: rgba(0, 0, 0, 0.3);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-sm);
    padding: 0.5rem 0.65rem;
    color: var(--text-primary);
    font-size: 0.78rem;
    font-family: inherit;
    outline: none;
}
.form-input:focus, .form-textarea:focus {
    border-color: var(--accent-orange);
}
.star-rating {
    display: flex;
    align-items: center;
    gap: 0.25rem;
}
.star {
    font-size: 1.3rem;
    color: #334155;
    cursor: pointer;
    transition: color 0.15s;
}
.star.active {
    color: var(--accent-gold);
}

/* Highlights */
.highlights-tags {
    display: flex;
    flex-wrap: wrap;
    gap: 0.4rem;
}
.highlight-tag {
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid var(--border-color);
    color: var(--text-secondary);
    padding: 0.25rem 0.55rem;
    border-radius: 999px;
    font-size: 0.72rem;
}

/* Modal Actions */
.btn-primary-route {
    background: var(--gradient-hero);
    color: #fff;
    padding: 0.85rem;
    font-size: 0.92rem;
    border-radius: var(--radius-md);
    box-shadow: 0 4px 20px rgba(234, 88, 12, 0.4);
}
.btn-primary-route:hover {
    transform: translateY(-1px);
    box-shadow: 0 6px 25px rgba(234, 88, 12, 0.5);
}
.btn-primary-route.in-route {
    background: rgba(239, 68, 68, 0.15);
    border: 1px solid rgba(239, 68, 68, 0.4);
    color: var(--accent-red);
    box-shadow: none;
}

/* Share Modal Specifics */
.share-modal-header,
.badges-modal-header {
    text-align: center;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 0.5rem;
}
.share-modal-icon,
.badges-modal-icon {
    width: 54px;
    height: 54px;
    border-radius: 50%;
    background: rgba(234, 88, 12, 0.15);
    color: var(--accent-orange);
    display: flex;
    align-items: center;
    justify-content: center;
}
.share-modal-icon i,
.badges-modal-icon i {
    width: 26px;
    height: 26px;
}
.share-modal-header h3,
.badges-modal-header h3 {
    font-family: var(--font-titles);
    font-size: 1.35rem;
    color: #fff;
}
.share-modal-header p,
.badges-modal-header p {
    font-size: 0.82rem;
    color: var(--text-secondary);
    line-height: 1.45;
}

.share-url-box {
    display: flex;
    gap: 0.5rem;
    background: rgba(0, 0, 0, 0.3);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-md);
    padding: 0.4rem;
}
#share-url-input {
    flex: 1;
    background: transparent;
    border: none;
    color: var(--text-secondary);
    font-size: 0.78rem;
    font-family: var(--font-mono);
    padding: 0.4rem;
    outline: none;
}

.share-social-buttons {
    display: flex;
    flex-direction: column;
    gap: 0.6rem;
}
.share-social-btn {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    padding: 0.8rem;
    border-radius: var(--radius-md);
    font-size: 0.85rem;
    font-weight: 600;
    text-decoration: none;
    cursor: pointer;
    border: none;
    transition: var(--transition-fast);
}
.share-social-btn i {
    width: 18px;
    height: 18px;
}
.btn-whatsapp {
    background: #25D366;
    color: #fff;
}
.btn-whatsapp:hover {
    background: #1ebc57;
}
.btn-native {
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid var(--border-color);
    color: var(--text-primary);
}
.btn-native:hover {
    background: rgba(255, 255, 255, 0.1);
}

/* Badges Grid */
.badges-list-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 0.75rem;
}
.badge-card {
    background: rgba(255, 255, 255, 0.02);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-lg);
    padding: 1rem;
    display: flex;
    flex-direction: column;
    align-items: center;
    text-align: center;
    gap: 0.35rem;
    transition: var(--transition-fast);
    position: relative;
    overflow: hidden;
}
.badge-card.unlocked {
    background: rgba(234, 88, 12, 0.08);
    border-color: rgba(234, 88, 12, 0.4);
    box-shadow: 0 0 20px rgba(234, 88, 12, 0.15);
}
.badge-card.locked {
    opacity: 0.5;
    filter: grayscale(80%);
}
.badge-card-icon {
    font-size: 2rem;
    margin-bottom: 0.15rem;
}
.badge-card-title {
    font-family: var(--font-titles);
    font-size: 0.95rem;
    font-weight: 700;
    color: #fff;
}
.badge-card-desc {
    font-size: 0.72rem;
    color: var(--text-secondary);
    line-height: 1.35;
}
.badge-status-tag {
    margin-top: 0.35rem;
    font-size: 0.65rem;
    font-weight: 700;
    padding: 0.1rem 0.45rem;
    border-radius: 999px;
}
.badge-card.unlocked .badge-status-tag {
    background: var(--accent-emerald);
    color: #fff;
}
.badge-card.locked .badge-status-tag {
    background: rgba(255, 255, 255, 0.08);
    color: var(--text-muted);
}

/* Toast Notifications */
.toast-container {
    position: fixed;
    bottom: 2rem;
    right: 2rem;
    z-index: 9999;
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
    pointer-events: none;
}
.toast {
    background: rgba(15, 23, 42, 0.95);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-md);
    padding: 0.75rem 1.25rem;
    color: #fff;
    font-size: 0.82rem;
    font-weight: 600;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.6);
    display: flex;
    align-items: center;
    gap: 0.5rem;
    animation: toastSlide 0.3s cubic-bezier(0.34, 1.56, 0.64, 1);
    backdrop-filter: blur(12px);
    pointer-events: auto;
}
@keyframes toastSlide {
    from { transform: translateY(20px); opacity: 0; }
    to { transform: translateY(0); opacity: 1; }
}
.toast-success { border-left: 4px solid var(--accent-emerald); }
.toast-gold { border-left: 4px solid var(--accent-gold); }
.toast-danger { border-left: 4px solid var(--accent-red); }

/* Mobile Navigation Bar */
.mobile-nav-bar {
    display: none;
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    height: var(--mobile-nav-height);
    background: rgba(6, 9, 19, 0.96);
    backdrop-filter: blur(16px);
    -webkit-backdrop-filter: blur(16px);
    border-top: 1px solid var(--border-color);
    z-index: 1500;
    align-items: center;
    justify-content: space-around;
    padding: 0 0.5rem;
}
.mob-nav-btn {
    flex: 1;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 0.2rem;
    background: transparent;
    border: none;
    color: var(--text-muted);
    font-size: 0.68rem;
    font-weight: 600;
    cursor: pointer;
    position: relative;
    padding: 0.4rem 0;
}
.mob-nav-btn i {
    width: 20px;
    height: 20px;
}
.mob-nav-btn.active {
    color: var(--accent-orange);
}
.mob-badge {
    position: absolute;
    top: 2px;
    right: 25%;
    background: var(--accent-orange);
    color: #fff;
    font-size: 0.6rem;
    font-weight: 800;
    width: 16px;
    height: 16px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
}

/* Helpers */
.hidden { display: none !important; }
.w-full { width: 100% !important; }
.cursor-pointer { cursor: pointer; }

/* ==========================================================================
   RESPONSIVIDADE (MOBILE & TABLET)
   ========================================================================== */
@media (max-width: 900px) {
    :root {
        --sidebar-width: 100%;
        --header-height: 60px;
    }

    .header-progress {
        display: none;
    }
    .badge-expedicao {
        display: none;
    }
    .header-actions .btn-txt {
        display: none;
    }
    .header-actions .btn-action {
        padding: 0.5rem;
    }

    .mobile-nav-bar {
        display: flex;
    }

    /* Sidebar transforms into Bottom Sheet Drawer */
    .app-sidebar {
        position: fixed;
        bottom: var(--mobile-nav-height);
        left: 0;
        right: 0;
        width: 100%;
        height: calc(85vh - var(--mobile-nav-height));
        border-right: none;
        border-top: 1px solid var(--border-color);
        border-radius: var(--radius-xl) var(--radius-xl) 0 0;
        box-shadow: 0 -10px 40px rgba(0, 0, 0, 0.8);
        transform: translateY(105%);
        transition: transform 0.35s cubic-bezier(0.32, 0.72, 0, 1);
        z-index: 1200;
    }
    .app-sidebar.drawer-open {
        transform: translateY(0);
    }

    .drawer-handle-bar {
        display: flex;
    }

    .map-overlay-controls {
        top: 0.75rem;
        right: 0.75rem;
        flex-direction: column;
        align-items: flex-end;
    }
    .map-legend {
        bottom: calc(var(--mobile-nav-height) + 1rem);
        right: 0.75rem;
        padding: 0.35rem 0.65rem;
        gap: 0.5rem;
    }
    .map-hover-card {
        display: none !important;
    }

    .city-detail-modal,
    .share-modal,
    .badges-modal {
        border-radius: var(--radius-xl);
        padding: 1.5rem 1.25rem;
    }

    .city-metrics-row {
        grid-template-columns: 1fr 1fr;
    }
    .hero-stats-grid {
        grid-template-columns: 1fr 1fr;
    }
    .milestones-grid {
        grid-template-columns: 1fr;
    }
    .badges-list-grid {
        grid-template-columns: 1fr;
    }
}


/* ==========================================================================
   V2 EXTENSIONS: PARTIDA, CUSTOS, 8 ETAPAS & GUIA DE ATRACOES
   ========================================================================== */

/* Seletor Rapido de Partida no Header */
.header-start-city-pill {
    display: inline-flex;
    align-items: center;
    gap: 0.6rem;
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid rgba(245, 158, 11, 0.35);
    padding: 0.35rem 0.85rem;
    border-radius: 999px;
    cursor: pointer;
    transition: var(--transition-fast);
}
.header-start-city-pill:hover {
    background: rgba(245, 158, 11, 0.12);
    border-color: var(--accent-gold);
    transform: translateY(-1px);
}
.start-flag {
    font-size: 1.1rem;
}
.start-city-text {
    display: flex;
    flex-direction: column;
    line-height: 1.15;
}
.start-label {
    font-size: 0.62rem;
    color: var(--accent-gold);
    text-transform: uppercase;
    font-weight: 700;
    letter-spacing: 0.5px;
}
.start-name {
    font-size: 0.85rem;
    color: var(--text-primary);
    font-weight: 700;
}
.start-chevron {
    width: 14px;
    height: 14px;
    color: var(--text-secondary);
}

/* Card de Configuracao de Partida no Roteiro */
.origin-config-card {
    background: linear-gradient(135deg, rgba(30, 41, 59, 0.7) 0%, rgba(15, 23, 42, 0.85) 100%);
    border: 1px solid rgba(245, 158, 11, 0.25);
    border-radius: var(--radius-md);
    padding: 0.85rem 1rem;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 0.75rem;
    margin-bottom: 1rem;
}
.origin-config-left {
    display: flex;
    align-items: center;
    gap: 0.65rem;
    flex: 1;
}
.origin-tag {
    font-size: 0.78rem;
    font-weight: 700;
    color: var(--accent-gold);
    white-space: nowrap;
}
.origin-select-wrapper {
    flex: 1;
}
.origin-select {
    width: 100%;
    background: rgba(6, 9, 19, 0.8);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-sm);
    color: var(--text-primary);
    font-size: 0.85rem;
    font-weight: 600;
    padding: 0.45rem 0.75rem;
    outline: none;
    transition: var(--transition-fast);
    cursor: pointer;
}
.origin-select:focus {
    border-color: var(--accent-gold);
    box-shadow: 0 0 10px rgba(245, 158, 11, 0.25);
}
.origin-select option {
    background: #0f172a;
    color: #f8fafc;
}
.origin-config-right {
    flex-shrink: 0;
}
.btn-toggle-round {
    display: inline-flex;
    align-items: center;
    gap: 0.45rem;
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid var(--border-color);
    border-radius: 999px;
    padding: 0.4rem 0.75rem;
    color: var(--text-secondary);
    font-size: 0.75rem;
    font-weight: 600;
    cursor: pointer;
    transition: var(--transition-fast);
}
.btn-toggle-round.active {
    background: rgba(16, 185, 129, 0.15);
    border-color: var(--accent-emerald);
    color: var(--accent-emerald-light);
}
.btn-toggle-round i {
    width: 14px;
    height: 14px;
}

/* Geo disclaimer */
.geo-disclaimer {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.55rem 0.8rem;
    background: rgba(234, 88, 12, 0.08);
    border: 1px dashed rgba(234, 88, 12, 0.3);
    border-radius: var(--radius-sm);
    margin-bottom: 0.85rem;
    font-size: 0.74rem;
    color: var(--text-secondary);
    line-height: 1.35;
}
.geo-disclaimer i {
    width: 16px;
    height: 16px;
    color: var(--accent-orange);
    flex-shrink: 0;
}

/* Conectores e Rodovias no Itinerario */
.itinerary-leg-info {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0.3rem 0.85rem;
    margin: 0.2rem 1rem 0.2rem 2.2rem;
    background: rgba(255, 255, 255, 0.03);
    border-left: 2px dashed rgba(234, 88, 12, 0.5);
    border-radius: 0 var(--radius-sm) var(--radius-sm) 0;
    font-size: 0.72rem;
}
.leg-highway {
    display: inline-flex;
    align-items: center;
    gap: 0.35rem;
    color: var(--accent-gold);
    font-weight: 600;
}
.leg-highway i {
    width: 12px;
    height: 12px;
}
.leg-distance {
    color: var(--text-muted);
    font-family: var(--font-mono);
}

/* Tab Etapas (8 Blocos) */
.stages-intro-card {
    display: flex;
    align-items: flex-start;
    gap: 0.75rem;
    background: rgba(15, 23, 42, 0.8);
    border: 1px solid rgba(255, 255, 255, 0.08);
    border-radius: var(--radius-md);
    padding: 0.85rem 1rem;
    margin-bottom: 1rem;
}
.stages-intro-icon {
    font-size: 1.3rem;
    line-height: 1;
}
.stages-intro-txt {
    font-size: 0.82rem;
    line-height: 1.45;
    color: var(--text-secondary);
}
.stages-intro-txt strong {
    color: var(--accent-gold);
}

.stages-accordion-list {
    display: flex;
    flex-direction: column;
    gap: 0.85rem;
}

.stage-accordion-card {
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-md);
    overflow: hidden;
    transition: var(--transition-smooth);
}
.stage-accordion-card:hover {
    border-color: rgba(255, 255, 255, 0.18);
}
.stage-accordion-card.active {
    border-color: var(--accent-orange);
    box-shadow: 0 4px 20px rgba(234, 88, 12, 0.15);
}

.stage-accordion-header {
    padding: 0.85rem 1rem;
    cursor: pointer;
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
    user-select: none;
}
.stage-header-top {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 0.5rem;
}
.stage-badge-num {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 26px;
    height: 26px;
    background: var(--gradient-hero);
    color: #fff;
    font-size: 0.75rem;
    font-weight: 800;
    border-radius: 6px;
    flex-shrink: 0;
}
.stage-title-text {
    font-family: var(--font-titles);
    font-size: 0.95rem;
    font-weight: 700;
    color: var(--text-primary);
    flex: 1;
}
.stage-chevron-icon {
    width: 18px;
    height: 18px;
    color: var(--text-secondary);
    transition: transform 0.25s ease;
}
.stage-accordion-card.open .stage-chevron-icon {
    transform: rotate(180deg);
}

.stage-header-meta {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    font-size: 0.75rem;
    color: var(--text-muted);
}
.stage-meta-item {
    display: inline-flex;
    align-items: center;
    gap: 0.3rem;
}
.stage-meta-item strong {
    color: var(--text-secondary);
}

.stage-accordion-body {
    display: none;
    padding: 0.85rem 1rem 1rem;
    border-top: 1px solid rgba(255, 255, 255, 0.05);
    background: rgba(6, 9, 19, 0.4);
}
.stage-accordion-card.open .stage-accordion-body {
    display: block;
}

.stage-desc {
    font-size: 0.8rem;
    color: var(--text-secondary);
    line-height: 1.4;
    margin-bottom: 0.75rem;
}
.stage-highways-strip {
    display: flex;
    flex-wrap: wrap;
    gap: 0.4rem;
    margin-bottom: 0.75rem;
}
.highway-pill {
    font-size: 0.68rem;
    font-weight: 700;
    padding: 0.2rem 0.5rem;
    border-radius: 4px;
    background: rgba(245, 158, 11, 0.15);
    color: var(--accent-gold);
    border: 1px solid rgba(245, 158, 11, 0.3);
}

.stage-actions-row {
    display: flex;
    gap: 0.5rem;
    margin-bottom: 0.85rem;
}

.stage-cities-pills-grid {
    display: flex;
    flex-wrap: wrap;
    gap: 0.35rem;
    max-height: 180px;
    overflow-y: auto;
    padding-right: 0.25rem;
}
.stage-city-pill {
    font-size: 0.72rem;
    padding: 0.25rem 0.55rem;
    border-radius: 999px;
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid var(--border-color);
    color: var(--text-secondary);
    display: inline-flex;
    align-items: center;
    gap: 0.35rem;
    cursor: pointer;
    transition: var(--transition-fast);
}
.stage-city-pill:hover {
    background: rgba(255, 255, 255, 0.1);
    color: var(--text-primary);
}
.stage-city-pill.visited {
    border-color: rgba(16, 185, 129, 0.5);
    color: var(--accent-emerald-light);
    background: rgba(16, 185, 129, 0.1);
}

/* Modal de Cidades: Abas Visao Geral & O Que Conhecer */
.city-modal-tabs {
    display: flex;
    gap: 0.5rem;
    border-bottom: 1px solid var(--border-color);
    padding: 0 1.5rem;
    margin-bottom: 1.25rem;
}
.modal-tab-btn {
    display: inline-flex;
    align-items: center;
    gap: 0.45rem;
    padding: 0.75rem 0.5rem;
    background: transparent;
    border: none;
    border-bottom: 2px solid transparent;
    color: var(--text-secondary);
    font-size: 0.85rem;
    font-weight: 600;
    cursor: pointer;
    transition: var(--transition-fast);
}
.modal-tab-btn:hover {
    color: var(--text-primary);
}
.modal-tab-btn.active {
    color: var(--accent-orange);
    border-bottom-color: var(--accent-orange);
}
.modal-tab-badge {
    background: rgba(234, 88, 12, 0.2);
    color: var(--accent-orange-light);
    font-size: 0.7rem;
    font-weight: 700;
    padding: 0.1rem 0.45rem;
    border-radius: 999px;
}

.modal-tab-content {
    display: none;
}
.modal-tab-content.active {
    display: block;
}

/* City Start Point Row in Modal */
.city-start-point-row {
    margin: 1rem 0;
}

/* Highway badge in modal header */
.city-header-badges {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    flex-wrap: wrap;
    margin-bottom: 0.4rem;
}
.city-highway-badge {
    display: inline-flex;
    align-items: center;
    gap: 0.35rem;
    background: rgba(245, 158, 11, 0.12);
    border: 1px solid rgba(245, 158, 11, 0.3);
    color: var(--accent-gold);
    font-size: 0.72rem;
    font-weight: 600;
    padding: 0.2rem 0.6rem;
    border-radius: 999px;
}
.city-highway-badge i {
    width: 12px;
    height: 12px;
}

/* Guia de Atracoes ('O Que Conhecer') */
.attractions-guide-container {
    display: flex;
    flex-direction: column;
    gap: 1rem;
    max-height: 55vh;
    overflow-y: auto;
    padding-right: 0.4rem;
}
.attraction-category-block {
    background: rgba(255, 255, 255, 0.02);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-md);
    padding: 0.85rem 1rem;
}
.cat-title {
    font-size: 0.85rem;
    font-weight: 700;
    color: var(--text-primary);
    margin-bottom: 0.6rem;
    display: flex;
    align-items: center;
    gap: 0.4rem;
}
.cat-list {
    list-style: none;
    display: flex;
    flex-direction: column;
    gap: 0.45rem;
}
.attraction-item {
    display: flex;
    flex-direction: column;
    gap: 0.15rem;
    padding: 0.4rem 0.6rem;
    background: rgba(15, 23, 42, 0.6);
    border-radius: var(--radius-sm);
    border-left: 2px solid var(--accent-orange);
}
.attraction-name {
    font-size: 0.82rem;
    font-weight: 600;
    color: var(--text-primary);
}
.attraction-desc {
    font-size: 0.74rem;
    color: var(--text-secondary);
    line-height: 1.35;
}

/* Custom Attractions Section */
.user-custom-attractions-section {
    background: rgba(245, 158, 11, 0.04);
    border: 1px solid rgba(245, 158, 11, 0.2);
    border-radius: var(--radius-md);
    padding: 0.85rem 1rem;
}
.custom-attractions-list {
    display: flex;
    flex-direction: column;
    gap: 0.4rem;
    margin-bottom: 0.75rem;
}
.custom-attraction-tag {
    display: flex;
    align-items: center;
    justify-content: space-between;
    background: rgba(15, 23, 42, 0.8);
    border: 1px solid rgba(255, 255, 255, 0.08);
    border-radius: var(--radius-sm);
    padding: 0.35rem 0.6rem;
    font-size: 0.78rem;
    color: var(--text-primary);
}
.btn-remove-custom-attraction {
    background: transparent;
    border: none;
    color: var(--text-muted);
    cursor: pointer;
    font-size: 0.9rem;
    padding: 0.1rem 0.3rem;
}
.btn-remove-custom-attraction:hover {
    color: var(--accent-red);
}
.add-custom-attraction-row {
    display: flex;
    gap: 0.5rem;
}

/* Modal de Custos */
.costs-modal {
    position: relative;
    width: 100%;
    max-width: 580px;
    background: var(--bg-secondary);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-lg);
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.8);
    padding: 2rem;
    max-height: 90vh;
    overflow-y: auto;
}
.costs-modal-header {
    text-align: center;
    margin-bottom: 1.5rem;
}
.costs-modal-icon {
    width: 48px;
    height: 48px;
    background: rgba(245, 158, 11, 0.15);
    color: var(--accent-gold);
    border: 1px solid rgba(245, 158, 11, 0.3);
    border-radius: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    margin: 0 auto 0.75rem;
}
.costs-modal-icon i {
    width: 26px;
    height: 26px;
}
.costs-modal-header h3 {
    font-family: var(--font-titles);
    font-size: 1.35rem;
    font-weight: 800;
    margin-bottom: 0.25rem;
}
.costs-modal-header p {
    font-size: 0.85rem;
    color: var(--text-secondary);
}

.vehicle-selector-row {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 0.75rem;
    margin-bottom: 1.25rem;
}
.vehicle-btn {
    background: rgba(15, 23, 42, 0.6);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-md);
    padding: 0.85rem 0.5rem;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 0.25rem;
    cursor: pointer;
    transition: var(--transition-fast);
}
.vehicle-btn:hover {
    background: rgba(255, 255, 255, 0.05);
    border-color: rgba(255, 255, 255, 0.2);
}
.vehicle-btn.active {
    background: rgba(234, 88, 12, 0.12);
    border-color: var(--accent-orange);
    box-shadow: 0 0 15px rgba(234, 88, 12, 0.2);
}
.v-icon {
    font-size: 1.4rem;
}
.v-name {
    font-size: 0.82rem;
    font-weight: 700;
    color: var(--text-primary);
}
.v-cons {
    font-size: 0.72rem;
    color: var(--text-muted);
}

.costs-inputs-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 0.85rem;
    margin-bottom: 1.5rem;
}
.cost-input-group label {
    display: block;
    font-size: 0.75rem;
    font-weight: 600;
    color: var(--text-secondary);
    margin-bottom: 0.35rem;
}

.costs-results-card {
    background: rgba(6, 9, 19, 0.7);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-md);
    padding: 1.25rem;
}
.costs-results-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 0.85rem;
    margin-bottom: 1.25rem;
}
.cost-res-item {
    display: flex;
    flex-direction: column;
    gap: 0.2rem;
}
.res-title {
    font-size: 0.72rem;
    color: var(--text-muted);
}
.res-val {
    font-size: 0.95rem;
    font-weight: 700;
    color: var(--text-primary);
}
.res-val.cost-gold {
    color: var(--accent-gold);
}

.cost-total-banner {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 1rem;
    padding-top: 1rem;
    border-top: 1px solid rgba(255, 255, 255, 0.08);
}
.cost-total-left {
    display: flex;
    flex-direction: column;
}
.total-label {
    font-size: 0.68rem;
    font-weight: 800;
    letter-spacing: 0.8px;
    color: var(--accent-orange);
    text-transform: uppercase;
}
.total-sub {
    font-size: 0.74rem;
    color: var(--text-secondary);
}
.total-val {
    font-family: var(--font-titles);
    font-size: 1.6rem;
    font-weight: 900;
    color: var(--accent-emerald-light);
}

/* Modal Stages (8 Etapas) */
.stages-modal {
    position: relative;
    width: 100%;
    max-width: 680px;
    background: var(--bg-secondary);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-lg);
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.8);
    padding: 2rem;
    max-height: 90vh;
    overflow-y: auto;
}
.stages-modal-header {
    text-align: center;
    margin-bottom: 1.5rem;
}
.stages-modal-icon {
    width: 48px;
    height: 48px;
    background: rgba(234, 88, 12, 0.15);
    color: var(--accent-orange);
    border: 1px solid rgba(234, 88, 12, 0.3);
    border-radius: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    margin: 0 auto 0.75rem;
}
.stages-modal-icon i {
    width: 26px;
    height: 26px;
}
.stages-modal-header h3 {
    font-family: var(--font-titles);
    font-size: 1.35rem;
    font-weight: 800;
    margin-bottom: 0.25rem;
}
.stages-modal-header p {
    font-size: 0.85rem;
    color: var(--text-secondary);
}
.stages-modal-list {
    display: flex;
    flex-direction: column;
    gap: 0.85rem;
    margin-bottom: 1.5rem;
}

/* ==========================================================================
   EXTRA STYLES: START CITY, RETURN LEG & HIGHWAY HINTS
   ========================================================================== */

.custom-route-pin.pin-start {
    background: linear-gradient(135deg, #f59e0b 0%, #ea580c 100%) !important;
    border-color: #fef08a !important;
    box-shadow: 0 0 15px rgba(245, 158, 11, 0.7) !important;
    font-size: 0.85rem !important;
    transform: scale(1.15);
    z-index: 999;
}

.itinerary-item.start-city-item {
    border-left: 4px solid var(--accent-gold) !important;
    background: rgba(245, 158, 11, 0.08) !important;
}

.step-start {
    background: linear-gradient(135deg, #f59e0b 0%, #ea580c 100%) !important;
    color: #fff !important;
    font-size: 0.85rem !important;
}

.pill-tag-start {
    background: rgba(245, 158, 11, 0.2);
    color: var(--accent-gold);
    font-size: 0.65rem;
    font-weight: 700;
    padding: 0.15rem 0.45rem;
    border-radius: 4px;
    margin-left: 0.35rem;
    text-transform: uppercase;
    letter-spacing: 0.4px;
    display: inline-block;
    vertical-align: middle;
}

.itinerary-item.circuit-return-item {
    border-left: 4px solid var(--accent-emerald) !important;
    background: rgba(16, 185, 129, 0.08) !important;
    cursor: pointer;
}

.itinerary-leg-info.return-leg {
    border-left-color: var(--accent-emerald) !important;
    background: rgba(16, 185, 129, 0.04) !important;
}

.step-finish {
    background: linear-gradient(135deg, #059669 0%, #10b981 100%) !important;
    color: #fff !important;
    font-size: 0.85rem !important;
}

.item-hw-hint {
    font-size: 0.68rem;
    color: var(--accent-gold);
    font-weight: 600;
    background: rgba(245, 158, 11, 0.1);
    padding: 0.1rem 0.35rem;
    border-radius: 3px;
}

.hw-mini {
    color: var(--accent-gold);
    font-size: 0.7rem;
    font-weight: 600;
}

.dot-gold {
    background-color: var(--accent-gold) !important;
    box-shadow: 0 0 6px var(--accent-gold) !important;
}

.status-start {
    border-left: 3px solid var(--accent-gold) !important;
}
