/*==============================================================================
  Toast component
  ------------------------------------------------------------------------------
  The theme's bootstrap.min.css ships the --bs-toast-* CUSTOM PROPERTIES but the
  component's actual rules were stripped from the build. Without them a toast
  host renders as an unstyled div: no background, no shadow, and — because
  `.toast:not(.show) { display: none }` is one of the missing rules — permanently
  visible. Combined with `position-fixed top-0 end-0` that produced a transparent
  ghost box sitting over the header, obscuring the clock and the user menu.

  This restores the component, using the theme's own variables so the result
  matches the design system rather than looking bolted on, and offsets the
  container below the fixed .topbar (position: fixed, min-height 60px).

  Loaded globally from _Layout, so every toast host in the app is fixed at once.
==============================================================================*/

.toast-container {
    position: fixed;
    z-index: 1090;              /* above .topbar (999) but below modals */

    /* Clear the fixed header instead of covering it. The container's own
       padding supplies the gap below that. */
    top: 60px;
    right: 0;
    bottom: auto;
    left: auto;

    width: max-content;
    max-width: 100%;
    padding: 1rem;

    /* The container spans a large empty area; without this it would swallow
       clicks on whatever sits underneath it. */
    pointer-events: none;
}

    .toast-container > :not(:last-child) {
        margin-bottom: .75rem;
    }

.toast {
    /* Individual toasts are still interactive — the close button has to work. */
    pointer-events: auto;

    width: 350px;
    max-width: 100%;

    font-size: .875rem;
    color: var(--bs-toast-color, inherit);
    background-color: var(--bs-toast-bg, rgba(255, 255, 255, .96));
    background-clip: padding-box;

    border: 1px solid var(--bs-toast-border-color, rgba(0, 0, 0, .1));
    border-radius: var(--bs-toast-border-radius, .375rem);
    box-shadow: var(--bs-toast-box-shadow, 0 .5rem 1rem rgba(0, 0, 0, .15));
}

    /* The rule whose absence made an empty toast permanently visible.
       !important because the theme's own scripts call Toast.show()/hide() on
       shared hosts at load, and a stray .show must not be able to resurrect a
       toast that has nothing to say. */
    .toast:not(.show) {
        display: none !important;
    }

    .toast.showing {
        opacity: 0;
    }

    .toast.show {
        display: block;
        opacity: 1;
    }

    /* Belt and braces: a toast with an empty body is never worth showing,
       whatever put .show on it. This is what was covering the header — a host
       that had never been given a message. */
    .toast:has(> .toast-body:empty),
    .toast:has(> .d-flex > .toast-body:empty) {
        display: none !important;
    }

.toast-body {
    padding: .75rem;
    word-wrap: break-word;
}

/* A toast can carry several lines when it reports skipped records; keep it
   readable rather than letting it grow off-screen. */
.toast-body {
    max-height: 40vh;
    overflow-y: auto;
}

/* The menu collapses on small screens, so the header no longer occupies the
   same band — pull the toasts up and let them span the width. */
@media (max-width: 767.98px) {
    .toast-container {
        top: 56px;
        left: 0;
        right: 0;
        width: auto;
        padding: .75rem;
    }

    .toast {
        width: 100%;
    }
}
