body {
    display: flex;
    min-height: 100vh;
    flex-direction: column;
}

main {
    flex: 1 0 auto;
}

.animated.rotateFull {
    -webkit-animation-name: rotate;
}

.hidden {
    display: none !important;
}

@-webkit-keyframes rotate {
    from {
        -webkit-transform: rotate(0deg);
    }
    to {
        -webkit-transform: rotate(360deg);
    }
}

.list-card-veiculos .card.veiculo-desligado .card-content i,
.list-card-veiculos .card.veiculo-desligado .card-content .card-title {
    color: #d50000;
}

.list-card-veiculos .card.veiculo-desligado {
    border-left: 3.5px solid #d50000;
}

.list-card-veiculos .card.veiculo-ligado .card-content i,
.list-card-veiculos .card.veiculo-ligado .card-content .card-title {
    color: #1b5e20;
}

.list-card-veiculos .card.veiculo-ligado {
    border-left: 3.5px solid #1b5e20;
}

.list-card-veiculos .card.veiculo-bloqueado .card-content i,
.list-card-veiculos .card.veiculo-bloqueado .card-content .card-title {
    color: #000 !important;
}

.list-card-veiculos .card.veiculo-bloqueado {
    border-left: 3.5px solid #000 !important;
}

.list-card-veiculos .card .card-content,
.list-card-veiculos .card .card-action {
    padding-left: 18px !important;
    padding-right: 18px !important;
}

table.table-sm tr td {
    padding: 6px 5px;
}

.box-resumo-dia {
    display: flex;
    justify-content: start;
    flex-wrap: wrap;
}

.box-resumo-dia .card-resumo-dia {
    width: 18vh;
    margin: 0 auto;
    margin-bottom: 12px;
}

.box-resumo-dia .card {
    text-align: center;
    margin: 0;
}

.box-resumo-dia .card .card-content {
    padding: 12px;
}

.box-resumo-dia .card .card-content .card-title {
    font-size: 1.2em;
    line-height: normal;
}

.card .card-mapa-historico {
    height: 280px;
}

.valor {
    font-size: 1.5rem;
    margin-left: 5px;
}

.icone {
    font-size: 1.5rem;
}

.card-dash {
    flex-direction: column;
    /* organiza os itens em coluna */
    align-items: center;
    /* centraliza horizontalmente */
    justify-content: center;
    /* centraliza verticalmente (se houver altura definida) */
    text-align: center;
    /* centraliza textos */
    padding: 10px;
}

.dashboard-main {
    padding-bottom: 28px;
}

.dashboard-container {
    display: grid;
    gap: 20px;
}

.dashboard-section {
    min-width: 0;
}

.dashboard-section-heading {
    align-items: flex-end;
    display: flex;
    justify-content: space-between;
    margin-bottom: 10px;
}

.dashboard-section-heading h1,
.dashboard-section-heading h2 {
    color: #0f172a;
    font-size: 1.05rem;
    font-weight: 800;
    line-height: 1.2;
    margin: 0;
}

.dashboard-section-heading p {
    color: #64748b;
    font-size: 0.76rem;
    margin: 3px 0 0;
}

.dashboard-live-label {
    align-items: center;
    color: #00875a;
    display: inline-flex;
    font-size: 0.68rem;
    font-weight: 800;
    gap: 5px;
    text-transform: uppercase;
}

.dashboard-live-label i {
    background: #10b981;
    border-radius: 50%;
    box-shadow: 0 0 0 4px rgba(16, 185, 129, 0.13);
    height: 7px;
    width: 7px;
}

.dashboard-grid {
    display: grid;
    gap: 9px;
    grid-template-columns: repeat(3, minmax(0, 1fr));
}

.dashboard-card {
    align-items: center;
    background: #fff;
    border: 1px solid #e2e8f0;
    border-radius: 10px;
    display: flex;
    gap: 12px;
    min-height: 92px;
    padding: 14px;
}

.dashboard-card-icon {
    align-items: center;
    background: #f1f5f9;
    border-radius: 9px;
    color: #475569;
    display: inline-flex;
    flex: 0 0 42px;
    height: 42px;
    justify-content: center;
    width: 42px;
}

.dashboard-card-icon i {
    font-size: 21px;
}

.dashboard-card-content {
    display: flex;
    flex-direction: column;
    min-width: 0;
}

.dashboard-card-content strong {
    color: #0f172a;
    font-size: 1.45rem;
    font-weight: 800;
    line-height: 1;
}

.dashboard-card-content > span {
    color: #334155;
    font-size: 0.78rem;
    font-weight: 700;
    margin-top: 5px;
}

.dashboard-card-content small {
    color: #64748b;
    font-size: 0.64rem;
    margin-top: 3px;
}

.dashboard-card-success {
    border-color: #b7ead7;
}

.dashboard-card-success .dashboard-card-icon {
    background: #e9fbf4;
    color: #00875a;
}

.dashboard-card-danger {
    border-color: #fecaca;
}

.dashboard-card-danger .dashboard-card-icon {
    background: #fff1f2;
    color: #dc2626;
}

.dashboard-card-warning {
    border-color: #f6d99a;
}

.dashboard-card-warning .dashboard-card-icon {
    background: #fff8e8;
    color: #d28a00;
}

.dashboard-card-info .dashboard-card-icon {
    background: #eef6ff;
    color: #2563eb;
}

.dashboard-card-muted .dashboard-card-icon {
    color: #64748b;
}

.dashboard-card-loading {
    background: linear-gradient(90deg, #f8fafc 25%, #eef2f5 45%, #f8fafc 65%);
    background-size: 200% 100%;
    border-color: #e5e7eb;
    min-height: 92px;
    animation: dashboard-loading 1.2s linear infinite;
}

.dashboard-empty-state {
    align-items: center;
    background: #fff;
    border: 1px solid #e2e8f0;
    border-radius: 10px;
    color: #64748b;
    display: flex;
    flex-direction: column;
    grid-column: 1 / -1;
    padding: 32px 18px;
    text-align: center;
}

.dashboard-empty-state i {
    color: #94a3b8;
    font-size: 34px;
}

.dashboard-empty-state strong {
    color: #334155;
    margin-top: 6px;
}

.dashboard-empty-state span {
    font-size: 0.76rem;
    margin-top: 3px;
}

@keyframes dashboard-loading {
    to {
        background-position: -200% 0;
    }
}

.monitoramento-page {
    background: #eef2f5 !important;
    color: #111827;
}

.app-page {
    background: #eef2f5 !important;
    color: #111827;
    font-family: 'Inter', sans-serif !important;
}

.app-shell-header {
    background: linear-gradient(135deg, #06111d 0%, #0a1d31 52%, #07101a 100%);
    box-shadow: 0 3px 14px rgba(15, 23, 42, 0.28);
    padding: 6px 16px 9px;
    position: sticky;
    top: 0;
    z-index: 20;
}

.app-topbar,
.app-searchbar,
.monitoramento-main,
.app-container {
    max-width: 720px;
    margin-left: auto;
    margin-right: auto;
}

.app-page-main {
    background: #eef2f5;
    padding: 14px 12px 92px;
    width: 100%;
}

.app-container {
    width: 100%;
}

.app-map-main {
    background: #eef2f5;
}

.app-map-main #espacoMapa {
    height: calc(100vh - 61px) !important;
}

.app-page .card,
.app-page-card {
    border: 1px solid #e2e8f0;
    border-radius: 10px;
    box-shadow: 0 8px 22px rgba(15, 23, 42, 0.1);
    overflow: hidden;
}

.app-page .collection {
    border: 0;
    border-radius: 10px;
    box-shadow: 0 8px 22px rgba(15, 23, 42, 0.1);
    overflow: hidden;
}

.app-page .input-field {
    margin-top: 0;
}

.app-page input:not([type]),
.app-page input[type=text],
.app-page input[type=number],
.app-page .select-wrapper input.select-dropdown {
    border-bottom-color: #cbd5e1 !important;
    color: #0f172a;
}

.app-section-title {
    color: #0f172a;
    display: block;
    font-size: 1rem;
    font-weight: 800;
    margin: 6px 0 10px;
}

.app-primary-btn {
    align-items: center;
    background: #00875a;
    border: 0;
    border-radius: 8px;
    color: #fff;
    cursor: pointer;
    display: inline-flex;
    font-size: 0.9rem;
    font-weight: 800;
    min-height: 38px;
    padding: 0 14px;
}

.app-page pre {
    background: #f8fafc;
    border: 1px solid #e2e8f0;
    border-radius: 8px;
    color: #334155;
    overflow: auto;
    padding: 10px;
    white-space: pre-wrap;
}

.sidenav {
    background: #f8fafc;
}

.sidenav .user-view {
    background: linear-gradient(135deg, #06111d 0%, #0a1d31 100%);
    margin-bottom: 8px;
    padding: 18px 20px 16px;
}

.sidenav .user-view::before {
    background: url('../img/localiza-logo-branco.png') center / contain no-repeat;
    content: '';
    display: block;
    height: 42px;
    margin: 0 auto 10px;
    width: 170px;
}

.sidenav .user-view .name {
    color: #fff;
    font-size: 0.86rem;
    font-weight: 800;
    letter-spacing: 0;
}

.sidenav li > a {
    align-items: center;
    color: #0f172a;
    display: flex;
    font-weight: 700;
}

.sidenav li > a i.material-icons {
    color: #475569;
    margin-right: 18px;
}

.login-page {
    min-height: 100vh;
}

.login-main {
    align-items: center;
    display: flex;
    justify-content: center;
    min-height: 100vh;
    padding: 24px 12px;
}

.login-card {
    background: #fff;
    border: 1px solid #e2e8f0;
    border-radius: 10px;
    box-shadow: 0 12px 30px rgba(15, 23, 42, 0.12);
    margin: 0;
    max-width: 390px;
    padding: 28px 20px 24px;
    width: 100%;
}

.app-topbar {
    align-items: center;
    display: grid;
    grid-template-columns: 36px 1fr 70px;
    min-height: 46px;
}

.app-logo {
    display: block;
    height: 38px;
    justify-self: center;
    max-width: 270px;
    object-fit: contain;
    width: 66%;
}

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

.app-icon-btn,
.app-clear-btn {
    align-items: center;
    background: transparent;
    border: 0;
    color: #fff;
    cursor: pointer;
    display: inline-flex;
    height: 32px;
    justify-content: center;
    padding: 0;
    width: 32px;
}

.app-icon-btn i {
    font-size: 24px;
}

.app-notification {
    position: relative;
}

.app-notification span {
    background: #ef1f2f;
    border: 2px solid #06111d;
    border-radius: 50%;
    height: 10px;
    position: absolute;
    right: 3px;
    top: 3px;
    width: 10px;
}

.app-searchbar {
    align-items: center;
    display: grid;
    gap: 7px;
    grid-template-columns: minmax(0, 1fr) auto;
}

.app-search-field {
    align-items: center;
    background: rgba(255, 255, 255, 0.07);
    border: 1px solid rgba(255, 255, 255, 0.09);
    border-radius: 10px;
    display: flex;
    height: 38px;
    min-width: 0;
    padding: 0 10px;
}

.app-search-field > i {
    color: #b8c4d2;
    font-size: 20px;
    margin-right: 7px;
}

.app-search-field input[type=search] {
    background: transparent;
    border: 0 !important;
    box-shadow: none !important;
    color: #fff;
    font-size: 0.9rem;
    height: 36px;
    margin: 0;
    min-width: 0;
}

.app-search-field input[type=search]::placeholder {
    color: #93a2b4;
}

.app-clear-btn {
    color: #93a2b4;
    flex: 0 0 28px;
    height: 28px;
    width: 28px;
}

.app-clear-btn i,
.app-filter-btn i {
    font-size: 20px;
}

.app-filter-btn {
    align-items: center;
    background: rgba(255, 255, 255, 0.06);
    border: 1px solid rgba(255, 255, 255, 0.12);
    border-radius: 10px;
    color: #fff;
    display: inline-flex;
    height: 38px;
    justify-content: center;
}

.app-filter-btn {
    gap: 7px;
    padding: 0 11px;
}

.app-filter-btn span {
    font-size: 0.9rem;
    font-weight: 600;
}

.monitoramento-main {
    background: #eef2f5;
    padding: 12px 16px 24px;
    width: 100%;
}

.status-summary {
    display: grid;
    gap: 6px;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    margin: 0 0 12px;
}

.summary-card {
    align-items: center;
    background: #f8fafc;
    border: 1px solid #e5e7eb;
    border-radius: 14px;
    cursor: pointer;
    display: flex;
    flex-direction: column;
    justify-content: center;
    min-height: 58px;
    min-width: 0;
    padding: 8px 4px;
    text-align: center;
    transition: border-color 0.18s ease, transform 0.18s ease;
}

.summary-card.active {
    transform: translateY(-1px);
}

.summary-card.active:not(.summary-moving):not(.summary-stopped):not(.summary-alert) {
    border-color: #94a3b8;
}

.summary-card strong {
    color: #0f172a;
    font-size: 1.2rem;
    font-weight: 800;
    line-height: 1.05;
}

.summary-card span {
    color: #334155;
    font-size: 0.56rem;
    font-weight: 800;
    letter-spacing: 0;
    line-height: 1.1;
    margin-top: 4px;
    text-transform: uppercase;
    white-space: nowrap;
}

.summary-moving {
    background: #e9fbf3;
    border-color: #b7efd5;
}

.summary-moving.active {
    border-color: #00875a;
}

.summary-moving strong,
.summary-moving span {
    color: #00875a;
}

.summary-stopped {
    background: #fff1f1;
    border-color: #ffcaca;
}

.summary-stopped.active {
    border-color: #dc2626;
}

.summary-stopped strong,
.summary-stopped span {
    color: #dc2626;
}

.summary-alert {
    background: #fff7e6;
    border-color: #ffe4a3;
}

.summary-alert.active {
    border-color: #d28a00;
}

.summary-alert strong,
.summary-alert span {
    color: #d28a00;
}

.list-card-veiculos {
    list-style: none;
    margin: 0;
    padding: 0;
}

.vehicle-card-item {
    margin: 0 0 12px;
}

.vehicle-card {
    background: #fff;
    border-radius: 10px;
    box-shadow: 0 8px 22px rgba(15, 23, 42, 0.12);
    display: grid;
    gap: 10px 12px;
    grid-template-columns: 76px minmax(0, 1fr);
    overflow: hidden;
    padding: 14px 14px 12px 18px;
    position: relative;
}

.vehicle-status-rail {
    background: #dc2626;
    bottom: 0;
    left: 0;
    position: absolute;
    top: 0;
    width: 4px;
}

.vehicle-card-moving .vehicle-status-rail {
    background: #00875a;
}

.vehicle-card-moving .vehicle-status-inline,
.vehicle-card-moving .vehicle-title-row {
    color: #00875a;
}

.vehicle-card-parked .vehicle-status-rail {
    background: #d28a00;
}

.vehicle-card-parked .vehicle-status-inline,
.vehicle-card-parked .vehicle-title-row {
    color: #d28a00;
}

.vehicle-card-stopped .vehicle-status-rail {
    background: #dc2626;
}

.vehicle-card-stopped .vehicle-status-inline,
.vehicle-card-stopped .vehicle-title-row {
    color: #dc2626;
}

.vehicle-card-blocked .vehicle-status-rail {
    background: #111827;
}

.vehicle-card-blocked .vehicle-status-inline,
.vehicle-card-blocked .vehicle-title-row {
    color: #111827;
}

.vehicle-icon-wrap {
    align-items: center;
    display: flex;
    flex: 0 0 58px;
    justify-content: center;
}

.vehicle-type-icon {
    background: #f1f5f9;
    border-radius: 50%;
    box-sizing: border-box;
    height: 58px;
    object-fit: contain;
    opacity: 0.78;
    padding: 13px;
    width: 58px;
}

.vehicle-main-info {
    flex: 1 1 auto;
    min-width: 0;
}

.vehicle-card-header {
    align-items: center;
    display: flex;
    gap: 10px;
    grid-column: 1 / -1;
    justify-content: space-between;
    margin-bottom: 0;
    min-width: 0;
}

.vehicle-title-row {
    display: block;
    font-size: 1.3rem;
    font-weight: 800;
    line-height: 0.95;
    margin: 0;
    min-width: 0;
}

.vehicle-title-row span {
    color: #4b5563;
    display: inline;
    font-size: 0.76rem;
    font-weight: 600;
    line-height: 1;
    margin-left: 4px;
    min-width: 0;
    overflow-wrap: normal;
    text-transform: uppercase;
    white-space: nowrap;
}

.vehicle-identity-meta {
    align-items: flex-start;
    display: flex;
    flex-direction: column;
    gap: 3px;
    margin-top: 2px;
    min-width: 0;
}

.vehicle-status-inline {
    align-items: baseline;
    display: inline-flex;
    font-size: 0.74rem;
    font-weight: 800;
    gap: 4px;
    line-height: 1;
    white-space: nowrap;
}

.vehicle-status-inline small {
    color: #64748b;
    font-size: 0.64rem;
    font-weight: 700;
}

.vehicle-driver-inline {
    align-items: center;
    color: #475569;
    display: inline-flex;
    font-size: 0.76rem;
    font-weight: 600;
    line-height: 1.1;
    min-width: 0;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.vehicle-driver-inline i {
    color: #475569;
    flex: 0 0 auto;
    font-size: 15px;
    margin-right: 4px;
}

.vehicle-speed {
    --speed-color: #94a3b8;
    --speed-progress: 0deg;
    align-items: center;
    background: #fff;
    border-radius: 50%;
    box-sizing: border-box;
    color: #0f172a;
    display: flex;
    flex-direction: column;
    flex-shrink: 0;
    height: 58px;
    justify-content: center;
    line-height: 1;
    padding: 5px 4px 4px;
    position: relative;
    width: 58px;
}

.vehicle-speed::before,
.vehicle-speed::after {
    border-radius: 50%;
    content: '';
    inset: 3px;
    pointer-events: none;
    position: absolute;
}

.vehicle-speed::before {
    border: 1px solid #d7dee8;
}

.vehicle-speed::after {
    background: conic-gradient(from 225deg, var(--speed-color) 0deg var(--speed-progress), transparent var(--speed-progress) 360deg);
    -webkit-mask: radial-gradient(farthest-side, transparent calc(100% - 4px), #000 calc(100% - 4px));
    mask: radial-gradient(farthest-side, transparent calc(100% - 4px), #000 calc(100% - 4px));
}

.vehicle-speed strong {
    font-size: 1.12rem;
    font-weight: 800;
    position: relative;
    z-index: 1;
}

.vehicle-speed span {
    color: #475569;
    font-size: 0.55rem;
    font-weight: 700;
    letter-spacing: 0;
    margin-top: 1px;
    position: relative;
    text-transform: lowercase;
    z-index: 1;
}

.vehicle-card-moving .vehicle-speed {
    --speed-color: #22c55e;
}

.vehicle-card-parked .vehicle-speed {
    --speed-color: #d28a00;
}

.vehicle-card-stopped .vehicle-speed {
    --speed-color: #94a3b8;
}

.vehicle-location,
.vehicle-date {
    align-items: center;
    color: #334155;
    display: flex;
    min-width: 0;
}

.vehicle-location {
    cursor: pointer;
    font-size: 0.88rem;
    font-weight: 600;
    grid-column: 1 / -1;
    line-height: 1.25;
    margin-bottom: 0;
}

.vehicle-location span {
    overflow-wrap: anywhere;
    white-space: normal;
}

.vehicle-location i,
.vehicle-date i {
    color: #475569;
    flex: 0 0 auto;
    font-size: 19px;
    margin-right: 7px;
}

.vehicle-date {
    color: #475569;
    font-size: 0.76rem;
    gap: 5px;
    grid-column: 1 / -1;
}

.vehicle-date i {
    margin-right: 2px;
}

.vehicle-date small {
    color: #64748b;
    margin-left: 4px;
}

.vehicle-meta {
    align-items: center;
    display: grid;
    flex: 1 1 auto;
    gap: clamp(5px, 1.25vw, 8px);
    grid-template-columns: repeat(auto-fit, minmax(54px, 1fr));
    min-width: 0;
}

.vehicle-chip {
    align-items: center;
    background: #f8fafc;
    border-radius: 7px;
    color: #334155;
    display: inline-flex;
    font-size: clamp(0.66rem, 1.75vw, 0.74rem);
    font-weight: 700;
    justify-content: center;
    min-height: 36px;
    min-width: 0;
    padding: 6px clamp(5px, 1.4vw, 8px);
    text-align: center;
    white-space: nowrap;
}

.vehicle-chip i {
    color: #64748b;
    font-size: clamp(16px, 3.8vw, 19px);
    margin-right: clamp(3px, 0.9vw, 5px);
}

.vehicle-chip i:only-child {
    margin-right: 0;
}

.vehicle-io-chip {
    min-width: 2.3rem;
    text-transform: uppercase;
}

.vehicle-chip.danger {
    color: #dc2626;
}

.vehicle-chip.danger i {
    color: #dc2626;
}

.vehicle-extra-data {
    display: grid;
    gap: 5px;
    grid-column: 1 / -1;
    grid-template-columns: repeat(4, minmax(0, 1fr));
}

.vehicle-extra-chip {
    align-items: center;
    background: #f8fafc;
    border-radius: 7px;
    color: #334155;
    display: inline-flex;
    flex-direction: column;
    justify-content: center;
    min-height: 42px;
    min-width: 0;
    padding: 4px 3px;
    text-align: center;
}

.vehicle-extra-chip strong {
    color: #334155;
    font-size: 0.68rem;
    font-weight: 800;
    line-height: 1;
    margin-top: 2px;
}

.vehicle-extra-chip small {
    color: #64748b;
    font-size: 0.54rem;
    font-weight: 700;
    line-height: 1;
    overflow: hidden;
    text-overflow: ellipsis;
    text-transform: uppercase;
    white-space: nowrap;
}

.vehicle-extra-chip i,
.vehicle-extra-chip img {
    color: #64748b;
    display: block;
    font-size: 16px;
    height: 15px;
    object-fit: contain;
    opacity: 0.78;
    width: 15px;
}

.vehicle-extra-raw {
    align-items: center;
    background: #f8fafc;
    border-radius: 7px;
    color: #334155;
    display: flex;
    flex-wrap: wrap;
    font-size: 0.78rem;
    font-weight: 700;
    gap: 6px;
    grid-column: 1 / -1;
    min-height: 34px;
    padding: 5px 6px;
}

.vehicle-extra-raw img {
    height: 18px;
    object-fit: contain;
    width: 18px;
}

.vehicle-footer {
    align-items: center;
    border-top: 1px solid #e5e7eb;
    display: flex;
    gap: 8px;
    grid-column: 1 / -1;
    justify-content: space-between;
    min-width: 0;
    padding-top: 7px;
}

.vehicle-history-btn {
    align-items: center;
    background: #64748b !important;
    background-color: #64748b !important;
    border-radius: 6px;
    color: #fff;
    display: inline-flex;
    flex: 0 0 auto;
    font-size: 0.72rem;
    font-weight: 700;
    height: 30px;
    padding: 0 10px;
    text-transform: none;
}

.vehicle-history-btn i {
    font-size: 15px;
    margin-right: 4px;
}

.load-more-vehicles {
    background: #0a1d31;
    border-radius: 9px;
    color: #fff;
    cursor: pointer;
    display: block;
    font-weight: 700;
    margin: 18px 0 0;
    padding: 13px 16px;
    text-align: center;
}

.empty-vehicles {
    align-items: center;
    background: #fff;
    border-radius: 10px;
    box-shadow: 0 8px 22px rgba(15, 23, 42, 0.10);
    color: #475569;
    display: flex;
    flex-direction: column;
    margin-top: 12px;
    padding: 36px 20px;
    text-align: center;
}

.empty-vehicles i {
    color: #00875a;
    font-size: 42px;
    margin-bottom: 8px;
}

.empty-vehicles strong {
    color: #111827;
    font-size: 1.05rem;
}

.historico-page {
    background: #eef2f5;
    color: #0f172a;
}

.historico-actions-menu {
    background: #07101a;
    border: 1px solid rgba(255, 255, 255, 0.08);
    border-radius: 10px;
    box-shadow: 0 12px 30px rgba(15, 23, 42, 0.28);
    overflow: hidden;
    width: 280px !important;
}

.historico-actions-menu li > a {
    color: #e5edf5;
    font-weight: 700;
}

.historico-actions-menu li > a:hover {
    background: #102235;
    color: #fff;
}

.historico-actions-menu li > a span {
    color: #93a2b4;
}

.historico-main {
    background: #eef2f5;
    padding: 12px 12px 92px;
    width: 100%;
}

.historico-container {
    margin: 0 auto;
    max-width: 720px;
}

.history-vehicle-card,
.history-filter-panel,
.history-event-card,
.history-segment-card {
    background: #fff;
    border-radius: 10px;
    box-shadow: 0 8px 22px rgba(15, 23, 42, 0.12);
}

.history-vehicle-card {
    border-left: 4px solid #dc2626;
    margin-bottom: 12px;
    padding: 14px;
}

.history-vehicle-card.is-on {
    border-left-color: #00875a;
}

.history-vehicle-identity {
    align-items: center;
    display: flex;
    gap: 12px;
    min-width: 0;
}

.history-vehicle-icon {
    background: #f1f5f9;
    border-radius: 50%;
    box-sizing: border-box;
    flex: 0 0 58px;
    height: 58px;
    object-fit: contain;
    opacity: 0.78;
    padding: 13px;
    width: 58px;
}

.history-plate {
    color: #dc2626;
    font-size: 1.25rem;
    font-weight: 800;
    line-height: 1;
    margin: 0;
}

.history-vehicle-card.is-on .history-plate {
    color: #00875a;
}

.history-plate span {
    color: #4b5563;
    font-size: 0.76rem;
    font-weight: 600;
    margin-left: 4px;
    text-transform: uppercase;
    white-space: nowrap;
}

.history-fleet {
    color: #64748b;
    display: block;
    font-size: 0.76rem;
    font-weight: 700;
    margin-top: 3px;
    text-transform: uppercase;
}

.history-driver {
    align-items: center;
    color: #475569;
    display: flex;
    font-size: 0.78rem;
    font-weight: 600;
    margin-top: 5px;
    min-width: 0;
}

.history-driver i {
    font-size: 15px;
    margin-right: 4px;
}

.history-vehicle-status-date {
    align-items: center;
    background: #f8fafc;
    border-radius: 8px;
    color: #475569;
    display: flex;
    font-size: 0.76rem;
    font-weight: 700;
    gap: 6px;
    margin-top: 10px;
    min-height: 32px;
    padding: 0 10px;
}

.history-vehicle-status-date i {
    color: #dc2626;
    font-size: 16px;
}

.history-vehicle-card.is-on .history-vehicle-status-date i {
    color: #00875a;
}

.history-vehicle-meta,
.history-maintenance-line {
    display: grid;
    gap: 7px;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    margin-top: 12px;
}

.history-vehicle-meta span,
.history-maintenance-line span {
    align-items: center;
    background: #f8fafc;
    border-radius: 7px;
    color: #334155;
    display: flex;
    font-size: 0.72rem;
    font-weight: 700;
    justify-content: center;
    min-height: 32px;
    text-align: center;
}

.history-maintenance-line:empty {
    display: none;
}

.history-maintenance-line span:empty {
    display: none;
}

.history-filter-panel {
    align-items: center;
    display: flex;
    gap: 12px;
    justify-content: space-between;
    margin-bottom: 12px;
    overflow: visible;
    padding: 13px 14px;
}

.history-filter-panel strong {
    display: block;
    font-size: 1.05rem;
    line-height: 1.1;
}

.history-filter-panel span {
    color: #64748b;
    display: block;
    font-size: 0.78rem;
    margin-top: 3px;
}

.history-filter-controls {
    align-items: center;
    display: flex;
    flex: 1 1 auto;
    gap: 8px;
    justify-content: flex-end;
    min-width: 0;
    overflow: visible;
}

.history-date-field {
    align-items: center;
    background: #f8fafc;
    border: 1px solid #e2e8f0;
    border-radius: 8px;
    display: flex;
    flex: 1 1 auto;
    height: 38px;
    min-width: 0;
    padding: 0 10px;
}

.history-date-field i {
    color: #475569;
    font-size: 18px;
    margin-right: 6px;
}

.history-date-field input {
    border: 0 !important;
    box-shadow: none !important;
    color: #0f172a;
    font-size: 0.82rem !important;
    height: 34px !important;
    margin: 0 !important;
    max-width: none;
    min-width: 0;
    width: 100%;
}

.history-connection-control {
    align-items: center;
    background: #f8fafc;
    border: 1px solid #e2e8f0;
    border-radius: 8px;
    color: #334155;
    display: flex;
    flex: 0 0 42px;
    height: 38px;
    justify-content: center;
    margin: 0;
    position: relative;
    width: 42px;
    z-index: 6;
}

.history-connection-control > i {
    font-size: 19px;
    pointer-events: none;
    position: relative;
    z-index: 1;
}

.history-connection-control .select-wrapper {
    inset: 0;
    overflow: visible;
    position: absolute;
}

.history-connection-control .select-wrapper input.select-dropdown {
    border: 0 !important;
    box-shadow: none !important;
    color: transparent;
    cursor: pointer;
    height: 36px;
    margin: 0;
    opacity: 0;
    padding: 0;
    width: 40px;
}

.history-connection-control .select-wrapper .caret {
    display: none;
}

.history-connection-control .dropdown-content {
    left: auto !important;
    min-width: 188px;
    right: 0 !important;
    width: 188px !important;
}

.history-connection-control .dropdown-content li > span {
    color: #0f172a;
    font-size: 0.86rem;
    line-height: 1.2;
    padding: 12px 14px;
}

.history-connection-select {
    color: #334155;
    font-size: 0.78rem;
    height: 38px;
}

.history-summary-grid {
    display: grid;
    gap: 8px;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    margin-bottom: 12px;
}

.history-summary-grid .card-resumo-dia {
    margin: 0;
    width: auto;
}

.history-summary-grid .card {
    background: #fff;
    border: 1px solid #e2e8f0;
    border-radius: 10px;
    box-shadow: none;
}

.history-summary-grid .card .card-content {
    padding: 10px 6px;
}

.history-summary-grid .card-title {
    color: #0f172a;
    font-size: 1rem !important;
    font-weight: 800;
}

.history-summary-grid small {
    color: #475569;
    font-size: 0.62rem;
    font-weight: 700;
    text-transform: uppercase;
}

.history-tabs {
    background: #fff;
    border-radius: 10px;
    box-shadow: 0 5px 16px rgba(15, 23, 42, 0.12);
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    margin: 10px 0 12px;
    overflow: hidden;
}

.history-tabs label {
    cursor: pointer;
    display: flex;
    height: 48px;
    margin: 0;
    min-width: 0;
    width: 100%;
}

.history-tabs input {
    display: none;
}

.history-tabs label > span {
    align-items: center;
    border-right: 1px solid #e2e8f0;
    box-sizing: border-box;
    color: #475569;
    display: flex;
    font-size: 0.95rem;
    font-weight: 800;
    height: 48px !important;
    justify-content: center;
    line-height: 1;
    padding: 0 !important;
    text-align: center;
    width: 100%;
}

.history-tabs label:last-child > span {
    border-right: 0;
}

.history-tabs [type="radio"] + span::before,
.history-tabs [type="radio"] + span::after,
.history-tabs [type="radio"]:checked + span::before,
.history-tabs [type="radio"]:checked + span::after,
.history-tabs [type="radio"]:not(:checked) + span::before,
.history-tabs [type="radio"]:not(:checked) + span::after {
    content: none !important;
    display: none !important;
}

.history-tabs [type="radio"] + span {
    align-items: center;
    display: flex;
    height: 48px !important;
    justify-content: center;
    line-height: 1 !important;
    padding: 0 !important;
}

.history-tab-content {
    align-items: center !important;
    display: flex !important;
    gap: 8px;
    height: 24px !important;
    justify-content: center;
    line-height: 24px !important;
    padding: 0 !important;
}

.history-tab-content i {
    align-items: center;
    display: inline-flex;
    font-size: 20px;
    justify-content: center;
    height: 24px;
    line-height: 24px;
    margin: 0;
    padding: 0;
    transform: none;
    width: 24px;
}

.history-tab-content > span {
    align-items: center;
    display: inline-flex;
    height: 24px;
    justify-content: flex-start;
    line-height: 1;
}

.history-tabs input:checked + span {
    background: #ecfdf5;
    color: #00875a;
}

.history-timeline {
    position: relative;
}

.history-event {
    display: grid;
    gap: 8px;
    grid-template-columns: 42px minmax(0, 1fr);
    margin-bottom: 12px;
    position: relative;
}

.history-event::before {
    background: #d7dee8;
    bottom: -12px;
    content: '';
    left: 21px;
    position: absolute;
    top: 0;
    width: 2px;
}

.history-event:last-child::before {
    display: none;
}

.history-event-time {
    align-items: center;
    color: #0f172a;
    display: flex;
    flex-direction: column;
    padding-top: 9px;
    position: relative;
    text-align: center;
    z-index: 1;
}

.history-event-time strong {
    background: #eef2f5;
    border-radius: 4px 4px 0 0;
    display: block;
    font-size: 0.86rem;
    font-weight: 800;
    line-height: 1;
    padding: 2px 0 1px;
    width: 28px;
}

.history-event-time small {
    background: #eef2f5;
    border-radius: 0 0 4px 4px;
    color: #0f172a;
    display: block;
    font-size: 0.72rem;
    font-weight: 800;
    line-height: 1;
    padding: 1px 0 2px;
    width: 28px;
}

.history-event-card {
    overflow: hidden;
    padding: 12px;
}

.history-event-card header,
.history-event-location,
.history-event-driver {
    align-items: center;
    display: flex;
}

.history-event-card header {
    gap: 8px;
    justify-content: space-between;
}

.history-status-pill {
    align-items: center;
    border: 1px solid #fecaca;
    border-radius: 999px;
    color: #dc2626;
    display: inline-flex;
    font-size: 0.72rem;
    font-weight: 800;
    gap: 5px;
    height: 28px;
    padding: 0 10px;
}

.history-event.is-on .history-status-pill {
    border-color: #bbf7d0;
    color: #00875a;
}

.history-event.is-off .history-status-pill i {
    color: #dc2626;
}

.history-event.is-on .history-status-pill i {
    color: #00875a;
}

.history-status-pill i,
.history-event-date i,
.history-event-location i,
.history-event-driver i {
    font-size: 17px;
}

.history-event-date {
    align-items: center;
    color: #475569;
    display: inline-flex;
    font-size: 0.72rem;
    gap: 5px;
    white-space: nowrap;
}

.history-event-date small {
    color: #64748b;
    font-size: 0.62rem;
    font-weight: 700;
    margin-left: 4px;
}

.history-event-location {
    gap: 8px;
    margin-top: 10px;
}

.history-event-location i,
.history-event-driver i {
    color: #475569;
    flex: 0 0 auto;
}

.history-event-location span {
    color: #334155;
    display: block;
    font-size: 0.82rem;
    font-weight: 600;
    line-height: 1.25;
    margin-top: 0;
}

.history-event-driver {
    color: #475569;
    font-size: 0.78rem;
    font-weight: 600;
    gap: 5px;
    margin-top: 9px;
}

.history-event-metrics {
    border-top: 1px solid #e5e7eb;
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    margin-top: 11px;
    padding-top: 10px;
}

.history-event-metrics span {
    align-items: center;
    border-right: 1px solid #e5e7eb;
    display: flex;
    flex-direction: column;
    min-width: 0;
    text-align: center;
}

.history-event-metrics span:last-child {
    border-right: 0;
}

.history-event-metrics i {
    color: #334155;
    font-size: 21px;
}

.history-event-metrics strong {
    font-size: 0.78rem;
    line-height: 1.1;
    margin-top: 3px;
}

.history-event-metrics small {
    color: #64748b;
    font-size: 0.66rem;
    margin-top: 2px;
}

.history-speed-limit {
    align-items: center;
    color: #dc2626 !important;
    display: inline-flex !important;
    font-size: 0.56rem !important;
    font-weight: 800;
    gap: 2px;
    justify-content: center;
}

.history-speed-limit i {
    color: #dc2626;
    font-size: 13px;
}

.history-event-extra {
    color: #475569;
    font-size: 0.75rem;
    margin-top: 9px;
}

.history-map,
.card-mapa-historico {
    border-radius: 10px;
    overflow: hidden;
}

.history-map {
    height: 420px;
}

.card-mapa-historico {
    grid-column: 2;
    height: 240px;
    margin-bottom: 4px;
}

.history-segments {
    display: grid;
    gap: 10px;
}

.history-segment-card {
    display: block;
    overflow: hidden;
}

.history-segment-content {
    box-sizing: border-box;
    padding: 12px;
    width: 100%;
}

.history-segment-points {
    display: grid;
    gap: 10px;
}

.history-segment-points div {
    border-left: 3px solid #00875a;
    padding-left: 10px;
}

.history-segment-points div + div {
    border-left-color: #dc2626;
}

.history-segment-points span {
    color: #64748b;
    display: block;
    font-size: 0.68rem;
    font-weight: 800;
    text-transform: uppercase;
}

.history-segment-points strong {
    display: block;
    font-size: 0.82rem;
    margin-top: 2px;
}

.history-segment-points p {
    color: #334155;
    font-size: 0.78rem;
    margin: 3px 0 0;
}

.history-segment-metrics {
    display: grid;
    gap: 6px;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    margin-top: 12px;
}

.history-segment-metrics div {
    background: #f8fafc;
    border-radius: 7px;
    padding: 7px 3px;
    text-align: center;
}

.history-segment-metrics strong {
    display: block;
    font-size: 0.78rem;
}

.history-segment-metrics small {
    color: #64748b;
    font-size: 0.62rem;
    font-weight: 700;
    text-transform: uppercase;
}

.history-segment-card > .card-mapa-historico {
    grid-column: auto;
    height: 320px;
    margin: 8px 10px 10px;
}

.bottom-nav {
    align-items: center;
    background: linear-gradient(135deg, #06111d 0%, #0a1d31 100%);
    bottom: 0;
    box-shadow: 0 -8px 24px rgba(15, 23, 42, 0.25);
    display: none !important;
    grid-template-columns: repeat(4, 1fr);
    height: 70px;
    left: 0;
    margin: 0;
    padding: 0 max(12px, calc((100vw - 720px) / 2));
    position: fixed;
    right: 0;
    z-index: 25;
}

.bottom-nav a {
    align-items: center;
    color: #cbd5e1;
    display: grid;
    grid-template-rows: 42px 14px;
    font-size: 0.72rem;
    font-weight: 600;
    height: 70px;
    justify-items: center;
    line-height: 1.1;
    padding-top: 7px;
}

.bottom-nav a.active {
    color: #fff;
}

.bottom-nav a.active i {
    align-items: center;
    background: #00875a;
    border-radius: 9px;
    box-shadow: 0 6px 16px rgba(0, 135, 90, 0.38);
    color: #fff;
    display: flex;
    height: 42px;
    justify-content: center;
    padding: 0;
    width: 58px;
}

.bottom-nav i {
    font-size: 24px;
    height: 42px;
    line-height: 42px;
}

@media (max-width: 520px) {
    .app-shell-header {
        padding-left: 10px;
        padding-right: 10px;
    }

    .app-topbar {
        grid-template-columns: 34px 1fr 64px;
        min-height: 42px;
    }

    .app-logo {
        height: 34px;
        width: 62%;
    }

    .app-filter-btn span {
        display: none;
    }

    .app-filter-btn {
        padding: 0;
        width: 38px;
    }

    .dashboard-main {
        padding-top: 16px;
    }

    .dashboard-container {
        gap: 18px;
    }

    .dashboard-grid {
        gap: 8px;
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }

    .dashboard-card {
        align-items: flex-start;
        flex-direction: column;
        gap: 9px;
        min-height: 126px;
        padding: 12px;
    }

    .dashboard-card-icon {
        flex-basis: 36px;
        height: 36px;
        width: 36px;
    }

    .dashboard-card-icon i {
        font-size: 19px;
    }

    .dashboard-card-content strong {
        font-size: 1.32rem;
    }

    .dashboard-card-content > span {
        font-size: 0.73rem;
    }

    .dashboard-grid-day .dashboard-card:last-child {
        grid-column: 1 / -1;
        min-height: 104px;
    }

    .monitoramento-main {
        padding-bottom: 24px;
        padding-left: 10px;
        padding-right: 10px;
    }

    .summary-card {
        border-radius: 10px;
        min-height: 54px;
        min-width: 0;
        padding: 7px 3px;
    }

    .summary-card strong {
        font-size: 1.1rem;
    }

    .summary-card span {
        font-size: 0.52rem;
    }

    .vehicle-card {
        gap: 9px 10px;
        grid-template-columns: 72px minmax(0, 1fr);
        padding: 13px 10px 11px 15px;
    }

    .vehicle-title-row {
        font-size: 1.16rem;
    }

    .vehicle-speed {
        height: 54px;
        width: 54px;
    }

    .vehicle-speed strong {
        font-size: 1.05rem;
    }

    .vehicle-meta {
        gap: clamp(4px, 1.2vw, 6px);
        grid-template-columns: repeat(auto-fit, minmax(50px, 1fr));
    }

    .vehicle-chip {
        font-size: clamp(0.62rem, 2vw, 0.7rem);
        min-height: 34px;
        padding-left: clamp(4px, 1.2vw, 7px);
        padding-right: clamp(4px, 1.2vw, 7px);
    }

    .vehicle-chip i {
        font-size: clamp(15px, 3.7vw, 17px);
    }

    .vehicle-extra-data {
        gap: 5px;
    }

    .vehicle-extra-chip {
        min-height: 40px;
        padding-left: 4px;
        padding-right: 4px;
    }

    .vehicle-extra-chip i,
    .vehicle-extra-chip img {
        font-size: 16px;
    }

    .historico-main {
        padding-left: 10px;
        padding-right: 10px;
    }

    .history-filter-panel {
        align-items: stretch;
        flex-direction: column;
    }

    .history-filter-controls {
        flex: 0 0 auto;
        width: 100%;
    }

    .history-date-field {
        flex: 1 1 auto;
    }

    .history-date-field input {
        max-width: none;
        width: 100%;
    }

    .history-connection-control {
        flex: 0 0 42px;
    }

    .history-summary-grid {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }

    .history-event {
        gap: 7px;
        grid-template-columns: 40px minmax(0, 1fr);
    }

    .history-event::before {
        left: 20px;
    }

    .history-event-time strong {
        font-size: 0.86rem;
    }

    .history-event-card {
        padding: 11px;
    }

    .history-event-card header {
        align-items: flex-start;
        flex-direction: column;
    }

    .history-event-metrics {
        grid-template-columns: repeat(4, minmax(0, 1fr));
        row-gap: 0;
    }

    .history-segment-metrics {
        grid-template-columns: repeat(4, minmax(0, 1fr));
    }

    .history-event-metrics span:nth-child(2) {
        border-right: 1px solid #e5e7eb;
    }

    .history-map {
        height: 340px;
    }

    .card-mapa-historico {
        grid-column: 2;
        height: 230px;
    }

    .history-segment-card > .card-mapa-historico {
        grid-column: auto;
        height: 330px;
    }
}
