/* Panel overrides loaded on every page without depending on Vite build */

/* === GLOBAL SWEETALERT TOASTS === */
.swal2-container {
    z-index: 20000 !important;
}

.swal-toast {
    border-radius: 14px;
    padding: 0.75rem 1rem;
    backdrop-filter: blur(12px);
    background: rgba(255, 255, 255, 0.95);
    border-inline-start: 4px solid var(--theme-default, #1bbf72);
    box-shadow: 0 16px 40px rgba(15, 23, 42, 0.18);
    min-width: 260px;
}

.swal-toast__title {
    font-size: 0.92rem;
    font-weight: 700;
    margin-bottom: 0.2rem;
    color: var(--body-font-color, #111827);
}

.swal-toast__body {
    font-size: 0.82rem;
    color: var(--gray-600, #6b7280);
}

.swal-toast .swal2-timer-progress-bar-container {
    position: absolute;
    inset-inline: 0.75rem;
    bottom: 0.4rem;
    height: 3px;
    overflow: hidden;
    border-radius: 999px;
    background: rgba(27, 191, 114, 0.15);
}

.swal-toast .swal2-timer-progress-bar {
    background: linear-gradient(90deg, #1bbf72, #0b8f55);
    height: 100%;
}

.swal-toast--success {
    border-color: var(--success-color, #22c55e);
}

.swal-toast--error {
    border-color: var(--danger-color, #ef4444);
}

.swal-toast--warning {
    border-color: var(--warning-color, #f59e0b);
}

.swal-toast--info {
    border-color: var(--theme-default, #1bbf72);
}

.swal-temp-password .swal2-title {
    font-size: 1.05rem;
    color: var(--body-font-color, #111827);
}

.swal-temp-password .swal-temp-pass input {
    font-family: 'SFMono-Regular', Consolas, 'Liberation Mono', monospace;
    font-size: 1rem;
    font-weight: 600;
}

/* === USER AVATAR (INITIALS/PRESETS) === */
.user-avatar {
    width: 36px;
    height: 36px;
    border-radius: 999px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-weight: 700;
    font-size: 0.85rem;
    line-height: 1;
    letter-spacing: 0.03em;
}

.user-avatar i {
    font-size: 1rem;
}

.user-avatar-img {
    width: 36px;
    height: 36px;
    border-radius: 999px;
    object-fit: cover;
    display: inline-block;
}

.avatar-preset.avatar-1 { background: #1bbf72; color: #fff; }
.avatar-preset.avatar-2 { background: #2563eb; color: #fff; }
.avatar-preset.avatar-3 { background: #f59e0b; color: #1f2937; }
.avatar-preset.avatar-4 { background: #ef4444; color: #fff; }
.avatar-preset.avatar-5 { background: #8b5cf6; color: #fff; }
.avatar-preset.avatar-6 { background: #0ea5e9; color: #fff; }

.avatar-picker {
    display: flex;
    flex-wrap: wrap;
    gap: 14px;
}

.avatar-card {
    border: 1px solid rgba(148, 163, 184, 0.35);
    border-radius: 16px;
    padding: 16px;
    background: #fff;
    margin-bottom: 20px;
}

.avatar-card__header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
    padding-bottom: 12px;
    border-bottom: 1px solid rgba(148, 163, 184, 0.25);
}

.avatar-card__body {
    padding: 16px 0;
}

.avatar-card__actions {
    display: flex;
    justify-content: flex-end;
}

.avatar-preview {
    width: 88px;
    height: 88px;
    border-radius: 999px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    background: #f8fafc;
    border: 1px solid rgba(148, 163, 184, 0.35);
}

.avatar-preview--pulse {
    animation: avatarPulse 0.35s ease;
}

.avatar-option__badge {
    display: none;
    padding: 2px 8px;
    border-radius: 999px;
    font-size: 0.68rem;
    font-weight: 700;
    background: rgba(27, 191, 114, 0.12);
    color: #0f766e;
}

.avatar-option.is-selected .avatar-option__badge {
    display: inline-flex;
}

.avatar-option.is-selected {
    border-color: rgba(16, 185, 129, 0.5);
}

.avatar-preview__initials {
    width: 76px;
    height: 76px;
    border-radius: 999px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-size: 1.4rem;
    font-weight: 700;
}

.avatar-preview__image {
    width: 76px;
    height: 76px;
    border-radius: 999px;
    object-fit: cover;
    display: block;
}

.avatar-picker-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(110px, 1fr));
    gap: 14px;
}

/* === PAGE LOADING OVERLAY === */
.page-loading-overlay {
    position: fixed;
    inset: 0;
    background: rgba(15, 23, 42, 0.25);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 10000;
    backdrop-filter: blur(2px);
}

.page-loading-overlay.d-none {
    display: none !important;
}

.page-loading-overlay .loader {
    transform: scale(1.1);
}

.avatar-option.card {
    border: 1px solid rgba(148, 163, 184, 0.35);
    border-radius: 14px;
    padding: 12px 10px;
    background: #f8fafc;
    transition: transform 0.15s ease, box-shadow 0.15s ease, border-color 0.15s ease;
}

/* === MODALS (Acessibilidade + leitura em telas menores) === */
.modal .modal-content {
    max-height: calc(100vh - 2rem);
}

.modal .modal-body {
    overflow-y: auto;
    max-height: calc(100vh - 220px);
}

.avatar-option.card:hover {
    transform: translateY(-2px);
    box-shadow: 0 10px 22px rgba(15, 23, 42, 0.12);
    border-color: rgba(30, 64, 175, 0.4);
}

.avatar-option.card input:checked + .avatar-option__preview {
    border-color: var(--theme-default, #1bbf72);
    box-shadow: 0 8px 18px rgba(17, 24, 39, 0.18);
    transform: translateY(-1px);
}

.avatar-option.card span {
    text-align: center;
}
.avatar-option {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 6px;
    cursor: pointer;
    font-size: 0.78rem;
    color: var(--body-font-color, #111827);
}

.avatar-option input {
    position: absolute;
    opacity: 0;
    pointer-events: none;
}

.avatar-option__preview {
    width: 48px;
    height: 48px;
    border-radius: 999px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-weight: 700;
    font-size: 0.95rem;
    border: 2px solid transparent;
    transition: border-color 0.15s ease, transform 0.15s ease, box-shadow 0.15s ease;
}

.avatar-option input:checked + .avatar-option__preview {
    border-color: var(--theme-default, #1bbf72);
    box-shadow: 0 6px 18px rgba(17, 24, 39, 0.18);
    transform: translateY(-1px);
}

.avatar-option__preview i {
    font-size: 1.1rem;
}

.avatar-option__image {
    width: 100%;
    height: 100%;
    border-radius: 999px;
    object-fit: cover;
    display: block;
}

@keyframes avatarPulse {
    0% { transform: scale(1); box-shadow: 0 0 0 rgba(16, 185, 129, 0.0); }
    45% { transform: scale(1.04); box-shadow: 0 12px 24px rgba(16, 185, 129, 0.18); }
    100% { transform: scale(1); box-shadow: none; }
}

/* === TYPEAHEAD LOADER (ONDINHAS) === */
.Typeahead-spinner {
    position: absolute;
    top: 50%;
    right: 18px;
    transform: translateY(-50%);
    pointer-events: none;
}

.Typeahead-spinner--wave {
    display: flex;
    align-items: flex-end;
    gap: 6px;
    width: 64px;
    height: 28px;
}

.Typeahead-spinner--wave span {
    width: 6px;
    height: 6px;
    border-radius: 999px;
    background-color: rgba(27, 191, 114, 0.25);
    animation: waveUp 1.9s ease-in-out infinite, smallExtend 1.9s ease-in-out infinite;
}

.Typeahead-spinner--wave span:nth-child(2),
.Typeahead-spinner--wave span:nth-child(4) {
    animation-name: waveUp, largeExtend;
}

.Typeahead-spinner--wave span:nth-child(2) { animation-delay: .12s; }
.Typeahead-spinner--wave span:nth-child(3) { animation-delay: .24s; }
.Typeahead-spinner--wave span:nth-child(4) { animation-delay: .36s; }
.Typeahead-spinner--wave span:nth-child(5) { animation-delay: .48s; }

@keyframes waveUp {
    0%, 18% { transform: translateY(0); }
    45%, 65% { transform: translateY(-7px); }
    100% { transform: translateY(0); }
}

@keyframes smallExtend {
    0%, 12% { height: 6px; background-color: rgba(27, 191, 114, 0.3); }
    30%, 54% { height: 22px; background-color: #1bbf72; }
    100% { height: 6px; background-color: rgba(27, 191, 114, 0.3); }
}

@keyframes largeExtend {
    0%, 12% { height: 6px; background-color: rgba(27, 191, 114, 0.35); }
    30%, 54% { height: 28px; background-color: #1bbf72; }
    100% { height: 6px; background-color: rgba(27, 191, 114, 0.35); }
}

/* === HEADER DROPDOWNS === */
.page-header .custom-dropdown .custom-menu li a,
.organization-selector__item {
    transition: background-color .2s ease, color .2s ease;
}

.page-header .custom-dropdown .custom-menu li,
.page-header .custom-dropdown .custom-menu li:hover {
    background: transparent !important;
}

.page-header .custom-dropdown .custom-menu li a:hover,
.page-header .custom-dropdown .custom-menu li button:hover,
.organization-selector__item:hover {
    background: rgba(27, 191, 114, 0.12) !important;
    color: var(--theme-default, #1bbf72) !important;
}

.organization-selector__item {
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto;
    gap: 0.75rem;
    align-items: flex-start;
    padding: 0.85rem 1rem;
    border-radius: 0.35rem;
    background: transparent;
}

.organization-selector__item-text {
    min-width: 0;
}

.organization-selector__meta {
    white-space: nowrap;
}

.organization-selector__badge {
    border-radius: 999px;
    font-size: 0.65rem;
    font-weight: 600;
    letter-spacing: 0.08em;
    padding: 0.2rem 0.7rem;
    border: 1px solid rgba(27, 191, 114, 0.6) !important;
    background: rgba(27, 191, 114, 0.2) !important;
    color: #0a6b3d !important;
    position: static !important;
    top: auto !important;
    right: auto !important;
}

.organization-selector__item.active {
    background: rgba(27, 191, 114, 0.16) !important;
    color: var(--theme-default, #1bbf72);
}

.organization-selector__item.active .organization-selector__badge,
.organization-selector__badge.active {
    background: var(--theme-default, #1bbf72) !important;
    color: #fff !important;
    border-color: transparent !important;
}

/* === LANGUAGE DROPDOWN FLAG SPACE === */
.language-menu .lang:hover {
    background: rgba(27, 191, 114, 0.12) !important;
    color: var(--theme-default, #1bbf72) !important;
}

/* === GLOBAL LOADER LABEL === */
.loader {
    position: relative;
    width: 72px;
    height: 72px;
    border-width: 4px;
}

.loader::before {
    content: 'Mapertest';
    position: absolute;
    left: 50%;
    top: 50%;
    width: 100%;
    height: 100%;
    transform: translate(-50%, -50%) rotate(0deg);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 11px;
    font-weight: 700;
    letter-spacing: 0.06em;
    color: var(--theme-default, #1bbf72);
    text-shadow: 0 1px 2px rgba(15, 23, 42, 0.15);
    pointer-events: none;
    animation: loaderTextCounter 1s linear infinite, loaderTextPulse 1.4s ease-in-out infinite;
}

.loader::after {
    width: 84px;
    height: 84px;
    border-width: 4px;
}

@keyframes loaderTextCounter {
    from {
        transform: translate(-50%, -50%) rotate(0deg);
    }
    to {
        transform: translate(-50%, -50%) rotate(-360deg);
    }
}

@keyframes loaderTextPulse {
    0% {
        opacity: 0.6;
    }
    50% {
        opacity: 1;
    }
    100% {
        opacity: 0.6;
    }
}
