:root {
  color-scheme: light;
  --ink: #172033;
  --muted: #5c6b80;
  --line: #e4eaf2;
  --paper: #eef3f8;
  --card: #ffffff;
  --accent: #0c7a62;
  --accent-dark: #095c4a;
  --danger: #b42318;
  --shadow: 0 16px 40px rgba(23, 32, 51, 0.08);
  --radius: 16px;
}

* { box-sizing: border-box; }

body {
  margin: 0;
  min-height: 100vh;
  background:
    radial-gradient(900px 420px at 100% -10%, rgba(12, 122, 98, 0.16), transparent 60%),
    radial-gradient(700px 380px at -10% 0%, rgba(37, 99, 168, 0.12), transparent 55%),
    var(--paper);
  color: var(--ink);
  font: 16px/1.5 "Segoe UI", system-ui, sans-serif;
}

main {
  width: min(1120px, calc(100% - 32px));
  margin: 28px auto 48px;
}

header, section, .credencial, .login form {
  background: var(--card);
  border: 1px solid rgba(255, 255, 255, 0.8);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
}

header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 16px;
  padding: 22px 26px;
}

section, .credencial { margin-top: 16px; padding: 22px 26px; }

h1, h2 { margin: 0; font-weight: 680; letter-spacing: -0.02em; }
h1 { font-size: 30px; }
h2 { font-size: 18px; margin-bottom: 16px; }

.kicker {
  margin: 0 0 4px;
  color: var(--accent);
  font-size: 12px;
  font-weight: 750;
  letter-spacing: 0.12em;
  text-transform: uppercase;
}

.lede { margin: 6px 0 0; color: var(--muted); }

label { display: grid; gap: 6px; color: var(--muted); font-size: 13px; font-weight: 650; }

input, button {
  border: 1px solid var(--line);
  border-radius: 10px;
  padding: 11px 13px;
  font: inherit;
}

input {
  background: #f8fafc;
  color: var(--ink);
  min-width: 180px;
}

input:focus {
  outline: 3px solid rgba(12, 122, 98, 0.18);
  border-color: #8dcebf;
  background: #fff;
}

button {
  background: var(--accent);
  color: white;
  border-color: var(--accent);
  font-weight: 680;
  cursor: pointer;
  transition: transform 0.12s ease, background 0.12s ease;
}

button:hover { background: var(--accent-dark); }
button:active { transform: translateY(1px); }

button.ghost, button.perigo { background: #fff; }
button.ghost { color: var(--ink); }
button.ghost:hover { background: #f3f6fa; }
button.perigo { color: var(--danger); border-color: #f0c7c3; }
button.perigo:hover { background: #fff5f4; }

.grade, .acoes { display: flex; gap: 12px; align-items: end; flex-wrap: wrap; }
.grade button, .acoes button { height: 44px; }

table { width: 100%; border-collapse: collapse; }
th, td { text-align: left; padding: 12px 8px; border-top: 1px solid var(--line); vertical-align: middle; }
th { color: var(--muted); font-size: 12px; font-weight: 750; letter-spacing: 0.04em; text-transform: uppercase; }
tbody tr:hover td { background: #f8fbfa; }

.estado {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 3px 9px;
  border-radius: 999px;
  background: #e8f6ef;
  color: var(--accent-dark);
  font-size: 13px;
  font-weight: 700;
}

.estado.bloqueado { background: #fdecec; color: var(--danger); }
.estado::before {
  content: "";
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: currentColor;
}

dl { display: grid; grid-template-columns: 120px 1fr; gap: 8px 12px; margin: 16px 0 0; }
dt { color: var(--muted); }
dd { margin: 0; font-family: ui-monospace, "Cascadia Mono", monospace; }

.credencial {
  border-color: #b7e4d6;
  background: linear-gradient(180deg, #f3fbf8, #fff 42%);
}

.erro, .aviso { padding: 12px 14px; border-radius: 12px; margin: 16px 0 0; }
.erro { background: #fdecec; color: var(--danger); }
.aviso { background: #e8f6ef; color: var(--accent-dark); }

.login {
  width: min(440px, calc(100% - 32px));
  margin-top: 12vh;
}

.login form { display: grid; gap: 14px; padding: 28px; }
.login h1 { margin-bottom: 4px; }
.login .erro, .login .aviso { margin: 0 0 14px; }

.overlay {
  position: fixed;
  inset: 0;
  display: none;
  place-items: center;
  background: rgba(23, 32, 51, 0.38);
  backdrop-filter: blur(3px);
  z-index: 20;
}

.overlay.ativo { display: grid; }

.overlay div {
  display: grid;
  justify-items: center;
  gap: 14px;
  min-width: 220px;
  padding: 28px 32px;
  border-radius: 18px;
  background: #fff;
  box-shadow: var(--shadow);
  color: var(--ink);
  font-weight: 700;
}

.spinner {
  width: 36px;
  height: 36px;
  border-radius: 50%;
  border: 3px solid #d7efe8;
  border-top-color: var(--accent);
  animation: giro 0.7s linear infinite;
}

@keyframes giro { to { transform: rotate(360deg); } }

@media (max-width: 760px) {
  .acoes form, .grade { width: 100%; }
  input { width: 100%; }
  header { align-items: flex-start; }
}
