/* ============================================================
   DESIGN TOKENS
   ============================================================ */
:root {
    --color-bg: #0f172a;
    --color-surface: #1e293b;
    --color-surface-raised: #273449;
    --color-border: #334155;
    --color-border-subtle: #1e293b;
    --color-text: #e2e8f0;
    --color-text-strong: #f1f5f9;
    --color-text-muted: #94a3b8;
    --color-text-dim: #64748b;
    --color-primary: #1e40af;
    --color-primary-hover: #1e3a8a;
    --color-accent: #4f7ef8;
    --color-danger: #ef4444;
    --color-danger-bg: #7f1d1d;
    --color-danger-text: #fca5a5;
    --color-success: #22c55e;
    --color-metrica-ok: #22c55e;
    --color-metrica-alerta: #f59e0b;
    --color-metrica-critica: #ef4444;
    --color-metrica-neutra: #94a3b8;
    --color-link-hover: #93c5fd;
    --select-arrow: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 12 12'%3E%3Cpath fill='%2394a3b8' d='M3 4.5L6 7.5L9 4.5'/%3E%3C/svg%3E");
    --radius-sm: 0.35rem;
    --radius-md: 0.5rem;
    --radius-lg: 0.75rem;
    --transition-fast: 0.15s;
    --font-sans: system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
}

/* ============================================================
   RESET & BASE
   ============================================================ */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

html {
    color-scheme: dark;
}

body {
    font-family: var(--font-sans);
    background: var(--color-bg);
    color: var(--color-text);
    min-height: 100vh;
    line-height: 1.5;
    -webkit-font-smoothing: antialiased;
}

a { color: inherit; text-decoration: none; }

a:not([class]):hover { color: var(--color-link-hover); }

h1, h2, h3, h4 {
    color: var(--color-text-strong);
    font-weight: 600;
    line-height: 1.3;
}

button, input, select, textarea {
    font-family: inherit;
    font-size: inherit;
    line-height: inherit;
}

button {
    background: none;
    border: none;
    color: inherit;
}

/* ============================================================
   FORM COMPONENTS
   ============================================================ */
.field {
    display: flex;
    flex-direction: column;
    gap: 0.35rem;
}

.field label {
    font-size: 0.875rem;
    color: var(--color-text-muted);
}

.input {
    display: block;
    padding: 0.6rem 0.75rem;
    border-radius: var(--radius-md);
    border: 1px solid var(--color-border);
    background-color: var(--color-bg);
    color: var(--color-text);
    font-size: 0.9rem;
    outline: none;
    appearance: none;
    -webkit-appearance: none;
    transition: border-color var(--transition-fast), box-shadow var(--transition-fast),
                background-color var(--transition-fast);
}

.field .input,
.login-card .input {
    width: 100%;
}

.input:hover:not(:disabled):not(:focus) {
    border-color: #475569;
    background-color: #0b1220;
}

.input:focus,
.input:focus-visible {
    border-color: var(--color-accent);
    box-shadow: 0 0 0 3px rgba(79, 126, 248, 0.2);
    background-color: var(--color-bg);
}

.input::placeholder {
    color: var(--color-text-dim);
}

.input:disabled {
    opacity: 0.55;
    cursor: not-allowed;
}

select.input {
    cursor: pointer;
    padding-right: 1.75rem;
    background-image: var(--select-arrow);
    background-repeat: no-repeat;
    background-position: right 0.55rem center;
}

select.input:hover:not(:disabled):not(:focus),
select.input:focus,
select.input:focus-visible {
    background-image: var(--select-arrow);
    background-repeat: no-repeat;
    background-position: right 0.55rem center;
}

select.input option {
    background: var(--color-surface);
    color: var(--color-text);
}

.input-sm {
    padding: 0.35rem 0.65rem;
    font-size: 0.8rem;
    border-radius: var(--radius-sm);
}

.filter-bar .input-sm {
    width: auto;
    min-width: 110px;
}

/* ============================================================
   BUTTON COMPONENTS
   ============================================================ */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.35rem;
    padding: 0.55rem 1rem;
    border-radius: var(--radius-md);
    border: 1px solid transparent;
    font-size: 0.9rem;
    font-weight: 500;
    line-height: 1.2;
    cursor: pointer;
    white-space: nowrap;
    text-decoration: none;
    appearance: none;
    -webkit-appearance: none;
    transition: background var(--transition-fast), border-color var(--transition-fast),
                color var(--transition-fast), box-shadow var(--transition-fast),
                transform var(--transition-fast);
}

.btn:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

.btn:focus-visible {
    outline: none;
    box-shadow: 0 0 0 3px rgba(79, 126, 248, 0.35);
}

.btn-sm {
    padding: 0.3rem 0.7rem;
    font-size: 0.8rem;
    border-radius: var(--radius-sm);
}

.btn-block {
    width: 100%;
    margin-top: 0.5rem;
}

.btn-primary {
    background: linear-gradient(135deg, var(--color-primary) 0%, var(--color-accent) 100%);
    border-color: var(--color-accent);
    color: #fff;
    font-weight: 600;
}

.btn-primary:hover:not(:disabled) {
    background: linear-gradient(135deg, var(--color-primary-hover) 0%, #3b6de8 100%);
    box-shadow: 0 4px 12px rgba(30, 64, 175, 0.35);
}

.btn-secondary {
    background: var(--color-surface);
    border-color: var(--color-border);
    color: var(--color-text-muted);
}

.btn-secondary:hover:not(:disabled) {
    background: var(--color-surface-raised);
    border-color: #475569;
    color: var(--color-text);
}

.btn-secondary--active {
    background: #1d4ed8;
    border-color: #3b82f6;
    color: #eff6ff;
}

.btn-secondary--active:hover:not(:disabled) {
    background: var(--color-primary);
}

.btn-danger {
    background: var(--color-danger-bg);
    border-color: var(--color-danger);
    color: var(--color-danger-text);
    font-weight: 600;
}

.btn-danger:hover:not(:disabled) {
    background: #991b1b;
}

.btn-ghost {
    background: transparent;
    border-color: #3b82f6;
    color: #60a5fa;
}

.btn-ghost:hover:not(:disabled) {
    background: #1e3a5f;
}

.btn-export {
    border-color: #475569;
    color: #cbd5e1;
    background: var(--color-surface);
}

.btn-export:hover:not(:disabled) {
    background: var(--color-border);
    border-color: #64748b;
}

.btn-export-xlsx {
    border-color: #166534;
    color: #4ade80;
    background: #052e16;
}

.btn-export-xlsx:hover:not(:disabled) {
    background: #14532d;
}

/* ============================================================
   HEADER
   ============================================================ */
.header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    flex-wrap: wrap;
    padding: 0.85rem 2rem;
    background: var(--color-surface);
    border-bottom: 1px solid var(--color-border);
    position: sticky;
    top: 0;
    z-index: 100;
    gap: 0.75rem 1.25rem;
}

.header-brand {
    flex: 0 1 auto;
    min-width: 0;
    display: flex;
    flex-direction: column;
    gap: 0.15rem;
}

.header-summary.summary-cards {
    flex: 1 1 auto;
    min-width: 0;
    margin-left: auto;
    margin-right: auto;
}

.header h1 {
    font-size: 1.3rem;
    color: var(--color-text-strong);
}

.header-version {
    font-size: 0.75rem;
    color: var(--color-text-muted);
    font-weight: 400;
}

.header-version.outdated {
    color: #fbbf24;
}

.header-status {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    font-size: 0.8rem;
    color: var(--color-text-muted);
    white-space: nowrap;
}

/* ============================================================
   SUMMARY CARDS
   ============================================================ */
.summary-cards {
    display: grid;
    grid-template-columns: repeat(5, minmax(0, 1fr));
    gap: 0.65rem;
    max-width: 640px;
}

.header-summary .card {
    padding: 0.45rem 0.65rem;
    border-radius: var(--radius-md);
}

.header-summary .card-value {
    font-size: 1.35rem;
}

.header-summary .card-label {
    font-size: 0.7rem;
    margin-top: 0.15rem;
}

.card {
    background: #1e293b;
    border-radius: 0.75rem;
    padding: 1.25rem 1rem;
    text-align: center;
    border: 1px solid #334155;
    min-width: 0;
}

.card-value {
    font-size: 2.25rem;
    font-weight: 700;
    line-height: 1;
}

.card-label {
    color: #94a3b8;
    font-size: 0.8rem;
    margin-top: 0.4rem;
}

.card-online  .card-value { color: #22c55e; }
.card-offline .card-value { color: #ef4444; }
.card-mobile  .card-value { color: #60a5fa; }
.card-alertas .card-value { color: #f59e0b; }
.card-total-maquinas .card-value { color: #e2e8f0; }

/* ============================================================
   BADGES
   ============================================================ */
.badge {
    display: inline-block;
    padding: 0.2rem 0.65rem;
    border-radius: 9999px;
    font-size: 0.72rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.03em;
}

.badge-online  { background: #166534; color: #4ade80; }
.badge-offline { background: #7f1d1d; color: #fca5a5; }
.badge-servidor {
    background: #1f2937;
    color: #fbbf24;
    border: 1px solid #facc15;
    margin-left: 0.35rem;
}
.badge-mobile {
    background: #1e3a5f;
    color: #38bdf8;
    border: 1px solid #0ea5e9;
    margin-left: 0.35rem;
}
.badge-whatsapp-silenciado {
    background: #3b0764;
    color: #e9d5ff;
    border: 1px solid #a855f7;
    margin-left: 0.35rem;
}
.badge-integridade-dados {
    background: #422006;
    color: #fde68a;
    border: 1px solid #f59e0b;
    margin-left: 0.35rem;
}

/* ============================================================
   MACHINES TABLE
   ============================================================ */
.table-section {
    padding: 1.25rem 2rem 2rem;
}

#tabela-clientes-wrapper,
.clientes-lista-wrapper {
    overflow-x: auto;
    border-radius: 0.75rem;
    border: 1px solid #334155;
}

/* ============================================================
   CLIENT CARDS GRID
   ============================================================ */
.clientes-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
    gap: 1rem;
    padding: 0.75rem;
    background: #020617;
}

.cliente-card {
    background: #1e293b;
    border-radius: 0.75rem;
    border: 1px solid #334155;
    padding: 1rem 1.1rem;
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
    transition: border-color 0.15s ease, transform 0.15s ease, box-shadow 0.15s ease, background 0.15s ease;
    cursor: pointer;
    box-shadow: 0 0 0 0 rgba(59, 130, 246, 0);
}

.cliente-card:hover {
    border-color: #3b82f6;
    background: #111827;
    box-shadow: 0 0 20px rgba(59, 130, 246, 0.15), 0 10px 25px rgba(15, 23, 42, 0.8);
    transform: translateY(-1px);
}

.cliente-card.offline {
    opacity: 0.75;
}

.cliente-card.com-alerta {
    border-color: #f59e0b;
    box-shadow: 0 0 0 1px rgba(245, 158, 11, 0.35);
}

.cliente-card.com-alerta:hover {
    border-color: #fbbf24;
    box-shadow: 0 0 20px rgba(245, 158, 11, 0.2), 0 10px 25px rgba(15, 23, 42, 0.8);
}

.cliente-card-alerta-banner {
    display: flex;
    flex-direction: column;
    gap: 0.4rem;
}

.cliente-card-alerta-item {
    padding: 0.5rem 0.65rem;
    border-radius: 0.4rem;
    border-left: 3px solid;
}

.cliente-card-alerta-tipo {
    font-weight: 600;
    font-size: 0.78rem;
    color: #f1f5f9;
    line-height: 1.25;
}

.cliente-card-alerta-msg {
    color: #cbd5e1;
    font-size: 0.72rem;
    line-height: 1.3;
    margin-top: 0.15rem;
}

/* USB em servidor: informativo (slate), distinto do banner de alerta */
.cliente-card-usb-info {
    padding: 0.5rem 0.65rem;
    border-radius: 0.4rem;
    border-left: 3px solid #38bdf8;
    background: rgba(51, 65, 85, 0.55);
}

.cliente-card-usb-titulo {
    font-weight: 600;
    font-size: 0.78rem;
    color: #94a3b8;
    line-height: 1.25;
}

.cliente-card-usb-item {
    color: #cbd5e1;
    font-size: 0.72rem;
    line-height: 1.3;
    margin-top: 0.15rem;
}

.cliente-lista-usb-info {
    display: block;
    margin-top: 0.35rem;
    color: #94a3b8;
    font-size: 0.72rem;
    line-height: 1.35;
    background: transparent;
}

.cliente-lista-usb-info:first-child {
    margin-top: 0;
}

.cliente-card-no-link {
    cursor: default;
}

.cliente-card-no-link:hover {
    transform: none;
    border-color: #334155;
    box-shadow: none;
}

/* Topo: identificação + SO */
.cliente-card-top {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 0.5rem;
}

.cliente-card-identidade {
    min-width: 0;
}

.cliente-card-tipo {
    flex-shrink: 0;
    line-height: 0;
    margin-top: 0.1rem;
}

.cliente-card-tipo .device-marker--card {
    width: 26px;
    height: 28px;
    filter: none;
}

.cliente-card-tipo .device-marker--card .device-marker-svg {
    width: 22px;
}

.cliente-hostname {
    font-weight: 700;
    color: #f9fafb;
    font-size: 1.05rem;
    line-height: 1.2;
    word-break: break-all;
}

.cliente-card-identidade .cliente-sistema {
    color: #94a3b8;
    font-size: 0.8rem;
    margin-top: 0.2rem;
}

.cliente-card-identidade .cliente-usuario {
    color: #cbd5e1;
    font-size: 0.8rem;
    margin-top: 0.15rem;
}

/* Status + rede (IP, Wi-Fi) */
.cliente-card-status-rede {
    display: flex;
    flex-direction: column;
    gap: 0.35rem;
}

.cliente-card-rede-info {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 0.35rem 0.75rem;
    font-size: 0.78rem;
    color: #94a3b8;
}

.cliente-card-rede-info .cliente-ip {
    color: #94a3b8;
    margin: 0;
}

.cliente-card-rede-info .cliente-rede-ssid {
    color: #cbd5e1;
    display: inline-flex;
    align-items: center;
    gap: 0.25rem;
}

/* Métricas com barras */
.cliente-card-metricas {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

.cliente-metrica-barra {
    display: flex;
    flex-direction: column;
    gap: 0.2rem;
}

.cliente-metrica-cabecalho {
    display: flex;
    align-items: center;
    gap: 0.4rem;
    font-size: 0.78rem;
}

.cliente-metrica-icone {
    width: 14px;
    height: 14px;
    flex-shrink: 0;
    background-size: contain;
    background-repeat: no-repeat;
    background-position: center;
    opacity: 0.85;
}

.cliente-metrica-icone-cpu {
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%2394a3b8' stroke-width='2'%3E%3Crect x='4' y='4' width='16' height='16' rx='2'/%3E%3Cpath d='M9 9h6v6H9z'/%3E%3C/svg%3E");
}

.cliente-metrica-icone-mem {
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%2394a3b8' stroke-width='2'%3E%3Crect x='2' y='6' width='6' height='12' rx='1'/%3E%3Crect x='9' y='6' width='6' height='12' rx='1'/%3E%3Crect x='16' y='6' width='6' height='12' rx='1'/%3E%3C/svg%3E");
}

.cliente-metrica-icone-disco {
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%2394a3b8' stroke-width='2'%3E%3Ccircle cx='12' cy='12' r='3'/%3E%3Cpath d='M12 2v4M12 18v4M2 12h4M18 12h4'/%3E%3C/svg%3E");
}

.cliente-metrica-cabecalho .cliente-metrica-label {
    color: #94a3b8;
    flex: 1;
}

.cliente-metrica-cabecalho .cliente-metrica-valor {
    font-weight: 600;
    font-variant-numeric: tabular-nums;
}

.cliente-barra-wrap {
    height: 6px;
    background: #334155;
    border-radius: 3px;
    overflow: hidden;
}

.cliente-barra-fill {
    height: 100%;
    border-radius: 3px;
    transition: width 0.4s ease;
}

.cliente-barra-cpu { background: #22c55e; }
.cliente-barra-mem { background: #3b82f6; }
.cliente-barra-disco { background: #22c55e; }

/* Rodapé: tempo ativo + última sincronização */
.cliente-card-rodape {
    padding-top: 0.25rem;
    border-top: 1px solid #334155;
    font-size: 0.72rem;
    color: #64748b;
}

.cliente-card-rodape .cliente-uptime {
    color: #a5b4fc;
}

.cliente-ultima-sync {
    color: #64748b;
}

/* ============================================================
   MACHINE INFO SECTION
   ============================================================ */
.machine-info {
    margin: 1.25rem 2rem;
    padding: 1rem 1.5rem;
    background: #1e293b;
    border-radius: 0.75rem;
    border: 1px solid #334155;
}

.info-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
    gap: 0.5rem 1.5rem;
    font-size: 0.875rem;
}

.info-grid strong {
    color: #94a3b8;
}

.machine-info--specs {
    padding: 1.25rem 1.5rem;
}

.hw-specs-heading {
    margin: 0 0 1rem;
    color: #cbd5e1;
    font-size: 1rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

.hw-specs-grid {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 1rem;
}

.hw-spec-group {
    background: #0f172a;
    border: 1px solid #334155;
    border-radius: 0.5rem;
    padding: 0.875rem 1rem;
    min-width: 0;
}

.hw-spec-group-title {
    margin: 0 0 0.75rem;
    padding-bottom: 0.5rem;
    border-bottom: 1px solid #334155;
    color: #64748b;
    font-size: 0.75rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.06em;
}

.hw-spec-list {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
    margin: 0;
}

.hw-spec-item {
    display: grid;
    grid-template-columns: minmax(5.5rem, 0.9fr) minmax(0, 1.4fr);
    gap: 0.25rem 0.75rem;
    align-items: baseline;
    font-size: 0.8125rem;
}

.hw-spec-item--wide {
    grid-template-columns: 1fr;
    gap: 0.15rem;
}

.hw-spec-item dt {
    color: #64748b;
    font-weight: 500;
}

.hw-spec-item dd {
    margin: 0;
    color: #e2e8f0;
    word-break: break-word;
}

.hw-spec-item--wide dd {
    font-size: 0.875rem;
    line-height: 1.35;
}

.hw-spec-item--live dd {
    color: #7dd3fc;
    font-weight: 500;
}

/* ============================================================
   LOCATION CARD / MAP
   ============================================================ */
.location-section {
    padding: 0 2rem 1.5rem;
}

.location-card {
    background: #1e293b;
    border-radius: 0.75rem;
    border: 1px solid #334155;
    padding: 1rem 1.5rem 1.25rem;
}

.location-header {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 0.75rem 1rem;
    margin-bottom: 0.75rem;
    flex-wrap: wrap;
}

.location-header-main {
    flex: 1 1 220px;
    min-width: 0;
}

.location-header-actions {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    flex-wrap: wrap;
    flex-shrink: 0;
}

.location-header h2 {
    color: #cbd5e1;
    font-size: 1rem;
    margin: 0 0 0.25rem;
}

.location-extra {
    font-size: 0.75rem;
    color: #64748b;
    margin: 0;
    line-height: 1.4;
}

.location-meta {
    display: flex;
    flex-direction: column;
    gap: 0.35rem;
    margin-bottom: 0.75rem;
}

.location-summary {
    font-size: 0.875rem;
    color: #e2e8f0;
    margin: 0;
    line-height: 1.45;
    word-break: break-word;
}

.location-summary-muted {
    color: #64748b;
}

.location-datetime {
    font-size: 0.8125rem;
    color: #94a3b8;
    margin: 0;
}

.rotas-lista {
    list-style: none;
    margin: 0;
    padding: 0;
}

.rotas-lista li {
    display: flex;
    flex-wrap: wrap;
    align-items: flex-start;
    justify-content: space-between;
    gap: 0.5rem 0.75rem;
    padding: 0.75rem 0;
    border-bottom: 1px solid #334155;
    font-size: 0.875rem;
    color: #e2e8f0;
}

.rota-card-body {
    flex: 1 1 200px;
    min-width: 0;
}

.rota-titulo {
    font-weight: 600;
    line-height: 1.4;
    word-break: break-word;
}

.rota-periodo {
    margin-top: 0.25rem;
    font-size: 0.8125rem;
    color: #94a3b8;
    line-height: 1.4;
}

.rota-acoes {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 0.5rem 0.75rem;
    flex-shrink: 0;
}

.rota-link-btn {
    background: none;
    border: none;
    padding: 0;
    cursor: pointer;
    font: inherit;
    color: #60a5fa;
    text-decoration: underline;
}

.rota-link-btn:hover {
    color: #93c5fd;
}

.rotas-map {
    width: 100%;
    height: 280px;
    margin-bottom: 0.75rem;
    border-radius: 8px;
    border: 1px solid #334155;
    overflow: hidden;
}

.rotas-lista li:last-child {
    border-bottom: none;
}

.rota-item-main {
    flex: 1 1 200px;
    min-width: 0;
    line-height: 1.45;
    word-break: break-word;
}

.rotas-lista .rota-ordem {
    color: #60a5fa;
    font-weight: 600;
    margin-right: 0.35rem;
}

.rotas-lista .rota-link {
    flex-shrink: 0;
    font-size: 0.8125rem;
    white-space: nowrap;
}

.rede-atual-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
    gap: 0.65rem 1.25rem;
    font-size: 0.875rem;
    line-height: 1.45;
}

.rede-atual-grid > div {
    min-width: 0;
    word-break: break-word;
}

.rede-atual-grid strong {
    color: #94a3b8;
    display: inline-block;
    margin-right: 0.25rem;
}

.rede-detalhe-summary .rede-atual-grid {
    margin-bottom: 0.75rem;
}

.rede-detalhe-extra {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem 2rem;
    font-size: 0.875rem;
    color: #94a3b8;
    margin-bottom: 0.75rem;
    padding-bottom: 0.75rem;
    border-bottom: 1px solid #334155;
}

.rede-detalhe-mac {
    font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, monospace;
    font-size: 0.8rem;
    color: #94a3b8;
}

.rede-atual-actions {
    margin-top: 0.75rem;
    padding-top: 0.75rem;
    border-top: 1px solid #334155;
}

.table-wrap {
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
    margin: 0 -0.25rem;
    padding: 0 0.25rem;
}

.table-wrap .admin-table {
    min-width: 52rem;
}

.extra-section .section-header h2 {
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

.location-map {
    width: 100%;
    height: 260px;
    border-radius: 0.75rem;
    overflow: hidden;
    border: 1px solid #334155;
}

.parque-map {
    width: 100%;
    height: 360px;
    border-radius: 0.75rem;
    overflow: hidden;
    border: 1px solid #334155;
}

.parque-map-section {
    padding: 0 2rem 1.5rem;
}

.parque-map-section .section-header {
    margin-bottom: 0.75rem;
}

.parque-map-section .section-header h2 {
    margin: 0;
    font-size: 1rem;
    color: #cbd5e1;
}

.parque-map-vazio {
    margin: 0.5rem 0 0;
    font-size: 0.875rem;
    color: #94a3b8;
}

.device-marker-icon {
    background: transparent;
    border: none;
}

.device-marker {
    position: relative;
    display: flex;
    align-items: flex-end;
    justify-content: center;
    width: 32px;
    height: 36px;
    filter: drop-shadow(0 1px 3px rgba(0, 0, 0, 0.45));
}

.device-marker-svg {
    display: block;
    width: 28px;
    height: auto;
}

.device-marker--online .device-marker-svg {
    color: #22c55e;
}

.device-marker--offline .device-marker-svg {
    color: #94a3b8;
}

.device-marker-ordem {
    position: absolute;
    top: -4px;
    right: -6px;
    display: flex;
    align-items: center;
    justify-content: center;
    min-width: 16px;
    height: 16px;
    padding: 0 3px;
    border-radius: 999px;
    background: #1e293b;
    color: #f8fafc;
    font-size: 0.625rem;
    font-weight: 700;
    border: 1.5px solid #dbeafe;
    line-height: 1;
}

.mapa-legenda {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 0.75rem 1.25rem;
    margin: 0.5rem 0 0.75rem;
    font-size: 0.75rem;
    color: #94a3b8;
}

.mapa-legenda-titulo {
    font-weight: 600;
    color: #cbd5e1;
    margin-right: 0.25rem;
}

.mapa-legenda-item {
    display: inline-flex;
    align-items: center;
    gap: 0.35rem;
}

.mapa-legenda-item .device-marker {
    width: 20px;
    height: 22px;
    filter: none;
}

.mapa-legenda-item .device-marker-svg {
    width: 18px;
}

.mapa-legenda-status {
    display: inline-flex;
    align-items: center;
    gap: 0.75rem;
    margin-left: auto;
}

.mapa-legenda-cor {
    display: inline-block;
    width: 10px;
    height: 10px;
    border-radius: 50%;
}

.mapa-legenda-cor--online {
    background: #22c55e;
}

.mapa-legenda-cor--offline {
    background: #94a3b8;
}

.leaflet-control-zoom-fullscreen {
    background-color: #1e293b;
    border: 1px solid #334155;
}

.leaflet-control-zoom-fullscreen:hover {
    background-color: #334155;
}

.leaflet-fullscreen-icon {
    filter: brightness(0) invert(0.9);
}

/* ============================================================
   REAL-TIME METRICS
   ============================================================ */
.realtime-metrics {
    padding: 0 2rem 1.5rem;
}

.realtime-metrics h2 {
    margin-bottom: 1rem;
    color: #cbd5e1;
    font-size: 1rem;
}

.metrics-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(150px, 1fr));
    gap: 1rem;
}

.metric-card {
    background: #1e293b;
    border-radius: 0.75rem;
    padding: 1rem;
    border: 1px solid #334155;
    text-align: center;
}

.metric-label {
    color: #94a3b8;
    font-size: 0.75rem;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    margin-bottom: 0.5rem;
}

.metric-value {
    font-size: 1.75rem;
    font-weight: 700;
    color: #f1f5f9;
    line-height: 1;
}

.progress-bar {
    height: 5px;
    background: #334155;
    border-radius: 3px;
    margin-top: 0.75rem;
    overflow: hidden;
}

.progress-fill {
    height: 100%;
    border-radius: 3px;
    transition: width 0.6s ease, background-color 0.6s ease;
    width: 0%;
}

/* ============================================================
   HISTORY CHARTS
   ============================================================ */
.history-charts {
    padding: 0 2rem 1.5rem;
}

.history-charts h2 {
    margin-bottom: 1rem;
    color: #cbd5e1;
    font-size: 1rem;
}

.charts-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 1.25rem;
}

.chart-container {
    background: #1e293b;
    border-radius: 0.75rem;
    padding: 1rem 1.25rem;
    border: 1px solid #334155;
}

.chart-container h3 {
    color: #94a3b8;
    font-size: 0.8rem;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    margin-bottom: 0.75rem;
}

/* ============================================================
   ALERTS
   ============================================================ */
.alerts-section {
    padding: 0 2rem 2rem;
}

.alerts-section h2 {
    margin-bottom: 1rem;
    color: #cbd5e1;
    font-size: 1rem;
}

.whatsapp-silence-section {
    padding: 0 2rem 1.5rem;
}

.whatsapp-silence-section .section-header {
    margin-bottom: 0.75rem;
}

.whatsapp-silence-status {
    padding: 1rem 1.125rem;
    border-radius: 0.5rem;
    background: #1e293b;
    border: 1px solid #334155;
}

.whatsapp-silence-status--vazio {
    border-style: dashed;
}

.whatsapp-silence-status--ativo {
    border-color: #7c3aed;
    background: #2e1065;
    border-left-width: 4px;
    border-left-color: #a855f7;
}

.whatsapp-silence-card-inner {
    display: flex;
    gap: 1rem;
    align-items: flex-start;
}

.whatsapp-silence-card-icon {
    flex-shrink: 0;
    width: 2.5rem;
    height: 2.5rem;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 0.5rem;
    background: rgba(168, 85, 247, 0.15);
    color: #c084fc;
}

.whatsapp-silence-status--ativo .whatsapp-silence-card-icon {
    background: rgba(168, 85, 247, 0.25);
    color: #e9d5ff;
}

.whatsapp-silence-card-icon svg {
    width: 1.35rem;
    height: 1.35rem;
}

.whatsapp-silence-card-body {
    flex: 1;
    min-width: 0;
}

.whatsapp-silence-card-title {
    margin: 0 0 0.35rem;
    font-size: 0.9375rem;
    font-weight: 600;
    color: #e2e8f0;
}

.whatsapp-silence-status--ativo .whatsapp-silence-card-title {
    color: #e9d5ff;
}

.whatsapp-silence-card-text {
    margin: 0 0 0.75rem;
    font-size: 0.875rem;
    color: #94a3b8;
    line-height: 1.45;
}

.whatsapp-silence-status--ativo .whatsapp-silence-card-text {
    color: #c4b5fd;
}

.whatsapp-silence-cta {
    margin-top: 0.15rem;
}

.whatsapp-silence-form-row {
    display: flex;
    gap: 0.5rem;
    align-items: stretch;
}

.whatsapp-silence-form-row .input {
    flex: 1;
    min-width: 0;
}

.whatsapp-silence-unidade-select {
    flex: 0 0 auto;
    min-width: 7rem;
    cursor: pointer;
}

.modal-titulo-com-icone {
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.modal-titulo-icone {
    width: 1.25rem;
    height: 1.25rem;
    flex-shrink: 0;
    color: #a855f7;
}

.btn svg.btn-icon {
    width: 1em;
    height: 1em;
    flex-shrink: 0;
}

@media (max-width: 640px) {
    .whatsapp-silence-card-inner {
        flex-direction: column;
    }

    .whatsapp-silence-cta {
        width: 100%;
    }
}

.alerta-item {
    padding: 0.875rem 1rem;
    border-radius: 0.5rem;
    margin-bottom: 0.75rem;
    border-left: 4px solid;
}

.alerta-alta     { background: #431407; border-color: #f97316; }
.alerta-critica  { background: #450a0a; border-color: #ef4444; }
.alerta-media    { background: #422006; border-color: #f59e0b; }
.alerta-baixa    { background: #052e16; border-color: #22c55e; }

.alerta-header {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    margin-bottom: 0.4rem;
}

.alerta-tipo {
    font-weight: 600;
    font-size: 0.875rem;
    color: #f1f5f9;
}

.alerta-severidade {
    font-size: 0.7rem;
    font-weight: 700;
    padding: 0.1rem 0.5rem;
    border-radius: 4px;
    text-transform: uppercase;
}

.badge-severidade-critica { background: #7f1d1d; color: #fca5a5; }
.badge-severidade-alta    { background: #431407; color: #fdba74; }
.badge-severidade-media   { background: #422006; color: #fcd34d; }
.badge-severidade-baixa   { background: #052e16; color: #86efac; }

.alerta-mensagem {
    color: #cbd5e1;
    font-size: 0.875rem;
    margin-bottom: 0.25rem;
}

.alerta-timestamp {
    color: #64748b;
    font-size: 0.75rem;
}

/* ============================================================
   EMPTY STATE
   ============================================================ */
.empty-state {
    padding: 2rem;
    text-align: center;
    color: #475569;
    background: #1e293b;
    border-radius: 0.75rem;
    border: 2px dashed #334155;
    font-size: 0.9rem;
}

/* ============================================================
   SECTION HEADER (título + botões de exportação)
   ============================================================ */
.section-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 1rem;
    gap: 1rem;
}

.section-header h2 {
    color: #cbd5e1;
    font-size: 1rem;
    margin-bottom: 0;
}

/* ============================================================
   CARDS SECTION (SERVIDORES / CLIENTES)
   ============================================================ */
.cards-section {
    margin-top: 1.25rem;
}

.cards-section:first-of-type {
    margin-top: 0.5rem;
}

.cards-section-title {
    color: #e2e8f0;
    font-size: 0.9rem;
    margin-bottom: 0.5rem;
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: 0.35rem 0.45rem;
}

.cards-section-header {
    margin-bottom: 0.5rem;
}

.cards-section-header .cards-section-title {
    margin-bottom: 0;
    min-width: 0;
}

.cards-section-title-label {
    line-height: 1.3;
}

.btn-toggle-secao-grupo {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    padding: 0.15rem;
    border: none;
    background: transparent;
    color: #94a3b8;
    cursor: pointer;
    border-radius: 0.3rem;
    line-height: 0;
    vertical-align: middle;
}

.btn-toggle-secao-grupo:hover {
    color: #e2e8f0;
    background: rgba(148, 163, 184, 0.15);
}

.btn-toggle-secao-grupo:focus-visible {
    outline: 2px solid #38bdf8;
    outline-offset: 2px;
}

.btn-toggle-secao-icon {
    width: 1rem;
    height: 1rem;
    display: block;
    transition: transform 0.2s ease;
}

.btn-toggle-secao-grupo.is-expanded .btn-toggle-secao-icon {
    transform: rotate(180deg);
}

.cards-section.is-secao-recolhida {
    padding-left: 0.35rem;
    border-left: 2px solid #f59e0b;
}

.cards-section-body[hidden] {
    display: none;
}

.cards-wrapper {
    border-radius: 0.75rem;
    border: 1px solid #334155;
    overflow: hidden;
}

.export-buttons {
    display: flex;
    gap: 0.5rem;
    flex-shrink: 0;
    align-items: center;
}

.btn-visao-maquinas {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 2.25rem;
    min-width: 2.25rem;
    padding: 0.35rem;
}

.btn-visao-icon {
    width: 1.1rem;
    height: 1.1rem;
    display: block;
}

.lista-section {
    margin-top: 1.25rem;
}

.lista-section:first-of-type {
    margin-top: 0.5rem;
}

.clientes-lista {
    min-width: 1100px;
    font-size: 0.8rem;
}

.clientes-lista th {
    font-size: 0.7rem;
    letter-spacing: 0.04em;
    text-transform: uppercase;
    white-space: nowrap;
}

.cliente-linha {
    cursor: pointer;
}

.cliente-linha-no-link {
    cursor: default;
}

.cliente-linha.com-alerta {
    background: rgba(234, 179, 8, 0.06);
}

.cliente-lista-maquina {
    min-width: 10rem;
}

.cliente-lista-hostname {
    font-weight: 600;
    color: #e2e8f0;
}

.cliente-lista-sub {
    color: #94a3b8;
    font-size: 0.75rem;
    margin-top: 0.15rem;
}

.cliente-lista-tipo {
    display: flex;
    align-items: center;
    gap: 0.45rem;
    white-space: nowrap;
}

.cliente-lista-tipo .cliente-card-tipo {
    flex-shrink: 0;
}

.cliente-lista-tipo-label {
    color: #94a3b8;
    font-size: 0.72rem;
    letter-spacing: 0.03em;
}

.cliente-lista-rede {
    min-width: 9rem;
}

.cliente-lista-metrica {
    display: flex;
    flex-direction: column;
    gap: 0.2rem;
    min-width: 5.5rem;
}

.cliente-lista-metrica-valor {
    font-size: 0.78rem;
    color: #cbd5e1;
}

.cliente-lista-barra-wrap {
    height: 0.35rem;
    background: #0f172a;
    border-radius: 999px;
    overflow: hidden;
}

.cliente-lista-barra-fill {
    height: 100%;
    border-radius: 999px;
}

.cliente-lista-barra-mem {
    background: #3b82f6;
}

.cliente-lista-barra-disco {
    background: #22c55e;
}

.cliente-lista-cpu {
    font-weight: 600;
}

.cliente-lista-alertas {
    min-width: 10rem;
    max-width: 16rem;
    color: #fbbf24;
    font-size: 0.78rem;
    line-height: 1.35;
}

/* ============================================================
   DASHBOARD CHART
   ============================================================ */
.dashboard-chart-section {
    padding: 1rem 2rem 0.5rem;
}

.dashboard-chart-section h2 {
    color: #cbd5e1;
    font-size: 1rem;
    margin-bottom: 0.75rem;
}

.dashboard-chart-container {
    background: #1e293b;
    border-radius: 0.75rem;
    border: 1px solid #334155;
    padding: 1rem 1.25rem;
    max-height: 260px;
}

.dashboard-chart-container canvas {
    max-height: 220px;
}

/* ============================================================
   FILTER BAR
   ============================================================ */
.filter-bar {
    display: flex;
    flex-wrap: wrap;
    gap: 0.75rem 1.25rem;
    padding: 1rem 2rem;
    background: var(--color-surface);
    border-top: 1px solid var(--color-border);
    border-bottom: 1px solid var(--color-border);
    margin-bottom: 0;
    align-items: flex-end;
}

.filter-group {
    display: flex;
    align-items: center;
    gap: 0.45rem;
    flex-wrap: wrap;
    padding: 0.5rem 0.65rem;
    background: rgba(15, 23, 42, 0.45);
    border: 1px solid var(--color-border-subtle);
    border-radius: var(--radius-md);
}

.filter-label {
    color: var(--color-text-dim);
    font-size: 0.68rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.06em;
    white-space: nowrap;
    margin-right: 0.15rem;
}

.filter-group .btn-sm {
    min-height: 1.85rem;
}

.filter-group .input-sm {
    min-width: 120px;
}

.filter-group--push-end {
    margin-left: auto;
    display: flex;
    align-items: flex-end;
    gap: 0.45rem;
}

.btn-info-redes.btn-icon-only {
    width: 1.75rem;
    height: 1.75rem;
    min-width: 1.75rem;
    min-height: 1.75rem;
    padding: 0;
    font-size: 0.85rem;
    font-weight: 700;
    font-style: italic;
    border-radius: 50%;
    line-height: 1;
}

.filter-group .btn-info-versao.btn-icon-only {
    width: 1.2rem;
    height: 1.2rem;
    min-width: 1.2rem;
    min-height: 1.2rem;
    padding: 0;
    font-size: 0.7rem;
    font-weight: 700;
    font-style: italic;
    border-radius: 50%;
    line-height: 1;
    flex-shrink: 0;
}

.modal-resumo-redes {
    display: grid;
    grid-template-columns: 1fr;
    gap: 0.75rem;
    max-height: min(70vh, 640px);
    overflow-y: auto;
    margin: 0.75rem 0 0.5rem;
}

.resumo-redes-empresa {
    min-width: 0;
    margin: 0;
    padding: 0.55rem 0.65rem;
    background: var(--color-surface-raised);
    border: 1px solid var(--color-border);
    border-radius: var(--radius-sm);
}

.resumo-redes-empresa-titulo {
    margin: 0 0 0.35rem;
    font-size: 1rem;
    font-weight: 600;
}

.resumo-redes-lista {
    margin: 0;
    padding-left: 1.1rem;
}

.resumo-redes-item {
    margin: 0.25rem 0;
    line-height: 1.45;
}

.resumo-redes-item--total {
    margin-top: 0.5rem;
    padding-top: 0.45rem;
    font-weight: 700;
    color: var(--color-text-strong);
    border-top: 1px solid var(--color-border);
}

.resumo-redes-total-geral {
    margin: 0.75rem 0 0;
    padding: 0.55rem 0.65rem;
    font-size: 0.92rem;
    font-weight: 700;
    color: var(--color-text-strong);
    background: var(--color-surface-raised);
    border: 1px solid var(--color-border);
    border-radius: var(--radius-sm);
}

.modal-resumo-redes-rodape {
    margin: 0.5rem 0 0;
    font-size: 0.82rem;
    opacity: 0.75;
}

@media (min-width: 768px) {
    .modal-resumo-redes {
        grid-template-columns: 1fr 1fr;
    }
}

@media (min-width: 1024px) {
    .filter-bar {
        flex-wrap: nowrap;
        overflow-x: auto;
        gap: 0.45rem 0.55rem;
        padding: 0.65rem 1.25rem;
        scrollbar-width: thin;
    }

    .filter-group {
        flex-wrap: nowrap;
        flex-shrink: 0;
        padding: 0.35rem 0.45rem;
        gap: 0.35rem;
    }

    .filter-bar .input-sm,
    .filter-group .input-sm {
        min-width: 72px;
        max-width: 118px;
    }

    #filtro-busca {
        min-width: 130px;
        max-width: 180px;
    }

    #filtro-ip {
        min-width: 100px;
        max-width: 130px;
    }

    .filter-group--push-end {
        margin-left: 0;
    }
}

/* ============================================================
   NETWORK BADGE
   ============================================================ */
.badge-rede {
    display: inline-block;
    padding: 0.15rem 0.55rem;
    border-radius: 9999px;
    font-size: 0.7rem;
    font-weight: 600;
    cursor: default;
}

.badge-wifi {
    background: #1e3a5f;
    color: #60a5fa;
    border: 1px solid #3b82f6;
}

.badge-ethernet {
    background: #14532d;
    color: #4ade80;
    border: 1px solid #22c55e;
}

.badge-rede-desconhecido {
    background: #1e293b;
    color: #64748b;
    border: 1px solid #334155;
}

/* ============================================================
   EXTRA SECTIONS (GPU / Segurança / USB / Programas)
   ============================================================ */

.extra-section {
    padding: 0 2rem 1.5rem;
}

.extra-section h2 {
    margin-bottom: 1rem;
    color: #cbd5e1;
    font-size: 1rem;
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

.extra-section-body {
    background: #1e293b;
    border-radius: 0.75rem;
    border: 1px solid #334155;
    padding: 1rem 1.5rem;
}

.extra-vazio {
    color: #475569;
    font-size: 0.875rem;
    margin: 0;
}

.extra-summary {
    font-size: 0.875rem;
    color: #e2e8f0;
    margin-bottom: 0.75rem;
}

.extra-card {
    margin-bottom: 0.75rem;
    padding-bottom: 0.75rem;
    border-bottom: 1px solid #334155;
}

.extra-card:last-child {
    margin-bottom: 0;
    padding-bottom: 0;
    border-bottom: none;
}

.extra-card-title {
    font-weight: 600;
    color: #f1f5f9;
    font-size: 0.9rem;
    margin-bottom: 0.5rem;
}

.extra-card-grid {
    display: flex;
    flex-wrap: wrap;
    gap: 0.4rem 1.5rem;
    font-size: 0.8rem;
    color: #94a3b8;
}

.extra-card-grid strong {
    color: #64748b;
}

.extra-card-grid-wide {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem 2rem;
    font-size: 0.875rem;
    color: #94a3b8;
}

.extra-card-grid-wide strong {
    color: #94a3b8;
}

.hw-storage-row {
    margin-bottom: 0.75rem;
}

.hw-storage-header {
    display: flex;
    justify-content: space-between;
    gap: 0.5rem;
    font-size: 0.85rem;
    margin-bottom: 0.25rem;
}

.hw-storage-label {
    color: #e2e8f0;
    font-weight: 500;
}

.hw-storage-detail {
    color: #94a3b8;
    font-size: 0.8rem;
    text-align: right;
}

.hw-storage-bar {
    margin-top: 0.25rem;
}

.hw-subsection-title {
    margin: 1rem 0 0.5rem;
    font-size: 0.8rem;
    font-weight: 600;
    color: #94a3b8;
    text-transform: uppercase;
    letter-spacing: 0.04em;
}

.hw-io-row {
    margin-top: 0.75rem;
    font-size: 0.85rem;
    color: #cbd5e1;
}

.extra-list {
    display: flex;
    flex-wrap: wrap;
    gap: 0.4rem;
    margin-top: 0.5rem;
}

.extra-tag {
    background: #0f172a;
    border: 1px solid #334155;
    border-radius: 0.35rem;
    padding: 0.2rem 0.55rem;
    font-size: 0.75rem;
    color: #cbd5e1;
}

.extra-tag em {
    color: #64748b;
    font-style: normal;
}

.extra-tag-muted {
    color: #475569;
    border-color: #1e293b;
}

/* ------------------------------------------------------------
   PROGRAMAS INSTALADOS (DETALHE DO CLIENTE)
   ------------------------------------------------------------ */

.programas-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 0.75rem;
    margin-bottom: 0.75rem;
    font-size: 0.875rem;
    color: #e2e8f0;
}

.programas-total strong {
    color: #fbbf24;
}

.programas-tabela-wrapper {
    border-radius: 0.5rem;
    border: 1px solid #1f2937;
    background: #020617;
    max-height: 260px;
    overflow: auto;
}

.programas-tabela {
    width: 100%;
    border-collapse: collapse;
    font-size: 0.8rem;
}

.programas-tabela thead {
    position: sticky;
    top: 0;
    background: #020617;
    z-index: 1;
}

.programas-tabela th,
.programas-tabela td {
    padding: 0.45rem 0.75rem;
    border-bottom: 1px solid #111827;
}

.programas-tabela th {
    text-align: left;
    font-weight: 600;
    color: #9ca3af;
    font-size: 0.75rem;
    text-transform: uppercase;
    letter-spacing: 0.04em;
}

.programas-tabela td {
    color: #e5e7eb;
}

.programas-tabela tr:nth-child(even) td {
    background: #020617;
}

.programas-tabela tr:nth-child(odd) td {
    background: #030712;
}

.programas-tabela .col-nome   { width: 40%; }
.programas-tabela .col-versao { width: 25%; }
.programas-tabela .col-editor { width: 35%; }

.programas-footer {
    margin-top: 0.75rem;
    font-size: 0.8rem;
    color: #64748b;
}

/* ============================================================
   RESPONSIVE
   ============================================================ */
@media (max-width: 768px) {
    .header { padding: 0.75rem 1rem; }
    .header h1 { font-size: 1.1rem; }

    .header-summary {
        order: 3;
        flex: 1 1 100%;
        max-width: none;
    }

    .summary-cards {
        grid-template-columns: repeat(5, minmax(0, 1fr));
        max-width: none;
        width: 100%;
    }

    .header-summary .card-value { font-size: 1.15rem; }

    .admin-catalogo-botoes {
        grid-template-columns: 1fr;
    }

    .table-section,
    .realtime-metrics,
    .history-charts,
    .alerts-section,
    .dashboard-chart-section,
    .whatsapp-silence-section {
        padding-left: 1rem;
        padding-right: 1rem;
    }

    .machine-info { margin-left: 1rem; margin-right: 1rem; }

    .extra-section { padding-left: 1rem; padding-right: 1rem; }

    .charts-grid { grid-template-columns: 1fr; }

    .metrics-grid { grid-template-columns: repeat(2, 1fr); }

    .filter-bar { padding: 0.75rem 1rem; gap: 0.65rem; }

    .filter-group {
        width: 100%;
        padding: 0.45rem 0.55rem;
    }

    .filter-group .input-sm { min-width: 90px; flex: 1; }
}

/* ============================================================
   AÇÕES ADMINISTRATIVAS REMOTAS
   ============================================================ */
#secao-admin {
    background: var(--color-surface);
    border: 1px solid var(--color-border);
    border-radius: 0.75rem;
    padding: 1.25rem 1.5rem;
}

.admin-status {
    background: var(--color-bg);
    border: 1px solid var(--color-border);
    border-radius: var(--radius-md);
    padding: 0.6rem 0.9rem;
    margin-bottom: 1rem;
    font-size: 0.9rem;
    color: var(--color-text-muted);
}

.admin-block {
    margin-bottom: 1.5rem;
    padding-bottom: 1rem;
    border-bottom: 1px dashed var(--color-border);
}

#admin-block-pendencias-software {
    margin-top: 1rem;
    padding-bottom: 0.5rem;
}
.admin-block:last-child { border-bottom: none; }
.admin-block h3 { margin-bottom: 0.4rem; font-size: 1rem; color: var(--color-text); }
.admin-aviso { font-size: 0.8rem; color: #f87171; margin-bottom: 0.5rem; }
.admin-aviso-mobile {
    font-size: 0.85rem;
    color: #93c5fd;
    background: rgba(59, 130, 246, 0.1);
    border: 1px solid rgba(59, 130, 246, 0.35);
    border-radius: 6px;
    padding: 0.65rem 0.85rem;
    margin: 0.5rem 0 0.75rem;
}

.admin-botoes {
    display: flex;
    flex-wrap: wrap;
    gap: 0.65rem;
    align-items: stretch;
}

.admin-catalogo-comandos {
    display: flex;
    flex-direction: column;
    gap: 0.25rem;
}

.admin-categoria-grupo {
    margin-bottom: 0.85rem;
}

.admin-categoria-grupo:last-child {
    margin-bottom: 0;
}

.admin-catalogo-botoes {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    gap: 0.6rem;
    max-width: 960px;
}

.admin-catalogo-botoes .btn {
    white-space: normal;
    text-align: left;
    justify-content: flex-start;
    align-items: center;
    min-height: 2.75rem;
    padding: 0.55rem 0.85rem;
    line-height: 1.35;
    height: 100%;
}

.admin-historico { margin-top: 0.5rem; overflow-x: auto; }

.admin-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 0.85rem;
}
.admin-table th, .admin-table td {
    border: 1px solid var(--color-border);
    padding: 0.4rem 0.6rem;
    text-align: left;
}
.admin-table thead {
    background: #0f172a;
    color: var(--color-text-muted);
}
.admin-table tbody tr:hover {
    background: rgba(51, 65, 85, 0.35);
}

.admin-instalar-form {
    display: flex;
    flex-wrap: wrap;
    gap: 0.65rem 1rem;
    margin: 0.75rem 0 0;
}

.admin-instalar-form--pacotes {
    align-items: flex-end;
}

.admin-instalar-form--pacotes > .field--inline {
    flex: 1 1 200px;
    min-width: 0;
    max-width: 280px;
}

.admin-instalar-form--pacotes > .btn {
    flex: 0 0 auto;
    align-self: flex-end;
    margin-bottom: 1.2rem;
}

.admin-instalar-form--comando {
    align-items: flex-end;
}

.field-label-row {
    display: flex;
    align-items: center;
    gap: 0.35rem;
}

.btn-whitelist-info.btn-icon-only {
    width: 1.5rem;
    height: 1.5rem;
    min-width: 1.5rem;
    min-height: 1.5rem;
    padding: 0;
    font-size: 0.8rem;
    font-weight: 600;
    border-radius: 50%;
    opacity: 0.85;
}

.admin-whitelist-row {
    cursor: pointer;
}

.admin-whitelist-row:hover {
    background: var(--color-bg);
}

.admin-table--whitelist {
    margin-bottom: 1rem;
}

.admin-instalar-form--comando .field--grow { flex: 1 1 220px; min-width: 0; }
.admin-instalar-form--comando .input { width: 100%; }
.admin-instalar-form--comando > .btn { flex-shrink: 0; align-self: flex-end; }

.admin-resultado-box {
    margin: 0.5rem 0;
    padding: 0.5rem 0.7rem;
    background: var(--color-bg);
    border: 1px solid var(--color-border);
    border-radius: var(--radius-md);
    font-size: 0.85rem;
    min-height: 1.5rem;
    color: var(--color-text-muted);
}

.admin-resultado-box:empty {
    display: none;
    margin: 0;
    padding: 0;
    min-height: 0;
    border: none;
}

/* Login (2.0.0) */
body.login-page {
    display: flex;
    align-items: center;
    justify-content: center;
    min-height: 100vh;
    margin: 0;
}
.login-card {
    width: 100%;
    max-width: 400px;
    padding: 2rem;
    margin: 1rem;
    background: var(--color-surface);
    border-radius: var(--radius-lg);
    border: 1px solid var(--color-border);
    box-shadow: 0 10px 25px rgba(0, 0, 0, 0.35);
}
.login-card h1 {
    font-size: 1.35rem;
    font-weight: 700;
    color: var(--color-text-strong);
    margin-bottom: 0.15rem;
}
.login-card .header-version {
    display: block;
    margin-bottom: 0.5rem;
}
.login-card .field {
    margin-bottom: 1rem;
}
.login-card p {
    margin-bottom: 1.25rem;
    color: var(--color-text-muted);
    font-size: 0.9rem;
    line-height: 1.5;
}
.alert-error {
    background: rgba(239, 68, 68, 0.15);
    border: 1px solid #ef4444;
    color: #fca5a5;
    padding: 0.6rem 0.75rem;
    border-radius: 8px;
    margin-bottom: 1rem;
    font-size: 0.9rem;
}
.card-version-badge {
    font-size: 0.75rem;
    padding: 0.15rem 0.45rem;
    border-radius: 4px;
    background: #334155;
    color: #94a3b8;
    margin-left: 0.35rem;
}
.card-version-badge.outdated {
    background: rgba(234, 179, 8, 0.2);
    color: #fbbf24;
}

/* ============================================================
   UTILITÁRIOS E COMPONENTES AUXILIARES
   ============================================================ */
.versao-disponivel {
    font-size: 0.8rem;
    color: #fbbf24;
    margin-left: 0.35rem;
}

#link-servico-maquina {
    color: var(--color-text-strong);
    text-decoration: none;
}

#link-servico-maquina:hover {
    color: var(--color-link-hover);
    text-decoration: underline;
}

/* Métricas — classes de severidade (substituem cores inline no JS) */
.metrica-neutra  { color: var(--color-metrica-neutra); }
.metrica-ok      { color: var(--color-metrica-ok); }
.metrica-alerta  { color: var(--color-metrica-alerta); }
.metrica-critica { color: var(--color-metrica-critica); }

.cliente-barra-fill.metrica-ok      { background: var(--color-metrica-ok); }
.cliente-barra-fill.metrica-alerta  { background: var(--color-metrica-alerta); }
.cliente-barra-fill.metrica-critica { background: var(--color-metrica-critica); }
.cliente-barra-fill.metrica-neutra  { background: var(--color-metrica-neutra); }

.progress-fill.metrica-ok      { background-color: var(--color-metrica-ok); }
.progress-fill.metrica-alerta  { background-color: var(--color-metrica-alerta); }
.progress-fill.metrica-critica { background-color: var(--color-metrica-critica); }
.progress-fill.metrica-neutra  { background-color: var(--color-metrica-neutra); }

.metric-card .metric-value.metric-value--compact {
    font-size: 1.3rem;
}

.admin-categoria-titulo {
    margin: 0 0 0.45rem;
    font-size: 0.8rem;
    font-weight: 600;
    color: var(--color-text-muted);
    letter-spacing: 0.04em;
}

.section-header--admin {
    margin-bottom: 0.35rem;
}

.section-header--admin h3 {
    color: var(--color-text);
    font-size: 1rem;
    margin-bottom: 0;
}

.admin-historico-hint {
    margin: 0 0 0.5rem;
}

.admin-stderr {
    color: #fca5a5;
    border-left: 3px solid #ef4444;
    padding-left: 0.5rem;
    margin-top: 0.5rem;
}

.admin-resultado-box--info {
    border-color: rgba(59, 130, 246, 0.35);
    background: rgba(59, 130, 246, 0.08);
}

.admin-resultado-box--sucesso {
    border-color: #22c55e;
    background: rgba(34, 197, 94, 0.08);
}

.admin-resultado-box--erro {
    border-color: #ef4444;
    background: rgba(239, 68, 68, 0.08);
}

.admin-resultado-box--aviso {
    border-color: #f59e0b;
    background: rgba(245, 158, 11, 0.08);
}

.admin-historico-detalhe {
    margin: 0;
    font-size: 0.75rem;
}

.admin-historico-detalhe summary {
    cursor: pointer;
    color: var(--color-link);
    font-size: 0.8rem;
}

.admin-historico-detalhe pre {
    white-space: pre-wrap;
    word-break: break-word;
    max-height: 120px;
    overflow: auto;
    margin: 0.35rem 0 0;
    font-size: 0.75rem;
}

.admin-detalhes-conteudo {
    font-size: 0.8rem;
    color: var(--color-text-muted);
}

details summary {
    cursor: pointer;
    color: var(--color-text-muted);
    font-size: 0.85rem;
    margin-bottom: 0.35rem;
}

details summary:hover {
    color: var(--color-text);
}

/* ============================================================
   UX — SKIP LINK, SR-ONLY, REDUCED MOTION
   ============================================================ */
.skip-link {
    position: absolute;
    top: -100px;
    left: 1rem;
    z-index: 1000;
    padding: 0.5rem 1rem;
    background: var(--color-accent);
    color: #fff;
    border-radius: var(--radius-md);
    font-weight: 600;
    text-decoration: none;
}

.skip-link:focus {
    top: 1rem;
}

.sr-only {
    position: absolute;
    width: 1px;
    height: 1px;
    padding: 0;
    margin: -1px;
    overflow: hidden;
    clip: rect(0, 0, 0, 0);
    white-space: nowrap;
    border: 0;
}

@media (prefers-reduced-motion: reduce) {
    *, *::before, *::after {
        animation-duration: 0.01ms;
        animation-iteration-count: 1;
        transition-duration: 0.01ms;
    }
    .cliente-card:hover { transform: none; }
    .skeleton-item { animation: none; }
    .toast { animation: none; }
    .btn.is-loading::after { animation: none; }
}

/* ============================================================
   UX — BANNERS E TOAST
   ============================================================ */
.banner-erro,
.banner-aviso {
    padding: 0.65rem 1.25rem;
    font-size: 0.875rem;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 0.75rem;
    flex-wrap: wrap;
}

.banner-erro {
    background: rgba(239, 68, 68, 0.15);
    border-bottom: 1px solid #ef4444;
    color: #fca5a5;
}

.banner-aviso {
    background: rgba(245, 158, 11, 0.12);
    border-bottom: 1px solid #f59e0b;
    color: #fcd34d;
}

.banner-erro[hidden],
.banner-aviso[hidden] {
    display: none;
}

.toast-container {
    position: fixed;
    top: 1rem;
    right: 1rem;
    z-index: 500;
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
    max-width: min(400px, calc(100vw - 2rem));
    pointer-events: none;
}

.toast {
    pointer-events: auto;
    padding: 0.75rem 1rem;
    border-radius: var(--radius-md);
    font-size: 0.875rem;
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.4);
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 0.5rem;
    animation: toast-in 0.2s ease;
}

@keyframes toast-in {
    from { opacity: 0; transform: translateY(-8px); }
    to { opacity: 1; transform: translateY(0); }
}

.toast--sucesso { background: #14532d; color: #86efac; border: 1px solid #22c55e; }
.toast--erro { background: #450a0a; color: #fca5a5; border: 1px solid #ef4444; }
.toast--info { background: #1e3a5f; color: #93c5fd; border: 1px solid #3b82f6; }
.toast--aviso { background: #451a03; color: #fcd34d; border: 1px solid #f59e0b; }

.toast-fechar {
    background: none;
    border: none;
    color: inherit;
    opacity: 0.7;
    cursor: pointer;
    font-size: 1.1rem;
    line-height: 1;
    padding: 0 0.25rem;
}

.toast-fechar:hover { opacity: 1; }

/* ============================================================
   UX — MODAL
   ============================================================ */
.modal-overlay {
    position: fixed;
    inset: 0;
    z-index: 400;
    background: rgba(0, 0, 0, 0.65);
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 1rem;
}

.modal-overlay[hidden] { display: none; }

.modal-card {
    background: var(--color-surface);
    border: 1px solid var(--color-border);
    border-radius: var(--radius-lg);
    padding: 1.5rem;
    max-width: 420px;
    width: 100%;
    box-shadow: 0 20px 40px rgba(0, 0, 0, 0.5);
}

.modal-card.modal-card--wide {
    max-width: 640px;
    max-height: 85vh;
    overflow-y: auto;
}

.modal-overlay--resumo-redes .modal-card {
    max-width: min(72rem, calc(100vw - 2rem));
    max-height: calc(100vh - 2rem);
    min-height: 0;
    display: flex;
    flex-direction: column;
    overflow-x: hidden;
    overflow-y: auto;
}

.modal-overlay--resumo-redes .modal-card > * {
    flex-shrink: 0;
}

.modal-overlay--resumo-redes .modal-resumo-redes {
    overflow: visible;
    max-height: none;
}

.modal-card h2 {
    font-size: 1.15rem;
    margin-bottom: 0.75rem;
}

.modal-texto {
    font-size: 0.9rem;
    color: var(--color-text-muted);
    margin-bottom: 0.5rem;
}

.modal-acoes {
    display: flex;
    justify-content: flex-end;
    gap: 0.5rem;
    margin-top: 1.25rem;
}

.modal-overlay--versoes-plataforma .modal-card {
    max-width: min(28rem, calc(100vw - 2rem));
}

.modal-versoes-lista {
    list-style: none;
    margin: 0.75rem 0 0.25rem;
    padding: 0;
    display: flex;
    flex-direction: column;
    gap: 0.65rem;
}

.modal-versoes-item {
    border: 1px solid var(--color-border-subtle);
    border-radius: var(--radius-md);
    padding: 0.7rem 0.85rem;
    background: rgba(15, 23, 42, 0.45);
}

.modal-versoes-plataforma {
    margin: 0 0 0.2rem;
    font-size: 0.9rem;
    font-weight: 600;
}

.modal-versoes-meta {
    margin: 0 0 0.35rem;
    font-size: 0.8rem;
    color: var(--color-text-muted);
}

.modal-versoes-versao {
    font-weight: 600;
    color: var(--color-text);
}

.modal-versoes-changelog {
    margin: 0;
    font-size: 0.8rem;
    line-height: 1.4;
    max-height: 4.8em;
    overflow-y: auto;
    white-space: pre-wrap;
    word-break: break-word;
    color: var(--color-text-muted);
}

/* ============================================================
   UX — TABS
   ============================================================ */
.tabs {
    display: flex;
    flex-wrap: wrap;
    gap: 0.25rem;
    padding: 0 2rem;
    background: var(--color-bg);
    border-bottom: 1px solid var(--color-border);
    position: sticky;
    top: 57px;
    z-index: 90;
}

.tab-btn {
    padding: 0.65rem 1rem;
    font-size: 0.85rem;
    font-weight: 500;
    color: var(--color-text-muted);
    background: transparent;
    border: none;
    border-bottom: 2px solid transparent;
    cursor: pointer;
    transition: color var(--transition-fast), border-color var(--transition-fast);
    min-height: 44px;
}

.tab-btn:hover { color: var(--color-text); }

.tab-btn--active {
    color: var(--color-text-strong);
    border-bottom-color: var(--color-accent);
}

.tab-btn:focus-visible {
    outline: none;
    box-shadow: 0 0 0 3px rgba(79, 126, 248, 0.35);
}

.tab-panel { padding-bottom: 2rem; }
.tab-panel[hidden] { display: none; }
.tab-panel--active { display: block; }

/* ============================================================
   UX — HEADER DETALHE E DROPDOWN
   ============================================================ */
.header--detalhe {
    display: grid;
    grid-template-columns: auto 1fr auto;
    align-items: center;
    gap: 0.75rem 1rem;
}

.header-nav { flex-shrink: 0; }

.header-brand-row {
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: 0.5rem 0.75rem;
    min-width: 0;
}

.header-brand-row h1 {
    margin: 0;
    min-width: 0;
}

.header-remote-actions {
    display: flex;
    align-items: center;
    gap: 0.35rem;
    flex-shrink: 0;
}

.header-remote-actions[hidden] {
    display: none;
}

.header-remote-link {
    display: inline-flex;
    align-items: center;
    gap: 0.25rem;
    text-decoration: none;
}

.header-remote-link[hidden] {
    display: none;
}

.header-remote-link[aria-disabled="true"] {
    pointer-events: none;
    opacity: 0.55;
    cursor: not-allowed;
}

.btn-icon--remote {
    width: 1em;
    height: 1em;
    flex-shrink: 0;
}

.header-menu { position: relative; }

.btn-icon-only {
    min-width: 36px;
    min-height: 36px;
    padding: 0.35rem 0.5rem;
}

.btn-icon-only svg.btn-icon {
    width: 1.25rem;
    height: 1.25rem;
    margin-right: 0;
}

.dropdown-menu {
    position: absolute;
    top: calc(100% + 4px);
    right: 0;
    min-width: 180px;
    background: var(--color-surface);
    border: 1px solid var(--color-border);
    border-radius: var(--radius-md);
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.4);
    z-index: 200;
    overflow: hidden;
}

.dropdown-menu[hidden] { display: none; }

.dropdown-item {
    display: block;
    width: 100%;
    text-align: left;
    padding: 0.6rem 1rem;
    font-size: 0.875rem;
    background: none;
    border: none;
    color: var(--color-text);
    cursor: pointer;
}

.dropdown-item:hover { background: var(--color-surface-raised); }
.dropdown-item--danger { color: #fca5a5; }
.dropdown-item--danger:hover { background: rgba(127, 29, 29, 0.35); }

.btn-icon {
    display: inline-flex;
    margin-right: 0.2rem;
}

/* ============================================================
   UX — CAMPOS E HINTS
   ============================================================ */
.field--inline {
    display: flex;
    flex-direction: column;
    gap: 0.25rem;
    min-width: 140px;
}

.field--grow { flex: 1 1 200px; }

.field-hint {
    font-size: 0.72rem;
    color: var(--color-text-dim);
}

.field-required { color: #f87171; }

.filter-bar .filter-label {
    font-size: 0.75rem;
    color: var(--color-text-muted);
    font-weight: 500;
}

/* ============================================================
   UX — BOTÕES OFFLINE / LOADING
   ============================================================ */
.btn:disabled,
.btn.btn--offline-disabled {
    opacity: 0.4;
    cursor: not-allowed;
    filter: grayscale(0.5);
}

.btn.is-loading {
    position: relative;
    color: transparent;
    pointer-events: none;
    min-width: 2.75rem;
    min-height: 2rem;
}

.btn.is-loading::after {
    content: '';
    position: absolute;
    left: 50%;
    top: 50%;
    width: 14px;
    height: 14px;
    margin-left: -7px;
    margin-top: -7px;
    border: 2px solid rgba(255, 255, 255, 0.3);
    border-top-color: #fff;
    border-radius: 50%;
    animation: spin 0.6s linear infinite;
}

@keyframes spin { to { transform: rotate(360deg); } }

.admin-aviso--info { color: #93c5fd; }

.admin-resultado-ativo {
    margin: 0.75rem 0;
    padding: 0.75rem 1rem;
    background: var(--color-bg);
    border: 1px solid var(--color-border);
    border-radius: var(--radius-md);
    font-size: 0.85rem;
    max-height: 300px;
    overflow: auto;
}

.admin-resultado-ativo[hidden] { display: none; }

.admin-resultado-ativo--info {
    border-color: var(--color-border);
}

.admin-resultado-ativo--sucesso {
    border-color: #22c55e;
    background: rgba(34, 197, 94, 0.08);
}

.admin-resultado-ativo--erro {
    border-color: #ef4444;
    background: rgba(239, 68, 68, 0.08);
}

.admin-resultado-ativo--aviso {
    border-color: #f59e0b;
    background: rgba(245, 158, 11, 0.08);
}

.admin-status-offline {
    color: #fcd34d;
    font-size: 0.85em;
}

.btn.btn--offline-queue:not(:disabled) {
    opacity: 0.85;
    border-color: #f59e0b;
}

.metrics-grid--loading {
    display: none;
}

.programas-tabela .col-acoes {
    width: 110px;
    text-align: right;
}

.admin-resultado-ativo pre {
    white-space: pre-wrap;
    word-break: break-word;
    font-size: 0.8rem;
    color: var(--color-text-muted);
    margin-top: 0.5rem;
}

.admin-details-danger summary {
    list-style: none;
    cursor: pointer;
}

.admin-details-danger summary h3 {
    display: inline;
    font-size: 1rem;
}

.admin-details-danger summary::before {
    content: '▸ ';
    color: var(--color-text-muted);
}

.admin-details-danger[open] summary::before {
    content: '▾ ';
}

.admin-details-catalogo {
    margin-top: 1rem;
}

.admin-details-catalogo summary {
    list-style: none;
    cursor: pointer;
    font-size: 0.95rem;
    color: var(--color-text);
    display: flex;
    align-items: center;
    gap: 0.5rem;
    flex-wrap: wrap;
}

.admin-details-catalogo summary::before {
    content: '▸ ';
    color: var(--color-text-muted);
}

.admin-details-catalogo[open] summary::before {
    content: '▾ ';
}

.admin-details-catalogo .admin-catalogo-comandos {
    margin-top: 0.75rem;
}

.admin-so-badge {
    display: inline-block;
    font-size: 0.75rem;
    font-weight: 600;
    padding: 0.15rem 0.5rem;
    border-radius: 999px;
    background: rgba(59, 130, 246, 0.15);
    border: 1px solid rgba(59, 130, 246, 0.35);
    color: #93c5fd;
}

.admin-comando-rapido {
    margin-bottom: 0.75rem;
}

.admin-status--offline:not([hidden]) {
    color: #fcd34d;
    background: rgba(245, 158, 11, 0.08);
    border-color: rgba(245, 158, 11, 0.35);
}

.admin-block-comandos .btn-primary.btn-sm {
    background: var(--color-surface-raised);
    border-color: var(--color-border);
    color: var(--color-text);
}

.admin-block-comandos .btn-primary.btn-sm:hover:not(:disabled) {
    background: #334155;
    border-color: #475569;
}

.admin-bloqueio-acesso {
    margin-top: 1rem;
    padding-top: 1rem;
    border-top: 1px dashed var(--color-border);
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
    max-width: 480px;
}

.admin-bloqueio-acesso h4 {
    font-size: 0.9rem;
    margin: 0;
}

.admin-bloqueio-acesso label {
    font-size: 0.85rem;
    color: var(--color-text-muted);
}

.admin-bloqueio-acesso textarea.input {
    width: 100%;
    resize: vertical;
    min-height: 4.5rem;
}

.admin-bloqueio-acesso #chk-bloqueio-acesso {
    margin-right: 0.35rem;
    vertical-align: middle;
}

/* ============================================================
   UX — PROGRAMAS PAGINAÇÃO
   ============================================================ */
.programas-toolbar {
    margin-bottom: 0.75rem;
}

.programas-paginacao {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 0.5rem;
    margin-top: 0.75rem;
    flex-wrap: wrap;
    font-size: 0.8rem;
    color: var(--color-text-muted);
}

.programas-paginacao-botoes {
    display: flex;
    gap: 0.35rem;
}

.programas-footer {
    color: #94a3b8;
}

.info-details summary {
    cursor: pointer;
    font-weight: 600;
    color: var(--color-text-muted);
    margin-bottom: 0.5rem;
    font-size: 0.9rem;
}

.machine-info--resumo {
    margin-top: 0;
}

.extra-section-body--compact {
    min-height: auto;
    padding: 0.5rem 0;
}

.layout-mobile-only {
    display: none;
}

body.layout-mobile .layout-mobile-only {
    display: revert;
}

body.layout-mobile .layout-desktop-only {
    display: none;
}

#admin-aviso-mobile-software[hidden] {
    display: none;
}

.alerts-section--inline {
    padding: 1rem 2rem 0;
}

.metrics-grid {
    grid-template-columns: repeat(auto-fill, minmax(140px, 1fr));
}

/* ============================================================
   UX — SKELETON
   ============================================================ */
.skeleton-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(140px, 1fr));
    gap: 0.75rem;
    padding: 0 2rem 1rem;
}

.skeleton-grid--cards {
    grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
    padding: 0.75rem;
}

.skeleton-item {
    background: linear-gradient(90deg, #1e293b 25%, #273449 50%, #1e293b 75%);
    background-size: 200% 100%;
    animation: skeleton-shimmer 1.2s ease-in-out infinite;
    border-radius: var(--radius-md);
    height: 80px;
}

.skeleton-grid--cards .skeleton-item { height: 180px; }

@keyframes skeleton-shimmer {
    0% { background-position: 200% 0; }
    100% { background-position: -200% 0; }
}

.skeleton-grid[aria-hidden="true"]:empty,
.skeleton-grid.hidden { display: none; }

/* Cards como links */
a.cliente-card {
    text-decoration: none;
    color: inherit;
}

/* ============================================================
   UX — RESPONSIVE EXTRA
   ============================================================ */
@media (max-width: 1024px) {
    .tabs { padding: 0 1rem; top: 52px; }
    .alerts-section--inline { padding: 1rem 1rem 0; }
    .whatsapp-silence-section { padding: 0 1rem 1.25rem; }
    .location-section { padding: 0 1rem 1.5rem; }
    .hw-specs-grid {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }
    .hw-spec-group:last-child {
        grid-column: 1 / -1;
    }
    .location-header-actions {
        width: 100%;
        justify-content: flex-start;
    }
    .history-charts { padding-left: 1rem; padding-right: 1rem; }

    .header:not(.header--detalhe) .header-summary.summary-cards {
        order: 3;
        flex: 1 1 100%;
        max-width: none;
        width: 100%;
        margin-left: 0;
        margin-right: 0;
    }

    .header:not(.header--detalhe) .header-summary .card-value {
        font-size: 1.2rem;
    }
}

@media (max-width: 768px) {
    .header--detalhe {
        grid-template-columns: 1fr;
        grid-template-rows: auto auto auto;
    }
    .header-nav { order: 1; }
    .header-brand { order: 2; }
    .header-status {
        order: 3;
        flex-wrap: wrap;
        white-space: normal;
        justify-content: flex-start;
    }
    .tabs {
        overflow-x: auto;
        flex-wrap: nowrap;
        -webkit-overflow-scrolling: touch;
    }
    .tab-btn { flex-shrink: 0; }
    .location-map { height: 220px; }
    .parque-map { height: 280px; }
    .parque-map-section { padding: 0 1rem 1rem; }
    .mapa-legenda-status { margin-left: 0; width: 100%; }
    .rede-atual-grid {
        grid-template-columns: 1fr;
    }
    .rotas-lista li {
        flex-direction: column;
        align-items: flex-start;
    }
    .rota-acoes {
        margin-left: 1.5rem;
    }
    .rotas-map { height: 220px; }
    .btn-sm { min-height: 40px; padding: 0.4rem 0.75rem; }
    .filter-bar { padding: 0.75rem 1rem; }
    .location-section { padding: 0 1rem 1.5rem; }
    .hw-specs-grid { grid-template-columns: 1fr; }
    .hw-spec-group:last-child { grid-column: auto; }
    .skeleton-grid { padding: 0 1rem 1rem; }
}

@media (max-width: 480px) {
    .summary-cards {
        grid-template-columns: repeat(2, minmax(0, 1fr));
        max-width: none;
    }
    .metrics-grid { grid-template-columns: 1fr 1fr; }
    .modal-card { padding: 1rem; }
    .toast-container {
        left: 1rem;
        right: 1rem;
        max-width: none;
    }
}

.captura-tela-preview {
    margin-top: 1rem;
}

.captura-tela-imagem {
    display: block;
    max-width: 100%;
    max-height: 70vh;
    border: 1px solid var(--border-color, #334155);
    border-radius: 8px;
    background: #0f172a;
}

.captura-tela-acoes {
    margin-top: 0.75rem;
}

.captura-webcam-dupla {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
    gap: 1rem;
    margin-top: 0.75rem;
}

.captura-webcam-item figcaption {
    margin-top: 0.35rem;
    font-size: 0.85rem;
    color: var(--text-muted, #94a3b8);
}
