/* ==========================================================================
   RekordPlate — Toast notifications
   ==========================================================================
   A single, self-contained restyle of toastr v2.1.3. Loaded on every shell
   (back-office, auth, public web) directly after toastr.min.css so a toast
   looks the same wherever it fires.

   Why this file exists
     toastr ships each status colour as a full-bleed `background-image`
     data-URI marked `!important` on `#toast-container > .toast-success`
     (specificity 1,1,0). Any theme rule that repaints the toast with the
     `background` *shorthand* resets `background-repeat` to `repeat` and
     `background-position` to `0 0` while that `!important` image survives —
     which is what tiled the check mark across the whole toast. Every rule
     below therefore uses longhand `background-color`, and the sprite is
     killed from a selector that actually outranks toastr's (1,1,1).

   The status glyph is drawn by `::before` from an inline SVG instead, so it
   is not part of the box background at all and cannot tile.
   ========================================================================== */

#toast-container {
    position: fixed;
    z-index: 999999;
    pointer-events: none;
}

#toast-container.toast-top-right    { top: 14px; right: 14px; }
#toast-container.toast-top-left     { top: 14px; left: 14px; }
#toast-container.toast-bottom-right { bottom: 14px; right: 14px; }
#toast-container.toast-bottom-left  { bottom: 14px; left: 14px; }

/* --------------------------------------------------------------------------
   The toast itself
   -------------------------------------------------------------------------- */

#toast-container > div[class*="toast"] {
    /* kills toastr's tiled status sprite — outranks its !important rule */
    background-image: none !important;

    position: relative;
    overflow: hidden;
    pointer-events: auto;
    box-sizing: border-box;

    width: auto;
    min-width: 260px;
    max-width: 380px;
    margin: 0 0 10px;
    padding: 12px 34px 12px 44px;

    font-family: var(--font-body, "Inter", system-ui, -apple-system, "Segoe UI", sans-serif);
    font-size: 13px;
    line-height: 1.45;
    text-align: left;
    word-wrap: break-word;

    border: 1px solid transparent;
    border-radius: var(--radius-md, 8px);
    box-shadow: 0 6px 20px rgba(24, 26, 45, .16);
    opacity: 1;
    filter: none;

    animation: nc-toast-in 220ms var(--nc-ease, cubic-bezier(.2, .8, .2, 1)) both;
}

#toast-container > div[class*="toast"]:hover {
    box-shadow: 0 10px 26px rgba(24, 26, 45, .22);
    opacity: 1;
    filter: none;
    cursor: pointer;
}

@keyframes nc-toast-in {
    from { transform: translateY(-8px) scale(.98); }
    to   { transform: none; }
}

@media (prefers-reduced-motion: reduce) {
    #toast-container > div[class*="toast"] { animation: none; }
}

/* --------------------------------------------------------------------------
   Status glyph — one 18px mark, drawn per status
   -------------------------------------------------------------------------- */

#toast-container > div[class*="toast"]::before {
    content: "";
    position: absolute;
    left: 14px;
    top: 13px;
    width: 18px;
    height: 18px;
    background-repeat: no-repeat;
    background-position: center;
    background-size: 18px 18px;
}

#toast-container > div.toast-success::before {
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%232f7d55' stroke-width='2.4' stroke-linecap='round' stroke-linejoin='round'%3E%3Ccircle cx='12' cy='12' r='9'/%3E%3Cpath d='m8.5 12.2 2.4 2.4 4.6-4.9'/%3E%3C/svg%3E");
}

#toast-container > div.toast-error::before {
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23a63f4f' stroke-width='2.4' stroke-linecap='round' stroke-linejoin='round'%3E%3Ccircle cx='12' cy='12' r='9'/%3E%3Cpath d='M14.8 9.2 9.2 14.8M9.2 9.2l5.6 5.6'/%3E%3C/svg%3E");
}

#toast-container > div.toast-warning::before {
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%238a6420' stroke-width='2.4' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M10.3 3.9 2.2 17.7A2 2 0 0 0 3.9 20.8h16.2a2 2 0 0 0 1.7-3.1L13.7 3.9a2 2 0 0 0-3.4 0Z'/%3E%3Cpath d='M12 9.5v3.8M12 16.8h.01'/%3E%3C/svg%3E");
}

#toast-container > div.toast-info::before {
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%233f6494' stroke-width='2.4' stroke-linecap='round' stroke-linejoin='round'%3E%3Ccircle cx='12' cy='12' r='9'/%3E%3Cpath d='M12 16.3v-4.6M12 8.2h.01'/%3E%3C/svg%3E");
}

/* --------------------------------------------------------------------------
   Status colours — longhand only, never the `background` shorthand
   -------------------------------------------------------------------------- */

#toast-container > div.toast,
#toast-container > div.toast-success,
#toast-container > div.toast-error,
#toast-container > div.toast-warning,
#toast-container > div.toast-info {
    background-color: var(--color-surface, #ffffff);
    color: var(--color-text, #1b1d2a);
    border-color: var(--color-divider, rgba(27, 29, 42, .14));
}

#toast-container > div.toast-success {
    background-color: var(--color-success-bg, #dff2e7);
    color: var(--color-success-fg, #1c5138);
    border-color: var(--color-success, #2f7d55);
}

#toast-container > div.toast-error {
    background-color: var(--color-danger-bg, #fbe2e6);
    color: var(--color-danger-fg, #7d2e3b);
    border-color: var(--color-danger, #a63f4f);
}

#toast-container > div.toast-warning {
    background-color: var(--color-warning-bg, #fbeed6);
    color: var(--color-warning-fg, #6b4c16);
    border-color: var(--color-warning, #8a6420);
}

#toast-container > div.toast-info {
    background-color: var(--color-info-bg, #e0eaf7);
    color: var(--color-info-fg, #2b4667);
    border-color: var(--color-info, #3f6494);
}

/* --------------------------------------------------------------------------
   Text, close button, progress bar
   -------------------------------------------------------------------------- */

#toast-container .toast-title {
    font-family: var(--font-heading, inherit);
    font-weight: 600;
    font-size: 13px;
    margin-bottom: 2px;
}

#toast-container .toast-message {
    word-wrap: break-word;
    color: inherit;
}

#toast-container .toast-message a,
#toast-container .toast-message label { color: inherit; text-decoration: underline; }
#toast-container .toast-message a:hover { opacity: .8; }

#toast-container .toast-close-button {
    position: absolute;
    top: 8px;
    right: 8px;
    left: auto;
    float: none;
    width: 20px;
    height: 20px;
    padding: 0;
    font-size: 17px;
    font-weight: 400;
    line-height: 18px;
    text-align: center;
    color: inherit;
    text-shadow: none;
    background: transparent;
    border: 0;
    border-radius: var(--radius-sm, 4px);
    opacity: .5;
    filter: none;
    cursor: pointer;
    -webkit-appearance: none;
    appearance: none;
}

#toast-container .toast-close-button:hover,
#toast-container .toast-close-button:focus {
    color: inherit;
    opacity: 1;
    filter: none;
    background-color: rgba(0, 0, 0, .07);
    text-decoration: none;
}

#toast-container .toast-progress {
    position: absolute;
    left: 0;
    bottom: 0;
    height: 2px;
    background-color: currentColor;
    opacity: .35;
    filter: none;
}

/* --------------------------------------------------------------------------
   RTL
   -------------------------------------------------------------------------- */

#toast-container > div[class*="toast"].rtl {
    direction: rtl;
    text-align: right;
    padding: 12px 44px 12px 34px;
}

#toast-container > div[class*="toast"].rtl::before { left: auto; right: 14px; }
#toast-container > div[class*="toast"].rtl .toast-close-button { right: auto; left: 8px; }
#toast-container > div[class*="toast"].rtl .toast-progress { left: auto; right: 0; }

/* --------------------------------------------------------------------------
   Small screens — the toast used to span the whole header on a phone
   -------------------------------------------------------------------------- */

@media all and (max-width: 480px) {
    #toast-container.toast-top-right,
    #toast-container.toast-top-left    { top: 10px; left: 10px; right: 10px; }
    #toast-container.toast-bottom-right,
    #toast-container.toast-bottom-left { bottom: 10px; left: 10px; right: 10px; }

    #toast-container > div[class*="toast"] {
        width: 100%;
        min-width: 0;
        max-width: 100%;
    }
}

/* --------------------------------------------------------------------------
   Print — a toast must never land on a bill, invoice or receipt
   --------------------------------------------------------------------------
   Receipts print straight from the live document (`window.print()` in
   custom.js / onloadPrint.js), so anything fixed-position on screen joins the
   print job unless it is explicitly removed.
   -------------------------------------------------------------------------- */

@media print {
    #toast-container,
    #toast-container * {
        display: none !important;
        visibility: hidden !important;
    }
}
