﻿
/* ===== LOADING GLOBAL ===== */

body.loading-active {
    overflow: hidden;
}

.global-loading {
    position: fixed;
    inset: 0;
    z-index: 10000;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 1.5rem;
    background: rgb(15 23 42 / 48%);
    backdrop-filter: blur(4px);
    opacity: 0;
    visibility: hidden;
    pointer-events: none;
    transition: opacity .2s ease, visibility .2s ease;
}

.global-loading.is-visible {
    opacity: 1;
    visibility: visible;
    pointer-events: auto;
}

.global-loading__card {
    width: min(100%, 360px);
    padding: 2rem;
    text-align: center;
    color: var(--color-on-surface, #1f2937);
    background: var(--color-surface-container-lowest, #fff);
    border: 1px solid rgb(148 163 184 / 20%);
    border-radius: 1rem;
    box-shadow: 0 24px 70px rgb(0 0 0 / 20%);
}

.global-loading__spinner {
    width: 46px;
    height: 46px;
    margin: 0 auto 1.25rem;
    border: 4px solid rgb(0 109 56 / 15%);
    border-top-color: var(--color-primary, #006d38);
    border-radius: 50%;
    animation: global-spin .75s linear infinite;
}

.global-loading__title {
    margin: 0 0 .5rem;
    font-size: 1rem;
    font-weight: 800;
    letter-spacing: .04em;
}

.global-loading__message {
    margin: 0;
    font-size: .9rem;
    line-height: 1.5;
    opacity: .75;
}

@keyframes global-spin {
    to { transform: rotate(360deg); }
}

/* ===== TOAST GLOBAL ===== */

.toast-container {
    position: fixed;
    top: 1rem;
    right: 1rem;
    z-index: 11000;
    display: flex;
    flex-direction: column;
    gap: .75rem;
    width: min(420px, calc(100vw - 2rem));
    pointer-events: none;
}

.app-toast {
    display: flex;
    align-items: flex-start;
    gap: .75rem;
    padding: 1rem;
    color: #fff;
    background: #334155;
    border: 1px solid rgb(255 255 255 / 12%);
    border-radius: .875rem;
    box-shadow: 0 12px 32px rgb(15 23 42 / 18%);
    opacity: 0;
    transform: translateY(-8px);
    transition: opacity .2s ease, transform .2s ease;
    pointer-events: auto;
}

.app-toast.is-visible {
    opacity: 1;
    transform: translateY(0);
}

.app-toast.is-leaving {
    opacity: 0;
    transform: translateX(12px);
}

.app-toast--success { background: #166534; }
.app-toast--error { background: #991b1b; }
.app-toast--warning { background: #92400e; }
.app-toast--info { background: #1e40af; }

.app-toast__icon {
    flex-shrink: 0;
    font-size: 1.4rem;
}

.app-toast__message {
    flex: 1;
    min-width: 0;
    font-size: .9rem;
    line-height: 1.5;
    overflow-wrap: anywhere;
}

.app-toast__close {
    flex-shrink: 0;
    padding: 0 .25rem;
    color: inherit;
    background: transparent;
    border: 0;
    font-size: 1.5rem;
    line-height: 1;
    cursor: pointer;
    opacity: .8;
}

.app-toast__close:hover {
    opacity: 1;
}

@media (max-width: 480px) {
    .toast-container {
        top: .75rem;
        right: .75rem;
        width: calc(100vw - 1.5rem);
    }

    .global-loading__card {
        padding: 1.5rem;
    }
}

@media (prefers-reduced-motion: reduce) {
    .global-loading,
    .app-toast {
        transition: none;
    }

    .global-loading__spinner {
        animation-duration: 1.5s;
    }
}

.material-symbols-outlined {
      font-variation-settings: 'FILL' 0, 'wght' 500, 'GRAD' 0, 'opsz' 24;
      line-height: 1;
    }

    .material-symbols-outlined.fill-1 {
      font-variation-settings: 'FILL' 1, 'wght' 500, 'GRAD' 0, 'opsz' 24;
    }

    /* Hide scrollbars for clean table horizontal scroll on mobile */
    .no-scrollbar::-webkit-scrollbar {
      display: none;
    }

    .no-scrollbar {
      -ms-overflow-style: none;
      scrollbar-width: none;
    }