/*
 * Administrare-only accessibility + mobile layer, loaded after sb-admin-2.css.
 * Brand purple (#7c529c) already passes AA with white text (5.9:1), so it is
 * left alone; the stock SB Admin 2 status colours below do not (white on
 * #1cc88a is 2.1:1, on #36b9cc 2.2:1, on #e74a3b 3.9:1, on #858796 3.6:1).
 * Every replacement here is >= 4.5:1 against its text colour.
 */

/* --- contrast: status colours ------------------------------------------ */
.btn-success, .bg-success { background-color: #146c43 !important; border-color: #146c43 !important; }
.btn-success:hover, .btn-success:focus { background-color: #0f5132 !important; border-color: #0f5132 !important; }

.btn-danger, .bg-danger { background-color: #b02a37 !important; border-color: #b02a37 !important; }
.btn-danger:hover, .btn-danger:focus { background-color: #8c2029 !important; border-color: #8c2029 !important; }

.btn-info, .bg-info { background-color: #0b7285 !important; border-color: #0b7285 !important; }
.btn-info:hover, .btn-info:focus { background-color: #095b6b !important; border-color: #095b6b !important; }

.btn-secondary { background-color: #6c6e7e !important; border-color: #6c6e7e !important; }
.btn-secondary:hover, .btn-secondary:focus { background-color: #565866 !important; border-color: #565866 !important; }

/* Yellow needs dark text, not white. */
.btn-warning { color: #1f1f1f !important; background-color: #f6c23e; border-color: #f6c23e; }
.btn-warning:hover, .btn-warning:focus { color: #1f1f1f !important; background-color: #e0a800; border-color: #e0a800; }

.badge-success { background-color: #146c43; }
.badge-danger { background-color: #b02a37; }
.badge-info { background-color: #0b7285; }
.badge-warning { color: #1f1f1f; }
.text-success { color: #146c43 !important; }
.text-danger { color: #b02a37 !important; }

.text-gray-600 { color: #5a5c69 !important; }

/* Flash / notice cards (showMsg, showNotify): white text on the colours above. */
.card.bg-success, .card.bg-danger { color: #fff; }

/* --- keyboard focus ----------------------------------------------------- */
a:focus-visible, button:focus-visible, .btn:focus-visible,
input:focus-visible, select:focus-visible, textarea:focus-visible,
.page-link:focus-visible {
  outline: 3px solid #f6c23e;
  outline-offset: 2px;
  box-shadow: none;
}

/* --- mobile -------------------------------------------------------------- */
/* Icon-only actions inside tables (edit, archive, ...) are ~14px: give them a
   finger-sized hit area on touch screens. */
@media (pointer: coarse) {
  table.dataTable td a,
  table.dataTable td .btn-link {
    display: inline-block;
    min-width: 40px;
    min-height: 40px;
    line-height: 40px;
    text-align: center;
    padding: 0 !important;
  }
  .btn, .btn-sm { min-height: 40px; }
  #sidebarToggleTop { min-width: 44px; min-height: 44px; }
  .dropdown-item { padding-top: .6rem; padding-bottom: .6rem; }
}

@media (max-width: 767.98px) {
  /* 16px stops iOS from zooming the page when a field is focused; the
     inline height:30px on role/filter selects is too short to tap. */
  .form-control, .form-control-sm, select, textarea, input[type="text"],
  input[type="email"], input[type="password"], input[type="date"] {
    font-size: 16px !important;
  }
  select { min-height: 40px; height: auto !important; }

  /* Approve/decline forms sit side by side on desktop; stack them. */
  form[style*="inline-block"] { display: block !important; margin: 0 0 .5rem 0 !important; }
  form[style*="inline-block"] .btn { width: 100%; }

  /* DataTables controls: stack, full width, wrap the pager. */
  .dataTables_wrapper .dataTables_length,
  .dataTables_wrapper .dataTables_filter { text-align: left; }
  .dataTables_wrapper .dataTables_filter input { width: 100%; margin: .25rem 0 0 0; display: block; }
  .dataTables_wrapper .dataTables_paginate { float: none; text-align: center; }
  .dataTables_wrapper .pagination { flex-wrap: wrap; justify-content: center; }

  /* Less side padding so tables/cards get the width. */
  #content > .container-fluid { padding-left: .75rem; padding-right: .75rem; }
  .card-body { padding: 1rem; }
}
