body.ui-new-nav .table-responsive:has(> .table.table-list),
body.ui-new-nav .hg-modal-dashboard [data-table] .table-responsive,
body.ui-new-nav .hg-modal-list__table .table-responsive {
    border-radius: var(--hg-ui-table-radius);
    overflow-x: auto;
    overflow-y: hidden;
    -webkit-overflow-scrolling: touch;
}

body.ui-new-nav .table.table-list {
    border-collapse: separate;
    border-spacing: 0;
    border-radius: var(--hg-ui-table-radius);
}

body.ui-new-nav .table.table-list > thead > tr:first-child > th:first-child {
    border-top-left-radius: var(--hg-ui-table-radius);
}

body.ui-new-nav .table.table-list > thead > tr:first-child > th:last-child {
    border-top-right-radius: var(--hg-ui-table-radius);
}

body.ui-new-nav .table.table-list > tbody > tr:last-child > td:first-child {
    border-bottom-left-radius: var(--hg-ui-table-radius);
}

body.ui-new-nav .table.table-list > tbody > tr:last-child > td:last-child {
    border-bottom-right-radius: var(--hg-ui-table-radius);
}

body.ui-new-nav .table.table-list > thead > tr {
    color: var(--color-table-head-text);
    background-color: var(--color-table-head-background);
}

body.ui-new-nav .table.table-list > thead > tr > th,
body.ui-new-nav .modal .table.table-list thead th,
body.ui-new-nav .hg-modal-dashboard .table-list thead th {
    font-size: 12px;
    font-weight: 600;
    color: var(--color-table-head-text);
    background-color: var(--color-table-head-background);
    letter-spacing: 0.3px;
    white-space: nowrap;
    padding-top: 10px;
    padding-bottom: 10px;
    border-bottom: 2px solid var(--color-table-head-hover);
    user-select: none;
}

/* Cabecalho ordenavel: o <a> dentro do th herda a cor de link do tema e fica
   escuro sobre o fundo do cabecalho — so as colunas com ordenacao ficavam
   ilegiveis, enquanto as de texto puro apareciam brancas. */
body.ui-new-nav .table.table-list > thead > tr > th a,
body.ui-new-nav .modal .table.table-list thead th a,
body.ui-new-nav .hg-modal-dashboard .table-list thead th a {
    color: var(--color-table-head-text);
    text-decoration: none;
}

body.ui-new-nav .table.table-list > thead > tr > th a:hover,
body.ui-new-nav .table.table-list > thead > tr > th a:focus,
body.ui-new-nav .modal .table.table-list thead th a:hover,
body.ui-new-nav .modal .table.table-list thead th a:focus,
body.ui-new-nav .hg-modal-dashboard .table-list thead th a:hover,
body.ui-new-nav .hg-modal-dashboard .table-list thead th a:focus {
    color: var(--color-table-head-text);
    text-decoration: underline;
}

/* Excecao a regra acima: o menu de acoes em massa (engrenagem multi-edit) e
   filho do <th>, mas abre sobre o fundo branco do proprio dropdown — herdando
   a cor do cabecalho, os itens ficavam brancos no branco e sumiam. */
body.ui-new-nav .table.table-list > thead > tr > th .dropdown-menu > li > a,
body.ui-new-nav .modal .table.table-list thead th .dropdown-menu > li > a,
body.ui-new-nav .hg-modal-dashboard .table-list thead th .dropdown-menu > li > a {
    color: var(--color-modal-text);
    text-decoration: none;
}

body.ui-new-nav .table.table-list > thead > tr > th .dropdown-menu > li > a:hover,
body.ui-new-nav .table.table-list > thead > tr > th .dropdown-menu > li > a:focus,
body.ui-new-nav .modal .table.table-list thead th .dropdown-menu > li > a:hover,
body.ui-new-nav .modal .table.table-list thead th .dropdown-menu > li > a:focus,
body.ui-new-nav .hg-modal-dashboard .table-list thead th .dropdown-menu > li > a:hover,
body.ui-new-nav .hg-modal-dashboard .table-list thead th .dropdown-menu > li > a:focus {
    color: var(--color-modal-text);
    background-color: var(--color-modal-surface);
    text-decoration: none;
}

body.ui-new-nav .table.table-list.sticky-header > thead > tr > th {
    color: var(--color-table-head-text);
    background-color: var(--color-table-head-background);
}

body.ui-new-nav .table.table-list th.sorting:hover,
body.ui-new-nav .table.table-list th.sorting_asc,
body.ui-new-nav .table.table-list th.sorting_asc:hover,
body.ui-new-nav .table.table-list th.sorting_desc,
body.ui-new-nav .table.table-list th.sorting_desc:hover,
body.ui-new-nav .modal .table.table-list thead th.sorting:hover,
body.ui-new-nav .modal .table.table-list thead th.sorting_asc,
body.ui-new-nav .modal .table.table-list thead th.sorting_desc,
body.ui-new-nav .hg-modal-dashboard .table-list thead th.sorting:hover,
body.ui-new-nav .hg-modal-dashboard .table-list thead th.sorting_asc,
body.ui-new-nav .hg-modal-dashboard .table-list thead th.sorting_desc {
    background-color: var(--color-table-head-hover);
}

body.ui-new-nav .table.table-list th.sorting:before,
body.ui-new-nav .table.table-list th.sorting:after,
body.ui-new-nav .table.table-list th.sorting_asc:before,
body.ui-new-nav .table.table-list th.sorting_asc:after,
body.ui-new-nav .table.table-list th.sorting_desc:before,
body.ui-new-nav .table.table-list th.sorting_desc:after {
    color: var(--color-table-head-icon-muted);
}

body.ui-new-nav .table.table-list th.sorting_asc:before,
body.ui-new-nav .table.table-list th.sorting_desc:after {
    color: var(--color-table-head-text);
}

body.ui-new-nav .table.table-list > thead > tr > th .btn.icon,
body.ui-new-nav .hg-modal-dashboard .table-list thead th .btn.icon,
body.ui-new-nav .hg-modal-dashboard .table-list thead th .icon.multi-edit {
    color: var(--color-map-header-text-muted);
}

body.ui-new-nav .table.table-list > thead > tr > th .btn.icon:hover,
body.ui-new-nav .table.table-list > thead > tr > th.table-checkbox:hover .icon,
body.ui-new-nav .hg-modal-dashboard .table-list thead th .btn.icon:hover,
body.ui-new-nav .hg-modal-dashboard .table-list thead th .icon.multi-edit:hover {
    color: var(--color-table-head-text);
}

/* Cabecalho escuro: a caixa do "marcar todos" precisa de uma borda propria,
   senao o cinza padrao do tema some contra o fundo da tarja. */
body.ui-new-nav .table.table-list > thead .checkbox label::before,
body.ui-new-nav .hg-modal-dashboard .table-list thead .checkbox label::before {
    border-color: var(--color-map-header-text-muted);
}

body.ui-new-nav.admin-layout .table.table-list > tbody > tr > td {
    color: var(--color-text-emphasis);
    border-top: 1px solid var(--color-border-legacy);
}

body.ui-new-nav.admin-layout .table.table-list > tbody > tr:first-child > td {
    border-top: 0;
}

body.ui-new-nav.admin-layout .table.table-list > tbody > tr:hover {
    background-color: var(--color-surface-hover-light);
}

/* ---------- Placas em formato de etiqueta ---------- */

/* Coluna de veiculos dos Alertas dos Clientes: as placas vinham como um texto
   corrido separado por virgula e a celula ficava ilegivel quando o alerta tem
   dez veiculos. Aqui a celula deixa de ser nowrap (regra geral das tabelas do
   admin e do modal) para as etiquetas poderem quebrar em varias linhas. */
body.ui-new-nav .table.table-list > tbody > tr > td.hg-alert-devices,
body.ui-new-nav.admin-layout .table.table-list > tbody > tr > td.hg-alert-devices,
body.ui-new-nav .hg-modal-dashboard .table-list tbody td.hg-alert-devices {
    max-width: 460px;
    white-space: normal;
    line-height: 1.6;
}

body.ui-new-nav .hg-alert-devices__count {
    display: inline-block;
    min-width: 22px;
    margin-right: 6px;
    padding: 2px 6px;
    border-radius: 999px;
    background-color: var(--color-table-head-background);
    color: var(--color-table-head-text);
    font-size: 11px;
    font-weight: 600;
    line-height: 1.5;
    text-align: center;
    vertical-align: middle;
}

body.ui-new-nav .hg-plate {
    display: inline-block;
    margin: 2px 4px 2px 0;
    padding: 2px 8px;
    border: 1px solid var(--color-modal-border);
    border-radius: 999px;
    background-color: var(--color-modal-surface);
    color: var(--color-modal-text);
    font-size: 11px;
    font-weight: 600;
    letter-spacing: 0.4px;
    line-height: 1.5;
    white-space: nowrap;
    vertical-align: middle;
}

/* Etiqueta de status que liga e desliga no clique (admin_status_toggle.js).
   Sem o cursor de mao nada indica que a etiqueta e clicavel -- ela e igual
   a etiqueta estatica que as outras tabelas mostram. */
[data-status-toggle] {
    cursor: pointer;
    user-select: none;
    transition: opacity 120ms ease;
}

[data-status-toggle]:hover {
    opacity: 0.85;
}

/* Enquanto a requisicao esta no ar: a cor nova ja aparece, mas o esmaecido
   diz que ainda nao esta gravado. */
[data-status-toggle].is-saving {
    opacity: 0.55;
    cursor: progress;
}

/* Grupo e Plano que trocam na propria linha da tabela de Usuarios
   (admin_inline_select.js). Parado, o select parece o texto da celula com
   uma seta discreta; no hover/foco ganha a borda de campo, para dizer que
   da para trocar sem abrir o cadastro. */
.table-list select.hg-inline-select {
    -webkit-appearance: none;
    -moz-appearance: none;
    appearance: none;
    max-width: 100%;
    margin: 0 0 0 -7px;
    padding: 2px 20px 2px 6px;
    border: 1px solid transparent;
    border-radius: var(--hg-ui-control-radius);
    background: transparent url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='10' height='6' viewBox='0 0 10 6'%3E%3Cpath d='M1 1l4 4 4-4' fill='none' stroke='%238a9099' stroke-width='1.6' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E") no-repeat right 6px center;
    color: inherit;
    font: inherit;
    line-height: 1.4;
    white-space: nowrap;
    text-overflow: ellipsis;
    overflow: hidden;
    cursor: pointer;
    transition: border-color 120ms ease, background-color 120ms ease, opacity 120ms ease;
}

.table-list select.hg-inline-select:hover,
.table-list select.hg-inline-select:focus {
    border-color: var(--color-border-neutral);
    background-color: var(--color-primary-tint);
    outline: none;
}

.table-list select.hg-inline-select:focus-visible {
    border-color: var(--color-primary);
}

/* A lista aberta usa as cores do proprio select; com fundo transparente o
   navegador pode desenhar as opcoes sem contraste. */
.table-list select.hg-inline-select option {
    color: var(--color-text-primary);
    background-color: #ffffff;
}

.table-list select.hg-inline-select.is-saving {
    opacity: 0.55;
    cursor: progress;
}

/* Gravou: a borda pisca verde por um instante. */
.table-list select.hg-inline-select.is-saved {
    border-color: #2e9e5b;
}

/* Modulos somados ao plano (so se trocam no cadastro). */
.table-list .hg-inline-extra {
    display: block;
    max-width: 100%;
    color: var(--color-text-muted);
    font-size: var(--hg-ui-font-xs);
    white-space: nowrap;
    text-overflow: ellipsis;
    overflow: hidden;
}

.table-list .hg-inline-extra[hidden] {
    display: none;
}
