/* Aparelhos conectados (delta do legado de 03/11 e 09/11): situação (rota do dia e sinal), bateria, rota com os
   pinos (cinza = concluída, amarelo = atual, azul = pendente), histórico e o celular desenhado da ficha. */

.sn2-dev-situation {
    display: inline-flex;
    flex-wrap: wrap;
    gap: 6px;
    align-items: center;
}

.sn2-dev-route-count {
    font-size: var(--sn2-text-xs);
    font-weight: 600;
    color: var(--sn2-fg-2);
    white-space: nowrap;
}

.sn2-dev-signal {
    display: inline-flex;
    gap: 6px;
    align-items: center;
    font-size: var(--sn2-text-sm);
    color: var(--sn2-fg-3);
    white-space: nowrap;
}

.sn2-dev-signal__dot {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background: var(--sn2-fg-3);
}

.sn2-dev-signal--on { color: var(--sn2-success); }
.sn2-dev-signal--on .sn2-dev-signal__dot { background: var(--sn2-success); box-shadow: 0 0 0 3px color-mix(in srgb, var(--sn2-success) 22%, transparent); }

/* Rota concluída: o chip pulsa e esmaece, como o recolhimento do cartão no legado. */
.sn2-dev-route-chip--done { animation: sn2-dev-done 2.4s ease-out 3 both; }

@keyframes sn2-dev-done {
    0% { transform: scale(0.92); opacity: 0.4; }
    30% { transform: scale(1.06); opacity: 1; }
    100% { transform: scale(1); opacity: 0.85; }
}

/* Bateria */
.sn2-dev-battery {
    display: inline-flex;
    gap: 6px;
    align-items: center;
    font-size: var(--sn2-text-sm);
    white-space: nowrap;
}

.sn2-dev-battery__meter {
    display: inline-block;
    width: 26px;
    height: 12px;
    padding: 1px;
    border: 1.5px solid currentColor;
    border-radius: 3px;
}

.sn2-dev-battery__meter > span {
    display: block;
    height: 100%;
    border-radius: 1px;
    background: currentColor;
}

.sn2-dev-battery--ok { color: var(--sn2-success); }
.sn2-dev-battery--mid { color: var(--sn2-warning); }
.sn2-dev-battery--low { color: var(--sn2-danger); }

.sn2-dev-battery__plug {
    font-size: var(--sn2-text-xs);
    color: var(--sn2-fg-3);
}

.sn2-dev-nosignal {
    margin: 0;
    padding: 12px 24px;
    border-top: 1px solid var(--sn2-border-1);
}

/* Pinos da rota */
.sn2-dev-pin {
    display: inline-grid;
    flex: none;
    place-items: center;
    width: 22px;
    height: 22px;
    border-radius: 50%;
    font-size: 11px;
    font-weight: 700;
    color: #fff;
    background: #2563EB;
}

.sn2-dev-pin--done { background: #94A3B8; }
.sn2-dev-pin--current { background: #F5B301; color: #3A2A00; }
.sn2-dev-pin--pending { background: #2563EB; }
.sn2-dev-pin--device { background: #23AA58; }

.sn2-dev-route__head {
    display: flex;
    gap: 8px;
    align-items: center;
    justify-content: space-between;
}

.sn2-dev-route__head .sn2-card__title { margin: 0; }

.sn2-dev-route__bar {
    display: flex;
    gap: 3px;
    margin: 12px 0 6px;
}

.sn2-dev-route__bar > i {
    flex: 1;
    height: 6px;
    border-radius: 3px;
}

.sn2-dev-route__bar > .sn2-dev-pin--done { background: #94A3B8; }
.sn2-dev-route__bar > .sn2-dev-pin--current { background: #F5B301; }
.sn2-dev-route__bar > .sn2-dev-pin--pending { background: color-mix(in srgb, #2563EB 35%, transparent); }

.sn2-dev-route__meta {
    margin: 0 0 12px;
    font-size: var(--sn2-text-sm);
    color: var(--sn2-fg-2);
}

.sn2-dev-route__done {
    margin: -24px -26px 14px;
    padding: 8px 26px;
    display: flex;
    gap: 6px;
    align-items: center;
    font-size: var(--sn2-text-sm);
    font-weight: 600;
    color: var(--sn2-success-fg);
    background: var(--sn2-success-bg);
    animation: sn2-dev-done 2.4s ease-out both;
}

.sn2-dev-stops {
    display: grid;
    gap: 2px;
    margin: 0 0 12px;
    padding: 0;
    list-style: none;
}

.sn2-dev-stop {
    display: flex;
    gap: 10px;
    align-items: center;
    padding: 8px 0;
    border-bottom: 1px solid var(--sn2-border-1);
}

.sn2-dev-stop:last-child { border-bottom: 0; }

.sn2-dev-stop__text {
    display: grid;
    flex: 1;
    min-width: 0;
}

.sn2-dev-stop__text b,
.sn2-dev-stop__text span {
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.sn2-dev-stop__text span {
    font-size: var(--sn2-text-xs);
    color: var(--sn2-fg-3);
}

.sn2-dev-stop--done .sn2-dev-stop__text b { color: var(--sn2-fg-3); font-weight: 500; }

.sn2-dev-stop__state {
    font-size: var(--sn2-text-xs);
    font-style: normal;
    color: var(--sn2-fg-2);
    white-space: nowrap;
}

.sn2-dev-stop--current .sn2-dev-stop__state { font-weight: 700; color: #9A6B00; }

.sn2-dev-legend {
    display: flex;
    flex-wrap: wrap;
    gap: 14px;
    margin: 10px 0 0;
    padding: 0;
    list-style: none;
    font-size: var(--sn2-text-xs);
    color: var(--sn2-fg-2);
}

.sn2-dev-legend li {
    display: inline-flex;
    gap: 6px;
    align-items: center;
}

.sn2-dev-legend .sn2-dev-pin {
    width: 12px;
    height: 12px;
}

/* Histórico */
.sn2-dev-history {
    display: grid;
    grid-template-columns: 74px 1fr;
    gap: 8px;
    padding: 7px 0;
    border-bottom: 1px solid var(--sn2-border-1);
    font-size: var(--sn2-text-sm);
}

.sn2-dev-history:last-of-type { border-bottom: 0; }

.sn2-dev-history__when {
    color: var(--sn2-fg-3);
    font-variant-numeric: tabular-nums;
}

/* Celular desenhado */
.sn2-dev-phone-card { display: grid; place-items: center; }

.sn2-dev-phone {
    width: 180px;
    height: 330px;
    padding: 10px;
    border-radius: 30px;
    background: #1E2A36;
    box-shadow: inset 0 0 0 2px #3A4A5C;
}

.sn2-dev-phone__screen {
    display: grid;
    place-items: center;
    height: 100%;
    overflow: hidden;
    border-radius: 22px;
    color: #fff;
    background: linear-gradient(160deg, #23476B, #10202F);
}

.sn2-dev-phone__lock,
.sn2-dev-phone__app {
    display: grid;
    gap: 6px;
    justify-items: center;
    padding: 14px;
    text-align: center;
}

.sn2-dev-phone__date { font-size: 13px; opacity: 0.85; }
.sn2-dev-phone__clock { font-size: 44px; font-weight: 300; line-height: 1; letter-spacing: -1px; }
.sn2-dev-phone__last { font-size: 12px; opacity: 0.75; }

.sn2-dev-phone__mon {
    padding: 2px 8px;
    border-radius: 999px;
    font-size: 11px;
    background: rgba(221, 75, 107, 0.85);
}

.sn2-dev-phone__app {
    width: calc(100% - 20px);
    border-radius: 14px;
    color: #10202F;
    background: #fff;
}

.sn2-dev-phone__app span:last-child {
    font-size: 12px;
    color: #5C6C80;
}

.sn2-dev-phone__kind {
    display: inline-flex;
    gap: 4px;
    align-items: center;
    font-size: 12px;
    font-weight: 700;
    color: #9A6B00;
}

.sn2-dev-phone__app--done {
    color: var(--sn2-success);
    animation: sn2-dev-done 2.4s ease-out both;
}

@media (prefers-reduced-motion: reduce) {
    .sn2-dev-route-chip--done,
    .sn2-dev-route__done,
    .sn2-dev-phone__app--done { animation: none; }
}
