body {
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
}

/* Container um pouco mais folgado no mobile */
@media (max-width: 575.98px) {
  .container { padding-left: .75rem; padding-right: .75rem; }
}

/* Cabecalho da pagina */
.app-header h3 { font-size: 1.4rem; }
@media (max-width: 575.98px) {
  .app-header h3 { font-size: 1.15rem; }
}

/* ---- Cartao de status — muda de cor conforme o estado do IP ---- */
#statusCard {
  border: 2px solid #444;
  transition: background-color .3s, border-color .3s;
}
#statusCard.status-loading { background:#2b2b2b; color:#ccc; border-color:#555; }
#statusCard.status-virgem  { background:#0f5132; color:#d1e7dd; border-color:#198754; }
#statusCard.status-usado   { background:#842029; color:#f8d7da; border-color:#dc3545; }

/* IP grande, mas que nao estoura em telas estreitas */
#statusIp {
  word-break: break-all;
  line-height: 1.1;
}
@media (max-width: 575.98px) {
  #statusIp { font-size: 1.5rem; }
  #statusContador { text-align: left !important; }
}

#statusGrid .lbl { opacity:.7; display:block; font-size:.72rem; text-transform:uppercase; }
#statusGrid .val { font-weight:600; word-break:break-word; }

/* Badge de acessos na tabela */
.badge-acessos-1  { background:#198754; }
.badge-acessos-2  { background:#fd7e14; }
.badge-acessos-3p { background:#dc3545; }

#lista tr.row-nova { animation: flash 1s ease-out; }
@keyframes flash { from { background:#ffc107; } to { background:transparent; } }

/* =========================================================
   LISTA RESPONSIVA
   Desktop (>= 768px): tabela normal.
   Mobile  (<  768px): cada linha vira um cartao empilhado,
   com o rotulo de cada campo vindo do atributo data-label.
   ========================================================= */
@media (max-width: 767.98px) {
  #listaTabela thead { display: none; }              /* esconde o cabecalho da tabela */

  #listaTabela,
  #listaTabela tbody,
  #listaTabela tr,
  #listaTabela td { display: block; width: 100%; }

  #listaTabela tr {
    background: #1e1e1e;
    border: 1px solid #333;
    border-radius: .5rem;
    margin-bottom: .6rem;
    padding: .5rem .75rem;
  }
  #listaTabela tr.row-nova { animation: flash 1s ease-out; }

  #listaTabela td {
    border: 0;
    padding: .25rem 0;
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 1rem;
    text-align: right;
    white-space: normal;
    word-break: break-word;
  }
  /* rotulo (nome do campo) a esquerda de cada dado */
  #listaTabela td::before {
    content: attr(data-label);
    font-weight: 600;
    color: #7a7a7a;
    text-transform: uppercase;
    font-size: .7rem;
    text-align: left;
    flex: 0 0 auto;
  }
  /* o IP como "titulo" do cartao */
  #listaTabela td.cel-ip {
    font-size: 1.05rem;
    border-bottom: 1px solid #333;
    padding-bottom: .4rem;
    margin-bottom: .25rem;
  }
  /* esconde a coluna "#" no modo cartao (nao faz sentido empilhado) */
  #listaTabela td.cel-num { display: none; }
}
