.topbar {
    min-height: var(--erp-topbar);
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 1rem;
    padding: 0.65rem 1.75rem;
    background: var(--erp-topbar-bg);
    border-bottom: 1px solid var(--erp-border);
    box-shadow: var(--erp-shadow-sm);
    z-index: 1030;
    width: 100%;
    max-width: 100%;
    min-width: 0;
    transition: background-color 200ms ease, border-color 200ms ease;
}

.topbar-left,
.topbar-center,
.topbar-right {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    min-width: 0;
}

.topbar-left .topbar-toggle,
.topbar-theme,
#fullscreenToggle,
#notificationToggle {
    border-radius: 4px;
    background: var(--erp-surface-alt, #F8FAFC);
    border: 1px solid var(--erp-border, #E2E8F0);
    color: var(--erp-text-secondary, #64748B);
    transition: all var(--erp-transition, 0.15s ease);
}

.topbar-left .topbar-toggle:hover,
.topbar-theme:hover,
#fullscreenToggle:hover,
#notificationToggle:hover {
    color: var(--erp-primary, #071A2F);
    background: var(--erp-surface, #FFFFFF);
    border-color: var(--erp-secondary-accent, #00A6A6);
}

.topbar-center {
    flex: 1 1 auto;
    justify-content: center;
    min-width: 0;
}

.topbar-search {
    flex: 1 1 160px;
    max-width: 360px;
    min-width: 120px;
    position: relative;
}

.topbar-search i {
    position: absolute;
    left: 0.9rem;
    top: 50%;
    transform: translateY(-50%);
    color: var(--erp-muted, #64748B);
    font-size: 0.88rem;
    pointer-events: none;
}

.topbar-search .form-control {
    padding-left: 2.35rem;
    padding-right: 1rem;
    border-radius: 4px;
    background: var(--erp-surface-alt, #F8FAFC);
    border: 1px solid var(--erp-border, #E2E8F0);
    color: var(--erp-text, #172033);
    font-size: 0.88rem;
    min-height: 38px;
    font-family: 'Inter', sans-serif;
    transition: all var(--erp-transition, 0.15s ease);
}

.topbar-search .form-control::placeholder {
    color: var(--erp-muted, #64748B);
}

.topbar-search .form-control:focus {
    background: #FFFFFF;
    color: var(--erp-text, #172033);
    border-color: var(--erp-secondary-accent, #00A6A6);
    box-shadow: 0 0 0 2px rgba(0, 166, 166, 0.2);
}

.context-select {
    flex: 0 1 155px;
    max-width: 165px;
    min-width: 100px;
    min-height: 38px;
    font-size: 0.84rem;
    font-weight: 500;
    border-radius: 4px;
    background-color: var(--erp-surface-alt, #F8FAFC);
    border: 1px solid var(--erp-border, #E2E8F0);
    color: var(--erp-text, #172033);
    font-family: 'Inter', sans-serif;
}

.context-select:focus {
    background-color: #FFFFFF;
    color: var(--erp-text, #172033);
    border-color: var(--erp-secondary-accent, #00A6A6);
    box-shadow: 0 0 0 2px rgba(0, 166, 166, 0.2);
}

.notification-dot {
    position: absolute;
    right: 7px;
    top: 7px;
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background: var(--erp-danger, #DC2626);
    box-shadow: 0 0 0 2px var(--erp-topbar-bg, #FFFFFF);
}

.badge-counter {
    position: absolute;
    top: -4px;
    right: -4px;
    font-size: 0.65rem;
    padding: 0.2rem 0.4rem;
    border-radius: 4px;
    border: 2px solid var(--erp-topbar-bg, #FFFFFF);
}

.notification-menu {
    width: min(380px, 94vw);
    border: 1px solid var(--erp-border, #E2E8F0);
    border-radius: 6px;
    background: var(--erp-card, #FFFFFF);
    box-shadow: var(--erp-shadow-lg, 0 12px 32px rgba(7, 26, 47, 0.15));
    overflow: hidden;
    margin-top: 0.5rem;
}

.notification-header {
    padding: 0.85rem 1rem;
    font-weight: 700;
    font-size: 0.9rem;
    color: var(--erp-text);
    border-bottom: 1px solid var(--erp-border);
    background: var(--erp-surface-2);
}

.notification-header a {
    color: var(--erp-primary);
}

.notification-item {
    display: flex;
    gap: 0.75rem;
    padding: 0.85rem 1rem;
    border-top: 1px solid var(--erp-border-subtle);
    cursor: pointer;
    transition: background var(--erp-transition);
}

.notification-item:hover {
    background: var(--erp-surface-2);
}

.notification-item.unread {
    background: var(--erp-primary-subtle);
}

.notification-icon {
    width: 36px;
    height: 36px;
    border-radius: 8px;
    display: grid;
    place-items: center;
    flex: 0 0 auto;
    font-size: 0.9rem;
}

.notification-item strong {
    display: block;
    color: var(--erp-text);
    font-size: 0.84rem;
    line-height: 1.3;
}

.notification-item p {
    color: var(--erp-text-secondary);
    font-size: 0.8rem;
    margin: 0.15rem 0;
    line-height: 1.3;
}

.notification-item small {
    color: var(--erp-muted);
    font-size: 0.74rem;
}

.notification-footer {
    padding: 0.65rem;
    border-top: 1px solid var(--erp-border);
    background: var(--erp-surface-2);
}

.profile-btn {
    display: flex;
    align-items: center;
    gap: 0.65rem;
    border: 1px solid var(--erp-border, #E2E8F0);
    background: var(--erp-surface-alt, #F8FAFC);
    border-radius: 4px;
    padding: 0.35rem 0.65rem 0.35rem 0.4rem;
    color: var(--erp-text, #172033);
    transition: all var(--erp-transition, 0.15s ease);
}

.profile-btn:hover,
.profile-btn[aria-expanded="true"] {
    background: var(--erp-surface-2, #F1F5F9);
    border-color: var(--erp-secondary-accent, #00A6A6);
}

.avatar-ring {
    width: 34px;
    height: 34px;
    border-radius: 4px;
    display: grid;
    place-items: center;
    background: linear-gradient(135deg, #071A2F, #123B5D);
    color: #00A6A6;
    font-weight: 800;
    font-size: 0.88rem;
    flex-shrink: 0;
}

.profile-copy {
    text-align: left;
    line-height: 1.2;
    font-family: 'Inter', sans-serif;
}

.profile-copy strong {
    display: block;
    font-size: 0.84rem;
    color: var(--erp-text, #172033);
    font-weight: 600;
}

.profile-copy small {
    display: block;
    font-size: 0.74rem;
    color: var(--erp-muted, #64748B);
}

.profile-btn i {
    color: var(--erp-muted, #64748B);
}

.profile-menu {
    border: 1px solid var(--erp-border, #E2E8F0);
    border-radius: 6px;
    background: var(--erp-card, #FFFFFF);
    box-shadow: var(--erp-shadow-lg, 0 12px 32px rgba(7, 26, 47, 0.15));
    min-width: 210px;
    margin-top: 0.5rem;
    padding: 0.4rem;
}

.profile-menu .dropdown-header {
    padding: 0.5rem 0.75rem;
    color: var(--erp-muted, #64748B);
    font-size: 0.78rem;
    border-bottom: 1px solid var(--erp-border-subtle, #F1F5F9);
    margin-bottom: 0.25rem;
    font-family: 'Inter', sans-serif;
}

.profile-menu .dropdown-header strong {
    color: var(--erp-text, #172033);
}

.profile-menu .dropdown-item {
    border-radius: 4px;
    padding: 0.48rem 0.75rem;
    font-size: 0.86rem;
    font-weight: 500;
    color: var(--erp-text-secondary, #64748B);
    font-family: 'Inter', sans-serif;
}

.profile-menu .dropdown-item:hover {
    background: var(--erp-surface-2, #F1F5F9);
    color: var(--erp-text, #172033);
}

.profile-menu .dropdown-item i {
    color: var(--erp-primary, #071A2F);
}

.profile-menu .dropdown-item.text-danger {
    color: var(--erp-danger, #DC2626) !important;
}

.profile-menu .dropdown-item.text-danger i {
    color: var(--erp-danger, #DC2626) !important;
}

.profile-menu .dropdown-item.text-danger:hover {
    background: var(--erp-danger-subtle, #FEE2E2);
    color: var(--erp-danger, #DC2626) !important;
}

.quick-action-btn {
    background: var(--erp-secondary-accent, #00A6A6) !important;
    color: #FFFFFF !important;
    font-weight: 600;
    border: none !important;
    border-radius: 4px !important;
    box-shadow: 0 2px 8px rgba(0, 166, 166, 0.3);
    transition: all var(--erp-transition, 0.15s ease);
}

.quick-action-btn:hover {
    background: #008E8E !important;
    box-shadow: 0 4px 14px rgba(0, 166, 166, 0.4);
    transform: translateY(-1px);
    color: #FFFFFF !important;
}