/* Painéis (admin, dono, staff, motorista), login e instalador.
   Direção visual: sinalização rodoviária brasileira. Verde de placa, giz, amarelo só onde importa. */
:root {
  --green: #0b5d3b; --green-d: #08452c; --chalk: #f3f5f1; --paper: #ffffff;
  --ink: #1c2227; --muted: #5a656d; --line: #d3d9d1; --yellow: #ffc20e;
  --red: #b3261e; --red-bg: #fbeae8; --ok-bg: #e2f1e7; --warn-bg: #fff6d6;
  --font-head: "Bahnschrift", "DIN Alternate", "Arial Narrow", "Roboto Condensed", system-ui, sans-serif;
}
*, *::before, *::after { box-sizing: border-box; }
body { margin: 0; background: var(--chalk); color: var(--ink); font: 400 1rem/1.6 system-ui, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif; }
h1, h2 { font-family: var(--font-head); font-stretch: 80%; line-height: 1.1; margin: 0 0 .8rem; }
h1 { font-size: clamp(1.7rem, 4vw, 2.3rem); font-weight: 800; }
h2 { font-size: 1.3rem; font-weight: 700; margin-top: 1.4rem; }
.card h2:first-child, .card-head h2 { margin-top: 0; }
a { color: var(--green); }
:focus-visible { outline: 3px solid var(--ink); outline-offset: 2px; }
.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
.muted { color: var(--muted); }
.center { text-align: center; }

/* Barra superior: uma placa de guia, com friso branco interno */
.topbar {
  display: flex; flex-wrap: wrap; align-items: center; gap: .6rem 1.5rem; padding: .9rem clamp(1rem, 3vw, 2rem);
  background: var(--green); color: #fff;
  box-shadow: inset 0 0 0 3px var(--green), inset 0 0 0 5px rgba(255,255,255,.85);
}
.topbar :focus-visible { outline-color: var(--yellow); }
.brand { display: inline-flex; align-items: center; gap: .6rem; color: #fff; text-decoration: none; font: 800 1.25rem var(--font-head); font-stretch: 80%; letter-spacing: .02em; }
.brand-mark {
  width: 1.5rem; height: 1.5rem; border-radius: 4px; flex: none;
  background: repeating-linear-gradient(180deg, var(--yellow) 0 4px, transparent 4px 8px), var(--green-d);
  box-shadow: inset 0 0 0 2px #fff;
}
.nav { display: flex; flex-wrap: wrap; gap: .25rem 1.1rem; margin-right: auto; }
.nav a { color: #fff; text-decoration: none; padding: .2rem 0; border-bottom: 3px solid transparent; }
.nav a:hover, .nav a.is-active { border-bottom-color: var(--yellow); }
.who { display: flex; align-items: center; gap: .8rem; }
.who-text { display: grid; line-height: 1.25; text-align: right; }
.who-text small { opacity: .85; }

.page { max-width: 68rem; margin: 0 auto; padding: clamp(1rem, 3vw, 2rem); }
.page-head, .card-head { display: flex; align-items: center; justify-content: space-between; gap: 1rem; flex-wrap: wrap; }

.card { background: var(--paper); border: 1px solid var(--line); border-radius: 6px; padding: clamp(1rem, 3vw, 1.6rem); margin-bottom: 1.2rem; }
.card.narrow { max-width: 26rem; margin-inline: auto; }
.card.narrow-left { max-width: 40rem; }

/* Números-chave: uma faixa contínua, sem cartões repetidos */
.stats { display: flex; flex-wrap: wrap; margin: 0 0 1.4rem; border-top: 3px solid var(--green); background: var(--paper); border-bottom: 1px solid var(--line); }
.stats > div { flex: 1 1 10rem; padding: .9rem 1.2rem; border-right: 1px solid var(--line); }
.stats > div:last-child { border-right: 0; }
.stats dt { color: var(--muted); font-size: .92rem; }
.stats dd { margin: 0; font: 800 2.2rem/1.1 var(--font-head); font-stretch: 80%; }
.stats dd.text-dd { font-size: 1.6rem; }

.plain-list { list-style: none; margin: 0; padding: 0; }
.plain-list li { display: flex; gap: .8rem; align-items: center; flex-wrap: wrap; padding: .6rem 0; border-bottom: 1px solid var(--line); }
.plain-list li:last-child { border-bottom: 0; }
.empty { color: var(--muted); margin: 0; }

.table-wrap { overflow-x: auto; }
table { width: 100%; border-collapse: collapse; }
th, td { text-align: left; padding: .65rem .7rem; border-bottom: 1px solid var(--line); vertical-align: middle; white-space: nowrap; }
th { font-weight: 700; color: var(--muted); font-size: .92rem; }

.badge { display: inline-block; padding: .1rem .6rem; border-radius: 999px; font-size: .85rem; font-weight: 700; }
.badge-active { background: var(--ok-bg); color: var(--green-d); }
.badge-suspended { background: var(--red-bg); color: var(--red); }

/* Botões e formulários */
.btn {
  display: inline-block; font: 700 1rem/1.2 system-ui, "Segoe UI", sans-serif; padding: .65rem 1.1rem; border-radius: 6px;
  border: 2px solid var(--ink); background: var(--paper); color: var(--ink); text-decoration: none; cursor: pointer;
}
.btn:hover { background: var(--chalk); }
.btn-primary { background: var(--green); border-color: var(--green); color: #fff; }
.btn-primary:hover { background: var(--green-d); border-color: var(--green-d); }
.btn-quiet { border-color: transparent; background: transparent; color: inherit; text-decoration: underline; text-underline-offset: 3px; }
.topbar .btn-quiet { color: #fff; }
.btn[disabled] { opacity: .5; cursor: not-allowed; }

.form { display: grid; gap: 1rem; }
.form label { display: grid; gap: .3rem; font-weight: 600; }
.form small { font-weight: 400; color: var(--muted); }
input[type=text], input[type=email], input[type=password], input:not([type]), textarea {
  width: 100%; font: inherit; font-weight: 400; padding: .6rem .7rem; border: 1.5px solid #9aa5a0; border-radius: 5px; background: #fff; color: var(--ink);
}
textarea { resize: vertical; }
input[type=color] { width: 100%; height: 3rem; padding: .2rem; border: 1.5px solid #9aa5a0; border-radius: 5px; background: #fff; }
input[type=file] { font-weight: 400; }
.check { display: flex !important; align-items: center; gap: .6rem; font-weight: 500 !important; }
.check input { width: 1.15rem; height: 1.15rem; }
.input-prefix { display: flex; align-items: stretch; }
.input-prefix > span { display: flex; align-items: center; padding: 0 .7rem; background: var(--chalk); border: 1.5px solid #9aa5a0; border-right: 0; border-radius: 5px 0 0 5px; color: var(--muted); font-weight: 400; white-space: nowrap; }
.input-prefix input { border-radius: 0 5px 5px 0; }
.grid-2 { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 1rem; }
.grid-3 { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 1rem; }
.actions { display: flex; flex-wrap: wrap; gap: .8rem; align-items: center; }
.preview { display: block; max-width: 100%; max-height: 9rem; margin: .7rem 0; border: 1px solid var(--line); border-radius: 4px; background: repeating-conic-gradient(#e9ece7 0 25%, #fff 0 50%) 0 0 / 14px 14px; }
.preview-logo { max-height: 6rem; }

.alert { padding: .8rem 1rem; border-radius: 5px; margin-bottom: 1rem; border-left: 5px solid; }
.alert-success { background: var(--ok-bg); border-color: var(--green); }
.alert-error { background: var(--red-bg); border-color: var(--red); }

/* Login, instalador e erros */
.plain-wrap { max-width: 44rem; margin: 0 auto; padding: 2rem 1rem 3rem; }
.brand-large { color: var(--green); font-size: 1.7rem; margin-bottom: 1.2rem; }
.brand-large .brand-mark { box-shadow: inset 0 0 0 2px var(--green); background: repeating-linear-gradient(180deg, var(--yellow) 0 4px, transparent 4px 8px), #fff; }
.big-code { font-size: 4.5rem; color: var(--green); margin: 0; }
.checks { list-style: none; padding: 0; margin: 0 0 1.2rem; }
.checks li { padding: .35rem 0; border-bottom: 1px solid var(--line); }
.check-state { display: inline-block; min-width: 4.8rem; font-weight: 800; }
.is-ok .check-state { color: var(--green); }
.is-bad .check-state { color: var(--red); }

@media (max-width: 640px) {
  .grid-2, .grid-3 { grid-template-columns: 1fr; }
  .who-text { text-align: left; }
  .stats > div { border-right: 0; border-bottom: 1px solid var(--line); }
}
