<!DOCTYPE html>
<html lang="pt-br">
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>{% block title %}Frota Trucks{% endblock %}</title>
<style>
  :root {
    --surface-1:      #fcfcfb;
    --page-plane:     #f9f9f7;
    --text-primary:   #0b0b0b;
    --text-secondary: #52514e;
    --text-muted:     #898781;
    --gridline:       #e1e0d9;
    --border:         rgba(11,11,11,0.10);
    --status-good:      #0ca30c;
    --status-good-bg:   rgba(12,163,12,0.10);
    --status-good-text: #0a6e0a;
    --status-warning:      #fab219;
    --status-warning-bg:   rgba(250,178,25,0.16);
    --status-warning-text: #8a5a00;
    --status-critical:      #d03b3b;
    --status-critical-bg:   rgba(208,59,59,0.10);
    --status-critical-text: #a02323;
    --status-muted-bg:      rgba(137,135,129,0.14);
    --status-muted-text:    #6b6a65;
    --accent: #2a78d6;
  }
  @media (prefers-color-scheme: dark) {
    :root {
      --surface-1:      #1a1a19;
      --page-plane:     #0d0d0d;
      --text-primary:   #ffffff;
      --text-secondary: #c3c2b7;
      --text-muted:     #898781;
      --gridline:       #2c2c2a;
      --border:         rgba(255,255,255,0.10);
      --status-good:      #199e70;
      --status-good-bg:   rgba(25,158,112,0.18);
      --status-good-text: #4fd39a;
      --status-warning:      #c98500;
      --status-warning-bg:   rgba(201,133,0,0.20);
      --status-warning-text: #eab84d;
      --status-critical:      #e66767;
      --status-critical-bg:   rgba(230,103,103,0.18);
      --status-critical-text: #f3a3a3;
      --status-muted-bg:      rgba(137,135,129,0.18);
      --status-muted-text:    #c3c2b7;
      --accent: #3987e5;
    }
  }
  * { box-sizing: border-box; }
  body {
    margin: 0;
    font-family: system-ui, -apple-system, "Segoe UI", sans-serif;
    background: var(--page-plane);
    color: var(--text-primary);
  }
  header {
    background: var(--surface-1);
    border-bottom: 1px solid var(--border);
    padding: 14px 24px;
    display: flex;
    align-items: center;
    justify-content: space-between;
  }
  header .brand { font-weight: 700; font-size: 1.05rem; }
  header nav a {
    color: var(--text-secondary);
    text-decoration: none;
    margin-left: 18px;
    font-size: 0.9rem;
  }
  header nav a:hover { color: var(--text-primary); }
  main { max-width: 1100px; margin: 0 auto; padding: 24px; }
  .card {
    background: var(--surface-1);
    border: 1px solid var(--border);
    border-radius: 10px;
    padding: 20px;
    overflow-x: auto;
  }
  .muted { color: var(--text-muted); }
  .secondary { color: var(--text-secondary); }
  table { width: 100%; min-width: 640px; border-collapse: collapse; font-size: 0.92rem; }
  th, td { text-align: left; padding: 10px 12px; border-bottom: 1px solid var(--gridline); white-space: nowrap; }
  th { color: var(--text-muted); font-weight: 600; font-size: 0.8rem; text-transform: uppercase; letter-spacing: 0.03em; }
  tbody tr:hover { background: rgba(128,128,128,0.05); }
  .badge {
    display: inline-flex; align-items: center; gap: 6px;
    padding: 4px 10px; border-radius: 999px; font-weight: 600; font-size: 0.82rem;
  }
  .badge .dot { width: 8px; height: 8px; border-radius: 50%; flex-shrink: 0; }
  .badge-ok { background: var(--status-good-bg); color: var(--status-good-text); }
  .badge-ok .dot { background: var(--status-good); }
  .badge-vencendo { background: var(--status-warning-bg); color: var(--status-warning-text); }
  .badge-vencendo .dot { background: var(--status-warning); }
  .badge-vencido { background: var(--status-critical-bg); color: var(--status-critical-text); }
  .badge-vencido .dot { background: var(--status-critical); }
  .badge-sem_registro, .badge-sem_configuracao { background: var(--status-muted-bg); color: var(--status-muted-text); }
  .badge-sem_registro .dot, .badge-sem_configuracao .dot { background: var(--text-muted); }
  input, select, button, textarea {
    font-family: inherit; font-size: 0.95rem;
    padding: 9px 12px; border-radius: 7px; border: 1px solid var(--border);
    background: var(--surface-1); color: var(--text-primary);
  }
  button {
    background: var(--accent); color: white; border: none; cursor: pointer; font-weight: 600;
  }
  button:hover { filter: brightness(1.08); }
  button.secondary-btn { background: transparent; color: var(--text-primary); border: 1px solid var(--border); }
  label { display: block; font-size: 0.85rem; color: var(--text-secondary); margin-bottom: 5px; margin-top: 14px; }
  .form-narrow { max-width: 420px; margin: 60px auto; }
  .error { color: var(--status-critical-text); background: var(--status-critical-bg); padding: 10px 14px; border-radius: 8px; font-size: 0.88rem; margin-top: 14px; }
  .success { color: var(--status-good-text); background: var(--status-good-bg); padding: 10px 14px; border-radius: 8px; font-size: 0.88rem; margin-top: 14px; }
  .machine-code {
    font-family: ui-monospace, monospace; font-size: 1.1rem; letter-spacing: 0.05em;
    background: var(--page-plane); border: 1px dashed var(--border); border-radius: 8px;
    padding: 10px 14px; display: inline-block; margin-top: 6px;
  }
  .link-btn {
    display: inline-flex; align-items: center; gap: 4px;
    padding: 5px 12px; border-radius: 7px; border: 1px solid var(--border);
    color: var(--accent); text-decoration: none; font-size: 0.85rem; font-weight: 600;
    background: transparent; transition: background 0.12s, border-color 0.12s;
  }
  .link-btn:hover { background: var(--status-good-bg); border-color: var(--accent); }
  .link-btn::after { content: "\2192"; font-weight: 400; }
  .back-link {
    display: inline-flex; align-items: center; gap: 6px;
    color: var(--text-secondary); text-decoration: none; font-size: 0.9rem; font-weight: 600;
    padding: 6px 2px; transition: color 0.12s;
  }
  .back-link:hover { color: var(--accent); }
  .filter-card {
    display: block; text-decoration: none; color: inherit;
    cursor: pointer; transition: transform 0.1s, box-shadow 0.1s;
  }
  .filter-card:hover { transform: translateY(-1px); box-shadow: 0 2px 10px rgba(0,0,0,0.06); }
  .filter-card.active { border-color: var(--accent); box-shadow: 0 0 0 1.5px var(--accent) inset; }
</style>
</head>
<body>
{% block body %}{% endblock %}
</body>
</html>
