/* =====================================================
 * 03-topbar.css — App Header, Search Bar, User Profile
 * ===================================================== */

/* ── Topbar Shell ── */
.app-topbar {
    height: 80px;
    background: #ffffff;
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0 24px;
    flex-shrink: 0;
    border-bottom: 1px solid var(--border);
}

.topbar-left  { display: flex; align-items: center; gap: 16px; flex: 1; justify-content: flex-end; }
.topbar-right { display: flex; align-items: center; gap: 14px; }

.topbar-logo        { height: 40px; width: auto; }
.topbar-brand-name  { font-size: 1.4rem; font-weight: 800; color: var(--primary); letter-spacing: 0.5px; }



/* ── Search Box ── */
.topbar-search-box  { position: relative; width: auto; }

.topbar-search-icon {
    position: absolute;
    right: 14px;
    top: 50%;
    transform: translateY(-50%);
    color: var(--text-muted);
}

.topbar-search-input {
    width: 320px;
    height: var(--btn-height);
    padding: 0 48px 0 18px;
    border: 1.5px solid #e2e8f0;
    background: #f8fafc;
    font-size: 0.95rem;
    color: var(--text-dark);
    display: flex;
    align-items: center;
    transition: all 0.25s ease;
}
.topbar-search-input:focus {
    outline: none;
    background: #ffffff;
    border-color: var(--primary);
    box-shadow: 0 10px 25px rgba(142,113,240,0.15), 0 0 0 4px rgba(142,113,240,0.05);
    transform: translateY(-1px);
}

/* ── User Profile ── */
.topbar-user-profile {
    position: relative;
    cursor: pointer;
    flex-shrink: 0;
}
.topbar-profile-trigger {
    display: flex; align-items: center; gap: 10px;
    padding: 6px 10px; border-radius: var(--radius-sm);
    transition: background 0.2s ease-in-out; cursor: pointer;
}
.topbar-profile-trigger:hover { background: transparent; }

.user-avatar-img {
    width: var(--btn-height); height: var(--btn-height);
    border-radius: 0 !important;
    object-fit: cover;
    border: 1px solid var(--border);
    transition: transform 0.2s;
}
.topbar-user-profile:hover .user-avatar-img { transform: scale(1.05); }

.topbar-user-info   { display: flex; flex-direction: column; justify-content: center; }
.topbar-user-name   { font-size: 0.95rem; font-weight: 800; color: var(--text-dark); line-height: 1.2; }
.topbar-user-role   { font-size: 0.75rem; color: var(--text-muted); font-weight: 600; }
.topbar-user-chevron {
    font-size: 0.75rem; color: var(--text-muted);
    margin-right: 12px; transition: transform 0.2s;
}
.topbar-user-profile:hover .topbar-user-chevron { transform: translateY(2px); color: var(--primary); }

/* ── User Dropdown ── */
.user-dropdown {
    position: fixed;
    top: 80px;
    left: var(--margin-main);
    right: auto;
    background: #ffffff;
    border: 1px solid var(--border);
    border-top: 3px solid var(--primary);
    border-radius: 0 !important;
    box-shadow: 0 8px 24px rgba(0,0,0,0.10);
    min-width: 220px;
    display: flex;
    flex-direction: column;
    padding: 6px;
    opacity: 0;
    visibility: hidden;
    transform: translateY(-6px);
    transition: opacity 0.18s ease, transform 0.18s ease, visibility 0.18s;
    z-index: 200;
}
.user-dropdown.show { opacity: 1; visibility: visible; transform: translateY(0); }

.user-dropdown button {
    display: flex; align-items: center; gap: 10px;
    padding: 12px 14px; background: transparent; border: none;
    width: 100%; text-align: right; font-size: 0.95rem;
    font-weight: 600; color: var(--text-dark);
    border-radius: 0 !important; cursor: pointer; transition: background 0.2s;
}
.user-dropdown button i    { width: 20px; text-align: center; color: var(--text-muted); }
.user-dropdown button:hover { background: #f1f3f5; }
.user-dropdown .dropdown-logout-btn       { color: #e05252; }
.user-dropdown .dropdown-logout-btn i    { color: #e05252; }
.user-dropdown .dropdown-logout-btn:hover { background: #fff5f5; }

/* ── Contextual View Filters (in Header) ── */
.topbar-filter-wrapper {
    display: flex;
    align-items: center;
    gap: 8px;
    background: #f8fafc;
    border: 1.5px solid #e2e8f0;
    border-radius: var(--radius-sm);
    padding: 0 14px;
    height: var(--btn-height);
    transition: all 0.2s ease;
}
.topbar-filter-wrapper:hover {
    border-color: var(--primary-light);
    background: #ffffff;
}
.topbar-filter-wrapper i {
    color: var(--text-muted);
    font-size: 0.85rem;
}
.topbar-status-select {
    border: none;
    background: transparent;
    font-size: 0.9rem;
    font-weight: 700;
    color: var(--text-dark);
    font-family: inherit;
    outline: none;
    cursor: pointer;
    min-width: 140px;
}
