:root {
  --brand: #147844;
  --brand-dark: #0c5230;
  --brand-soft: #e7f5ed;
  --ink: #17221c;
  --muted: #627169;
  --line: #dce5df;
  --surface: #ffffff;
  --canvas: #f4f7f5;
  --danger: #b42318;
  --danger-soft: #fff0ee;
  --warning: #9a6700;
  --warning-soft: #fff7d6;
  --shadow: 0 10px 30px rgba(20, 54, 36, .08);
  --radius: 16px;
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  color: var(--ink);
  background: var(--canvas);
}
* { box-sizing: border-box; }
body { margin: 0; min-height: 100vh; background: var(--canvas); color: var(--ink); }
a { color: inherit; }
button, input, select, textarea { font: inherit; }
button, a { -webkit-tap-highlight-color: transparent; }
:focus-visible { outline: 3px solid rgba(20,120,68,.28); outline-offset: 2px; }
.topbar { min-height: 76px; padding: 14px clamp(18px,4vw,48px); display: flex; align-items: center; justify-content: space-between; gap: 20px; background: #0f1f17; color: #fff; border-bottom: 3px solid var(--brand); }
.brand { display: flex; flex-direction: column; text-decoration: none; min-width: 0; }
.brand-name { font-size: 18px; font-weight: 850; letter-spacing: .12em; }
.brand-product { color: #b9d8c6; font-size: 13px; margin-top: 3px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.topbar-actions, .button-row { display: flex; align-items: center; gap: 9px; flex-wrap: wrap; }
.topbar-actions form, .button-row form { margin: 0; }
.user-chip { border: 1px solid rgba(255,255,255,.2); border-radius: 999px; padding: 7px 11px; color: #dbe9e0; font-size: 13px; }
.navigation { padding: 0 clamp(18px,4vw,48px); background: var(--surface); border-bottom: 1px solid var(--line); display: flex; gap: 4px; overflow-x: auto; }
.navigation a { padding: 15px 14px 13px; color: var(--muted); font-size: 14px; font-weight: 700; text-decoration: none; border-bottom: 3px solid transparent; white-space: nowrap; }
.navigation a:hover, .navigation a.active { color: var(--brand-dark); border-bottom-color: var(--brand); }
.page { width: min(1240px, calc(100% - 36px)); margin: 30px auto 54px; }
.page-login { width: min(460px, calc(100% - 36px)); min-height: calc(100vh - 190px); display: grid; place-items: center; }
.footer { width: min(1240px, calc(100% - 36px)); margin: 0 auto; padding: 22px 0 30px; border-top: 1px solid var(--line); display: flex; justify-content: space-between; color: var(--muted); font-size: 12px; }
.page-heading { margin-bottom: 22px; }
.page-heading h1, .login-card h1, .error-card h1 { margin: 5px 0 6px; font-size: clamp(28px,4vw,38px); letter-spacing: -.035em; }
.page-heading p, .panel-heading p, .login-card p { margin: 0; color: var(--muted); }
.heading-actions { display: flex; align-items: center; justify-content: space-between; gap: 18px; }
.eyebrow { color: var(--brand); font-size: 11px; font-weight: 850; letter-spacing: .14em; }
.panel, .login-card { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); box-shadow: var(--shadow); padding: 22px; }
.panel + .panel { margin-top: 16px; }
.panel-heading { margin-bottom: 18px; }
.panel-heading h2 { font-size: 19px; margin: 0 0 4px; }
.login-card { width: 100%; padding: clamp(24px,6vw,40px); }
.stats-grid { display: grid; grid-template-columns: repeat(4, minmax(0,1fr)); gap: 14px; margin-bottom: 16px; }
.stat-card { padding: 20px; border: 1px solid var(--line); border-radius: var(--radius); background: var(--surface); box-shadow: var(--shadow); }
.stat-card span { display: block; color: var(--muted); font-size: 13px; }
.stat-card strong { display: block; margin-top: 6px; font-size: 32px; letter-spacing: -.04em; }
.status-grid { display: grid; grid-template-columns: repeat(2,minmax(0,1fr)); gap: 16px; margin-bottom: 16px; }
.definition-list { margin: 0; }
.definition-list div { display: flex; justify-content: space-between; gap: 20px; padding: 11px 0; border-bottom: 1px solid var(--line); }
.definition-list div:last-child { border: 0; }
.definition-list dt { color: var(--muted); }
.definition-list dd { margin: 0; text-align: right; font-weight: 700; }
.button { appearance: none; display: inline-flex; align-items: center; justify-content: center; min-height: 40px; padding: 9px 14px; border-radius: 10px; border: 1px solid transparent; font-weight: 750; font-size: 13px; cursor: pointer; text-decoration: none; transition: .15s ease; }
.button:hover { transform: translateY(-1px); }
.button-primary { background: var(--brand); color: #fff; border-color: var(--brand); }
.button-primary:hover { background: var(--brand-dark); }
.button-secondary { background: var(--surface); color: var(--ink); border-color: var(--line); }
.button-secondary:hover { border-color: #9eb8a7; color: var(--brand-dark); }
.button-danger { background: var(--danger-soft); color: var(--danger); border-color: #f3bbb5; }
.button-ghost { background: transparent; color: #fff; border-color: rgba(255,255,255,.25); }
.status { display: inline-flex; align-items: center; border-radius: 999px; padding: 5px 9px; font-size: 11px; font-weight: 800; text-transform: uppercase; letter-spacing: .04em; background: #edf1ef; color: #4c5c53; }
.status-ativo, .status-sucesso, .status-notificada, .status-ok { background: var(--brand-soft); color: var(--brand-dark); }
.status-pausado, .status-encerrada, .status-aguardando { background: #edf1ef; color: #59665f; }
.status-erro, .status-atrasado { background: var(--danger-soft); color: var(--danger); }
.status-executando, .status-observando { background: #eaf2ff; color: #175cd3; }
.notice, .flash { padding: 13px 15px; border-radius: 11px; border: 1px solid var(--line); background: #f7faf8; color: #405047; }
.notice { margin-bottom: 16px; }
.notice-warning, .flash-warning { background: var(--warning-soft); border-color: #f0d486; color: #755100; }
.flash-error { background: var(--danger-soft); border-color: #f3bbb5; color: var(--danger); }
.flash-success { background: var(--brand-soft); border-color: #b6ddc7; color: var(--brand-dark); }
.flash-stack { display: grid; gap: 8px; margin-bottom: 16px; }
.form-grid { display: grid; grid-template-columns: repeat(2,minmax(0,1fr)); gap: 18px; }
.form-grid.single { grid-template-columns: 1fr; }
.form-grid label, .filter-form label, .vehicle-config label { display: grid; gap: 7px; color: #39483f; font-size: 13px; font-weight: 700; }
.form-grid small, .vehicle-config small, td small { display: block; margin-top: 4px; color: var(--muted); font-weight: 450; }
.span-2 { grid-column: 1 / -1; }
input, select, textarea { width: 100%; min-height: 44px; border: 1px solid #cbd7d0; border-radius: 10px; padding: 10px 12px; background: #fff; color: var(--ink); }
textarea { resize: vertical; }
input:focus, select:focus, textarea:focus { border-color: var(--brand); box-shadow: 0 0 0 3px rgba(20,120,68,.1); outline: 0; }
.input-suffix { display: flex; align-items: center; border: 1px solid #cbd7d0; border-radius: 10px; overflow: hidden; background: #f5f8f6; }
.input-suffix input { border: 0; border-radius: 0; box-shadow: none; }
.input-suffix span { padding: 0 12px; color: var(--muted); font-size: 13px; }
.end { justify-content: flex-end; }
.card-list { display: grid; gap: 14px; }
.client-card.muted, .vehicle-card.muted { opacity: .72; box-shadow: none; }
.facts { display: flex; flex-wrap: wrap; gap: 12px 20px; padding: 13px 0; border-block: 1px solid var(--line); color: var(--muted); font-size: 13px; }
.facts strong { color: var(--ink); }
.small { color: var(--muted); font-size: 12px; }
.vehicle-config { display: grid; grid-template-columns: 1.2fr 1fr 1.3fr 1.4fr auto; gap: 13px; align-items: end; }
.check-label { align-self: center; grid-template-columns: auto 1fr !important; align-items: center; }
.check-label input { width: 18px; min-height: 18px; }
.label-text { display: block; margin-bottom: 7px; color: #39483f; font-size: 13px; font-weight: 700; }
.filter-form { display: flex; align-items: end; gap: 8px; }
.table-wrap { width: 100%; overflow-x: auto; }
table { width: 100%; border-collapse: collapse; font-size: 13px; }
th { padding: 10px 12px; color: var(--muted); font-size: 11px; letter-spacing: .05em; text-transform: uppercase; text-align: left; border-bottom: 1px solid var(--line); }
td { padding: 13px 12px; border-bottom: 1px solid var(--line); vertical-align: top; }
tbody tr:last-child td { border-bottom: 0; }
tbody tr:hover { background: #f8fbf9; }
.empty { padding: 34px; text-align: center; color: var(--muted); }
.error-card { max-width: 680px; margin: 50px auto; }

@media (max-width: 900px) {
  .stats-grid { grid-template-columns: repeat(2,minmax(0,1fr)); }
  .vehicle-config { grid-template-columns: repeat(2,minmax(0,1fr)); }
  .vehicle-config .button { grid-column: 1 / -1; }
}
@media (max-width: 650px) {
  .topbar { align-items: flex-start; }
  .brand-product { max-width: 220px; }
  .user-chip { display: none; }
  .page { width: min(100% - 24px, 1240px); margin-top: 20px; }
  .heading-actions { align-items: stretch; flex-direction: column; }
  .heading-actions > .button, .heading-actions > form .button { width: 100%; }
  .stats-grid, .status-grid, .form-grid, .vehicle-config { grid-template-columns: 1fr; }
  .span-2 { grid-column: auto; }
  .panel, .login-card { padding: 17px; border-radius: 13px; }
  .button-row { align-items: stretch; }
  .button-row > *, .button-row form .button { width: 100%; }
  .filter-form { flex-direction: column; align-items: stretch; }
  .footer { width: calc(100% - 24px); }
}

