/* Máquina: reaproveita a casca de módulo (module-*) e refina a lista de computadores.
   Tudo em tokens do tema (claro/escuro) e sem cor como único sinal — cada estado tem texto. */

/* O nó do problema do "espaço enorme": a tabela distribui largura igual entre as colunas. Aqui o
   nome cresce e ocupa a folga, e Estado/Escrita/ações encolhem ao próprio conteúdo, coladas à
   direita — some o vão entre ELAS. */
.module-table td.machine-cell-name { width: 100%; }
.module-table td.machine-col-status,
.module-table td.machine-col-write,
.module-table td.machine-col-actions { white-space: nowrap; width: 1%; }

/* Centro vertical: as pills ficam alinhadas com o nome, não grudadas no topo da célula. */
.machine-row td { vertical-align: middle; }

/* Nome + ícone do aparelho + meta (SO · versão). */
.machine-name-row { display: flex; align-items: center; gap: 12px; min-width: 0; }
.machine-icon {
    flex: none;
    display: grid;
    place-items: center;
    width: 34px;
    height: 34px;
    border-radius: 10px;
    background: var(--surface-hover);
    border: 1px solid var(--line);
    color: var(--ink-muted);
}
.machine-icon svg { width: 18px; height: 18px; }
.machine-name-text { display: flex; flex-direction: column; gap: 1px; min-width: 0; }
.machine-primary {
    font-weight: 650;
    color: var(--ink);
    line-height: 1.25;
    overflow: hidden;
    text-overflow: ellipsis;
}
.machine-meta {
    font-size: var(--text-xs);
    color: var(--ink-muted);
    overflow: hidden;
    text-overflow: ellipsis;
}

/* Pill de estado (Online/Offline). O ponto é decorativo (aria-hidden); o texto carrega o sentido. */
.machine-status {
    display: inline-flex;
    align-items: center;
    gap: 7px;
    padding: 4px 11px;
    border-radius: 999px;
    background: var(--line);
    color: var(--ink-muted);
    font-size: var(--text-2xs);
    font-weight: 650;
    line-height: 1;
}
.machine-status .machine-dot {
    width: 7px; height: 7px; border-radius: 50%;
    background: currentColor; opacity: 0.75; flex: none;
}
.machine-status-online {
    background: var(--green-soft);
    color: var(--accent-ink);
}
.machine-status-online .machine-dot {
    background: var(--green);
    opacity: 1;
}
@media (prefers-reduced-motion: no-preference) {
    .machine-status-online .machine-dot { animation: machine-pulse 2s ease-in-out infinite; }
}
@keyframes machine-pulse {
    0%, 100% { box-shadow: 0 0 0 0 color-mix(in srgb, var(--green) 55%, transparent); }
    70% { box-shadow: 0 0 0 5px color-mix(in srgb, var(--green) 0%, transparent); }
}

/* Pill de escrita. Somente leitura = neutro discreto; Leitura e escrita = âmbar (atenção). */
.machine-write {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 4px 11px;
    border-radius: 999px;
    background: var(--surface-hover);
    color: var(--ink-muted);
    border: 1px solid var(--line);
    font-size: var(--text-2xs);
    font-weight: 650;
    line-height: 1;
}
.machine-write svg { width: 12px; height: 12px; flex: none; }
.machine-write-on {
    background: var(--warn-bg);
    color: var(--warn-ink);
    border-color: var(--warn-border);
}

/* Foco visível e acessível em qualquer alvo interativo da linha. */
.machine-row a:focus-visible,
.machine-row button:focus-visible {
    outline: 2px solid var(--green);
    outline-offset: 2px;
    border-radius: 8px;
}

/* Celular: o nome e as ações bastam; Estado e Escrita saem da grade e viram etiquetas sob o nome. */
@media (max-width: 620px) {
    .machine-col-hide-sm { display: none; }
    .machine-name-badges { display: flex; gap: 6px; margin-top: 4px; flex-wrap: wrap; }
}
@media (min-width: 621px) {
    .machine-name-badges { display: none; }
}
