:root {
  --jadlog-red: #ba1e34;
  --jadlog-red-dark: #dc0032;
  --jadlog-red-btn: #c8102e;
  --text: #333333;
  --muted: #777777;
  --border: #dcdcdc;
  --panel-bg: #f5f5f5;
  --white: #ffffff;
  --max: 1140px;
}

* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

body {
  font-family: Arial, Helvetica, sans-serif;
  color: var(--text);
  background: var(--white);
  line-height: 1.4;
  min-height: 100vh;
}

a {
  color: var(--text);
  text-decoration: none;
}

a:hover {
  color: var(--jadlog-red);
}

img {
  max-width: 100%;
  vertical-align: middle;
}

.container {
  width: 100%;
  max-width: var(--max);
  margin: 0 auto;
  padding: 0 15px;
}

/* ===== TOP ===== */
.top {
  padding: 18px 0 8px;
  background: var(--white);
}

.top-inner {
  display: flex;
  justify-content: space-between;
  gap: 20px;
  align-items: flex-start;
  flex-wrap: wrap;
}

.brand img {
  width: min(450px, 100%);
  height: auto;
}

.top-tools {
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  gap: 10px;
  flex: 1;
  min-width: 280px;
}

.top-tools > .lang,
.top-tools > .busca,
.top-tools > .sociais {
  display: inline-flex;
}

.top-tools {
  display: grid;
  grid-template-columns: auto 1fr auto;
  grid-template-areas:
    "lang busca sociais"
    "track track track";
  align-items: center;
  gap: 8px 12px;
  max-width: 560px;
}

.lang { grid-area: lang; justify-self: end; }
.busca { grid-area: busca; }
.sociais { grid-area: sociais; justify-self: end; }
.box-rastreiar { grid-area: track; }

.lang-btn {
  background: none;
  border: none;
  font-size: 13px;
  color: #555;
  cursor: pointer;
}

.caret {
  display: inline-block;
  width: 0;
  height: 0;
  margin-left: 4px;
  border-left: 4px solid transparent;
  border-right: 4px solid transparent;
  border-top: 5px solid #666;
  vertical-align: middle;
}

.busca {
  display: flex;
  width: 100%;
  max-width: 220px;
}

.busca input {
  flex: 1;
  height: 30px;
  border: 1px solid #ccc;
  border-right: 0;
  padding: 0 10px;
  font-size: 13px;
  outline: none;
}

.busca button {
  width: 36px;
  height: 30px;
  border: none;
  background: var(--jadlog-red-dark);
  cursor: pointer;
  display: grid;
  place-items: center;
}

.sociais {
  display: flex;
  gap: 4px;
}

.sociais a img {
  width: 30px;
  height: 30px;
  display: block;
}

.box-rastreiar {
  display: flex;
  align-items: center;
  gap: 8px;
  background: var(--jadlog-red);
  color: #fff;
  padding: 8px 10px;
  width: 100%;
  max-width: 515px;
  justify-self: end;
}

.box-label {
  display: flex;
  align-items: center;
  gap: 6px;
  white-space: nowrap;
}

.box-label span {
  font-size: 10.2px;
  font-weight: 700;
  letter-spacing: 0.2px;
}

.icon-rastreie {
  width: 28px;
  height: 28px;
}

.box-rastreiar input {
  flex: 1;
  min-width: 0;
  height: 30px;
  border: none;
  padding: 0 10px;
  font-size: 13px;
  outline: none;
}

.box-rastreiar button {
  background: var(--jadlog-red-dark);
  color: #fff;
  border: none;
  height: 30px;
  padding: 0 14px;
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
  white-space: nowrap;
}

.box-rastreiar button:hover {
  filter: brightness(0.95);
}

/* ===== NAV ===== */
.navbar {
  background: var(--white);
  box-shadow: 0 2px 6px rgba(0, 0, 0, 0.08);
  position: relative;
  z-index: 10;
  margin-bottom: 20px;
}

.navbar .container {
  display: flex;
  align-items: center;
  min-height: 48px;
}

.nav-toggle {
  display: none;
  background: none;
  border: 1px solid #ddd;
  padding: 8px 10px;
  margin: 8px 0;
  cursor: pointer;
}

.nav-toggle span {
  display: block;
  width: 22px;
  height: 2px;
  background: #555;
  margin: 4px 0;
}

.nav-links {
  list-style: none;
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 2px 18px;
  width: 100%;
  padding: 10px 0;
}

.nav-links a {
  font-size: 13px;
  color: #444;
  font-weight: 500;
}

.nav-links a:hover,
.nav-links a.destaque {
  color: var(--jadlog-red);
}

/* ===== MAIN ===== */
.main {
  padding: 10px 15px 40px;
  min-height: 42vh;
}

.panel-rastreamento {
  border: 1px solid #d0d0d0;
  background: var(--white);
}

.panel-title {
  background: linear-gradient(to bottom, #f7f7f7, #ececec);
  border-bottom: 1px solid #d0d0d0;
  padding: 10px 14px;
  font-size: 14px;
  font-weight: 700;
  color: #444;
}

.panel-body {
  padding: 18px 16px 20px;
}

.form-row {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
}

.form-row label {
  font-size: 13px;
  color: #444;
  min-width: 100px;
}

.form-row input {
  width: min(280px, 100%);
  height: 34px;
  border: 1px solid #ccc;
  padding: 0 10px;
  font-size: 13px;
  outline: none;
}

.form-row input:focus {
  border-color: #999;
}

.btn-consultar {
  background: var(--jadlog-red);
  color: #fff;
  border: none;
  height: 34px;
  min-width: 110px;
  padding: 0 18px;
  font-size: 14px;
  font-weight: 600;
  cursor: pointer;
}

.btn-consultar:hover {
  background: #a3192c;
}

.btn-consultar:disabled {
  opacity: 0.7;
  cursor: wait;
}

.mensagem {
  margin-top: 10px;
  font-size: 13px;
  min-height: 1.2em;
}

.mensagem.erro,
.erro-txt {
  color: #c0392b;
}

.resultado {
  margin-top: 24px;
  display: none;
}

.resultado.visivel {
  display: block;
}

.resultado-meta {
  margin-bottom: 12px;
  font-size: 13px;
  color: #444;
}

.table-wrap {
  border: 1px solid #d0d0d0;
  overflow-x: auto;
}

.data-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 12px;
  background: var(--white);
}

.data-table th {
  background: linear-gradient(to bottom, #f3f3f3, #e8e8e8);
  border: 1px solid #d0d0d0;
  padding: 8px 10px;
  text-align: left;
  font-weight: 700;
  color: #444;
  white-space: nowrap;
}

.data-table td {
  border: 1px solid #e2e2e2;
  padding: 8px 10px;
  color: #333;
  vertical-align: top;
}

.data-table tbody tr:nth-child(even) {
  background: #fafafa;
}

.data-table tbody tr:hover {
  background: #fff5f6;
}

.empty-row td {
  text-align: center;
  color: #777;
  padding: 16px 10px;
}

/* ===== FOOTER ===== */
.footer {
  border-top: 1px solid #eee;
  padding: 28px 0 20px;
  margin-top: 30px;
  background: var(--white);
}

.menu-footer {
  display: flex;
  flex-wrap: wrap;
  gap: 10px 18px;
  align-items: center;
  padding-bottom: 18px;
  border-bottom: 1px solid #eee;
  font-size: 13px;
}

.menu-footer a.suporte {
  color: var(--jadlog-red) !important;
  font-weight: 700;
}

.footer-sociais {
  margin-left: auto;
}

.footer-bottom {
  display: flex;
  justify-content: space-between;
  gap: 20px;
  flex-wrap: wrap;
  padding-top: 18px;
  align-items: center;
}

.copy-block {
  display: flex;
  gap: 14px;
  align-items: flex-start;
  font-size: 12px;
  color: #666;
}

.copy-block ul {
  list-style: none;
  display: flex;
  gap: 14px;
  margin-top: 4px;
}

.copy-block a {
  color: #666;
  font-size: 12px;
}

.logo-foot {
  width: 120px;
  height: auto;
}

.partners {
  display: flex;
  align-items: center;
  gap: 10px;
  font-size: 12px;
  color: #666;
  flex-wrap: wrap;
}

.partners img {
  height: 36px;
  width: auto;
}

/* ===== LOADING ===== */
#loading {
  position: fixed;
  inset: 0;
  background: rgba(255, 255, 255, 0.45);
  display: none;
  z-index: 1000;
}

#loading.visivel {
  display: block;
}

#loading.visivel::after {
  content: "";
  position: absolute;
  top: 40%;
  left: 50%;
  width: 36px;
  height: 36px;
  margin: -18px 0 0 -18px;
  border: 3px solid #eee;
  border-top-color: var(--jadlog-red);
  border-radius: 50%;
  animation: spin 0.7s linear infinite;
}

@keyframes spin {
  to { transform: rotate(360deg); }
}

@media (max-width: 900px) {
  .top-tools {
    max-width: 100%;
    width: 100%;
    grid-template-columns: 1fr auto auto;
    grid-template-areas:
      "lang busca sociais"
      "track track track";
  }

  .box-rastreiar {
    max-width: 100%;
    flex-wrap: wrap;
  }

  .nav-toggle { display: block; }

  .nav-links {
    display: none;
    flex-direction: column;
    align-items: flex-start;
    gap: 0;
    padding: 0 0 12px;
  }

  .nav-links.open { display: flex; }

  .nav-links li {
    width: 100%;
    border-top: 1px solid #eee;
  }

  .nav-links a {
    display: block;
    padding: 10px 0;
  }

  .footer-sociais { margin-left: 0; }
}

@media (max-width: 560px) {
  .brand img { width: 260px; }

  .form-row label { width: 100%; }

  .form-row input,
  .btn-consultar { width: 100%; }
}
