/* ==============================================================================
   daisyUI Theme + App Shell
   ============================================================================== */

:root,
body[data-theme="riob"] {
    --color-base-100: oklch(98.5% 0.008 220);
    --color-base-200: oklch(95.8% 0.014 224);
    --color-base-300: oklch(90.2% 0.02 226);
    --color-base-content: oklch(26% 0.028 246);
    --color-primary: oklch(52% 0.16 249);
    --color-primary-content: oklch(98% 0.01 240);
    --color-secondary: oklch(38% 0.05 242);
    --color-secondary-content: oklch(96% 0.01 240);
    --color-accent: oklch(72% 0.14 190);
    --color-accent-content: oklch(23% 0.04 210);
    --color-neutral: oklch(26% 0.03 248);
    --color-neutral-content: oklch(95% 0.01 240);
    --color-info: oklch(72% 0.11 224);
    --color-info-content: oklch(27% 0.03 238);
    --color-success: oklch(73% 0.14 163);
    --color-success-content: oklch(28% 0.04 166);
    --color-warning: oklch(79% 0.16 78);
    --color-warning-content: oklch(31% 0.06 52);
    --color-error: oklch(67% 0.19 20);
    --color-error-content: oklch(27% 0.08 18);
    --radius-box: 1.15rem;
    --radius-field: 0.9rem;
    --radius-selector: 0.8rem;
    --depth: 1;
}

body[data-theme="dark-riob"] {
    --color-base-100: oklch(23% 0.028 248);
    --color-base-200: oklch(27% 0.03 248);
    --color-base-300: oklch(33% 0.036 248);
    --color-base-content: oklch(92% 0.015 242);
    --color-primary: oklch(70% 0.16 250);
    --color-primary-content: oklch(20% 0.03 248);
    --color-secondary: oklch(78% 0.05 242);
    --color-secondary-content: oklch(18% 0.03 248);
    --color-accent: oklch(76% 0.12 188);
    --color-accent-content: oklch(20% 0.03 205);
    --color-neutral: oklch(20% 0.03 248);
    --color-neutral-content: oklch(92% 0.015 242);
    --color-info: oklch(73% 0.11 224);
    --color-info-content: oklch(18% 0.03 240);
    --color-success: oklch(77% 0.14 163);
    --color-success-content: oklch(18% 0.03 166);
    --color-warning: oklch(84% 0.16 78);
    --color-warning-content: oklch(24% 0.06 52);
    --color-error: oklch(75% 0.18 20);
    --color-error-content: oklch(21% 0.07 18);
}

.app-shell {
    box-sizing: border-box;
    display: flex;
    flex-direction: column;
    height: 100dvh;
    overflow: hidden;
    max-width: 100vw;
    color: var(--color-base-content);
    font-family: "Segoe UI", "Helvetica Neue", sans-serif;
    background:
        radial-gradient(circle at top left, rgba(115, 184, 255, 0.24), transparent 32%),
        radial-gradient(circle at top right, rgba(84, 210, 194, 0.18), transparent 28%),
        linear-gradient(180deg, #edf4fb 0%, #e6eef8 40%, #dde8f5 100%);
}

    body[data-theme="dark-riob"] .app-shell {
        background:
        radial-gradient(circle at top left, rgba(77, 129, 194, 0.2), transparent 38%),
        radial-gradient(circle at top right, rgba(49, 145, 146, 0.14), transparent 35%),
        linear-gradient(180deg, #0f1726 0%, #111d31 45%, #13223a 100%);
    }

.shell-banner {
    position: relative;
    z-index: 30;
}

.header {
    padding: clamp(10px, 1.8vw, 18px) clamp(12px, 2.6vw, 24px) 10px;
}

.shell-main {
    display: flex;
    flex-direction: row;
    flex: 1;
    min-height: 0;
    overflow: hidden;
}

.shell-navbar {
    min-height: 0;
    padding: clamp(10px, 1.6vw, 16px) clamp(14px, 2vw, 20px);
    justify-content: space-between;
    align-items: center;
    gap: 14px;
    border: 1px solid rgba(255, 255, 255, 0.65);
    border-radius: 1.25rem;
    background:
        linear-gradient(135deg, rgba(19, 33, 53, 0.96), rgba(24, 56, 96, 0.88)),
        linear-gradient(180deg, rgba(255, 255, 255, 0.05), rgba(255, 255, 255, 0));
    box-shadow: 0 22px 46px rgba(26, 54, 91, 0.18);
    color: #f6fbff;
}

.header-brand {
    display: flex;
    align-items: center;
    gap: 12px;
    width: auto;
}

.header-actions {
    display: inline-flex;
    align-items: center;
    justify-content: flex-end;
    gap: 8px;
}

.dropdown-locale {
    min-width: 96px;
    font-size: 0.76rem;
    font-family: "Segoe UI", "Helvetica Neue", sans-serif;
}

.dropdown-locale .Select-control {
    min-height: 2.3rem;
    height: 2.3rem;
    border-radius: 999px;
    border: 1px solid rgba(236, 245, 255, 0.26);
    background: rgba(255, 255, 255, 0.11);
}

.dropdown-locale .Select-value-label,
.dropdown-locale .Select-placeholder {
    color: #ecf5ff !important;
    font-weight: 700;
    letter-spacing: 0.02em;
    font-family: "Segoe UI", "Helvetica Neue", sans-serif;
}

.dropdown-locale .Select-option {
    font-family: "Segoe UI", "Helvetica Neue", sans-serif;
}

.dropdown-locale .locale-option-label {
    display: inline-flex;
    align-items: center;
    gap: 6px;
}

.dropdown-locale .locale-flag-icon {
    width: 16px;
    height: 11px;
    border-radius: 2px;
    border: 1px solid rgba(15, 29, 49, 0.24);
    object-fit: cover;
}

body[data-theme="dark-riob"] .dropdown-locale .locale-flag-icon {
    border-color: rgba(220, 234, 252, 0.3);
}

.dropdown-locale .locale-flag-text {
    font-weight: 700;
    letter-spacing: 0.02em;
    color: #102034;
}

.dropdown-locale .Select-value-label,
.dropdown-locale .Select-placeholder,
.dropdown-locale .Select-input > input,
.dropdown-locale .locale-flag-text {
    color: #102034;
}

body[data-theme="dark-riob"] .dropdown-locale .Select-value-label,
body[data-theme="dark-riob"] .dropdown-locale .Select-placeholder,
body[data-theme="dark-riob"] .dropdown-locale .Select-input > input,
body[data-theme="dark-riob"] .dropdown-locale .locale-flag-text {
    color: #f5f9ff;
}

.dropdown-locale .Select-arrow {
    border-top-color: rgba(236, 245, 255, 0.92) !important;
}

.dropdown-locale .Select-menu-outer {
    margin-top: 8px;
    z-index: 12050 !important;
    border-radius: 0.9rem;
    border: 1px solid #d6e2f0;
    background: #ffffff;
    box-shadow: 0 18px 34px rgba(17, 31, 51, 0.2);
}

.dropdown-locale .Select-option {
    background: #ffffff;
    color: #102034;
}

.dropdown-locale .Select-option.is-focused {
    background: #eaf2fd;
    color: #102034;
}

.dropdown-locale .Select-option.is-selected {
    background: #dbeaff;
    color: #0d1b2e;
    font-weight: 700;
}

body[data-theme="dark-riob"] .dropdown-locale .Select-control {
    border-color: rgba(160, 190, 227, 0.34);
    background: rgba(21, 42, 70, 0.62);
}

body[data-theme="dark-riob"] .dropdown-locale .Select-menu-outer {
    border-color: rgba(113, 149, 197, 0.35);
    background: rgba(15, 29, 49, 0.98);
    box-shadow: 0 18px 34px rgba(2, 8, 20, 0.56);
}

body[data-theme="dark-riob"] .dropdown-locale .Select-option {
    background: rgba(15, 29, 49, 0.98);
    color: #dce8fa;
}

body[data-theme="dark-riob"] .dropdown-locale .Select-option.is-focused {
    background: rgba(31, 58, 94, 0.92);
    color: #e9f2ff;
}

body[data-theme="dark-riob"] .dropdown-locale .Select-option.is-selected {
    background: rgba(45, 85, 132, 0.92);
    color: #ffffff;
}

.btn-theme-toggle {
    width: 2.3rem;
    height: 2.3rem;
    border-radius: 999px;
    border: 1px solid rgba(236, 245, 255, 0.22);
    background: rgba(255, 255, 255, 0.11);
    color: #ecf5ff;
    font-size: 1rem;
    line-height: 1;
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    transition: transform 0.15s ease, background 0.15s ease, border-color 0.15s ease;
}

.btn-theme-toggle:hover {
    transform: translateY(-1px);
    background: rgba(255, 255, 255, 0.2);
    border-color: rgba(236, 245, 255, 0.45);
}

.btn-theme-toggle:focus-visible {
    outline: 2px solid rgba(113, 198, 255, 0.95);
    outline-offset: 2px;
}

body[data-theme="dark-riob"] .shell-navbar {
    border-color: rgba(92, 130, 186, 0.34);
    background:
        linear-gradient(135deg, rgba(11, 24, 42, 0.96), rgba(16, 40, 72, 0.92)),
        linear-gradient(180deg, rgba(173, 205, 240, 0.08), rgba(255, 255, 255, 0));
    box-shadow: 0 18px 38px rgba(3, 10, 24, 0.5);
}

body[data-theme="dark-riob"] .header-build-badge {
    color: rgba(220, 234, 252, 0.94);
    border-color: rgba(160, 190, 227, 0.35);
    background: rgba(21, 42, 70, 0.6);
}

body[data-theme="dark-riob"] .header-subtitulo {
    color: rgba(202, 218, 242, 0.82);
}

.header-icon {
    width: 2.8rem;
    height: 2.8rem;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border-radius: 999px;
    background: linear-gradient(135deg, rgba(86, 187, 255, 0.35), rgba(255, 255, 255, 0.14));
    font-size: 1.2rem;
}

.header-copy {
    display: flex;
    flex-direction: column;
    gap: 2px;
}

.header-title-row {
    display: flex;
    align-items: center;
    gap: 10px;
    flex-wrap: wrap;
}

.header-build-badge {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border-radius: 999px;
    padding: 0.2rem 0.55rem;
    font-size: 0.68rem;
    line-height: 1;
    font-weight: 700;
    letter-spacing: 0.02em;
    color: rgba(236, 245, 255, 0.9);
    border: 1px solid rgba(236, 245, 255, 0.24);
    background: rgba(255, 255, 255, 0.08);
}

.header-titulo {
    margin: 0;
    font-size: clamp(0.94rem, 1.55vw, 1.12rem);
    line-height: 1.1;
    font-weight: 750;
    letter-spacing: 0.01em;
}

.header-subtitulo {
    margin: 0;
    color: rgba(236, 245, 255, 0.75);
    font-size: clamp(0.74rem, 1.15vw, 0.9rem);
}

.header-status {
    border: 1px solid rgba(255, 255, 255, 0.14);
    background: rgba(255, 255, 255, 0.08);
    color: #ecfff7;
    backdrop-filter: blur(8px);
}

.header-status-text {
    font-weight: 700;
}

.controles {
    padding: 0 clamp(10px, 2vw, 20px) 20px;
    display: flex;
    flex-direction: column;
    align-items: stretch;
    gap: 12px;
    width: clamp(320px, 28vw, 420px);
    flex: 0 0 auto;
    overflow-y: auto;
}

.controls-card,
.toolbar-card,
.map-frame {
    border-color: rgba(255, 255, 255, 0.72);
    background: rgba(255, 255, 255, 0.96);
    backdrop-filter: none;
    box-shadow: 0 10px 24px rgba(33, 57, 88, 0.08);
}

body[data-theme="dark-riob"] .controls-card,
body[data-theme="dark-riob"] .toolbar-card,
body[data-theme="dark-riob"] .map-frame {
    border-color: rgba(96, 133, 186, 0.34);
    background: rgba(18, 33, 55, 0.92);
    box-shadow: 0 10px 24px rgba(3, 10, 24, 0.36);
}

.controls-card {
    flex: 0 0 auto;
    min-width: 0;
    padding: 14px 14px 12px;
}

.controls-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    gap: 10px;
    margin-bottom: 8px;
}

.controls-title {
    margin: 0;
    font-size: 1rem;
}

.controls-subtitle {
    margin: 2px 0 0;
    color: color-mix(in oklab, var(--color-base-content) 62%, transparent);
    font-size: 0.84rem;
}

.controls-badges {
    display: flex;
    gap: 6px;
    flex-wrap: wrap;
    justify-content: flex-end;
}

.controls-help {
    margin-top: 6px;
    text-align: center;
    font-size: 0.76rem;
    color: color-mix(in oklab, var(--color-base-content) 60%, transparent);
}

.label {
    font-weight: 700;
    margin-bottom: 4px;
    text-align: center;
    color: var(--color-base-content);
}

.dropdown-wrapper {
    position: relative;
    z-index: 9999;
    width: 100%;
    display: flex;
    justify-content: center;
}

.controles,
.controls-card {
    position: relative;
    z-index: 10001;
}

.dropdown {
    width: 100%;
    max-width: 420px;
}

.toolbar-card {
    flex: 0 0 auto;
    padding: 12px 14px;
    display: flex;
    flex-direction: column;
    align-items: stretch;
    justify-content: center;
    gap: 10px;
}

.botao-atualizar {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    min-height: 2.85rem;
    padding: 0.75rem 1.2rem;
    border: 1px solid color-mix(in oklab, var(--color-primary) 24%, white);
    border-radius: 999px;
    background: linear-gradient(135deg, #176edc, #0f4ea9);
    color: white;
    cursor: pointer;
    font-weight: 700;
    box-shadow: 0 12px 24px rgba(19, 102, 214, 0.24);
    transition: transform 0.16s ease, box-shadow 0.16s ease;
    white-space: nowrap;
    flex: 0 0 auto;
}

.botao-atualizar:hover {
    transform: translateY(-1px);
    box-shadow: 0 16px 28px rgba(19, 102, 214, 0.28);
}

.botao-atualizar:disabled {
    opacity: 0.72;
    cursor: default;
    transform: none;
}

.refresh-button-icon {
    font-size: 1rem;
    line-height: 1;
}

.update-status-chip {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    min-height: 2.7rem;
    padding: 0.5rem 0.9rem;
    border: 1px solid color-mix(in oklab, var(--color-base-content) 8%, white);
    border-radius: 999px;
    background: rgba(255, 255, 255, 0.82);
    white-space: nowrap;
    flex: 1 1 auto;
    min-width: 0;
}

body[data-theme="dark-riob"] .update-status-chip {
    border-color: rgba(113, 149, 197, 0.32);
    background: rgba(16, 31, 52, 0.9);
}

.texto-atualizacao {
    display: inline-flex;
    align-items: center;
    color: color-mix(in oklab, var(--color-base-content) 58%, transparent);
    font-size: 0.8rem;
    font-weight: 600;
    white-space: nowrap;
}

.update-label-short {
    display: none;
}

.update-time-value {
    font-size: 0.82rem;
    font-weight: 700;
}

.update-time-icon {
    min-width: 1rem;
    font-size: 0.95rem;
    line-height: 1;
}

.map-frame {
    position: relative;
    flex: 1 1 auto;
    min-height: 0;
    padding: 0;
    overflow: hidden;
}

.map-frame-header {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 4px 6px 10px;
}

.map-frame-copy {
    display: flex;
    flex-direction: column;
    gap: 2px;
}

.map-frame-title {
    font-size: 0.9rem;
    font-weight: 750;
}

.map-frame-subtitle {
    font-size: 0.76rem;
    color: color-mix(in oklab, var(--color-base-content) 54%, transparent);
}

.map-frame .leaflet-container {
    border-radius: calc(var(--radius-box) - 0.25rem);
    overflow: hidden;
}

.leaflet-control-layers label .leaflet-layer-label-text {
    display: inline-block;
    transition: opacity 0.18s ease, color 0.18s ease;
    opacity: 1;
}

.leaflet-control-layers label .leaflet-layer-label-text.locale-fade {
    opacity: 0.2;
}

.caixa-legenda {
    background: rgba(255, 255, 255, 0.96);
    padding: 10px 12px;
    border-radius: 1rem;
    box-shadow: 0 10px 22px rgba(31, 42, 55, 0.1);
    border: 1px solid rgba(255, 255, 255, 0.82);
    backdrop-filter: none;
    font-family: "Segoe UI", sans-serif;
    font-size: clamp(9px, 1.1vw, 12px);
    line-height: 1.45;
    max-height: 38vh;
    overflow-y: auto;
    overflow-x: hidden;
}

body[data-theme="dark-riob"] .caixa-legenda {
    background: rgba(17, 32, 53, 0.95);
    box-shadow: 0 10px 22px rgba(2, 8, 20, 0.42);
    border-color: rgba(93, 132, 189, 0.32);
}

.caixa-legenda > b:first-child {
    display: inline-flex !important;
    align-items: center;
    gap: 6px;
    margin-bottom: 6px !important;
    color: color-mix(in oklab, var(--color-base-content) 86%, transparent);
}

.caixa-legenda img {
    border-radius: 999px;
    background: rgba(255, 255, 255, 0.85);
    border: 1px solid rgba(31, 42, 55, 0.1);
}

body[data-theme="dark-riob"] .caixa-legenda img {
    background: rgba(21, 39, 64, 0.88);
    border-color: rgba(147, 180, 223, 0.25);
}

@media (max-width: 768px) {
    .shell-main {
        flex-direction: column;
        overflow-y: auto;
    }

    .controles {
        width: 100%;
        flex-direction: row;
        overflow-y: visible;
        padding: 0 12px 10px;
        gap: 8px;
        flex-wrap: wrap;
    }

    .controls-card {
        flex: 1 1 100%;
    }

    .toolbar-card {
        flex: 1 1 100%;
        flex-direction: row;
    }

    .update-status-chip {
        flex: 1;
    }

    .shell-map-container {
        height: min(500px, 60vh);
        flex: 0 0 auto !important;
    }
}

.botao-localizacao {
    width: 40px;
    height: 40px;
    background: rgba(255,255,255,0.96);
    border: 1px solid rgba(31,42,55,0.16);
    border-radius: 999px;
    cursor: pointer;
    font-size: 17px;
    line-height: 1;
    box-shadow: 0 10px 24px rgba(15, 36, 61, 0.18);
    padding: 0;
    display: flex;
    align-items: center;
    justify-content: center;
}

body[data-theme="dark-riob"] .botao-localizacao,
body[data-theme="dark-riob"] .botao-instalar {
    background: rgba(15, 29, 49, 0.95);
    color: #d8e8ff;
    border-color: rgba(121, 159, 211, 0.35);
    box-shadow: 0 10px 24px rgba(2, 8, 20, 0.42);
}

.botao-localizacao-container {
    position: absolute;
    top: 82px;
    left: 10px;
    z-index: 1000;
}

.botao-instalar-container {
    position: absolute;
    top: 82px;
    left: 58px;
    z-index: 1000;
}

.botao-instalar {
    min-height: 38px;
    padding: 0 14px;
    border: 1px solid rgba(19,102,214,0.18);
    border-radius: 999px;
    background: rgba(255,255,255,0.92);
    color: #0f4ea9;
    cursor: pointer;
    font-size: 12px;
    font-weight: 700;
    line-height: 1;
    box-shadow: 0 10px 24px rgba(15, 36, 61, 0.16);
    align-items: center;
    justify-content: center;
}

.botao-instalar:hover {
    background: #1366d6;
    color: #ffffff;
}

.legenda-container {
    position: absolute;
    bottom: 30px;
    left: 16px;
    z-index: 10000;
    pointer-events: auto;
}

.error-banner {
    border: none;
    border-bottom: 1px solid color-mix(in oklab, var(--color-warning) 35%, white);
    background: color-mix(in oklab, var(--color-warning) 16%, white);
    color: color-mix(in oklab, var(--color-warning-content) 90%, var(--color-base-content));
    padding: 7px 12px;
    font-size: 12px;
    text-align: center;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
}

/* ==============================================================================
   Dash Components
   ============================================================================== */

.tabs-filtro-parent {
    width: 100%;
}

.tabs-panel-content {
    padding-top: 4px;
    display: flex;
    flex-direction: column;
    align-items: center;
    width: 100%;
}

/* daisyUI hides any .tab-content globally; override for Dash's dcc.Tabs panel */
.tabs-filtro-parent .tab-content {
    display: block !important;
    visibility: visible !important;
    width: 100%;
}

.tabs-filtro-container {
    display: flex !important;
    flex-wrap: nowrap !important;
    width: 100%;
    gap: 8px;
    padding: 4px;
    border-radius: 1rem;
    background: color-mix(in oklab, var(--color-base-200) 88%, white);
}

body[data-theme="dark-riob"] .tabs-filtro-container {
    background: color-mix(in oklab, var(--color-base-200) 90%, rgba(12, 24, 41, 0.9));
}

.tabs-filtro-item {
    display: inline-flex !important;
    align-items: center !important;
    justify-content: center !important;
    flex: 1 !important;
    white-space: nowrap;
    border-radius: 0.85rem !important;
    border: 1px solid transparent !important;
    background: transparent !important;
    color: color-mix(in oklab, var(--color-base-content) 60%, transparent) !important;
    min-height: 32px !important;
    padding: 4px 12px !important;
    line-height: 20px !important;
    font-size: 12px !important;
    font-weight: 600 !important;
}

.tabs-filtro-item--selected {
    background: rgba(255, 255, 255, 0.92) !important;
    color: var(--color-base-content) !important;
    border-color: rgba(255, 255, 255, 0.82) !important;
    box-shadow: 0 10px 20px rgba(31, 42, 55, 0.08) !important;
    font-weight: 700 !important;
}

body[data-theme="dark-riob"] .tabs-filtro-item--selected {
    background: rgba(20, 38, 63, 0.95) !important;
    border-color: rgba(120, 158, 210, 0.4) !important;
    box-shadow: 0 8px 18px rgba(2, 8, 20, 0.36) !important;
}

.dropdown .Select-control {
    min-height: 44px;
    border-radius: 0.95rem;
    border: 1px solid color-mix(in oklab, var(--color-base-content) 8%, white);
    background: #ffffff;
    box-shadow: 0 8px 18px rgba(31, 42, 55, 0.06);
}

body[data-theme="dark-riob"] .dropdown .Select-control {
    border-color: rgba(115, 152, 204, 0.28);
    background: rgba(16, 30, 50, 0.94);
    box-shadow: 0 8px 18px rgba(2, 8, 20, 0.3);
}

.dropdown .Select.is-focused > .Select-control,
.dropdown .Select-control:hover {
    border-color: color-mix(in oklab, var(--color-primary) 45%, white);
    box-shadow: 0 0 0 3px color-mix(in oklab, var(--color-primary) 18%, transparent);
}

.dropdown .Select-value-label,
.dropdown .Select-placeholder,
.dropdown .Select-input > input {
    color: var(--color-base-content) !important;
}

.dropdown .Select-menu-outer {
    margin-top: 8px;
    z-index: 11000 !important;
    border-radius: 1rem;
    border: 1px solid #e8edf2;
    background: #ffffff;
    box-shadow: 0 18px 34px rgba(31, 42, 55, 0.14);
}

body[data-theme="dark-riob"] .dropdown .Select-menu-outer {
    border-color: rgba(113, 149, 197, 0.35);
    background: rgba(15, 29, 49, 0.98);
    box-shadow: 0 18px 34px rgba(2, 8, 20, 0.5);
}

body[data-theme="dark-riob"] .dropdown .Select-option {
    background: rgba(15, 29, 49, 0.98);
    color: #dce8fa;
}

body[data-theme="dark-riob"] .dropdown .Select-option.is-focused {
    background: color-mix(in oklab, var(--color-primary) 18%, rgba(15, 29, 49, 0.98));
}

.dropdown .Select-menu {
    z-index: 11000 !important;
}

.dropdown .Select-option.is-focused {
    background: color-mix(in oklab, var(--color-primary) 12%, white);
}

.dropdown .Select--multi .Select-value {
    border-radius: 999px;
    border: none;
    background: color-mix(in oklab, var(--color-primary) 14%, white);
    color: var(--color-primary);
}

@media (max-width: 640px) {
    .header {
        padding-top: 8px;
    }

    .shell-navbar {
        padding: 8px 12px;
        gap: 10px;
    }

    .header-icon {
        width: 2.3rem;
        height: 2.3rem;
        font-size: 1rem;
    }

    .btn-theme-toggle {
        width: 2rem;
        height: 2rem;
        font-size: 0.92rem;
    }

    .dropdown-locale {
        min-width: 88px;
        font-size: 0.7rem;
    }

    .dropdown-locale .Select-control {
        min-height: 2rem;
        height: 2rem;
    }

    .header-titulo {
        font-size: 0.9rem;
    }

    .header-subtitulo {
        font-size: 0.68rem;
    }

    .header-build-badge {
        font-size: 0.62rem;
        padding: 0.18rem 0.46rem;
    }

    .controles {
        flex-direction: column;
        gap: 8px;
        padding: 8px 10px;
    }

    .controls-card,
    .toolbar-card {
        width: 100%;
        flex: 0 0 auto;
    }

    .toolbar-card {
        flex-direction: row;
        flex-wrap: nowrap;
        justify-content: space-between;
        padding: 8px 10px;
        gap: 6px;
    }

    .botao-atualizar {
        min-height: 2.45rem;
        padding: 0.62rem 0.9rem;
        gap: 6px;
        font-size: 0.82rem;
    }

    .update-status-chip {
        min-height: 2.45rem;
        padding: 0.45rem 0.72rem;
        gap: 4px;
    }

    .texto-atualizacao {
        font-size: 0.72rem;
    }

    .update-label-full {
        display: none;
    }

    .update-label-short {
        display: inline;
    }

    .update-time-value {
        font-size: 0.76rem;
    }

    .update-time-icon {
        min-width: 0.8rem;
        font-size: 0.82rem;
    }

    .tabs-filtro-container {
        gap: 6px;
        padding: 3px;
    }

    .tabs-filtro-item {
        min-height: 30px !important;
        padding: 4px 8px !important;
        line-height: 18px !important;
        font-size: 11px !important;
    }

    .tabs-panel-content {
        padding-top: 2px;
    }

    .dropdown .Select-control {
        min-height: 40px;
    }

    .dropdown .Select-placeholder,
    .dropdown .Select-value-label,
    .dropdown .Select-input > input {
        font-size: 16px !important;
    }

    .botao-instalar-container {
        top: 82px;
        left: 58px;
    }

    .botao-instalar {
        min-height: 34px;
        padding: 0 10px;
        font-size: 11px;
    }

    .botao-localizacao-container {
        top: 82px;
        left: 10px;
    }

    .legenda-container {
        left: 10px;
        right: auto;
        bottom: 18px;
        max-width: calc(100vw - 20px);
    }

    .caixa-legenda {
        width: max-content;
        max-width: min(220px, calc(100vw - 24px));
    }
}
/* ==============================================================================
   Recurso de Trajetos (MOTIS) - Design Premium
   ============================================================================== */

.routing-panel {
    display: flex;
    flex-direction: column;
    gap: 0;
    background: var(--color-base-100);
}

.routing-input-container {
    padding: 1rem;
    position: relative;
    background: linear-gradient(180deg, var(--color-base-100), var(--color-base-200));
    border-bottom: 1px solid var(--color-base-300);
}

.routing-input-wrapper {
    position: relative;
    display: flex;
    flex-direction: column;
    gap: 8px;
    margin-bottom: 16px;
}

/* Conector visual entre origem e destino */
.routing-input-wrapper::before {
    content: "";
    position: absolute;
    left: 14px;
    top: 24px;
    bottom: 24px;
    width: 2px;
    background: repeating-linear-gradient(to bottom, var(--color-base-300), var(--color-base-300) 4px, transparent 4px, transparent 8px);
    z-index: 1;
}

.routing-input-row {
    display: flex;
    align-items: center;
    gap: 12px;
    position: relative;
    z-index: 2;
}

.routing-dot {
    min-width: 10px;
    height: 10px;
    border-radius: 50%;
    background: var(--color-base-300);
    border: 2px solid var(--color-base-100);
    box-shadow: 0 0 0 2px var(--color-base-300);
}

.routing-dot--origin { background: var(--color-info); box-shadow: 0 0 0 2px var(--color-info); }
.routing-dot--dest { background: var(--color-error); box-shadow: 0 0 0 2px var(--color-error); }

.routing-input {
    flex: 1;
    background: var(--color-base-100) !important;
    border: 1px solid var(--color-base-300) !important;
    border-radius: 0.75rem !important;
    padding: 8px 12px !important;
    font-size: 0.85rem !important;
    transition: all 0.2s ease;
}

.routing-input:focus {
    border-color: var(--color-primary) !important;
    box-shadow: 0 0 0 3px color-mix(in oklab, var(--color-primary) 20%, transparent) !important;
    outline: none;
}

.btn-routing-search {
    width: 100%;
    height: 3rem;
    border-radius: 0.85rem;
    font-weight: 800;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    background: linear-gradient(135deg, var(--color-primary), color-mix(in oklab, var(--color-primary) 80%, black));
    color: var(--color-primary-content);
    border: none;
    cursor: pointer;
    transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
    box-shadow: 0 4px 14px color-mix(in oklab, var(--color-primary) 40%, transparent);
}

.btn-routing-search:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 20px color-mix(in oklab, var(--color-primary) 50%, transparent);
    filter: brightness(1.1);
}

.btn-routing-search:active {
    transform: translateY(0);
}

/* Cards de Itinerário */
.itinerary-card {
    margin: 12px;
    padding: 16px;
    border-radius: 1.1rem;
    background: var(--color-base-100);
    border: 1px solid var(--color-base-300);
    cursor: pointer;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    position: relative;
    overflow: hidden;
}

.itinerary-card:hover {
    border-color: var(--color-primary);
    transform: translateX(4px);
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.05);
}

.itinerary-card--active {
    border-color: var(--color-primary);
    background: color-mix(in oklab, var(--color-primary) 4%, var(--color-base-100));
    box-shadow: 0 12px 32px rgba(0, 0, 0, 0.08);
}

.itinerary-card--active::before {
    content: "";
    position: absolute;
    left: 0;
    top: 0;
    bottom: 0;
    width: 4px;
    background: var(--color-primary);
}

/* Timeline Minimalista */
.routing-timeline {
    margin-top: 16px;
    padding-top: 16px;
    border-top: 1px solid var(--color-base-300);
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.timeline-step {
    display: flex;
    gap: 16px;
    position: relative;
}

.timeline-icon-col {
    display: flex;
    flex-direction: column;
    align-items: center;
    position: relative;
}

.timeline-line {
    position: absolute;
    top: 24px;
    bottom: -12px;
    width: 2px;
    background: var(--color-base-300);
}

.timeline-step:last-child .timeline-line {
    display: none;
}

.timeline-icon-circle {
    width: 24px;
    height: 24px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 12px;
    background: var(--color-base-200);
    z-index: 2;
}

.timeline-content {
    flex: 1;
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.timeline-title {
    font-weight: 700;
    font-size: 0.85rem;
    color: var(--color-base-content);
}

.timeline-stop {
    font-size: 0.75rem;
    opacity: 0.7;
    display: flex;
    align-items: center;
    gap: 6px;
}

.timeline-duration {
    font-size: 0.7rem;
    font-style: italic;
    opacity: 0.4;
    margin: 4px 0 4px 12px;
}

/* Paradas intermediárias no card */
.timeline-stops-list {
    list-style: none;
    padding: 6px 0 6px 12px;
    margin: 4px 0;
    border-left: 2px dashed var(--color-base-300);
    display: flex;
    flex-direction: column;
    gap: 4px;
    max-height: 200px;
    overflow-y: auto;
    scrollbar-width: thin;
    scrollbar-color: var(--color-base-300) transparent;
}

.timeline-stops-list::-webkit-scrollbar {
    width: 4px;
}

.timeline-stops-list::-webkit-scrollbar-thumb {
    background: var(--color-base-300);
    border-radius: 4px;
}

.timeline-intermediate-stop {
    font-size: 0.72rem;
    opacity: 0.65;
    padding: 2px 0;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    transition: opacity 0.2s;
}

.timeline-intermediate-stop:hover {
    opacity: 1;
}

.timeline-intermediate-stop::before {
    content: "•";
    margin-right: 5px;
    opacity: 0.5;
}

/* Crédito Transitous */
.routing-credit {
    display: flex;
    align-items: center;
    gap: 3px;
    padding: 8px 12px;
    margin-top: 8px;
    border-top: 1px solid var(--color-base-300);
    flex-wrap: wrap;
}

.routing-credit-icon {
    font-size: 0.7rem;
}

.routing-credit-text {
    font-size: 0.68rem;
    opacity: 0.45;
    color: var(--color-base-content);
}

.routing-credit-link {
    font-size: 0.68rem;
    font-weight: 700;
    text-decoration: none;
    color: var(--color-primary);
    opacity: 0.7;
    transition: opacity 0.2s;
}

.routing-credit-link:hover {
    opacity: 1;
    text-decoration: underline;
}
