/* =====================================================================
   TJDFT - Controle de Entrada e Saída de Veículos
   Tema visual: institucional, navy + dourado, cartões com elevação leve.
   ===================================================================== */

:root {
  --navy-900: #0f1f33;
  --navy-800: #16304d;
  --navy-700: #1c3b5e;
  --navy-600: #234a73;
  --gold-600: #b58a2c;
  --gold-500: #c99b3d;
  --gold-100: #f6ecd7;
  --bg: #eef1f5;
  --surface: #ffffff;
  --border: #e2e6ec;
  --text: #1c2530;
  --text-muted: #5b6675;
  --text-faint: #8994a3;
  --success: #1c7a4d;
  --success-bg: #e7f5ee;
  --danger: #b3261e;
  --danger-bg: #fbebea;
  --radius: 12px;
  --radius-sm: 8px;
  --shadow-sm: 0 1px 3px rgba(15, 31, 51, 0.08);
  --shadow-md: 0 8px 24px rgba(15, 31, 51, 0.10);
  --shadow-lg: 0 20px 50px rgba(15, 31, 51, 0.20);
}

* { box-sizing: border-box; }

body {
  margin: 0;
  font-family: "Inter", "Segoe UI", Arial, sans-serif;
  background: var(--bg);
  color: var(--text);
  -webkit-font-smoothing: antialiased;
}

.oculto { display: none !important; }

/* ---------- LOGIN ---------- */
.tela-login {
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 24px;
  background:
    radial-gradient(circle at 15% 15%, rgba(197, 155, 61, 0.18), transparent 40%),
    linear-gradient(160deg, var(--navy-900), var(--navy-700) 60%, var(--navy-600));
}
.login-wrap {
  display: flex;
  flex-direction: column;
  align-items: center;
  width: 420px;
  max-width: 100%;
}
.login-card {
  background: var(--surface);
  padding: 36px 40px 32px;
  border-radius: var(--radius);
  width: 100%;
  max-width: 100%;
  box-shadow: var(--shadow-lg);
  text-align: center;
}
.login-logo {
  width: 220px;
  height: auto;
  margin-bottom: 8px;
  filter: drop-shadow(0 10px 22px rgba(0,0,0,.45));
}
.login-card h1 {
  margin: 0 0 6px;
  color: var(--navy-800);
  font-size: 26px;
  font-weight: 800;
  letter-spacing: 0.5px;
}
.login-card h2 {
  font-size: 13.5px;
  font-weight: 500;
  color: var(--text-muted);
  margin: 0 0 28px;
  line-height: 1.5;
}
.login-card h2 small { color: var(--text-faint); }
.login-card form { display: flex; flex-direction: column; gap: 4px; text-align: left; }
.login-card label {
  font-size: 12px;
  font-weight: 600;
  color: var(--text-muted);
  margin: 10px 0 6px;
  text-transform: uppercase;
  letter-spacing: 0.4px;
}
.login-card input {
  padding: 11px 13px;
  border: 1.5px solid var(--border);
  border-radius: var(--radius-sm);
  font-size: 14.5px;
  font-family: inherit;
  transition: border-color .15s, box-shadow .15s;
}
.login-card input:focus {
  outline: none;
  border-color: var(--navy-600);
  box-shadow: 0 0 0 3px rgba(35, 74, 115, 0.15);
}
.login-card button {
  margin-top: 20px;
  padding: 12px;
  border: none;
  border-radius: var(--radius-sm);
  background: var(--navy-800);
  color: #fff;
  font-weight: 700;
  font-size: 14.5px;
  cursor: pointer;
  transition: background .15s, transform .05s;
  letter-spacing: 0.3px;
}
.login-card button:hover { background: var(--navy-700); }
.login-card button:active { transform: translateY(1px); }

.erro { color: var(--danger); font-size: 13px; min-height: 18px; margin: 10px 0 0; }
.link-secundario {
  font-size: 13px; color: var(--navy-700); text-align: center;
  text-decoration: none; margin-top: 14px; font-weight: 600;
}
.link-secundario:hover { text-decoration: underline; }

/* ---------- TOPO / NAV ---------- */
.topo {
  background: var(--navy-900);
  color: #fff;
  padding: 14px 28px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
  gap: 12px;
  border-bottom: 3px solid var(--gold-600);
}
.topo-marca { display: flex; align-items: center; gap: 16px; }
.topo-logo { height: 64px; width: auto; filter: drop-shadow(0 3px 6px rgba(0,0,0,.35)); }
.topo-titulo { font-size: 15px; line-height: 1.35; }
.topo-titulo strong { font-weight: 800; letter-spacing: 0.5px; }
.topo-sub { font-size: 12px; opacity: .75; }
.topo-usuario { display: flex; align-items: center; gap: 12px; }
#usuario-nome { font-size: 13.5px; font-weight: 600; opacity: .95; }
.badge {
  background: var(--gold-600);
  color: #24190a;
  padding: 3px 10px;
  border-radius: 20px;
  font-size: 10.5px;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}
#btn-sair {
  background: transparent;
  border: 1.5px solid rgba(255,255,255,.4);
  color: #fff;
  padding: 7px 16px;
  border-radius: 20px;
  cursor: pointer;
  font-size: 13px;
  font-weight: 600;
  transition: background .15s, border-color .15s;
}
#btn-sair:hover { background: rgba(255,255,255,.12); border-color: rgba(255,255,255,.7); }

.abas {
  display: flex;
  background: var(--surface);
  border-bottom: 1px solid var(--border);
  padding: 0 28px;
  gap: 4px;
  box-shadow: var(--shadow-sm);
}
.aba-btn {
  padding: 14px 20px;
  border: none;
  background: none;
  cursor: pointer;
  font-size: 14px;
  font-weight: 600;
  color: var(--text-muted);
  border-bottom: 3px solid transparent;
  transition: color .15s, border-color .15s;
}
.aba-btn:hover { color: var(--navy-700); }
.aba-btn.ativa { color: var(--navy-800); border-bottom-color: var(--gold-600); }
.aba-conteudo { display: none; padding: 28px; max-width: 1400px; margin: 0 auto; }
.aba-conteudo.ativa { display: block; }

/* ---------- FORM / CARTÃO ---------- */
.cartao {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 28px;
  max-width: 920px;
  box-shadow: var(--shadow-sm);
}
.linha { display: flex; gap: 18px; margin-bottom: 18px; flex-wrap: wrap; }
.campo { display: flex; flex-direction: column; flex: 1; min-width: 160px; }
.campo-largo { flex: 2; }
.campo label {
  font-size: 11.5px;
  color: var(--text-muted);
  margin-bottom: 6px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.4px;
}
.campo input, .campo select {
  padding: 10px 12px;
  border: 1.5px solid var(--border);
  border-radius: var(--radius-sm);
  font-size: 14px;
  font-family: inherit;
  background: var(--surface);
  transition: border-color .15s, box-shadow .15s;
}
.campo input:focus, .campo select:focus {
  outline: none;
  border-color: var(--navy-600);
  box-shadow: 0 0 0 3px rgba(35, 74, 115, 0.12);
}
.campo input:disabled { background: #f3f5f8; color: var(--text-faint); }

.tipo-caixinhas { display: flex; gap: 10px; padding-top: 2px; }
.caixinha {
  display: flex; align-items: center; gap: 7px; font-size: 13.5px; font-weight: 600;
  cursor: pointer; padding: 9px 16px; border-radius: 20px; border: 1.5px solid var(--border);
  transition: background .15s, border-color .15s, color .15s;
  user-select: none;
}
.caixinha:has(input:checked) {
  background: var(--navy-800); border-color: var(--navy-800); color: #fff;
}
.caixinha input { accent-color: var(--gold-600); }

.status { min-height: 20px; font-size: 13px; font-weight: 600; margin: 4px 0 16px; }
.status.ok { color: var(--success); }
.status.erro { color: var(--danger); }
.status.aviso { color: var(--gold-600); }

.btn-enviar {
  background: var(--navy-800); color: #fff; border: none; padding: 12px 30px;
  border-radius: var(--radius-sm); font-weight: 700; cursor: pointer; font-size: 14.5px;
  letter-spacing: 0.3px; transition: background .15s, transform .05s; box-shadow: var(--shadow-sm);
}
.btn-enviar:hover { background: var(--navy-700); }
.btn-enviar:active { transform: translateY(1px); }
.btn-secundario {
  background: #eef1f5; color: var(--text); border: none; padding: 10px 18px;
  border-radius: var(--radius-sm); cursor: pointer; font-weight: 600; font-size: 13.5px;
  transition: background .15s;
}
.btn-secundario:hover { background: #e2e6ec; }

.titulo-tabela {
  margin: 36px 0 14px; font-size: 15px; font-weight: 700; color: var(--navy-800);
  text-transform: uppercase; letter-spacing: 0.5px;
}

/* ---------- TABELAS ---------- */
.tabela-scroll {
  overflow-x: auto; max-width: 100%; background: var(--surface);
  border-radius: var(--radius); border: 1px solid var(--border); box-shadow: var(--shadow-sm);
}
table { border-collapse: collapse; width: 100%; font-size: 13px; }
th, td { padding: 11px 14px; text-align: left; white-space: nowrap; }
th {
  background: #f5f7fa; color: var(--navy-800); font-weight: 700; font-size: 11.5px;
  text-transform: uppercase; letter-spacing: 0.4px; border-bottom: 2px solid var(--border);
  position: sticky; top: 0;
}
td { border-bottom: 1px solid var(--border); color: var(--text); }
tbody tr:hover { background: #f7f9fb; }
tbody tr:last-child td { border-bottom: none; }
td button {
  border: none; background: var(--gold-100); color: var(--navy-800); font-size: 12.5px;
  font-weight: 700; margin-right: 6px; padding: 5px 12px; border-radius: 16px; cursor: pointer;
  transition: background .15s;
}
td button:hover { background: #eeddb4; }

/* Coluna de ações fixa na esquerda: continua visível ao rolar a tabela
   pros lados, e sempre é a primeira coluna (não precisa rolar até o fim). */
th:first-child, td:first-child {
  position: sticky;
  left: 0;
  z-index: 3;
  background: var(--surface);
  box-shadow: 2px 0 5px rgba(15, 31, 51, 0.06);
  white-space: nowrap;
}
th:first-child { background: #f5f7fa; z-index: 4; }
tbody tr:hover td:first-child { background: #f7f9fb; }

/* ---------- FILTROS ---------- */
.filtros {
  display: flex; gap: 16px; flex-wrap: wrap; align-items: flex-end;
  background: var(--surface); padding: 20px; border-radius: var(--radius); margin-bottom: 20px;
  border: 1px solid var(--border); box-shadow: var(--shadow-sm);
}
.filtros .campo { min-width: 140px; }
.filtros .campo label {
  font-size: 11px; color: var(--text-muted); margin-bottom: 6px; font-weight: 700;
  text-transform: uppercase; letter-spacing: 0.4px;
}
.filtros input, .filtros select {
  padding: 9px 11px; border: 1.5px solid var(--border); border-radius: var(--radius-sm);
  font-size: 13.5px; font-family: inherit;
}
.filtros button {
  padding: 10px 22px; border-radius: var(--radius-sm); border: none;
  background: var(--navy-800); color: #fff; cursor: pointer; height: 40px; font-weight: 700;
  font-size: 13.5px; transition: background .15s;
}
.filtros button:hover { background: var(--navy-700); }
.filtros button.btn-secundario { background: #eef1f5; color: var(--text); }
.filtros button.btn-secundario:hover { background: #e2e6ec; }

/* ---------- CADASTRO ---------- */
.cadastro-topo { display: flex; justify-content: space-between; margin-bottom: 18px; gap: 12px; flex-wrap: wrap; }
.cadastro-topo input {
  flex: 1; max-width: 420px; padding: 10px 14px; border: 1.5px solid var(--border);
  border-radius: 20px; font-size: 13.5px; font-family: inherit;
}
.cadastro-topo input:focus { outline: none; border-color: var(--navy-600); }
#btn-novo-cadastro {
  background: var(--navy-800); color: #fff; border: none; padding: 10px 22px;
  border-radius: var(--radius-sm); cursor: pointer; font-weight: 700; font-size: 13.5px;
  transition: background .15s;
}
#btn-novo-cadastro:hover { background: var(--navy-700); }

/* ---------- MODAL ---------- */
.modal {
  position: fixed; inset: 0; background: rgba(15, 31, 51, .55); backdrop-filter: blur(2px);
  display: flex; align-items: center; justify-content: center; z-index: 50; padding: 20px;
}
.modal-caixa {
  background: var(--surface); padding: 28px; border-radius: var(--radius); width: 480px; max-width: 100%;
  max-height: 88vh; overflow-y: auto; box-shadow: var(--shadow-lg);
}
.modal-caixa h3 { margin: 0 0 18px; color: var(--navy-800); font-size: 17px; font-weight: 800; }
.modal-acoes { display: flex; gap: 10px; margin-top: 18px; }
.modal-acoes button[type="submit"] {
  background: var(--navy-800); color: #fff; border: none; padding: 10px 22px;
  border-radius: var(--radius-sm); cursor: pointer; font-weight: 700; font-size: 13.5px;
}
.modal-acoes button[type="submit"]:hover { background: var(--navy-700); }
.opcao-veiculo {
  border: 1.5px solid var(--border); border-radius: var(--radius-sm); padding: 12px 14px; margin-bottom: 8px;
  cursor: pointer; display: flex; justify-content: space-between; align-items: center;
  font-size: 13.5px; transition: background .15s, border-color .15s;
}
.opcao-veiculo:hover { background: var(--gold-100); border-color: var(--gold-500); }

@media (max-width: 640px) {
  .topo { flex-direction: column; align-items: flex-start; gap: 10px; padding: 14px 18px; }
  .abas { padding: 0 12px; overflow-x: auto; }
  .aba-conteudo { padding: 16px; }
  .linha { flex-direction: column; }
  .cartao { padding: 20px; }
}
