/* Fase 2 UI — não altera popup/comandos do veículo */

body.avsl-ui-fase2 #fleet-panel .device-search-bar {
    position: sticky;
    top: 0;
    z-index: 12;
    background: #fff;
    box-shadow: 0 2px 8px rgba(15, 23, 42, 0.06);
}

html.theme-dark body.avsl-ui-fase2 #fleet-panel .device-search-bar {
    background: #1e293b;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.35);
}

body.avsl-ui-fase2 #fleet-panel .devicesView .x-column-header-text-inner,
body.avsl-ui-fase2 #fleet-panel devicesview .x-column-header-text-inner {
    font-size: 11px;
}

body.avsl-ui-fase2 .avsl-status-dot {
    display: inline-block;
    width: 8px;
    height: 8px;
    border-radius: 50%;
    margin-right: 6px;
    vertical-align: middle;
    flex-shrink: 0;
}

body.avsl-ui-fase2 .avsl-status-dot.online { background: #16a34a; }
body.avsl-ui-fase2 .avsl-status-dot.offline { background: #dc2626; }
body.avsl-ui-fase2 .avsl-status-dot.unknown { background: #d97706; }

body.avsl-ui-fase2 #fleet-panel .x-grid-cell-inner {
    font-size: 12px;
    line-height: 1.35;
}

body.avsl-ui-fase2 #fleet-panel .x-grid-cell[data-columnid*="attributes"] .x-grid-cell-inner,
body.avsl-ui-fase2 #fleet-panel .x-grid-cell:last-child .x-grid-cell-inner {
    white-space: nowrap;
    letter-spacing: 0;
}

body.avsl-ui-fase2 .stateView .x-grid-row[data-avsl-address="1"] .x-grid-cell:nth-child(2) .x-grid-cell-inner {
    max-height: 2.8em;
    overflow: hidden;
    cursor: pointer;
}

body.avsl-ui-fase2 .stateView .x-grid-row[data-avsl-address="1"].avsl-address-open .x-grid-cell:nth-child(2) .x-grid-cell-inner {
    max-height: none;
}

body.avsl-ui-fase2 .stateView .x-grid-row[data-avsl-address="1"]:not(.avsl-address-open) .x-grid-cell:nth-child(2) .x-grid-cell-inner::after {
    content: " (clique para expandir)";
    color: #64748b;
    font-size: 11px;
}

html.theme-dark body.avsl-ui-fase2 .x-grid-item.x-grid-item-selected,
html.theme-dark body.avsl-ui-fase2 .x-grid-item.x-grid-item-selected[class*="view-color-"] {
    background-color: rgba(59, 130, 246, 0.55) !important;
    box-shadow: inset 4px 0 0 #93c5fd;
}

html.theme-dark body.avsl-ui-fase2 .x-grid-item.x-grid-item-selected .x-grid-cell-inner {
    color: #f8fafc !important;
}

html.theme-dark body.avsl-ui-fase2 .view-color-red .x-grid-cell-inner,
html.theme-dark body.avsl-ui-fase2 .view-color-green .x-grid-cell-inner {
    color: #e2e8f0;
}

@media (max-width: 768px) {
    body.avsl-ui-fase2 #fleet-panel {
        width: 100% !important;
        max-width: 100vw;
    }
    body.avsl-ui-fase2 #fleet-panel .x-grid-cell-inner {
        font-size: 11px;
    }
    body.avsl-ui-fase2 .fleet-summary {
        height: auto !important;
        min-height: 72px;
    }
}
