/* OneStaff v5 "Flow" - popups (modals, select2 drops, pickers, menus).
   Printed by head.php right after onestaff-flow-calendar.css. Reads the tokens from onestaff-flow.css only. */

/* ---------- select2 inside forms ----------
   select2 copies the <select>'s classes onto its container, so `.form-control` painted a second field
   (background, border, 8px 12px padding) around the real one. The inner .select2-choice(s) is the field. */
.select2-container.form-control, .select2-container-multi.form-control {
    background: transparent !important; border: 0 !important; padding: 0 !important; min-height: 0 !important; height: auto !important;
    box-shadow: none !important; display: block; width: 100%;
}
.select2-container.form-control .select2-choice { width: 100%; }
.select2-container-multi .select2-choices { min-height: 38px; height: auto !important; }
.select2-container-multi .select2-choices .select2-search-field input { background: transparent !important; border: 0 !important; box-shadow: none !important; height: 28px; padding: 0 4px; }

/* ---------- modal forms ---------- */
/* label column: sit on the same line as the field's text (fields are 38px, labels 19px) */
.modal-body .row > label[class*="col-"], .modal-body .form-group > label[class*="col-"] { padding-top: 9px; line-height: 1.5; }
/* the body scroll height is measured once on open; keep it inside the window if the window changes afterwards */
@media (min-width: 768px) { #ajaxModalContent .modal-body { max-height: calc(100vh - 190px); overflow-y: auto; } }
/* radios / checkboxes sit directly in the value column: drop them to the label's line */
.modal-body .row > [class*="col-"]:has(> .form-check-input, > .form-check, > .radio, > .checkbox, > .form-switch) { padding-top: 8px; }

/* ---------- badges ---------- */
/* onestaff-charts.js turns coloured badges into soft tints with dark ink, but the stock `.white-link` inside them stayed white (invisible on the tint) */
.badge.os-tinted a, .badge.os-tinted .white-link, .badge[data-os-tint] a.white-link { color: inherit !important; }

/* ---------- delete confirmation ---------- */
#confirmationModal #confirmDeleteButton { background: var(--os-coral) !important; border-color: var(--os-coral) !important; color: #fff !important; }
#confirmationModal #confirmDeleteButton:hover { filter: brightness(0.94); }

/* ---------- phones ---------- */
@media (max-width: 575.98px) {
    /* upload button gets its own row; the actions wrap instead of pushing Save off screen */
    .modal-footer { flex-wrap: wrap; justify-content: flex-end; }
    .modal-footer > .me-auto { flex: 1 0 100%; margin: 0 0 4px !important; }
    .modal-footer > .btn, .modal-footer > button { margin: 0 !important; }
}

/* ---------- native selects ---------- */
/* the flow skin clears the stock arrow (.form-control has no background-image); give single selects one chevron back */
select.form-control:not([multiple]):not([size]), select.form-select:not([multiple]):not([size]) {
    -webkit-appearance: none; appearance: none; padding-right: 34px !important;
    background-image: url("data:image/svg+xml,%3csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23888' stroke-width='2.2' stroke-linecap='round' stroke-linejoin='round'%3e%3cpath d='m6 9 6 6 6-6'/%3e%3c/svg%3e") !important;
    background-repeat: no-repeat !important; background-size: 14px 14px !important; background-position: right 12px center !important;
}

/* ---------- toasts (appAlert) ---------- */
/* stock: bottom-right at z-index 100, i.e. under the chat orb and, while a modal is open, under the backdrop */
.app-alert.animate { bottom: 96px !important; z-index: 2000 !important; }
@media (max-width: 767.98px) { .app-alert.animate { bottom: 140px !important; max-width: calc(100vw - 30px); } }

/* ---------- multi-select / column pickers ---------- */
/* selected rows were only a grey wash; add a tick so the state reads without colour */
.dropdown-menu .list-group-item, .popover .list-group-item {
    display: flex; align-items: center; justify-content: space-between; gap: 14px; min-height: 32px;
    border: 0 !important; border-radius: 8px !important; padding: 6px 10px !important; background: transparent; font-size: 13px; color: var(--os-text-2);
}
.dropdown-menu .list-group-item:hover, .popover .list-group-item:hover { background: var(--os-wash) !important; color: var(--os-text); }
.dropdown-menu .list-group-item.active, .popover .list-group-item.active { background: var(--os-wash-2) !important; color: var(--os-text) !important; font-weight: 500; }
.dropdown-menu .list-group-item.active::after, .popover .list-group-item.active::after {
    content: ""; flex: none; width: 14px; height: 14px; background: currentColor;
    -webkit-mask: url("data:image/svg+xml,%3csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='3' stroke-linecap='round' stroke-linejoin='round'%3e%3cpath d='m5 12 5 5 9-10'/%3e%3c/svg%3e") center / contain no-repeat;
            mask: url("data:image/svg+xml,%3csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='3' stroke-linecap='round' stroke-linejoin='round'%3e%3cpath d='m5 12 5 5 9-10'/%3e%3c/svg%3e") center / contain no-repeat;
}
.dropdown-menu .list-group, .popover .list-group { gap: 2px; }
