/* ==========================================================================
   Topbar — global page header with role switcher + user menu
   ========================================================================== */

.impersonation-banner {
    background: linear-gradient(90deg, #f59e0b, #ef4444);
    color: #fff;
    padding: 10px 20px;
    display: flex;
    align-items: center;
    gap: 12px;
    font-size: 13px;
    border-bottom: 1px solid rgba(0,0,0,0.08);
}
.impersonation-banner i { font-size: 16px; }
.impersonation-banner strong { font-weight: 600; }
.impersonation-stop-form { margin-left: auto; }

.topbar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 12px 24px;
    background: #fff;
    border-bottom: 1px solid var(--gray-200, #e5e7eb);
    gap: 16px;
    position: sticky;
    top: 0;
    z-index: 50;
}
.topbar-left { flex: 1; min-width: 0; }
.topbar-right { display: flex; align-items: center; gap: 8px; }

.topbar-btn,
.topbar-user {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    background: transparent;
    border: 1px solid var(--gray-200, #e5e7eb);
    border-radius: 10px;
    padding: 6px 12px;
    cursor: pointer;
    font-size: 13px;
    color: var(--gray-700, #374151);
    transition: all .15s;
}
.topbar-btn:hover,
.topbar-user:hover { background: var(--gray-50, #f9fafb); border-color: var(--gray-300, #d1d5db); }
.topbar-btn-label { font-weight: 500; }
.topbar-btn-caret { font-size: 10px; opacity: .6; }

.topbar-user-avatar {
    width: 30px; height: 30px;
    border-radius: 50%;
    background: var(--primary, #1e3a5f);
    color: #fff;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-weight: 700;
    font-size: 13px;
}
.topbar-user-text {
    display: flex; flex-direction: column; align-items: flex-start; line-height: 1.15;
}
.topbar-user-name { font-weight: 600; font-size: 13px; color: #111827; }
.topbar-user-role { font-size: 11px; color: #6b7280; }

.topbar-dropdown { position: relative; }
.topbar-dropdown-menu {
    position: absolute;
    top: calc(100% + 6px);
    left: 0;
    min-width: 260px;
    background: #fff;
    border: 1px solid var(--gray-200, #e5e7eb);
    border-radius: 12px;
    box-shadow: 0 10px 30px rgba(0,0,0,0.08);
    padding: 6px;
    display: none;
    z-index: 100;
}
.topbar-dropdown-menu-end { left: auto; right: 0; }
.topbar-dropdown.is-open .topbar-dropdown-menu { display: block; }

.topbar-dropdown-header {
    padding: 8px 12px 4px;
    font-size: 11px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: .04em;
    color: #6b7280;
}
.topbar-dropdown-form { margin: 0; padding: 0; }
.topbar-dropdown-item {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 8px 10px;
    border-radius: 8px;
    color: #111827;
    text-decoration: none;
    font-size: 13px;
    background: transparent;
    border: 0;
    width: 100%;
    cursor: pointer;
    text-align: left;
}
.topbar-dropdown-item > i:first-child {
    width: 28px; height: 28px;
    border-radius: 8px;
    background: var(--gray-100, #f3f4f6);
    color: var(--primary, #1e3a5f);
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-size: 13px;
}
.topbar-dropdown-item:hover { background: var(--gray-50, #f9fafb); }
.topbar-dropdown-item.is-active { background: #eff6ff; color: var(--primary, #1e3a5f); }
.topbar-dropdown-item.is-active > i:first-child { background: var(--primary, #1e3a5f); color: #fff; }
.topbar-dropdown-item-text { display: flex; flex-direction: column; line-height: 1.15; flex: 1; }
.topbar-dropdown-item-label { font-weight: 500; }
.topbar-dropdown-item-sub { font-size: 11px; color: #6b7280; }
.topbar-dropdown-item-check { color: var(--primary, #1e3a5f); margin-left: auto; }
.topbar-dropdown-divider { height: 1px; background: var(--gray-100, #f3f4f6); margin: 4px 6px; }
.topbar-dropdown-exit { color: #dc2626; }
.topbar-dropdown-exit > i:first-child { background: #fef2f2; color: #dc2626; }

@media (max-width: 768px) {
    .topbar { padding: 10px 14px; }
    .topbar-btn-label,
    .topbar-user-text { display: none; }
}
