:root {
  --navy: #002366;
  --teal: #0097ae;
  --teal-dark: #007a8d;
  --bg: #f0f7f9;
  --bar: #e6f2f4;
  --white: #ffffff;
  --text: #1c2b4a;
  --muted: #5f6f8a;
  --line: #d5e4e8;
  --danger: #b3261e;
  --ok: #1b7f4b;
  --radius: 18px;
  --shadow: 0 4px 18px rgba(0, 35, 102, 0.08);
}

* { box-sizing: border-box; }
html, body { margin: 0; }
body {
  font-family: system-ui, -apple-system, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
  background: var(--bg);
  color: var(--text);
  line-height: 1.5;
  min-height: 100vh;
}
h1, h2, h3 { color: var(--navy); line-height: 1.2; margin: 0 0 12px; }
h1 { font-size: 1.7rem; }
h2 { font-size: 1.25rem; }
h3 { font-size: 1.05rem; }
p { margin: 0 0 10px; }
.muted { color: var(--muted); font-size: 0.92rem; }
.boot { padding: 40px; text-align: center; color: var(--muted); }

/* topo */
.topbar {
  background: var(--white);
  border-bottom: 1px solid var(--line);
  position: sticky; top: 0; z-index: 10;
}
.topbar-inner {
  max-width: 1050px; margin: 0 auto; padding: 10px 16px;
  display: flex; align-items: center; gap: 14px; flex-wrap: wrap;
}
.brand { display: flex; align-items: center; gap: 10px; text-decoration: none; }
.brand img { height: 40px; width: auto; display: block; }
.brand span { color: var(--navy); font-weight: 700; font-size: 0.95rem; }
.nav { display: flex; gap: 6px; flex-wrap: wrap; flex: 1; }
.nav a {
  text-decoration: none; color: var(--navy); padding: 8px 14px;
  border-radius: 999px; font-weight: 600; font-size: 0.93rem;
}
.nav a:hover { background: var(--bar); }
.nav a.active { background: var(--navy); color: var(--white); }
.tools { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.who { font-size: 0.82rem; color: var(--muted); max-width: 200px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

main { max-width: 1050px; margin: 0 auto; padding: 22px 16px 60px; }

/* botoes */
button, .btn {
  font: inherit; cursor: pointer; border: 0; border-radius: 999px;
  padding: 10px 20px; font-weight: 700; font-size: 0.93rem;
  background: var(--navy); color: var(--white);
  transition: background 0.15s;
}
button:hover { background: #0a3485; }
button.teal { background: var(--teal); }
button.teal:hover { background: var(--teal-dark); }
button.ghost { background: transparent; color: var(--navy); border: 1.5px solid var(--navy); }
button.ghost:hover { background: var(--bar); }
button.small { padding: 6px 14px; font-size: 0.85rem; }
button.lang { padding: 6px 12px; font-size: 0.82rem; }
button:disabled { opacity: 0.55; cursor: default; }
button:focus-visible, a:focus-visible, input:focus-visible, select:focus-visible {
  outline: 3px solid var(--teal); outline-offset: 2px;
}

/* cartoes */
.card {
  background: var(--white); border-radius: var(--radius);
  box-shadow: var(--shadow); padding: 20px; margin-bottom: 18px;
}
.grid { display: grid; gap: 14px; grid-template-columns: repeat(auto-fit, minmax(190px, 1fr)); margin-bottom: 18px; }
.stat { background: var(--white); border-radius: var(--radius); box-shadow: var(--shadow); padding: 18px 20px; }
.stat .num { font-size: 2rem; font-weight: 800; color: var(--teal); line-height: 1; }
.stat .label { color: var(--muted); font-size: 0.9rem; margin-top: 6px; }
.eyebrow { text-transform: uppercase; letter-spacing: 0.08em; font-size: 0.74rem; font-weight: 700; color: var(--teal); margin-bottom: 4px; }

/* listas */
.item {
  display: flex; flex-wrap: wrap; gap: 10px 16px; align-items: center;
  justify-content: space-between;
  padding: 14px 0; border-bottom: 1px solid var(--line);
}
.item:last-child { border-bottom: 0; }
.item .main { flex: 1 1 260px; min-width: 0; }
.item .title { font-weight: 700; color: var(--navy); }
.item .side { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; }
.time-line { font-size: 0.9rem; color: var(--muted); }
.time-line b { color: var(--text); font-weight: 600; }
.empty { color: var(--muted); padding: 10px 0; }

.badge {
  display: inline-block; padding: 2px 10px; border-radius: 999px;
  font-size: 0.78rem; font-weight: 700; background: var(--bar); color: var(--navy);
}
.badge.ok { background: #dff3e8; color: var(--ok); }
.badge.off { background: #f4e1df; color: var(--danger); }

/* formularios */
form.row { display: grid; gap: 12px; grid-template-columns: repeat(auto-fit, minmax(200px, 1fr)); align-items: end; }
label { display: block; font-size: 0.83rem; font-weight: 700; color: var(--navy); margin-bottom: 4px; }
input, select {
  font: inherit; width: 100%; padding: 10px 12px; border-radius: 12px;
  border: 1.5px solid var(--line); background: var(--white); color: var(--text);
}
.checks { display: flex; flex-wrap: wrap; gap: 8px 16px; padding: 6px 0; }
.checks label { display: flex; align-items: center; gap: 6px; font-weight: 500; color: var(--text); margin: 0; }
.checks input { width: auto; }
.full { grid-column: 1 / -1; }

/* login */
.center-screen { min-height: 100vh; display: grid; place-items: center; padding: 20px; }
.login-card { max-width: 420px; width: 100%; text-align: center; padding: 34px 26px; }
.login-card img { width: 220px; max-width: 70%; margin-bottom: 14px; }
.login-card .lang-row { margin-top: 16px; display: flex; justify-content: center; gap: 8px; }
.err { color: var(--danger); font-weight: 600; }

/* aviso */
#toast {
  position: fixed; left: 50%; bottom: 22px; transform: translateX(-50%) translateY(30px);
  background: var(--navy); color: var(--white); padding: 12px 20px; border-radius: 999px;
  font-weight: 600; font-size: 0.92rem; opacity: 0; pointer-events: none;
  transition: all 0.25s; max-width: 92vw; z-index: 50;
}
#toast.show { opacity: 1; transform: translateX(-50%) translateY(0); }
#toast.bad { background: var(--danger); }

@media (max-width: 640px) {
  h1 { font-size: 1.4rem; }
  .topbar-inner { gap: 8px; }
  .nav { order: 3; flex-basis: 100%; }
  .who { display: none; }
  .card { padding: 16px; }
}
