body {
  margin: 0;
  min-height: 100vh;
  color: #17324d;
  font-family: "Segoe UI", sans-serif;
  background:
    radial-gradient(circle at 8% 6%, #fff 0 78px, transparent 80px),
    radial-gradient(circle at 14% 11%, #fff 0 36px, transparent 38px),
    radial-gradient(circle at 92% 4%, #fff 0 96px, transparent 98px),
    radial-gradient(circle at 84% 16%, #cfe6ff 0 48px, transparent 50px),
    linear-gradient(180deg, #cfe8ff 0%, #eef6ff 42%, #f7fbff 100%);
}
main { width: 100%; box-sizing: border-box; padding: 1.1rem 1.4rem 2rem; }
main.entrada { max-width: 480px; margin: 4rem auto; }
h1 { margin: 0; font-size: 1.8rem; color: #145ea8; letter-spacing: -0.03em; }
h2 { margin: 0 0 0.7rem; font-size: 1.05rem; color: #1a6fbf; }
section {
  background: rgba(255, 255, 255, 0.92);
  border: 1px solid #d5e8f8;
  border-radius: 20px;
  padding: 1rem 1.05rem 1.1rem;
  margin: 0;
  box-shadow: 0 12px 28px rgba(43, 125, 233, 0.08);
}
.topo { display: flex; justify-content: space-between; align-items: center; gap: 1rem; margin-bottom: 0.85rem; flex-wrap: wrap; }
.menu { display: flex; gap: 0.45rem; flex-wrap: wrap; margin: 0 0 0.85rem; }
.menu button.activo, .menu button.activo:hover { background: #2b7de9; color: #fff; }
.vista { display: grid; gap: 0.85rem; }
[hidden] { display: none !important; }
.hora-caixa { display: flex; align-items: center; gap: 0.75rem; flex-wrap: wrap; }
.aviso { padding: 0.7rem 1rem; border-radius: 14px; background: #e7f3ff; border: 1px solid #b9d8f5; color: #1a568f; margin-bottom: 0.85rem; }
.aviso.ligado { background: #e8f8ff; border-color: #8fd0f2; color: #0d6e93; }
.metricas { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 0.8rem; margin-bottom: 0.85rem; }
.metrica { background: rgba(255, 255, 255, 0.92); border: 1px solid #d5e8f8; border-radius: 18px; padding: 0.85rem 1rem; box-shadow: 0 10px 24px rgba(43, 125, 233, 0.07); }
.metrica span { display: block; color: #4d7ea8; font-size: 0.8rem; margin-bottom: 0.2rem; }
.metrica strong { font-size: 1.45rem; color: #145ea8; font-weight: 700; }
#ultimo-movimento { font-size: 1.05rem; }
.painel { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: 0.85rem; align-items: start; }
.largo, .coluna, .tabela, section { min-width: 0; }
.coluna { display: grid; gap: 0.85rem; }
.cartao-relogio .acoes { white-space: normal; }
.cartao-relogio { border: 1px solid #e5f1fb; border-radius: 14px; padding: 0.75rem; margin-top: 0.55rem; background: #f8fcff; }
.cartao-relogio input.nome-relogio { max-width: none; margin: 0.45rem 0; }
.grelha { display: grid; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); gap: 0.75rem; align-items: end; }
label { display: block; font-size: 0.82rem; margin-bottom: 0.28rem; color: #3d6f99; }
input, select {
  width: 100%;
  box-sizing: border-box;
  padding: 0.5rem 0.6rem;
  border: 1px solid #c5dff3;
  border-radius: 12px;
  background: #f8fcff;
  color: #17324d;
}
input:focus, select:focus { outline: 2px solid #8ec5f8; border-color: #7eb7ee; }
button, a.secundario {
  border: 0;
  border-radius: 999px;
  padding: 0.55rem 0.95rem;
  background: #2b7de9;
  color: #fff;
  font-weight: 600;
  cursor: pointer;
  text-decoration: none;
  display: inline-flex;
  align-items: center;
  justify-content: center;
}
button:hover, a.secundario:hover { background: #1f6ed4; }
button.secundario, a.secundario { background: #e7f3ff; color: #1a62ad; }
button.secundario:hover, a.secundario:hover { background: #d7ebff; }
button.perigo { background: #ffe8ea; color: #a33b45; }
button.perigo:hover { background: #ffd6db; }
.tabela { overflow-x: auto; }
table { width: 100%; border-collapse: collapse; }
th, td { text-align: left; padding: 0.55rem 0.45rem; border-bottom: 1px solid #e5f1fb; vertical-align: middle; }
th { font-size: 0.78rem; color: #4d7ea8; background: #f3f9ff; white-space: nowrap; }
tr:hover td { background: #f7fbff; }
td.acoes, .acoes { white-space: nowrap; }
.acoes button { display: inline-flex; align-items: center; gap: 0.35rem; margin: 0 0.28rem 0 0; vertical-align: middle; }
td.acoes button { width: 2.45rem; height: 2.45rem; padding: 0; }
button svg.icone { width: 1.15rem; height: 1.15rem; flex: 0 0 auto; }
.nota { color: #5b7f9e; font-size: 0.92rem; }
.relogio { margin: 0; font-size: 1.35rem; font-weight: 700; color: #145ea8; }
#mensagem, #mensagem-relogios { min-height: 1.2rem; margin: 0.45rem 0 0; }
select.dedo, select.destino { max-width: 11rem; width: auto; background: #fff; }
select.destino { max-width: 12rem; }
.linha { display: flex; justify-content: space-between; gap: 1rem; align-items: center; flex-wrap: wrap; }
.popup { position: fixed; inset: 0; z-index: 30; display: flex; align-items: center; justify-content: center; padding: 1rem; }
.popup[hidden] { display: none; }
.popup-fundo { position: absolute; inset: 0; background: rgba(20, 74, 122, 0.35); }
.popup-caixa { position: relative; width: min(760px, 100%); max-height: 90vh; overflow: auto; background: #fff; border-radius: 22px; padding: 1.2rem 1.25rem 1.3rem; box-shadow: 0 18px 50px rgba(20, 74, 122, 0.22); }
.selo { display: inline-block; padding: 0.12rem 0.6rem; border-radius: 999px; font-size: 0.82rem; font-weight: 700; }
.selo.entrada { background: #e5f8ec; color: #1b7a3a; }
.selo.saida { background: #fde8ea; color: #c23642; }
input.nome-relogio { max-width: 16rem; }
@media (max-width: 1100px) {
  .metricas { grid-template-columns: 1fr 1fr; }
  .painel { grid-template-columns: minmax(0, 1fr); }
}
