/*
 * Visual novo da barra de widgets do rodape do mapa (/objects).
 *
 * So aparencia: nao muda marcacao, alturas nem o que o app.js le ou escreve
 * nos [data-device]. Carregado depois do tema em partials/head.blade.php,
 * entao vale nos 41 temas sem recompilar nenhum. Para voltar ao visual
 * antigo, basta tirar o <link> de la.
 *
 * As cores sao sobreposicoes de cinza translucido e currentColor, nunca um
 * tom fixo: o fundo e a cor do texto continuam vindo do tema, e por isso
 * funciona igual no claro e no escuro.
 */

/* Barra: vira um painel de cantos arredondados solto sobre o mapa */
#widgets .widgets-content {
    padding: 8px 8px 0;
    border-radius: 14px 14px 0 0;
    box-shadow: 0 -6px 24px rgba(0, 0, 0, .18);
    scrollbar-width: thin;
}

#widgets.collapsed .widgets-content {
    padding: 0;
    box-shadow: none;
}

/* Cada widget: cartao separado, em vez de colunas coladas por uma borda */
#widgets .widget {
    margin-bottom: 8px;
    overflow: hidden;
    border: 1px solid rgba(127, 127, 127, .18);
    border-radius: 10px;
    background: rgba(127, 127, 127, .07);
    transition: background-color .2s ease, border-color .2s ease;
}

#widgets .widget + .widget {
    margin-left: 8px;
}

#widgets .widget:hover {
    border-color: rgba(127, 127, 127, .32);
    background: rgba(127, 127, 127, .11);
}

/* Cabecalho: rotulo discreto no lugar da faixa cheia do .panel-heading */
#widgets .widget-heading {
    padding: 8px 12px 6px;
    border-bottom: 1px solid rgba(127, 127, 127, .14);
    background: transparent;
    color: inherit;
}

#widgets .widget-title {
    color: inherit;
    font-size: 11px;
    font-weight: 600;
    letter-spacing: .05em;
    text-transform: uppercase;
}

/* O nome do veiculo e dado, nao rotulo: fica como foi cadastrado */
#widgets .widget-title [data-device="name"] {
    font-size: 13px;
    letter-spacing: 0;
    text-transform: none;
}

#widgets .widget-title [data-device="status"] {
    display: inline-block;
    width: 8px;
    height: 8px;
    border-radius: 50%;
    vertical-align: middle;
}

#widgets .widget-title [data-device="status-text"] {
    display: inline-block;
    padding: 1px 8px;
    border-radius: 999px;
    background: rgba(127, 127, 127, .16);
    font-weight: 600;
    letter-spacing: 0;
    text-transform: none;
    vertical-align: middle;
}

#widgets .widget-title [data-device="status-text"]:empty {
    display: none;
}

/* Tabelas: sem linhas divisorias */
#widgets .widget .table > tbody > tr > td,
#widgets .widget .table > tbody > tr > th {
    border-top: 0;
}

/* Rotulo apagado e valor em destaque, so nos widgets de "rotulo: valor".
   Comandos, eventos e sensores tem conteudo na primeira coluna. */
#widgets .widget-device .table tr > td:first-child,
#widgets .widget-driver .table tr > td:first-child,
#widgets .widget-locking .table tr > td:first-child {
    opacity: .6;
}

#widgets .widget-device .table tr > td + td,
#widgets .widget-driver .table tr > td + td,
#widgets .widget-locking .table tr > td + td {
    font-weight: 600;
}

#widgets .widget-recent-events .table tr[onclick]:hover,
#widgets .widget-gprs-command .table tr:hover {
    background: rgba(127, 127, 127, .12);
}

#widgets .widget .btn {
    border-radius: 8px;
}

#widgets .widget .btn-xs {
    border-radius: 6px;
}


/* ─── Icones dos sensores ───────────────────────────────────────────────────
 * O <i class="icon {tipo}"> que o device.js gera continua igual. Aqui o glifo
 * da fonte icomoon some (font-size: 0) e o desenho passa a ser um SVG de traco
 * aplicado como mascara: a cor continua sendo a do icone no tema.
 * Icone enviado pelo admin (img.sensor-icon) nao e trocado, so alinhado.
 */
#widgets .widget-sensors i.icon {
    position: relative;
    display: inline-block;
    width: 20px;
    height: 20px;
    margin-right: 8px;
    font-size: 0;
    vertical-align: middle;
    background-color: currentColor;
    -webkit-mask: var(--sensor-icon) center / contain no-repeat;
    mask: var(--sensor-icon) center / contain no-repeat;
    /* Tipo sem desenho proprio (ex.: sensores novos): ponto de atividade */
    --sensor-icon: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23000' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M22 12h-4l-3 9L9 3l-3 9H2'/%3E%3C/svg%3E");
}

#widgets .widget-sensors i.icon::before,
#widgets .widget-sensors i.icon::after {
    content: none;
}

#widgets .widget-sensors img.sensor-icon {
    width: 20px;
    height: 20px;
    max-width: none;
    max-height: none;
    margin-right: 8px;
    object-fit: contain;
    vertical-align: middle;
}

/* titulo do widget: ondas de sinal */
#widgets .widget-sensors i.icon.sensors {
    --sensor-icon: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23000' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M4.9 19.1C1 15.2 1 8.8 4.9 4.9'/%3E%3Cpath d='M7.8 16.2c-2.3-2.3-2.3-6.1 0-8.5'/%3E%3Ccircle cx='12' cy='12' r='2'/%3E%3Cpath d='M16.2 7.8c2.3 2.3 2.3 6.1 0 8.5'/%3E%3Cpath d='M19.1 4.9C23 8.8 23 15.1 19.1 19'/%3E%3C/svg%3E");
}

/* chave */
#widgets .widget-sensors i.icon.acc,
#widgets .widget-sensors i.icon.ignition {
    --sensor-icon: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23000' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Ccircle cx='7.5' cy='15.5' r='5.5'/%3E%3Cpath d='m21 2-9.6 9.6'/%3E%3Cpath d='m15.5 7.5 3 3L22 7l-3-3'/%3E%3C/svg%3E");
}

/* liga/desliga */
#widgets .widget-sensors i.icon.logical,
#widgets .widget-sensors i.icon.plugged {
    --sensor-icon: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23000' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M12 2v10'/%3E%3Cpath d='M18.4 6.6a9 9 0 1 1-12.77.04'/%3E%3C/svg%3E");
}

/* trajeto percorrido */
#widgets .widget-sensors i.icon.odometer {
    --sensor-icon: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23000' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Ccircle cx='6' cy='19' r='3'/%3E%3Cpath d='M9 19h8.5a3.5 3.5 0 0 0 0-7h-11a3.5 3.5 0 0 1 0-7H15'/%3E%3Ccircle cx='18' cy='5' r='3'/%3E%3C/svg%3E");
}

/* contador */
#widgets .widget-sensors i.icon.counter,
#widgets .widget-sensors i.icon.numerical {
    --sensor-icon: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23000' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Crect x='2' y='7' width='20' height='10' rx='2'/%3E%3Cpath d='M8.7 7v10'/%3E%3Cpath d='M15.3 7v10'/%3E%3C/svg%3E");
}

/* velocimetro */
#widgets .widget-sensors i.icon.speed,
#widgets .widget-sensors i.icon.speed_ecm {
    --sensor-icon: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23000' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='m12 14 4-4'/%3E%3Cpath d='M3.34 19a10 10 0 1 1 17.32 0'/%3E%3C/svg%3E");
}

/* conta-giros */
#widgets .widget-sensors i.icon.tachometer {
    --sensor-icon: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23000' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Ccircle cx='12' cy='12' r='10'/%3E%3Cpath d='m12 12 3-6'/%3E%3Cpath d='M12 12v.01'/%3E%3C/svg%3E");
}

/* bomba de combustivel */
#widgets .widget-sensors i.icon.fuel,
#widgets .widget-sensors i.icon.fuel_tank,
#widgets .widget-sensors i.icon.fuel_tank_calibration,
#widgets .widget-sensors i.icon.fuel_consumption,
#widgets .widget-sensors i.icon.fuel_tank_consumption {
    --sensor-icon: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23000' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M3 22h12'/%3E%3Cpath d='M4 9h10'/%3E%3Cpath d='M14 22V4a2 2 0 0 0-2-2H6a2 2 0 0 0-2 2v18'/%3E%3Cpath d='M14 13h2a2 2 0 0 1 2 2v2a2 2 0 0 0 4 0V9.83a2 2 0 0 0-.59-1.42L18 5'/%3E%3C/svg%3E");
}

/* termometro */
#widgets .widget-sensors i.icon.temperature,
#widgets .widget-sensors i.icon.temperature_calibration {
    --sensor-icon: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23000' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M14 4v10.54a4 4 0 1 1-4 0V4a2 2 0 0 1 4 0Z'/%3E%3C/svg%3E");
}

/* porta */
#widgets .widget-sensors i.icon.door,
#widgets .widget-sensors i.icon.doors {
    --sensor-icon: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23000' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M13 4h3a2 2 0 0 1 2 2v14'/%3E%3Cpath d='M2 20h3'/%3E%3Cpath d='M13 20h9'/%3E%3Cpath d='M10 12v.01'/%3E%3Cpath d='M13 4.56v16.16a1 1 0 0 1-1.24.97L5 20V5.56a2 2 0 0 1 1.52-1.94l4-1A2 2 0 0 1 13 4.56Z'/%3E%3C/svg%3E");
}

/* engrenagem */
#widgets .widget-sensors i.icon.engine,
#widgets .widget-sensors i.icon.detect_engine {
    --sensor-icon: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23000' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Ccircle cx='12' cy='12' r='7'/%3E%3Ccircle cx='12' cy='12' r='2.5'/%3E%3Cpath d='M12 2v3M12 19v3M2 12h3M19 12h3M4.93 4.93l2.12 2.12M16.95 16.95l2.12 2.12M4.93 19.07l2.12-2.12M16.95 7.05l2.12-2.12'/%3E%3C/svg%3E");
}

/* relogio */
#widgets .widget-sensors i.icon.engine_hours {
    --sensor-icon: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23000' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Ccircle cx='12' cy='12' r='10'/%3E%3Cpath d='M12 6v6l4 2'/%3E%3C/svg%3E");
}

/* antena */
#widgets .widget-sensors i.icon.satellites {
    --sensor-icon: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23000' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M4 10a7.31 7.31 0 0 0 10 10Z'/%3E%3Cpath d='m9 15 3-3'/%3E%3Cpath d='M17 13a6 6 0 0 0-6-6'/%3E%3Cpath d='M21 13A10 10 0 0 0 11 3'/%3E%3C/svg%3E");
}

/* escudo */
#widgets .widget-sensors i.icon.seatbelt {
    --sensor-icon: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23000' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M20 13c0 5-3.5 7.5-7.66 8.95a1 1 0 0 1-.67-.01C7.5 20.5 4 18 4 13V6a1 1 0 0 1 1-1c2 0 4.5-1.2 6.24-2.72a1.17 1.17 0 0 1 1.52 0C14.51 3.81 17 5 19 5a1 1 0 0 1 1 1z'/%3E%3Cpath d='m9 12 2 2 4-4'/%3E%3C/svg%3E");
}

/* texto */
#widgets .widget-sensors i.icon.textual,
#widgets .widget-sensors i.icon.vin {
    --sensor-icon: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23000' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M4 7V5h16v2'/%3E%3Cpath d='M12 5v14'/%3E%3Cpath d='M9 19h6'/%3E%3C/svg%3E");
}

/* peso */
#widgets .widget-sensors i.icon.load,
#widgets .widget-sensors i.icon.load_calibration {
    --sensor-icon: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23000' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Ccircle cx='12' cy='5' r='3'/%3E%3Cpath d='M6.5 8h11L20 21H4z'/%3E%3C/svg%3E");
}

/* cartao */
#widgets .widget-sensors i.icon.rfid {
    --sensor-icon: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23000' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Crect x='2' y='5' width='20' height='14' rx='2'/%3E%3Cpath d='M2 10h20'/%3E%3C/svg%3E");
}

/* cadeado */
#widgets .widget-sensors i.icon.blocked,
#widgets .widget-sensors i.icon.lock {
    --sensor-icon: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23000' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Crect x='4' y='11' width='16' height='10' rx='2'/%3E%3Cpath d='M8 11V7a4 4 0 0 1 8 0v4'/%3E%3C/svg%3E");
}

/* cadeado aberto */
#widgets .widget-sensors i.icon.unlock {
    --sensor-icon: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23000' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Crect x='4' y='11' width='16' height='10' rx='2'/%3E%3Cpath d='M8 11V7a4 4 0 0 1 7.5-2'/%3E%3C/svg%3E");
}

/* alerta */
#widgets .widget-sensors i.icon.harsh_acceleration,
#widgets .widget-sensors i.icon.harsh_breaking,
#widgets .widget-sensors i.icon.harsh_turning {
    --sensor-icon: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23000' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M12 3 2 20h20z'/%3E%3Cpath d='M12 10v4'/%3E%3Cpath d='M12 17v.01'/%3E%3C/svg%3E");
}

/* Bateria e sinal: a mascara do <i> e o contorno; o ::before pinta o nivel.
   Com mascara no proprio <i> o ::before seria recortado junto, por isso aqui
   o contorno vai no ::after e o <i> fica sem fundo. */
#widgets .widget-sensors i.icon.battery,
#widgets .widget-sensors i.icon.battery-0,
#widgets .widget-sensors i.icon.battery-1,
#widgets .widget-sensors i.icon.battery-2,
#widgets .widget-sensors i.icon.battery-3,
#widgets .widget-sensors i.icon.battery-4,
#widgets .widget-sensors i.icon.battery-5,
#widgets .widget-sensors i.icon.gsm-0,
#widgets .widget-sensors i.icon.gsm-1,
#widgets .widget-sensors i.icon.gsm-2,
#widgets .widget-sensors i.icon.gsm-3,
#widgets .widget-sensors i.icon.gsm-4,
#widgets .widget-sensors i.icon.gsm-5 {
    background-color: transparent;
    -webkit-mask: none;
    mask: none;
}

#widgets .widget-sensors i.icon.battery::after,
#widgets .widget-sensors i.icon.battery-0::after,
#widgets .widget-sensors i.icon.battery-1::after,
#widgets .widget-sensors i.icon.battery-2::after,
#widgets .widget-sensors i.icon.battery-3::after,
#widgets .widget-sensors i.icon.battery-4::after,
#widgets .widget-sensors i.icon.battery-5::after,
#widgets .widget-sensors i.icon.gsm-0::after,
#widgets .widget-sensors i.icon.gsm-1::after,
#widgets .widget-sensors i.icon.gsm-2::after,
#widgets .widget-sensors i.icon.gsm-3::after,
#widgets .widget-sensors i.icon.gsm-4::after,
#widgets .widget-sensors i.icon.gsm-5::after,
#widgets .widget-sensors i.icon.battery::before,
#widgets .widget-sensors i.icon.battery-0::before,
#widgets .widget-sensors i.icon.battery-1::before,
#widgets .widget-sensors i.icon.battery-2::before,
#widgets .widget-sensors i.icon.battery-3::before,
#widgets .widget-sensors i.icon.battery-4::before,
#widgets .widget-sensors i.icon.battery-5::before,
#widgets .widget-sensors i.icon.gsm-0::before,
#widgets .widget-sensors i.icon.gsm-1::before,
#widgets .widget-sensors i.icon.gsm-2::before,
#widgets .widget-sensors i.icon.gsm-3::before,
#widgets .widget-sensors i.icon.gsm-4::before,
#widgets .widget-sensors i.icon.gsm-5::before {
    content: "";
    position: absolute;
    top: 0;
    right: 0;
    bottom: 0;
    left: 0;
    -webkit-mask: var(--sensor-icon) center / contain no-repeat;
    mask: var(--sensor-icon) center / contain no-repeat;
}

#widgets .widget-sensors i.icon.battery::after,
#widgets .widget-sensors i.icon.battery-0::after,
#widgets .widget-sensors i.icon.battery-1::after,
#widgets .widget-sensors i.icon.battery-2::after,
#widgets .widget-sensors i.icon.battery-3::after,
#widgets .widget-sensors i.icon.battery-4::after,
#widgets .widget-sensors i.icon.battery-5::after,
#widgets .widget-sensors i.icon.gsm-0::after,
#widgets .widget-sensors i.icon.gsm-1::after,
#widgets .widget-sensors i.icon.gsm-2::after,
#widgets .widget-sensors i.icon.gsm-3::after,
#widgets .widget-sensors i.icon.gsm-4::after,
#widgets .widget-sensors i.icon.gsm-5::after {
    background-color: currentColor;
}

#widgets .widget-sensors i.icon.battery::before,
#widgets .widget-sensors i.icon.battery-0::before,
#widgets .widget-sensors i.icon.battery-1::before,
#widgets .widget-sensors i.icon.battery-2::before,
#widgets .widget-sensors i.icon.battery-3::before,
#widgets .widget-sensors i.icon.battery-4::before,
#widgets .widget-sensors i.icon.battery-5::before,
#widgets .widget-sensors i.icon.gsm-0::before,
#widgets .widget-sensors i.icon.gsm-1::before,
#widgets .widget-sensors i.icon.gsm-2::before,
#widgets .widget-sensors i.icon.gsm-3::before,
#widgets .widget-sensors i.icon.gsm-4::before,
#widgets .widget-sensors i.icon.gsm-5::before {
    background-color: #5cb85c;
    -webkit-mask-image: var(--sensor-level);
    mask-image: var(--sensor-level);
}

#widgets .widget-sensors i.icon.battery,
#widgets .widget-sensors i.icon.battery-0,
#widgets .widget-sensors i.icon.battery-1,
#widgets .widget-sensors i.icon.battery-2,
#widgets .widget-sensors i.icon.battery-3,
#widgets .widget-sensors i.icon.battery-4,
#widgets .widget-sensors i.icon.battery-5 {
    --sensor-icon: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23000' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Crect x='2' y='7' width='17' height='10' rx='2'/%3E%3Cpath d='M22 11v2'/%3E%3C/svg%3E");
    --sensor-level: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='%23000'%3E%3Crect x='4.2' y='9.5' width='1.8' height='5'/%3E%3Crect x='6.9' y='9.5' width='1.8' height='5'/%3E%3Crect x='9.6' y='9.5' width='1.8' height='5'/%3E%3Crect x='12.3' y='9.5' width='1.8' height='5'/%3E%3C/svg%3E");
}

#widgets .widget-sensors i.icon.battery-0 { --sensor-level: none; }
#widgets .widget-sensors i.icon.battery-1 { --sensor-level: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='%23000'%3E%3Crect x='4.2' y='9.5' width='1.8' height='5'/%3E%3C/svg%3E"); }
#widgets .widget-sensors i.icon.battery-2 { --sensor-level: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='%23000'%3E%3Crect x='4.2' y='9.5' width='1.8' height='5'/%3E%3Crect x='6.9' y='9.5' width='1.8' height='5'/%3E%3C/svg%3E"); }
#widgets .widget-sensors i.icon.battery-3 { --sensor-level: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='%23000'%3E%3Crect x='4.2' y='9.5' width='1.8' height='5'/%3E%3Crect x='6.9' y='9.5' width='1.8' height='5'/%3E%3Crect x='9.6' y='9.5' width='1.8' height='5'/%3E%3C/svg%3E"); }
#widgets .widget-sensors i.icon.battery-4 { --sensor-level: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='%23000'%3E%3Crect x='4.2' y='9.5' width='1.8' height='5'/%3E%3Crect x='6.9' y='9.5' width='1.8' height='5'/%3E%3Crect x='9.6' y='9.5' width='1.8' height='5'/%3E%3Crect x='12.3' y='9.5' width='1.8' height='5'/%3E%3C/svg%3E"); }
#widgets .widget-sensors i.icon.battery-5 { --sensor-level: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='%23000'%3E%3Crect x='4.2' y='9.5' width='1.8' height='5'/%3E%3Crect x='6.9' y='9.5' width='1.8' height='5'/%3E%3Crect x='9.6' y='9.5' width='1.8' height='5'/%3E%3Crect x='12.3' y='9.5' width='1.8' height='5'/%3E%3Crect x='15.0' y='9.5' width='1.8' height='5'/%3E%3C/svg%3E"); }

#widgets .widget-sensors i.icon.gsm-0,
#widgets .widget-sensors i.icon.gsm-1,
#widgets .widget-sensors i.icon.gsm-2,
#widgets .widget-sensors i.icon.gsm-3,
#widgets .widget-sensors i.icon.gsm-4,
#widgets .widget-sensors i.icon.gsm-5 {
    --sensor-icon: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='%23000' fill-opacity='.3'%3E%3Crect x='2.5' y='15' width='3' height='5' rx='1'/%3E%3Crect x='6.5' y='12' width='3' height='8' rx='1'/%3E%3Crect x='10.5' y='9' width='3' height='11' rx='1'/%3E%3Crect x='14.5' y='6' width='3' height='14' rx='1'/%3E%3Crect x='18.5' y='3' width='3' height='17' rx='1'/%3E%3C/svg%3E");
}

#widgets .widget-sensors i.icon.gsm-0 { --sensor-level: none; }
#widgets .widget-sensors i.icon.gsm-1 { --sensor-level: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='%23000'%3E%3Crect x='2.5' y='15' width='3' height='5' rx='1'/%3E%3C/svg%3E"); }
#widgets .widget-sensors i.icon.gsm-2 { --sensor-level: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='%23000'%3E%3Crect x='2.5' y='15' width='3' height='5' rx='1'/%3E%3Crect x='6.5' y='12' width='3' height='8' rx='1'/%3E%3C/svg%3E"); }
#widgets .widget-sensors i.icon.gsm-3 { --sensor-level: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='%23000'%3E%3Crect x='2.5' y='15' width='3' height='5' rx='1'/%3E%3Crect x='6.5' y='12' width='3' height='8' rx='1'/%3E%3Crect x='10.5' y='9' width='3' height='11' rx='1'/%3E%3C/svg%3E"); }
#widgets .widget-sensors i.icon.gsm-4 { --sensor-level: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='%23000'%3E%3Crect x='2.5' y='15' width='3' height='5' rx='1'/%3E%3Crect x='6.5' y='12' width='3' height='8' rx='1'/%3E%3Crect x='10.5' y='9' width='3' height='11' rx='1'/%3E%3Crect x='14.5' y='6' width='3' height='14' rx='1'/%3E%3C/svg%3E"); }
#widgets .widget-sensors i.icon.gsm-5 { --sensor-level: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='%23000'%3E%3Crect x='2.5' y='15' width='3' height='5' rx='1'/%3E%3Crect x='6.5' y='12' width='3' height='8' rx='1'/%3E%3Crect x='10.5' y='9' width='3' height='11' rx='1'/%3E%3Crect x='14.5' y='6' width='3' height='14' rx='1'/%3E%3Crect x='18.5' y='3' width='3' height='17' rx='1'/%3E%3C/svg%3E"); }


/* Nivel zero: so o contorno. Sem isto, mask-image: none deixaria o ::before
   pintar o quadrado inteiro. */
#widgets .widget-sensors i.icon.battery-0::before,
#widgets .widget-sensors i.icon.gsm-0::before {
    display: none;
}

/* Bateria do veiculo: sensor de bateria em volts, marcado pelo
   widgets-modern.js. Bateria de carro com os dois polos, sem barras de nivel:
   tensao nao e porcentagem de carga. */
#widgets .widget-sensors i.icon.battery.battery-vehicle {
    background-color: currentColor;
    -webkit-mask: var(--sensor-icon) center / contain no-repeat;
    mask: var(--sensor-icon) center / contain no-repeat;
    --sensor-icon: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23000' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Crect x='3' y='7' width='18' height='13' rx='2'/%3E%3Cpath d='M7 7V4'/%3E%3Cpath d='M17 7V4'/%3E%3Cpath d='M6.5 13.5h4'/%3E%3Cpath d='M13.5 13.5h4'/%3E%3Cpath d='M15.5 11.5v4'/%3E%3C/svg%3E");
}

#widgets .widget-sensors i.icon.battery.battery-vehicle::before,
#widgets .widget-sensors i.icon.battery.battery-vehicle::after {
    content: none;
}

/* Nome do sensor: o widgets-modern.js embrulha o nome em .sensor-name e marca
   .is-long quando nao cabe. O nome comprido desliza ate o fim e volta, com
   pausa nas pontas, no lugar das reticencias. */
#widgets .widget-sensors .sensor-name {
    display: inline-block;
    /* coluna menos o icone (20px) e a margem dele (8px) */
    max-width: calc(100% - 28px);
    overflow: hidden;
    white-space: nowrap;
    vertical-align: middle;
}

#widgets .widget-sensors .sensor-name > span {
    display: inline-block;
}

#widgets .widget-sensors .sensor-name.is-long > span {
    /* 8s: mesma duracao de MARQUEE_MS no widgets-modern.js */
    animation: sensor-name-marquee 8s ease-in-out infinite;
}

@keyframes sensor-name-marquee {
    0%, 12% {
        transform: translateX(0);
    }
    45%, 57% {
        transform: translateX(var(--sensor-name-shift));
    }
    90%, 100% {
        transform: translateX(0);
    }
}

/* Bloqueio conforme o estado (.is-on/.is-off vem do widgets-modern.js):
   desligado, cadeado aberto; bloqueado, o cadeado fechado do tipo "blocked".
   Sem o estado, fica o fechado. */
#widgets .widget-sensors i.icon.blocked.is-off {
    --sensor-icon: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23000' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Crect x='4' y='11' width='16' height='10' rx='2'/%3E%3Cpath d='M8 11V7a4 4 0 0 1 7.5-2'/%3E%3C/svg%3E");
}

/* Movimento ligado: verde, o mesmo das barras de bateria. Desligado fica na
   cor do tema. */
#widgets .widget-sensors i.icon.logical.motion.is-on {
    background-color: #5cb85c;
}

/* Movimento: sensor logico reconhecido pelo nome no widgets-modern.js.
   Setas duplas de avanco no lugar do liga/desliga generico. */
#widgets .widget-sensors i.icon.logical.motion {
    --sensor-icon: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23000' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='m6 17 5-5-5-5'/%3E%3Cpath d='m13 17 5-5-5-5'/%3E%3C/svg%3E");
}
