/* ── Navbar ──────────────────────────────────────────────────────────────────── */
.navbar {
  height: var(--nav-h);
  background: var(--surface);
  border-bottom: 1px solid var(--border);
  position: sticky; top: 0; z-index: 100;
  box-shadow: var(--shadow-sm);
}
.navbar .container {
  height: 100%;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--sp-4);
}
.nav-brand {
  display: flex; align-items: center; gap: var(--sp-2);
  font-size: 1.2rem; font-weight: 800;
  color: var(--primary);
  text-decoration: none;
  white-space: nowrap;
  flex-shrink: 0;
}
.nav-brand-icon { font-size: 1.4rem; }

/* Compact search bar in navbar (non-home pages) */
.nav-search { flex: 1; max-width: 480px; }
.nav-search-form {
  display: flex;
  border: 1.5px solid var(--border);
  border-radius: var(--r-full);
  overflow: hidden;
  background: var(--surface-2);
  transition: border-color .2s;
}
.nav-search-form:focus-within { border-color: var(--primary); }
.nav-search-select {
  border: none; background: transparent;
  padding: var(--sp-2) var(--sp-3);
  font-size: 0.8rem; color: var(--text-muted);
  cursor: pointer; outline: none;
  border-right: 1px solid var(--border);
  min-width: 110px;
}
.nav-search-input {
  flex: 1; border: none; background: transparent;
  padding: var(--sp-2) var(--sp-3);
  font-size: 0.875rem; outline: none;
}
.nav-search-btn {
  border: none; background: var(--primary);
  color: #fff; padding: 0 var(--sp-4);
  cursor: pointer; font-size: 0.875rem;
  transition: background .2s;
}
.nav-search-btn:hover { background: var(--primary-dark); }

.nav-actions { display: flex; align-items: center; gap: var(--sp-2); flex-shrink: 0; }

/* ── Buttons ─────────────────────────────────────────────────────────────────── */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: var(--sp-2);
  padding: 9px var(--sp-4);
  border-radius: var(--r-sm);
  font-size: 0.875rem; font-weight: 600;
  cursor: pointer; border: none;
  text-decoration: none;
  transition: background .2s, color .2s, box-shadow .2s;
  white-space: nowrap;
  line-height: 1;
}
.btn-primary {
  background: var(--primary);
  color: #fff;
}
.btn-primary:hover { background: var(--primary-dark); text-decoration: none; color: #fff; }
.btn-ghost {
  background: transparent;
  color: var(--text);
  border: 1.5px solid var(--border);
}
.btn-ghost:hover { background: var(--bg); text-decoration: none; }
.btn-sm { padding: 6px var(--sp-3); font-size: 0.8rem; }
.btn-lg { padding: 13px var(--sp-6); font-size: 1rem; }
.btn-full { width: 100%; }
.btn:disabled { opacity: .55; cursor: not-allowed; }

/* ── Form inputs ─────────────────────────────────────────────────────────────── */
.form-group { margin-bottom: var(--sp-4); }
.form-label {
  display: block;
  font-size: 0.875rem; font-weight: 600;
  margin-bottom: var(--sp-2);
  color: var(--text);
}
.form-input, .form-select {
  width: 100%;
  padding: 10px var(--sp-3);
  border: 1.5px solid var(--border);
  border-radius: var(--r-sm);
  background: var(--surface);
  color: var(--text);
  font-size: 0.9rem;
  transition: border-color .2s, box-shadow .2s;
  outline: none;
}
.form-input:focus, .form-select:focus {
  border-color: var(--primary);
  box-shadow: 0 0 0 3px rgba(26,86,219,.12);
}
.form-input::placeholder { color: var(--text-light); }
.form-error {
  font-size: 0.8rem; color: var(--red);
  margin-top: var(--sp-1);
  display: none;
}
.form-error.show { display: block; }

/* ── Cards ───────────────────────────────────────────────────────────────────── */
.card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--r-lg);
  box-shadow: var(--shadow-sm);
  padding: var(--sp-6);
}
.card-sm { padding: var(--sp-4); border-radius: var(--r-md); }

/* Carrier result card */
.carrier-card {
  background: var(--surface);
  border: 1.5px solid var(--border);
  border-radius: var(--r-lg);
  padding: var(--sp-5);
  cursor: pointer;
  transition: border-color .2s, box-shadow .2s, transform .15s;
  display: flex; flex-direction: column; gap: var(--sp-3);
}
.carrier-card:hover {
  border-color: var(--primary);
  box-shadow: var(--shadow-md);
  transform: translateY(-2px);
}
.carrier-card-header {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: var(--sp-3);
}
.carrier-card-title {
  font-size: 1rem; font-weight: 700;
  color: var(--text);
  line-height: 1.3;
}
.carrier-card-dba {
  font-size: 0.8rem; color: var(--text-muted);
  margin-top: 2px;
}
.carrier-card-meta {
  display: flex; flex-wrap: wrap; gap: var(--sp-2) var(--sp-5);
}
.meta-item {
  font-size: 0.8rem; color: var(--text-muted);
}
.meta-item strong { color: var(--text); font-weight: 600; }
.carrier-card-footer {
  display: flex; align-items: center; justify-content: space-between;
  padding-top: var(--sp-2);
  border-top: 1px solid var(--border);
}
.card-link {
  font-size: 0.8rem; font-weight: 600;
  color: var(--primary);
}

/* ── Badges ──────────────────────────────────────────────────────────────────── */
.badge {
  display: inline-flex; align-items: center;
  padding: 3px 10px;
  border-radius: var(--r-full);
  font-size: 0.75rem; font-weight: 700;
  white-space: nowrap;
  flex-shrink: 0;
}
.badge-satisfactory  { color: var(--badge-sat);  background: var(--badge-sat-bg); }
.badge-conditional   { color: var(--badge-cond); background: var(--badge-cond-bg); }
.badge-unsatisfactory{ color: var(--badge-unsat);background: var(--badge-unsat-bg); }
.badge-not-rated     { color: var(--badge-nr);   background: var(--badge-nr-bg); }
.badge-active        { color: var(--green); background: #dcfce7; }
.badge-inactive      { color: var(--red);   background: #fee2e2; }
.badge-pending       { color: var(--amber); background: #fef9c3; }

/* Status dot (inline) */
.status-dot::before {
  content: '';
  display: inline-block;
  width: 8px; height: 8px;
  border-radius: 50%;
  margin-right: 5px;
  vertical-align: middle;
}
.status-dot-active::before   { background: var(--green); }
.status-dot-inactive::before { background: var(--red); }

/* Authority pill */
.auth-pill {
  display: inline-flex; align-items: center; gap: 6px;
  padding: 5px var(--sp-3);
  border-radius: var(--r-full);
  font-size: 0.8rem; font-weight: 600;
  border: 1.5px solid;
}
.auth-pill-active   { color: var(--green); border-color: var(--green); background: #dcfce7; }
.auth-pill-inactive { color: var(--text-muted); border-color: var(--border); background: var(--bg); }

/* ── Section panels (carrier detail) ────────────────────────────────────────── */
.detail-section {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--r-lg);
  overflow: hidden;
  margin-bottom: var(--sp-5);
}
.detail-section-header {
  padding: var(--sp-4) var(--sp-5);
  border-bottom: 1px solid var(--border);
  background: var(--surface-2);
  display: flex; align-items: center; gap: var(--sp-3);
}
.detail-section-icon { font-size: 1.2rem; }
.detail-section-title { font-size: 1rem; font-weight: 700; color: var(--text); }
.detail-section-body { padding: var(--sp-5); }
.detail-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
  gap: var(--sp-4) var(--sp-6);
}
.detail-field {}
.detail-field-label {
  font-size: 0.75rem; font-weight: 600;
  text-transform: uppercase; letter-spacing: .05em;
  color: var(--text-muted);
  margin-bottom: var(--sp-1);
}
.detail-field-value {
  font-size: 0.95rem; font-weight: 600; color: var(--text);
}
.detail-field-value.large { font-size: 1.5rem; font-weight: 800; }

/* ── Cargo chips ─────────────────────────────────────────────────────────────── */
.chip-list { display: flex; flex-wrap: wrap; gap: var(--sp-2); }
.chip {
  background: var(--primary-light);
  color: var(--primary-dark);
  padding: 3px 10px;
  border-radius: var(--r-full);
  font-size: 0.78rem; font-weight: 600;
}

/* ── Page header banner ──────────────────────────────────────────────────────── */
.page-header {
  background: var(--surface);
  border-bottom: 1px solid var(--border);
  padding: var(--sp-6) 0;
  margin-bottom: var(--sp-6);
}
.page-header h1 { font-size: 1.6rem; }
.page-header p  { margin-top: var(--sp-1); }

/* ── Auth card ───────────────────────────────────────────────────────────────── */
.auth-wrapper {
  min-height: calc(100vh - var(--nav-h));
  display: flex; align-items: center; justify-content: center;
  padding: var(--sp-8) var(--sp-4);
}
.auth-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--r-xl);
  padding: var(--sp-8) var(--sp-8);
  width: 100%; max-width: 420px;
  box-shadow: var(--shadow-md);
}
.auth-card h1 { font-size: 1.5rem; text-align: center; margin-bottom: var(--sp-1); }
.auth-card .auth-sub { text-align: center; margin-bottom: var(--sp-6); }
.auth-divider { text-align: center; color: var(--text-muted); font-size: 0.8rem; margin: var(--sp-4) 0; }
.auth-footer { text-align: center; font-size: 0.875rem; margin-top: var(--sp-4); }

/* ── Responsive ──────────────────────────────────────────────────────────────── */
@media (max-width: 768px) {
  .nav-search { display: none; }
  .auth-card  { padding: var(--sp-6) var(--sp-5); }
}
@media (max-width: 480px) {
  .btn-ghost.nav-btn-text { display: none; }
}
