/* Shared actions for BidSmart's client, supplier, public, and admin pages.
   Loaded after the V3 consistency layer; limited to explicit action classes. */
:root {
  --bs-action-red: #b51623;
  --bs-action-red-hover: #92101b;
  --bs-action-ink: #1f2933;
  --bs-action-border: #bec9d5;
  --bs-action-hover: #eef2f6;
}

:is(
  .roof-post-btn, .main-btn, .profile-primary-btn, .roof-select-btn,
  .client-primary-btn, .client-primary-link, .admin-btn-red,
  .client-approve-btn, .modal-save-btn, .hero-primary-btn,
  .header-btn-red, .signup-otp-button-primary,
  .inquiry-submit, .btn-red, .announcement-filter-button,
  .supplier-profile-main-action, .messenger-client-send,
  .messenger-send-btn, .messenger-choice-send,
  .signup-otp-verify, .catalogue-add-btn
) {
  min-height: 44px !important;
  max-width: 100%;
  box-sizing: border-box;
  border: 1px solid var(--bs-action-red) !important;
  border-radius: 11px !important;
  background: var(--bs-action-red) !important;
  color: #fff !important;
  font-weight: 750 !important;
  line-height: 1.3 !important;
  text-decoration: none !important;
  box-shadow: 0 4px 12px rgba(181, 22, 35, .15) !important;
  cursor: pointer;
  transition: background-color .17s ease, border-color .17s ease, box-shadow .17s ease !important;
}

:is(
  .admin-btn-neutral, .profile-secondary-btn, .client-secondary-btn,
  .view-post-link, .hero-secondary-btn, .header-btn-light,
  .manufacturer-bid-back-btn, .client-bids-back-btn,
  .inquiry-secondary, .inquiry-back-link, .btn-light,
  .messenger-secondary-btn, .announcement-action-btn,
  .overview-view-link, .database-view-link,
  .audit-open-details, .quotation-cancel-btn,
  .signup-otp-send, .messenger-tool-btn
) {
  min-height: 44px !important;
  max-width: 100%;
  box-sizing: border-box;
  border: 1px solid var(--bs-action-border) !important;
  border-radius: 11px !important;
  background: #fff !important;
  color: var(--bs-action-ink) !important;
  font-weight: 720 !important;
  line-height: 1.3 !important;
  text-decoration: none !important;
  box-shadow: none !important;
  cursor: pointer;
  transition: background-color .17s ease, border-color .17s ease, color .17s ease !important;
}

.database-view-link.active {
  border-color: var(--bs-action-red) !important;
  background: #fff1f2 !important;
  color: #8d101a !important;
}

/* Destructive actions keep their own meaning while sharing the same contrast. */
:is(.admin-btn-danger, .staff-delete-btn, .danger-action) {
  min-height: 44px !important;
  box-sizing: border-box;
  border: 1px solid #9f1521 !important;
  border-radius: 11px !important;
  background: #9f1521 !important;
  color: #fff !important;
  font-weight: 750 !important;
  text-decoration: none !important;
}

@media (hover: hover) {
  :is(
    .roof-post-btn, .main-btn, .profile-primary-btn, .roof-select-btn,
    .client-primary-btn, .client-primary-link, .admin-btn-red,
    .client-approve-btn, .modal-save-btn, .hero-primary-btn,
    .header-btn-red, .signup-otp-button-primary,
    .inquiry-submit, .btn-red, .announcement-filter-button,
    .supplier-profile-main-action, .messenger-client-send,
    .messenger-send-btn, .messenger-choice-send,
    .signup-otp-verify, .catalogue-add-btn
  ):hover:not(:disabled) {
    border-color: var(--bs-action-red-hover) !important;
    background: var(--bs-action-red-hover) !important;
    color: #fff !important;
    box-shadow: 0 6px 16px rgba(146, 16, 27, .2) !important;
  }
  :is(
    .admin-btn-neutral, .profile-secondary-btn, .client-secondary-btn,
    .view-post-link, .hero-secondary-btn, .header-btn-light,
    .manufacturer-bid-back-btn, .client-bids-back-btn,
    .inquiry-secondary, .inquiry-back-link, .btn-light,
    .messenger-secondary-btn, .announcement-action-btn,
    .overview-view-link, .database-view-link,
    .audit-open-details, .quotation-cancel-btn,
    .signup-otp-send, .messenger-tool-btn
  ):hover:not(:disabled) {
    border-color: #9caaba !important;
    background: var(--bs-action-hover) !important;
    color: #17212c !important;
  }
  :is(.admin-btn-danger, .staff-delete-btn, .danger-action):hover:not(:disabled) {
    border-color: #7f1019 !important;
    background: #7f1019 !important;
    color: #fff !important;
  }
}

:is(
  .roof-post-btn, .main-btn, .profile-primary-btn, .roof-select-btn,
  .client-primary-btn, .client-primary-link, .admin-btn-red,
  .client-approve-btn, .modal-save-btn, .hero-primary-btn,
  .header-btn-red, .signup-otp-button-primary,
  .inquiry-submit, .btn-red, .announcement-filter-button,
  .supplier-profile-main-action, .messenger-client-send,
  .messenger-send-btn, .messenger-choice-send,
  .signup-otp-verify, .catalogue-add-btn,
  .admin-btn-neutral, .profile-secondary-btn, .client-secondary-btn,
  .view-post-link, .hero-secondary-btn, .header-btn-light,
  .manufacturer-bid-back-btn, .client-bids-back-btn,
  .inquiry-secondary, .inquiry-back-link, .btn-light,
  .messenger-secondary-btn, .announcement-action-btn,
  .overview-view-link, .database-view-link,
  .audit-open-details, .quotation-cancel-btn,
  .signup-otp-send, .messenger-tool-btn,
  .admin-btn-danger, .staff-delete-btn, .danger-action
):focus-visible {
  outline: 3px solid #1c3854 !important;
  outline-offset: 3px !important;
}

.client-review-btn {
  min-height: 44px !important;
  border-radius: 11px !important;
  font-weight: 750 !important;
}
.client-review-btn:focus-visible {
  outline: 3px solid #1c3854 !important;
  outline-offset: 3px !important;
}

:is(button, input[type="submit"]):disabled { cursor: not-allowed !important; }

@media (max-width: 720px) {
  :is(.admin-main, .portal-main, .client-portal-main, .track-shell, .inquiry-shell) {
    min-width: 0;
  }
  :is(.admin-main, .portal-main, .client-portal-main, .track-shell, .inquiry-shell) h1 {
    overflow-wrap: break-word;
    line-height: 1.2;
  }
  :is(.admin-header, .portal-page-heading, .roof-page-heading, .staff-toolbar) {
    flex-wrap: wrap;
  }
  :is(.admin-main, .portal-main, .client-portal-main, .track-shell, .inquiry-shell) :is(button, input[type="submit"], select) {
    max-width: 100%;
  }
}

@media (prefers-reduced-motion: reduce) {
  :is(button, input[type="submit"], a) { transition-duration: .01ms !important; }
}
