/* ============================================================
   AUTO PADRÃO SPA - UI mobile-first
   Identidade: MIV oficial (Montserrat, #226C79 / #131D32 / #EDEDED)
   ============================================================ */

:root {
  --cor-primaria: #226c79;
  --cor-primaria-escura: #1a545e;
  --cor-escura: #131d32;
  --cor-clara: #ededed;
  --branco: #ffffff;
  --texto: #1f2a3d;
  --texto-suave: #5b6779;
  --borda: #d5d9e0;

  /* Status (SPEC seção 20) */
  --st-entrou: #2563eb;
  --st-pronto: #ea8a00;
  --st-ok: #16a34a;
  --st-cancelado: #dc2626;
  --st-pendente: #6b7280;

  --radius: 10px;
  --shadow: 0 2px 8px rgba(19, 29, 50, 0.08);
}

* { box-sizing: border-box; }

html, body {
  margin: 0;
  padding: 0;
  font-family: 'Montserrat', -apple-system, sans-serif;
  background: var(--cor-clara);
  color: var(--texto);
  font-size: 16px;
  -webkit-font-smoothing: antialiased;
}

/* ── Topbar ─────────────────────────────────────────────── */
.topbar {
  background: var(--cor-escura);
  color: var(--branco);
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0.7rem 1rem;
  position: sticky;
  top: 0;
  z-index: 50;
}
.topbar .brand { font-weight: 800; letter-spacing: 0.02em; font-size: 1.05rem; display: flex; align-items: center; }
.topbar .brand span { color: var(--cor-primaria); }
.topbar .brand-logo { height: 38px; width: auto; display: block; }
.topbar .who { font-size: 0.8rem; opacity: 0.85; text-align: right; }
.topbar select {
  background: rgba(255,255,255,0.1);
  color: var(--branco);
  border: 1px solid rgba(255,255,255,0.25);
  border-radius: 6px;
  padding: 0.3rem 0.5rem;
  font-family: inherit;
  font-size: 0.85rem;
}

/* ── Navegação ──────────────────────────────────────────── */
.nav {
  background: var(--cor-escura);
  display: flex;
  gap: 0.25rem;
  overflow-x: auto;
  padding: 0 0.5rem 0.6rem;
  -webkit-overflow-scrolling: touch;
}
.nav a {
  color: rgba(255,255,255,0.75);
  text-decoration: none;
  font-size: 0.85rem;
  font-weight: 600;
  padding: 0.45rem 0.8rem;
  border-radius: 999px;
  white-space: nowrap;
}
.nav a.ativo, .nav a:hover { background: var(--cor-primaria); color: var(--branco); }

/* ── Layout ─────────────────────────────────────────────── */
.container { max-width: 1100px; margin: 0 auto; padding: 1rem; }
.page-title { font-size: 1.3rem; font-weight: 800; margin: 0.5rem 0 1rem; color: var(--cor-escura); }

.card {
  background: var(--branco);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  padding: 1.1rem;
  margin-bottom: 1rem;
}
.card h2 { margin: 0 0 0.8rem; font-size: 1.05rem; color: var(--cor-escura); }

.grid { display: grid; gap: 1rem; }
@media (min-width: 720px) {
  .grid-2 { grid-template-columns: 1fr 1fr; }
  .grid-3 { grid-template-columns: repeat(3, 1fr); }
  .grid-4 { grid-template-columns: repeat(4, 1fr); }
}

/* ── Botões (grandes, dedo na pia) ──────────────────────── */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.4rem;
  min-height: 48px;
  padding: 0.6rem 1.3rem;
  border: none;
  border-radius: var(--radius);
  font-family: inherit;
  font-size: 1rem;
  font-weight: 700;
  cursor: pointer;
  text-decoration: none;
  transition: filter 0.15s ease;
}
.btn:active { filter: brightness(0.9); }
.btn-primario { background: var(--cor-primaria); color: var(--branco); }
.btn-escuro { background: var(--cor-escura); color: var(--branco); }
.btn-claro { background: var(--branco); color: var(--cor-escura); border: 1.5px solid var(--borda); }
.btn-perigo { background: var(--st-cancelado); color: var(--branco); }
.btn-bloco { width: 100%; }
.btn[disabled] { opacity: 0.5; cursor: not-allowed; }

/* ── Formulários ────────────────────────────────────────── */
label { display: block; font-size: 0.82rem; font-weight: 700; color: var(--texto-suave); margin: 0.7rem 0 0.25rem; }
input[type="text"], input[type="password"], input[type="number"], input[type="date"],
input[type="email"], input[type="tel"], select, textarea {
  width: 100%;
  min-height: 48px;
  padding: 0.6rem 0.8rem;
  border: 1.5px solid var(--borda);
  border-radius: var(--radius);
  font-family: inherit;
  font-size: 1rem;
  background: var(--branco);
  color: var(--texto);
}
input:focus, select:focus, textarea:focus {
  outline: none;
  border-color: var(--cor-primaria);
  box-shadow: 0 0 0 3px rgba(34, 108, 121, 0.15);
}
textarea { min-height: 90px; resize: vertical; }
.campo-erro { color: var(--st-cancelado); font-size: 0.8rem; margin-top: 0.2rem; }

/* ── Tabelas ────────────────────────────────────────────── */
.tabela-wrap { overflow-x: auto; }
table { width: 100%; border-collapse: collapse; font-size: 0.9rem; }
th { text-align: left; font-size: 0.75rem; text-transform: uppercase; letter-spacing: 0.04em; color: var(--texto-suave); padding: 0.5rem 0.6rem; border-bottom: 2px solid var(--borda); }
td { padding: 0.65rem 0.6rem; border-bottom: 1px solid var(--cor-clara); }
tr:hover td { background: #f6f8f9; }

/* ── Badges de status ───────────────────────────────────── */
.badge {
  display: inline-block;
  padding: 0.25rem 0.7rem;
  border-radius: 999px;
  font-size: 0.75rem;
  font-weight: 700;
  color: var(--branco);
}
.badge-entrou { background: var(--st-entrou); }
.badge-pronto { background: var(--st-pronto); }
.badge-ok { background: var(--st-ok); }
.badge-cancelado { background: var(--st-cancelado); }
.badge-pendente { background: var(--st-pendente); }
.badge-inativo { background: var(--texto-suave); }
.badge-ativo { background: var(--st-ok); }

/* ── Alertas / flash ────────────────────────────────────── */
.alerta { padding: 0.8rem 1rem; border-radius: var(--radius); font-size: 0.9rem; margin-bottom: 1rem; font-weight: 600; }
.alerta-erro { background: #fde8e8; color: #9b1c1c; }
.alerta-ok { background: #e6f6ec; color: #14652f; }
.alerta-info { background: #e8f1f3; color: var(--cor-primaria-escura); }

/* ── Texto auxiliar ─────────────────────────────────────── */
.texto-suave { color: var(--texto-suave); font-size: 0.85rem; }

/* ── Estado vazio ───────────────────────────────────────── */
.vazio { text-align: center; padding: 2.5rem 1rem; color: var(--texto-suave); }
.vazio strong { display: block; font-size: 1.05rem; color: var(--texto); margin-bottom: 0.4rem; }

/* ── Login ──────────────────────────────────────────────── */
.login-wrap {
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  background: var(--cor-escura);
  padding: 1rem;
}
.login-card {
  background: var(--branco);
  border-radius: 16px;
  padding: 2rem 1.6rem;
  width: 100%;
  max-width: 380px;
  box-shadow: 0 10px 40px rgba(0,0,0,0.35);
}
.login-card .brand { text-align: center; font-weight: 800; font-size: 1.4rem; color: var(--cor-escura); margin-bottom: 0.2rem; }
.login-card .brand span { color: var(--cor-primaria); }
.login-card .sub { text-align: center; color: var(--texto-suave); font-size: 0.85rem; margin-bottom: 1.4rem; }

/* ── Modal simples ──────────────────────────────────────── */
.modal-bg { position: fixed; inset: 0; background: rgba(19,29,50,0.6); display: flex; align-items: center; justify-content: center; z-index: 100; padding: 1rem; }
.modal { background: var(--branco); border-radius: var(--radius); padding: 1.3rem; width: 100%; max-width: 480px; max-height: 90vh; overflow-y: auto; }
.modal h3 { margin: 0 0 1rem; color: var(--cor-escura); }

/* ── Utilitários ────────────────────────────────────────── */
.mt-1 { margin-top: 1rem; }
.direita { text-align: right; }
.suave { color: var(--texto-suave); font-size: 0.85rem; }
.linha-acoes { display: flex; gap: 0.6rem; flex-wrap: wrap; margin-top: 1rem; }
