/* ── Widget KM ──────────────────────────────────────── */
.widget-km {
    margin: 20px 0;
    border: 1px solid #ddd;
    border-radius: 4px;
    background-color: #fff;
    box-shadow: 0 2px 4px rgba(0,0,0,0.1);
}

.widget-km .widget-header {
    background-color: #f5f5f5;
    padding: 15px;
    border-bottom: 1px solid #ddd;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.widget-km .widget-header h3 {
    margin: 0;
    font-size: 18px;
    color: #333;
}

.widget-km .filtros {
    display: flex;
    flex-direction: row;
    align-items: center;
    gap: 5px;
    padding: 8px 15px;
    border-bottom: 1px solid #eee;
}

.widget-km .filtros label {
    margin: 0;
    font-size: 12px;
    color: #555;
    flex-shrink: 0;
}

.widget-km .filtros input[type="date"] {
    width: 130px;
    flex-shrink: 0;
    padding: 3px 5px;
    border: 1px solid #ccc;
    border-radius: 3px;
    font-size: 12px;
}

.widget-km .filtros button {
    flex-shrink: 0;
    padding: 3px 10px;
    background-color: #007bff;
    color: #fff;
    border: none;
    border-radius: 3px;
    font-size: 12px;
    cursor: pointer;
}

.widget-km .filtros button:hover:not([disabled]) {
    background-color: #0056b3;
}

.widget-km .filtros button[disabled] {
    background-color: #6c9fd8;
    cursor: not-allowed;
}


.widget-km .widget-info {
    display: flex;
    gap: 6px;
    flex-wrap: wrap;
    margin-top: 4px;
}

/* ── Scroll container ───────────────────────────────── */
.widget-km .km-scroll {
    max-height: 620px;
    overflow-y: auto;
}

/* ── Seção por embarcador ───────────────────────────── */
.widget-km .emb-section {
    border-bottom: 1px solid #eee;
}

.widget-km .emb-section:last-child {
    border-bottom: none;
}

.widget-km .emb-row {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 10px 15px;
    cursor: pointer;
    transition: background-color 0.15s;
    user-select: none;
}

.widget-km .emb-row:hover {
    background-color: #f0f8ff;
}

.widget-km .emb-row .bullet {
    width: 8px;
    height: 8px;
    background-color: #17a2b8;
    border-radius: 50%;
    flex-shrink: 0;
}

.widget-km .emb-nome {
    flex: 1;
    font-weight: 600;
    font-size: 13px;
    color: #333;
    text-transform: uppercase;
}

.widget-km .emb-toggle {
    font-size: 10px;
    color: #888;
}

.widget-km .emb-total {
    background-color: #17a2b8;
    color: #fff;
    padding: 2px 9px;
    border-radius: 12px;
    font-size: 12px;
    font-weight: bold;
    flex-shrink: 0;
}

/* ── Tabela de veículos ─────────────────────────────── */
.widget-km .km-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 13px;
    background-color: #fafafa;
}

.widget-km .km-table thead tr {
    background-color: #e9ecef;
}

.widget-km .km-table th {
    padding: 6px 10px;
    text-align: left;
    font-weight: 600;
    color: #555;
    font-size: 11px;
    text-transform: uppercase;
    letter-spacing: 0.03em;
    border-bottom: 1px solid #dee2e6;
    white-space: nowrap;
}

.widget-km .km-table th.th-num {
    text-align: right;
}

.widget-km .km-table tbody tr {
    border-bottom: 1px solid #f0f0f0;
    transition: background-color 0.1s;
}

.widget-km .km-table tbody tr:last-child {
    border-bottom: none;
}

.widget-km .km-table tbody tr:hover {
    background-color: #eef7ff;
}

.widget-km .km-table td {
    padding: 6px 10px;
    color: #333;
    font-size: 12px;
}

.widget-km .km-table .td-sigla {
    font-weight: 600;
    text-transform: uppercase;
    color: #222;
}

.widget-km .km-table .td-num {
    text-align: right;
    font-variant-numeric: tabular-nums;
    white-space: nowrap;
}

.widget-km .km-table .td-rodado {
    color: #28a745;
    font-weight: 600;
}

/* ── Estados ────────────────────────────────────────── */
.widget-km .loading-spinner {
    text-align: center;
    padding: 20px;
    color: #999;
}

.widget-km .erro-mensagem {
    background-color: #f8d7da;
    color: #721c24;
    padding: 12px 15px;
    border: 1px solid #f5c6cb;
    border-radius: 4px;
    margin: 15px;
}

.widget-km .vazio-mensagem {
    text-align: center;
    padding: 30px;
    color: #999;
}

@media (max-width: 768px) {
    .widget-km .widget-header {
        flex-direction: column;
        align-items: flex-start;
    }

    .widget-km .km-table .td-num {
        width: auto;
    }
}
