* { box-sizing: border-box; }

body {
  margin: 0;
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  font-family: -apple-system, "Segoe UI", Helvetica, Arial, sans-serif;
  background: #f7f7f5;
  color: #141413;
}

.card {
  width: 360px;
  background: #ffffff;
  border-radius: 8px;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.08);
  padding: 40px 32px;
  display: flex;
  flex-direction: column;
  gap: 22px;
}

.card--wide {
  width: 640px;
}

.card--xwide {
  width: 960px;
  max-width: calc(100vw - 32px);
}

.table-scroll {
  overflow-x: auto;
}

/* nomes de arquivo de CT-e são longos: quebram em vez de alargar a tabela */
.table-scroll td:first-child {
  max-width: 220px;
  font-size: 12px;
  word-break: break-all;
}

input[type="file"] {
  font-size: 13px;
}

h1 {
  margin: 0;
  font-size: 22px;
  font-weight: 700;
  letter-spacing: -0.01em;
}

.subtitle {
  margin: 0;
  font-size: 13px;
  line-height: 1.5;
  color: #6b6b68;
}

.field {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.field-row {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
}

label {
  font-size: 13px;
  font-weight: 600;
}

.hint {
  font-size: 12px;
  color: #8a8a86;
}

input[type="text"],
input[type="email"],
input[type="password"],
input[type="date"] {
  width: 100%;
  padding: 10px 12px;
  font-size: 14px;
  border: 1px solid #d9d9d6;
  border-radius: 6px;
  color: #141413;
  background: #ffffff;
}

input:focus {
  outline: none;
  border-color: #1b1b1b;
}

.btn {
  width: 100%;
  padding: 12px;
  font-size: 14px;
  font-weight: 600;
  color: #ffffff;
  background: #1e5b3a;
  border: none;
  border-radius: 6px;
  cursor: pointer;
}

.btn:disabled {
  opacity: 0.6;
  cursor: not-allowed;
}

.btn-small {
  width: auto;
  margin-top: 6px;
  padding: 4px 10px;
  font-size: 12px;
}

.btn-secondary {
  background: #ffffff;
  color: #1e5b3a;
  border: 1px solid #1e5b3a;
}

.link {
  font-size: 13px;
  color: #1e5b3a;
  text-decoration: none;
}

.link:hover {
  text-decoration: underline;
}

.footer {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 4px;
  padding-top: 8px;
  border-top: 1px solid #edede9;
  text-align: center;
}

.footer-caption {
  font-size: 12px;
  color: #8a8a86;
}

.error {
  font-size: 13px;
  color: #b3261e;
  margin: 0;
}

.success {
  font-size: 13px;
  color: #1e5b3a;
  margin: 0;
}

table {
  width: 100%;
  border-collapse: collapse;
  font-size: 13px;
}

th, td {
  text-align: left;
  padding: 8px 10px;
  border-bottom: 1px solid #edede9;
}

th {
  color: #6b6b68;
  font-weight: 600;
}

.badge {
  display: inline-block;
  padding: 2px 8px;
  border-radius: 999px;
  font-size: 11px;
  font-weight: 600;
}

.badge-pending { background: #fff4e5; color: #8a5a00; }
.badge-active { background: #e6f4ea; color: #1e5b3a; }
.badge-rejected { background: #fdecea; color: #b3261e; }

.row-actions { display: flex; gap: 8px; }

.row-actions button {
  padding: 4px 10px;
  font-size: 12px;
  border-radius: 4px;
  border: 1px solid #d9d9d6;
  background: #ffffff;
  cursor: pointer;
}

.topbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
}

/* Barra de navegação (nav.js) */
body.has-nav {
  padding-top: 72px;
  padding-bottom: 24px;
}

.navbar {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  z-index: 10;
  display: flex;
  align-items: center;
  gap: 24px;
  height: 52px;
  padding: 0 24px;
  background: #1e5b3a;
  color: #ffffff;
  font-size: 14px;
}

.navbar-brand {
  font-weight: 700;
  letter-spacing: 0.02em;
}

.navbar-links {
  display: flex;
  gap: 4px;
  flex: 1;
}

.navbar-links a {
  padding: 6px 12px;
  color: #ffffff;
  text-decoration: none;
  border-radius: 6px;
  opacity: 0.85;
}

.navbar-links a:hover {
  background: rgba(255, 255, 255, 0.14);
  opacity: 1;
}

.navbar-links a[aria-current="page"] {
  background: rgba(255, 255, 255, 0.22);
  opacity: 1;
  font-weight: 600;
}

.navbar-user {
  display: flex;
  align-items: center;
  gap: 12px;
}

.navbar-user button {
  padding: 5px 12px;
  font: inherit;
  color: #ffffff;
  background: transparent;
  border: 1px solid rgba(255, 255, 255, 0.6);
  border-radius: 6px;
  cursor: pointer;
}

.navbar-user button:hover {
  background: rgba(255, 255, 255, 0.14);
}

@media (max-width: 600px) {
  .navbar { gap: 8px; padding: 0 12px; }
  .navbar-brand, .navbar-user span { display: none; }
}
