/* --------------------------------------------------------------------------
   Admin panel UI corrections.

   Loaded last in <head> so it can win against the theme's bootstrap.min.css.
   -------------------------------------------------------------------------- */

/* Toast notifications ------------------------------------------------------
   toastr and Bootstrap 5 both claim `.toast`. Bootstrap's copy loads after
   toastr's here and paints the box with `--bs-toast-bg` (white) while
   toastr's own `#toast-container > div { color:#fff }` wins on specificity -
   which is how every success message ended up as white text on white. Pin
   the colours back onto the type classes, scoped to toastr's container so
   real Bootstrap toasts elsewhere are untouched. */
#toast-container > div {
    width: 340px;
    padding: 15px 15px 15px 50px;
    border: 0;
    border-radius: 8px;
    box-shadow: 0 8px 20px rgba(0, 0, 0, .25);
    background-position: 15px center;
    background-repeat: no-repeat;
    background-clip: border-box;
    opacity: 1;
    color: #fff !important;
}

#toast-container > .toast-success { background-color: #198754 !important; }
#toast-container > .toast-error   { background-color: #dc3545 !important; }
#toast-container > .toast-warning { background-color: #e08e0b !important; }
#toast-container > .toast-info    { background-color: #0b7285 !important; }

#toast-container .toast-title   { color: #fff; font-weight: 600; }
#toast-container .toast-message { color: #fff; }

#toast-container .toast-close-button {
    color: #fff;
    opacity: .9;
    text-shadow: none;
}

#toast-container .toast-progress { background-color: rgba(255, 255, 255, .55); }

/* Confirmation dialogs -----------------------------------------------------
   Every "are you sure?" renders through
   resources/views/pages/partials/admin/confirm-modal.blade.php. */
.admin-confirm-modal .modal-sm-plus { max-width: 420px; }
.admin-confirm-modal .modal-content { border: 0; border-radius: 12px; }
.admin-confirm-modal h4             { font-size: 1.3rem; font-weight: 600; }
.admin-confirm-modal .btn           { min-width: 110px; }

/* Search boxes -------------------------------------------------------------
   Every list in the panel uses `<input type="search">` with its own clear
   link drawn over the field. WebKit draws a native clear button as well, so
   the box showed two X icons side by side. Keep ours, drop the browser's. */
input[type="search"]::-webkit-search-cancel-button,
input[type="search"]::-webkit-search-decoration,
input[type="search"]::-webkit-search-results-button,
input[type="search"]::-webkit-search-results-decoration {
    -webkit-appearance: none;
    appearance: none;
    display: none;
}

input[type="search"]::-ms-clear { display: none; width: 0; height: 0; }

/* Required fields ----------------------------------------------------------
   One marker for the whole panel: a red asterisk after the label text. Use
   `<label class="form-label required">` or write the span out by hand - they
   render identically. */
.form-label.required::after,
label.required::after {
    content: " *";
    color: var(--bs-danger, #dc3545);
    font-weight: 600;
}

/* Read-only fields ---------------------------------------------------------
   Bootstrap only greys out `disabled`, and a disabled input is not posted.
   Fields we want visible-but-locked use `readonly`, so give them the same
   affordance. */
.form-control[readonly]:not(.flatpickr-input) {
    background-color: var(--bs-secondary-bg, #e9ecef);
    cursor: not-allowed;
}
