/* Shared core styles — maintenance banner, app nav, and other _core/ components */

/* ── Maintenance Banner ────────────────────────────────────────────── */
#at-maintenance-banner {
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    z-index: 99999;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    padding: 0.5rem 1rem;
    font-size: 0.875rem;
    font-family: system-ui, -apple-system, sans-serif;
    color: #fff;
    border: none;
    box-shadow: none;
    line-height: 1.4;
}

#at-maintenance-banner.at-banner--active {
    background: #b45309;
}

#at-maintenance-banner.at-banner--coming-soon {
    background: #2563eb;
}

#at-maintenance-banner svg {
    flex-shrink: 0;
    width: 18px;
    height: 18px;
}

/* ── Maintenance read-only: locked form controls ─────────────────── */
[data-m-locked] {
    cursor: not-allowed !important;
}

/* ── Impersonation bar (super_admin viewing as another user) ─────────── */
body.at-impersonation-bar-visible {
    padding-top: 2.5rem;
}

.at-impersonation-bar {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    z-index: 99999;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 1rem;
    padding: 0.5rem 1rem;
    font-size: 0.875rem;
    font-family: system-ui, -apple-system, sans-serif;
    background: #b45309;
    color: #fff;
    line-height: 1.4;
    flex-wrap: wrap;
}

.at-impersonation-label {
    opacity: 0.95;
}

.at-impersonation-stop {
    background: transparent;
    border: 1px solid rgba(255, 255, 255, 0.8);
    color: #fff;
    font-size: 0.875rem;
    padding: 0.25rem 0.75rem;
    cursor: pointer;
    font-weight: 600;
}

.at-impersonation-stop:hover {
    background: rgba(255, 255, 255, 0.2);
}

.at-impersonation-stop:disabled {
    opacity: 0.7;
    cursor: wait;
}

/* ── Impersonate User widget (top-right dropdown) ──────────────────── */
.at-impersonation-widget {
    position: fixed;
    top: 0.5rem;
    right: 0.5rem;
    z-index: 99998;
    font-family: system-ui, -apple-system, sans-serif;
}

.at-impersonation-toggle {
    font-size: 0.8125rem;
    padding: 0.35rem 0.75rem;
    background: #1e3a5f;
    color: rgba(255, 255, 255, 0.95);
    border: 1px solid rgba(255, 255, 255, 0.2);
    cursor: pointer;
}

.at-impersonation-toggle:hover {
    background: #2a4a7a;
    color: #fff;
}

.at-impersonation-dropdown {
    position: absolute;
    top: 100%;
    right: 0;
    margin-top: 0.25rem;
    min-width: 12rem;
    max-height: 20rem;
    overflow-y: auto;
    background: #fff;
    border: 1px solid #ccc;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
}

.at-impersonation-loading {
    display: block;
    padding: 0.75rem 1rem;
    font-size: 0.8125rem;
    color: #666;
}

.at-impersonation-list {
    list-style: none;
    margin: 0;
    padding: 0.25rem 0;
}

.at-impersonation-user-btn {
    display: block;
    width: 100%;
    text-align: left;
    font-size: 0.8125rem;
    padding: 0.5rem 1rem;
    background: none;
    border: none;
    cursor: pointer;
    color: #222;
}

.at-impersonation-user-btn:hover {
    background: #f0f0f0;
}

.at-impersonation-user-btn:disabled {
    opacity: 0.6;
    cursor: wait;
}

@media print {
    #at-maintenance-banner,
    #at-app-nav,
    #at-impersonation-bar,
    #at-impersonation-widget {
        display: none !important;
    }
}
