body {
  font-family: "Segoe UI", "PingFang SC", "Microsoft YaHei", sans-serif;
}

.card {
  border-radius: 12px;
}

/* Default tables should wrap to avoid overly wide pages (e.g. admin/users). */
.table td, .table th {
  vertical-align: middle;
}

/* Keep the loans table compact and aligned. */
.mv-nowrap td, .mv-nowrap th {
  white-space: nowrap;
}

.mv-ellipsis {
  max-width: 360px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.mv-etc-cell {
  max-width: 360px;
}

.mv-etc-preview {
  word-break: break-word;
}

.mv-tooltip {
  position: relative;
  cursor: help;
}

.mv-tooltip-content {
  display: none;
  position: absolute;
  left: 0;
  top: 100%;
  margin-top: 6px;
  max-width: 520px;
  white-space: normal;
  background: rgba(20, 20, 20, 0.88);
  color: #fff;
  padding: 8px 10px;
  border-radius: 8px;
  font-size: 12px;
  line-height: 1.35;
  z-index: 9999;
  box-shadow: 0 8px 24px rgba(0,0,0,0.25);
}

.mv-tooltip:hover .mv-tooltip-content {
  display: block;
}

.mv-tooltip:hover::before {
  content: "";
  position: absolute;
  left: 14px;
  top: 100%;
  margin-top: 2px;
  border: 6px solid transparent;
  border-bottom-color: rgba(20, 20, 20, 0.88);
  z-index: 10000;
}

/* Admin page: vertical multi-column checkbox layout */
.mv-checkgrid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(120px, 1fr));
  gap: 8px 14px;
}

.mv-checkgrid .form-check {
  margin: 0;
}

/* Admin loans domain filter: keep it compact with scrolling when many domains */
.mv-domain-filter {
  grid-template-columns: 1fr;
  max-height: 220px;
  overflow: auto;
}

.mv-domain-filter .form-check {
  display: flex;
  align-items: flex-start;
  gap: 6px;
}

.mv-domain-filter .form-check-label {
  white-space: normal;
  word-break: break-all;
  line-height: 1.25;
}

@media (min-width: 992px) {
  .mv-domain-filter {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    max-height: 150px;
  }
}

@media (min-width: 1400px) {
  .mv-domain-filter {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }
}

/* Admin page: show selected columns in consistent grid gaps */
.mv-col-badges {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(110px, 1fr));
  gap: 6px 8px;
}

.mv-col-badges .badge {
  justify-self: start;
}

/* Desktop admin edit panel feels aligned */
.mv-edit-panel .form-label {
  color: rgba(33, 37, 41, 0.75);
  display: block;
  min-height: 2.4em;
}

/* Force admin edit inputs aligned even with long labels */
.mv-edit-panel .mv-field {
  display: flex;
  flex-direction: column;
}

.mv-edit-panel .mv-field > .form-label {
  min-height: 34px;
  margin-bottom: 6px !important;
  white-space: nowrap;
}
