html {
  font-size: 14px;
}

@media (min-width: 768px) {
  html {
    font-size: 16px;
  }
}

.btn:focus, .btn:active:focus, .btn-link.nav-link:focus, .form-control:focus, .form-check-input:focus {
  box-shadow: 0 0 0 0.1rem white, 0 0 0 0.25rem #258cfb;
}

html {
  position: relative;
  min-height: 100%;
}

body {
  margin-bottom: 60px;
}

.form-floating > .form-control-plaintext::placeholder, .form-floating > .form-control::placeholder {
  color: var(--bs-secondary-color);
  text-align: end;
}

.form-floating > .form-control-plaintext:focus::placeholder, .form-floating > .form-control:focus::placeholder {
  text-align: start;
}

/*
 * Chuẩn hóa modal toàn hệ thống:
 * - Không để modal cao hơn vùng hiển thị của thiết bị.
 * - Tự tạo thanh cuộn tại phần nội dung khi dữ liệu dài.
 * - Giữ header/footer luôn nhìn thấy để người dùng có thể đóng hoặc thao tác.
 */
.modal .modal-dialog {
  max-height: calc(100vh - 1rem);
  max-height: calc(100dvh - 1rem);
  margin-top: .5rem;
  margin-bottom: .5rem;
}

.modal .modal-content {
  max-height: calc(100vh - 1rem);
  max-height: calc(100dvh - 1rem);
  overflow: hidden;
}

/* Nhiều modal trong dự án dùng form bọc header/body/footer. */
.modal .modal-content > form {
  display: flex;
  flex-direction: column;
  min-height: 0;
  max-height: inherit;
}

.modal .modal-header,
.modal .modal-footer {
  flex-shrink: 0;
}

.modal .modal-body {
  min-height: 0;
  overflow-x: auto;
  overflow-y: auto;
  overscroll-behavior: contain;
  -webkit-overflow-scrolling: touch;
}

@media (min-width: 576px) {
  .modal .modal-dialog {
    max-height: calc(100vh - 3.5rem);
    max-height: calc(100dvh - 3.5rem);
    margin-top: 1.75rem;
    margin-bottom: 1.75rem;
  }

  .modal .modal-content {
    max-height: calc(100vh - 3.5rem);
    max-height: calc(100dvh - 3.5rem);
  }
}

/* Chuẩn hóa nút biểu tượng Xem/Sửa trong cột Thao tác toàn hệ thống. */
.action-buttons {
  gap: .25rem;
}

.action-buttons .btn-icon {
  width: 34px;
  height: 32px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 0;
  border-radius: 8px;
}

