.avh-stack {
  display: grid;
  gap: 1.25rem;
  margin: 1.25rem 0;
}

.avh-modal [hidden] { display: none !important; }

.avh-card {
  background: #fff;
  border: 1px solid #e2e8f0;
  border-radius: 0.85rem;
  box-shadow: 0 1px 2px rgba(15, 23, 42, 0.05);
  overflow: hidden;
}

.avh-head,
.avh-current {
  align-items: center;
  display: flex;
  gap: 0.8rem;
  justify-content: space-between;
  padding: 1rem 1.25rem;
}

.avh-head {
  border-bottom: 1px solid #e2e8f0;
}

.avh-title {
  color: #0f172a;
  font-size: 1.13rem;
  font-weight: 700;
  margin: 0;
}

.avh-subtitle,
.avh-muted {
  color: #64748b;
  font-size: 0.78rem;
  margin: 0.2rem 0 0;
}

.avh-current {
  align-items: flex-start;
  background: #f8fafc;
  border-bottom: 1px solid #e2e8f0;
}

.avh-current-main {
  display: grid;
  gap: 0.25rem;
}

.avh-current-label {
  color: #475569;
  font-size: 0.72rem;
  font-weight: 700;
  letter-spacing: 0.05em;
  text-transform: uppercase;
}

.avh-current-value {
  color: #0f172a;
  font-size: 0.95rem;
  font-weight: 650;
}

.avh-badge {
  border-radius: 999px;
  display: inline-flex;
  font-size: 0.69rem;
  font-weight: 700;
  margin-right: 0.4rem;
  padding: 0.2rem 0.55rem;
  text-transform: uppercase;
}

.avh-badge--employee { background: #dbeafe; color: #1d4ed8; }
.avh-badge--team { background: #dcfce7; color: #15803d; }
.avh-badge--site { background: #fef3c7; color: #a16207; }
.avh-badge--legacy { background: #f1f5f9; color: #475569; }

.avh-btn {
  align-items: center;
  background: #0f172a;
  border: 1px solid #0f172a;
  border-radius: 0.5rem;
  color: #fff;
  cursor: pointer;
  display: inline-flex;
  font-size: 0.78rem;
  font-weight: 650;
  gap: 0.35rem;
  justify-content: center;
  min-height: 2.15rem;
  padding: 0.45rem 0.75rem;
}

.avh-btn:hover { background: #1e293b; }
.avh-btn:disabled { cursor: not-allowed; opacity: 0.5; }
.avh-btn--secondary { background: #fff; color: #0f172a; }
.avh-btn--secondary:hover { background: #f8fafc; }
.avh-btn--danger { background: #fff; border-color: #fecaca; color: #b91c1c; }
.avh-btn--danger:hover { background: #fef2f2; }
.avh-btn--small { font-size: 0.72rem; min-height: 1.85rem; padding: 0.28rem 0.55rem; }

.avh-table-wrap { overflow-x: auto; }
.avh-table { border-collapse: collapse; min-width: 980px; width: 100%; }
.avh-table th,
.avh-table td {
  border-bottom: 1px solid #e2e8f0;
  color: #334155;
  font-size: 0.76rem;
  padding: 0.7rem 0.75rem;
  text-align: left;
  vertical-align: top;
}
.avh-table th {
  background: #f8fafc;
  color: #475569;
  font-size: 0.68rem;
  letter-spacing: 0.035em;
  text-transform: uppercase;
}
.avh-table tr:last-child td { border-bottom: 0; }
.avh-actions { display: flex; gap: 0.4rem; white-space: nowrap; }
.avh-empty,
.avh-error { color: #64748b; font-size: 0.82rem; padding: 1.25rem; text-align: center; }
.avh-error { color: #b91c1c; }

.avh-odo-list { display: grid; }
.avh-odo-row {
  align-items: flex-start;
  border-bottom: 1px solid #e2e8f0;
  display: grid;
  gap: 0.75rem;
  grid-template-columns: 7rem minmax(0, 1fr) auto;
  padding: 0.8rem 1.25rem;
}
.avh-odo-row:last-child { border-bottom: 0; }
.avh-delta { font-size: 0.92rem; font-weight: 750; }
.avh-delta--positive { color: #15803d; }
.avh-delta--negative { color: #b91c1c; }
.avh-delta--zero { color: #64748b; }
.avh-odo-detail { color: #334155; font-size: 0.78rem; }
.avh-odo-km { color: #64748b; font-size: 0.72rem; white-space: nowrap; }
.avh-activation { background: #f8fafc; border-bottom: 1px solid #e2e8f0; color: #475569; font-size: 0.73rem; padding: 0.65rem 1.25rem; }

.avh-modal-backdrop {
  align-items: center;
  background: rgba(15, 23, 42, 0.62);
  display: flex;
  inset: 0;
  justify-content: center;
  padding: 1rem;
  position: fixed;
  z-index: 10000;
}
.avh-modal {
  background: #fff;
  border-radius: 0.85rem;
  box-shadow: 0 24px 60px rgba(15, 23, 42, 0.28);
  max-height: 92vh;
  max-width: 720px;
  overflow: auto;
  width: 100%;
}
.avh-modal-head { border-bottom: 1px solid #e2e8f0; padding: 1rem 1.25rem; }
.avh-modal-head h2 { color: #0f172a; font-size: 1.05rem; font-weight: 700; margin: 0; }
.avh-modal-body { display: grid; gap: 0.9rem; padding: 1.1rem 1.25rem; }
.avh-grid { display: grid; gap: 0.85rem; grid-template-columns: repeat(2, minmax(0, 1fr)); }
.avh-field { display: grid; gap: 0.32rem; }
.avh-field--full { grid-column: 1 / -1; }
.avh-field label { color: #334155; font-size: 0.75rem; font-weight: 650; }
.avh-field input,
.avh-field select,
.avh-field textarea {
  background: #fff;
  box-sizing: border-box;
  border: 1px solid #cbd5e1;
  border-radius: 0.45rem;
  color: #0f172a;
  font: inherit;
  font-size: 0.83rem;
  min-height: 2.35rem;
  padding: 0.5rem 0.65rem;
  width: 100%;
}
.avh-field textarea { min-height: 5rem; resize: vertical; }
.avh-modal-error { color: #b91c1c; font-size: 0.78rem; min-height: 1rem; }
.avh-modal-actions { border-top: 1px solid #e2e8f0; display: flex; gap: 0.55rem; justify-content: flex-end; padding: 0.9rem 1.25rem; }

@media (max-width: 720px) {
  .avh-head,
  .avh-current { align-items: stretch; flex-direction: column; }
  .avh-grid { grid-template-columns: 1fr; }
  .avh-field--full { grid-column: auto; }
  .avh-odo-row { grid-template-columns: 1fr; gap: 0.25rem; }
  .avh-odo-km { white-space: normal; }
}
